Beispiel #1
0
 public static function getListWarna()
 {
     $listwarna = WarnaKegiatan::model()->findAll();
     $items = array();
     $options["options"] = array();
     $ii = 1;
     foreach ($listwarna as $data) {
         $items[$ii] = $data->kode;
         $options["options"][$ii] = array("style" => "color:#" . $items[$ii] . "");
         $ii++;
     }
     return array("items" => $items, "options" => $options);
 }
Beispiel #2
0
    echo "\" class=\"display compact cell-border nowrap\">\n    <colgroup>\n    <col class=\"odd\"></col>\n    <col class=\"even\"></col>\n    <col class=\"odd\"></col>\n    <col class=\"even\"></col>\n    <col class=\"odd\"></col>\n    <col class=\"even\"></col>\n    <col class=\"odd\"></col>\n    <col class=\"even\"></col>\n    </colgroup>\n    <thead>\n      <tr>\n        <th class=\"dt-head-center\" rowspan=\"3\">No.</th>\n        <th class=\"dt-head-center\" rowspan=\"3\">Nama Personil</th>\n        <th class=\"dt-head-center\" colspan=\"48\">Periode</th>";
    if (Yii::app()->user->getState('role') == Akun::ADMIN) {
        echo "<th class=\"dt-head-center\" rowspan=\"3\">Aksi</th>";
    }
    echo "\n      </tr>\n      <tr>\n        <th class=\"dt-head-center\" colspan=\"4\">Januari</th>\n        <th class=\"dt-head-center\" colspan=\"4\">Februari</th>\n        <th class=\"dt-head-center\" colspan=\"4\">Maret</th>\n        <th class=\"dt-head-center\" colspan=\"4\">April</th>\n        <th class=\"dt-head-center\" colspan=\"4\">Mei</th>\n        <th class=\"dt-head-center\" colspan=\"4\">Juni</th>\n        <th class=\"dt-head-center\" colspan=\"4\">Juli</th>\n        <th class=\"dt-head-center\" colspan=\"4\">Agustus</th>\n        <th class=\"dt-head-center\" colspan=\"4\">September</th>\n        <th class=\"dt-head-center\" colspan=\"4\">Oktober</th>\n        <th class=\"dt-head-center\" colspan=\"4\">November</th>\n        <th class=\"dt-head-center\" colspan=\"4\">Desember</th>\n      </tr>\n\n      <tr>\n        <th>1</th>\n        <th>2</th>\n        <th>3</th>\n        <th>4</th>\n        <th>1</th>\n        <th>2</th>\n        <th>3</th>\n        <th>4</th>\n        <th>1</th>\n        <th>2</th>\n        <th>3</th>\n        <th>4</th>\n        <th>1</th>\n        <th>2</th>\n        <th>3</th>\n        <th>4</th>\n        <th>1</th>\n        <th>2</th>\n        <th>3</th>\n        <th>4</th>\n        <th>1</th>\n        <th>2</th>\n        <th>3</th>\n        <th>4</th>\n        <th>1</th>\n        <th>2</th>\n        <th>3</th>\n        <th>4</th>\n        <th>1</th>\n        <th>2</th>\n        <th>3</th>\n        <th>4</th>\n        <th>1</th>\n        <th>2</th>\n        <th>3</th>\n        <th>4</th>\n        <th>1</th>\n        <th>2</th>\n        <th>3</th>\n        <th>4</th>\n        <th>1</th>\n        <th>2</th>\n        <th>3</th>\n        <th>4</th>\n        <th>1</th>\n        <th>2</th>\n        <th>3</th>\n        <th>4</th>\n      </tr>\n    </thead>\n    <tfoot>\n      <tr>\n      </tr>\n    </tfoot>\n    <tbody>";
    $ii = 1;
    foreach ($dataProvider as $data) {
        echo "<tr id=\"\">";
        echo "<td>" . $ii++ . "</td>";
        echo "<td>" . $data['nama'] . "</td>";
        for ($a = 1; $a <= 12; $a++) {
            for ($b = 1; $b <= 4; $b++) {
                $val = "w" . $a . $b;
                if ($data[$val] != NULL) {
                    $detail = DetailKegiatan::model()->getKodeKegiatan($data[$val]);
                    $bgcolor = WarnaKegiatan::model()->findByPk($detail['kode']);
                    echo "<td bgcolor=\"#" . $bgcolor['kode'] . "\">" . chr(64 + $bgcolor['id']) . $detail['id_kegiatan'] . "</td>";
                } else {
                    echo "<td></td>";
                }
            }
        }
        if (Yii::app()->user->getState('role') == Akun::ADMIN) {
            echo "<td class=\"text-left\">" . CHtml::link('Tambah', array('DetailKegiatanPersonil/addKegiatan', 'id' => $data['id'], 'id_personil' => $data['id_personil'])) . " |" . CHtml::link('Hapus', array('DetailKegiatanPersonil/deleteKegiatan', 'id' => $data['id'])) . "</td>";
        }
        echo "</tr>";
    }
    echo "\n    </tbody>\n  </table>";
}
?>
</div>
Beispiel #3
0
      <?php 
$ii = 1;
foreach ($dataProvider as $data) {
    echo "<tr id=\"\">";
    echo "<td>" . $ii++ . "</td>";
    echo "<td>" . $data->nama . "</td>";
    echo "<td class=\"text-left\">" . $data->anggaran . "</td>";
    echo "<td class=\"text-left\">" . $data->persen_anggaran . "%</td>";
    echo "<td class=\"text-left\">" . $data->waktu . "</td>";
    echo "<td class=\"text-left\">" . $data->persen_waktu . "%</td>";
    echo "<td class=\"text-left\">" . $data->nomor_sp . "</td>";
    for ($a = 1; $a <= 12; $a++) {
        for ($b = 1; $b <= 4; $b++) {
            $val = "w" . $a . $b;
            if ($data[$val] != NULL) {
                $bgcolor = WarnaKegiatan::model()->findByPk($data->kode);
                echo "<td bgcolor=\"#" . $bgcolor['kode'] . "\">" . chr(64 + $bgcolor['id']) . $data->id_kegiatan . "</td>";
            } else {
                echo "<td></td>";
            }
        }
    }
    if (Yii::app()->user->getState('role') == Akun::ADMIN) {
        echo "<td class=\"text-left\">" . CHtml::link('Ubah', array('DetailKegiatan/update', 'id' => $data->id)) . " |" . CHtml::link('Hapus', array('DetailKegiatan/delete', 'id' => $data->id), array('submit' => array('DetailKegiatan/delete', 'id' => $data->id), 'class' => 'delete', 'confirm' => 'Anda yakin untuk menghapus detil kegiatan?')) . "</td>";
    }
    echo "</tr>";
}
?>
    </tbody>
  </table>
</div>
Beispiel #4
0
echo $form->labelEx($model, 'nama');
?>
		<?php 
echo $form->textField($model, 'nama', array('size' => 50, 'maxlength' => 50));
?>
		<?php 
echo $form->error($model, 'nama');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'Warna');
?>
		<?php 
$listwarna = WarnaKegiatan::model()->getListWarna();
$items = $listwarna['items'];
$options = $listwarna['options'];
?>
		<?php 
echo $form->dropDownList($model, 'kode', $items, $options);
?>
		<?php 
echo $form->error($model, 'kode');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'anggaran');
?>