コード例 #1
1
 function user_challan_listname($challan_id)
 {
     if (!empty($challan_id) && $challan_id != '') {
         $criteria = new CDbCriteria();
         $criteria->condition = "id = " . $challan_id;
         $challan = Challan::model()->find()->findByPk($challan_id);
         //$list=OffenceList::model()->findAllByAttributes(array("id"=>array("(".$challan->offence_ids.")")));
         $criteria = new CDbCriteria();
         $html = "";
         if (!empty($challan->offence_ids)) {
             $criteria->condition = "id IN (" . $challan->offence_ids . ")";
             $list = CHtml::ListData(OffenceList::model()->findAll($criteria), "id", "name");
         } else {
             return "";
         }
         foreach ($list as $k => $v) {
             $html .= " >> {$v} ";
         }
         return "{$html}";
     } else {
         return "";
     }
 }
コード例 #2
1
 public function actionMarkpaid()
 {
     if (!empty($_REQUEST['id']) && !empty($_REQUEST['rupee'])) {
         $dispatch = Dispatch::model()->findByPk($_REQUEST['id']);
         $dispatch->status = "Paid";
         $dispatch->status_id = 4;
         if ($dispatch->save()) {
             $payment = new Payment();
             $payment->dispatch_id = $_REQUEST['id'];
             $payment->rupee = $_REQUEST['rupee'];
             $payment->court_id = $dispatch->court_id;
             $payment->user_id = Yii::app()->user->id;
             $payment->court_id = $dispatch->court_id;
             $payment->challan_id = $dispatch->challan_id;
             $payment->created = date("Y-m-d H:i:s", time());
             $payment->paid_at = "Court";
             if ($payment->save()) {
                 $challan = Challan::model()->findByPk($dispatch->challan_id);
                 $challan->status_id = 4;
                 $challan->save();
                 echo "1";
             }
         } else {
             echo "0";
         }
     } else {
         echo "-1";
     }
     exit;
 }
コード例 #3
0
 public function actionLoadHistory()
 {
     //print_r($_REQUEST);exit;
     $model = new Challan();
     if (!empty($_REQUEST['reg'])) {
         $criteria = new CDbCriteria();
         $criteria->select = '*';
         $criteria->condition = "vehicle_reg_no = '" . $_REQUEST['reg'] . "'";
         $data = Challan::model()->findAll($criteria);
     }
     print json_encode((array) $data);
     Yii::app()->end();
 }
コード例 #4
0
 public function actionGetword()
 {
     $model = new Challan('search');
     if (isset($_GET['Challan'])) {
         $model->attributes = $_GET['Challan'];
     }
     $data = Challan::model()->findAll();
     header("Content-type: application/vnd.ms-word");
     header("Content-Disposition: attachment;Filename=document_name.doc");
     echo "<html>";
     echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=Windows-1252\">";
     echo "<body>";
     echo "<table border='1' width='100%'>";
     if (!empty($_GET['Challan']['fields'])) {
         $fld = $_GET['Challan']['fields'];
     } else {
         $fld = array('challan_number', 'challan_form_number', 'name_person', 'date_fixed', 'vehicle_reg_no', 'scene_of_offence', 'Place of Offence', 'date_time_offence', 'mobile', 'apperance_date', 'fine_amount');
     }
     echo "<tr>";
     foreach ($fld as $d => $v) {
         echo "<th>" . $model->getAttributeLabel($v) . "</th>";
     }
     echo "</tr>";
     foreach ($data as $l => $v) {
         echo "<tr>";
         foreach ((array) $v as $j => $m) {
             foreach ($fld as $d => $val) {
                 if ($val == $j) {
                     echo "<td>{$m}</td>";
                 }
             }
         }
         echo "</tr>";
     }
     echo "</table>";
     echo "</body>";
     echo "</html>";
 }
コード例 #5
0
ファイル: dispatchReport.php プロジェクト: harpreet39/challan
<table class="items table" style="padding:20px;">
    <thead>
        <tr>            
            <th>Book No.</th>        
            <th>Form No.</th>        
            <th>Challan Date</th>        
            <th>DL No.</th>        
            <th>Violator Name</th>        
            <th>Court</th>
        </tr>
    </thead>
    <tbody>     
        <?php 
if (!empty($failed)) {
    foreach ($failed as $d => $v) {
        $challan = Challan::model()->with('placeOfOffence')->findByPk($v);
        ?>
         
            <tr class="" style="cursor:pointer;">                
                <td><?php 
        echo $challan->challan_number;
        ?>
</td>
                <td><?php 
        echo $challan->challan_form_number;
        ?>
</td>
                <td><?php 
        echo $challan->date_time_offence;
        ?>
</td>
コード例 #6
0
 public function actionDispatchForm()
 {
     $challan = Challan::model()->findByPk($_GET['id']);
     $this->layout = "plain";
     return $this->render("dispatchForm", array('challan' => $challan));
 }
コード例 #7
-1
ファイル: Challan.php プロジェクト: harpreet39/challan
 function user_docs_confname($challan_id)
 {
     if (!empty($challan_id) && $challan_id != '') {
         $criteria = new CDbCriteria();
         $criteria->condition = "id = " . $challan_id;
         $challan = Challan::model()->find()->findByPk($challan_id);
         $criteria = new CDbCriteria();
         $criteria->condition = "id IN (" . $this->document_impounded . ")";
         $list = CHtml::ListData(DocumentsList::model()->findAll($criteria), "id", "name");
         return $list;
     } else {
         return array();
     }
 }