Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function count_hit()
- {
- $file_pointer= fopen("hits.txt", "r+");
- if ($file_pointer == false)
- {
- return "Error: could not open the file! It may not exist!";
- exit;
- }
- $hits= fread($file_pointer, filesize("hits.txt"));
- $hits= trim($hits);
- $hits++;
- fseek($file_pointer, 0);
- $result= fwrite($file_pointer, $hits);
- if ($result == false)
- {
- return "Error: could not write to the file!";
- exit;
- }
- else {
- return $hits;
- }
- $close= fclose($file_pointer);
- if ($close == false)
- {
- echo "Error: could not close the file!";
- exit;
- }
- }
- ?>
- <script type="text/javascript">
- hs.graphicsDir = '<?php echo $this->getSkinUrl(); ?>highslide/graphics/';
- hs.align = 'center';
- hs.transitions = ['expand', 'crossfade'];
- hs.outlineType = 'rounded-white';
- hs.fadeInOut = true;
- //hs.dimmingOpacity = 0.75;
- // Add the controlbar
- hs.addSlideshow({
- //slideshowGroup: 'group1',
- interval: 5000,
- repeat: false,
- useControls: true,
- fixedControls: 'fit',
- overlayOptions: {
- opacity: 0.75,
- position: 'bottom center',
- hideOnMouseOut: true
- }
- });
- </script>
- <?php
- $_restaurant = Mage::getModel('dailydeals/merchant')->load($this->getRequest()->getParam("id"));
- if(!$_restaurant->getIsNonpaying()):
- function isValidURL($url)
- {
- return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url);
- }
- ?>
- <div class="view-restaurant">
- <div class="block block-seeour">
- <div class="block-title">
- <strong><span><?php echo $this->__("See Our"); ?></span></strong>
- </div>
- <div class="block-content">
- <ul>
- <li>
- <?php
- $collection = Mage::getModel('coupons/coupons')->getCollection()->addFieldToFilter("status", 1)->addFieldToFilter("user_id", $_restaurant->getCustomerId());
- if(count($collection)>0):
- ?>
- <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>
- <?php else: ?>
- <a href="javascript: void(0)"><img src="<?php echo $this->getSkinUrl("images/coupons-inactive.jpg"); ?>" /><br><?php echo $this->__("Coupons"); ?></a>
- <?php endif; ?>
- </li>
- <li>
- <?php if($_restaurant->getMerchantMenu()!=""): ?>
- <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>
- <?php else: ?>
- <a href="javscript: void(0)"><img src="<?php echo $this->getSkinUrl("images/restaurant-menu-inactive.jpg"); ?>" /><br><?php echo $this->__("Menu"); ?></a>
- <?php endif; ?>
- </li>
- <li>
- <?php
- $collection = Mage::getModel('events/events')->getCollection()->addFieldToFilter("status", 1)->addFieldToFilter("user_id", $_restaurant->getCustomerId());
- if(count($collection)>0):
- ?>
- <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>
- <?php else: ?>
- <a href="javascript: void(0)"><img src="<?php echo $this->getSkinUrl("images/events-inactive.jpg"); ?>" /><br><?php echo $this->__("Events"); ?></a>
- <?php endif; ?>
- </li>
- <li>
- <?php
- $collection = Mage::getModel('photos/photos')->getCollection()->addFieldToFilter("status", 1)->addFieldToFilter("user_id", $_restaurant->getCustomerId());
- if(count($collection)>0):
- ?>
- <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>
- <?php else: ?>
- <a href="javascript: void(0)"><img src="<?php echo $this->getSkinUrl("images/photos-inactive.jpg"); ?>" /><br><?php echo $this->__("Photos"); ?></a>
- <?php endif; ?>
- </li>
- <li>
- <?php $collection = Mage::getModel('videos/videos')->getCollection()->addFieldToFilter("status", 1)->addFieldToFilter("merchant_id", $this->getRequest()->getParam("id"));
- if(count($collection)>0):
- ?>
- <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>
- <?php else: ?>
- <a href="javascript: void(0)"><img src="<?php echo $this->getSkinUrl("images/videos-inactive.jpg"); ?>" /><br><?php echo $this->__("Videos"); ?></a>
- <?php endif; ?>
- </li>
- <li>
- <?php
- $collection = Mage::getModel('articles/articles')->getCollection()->addFieldToFilter("status", 1)->addFieldToFilter("user_id", $_restaurant->getCustomerId());
- if(count($collection)>0):
- ?>
- <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>
- <?php else: ?>
- <a href="javascript: void(0)"><img src="<?php echo $this->getSkinUrl("images/articles-inactive.jpg"); ?>" /><br><?php echo $this->__("Articles"); ?></a>
- <?php endif; ?>
- </li>
- <li>
- <?php
- $collection = Mage::getResourceModel('catalog/product_collection')->addAttributeToFilter('type_id', array('eq' => 'ugiftcert'))->addFieldToFilter("merchant_id", $this->getRequest()->getParam("id"));
- if(count($collection)>0):
- foreach($collection as $item):
- $_product = Mage::getModel("catalog/product")->load($item->getId());
- ?>
- <a href="<?php echo $_product->getProductUrl() ?>"><img src="<?php echo $this->getSkinUrl("images/gift-cards.jpg"); ?>" /><br><?php echo $this->__("Gift Cards"); ?></a>
- <?php break; ?>
- <?php endforeach; ?>
- <?php else: ?>
- <a href="javascript: void(0)"><img src="<?php echo $this->getSkinUrl("images/gift-cards-inactive.jpg"); ?>" /><br><?php echo $this->__("Gift Cards"); ?></a>
- <?php endif; ?>
- </li>
- </ul>
- </div>
- </div>
- <div class="col-content">
- <h1><?php echo $_restaurant->getMerchantName(); ?></h1>
- <!--<img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>restaurant-img.jpg" />-->
- <?php
- $collection = Mage::getModel('photos/photos')->getCollection()->addFieldToFilter("status", 1)->addFieldToFilter("user_id", $_restaurant->getCustomerId());
- ?>
- <div class="restaurant-info">
- <div class="restaurant-logo">
- <?php
- // actual path of image
- $_imageUrl = Mage::getBaseDir('media').DS."merchant_image".DS.$_restaurant->getMerchantImage();
- $imageResized = Mage::getBaseDir('media').DS."merchant_image".DS."resized".DS."188_143".DS.$_restaurant->getMerchantImage();
- if (!file_exists($imageResized)&&file_exists($_imageUrl)) :
- $imageObj = new Varien_Image($_imageUrl);
- $imageObj->constrainOnly(TRUE);
- $imageObj->keepAspectRatio(FALSE);
- $imageObj->keepFrame(FALSE);
- $imageObj->backgroundColor(array(255,255,255));
- $imageObj->resize(188, 143);
- $imageObj->save($imageResized);
- endif;
- ?>
- <img src="<?php echo Mage::getBaseUrl('media')."merchant_image/resized/188_143/".$_restaurant->getMerchantImage() ?>" width="188"/>
- </div>
- <div class="restaurant-details">
- <div class="cuisine"><?php echo $this->__("Cuisine Type"); ?>: <?php echo $_restaurant->getMerchantCuisine() ?></div>
- <div class="price-range"><?php echo $this->__("Price Range"); ?>: <?php echo $_restaurant->getMerchantPriceRange() ?></div>
- <div class="address"><?php echo $_restaurant->getMerchantAddress(); ?></div>
- <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>
- <div class="website"><?php echo $_restaurant->getMerchantPhone(); ?></div>
- <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>
- <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>
- <div class="payments-accepted">
- <?php if($_restaurant->getMerchantPaymentsCash()==1): ?>
- <img src="<?php echo Mage::getBaseUrl('media')."payments_accepted/cash-on-delivery.png"; ?>" />
- <?php endif; ?>
- <?php if($_restaurant->getMerchantPaymentsMaster()==1): ?>
- <img src="<?php echo Mage::getBaseUrl('media')."payments_accepted/mastercard.png"; ?>" />
- <?php endif; ?>
- <?php if($_restaurant->getMerchantPaymentsVisa()==1): ?>
- <img src="<?php echo Mage::getBaseUrl('media')."payments_accepted/visa.png"; ?>" />
- <?php endif; ?>
- <?php if($_restaurant->getMerchantPaymentsAe()==1): ?>
- <img src="<?php echo Mage::getBaseUrl('media')."payments_accepted/american-express.png"; ?>" />
- <?php endif; ?>
- <?php if($_restaurant->getMerchantPaymentsInterac()==1): ?>
- <img src="<?php echo Mage::getBaseUrl('media')."payments_accepted/interac.png"; ?>" />
- <?php endif; ?>
- </div>
- <?php if(!$_restaurant->getHideOrderDelivery()): ?>
- <div class="restaurant-tools">
- <p class="table-reservation"><!--<a class="reservation" href="#"><span><?php echo $this->__("Make a reservation"); ?></span></a>-->
- <?php if(($_restaurant->getMerchantMenuUrl()!="")&&($_restaurant->getMerchantMenuUrl()!="0")): ?>
- <script>
- function checkdeliverytype()
- {
- document.getElementById('light').style.display='block';
- document.getElementById('fade').style.display='block';
- }
- function ckeckvalueofform(str)
- {
- //alert(str);
- var radios = document.getElementsByName('deliverytype');
- for (var i = 0, length = radios.length; i < length; i++) {
- if (radios[i].checked) {
- var lastcall=radios[i].value;
- //alert(document.getElementById('example12').value);
- if(lastcall == 'delivery')
- {
- var xyz=<?php echo $_restaurant->getDeliveryOption();?>;
- if(xyz != 1)
- {
- document.getElementById('light').style.display='none';
- document.getElementById('fade').style.display='none';
- if(str =='francais')
- {
- alert('Este restaurante no ofrece la Entrega. Por favor seleccione la elección opción');
- }
- else
- {
- alert('This restaurant does not offer Delivery. Please select the pick up option');
- }
- return false;
- }
- else
- {
- //alert(document.getElementsByName('ordtimesel').value);
- //var today = new Date();
- //var expiry = new Date(today.getTime() + 1 * 24 * 3600 * 1000);
- //var serviceofdeliveryck = 'serviceofdeliveryck';
- //var valueincok='Home Delivery';
- //document.cookie=serviceofdeliveryck + "=" + escape(valueincok) + "; path=/; expires=" + expiry.toGMTString();
- //return true;
- }
- }
- else
- {
- var xyz=<?php echo $_restaurant->getCheckpickup();?>;
- if(xyz != 1)
- {
- document.getElementById('light').style.display='none';
- document.getElementById('fade').style.display='none';
- if(str =='francais')
- {
- alert('Este restaurante no ofrece recogen. Por favor seleccione la opción de Entrega');
- }
- else
- {
- alert('This restaurant does not offer pick up. Please select the Delivery option');
- }
- return false;
- }
- else
- {
- if(document.getElementById('example12').value == 'click here' || document.getElementById('ordtimeseln').checked)
- {
- 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))
- {
- var today = new Date();
- var expiry = new Date(today.getTime() + 1 * 24 * 3600 * 1000);
- var serviceofdeliveryck = 'serviceofdeliveryck';
- var valueincok='PickUp Delivery';
- document.cookie=serviceofdeliveryck + "=" + escape(valueincok) + "; path=/; expires=" + expiry.toGMTString(); var serviceofdeliverycknew= 'Dateoddelivery';
- //var valueincoknew=Date(year);
- var currentTime = new Date();
- var month = currentTime.getMonth() + 1;
- var day = currentTime.getDate();
- var year = currentTime.getFullYear();
- var valueincoknew=month + "/" + day + "/" + year;
- document.cookie=serviceofdeliverycknew + "=" + escape(valueincoknew) + "; path=/; expires=" + expiry.toGMTString();
- // var da=Date(document.getElementById('currenttime').value);
- //alert(da);
- //alert('<?php echo $this->getUrl('onestepcheckout', array('_secure'=>true)) ?>');
- //alert(document.getElementById('operational_hr_fr').value);
- //alert(document.getElementById('currenttime').value);
- //alert(document.getElementById('operational_hr_to').value);
- //alert('right');
- return true;
- }
- else
- {
- alert("Le restaurant est pr"+unescape('%E9')+"sentement ferm"+unescape('%E9')+".");
- return false;
- }
- }
- else
- {
- var advancedateTime = document.getElementById('example12').value.replace('/','-').replace('/','-');
- var asdasd=document.getElementById('example12').value;
- var asgg=Date(asdasd);
- var onlydate=asdasd.split(" ");
- var lastandlastdate=onlydate[0];
- var jul07 = new Date(lastandlastdate);
- var finallyday=jul07.getDay();
- //var asdasasddas=jul07.getDAY();
- alert(finallyday);
- switch (finallyday)
- {
- case 0:
- break;
- case 1:
- break;
- case 2:
- break;
- case 3:
- break;
- case 4:
- break;
- case 5:
- break;
- case 6:
- break;
- }
- //var hariomsir=lastandlastdate.replace(/blue/gi,"red");
- //alert(hariomsir);
- //alert(advancedateTime);
- //alert('<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK); ?>menus/index/viewdays');
- //alert(asgg.getUTCDay());
- return false;
- }
- }
- }
- }
- }
- }
- </script>
- <style>
- .black_overlay{
- display: none;
- position: absolute;
- top: 0%;
- left: 0%;
- width: 100%;
- height: 2500px;
- background-color: black;
- z-index:1001;
- -moz-opacity: 0.8;
- opacity:.80;
- filter: alpha(opacity=80);
- }
- .white_content {
- display: none;
- position: fixed;
- top: 20%;
- left: 45%;
- width: auto;
- height: auto;
- padding: 16px;
- border: 2px solid #f19317;
- background-color: white;
- z-index:1002;
- overflow: auto;
- margin:0 0 0 -120px;
- }
- </style>
- <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" />
- <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
- <script type="text/javascript" src="http://code.jquery.com/ui/1.8.21/jquery-ui.min.js"></script>
- <script type="text/javascript" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS); ?>jquery-ui-timepicker-addon.js"></script>
- <script type="text/javascript" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS); ?>jquery-ui-sliderAccess.js"></script>
- <script type="text/javascript">
- function showdatetimes()
- {
- $('#example12').datetimepicker({
- minDate: 0
- });
- $('#ui-datepicker-div').css({"z-index":'15'});
- }
- function showhidetimes(val)
- {
- if(val == 'l')
- {
- document.getElementById("timenew").style.display = 'block';
- $('#example12').datetimepicker({
- minDate: 0
- });
- $('#ui-datepicker-div').css({"z-index":'15'});
- $('#ui-datepicker-div').css({"top":'152.6px'});
- $('#ui-datepicker-div').attr('id', 'white_content');
- }
- if(val == 'n')
- {
- document.getElementById("timenew").style.display = 'none';
- }
- }
- </script>
- <div id="fade" class="black_overlay"></div>
- <div id="light" class="white_content">
- <div >
- <?php
- $currenttime = Mage::getModel('core/date')->timestamp();
- $id = (int) $this->getRequest()->getParam('id');
- if(!$id)
- {
- $allItems = Mage::getModel('menus/cart')->getQuote()->getAllItems();
- foreach($allItems as $item)
- {
- $product_id = $item->getProductId();
- }
- $menusData = Mage::getModel('menus/menus')->load($product_id, 'product_id');
- $id = $menusData->getMerchantId();
- }
- $displayOption = 1;
- $currentDat = date('Y-m-d h:i:s',$currenttime);
- //echo 'Current Time '.$currentDat;
- $merchantData = Mage::getModel('dailydeals/merchant')->load($id);
- $operationalMinFrom = $merchantData->getOperationHoursMinFrom();
- $operationalMinTo = $merchantData->getOperationHoursMinTo();
- $operationalMinFrom = explode(',',$operationalMinFrom);
- $operationalMinTo = explode(',',$operationalMinTo);
- $day = date('D', $currenttime);
- $newDay = strtolower($day);
- switch($newDay)
- {
- case 'sun':
- $operationHoursMinFrom = $operationalMinFrom[0];
- $operationHoursMinTo = $operationalMinTo[0];
- $operationHoursHrFrom = $merchantData->getOperationHoursHrFromSun();
- $operationHoursHrTo = $merchantData->getOperationHoursHrToSun();
- break;
- case 'mon':
- $operationHoursMinFrom = $operationalMinFrom[1];
- $operationHoursMinTo = $operationalMinTo[1];
- $operationHoursHrFrom = $merchantData->getOperationHoursHrFromMon();
- $operationHoursHrTo = $merchantData->getOperationHoursHrToMon();
- break;
- case 'tue':
- $operationHoursMinFrom = $operationalMinFrom[2];
- $operationHoursMinTo = $operationalMinTo[2];
- $operationHoursHrFrom = $merchantData->getOperationHoursHrFromTue();
- $operationHoursHrTo = $merchantData->getOperationHoursHrToTue();
- break;
- case 'wed':
- $operationHoursMinFrom = $operationalMinFrom[3];
- $operationHoursMinTo = $operationalMinTo[3];
- $operationHoursHrFrom = $merchantData->getOperationHoursHrFromWed();
- $operationHoursHrTo = $merchantData->getOperationHoursHrToWed();
- break;
- case 'thu':
- $operationHoursMinFrom = $operationalMinFrom[4];
- $operationHoursMinTo = $operationalMinTo[4];
- $operationHoursHrFrom = $merchantData->getOperationHoursHrFromThu();
- $operationHoursHrTo = $merchantData->getOperationHoursHrToThu();
- break;
- case 'fri':
- $operationHoursMinFrom = $operationalMinFrom[5];
- $operationHoursMinTo = $operationalMinTo[5];
- $operationHoursHrFrom = $merchantData->getOperationHoursHrFromFri();
- $operationHoursHrTo = $merchantData->getOperationHoursHrToFri();
- break;
- case 'sat':
- $operationHoursMinFrom = $operationalMinFrom[6];
- $operationHoursMinTo = $operationalMinTo[6];
- $operationHoursHrFrom = $merchantData->getOperationHoursHrFromSat();
- $operationHoursHrTo = $merchantData->getOperationHoursHrToSat();
- break;
- }
- ///echo '<br/>';
- $operationHoursHrFrom.':'.$operationHoursMinFrom.':00';
- // echo '<br/>';
- $operationHoursHrTo.':'.$operationHoursMinTo.':00';
- // echo '<br/>';
- $operational_hr_fr = strtotime($operationHoursHrFrom.':'.$operationHoursMinFrom.':00');
- // echo '<br/>';
- $operational_hr_to = strtotime($operationHoursHrTo.':'.$operationHoursMinTo.':00');
- // echo '<br/>';
- $displayOption = ($operational_hr_fr < $currenttime && $currenttime < $operational_hr_to) ? 1 : 0;
- $language_settings = Mage::app()->getStore()->getCode();
- $language_settings = strtolower($language_settings);
- ?>
- <script>
- function checkdeliverytype()
- {
- document.getElementById('light').style.display='block';
- document.getElementById('fade').style.display='block';
- }
- function ckeckvalueofform(str)
- {
- //alert(str);
- var radios = document.getElementsByName('deliverytype');
- for (var i = 0, length = radios.length; i < length; i++) {
- if (radios[i].checked) {
- var lastcall=radios[i].value;
- //alert(document.getElementById('example12').value);
- if(lastcall == 'delivery')
- {
- var xyz=<?php echo $_restaurant->getDeliveryOption();?>;
- if(xyz != 1)
- {
- document.getElementById('light').style.display='none';
- document.getElementById('fade').style.display='none';
- if(str =='francais')
- {
- alert('Este restaurante no ofrece la Entrega. Por favor seleccione la elección opción');
- }
- else
- {
- alert('This restaurant does not offer Delivery. Please select the pick up option');
- }
- return false;
- }
- else
- {
- if(document.getElementById('example12').value == 'click here' || document.getElementById('ordtimeseln').checked)
- {
- 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))
- {
- var today = new Date();
- var expiry = new Date(today.getTime() + 1 * 24 * 3600 * 1000);
- var serviceofdeliveryck = 'serviceofdeliveryck';
- var valueincok='Home Delivery';
- document.cookie=serviceofdeliveryck + "=" + escape(valueincok) + "; path=/; expires=" + expiry.toGMTString(); var serviceofdeliverycknew= 'Dateoddelivery';
- //var valueincoknew=Date(year);
- var currentTime = new Date();
- var month = currentTime.getMonth() + 1;
- var day = currentTime.getDate();
- var year = currentTime.getFullYear();
- var valueincoknew=month + "/" + day + "/" + year;
- document.cookie=serviceofdeliverycknew + "=" + escape(valueincoknew) + "; path=/; expires=" + expiry.toGMTString();
- return true;
- }
- else
- {
- document.getElementById('light').style.display='none';
- document.getElementById('fade').style.display='none';
- alert("Le restaurant est pr"+unescape('%E9')+"sentement ferm"+unescape('%E9')+".");
- return false;
- }
- }
- else
- {
- var advancedateTime = document.getElementById('example12').value.replace('/','-').replace('/','-');
- var asdasd=document.getElementById('example12').value;
- var asgg=Date(asdasd);
- var onlydate=asdasd.split(" ");
- var lastandlastdate=onlydate[0];
- var jul07 = new Date(lastandlastdate);
- var finallyday=jul07.getDay();
- //var asdasasddas=jul07.getDAY();
- //alert(finallyday);
- switch (finallyday)
- {
- case 0:
- var operationHoursMinFrom =<?php echo $operationalMinFrom[0];?>;
- var operationHoursMinTo=<?php echo $operationalMinTo[0]; ?>;
- var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromSun(); ?>;
- var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToSun() ?>;
- break;
- case 1:
- var operationHoursMinFrom =<?php echo $operationalMinFrom[1];?>;
- var operationHoursMinTo=<?php echo $operationalMinTo[1]; ?>;
- var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromMon(); ?>;
- var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToMon() ?>;
- break;
- case 2:
- var operationHoursMinFrom =<?php echo $operationalMinFrom[2];?>;
- var operationHoursMinTo=<?php echo $operationalMinTo[2]; ?>;
- var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromTue(); ?>;
- var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToTue() ?>;
- break;
- case 3:
- var operationHoursMinFrom =<?php echo $operationalMinFrom[3];?>;
- var operationHoursMinTo=<?php echo $operationalMinTo[3]; ?>;
- var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromWed(); ?>;
- var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToWed() ?>;
- break;
- case 4:
- var operationHoursMinFrom =<?php echo $operationalMinFrom[4];?>;
- var operationHoursMinTo=<?php echo $operationalMinTo[4]; ?>;
- var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromThu(); ?>;
- var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToThu() ?>;
- break;
- case 5:
- var operationHoursMinFrom =<?php echo $operationalMinFrom[5];?>;
- var operationHoursMinTo=<?php echo $operationalMinTo[5]; ?>;
- var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromFri(); ?>;
- var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToFri() ?>;
- break;
- case 6:
- var operationHoursMinFrom =<?php echo $operationalMinFrom[6];?>;
- var operationHoursMinTo=<?php echo $operationalMinTo[6]; ?>;
- var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromSat(); ?>;
- var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToSat() ?>;
- break;
- }
- var firsttimecompare=(operationHoursHrFrom*60)+operationHoursMinFrom;
- var secondtimecompare=(operationHoursHrTo*60)+operationHoursMinTo;
- var mytimetosplit=onlydate[1].split(":");
- var finalfirsthr=parseInt(mytimetosplit[0]);
- var finalsecondmin=parseInt(mytimetosplit[1]);
- var finaltimetocompare=(finalfirsthr*60)+finalsecondmin;
- //alert(mytimetosplit[0]);
- //alert(mytimetosplit[1]);
- //alert(firsttimecompare);
- //alert(secondtimecompare);
- //alert(finaltimetocompare);
- if(finaltimetocompare>=firsttimecompare && finaltimetocompare<=secondtimecompare)
- {
- var serviceofdeliverycknew= 'Dateoddelivery';
- var valueincoknew=asdasd;
- document.cookie=serviceofdeliverycknew + "=" + escape(valueincoknew) + "; path=/; expires=" + expiry.toGMTString();
- return true;
- }
- else
- {
- document.getElementById('light').style.display='none';
- document.getElementById('fade').style.display='none';
- alert("Restaurants is closed on given time");
- return false;
- }
- }
- }
- }
- else
- {
- var xyz=<?php echo $_restaurant->getCheckpickup();?>;
- if(xyz != 1)
- {
- document.getElementById('light').style.display='none';
- document.getElementById('fade').style.display='none';
- if(str =='francais')
- {
- alert('Este restaurante no ofrece recogen. Por favor seleccione la opción de Entrega');
- }
- else
- {
- alert('This restaurant does not offer pick up. Please select the Delivery option');
- }
- return false;
- }
- else
- {
- if(document.getElementById('example12').value == 'click here' || document.getElementById('ordtimeseln').checked)
- {
- 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))
- {
- var today = new Date();
- var expiry = new Date(today.getTime() + 1 * 24 * 3600 * 1000);
- var serviceofdeliveryck = 'serviceofdeliveryck';
- var valueincok='PickUp Delivery';
- document.cookie=serviceofdeliveryck + "=" + escape(valueincok) + "; path=/; expires=" + expiry.toGMTString(); var serviceofdeliverycknew= 'Dateoddelivery';
- //var valueincoknew=Date(year);
- var currentTime = new Date();
- var month = currentTime.getMonth() + 1;
- var day = currentTime.getDate();
- var year = currentTime.getFullYear();
- var valueincoknew=month + "/" + day + "/" + year;
- document.cookie=serviceofdeliverycknew + "=" + escape(valueincoknew) + "; path=/; expires=" + expiry.toGMTString();
- return true;
- }
- else
- {
- document.getElementById('light').style.display='none';
- document.getElementById('fade').style.display='none';
- alert("Le restaurant est pr"+unescape('%E9')+"sentement ferm"+unescape('%E9')+".");
- return false;
- }
- }
- else
- {
- var advancedateTime = document.getElementById('example12').value.replace('/','-').replace('/','-');
- var asdasd=document.getElementById('example12').value;
- var asgg=Date(asdasd);
- var onlydate=asdasd.split(" ");
- var lastandlastdate=onlydate[0];
- var jul07 = new Date(lastandlastdate);
- var finallyday=jul07.getDay();
- //var asdasasddas=jul07.getDAY();
- //alert(finallyday);
- switch (finallyday)
- {
- case 0:
- var operationHoursMinFrom =<?php echo $operationalMinFrom[0];?>;
- var operationHoursMinTo=<?php echo $operationalMinTo[0]; ?>;
- var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromSun(); ?>;
- var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToSun() ?>;
- break;
- case 1:
- var operationHoursMinFrom =<?php echo $operationalMinFrom[1];?>;
- var operationHoursMinTo=<?php echo $operationalMinTo[1]; ?>;
- var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromMon(); ?>;
- var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToMon() ?>;
- break;
- case 2:
- var operationHoursMinFrom =<?php echo $operationalMinFrom[2];?>;
- var operationHoursMinTo=<?php echo $operationalMinTo[2]; ?>;
- var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromTue(); ?>;
- var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToTue() ?>;
- break;
- case 3:
- var operationHoursMinFrom =<?php echo $operationalMinFrom[3];?>;
- var operationHoursMinTo=<?php echo $operationalMinTo[3]; ?>;
- var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromWed(); ?>;
- var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToWed() ?>;
- break;
- case 4:
- var operationHoursMinFrom =<?php echo $operationalMinFrom[4];?>;
- var operationHoursMinTo=<?php echo $operationalMinTo[4]; ?>;
- var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromThu(); ?>;
- var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToThu() ?>;
- break;
- case 5:
- var operationHoursMinFrom =<?php echo $operationalMinFrom[5];?>;
- var operationHoursMinTo=<?php echo $operationalMinTo[5]; ?>;
- var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromFri(); ?>;
- var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToFri() ?>;
- break;
- case 6:
- var operationHoursMinFrom =<?php echo $operationalMinFrom[6];?>;
- var operationHoursMinTo=<?php echo $operationalMinTo[6]; ?>;
- var operationHoursHrFrom=<?php echo $merchantData->getOperationHoursHrFromSat(); ?>;
- var operationHoursHrTo=<?php echo $merchantData->getOperationHoursHrToSat() ?>;
- break;
- }
- var firsttimecompare=(operationHoursHrFrom*60)+operationHoursMinFrom;
- var secondtimecompare=(operationHoursHrTo*60)+operationHoursMinTo;
- var mytimetosplit=onlydate[1].split(":");
- var finalfirsthr=parseInt(mytimetosplit[0]);
- var finalsecondmin=parseInt(mytimetosplit[1]);
- var finaltimetocompare=(finalfirsthr*60)+finalsecondmin;
- //alert(mytimetosplit[0]);
- //alert(mytimetosplit[1]);
- //alert(firsttimecompare);
- //alert(secondtimecompare);
- //alert(finaltimetocompare);
- if(finaltimetocompare>=firsttimecompare && finaltimetocompare<=secondtimecompare)
- {
- var today = new Date();
- var expiry = new Date(today.getTime() + 1 * 24 * 3600 * 1000);
- var serviceofdeliverycknew= 'Dateoddelivery';
- var valueincoknew=asdasd;
- alert(valueincoknew);
- document.cookie=serviceofdeliverycknew + "=" + escape(valueincoknew) + "; path=/; expires=" + expiry.toGMTString();
- return true;
- }
- else
- {
- document.getElementById('light').style.display='none';
- document.getElementById('fade').style.display='none';
- alert("Restaurants is closed on given time");
- return false;
- }
- }
- }
- }
- }
- }
- }
- </script>
- <?php
- if ($language_settings == "francais")
- {
- ?>
- <form name="deliveryform" action="<?php echo $_restaurant->getMerchantMenuUrl(); ?>" method="post" onSubmit="return ckeckvalueofform('francais');" >
- <div style="margin-left:30px;"><b>SVP choisir votre service?</b></div>
- <div style="margin-left:-10px;margin-top:20px;"><input type="radio" name="deliverytype" id="pickup" value="Pick up"> Ramassage au magasin <input type="radio" name="deliverytype" id="delivery" value="delivery"> Livraison</div>
- <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>
- </form>
- <?php
- }
- else
- {
- ?>
- <form name="deliveryform" action="<?php echo $_restaurant->getMerchantMenuUrl(); ?>" method="post" onSubmit="return ckeckvalueofform('english');" >
- <input id="currenttime" name="currenttime" value="<?php echo $currenttime ?>" type="hidden" />
- <input id="operational_hr_fr" name="operational_hr_fr" value="<?php echo $operational_hr_fr ?>" type="hidden" />
- <input id="operational_hr_to" name="operational_hr_to" value="<?php echo $operational_hr_to ?>" type="hidden" />
- <div style="margin-left:10px;"><b>Please select your delivery type?</b></div>
- <div style="border-top:2px solid #CCCCCC;">
- <div style="margin-left:47px;margin-top:10px;"><input type="radio" name="deliverytype" id="pickup" value="Pick up"> Pick up <input type="radio" name="deliverytype" id="delivery" value="delivery"> Delivery</div>
- </div>
- <div style="margin-left:10px;margin-top:10px;"><b>
- <?php if ($language_settings == "francais")
- {echo 'Quand voulez-vous votre commande?';}else{ echo 'when do you want your order?';}?></b>
- </div>
- <div style="border:1px solid #CCCCCC;">
- <div style="float:left; width:51%; padding:10px 0 0 10px;">
- <?php if ($language_settings == "francais")
- {echo 'Maintenant';}else{ echo 'Now';}?> <input type="radio" name="ordtimesel" value="n" id="ordtimeseln" checked="checked" onchange="showhidetimes(this.value);" /> <?php if ($language_settings == "francais")
- {echo 'ou Tantot';}else{ echo 'or Later';}?> <input type="radio" name="ordtimesel" value="l" id="ordtimesell" onchange="showhidetimes(this.value);" />
- </div>
- <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>
- </div>
- <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>
- </form>
- <?php
- }
- ?>
- <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>
- </div>
- </div>
- <!--<a target="_blank" href="<?php echo $_restaurant->getMerchantMenuUrl(); ?>">-->
- <?php
- $language_settings = Mage::app()->getStore()->getCode();
- $language_settings = strtolower($language_settings);
- if ( $language_settings == "default"):
- ?>
- <img src="<?php echo $this->getSkinUrl("images/deliverybutton.png") ?>" onclick="return checkdeliverytype();"/>
- <?php
- else:
- ?>
- <img src="<?php echo $this->getSkinUrl("images/deliverybuttonfr.png") ?>" onclick="return checkdeliverytype();"/>
- <?php
- endif;
- ?>
- <!--</a>-->
- <?php else: ?>
- <a href="javscript: void(0)">
- <?php
- $language_settings = Mage::app()->getStore()->getCode();
- $language_settings = strtolower($language_settings);
- if ( $language_settings == "default"):
- ?>
- <img src="<?php echo $this->getSkinUrl("images/deliverybutton.png") ?>"/>
- <?php
- else:
- ?>
- <img src="<?php echo $this->getSkinUrl("images/deliverybuttonfr.png") ?>"/>
- <?php
- endif;
- ?>
- </a>
- <?php endif; ?>
- </p>
- </div>
- <?php endif; ?>
- </div>
- </div>
- <div class="restaurant-images">
- <?php $i = 0;
- if(count($collection)>0):
- foreach($collection as $restaurant):
- $i++;
- ?>
- <div class="<?php if($i==1): ?>item-main<?php elseif($i==2): ?>item item-first<? else: ?>item <?php endif; ?>">
- <?php
- if($i==1){
- $_imageUrl = Mage::getBaseDir('media').DS."restaurant_photos".DS.$restaurant->getFilename();
- $imageResized = Mage::getBaseDir('media').DS."restaurant_photos".DS."resized".DS."588_274".DS.$restaurant->getFilename();
- if(!file_exists($imageResized)&&file_exists($_imageUrl)):
- $imageObj = new Varien_Image($_imageUrl);
- $imageObj->constrainOnly(TRUE);
- $imageObj->keepAspectRatio(TRUE);
- $imageObj->keepFrame(FALSE);
- $imageObj->resize(588, 274);
- $imageObj->save($imageResized);
- endif;
- ?>
- <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" >
- <img src="<?php echo Mage::getBaseUrl('media')."restaurant_photos/resized/588_274/".$restaurant->getFilename() ?>" />
- </a>
- <?php
- }else{
- $_imageUrl1 = Mage::getBaseDir('media').DS."restaurant_photos".DS.$restaurant->getFilename();
- $imageResized1 = Mage::getBaseDir('media').DS."restaurant_photos".DS."resized".DS."132_84".DS.$restaurant->getFilename();
- if(!file_exists($imageResized1)&&file_exists($_imageUrl1)):
- $imageObj = new Varien_Image($_imageUrl1);
- $imageObj->constrainOnly(TRUE);
- $imageObj->keepAspectRatio(FALSE);
- $imageObj->keepFrame(FALSE);
- $imageObj->resize(132, 84);
- $imageObj->save($imageResized1);
- endif;
- $_imageUrl = Mage::getBaseDir('media').DS."restaurant_photos".DS.$restaurant->getFilename();
- $imageResized = Mage::getBaseDir('media').DS."restaurant_photos".DS."resized".DS."588_274".DS.$restaurant->getFilename();
- if(!file_exists($imageResized)&&file_exists($_imageUrl)):
- $imageObj = new Varien_Image($_imageUrl);
- $imageObj->constrainOnly(TRUE);
- $imageObj->keepAspectRatio(true);
- $imageObj->keepFrame(FALSE);
- $imageObj->resize(588, 274);
- $imageObj->save($imageResized);
- endif;
- ?>
- <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(); ?>">
- <img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."restaurant_photos/resized/132_84/".$restaurant->getFilename(); ?>" />
- </a>
- <?php
- }
- ?>
- </div>
- <?php endforeach; ?>
- <?php endif; ?>
- </div>
- <style>
- .scrollable img {
- width:100px;
- margin:20px 5px 20px 21px;
- }
- .scrollable img.hover {
- background-color:#123;
- }
- </style>
- <!-- wrapper for navigator elements -->
- <!--<div class="navi"></div>-->
- <!-- 1-5 -->
- <?php
- $featured_collections = Mage::getModel('photos/photos')->getCollection()->addFieldToFilter("status", 1)->addFieldToFilter("user_id", $_restaurant->getCustomerId())->addFieldToFilter("featured", 1);
- $i = 0;
- if(count($featured_collections)>0):
- ?>
- <div style="margin:0 auto; width: 595px; height:120px; float: left;">
- <!-- "previous page" action -->
- <a class="prev browse left"></a>
- <!-- root element for scrollable -->
- <div class="scrollable" id="chained">
- <!-- root element for the items -->
- <div class="items">
- <?php
- foreach($featured_collections as $restaurant):
- if($i%4==0):
- ?>
- <div>
- <?php endif; ?>
- <?php
- // actual path of image
- $_imageUrl = Mage::getBaseDir('media').DS."restaurant_photos".DS.$restaurant->getFilename();
- // path of the resized image to be saved
- // here, the resized image is saved in media/resized folder
- $imageResized = Mage::getBaseDir('media').DS."restaurant_photos".DS."resized".DS."100_75".DS.$restaurant->getFilename();
- // resize image only if the image file exists and the resized image file doesn't exist
- // the image is resized proportionally with the width/height 135px
- if (!file_exists($imageResized)&&file_exists($_imageUrl)) :
- $imageObj = new Varien_Image($_imageUrl);
- $imageObj->constrainOnly(TRUE);
- $imageObj->keepAspectRatio(FALSE);
- $imageObj->keepFrame(FALSE);
- $imageObj->resize(100, 75);
- $imageObj->save($imageResized);
- endif;
- ?>
- <!--<a href="images/harley1c.jpg" rel="disable-zoom: true;" class="MagicZoomPlus"><img src="images/harley1b.jpg"/></a>-->
- <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>
- <?php $i++;
- if(($i%4==0)||($i==count($featured_collections))):
- ?>
- </div>
- <?php endif; ?>
- <?php endforeach; ?>
- </div>
- </div>
- <!-- "next page" action -->
- <a class="next browse right"></a>
- </div>
- <?php endif; ?>
- <!-- javascript coding -->
- <script>
- jQuery(document).ready(function() {
- jQuery("#chained").scrollable({circular: true, mousewheel: true}).navigator().autoscroll({
- interval: 3000
- });
- });
- </script>
- <div class="block description-block">
- <div class="block-title">
- <h3><?php echo $this->__("Description"); ?></h3>
- </div>
- <div class="block-content">
- <?php echo $_restaurant->getMerchantDescription(); ?>
- </div>
- </div>
- <div class="block block-customers-photos description-block">
- <div class="block-title">
- <h3><?php echo $this->__("CUSTOMER PHOTOS"); ?></h3>
- </div>
- <div class="block-content">
- <?php
- $photos = Mage::getModel("customersphotos/customersphotos")->getCollection()->addFieldToFilter("status", 1)->addFieldToFilter("merchant_id", $this->getRequest()->getParam("id"))->setOrder('customersphotos_id', 'DESC');
- if(count($photos)>0):
- $i=0;
- foreach($photos as $photo):
- $_imageUrl = Mage::getBaseDir('media').DS."customersphotos".DS.$photo->getFilename();
- $imageResized = Mage::getBaseDir('media').DS."customersphotos".DS."resized".DS."105_68".DS.$photo->getFilename();
- if (!file_exists($imageResized)&&file_exists($_imageUrl)) :
- $imageObj = new Varien_Image($_imageUrl);
- $imageObj->constrainOnly(TRUE);
- $imageObj->keepAspectRatio(FALSE);
- $imageObj->keepFrame(FALSE);
- $imageObj->resize(105, 68);
- $imageObj->save($imageResized);
- endif;
- ?>
- <div class="<?php if($i%3==0): ?>first<?php endif; ?> item">
- <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() ?>" />
- </div>
- <?php $i++;
- if($i==15) break;
- ?>
- <?php endforeach; ?>
- <?php endif; ?>
- <a class="upload-photos" href="<?php echo $this->getUrl("customersphotos"); ?>?id=<?php echo $this->getRequest()->getParam("id"); ?>"><?php echo $this->__("Upload your photos"); ?></a>
- <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>
- </div>
- </div>
- <?php echo $this->getLayout()->createBlock('core/template')->setTemplate('dailydeals/restaurant-reviews.phtml')->toHtml(); ?>
- </div>
- <div class="col-right">
- <?php /*<div class="block block-like">
- <div class="block-title">
- <strong><span><?php echo $this->__("Vistors"); ?></span></strong>
- </div>
- <div class="block-content">
- <?php echo count_hit(); ?>
- </div>
- </div> */ ?>
- <div class="block block-like">
- <div class="block-title">
- <strong><span><?php echo $this->__("Do you like us?"); ?></span></strong>
- </div>
- <div class="block-content">
- <!-- AddThis Button BEGIN -->
- <div class="addthis_toolbox addthis_default_style ">
- <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
- <a class="addthis_button_tweet"></a>
- <a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
- <!--<a class="addthis_counter addthis_pill_style"></a>-->
- </div>
- <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4f7ab3bd2703b5c8"></script>
- <!-- AddThis Button END -->
- </div>
- </div>
- <div class="block block-location">
- <div class="block-title">
- <strong><span><?php echo $this->__("Location"); ?></span></strong>
- </div>
- <div class="block-content">
- <?php echo $_restaurant->getMerchantLocation(); ?>
- </div>
- </div>
- <div class="block description-block">
- <div class="block-title">
- <strong><span><?php echo $this->__("Heures d'operation"); ?></span></strong>
- </div>
- <div class="block-content">
- <?php
- $id = (int) $this->getRequest()->getParam('id');
- $merchantData = Mage::getModel('dailydeals/merchant')->load($id);
- $operationalMinFrom = $merchantData->getOperationHoursMinFrom();
- $operationalMinTo = $merchantData->getOperationHoursMinTo();
- $operationalMinFrom = explode(',',$operationalMinFrom);
- $operationalMinTo = explode(',',$operationalMinTo);
- ?>
- <div style="float:left; width:95%;">
- <div style="float:left; width:100%;">
- Sunday
- </div>
- <div style="float:left; width:100%;">
- <div style="float:left; width:50%;">
- Open <?php echo $merchantData->getOperationHoursHrFromSun().':'.$operationalMinFrom[0]; ?>
- </div>
- <div style="float:left; width:50%;">
- Close <?php echo $merchantData->getOperationHoursHrToSun().':'.$operationalMinTo[0]; ?>
- </div>
- </div>
- </div>
- <div style="float:left; width:95%;">
- <div style="float:left; width:100%;">
- Monday
- </div>
- <div style="float:left; width:100%;">
- <div style="float:left; width:50%;">
- Open <?php echo $merchantData->getOperationHoursHrFromMon().':'.$operationalMinFrom[1]; ?>
- </div>
- <div style="float:left; width:50%;">
- Close <?php echo $merchantData->getOperationHoursHrToMon().':'.$operationalMinTo[1]; ?>
- </div>
- </div>
- </div>
- <div style="float:left; width:95%;">
- <div style="float:left; width:100%;">
- Tuesday
- </div>
- <div style="float:left; width:100%;">
- <div style="float:left; width:50%;">
- Open <?php echo $merchantData->getOperationHoursHrFromTue().':'.$operationalMinFrom[2]; ?>
- </div>
- <div style="float:left; width:50%;">
- Close <?php echo $merchantData->getOperationHoursHrToTue().':'.$operationalMinTo[2]; ?>
- </div>
- </div>
- </div>
- <div style="float:left; width:95%;">
- <div style="float:left; width:100%;">
- Wednesday
- </div>
- <div style="float:left; width:100%;">
- <div style="float:left; width:50%;">
- Open <?php echo $merchantData->getOperationHoursHrFromWed().':'.$operationalMinFrom[3]; ?>
- </div>
- <div style="float:left; width:50%;">
- Close <?php echo $merchantData->getOperationHoursHrToWed().':'.$operationalMinTo[3]; ?>
- </div>
- </div>
- </div>
- <div style="float:left; width:95%;">
- <div style="float:left; width:100%;">
- Thursday
- </div>
- <div style="float:left; width:100%;">
- <div style="float:left; width:50%;">
- Open <?php echo $merchantData->getOperationHoursHrFromThu().':'.$operationalMinFrom[4]; ?>
- </div>
- <div style="float:left; width:50%;">
- Close <?php echo $merchantData->getOperationHoursHrToThu().':'.$operationalMinTo[4]; ?>
- </div>
- </div>
- </div>
- <div style="float:left; width:95%;">
- <div style="float:left; width:100%;">
- Friday
- </div>
- <div style="float:left; width:100%;">
- <div style="float:left; width:50%;">
- Open <?php echo $merchantData->getOperationHoursHrFromFri().':'.$operationalMinFrom[5]; ?>
- </div>
- <div style="float:left; width:50%;">
- Close <?php echo $merchantData->getOperationHoursHrToFri().':'.$operationalMinTo[5]; ?>
- </div>
- </div>
- </div>
- <div style="float:left; width:95%;">
- <div style="float:left; width:100%;">
- Saturday
- </div>
- <div style="float:left; width:100%;">
- <div style="float:left; width:50%;">
- Open <?php echo $merchantData->getOperationHoursHrFromSat().':'.$operationalMinFrom[6]; ?>
- </div>
- <div style="float:left; width:50%;">
- Close <?php echo $merchantData->getOperationHoursHrToSat().':'.$operationalMinTo[6]; ?>
- </div>
- </div>
- </div>
- <?php // echo $_restaurant->getMerchantHours(); ?>
- </div>
- </div>
- <div class="block block-deal">
- <div class="block-title">
- <strong><span><?php echo $this->__("Deals"); ?></span></strong>
- </div>
- <div class="block-content">
- <script type="text/javascript" src="<?php echo $this->getSkinUrl("fancybox/jquery.min.js"); ?>"></script>
- <script type="text/javascript">// <![CDATA[
- jQuery(document).ready(function(){
- jQuery('.deal-item').hover(function(){
- jQuery(this).find('.deal-description').animate({
- opacity: 0.7
- }, 300);
- }, function(){
- jQuery(this).find('.deal-description').animate({
- opacity: 0
- }, 100);
- });
- });
- // ]]></script>
- <?php //echo $_restaurant->getMerchantLocation();
- $collection = Mage::getModel('dailydeals/deal')->getCollection()->addFieldToFilter("merchant_id", $this->getRequest()->getParam("id"))->addFieldToFilter("deal_status", 1)->addFieldToFilter("att_set", 0);
- foreach($collection as $item){
- $_product = Mage::getModel("catalog/product")->load($item->getProductId());
- ?>
- <div class="deal-item">
- <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->getImageLabel($_product, 'small_image') ?>" class="product-image">
- <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) ?>" />
- </a>
- <div class="deal-description">
- <?php echo $_product->getShortDescription() ?>
- <a href="<?php echo $_product->getProductUrl() ?>" class="button"><?php echo $this->__("View Deal"); ?></a>
- </div>
- <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>
- <?php
- //$deal = $this->getDeal();
- $deal = Mage::getModel('dailydeals/deal')->load($_product->getId(), 'product_id');
- $target_count = $deal->getTargetCount();
- $sold_count = $deal->getSoldCount() + $deal->getDummyCount();
- ?>
- <div class="deal-footer">
- <div class="num-bought">
- <?php
- if($sold_count>0){
- echo $sold_count.$this->__(' Buys');
- }else{
- echo $sold_count.$this->__(' Buy');
- }
- ?>
- </div>
- <?php
- $systemtimezone = Mage::app()->getStore()->getConfig('general/locale/timezone');
- $timezone = new DateTimeZone($systemtimezone);
- $offset = $timezone->getOffset(new DateTime("now"));
- $hours = Mage::getStoreConfig('dailydeals/general/start_time');
- $lead_time = $hours*60*60;
- $targetDate = $deal->getDateTo();
- $my_time = strtotime($targetDate) + $lead_time;
- ?>
- <div class="remaining_time">
- <div class="timercontainer" id="cdcontainer_<?php echo $deal->getDealId(); ?>"></div>
- <script type="text/javascript">
- var dealActiveUntil = new Date();
- dealActiveUntil.setTime(<?php echo $my_time*1000; ?>);
- var serverNow = new Date();
- serverNow.setSeconds(serverNow.getSeconds() + <?php echo $offset ?>);
- var launchdate_<?php echo $deal->getDealId(); ?>=new cdLocalTime("cdcontainer_<?php echo $deal->getDealId(); ?>", "server-php", 0, dealActiveUntil.toString(), serverNow.toUTCString());
- launchdate_<?php echo $deal->getDealId(); ?>.displaycountdown("days", formatresults3);
- </script>
- </div>
- </div>
- </div>
- <?php
- break;
- }
- ?>
- <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>
- </div>
- </div>
- <?php //echo $this->getLayout()->createBlock('core/template')->setTemplate('dailydeals/restaurant-giftcards.phtml')->toHtml(); ?>
- <div class="block block-coupons">
- <div class="block-title">
- <strong><span><?php echo $this->__("COUPONS"); ?></span></strong>
- </div>
- <div class="block-content">
- <link href="<?php echo $this->getSkinUrl("custom_scroller/jquery.mCustomScrollbar.css") ?>" rel="stylesheet" type="text/css" />
- <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
- <!-- content block -->
- <div id="mcs3_container">
- <div class="customScrollBox">
- <div class="container">
- <div class="content">
- <?php
- $collection = Mage::getModel('coupons/coupons')->getCollection()->addFieldToFilter("status", 1)->addFieldToFilter("user_id", $_restaurant->getCustomerId());
- if(count($collection)>0):
- ?>
- <div class="restaurant-coupons">
- <?php
- $i = 0;
- foreach($collection as $item):
- $i++;
- ?>
- <div class="item <?php if($i==5): ?>last<?php endif; ?>">
- <img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."coupons/".$item->getFilename(); ?>" width="278"/>
- <h3 class="coupon-title"><?php echo $item->getDetail(); ?></h3>
- <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>
- </div>
- <?php endforeach; ?>
- </div>
- <?php else: ?>
- <p><?php echo $this->__("There's no coupon."); ?></p>
- <?php endif; ?>
- </div>
- </div>
- <div class="dragger_container">
- <div class="dragger"></div>
- </div>
- </div>
- </div>
- <script>
- jQuery.noConflict();
- jQuery(window).load(function() {
- mCustomScrollbars();
- });
- function mCustomScrollbars(){
- jQuery("#mcs3_container").mCustomScrollbar("vertical",900,"easeOutCirc",1.05,"auto","no","no",0);
- }
- /* function to fix the -10000 pixel limit of jquery.animate */
- jQuery.fx.prototype.cur = function(){
- if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
- return this.elem[ this.prop ];
- }
- var r = parseFloat( jQuery.css( this.elem, this.prop ) );
- return typeof r == 'undefined' ? 0 : r;
- }
- /* function to load new content dynamically */
- function LoadNewContent(id,file){
- jQuery("#"+id+" .customScrollBox .content").load(file,function(){
- mCustomScrollbars();
- });
- }
- </script>
- <script src="<?php echo $this->getSkinUrl("custom_scroller/jquery.mCustomScrollbar.js") ?>"></script>
- </div>
- </div>
- </div>
- </div>
- <?php else: ?>
- <?php echo $this->getLayout()->createBlock('core/template')->setTemplate('dailydeals/non-paying-restaurant.phtml')->toHtml(); ?>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment