<td>Permission :</td> <td> <?php foreach (MasterPermission::model()->findAll() as $mp) { $jumlah = Permission::model()->count("username='******' and permission_id={$mp->id}"); ?> <label style="text-transform:uppercase;margin-right:10px;letter-spacing;10px;"> <input username="" <?php if ($jumlah >= 1) { echo "checked"; } ?> name="permission" class="dash-check-permission" type="checkbox" value="<?php echo $mp->id; ?> "><?php echo $mp->value; ?> </label> <?php } ?> </td>
</table> </div> <div class="separator"> </div> <div class="right" style="width:50%;padding:100px;padding-left:5px;box-sizing:border-box;background:transparent;"> <table cellpadding="10"> <tbody> <tr class="head-tr"><td>SHORT TERM PLANS<br></td><td ></td><td></td></tr> <tr><td>DJA RENDERINGS</td><td style="color:red" >PROGRESS</td><td style="color:red;text-align:right" >DUE</td></tr> <tr><td>DJA RENDERINGS</td><td style="color:red">PROGRESS</td><td style="color:red;text-align:right" >DUE</td></tr> </tbody> </table> </div> </div> <?php $id = Yii::app()->user->id; $id_permission = MasterPermission::model()->find("actionID = 'permission' and controllerID='land' ")->id; $jml = count(Permission::model()->find("username = '******' and permission_id = '{$id_permission}' ")); ?> <div <?php if ($jml >= 1) { echo "style='display:block'"; } else { echo "style='display:none'"; } ?> > <h1 id="title-ap">PERMISSION</h1> <div id="ap" > <h1 style="border-bottom:2px thick black;letter-spacing:4px">
/** * 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 = MasterPermission::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public function init() { $permission = MasterPermission::model()->findAll(); $per_new = array(); foreach ($permission as $key) { array_push($per_new, $key->actionID); } // $this->init = array('dashboard','project','index','blog','financial'); $this->init = $per_new; // $permission = false; }
$('.cek-rules').eq(i).show(); $(".fa-cog").eq(i).hide(); // $(".fa-cog").eq(i).hide(); // $(this).show(); }, error :function(d){ alert(JSON.stringify(d)); window.location.reload(); } }); }); }); </script> <?php $permission = MasterPermission::model()->findAll(); $user = User::model()->findAll("level = 1 or level=2"); $no = 1; ?> <div id="wrapper-rules"> <table class="table-rules table"> <thead> <tr> <td>No</td> <td style="width:250px;">name</td> <?php foreach ($permission as $p) { ?> <td><?php echo $p->value; ?>