public function actionAdmin()
 {
     $tahun = isset($_GET['tahun']) ? $_GET['tahun'] : date('Y');
     $dunit = Yii::$app->user->identity->unit_id;
     if ($dunit == '100000') {
         $command = Yii::$app->db->createCommand("SELECT \n                sum(pagu) as total\n                 FROM t_mak where unit_mak in('BP','BHO','BU','Biro Umum','INSPEK','BDL') and t_mak.tahun=" . $tahun);
         $dataPagu = $command->queryScalar();
         $command2 = Yii::$app->db->createCommand("SELECT \n                sum(pagu)\n                 FROM t_mak where unit_mak in('DIFRZR', 'DPIBN', 'DPFRZR', 'DI2BN', 'DK2N') and t_mak.tahun=" . $tahun);
         $dataPagu2 = $command2->queryScalar();
         $command3 = Yii::$app->db->createCommand("SELECT \n                sum(pagu)\n                 FROM t_mak where unit_mak in('P2STPFRZR', 'P2STPIBN', 'DP2FRZR', 'DP2IBN') and t_mak.tahun=" . $tahun);
         $dataPagu3 = $command3->queryScalar();
         $command4 = Yii::$app->db->createCommand("SELECT \n                sum(pagu)\n                 FROM t_mak where unit_mak in('SKLN') and t_mak.tahun=" . $tahun);
         $dataPagu4 = $command4->queryScalar();
         //akhir data pagu
         $totalPagu = $dataPagu + $dataPagu2 + $dataPagu3 + $dataPagu4;
         //mulai data realisasi
     }
     if ($dunit == '100000') {
         $count = \common\models\DaftarUnit::find()->where('unit_id in (110000,120000,130000,161100,151000)')->count();
         $unit = \common\models\DaftarUnit::find()->where('unit_id in (110000,120000,130000,161100,151000)');
     } else {
         $count = \common\models\DaftarUnit::find()->where('unit_id in (' . $dunit . ')')->count();
         $unit = \common\models\DaftarUnit::find()->where('unit_id in (' . $dunit . ')');
     }
     $pages = new Pagination(['totalCount' => $count]);
     $models = $unit->offset($pages->offset, $pages->pageSize = 100)->limit($pages->limit)->all();
     $unitkerja = Yii::$app->db->createCommand("SELECT sum(pagu) FROM t_mak where  t_mak.tahun=" . $tahun)->queryScalar();
     $unitke = Yii::$app->db->createCommand("SELECT sum(pagu) FROM t_mak where  t_mak.tahun=" . $tahun)->queryScalar();
     $realisasi = Yii::$app->db->createCommand("SELECT sum(jml) FROM `simpel_rincian_biaya` where id_kegiatan=4")->queryScalar();
     return $this->render('index', ['dataPagu2' => $dataPagu2, 'dataPagu3' => $dataPagu3, 'dataPagu4' => $dataPagu4, 'totalPagu' => $totalPagu, 'pages' => $pages, 'unit' => $unit, 'realisasi' => $realisasi, 'models' => $models, 'unitkerja' => $unitkerja, 'unitke' => $unitke, 'dunit' => $dunit]);
 }
 public function actionLists($id)
 {
     $countKokab = \common\models\DaftarUnit::find()->where(['unit_parent_id' => $id])->count();
     $Kokab = \common\models\DaftarUnit::find()->where(['unit_parent_id' => $id])->all();
     if ($countKokab > 0) {
         echo "<option ><center>- Pilih -  </center></option>";
         foreach ($Kokab as $kota) {
             echo "<option value='" . $kota->unit_id . "'>" . $kota->nama . "</option>";
         }
     } else {
         echo "<option>-</option>";
     }
 }
 public function actionAdmin()
 {
     $tahun = isset($_GET['tahun']) ? $_GET['tahun'] : date('Y');
     $dunit = Yii::$app->user->identity->unit_id;
     if ($dunit == '100000') {
         $count = \common\models\DaftarUnit::find()->where('unit_id in (110000,120000,130000,161100,151000)')->count();
         $unit = \common\models\DaftarUnit::find()->where('unit_id in (110000,120000,130000,161100,151000)');
     } else {
         $count = \common\models\DaftarUnit::find()->where('unit_id in (' . $dunit . ')')->count();
         $unit = \common\models\DaftarUnit::find()->where('unit_id in (' . $dunit . ')');
     }
     $pages = new Pagination(['totalCount' => $count]);
     $models = $unit->offset($pages->offset, $pages->pageSize = 100)->limit($pages->limit)->all();
     $realisasi = Yii::$app->db->createCommand("SELECT sum(jml) FROM `simpel_rincian_biaya` where id_kegiatan=4")->queryScalar();
     return $this->render('index', ['pages' => $pages, 'unit' => $unit, 'realisasi' => $realisasi, 'models' => $models, 'dunit' => $dunit]);
 }
 protected function findUnit($mak)
 {
     if (($model = \common\models\DaftarUnit::findOne($mak)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
                         <?php 
 switch ($unit->unit_id) {
     case 110000:
         $satker = DaftarUnit::find()->where('satker_id=110000 and unit_id in (111000,112000,113000,114000,115000)')->all();
         break;
     case 120000:
         $satker = DaftarUnit::find()->where(' unit_id in (121000,122000,123000,124000)')->all();
         break;
     case 130000:
         $satker = DaftarUnit::find()->where('unit_id in (131000,132000,133000)')->all();
         break;
     case 161100:
         $satker = DaftarUnit::find()->where("unit_id='161100'")->all();
         break;
     case 151000:
         $satker = DaftarUnit::find()->where("unit_id='151000'")->all();
         break;
 }
 $n = 1;
 foreach ($satker as $sat) {
     ?>
                             <tr>
                                 <td width="40"></td>
                                 <td  width="50" bgcolor="gray" style="text-align:center;">
                                     <div >
                                         <?php 
     switch ($sat->unit_id) {
         case 110000:
             ?>
                                                 <h6> <?php 
             echo Html::a(HelperUnit::Apagu($sat->unit_id), Yii::$app->urlManager->createUrl(['simpel-keg/tabarsip', 'unit' => $sat->unit_id]), ['title' => Yii::t('yii', 'Proses')]);
Exemple #6
0
 public function Unit($id)
 {
     $gole = \common\models\DaftarUnit::find()->where(['unit_id' => $id])->one();
     return $gole->nama;
 }
 public function getUnit()
 {
     return $this->hasOne(\common\models\DaftarUnit::className(), ['unit_id' => 'unit_id']);
 }
                    <?php 
    switch ($unit->unit_id) {
        case 110000:
            $satker = DaftarUnit::find()->where('satker_id=110000 and unit_id in (111000,112000,113000,114000,115000)')->all();
            break;
        case 120000:
            $satker = DaftarUnit::find()->where(' unit_id in (121000,122000,123000,124000)')->all();
            break;
        case 130000:
            $satker = DaftarUnit::find()->where('unit_id in (131000,132000,133000)')->all();
            break;
        case 161100:
            $satker = DaftarUnit::find()->where('unit_id in (0)')->all();
            break;
        case 151000:
            $satker = DaftarUnit::find()->where('unit_id=0')->all();
            break;
        default:
            echo "";
    }
    foreach ($satker as $sat) {
        ?>
                        <tr>
                            <th  width="240" bgcolor="gray" align="left">
                                <div class="pull-right">
                                    <?php 
        echo HelperUnit::Apagu($sat->unit_id);
        ?>
   
                                </div>
echo $form->field($result, 'nama_detail')->textInput(['rows' => 6, 'value' => $result['nama_detail']])->label('Nama Kegiatan');
?>
            <?php 
echo $form->field($result, 'detail_id')->hiddenInput(['rows' => 6, 'value' => $result['detail_id']])->label(false);
?>
            <?php 
echo $form->field($result, 'kode_mak')->hiddenInput(['rows' => 6, 'value' => $result['kode_mak']])->label(false);
?>
            <div id="kota">         
                <?php 
$data = ArrayHelper::map(\backend\models\DafKota::find()->asArray()->all(), 'kab_id', 'nama');
echo $form->field($result, 'kota_keberangkatan')->widget(Select2::classname(), ['data' => $data, 'theme' => Select2::THEME_BOOTSTRAP, 'options' => ['id' => 'brkota', 'placeholder' => 'Pilih Kota Keberangkatan'], 'pluginOptions' => ['allowClear' => true]]);
?>
            </div> 
                <?php 
$unit = ArrayHelper::map(\common\models\DaftarUnit::find()->asArray()->all(), 'unit_id', 'nama');
echo $form->field($result, 'unit_id')->widget(Select2::classname(), ['data' => $unit, 'theme' => Select2::THEME_BOOTSTRAP, 'options' => ['required' => 'required', 'placeholder' => 'Pilih UNIT Kerja'], 'pluginOptions' => ['allowClear' => true]])->label('Unit Kerja');
?>

            <?php 
echo $form->field($result, 'renc_tgl_mulai')->widget(DatePicker::classname(), ['options' => ['value' => $result['renc_tgl_mulai'], 'placeholder' => 'Enter birth date ...'], 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-m-d']])->label('Pergi Keberangkatan');
?>
           <?php 
echo $form->field($result, 'tgl_penugasan')->widget(DatePicker::classname(), ['options' => ['placeholder' => 'Enter birth date ...'], 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-m-d']])->label('Tanggal Penugasan');
?>
        </div>
        <div class="col-md-6">

            <?php 
$data = ArrayHelper::map(\common\models\Pegawai::find()->asArray()->all(), 'nip', 'nama_cetak');
echo $form->field($result, 'nip_ppk')->widget(Select2::classname(), ['data' => $data, 'theme' => Select2::THEME_BOOTSTRAP, 'options' => ['placeholder' => 'Pilih Nama PPK'], 'pluginOptions' => ['allowClear' => true]])->label('Pilih Nama PPK');
    ?>
</th>
                       	<td align="center"><?php 
    $pag = HelperUnit::Pagu($unit->unit_id);
    $pagn = number_format(HelperUnit::Pagu($unit->unit_id), 0, ",", ".");
    echo $pagn;
    ?>
   </td>
                       	<td align="center"></td>
                       	<td align="center"></td>
                       	<td align="center"></td>

                    </tr>

                    <?php 
    $pimpin2 = DaftarUnit::find()->where("unit_parent_id='" . $unit->unit_id . "'")->all();
    foreach ($pimpin2 as $sat) {
        ?>
                        <tr>
                            <th  width="280" bgcolor="gray" align="left">
                                <div class="pull-right">
                                    <?php 
        echo HelperUnit::unit($sat->unit_id);
        ?>
   
                                </div>

                            </th>
                           <td align="center"><?php 
        $sql_pagu = "SELECT sum(b.alokasi_sub_mak) FROM serasi2015_sql.news_nas_suboutput a LEFT JOIN serasi2015_sql.news_sub_mak_tahun b on a.suboutput_id=b.sub_mak_id LEFT JOIN pegawai.daf_unit c on a.unit_id3=c.unit_id WHERE a.tahun=" . $tahun . " and c.unit_id=" . $sat['unit_id'];
        $nilaipagu = Yii::$app->db->createCommand($sql_pagu)->queryScalar();
                <tr>
                    <th scope="row"><?php 
echo \common\components\HelperUnit::Unit($dunit);
?>
  </th>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>




                </tr>
                <?php 
$satker = \common\models\DaftarUnit::find()->where('unit_id =' . $dunit)->all();
foreach ($satker as $sat) {
    ?>
                    <tr>
                        <th  bgcolor="gray" align="left">
                            <div class="pull-right">
                                <?php 
    echo \common\components\HelperUnit::Unit($sat->unit_id);
    ?>
   
                            </div>

                        </th>
                        <td>
                            <?php 
    echo $sat->unit_id;
Exemple #12
0
                        </td>

                    </tr>
                    <?php 
    switch ($unit->unit_id) {
        case 110000:
            $ese = isset($_GET['unit_id']) ? $_GET['unit_id'] : '111000,112000,113000,114000,115000';
            $satker = DaftarUnit::find()->where(' unit_id in (' . $ese . ')')->all();
            break;
        case 120000:
            $ese = isset($_GET['unit_id']) ? $_GET['unit_id'] : '121000,122000,123000,124000';
            $satker = DaftarUnit::find()->where(' unit_id in (' . $ese . ')')->all();
            break;
        case 130000:
            $ese = isset($_GET['unit_id']) ? $_GET['unit_id'] : '131000,132000,133000';
            $satker = DaftarUnit::find()->where(' unit_id in (' . $ese . ')')->all();
            $jum = Yii::$app->db->createCommand("SELECT \n                                      sum(alokasi_sub_mak) as total\n                                     FROM pagu_mak where  unit_id in(131000,132000,133000)")->queryScalar();
            break;
    }
    $n = 1;
    foreach ($satker as $sat) {
        $ese = isset($_GET['unit_id']) ? $_GET['unit_id'] : $sat->unit_id;
        $hsl = Yii::$app->db->createCommand("SELECT \n                                      sum(alokasi_sub_mak) as total\n                                     FROM pagu_mak where  unit_id in(" . $ese . ")")->queryScalar();
        ?>

                        <tr >
                            <td align="right"><?php 
        echo $n;
        ?>
.</td>
                            <td><?php 
            </tfoot>
            <tbody>
             <tr>
                    <td style="background-color: white;"  scope="row"></td>
                </tr>
                <tr>
                    <th scope="row">Deputi PI</th>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td>
                    </td>

                </tr>
                <?php 
$satker = \common\models\DaftarUnit::find()->where('satker_id=110000 and unit_id in (111000,112000,113000,114000,115000)')->all();
foreach ($satker as $sat) {
    ?>
                    <tr>
                        <th  bgcolor="gray" align="left">
                            <div class="pull-right">
                                <?php 
    echo \common\components\HelperUnit::Apagu($sat->unit_id);
    ?>
   
                            </div>

                        </th>

                    </tr>
 public function AnakUnit($id)
 {
     $gole = \common\models\DaftarUnit::find()->where(['unit_parent_id' => $id])->one();
     return $gole->unit_id;
 }