/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = SimpelPersonil::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id_personil' => $this->id_personil]);
     return $dataProvider;
 }
 public function actionMonikeg()
 {
     // get your HTML raw content without any layouts or scripts
     if (!empty($_GET['unit_id'])) {
         $find_query = "SELECT c.* FROM simpel_keg as a\n                            LEFT JOIN pegawai.daf_unit b ON  a.unit_id = b.unit_id\n                            LEFT JOIN simpel_personil c ON  a.id_kegiatan = c.id_kegiatan\n                          WHERE (unit_parent_id='" . $_GET['unit_id'] . "') and tgl_berangkat='" . $_GET['tgl_mulai'] . "' or tgl_kembali='" . $_GET['tgl_kembali'] . "' and c.status=4 group by pegawai_id";
         $query = SimpelPersonil::findBySql($find_query);
         $countQuery = count($query->all());
         $pages = new Pagination(['totalCount' => $countQuery]);
         $models = $query->offset($pages->offset, $pages->pageSize = 10)->limit($pages->limit)->all();
     } else {
         $unit = SimpelPersonil::find()->joinWith('keg')->where('simpel_keg.status = 4')->groupBy('pegawai_id');
         $count = count($unit->all());
         $pages = new Pagination(['totalCount' => $count]);
         $models = $unit->offset($pages->offset, $pages->pageSize = 10)->limit($pages->limit)->all();
     }
     return $this->render('monikeg', ['pages' => $pages, 'models' => $models]);
 }
 public function actionUrll($id)
 {
     $model = $this->findModel($id);
     $model2 = \backend\models\SimpelPersonil::find()->where('id_kegiatan=' . $id)->all();
     return $this->renderAjax('v_qrcode_luar', ['model' => $model, 'model2' => $model2]);
 }
示例#4
0
            $da = $i . '0';
        } elseif ($i == 30) {
            $da = $i . '0';
        } else {
            $da = $i;
        }
        // echo $da;
        // die();
        $count = Yii::$app->db->createCommand("SELECT count(pegawai_id) from simpel_personil where pegawai_id=" . $key['pegawai_id'] . " and tgl_berangkat='" . $tahun . '-' . $bln . '-' . $da . "'")->queryScalar();
        if ($count > 0) {
            ?>
                                <span class="label label-success" data-toggle="popover" data-html="true" title="Detail Tujuan Keberangkatan"
                                 data-content="
                                 <?php 
            $tgl = isset($_GET['tgl_mulai']) ? $_GET['tgl_mulai'] : $key->tgl_berangkat;
            $data = \backend\models\SimpelPersonil::find()->where("pegawai_id=" . $key['pegawai_id'] . "  and tgl_berangkat like '%" . $tgl . "%'")->groupBy('id_kegiatan')->all();
            foreach ($data as $value) {
                echo '<b>' . $value->keg->kotaTujuan->nama . '</b> ';
                echo "<br/>";
                echo $value->keg->nama_keg;
                echo "<br/>";
                echo "<br/>";
            }
            ?>
"><?php 
            echo count($data) . 'x';
            ?>
</span>
                           <?php 
        } else {
            echo "";
示例#5
0
 public function CountUper($id)
 {
     /* $command = Yii::$app->db->createCommand("SELECT 
        sum(transport+taksi+taksi2+lumpsum+uhr+uhr_fb+penginapan+representatif+trans_pim+inap_lain+inap_fb )
        FROM perjadin where nomi_id=16"); */
     $command = Yii::$app->db->createCommand("SELECT sum(jml) FROM  simpel_rincian_biaya where personil_id=" . $id . " and bukti_kwitansi in(1,2) GROUP BY id_kegiatan");
     $sum = $command->queryScalar();
     $counts = \backend\models\SimpelPersonil::find()->where(['id_personil' => $id])->count();
     if (!empty($counts)) {
         return $sum;
     } else {
         return "-";
     }
 }
 /**
  * Finds the SimpelPersonil model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return SimpelPersonil the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = SimpelPersonil::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
                <div class="box-body" style="display: block;">
<table  style="width:100%;" class="table table-striped">
    <thead>
        <tr  style="background-color:#4e95f4;">
            <th width="2%" class="th">No.</th>
            <th width="33%">Data Personil</th>
            <th width="33%">Data Penugasan</th>
            <th width="27%">Pembiayaan Luar Negri </th>
            <th width="5%">Action</th>
        </tr>
    </thead>
    <tbody>

        <?php 
$no = 1;
$data = \backend\models\SimpelPersonil::find()->where('id_kegiatan=' . $model->id_kegiatan)->all();
foreach ($data as $key) {
    ?>
            <tr class="item-row">
                <td valign="top"><span id="No"><?php 
    echo $no;
    ?>
</span></td>
                <td style="width:5%;">
                    <table style="width:80%;">
                        <tbody>

                            <tr>
                                <td width="20%">Nama</td>
                                <td valign="top">:</td>
                                <td><?php 
 public function Jml($id)
 {
     $personil = \backend\models\SimpelPersonil::find();
     $rincian = \backend\models\SimpelRincianBiaya::find();
     $daftar = \backend\models\SimpelDafKatBiaya::find();
     return $id;
 }
 public function getPersonil()
 {
     return $this->hasOne(\backend\models\SimpelPersonil::className(), ['id_personil' => 'personil_id']);
 }