Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi Guys,
I am working on a Heavily modified OsCommerce MS2.2.2 Distribution...
at the moment i am trying to make a contribution that will allow users to display different infobox's for different account_level types, for instance franchise level is displayed franchise tools menu, wholesale has the wholesale tools menu etc...
I have some of the code ready to go and was wondering if anyone (Everah you sexc beast) could help me
[b][Filename: accountselect.php][/b]Code: Select all
if(isset($customers_id))
{
$sql = "SELECT account_level, customers_id FROM `customers` WHERE customers_id = '$customers_id'";
if(!$result = mysql_query($sql))
{
die('Could not connect to the Database' . mysql_error());
}
while($row = mysql_fetch_array($result))
{
if($row['customers_id'] == '$customers_id')
{
$admin_account = 'true';
$admin_account_level = $row['account_level'];
}
}
}$admin_account_level is set to whatever is in the database, this is the variable used to control if the box is displayed...
My next bit of code is related to how the actual box is selected,
[Filename: coloum_left.php]
Code: Select all
if(isset($admin_account_level))
{
if($admin_account_level = 1)
{ // Administration Account Level ---> DISABLED For security reasons until a more secure way is found and implemented
require(DIR_WS_BOXES . 'admintools.class.php');
}
elseif($admin_account_level = 2)
{ // Franchise Account Level
require(DIR_WS_BOXES . 'franchisetools.class.php');
}
elseif($admin_account_level = 3)
{ // Wholesale Account Level
require(DIR_WS_BOXES . 'wholesaletools.class.php');
}
elseif($admin_account_level = 4)
{ // Trade Account level
require(DIR_WS_BOXES . 'tradetools.class.php');
}
elseif($admin_account_level < 1)
{
$admin_access = 'no';
}
}Do you guys think this will work properly, or do you know of a better way to do the job that is required...
I would appreciate any help/support you can give me, of course this contribution will be distributed for free on the oscommerce site, to help make the community bigger and have more functions for the the vanilla oscommerce installations...
Thanks in Advance,
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]