Guest User

Php. magento

a guest
Apr 30th, 2013
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 62.80 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4.  
  5. function count_hit()
  6. {
  7.  
  8.  
  9.  
  10. $file_pointer= fopen("hits.txt", "r+");
  11.  
  12.  
  13.  
  14. if ($file_pointer == false)
  15.  
  16.  
  17.  
  18. {
  19.  
  20.  
  21.  
  22. return "Error: could not open the file! It may not exist!";
  23.  
  24.  
  25.  
  26. exit;
  27.  
  28.  
  29.  
  30. }
  31.  
  32.  
  33.  
  34. $hits= fread($file_pointer, filesize("hits.txt"));
  35.  
  36.  
  37.  
  38. $hits= trim($hits);
  39.  
  40.  
  41.  
  42. $hits++;
  43.  
  44.  
  45.  
  46. fseek($file_pointer, 0);
  47.  
  48.  
  49.  
  50. $result= fwrite($file_pointer, $hits);
  51.  
  52.  
  53.  
  54. if ($result == false)
  55.  
  56.  
  57.  
  58. {
  59.  
  60.  
  61.  
  62. return "Error: could not write to the file!";
  63.  
  64.  
  65.  
  66. exit;
  67.  
  68.  
  69.  
  70. }
  71.  
  72.  
  73.  
  74. else {
  75.  
  76.  
  77.  
  78. return $hits;
  79.  
  80.  
  81.  
  82. }
  83.  
  84.  
  85.  
  86. $close= fclose($file_pointer);
  87.  
  88.  
  89.  
  90. if ($close == false)
  91.  
  92.  
  93.  
  94. {
  95.  
  96.  
  97.  
  98. echo "Error: could not close the file!";
  99.  
  100.  
  101.  
  102. exit;
  103.  
  104.  
  105.  
  106. }
  107.  
  108.  
  109.  
  110. }
  111.  
  112.  
  113.  
  114. ?>
  115.  
  116. <script type="text/javascript">
  117.  
  118. hs.graphicsDir = '<?php echo $this->getSkinUrl(); ?>highslide/graphics/';
  119.  
  120. hs.align = 'center';
  121.  
  122. hs.transitions = ['expand', 'crossfade'];
  123.  
  124. hs.outlineType = 'rounded-white';
  125.  
  126. hs.fadeInOut = true;
  127.  
  128. //hs.dimmingOpacity = 0.75;
  129.  
  130.  
  131.  
  132. // Add the controlbar
  133.  
  134. hs.addSlideshow({
  135.  
  136.     //slideshowGroup: 'group1',
  137.  
  138.     interval: 5000,
  139.  
  140.     repeat: false,
  141.  
  142.     useControls: true,
  143.  
  144.     fixedControls: 'fit',
  145.  
  146.     overlayOptions: {
  147.  
  148.         opacity: 0.75,
  149.  
  150.         position: 'bottom center',
  151.  
  152.         hideOnMouseOut: true
  153.  
  154.     }
  155.  
  156. });
  157.  
  158. </script>
  159.  
  160. <?php
  161.  
  162. $_restaurant = Mage::getModel('dailydeals/merchant')->load($this->getRequest()->getParam("id"));
  163.  
  164. if(!$_restaurant->getIsNonpaying()):
  165.  
  166.     function isValidURL($url)
  167.  
  168.     {
  169.  
  170.     return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url);
  171.  
  172.     }
  173.  
  174. ?>
  175.  
  176. <div class="view-restaurant">
  177.  
  178.     <div class="block block-seeour">
  179.  
  180.         <div class="block-title">
  181.  
  182.             <strong><span><?php echo $this->__("See Our"); ?></span></strong>
  183.  
  184.         </div>         
  185.  
  186.         <div class="block-content">
  187.  
  188.             <ul>
  189.  
  190.                 <li>
  191.  
  192.                     <?php
  193.  
  194.                     $collection = Mage::getModel('coupons/coupons')->getCollection()->addFieldToFilter("status", 1)->addFieldToFilter("user_id", $_restaurant->getCustomerId());  
  195.  
  196.                     if(count($collection)>0):
  197.  
  198.                     ?>
  199.  
  200.                     <a href="<?php echo $this->getUrl("restaurant-coupons"); ?>?id=<?php echo $this->getRequest()->getParam("id"); ?>"><img src="<?php echo $this->getSkinUrl("images/coupons.jpg"); ?>" /><br><?php echo $this->__("Coupons"); ?></a>
  201.  
  202.                     <?php else: ?>
  203.  
  204.                     <a href="javascript: void(0)"><img src="<?php echo $this->getSkinUrl("images/coupons-inactive.jpg"); ?>" /><br><?php echo $this->__("Coupons"); ?></a>
  205.  
  206.                     <?php endif; ?>
  207.  
  208.                 </li>
  209.  
  210.  
  211.  
  212.                 <li>
  213.  
  214.                     <?php if($_restaurant->getMerchantMenu()!=""): ?>
  215.  
  216.                         <a target="_blank" href="<?php echo Mage::getBaseUrl('media')."merchant_menu/".$_restaurant->getMerchantMenu(); ?>"><img src="<?php echo $this->getSkinUrl("images/restaurant-menu.jpg"); ?>" /><br><?php echo $this->__("Menu"); ?></a>
  217.  
  218.                     <?php else: ?>
  219.  
  220.                         <a href="javscript: void(0)"><img src="<?php echo $this->getSkinUrl("images/restaurant-menu-inactive.jpg"); ?>" /><br><?php echo $this->__("Menu"); ?></a>
  221.  
  222.                     <?php endif; ?>
  223.  
  224.                 </li>
  225.  
  226.  
  227.  
  228.                 <li>
  229.  
  230.                     <?php
  231.  
  232.                     $collection = Mage::getModel('events/events')->getCollection()->addFieldToFilter("status", 1)->addFieldToFilter("user_id", $_restaurant->getCustomerId());  
  233.  
  234.                     if(count($collection)>0):
  235.  
  236.                     ?>
  237.  
  238.                     <a href="<?php echo $this->getUrl("restaurant-events"); ?>?id=<?php echo $this->getRequest()->getParam("id"); ?>"><img src="<?php echo $this->getSkinUrl("images/events.jpg"); ?>" /><br><?php echo $this->__("Events"); ?></a>
  239.  
  240.                     <?php else: ?>
  241.  
  242.                     <a href="javascript: void(0)"><img src="<?php echo $this->getSkinUrl("images/events-inactive.jpg"); ?>" /><br><?php echo $this->__("Events"); ?></a>
  243.  
  244.                     <?php endif; ?>
  245.  
  246.                 </li>
  247.  
  248.  
  249.  
  250.                 <li>
  251.  
  252.                     <?php
  253.  
  254.                     $collection = Mage::getModel('photos/photos')->getCollection()->addFieldToFilter("status", 1)->addFieldToFilter("user_id", $_restaurant->getCustomerId());  
  255.  
  256.                     if(count($collection)>0):
  257.  
  258.                     ?>
  259.  
  260.                     <a href="<?php echo $this->getUrl("restaurant-photos"); ?>?id=<?php echo $this->getRequest()->getParam("id"); ?>"><img src="<?php echo $this->getSkinUrl("images/photos.jpg"); ?>" /><br><?php echo $this->__("Photos"); ?></a>
  261.  
  262.                     <?php else: ?>
  263.  
  264.                     <a href="javascript: void(0)"><img src="<?php echo $this->getSkinUrl("images/photos-inactive.jpg"); ?>" /><br><?php echo $this->__("Photos"); ?></a>
  265.  
  266.                     <?php endif; ?>
  267.  
  268.                 </li>
  269.  
  270.  
  271.  
  272.                 <li>
  273.  
  274.                     <?php $collection = Mage::getModel('videos/videos')->getCollection()->addFieldToFilter("status", 1)->addFieldToFilter("merchant_id", $this->getRequest()->getParam("id"));  
  275.  
  276.                     if(count($collection)>0):
  277.  
  278.                     ?>
  279.  
  280.                     <a href="<?php echo $this->getUrl("restaurant-video"); ?>?id=<?php echo $this->getRequest()->getParam("id"); ?>"><img src="<?php echo $this->getSkinUrl("images/videos.jpg"); ?>" /><br><?php echo $this->__("Videos"); ?></a>
  281.  
  282.                     <?php else: ?>
  283.  
  284.                     <a href="javascript: void(0)"><img src="<?php echo $this->getSkinUrl("images/videos-inactive.jpg"); ?>" /><br><?php echo $this->__("Videos"); ?></a>
  285.  
  286.                     <?php endif; ?>
  287.  
  288.                 </li>
  289.  
  290.  
  291.  
  292.                 <li>
  293.  
  294.                     <?php
  295.  
  296.                     $collection = Mage::getModel('articles/articles')->getCollection()->addFieldToFilter("status", 1)->addFieldToFilter("user_id", $_restaurant->getCustomerId());  
  297.  
  298.                     if(count($collection)>0):
  299.  
  300.                     ?>
  301.  
  302.                     <a href="<?php echo $this->getUrl("restaurant-articles"); ?>?id=<?php echo $this->getRequest()->getParam("id"); ?>"><img src="<?php echo $this->getSkinUrl("images/articles.jpg"); ?>" /><br><?php echo $this->__("Articles"); ?></a>
  303.  
  304.                     <?php else: ?>
  305.  
  306.                     <a href="javascript: void(0)"><img src="<?php echo $this->getSkinUrl("images/articles-inactive.jpg"); ?>" /><br><?php echo $this->__("Articles"); ?></a>
  307.  
  308.                     <?php endif; ?>
  309.  
  310.                 </li>
  311.  
  312.                 <li>
  313.  
  314.                     <?php
  315.  
  316.                     $collection = Mage::getResourceModel('catalog/product_collection')->addAttributeToFilter('type_id', array('eq' => 'ugiftcert'))->addFieldToFilter("merchant_id", $this->getRequest()->getParam("id"));
  317.  
  318.                     if(count($collection)>0):                  
  319.  
  320.                         foreach($collection as $item):
  321.  
  322.                             $_product = Mage::getModel("catalog/product")->load($item->getId());
  323.  
  324.                     ?>
  325.  
  326.                         <a href="<?php echo $_product->getProductUrl() ?>"><img src="<?php echo $this->getSkinUrl("images/gift-cards.jpg"); ?>" /><br><?php echo $this->__("Gift Cards"); ?></a>
  327.  
  328.                     <?php break; ?>
  329.  
  330.                     <?php endforeach; ?>
  331.  
  332.                     <?php else: ?>
  333.  
  334.                     <a href="javascript: void(0)"><img src="<?php echo $this->getSkinUrl("images/gift-cards-inactive.jpg"); ?>" /><br><?php echo $this->__("Gift Cards"); ?></a>
  335.  
  336.                     <?php endif; ?>
  337.  
  338.                 </li>
  339.  
  340.             </ul>          
  341.  
  342.         </div>
  343.  
  344.  
  345.  
  346.     </div>
  347.  
  348.  
  349.  
  350.    
  351.  
  352.     <div class="col-content">
  353.  
  354.         <h1><?php echo $_restaurant->getMerchantName(); ?></h1>
  355.  
  356.         <!--<img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>restaurant-img.jpg" />-->
  357.  
  358.         <?php
  359.  
  360.         $collection = Mage::getModel('photos/photos')->getCollection()->addFieldToFilter("status", 1)->addFieldToFilter("user_id", $_restaurant->getCustomerId());  
  361.  
  362.         ?>
  363.  
  364.         <div class="restaurant-info">
  365.  
  366.             <div class="restaurant-logo">
  367.  
  368.                 <?php
  369.  
  370.                  // actual path of image
  371.  
  372.                 $_imageUrl = Mage::getBaseDir('media').DS."merchant_image".DS.$_restaurant->getMerchantImage();
  373.  
  374.                
  375.  
  376.                 $imageResized = Mage::getBaseDir('media').DS."merchant_image".DS."resized".DS."188_143".DS.$_restaurant->getMerchantImage();
  377.  
  378.                  
  379.  
  380.                 if (!file_exists($imageResized)&&file_exists($_imageUrl)) :
  381.  
  382.                   $imageObj = new Varien_Image($_imageUrl);
  383.  
  384.                   $imageObj->constrainOnly(TRUE);
  385.  
  386.                   $imageObj->keepAspectRatio(FALSE);
  387.  
  388.                   $imageObj->keepFrame(FALSE);               
  389.  
  390.                   $imageObj->backgroundColor(array(255,255,255));
  391.  
  392.                   $imageObj->resize(188, 143);
  393.  
  394.                   $imageObj->save($imageResized);
  395.  
  396.                  
  397.  
  398.                 endif;
  399.  
  400.                 ?>                 
  401.  
  402.                 <img src="<?php echo Mage::getBaseUrl('media')."merchant_image/resized/188_143/".$_restaurant->getMerchantImage() ?>" width="188"/>
  403.  
  404.             </div>
  405.  
  406.             <div class="restaurant-details">
  407.  
  408.                 <div class="cuisine"><?php echo $this->__("Cuisine Type"); ?>: <?php echo $_restaurant->getMerchantCuisine() ?></div>
  409.  
  410.                 <div class="price-range"><?php echo $this->__("Price Range"); ?>: <?php echo $_restaurant->getMerchantPriceRange() ?></div>
  411.  
  412.                 <div class="address"><?php echo $_restaurant->getMerchantAddress(); ?></div>
  413.  
  414.                 <div class="website"><a target="_blank" href="<?php if(!isValidURL($_restaurant->getMerchantWebsite())){ echo "http://".$_restaurant->getMerchantWebsite(); }else{ echo $_restaurant->getMerchantWebsite(); } ?>"><?php echo $_restaurant->getMerchantWebsite(); ?></a></div>
  415.  
  416.                 <div class="website"><?php echo $_restaurant->getMerchantPhone(); ?></div>
  417.  
  418.                 <div class="website"><a target="_blank" href="<?php if(!isValidURL($_restaurant->getMerchantFacebookLink())){ echo "http://".$_restaurant->getMerchantFacebookLink(); }else{ echo $_restaurant->getMerchantFacebookLink(); } ?>"><?php echo $_restaurant->getMerchantFacebookLink(); ?></a></div>
  419.  
  420.                 <div class="website"><a target="_blank" href="<?php if(!isValidURL($_restaurant->getMerchantTwitterLink())){ echo "http://".$_restaurant->getMerchantTwitterLink(); }else{ echo $_restaurant->getMerchantTwitterLink(); } ?>"><?php echo $_restaurant->getMerchantTwitterLink(); ?></a></div>
  421.  
  422.                 <div class="payments-accepted">
  423.  
  424.                     <?php if($_restaurant->getMerchantPaymentsCash()==1): ?>
  425.  
  426.                         <img src="<?php echo Mage::getBaseUrl('media')."payments_accepted/cash-on-delivery.png"; ?>" />
  427.  
  428.                     <?php endif; ?>
  429.  
  430.                     <?php if($_restaurant->getMerchantPaymentsMaster()==1): ?>
  431.  
  432.                         <img src="<?php echo Mage::getBaseUrl('media')."payments_accepted/mastercard.png"; ?>" />
  433.  
  434.                     <?php endif; ?>
  435.  
  436.                     <?php if($_restaurant->getMerchantPaymentsVisa()==1): ?>
  437.  
  438.                         <img src="<?php echo Mage::getBaseUrl('media')."payments_accepted/visa.png"; ?>" />
  439.  
  440.                     <?php endif; ?>
  441.  
  442.                     <?php if($_restaurant->getMerchantPaymentsAe()==1): ?>
  443.  
  444.                         <img src="<?php echo Mage::getBaseUrl('media')."payments_accepted/american-express.png"; ?>" />
  445.  
  446.                     <?php endif; ?>
  447.  
  448.                     <?php if($_restaurant->getMerchantPaymentsInterac()==1): ?>
  449.  
  450.                         <img src="<?php echo Mage::getBaseUrl('media')."payments_accepted/interac.png"; ?>" />
  451.  
  452.                     <?php endif; ?>            
  453.  
  454.                 </div>
  455.  
  456.                 <?php if(!$_restaurant->getHideOrderDelivery()): ?>
  457.  
  458.                 <div class="restaurant-tools">
  459.  
  460.                     <p class="table-reservation"><!--<a class="reservation" href="#"><span><?php echo $this->__("Make a reservation"); ?></span></a>-->
  461.  
  462.                     <?php if(($_restaurant->getMerchantMenuUrl()!="")&&($_restaurant->getMerchantMenuUrl()!="0")): ?>
  463.                        
  464.  
  465.            
  466.    
  467.                         <script>
  468.                         function checkdeliverytype()
  469.                         {
  470.                         document.getElementById('light').style.display='block';
  471.                           document.getElementById('fade').style.display='block';
  472.                         }
  473.                         function ckeckvalueofform(str)
  474.                         {
  475.                    
  476.                         //alert(str);
  477.                         var radios = document.getElementsByName('deliverytype');
  478.                        
  479.                             for (var i = 0, length = radios.length; i < length; i++) {
  480.                                 if (radios[i].checked) {
  481.                                     var lastcall=radios[i].value;
  482.                                    
  483.                                     //alert(document.getElementById('example12').value);
  484.                                     if(lastcall == 'delivery')
  485.                                     {
  486.                                         var xyz=<?php echo $_restaurant->getDeliveryOption();?>;
  487.                                         if(xyz != 1)
  488.                                         {
  489.                                         document.getElementById('light').style.display='none';
  490.                                           document.getElementById('fade').style.display='none';
  491.                                           if(str =='francais')
  492.                                           {
  493.                                           alert('Este restaurante no ofrece la Entrega. Por favor seleccione la elección opción');
  494.                                           }
  495.                                           else
  496.                                           {
  497.                                             alert('This restaurant does not offer Delivery. Please select the pick up option');
  498.                                            }   
  499.                                         return false;
  500.                                         }
  501.                                         else
  502.                                         {
  503.                                         //alert(document.getElementsByName('ordtimesel').value);
  504.                                            
  505.                                        
  506.                                        
  507.                                         //var today = new Date();
  508.                                           //var expiry = new Date(today.getTime() + 1 * 24 * 3600 * 1000);
  509.                                           //var serviceofdeliveryck = 'serviceofdeliveryck';
  510.                                           //var valueincok='Home Delivery';
  511.                                           //document.cookie=serviceofdeliveryck + "=" + escape(valueincok) + "; path=/; expires=" + expiry.toGMTString();
  512.                                             //return true;
  513.                                         }
  514.                                     }
  515.                                     else
  516.                                     {
  517.                                         var xyz=<?php echo $_restaurant->getCheckpickup();?>;
  518.                                         if(xyz != 1)
  519.                                         {
  520.                                             document.getElementById('light').style.display='none';
  521.                                           document.getElementById('fade').style.display='none';
  522.                                        
  523.                                             if(str =='francais')
  524.                                           {
  525.                                           alert('Este restaurante no ofrece recogen. Por favor seleccione la opción de Entrega');
  526.                                           }
  527.                                           else
  528.                                           {
  529.                                             alert('This restaurant does not offer pick up. Please select the Delivery option');
  530.                                            }   
  531.                                         return false;
  532.                                         }
  533.                                         else
  534.                                         {
  535.                                             if(document.getElementById('example12').value == 'click here' || document.getElementById('ordtimeseln').checked)
  536.                                             {
  537.                                                
  538.                                             if(parseInt(document.getElementById('operational_hr_fr').value) < parseInt(document.getElementById('currenttime').value) && parseInt(document.getElementById('currenttime').value) < parseInt(document.getElementById('operational_hr_to').value))
  539.                                             {
  540.                                                 var today = new Date();
  541.                                                  var expiry = new Date(today.getTime() + 1 * 24 * 3600 * 1000);
  542.                                                   var serviceofdeliveryck = 'serviceofdeliveryck';
  543.                                                     var valueincok='PickUp Delivery';
  544.                                                   document.cookie=serviceofdeliveryck + "=" + escape(valueincok) + "; path=/; expires=" + expiry.toGMTString();                                                 var serviceofdeliverycknew= 'Dateoddelivery';
  545.                                                     //var valueincoknew=Date(year);
  546.                                                     var currentTime = new Date();
  547.                                                     var month = currentTime.getMonth() + 1;
  548.                                                     var day = currentTime.getDate();
  549.                                                     var year = currentTime.getFullYear();
  550.                                                     var valueincoknew=month + "/" + day + "/" + year;
  551.                                                      document.cookie=serviceofdeliverycknew + "=" + escape(valueincoknew) + "; path=/; expires=" + expiry.toGMTString();
  552.                                                 // var da=Date(document.getElementById('currenttime').value);
  553.                                                  //alert(da);
  554.                                                 //alert('<?php echo $this->getUrl('onestepcheckout', array('_secure'=>true)) ?>');
  555.                                                 //alert(document.getElementById('operational_hr_fr').value);
  556.                                                 //alert(document.getElementById('currenttime').value);
  557.                                                 //alert(document.getElementById('operational_hr_to').value);
  558.                                                 //alert('right');
  559.                                                 return true;
  560.                                             }
  561.                                             else
  562.                                             {
  563.                                             alert("Le restaurant est pr"+unescape('%E9')+"sentement ferm"+unescape('%E9')+".");
  564.                                             return false;  
  565.                                             }  
  566.                                             }
  567.                                             else
  568.                                             {
  569.                                                
  570.                             var advancedateTime = document.getElementById('example12').value.replace('/','-').replace('/','-');
  571.                             var asdasd=document.getElementById('example12').value;
  572.                             var asgg=Date(asdasd);
  573.                             var onlydate=asdasd.split(" ");
  574.                             var lastandlastdate=onlydate[0];
  575.                             var jul07 = new Date(lastandlastdate);
  576.                             var finallyday=jul07.getDay();
  577.                             //var asdasasddas=jul07.getDAY();
  578.                             alert(finallyday);
  579.                             switch (finallyday)
  580.                             {
  581.                                 case 0:
  582.                                
  583.                                 break;
  584.                                 case 1:
  585.                                
  586.                                 break;
  587.                                 case 2:
  588.                                    
  589.                                 break;
  590.                                 case 3:
  591.                                
  592.                                 break;
  593.                                 case 4:
  594.                                
  595.                                 break;
  596.                                 case 5:
  597.                                
  598.                                 break;
  599.                                 case 6:
  600.                                
  601.                                 break;
  602.                                
  603.                                
  604.                             }
  605.                             //var hariomsir=lastandlastdate.replace(/blue/gi,"red");
  606.                             //alert(hariomsir);
  607.                             //alert(advancedateTime);
  608.                             //alert('<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK); ?>menus/index/viewdays');
  609.                             //alert(asgg.getUTCDay());
  610.                             return false;
  611.            
  612.                                             }
  613.                                         }
  614.                                     }
  615.                                    
  616.                                    
  617.                                 }
  618.                             }
  619.                         }
  620.                        
  621.                         </script>
  622.                        
  623.                        
  624.                        
  625.                        
  626.                         <style>
  627.                       .black_overlay{
  628.                             display: none;
  629.                             position: absolute;
  630.                             top: 0%;
  631.                             left: 0%;
  632.                             width: 100%;
  633.                             height: 2500px;
  634.                             background-color: black;
  635.                             z-index:1001;
  636.                             -moz-opacity: 0.8;
  637.                             opacity:.80;
  638.                             filter: alpha(opacity=80);
  639.                         }
  640.                         .white_content {
  641.                             display: none;
  642.                             position: fixed;
  643.                             top: 20%;
  644.                             left: 45%;
  645.                             width: auto;
  646.                             height: auto;
  647.                             padding: 16px;
  648.                             border: 2px solid #f19317;
  649.                             background-color: white;
  650.                             z-index:1002;
  651.                             overflow: auto;
  652.                             margin:0  0  0  -120px;
  653.                            
  654.                         }
  655.                    
  656.                     </style>
  657.                         <link rel="stylesheet" media="all" type="text/css" href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS); ?>jquery-ui-timepicker-addon.css" />
  658.        
  659.         <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
  660.         <script type="text/javascript" src="http://code.jquery.com/ui/1.8.21/jquery-ui.min.js"></script>
  661.         <script type="text/javascript" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS); ?>jquery-ui-timepicker-addon.js"></script>
  662.         <script type="text/javascript" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS); ?>jquery-ui-sliderAccess.js"></script>
  663. <script type="text/javascript">
  664.  
  665.  
  666.     function showdatetimes()
  667.     {
  668.        
  669.     $('#example12').datetimepicker({
  670.     minDate: 0
  671.     });
  672.    
  673.     $('#ui-datepicker-div').css({"z-index":'15'});
  674.    
  675.     }
  676.    
  677.  
  678. function showhidetimes(val)
  679. {
  680. if(val == 'l')
  681. {
  682. document.getElementById("timenew").style.display = 'block';
  683.     $('#example12').datetimepicker({
  684.     minDate: 0
  685.     });
  686.    
  687.     $('#ui-datepicker-div').css({"z-index":'15'});
  688.     $('#ui-datepicker-div').css({"top":'152.6px'});
  689.     $('#ui-datepicker-div').attr('id', 'white_content');
  690.    
  691. }
  692. if(val == 'n')
  693. {
  694. document.getElementById("timenew").style.display = 'none'; 
  695. }
  696. }
  697.  
  698.  
  699.  
  700.  
  701. </script>
  702.                             <div id="fade" class="black_overlay"></div>
  703.                            
  704.                             <div id="light" class="white_content">
  705.                            
  706.                              <div >
  707.                              <?php
  708.  
  709. $currenttime =  Mage::getModel('core/date')->timestamp();
  710.  
  711.  $id = (int) $this->getRequest()->getParam('id');
  712.  
  713.      if(!$id)
  714.       {
  715.         $allItems = Mage::getModel('menus/cart')->getQuote()->getAllItems();
  716.        
  717.         foreach($allItems as $item)
  718.         {
  719.             $product_id =   $item->getProductId();
  720.         }
  721.            
  722.         $menusData = Mage::getModel('menus/menus')->load($product_id, 'product_id');
  723.  
  724.         $id = $menusData->getMerchantId();
  725.        
  726.         }
  727.  
  728.    
  729. $displayOption = 1;
  730.  
  731. $currentDat = date('Y-m-d h:i:s',$currenttime);
  732.  
  733. //echo 'Current Time '.$currentDat;
  734.  
  735.  
  736.         $merchantData = Mage::getModel('dailydeals/merchant')->load($id);
  737.  
  738.         $operationalMinFrom = $merchantData->getOperationHoursMinFrom();
  739.         $operationalMinTo = $merchantData->getOperationHoursMinTo();
  740.        
  741.         $operationalMinFrom = explode(',',$operationalMinFrom);
  742.         $operationalMinTo = explode(',',$operationalMinTo);
  743.  
  744.         $day = date('D', $currenttime);
  745.         $newDay = strtolower($day);
  746.  
  747.         switch($newDay)
  748.         {
  749.         case 'sun':
  750.         $operationHoursMinFrom = $operationalMinFrom[0];
  751.         $operationHoursMinTo = $operationalMinTo[0];
  752.         $operationHoursHrFrom = $merchantData->getOperationHoursHrFromSun();
  753.         $operationHoursHrTo = $merchantData->getOperationHoursHrToSun();
  754.         break;
  755.         case 'mon':
  756.         $operationHoursMinFrom = $operationalMinFrom[1];
  757.         $operationHoursMinTo = $operationalMinTo[1];
  758.         $operationHoursHrFrom = $merchantData->getOperationHoursHrFromMon();
  759.         $operationHoursHrTo = $merchantData->getOperationHoursHrToMon();
  760.         break;
  761.         case 'tue':
  762.         $operationHoursMinFrom = $operationalMinFrom[2];
  763.         $operationHoursMinTo = $operationalMinTo[2];
  764.         $operationHoursHrFrom = $merchantData->getOperationHoursHrFromTue();
  765.         $operationHoursHrTo = $merchantData->getOperationHoursHrToTue();
  766.         break;
  767.         case 'wed':
  768.         $operationHoursMinFrom = $operationalMinFrom[3];
  769.         $operationHoursMinTo = $operationalMinTo[3];
  770.         $operationHoursHrFrom = $merchantData->getOperationHoursHrFromWed();
  771.         $operationHoursHrTo = $merchantData->getOperationHoursHrToWed();
  772.         break;
  773.         case 'thu':
  774.         $operationHoursMinFrom = $operationalMinFrom[4];
  775.         $operationHoursMinTo = $operationalMinTo[4];
  776.         $operationHoursHrFrom = $merchantData->getOperationHoursHrFromThu();
  777.         $operationHoursHrTo = $merchantData->getOperationHoursHrToThu();
  778.         break;
  779.         case 'fri':
  780.         $operationHoursMinFrom = $operationalMinFrom[5];
  781.         $operationHoursMinTo = $operationalMinTo[5];
  782.         $operationHoursHrFrom = $merchantData->getOperationHoursHrFromFri();
  783.         $operationHoursHrTo = $merchantData->getOperationHoursHrToFri();
  784.         break;
  785.         case 'sat':
  786.         $operationHoursMinFrom = $operationalMinFrom[6];
  787.         $operationHoursMinTo = $operationalMinTo[6];
  788.         $operationHoursHrFrom = $merchantData->getOperationHoursHrFromSat();
  789.         $operationHoursHrTo = $merchantData->getOperationHoursHrToSat();
  790.         break;     
  791.         }
  792.    
  793.     ///echo '<br/>';
  794.    
  795.     $operationHoursHrFrom.':'.$operationHoursMinFrom.':00';
  796.     //  echo '<br/>';
  797.        
  798.     $operationHoursHrTo.':'.$operationHoursMinTo.':00';
  799.     //  echo '<br/>';  
  800.  $operational_hr_fr = strtotime($operationHoursHrFrom.':'.$operationHoursMinFrom.':00');
  801.     //  echo '<br/>';
  802.  $operational_hr_to = strtotime($operationHoursHrTo.':'.$operationHoursMinTo.':00');   
  803.     //      echo '<br/>';
  804.  $displayOption = ($operational_hr_fr < $currenttime && $currenttime < $operational_hr_to) ? 1 : 0;
  805.  
  806. $language_settings = Mage::app()->getStore()->getCode();
  807. $language_settings = strtolower($language_settings);
  808. ?>
  809.                         <script>
  810.                         function checkdeliverytype()
  811.                         {
  812.                         document.getElementById('light').style.display='block';
  813.                           document.getElementById('fade').style.display='block';
  814.                         }
  815.                         function ckeckvalueofform(str)
  816.                         {
  817.                    
  818.                         //alert(str);
  819.                         var radios = document.getElementsByName('deliverytype');
  820.                        
  821.                             for (var i = 0, length = radios.length; i < length; i++) {
  822.                                 if (radios[i].checked) {
  823.                                     var lastcall=radios[i].value;
  824.                                    
  825.                                     //alert(document.getElementById('example12').value);
  826.                                     if(lastcall == 'delivery')
  827.                                     {
  828.                                         var xyz=<?php echo $_restaurant->getDeliveryOption();?>;
  829.                                         if(xyz != 1)
  830.                                         {
  831.                                         document.getElementById('light').style.display='none';
  832.                                           document.getElementById('fade').style.display='none';
  833.                                           if(str =='francais')
  834.                                           {
  835.                                           alert('Este restaurante no ofrece la Entrega. Por favor seleccione la elección opción');
  836.                                           }
  837.                                           else
  838.                                           {
  839.                                             alert('This restaurant does not offer Delivery. Please select the pick up option');
  840.                                            }   
  841.                                         return false;
  842.                                         }
  843.                                         else
  844.                                         {
  845.                                        
  846.                                             if(document.getElementById('example12').value == 'click here' || document.getElementById('ordtimeseln').checked)
  847.                                             {
  848.                                                
  849.                                             if(parseInt(document.getElementById('operational_hr_fr').value) < parseInt(document.getElementById('currenttime').value) && parseInt(document.getElementById('currenttime').value) < parseInt(document.getElementById('operational_hr_to').value))
  850.                                             {
  851.                                                 var today = new Date();
  852.                                           var expiry = new Date(today.getTime() + 1 * 24 * 3600 * 1000);
  853.                                           var serviceofdeliveryck = 'serviceofdeliveryck';
  854.                                           var valueincok='Home Delivery';
  855.                                           document.cookie=serviceofdeliveryck + "=" + escape(valueincok) + "; path=/; expires=" + expiry.toGMTString();                                                                                                                   var serviceofdeliverycknew= 'Dateoddelivery';
  856.                                                     //var valueincoknew=Date(year);
  857.                                                     var currentTime = new Date();
  858.                                                     var month = currentTime.getMonth() + 1;
  859.                                                     var day = currentTime.getDate();
  860.                                                     var year = currentTime.getFullYear();
  861.                                                     var valueincoknew=month + "/" + day + "/" + year;
  862.                                                      document.cookie=serviceofdeliverycknew + "=" + escape(valueincoknew) + "; path=/; expires=" + expiry.toGMTString();
  863.                                            
  864.                                                 return true;
  865.                                             }
  866.                                             else
  867.                                             {
  868.                                                 document.getElementById('light').style.display='none';
  869.                                           document.getElementById('fade').style.display='none';
  870.                                             alert("Le restaurant est pr"+unescape('%E9')+"sentement ferm"+unescape('%E9')+".");
  871.                                             return false;  
  872.                                             }  
  873.                                             }
  874.                                             else
  875.                                             {
  876.                                                
  877.                             var advancedateTime = document.getElementById('example12').value.replace('/','-').replace('/','-');
  878.                             var asdasd=document.getElementById('example12').value;
  879.                             var asgg=Date(asdasd);
  880.                             var onlydate=asdasd.split(" ");
  881.                             var lastandlastdate=onlydate[0];
  882.                             var jul07 = new Date(lastandlastdate);
  883.                             var finallyday=jul07.getDay();
  884.                             //var asdasasddas=jul07.getDAY();
  885.                             //alert(finallyday);
  886.                             switch (finallyday)
  887.                             {
  888.                                 case 0:
  889.                                 var operationHoursMinFrom =<?php echo $operationalMinFrom[0];?>;
  890.                                 var operationHoursMinTo=<?php echo $operationalMinTo[0]; ?>;
  891.                                 var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromSun(); ?>;
  892.                                 var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToSun()  ?>;
  893.                                 break;
  894.                                 case 1:
  895.                                 var operationHoursMinFrom =<?php echo $operationalMinFrom[1];?>;
  896.                                 var operationHoursMinTo=<?php echo $operationalMinTo[1]; ?>;
  897.                                 var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromMon(); ?>;
  898.                                 var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToMon()  ?>;
  899.                                 break;
  900.                                 case 2:
  901.                                 var operationHoursMinFrom =<?php echo $operationalMinFrom[2];?>;
  902.                                 var operationHoursMinTo=<?php echo $operationalMinTo[2]; ?>;
  903.                                 var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromTue(); ?>;
  904.                                 var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToTue()  ?>;
  905.                                 break;
  906.                                 case 3:
  907.                                 var operationHoursMinFrom =<?php echo $operationalMinFrom[3];?>;
  908.                                 var operationHoursMinTo=<?php echo $operationalMinTo[3]; ?>;
  909.                                 var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromWed(); ?>;
  910.                                 var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToWed()  ?>;
  911.                                 break;
  912.                                 case 4:
  913.                                 var operationHoursMinFrom =<?php echo $operationalMinFrom[4];?>;
  914.                                 var operationHoursMinTo=<?php echo $operationalMinTo[4]; ?>;
  915.                                 var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromThu(); ?>;
  916.                                 var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToThu()  ?>;
  917.                                 break;
  918.                                 case 5:
  919.                                 var operationHoursMinFrom =<?php echo $operationalMinFrom[5];?>;
  920.                                 var operationHoursMinTo=<?php echo $operationalMinTo[5]; ?>;
  921.                                 var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromFri(); ?>;
  922.                                 var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToFri()  ?>;
  923.                                 break;
  924.                                 case 6:
  925.                                 var operationHoursMinFrom =<?php echo $operationalMinFrom[6];?>;
  926.                                 var operationHoursMinTo=<?php echo $operationalMinTo[6]; ?>;
  927.                                 var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromSat(); ?>;
  928.                                 var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToSat()  ?>;
  929.                                 break;
  930.                                
  931.                                
  932.                             }
  933.                            
  934.                             var firsttimecompare=(operationHoursHrFrom*60)+operationHoursMinFrom;
  935.                             var secondtimecompare=(operationHoursHrTo*60)+operationHoursMinTo;
  936.                             var mytimetosplit=onlydate[1].split(":");
  937.                             var finalfirsthr=parseInt(mytimetosplit[0]);
  938.                             var finalsecondmin=parseInt(mytimetosplit[1]);
  939.                             var finaltimetocompare=(finalfirsthr*60)+finalsecondmin;
  940.                             //alert(mytimetosplit[0]);
  941.                             //alert(mytimetosplit[1]);
  942.                             //alert(firsttimecompare);
  943.                             //alert(secondtimecompare);
  944.                             //alert(finaltimetocompare);
  945.                             if(finaltimetocompare>=firsttimecompare && finaltimetocompare<=secondtimecompare)
  946.                             {
  947.                             var serviceofdeliverycknew= 'Dateoddelivery';
  948.                             var valueincoknew=asdasd;
  949.                             document.cookie=serviceofdeliverycknew + "=" + escape(valueincoknew) + "; path=/; expires=" + expiry.toGMTString();
  950.                             return true;
  951.                             }
  952.                             else
  953.                             {
  954.                                 document.getElementById('light').style.display='none';
  955.                                           document.getElementById('fade').style.display='none';
  956.                             alert("Restaurants is closed on given time");
  957.                             return false;
  958.                             }
  959.                                             }
  960.                                        
  961.                                         }
  962.                                     }
  963.                                     else
  964.                                     {
  965.                                         var xyz=<?php echo $_restaurant->getCheckpickup();?>;
  966.                                         if(xyz != 1)
  967.                                         {
  968.                                             document.getElementById('light').style.display='none';
  969.                                           document.getElementById('fade').style.display='none';
  970.                                        
  971.                                             if(str =='francais')
  972.                                           {
  973.                                           alert('Este restaurante no ofrece recogen. Por favor seleccione la opción de Entrega');
  974.                                           }
  975.                                           else
  976.                                           {
  977.                                             alert('This restaurant does not offer pick up. Please select the Delivery option');
  978.                                            }   
  979.                                         return false;
  980.                                         }
  981.                                         else
  982.                                         {
  983.                                             if(document.getElementById('example12').value == 'click here' || document.getElementById('ordtimeseln').checked)
  984.                                             {
  985.                                                
  986.                                             if(parseInt(document.getElementById('operational_hr_fr').value) < parseInt(document.getElementById('currenttime').value) && parseInt(document.getElementById('currenttime').value) < parseInt(document.getElementById('operational_hr_to').value))
  987.                                             {
  988.                                                 var today = new Date();
  989.                                                  var expiry = new Date(today.getTime() + 1 * 24 * 3600 * 1000);
  990.                                                   var serviceofdeliveryck = 'serviceofdeliveryck';
  991.                                                     var valueincok='PickUp Delivery';
  992.                                                   document.cookie=serviceofdeliveryck + "=" + escape(valueincok) + "; path=/; expires=" + expiry.toGMTString();                                                 var serviceofdeliverycknew= 'Dateoddelivery';
  993.                                                     //var valueincoknew=Date(year);
  994.                                                     var currentTime = new Date();
  995.                                                     var month = currentTime.getMonth() + 1;
  996.                                                     var day = currentTime.getDate();
  997.                                                     var year = currentTime.getFullYear();
  998.                                                     var valueincoknew=month + "/" + day + "/" + year;
  999.                                                      document.cookie=serviceofdeliverycknew + "=" + escape(valueincoknew) + "; path=/; expires=" + expiry.toGMTString();
  1000.                                            
  1001.                                                 return true;
  1002.                                             }
  1003.                                             else
  1004.                                             {
  1005.                                                 document.getElementById('light').style.display='none';
  1006.                                           document.getElementById('fade').style.display='none';
  1007.                                             alert("Le restaurant est pr"+unescape('%E9')+"sentement ferm"+unescape('%E9')+".");
  1008.                                             return false;  
  1009.                                             }  
  1010.                                             }
  1011.                                             else
  1012.                                             {
  1013.                                                
  1014.                             var advancedateTime = document.getElementById('example12').value.replace('/','-').replace('/','-');
  1015.                             var asdasd=document.getElementById('example12').value;
  1016.                             var asgg=Date(asdasd);
  1017.                             var onlydate=asdasd.split(" ");
  1018.                             var lastandlastdate=onlydate[0];
  1019.                             var jul07 = new Date(lastandlastdate);
  1020.                             var finallyday=jul07.getDay();
  1021.                             //var asdasasddas=jul07.getDAY();
  1022.                             //alert(finallyday);
  1023.                             switch (finallyday)
  1024.                             {
  1025.                                 case 0:
  1026.                                 var operationHoursMinFrom =<?php echo $operationalMinFrom[0];?>;
  1027.                                 var operationHoursMinTo=<?php echo $operationalMinTo[0]; ?>;
  1028.                                 var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromSun(); ?>;
  1029.                                 var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToSun()  ?>;
  1030.                                 break;
  1031.                                 case 1:
  1032.                                 var operationHoursMinFrom =<?php echo $operationalMinFrom[1];?>;
  1033.                                 var operationHoursMinTo=<?php echo $operationalMinTo[1]; ?>;
  1034.                                 var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromMon(); ?>;
  1035.                                 var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToMon()  ?>;
  1036.                                 break;
  1037.                                 case 2:
  1038.                                 var operationHoursMinFrom =<?php echo $operationalMinFrom[2];?>;
  1039.                                 var operationHoursMinTo=<?php echo $operationalMinTo[2]; ?>;
  1040.                                 var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromTue(); ?>;
  1041.                                 var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToTue()  ?>;
  1042.                                 break;
  1043.                                 case 3:
  1044.                                 var operationHoursMinFrom =<?php echo $operationalMinFrom[3];?>;
  1045.                                 var operationHoursMinTo=<?php echo $operationalMinTo[3]; ?>;
  1046.                                 var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromWed(); ?>;
  1047.                                 var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToWed()  ?>;
  1048.                                 break;
  1049.                                 case 4:
  1050.                                 var operationHoursMinFrom =<?php echo $operationalMinFrom[4];?>;
  1051.                                 var operationHoursMinTo=<?php echo $operationalMinTo[4]; ?>;
  1052.                                 var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromThu(); ?>;
  1053.                                 var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToThu()  ?>;
  1054.                                 break;
  1055.                                 case 5:
  1056.                                 var operationHoursMinFrom =<?php echo $operationalMinFrom[5];?>;
  1057.                                 var operationHoursMinTo=<?php echo $operationalMinTo[5]; ?>;
  1058.                                 var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromFri(); ?>;
  1059.                                 var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToFri()  ?>;
  1060.                                 break;
  1061.                                 case 6:
  1062.                                 var operationHoursMinFrom =<?php echo $operationalMinFrom[6];?>;
  1063.                                 var operationHoursMinTo=<?php echo $operationalMinTo[6]; ?>;
  1064.                                 var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromSat(); ?>;
  1065.                                 var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToSat()  ?>;
  1066.                                 break;
  1067.                                
  1068.                                
  1069.                             }
  1070.                            
  1071.                             var firsttimecompare=(operationHoursHrFrom*60)+operationHoursMinFrom;
  1072.                             var secondtimecompare=(operationHoursHrTo*60)+operationHoursMinTo;
  1073.                             var mytimetosplit=onlydate[1].split(":");
  1074.                             var finalfirsthr=parseInt(mytimetosplit[0]);
  1075.                             var finalsecondmin=parseInt(mytimetosplit[1]);
  1076.                             var finaltimetocompare=(finalfirsthr*60)+finalsecondmin;
  1077.                             //alert(mytimetosplit[0]);
  1078.                             //alert(mytimetosplit[1]);
  1079.                             //alert(firsttimecompare);
  1080.                             //alert(secondtimecompare);
  1081.                             //alert(finaltimetocompare);
  1082.                             if(finaltimetocompare>=firsttimecompare && finaltimetocompare<=secondtimecompare)
  1083.                             {
  1084.                             var today = new Date();
  1085.                             var expiry = new Date(today.getTime() + 1 * 24 * 3600 * 1000);
  1086.                             var serviceofdeliverycknew= 'Dateoddelivery';
  1087.                             var valueincoknew=asdasd;
  1088.                             alert(valueincoknew);
  1089.                             document.cookie=serviceofdeliverycknew + "=" + escape(valueincoknew) + "; path=/; expires=" + expiry.toGMTString();
  1090.                             return true;
  1091.                             }
  1092.                             else
  1093.                             {
  1094.                             document.getElementById('light').style.display='none';
  1095.                             document.getElementById('fade').style.display='none';
  1096.                             alert("Restaurants is closed on given time");
  1097.                             return false;
  1098.                             }
  1099.                                             }
  1100.                                         }
  1101.                                     }
  1102.                                    
  1103.                                    
  1104.                                 }
  1105.                             }
  1106.                         }
  1107.                        
  1108.                         </script>
  1109.                               <?php
  1110.                              
  1111.                                 if ($language_settings == "francais")
  1112.                                  {
  1113.                                  ?>
  1114.                                  <form name="deliveryform" action="<?php echo $_restaurant->getMerchantMenuUrl(); ?>" method="post" onSubmit="return ckeckvalueofform('francais');" >
  1115.                                  
  1116.                             <div style="margin-left:30px;"><b>SVP choisir votre service?</b></div>
  1117.                             <div style="margin-left:-10px;margin-top:20px;"><input type="radio" name="deliverytype" id="pickup" value="Pick up">&nbsp;&nbsp;Ramassage au magasin &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="deliverytype" id="delivery" value="delivery">&nbsp;&nbsp;Livraison</div>
  1118.                             <div style="margin-left:90px;margin-top:15px;"><input type="submit" name="submitdlform" id="submitdlform" value="Soumettre" class="view-all" style="background-color:#851811;color:#FFFFFF;width:80px;height:33px;" /></div>
  1119.                            
  1120.                             </form>
  1121.                                  <?php
  1122.                                  }
  1123.                                  else
  1124.                                  {
  1125.                                 ?>
  1126.                                 <form name="deliveryform" action="<?php echo $_restaurant->getMerchantMenuUrl(); ?>" method="post" onSubmit="return ckeckvalueofform('english');" >
  1127.                                 <input id="currenttime" name="currenttime" value="<?php echo $currenttime ?>" type="hidden" />
  1128. <input id="operational_hr_fr" name="operational_hr_fr" value="<?php echo $operational_hr_fr ?>" type="hidden" />
  1129. <input id="operational_hr_to" name="operational_hr_to" value="<?php echo $operational_hr_to ?>" type="hidden" />
  1130.                                
  1131.                             <div style="margin-left:10px;"><b>Please select your delivery type?</b></div>
  1132.                             <div style="border-top:2px solid #CCCCCC;">
  1133.                             <div style="margin-left:47px;margin-top:10px;"><input type="radio" name="deliverytype" id="pickup" value="Pick up">&nbsp;&nbsp;Pick up &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="deliverytype" id="delivery" value="delivery">&nbsp;&nbsp;Delivery</div>
  1134.                             </div>
  1135.                            
  1136.                            
  1137.                             <div style="margin-left:10px;margin-top:10px;"><b>
  1138.                 <?php if ($language_settings == "francais")
  1139.                                  {echo 'Quand voulez-vous votre commande?';}else{ echo 'when do you want your order?';}?></b>
  1140.                 </div>
  1141.                
  1142.                
  1143.                          <div style="border:1px solid #CCCCCC;">
  1144.  
  1145.                
  1146.                
  1147.                 <div style="float:left; width:51%; padding:10px 0 0 10px;">
  1148.                 <?php if ($language_settings == "francais")
  1149.                                  {echo 'Maintenant';}else{ echo 'Now';}?>&nbsp;<input type="radio" name="ordtimesel" value="n" id="ordtimeseln" checked="checked" onchange="showhidetimes(this.value);" />&nbsp;<?php if ($language_settings == "francais")
  1150.                                  {echo 'ou Tantot';}else{ echo 'or Later';}?>&nbsp;<input type="radio" name="ordtimesel" value="l" id="ordtimesell" onchange="showhidetimes(this.value);" />   
  1151.                 </div>
  1152.                 <div id="timenew" style="float:left; width:44%; display:none;margin-top:7px;"><input type="text" name="example12" id="example12" value="click here" onfocus="showdatetimes();" size="18" /></div>
  1153.  
  1154. </div>
  1155.                            
  1156.                             <div style="margin-left:80px;margin-top:60px;"><input type="submit" name="submitdlform" id="submitdlform" value="Submit" class="view-all" style="background-color:#851811;color:#FFFFFF;width:80px;height:33px;" /></div>
  1157.              
  1158.                             </form>
  1159.                                 <?php
  1160.                                  }
  1161.                                   ?>
  1162.                              
  1163.                               <a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'"><img src="<?php echo $this->getSkinUrl('images/deliveryclose.png'); ?>" style="margin-top:-171px;margin-left:257px;"></a>
  1164.                               </div>
  1165.                              
  1166.    
  1167.    
  1168.  
  1169.                              
  1170.                              
  1171.                               </div>
  1172.  
  1173.                         <!--<a target="_blank" href="<?php echo $_restaurant->getMerchantMenuUrl(); ?>">-->
  1174.  
  1175.                             <?php
  1176.  
  1177.                         $language_settings = Mage::app()->getStore()->getCode();
  1178.  
  1179.                         $language_settings = strtolower($language_settings);
  1180.  
  1181.                         if ( $language_settings == "default"):
  1182.  
  1183.                         ?>
  1184.  
  1185.                         <img src="<?php echo $this->getSkinUrl("images/deliverybutton.png") ?>" onclick="return checkdeliverytype();"/>
  1186.  
  1187.                         <?php
  1188.  
  1189.                         else:
  1190.  
  1191.                         ?>
  1192.  
  1193.                         <img src="<?php echo $this->getSkinUrl("images/deliverybuttonfr.png") ?>" onclick="return checkdeliverytype();"/>
  1194.  
  1195.                         <?php
  1196.  
  1197.                         endif;                     
  1198.  
  1199.                         ?>
  1200.  
  1201.                         <!--</a>-->
  1202.  
  1203.                     <?php else: ?>
  1204.  
  1205.                         <a href="javscript: void(0)">
  1206.  
  1207.                             <?php
  1208.  
  1209.                         $language_settings = Mage::app()->getStore()->getCode();
  1210.  
  1211.                         $language_settings = strtolower($language_settings);
  1212.  
  1213.                         if ( $language_settings == "default"):
  1214.  
  1215.                         ?>
  1216.  
  1217.                         <img src="<?php echo $this->getSkinUrl("images/deliverybutton.png") ?>"/>
  1218.  
  1219.                         <?php
  1220.  
  1221.                         else:
  1222.  
  1223.                         ?>
  1224.  
  1225.                         <img src="<?php echo $this->getSkinUrl("images/deliverybuttonfr.png") ?>"/>
  1226.  
  1227.                         <?php
  1228.  
  1229.                         endif;                     
  1230.  
  1231.                         ?>
  1232.  
  1233.                         </a>
  1234.  
  1235.                     <?php endif; ?>
  1236.  
  1237.                     </p>
  1238.  
  1239.                 </div>
  1240.  
  1241.                 <?php endif; ?>
  1242.  
  1243.                
  1244.  
  1245.             </div>
  1246.  
  1247.         </div>
  1248.  
  1249.        
  1250.  
  1251.         <div class="restaurant-images">        
  1252.  
  1253.             <?php $i = 0;
  1254.  
  1255.             if(count($collection)>0):
  1256.  
  1257.             foreach($collection as $restaurant):
  1258.  
  1259.                 $i++;
  1260.  
  1261.             ?>
  1262.  
  1263.                 <div class="<?php if($i==1): ?>item-main<?php elseif($i==2): ?>item item-first<? else: ?>item <?php endif; ?>">
  1264.  
  1265.                     <?php
  1266.  
  1267.                     if($i==1){                     
  1268.  
  1269.                         $_imageUrl = Mage::getBaseDir('media').DS."restaurant_photos".DS.$restaurant->getFilename();
  1270.  
  1271.                         $imageResized = Mage::getBaseDir('media').DS."restaurant_photos".DS."resized".DS."588_274".DS.$restaurant->getFilename();
  1272.  
  1273.                          
  1274.  
  1275.                         if(!file_exists($imageResized)&&file_exists($_imageUrl)):
  1276.  
  1277.                             $imageObj = new Varien_Image($_imageUrl);
  1278.  
  1279.                             $imageObj->constrainOnly(TRUE);
  1280.  
  1281.                             $imageObj->keepAspectRatio(TRUE);
  1282.  
  1283.                             $imageObj->keepFrame(FALSE);
  1284.  
  1285.                             $imageObj->resize(588, 274);
  1286.  
  1287.                             $imageObj->save($imageResized);                  
  1288.  
  1289.                         endif;
  1290.  
  1291.                     ?>         
  1292.  
  1293.                         <a href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."restaurant_photos/".$restaurant->getFilename(); ?>" class="MagicZoomPlus" id="Zoomer" rel="zoom-position:inner;zoom-fade: true;expand-position: top:0, left:0" >
  1294.  
  1295.                             <img src="<?php echo Mage::getBaseUrl('media')."restaurant_photos/resized/588_274/".$restaurant->getFilename() ?>" />
  1296.  
  1297.                         </a>
  1298.  
  1299.                     <?php
  1300.  
  1301.                     }else{
  1302.  
  1303.                         $_imageUrl1 = Mage::getBaseDir('media').DS."restaurant_photos".DS.$restaurant->getFilename();
  1304.  
  1305.                         $imageResized1 = Mage::getBaseDir('media').DS."restaurant_photos".DS."resized".DS."132_84".DS.$restaurant->getFilename();
  1306.  
  1307.                          
  1308.  
  1309.                         if(!file_exists($imageResized1)&&file_exists($_imageUrl1)):
  1310.  
  1311.                             $imageObj = new Varien_Image($_imageUrl1);
  1312.  
  1313.                             $imageObj->constrainOnly(TRUE);
  1314.  
  1315.                             $imageObj->keepAspectRatio(FALSE);
  1316.  
  1317.                             $imageObj->keepFrame(FALSE);
  1318.  
  1319.                             $imageObj->resize(132, 84);
  1320.  
  1321.                             $imageObj->save($imageResized1);                     
  1322.  
  1323.                         endif;
  1324.  
  1325.                        
  1326.  
  1327.                         $_imageUrl = Mage::getBaseDir('media').DS."restaurant_photos".DS.$restaurant->getFilename();
  1328.  
  1329.                         $imageResized = Mage::getBaseDir('media').DS."restaurant_photos".DS."resized".DS."588_274".DS.$restaurant->getFilename();
  1330.  
  1331.                          
  1332.  
  1333.                         if(!file_exists($imageResized)&&file_exists($_imageUrl)):
  1334.  
  1335.                             $imageObj = new Varien_Image($_imageUrl);
  1336.  
  1337.                             $imageObj->constrainOnly(TRUE);
  1338.  
  1339.                             $imageObj->keepAspectRatio(true);
  1340.  
  1341.                             $imageObj->keepFrame(FALSE);
  1342.  
  1343.                             $imageObj->resize(588, 274);
  1344.  
  1345.                             $imageObj->save($imageResized);                  
  1346.  
  1347.                         endif;
  1348.  
  1349.                         ?>         
  1350.  
  1351.                         <a href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."restaurant_photos/".$restaurant->getFilename(); ?>" rel="zoom-id:Zoomer" rev="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."restaurant_photos/resized/588_274/".$restaurant->getFilename(); ?>">
  1352.  
  1353.                             <img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."restaurant_photos/resized/132_84/".$restaurant->getFilename(); ?>" />
  1354.  
  1355.                         </a>
  1356.  
  1357.                     <?php
  1358.  
  1359.                     }
  1360.  
  1361.                     ?>
  1362.  
  1363.                 </div>
  1364.  
  1365.             <?php endforeach; ?>
  1366.  
  1367.             <?php endif; ?>
  1368.  
  1369.         </div>
  1370.  
  1371.        
  1372.  
  1373.        
  1374.  
  1375.         <style>
  1376.  
  1377.         .scrollable img {
  1378.  
  1379.             width:100px;
  1380.  
  1381.             margin:20px 5px 20px 21px;
  1382.  
  1383.         }
  1384.  
  1385.  
  1386.  
  1387.         .scrollable img.hover {
  1388.  
  1389.             background-color:#123;
  1390.  
  1391.         }
  1392.  
  1393.         </style>
  1394.  
  1395.         <!-- wrapper for navigator elements -->
  1396.  
  1397.         <!--<div class="navi"></div>-->
  1398.  
  1399.  
  1400.  
  1401.        
  1402.  
  1403.  
  1404.  
  1405.             <!-- 1-5 -->
  1406.  
  1407.             <?php
  1408.  
  1409.             $featured_collections = Mage::getModel('photos/photos')->getCollection()->addFieldToFilter("status", 1)->addFieldToFilter("user_id", $_restaurant->getCustomerId())->addFieldToFilter("featured", 1);  
  1410.  
  1411.             $i = 0;
  1412.  
  1413.             if(count($featured_collections)>0):
  1414.  
  1415.             ?>
  1416.  
  1417.             <div style="margin:0 auto; width: 595px; height:120px; float: left;">
  1418.  
  1419.             <!-- "previous page" action -->
  1420.  
  1421.             <a class="prev browse left"></a>
  1422.  
  1423.  
  1424.  
  1425.             <!-- root element for scrollable -->
  1426.  
  1427.             <div class="scrollable" id="chained">
  1428.  
  1429.  
  1430.  
  1431.             <!-- root element for the items -->
  1432.  
  1433.             <div class="items">
  1434.  
  1435.             <?php
  1436.  
  1437.             foreach($featured_collections as $restaurant):
  1438.  
  1439.                 if($i%4==0):               
  1440.  
  1441.             ?>
  1442.  
  1443.                 <div>  
  1444.  
  1445.             <?php endif; ?>
  1446.  
  1447.                 <?php
  1448.  
  1449.                      // actual path of image
  1450.  
  1451.                     $_imageUrl = Mage::getBaseDir('media').DS."restaurant_photos".DS.$restaurant->getFilename();
  1452.  
  1453.                      
  1454.  
  1455.                     // path of the resized image to be saved
  1456.  
  1457.                     // here, the resized image is saved in media/resized folder
  1458.  
  1459.                     $imageResized = Mage::getBaseDir('media').DS."restaurant_photos".DS."resized".DS."100_75".DS.$restaurant->getFilename();
  1460.  
  1461.                      
  1462.  
  1463.                     // resize image only if the image file exists and the resized image file doesn't exist
  1464.  
  1465.                     // the image is resized proportionally with the width/height 135px
  1466.  
  1467.                      
  1468.  
  1469.                     if (!file_exists($imageResized)&&file_exists($_imageUrl)) :
  1470.  
  1471.                       $imageObj = new Varien_Image($_imageUrl);
  1472.  
  1473.                       $imageObj->constrainOnly(TRUE);
  1474.  
  1475.                       $imageObj->keepAspectRatio(FALSE);
  1476.  
  1477.                       $imageObj->keepFrame(FALSE);
  1478.  
  1479.                       $imageObj->resize(100, 75);
  1480.  
  1481.                       $imageObj->save($imageResized);
  1482.  
  1483.                      
  1484.  
  1485.                     endif;
  1486.  
  1487.                     ?>         
  1488.  
  1489.                     <!--<a href="images/harley1c.jpg" rel="disable-zoom: true;" class="MagicZoomPlus"><img src="images/harley1b.jpg"/></a>-->
  1490.  
  1491.                     <a href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."restaurant_photos/".$restaurant->getFilename(); ?>" class="highslide" onclick="return hs.expand(this)"><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."restaurant_photos/resized/100_75/".$restaurant->getFilename(); ?>" /></a>
  1492.  
  1493.  
  1494.  
  1495.             <?php $i++;
  1496.  
  1497.                 if(($i%4==0)||($i==count($featured_collections))):
  1498.  
  1499.             ?>
  1500.  
  1501.                 </div>
  1502.  
  1503.             <?php endif; ?>
  1504.  
  1505.             <?php endforeach; ?>
  1506.  
  1507.  
  1508.  
  1509.                 </div>
  1510.  
  1511.  
  1512.  
  1513.             </div>
  1514.  
  1515.  
  1516.  
  1517.             <!-- "next page" action -->
  1518.  
  1519.             <a class="next browse right"></a>
  1520.  
  1521.             </div>
  1522.  
  1523.             <?php endif; ?>
  1524.  
  1525.            
  1526.  
  1527.        
  1528.  
  1529.          
  1530.  
  1531.  
  1532.  
  1533.         <!-- javascript coding -->
  1534.  
  1535.         <script>
  1536.  
  1537.         jQuery(document).ready(function() {
  1538.  
  1539.         jQuery("#chained").scrollable({circular: true, mousewheel: true}).navigator().autoscroll({
  1540.  
  1541.             interval: 3000
  1542.  
  1543.         });
  1544.  
  1545.         });
  1546.  
  1547.         </script>
  1548.  
  1549.         <div class="block description-block">
  1550.  
  1551.             <div class="block-title">
  1552.  
  1553.                 <h3><?php echo $this->__("Description"); ?></h3>
  1554.  
  1555.             </div>
  1556.  
  1557.             <div class="block-content">
  1558.  
  1559.                 <?php echo $_restaurant->getMerchantDescription(); ?>
  1560.  
  1561.             </div>
  1562.  
  1563.         </div>
  1564.  
  1565.        
  1566.  
  1567.         <div class="block block-customers-photos description-block">
  1568.  
  1569.             <div class="block-title">
  1570.  
  1571.                 <h3><?php echo $this->__("CUSTOMER PHOTOS"); ?></h3>
  1572.  
  1573.             </div> 
  1574.  
  1575.             <div class="block-content">
  1576.  
  1577.                 <?php
  1578.  
  1579.                 $photos = Mage::getModel("customersphotos/customersphotos")->getCollection()->addFieldToFilter("status", 1)->addFieldToFilter("merchant_id", $this->getRequest()->getParam("id"))->setOrder('customersphotos_id', 'DESC');
  1580.  
  1581.                 if(count($photos)>0):
  1582.  
  1583.                     $i=0;
  1584.  
  1585.                     foreach($photos as $photo):
  1586.  
  1587.                         $_imageUrl = Mage::getBaseDir('media').DS."customersphotos".DS.$photo->getFilename();
  1588.  
  1589.                         $imageResized = Mage::getBaseDir('media').DS."customersphotos".DS."resized".DS."105_68".DS.$photo->getFilename();
  1590.  
  1591.                          
  1592.  
  1593.                         if (!file_exists($imageResized)&&file_exists($_imageUrl)) :
  1594.  
  1595.                           $imageObj = new Varien_Image($_imageUrl);
  1596.  
  1597.                           $imageObj->constrainOnly(TRUE);
  1598.  
  1599.                           $imageObj->keepAspectRatio(FALSE);
  1600.  
  1601.                           $imageObj->keepFrame(FALSE);
  1602.  
  1603.                           $imageObj->resize(105, 68);
  1604.  
  1605.                           $imageObj->save($imageResized);
  1606.  
  1607.                          
  1608.  
  1609.                         endif;
  1610.  
  1611.                         ?>         
  1612.  
  1613.  
  1614.  
  1615.                     <div class="<?php if($i%3==0): ?>first<?php endif; ?> item">
  1616.  
  1617.                         <a href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."customersphotos/".$photo->getFilename(); ?>" rel="disable-zoom: true;" class="MagicZoomPlus"><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."customersphotos/resized/105_68/".$photo->getFilename() ?>" />
  1618.  
  1619.                     </div>
  1620.  
  1621.                 <?php $i++;
  1622.  
  1623.                     if($i==15) break;
  1624.  
  1625.                 ?>
  1626.  
  1627.                 <?php endforeach; ?>
  1628.  
  1629.                 <?php endif; ?>
  1630.  
  1631.                 <a class="upload-photos" href="<?php echo $this->getUrl("customersphotos"); ?>?id=<?php echo $this->getRequest()->getParam("id"); ?>"><?php echo $this->__("Upload your photos"); ?></a>
  1632.  
  1633.                 <a class="view-all" href="<?php echo $this->getUrl("customersphotos/index/viewall"); ?>?id=<?php echo $this->getRequest()->getParam("id"); ?>"><?php echo $this->__("VIEW ALL PHOTOS"); ?></a>
  1634.  
  1635.             </div>
  1636.  
  1637.         </div>
  1638.  
  1639.        
  1640.  
  1641.         <?php echo $this->getLayout()->createBlock('core/template')->setTemplate('dailydeals/restaurant-reviews.phtml')->toHtml(); ?>
  1642.  
  1643.        
  1644.  
  1645.     </div>
  1646.  
  1647.     <div class="col-right">
  1648.  
  1649.        
  1650.  
  1651.         <?php /*<div class="block block-like">
  1652.  
  1653.             <div class="block-title">
  1654.  
  1655.                 <strong><span><?php echo $this->__("Vistors"); ?></span></strong>
  1656.  
  1657.             </div>         
  1658.  
  1659.             <div class="block-content">
  1660.  
  1661.                 <?php echo count_hit(); ?>
  1662.  
  1663.             </div>
  1664.  
  1665.         </div> */ ?>       
  1666.  
  1667.         <div class="block block-like">
  1668.  
  1669.             <div class="block-title">
  1670.  
  1671.                 <strong><span><?php echo $this->__("Do you like us?"); ?></span></strong>
  1672.  
  1673.             </div>         
  1674.  
  1675.             <div class="block-content">
  1676.  
  1677.                 <!-- AddThis Button BEGIN -->
  1678.  
  1679.                 <div class="addthis_toolbox addthis_default_style ">
  1680.  
  1681.                 <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
  1682.  
  1683.                 <a class="addthis_button_tweet"></a>
  1684.  
  1685.                 <a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
  1686.  
  1687.                 <!--<a class="addthis_counter addthis_pill_style"></a>-->
  1688.  
  1689.                 </div>
  1690.  
  1691.                 <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4f7ab3bd2703b5c8"></script>
  1692.  
  1693.                 <!-- AddThis Button END -->
  1694.  
  1695.             </div>
  1696.  
  1697.         </div>
  1698.  
  1699.         <div class="block block-location">
  1700.  
  1701.             <div class="block-title">
  1702.  
  1703.                 <strong><span><?php echo $this->__("Location"); ?></span></strong>
  1704.  
  1705.             </div>         
  1706.  
  1707.             <div class="block-content">
  1708.  
  1709.                 <?php echo $_restaurant->getMerchantLocation(); ?>
  1710.  
  1711.             </div>
  1712.  
  1713.         </div>
  1714.  
  1715.        
  1716.  
  1717.         <div class="block description-block">
  1718.  
  1719.             <div class="block-title">
  1720.  
  1721.                 <strong><span><?php echo $this->__("Heures d'operation"); ?></span></strong>
  1722.  
  1723.             </div>
  1724.  
  1725.             <div class="block-content">
  1726.  
  1727.                 <?php
  1728.  
  1729.                 $id = (int) $this->getRequest()->getParam('id');
  1730.  
  1731.  
  1732.  
  1733.                 $merchantData = Mage::getModel('dailydeals/merchant')->load($id);
  1734.  
  1735.                  
  1736.  
  1737.                 $operationalMinFrom = $merchantData->getOperationHoursMinFrom();
  1738.  
  1739.                 $operationalMinTo = $merchantData->getOperationHoursMinTo();
  1740.  
  1741.                        
  1742.  
  1743.                 $operationalMinFrom = explode(',',$operationalMinFrom);
  1744.  
  1745.                 $operationalMinTo = explode(',',$operationalMinTo);
  1746.  
  1747.                 ?>
  1748.  
  1749.                
  1750.  
  1751.                 <div style="float:left; width:95%;">
  1752.  
  1753.             <div style="float:left; width:100%;">
  1754.  
  1755.                 Sunday
  1756.  
  1757.             </div>
  1758.  
  1759.             <div style="float:left; width:100%;">
  1760.  
  1761.                 <div style="float:left; width:50%;">
  1762.  
  1763.                     Open&nbsp;&nbsp;<?php echo $merchantData->getOperationHoursHrFromSun().':'.$operationalMinFrom[0]; ?>
  1764.  
  1765.                 </div>
  1766.  
  1767.                 <div style="float:left; width:50%;">
  1768.  
  1769.                     Close&nbsp;&nbsp;<?php echo $merchantData->getOperationHoursHrToSun().':'.$operationalMinTo[0]; ?>
  1770.  
  1771.                 </div>
  1772.  
  1773.             </div>
  1774.  
  1775.         </div>
  1776.  
  1777.        
  1778.  
  1779.         <div style="float:left; width:95%;">
  1780.  
  1781.             <div style="float:left; width:100%;">
  1782.  
  1783.                 Monday
  1784.  
  1785.             </div>
  1786.  
  1787.             <div style="float:left; width:100%;">
  1788.  
  1789.                 <div style="float:left; width:50%;">
  1790.  
  1791.                     Open&nbsp;&nbsp;<?php echo $merchantData->getOperationHoursHrFromMon().':'.$operationalMinFrom[1]; ?>
  1792.  
  1793.                 </div>
  1794.  
  1795.                 <div style="float:left; width:50%;">
  1796.  
  1797.                     Close&nbsp;&nbsp;<?php echo $merchantData->getOperationHoursHrToMon().':'.$operationalMinTo[1]; ?>
  1798.  
  1799.                 </div>
  1800.  
  1801.             </div>
  1802.  
  1803.         </div>
  1804.  
  1805.        
  1806.  
  1807.         <div style="float:left; width:95%;">
  1808.  
  1809.             <div style="float:left; width:100%;">
  1810.  
  1811.                 Tuesday
  1812.  
  1813.             </div>
  1814.  
  1815.             <div style="float:left; width:100%;">
  1816.  
  1817.                 <div style="float:left; width:50%;">
  1818.  
  1819.                     Open&nbsp;&nbsp;<?php echo $merchantData->getOperationHoursHrFromTue().':'.$operationalMinFrom[2]; ?>
  1820.  
  1821.                 </div>
  1822.  
  1823.                 <div style="float:left; width:50%;">
  1824.  
  1825.                     Close&nbsp;&nbsp;<?php echo $merchantData->getOperationHoursHrToTue().':'.$operationalMinTo[2]; ?>
  1826.  
  1827.                 </div>
  1828.  
  1829.             </div>
  1830.  
  1831.         </div>
  1832.  
  1833.        
  1834.  
  1835.         <div style="float:left; width:95%;">
  1836.  
  1837.             <div style="float:left; width:100%;">
  1838.  
  1839.                 Wednesday
  1840.  
  1841.             </div>
  1842.  
  1843.             <div style="float:left; width:100%;">
  1844.  
  1845.                 <div style="float:left; width:50%;">
  1846.  
  1847.                     Open&nbsp;&nbsp;<?php echo $merchantData->getOperationHoursHrFromWed().':'.$operationalMinFrom[3]; ?>
  1848.  
  1849.                 </div>
  1850.  
  1851.                 <div style="float:left; width:50%;">
  1852.  
  1853.                     Close&nbsp;&nbsp;<?php echo $merchantData->getOperationHoursHrToWed().':'.$operationalMinTo[3]; ?>
  1854.  
  1855.                 </div>
  1856.  
  1857.             </div>
  1858.  
  1859.         </div>
  1860.  
  1861.        
  1862.  
  1863.         <div style="float:left; width:95%;">
  1864.  
  1865.             <div style="float:left; width:100%;">
  1866.  
  1867.                 Thursday
  1868.  
  1869.             </div>
  1870.  
  1871.             <div style="float:left; width:100%;">
  1872.  
  1873.                 <div style="float:left; width:50%;">
  1874.  
  1875.                     Open&nbsp;&nbsp;<?php echo $merchantData->getOperationHoursHrFromThu().':'.$operationalMinFrom[4]; ?>
  1876.  
  1877.                 </div>
  1878.  
  1879.                 <div style="float:left; width:50%;">
  1880.  
  1881.                     Close&nbsp;&nbsp;<?php echo $merchantData->getOperationHoursHrToThu().':'.$operationalMinTo[4]; ?>
  1882.  
  1883.                 </div>
  1884.  
  1885.             </div>
  1886.  
  1887.         </div>
  1888.  
  1889.        
  1890.  
  1891.         <div style="float:left; width:95%;">
  1892.  
  1893.             <div style="float:left; width:100%;">
  1894.  
  1895.                 Friday
  1896.  
  1897.             </div>
  1898.  
  1899.             <div style="float:left; width:100%;">
  1900.  
  1901.                 <div style="float:left; width:50%;">
  1902.  
  1903.                     Open&nbsp;&nbsp;<?php echo $merchantData->getOperationHoursHrFromFri().':'.$operationalMinFrom[5]; ?>
  1904.  
  1905.                 </div>
  1906.  
  1907.                 <div style="float:left; width:50%;">
  1908.  
  1909.                     Close&nbsp;&nbsp;<?php echo $merchantData->getOperationHoursHrToFri().':'.$operationalMinTo[5]; ?>
  1910.  
  1911.                 </div>
  1912.  
  1913.             </div>
  1914.  
  1915.         </div>
  1916.  
  1917.        
  1918.  
  1919.         <div style="float:left; width:95%;">
  1920.  
  1921.             <div style="float:left; width:100%;">
  1922.  
  1923.                 Saturday
  1924.  
  1925.             </div>
  1926.  
  1927.             <div style="float:left; width:100%;">
  1928.  
  1929.                 <div style="float:left; width:50%;">
  1930.  
  1931.                     Open&nbsp;&nbsp;<?php echo $merchantData->getOperationHoursHrFromSat().':'.$operationalMinFrom[6]; ?>
  1932.  
  1933.                 </div>
  1934.  
  1935.                 <div style="float:left; width:50%;">
  1936.  
  1937.                     Close&nbsp;&nbsp;<?php echo $merchantData->getOperationHoursHrToSat().':'.$operationalMinTo[6]; ?>
  1938.  
  1939.                 </div>
  1940.  
  1941.             </div>
  1942.  
  1943.         </div>
  1944.  
  1945.  
  1946.  
  1947.             <?php //    echo $_restaurant->getMerchantHours(); ?>
  1948.  
  1949.                
  1950.  
  1951.             </div>
  1952.  
  1953.         </div>
  1954.  
  1955.        
  1956.  
  1957.         <div class="block block-deal">
  1958.  
  1959.             <div class="block-title">
  1960.  
  1961.                 <strong><span><?php echo $this->__("Deals"); ?></span></strong>
  1962.  
  1963.             </div>         
  1964.  
  1965.             <div class="block-content">
  1966.  
  1967.                 <script type="text/javascript" src="<?php echo $this->getSkinUrl("fancybox/jquery.min.js"); ?>"></script>
  1968.  
  1969.                 <script type="text/javascript">// <![CDATA[
  1970.  
  1971.                 jQuery(document).ready(function(){
  1972.  
  1973.  
  1974.  
  1975.                     jQuery('.deal-item').hover(function(){
  1976.  
  1977.                         jQuery(this).find('.deal-description').animate({
  1978.  
  1979.                             opacity: 0.7
  1980.  
  1981.                         }, 300);
  1982.  
  1983.                     }, function(){
  1984.  
  1985.                         jQuery(this).find('.deal-description').animate({
  1986.  
  1987.                             opacity: 0
  1988.  
  1989.                         }, 100);
  1990.  
  1991.                     });
  1992.  
  1993.                 });
  1994.  
  1995.                 // ]]></script>
  1996.  
  1997.                 <?php //echo $_restaurant->getMerchantLocation();
  1998.  
  1999.                     $collection = Mage::getModel('dailydeals/deal')->getCollection()->addFieldToFilter("merchant_id", $this->getRequest()->getParam("id"))->addFieldToFilter("deal_status", 1)->addFieldToFilter("att_set", 0);
  2000.  
  2001.                     foreach($collection as $item){
  2002.  
  2003.                         $_product = Mage::getModel("catalog/product")->load($item->getProductId());
  2004.  
  2005.                        
  2006.  
  2007.                 ?>
  2008.  
  2009.                         <div class="deal-item">
  2010.  
  2011.                             <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->getImageLabel($_product, 'small_image') ?>" class="product-image">
  2012.  
  2013.                             <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->keepFrame(false)->resize(300,220); ?>" width="300" height="220" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
  2014.  
  2015.                             </a>
  2016.  
  2017.                             <div class="deal-description">
  2018.  
  2019.                                 <?php echo $_product->getShortDescription() ?>
  2020.  
  2021.                                 <a href="<?php echo $_product->getProductUrl() ?>" class="button"><?php echo $this->__("View Deal"); ?></a>
  2022.  
  2023.                             </div>
  2024.  
  2025.                             <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_product->getName() ?></a></h2>                
  2026.  
  2027.                            
  2028.  
  2029.                             <?php
  2030.  
  2031.                             //$deal = $this->getDeal();
  2032.  
  2033.                             $deal = Mage::getModel('dailydeals/deal')->load($_product->getId(), 'product_id');
  2034.  
  2035.                             $target_count = $deal->getTargetCount();
  2036.  
  2037.                             $sold_count = $deal->getSoldCount() + $deal->getDummyCount();
  2038.  
  2039.                             ?>
  2040.  
  2041.                             <div class="deal-footer">
  2042.  
  2043.                                 <div class="num-bought">
  2044.  
  2045.                                 <?php
  2046.  
  2047.                                 if($sold_count>0){
  2048.  
  2049.                                     echo $sold_count.$this->__(' Buys');
  2050.  
  2051.                                 }else{
  2052.  
  2053.                                     echo $sold_count.$this->__(' Buy');
  2054.  
  2055.                                 }
  2056.  
  2057.                                 ?>
  2058.  
  2059.                                 </div>
  2060.  
  2061.                                 <?php
  2062.  
  2063.                                 $systemtimezone = Mage::app()->getStore()->getConfig('general/locale/timezone');
  2064.  
  2065.                                 $timezone = new DateTimeZone($systemtimezone);
  2066.  
  2067.                                 $offset = $timezone->getOffset(new DateTime("now"));
  2068.  
  2069.                                
  2070.  
  2071.                                 $hours = Mage::getStoreConfig('dailydeals/general/start_time');
  2072.  
  2073.                                 $lead_time = $hours*60*60;
  2074.  
  2075.                                 $targetDate  = $deal->getDateTo();
  2076.  
  2077.                                 $my_time = strtotime($targetDate) + $lead_time;
  2078.  
  2079.                                 ?>         
  2080.  
  2081.                                 <div class="remaining_time">
  2082.  
  2083.                                     <div class="timercontainer" id="cdcontainer_<?php echo $deal->getDealId(); ?>"></div>
  2084.  
  2085.                                     <script type="text/javascript">                
  2086.  
  2087.                                         var dealActiveUntil = new Date();
  2088.  
  2089.                                         dealActiveUntil.setTime(<?php echo $my_time*1000; ?>);
  2090.  
  2091.                                         var serverNow = new Date();
  2092.  
  2093.                                         serverNow.setSeconds(serverNow.getSeconds() + <?php echo $offset ?>);
  2094.  
  2095.                                         var launchdate_<?php echo $deal->getDealId(); ?>=new cdLocalTime("cdcontainer_<?php echo $deal->getDealId(); ?>", "server-php", 0, dealActiveUntil.toString(), serverNow.toUTCString());
  2096.  
  2097.                                         launchdate_<?php echo $deal->getDealId(); ?>.displaycountdown("days", formatresults3);
  2098.  
  2099.                                     </script>
  2100.  
  2101.                                 </div>
  2102.  
  2103.                             </div>
  2104.  
  2105.                         </div>
  2106.  
  2107.                 <?php
  2108.  
  2109.                         break;
  2110.  
  2111.                     }
  2112.  
  2113.                 ?>
  2114.  
  2115.                 <a href="<?php echo $this->getUrl("restaurant-deals"); ?>?id=<?php echo $this->getRequest()->getParam("id"); ?>" class="view-all"><?php echo $this->__("VIEW ALL DEALS"); ?></a>
  2116.  
  2117.             </div>
  2118.  
  2119.         </div>
  2120.  
  2121.         <?php //echo $this->getLayout()->createBlock('core/template')->setTemplate('dailydeals/restaurant-giftcards.phtml')->toHtml(); ?>
  2122.  
  2123.         <div class="block block-coupons">
  2124.  
  2125.             <div class="block-title">
  2126.  
  2127.                 <strong><span><?php echo $this->__("COUPONS"); ?></span></strong>
  2128.  
  2129.             </div>         
  2130.  
  2131.             <div class="block-content">
  2132.  
  2133.                 <link href="<?php echo $this->getSkinUrl("custom_scroller/jquery.mCustomScrollbar.css") ?>" rel="stylesheet" type="text/css" />
  2134.  
  2135.                 <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  2136.  
  2137.                 <!-- content block -->
  2138.  
  2139.                 <div id="mcs3_container">
  2140.  
  2141.                     <div class="customScrollBox">
  2142.  
  2143.                         <div class="container">
  2144.  
  2145.                             <div class="content">
  2146.  
  2147.                                 <?php
  2148.  
  2149.                                 $collection = Mage::getModel('coupons/coupons')->getCollection()->addFieldToFilter("status", 1)->addFieldToFilter("user_id", $_restaurant->getCustomerId());  
  2150.  
  2151.                                 if(count($collection)>0):
  2152.  
  2153.                                 ?>
  2154.  
  2155.                                 <div class="restaurant-coupons">
  2156.  
  2157.                                 <?php
  2158.  
  2159.                                 $i = 0;
  2160.  
  2161.                                 foreach($collection as $item):
  2162.  
  2163.                                     $i++;
  2164.  
  2165.                                 ?>
  2166.  
  2167.                                     <div class="item <?php if($i==5): ?>last<?php endif; ?>">
  2168.  
  2169.                                         <img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."coupons/".$item->getFilename(); ?>" width="278"/>
  2170.  
  2171.                                         <h3 class="coupon-title"><?php echo $item->getDetail(); ?></h3>
  2172.  
  2173.                                         <p class="print-coupon"><a onclick="this.target='_blank'" href="<?php echo $this->getUrl("coupons/index/print");?>id/<?php echo $item->getCouponsId(); ?>"><?php echo $this->__("Print coupon"); ?></a></p>
  2174.  
  2175.                                     </div>
  2176.  
  2177.                                 <?php endforeach; ?>
  2178.  
  2179.                                 </div>
  2180.  
  2181.                                 <?php else: ?>
  2182.  
  2183.                                 <p><?php echo $this->__("There's no coupon."); ?></p>
  2184.  
  2185.                                 <?php endif; ?>
  2186.  
  2187.                             </div>
  2188.  
  2189.                         </div>
  2190.  
  2191.                         <div class="dragger_container">
  2192.  
  2193.                             <div class="dragger"></div>
  2194.  
  2195.                         </div>
  2196.  
  2197.                     </div>
  2198.  
  2199.                 </div>
  2200.  
  2201.  
  2202.  
  2203.                 <script>
  2204.  
  2205.                 jQuery.noConflict();
  2206.  
  2207.                 jQuery(window).load(function() {
  2208.  
  2209.                     mCustomScrollbars();
  2210.  
  2211.                 });
  2212.  
  2213.  
  2214.  
  2215.                 function mCustomScrollbars(){
  2216.  
  2217.                     jQuery("#mcs3_container").mCustomScrollbar("vertical",900,"easeOutCirc",1.05,"auto","no","no",0);
  2218.  
  2219.                 }
  2220.  
  2221.  
  2222.  
  2223.                 /* function to fix the -10000 pixel limit of jquery.animate */
  2224.  
  2225.                 jQuery.fx.prototype.cur = function(){
  2226.  
  2227.                     if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
  2228.  
  2229.                       return this.elem[ this.prop ];
  2230.  
  2231.                     }
  2232.  
  2233.                     var r = parseFloat( jQuery.css( this.elem, this.prop ) );
  2234.  
  2235.                     return typeof r == 'undefined' ? 0 : r;
  2236.  
  2237.                 }
  2238.  
  2239.  
  2240.  
  2241.                 /* function to load new content dynamically */
  2242.  
  2243.                 function LoadNewContent(id,file){
  2244.  
  2245.                     jQuery("#"+id+" .customScrollBox .content").load(file,function(){
  2246.  
  2247.                         mCustomScrollbars();
  2248.  
  2249.                     });
  2250.  
  2251.                 }
  2252.  
  2253.                 </script>
  2254.  
  2255.                 <script src="<?php echo $this->getSkinUrl("custom_scroller/jquery.mCustomScrollbar.js") ?>"></script>
  2256.  
  2257.             </div>
  2258.  
  2259.         </div>
  2260.  
  2261.        
  2262.  
  2263.        
  2264.  
  2265.     </div>
  2266.  
  2267. </div>
  2268.  
  2269. <?php else: ?>
  2270.  
  2271. <?php echo $this->getLayout()->createBlock('core/template')->setTemplate('dailydeals/non-paying-restaurant.phtml')->toHtml(); ?>
  2272.  
  2273. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment