예제 #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 $id the ID of the model to be loaded
  * @return BarangDalam the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = BarangDalam::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
예제 #2
0
파일: _form.php 프로젝트: robebeye/sim-kk
		<label>Obat</label>
		<table class="table table-bordered">
			<thead>
				<th>No.</th>
				<th>Nama Obat</th>
				<th>Harga</th>
				<th>Diskon</th>
				<th>Jumlah</th>
				<th></th>
			</thead>
			<tbody>
				<tr ng-repeat="obat in obatCollection">
					<td>{{$index+1}}</td>
					<td width="40%">
						<?php 
$obat = BarangDalam::model()->findAll();
?>
						<select ng-change="updateObat($index, obat.id_obat, obat.jumlah)" ng-model="obat.id_obat">
							
							<?php 
for ($i = 0; $i < count($obat); $i++) {
    echo '<option value="' . $obat[$i]['id_barang_dalam'] . '">' . $obat[$i]['nama_barang'] . ' - Rp. ' . number_format($obat[$i]['harga_jual'], 2, ',', '.') . '</option>';
}
?>
						</select>
					</td>
					<td>
						{{obat.harga}}
					</td>
					<td>
						{{obat.diskon}}
예제 #3
0
 public function loadModelBarang($id)
 {
     $model = BarangDalam::model()->findByPk($id);
     return $model;
 }