Jump to content
Sign in to follow this  
dekzorro

Buat System Guna ... Php

Recommended Posts

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...

Share this post


Link to post
Share on other sites

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 by benhurism

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...