Ok, i am working on a CMS for a branch of my college that works with continuing education, non traditional students, non-credit classes. In the user table for the DB, i have user access set up in this fashion:
user = 00000
student worker = 01000
instructor = 00200
program developer = 00030
super admin = 00004
so its combinable in that a program developer can also have instructor and student worker access = 01230 or that type of deal. super admins have a page where they can delegate access to different users. below is the code that is generated when they search for the "sh". i use the preg_match function to fill in the check boxes that pertain to each persons access level.
i know this is probably an easy solution, but im fried. what i need to know is how to successfully mold the changes for each user into a usable format. because i dont know what the u_id is going to be, i dont know how to handle the POST data.
What is the best way to set up the form so that the variables/values can be tied to the user? im having a hard time explaining, sorry.
i would like to be able to do $id_access = "0".$student.$instructor.$developer.$super; <-not those exact variables, but i need to be able to split up the values from multiple users using a form like the one below. if someone can help me with better names/values for my form or some type of array/foreach/while magic, i would be extremely excited.
hopefully someone understands my problem and took the time to read it. thanks.
<h2>Found Users</h2>
<form name="updateadmin" method="post" action="admin.php?action=sup_delegate">
<h3>Jill Welsh</h3>
<div class="m10">
<input type="hidden" name="u84" value="84" />
<input type="checkbox" name="s84" id="s84" value="1" /> <label for="s84">Student Worker</label>
<input type="checkbox" name="i84" id="i84" value="2" checked="checked" /> <label for="i84">Instructor</label>
<input type="checkbox" name="d84" id="d84" value="3" /> <label for="d84">Program Developer</label>
<input type="checkbox" name="a84" id="a84" value="4" /> <label for="a84">Super Admin</label>
</div>
<h3>Julie Sharrow</h3>
<div class="m10">
<input type="hidden" name="u72" value="72" />
<input type="checkbox" name="s72" id="s72" value="1" checked="checked" /> <label for="s72">Student Worker</label>
<input type="checkbox" name="i72" id="i72" value="2" checked="checked" /> <label for="i72">Instructor</label>
<input type="checkbox" name="d72" id="d72" value="3" checked="checked" /> <label for="d72">Program Developer</label>
<input type="checkbox" name="a72" id="a72" value="4" /> <label for="a72">Super Admin</label>
</div>
<h3>Michael Sheppard</h3>
<div class="m10">
<input type="hidden" name="u26" value="26" />
<input type="checkbox" name="s26" id="s26" value="1" /> <label for="s26">Student Worker</label>
<input type="checkbox" name="i26" id="i26" value="2" checked="checked" /> <label for="i26">Instructor</label>
<input type="checkbox" name="d26" id="d26" value="3" /> <label for="d26">Program Developer</label>
<input type="checkbox" name="a26" id="a26" value="4" /> <label for="a26">Super Admin</label>
</div>
<h3>Ryan Fisher</h3>
<div class="m10">
<input type="hidden" name="u35" value="35" />
<input type="checkbox" name="s35" id="s35" value="1" checked="checked" /> <label for="s35">Student Worker</label>
<input type="checkbox" name="i35" id="i35" value="2" checked="checked" /> <label for="i35">Instructor</label>
<input type="checkbox" name="d35" id="d35" value="3" checked="checked" /> <label for="d35">Program Developer</label>
<input type="checkbox" name="a35" id="a35" value="4" checked="checked" /> <label for="a35">Super Admin</label>
</div>
<h3>Teri Sheely</h3>
<div class="m10">
<input type="hidden" name="u87" value="87" />
<input type="checkbox" name="s87" id="s87" value="1" /> <label for="s87">Student Worker</label>
<input type="checkbox" name="i87" id="i87" value="2" checked="checked" /> <label for="i87">Instructor</label>
<input type="checkbox" name="d87" id="d87" value="3" /> <label for="d87">Program Developer</label>
<input type="checkbox" name="a87" id="a87" value="4" /> <label for="a87">Super Admin</label>
</div>
<div class="right">
<input type="hidden" name="qupeop" value="sh" />
<input type="submit" name="sup_admin_update" value="Change">
</form>