?
Current Path : /home1/savoy/public_html/savoyglobal.net/sgms/application/views/Settings/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/public_html/savoyglobal.net/sgms/application/views/Settings/settingsheader.php |
<script type="text/javascript"> function CheckModuleView(prefix, module) { var welements = document.getElementsByName(prefix+ module+"[]"); for (var i = 0; i < welements.length; i++) { if(document.getElementById(prefix+ module).checked==true) welements[i].checked=true; else welements[i].checked=false; } CheckAllView('','',prefix); } function CheckAllView(status,prefix,prefix1) { var Length = document.getElementById('ViewCount').value; var Permision=0; var PrivatePermission =""; //var Private_Permision=""; var FinalPermission=""; for(var i=0; i <Length; i++) { if(prefix!="") document.getElementById(prefix +""+ i).checked=status.checked; //if edit checked then view also checked if(prefix1=="ViewAll_") { if(document.getElementById("ViewAll_"+ i).checked) { document.getElementById('View_'+i ).checked = true; document.getElementById('Edit_'+i ).checked = true; document.getElementById('Add_'+i ).checked = true; document.getElementById('Delete_'+i ).checked = true; } if(document.getElementById("ViewAll_"+ i).checked==false) { document.getElementById('View_'+i ).checked = false; document.getElementById('Edit_'+i ).checked = false; document.getElementById('Add_'+i ).checked = false; document.getElementById('Delete_'+i ).checked = false; } } if(prefix1=="Edit_") { if(document.getElementById("Edit_"+ i).checked) document.getElementById('View_'+i ).checked = true; if(document.getElementById("Edit_"+ i).checked==false) document.getElementById('Edit_CheckAll').checked = false; } if(prefix1=="Add_") { if(document.getElementById("Add_"+ i).checked) document.getElementById('View_'+i ).checked = true; if(document.getElementById("Add_"+ i).checked==false) document.getElementById('Add_CheckAll').checked = false; } //if delete checked then view automatically checked if(prefix1=="Delete_") { if(document.getElementById("Delete_"+ i).checked) document.getElementById('View_'+i ).checked = true; if(document.getElementById("Delete_"+ i).checked==false) document.getElementById('Delete_CheckAll').checked = false; } if(prefix1=="View_") { if(document.getElementById('View_'+i).checked == false) { document.getElementById('Edit_'+i ).checked = false; document.getElementById('Add_'+i ).checked = false; document.getElementById('Delete_'+i ).checked = false; } if(document.getElementById("View_"+ i).checked==false) { document.getElementById('Delete_CheckAll').checked = false; document.getElementById('Add_CheckAll').checked = false; document.getElementById('Edit_CheckAll').checked = false; document.getElementById('View_CheckAll').checked = false; } } if(document.getElementById("Private_"+ i).checked) PrivatePermission = PrivatePermission + "1,"; else PrivatePermission = PrivatePermission + "0,"; //Calculate the Permission Value According to the user select Permission=0; if(document.getElementById("View_"+ i).checked) Permission+=8; if(document.getElementById("Add_"+ i).checked) Permission+=4; if(document.getElementById("Edit_"+ i).checked) Permission+=2; if(document.getElementById("Delete_"+ i).checked) Permission+=1; FinalPermission = FinalPermission + "" + Permission + ","; } document.getElementById('TxtPermissionList').value = FinalPermission; document.getElementById('PrivareList').value = PrivatePermission; } </script>