Ejemplo n.º 1
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = ProgramStudi::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Ejemplo n.º 2
0
                        <?php 
    foreach ($fakultas as $fakultas_1) {
        ?>
                            <div class="mcbrow" id="jobDialog1">
                                <ul>
                                    <li class="gtcol1" onclick="details('<?php 
        echo $fakultas_1->id;
        ?>
');" style="cursor:pointer;">

                                        <?php 
        echo $fakultas_1->kode_fakultas . ' - ' . $fakultas_1->nama_fakultas;
        ?>
                                        <?php 
        $fakultas = Fakultas::model()->findByAttributes(array('id' => $fakultas_1->id, 'is_deleted' => 0));
        $programstudi = ProgramStudi::model()->findAll("id_fakultas=:x AND is_deleted=:y", array(':x' => $fakultas_1->id, ':y' => 0));
        ?>
                                        <span><?php 
        echo count($programstudi);
        ?>
 - Program Studi</span>
                                    </li>
                                    <li class="col2">
                                        <?php 
        echo CHtml::ajaxLink(Yii::t('Fakultas', 'Ubah'), $this->createUrl('fakultas/Edit'), array('onclick' => '$("#jobDialog11").dialog("open"); return false;', 'update' => '#jobDialog1', 'type' => 'GET', 'data' => array('val1' => $fakultas_1->id), 'dataType' => 'text'), array('id' => 'showJobDialog123' . $fakultas_1->id, 'class' => 'edit'));
        ?>
                                    </li>
                                    <li class="col3">
                                        <?php 
        echo CHtml::link(Yii::t('Fakultas', 'Hapus'), array('deactivate', 'id' => $fakultas_1->id), array('confirm' => "Apakah anda yakin ingin menghapus data ini?", 'class' => 'delete'));
        ?>