</td> <td><?php echo $rs['car_id']; ?> </td> <td> <?php echo $rs['assign_id']; ?> <a href="<?php echo Url::to(['order-transport/incom_outcome', 'id' => $rs['assign_id']]); ?> " target="_blank"><i class="fa fa-eye"></i></a> </td> <td><?php echo $config->thaidate($rs['order_date_start']) . ' - ' . $config->thaidate($rs['order_date_end']); ?> </td> <td><?php echo get_driver($rs['driver1']) . ' ' . get_driver($rs['driver2']); ?> </td> <td><?php echo $customer->find()->where(['cus_id' => $rs['employer']])->one()['company']; ?> </td> <td style=" text-align: right;"><?php echo number_format((int) $rs['income'], 2); ?> </td> </tr>
// echo $this->render('_search', ['model' => $searchModel]); ?> <p> <?php echo Html::a('<i class="fa fa-plus"></i> สร้างใบปฏิบัติงาน', ['create'], ['class' => 'btn btn-primary']); ?> </p> <?php $columns = [['class' => 'yii\\grid\\SerialColumn'], 'order_id', ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'order_date_start', 'label' => 'วันที่ไป', 'hAlign' => 'center', 'width' => '10%', 'format' => 'raw', 'mergeHeader' => true, 'value' => function ($model) { $config = new \app\models\Config_system(); return $config->thaidate($model->order_date_start); }], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'order_date_end', 'label' => 'วันที่กลับ', 'hAlign' => 'center', 'width' => '10%', 'format' => 'raw', 'mergeHeader' => true, 'value' => function ($model) { $config = new \app\models\Config_system(); return $config->thaidate($model->order_date_end); }], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'truck1', 'label' => 'ทะเบียนรถ', 'mergeHeader' => true, 'value' => function ($model) { $truck = new app\models\AffiliatedTruck(); $tr = $truck->find()->where(['id' => $model->truck1])->one(); return $tr['license_plate']; }], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'truck2', 'label' => 'ทะเบียน(พ่วง)', 'mergeHeader' => true, 'value' => function ($model) { $truck = new app\models\AffiliatedTruck(); $tr = $truck->find()->where(['id' => $model->truck2])->one(); return $tr['license_plate']; }], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'driver1', 'label' => 'คนขับ1', 'mergeHeader' => true], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'driver2', 'label' => 'คนขับ2', 'mergeHeader' => true], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'flag', 'label' => 'สถานะ', 'format' => 'raw', 'mergeHeader' => true, 'value' => function ($model) { if ($model->flag == 1) { $status = "<font style='color:green;'>จ่ายเงินแล้ว</font>"; } else { $status = "<font style='color:red;'>ค้างจ่าย</font>"; } return $status;
<b>ที่อยู่ : </b> <?php echo $employer['address']; ?> </td> <td colspan="2" valign='top'> <b>เลขที่ Invoice No.:</b> <div id="line">.</div> <b>วันที่ Invoice Date :</b> </td> <td valign='top' style=" text-align: right;"> <?php echo $model->assign_id; ?> <div id="line">.</div> <?php echo $config->thaidate($model->order_date_start); ?> </td> </tr> <thead> <tr> <th style=" text-align: center; width: 5%;">#</th> <th style="text-align:center; width: 65%;">รายการ</th> <th style=" text-align: center; width: 10%;">จำนวน</th> <th style="text-align:center; width: 10%;">หน่วยละ</th> <th style="text-align:center; width: 15%;">จำนวนเงินสุทธิ(บาท)</th> </tr> </thead> <tbody> <tr> <td style="text-align: center;" valign="top">1</td>
</div> </div> <div class="row"> <h3><?php echo "ห้างหุ้นส่วนจํากัด ตงตง ทรานสปอร์ต"; ?> </h3> <div class="col-sm-6 col-md-3 col-lg-3"><label>ใบบฏิบัติงาน</label> <label class="label label-success"><?php echo $model->order_id; ?> </label></div> <div class="col-sm-6 col-md-3 col-lg-3"> <label>วันที่ไป</label> <label class="label label-success"> <?php echo $config->thaidate($model->order_date_start); ?> </label> <label>วันที่กลับ</label> <label class="label label-success"> <?php echo $config->thaidate($model->order_date_end); ?> </label> </div> <div class="col-sm-6 col-md-3 col-lg-3"> <?php echo "<label>ทะเบียนรถ </label>"; $rs = $truck_model->find()->where(['id' => $model->truck1])->one(); echo '<label class="label label-success">' . $rs['license_plate'] . '</label>';
<div style="width:49%; float: right; border-left: #000000 solid 1px;"> <div style=" text-align: left; float: left; width: 50%; border-right: #000 solid 1px; padding-left: 5px;"> <b>เลขที่ Invoice No.:</b><br/> <b>วันที่ Invoice Date :</b> </div> <div style=" text-align: center; float: left; width: 46%;"> <?php $year = substr(date('Y'), 2, 2); $month = date("m"); $day = date("d"); $time = date("s"); echo date("Y-m-d H:i:s"); ?> <br/> <?php echo $config->thaidate(date("Y-m-d")); ?> </div> <div style="text-align: left; width: 100%; border-top: #000 solid 1px; padding: 5px;"> <?php echo $account['bank_name']; ?> สาขา <?php echo $account['brance']; ?> <br/> บัญชีเลขที่ <?php echo $account['account_number']; ?> <br/> <?php
<ul class="list-group list-group-unbordered"> <li class="list-group-item"> <b>อายุ</b> <a class="pull-right"><?php echo $config->get_age($model->birth); ?> ปี</a> </li> <li class="list-group-item"> <b>เลขที่ใบขับขี่</b> <a class="pull-right"><?php echo $model->driver_license_id; ?> </a> </li> <li class="list-group-item"> <b>วันหมดอายุ</b> <a class="pull-right"><?php echo $config->thaidate($model->driver_license_expire); ?> </a> </li> <li class="list-group-item"> <?php if ($config->Datediff(date("Y-m-d"), $model->driver_license_expire) < 0) { echo "<font style='color:red;'>"; echo "<b>หมดอายุ </b><a class=\"pull-right\">" . +-$config->Datediff(date("Y-m-d"), $model->driver_license_expire) . ' วัน</a>'; } else { echo "<font style='color:green;'>"; echo "<b>เหลือ </b><a class=\"pull-right\">" . $config->Datediff(date("Y-m-d"), $model->driver_license_expire) . ' วัน</a>'; } echo "</font>"; ?> </li>
<tbody> <?php $i = 0; $sum = 0; foreach ($repair_order as $rs) { $i++; $sum = $sum + $rs['price']; //$order_id = $order->find()->where(['order_id' => $rs['order_id']])->one()['id']; ?> <tr> <td><?php echo $i; ?> </td> <td><?php echo $config->thaidate($rs['create_date']); ?> </td> <td><?php echo $rs['detail']; ?> <?php if ($rs['order_id'] != '0') { ?> <font style="color:red" class="pull-right"><em>(ระหว่างวิ่งรถ <?php echo $rs['order_id']; ?> )</em> <?php }
?> <p class="pull-right"> <?php echo Html::a('<i class="fa fa-pencil"></i> แก้ไข', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']); ?> <?php echo Html::a('<i class="fa fa-trash"></i> ลบ', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => 'Are you sure you want to delete this item?', 'method' => 'post']]); ?> <?php } ?> </p> </div> <div class="box-body"> <?php echo DetailView::widget(['model' => $model, 'attributes' => ['license_plate', 'brand', 'model', 'color', ['attribute' => 'date_buy', 'format' => 'raw', 'value' => $config->thaidate($model->date_buy), 'displayOnly' => true], ['attribute' => 'price', 'format' => 'integer'], ['attribute' => 'down', 'format' => 'integer'], ['attribute' => 'period_price', 'format' => 'integer'], 'period', 'date_supply', ['attribute' => 'type_id', 'format' => 'raw', 'value' => \app\models\Typecar::find()->where(['id' => $model->type_id])->one()['type_name'], 'displayOnly' => true]], 'mode' => 'view', 'striped' => true, 'condensed' => true, 'responsive' => true, 'hAlign' => 'left', 'vAlign' => 'center']); ?> </div> </div> </div> <!-- ประวัติการวิ่งรถ --> <div class="tab-pane" id="history"> <div id="load_history"></div> </div> <div class="tab-pane" id="repair"> <div class="row"> <div class="col-xs-12 col-sm-12 col-md-5 col-lg-5"> <div class="form-group"> <div class="input-group"> <div class="input-group-addon">ปี</div>
<tbody> <?php $sum = 0; $i = 0; foreach ($income as $rs) { $sum = $sum + $rs['price']; //if ((int) $rs['price'] != 0) { $i++; ?> <tr> <td><?php echo $i; ?> </td> <td><?php echo $config->thaidate($rs['transport_date']); ?> </td> <td><?php echo $rs['detail']; ?> </td> <td style=" text-align: right;"><?php echo number_format((int) $rs['price'], 2); ?> </td> <td style=" text-align: center;"> <?php if ($rs['type'] == 1) { ?> <a href="javascript:delete_driver_income('<?php
$i++; //$order_id = $order->find()->where(['order_id' => $rs['order_id']])->one()['id']; ?> <tr> <td><?php echo $i; ?> </td> <td> <?php echo $rs['license_plate']; ?> </td> <td> <?php echo $config->thaidate($rs['last_period']); ?> </td> <td> <?php echo $config->thaidate($rs['checkdate']); ?> </td> <td> <?php if (substr($rs['over_day'], 0, 1) != '-') { echo "<font style='color: #ff9900;'>ชำระภายใน " . $rs['over_day'] . " วัน</font>"; } else { echo "<font style='color: red;'>เลยกำหนดชำระ " . +-$rs['over_day'] . " วัน</font>"; } ?>
<b>ที่อยู่ : </b> <?php echo $employer['address']; ?> </td> <td colspan="2" valign='top'> <b>เลขที่ Invoice No.:</b> <div id="line">.</div> <b>วันที่ Invoice Date :</b> </td> <td valign='top' style=" text-align: right;"> <?php echo $model['assign_id']; ?> <div id="line">.</div> <?php echo $config->thaidate($model['order_date_start']); ?> </td> </tr> <thead> <tr> <th style=" text-align: center; width: 5%;">#</th> <th style="text-align:center; width: 65%;">รายการ</th> <th style=" text-align: center; width: 10%;">จำนวน</th> <th style="text-align:center; width: 10%;">หน่วยละ</th> <th style="text-align:center; width: 15%;">จำนวนเงินสุทธิ(บาท)</th> </tr> </thead> <tbody> <tr> <td style="text-align: center;" valign="top">1</td>
$i++; //$order_id = $order->find()->where(['order_id' => $rs['order_id']])->one()['id']; ?> <tr> <td><?php echo $i; ?> </td> <td> <?php echo $rs['license_plate']; ?> </td> <td> <?php echo $config->thaidate($rs['act_end']); ?> </td> <td> <?php if (substr($rs['OVER_DAY'], 0, 1) == '-') { echo "<font style='color:red;'>เลยมา " . +-$rs['OVER_DAY'] . " วัน</font>"; } else { echo "<font style='color:orange;'>เหลือ " . $rs['OVER_DAY'] . " วัน</font>"; } ?> </td> <td style=" text-align: center;"> <a href="<?php echo Url::to(['truck/view', 'id' => $rs['id']]);
</thead> <tbody> <?php $i = 0; foreach ($truck_act as $rs) { $i++; //$order_id = $order->find()->where(['order_id' => $rs['order_id']])->one()['id']; ?> <tr> <td><?php echo $i; ?> </td> <td> <?php echo $config->thaidate($rs['act_start']); ?> </td> <td> <?php echo $config->thaidate($rs['act_end']); ?> </td> <td> <?php echo $config->thaidate($rs['create_date']); ?> </td> <td style="text-align: right;"> <?php echo number_format($rs['act_price'], 2);
} else { $status = "<font style='color:red;'><i class='fa fa-warning'></i> ค้างชำระเงิน</font>"; } return $status; }]]; echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => $columns, 'options' => ['id' => 'assign'], 'containerOptions' => ['style' => 'overflow: auto'], 'headerRowOptions' => ['class' => 'kartik-sheet-style'], 'filterRowOptions' => ['class' => 'kartik-sheet-style'], 'responsive' => true, 'pjax' => true, 'panel' => ['type' => GridView::TYPE_PRIMARY, 'heading' => "<i class='fa fa-book'></i> " . $this->title . "(รถภายใน)"]]); ?> <!-- DT 2 --> <?php $columns2 = [['class' => 'yii\\grid\\SerialColumn'], 'id', ['class' => 'kartik\\grid\\CheckboxColumn', 'headerOptions' => ['class' => 'kartik-sheet-style']], 'order_id', ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'order_date_start', 'label' => 'วันที่ไป', 'hAlign' => 'center', 'width' => '10%', 'format' => 'raw', 'mergeHeader' => true, 'value' => function ($model) { $config = new \app\models\Config_system(); return $config->thaidate($model['order_date_start']); }], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'order_date_end', 'label' => 'วันที่กลับ', 'hAlign' => 'center', 'width' => '10%', 'format' => 'raw', 'mergeHeader' => true, 'value' => function ($model) { $config = new \app\models\Config_system(); return $config->thaidate($model['order_date_end']); }], 'driver1', 'driver2', ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'imcome', 'label' => 'รายได้', 'mergeHeader' => true, 'hAlign' => 'right', 'format' => 'raw', 'value' => function ($model) { return "<font style='color:blue;'>" . number_format($model['price_employer'], 2) . "</font>"; }], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'flag', 'label' => 'สถานะ', 'mergeHeader' => true, 'format' => 'raw', 'value' => function ($model) { if ($model['flag'] == 1) { $status = "<font style='color:green;'><i class='fa fa-check'></i> ชำระเงินแล้ว</font>"; } else { $status = "<font style='color:red;'><i class='fa fa-warning'></i> ค้างชำระเงิน</font>"; } return $status; }]]; echo GridView::widget(['dataProvider' => $dataProvider2, 'columns' => $columns2, 'options' => ['id' => 'assign_out'], 'containerOptions' => ['style' => 'overflow: auto'], 'headerRowOptions' => ['class' => 'kartik-sheet-style'], 'filterRowOptions' => ['class' => 'kartik-sheet-style'], 'responsive' => true, 'pjax' => true, 'panel' => ['type' => GridView::TYPE_DANGER, 'heading' => "<i class='fa fa-book'></i> " . $this->title . "(จ้างบริษัทรถร่วม)"]]); ?> </div>