Server IP : 103.119.228.120 / Your IP : 3.143.214.226 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/hendraso/public_html/Modules/Controller/Admin/Master/ |
Upload File : |
<?php /* * To User Access * Creator : Ageng Maulana @ July 2017 */ class Controller_Admin_Master_Useraccess extends GeneralAction { function beforeExec() { parent::beforeExec(); parent::$moduleName = "User Access"; parent::$isAdmin = true; parent::$btnActionDelete = false; parent::$mapping = parent::generateMapping('User Access'); parent::$prefix = 'udaf'; parent::$table = 'user'; } protected function do_show() { parent::$addJs = ' $(document).ready(function(){ $("input[type=checkbox]").click(function () { var main = $(this).attr("class"); if (typeof main != "undefined") { if ($(this).is(":checked") == true) { //$(this).next().children().children().prop("checked", true); $(this).parent().next().children().children().children().prop("checked", true); } else { //$(this).next().children().children().prop("checked", false); $(this).parent().next().children().children().children().prop("checked", false); } } else { if ($(this).is(":checked") == true) { //$(this).parent().parent().parent().children().prop("checked", true); $(this).parent().parent().parent().parent().children().children("input").prop("checked", true); } else { //if ($(this).parent().parent().parent().children().next().children().children(":checked").length == 0) { if ($(this).parent().parent().parent().parent().children().children().children().children(":checked").length == 0) { //$(this).parent().parent().parent().children().prop("checked", false); $(this).parent().parent().parent().parent().children().children("input").prop("checked", false); } } } }); });'; //$menuaccess = GeneralFunction::build()->createMenu(parent::getMenu(true), true); $menuaccess = GeneralFunction::getMenuUser(); $form = GenerateForm::load()->buildForm(static::$mapping); $form .= "<div class='userAccessCustom'><ul class='list-unstyled'>"; foreach($menuaccess['menu'] as $parent) { $form .= ' <li> <label><input type="checkbox" name="menuaccess[]" id="menuaccess'.$parent['id'].'" value="'.$parent['id'].'" class="mainmenu"> '.$parent['name'].'</label>'; if(isset($parent['sub'])) { $form .= ' <ul class="list-unstyled">'; foreach($parent['sub'] as $child) { $form .= ' <li> <label><input type="checkbox" name="menuaccess[]" id="menuaccess'.$child['id'].'" value="'.$child['id'].'"> '.$child['name'].'</label> </li>'; } $form .= ' </ul>'; } $form .='</li>'; } $form .= "</ul></div>"; $addTpl = array("menuaccess" => $menuaccess, "form" => $form, "export" => false, "addnew" => false); parent::do_show('/Templates/Admin/default1Grid.html', $addTpl); } protected function do_select() { $data = parent::do_select(); $userAcc = Database::build()->getAllDb("SELECT udacAccess FROM user_access WHERE udacUdafId = '".$_POST['id']."'"); if(!empty($userAcc)) { foreach($userAcc as $key => $val) { $data['data'][0]['menuaccess'.$val['udacAccess']] = $val['udacAccess']; } return $data; }else{ return $data; } } protected function do_update() { if(!empty($_POST['menuaccess'])) { $delete = Database::build()->delete_data("user_access", "udac", " udacUdafId = '".$_POST['txtId']."'"); foreach($_POST['menuaccess'] as $key => $val) { $insertAccess = Database::build()->insertArray("user_access", "udac", array("udacUdafId" => $_POST['txtId'], "udacAccess" => $val)); } return array("status" => "ok", "id" => $insertAccess['id']); }else{ return array("status" => "error", "error" => "Please Checked User Access"); } } }