Hello All,
I hope you are fine . I am trying to create a new module for my virtual airline but i have stuck in something(i think very silly). More than three hours have passed but i can't find anything. For some reason it does not send the data to the database. Can you find the problem?
public function assign_checkride()
{
$this->set('pilots', AcademyData::get_pilots());
$this->set('exams', AcademyData::get_exams());
$this->render('academy/checkride_assign.tpl');
}
public function checkride_theory_assign()
{
$ret = AcademyData::theory_checkride_assign($this->post->examid, $this->post->pilotid, $this->post->by, $this->post->at);
$this->set('message', 'Added');
$this->render('core_success.tpl');
}
public function theory_checkride_assign($examid, $pilotid, $by, $at) {
$examid = DB::escape($examid);
$pilotid = DB::escape($pilotid);
$by = DB::escape($by);
$at = DB::escape($at);
$sql="INSERT INTO phpvms_fssexams_available
(id, examid, pilotid, by, at)
VALUES ('', '$examid', '$pilotid', '$by', '$at')";
DB::query($sql);
}
<h3>Assign Theory Checkride to a Trainee</h3>
<center><form id="form" action="<?php echo adminaction('/academy/checkride_theory_assign/'); ?>" method="post">
<table width="60%" border="0">
<tr>
<td>Trainee:</td>
<td><select name="pilotid">
<?php
foreach($pilots as $plt)
{ ?>
<option value="<?php echo $plt->pilotid; ?>"><?php echo $plt->lastname; ?></option> <?php } ?>
</select></td>
</tr>
<tr>
<td>Checkride Type:</td>
<td><select name="examid">
<?php
foreach($exams as $exm)
{ ?>
<option value="<?php echo $exm->id; ?>"><?php echo $exm->exam_description; ?></option> <?php } ?>
</select></td>
</tr>
<tr>
<td colspan="2"><center><input type="submit" name="submit" value="Submit This Material" /></center></td>
</tr>
</table>
</form></center>
<br />
Another eye is always helpful .