コード例 #1
0
ファイル: AuditController.php プロジェクト: azman1204/vms
 public function actionList()
 {
     $where = '1';
     //comment here
     if (isset($_POST['tarikh'])) {
         $tarikh = $_POST['tarikh'];
         $module = $_POST['module'];
         if (!empty($module)) {
             $where .= " AND module = '{$module}'";
         }
         if (!empty($tarikh)) {
             $where .= " AND event_dt LIKE '" . MyDate::dateFormat('dmy', 'ymd', $tarikh, '-') . "%'";
         }
     } else {
         $module = '0';
         $event_dt = '';
     }
     $count = Audit::find()->where($where)->count();
     $pages = new Pagination(['totalCount' => $count]);
     $pages->pageSize = 10;
     $data['pages'] = $pages;
     $data['module'] = $module;
     $data['event_dt'] = $event_dt;
     $audits = Audit::find()->where($where)->offset($pages->offset)->limit($pages->limit)->all();
     $data['audits'] = $audits;
     $data['mod'] = Ref::getList('mod');
     return $this->render('list', $data);
 }
コード例 #2
0
ファイル: Visitor.php プロジェクト: azman1204/vms
 public function beforeSave($insert)
 {
     if (parent::beforeSave($insert)) {
         if (!empty($this->bod)) {
             $this->bod = MyDate::dateFormat('dmy', 'ymd', $this->bod, '-');
         }
         return true;
     } else {
         return false;
     }
 }
コード例 #3
0
ファイル: Card.php プロジェクト: azman1204/vms
 public function afterFind()
 {
     $this->create_dt = MyDate::dateFormat('ymd', 'dmy', $this->create_dt);
 }
コード例 #4
0
ファイル: by_month.php プロジェクト: azman1204/vms
                    }
                }
            },
            tooltip: {
                headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
                pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> of total<br/>'
            },
            series: [{
                name: "Brands",
                colorByPoint: true,
                data: [
                    <?php 
foreach ($rs as $r) {
    ?>
                    {
                        name: "<?php 
    echo MyDate::monthName($r['month']);
    ?>
",
                        y: <?php 
    echo $r['bil'];
    ?>
                    },
                    <?php 
}
?>
                ]
            }]
        });
    });
</script>
コード例 #5
0
ファイル: by_dept.php プロジェクト: azman1204/vms
<?php

use app\helpme\MyDate;
use yii\helpers\Html;
use app\models\Ref;
?>

<legend>Laporan Lawatan Mengikut Jabatan</legend>

<form method="post" action="index.php?r=report/by-dept">
    <div class="container">
        <div class="row">
            <div class="col-md-4">
                <?php 
echo Html::dropDownList('year', $year, MyDate::yearList(3));
?>
                <input type="submit" value="Hantar" class="btn btn-primary btn-sm">
            </div>
        </div>
    </div>
</form>

<div class="col-md-4">
    <table class="table table-bordered">
        <tr class="success">
            <td>Jabatan</td>
            <td>Bilangan</td>
        </tr>
        <?php 
foreach ($rs as $r) {
    ?>