Jump to content

Add a field into aircraft form


a786013819

Recommended Posts

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...