Example #1
0
 public function getInfo()
 {
     function boolToText($value)
     {
         if ($value) {
             return 'Yes';
         } else {
             return 'No';
         }
     }
     $this->load->model('drop_downhandler_model');
     $make = $this->input->get('id', true);
     $model = $this->input->get('model', true);
     $variant = $this->input->get('variant', true);
     //echo "controller make-".$make ;
     $Data['bikeid'] = $this->drop_downhandler_model->getBikeid($make, $model, $variant);
     foreach ($Data['bikeid'] as $row) {
         $modelID = $row->modelID;
         $Data['bikedetails'] = $this->drop_downhandler_model->getBikeDetails($modelID);
     }
     $output = null;
     echo "<table style='width:30%'><tr style='background-color: gray;'> <th>select </th><th>cc </th><th>AnalogMeter </th><th>DigitalMeter </th><th>Tachometer</th><th>DTSi</th><th>Kick Start</th> <th>Self Start</th> <th>Wheel Type</th> <th>Rear Brake</th><th>Front Brake</th><th>ABS</th><th>Digital Meter</th><th>Manufactured Year</th><th>Discontinued Year</th><th>Color</th></tr>";
     foreach ($Data['bikedetails'] as $row) {
         $bike_id = $row->bikeID;
         $color = $row->colour;
         $color = explode(",", $color);
         $color = array_unique($color);
         $color = implode(",", $color);
         $text = "";
         if (isset($bikeId)) {
             if ($bike_id == $bikeId) {
                 echo "<input type='radio' id='bikeId' name='bikeId' value={$bike_id} onclick='this.form.submit()' checked>";
             } else {
                 echo "<input type='radio' id='bikeId' name='bikeId' onclick='this.form.submit()' value={$bike_id} >";
             }
         } else {
             echo "<td><input type='radio' name='bikeId' id='bikeId' value={$bike_id} >";
         }
         echo "</td> <td>{$row->cc}</td><td>" . boolToText($row->analogMeter) . "</td><td>" . boolToText($row->digitalMeter) . "</td><td>" . boolToText($row->tachometer) . "</td><td>" . boolToText($row->dtsi) . "</td><td>" . boolToText($row->kickStart) . "</td> <td>" . boolToText($row->selfStart) . "</td> <td>{$row->wheelType}</td> <td>{$row->rearBrakeType}</td><td>" . $row->frontBrakeType . "</td><td>" . boolToText($row->abs) . "</td><td>" . boolToText($row->digitalMeter) . "</td><td>{$row->mfgYear}</td><td>{$row->discontinuationYear}</td><td>{$color}</td></tr>";
     }
     echo "</table>";
     echo $output;
 }
Example #2
0
 function dealer_search()
 {
     function boolToText($value)
     {
         if ($value) {
             return 'Yes';
         } else {
             return 'No';
         }
     }
     $this->load->model("data_collection_model");
     $dealer = $this->input->get('dealerID', true);
     $Data['yearlist'] = $this->data_collection_model->GetYear();
     $Data['distDealer'] = $this->data_collection_model->GetDistDealer($dealer);
     $output = null;
     $years_array = array();
     $output .= "<table style='width:100%'><tr><td rowspan='2'><b>Make-Model-Variant</b></td><th colspan='15'>Specs</th>";
     foreach ($Data['yearlist'] as $row1) {
         //array_push($years_array,$row1->year);
         $output .= "<td rowspan='2'><b>{$row1->year}</b></td>";
     }
     $output .= "</tr>";
     $output .= "<tr><th>cc </th><th>AnalogMeter </th><th>DigitalMeter </th><th>Tachometer</th><th>DTSi</th><th>Kick Start</th> <th>Self Start</th> <th>Wheel Type</th> <th>Rear Brake</th><th>Front Brake</th><th>ABS</th><th>Digital Meter</th><th>Manufactured Year</th><th>Discontinued Year</th><th>Color</th></tr>";
     foreach ($Data['distDealer'] as $row2) {
         $mmvlists = $this->data_collection_model->getBikeDetailsfromModelId($row2->modelId);
         foreach ($mmvlists as $mmvlist) {
             $make_model_variant = $mmvlist->make . "-" . $mmvlist->model . "-" . $mmvlist->variant;
         }
         $distbikeID = $this->data_collection_model->getBikeIdfromDealMid($dealer, $row2->modelId);
         $output .= "<tr>";
         $output .= "<th rowspan=''>{$make_model_variant}</th>";
         foreach ($distbikeID as $row3) {
             $Data['results'] = $this->data_collection_model->getBikeDetailsfromBikeId($row3->bikeId);
             foreach ($Data['results'] as $result) {
                 $output .= "<td >{$result->cc}</td><td>" . boolToText($result->analogMeter) . "</td><td>" . boolToText($result->digitalMeter) . "</td><td>" . boolToText($result->tachometer) . "</td><td>" . boolToText($result->dtsi) . "</td><td>" . boolToText($result->kickStart) . "</td> <td>" . boolToText($result->selfStart) . "</td> <td>{$result->wheelType}</td> <td>{$result->rearBrakeType}</td><td>{$result->frontBrakeType}</td><td>" . boolToText($result->abs) . "</td><td>" . boolToText($result->digitalMeter) . "</td><td>{$result->mfgYear}</td><td>{$result->discontinuationYear}</td><td>{$result->colour}</td>";
                 foreach ($Data['yearlist'] as $row1) {
                     $Data['min_max'] = $this->data_collection_model->getMinMaxPrices($row3->bikeId, $dealer, $row1->year);
                     foreach ($Data['min_max'] as $min_max) {
                         $output .= "<td>{$min_max}</td>";
                     }
                     //$output .= "</tr><tr>";
                 }
             }
         }
     }
     echo $output;
 }