Exemplo n.º 1
0
<style type="text/css">
    table tbody td{ white-space: nowrap;}
    table thead th{ white-space: nowrap;}
</style>
<?php 
use yii\helpers\Url;
$config = new app\models\Config_system();
$order = new app\models\OrdersTransportAffiliated();
$assign = new \app\models\AssignAffiliated();
$changwat = new \app\models\Changwat();
function get_customer($cus_id = null)
{
    $customer = new app\models\Customer();
    $cs = $customer->find()->where(['cus_id' => $cus_id])->one();
    return $cs['company'];
}
?>

<table class="table table-bordered table-striped" id="history_affiliated">
    <thead>
        <tr>
            <th>#</th>
            <th>รหัสปฏิบัติงาน</th>
            <th>วันที่(ไป - กลับ)</th>
            <th>คนขับ</th>
            <th>สถานที่ส่ง</th>
            <th>เส้นทาง</th>
            <th>ค่าขนสินค้า</th>
        </tr>
    </thead>
    <tbody>
 public function actionReceipt($id = null)
 {
     $order_id = OrdersTransportAffiliated::find()->where(['id' => $id])->one()['order_id'];
     $assign_model = new \app\models\AssignAffiliated();
     //$outgoings_model = new \app\models\Outgoings();
     //$expenses_model = new \app\models\ExpensesTruck();
     //$outgoings = $outgoings_model->find()->where(['order_id' => $order_id])->all();
     //$expenses = $expenses_model->find()->where(['order_id' => $order_id])->all();
     $assign = $assign_model->find()->where(['order_id' => $order_id])->all();
     $model = $this->findModel($id);
     $page = $this->renderPartial('_receipt', ['model' => $model, 'assigns' => $assign]);
     $mpdf = new \mPDF('th', 'A4-P', '0', 'THSaraban');
     $mpdf->WriteHTML($page);
     $mpdf->SetDisplayMode('fullpage');
     $mpdf->Output($order_id . ".pdf", "I");
 }