[eluser]Unknown[/eluser]
Quote:
this is my controller.php
<?php
class search extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->helper('url');
}
public function index()
{
$this->load->model('Model_form');
$this->load->helper('form');
$data['countries'] = $this->Model_form->get_countries();
$data['bodies'] = $this->Model_form->get_bodies();
$data['query']=$this->Model_form->trksearch();
$this->Model_form->display();
$data['query1']=$this->Model_form->display();
$data['query2']=$this->Model_form->display();
$data['query']=$this->Model_form->display();
$data['base_url']=base_url();
$this->load->view('trksearch',$data);
} ?>
this iz my model.php
<?php
class Model_form extends CI_Model
{
function __construct()
{
// Call the Model constructor
parent::__construct();
$this->load->database();
}
public function display()
{
$make = $this->input->post('mkno');
$model = $this->input->post('modno');
$this->db->select('mkcmpny');
$this->db->where('mkno',$make);
$query1=$this->db->get('mktruck');
return $query1->result();
$model = $this->input->post('modno');
$this->db->select('modnm');
$this->db->where('modno',$model);
$query2=$this->db->get('mkmodel');
return $query2->result();
$this->db->select('id,km,rgat,bdty,eprc,desr');
$this->db->where('mk',$make);
$this->db->where('md',$model);
$query=$this->db->get('tbl_sel');
return $query->result();
}
} ?>
this is my view.php
<div id="trucksearch">
<?php
foreach($query1 as $rows)
{
$truck=$rows->mkcmpny;
}
foreach ($query2 as $rows)
{ $model=$rows->modnm;}
foreach ($query as $rows)
{
$id=$rows->id;
$km =$rows->km;
$rgat=$rows->rgat;
$bdty=$rows->bdty;
$eprc=$rows->eprc;
$descr=$rows->desr;
?>
<br/>
<table width="720" border="2" bordercolor="#999999" align="center">
<tr><td valign="Left" width="200" bgcolor="#E8E8E8" class="table_text1"><p align="left">
<strong>Make And Model :</strong></p></td>
<td valign="Left" width="520" bgcolor="#E8E8E8" class="table_text1"><p align="left">a href="viewsaletrk.php?msg=<?php echo $id; ?>"><?php echo $make;?> <?php echo $model ;?></a></p></td><tr/>
<tr><td valign="bottom" width="200" bgcolor="#E8E8E8" class="table_text1"><p align="left">strong>KM Run:</strong></td>
<td valign="Left" width="520" bgcolor="#E8E8E8" class="table_text1"><p align="left"><?php echo $km ;?></p></td></tr>
<tr><td valign="bottom" width="200" bgcolor="#E8E8E8" class="table_text1"><p align="left">strong>Body Type:</strong></td>
<td valign="Left" width="520" bgcolor="#E8E8E8" class="table_text1"><p align="left">p align="left" style="color:#0d4c7d"><?php echo $bdty;?></p></td></tr>
<tr><td valign="bottom" width="200" bgcolor="#E8E8E8" class="table_text1"><p align="left">strong>City:</strong></td>
<td valign="Left" width="520" bgcolor="#E8E8E8" class="table_text1"><p align="left">p align="left" style="color:#0d4c7d"><?php echo $rgat;?></p></td></tr>
<tr><td valign="bottom" width="200" bgcolor="#E8E8E8" class="table_text1"><p align="left">strong>Expected Price:</strong></td>
<td valign="Left" width="520" bgcolor="#E8E8E8" class="table_text1"><p align="left">p align="left" style="color:#0d4c7d"><?php echo $eprc;?></p></td></tr>
<tr><td valign="bottom" width="200" bgcolor="#E8E8E8" class="table_text1"><p align="left">strong>Description:</strong></td>
<td valign="bottom" width="520" bgcolor="#E8E8E8" height="25" class="table_text1"><p align="left"><?php echo $descr;?></p></td></tr>
<tr ><td><p align="left"> </p></td></tr>
<?php
}
?>
<!--</tr> -->
</table>
</div>