dekzorro 0 Report post Posted February 3, 2006 aku nak buat satu system guna php..system nie guna utk technician create report setiap minggu..ada 6 org technician..setiap technician akan handle lab masing..maknanye ada 6 lab..aku dah ade code utk buat login, add user, session dah..cuma aku takde idea..camne aku nak pointkan user A akan masuk report utk lab A...maknanyer..bila user A login...system akan direct user tu ke report lab A..secara auto..aku harap korang paham dan bole kongsi idea ngan aku...skang nie..aku buat, bila user A masuk, terus masuk ke lab A..aku buat hard-code terus..tapi isunye..kalu admin nak tambah user dan lab lain...takkan aku nak edit code lak..?? jadi aku nak admin bole handle kat bahagian admin je... Quote Share this post Link to post Share on other sites
johari rahmad 0 Report post Posted February 5, 2006 (edited) dlm table lab, make sure ko buat satu field utk relatekan dgn technician. Maknanya, setiap kasi Admin akan add @ modiy lab, dia akan assignkan lab tu pada technician yg dia nak.Maknanya, setiap kali technician tu login.. validation script ko yg akan redirectkan technician tu based on lab yg admin dah assignedkan. Buat satu table "technician", satu table utk "lab". Untuk table "lab", taruk satu field name nama "technicianID". Field name ni act as foreign key kepada table "technician" yang mana dlm table technician tu, primary key nya ialah "technicianID" jugak.Dalam table "lab", make sure ko specify link ke Lab A misalnya: labA.php. so, masa technician tu login.. validation script ko tu akan redirectkan technician tu guna SQL statement yg bersesuaian:$SQL = "SELECT * FROM technician, lab WHERE technician.technicianID=lab.technicianID AND technician.technicianID=$sessionID"; Edited February 5, 2006 by benhurism Quote Share this post Link to post Share on other sites
bushak 0 Report post Posted February 8, 2006 Setkan group utk stp permission.... Cara lain.. buat switch jika technician A login... dia hanya boleh akses lab A... Quote Share this post Link to post Share on other sites