Advertisement
Guest User

Untitled

a guest
Nov 26th, 2013
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 24.66 KB | None | 0 0
  1. <?php
  2. if(isset($_POST)&&count($_POST)>1) {
  3.     // print_r($_POST);
  4.     // DIE();
  5. }
  6.  
  7. require_once('_includes/publicGlobal.inc.php');
  8. $dimensions=array();
  9. $page = new Page($db,'Catalogue',$_GET['pageIdName']);
  10. $page->recordStats();
  11. $tags = new Tags($db);
  12. $catalogue = new Catalogue($db,$site);
  13.  
  14. if(!$page->row['pagePrice'] && !$user->row['account']){
  15.     redirect('Wholesale');
  16. }
  17.  
  18.  
  19. if ($_POST['quantity']){
  20.     foreach($_POST['quantity'] as $id=>$each){ if ($each>0){
  21.         //unset($_POST['po']);
  22.         // $_POST['po'][$_POST['poOptionType'][$id]] = $_POST['poOptionName'][$id];
  23.         // var_dump($_POST);
  24.         $basket->add($page->row['pageId'],$_POST['poOptionType'],$each,$_POST['poPersonalisation']);
  25.     }}
  26.     $basket->updateTotal();
  27.     redirect('Basket');
  28. }
  29. $rsPM = $db->query('SELECT * FROM `pageMeta`,`metaKey` WHERE `pageMeta`.`metaId` = `metaKey`.`metaId` AND `pageMeta`.`pageId`='.$db->mes($page->row['pageId']));
  30. if ($rsPM->num_rows()){
  31.     while ($row_rsPM = $rsPM->get_row_assoc()){
  32.         if ($row_rsPM['underMetaId'] == 37){
  33.             $preference_row_rsPM = $row_rsPM;
  34.         }
  35.     }
  36.     if (isset($preference_row_rsPM)) $row_rsPM = $preference_row_rsPM;
  37.    
  38.     $routeArray = $catalogue->route($row_rsPM['metaId']);
  39.     $selected = $routeArray[0]['metaKey'];
  40. } else {
  41.     $routeArray = array();
  42. }
  43. $catRoot='';
  44. foreach((array)$routeArray as $each) $catRoot.=($each['htmlMetaTitle']=='Shop'?'':$each['metaKey'].'/');
  45.  
  46. if (!$page->row['pageId']){
  47.  header("HTTP/1.0 404 Not Found");
  48.  $page404 = new Page($db,'SiteElements','404');  
  49.  }
  50.  
  51. require_once(DOCUMENT_ROOT.'/_includes/start.inc.php'); ?>
  52. <title><?php if ($page404){ echo $page404->row['pageTitle']; ?>
  53. <?php }
  54. ?><?php if ($page->row['seoTitle']){ ?> <?php echo $page->row['seoTitle']; } ?></title>
  55. <script src="<?php echo HTTP_HOST; ?>Scripts/jquery.lightbox-0.5.min.js"></script>
  56. <link rel="stylesheet" type="text/css" href="<?php echo HTTP_HOST; ?>lightbox/css/jquery.lightbox-0.5.css" media="screen" />
  57. <meta name="keywords" content="<?php echo $page->row['seoKeywords']; ?>" />
  58. <meta name="description" content="<?php echo $page->row['seoDescription']; ?>" />
  59. <link rel="stylesheet" href="<?php echo HTTP_HOST; ?>   css/lightbox.css" type="text/css" media="screen" />
  60. <script type="text/javascript">
  61. (function($) {
  62.   var cache = [];
  63.   // Arguments are image paths relative to the current page.
  64.   $.preLoadImages = function() {
  65.     var args_len = arguments.length;
  66.     for (var i = args_len; i--;) {
  67.       var cacheImage = document.createElement('img');
  68.       cacheImage.src = arguments[i];
  69.       cache.push(cacheImage);
  70.     }
  71.   }
  72. })(jQuery)
  73. var image_number = 0;
  74. var thumb = new Array();
  75. var zoomed = 0;
  76. <?php $rsThumb = $db->query('SELECT * FROM `file`,`filePage` WHERE `file`.`fileId` = `filePage`.`fileId` AND `pageId` ='.$db->mes($page->row['pageId']).' ORDER BY `position` ASC LIMIT 0,4'); $i=0;
  77. while ($row_rsThumb = $rsThumb->get_row_assoc()){ $i++; $thumbBank[] = $row_rsThumb['fileName'];
  78. $dimensions[] = getimagesize(DOCUMENT_ROOT.'/upload/full/'.$row_rsThumb['fileId'].'_'.$row_rsThumb['fileName'].''); ?>
  79. thumb[<?php echo $i; ?>] = '<?php echo $row_rsThumb['fileId'].'_'.$row_rsThumb['fileName']; ?>';
  80. <?php } ?>
  81.  
  82. var dimensions = [
  83. <?php //print_r($dimensions);
  84. $dim_output = '';
  85. foreach ($dimensions as $single_image_dim) {
  86.     $dim_output.='['.$single_image_dim[0].','.$single_image_dim[1].'],';
  87. }
  88. $dim_output = rtrim($dim_output,',');
  89. echo $dim_output;
  90. ?>];
  91. //console.log(dimensions);
  92. $(document).ready(function(){
  93.     $(".product-select > a").click(function(e){
  94.         //var text_id = $(this).attr("id");
  95.         //var new_id = text_id.replace("thumb_", "");
  96.         //image_number = new_id-1;
  97.         //console.log(image_number);
  98.         //thumb_reset();
  99.     });
  100.  
  101.     <?php for ($j=1; $j<=$i;$j++){ ?>
  102.     $("#thumb_<?php echo $j; ?>").data("curThumb","<?php echo $j; ?>");
  103.     <?php } ?>
  104.     jQuery.data(document.body,'current_thumb',"1");
  105.     $(".thumb_button").click(function(){
  106.         var changeTo = $(this).data("curThumb");
  107.         image_number = changeTo-1;
  108.         var changeFrom = jQuery.data(document.body,'current_thumb');
  109.         $("#thumb_main").attr('src','<?php echo HTTP_HOST.'upload/full/'; ?>'+thumb[changeTo]);
  110.         $("#enlarge").attr('href','<?php echo HTTP_HOST.'upload/full/'; ?>'+thumb[changeTo]);
  111.         //$(this).children('img').attr('src','<?php echo HTTP_HOST.'upload/340w/'; ?>'+thumb[changeFrom]);
  112.         //$(this).attr('href','<?php echo HTTP_HOST.'upload/full/'; ?>'+thumb[changeFrom]);
  113.         //$(this).attr('id','thumb_'+changeTo);    
  114.         //jQuery.data(document.body,'current_thumb',changeTo);
  115.         //$(this).data("curThumb",changeFrom);
  116.         thumb_reset();
  117.         return false;
  118.     });
  119.     //$(".thumb_button").trigger('click');
  120.     jQuery.preLoadImages("<?php echo implode('","',$thumbBank); ?>");
  121.     // resize to fit
  122.     thumb_reset();
  123.     $("#thumb_reset").click(function(){
  124.         thumb_reset();
  125.         return false;
  126.     });
  127.     $("#thumb_main").mousemove(function(e){
  128.         if (zoomed==1) {
  129.             move_thumb(e);
  130.         }
  131.     });
  132.     $("#thumb_container_big").click(function(e){
  133.         $t = $("#thumb_main");
  134.         $t.css('position','relative');
  135.         $w = $t.width();
  136.         $h = $t.height();
  137.         $wLimit = dimensions[image_number][0]<?php //echo $dimensions[0][0]; ?>;
  138.         $hLimit = dimensions[image_number][1]<?php //echo $dimensions[0][1]; ?>;
  139.         $differenceW = 100;
  140.         $differenceH = 100*$h/$w;
  141.         $w = $w+$differenceW;
  142.         $h = $h+$differenceH;
  143.         if ($w>$wLimit || $h>$hLimit){
  144.             $w = $wLimit;
  145.             $h = $hLimit;
  146.         }  
  147.         $t.animate({'height':$h,'width':$w,'top':calculate_thumb_pos_top(e,$h),'left' : calculate_thumb_pos_left(e,$w)});
  148.         zoomed=1;
  149.         return false;
  150.     });
  151.     $("#thumb_container_small").click(function(e){
  152.         $t = $("#thumb_main");
  153.         $t.css('position','relative');
  154.         $w = $t.width();
  155.         $h = $t.height();
  156.         $wLimit = dimensions[image_number][0]<?php //echo $dimensions[0][0]; ?>;
  157.         $hLimit = dimensions[image_number][1]<?php //echo $dimensions[0][1]; ?>;
  158.         $differenceW = -100;
  159.         $differenceH = -100*$w/$h;
  160.         $w = $w+$differenceW;
  161.         $h = $h+$differenceH;
  162.         if ($w<250 || $h<250){
  163.             thumb_reset();
  164.         } else {
  165.             $t.animate({'height':$h,'width':$w,'top' : calculate_thumb_pos_top(e,$h),'left' : calculate_thumb_pos_left(e,$w)});
  166.         }
  167.         return false;
  168.     });
  169.     $('a.lightbox').lightBox();
  170.     $('#jq_form').submit(function(){
  171.         var qty=0;
  172.         $('.jq_qty').each(function(){
  173.             qty = qty + parseInt($(this).val());
  174.         });
  175.         if (qty==0) return false;
  176.     });
  177.    
  178.     $('#tab_001').show();
  179.     $('#tab_002').hide();
  180.     $('#tab_003').hide();
  181.     $('#tab_list li:first').addClass('active');
  182.      
  183.     $('#tab_list li a').click(function(){
  184.         $('#tab_list li').removeClass('active');
  185.         $(this).parent().addClass('active');
  186.         var currentTab = $(this).attr('href');
  187.         $('#tab_001').hide();
  188.         $('#tab_002').hide();
  189.         //console.log(currentTab);
  190.         $(currentTab).show();
  191.         return false;
  192.     });
  193.    
  194.    
  195. });
  196. function calculate_thumb_pos_left(e,width){
  197.     var x = (e.pageX - $("#thumb").offset().left)/250;
  198.     x = x< 0 ? 0 : (x>1?1:x);
  199.     return((-x)*(width-250));
  200. }
  201. function calculate_thumb_pos_top(e,height){
  202.     var y = (e.pageY - $("#thumb").offset().top)/250;
  203.     y = y< 0 ? 0 : (y>1?1:y);
  204.     return((-y)*(height-250));
  205. }
  206. function move_thumb(e){
  207.     $t = $("#thumb_main");
  208.     $t.css('position','relative');
  209.     $t.css('left',calculate_thumb_pos_left(e,$("#thumb_main").width()));
  210.     $t.css('top',calculate_thumb_pos_top(e,$("#thumb_main").height()));
  211. }
  212. function thumb_reset(){
  213.     zoomed=0;
  214.     $t = $("#thumb_main");
  215.     $t.css('position','relative');
  216.     $w = dimensions[image_number][0]<?php //echo $dimensions[0][0]; ?>;  
  217.     $h = dimensions[image_number][1]<?php //echo $dimensions[0][1]; ?>;
  218.     //console.log('height= '+$h);
  219.     //console.log('width= '+$w);
  220.    
  221.     if ($w > $h){
  222.         // width is greater than height
  223.         $t.height(250*$h/$w);
  224.         //$w = 250*$w/$h // aspect
  225.         $t.width(250);
  226.         // centre
  227.         $t.css('left',0);
  228.         $t.css('top',0);
  229.    
  230.         ///////////console.log('width is greater');
  231.         ///////////// width is greater than height
  232.         ///////////$t.height(250);
  233.         ///////////$w = 250*$w/$h // aspect
  234.         ///////////$t.width($w);
  235.         ///////////// centre
  236.         ///////////$t.css('left',0);
  237.         ///////////$t.css('top',0);
  238.     } else {
  239.         //console.log('height is greater');
  240.         //console.log('ratio '+$h/$w);
  241.         //console.log('new height'+250*$h/$w)
  242.         // height is greater than width
  243.         $t.width(250*$w/$h);
  244.         //$h = 250*$h/$w // aspect
  245.         $t.height(250);
  246.         // centre
  247.         $t.css('top',0);
  248.         $t.css('left',0);
  249.         ///////// height is greater than width
  250.         ///////$t.width(250);
  251.         ///////$h = 250*$h/$w // aspect
  252.         ///////$t.height($h);
  253.         ///////// centre
  254.         ///////$t.css('top',0);
  255.         ///////$t.css('left',0);
  256.     }
  257. }
  258. </script>
  259. <style>
  260. #thumb{
  261.     overflow: hidden;
  262.     width:250px;
  263.     height:250px;
  264. }
  265. $thumb_main{
  266.     position: relative;
  267. }
  268. #thumb_container_big,#thumb_container_small,#thumb_reset{
  269.     cursor:pointer;
  270. }
  271. </style>
  272.  
  273. <?php $selected='Shop'; require_once(DOCUMENT_ROOT.'/_includes/header.inc.php');
  274.  
  275. if (!$page->row['pageId']){ ?>
  276.     <div id="content">
  277.            
  278.             <h1><?php echo $page404->row['pageTitle']; ?></h1>
  279.             <?php echo $page404->row['pageCopy']; ?>
  280.     </div>
  281.  
  282. <?php } else { ?>
  283.             <!-- full width breadcrumb -->
  284.             <?php $rsThumb->data_seek(0); ?>
  285.                 <div class="breadcrumbs">
  286.                     <ul>
  287.                         <li>You are here :
  288.                         <a class="previous" href="<?php echo HTTP_HOST; ?>">Home</a></li>
  289.                         <li><a class="previous" href="<?php echo HTTP_HOST; ?>Shop">Products</a></li>
  290.                         <li><?php $path='/';
  291.                         foreach((array)$routeArray as $each){ ?>
  292.                             <a href="<?php echo HTTP_HOST.'Shop'; echo $path .= ($each['htmlMetaTitle']!='Shop'?$each['metaKey'].'/':''); ?>" class="previous"><?php echo $each['htmlMetaTitle']; ?></a>
  293.                         <?php }
  294.                         $rsM = $db->query('SELECT * FROM `metaKey`,`pageMeta` WHERE `metaKey`.`metaId` = `pageMeta`.`metaId` AND `pageMeta`.`pageId` = '.$db->mes($page->row['pageId']).'');
  295.                         if ($rsM->num_rows()) $row_rsM = $rsM->get_row_assoc();
  296.                         ?>
  297.                         <a href="<?php echo HTTP_HOST.'Product'.$path.$page->row['pageName']; ?>"><?php echo $page->row['pageTitle']; ?></a></li>
  298.                     </ul>
  299.                 </div>
  300.             <!-- end full width breadcrumb -->
  301.            
  302.            
  303.             <div class="col-1">        
  304.             <div class="row">
  305.                 <div class="span4">
  306.                     <div class="image-select">
  307.                         <?php
  308.                         if ($rsThumb->num_rows()){
  309.                             $row_rsThumb = $rsThumb->get_row_assoc(); ?>
  310.                         <?php
  311.                             $img_ratio='';
  312.                             $filename = HTTP_HOST.'upload/340w/'.$row_rsThumb['fileId'].'_'.$row_rsThumb['fileName'];
  313.                             $filename = str_replace(' ','%20',$filename);
  314.                             list($img_width, $img_height, $type, $attr) = getimagesize($filename);
  315.                             //echo $img_width.' '.$img_height.' <br>';
  316.                             if ($img_width<$img_height) {
  317.                                 $img_ratio = 'height:210px;';
  318.                             } else {
  319.                                 $img_ratio = 'width:210px;';
  320.                             }
  321.                        
  322.                        
  323.                         ?>
  324.                         <div id="thumb"><img style="<?=$img_ratio;?>" id="thumb_main" src="<?php echo HTTP_HOST.'upload/full/'.$row_rsThumb['fileId'].'_'.$row_rsThumb['fileName']; ?>" alt="<?php echo htmlentities(truncate($page->row['pageTitle'])); ?>" /></div>
  325.  
  326.                         <div class="zoom">
  327.                             <a href="#" id="thumb_container_big"><img src="<?php HTTP_HOST ?>/img/zoom_in.png" /> <strong> ZOOM IN</strong> </a>
  328.                             <!-- <a class="lightbox" id="enlarge" href="<?php echo HTTP_HOST.'upload/full/'.$row_rsThumb['fileId'].'_'.$row_rsThumb['fileName']; ?>" target="_blank"><i class="fa fa-search-plus"> FULL SIZE </i></a> -->
  329.                             <a href="#" id="thumb_container_small"><img src="<?php HTTP_HOST ?>/img/zoom_out.png" /> <strong>ZOOM OUT</strong></a>
  330.                             <a href="#" id="thumb_reset"><img src="<?php HTTP_HOST ?>/img/search.png" /> <strong>RESET</strong></a>
  331.                         </div>
  332.                         <?php } ?>
  333.                     </div>
  334.                 </div>
  335.             </div>
  336.             </div>
  337.  
  338.             <div class="col-2">
  339.  
  340.                 <div id="description">
  341.                     <div class="overview">
  342.                     <div class="row">
  343.                         <div class="span5">
  344.                             <div id="product-description-container">
  345.                             <div class="tabbable"> <!-- Only required for left/right tabs -->
  346.                                 <ul class="nav nav-tabs" id="myTab">
  347.                                     <li class="active"><a href="#product_description">Description</a></li>
  348.                                 </ul>
  349.                                 <div class="tab-content">
  350.                                   <div class="tab-pane active" id="product_description">
  351.                                     <h4><?php echo $page->row['pageTitle']; ?></h4>
  352.                                     <?php echo $page->row['pageCopy']; ?>
  353.                                     <!--p>These sizes are just for reference only. Please see individual costume drop down box for available sizes, if there is no drop down box please read the costumes description for specific sizes, The below is just a guide as some costumes may vary.</p-->
  354.                                                            
  355.                                     <div class="clear"></div>
  356.                                    
  357.                                     <form method="post" id="jq_form">
  358.                                     <!-- Product Options (Options/Price/Purchase Button) -->
  359.                                     <table class='table table-condensed table-striped'>
  360.                                         <thead>
  361.                                             <tr>
  362.                                                 <th colspan="2">Product Code</th>
  363.                                                 <th class='center'><?php print_r($row_rsPO);?></th>
  364.                                                 <th>&nbsp;</th>
  365.                                             </tr>
  366.                                         </thead>
  367.                                         <tbody>
  368.                                             <!-- <tr>
  369.                                                 <th colspan="2">Product Options</th>
  370.                                                 <th class='center'>Size</th>
  371.                                                 <th>&nbsp;</th>
  372.                                             </tr> -->
  373.                                         <!--tr>
  374.                                             <td colspan="2">Choose Your Size</td>
  375.                                             <td class='center'>
  376.                                                 <select class="product-size-dropdown">
  377.                                                   <option>Extra Small: 6 - 10</option>
  378.                                                   <option>Extra Small: 6 - 10</option>
  379.                                                   <option>Extra Small: 6 - 10</option>
  380.                                                   <option>Extra Small: 6 - 10</option>
  381.                                                   <option>Extra Small: 6 - 10</option>
  382.                                                 </select>
  383.                                             </td>
  384.                                             <td>&nbsp;</td>
  385.                                         </tr-->
  386.                                         <?php
  387.                                             $rsPO = $db->select('pageOption',array('pageId'=>$db->mes($page->row['pageId'])),array('optionType'=>'ASC','price'=>'ASC'));
  388.                                             $rsPO1 = $db->select('pageOption',array('pageId'=>$db->mes($page->row['pageId'])),array('optionType'=>'ASC','price'=>'ASC'));
  389.                                            
  390.                                             //echo '<div style="display:none;">';
  391.                                                 $row_rsPO1 = $rsPO1->get_row_assoc();
  392.                                                 //print_r($row_rsPO1);
  393.                                                 if ($row_rsPO1['customAttributeValue']=='') {
  394.                                                     $row_rsPO1['customAttributeValue']=$row_rsPO1['customAttribute'];
  395.                                                     $row_rsPO1['customAttribute']='Colour ';
  396.                                                 }
  397.                                             //echo '</div>';
  398.                                             //echo '<span class="drop_down_label">'.$row_rsPO1['customAttribute'].' <span> <select id="productColor_id" name="productColor">';
  399.                                             //$php_array=array();
  400.                                             //while ($row_rsPO = $rsPO->get_row_assoc()){
  401.                                             //  $price_js = number_format(($price+$row_rsPO['price'])*($site->row['vatRate']/100+1),2);
  402.                                             //  $price_no_vat_js = number_format(($price+$row_rsPO['price']),2);
  403.                                             //  //print_r($row_rsPO);
  404.                                             //  if ($row_rsPO['customAttributeValue']=='') {
  405.                                             //      $row_rsPO['customAttributeValue']=$row_rsPO['customAttribute'];
  406.                                             //      $row_rsPO['customAttribute']='Colour ';
  407.                                             //  }
  408.                                             // 
  409.                                             // 
  410.                                             //  echo ' <option value="'.$row_rsPO['customAttributeValue'].'">'.$row_rsPO['customAttributeValue'].'</option>';
  411.                                             //  if (isset($row_rsPO['customAttribute'])) {
  412.                                             //      //echo $row_rsPO['customAttribute'].': '.$row_rsPO['customAttributeValue'].'<br />';
  413.                                             //  }
  414.                                             //   //echo $row_rsPO['optionColour'];
  415.                                             //  if (!isset($sizeWeight)){$sizeWeight=substr($row_rsPO['sizeWeight'],strpos($row_rsPO['sizeWeight'],';'));}
  416.                                             //  $php_array[$row_rsPO['customAttributeValue']] = array(
  417.                                             //      'stock'=>$row_rsPO['stock'],
  418.                                             //      'price'=>'&pound;'.$price_js.'<span class="vat">(&pound;'.$price_no_vat_js.'<br />exc VAT)</span>',
  419.                                             //      'weight'=>$row_rsPO['sizeWeight'],
  420.                                             //  );
  421.                                             //}
  422.                                             //echo '</select><br>';
  423.                                             //print_r($php_array);
  424.                                             echo '<td colspan="2"><span class="drop_down_label">Quantity<span></td>';
  425.                                             echo '<td>';
  426.                                             $frm_qty = new Select($db,'quantity['.$row_rsPO['optionName'].']','jq_qty',($_POST['quantity'][$row_rsPO['optionName']]?$_POST['quantity'][$row_rsPO['optionName']]:1),'');
  427.                                             for ($i=1;$i<=14; $i+=1 ) $frm_qty->newOption($i,$i);
  428.                                             $frm_qty->writeLabel(); $frm_qty->write();
  429.                                         ?>
  430.                                             <input id="poOptionType" type="hidden" name="poOptionType" value="<?php echo $row_rsPO['optionType']; ?>" />
  431.                                         <?php echo '</td><td>&nbsp;</td>'; ?>
  432.                                        
  433.                                         <tr>
  434.                                             <!--<td><?php
  435.                                             //$frm_add = new Image($db,'add['.$row_rsPO['optionName'].']','','Add to Basket');
  436.                                             //$frm_add->src = HTTP_HOST.'Images/Buttons/Basket-Nurture.png';
  437.                                             //$frm_add->write();  ?></td>-->
  438.                                             <td><input type="submit" class="btn btn-success" value="Add to Basket"></td>
  439.                                             <td>&nbsp;</td>
  440.                                             <td>&nbsp;</td>
  441.                                             <td>&nbsp;</td>
  442.                                         </tr>
  443.                                         </form>
  444.                                        
  445.                                         </tbody>
  446.                                     </table>
  447.                                 </div>
  448.                                
  449.                                         <div class="tab-pane" id="product_information">
  450.                                         <div class="facts">
  451.                                             <div class="left">
  452.                                                 <h4>Quick Facts</h4>                              
  453.                                                   <strong>Stockcode</strong><br /><span class="show_weight" id="stockcode_id"></span><br />
  454.                                                   <strong>Weight</strong><br /><span class="show_weight" id="weight_id"><?=$sizeWeight;?></span>
  455.                                             </div>
  456.                                             <div class="right">
  457.                                                 <h4>Page Options</h4>
  458.                                                 Print Page<br />
  459.                                                 Social Bookmarks
  460.                                             </div>
  461.                                         </div>
  462.                                 </div><!-- end product_information -->
  463.                                 </div><!-- end tab-content -->
  464.                                 <div class="clear"></div>
  465.                         </div><!-- end tab-content -->
  466.                 </div>
  467.                
  468.             </div><!-- end span8 -->
  469.                 <div class="span3">
  470.                     <div class="product-details-right">
  471.                         <h3 class="pull-right">&#163;<?php
  472.                             if ($user->row['account']){
  473.                             $price = number_format($row_rsPO['wholesaleMultiplier']*(($page->row['pageSalePrice']?$page->row['pageSalePrice']+$row_rsPO['salePrice']:$page->row['pagePrice']+$row_rsPO['price'])),2);
  474.                             $price_no_vat = number_format($row_rsPO['wholesaleMultiplier']*(($page->row['pageSalePrice']?$page->row['pageSalePrice']+$row_rsPO['salePrice']:$page->row['pagePrice']+$row_rsPO['price'])),2);
  475.                             } else {
  476.                                 //$price = number_format(($page->row['pagePrice']+$row_rsPO['price'])*($site->row['vatRate']/100+1),2);
  477.                                 $price = number_format(($page->row['pagePrice']+$row_rsPO['price']),2);
  478.                                 $price_no_vat = number_format(($page->row['pagePrice']+$row_rsPO['price']),2);
  479.                             }
  480.                             if (substr($price,-3)=='.00'){
  481.                             echo (substr($price,0,strlen($price)-3));
  482.                             } else {
  483.                             echo $price;
  484.                             }
  485.                             ?>
  486.                         </h3>
  487.                         <div class="clear"></div>
  488.                         <h6>Still Under Development...</h6>
  489.                         <div class="product-detail1"><strong>Code:</strong> 123456789</div>
  490.                        
  491.                     <div id="fb-root"></div>
  492. <div id="fb-root"></div>
  493. <script>(function(d, s, id) {
  494.   var js, fjs = d.getElementsByTagName(s)[0];
  495.   if (d.getElementById(id)) return;
  496.   js = d.createElement(s); js.id = id;
  497.   js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&appId=102230299816205";
  498.   fjs.parentNode.insertBefore(js, fjs);
  499. }(document, 'script', 'facebook-jssdk'));</script>
  500.                        
  501.                         <div class="product-detail2">
  502.                         <a href="https://twitter.com/share" class="twitter-share-button" data-lang="en">Tweet</a>
  503. <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
  504.  
  505. <div class="fb-share-button" data-href="http://developers.facebook.com/docs/plugins/" data-type="button_count"></div>
  506.  
  507. </div>
  508.  
  509.                         <div class="product-detail3">
  510.                             <form method="post" id="jq_form">
  511.                                 <?php $frm_qty = new Select($db,'quantity['.$row_rsPO['optionName'].']','jq_qty',($_POST['quantity'][$row_rsPO['optionName']]?$_POST['quantity'][$row_rsPO['optionName']]:1),''); ?>
  512.                                 <?php for ($i=1;$i<=14; $i+=1 ) $frm_qty->newOption($i,$i);
  513.                                             $frm_qty->writeLabel(); $frm_qty->write();  ?>
  514.                                 <input id="poOptionType" type="hidden" name="poOptionType" value="<?php echo $row_rsPO['optionType']; ?>" />
  515.                             </form>
  516.                         </div>
  517.  
  518.                         <form method="post" id="jq_form">
  519.                             <input type="submit" class="btn btn-success" style="width: 200px" value="Add to Basket">
  520.                         </form>
  521.                     </div>
  522.                 </div>
  523.             </div><!-- end row -->
  524.             </div><!-- end overview div -->
  525. <script type='text/javascript'>
  526. <?php
  527. $js_array = json_encode($php_array);
  528. echo "var javascript_array = ". $js_array . ";\n";
  529. ?>
  530.  
  531.     $('#productColor_id').change(function(){
  532.    
  533.         //console.log($(this).val());
  534.         //console.log(javascript_array);
  535.         $('#stockcode_id').html(javascript_array[$(this).val()]['stock']);
  536.         $('#price_id').html(javascript_array[$(this).val()]['price']);
  537.         $('#weight_id').html(javascript_array[$(this).val()]['weight']);
  538.         $('#poOptionType').val(javascript_array[$(this).val()]['stock']);
  539.     });
  540.     $(document).ready(function(){
  541.         $('#productColor_id').change();
  542.     });
  543.  
  544. </script>
  545.  
  546.                
  547.             </div><!-- End Description -->
  548.             <div class="clear"></div>
  549. <!--ul id="tab_list">
  550.     <li><a href="#tab_001">Product Description</a></li>
  551.     <li><a href="#tab_002">Product Specification</a></li>
  552.     <li><a href="#tab_003">Resources and Download</a></li>
  553. </ul>  
  554.            
  555.            
  556. <div id="tab_001" class="overview">
  557.     <div class="description">
  558.         <div class="left">
  559.             <h2>In Brief ...</h2>
  560.             <div id="product_description" class="short_text">
  561.                 <p><?php echo $page->row['pageCopy']; ?></p>  
  562.             </div-->
  563.             <!--script type="text/javascript">
  564.             $(document).ready(function(){
  565.                 $('#product_description_show_all').click(function(){
  566.                     var cur_status = $('#product_description').attr("class");
  567.                     //alert (cur_status);
  568.                     if (cur_status=='short_text') {
  569.                         $('#product_description').removeClass('short_text');
  570.                         $('#product_description').addClass('long_text');
  571.                         $('#product_description').css('height','100%');
  572.                        
  573.                     } else {
  574.                         $('#product_description').removeClass('long_text');
  575.                         $('#product_description').addClass('short_text');
  576.                         $('#product_description').css('height','95px');
  577.                     }
  578.                 });
  579.             });
  580.             </script>
  581.             <div id="product_description_show_all"><span>-Show All-<span></div-->
  582.         <!--/div>
  583.     </div>
  584.     <div class="clear"></div>
  585. </div-->               
  586.            
  587. <div id="tab_002" class="overview">                          
  588.     <div class="description">
  589.         <div class="left">
  590.             <h2>In Brief ...</h2>
  591.                 <p><?php echo $page->row['pageSpec']; ?></p>                  
  592.         </div>
  593.  
  594.     </div>
  595.     <div class="clear"></div>
  596. </div>
  597. <div id="tab_003" class="overview">                          
  598.     <div class="description">
  599.         <div class="left">
  600.             <h2>Download:</h2>
  601.                 <p><?php echo 'To be added'; ?></p>                  
  602.         </div>
  603.     </div>
  604.     <div class="clear"></div>
  605. </div>        
  606.     <div class="clear"></div>
  607.         <div id="details">
  608.             <div id="footer-2">
  609.             <?php
  610.              $suggestCatalogue = new Catalogue($db,$site,$catalogue->setCatRoot($routeArray[0]['metaId']),1); $suggestCatalogue->perPage=5; ?>
  611.                 <!-- Accessories
  612.                 <div class="well">
  613.                 <h4>Accessories</h4>
  614.                 <table class='table table-condensed table-striped'>
  615.                     <tbody>
  616.                         <tr>
  617.                             <td><img src="http://placehold.it/75x75" alt="" title=""></td>
  618.                             <td class='accessories-description'>
  619.                                 <h6>Yellow Face Paint</h6>
  620.                                 <p>2</p>
  621.                             </td>
  622.                             <td class='center'>&nbsp;</td>
  623.                             <td><a href='#' class='btn btn-mini btn-success pull-right'>Add to Basket</a></td>
  624.                         </tr>
  625.                         <tr>
  626.                             <td><img src="http://placehold.it/75x75" alt="" title=""></td>
  627.                             <td class='accessories-description'>
  628.                                 <h6>Yellow Face Paint</h6>
  629.                                 <p>2</p>
  630.                             </td>
  631.                             <td class='center'>&nbsp;</td>
  632.                             <td><a href='#' class='btn btn-mini btn-success pull-right'>Add to Basket</a></td>
  633.                         </tr>
  634.                         <tr>
  635.                             <td><img src="http://placehold.it/75x75" alt="" title=""></td>
  636.                             <td class='accessories-description'>
  637.                                 <h6>Yellow Face Paint</h6>
  638.                                 <p>2</p>
  639.                             </td>
  640.                             <td class='center'>&nbsp;</td>
  641.                             <td><a href='#' class='btn btn-mini btn-success pull-right'>Add to Basket</a></td>
  642.                         </tr>
  643.                     </tbody>
  644.                 </table>
  645.                 </div>
  646.                  END Accessories -->
  647.             </div>
  648.         </div>  
  649.         </div>      
  650. <?php } ?>
  651. <?php require_once(DOCUMENT_ROOT.'/_includes/footer.inc.php'); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement