Esempio 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 = Siswa::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Esempio n. 2
0
			<th>nis</th>
			<th>NAMA</th>
			<th>NILAI AKHIR</th>
			<th>UJIAN NASIONAL</th>
			<th>UJIAN SEKOLAH</th>
		</tr>
		</thead>
		<tbody>
		<?php 
        /*$siswa=Siswa::model()->findAll(array(
        			//SELECT * FROM "siswa" WHERE kelas = '2' and lokal = 'B'
        			//'index'=>'nis',
        			'select'=>'*',
        			'condition'=>"kelas='".$pgi['kelas']."' or lokal='".$pgi['lokal']."'",
        		));*/
        $siswa = Siswa::model()->with(array('nis0' => array('joinType' => 'INNER JOIN', 'condition' => "kelas='" . $pgi['kelas'] . "' or lokal='" . $pgi['lokal'] . "'")))->findAll();
        foreach ($siswa as $i => $ii) {
            ?>
	
		<?php 
            echo $form->hiddenField($model, "[{$i}]lokal");
            ?>
		<?php 
            echo $form->hiddenField($model, "[{$i}]kelas");
            ?>
		<?php 
            echo $form->hiddenField($model, "[{$i}]nis", array('value' => $ii['nis']));
            ?>
			<tr>
				<td><?php 
            echo $ii['nis'];