abdul_zu Posted July 10, 2006 Share Posted July 10, 2006 Hi all,I am looking some idea about to create control panel with privileg. and the DB will be MySQL.Here is the full stracture which i need.I will have one Admin account who will have full access of all tools. and he will create one reseller and assign some releated tool privileg so the reseller can access what admin giving him permission.For the example:Admin have full tools:tool1 tool2 tool3tool4 tool5 tool6He created one reseller and assign assign only tool3 and tool6 from checkbox while he was creating new reseller.once reseller will login he will see only:tool3 tool6I hope this explaination will be sufficient. So please advice me what should be logic to do these setup in PHP with MySQL.Regards, Quote Link to comment https://forums.phpfreaks.com/topic/14165-php-logic-required/ Share on other sites More sharing options...
Daniel0 Posted July 10, 2006 Share Posted July 10, 2006 You mean kinda like the cPanel WHM permission system work? Quote Link to comment https://forums.phpfreaks.com/topic/14165-php-logic-required/#findComment-55489 Share on other sites More sharing options...
redarrow Posted July 10, 2006 Share Posted July 10, 2006 What is all this about are you trying to add a members system.for example a member joins the site the member signs for a high end account related to grade 6so there fore the member has the number 6 in the member deatals.you select do a select statement that says where member='6'and on the members pages only allow access to tools relating to a memeber 6 access Quote Link to comment https://forums.phpfreaks.com/topic/14165-php-logic-required/#findComment-55491 Share on other sites More sharing options...
abdul_zu Posted July 10, 2006 Author Share Posted July 10, 2006 Hello,I am doing CallShop application which is going to have multi employee. and each employee will have different privileg to access his area.for the example1- Employee * Create Phone Booth * Add balance to Booth * Rollback etc... * Modify calling rate2- Employee * Add balance * Rollback * View Call LogsWhat i was making my logic to create function for each action and store it in one table with Employee ID. so when employee will login in his control panel only those fuction will be called which is assigned by admin.Or is there any better way?Abdul Quote Link to comment https://forums.phpfreaks.com/topic/14165-php-logic-required/#findComment-55493 Share on other sites More sharing options...
redarrow Posted July 10, 2006 Share Posted July 10, 2006 Your way with admin controll is the best way in my option.Might be a lot more work but worth it.so basickly you add a number field to the users accounts and then that number relate to provilages.example1 basic2 bronz3 silver4 goldSo depending on the value of the number will controll the users previlages Quote Link to comment https://forums.phpfreaks.com/topic/14165-php-logic-required/#findComment-55496 Share on other sites More sharing options...
sasa Posted July 10, 2006 Share Posted July 10, 2006 You can add some binary representation of toolstool1 - 1tool2 - 2tool3 - 4...tooln - 2^(n-1)try[code]<?phpecho "<form method=\"POST\" action=\"\">";if ($_POST['submit']) $a=array_sum($_POST['tool']);for ($i=1;$i<7;$i++) { $b=pow(2,$i-1); $c= ($a & $b) ? "checked=\"checked\"" :""; echo "<input type=\"checkbox\" name=\"tool[]\" value=\"$b\" $c>tool$i</input><br />\n";}echo "<input type=\"submit\" name=\"submit\"></form>";if ($_POST['submit']) { $a=array_sum($_POST['tool']); echo "<hr />Put in database number $a.<hr /> When you read this number :<br />"; for ($i=1;$i<7;$i++){ $b= pow(2,$i-1); $c= ($a & $b) ? true : false; echo "tool$i - $c <br />\n"; }}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/14165-php-logic-required/#findComment-55741 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.