public function actionLoad_report_month_select_car_round() { $year = \Yii::$app->request->post('year'); $month = \Yii::$app->request->post('month'); $car_id = \Yii::$app->request->post('car_id'); $Assign = new \app\models\Assign(); $result = $Assign->find()->where(['car_id' => $car_id, 'LEFT(order_date_start,4)' => $year, 'SUBSTR(order_date_start,6,2)' => $month])->orderBy('id')->all(); $report = new \app\models\MapTruck(); //$result = $report->get_price($car_id, $year, $month); $MapDriver = new \app\models\MapDriver(); $DriverModel = new \app\models\Driver(); $car = $report->find()->where(['car_id' => $car_id])->one(); //ข้อมูลรถ(มีทะเบียนไรบ้าง) $driv = $MapDriver->find()->where(['car_id' => $car_id])->one(); //คันนี้ใครขับ $driver = $DriverModel->find()->where(['driver_id' => $driv['driver']])->one(); //ดึงชื่อคนขับ return $this->renderPartial('load_report_month_select_car_round', ['result' => $result, 'car' => $car, 'driver' => $driver, 'year' => $year, 'month' => $month]); }
public function actionDetail_transport($assign_id = null) { $Assign_modail = new \app\models\Assign(); $assign = $Assign_modail->find()->where(['assign_id' => $assign_id])->one(); $page = $this->renderPartial('detail_transport', ['model' => $assign]); $mpdf = new \mPDF('th', 'A4-P', '0', 'THSaraban'); $mpdf->WriteHTML($page); $mpdf->SetDisplayMode('fullpage'); $mpdf->Output($assign['assign_id'] . ".pdf", "I"); }