Jump to content

mlungisi

Members
  • Posts

    17
  • Joined

  • Last visited

About mlungisi

  • Birthday 09/10/1982

Profile Information

  • Gender
    Male
  • Location
    South Africa

mlungisi's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks Mac G, i guess im kicked in the balls and my only solution is to build a new site. unless if you can fix it for $10
  2. Thanks, I am testing on local server and still the site can display products, there to many errors on $_SESSION lines. I somehow wonder how it worked on the old server? unfortunately the server is gone and cant go back check evenrything. Can a MySQL or PHP confirg error cause this?
  3. Hi We moved a site that was developed by outsource company from old to new server and seem to be experiencing some issues on the new server. The products don’t show up anymore and no changes have been done on the code. When I turn errors on like http://mlungisi-001-site1.smarterasp.net/products.php there are some notices but surprisingly it worked on the old server. Windows 2008, IIS7 Server Errors turned on Notice: A session had already been started - ignoring session_start() in H:\root\home\mlungisi-001\www\site1\libs\products.php on line 27 session_start(); Notice: Undefined variable: iAUID in H:\root\home\mlungisi-001\www\site1\libs\users.php on line 73 GetAU($iAUID, $AUID, $Email, $Firstname, $Surname, $COID, $CellNo, $PWord, $Active_Tag); Notice: Undefined offset: 0 in H:\root\home\mlungisi-001\www\site1\libs\users.php on line 74 GetAU($iAUID, $AUID, $Email, $Firstname, $Surname, $COID, $CellNo, $PWord, $Active_Tag); Notice: Undefined offset: 0 in H:\root\home\mlungisi-001\www\site1\libs\users.php on line 75 $_SESSION['uSurName'] = $Surname[0]; Notice: Undefined index: uUserTypeID in H:\root\home\mlungisi-001\www\site1\libs\products.php on line 1244 if ($_SESSION['uUserTypeID'] == 2) I have tried to kill sessions before starting a new one but that didn’t help either. I am caught between a latch and a door, don’t know whether its code issue or PHP configurations or MySQOL. Please share ideas Attachments Products.php Users.php users.php products.php
  4. Yes that's what the form is currently doing irrespective of what option is chosen.
  5. No idea, i tool over from the person who developed the website. I guess it's not the source of the issue....
  6. I am struggling to send a PHP web form to different email addresses that are defined in arrays. The form is only sent to the last email in the arrays definition section. **Contact form code with arrays** <?php require_once('src/config.php'); $VarSecurity = new VarSecurity(); $enquiry = NULL; $chk_Locate = FALSE; if((isset($_GET['enquiry']) && $_GET['enquiry']=='Locate a dealer/distributor')||(isset($_POST['enquiry']) && $_POST['enquiry']=='Locate a dealer/distributor')){ $chk_Locate=TRUE; } if(isset($_GET['enquiry']) && $_GET['enquiry'] == 'CC'){ $query_recipients = array(array('Complaint', 'csm@examplecompany.co.za'), array('Suggestion', 'csm@examplecompany.co.za'), array('Compliment', 'csm@examplecompany.co.za')); $enquiry = '<input type="hidden" name="enquiry" id="enquiry" value="CC">'; } else{ $query_recipients = array(array('Locate a dealer/distributor', 'sales@examplecompany.co.za'), array('Technical support', 'technical@examplecompany.co.za'), array('Back orders', 'backorders@examplecompany.co.za'), array('Product enquiry', 'sales@examplecompany.co.za'), array('Catalog request', 'sales@examplecompany.co.za'), array('New customer enquiry', 'sales@examplecompany.co.za'), array('Existing customers - logon', 'dealers@examplecompany.co.za'), array('Existing customers - orders', 'weborder@examplecompany.co.za'), array('Report web problems', 'webmaster@examplecompany.co.za')); } **Config code** <?php $db_server = 'www.examplecompany.co.za'; $db = ********* $db_username = ************ $db_password = ********** $title = 'Company ABC'; $env_repo = getenv('php_repository'); if(!empty($env_repo)){ $classes = $env_repo; } else { $classes = 'src/Classes/'; } $pagination = array('items_per_page'=>300); $default_page = 'Home'; $sales_email = 'weborder@examplecompany.co.za'; $contact_email = 'info@examplecompany.co.za'; $image_path = 'http://examplecompany.co.za/src/img/email/'; ?> **Complete contact page code** <?php require_once('src/config.php'); $VarSecurity = new VarSecurity(); $enquiry = NULL; $chk_Locate = FALSE; if((isset($_GET['enquiry']) && $_GET['enquiry']=='Locate a dealer/distributor')||(isset($_POST['enquiry']) && $_POST['enquiry']=='Locate a dealer/distributor')){ $chk_Locate=TRUE; } if(isset($_GET['enquiry']) && $_GET['enquiry'] == 'CC'){ $query_recipients = array(array('Complaint', 'csm@Examplecompany.co.za'), array('Suggestion', 'csm@Examplecompany.co.za'), array('Compliment', 'csm@Examplecompany.co.za')); $enquiry = '<input type="hidden" name="enquiry" id="enquiry" value="CC">'; } else{ $query_recipients = array(array('Locate a dealer/distributor', 'sales@Examplecompany.co.za'), array('Technical support', 'technical@Examplecompany.co.za'), array('Back orders', 'backorders@Examplecompany.co.za'), array('Product enquiry', 'sales@Examplecompany.co.za'), array('Catalog request', 'sales@Examplecompany.co.za'), array('New customer enquiry', 'sales@Examplecompany.co.za'), array('Existing customers - logon', 'dealers@Examplecompany.co.za'), array('Existing customers - orders', 'weborder@Examplecompany.co.za'), array('Report web problems', 'webmaster@Examplecompany.co.za')); } $enquiry_options = ''; $selected_notes = ''; $item = NULL; if(isset($_GET['item'])){ $item=$_GET['item']; } foreach($query_recipients as $key => $val){ if((isset($_POST['enquiry']) && $_POST['enquiry'] == $val[0])||(isset($_GET['enquiry']) && $_GET['enquiry'] == $val[0])){ $selected = $val[0].' : '.$item; if($val[0]=='Existing customers - logon'||$val[0]=='Technical support'||$val[0]=='Catalog request'||$val[0]=='Product enquiry'||$val[0]=='New customer enquiry'||$val[0]=='Existing customers - orders'||$val[0]=='Catalog request'){ $selected_notes = '<br><p>• If you are an EXISTING Examplecompany dealer please enter you Examplecompany account number so that we can correctly deal with your enquiry. Please enter your username and password for verification purposes (your login details are not sent with the enquiry). If you are already logged in you will not need to enter this information</p> <p>• Please enter </p><br> <p>Examplecompany only supplies to appointed distributors, and not direct to the public.</p> <p>However, our showrooms are open to the public daily, where you can view our product range and get assistance with your queries.</p>'; }elseif($val[0]=='Locate a dealer/distributor'){ $selected_notes = '<p>• Please supply your area details in the message body, as well as surrounding suburbs</p><br>'; } } $enquiry_options .= '<option>'.$val[0].'</option>'; $recpt_email = $val[1]; } if(empty($selected)){ $selected = 'Select option'; $selected_notes = '<br><p>• If you are an EXISTING Examplecompany dealer please enter you Examplecompany account number so that we can correctly deal with your enquiry. Please enter your username and password for verification purposes (your login details are not sent with the enquiry). If you are already logged in you will not need to enter this information</p><br> <p>Examplecompany only supplies to appointed distributors, and not direct to the public.</p> <p>However, our showrooms are open to the public daily, where you can view our product range and get assistance with your queries.</p>'; } $cont_ref = NULL; $ref_number = NULL; if(isset($_POST['name'])){ $VarSecurity->protectform(); if ($Session->ID()==NULL){ $query = @mysql_query('SELECT Accnr FROM WEB_Cust WHERE Uname="'.$_POST['dealer_username'].'" AND Pword="'.md5($_POST['dealer_password']).'" AND active=1 AND AXblocked!=2 LIMIT 0,1'); $login = @mysql_num_rows($query); if($login==1){ $cust_verify = 'Dealer is verified'; $contact_email = 'info2@Examplecompany.co.za'; $Session->Logout(NULL); } else { $cust_verify = 'Dealer not verfied: username/password supplied but did not match our records.'; } }elseif($Session->ID()!=NULL){ $cust_verify = 'Dealer is verified'; $contact_email = 'info2@Examplecompany.co.za'; }else{ $cust_verify = 'Dealer not verfied: username/password not supplied.'; } if(isset($_POST['enquiry']) && $_POST['enquiry'] == 'CC'){ $done = false; while(!$done){ $ref_number = 'web'.strtolower(substr(str_replace(' ', '', $_POST['company']), 0, 1)).substr(md5(microtime()), 0, 5); $unique_query = @mysql_query('SELECT * FROM web_cms_feedback WHERE ref_number="'.$ref_number.'"'); if(@mysql_num_rows($unique_query) == 0){ $done = true; } } $insert_query = @mysql_query('INSERT INTO web_cms_feedback (Web_ref, Name, Surname, Company, Accnr, Email, Tel_cell, Enquiry, Message) VALUES ("'.$ref_number.'", "'.$_POST['name'].'", "'.$_POST['surname'].'", "'.$_POST['company'].'", "'.$_POST['accnr'].'", "'.$_POST['email'].'", "'.$_POST['tel'].'", "'.$_POST['enquiry'].'", "'.$_POST['message'].'")'); $insert_data = @mysql_fetch_array($insert_query); $cont_ref = '<br> <h4>Reference: '.$ref_number.'</h4> You will receive an automated response to your email address shortly'; } $_POST['recipient_email'] = $contact_email.','.$recpt_email; if(isset($ref_number)){ $_POST['subject'] = 'Examplecompany Group: '.$ref_number.': '.$_POST['enquiry']; }else{ $_POST['subject'] = 'Examplecompany Group: '.$_POST['enquiry']; } $_POST['sender_email'] = $_POST['email']; $_POST['cc'] = $_POST['email'].', Examplecompany Group <Examplecompany.orders@gmail.com>'; $_POST['body'] = '<p>Name: ' . $_POST['name'] . '</p>' . '<p>Surname: ' . $_POST['surname'] . '</p>' . '<p>Company: ' . $_POST['company'] . '</p>' . '<p>Examplecompany Account No.: ' . $_POST['accnr'] . '</p>' . '<p>Account No. verification: ' . $cust_verify . '</p>' . '<p>Email: ' . $_POST['email'] . '</p>' . '<p>Tel/cell: ' . $_POST['tel'] . '</p>' . $_POST['enquiry'] . ': ' . $_POST['message']; if(Email::Send($_POST, NULL)){ $message = 'Your feedback has been sent'.$cont_ref; } else { $message = 'There was an error sending your feedback'; } } $Newproducts = new NewProducts(); global $body; $body = '<div class="column-310 float-left"> <div class="block-khaki home-highlights"> <div class="padding-10"> <h1 class="text-white">Welcome to Examplecompany</h1> <br/> <p>We are committed to a brighter future by creating lighting and electrical solutions which are beautiful by design and inspired by the environment. We are certain that you will find lighting and electrical products that compliment your life space and enlighten you.</p> </div> </div> <div class="gap-hoz-small"></div> <div class="block-khaki home-newprod"> <div class="padding-10"> </div> <table width="100%" border="0" cellspacing="0" cellpadding="10"> <tr> <td align="center"><img src="src/img/contact/Examplecompany-arial-view.jpg" width="288" height="228" /></td> </tr> </table> </div> </div>'; echo $body; ?> <div class="gap-vert float-left"></div> <div class="column-630 float-left"> <h1 class="text-grey">Contact feedback</h1> <br/> <p class="message"><?php echo (isset($message) ? $message : NULL); ?></p> <br/> <form id="form" action="?page=contact-feedback" method="post"> <div class="form order-form"> <?php if($Session->ID()==NULL && $chk_Locate==FALSE):?> <div><label>Examplecompany Account No.</label><div><input type="text" name="accnr" id="accnr" class="input" maxlength="100" value=" "/></div></div> <p class="clear"></p> <div><label>User name</label><div><input type="text" name="dealer_username" id="dealer_username" class="input dealer-input"/></div></div> <p class="clear"></p> <div><label>Password</label><div><input type="password" name="dealer_password" id="dealer_password" class="input dealer-input"/></div></div> <p class="clear"></p> <?php elseif($chk_Locate==FALSE):?> <input type="hidden" name="accnr" id="accnr" class="input" maxlength="100" value="<?php echo $Session->ID();?>"/> <?php endif?> <p class="clear"></p><br /> <div><label>Name</label><div><input type="text" name="name" id="name" value="" class="input"/></div></div> <p class="clear"></p> <div><label>Surname</label><div><input type="text" name="surname" id="surname" value="" class="input"/></div></div> <p class="clear"></p> <div><label>Company</label><div><input type="text" name="company" id="company" value="" class="input"/></div></div> <p class="clear"></p> <div><label>Email</label><div><input type="text" name="email" id="email" class="input" maxlength="100"/></div></div> <p class="clear"></p> <div><label>Tel/cell</label><div><input type="text" name="tel" id="tel" class="input" maxlength="50"/></div></div> <p class="clear"></p> <div><label>Enquiry</label><div><select name="enquiry" id="enquiry" class="select"><option selected="selected"><?php echo $selected ?></option><?php echo $enquiry_options ?></select></div></div> <p class="clear"></p> <div><label>Message</label><div><textarea name="message" id="message" rows="5" cols="10" class="textarea"></textarea></div></div> </div> <div> <?php echo $selected_notes?> <br/> <?php echo $enquiry?> <input type="submit" id="submit" value="submit" class="submit-khaki" onclick="javascript:return mail.Send();"/> <p class="clear"></p> <br/> </div> </form> <br /> <p><input type="submit" value="Back" class="submit-khaki float-right" onclick="javascript:window.history.back();"/></p> </div> The email goes to info@examplecompany.co.za email and the last email (Webmaster@examplecompany.co.za) on arrays group. Please help.
  7. For now the code sends email to: info@mycompany.com the email in config.php "$contact_email = 'info@mycompany.com';" and webmaster@mycompany.com the last email in the arrays "array('Report web problems', 'webmaster@mycompany.com'));". It doesn't matter what subject the user chooses, the emails are sent to those two email addresses.
  8. Hi there Please help, the form suppose to send email to different email address depending on enquiry option selected. Currently the form doesn?t do that and I cant seem to find or fix this issue. Contact page code <?php require_once('src/config.php'); $VarSecurity = new VarSecurity(); $enquiry = NULL; $chk_Locate = FALSE; if((isset($_GET['enquiry']) && $_GET['enquiry']=='Locate a dealer/distributor')||(isset($_POST['enquiry']) && $_POST['enquiry']=='Locate a dealer/distributor')){ $chk_Locate=TRUE; } if(isset($_GET['enquiry']) && $_GET['enquiry'] == 'CC'){ $query_recipients = array(array('Complaint', 'csm@mycompany.com'), array('Suggestion', 'csm@mycompany.com'), array('Compliment', 'csm@mycompany.com')); $enquiry = '<input type="hidden" name="enquiry" id="enquiry" value="CC">'; } else{ $query_recipients = array(array('Locate a dealer/distributor', 'sales@mycompany.com'), array('Technical support', 'technical@mycompany.com'), array('Back orders', 'backorders@mycompany.com'), array('Product enquiry', 'sales@mycompany.com'), array('Catalog request', 'sales@mycompany.com'), array('New customer enquiry', 'sales@mycompany.com'), array('Existing customers - logon', 'dealers@mycompany.com'), array('Existing customers - orders', 'weborder@mycompany.com'), array('Report web problems', 'webmaster@mycompany.com')); } $enquiry_options = ''; $selected_notes = ''; $item = NULL; if(isset($_GET['item'])){ $item=$_GET['item']; } foreach($query_recipients as $key => $val){ if((isset($_POST['enquiry']) && $_POST['enquiry'] == $val[0])||(isset($_GET['enquiry']) && $_GET['enquiry'] == $val[0])){ $selected = $val[0].' : '.$item; if($val[0]=='Existing customers - logon'||$val[0]=='Technical support'||$val[0]=='Catalog request'||$val[0]=='Product enquiry'||$val[0]=='New customer enquiry'||$val[0]=='Existing customers - orders'||$val[0]=='Catalog request'){ $selected_notes = '<br><p>• If you are an EXISTING Radiant dealer please enter you Radiant account number so that we can correctly deal with your enquiry. Please enter your username and password for verification purposes (your login details are not sent with the enquiry). If you are already logged in you will not need to enter this information</p> <p>• Please enter </p><br> <p>Radiant only supplies to appointed distributors, and not direct to the public.</p> <p>However, our showrooms are open to the public daily, where you can view our product range and get assistance with your queries.</p>'; }elseif($val[0]=='Locate a dealer/distributor'){ $selected_notes = '<p>• Please supply your area details in the message body, as well as surrounding suburbs</p><br>'; } } $enquiry_options .= '<option>'.$val[0].'</option>'; $recpt_email = $val[1]; } if(empty($selected)){ $selected = 'Select option'; $selected_notes = '<br><p>• If you are an EXISTING Radiant dealer please enter you Radiant account number so that we can correctly deal with your enquiry. Please enter your username and password for verification purposes (your login details are not sent with the enquiry). If you are already logged in you will not need to enter this information</p><br> <p>Radiant only supplies to appointed distributors, and not direct to the public.</p> <p>However, our showrooms are open to the public daily, where you can view our product range and get assistance with your queries.</p>'; } $cont_ref = NULL; $ref_number = NULL; if(isset($_POST['name'])){ $VarSecurity->protectform(); if ($Session->ID()==NULL){ $query = @mysql_query('SELECT Accnr FROM WEB_Cust WHERE Uname="'.$_POST['dealer_username'].'" AND Pword="'.md5($_POST['dealer_password']).'" AND active=1 AND AXblocked!=2 LIMIT 0,1'); $login = @mysql_num_rows($query); if($login==1){ $cust_verify = 'Dealer is verified'; $contact_email = 'info2@mycompany.com'; $Session->Logout(NULL); } else { $cust_verify = 'Dealer not verfied: username/password supplied but did not match our records.'; } }elseif($Session->ID()!=NULL){ $cust_verify = 'Dealer is verified'; $contact_email = 'info2@radiant.co.za'; }else{ $cust_verify = 'Dealer not verfied: username/password not supplied.'; } if(isset($_POST['enquiry']) && $_POST['enquiry'] == 'CC'){ $done = false; while(!$done){ $ref_number = 'web'.strtolower(substr(str_replace(' ', '', $_POST['company']), 0, 1)).substr(md5(microtime()), 0, 5); $unique_query = @mysql_query('SELECT * FROM web_cms_feedback WHERE ref_number="'.$ref_number.'"'); if(@mysql_num_rows($unique_query) == 0){ $done = true; } } $insert_query = @mysql_query('INSERT INTO web_cms_feedback (Web_ref, Name, Surname, Company, Accnr, Email, Tel_cell, Enquiry, Message) VALUES ("'.$ref_number.'", "'.$_POST['name'].'", "'.$_POST['surname'].'", "'.$_POST['company'].'", "'.$_POST['accnr'].'", "'.$_POST['email'].'", "'.$_POST['tel'].'", "'.$_POST['enquiry'].'", "'.$_POST['message'].'")'); $insert_data = @mysql_fetch_array($insert_query); $cont_ref = '<br> <h4>Reference: '.$ref_number.'</h4> You will receive an automated response to your email address shortly'; } $_POST['recipient_email'] = $contact_email.','.$recpt_email; if(isset($ref_number)){ $_POST['subject'] = 'Radiant Group: '.$ref_number.': '.$_POST['enquiry']; }else{ $_POST['subject'] = 'Radiant Group: '.$_POST['enquiry']; } $_POST['sender_email'] = $_POST['email']; $_POST['cc'] = $_POST['email'].', Radiant Group <radiant.orders@gmail.com>'; $_POST['body'] = '<p>Name: ' . $_POST['name'] . '</p>' . '<p>Surname: ' . $_POST['surname'] . '</p>' . '<p>Company: ' . $_POST['company'] . '</p>' . '<p>Radiant Account No.: ' . $_POST['accnr'] . '</p>' . '<p>Account No. verification: ' . $cust_verify . '</p>' . '<p>Email: ' . $_POST['email'] . '</p>' . '<p>Tel/cell: ' . $_POST['tel'] . '</p>' . $_POST['enquiry'] . ': ' . $_POST['message']; if(Email::Send($_POST, NULL)){ $message = 'Your feedback has been sent'.$cont_ref; } else { $message = 'There was an error sending your feedback'; } } $Newproducts = new NewProducts(); global $body; $body = '<div class="column-310 float-left"> <div class="block-khaki home-highlights"> <div class="padding-10"> <h1 class="text-white">Welcome to Radiant</h1> <br/> <p>We are committed to a brighter future by creating lighting and electrical solutions which are beautiful by design and inspired by the environment. We are certain that you will find lighting and electrical products that compliment your life space and enlighten you.</p> </div> </div> <div class="gap-hoz-small"></div> <div class="block-khaki home-newprod"> <div class="padding-10"> <h1 class="text-white">New Products</h1> </div> '.$Newproducts->Display().' </div> </div>'; echo $body; ?> <div class="gap-vert float-left"></div> <div class="column-630 float-left"> <h1 class="text-grey">Contact feedback</h1> <br/> <p class="message"><?php echo (isset($message) ? $message : NULL); ?></p> <br/> <form id="form" action="?page=contact-feedback" method="post"> <div class="form order-form"> <?php if($Session->ID()==NULL && $chk_Locate==FALSE):?> <div><label>Radiant Account No.</label><div><input type="text" name="accnr" id="accnr" class="input" maxlength="100" value=" "/></div></div> <p class="clear"></p> <div><label>User name</label><div><input type="text" name="dealer_username" id="dealer_username" class="input dealer-input"/></div></div> <p class="clear"></p> <div><label>Password</label><div><input type="password" name="dealer_password" id="dealer_password" class="input dealer-input"/></div></div> <p class="clear"></p> <?php elseif($chk_Locate==FALSE):?> <input type="hidden" name="accnr" id="accnr" class="input" maxlength="100" value="<?php echo $Session->ID();?>"/> <?php endif?> <p class="clear"></p><br /> <div><label>Name</label><div><input type="text" name="name" id="name" value="" class="input"/></div></div> <p class="clear"></p> <div><label>Surname</label><div><input type="text" name="surname" id="surname" value="" class="input"/></div></div> <p class="clear"></p> <div><label>Company</label><div><input type="text" name="company" id="company" value="" class="input"/></div></div> <p class="clear"></p> <div><label>Email</label><div><input type="text" name="email" id="email" class="input" maxlength="100"/></div></div> <p class="clear"></p> <div><label>Tel/cell</label><div><input type="text" name="tel" id="tel" class="input" maxlength="50"/></div></div> <p class="clear"></p> <div><label>Enquiry</label><div><select name="enquiry" id="enquiry" class="select"><option selected="selected"><?php echo $selected ?></option><?php echo $enquiry_options ?></select></div></div> <p class="clear"></p> <div><label>Message</label><div><textarea name="message" id="message" rows="5" cols="10" class="textarea"></textarea></div></div> </div> <div> <?php echo $selected_notes?> <br/> <?php echo $enquiry?> <input type="submit" id="submit" value="submit" class="submit-khaki" onclick="javascript:return mail.Send();"/> <p class="clear"></p> <br/> </div> </form> <br /> <p><input type="submit" value="Back" class="submit-khaki float-right" onclick="javascript:window.history.back();"/></p> </div> Config.php code <?php $db_server = '100.1001.1001.10'; $db = 'Database'; $db_username = 'username'; $db_password = 'password'; $title = 'Radiant Group (Pty) Ltd'; $env_repo = getenv('php_repository'); if(!empty($env_repo)){ $classes = $env_repo; } else { $classes = 'src/Classes/'; } $pagination = array('items_per_page'=>300); $default_page = 'Home'; $sales_email = 'weborder@mycompany.com'; $contact_email = 'info@mycompany.com'; $image_path = 'http://www.mycompany.com/src/img/email/'; ?>
  9. Thanks Requinix for feedback, i took over the site and i'm not the initial developer, any idea on how to fix this? the code is attached in my initial post.
  10. Hi I need help to fix a bug that causes a repetition of &amp;amp;amp;amp; in links. The links are added via admin area and the site used MYSql database. Link should be: www.mycompany.com/?page=contact-feedback&enquiry=Locate but its renderd as www.mycompany.com/?page=contact-feedback&amp;amp;amp;amp;enquiry=Locate and the ;amp increases when i update the links Please help to fix this, i'm not advance in PHP. Thanks Code attached. 18430_.php
  11. HI, i'm back from Easter holiday and hope you had a safe break. The website is http://www.radiant.co.za Product view: http://www.radiant.co.za/?page=Product&id=JH108&group= I want to show the name of the product on title. Product name = JH108: Chandelier 240v - Tellus 3-light bar Also this will help when users share the product page on social network, the product name will be automatically posted. The product name/description is pulled from MySQL by <?php echo $Pagedescr?> and that's what i want to put in the site title.
  12. Search.php code <?php class Search{ function Search(){ global $body; $body = NULL; $VarSecurity = new VarSecurity(); if(isset($_POST['advanced_material'])){ $_GET['advanced_material'] = $VarSecurity->Security($_POST['advanced_material']); }elseif(isset($_GET['advanced_material'])){ $_GET['advanced_material'] = $VarSecurity->Security($_GET['advanced_material']); } if(isset($_POST['advanced_lamp'])){ $_GET['advanced_lamp'] = $VarSecurity->Security($_POST['advanced_lamp']); }elseif(isset($_GET['advanced_lamp'])){ $_GET['advanced_lamp'] = $VarSecurity->Security($_GET['advanced_lamp']); } if(isset($_POST['advanced_application'])){ $_GET['advanced_application'] = $VarSecurity->Security($_POST['advanced_application']); }elseif(isset($_GET['advanced_application'])){ $_GET['advanced_application'] = $VarSecurity->Security($_GET['advanced_application']); } if(isset($_GET['keyword'])){ $_POST['keyword'] = $VarSecurity->Security($_GET['keyword']); }elseif(isset($_POST['keyword'])){ $_POST['keyword'] = $VarSecurity->Security($_POST['keyword']); } if(isset($_GET['code'])){ $_POST['code'] = $VarSecurity->Security($_GET['code']); }elseif(isset($_POST['code'])){ $_POST['code'] = $VarSecurity->Security($_POST['code']); } if(isset($_GET['division2'])) $_GET['division2'] = $VarSecurity->Security($_GET['division2']); if(isset($_GET['division'])) $_GET['division'] = $VarSecurity->Security($_GET['division']); if(isset($_GET['c_id'])) $_GET['c_id'] = $VarSecurity->Security($_GET['c_id']); if(isset($_GET['sc_id'])) $_GET['sc_id'] = $VarSecurity->Security($_GET['sc_id']); if(isset($_GET['p_p'])) $_GET['p_p'] = $VarSecurity->Security($_GET['p_p']); if(isset($_GET['type'])) $_GET['type'] = $VarSecurity->Security($_GET['type']); if(isset($_POST['adv_search'])) $_POST['adv_search'] = $VarSecurity->Security($_POST['adv_search']); if(isset($_POST['keyword']) || isset($_POST['code']) || isset($_GET['advanced_material']) || isset($_GET['advanced_lamp']) || isset($_GET['advanced_application']) || isset($_GET['division']) || isset($_GET['type'])){ $this->Result(); } } function Result(){ $rows = 1; $link = NULL; $title = NULL; $division_breadcrumb = NULL; $category_breadcrumb = NULL; $subcat_breadcrumb = NULL; //Advanced search is used if(isset($_GET['advanced_material']) || isset($_GET['advanced_lamp']) || isset($_GET['advanced_application'])){ $link = 'page=Search&advanced_material='.$_GET['advanced_material'].'&advanced_lamp='.$_GET['advanced_lamp'].'&advanced_application='.$_GET['advanced_application']; //for pagination $x=0; $material = '---'; //set non-existing value to search on heading3, where option is NOT selected, for querying if(!empty($_GET['advanced_material'])){ $material = $_GET['advanced_material']; $x++; } $lamp = '---'; //same as above if(!empty($_GET['advanced_lamp'])){ $lamp = $_GET['advanced_lamp']; $x++; } $application = '---';//same as above if(!empty($_GET['advanced_application'])){ $application = $_GET['advanced_application']; $x++; } //for filtering search results by division->category $division = ''; $cat = ''; $s_cat = ''; if ((!empty($_GET['division2']))&&(!empty($_GET['c_id']))){ $division = 'AND OLAPProductGroup = '.$_GET['division2']; $cat = 'AND Dimension3_ = "'.$_GET['c_id'].'"'; $link .= '&division2='.$_GET['division2'].'&c_id='.$_GET['c_id']; if (empty($_GET['division'])){ $_GET['division'] = $_GET['division2']; } } if (!empty($_GET['sc_id'])){ $link .= '&sc_id='.$_GET['sc_id']; $s_cat = 'AND Dimension4_ = "'.$_GET['sc_id'].'"'; } //search result $query_string = 'SELECT WEB_InventTable.ItemId, ItemName, OLAPProductGroup, Dimension3_, Dimension4_, WEB_InventTable.Group, GroupView, InventInclusionGroupId, SpecialInventInclusionGroup, Discontinued, web_admin_options.title FROM web_admin_options, WEB_InventTable LEFT JOIN WEB_Data ON (WEB_Data.ItemId = WEB_InventTable.ItemId AND WEB_InventTable.Webitem=1) LEFT JOIN WEB_Heading3 ON (WEB_Data.Heading3 = WEB_Heading3.HeadId AND WEB_Data.Heading2 = WEB_Heading3.Heading2) WHERE WEB_Data.Heading1 = "Srch" and WEB_InventTable.OLAPProductGroup = web_admin_options.division_id and web_admin_options.type = "division" AND WEB_Data.Heading3 IN ("'.$material.'", "'.$lamp.'", "'.$application.'") '.$division.' '.$cat.' '.$s_cat.' GROUP BY WEB_InventTable.ItemId, ItemName, OLAPProductGroup, Dimension3_, Dimension4_, WEB_InventTable.Group, GroupView, InventInclusionGroupId, SpecialInventInclusionGroup HAVING count(WEB_Data.ItemId)>('.$x.')-1 ORDER BY OLAPProductGroup, Dimension3_, Dimension4_, ItemId ASC'; // echo $query = @mysql_query($query_string); $rows = @mysql_num_rows($query); $data = @mysql_fetch_array($query); $title = 'Search results: (advanced search)'; //Get Division->category for links (filtering) $query_string2 = 'SELECT WEB_InventTable.ItemId, OLAPProductGroup, Dimension3_, InventInclusionGroupId, web_olapprodcat.Description, SpecialInventInclusionGroup, web_admin_options.title FROM web_admin_options, web_olapprodcat, WEB_InventTable LEFT JOIN WEB_Data ON ( WEB_Data.ItemId = WEB_InventTable.ItemId AND WEB_InventTable.Webitem=1) LEFT JOIN WEB_Heading3 ON ( WEB_Data.Heading3 = WEB_Heading3.HeadId AND WEB_Data.Heading2 = WEB_Heading3.Heading2 ) WHERE web_olapprodcat.CATID = WEB_InventTable.Dimension3_ AND WEB_InventTable.OLAPProductGroup = web_admin_options.division_id and web_admin_options.type = "division" AND WEB_Data.Heading1 = "Srch" AND WEB_Data.Heading3 IN ("'.$material.'", "'.$lamp.'", "'.$application.'") GROUP BY WEB_InventTable.ItemId, OLAPProductGroup, Dimension3_, InventInclusionGroupId, web_olapprodcat.Description, SpecialInventInclusionGroup HAVING count(WEB_Data.ItemId)>('.$x.')-1 ORDER BY OLAPProductGroup, Dimension3_, ItemId ASC'; $query2 = @mysql_query($query_string2); $data2 = @mysql_fetch_array($query2); $temp3 = ''; $check1 = ''; $check2 = ''; $link_counter = 1; //formating filter links for display if (!empty($data2)){ mysql_data_seek($query2,0); $filters=array(); $counter=1; while($data2 = @mysql_fetch_array($query2)){ if ($check1!=$data2['OLAPProductGroup']){ $filters[$counter] = array("div"=>'<a href="#">'.$data2['title'].'</a>',"cats"=>NULL); $check1=$data2['OLAPProductGroup']; $counter++; $link_counter=1; } if (($check2!=$data2['Dimension3_'])&&($link_counter<=2)){ $filters[$counter-1]["cats"] .= '<span></span><a href="?page=Search&division2='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&advanced_material='.$_GET['advanced_material'].'&advanced_lamp='.$_GET['advanced_lamp'].'&advanced_application='.$_GET['advanced_application'].'">'.$data2['Description'].'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } elseif (($check2!=$data2['Dimension3_'])&&($link_counter>2)){ $filters[$counter-1]["cats"] .= '<span></span><a href="?page=Search&division2='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&advanced_material='.$_GET['advanced_material'].'&advanced_lamp='.$_GET['advanced_lamp'].'&advanced_application='.$_GET['advanced_application'].'" title="'.$data2['Description'].'">'.$link_counter.'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } } } if(isset($counter)){ for($r=1;$r<$counter;$r++){ $division_breadcrumb .= $filters[$r]["div"].$filters[$r]["cats"].'<p class="clear"></p>'; } } mysql_free_result($query2); unset($_GET['division2'],$data2); //Code or keyword is used } elseif (isset($_POST['keyword']) || isset($_POST['code'])){ $keyword = NULL; if(isset($_POST['keyword'])){ if($_POST['keyword'] != 'keyword' && $_POST['keyword'] != ''){ if(strpos($_POST['keyword'],' ')!==false){ $_POST['keyword'] = str_replace(' ', ' +',$_POST['keyword']); if((strpos($_POST['keyword'],'s ')!==false) && (strpos($_POST['keyword'],'ss ')===false)) $_POST['keyword'] = str_replace('s ', ' ',$_POST['keyword']); if(substr($_POST['keyword'],strlen($_POST['keyword'])-1)=='s') $_POST['keyword'] = substr($_POST['keyword'],0,(strlen($_POST['keyword'])-1)); $keyword = 'AND MATCH (WEB_InventTable.ItemName,WEB_InventTable.Description) AGAINST ("+'.$_POST['keyword'].'" IN BOOLEAN MODE)'; }else{ if(substr($_POST['keyword'],strlen($_POST['keyword'])-1)=='s') $_POST['keyword'] = substr($_POST['keyword'],0,(strlen($_POST['keyword'])-1)); $keyword = 'AND (ItemName LIKE "% '.$_POST['keyword'].' %" OR ItemName LIKE "'.$_POST['keyword'].' %" OR ItemName LIKE " %'.$_POST['keyword'].'") '; } } if($_POST['keyword'] == 'keyword'){ $_POST['keyword'] = NULL; } } $code = NULL; if(isset($_POST['code'])){ if($_POST['code'] != 'code' && $_POST['code'] != '' && $_POST['code'] != 'code'){ $code = 'AND ItemId LIKE "%'.$_POST['code'].'%"'; } if($_POST['code'] == 'code'){ $_POST['code'] = NULL; } } $link = 'page=Search&keyword='.$_POST['keyword'].'&code='.$_POST['code']; //for filtering search results by division->category $division = ''; $cat = ''; $s_cat=''; if ((!empty($_GET['division2']))&&(!empty($_GET['c_id']))){ $division = 'AND OLAPProductGroup = '.$_GET['division2']; $cat = 'AND Dimension3_ = "'.$_GET['c_id'].'"'; $link = $link.'&division2='.$_GET['division2'].'&c_id='.$_GET['c_id']; if (empty($_GET['division'])){ $_GET['division'] = $_GET['division2']; } } if (!empty($_GET['sc_id'])){ $link .= '&sc_id='.$_GET['sc_id']; $s_cat = 'AND Dimension4_ = "'.$_GET['sc_id'].'"'; } //search results $query_string = 'SELECT ItemId, ItemName, OLAPProductGroup, Dimension3_, Dimension4_, WEB_InventTable.Group, GroupView, InventInclusionGroupId, SpecialInventInclusionGroup, Discontinued, web_admin_options.title FROM WEB_InventTable, web_admin_options WHERE WEB_InventTable.OLAPProductGroup = web_admin_options.division_id and web_admin_options.type = "division" AND WEB_InventTable.Webitem=1 AND Dimension3_!="" '.$keyword.' '.$code.' '.$division.' '.$cat.' '.$s_cat.' ORDER BY OLAPProductGroup, Dimension3_, Dimension4_, ItemID ASC'; $query = @mysql_query($query_string); $rows = @mysql_num_rows($query); $keyword_title = NULL; if(!empty($keyword)){ $keyword_title = ' (keyword: '.str_replace(' +', ' ', $_POST['keyword']).')'; } $code_title = NULL; if(!empty($code)){ $code_title = ' (code: '.$_POST['code'].')'; } $title = 'Search result'.$keyword_title.$code_title; //Get Division->category for links (filtering) $query_string2 = 'SELECT WEB_InventTable.OLAPProductGroup, WEB_InventTable.Dimension3_, WEB_InventTable.InventInclusionGroupId, WEB_InventTable.SpecialInventInclusionGroup, web_olapprodcat.Description, web_admin_options.title FROM WEB_InventTable, web_olapprodcat, web_admin_options WHERE WEB_InventTable.OLAPProductGroup = web_admin_options.division_id and web_admin_options.type = "division" AND WEB_InventTable.Webitem=1 AND WEB_InventTable.Dimension3_!="" '.$keyword.' '.$code.' AND web_olapprodcat.CATID = WEB_InventTable.Dimension3_ GROUP BY WEB_InventTable.OLAPProductGroup, WEB_InventTable.Dimension3_ ORDER BY WEB_InventTable.OLAPProductGroup, WEB_InventTable.Dimension3_ ASC'; $query2 = @mysql_query($query_string2); $data2 = @mysql_fetch_array($query2); $temp3 = ''; $check1 = ''; $check2 = ''; $link_counter = 1; //formating filter links for display if (!empty($data2)){ mysql_data_seek($query2,0); while($data2 = @mysql_fetch_array($query2)){ if ($check1!=$data2['OLAPProductGroup']){ if (empty($check1)) { $a = '<a href="#">'.$data2['title'].'</a>'; $check1=$data2['OLAPProductGroup']; if (($check2!=$data2['Dimension3_'])&&($link_counter<=2)){//display first 2 category descriptions $b = '<span></span><a href="?page=Search&division2='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&keyword='.$_POST['keyword'].'&code='.$_POST['code'].'">'.$data2['Description'].'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } elseif (($check2!=$data2['Dimension3_'])&&($link_counter>2)){//display rest of categories as numbers with category names as link title $b = '<span></span><a href="?page=Search&division2='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&keyword='.$_POST['keyword'].'&code='.$_POST['code'].'" title="'.$data2['Description'].'">'.$link_counter.'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } } else { $a = '<p class="clear"></p><a href="#">'.$data2['title'].'</a>'; $link_counter=1; if (($check2!=$data2['Dimension3_'])&&($link_counter<=2)){//same as above $b = '<span></span><a href="?page=Search&division2='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&keyword='.$_POST['keyword'].'&code='.$_POST['code'].'">'.$data2['Description'].'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } elseif (($check2!=$data2['Dimension3_'])&&($link_counter>2)){//same as above $b = '<span></span><a href="?page=Search&division2='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&keyword='.$_POST['keyword'].'&code='.$_POST['code'].'" title="'.$data2['Description'].'">'.$link_counter.'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } } } else { $a = ''; if (($check2!=$data2['Dimension3_'])&&($link_counter<=2)){ $b = '<a href="?page=Search&division2='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&keyword='.$_POST['keyword'].'&code='.$_POST['code'].'"> | '.$data2['Description'].'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } elseif (($check2!=$data2['Dimension3_'])&&($link_counter>2)){ $b = '<a href="?page=Search&division2='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&keyword='.$_POST['keyword'].'&code='.$_POST['code'].'" title="'.$data2['Description'].'"> | '.$link_counter.'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } } $check1=$data2['OLAPProductGroup']; $check2=$data2['Dimension3_']; $temp3 = $temp3.$a.$b; } } $division_breadcrumb = $temp3; //mysql_free_result($query2); unset($_GET['division2'],$data2); //New products }elseif(!empty($_GET['type']) && $_GET['type']=='newproducts'){ $link = 'page=Search&type=newproducts'; //for filtering search results by division->category $division = ''; $cat = ''; $s_cat=''; if ((!empty($_GET['division']))&&(!empty($_GET['c_id']))){ $division = 'AND OLAPProductGroup = '.$_GET['division']; $cat = 'AND Dimension3_ = "'.$_GET['c_id'].'"'; $link .= '&division='.$_GET['division'].'&c_id='.$_GET['c_id']; if (empty($_GET['division'])){ $_GET['division'] = $_GET['division2']; } } if (!empty($_GET['sc_id'])){ $link .= '&sc_id='.$_GET['sc_id']; $s_cat = 'AND Dimension4_ = "'.$_GET['sc_id'].'"'; } //search results $query_string = 'SELECT WEB_InventTable.ItemId, WEB_InventTable.ItemName, WEB_InventTable.OLAPProductGroup, WEB_InventTable.Dimension3_, WEB_InventTable.Dimension4_, WEB_InventTable.Group, WEB_InventTable.GroupView, WEB_InventTable.InventInclusionGroupId, WEB_InventTable.SpecialInventInclusionGroup, WEB_InventTable.Discontinued,web_admin_options.title FROM web_admin_options, WEB_InventTable INNER JOIN web_newproduct ON WEB_InventTable.ItemId = web_newproduct.ItemId WHERE WEB_InventTable.OLAPProductGroup = web_admin_options.division_id AND web_admin_options.type = "division" AND WEB_InventTable.Webitem=1 AND Dimension3_!="" '.$division.' '.$cat.' '.$s_cat.' ORDER BY OLAPProductGroup, Dimension3_, Dimension4_, ItemID ASC'; $query = @mysql_query($query_string); $rows = @mysql_num_rows($query); $title = 'Search result (new products)'; //Get Division->category for links (filtering) $query_string2 = 'SELECT DISTINCT WEB_InventTable.OLAPProductGroup, WEB_InventTable.Dimension3_, WEB_InventTable.InventInclusionGroupId, web_olapprodcat.Description,web_admin_options.title FROM web_admin_options, web_olapprodcat, WEB_InventTable INNER JOIN web_newproduct ON WEB_InventTable.ItemId = web_newproduct.ItemId WHERE WEB_InventTable.OLAPProductGroup = web_admin_options.division_id AND web_admin_options.type = "division" AND WEB_InventTable.Webitem=1 AND Dimension3_!="" AND web_olapprodcat.CATID = WEB_InventTable.Dimension3_ GROUP BY WEB_InventTable.OLAPProductGroup, WEB_InventTable.Dimension3_ ORDER BY WEB_InventTable.OLAPProductGroup, WEB_InventTable.Dimension3_ ASC'; $query2 = @mysql_query($query_string2); $data2 = @mysql_fetch_array($query2); $temp3 = ''; $check1 = ''; $check2 = ''; $link_counter = 1; //formating filter links for display if (!empty($data2)){ mysql_data_seek($query2,0); while($data2 = @mysql_fetch_array($query2)){ if ($check1!=$data2['OLAPProductGroup']){ if (empty($check1)) { $a = '<a href="#">'.$data2['title'].'</a>'; $check1=$data2['OLAPProductGroup']; if (($check2!=$data2['Dimension3_'])&&($link_counter<=2)){//display first 2 category descriptions $b = '<span></span><a href="?page=Search&division='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&type=newproducts">'.$data2['Description'].'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } elseif (($check2!=$data2['Dimension3_'])&&($link_counter>2)){//display rest of categories as numbers with category names as link title $b = '<span></span><a href="?page=Search&division='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&type=newproducts" title="'.$data2['Description'].'">'.$link_counter.'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } } else { $a = '<p class="clear"></p><a href="#">'.$data2['title'].'</a>'; $link_counter=1; if (($check2!=$data2['Dimension3_'])&&($link_counter<=2)){//same as above $b = '<span></span><a href="?page=Search&division='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&type=newproducts">'.$data2['Description'].'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } elseif (($check2!=$data2['Dimension3_'])&&($link_counter>2)){//same as above $b = '<span></span><a href="?page=Search&division='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&type=newproducts" title="'.$data2['Description'].'">'.$link_counter.'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } } } else { $a = ''; if (($check2!=$data2['Dimension3_'])&&($link_counter<=2)){ $b = '<a href="?page=Search&division='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&type=newproducts"> | '.$data2['Description'].'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } elseif (($check2!=$data2['Dimension3_'])&&($link_counter>2)){ $b = '<a href="?page=Search&division='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&type=newproducts" title="'.$data2['Description'].'"> | '.$link_counter.'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } } $check1=$data2['OLAPProductGroup']; $check2=$data2['Dimension3_']; $temp3 = $temp3.$a.$b; } } $division_breadcrumb = $temp3; mysql_free_result($query2); unset($_GET['division2'],$data2); //Discontinued items }elseif(!empty($_GET['type']) && $_GET['type']=='endrange'){ $link = 'page=Search&type=endrange'; //for filtering search results by division->category $division = ''; $cat = ''; $s_cat=''; if ((!empty($_GET['division']))&&(!empty($_GET['c_id']))){ $division = 'AND OLAPProductGroup = '.$_GET['division']; $cat = 'AND Dimension3_ = "'.$_GET['c_id'].'"'; $link .= '&division='.$_GET['division'].'&c_id='.$_GET['c_id']; if (empty($_GET['division'])){ $_GET['division'] = $_GET['division2']; } } if (!empty($_GET['sc_id'])){ $link .= '&sc_id='.$_GET['sc_id']; $s_cat = 'AND Dimension4_ = "'.$_GET['sc_id'].'"'; } //search results $query_string = 'SELECT WEB_InventTable.ItemId, WEB_InventTable.ItemName, WEB_InventTable.OLAPProductGroup, WEB_InventTable.Dimension3_, WEB_InventTable.Dimension4_, WEB_InventTable.Group, WEB_InventTable.GroupView, WEB_InventTable.InventInclusionGroupId, WEB_InventTable.SpecialInventInclusionGroup, WEB_InventTable.Discontinued,web_admin_options.title FROM web_admin_options, WEB_InventTable WHERE WEB_InventTable.OLAPProductGroup = web_admin_options.division_id AND web_admin_options.type = "division" AND WEB_InventTable.Webitem=1 AND Discontinued=1 AND Dimension3_!="" '.$division.' '.$cat.' '.$s_cat.' ORDER BY OLAPProductGroup, Dimension3_, Dimension4_, ItemID ASC'; $query = @mysql_query($query_string); $rows = @mysql_num_rows($query); $title = 'Search result (end of range products)'; //Get Division->category for links (filtering) $query_string2 = 'SELECT DISTINCT WEB_InventTable.OLAPProductGroup, WEB_InventTable.Dimension3_, WEB_InventTable.InventInclusionGroupId, web_olapprodcat.Description,web_admin_options.title FROM web_olapprodcat, WEB_InventTable,web_admin_options WHERE WEB_InventTable.OLAPProductGroup = web_admin_options.division_id AND web_admin_options.type = "division" AND WEB_InventTable.Webitem=1 AND Discontinued=1 AND Dimension3_!="" AND web_olapprodcat.CATID = WEB_InventTable.Dimension3_ GROUP BY WEB_InventTable.OLAPProductGroup, WEB_InventTable.Dimension3_ ORDER BY WEB_InventTable.OLAPProductGroup, WEB_InventTable.Dimension3_ ASC'; $query2 = @mysql_query($query_string2); $data2 = @mysql_fetch_array($query2); $temp3 = ''; $check1 = ''; $check2 = ''; $link_counter = 1; //formating filter links for display if (!empty($data2)){ mysql_data_seek($query2,0); while($data2 = @mysql_fetch_array($query2)){ if ($check1!=$data2['OLAPProductGroup']){ if (empty($check1)) { $a = '<a href="#">'.$data2['title'].'</a>'; $check1=$data2['OLAPProductGroup']; if (($check2!=$data2['Dimension3_'])&&($link_counter<=2)){//display first 2 category descriptions $b = '<span></span><a href="?page=Search&division='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&type=endrange">'.$data2['Description'].'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } elseif (($check2!=$data2['Dimension3_'])&&($link_counter>2)){//display rest of categories as numbers with category names as link title $b = '<span></span><a href="?page=Search&division='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&type=endrange" title="'.$data2['Description'].'">'.$link_counter.'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } } else { $a = '<p class="clear"></p><a href="#">'.$data2['title'].'</a>'; $link_counter=1; if (($check2!=$data2['Dimension3_'])&&($link_counter<=2)){//same as above $b = '<span></span><a href="?page=Search&division='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&type=endrange">'.$data2['Description'].'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } elseif (($check2!=$data2['Dimension3_'])&&($link_counter>2)){//same as above $b = '<span></span><a href="?page=Search&division='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&type=endrange" title="'.$data2['Description'].'">'.$link_counter.'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } } } else { $a = ''; if (($check2!=$data2['Dimension3_'])&&($link_counter<=2)){ $b = '<a href="?page=Search&division='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&type=endrange"> | '.$data2['Description'].'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } elseif (($check2!=$data2['Dimension3_'])&&($link_counter>2)){ $b = '<a href="?page=Search&division='.$data2['OLAPProductGroup'].'&c_id='.$data2['Dimension3_'].'&type=endrange" title="'.$data2['Description'].'"> | '.$link_counter.'</a>'; $link_counter++; $check2=$data2['Dimension3_']; } } $check1=$data2['OLAPProductGroup']; $check2=$data2['Dimension3_']; $temp3 = $temp3.$a.$b; } } $division_breadcrumb = $temp3; mysql_free_result($query2); unset($_GET['division2'],$data2); //search generated by clicking on product links (product search link) } else { //sub category is specified if((isset($_GET['sc_id']))&&(isset($_GET['c_id']))){ $query_string = 'SELECT ItemId, ItemName, OLAPProductGroup, Dimension3_, Dimension4_, WEB_InventTable.Group, GroupView, InventInclusionGroupId, SpecialInventInclusionGroup, Discontinued, web_admin_options.title FROM WEB_InventTable, web_admin_options WHERE WEB_InventTable.OLAPProductGroup = web_admin_options.division_id AND OLAPProductGroup="'.$_GET['division'].'" AND WEB_InventTable.Webitem=1 AND ItemId NOT LIKE "%ZZZ%" AND Dimension3_="'.$_GET['c_id'].'" AND Dimension4_="'.$_GET['sc_id'].'" ORDER BY OLAPProductGroup, Dimension3_, Dimension4_, ItemId ASC'; $link = 'page=Search&division='.$_GET['division'].'&c_id='.$_GET['c_id'].'&sc_id='.$_GET['sc_id']; $subcat_query = @mysql_query('SELECT Description FROM web_olapprodsubcat WHERE SUBCATID="'.$_GET['sc_id'].'"'); $subcat_data = @mysql_fetch_array($subcat_query); $subcat_breadcrumb = '<span></span><a href="?page=Search&division='.$_GET['division'].'&c_id='.$_GET['c_id'].'&sc_id='.$_GET['sc_id'].'">'.$subcat_data['Description'].'</a>'; //category is specified } else if(isset($_GET['c_id'])&&(!isset($_GET['sc_id']))){ $query_string = 'SELECT ItemId, ItemName, OLAPProductGroup, Dimension3_, Dimension4_, WEB_InventTable.Group, GroupView, InventInclusionGroupId, SpecialInventInclusionGroup, Discontinued, web_admin_options.title FROM WEB_InventTable, web_admin_options WHERE WEB_InventTable.OLAPProductGroup = web_admin_options.division_id AND OLAPProductGroup="'.$_GET['division'].'" AND WEB_InventTable.Webitem=1 AND WEB_InventTable.ItemId NOT LIKE "%ZZZ%" AND Dimension3_="'.$_GET['c_id'].'" ORDER BY OLAPProductGroup, Dimension3_, Dimension4_, ItemId ASC'; $link = 'page=Search&division='.$_GET['division'].'&c_id='.$_GET['c_id']; } $query = @mysql_query($query_string); $rows = @mysql_num_rows($query); $data = @mysql_fetch_array($query); $title = $data['title']; $division_breadcrumb = '<a href="?page=Products&division='.$_GET['division'].'">'.$data['title'].'</a>'; //get Category names to display $category_query = @mysql_query('SELECT Description FROM web_olapprodcat WHERE CATID="'.$_GET['c_id'].'"'); $category_data = @mysql_fetch_array($category_query); $category_breadcrumb = '<span></span><a href="?page=Search&division='.$_GET['division'].'&c_id='.$_GET['c_id'].'">'.$category_data['Description'].'</a>'; //get Sub-category names to display if(!isset($_GET['sc_id'])){ $subcategory_query = @mysql_query('SELECT SUBCATID, Description FROM web_olapprodsubcat WHERE SUBCATID like "'.$_GET['c_id'].'%"'); $subcategory_data = @mysql_fetch_array($subcategory_query); $subcat_breadcrumb .= '<span></span><a href="?page=Search&division='.$_GET['division'].'&c_id='.$_GET['c_id'].'&sc_id='.$subcategory_data['SUBCATID'].'">'.$subcategory_data['Description'].'</a>'; $link_count = 1; mysql_field_seek($subcategory_query,1); while($subcategory_data = @mysql_fetch_array($subcategory_query)){ if ($link_count<3) { $subcat_breadcrumb .= '<a href="?page=Search&division='.$_GET['division'].'&c_id='.$_GET['c_id'].'&sc_id='.$subcategory_data['SUBCATID'].'"> | '.$subcategory_data['Description'].'</a>'; $link_count++; } else { $subcat_breadcrumb .= '<a href="?page=Search&division='.$_GET['division'].'&c_id='.$_GET['c_id'].'&sc_id='.$subcategory_data['SUBCATID'].'" title="'.$subcategory_data['Description'].'"> | '.$link_count.'</a>'; $link_count++; } } } } $page = 1; if(isset($_GET['p_p'])){ $page = $_GET['p_p']; } //Display of search results --- body parts global $pagination; $Pagination = new Pagination($rows, $pagination['items_per_page'], $link, $page); $AdvancedSearch = new AdvancedSearch(); $NewProducts = new NewProducts(); global $body; $body = '<div class="column-310 float-left"> '.$AdvancedSearch->Display().' <div class="gap-hoz-small"></div> <div class="column-310 float-left dealer-menu"> <div class="block-khaki"> <a href="javascript:CompareCookie.Display();" class="compare-btn" title="compare"></a> </div> <div class="gap-hoz-small"></div> <div class="block-khaki"> <a href="?page=Wishlist&view=hto" class="how-to-order"></a> </div> <div class="gap-hoz-small"></div> <div class="block-khaki"> <a href="javascript:WishlistCookie.Display();" class="wishlist"></a> </div> <div class="gap-hoz-small"></div><br> <div class="block-khaki"> <div class="padding-10"> <h1 class="text-white">New Products</h1> </div> '.$NewProducts->Display().' <div class="gap-hoz-small"></div> <br> </div></div> </div> <div class="gap-vert float-left"></div> <div class="column-630 float-left"> <h1 class="text-grey">'.$title.'</h1> <div class="breadcrumb"> '.$division_breadcrumb.' '.$category_breadcrumb.' '.$subcat_breadcrumb.' <p class="clear"></p></div> <div class="pagination"><p class="clear"></p>'.$Pagination->Display().'</div> <br/>'; $body .= '<div id="search-result-wrapper">'; $limit = ' LIMIT 0,'.$pagination['items_per_page']; if(isset($_GET['p_p'])){ $limit = ' LIMIT '.(($_GET['p_p'] - 1) * $pagination['items_per_page']).','.$pagination['items_per_page']; } $sub_category = NULL; $query = @mysql_query($query_string.$limit); if($rows > 0){ $division = NULL; $cat_check = NULL; $cat_txt = NULL; $discontinued=FALSE; mysql_data_seek($query,0); while($data = @mysql_fetch_array($query)){ if(substr($data['ItemName'],0,1)=="*" || $data['Discontinued']==1){ $discontinued=TRUE; } $division_changed = NULL; if ($cat_check!=$data['Dimension3_']) { $cat_query = @mysql_query('SELECT Description FROM web_olapprodcat WHERE CATID="'.$data['Dimension3_'].'"'); $cat_data = @mysql_fetch_array($cat_query); $link = NULL; if(!empty($_GET['advanced_material']) || !empty($_GET['advanced_lamp']) || !empty($_GET['advanced_application'])){ $link = '&division2='.$data['OLAPProductGroup'].'&c_id='.$data['Dimension3_'].'&advanced_material='.$_GET['advanced_material'].'&advanced_lamp='.$_GET['advanced_lamp'].'&advanced_application='.$_GET['advanced_application']; } elseif (isset($_POST['keyword']) || isset($_POST['code'])){ $link = '&division2='.$data['OLAPProductGroup'].'&c_id='.$data['Dimension3_'].'&keyword='.$_POST['keyword'].'&code='.$_POST['code']; } elseif (isset($_GET['division'])){ $link = '&division='.$data['OLAPProductGroup'].'&c_id='.$data['Dimension3_']; } elseif (isset($_GET['type']) && $_GET['type']=='newproducts'){ $link = '&division='.$data['OLAPProductGroup'].'&c_id='.$data['Dimension3_'].'&type=newproducts'; } elseif (isset($_GET['type']) && $_GET['type']=='endrange'){ $link = '&division='.$data['OLAPProductGroup'].'&c_id='.$data['Dimension3_'].'&type=endrange'; } $body .= '<p class="clear"></p> <h2 class="block-khaki padding-5">'.$data['title'].' | <a href="?page=Search'.$link.'">'.$cat_data['Description'].'</a></h2> <br>'; $division = $data['InventInclusionGroupId']; $division_changed = true; $cat_check = $data['Dimension3_']; $cat_txt = $cat_data['Description']; mysql_free_result($cat_query); } if(($data['Dimension4_'] != $sub_category) || $division_changed){ $subcat_query = @mysql_query('SELECT Description FROM web_olapprodsubcat WHERE SUBCATID="'.$data['Dimension4_'].'"'); $subcat_data = @mysql_fetch_array($subcat_query); if(!empty($_GET['advanced_material']) || !empty($_GET['advanced_lamp']) || !empty($_GET['advanced_application'])){ $body .= '<p class="clear"></p> <h5 class="block-yellow subcat"><a href="?page=Search&division2='.$data['OLAPProductGroup'].'&c_id='.$data['Dimension3_'].'&sc_id='.$data['Dimension4_'].'&advanced_material='.$_GET['advanced_material'].'&advanced_lamp='.$_GET['advanced_lamp'].'&advanced_application='.$_GET['advanced_application'].'" class="padding-5 subcat">'.$subcat_data['Description'].'</a></h5> <br/>'; } elseif(isset($_POST['keyword'])||isset($_POST['code'])){ $body .= '<p class="clear"></p> <h5 class="block-yellow subcat"><a href="?page=Search&division2='.$data['OLAPProductGroup'].'&c_id='.$data['Dimension3_'].'&sc_id='.$data['Dimension4_'].'&keyword='.$_POST['keyword'].'&code='.$_POST['code'].'" class="padding-5 subcat">'.$subcat_data['Description'].'</a></h5> <br/>'; } elseif(isset($_GET['division'])){ $body .= '<p class="clear"></p> <h5 class="block-yellow subcat"><a href="?page=Search&division='.$_GET['division'].'&c_id='.$data['Dimension3_'].'&sc_id='.$data['Dimension4_'].'" class="padding-5 subcat">'.$subcat_data['Description'].'</a></h5> <br/>'; } elseif(isset($_GET['type']) && $_GET['type']=='newproducts'){ $body .= '<p class="clear"></p> <h5 class="block-yellow subcat"><a href="?page=Search&division='.$data['OLAPProductGroup'].'&c_id='.$data['Dimension3_'].'&sc_id='.$data['Dimension4_'].'&type=newproducts" class="padding-5 subcat">'.$subcat_data['Description'].'</a></h5> <br/>'; } elseif(isset($_GET['type']) && $_GET['type']=='endrange'){ $body .= '<p class="clear"></p> <h5 class="block-yellow subcat"><a href="?page=Search&division='.$data['OLAPProductGroup'].'&c_id='.$data['Dimension3_'].'&sc_id='.$data['Dimension4_'].'&type=endrange" class="padding-5 subcat">'.$subcat_data['Description'].'</a></h5> <br/>'; } $sub_category = $data['Dimension4_']; if($discontinued==TRUE){ $body .= '<p class="error">End of range items are marked with <strong>*</strong></p>'; } $discontinued=FALSE; } $in_compare_cookie = NULL; if($this->Compared($data['ItemId'], 'rd_compare')){ $in_compare_cookie = ' checked="checked"'; } $in_wishlist_cookie = NULL; if($this->Compared($data['ItemId'], 'rd_wishlist')){ $in_wishlist_cookie = ' checked="checked"'; } $basket = NULL; $pic_query = @mysql_query('SELECT * FROM WEB_Pic WHERE ItemId="'.$data['ItemId'].'" AND Type="4"'); $pic_data = @mysql_fetch_array($pic_query); global $Session; $wishlist = '<p><input type="checkbox" class="checkbox" onclick="WishlistCookie.Add(this, \''.$data['ItemId'].'\');"'.$in_wishlist_cookie.'/>Add to wishlist</p>'; if($Session->ID() != NULL){ if($Session->Privilege() != NULL){ $allow = explode(",: ", $Session->Privilege()); foreach($allow as $key=>$val){ if ($val=='ALL' || ($val==$data['InventInclusionGroupId'] && $data['InventInclusionGroupId']!=NULL) || ($val==$data['SpecialInventInclusionGroup'] && $data['SpecialInventInclusionGroup']!=NULL)){ $basket = '<p> <a href="?page=Basket&pre_add='.urlencode($data['ItemId']).'" class="basket-link">» Add to basket</a></p>'; } } } } $body .= '<div> <p class="border-khaki image-wrapper"><a href="?page=Product&id='.urlencode($data['ItemId']).'&group='.($data['Group']).'"><img src="'.$pic_data['Href'].'" alt="'.htmlentities($data['ItemName']).'" title="'.htmlentities($data['ItemName']).'"/></a></p> <p class="item_name">('.$data['ItemId'].') '.$data['ItemName'].'</p> <p><input type="checkbox" class="checkbox" onclick="CompareCookie.Add(this, \''.$data['ItemId'].'\');"'.$in_compare_cookie.'/>Compare</p> '.$wishlist.' '.$basket.' </div>'; } } else { $body .= '<p class="error">Your search returned no results</p>'; } $body .= '</div></div> <br><p><input type="submit" value="Back" class="submit-khaki float-right" onclick="javascript:window.history.back();"/></p>'; } function Compared($value, $cookie_name){ if(isset($_COOKIE[$cookie_name])){ $CookieHandler = new CookieHandler(); $cookie = $CookieHandler->Parse($cookie_name); $compares = explode(':', $_COOKIE[$cookie_name]); foreach($cookie as $key){ $pieces = explode(':', $key); if($value == $pieces[0]){ return true; } } } return false; } } ?>
  13. Links are from products.php and search.php Products.php code: <?php class Products{ function Products(){ $VarSecurity = new VarSecurity(); if(isset($_GET['view'])){ $_GET['view'] = $VarSecurity->Security($_GET['view']); } if(isset($_GET['division'])){ $_GET['division'] = $VarSecurity->Security($_GET['division']); } if(isset($_GET['view'])){ $this->Show(); } if(isset($_GET['division'])){ $this->Division(); } else { $this->Show(); } } function Division(){ $advancedSearch = new AdvancedSearch(); $Newproducts = new NewProducts(); global $body; $body = '<div class="column-310 float-left"> '.$advancedSearch->Display().' <div class="gap-hoz-small"></div> <div class="column-310 float-left dealer-menu"> <div class="block-khaki"> <a href="javascript:CompareCookie.Display();" class="compare-btn" title="compare"></a> </div> <div class="gap-hoz-small"></div> <div class="block-khaki"> <a href="?page=Wishlist&view=hto" class="how-to-order"></a> </div> <div class="gap-hoz-small"></div> <div class="block-khaki"> <a href="javascript:WishlistCookie.Display();" class="wishlist"></a> </div> </div> </div> <div class="gap-vert float-left"></div> <div class="column-630 float-left">'; $query = @mysql_query('SELECT WEB_admin_options.title, WEB_admin_options.display_price, WEB_admin_options.display_cat_price_no, WEB_InventTable.OLAPProductGroup FROM WEB_InventTable, WEB_admin_options WHERE WEB_InventTable.OLAPProductGroup='.$_GET['division'].' AND WEB_InventTable.OLAPProductGroup = WEB_admin_options.division_id Limit 0,1'); $data = @mysql_fetch_array($query); $body .= '<h1 class="block-khaki padding-5">'.$data['title'].'</h1> <br/> <div id="products-columns">'; $price_list = NULL; //if($data['display_price']==1){ //$price_list = 'AND INCLInPriceList=1'; //} $cat_query = @mysql_query('SELECT Dimension3_, CATID, web_olapprodcat.Description AS Description FROM WEB_InventTable LEFT JOIN web_olapprodcat ON (WEB_InventTable.Dimension3_=web_olapprodcat.CATID) WHERE OLAPProductGroup='.$_GET['division'].' AND ItemId NOT LIKE "%*%" AND ItemId NOT LIKE "%zzz%" AND Dimension3_!="" '.$price_list.' GROUP BY web_olapprodcat.Description ORDER BY web_olapprodcat.Description ASC'); while($cat_data = @mysql_fetch_array($cat_query)){ $body .= '<h2><a href="?page=Search&division='.$data['OLAPProductGroup'].'&c_id='.$cat_data['CATID'].'">'.$cat_data['Description'].'</a></h2>'; } $body .= '</div> <p class="clear"></p> <br/><br/> <input type="submit" value="Back" class="submit-khaki float-right" onclick="javascript:window.history.back();"/> </div>'; } function Show(){ $Newproducts = new NewProducts(); global $body; $body = '<div class="column-310 float-left"> <div class="block-khaki home-highlights"> <div class="padding-10"> <h1 class="text-white">Welcome </h1> <br/> <p>Welcome to our company</p> </div> </div> <div class="gap-hoz-small"></div> <div class="block-khaki home-newprod"> <div class="padding-10"> <h1 class="text-white">New Products</h1> </div> '.$Newproducts->Display().' </div> </div> <div class="gap-vert float-left"></div> <div class="column-630 float-left">'; $query = @mysql_query('SELECT distinct WEB_admin_options.title, WEB_admin_options.division_id, WEB_admin_options.display_price, WEB_admin_options.display_cat_price_no, WEB_InventTable.OLAPProductGroup FROM WEB_InventTable, WEB_admin_options WHERE WEB_admin_options.type = "division" AND WEB_InventTable.OLAPProductGroup = WEB_admin_options.division_id'); while($data = @mysql_fetch_array($query)){ $body .= '<h1 class="block-khaki padding-5">'.$data['title'].'</h1> <br/> <div id="products-columns">'; $price_list = NULL; //if($data['display_price']==1){ //$price_list = 'AND INCLInPriceList=1'; //} $cat_query = @mysql_query('SELECT Dimension3_, CATID, web_olapprodcat.Description AS Description FROM WEB_InventTable LEFT JOIN web_olapprodcat ON (WEB_InventTable.Dimension3_=web_olapprodcat.CATID) WHERE OLAPProductGroup='.$data['division_id'].' AND ItemId NOT LIKE "%*%" AND ItemId NOT LIKE "%zzz%" AND Dimension3_!="" '.$price_list.' GROUP BY web_olapprodcat.Description ORDER BY web_olapprodcat.Description ASC'); while($cat_data = @mysql_fetch_array($cat_query)){ $body .= '<h2><a href="?page=Search&division='.$data['OLAPProductGroup'].'&c_id='.$cat_data['CATID'].'">'.$cat_data['Description'].'</a></h2>'; } $body .= '</div> <p class="clear"></p> <br/>'; } $body .= '<br/> <input type="submit" value="Back" class="submit-khaki float-right" onclick="javascript:window.history.back();"/> </div>'; } } ?>
  14. index.php code <?php require_once('src/php/init.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <script type="text/javascript">var switchTo5x=true;</script> <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script> <script type="text/javascript">stLight.options({publisher: "a00cacbc-1f81-43c4-8be2-e41d225b4bdf"}); </script> <title><?php if (isset($Pagedescr)) { echo $Pagedescr; } else { echo "My Company"; } ?></title> <meta name="description" content="#######"> <meta name="keywords" content="#########"> <link rel="shortcut icon" type="image/x-icon" href="/Prod_Pics/Icons/Rd.gif"> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-16713000-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <title><?php echo $title?> - <?php echo $_GET['page']; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> <link rel="stylesheet" type="text/css" href="src/css/screen.css"/> <link rel="stylesheet" type="text/css" href="src/css/screen-ie.css"/> <link rel="stylesheet" type="text/css" href="src/css/print.css" media="print" /> <link rel="stylesheet" type="text/css" href="src/css/slimbox2.css"/> <script src="src/js/jquery-1.3.1.min.js" type="text/javascript"></script> <script src="src/js/jookie.js" type="text/javascript"></script> <script src="src/js/CookieHandler.js" type="text/javascript"></script> <script src="src/js/Time.js" type="text/javascript"></script> <script src="src/js/core.js" type="text/javascript"></script> <!-- /*calls image popup*/--> <?php if(isset($_GET['page']) && ($_GET['page'] == 'Product' || $_GET['page'] == 'Compare' || $_GET['page'] == 'Range')):?> <script src="src/js/jquery.colorbox-min.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="src/css/colorbox.css"/> <?php endif?> </head> <body> <!--/*Setup for emails*/--> <?php isset($_GET['page']) && $_GET['page'] == 'Wishlist' || $_GET['page'] == 'Compare' || $_GET['page'] == 'Product' ? require_once('src/php/views/email-form.php') : NULL ?> <div id="wrapper"> <div class="header home-header"> <?php require_once('src/inc/menu.php')?> <div id="logo-rd</div> <div id="logo-so<img src="src/img/logo-so.png"/></a></div> <?php require_once('src/inc/search.php')?> <?php require_once('src/inc/shopping.php')?> </div> <div id="body" onmouseout="SubMenu();"> <noscript><p>This site makes extensive use of javascript. Some features will not be available if you do not enable javascript.</p></noscript> <?php echo $body ?> <p class="clear"></p> </div> <p class="clear"> </p> <?php require_once('src/inc/footer.php')?> <br /> <div align="center"> <img src="LED_Notice_Banner.jpg" alt="" width="950" height="180" /> <table width="100%" border="0" cellspacing="1" cellpadding="1"> <tr> <td> </td> </tr> </table> <table width="100%" border="0" cellspacing="1" cellpadding="1"> <tr> <td colspan="2"> </td> <td width="4%"> </td> <td width="4%"> </td> <td width="3%"> </td> <td width="4%"> </td> <td width="3%"> </td> </tr> <tr> <td width="74%" align="left" valign="middle"> <script charset="utf-8" src="http://widgets.twimg.com/j/2/widget.js"></script> <script> new TWTR.Widget({ version: 2, type: 'profile', rpp: 1, interval: 30000, width: 'auto', height: 100, theme: { shell: { background: '#ffffff', color: '#000000' }, tweets: { background: '#ffffff', color: '#000000', links: '#05854b' } }, features: { scrollbar: false, loop: false, live: false, behavior: 'all' } }).render().setUser('rd').start(); </script> </table> </div> </div> </body> </html>
  15. Yes the product page is called into index.php Products page code: <style type="text/css"> <!-- .Blacktext { color: #000; } --> </style> <div id="detailed-wrapper"> <div class="column-310 float-left"> <?php echo $advancedSearch->Display()?> <div class="gap-hoz-small"></div> <div class="column-310 float-left dealer-menu"> <div class="block-khaki"> <a href="javascript:CompareCookie.Display();" class="compare-btn" title="compare"></a> </div> <div class="gap-hoz-small"></div> <div class="block-khaki"> <a href="?page=Wishlist&view=hto" class="how-to-order"></a> </div> <div class="gap-hoz-small"></div> <div class="block-khaki"> <a href="javascript:WishlistCookie.Display();" class="wishlist"></a> </div> <div class="gap-hoz-small"></div><br> <div class="block-khaki"> <div class="padding-10"> <h1 class="text-white">New Products</h1> </div> <?php echo $Newproducts->Display()?> <div class="gap-hoz-small"></div> <br> </div></div> </div> <div class="gap-vert float-left"></div> <div class="column-630 float-left"> <h1 class="text-grey"><?php echo $Inventinclgrp?></h1> <br/> <div class="breadcrumb"> <p><?php echo $Inventinclgrp?></p> <span> </span> <p><?php echo $Prod_Cat?></p> <span> </span> <p><?php echo $Prod_Subcat?></p> </div> <p class="clear"></p> <br/> <div class="float-left"> <div class="column-310 product-detailed"> <img src="<?php echo $preview_image['href']?>" class="border-khaki float-left" alt="<?php echo htmlentities($data['ItemName'])?>" title="<?php echo htmlentities($data['ItemName'])?>"/> <div class="column-310 image-medium-description float-left"> <div class="border-khaki"> <p class="float-left padding-5"><?php echo $id?></p> <p class="float-right padding-5"> <?php $x = @getimagesize($first_image); $aw = ($x[0])+30; if($aw<330){ $aw = 360; }elseif($aw>650){ $aw = 650; }?> <a href="<?php echo $first_image?>" rel="productPics" class="image-enlarge" title="<?php echo $first_description?>">enlarge image</a> </p> <p style="display:none"> <?php foreach($image_tags as $img): $x = @getimagesize($img['href']); if($x[0]>650){ $aw = 650; }elseif($x[0]>$aw){ $aw = ($x[0]); } ?> <a href="<?php echo $img['href']?>" rel="productPics" class="image-enlarge" title="<?php echo $img['title']?>">enlarge image.......</a> <?php endforeach?> </p> <p class="clear"></p> </div> </div> <p class="clear"></p> <br/> </div> </div> <div class="gap-vert float-left"></div> <div class="float-left column-310"> <div class="block-yellow"><h5 class="padding-5"><?php echo $Pagedescr?></h5></div> <br/> <div id="detailed-menu"> <a href="?page=Product&id=<?php echo urlencode($_GET['id']); ?>&group=<?php echo $_GET['group']; ?>&prnt=YES" class="detailed-btn-print" title="print" target="_new"></a> <div class="gap-hoz-small float-left"></div> <a href="javascript:mail.Display(<?php echo $to_email; ?>);" class="detailed-btn-email" title="email"></a> <div class="gap-hoz-small float-left"></div> <a href="javascript:WishlistCookie.Add(this, '<?php echo $_GET['id']; ?>');" class="detailed-btn-wishlist" title="add to wishlist"></a> <?php echo $basket?> <div class="gap-hoz-small float-left"></div> <a href="?page=contact-feedback&enquiry=Product enquiry&item=<?php echo $id;?>" class="detailed-btn-contact" title="contact"></a> </div> <p class="float-left"><br /> <strong class="Blacktext">Note: </strong><span class="error">Products must be installed by a qualified Electrician.</span><br /> <br /> </p> <p><br/> <?php $sw = 350; if(count($technical_images) > 0): $x = @getimagesize($technical_images[$i]['href']); $sw = ($x[0]); if($sw<330){ $sw = 360; }elseif($sw>650){ $sw = 650; }?> </p> <p class="float-left"> <a href="<?php echo $technical_images[0]['href']?>" rel="technicalPics" class="image-tech-drawings" title="<?php echo $technical_images[0]['title']?>">Technical Drawings</a> </p> <?php for($i = 1; $i < count($technical_images); $i++): $x = @getimagesize($technical_images[$i]['href']); if($x[0]>650){ $sw = 650; }elseif($x[0]>$sw){ $sw = ($x[0]); }?> <p class="hide"> <a href="<?php echo $technical_images[$i]['href']?>" rel="technicalPics" class="image-tech-drawings" title="<?php echo $technical_images[$i]['title']?>">Technical Drawings</a> </p> <?php endfor?> <?php endif?> <p class="clear"></p> <br /> <input type="submit" value="Back" class="submit-khaki float-right" onclick="javascript:window.history.back();"/> <?php echo $range?><br /><br /> </div> <p class="float-left"> <br /> <br /> <span class='st_sharethis_hcount' displayText='ShareThis'></span><br /><br /> <span class='st_facebook_hcount' displayText='Facebook'></span><br /><br /> <span class='st_twitter_hcount' displayText='Tweet'></span><br /><br /> <span class='st_linkedin_hcount' displayText='LinkedIn'></span><br /> </p> <p class="clear"></p> <script type="text/javascript"> $(document).ready(function(){ $("a[rel='productPics']").colorbox({opacity: 0.75, width:<?php echo $aw?>}); $("a[rel='technicalPics']").colorbox({opacity: 0.75, width:<?php echo $sw?>}); }); </script> <?php echo $body2?> </div> </div>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.