/** * 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 = TPesan::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<h1>Manage Tpesans</h1> <?php if (TPerusahaan::isPerusahaan()) { ?> <table width="100%" class="table table-condensed table-hover"> <tr> <th>No</th> <th>Nama</th> <th>ID Permintaan</th> <th colspan="2" style="text-align: center">konfirmasi</th> </tr> <?php $perusahaan = new TPerusahaan(); foreach (TPermintaanPerusahaan::model()->findAllByAttributes(array('id_perusahaan' => $perusahaan->getIdUser())) as $permintaan) { $i = 1; foreach (TPesan::model()->findAllByAttributes(array('id_permintaan_perusahaan' => $permintaan->id_permintaan)) as $data) { ?> <tr> <td><?php echo $i; ?> </td> <td><?php echo CHtml::link($data->getNamaAnggota(), array("tAnggota/view", "id" => $data->id_anggota)); ?> </td> <td><?php echo $data->id_permintaan_perusahaan; ?> </td> <td style="text-align: center"><?php
<table class="table table-bordered table table-striped"> <tr> <th>Perusahaan</th> <th>Tanggapan</th> </tr> <?php $pesan = new TPesan(); $i = 1; foreach (TPesan::model()->findAllByAttributes(array('id_anggota' => $pesan->getIdUser())) as $pesan) { foreach (TPermintaanPerusahaan::model()->findAllByAttributes(array('id_permintaan' => $pesan->id_permintaan_perusahaan)) as $permintaan) { foreach (TPerusahaan::model()->findAllByAttributes(array('id_perusahaan' => $permintaan->id_perusahaan)) as $perusahaan) { if ($i++ == 11) { break; } ?> <tr> <td> <i class="glyphicon glyphicon-envelope"></i> <?php echo CHtml::link($perusahaan->nm_perusahaan, array('TPesan/view', 'id' => $pesan->id_pesan)); ?> </td> <td> <?php echo $pesan->konfirmasi; ?> </td> </tr> <?php } } } ?>