JezK
Edit File: privilege_ajax.php
<? include("session_check.php"); include("adm_operations.php"); $authid=$_REQUEST['id4privilege']; $operations=new adm_operations(); $privileges=$operations->getthisuserPrivileges($authid); if($privileges!='0') { $pr=explode(',',rtrim($privileges,',')); $one = ""; $two = ""; $three = ""; $four = ""; $five = ""; $six = ""; for($i=0;$i<count($pr);$i++) { if($pr[$i] == 1) { $one = "checked"; } elseif($pr[$i] == 2) { $two = "checked"; } elseif($pr[$i] == 3) { $three = "checked"; } elseif($pr[$i] == 4) { $four = "checked"; } elseif($pr[$i] == 5) { $five = "checked"; } elseif($pr[$i] == 6) { $six = "checked"; } } echo '<div class="col-md-4 col-md-offset-1 text-right"> <b style="color:#666666;">privileges</b> </div> <div style="border-style: solid;border-width: 1px; padding:3px;" class="col-md-7"> <input type="checkbox" '.$one.' name="usrpriv[]" value="1" style="margin-top:-4px;" tabindex="8"> Attendance<br> <input type="checkbox" '.$two.' name="usrpriv[]" value="2" style="margin-top:-4px;" tabindex="9"> Diary<br> <input type="checkbox" '.$three.' name="usrpriv[]" value="3" style="margin-top:-4px;" tabindex="10"> Notice Board<br> <input type="checkbox" '.$four.' name="usrpriv[]" value="4" style="margin-top:-4px;" tabindex="11"> Examinations<br> <input type="checkbox" '.$five.' name="usrpriv[]" value="5" style="margin-top:-4px;" tabindex="12"> Transport<br> <input type="checkbox" '.$six.' name="usrpriv[]" value="6" style="margin-top:-4px;" tabindex="13"> Fee Payment </div>'; } else { echo '<div class="col-md-4 col-md-offset-1 text-right"> <b style="color:#666666;">privileges</b> </div> <div style="border-style: solid;border-width: 1px; padding:3px;" class="col-md-7"> <input type="checkbox" value="1" name="usrpriv[]" style="margin-top:-4px;" tabindex="8"> Attendance<br> <input type="checkbox" value="2" name="usrpriv[]" style="margin-top:-4px;" tabindex="9"> Diary<br> <input type="checkbox" value="3" name="usrpriv[]" style="margin-top:-4px;" tabindex="10"> Notice Board<br> <input type="checkbox" value="4" name="usrpriv[]" style="margin-top:-4px;" tabindex="11"> Examinations<br> <input type="checkbox" value="5" name="usrpriv[]" style="margin-top:-4px;" tabindex="12"> Transport<br> <input type="checkbox" value="6" name="usrpriv[]" style="margin-top:-4px;" tabindex="13"> Fee Payment </div>'; }