コード例 #1
0
 /**
  * Creates a new OrdersTransport model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Assign();
     $confix = new \app\models\Config_system();
     $id = $confix->autoId_order("assign", "assign_id", 5);
     $newId = substr(date("Y"), -2) . "-" . $id;
     return $this->render('create', ['model' => $model, 'assign_id' => $newId]);
 }
コード例 #2
0
 /**
  * Creates a new Affiliated model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Affiliated();
     if ($model->load(Yii::$app->request->post())) {
         $model->create_date = date("Y-m-d H:i:s");
         $model->save();
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         $config = new \app\models\Config_system();
         $company_id = $config->autoId("affiliated", "company_id", 10);
         return $this->render('create', ['model' => $model, 'company_id' => $company_id]);
     }
 }
コード例 #3
0
 /**
  * Creates a new Driver model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Driver();
     if ($model->load(Yii::$app->request->post())) {
         $model->create_date = date("Y-m-d");
         $model->d_update = date("Y-m-d H:i:s");
         $model->save();
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         $config = new \app\models\Config_system();
         $driver_id = $config->autoId("driver", "driver_id", 5);
         return $this->render('create', ['model' => $model, 'driver_id' => $driver_id]);
     }
 }
コード例 #4
0
 /**
  * Creates a new OrdersTransport model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new OrdersTransportAffiliated();
     $config = new \app\models\Config_system();
     $id = $config->autoId_order("orders_transport_affiliated", "order_id", 5);
     $newId = substr(date("Y"), -2) . "T-" . $id;
     if ($model->load(Yii::$app->request->post())) {
         // Yii::$app->response->format = Response::FORMAT_JSON;
         if (Yii::$app->request->post('orders-transport-affiliated', null)) {
             $model->scenario = 'orders-transport-affiliated';
             return ActiveForm::validate($model);
         }
         if ($model->load(Yii::$app->request->post())) {
             $model->create_date = date("Y-m-d H:i:s");
             $model->save();
             return $this->redirect(['view', 'id' => $model->id]);
         }
     } else {
         return $this->render('create', ['model' => $model, 'order_id' => $newId]);
     }
 }
コード例 #5
0
 /**
  * Creates a new Customer model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Customer();
     if ($model->load(Yii::$app->request->post())) {
         $tax_number = $model->tax_number;
         $check = $model->find()->where(['tax_number' => $tax_number])->one();
         if ($check['tax_number'] != '') {
             $config = new \app\models\Config_system();
             $cusId = $config->autoId("customer", "cus_id", 7);
             return $this->render('create', ['error' => "ลูกค้าบริษัทนี้นี้มีอยู่ในระบบแล้ว ...!", 'model' => $model, 'cus_id' => $cusId]);
         } else {
             $model->create_date = date("Y-m-d H:i:s");
             $model->save();
             return $this->redirect(['view', 'id' => $model->id]);
         }
     } else {
         $config = new \app\models\Config_system();
         $cusId = $config->autoId("customer", "cus_id", 7);
         return $this->render('create', ['error' => '', 'model' => $model, 'cus_id' => $cusId]);
     }
 }
コード例 #6
0
<?php

use yii\helpers\Url;
//use miloschuman\highcharts\Highcharts;
$config = new \app\models\Config_system();
$monthFull = $config->MonthFull();
$monthVal = $config->Monthval();
$this->title = "บัญชีค่าใช้จ่ายของรถ คันที่ " . $car['car_id'] . " ทะเบียน (" . $car['truck_1'] . ") - (" . $car['truck_2'] . ")";
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="panel panel-primary">
    <div class="panel-heading">
        <i class="fa fa-bar-chart"></i>
        <?php 
echo $this->title;
?>
    </div>
    <div class="panel-body">
        <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>
                        <select id="year" name="year" class="form-control">
                            <?php 
$yearnow = date("Y");
for ($i = $yearnow; $i >= $yearnow - 2; $i--) {
    ?>
                                <option value="<?php 
    echo $i;
    ?>
コード例 #7
0
ファイル: _receipt.php プロジェクト: kimniyom/transport
<style type="text/css">
    body{color: #666666; font-size: 12px;}
    table tr td{ border-left: #000 solid 1px; border-bottom: #000 solid 1px; padding: 5px;}
    table tr th{ border-left: #000 solid 1px; border-bottom: #000 solid 1px; border-top: #000 solid 1px; padding: 5px; text-align: left; font-weight: normal;}
    table{ border-right: #000 solid 1px;}
    table tr th p{ margin-bottom: 10px;}
    #line{ color: #FFF; font-size: 5px;}
</style>
<?php 
use yii\helpers\Url;
$truck_model = new \app\models\Truck();
$config = new \app\models\Config_system();
$driver = new app\models\Driver();
$customer_model = new \app\models\Customer();
$changwat_model = new app\models\Changwat();
$producttype_model = new app\models\ProductType();
$thaibaht = new app\models\Thaibaht();
$company_model = new \app\models\Company();
$company = $company_model->find()->one();
?>
<!--
    #ข้อมูลใบปฏิบัติงาน
    Comment By Kimniyom
-->
<div style=" position: absolute; left: 50px; top: 30px;">
    <div style="width: 80px;">
        <img src="<?php 
echo Url::to('@web/web/uploads/logo/' . $company['logo'], true);
?>
"/>
    </div>
コード例 #8
0
    table tbody tr td{ text-align: right; white-space: nowrap;}
    table tbody tr th{ white-space: nowrap;}
    table tfoot tr td{ text-align: right; font-weight: bold; background: #999999; color: #FFF;}
    #income{ background: #006633; color: yellow; font-weight: bold;}
    #outcome{ background: #cc0033; color: #ffffff; font-weight: bold;}
    #total{ background: #0000cc; font-weight: bold; color: #FFF;}
</style>

<?php 
use yii\helpers\Html;
use yii\helpers\Url;
use kartik\date\DatePicker;
//use miloschuman\highcharts\Highcharts;
/* @var $this yii\web\View */
/* @var $model app\models\Truck */
$config = new app\models\Config_system();
$report = new \app\models\Report();
$monthfull = $config->MonthFullKey();
?>
<b>รายรับ รายจ่าย รายการขนส่งประจำปี <?php 
echo $year + 543;
?>
</b>
<?//php echo $chart; ?>
<div class="table table-responsive">
    <table class="table table-striped table-hover table-bordered" id="report_year">
        <thead>
            <tr>
                <th rowspan="2" valign="middle"><i class="fa fa-calendar"></i><br/>เดือน</th>
                <th rowspan="2" valign="middle"><i class="fa fa-truck"></i><br/>จำนวนรอบ</th>
                <th rowspan="2" valign="middle">ระยะทาง<br/>(ก.ม)</th>
コード例 #9
0
ファイル: _reportViewAll.php プロジェクト: kimniyom/transport
<style type="text/css">
    body{color: #666666; font-size: 12px;}
    table tr td{ border-left: #000000 solid 1px; border-bottom: #000000 solid 1px; padding: 5px;}
    table tr th{ border-left: #000000 solid 1px; border-bottom: #000000 solid 1px; border-top: #000000 solid 1px; padding: 5px; text-align: left; font-weight: normal;}
    table{ border-right: #000000 solid 1px;}
    table tr th p{ margin-bottom: 10px;}
</style>
<?php 
use yii\helpers\Url;
$truck_model = new \app\models\Truck();
$config = new \app\models\Config_system();
$driver = new app\models\Driver();
$customer_model = new \app\models\Customer();
$changwat_model = new app\models\Changwat();
$producttype_model = new app\models\ProductType();
?>
<!--
    #ข้อมูลใบปฏิบัติงาน
    Comment By Kimniyom
-->
<div style=" width: 100%; position: relative;">
    <div style="width: 80px; float: left;">
        <img src="<?php 
echo Url::to('@web/web/images/logo.jpg');
?>
"/>
    </div>
    <div style="float: left; padding-top: 5px;">
       
    </div>
</div>
コード例 #10
0
ファイル: view.php プロジェクト: kimniyom/transport
        max-width:200px;
        min-height:250px;
        background: #FFF;
    }
</style>
<?php 
use yii\helpers\Html;
//use yii\widgets\DetailView;
use kartik\detail\DetailView;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $model app\models\Driver */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => 'พนักงานขับรถ', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
$config = new app\models\Config_system();
$SalaryMasterModel = new \app\models\SalaryMaster();
$MapDrive = new \app\models\MapDriver();
$MapTruck = new app\models\MapTruck();
$car = $MapDrive->find()->where(['driver' => $model->driver_id, 'active' => '1'])->one();
$car_map = $MapTruck->find()->where(['car_id' => $car['car_id']])->one();
?>

<script type="text/javascript">
    function chkNumber(ele) {
        var vchar = String.fromCharCode(event.keyCode);
        if ((vchar < '0' || vchar > '9') && (vchar != '.'))
            return false;
        //ele.onKeyPress = vchar;
    }
</script>
コード例 #11
0
ファイル: detail_person.php プロジェクト: kimniyom/history
<?php 
use yii\helpers\Url;
use yii\helpers\Html;
//use yii2mod\google\maps\markers\GoogleMaps;
$occupation = new \app\models\MasOccupation();
$web_config = new app\models\Config_system();
$occupation_name = $occupation->find()->where(['occupa_id' => $model['OCCUPA']])->one()['occupa_name'];
?>

<button type="button" class="btn btn-warning btn-xs pull-right" onclick="dialog_query_person();">ที่มา</button>

<center style="display:none;">
    <?php 
if ($model['SEX'] == 'หญิง') {
    ?>
        <img class="profile-user-img img-responsive img-circle" src="<?php 
    echo Url::to('@web/web/themes/AdminLTE/dist/img/avatar2.png');
    ?>
" alt="User profile picture">
    <?php 
} else {
    ?>
        <img class="profile-user-img img-responsive img-circle" src="<?php 
    echo Url::to('@web/web/themes/AdminLTE/dist/img/avatar.png');
    ?>
" alt="User profile picture">
    <?php 
}
?>
</center>
コード例 #12
0
ファイル: repair.php プロジェクト: kimniyom/transport
<?php 
use yii\helpers\Url;
/*
 $customer = new app\models\Customer();
 $config = new app\models\Config_system();
 $order = new app\models\OrdersTransport();
*/
use yii\helpers\Html;
$config = new app\models\Config_system();
/* @var $this yii\web\View */
/* @var $model app\models\Repair */
$this->title = 'ทะเบียนรถ: ' . ' ' . $truck_license . ' คันที่ ' . $car_id;
$this->params['breadcrumbs'][] = 'บันทึกรายการซ่อม: ' . $truck_license;
?>
<div class="box box-primary">
    <div class="box-header with-border">
        <i class="fa fa-cogs"></i> <?php 
echo $this->title;
?>
        <div class="pull-right">
            <a href="<?php 
echo Url::to(['repair/create', 'truck_license' => $truck_license, 'car_id' => $car_id]);
?>
">
                <button type="button" class="btn btn-success"><i class="fa fa-plus"></i> เพิ่มรายการซ่อม</button>
            </a>
        </div>
    </div>
    <div class="box-body">
コード例 #13
0
<style type="text/css">
    body{color: #666666; font-size: 12px;}
    table tr td{ border-left: #000 solid 1px; border-bottom: #000 solid 1px; padding: 5px;}
    table tr th{ border-left: #000 solid 1px; border-bottom: #000 solid 1px; border-top: #000 solid 1px; padding: 5px; text-align: left; font-weight: normal;}
    table{ border-right: #000 solid 1px;}
    table tr th p{ margin-bottom: 10px;}
    #line{ color: #FFF; font-size: 5px;}
</style>
<?php 
use yii\helpers\Url;
$truck_model = new \app\models\Truck();
$config = new \app\models\Config_system();
$driver = new app\models\Driver();
$customer_model = new \app\models\Customer();
$changwat_model = new app\models\Changwat();
$producttype_model = new app\models\ProductType();
$thaibaht = new app\models\Thaibaht();
$company_model = new \app\models\Company();
$company = $company_model->find()->one();
?>
<!--
    #ข้อมูลใบปฏิบัติงาน
    Comment By Kimniyom
-->
<div style=" position: absolute; left: 50px; top: 30px;">
    <div style="width: 80px;">
        <img src="<?php 
echo Url::to('@web/web/images/logo.jpg', true);
?>
"/>
    </div>
コード例 #14
0
ファイル: notification.php プロジェクト: kimniyom/transport
<?php 
use yii\helpers\Url;
/*
 $customer = new app\models\Customer();
 $order = new app\models\OrdersTransport();
*/
$this->title = "แจ้งเตือน พรบ. / ภาษีรถ ที่ถึงกำหนดชำระ ";
//$this->params['breadcrumbs'][] = ['label' => 'รถบรรทุก', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
$config = new app\models\Config_system();
$notifications = new \app\models\Notifications();
$notify = $notifications->find()->one();
?>
<label style=" color: #ff3300;">
    * ระบบจะแจ้งเตือนก่อน <?php 
echo $notify->truck_act;
?>
 วัน
</label>

<div class="box box-danger">
    <div class="box-header with-border">
        <?php 
echo $this->title;
?>
    </div>
    <div class="box-body">
        <table class="table table-bordered table-striped" id="tb_notification_truck_act">
            <thead>
                <tr>
コード例 #15
0
ファイル: load_truck_act.php プロジェクト: kimniyom/transport
<?php 
use yii\helpers\Url;
/*
 $customer = new app\models\Customer();
 $order = new app\models\OrdersTransport();
*/
$config = new app\models\Config_system();
?>

<table class="table table-bordered table-striped" id="tb_truck_act">
    <thead>
        <tr>
            <th>#</th>
            <th>วันที่ทำ พรบ./ต่อภาษี</th>
            <th>วันที่ครบกำหนด</th>
            <th>วันที่ทำรายการ</th>
            <th style=" text-align: center;">จำนวน</th>
            <th style="text-align: center;">เลือก</th>
        </tr>
    </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;
コード例 #16
0
ファイル: load_income.php プロジェクト: kimniyom/transport
<?php

use yii\helpers\Url;
$config = new app\models\Config_system();
?>
<table class="table table-striped">
    <thead>
        <tr>
            <th>#</th>
            <th>วันที่</th>
            <th>รายการ</th>
            <th style=" text-align: center;">ราคา</th>
            <th style=" text-align:  center;">ลบ</th>
        </tr>
    </thead>
    <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']);
コード例 #17
0
ファイル: index.php プロジェクト: kimniyom/transport
            background: #000;
        }
        .box-menu-first{
            height: 400px;
            background: #6ba610;
        }
    }
</style>

<?php 
/* @var $this yii\web\View */
use yii\helpers\Url;
use app\models\CompanySearch;
$co = CompanySearch::find()->one();
$this->title = $co->companyname;
$config = new \app\models\Config_system();
?>

<div class="row" id="text-color">
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
        <div style="position: absolute; top: 5px; right: 5px;">
            <div class="dropdown">

                <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                    <i class="fa fa-cog faa-spin animated-hover"></i>
                </button>
                <ul class="dropdown-menu pull-right" aria-labelledby="dropdownMenu1">
                    <li><a href="Javascript:set_bg('gray')">Gray <div class="btn pull-right" id="content-bg-gray"></div></a></li>
                    <li><a href="Javascript:set_bg('red')">Red <div class="btn pull-right" id="content-bg-red"></div></a></li>
                    <li><a href="Javascript:set_bg('green')">Green <div class="btn pull-right" id="content-bg-green"></div></a></li>
                    <li><a href="Javascript:set_bg('blue')">Blue <div class="btn pull-right" id="content-bg-blue"></div></a></li>
コード例 #18
0
 public function actionChart_month($year = null, $month = null)
 {
     $config = new \app\models\Config_system();
     $months = $config->MonthFullKey();
     $title = "ยอดกำไร - ขาดทุน ปี พ.ศ. ";
     $title .= $year + 543;
     $title .= " เดือน " . $months[$month];
     $labels = "รวมทั้งเดือน";
     $report = new Report();
     $result = $report->Report_month($year, $month);
     $sum_expenses_row = 0;
     $sum_total_row = 0;
     $sum_income = 0;
     $sum_outcome = 0;
     $income_month = 0;
     foreach ($result as $rs) {
         $day[] = $rs['DAY'];
         $sum_expenses_row = $rs['oil_price'] + $rs['gas_price'] + $rs['expenses_around'] + $rs['fix_truck'] + $rs['income_driver'] + $rs['truck_period'] + $rs['truck_act'];
         $sum_total_row = $rs['income'] - $sum_expenses_row;
         $income_month = $rs['income'];
         if (empty($income_month)) {
             $income = 0;
         } else {
             $income = $income_month;
         }
         if (empty($sum_expenses_row)) {
             $outcome = 0;
         } else {
             $outcome = $sum_expenses_row;
         }
         $value_income[] = (int) $income;
         $value_outcome[] = (int) $outcome;
         $sum_income = $sum_income + $rs['income'];
         //รายได้รวมทุกเดือน
         $sum_outcome = $sum_outcome + $sum_expenses_row;
         //รายจ่ายรวมทุกเดือน
     }
     //$val_income = implode('', $value_income);
     //$val_outcome = implode('', $value_outcome);
     return $this->renderAjax('chart', ['category' => $day, 'title' => $title, 'labels' => $labels, 'val_income' => $value_income, 'val_outcome' => $value_outcome, 'sumIncome' => (int) $sum_income, 'sumOutcome' => (int) $sum_outcome]);
 }
コード例 #19
0
ファイル: load_repair.php プロジェクト: kimniyom/transport
<?php 
use yii\helpers\Url;
use app\models\Driver;
$customer = new app\models\Customer();
$config = new app\models\Config_system();
$order = new app\models\OrdersTransport();
?>

<table class="table table-bordered table-striped" id="history_repair">
    <thead>
        <tr>
            <th>#</th>
            <th>วันที่</th>
            <th>รายการซ่อม</th>
            <th style=" text-align: center;">ค่าใช้จ่าย</th>
            <th style=" text-align: center;">ลบ</th>
        </tr>
    </thead>
    <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;
コード例 #20
0
ファイル: list_over.php プロジェクト: kimniyom/transport
<?php 
use yii\helpers\Url;
/*
 $customer = new app\models\Customer();
 $order = new app\models\OrdersTransport();
*/
$this->title = "แจ้งเตือนค่างวดรถ ";
//$this->params['breadcrumbs'][] = ['label' => 'รถบรรทุก', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
$config = new app\models\Config_system();
$notifications = new \app\models\Notifications();
$notify = $notifications->find()->one();
?>
<label style=" color: #ff3300;">
    * ระบบจะแจ้งเตือนก่อน <?php 
echo $notify->truck_period;
?>
 วัน
</label>

<div class="box box-danger">
    <div class="box-header with-border">
        <?php 
echo $this->title;
?>
    </div>
    <div class="box-body">
        <table class="table table-bordered table-striped" id="tb_notification_over">
            <thead>
                <tr>
コード例 #21
0
<style type="text/css">
    body{color: #666666; font-size: 12px;}
    table tr td{ border-left: #000 solid 1px; border-bottom: #000 solid 1px; padding: 5px;}
    table tr th{ border-left: #000 solid 1px; border-bottom: #000 solid 1px; border-top: #000 solid 1px; padding: 5px; text-align: left; font-weight: normal;}
    table{ border-right: #000 solid 1px;}
    table tr th p{ margin-bottom: 10px;}
    #line{ color: #FFF; font-size: 5px;}
</style>
<?php 
use yii\helpers\Url;
$truck_model = new \app\models\Truck();
$config = new \app\models\Config_system();
$driver = new app\models\Driver();
$customer_model = new \app\models\Customer();
$changwat_model = new app\models\Changwat();
$producttype_model = new app\models\ProductType();
$thaibaht = new app\models\Thaibaht();
$company_model = new \app\models\Company();
$company = $company_model->find()->one();
$account_model = new \app\models\Account();
$account = $account_model->find()->where(['status' => 1])->one();
?>
<!--
    #ข้อมูลใบปฏิบัติงาน
    Comment By Kimniyom
-->
<div style=" position: absolute; left: 50px; top: 30px;">
    <div style="width: 80px;">
        <img src="<?php 
echo Url::to('@web/web/uploads/logo/' . $company['logo'], true);
?>
コード例 #22
0
ファイル: view.php プロジェクト: kimniyom/transport
<style type="text/css">
    table thead th{ white-space: nowrap;}
    table tbody td{ white-space: nowrap;}
</style>
<?php 
use yii\helpers\Html;
//use yii\widgets\DetailView;
use kartik\detail\DetailView;
use yii\helpers\Url;
use kartik\date\DatePicker;
/* @var $this yii\web\View */
/* @var $model app\models\Truck */
$this->title = "ทะเบียน " . $model->license_plate;
$this->params['breadcrumbs'][] = ['label' => 'รถบรรทุก', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
$config = new app\models\Config_system();
?>
<div class="panel panel-primary">
    <div class="panel-heading" style="padding-bottom: 20px;">
        <i class="fa fa-windows"></i>
        <?php 
echo " คันที่ " . $car_id;
?>
        <div class="pull-right">
            <a href="<?php 
echo yii\helpers\Url::to(['site/index']);
?>
" class="btn btn-danger btn-sm"><i class="fa fa-remove"></i></a>
        </div>
    </div>
    <div class="panel-body" id="panel-body">
コード例 #23
0
ファイル: index.php プロジェクト: kimniyom/transport
    <?php 
// 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>";
    }
コード例 #24
0
ファイル: load_annuities.php プロジェクト: kimniyom/transport
<?php 
use yii\helpers\Url;
/*
 $customer = new app\models\Customer();
 $config = new app\models\Config_system();
 $order = new app\models\OrdersTransport();
*/
$config = new app\models\Config_system();
$notify = new \app\models\Notifications();
$month_full = $config->MonthFullKey();
?>
<div class="box box-danger">
    <div class="box-header with-border" style=" color: #ff3300;">
        <i class="fa fa-info"></i> ระบบจะแจ้งเตือนก่อน <?php 
echo $notify->find()->one()['truck_period'];
?>
 วัน ในเดือนปัจจุบัน
    </div>
    <div class="box-body">
        <table class="table table-striped table-bordered" id="list_annuities">
            <thead>
                <tr>
                    <th style=" text-align: center;">#</th>
                    <th style=" text-align: center;">กำหนดจ่าย</th>
                    <th>ประจำเดือน</th>
                    <th>ประจำปี</th>
                    <th>ค่างวด</th>
                    <th>วันที่บันทึก</th>
                    <?php 
if ($flag_period == 0) {
コード例 #25
0
ファイル: load_history.php プロジェクト: kimniyom/transport
<style type="text/css">
    table tr th{ white-space: nowrap;}
    table tr td{ white-space: nowrap;}
</style>
<?php 
use yii\helpers\Url;
use app\models\Driver;
$customer = new app\models\Customer();
$config = new app\models\Config_system();
$order = new app\models\OrdersTransport();
function get_driver($driver_id = null)
{
    $rs = Driver::find()->where(['id' => $driver_id])->one();
    return $rs['name'] . '-' . $rs['lname'];
}
?>

<table class="table table-bordered table-striped" id="history_truck">
    <thead>
        <tr>
            <th>#</th>
            <th>รถคันที่</th>
            <th>รหัสปฏิบัติงาน</th>
            <th>วันที่(ไป - กลับ)</th>
            <th>คนขับ</th>
            <th>ผู้ว่าจ้าง</th>
            <th style=" text-align: center;">รายได้</th>
        </tr>
    </thead>
    <tbody>
        <?php 
コード例 #26
0
        $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' => $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>