Jump to content

Recommended Posts

Posted

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

  • Moderators
Posted

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...

Posted
  On 8/25/2012 at 7:40 AM, Kyle (Vansers) said:

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.

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.

×
×
  • Create New...