a786013819 Posted August 25, 2012 Report Share Posted August 25, 2012 I want to add "Airlines" into the aircraft form,and I could enter airlines for the aircraft when aircrafts are added/edited So I have edited admin/templates/ops_aircraftform.tpl , admin/modules/Operations/Operations.php and core/common/Operationsdata.class.php,I also insert a new field in the database,and the new field display on the form successfully,but it's still write "1" into database I added follow codes in the ops_aircraftform.tpl <dt>* Airlines</dt> <dd><input name="whos" type="text" value="<?php echo $aircraft->airlines; ?>" /></dd> here is the codes I added in the Operations.php $data = array( 'airlines'=>$this->post>airlines,//here 'icao'=>$this->post->icao, 'name'=>$this->post->name, 'fullname'=>$this->post->fullname, and the Operationsdata.class.php public static function addAircaft($data) { $data['airlines'] = DB::escape(strtoupper($data['whos'])); $data['icao'] = DB::escape(strtoupper($data['icao'])); ........... $sql = "INSERT INTO ".TABLE_PREFIX."aircraft (`airlines`, `icao`, `name`, `fullname`, `registration`, `downloadlink`, `imagelink`, `range`, `weight`, `cruise`, `maxpax`, `maxcargo`, `minrank`, `ranklevel`, `enabled`) VALUES ( '{$data['airlines']}','{$data['icao']}', '{$data['name']}', '{$data['fullname']}', '{$data['registration']}', '{$data['downloadlink']}', '{$data['imagelink']}', '{$data['range']}', '{$data['weight']}', '{$data['cruise']}', '{$data['maxpax']}', '{$data['maxcargo']}', {$data['minrank']}, {$rank_level}, {$data['enabled']})"; .......... The part of edit aircraft is omitted What should I do now? I am sorry for my poor English Thanks a lot Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted August 25, 2012 Moderators Report Share Posted August 25, 2012 Hey I noticed one error... $data['airlines'] = DB::escape(strtoupper($data['whos'])); Should this be... $data['airlines'] = DB::escape(strtoupper($data['airlines'])); That's what I'm seeing... Quote Link to comment Share on other sites More sharing options...
a786013819 Posted August 25, 2012 Author Report Share Posted August 25, 2012 Hey I noticed one error... $data['airlines'] = DB::escape(strtoupper($data['whos'])); Should this be... $data['airlines'] = DB::escape(strtoupper($data['airlines'])); That's what I'm seeing... Thanks,but the problem is not solved. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.