Jump to content

LeonardIGO4036

Members
  • Posts

    116
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by LeonardIGO4036

  1. Here's how the form Looks : <form action="<?php echo url('/Profile');?>" method="post" class="form-horizontal form-bordered"> <div class="form-group"> <label class="col-xs-3 control-label" for="material-text2">First Name</label> <div class="col-xs-9"> <input class="form-control" type="text" id="material-text2" name="material-text2" placeholder="<?php echo $pilot->firstname;?>" /disabled> </div> </div> <div class="form-group"> <label class="col-xs-3 control-label" for="material-text2">Last Name</label> <div class="col-xs-9"> <input class="form-control" type="text" id="material-text2" name="material-text2" placeholder="<?php echo $pilot->lastname;?>" /disabled> <span class="text-muted"><small>You cannot change your Name. If you need to change name, open a <a href="<?php echo SITE_URL?>/index.php/helpdesk">support ticket</a>.</small></span> </div> </div> <div class="form-group"> <label class="col-xs-3 control-label" for="material-text2">Hub</label> <div class="col-xs-9"> <input class="form-control" type="text" id="material-text2" name="material-text2" placeholder="<?php echo $pilot->hub;?>" /disabled> <span class="text-muted"><small>To change your Operating Hub, you need to open a ticket at <a href="<?php echo SITE_URL?>/index.php/hubtransfer">Hub Transfer </a>system.</small></span> </div> </div> <div class="form-group"> <label class="col-xs-3 control-label" for="email">Email</label> <div class="col-xs-9"> <input class="form-control" type="text" id="email" name="email" value="<?php echo $pilot->email;?>" placeholder="johndoe@example.com"> <span class="text-muted"><small>All e-mails regarding Flight operations and Human resources will be sent to this email ID.</small></span> </div> </div> <div class="form-group"> <label class="col-xs-3 control-label" for="livestream">Live Stream ID</label> <div class="col-xs-9"> <input type="livestream" name="livestream" class="form-control" value="<?php echo $pilot->livestream;?>" placeholder="Twitch"> <span class="text-muted"><small>Enter your Twitch User ID, *NOT* the URL</small></span> </div> </div> <div class="form-group"> <label class="col-xs-3 control-label" for="location">Country</label> <div class="col-xs-9"> <select class="form-control select-chosen" id="location" name="location" style="width: 100%;" data-placeholder="Choose one.."> <?php foreach($countries as $countryCode=>$countryName) { if($pilot->location == $countryCode) $sel = 'selected="selected"'; else $sel = ''; echo '<option value="'.$countryCode.'" '.$sel.'>'.$countryName.'</option>'; } ?> </select> </div> </div> <div class="form-group form-actions"> <div class="col-xs-9 col-xs-offset-3"> <input type="hidden" name="action" value="saveprofile" /> <input class="btn btn-sm btn-primary" type="submit" name="submit" value="Save Changes" /> </div> </div> </form> Here's how the Module Looks : P.s Since my site is on maintenance now, i've made it to work only for the Admins. <?php class Profile extends CodonModule { /** * Profile::index() * * @return */ public function index() { //remove after migration if(PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN)) { if(!Auth::LoggedIn()) { $this->render('login_form.php'); // return; } else { $this->render('profile_main.php'); // } } if(!Auth::LoggedIn()) { $this->render('Maintenance/index.php'); // login_form.php return; } /* * This is from /profile/editprofile */ if(isset($this->post->action)) { if($this->post->action == 'saveprofile') { $this->save_profile_post(); } /* this comes from /profile/changepassword */ if($this->post->action == 'changepassword') { $this->change_password_post(); } } $pilot = PilotData::getPilotData(Auth::$pilot->pilotid); if(Config::Get('TRANSFER_HOURS_IN_RANKS') == true) { $totalhours = $pilot->totalhours + $pilot->transferhours; } else { $totalhours = $pilot->totalhours; } $this->set('pilotcode', PilotData::getPilotCode($pilot->code, $pilot->pilotid)); $this->set('report', PIREPData::getLastReports($pilot->pilotid)); $this->set('nextrank', RanksData::getNextRank($totalhours)); $this->set('allawards', AwardsData::getPilotAwards($pilot->pilotid)); $this->set('userinfo', $pilot); $this->set('pilot', $pilot); $this->set('pilot_hours', $totalhours); $this->render('Maintenance/index.php'); // profile_main.php // CodonEvent::Dispatch('profile_viewed', 'Profile'); } public function viewbids() { if ($this->post->action == 'deletebid') { $ret = SchedulesData::RemoveBid($this->post->id); $params = array(); if ($ret == true) { $params['status'] = 'ok'; } else { $params['status'] = 'There was an error'; $params['message'] = DB::error(); } echo json_encode($params); return; } $this->set('allbids', SchedulesData::getAllBids()); $this->render('pilots_viewallbids.php'); } /** * This is the public profile for the pilot */ /** * Profile::view() * * @param string $pilotid * @return */ public function view($pilotid='') { #replacement for OFC charts - Google Charts API - simpilot $this->set('chart_url', ChartsData::build_pireptable(PilotData::parsePilotID($pilotid), 30)); #end $pilotid = PilotData::parsePilotID($pilotid); $pilot = PilotData::getPilotData($pilotid); $this->title = 'Profile of '.$pilot->firstname.' '.$pilot->lastname; $this->set('userinfo', $pilot); $this->set('pilot', $pilot); $this->set('allfields', PilotData::getFieldData($pilotid, false)); $pirep_list = PIREPData::getAllReportsForPilot($pilotid); $this->set('pireps', $pirep_list); $this->set('pirep_list', $pirep_list); $this->set('pilotcode', PilotData::getPilotCode($pilot->code, $pilot->pilotid)); $this->set('allawards', AwardsData::getPilotAwards($pilot->pilotid)); $this->render('pilot_public_profile.php'); } /** * Profile::stats() * * @return */ public function stats() { if(!Auth::LoggedIn()) { $this->set('message', 'Oops, You must be logged in to access this feature!'); $this->render('core_error.php'); return; } $this->set('pilot', Auth::$pilot); $this->render('profile_stats.php'); } /** * Profile::badge() * * @return */ public function badge() { $this->set('badge_url', fileurl(SIGNATURE_PATH.'/'.PilotData::GetPilotCode(Auth::$pilot->code, Auth::$pilot->pilotid).'.png')); $this->set('pilotcode', PilotData::getPilotCode(Auth::$pilot->code, Auth::$pilot->pilotid)); $this->render('profile_badge.php'); } /** * Profile::editprofile() * * @return */ public function editprofile() { if(!Auth::LoggedIn()) { $this->set('message', 'You must be logged in to access this feature!'); $this->render('core_error.php'); return; } $this->set('userinfo', Auth::$pilot); $this->set('pilot', Auth::$pilot); $this->set('customfields', PilotData::getFieldData(Auth::$pilotid, true)); $this->set('bgimages', PilotData::getBackgroundImages()); $this->set('countries', Countries::getAllCountries()); $this->set('pilotcode', PilotData::getPilotCode(Auth::$pilot->code, Auth::$pilot->pilotid)); $this->render('profile_edit.php'); } /** * Profile::changepassword() * * @return */ public function changepassword() { if(!Auth::LoggedIn()) { $this->set('message', 'You must be logged in to access this feature!'); $this->render('core_error.php'); return; } $this->render('profile_changepassword.php'); } /** * Profile::save_profile_post() * * @return */ protected function save_profile_post() { $pilot = Auth::$pilot; //TODO: check email validity if($this->post->email == '') { $this->set('message', 'The email address cannot be blank.'); $this->render('core_error.php'); return; } $fields = RegistrationData::getCustomFields(); if(count($fields) > 0) { foreach ($fields as $field) { $value = Vars::POST($field->fieldname); $value1 = DB::escape($value); if ($field->required == 1 && $value1 == '') { $this->set('message', ''.$field->title.' cannot be blank!'); $this->render('core_error.php'); return; } } } $params = array( 'code' => $pilot->code, 'email' => $this->post->email, 'location' => $this->post->location, 'avatar' => $this->post->avatar, 'hub' => $pilot->hub, 'bgimage' => $this->post->bgimage, 'retired' => false ); PilotData::updateProfile($pilot->pilotid, $params); PilotData::SaveFields($pilot->pilotid, $_POST); # Generate a fresh signature PilotData::GenerateSignature($pilot->pilotid); PilotData::SaveAvatar($pilot->code, $pilot->pilotid, $_FILES); $this->set('message', 'Profile Saved!'); $this->render('core_success.php'); } /** * Profile::change_password_post() * * @return */ protected function change_password_post() { if(!Auth::LoggedIn()) { $this->set('message', 'You must be logged in to access this feature!'); $this->render('core_error.php'); return; } // Verify if($this->post->oldpassword == '') { $this->set('message', 'You must enter your current password'); $this->render('core_error.php'); return; } if($this->post->password1 != $this->post->password2) { $this->set('message', 'Your passwords do not match'); $this->render('core_error.php'); return; } // Change $hash = md5($this->post->oldpassword . Auth::$pilot->salt); if($hash == Auth::$pilot->password) { RegistrationData::ChangePassword(Auth::$pilotid, $_POST['password1']); $this->set('message', 'Your password has been reset'); } else { $this->set('message', 'You entered an invalid password'); } $this->render('core_success.php'); } }
  2. It depends on what all features you would like to have. iCrew Center for IndiGo Virtual has all the premium modules. However, I can quote you a price just for skinning the existing the phpVMS. PM me for more details buddy.
  3. Hey. Even I have a similar error. I couldn't get phpVMS to save the data into the SQL Database. But it only happens with Profile_edit. In that too, the change_password works fine. It's only that the profile_edit is not working. Rest assured, all other stuff like adding new schedules, editing schedules, adding awards, editing awards etc are working perfectly. Check my other post once, it might help you.
  4. UPDATE : I noticed that i can add & edit the schedules, it's only the Pilot details that im unable to edit. define('DBASE_USER', 'iflyvaco_phpvms'); define('DBASE_PASS', 'xxxxx'); define('DBASE_NAME', 'iflyvaco_phpvms'); define('DBASE_SERVER', 'localhost'); define('DBASE_TYPE', 'mysqli'); define('TABLE_PREFIX', 'phpvms_'); define('SITE_URL', 'http://icrew.iflyva.in'); and also, this is what i have in the local.config.php. if anyone knows the solution, please let me know, my pilots are angry that they are not able to see their hours rising
  5. My Site is working Normally, URL is : icrew.iflyva.in, No its not a free hosting, and yes, phpVMS is running on v5.5 I tried clearing cache, it doesnt work. For now, im only able to make changes in the database via phpMyAdmin.
  6. Hello, iCrewCenter is now Owned and operated by iCrewSystems.in, and yes, I can help you make Skin for Jet Airways Virtual. Do check out the latest version of iCrew, iCrew v4, it releases this November!
  7. Hello, thanks for getting back. I am a novice in SQL and PhpVMS, so could you please direct me on how to do step 1 and 3? I've verified Step 2, it's perfect.
  8. I have noticed that phpVMS isn't quite writing anything into the MySQL database. For example, if there is a new pilot registration, the Admin Center does nothing when i press "Accept Pilot" Same for "Profile Edit", it doesn't show any errors, but neither it updates anything. The only way i do it is via the phpMyAdmin through the cPanel. This is kind of frustrating everytime, does anyone know how to fix this??
  9. Okay, thanks. I'll check it out EDIT : Browser says "Uploading", and once its done, it refreshes, and nothing happens... even checked the approval list. nothing there too
  10. Just Checked, its pics, its placed under Core. it had an "index.php" which was blank...
  11. Hi, wonderful addon, but when i try to implement it, I get this Error Warning: move_uploaded_file(pics/1501323385_2017-7-26_10-58-12-492.bmp): failed to open stream: No such file or directory in /home/iflyva/public_html/icrew/core/modules/Screenshots/Screenshots.php on line 75 Warning: move_uploaded_file(): Unable to move '/tmp/phpFhZe3o' to 'pics/1501323385_2017-7-26_10-58-12-492.bmp' in /home/iflyva/public_html/icrew/core/modules/Screenshots/Screenshots.php on line 75 I created a Folder called "Pics" in the Root folder, what else to do? Can anyone Help? Thanks in Advance
  12. Hey, i did a few things to get this working 1. In the Modules > Airports, i renamed the " airport_main.tpl " and "airport_info.tpl" into " airport_main.php " and "airport_info.php" 2. And for this error foreach($lastbids as $lastbid) Just change the "$lastbids" into "$lastbid" should look like this : foreach($lastbid as $lastbid) Regards, Leonard
  13. Hi im learning my way in phpVMS, hence excuse this question if this is stupid i tried to use this Snippet, but no joy, In phpVMS i have bids, and ive also inserted this code, now how do i access them? Give me an example This is how i intend to use the details <table class="table"> <thead> <h4><tr> <th>Pilot</th> <th>Aircraft</th> <th>Sector</th> </tr></h4> </thead> <tbody> <?php $bids = SchedulesData::getAllBids(); ?> <tr> <!-- I NEED TO GET THE DETAILS OF BIDS AND PASTE IT HERE--> <td>??????????????????</td> <td>??????????????????</td> <td>??????????????????</td> </tbody>
×
×
  • Create New...