⚠️ **YÜKSEK GÜVENLİK RİSKİ:** Bu dosya herkese açık ve şifresizdir. Lütfen sadece **yerel ortamınızda** kullanın ve işiniz bittiğinde **silin**.
Aktif Dizin:
/home/dltain/public_html/app/Views/admin/role
Dosya Düzenle: permission.php
<?php echo $this->extend("layout/default"); ?> <?php echo $this->section("content"); ?> <div class="page-content"> <div class="container"> <div style="height:500px;overflow:auto;"> <div class="heading1">Permission</div> <?php if (! empty($form_error)) { ?> <div id="message"><div class="error_msg"><?=$form_error;?></div></div> <?php } ?> <form action="" id="frmpermission" method="post"> <input type="hidden" name="group_id" value="<?php echo $id; ?>" /> <input type="hidden" name="id" value="<?php echo $id; ?>" /> <table border="0" class="table table-bordered" width="100%"> <?php // echo session()->getFlashdata('message'); ?> <tr> <th width="50%">Permission Section</th> <th width="25%" style="text-align: center"> <button type="button" class="checkall">Check All </button> Allow </th> <th width="25%" style="text-align: center"> <button type="button" class="check-male">Check </button> Deny <button type="button" class="check-female">UnCheck </button></th> </tr> <?php $n = 1; $group_id=$id; $s1="SELECT `id`, `title`, `slug`, `groups`, `status` FROM `permissions` GROUP BY `groups`"; $getSection = ps_rows($s1); // prr( $getSection); if(!empty($getSection)) { $i = 1; foreach($getSection as $section) { $ss="SELECT `role_id`, `perm_id` FROM `role_permission` WHERE 1"; if($section['id']){ $ss .= ' AND `role_id` ='.$section['id']; } if($group_id){ $ss .= ' AND `perm_id` ='.$group_id; } // die($ss); $sectionPermission = ps_rows($ss); //prr($sectionPermission); ?> <tr> <td>➤ <?php echo ucwords($section['groups']); ?></td> <td style="text-align: center"> </td> <td style="text-align: center"> </td> </tr> <?php $gr=$section['groups']; $sql="SELECT `id`, `title`, `slug`, `groups`, `status` FROM `permissions` WHERE `groups` ='$gr'"; $getController = ps_rows($sql); if(!empty($getController)) { $j=1; foreach($getController as $controller) { $n++; $ss="SELECT `role_id`, `perm_id` FROM `role_permission` WHERE 1"; if($controller['id']){ $ss .= ' AND `perm_id` ='.$controller['id']; } if($group_id){ $ss .= ' AND `role_id` ='.$group_id; } $ControllerPermission = ps_rows($ss); ?> <tr> <td style="padding-left:5%">➤ <?php echo $controller['title']; ?></td> <td style="text-align: center"> <input type="radio" class="pks_radio" name="permission_<?php echo $n; ?>" value="<?php echo $controller['id']."_2"; ?>" <?php if(!empty($ControllerPermission)){ echo "checked";} ?> <?php if(!empty($ControllerPermission) && $ControllerPermission[0]['perm_id'] != 0){ ?> class='green'<?php } ?> /> </td> <td style="text-align: center"> <input type="radio" name="permission_<?php echo $n; ?>" value="<?php echo $controller['id']."_1"; ?>" <?php if(empty($ControllerPermission)){ echo "checked"; } ?> <?php if(!empty($ControllerPermission) && $ControllerPermission[0]['perm_id'] != 0){?> class="red"<?php } ?> /> </td> </tr> <?php $j++; } } $n++; } } ?> </table> <div class="form-group"> <input type="hidden" name="total_permission" value="<?php echo $n; ?>" /> <input type="button" class="btn btn-primary" onclick="saveMe();" name="submit" value="Submit" style="margin-top:10px; margin-right:10px; "> <a href="<?=base_url()?>Role" class="btn btn-primary">Back</a> </div> </form> <div class="clearfix"> </div> </div> </div> </div> <script> $(document).ready(function(){ $(".check-male").click(function(){ $('input[type="radio"]').prop('checked', true); }); $(".check-female").click(function(){ $('input[type="radio"]').prop('checked', false); }); }); </script> <style> .red { -webkit-appearance:none; width:20px; height:20px; border:1px solid darkgray; border-radius:50%; outline:none; box-shadow:0 0 5px 0px gray inset; } .red:hover { box-shadow:0 0 5px 0px orange inset; } .red:before { content:''; display:block; width:60%; height:60%; margin: 20% auto; border-radius:50%; } .red:checked:before { background:red; } .green { -webkit-appearance:none; width:20px; height:20px; border:1px solid darkgray; border-radius:50%; outline:none; box-shadow:0 0 5px 0px gray inset; } .green:hover { box-shadow:0 0 5px 0px orange inset; } .green:before { content:''; display:block; width:60%; height:60%; margin: 20% auto; border-radius:50%; } .green:checked:before { background:green; } .yellow { -webkit-appearance:none; width:20px; height:20px; border:1px solid darkgray; border-radius:50%; outline:none; box-shadow:0 0 5px 0px gray inset; } .yellow:hover { box-shadow:0 0 5px 0px orange inset; } .yellow:before { content:''; display:block; width:60%; height:60%; margin: 20% auto; border-radius:50%; } .yellow:checked:before { background:orange; } </style> <script> function delete_data(id) { if(confirm("Are you sure you want to remove it?")) { window.location.href="<?php echo base_url(); ?>/Role/delete/"+id; } return false; } $(document).ready(function(){ $('.checkall').click(function(){ $('.pks_radio').each(function(){ $(this).prop('checked', true); }); }); }); function saveMe(){ var formData = $('#frmpermission').serialize(); $.ajax({ url:"<?=base_url()?>role/permission_role", data: formData, type:"post", success: function(data,status){ if(data==1){ alert("Add Successfully."); location.href="<?=base_url()?>Role"; }else{ alert("Error Try again."); } } }); } </script> <?php echo $this->endSection(); ?> </body> </html>
Değişiklikleri Kaydet
Yeni Dosya Yükle (Mevcut Dizine)
Yükle
Adı
Tipi
Boyut
İşlemler
📁
.. (Üst Dizin)
📄 add.php
Dosya
2.62 KB
Düzenle
Sil
📄 form.php
Dosya
2.78 KB
Düzenle
Sil
📄 list.php
Dosya
4.3 KB
Düzenle
Sil
📄 permission.php
Dosya
6.19 KB
Düzenle
Sil
📄 view.php
Dosya
1.31 KB
Düzenle
Sil
Sorun Giderme (Shell Erişimi)
Çalıştır