Your IP : 216.73.216.84


Current Path : /home/helpink/www/components/com_jbusinessdirectory/views/offer/tmpl/
Upload File :
Current File : /home/helpink/www/components/com_jbusinessdirectory/views/offer/tmpl/default_style_1.php

<?php
/**
 * @package    J-BusinessDirectory
 *
 * @author     CMSJunkie http://www.cmsjunkie.com/
 * @copyright  Copyright (C) 2007 - 2022 CMSJunkie. All rights reserved.
 * @license    https://www.gnu.org/licenses/agpl-3.0.en.html
 */
defined('_JEXEC') or die('Restricted access');
$user = JBusinessUtil::getUser();

$session = JFactory::getSession();
$menuItem = "&Itemid=".$session->get("offersMenuItemId");
$referer= isset($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REFERER']:"";

$couponUrl = JRoute::_('index.php?option=com_jbusinessdirectory&task=offer.generateCoupon&id='.$this->offer->id);
if($this->appSettings->enable_offer_selling && $this->offer->enable_offer_selling != OFFER_SELLING_COUPON && !empty((float)$this->offer->specialPrice) && !empty((float)$this->offer->price)){
	$couponUrl = "javascript:onclick=jbdOffers.addToCart(".$this->offer->id.",1)";
}

?>

<div id="jbd-container" class="jbd-container">
	<div id="offer-detail-1" class="offer-details offer-details-1"  itemscope itemtype="http://schema.org/Offer">
		<div class="row mb-4">
			<?php if(!empty($referer) && false){ ?>
				<div class="col-md-3">
	    			<a href="<?php echo $referer ?>"><?php echo JText::_("BACK") ?></a>
	    		</div>
	    	<?php }else{ ?>
	    		<div class="col-md-3">
	    			<a href="<?php echo JRoute::_('index.php?option=com_jbusinessdirectory&view=offers&reload=1'.$menuItem); ?>"><?php echo JText::_("BACK_TO_OFFERS") ?></a>
	    		</div>
			<?php } ?>
    		<div class="col-md-9 header-icons">
    			<?php require_once JPATH_COMPONENT_SITE."/include/social_share.php" ?>
        		<a class="print-icon" rel="nofollow" href="javascript:jbdUtils.printItem('<?php echo JRoute::_("index.php?option=com_jbusinessdirectory&view=offer&tmpl=component&action=print&offerId=".$this->offer->id); ?>')"><i class="icon print-circle"></i></a>
        		<?php if($this->appSettings->enable_bookmarks && $this->offer->item_type == OFFER_TYPE_OFFER) { ?>
                    <?php if(!empty($this->offer->bookmark)){?>
                        <!-- Business Bookmarks -->
                        <a id="bookmark-<?php echo $this->offer->id ?>" href="javascript:jbdUtils.showUpdateBookmarkDialog(<?php echo $user->id==0?"1":"0"?>, <?php echo $this->offer->id ?>,<?php echo BOOKMARK_TYPE_OFFER ?>)"  title="<?php echo JText::_("LNG_UPDATE_BOOKMARK")?>" class="bookmark"><i class="icon heart-circle"></i></a>
                    <?php } else {?>
                        <a id="bookmark-<?php echo $this->offer->id ?>" href="javascript:jbdUtils.showAddBookmark(<?php echo $user->id==0?"1":"0"?>, <?php echo $this->offer->id ?>,<?php echo BOOKMARK_TYPE_OFFER ?>)" title="<?php echo JText::_("LNG_ADD_BOOKMARK")?>" class="bookmark"><i class="icon heart-o-circle"></i></a>
                    <?php } ?>
                <?php } ?>
    	     </div>
    	</div>
		<div class="row item-section">
			<?php if(!empty($this->offer->pictures)){?>
                <div class="col-lg-7">
                    <?php
                        $this->pictures = $this->offer->pictures;
                        require_once JPATH_COMPONENT_SITE.'/include/gallery/image_gallery_vertical.php';
                    ?>
                </div>
            <?php } ?>
    		<div class="col-lg-5">
    			<h1 itemprop="name"> <?php echo $this->escape($this->offer->subject)?></h1>
    			
                <div class="rating-info">
                    <div class="rating rating-stars">
                        <span class="user-rating-avg rating-average-review" id="rating-average-review" title="<?php echo $this->offer->review_score?>" alt="<?php echo $this->offer->id?>" style="display: block;"></span>
                    </div>
                    <?php echo count($this->reviews)." ".JText::_("LNG_REVIEWS") ?> &nbsp; | &nbsp; <a class="" href="javascript:void(0)" onclick="jbdReviews.addNewReview(<?php echo ($appSettings->enable_reviews_users && $user->id ==0) ?"1":"0"?>,false)"><?php echo JText::_("LNG_WRITE_REVIEW") ?></a>
				</div>

                <?php
                    if (!empty($this->offer->price)) :
                        $originalPrice = (float) $this->offer->price;
                        $discountedPrice = !empty($this->offer->specialPrice) ? (float) $this->offer->specialPrice : null;

                        if ($discountedPrice && $originalPrice > 0) {
                            $discountPercentage = round((($originalPrice - $discountedPrice) / $originalPrice) * 100);
                        }
                    ?>

                    <div class="price-container">
                        <?php if ($discountedPrice) : ?>
                            <!-- Discount Badge -->
                             <div class="discount-wrapper">
                                <div class="discount-badge">
                                    <span class="discount-icon">%</span>
                                </div>
                                <div class="discount-value"><?php echo $discountPercentage > 0 ? '-' . $discountPercentage . '%' : '-'; ?></div>
                            </div>

                            <!-- Strikethrough Original Price with Currency -->
                            <div class="original-price">
                                <span class="price"><?php echo JBusinessUtil::getPriceFormat($originalPrice, $this->offer->currencyId); ?></span>
                            </div>

                            <!-- Special Price -->
                            <div class="special-price">
                                <span class="price"><?php echo JBusinessUtil::getPriceFormat($discountedPrice, $this->offer->currencyId); ?></span>
                            </div>
                        <?php else : ?>
                            <!-- Only the regular price if there's no special price -->
                            <div class="regular-price">
                                <span class="price"><?php echo JBusinessUtil::getPriceFormat($originalPrice, $this->offer->currencyId); ?></span>
                            </div>
                        <?php endif; ?>
                    </div>

                    <?php if ($this->defaultAttributes["price_text"]!=ATTRIBUTE_NOT_SHOW) { ?>
                        <?php if ($this->defaultAttributes["price_text"]!=ATTRIBUTE_NOT_SHOW) { ?>
                            <?php if (!empty($this->offer->price_text)) { ?>
                                <div class="price-text"><?php echo $this->offer->price_text;?></div>
                            <?php }elseif (empty($this->offer->price) && empty($this->offer->specialPrice) && ($this->appSettings->show_offer_free)){ ?>
                                <div><span class="free-text text-success p-2"><?php echo JText::_('LNG_FREE') ?></span></div>
                            <?php } ?>
                        <?php } ?>
                    <?php } ?>
                <?php endif; ?>
                       
                <div>
                    <?php if ($this->offer->item_type == OFFER_TYPE_OFFER && (!$this->appSettings->enable_offer_selling || $this->appSettings->enable_offer_selling && $this->offer->enable_offer_selling == OFFER_SELLING_COUPON)) { ?>
                        <div class="jbd-coupon">
                            <?php if(!empty($this->offer->specialPrice) && !empty($this->offer->price) && $this->offer->specialPrice < $this->offer->price){ ?>
                                <div class="jbd-coupon-discount">
                                    <?php echo JBusinessUtil::getPriceDiscount($this->offer->specialPrice, $this->offer->price) ?>% </span> <?php echo JText::_("LNG_OFF")?>
                                </div>
                            <?php } ?>
                            <?php if($this->appSettings->enable_offer_coupons) { ?>
                                <?php if($this->offer->checkOffer) { ?>
                                    <div class="jbd-coupon-link">
                                        <div class="jbtn-offer-darken"></div>
                                            <?php if($user->id !=0) { ?>
                                            <a href="<?php echo $couponUrl ?>">
                                                <?php echo JText::_("LNG_GENERATE_COUPON")?>
                                            </a>
                                            <?php } else { ?>
                                            <a href="javascript:jbdUtils.showLoginNotice()">
                                                <?php echo JText::_('LNG_GENERATE_COUPON')?>
                                            </a>
                                        <?php } ?>
                                    </div>
                                <?php } ?>
                            <?php } ?>
                        </div>
                    <?php } ?>
                </div>
                <div class="row">
                    <div class="col-lg">
                        <div class="offer-info">
                           <ul class="item-details">
                                <?php if (!empty($this->offer->show_time) && JBusinessUtil::getRemainingtime($this->offer->endDate, $this->offer->time_zone, true) != "") { ?>
                                    <li>
                                        <div class="icon-wrapper"><i class="la la-clock-o"></i></div> <?php echo JBusinessUtil::getRemainingtime($this->offer->endDate, $this->offer->time_zone, true) ?>
                                    </li>
                                <?php } ?> 

                                <?php if ((!empty($this->offer->startDate) && $this->offer->startDate!="0000-00-00") || (!empty($this->offer->endDate) && $this->offer->endDate!="0000-00-00")) { ?>
                                    <li>
                                        <div class="icon-wrapper"><i class="icon calendar"></i></div>
                                        <?php
                                            echo  JBusinessUtil::getDateGeneralFormat($this->offer->startDate)." - ". JBusinessUtil::getDateGeneralFormat($this->offer->endDate);
                                        ?>
                                        <span style="display: none;" itemprop="validFrom"><?php echo JBusinessUtil::getDateGeneralFormat($this->offer->startDate)?></span>
                                        <span style="display: none;" itemprop="validThrough"><?php echo JBusinessUtil::getDateGeneralFormat($this->offer->endDate)?></span>
                                    </li>
                                <?php } ?>
                                
                                <?php if ($this->appSettings->show_contact_form && $this->offer->item_type == OFFER_TYPE_OFFER) { ?>
                                    <?php if(!empty($this->offer->company->phone) || !empty($this->offer->company->mobile)){?>
                                        <li>
                                            <?php if(!empty($this->offer->company->phone)){ ?>
                                                <div class="icon-wrapper"><i class="icon phone-o"></i></div> <a href="tel:<?php  echo $this->escape($this->offer->company->phone); ?>"><?php  echo $this->escape($this->offer->company->phone); ?></a> &nbsp;&nbsp;
                                            <?php } else if(!empty($this->offer->company->mobile)){ ?>
                                                <div class="icon-wrapper"><i class="icon mobile"></i></div> <a href="tel:<?php  echo $this->escape($this->offer->company->mobile); ?>"><?php  echo $this->escape($this->offer->company->mobile); ?></a>
                                            <?php } ?>
                                        </li>
                                    <?php } ?>
                                    <li>
                                    <div class="icon-wrapper"><i class="icon envelope"></i></div><a itemprop="email" href="javascript:jbdListings.contactCompany(<?php echo $showData ? 1 : 0 ?>)"> <?php echo JText::_('LNG_CONTACT'); ?></a>
                                    </li>
                                <?php } ?>
                                
                                <?php if($appSettings->enable_offer_reporting){?>
                                    <li>
                                        <div class="icon-wrapper"><i class="la la-flag"></i></div><a href="javascript:jbdOffers.showReportOfferAbuse()"> <?php echo JText::_('LNG_REPORT_OFFER'); ?></a>
                                    </li>
                                <?php } ?>
                            </ul>
                        </div>
                	</div>
               </div>
        	</div>
    	</div>
   
    	<?php if ($this->appSettings->enable_offer_selling && $this->offer->enable_offer_selling == OFFER_SELLING_REGULAR && JBusinessUtil::checkDateInterval($this->offer->startDate, $this->offer->endDate) && $this->offer->quantity > 0
            && (isset($this->offer->companyPackage->features) && in_array(SELL_OFFERS,$this->offer->companyPackage->features) || !$this->appSettings->enable_packages)) { ?>
        	<div class="row item-section">
        		<div class="col-12">
            		<div class="jbtn-order">
            			<div class="jbtn-order-info">
                            <?php if (!empty($this->offer->sellingOptions)) {
	                            echo AttributeService::renderSellingAttributesFront($this->offer->sellingOptions, $this->offer->id, $this->offer->main_subcategory);
                            }else { ?>
                                <select  onchange="jbdOffers.checkAddToCartStatus()" name="quantity" id="quantity" class="select">
		                            <?php
                                        if ($this->offer->min_purchase > 0) {
                                            echo '<option value="0">0</option>';
                                        }

                                        $maximum = $this->offer->max_purchase;
                                        if ($this->offer->quantity < $this->offer->max_purchase) {
                                            $maximum = $this->offer->quantity;
                                        }
                                        $maximum = ($maximum < MAXIMUM_OFFER_QUANTITY_SELLING) ? $maximum : MAXIMUM_OFFER_QUANTITY_SELLING;
                                        for ($i = $this->offer->min_purchase; $i <= $maximum; $i++) {
                                            echo '<option value="' . $i . '">' . $i . '</option>';
                                        } 
                                    ?>
                                </select>
	                        <?php } ?>
	                        <p class="jbtn-order-info-text">
            				</p>
            			</div>
                        <input type="hidden" id="firstValue" value=""/>

            			<div class="jbtn-order-btn">
            				<a id="addToCartButton" href="javascript:onclick=jbdOffers.addToCart(<?php echo $this->offer->id; ?>)"><i class="icon cart white"></i> <?php echo JText::_('LNG_ADD_TO_CART'); ?></a>
            			</div>
                        <?php if(!empty($this->cart["items"]) && in_array($this->offer->id , array_column($this->cart["items"], 'id')) && false) {?>
                            <div class="jbtn-order-btn ml-2 btn-remove-cart">
                                <a id="removeFromCartButton" href="javascript:onclick=jbdOffers.removeFromCart('<?php echo $this->offer->id; ?>_')"><i class="la la-trash-o white"></i></a>
                            </div>
                        <?php } ?>
            		</div>
            	</div>
        	</div>
 		<?php } else if ($this->appSettings->enable_offer_selling && $this->offer->enable_offer_selling == OFFER_SELLING_REGULAR && JBusinessUtil::checkDateInterval($this->offer->startDate, $this->offer->endDate) && $this->offer->quantity == 0
            && (isset($this->offer->companyPackage->features) && in_array(SELL_OFFERS,$this->offer->companyPackage->features) || !$this->appSettings->enable_packages)) { ?>
            <div class="offer-quantity-info">
                <?php echo JText::_('LNG_OUT_OF_STOCK') ?>
            </div>
 		<?php } ?>

		
        <div class="row item-section">
        	<div class="col">
                <div class="section-title">
                    <?php echo JText::_("LNG_DESCRIPTION") ?>
                </div>
                <div itemprop="description">
                     <?php echo JHTML::_("content.prepare", $this->offer->description); ?>
                </div>
          	</div>
        </div>

        <div class="row item-section">
       		<div class="col categories-wrapper">
                <?php if(!empty($this->offer->categories)){
                    foreach($this->offer->categories as $i=>$category){
                        ?>
                        <a href="<?php echo JBusinessUtil::getOfferCategoryLink($category[0], $category[2]) ?>"><?php echo $this->escape($category[1]) ?></a><?php echo $i<(count($this->offer->categories)-1)? '':'' ?>
                        <?php
                    }
                } ?>
           </div>
        </div>

        <?php if(!empty($this->offer->offerType)){?>
            <div class="row item-section">
                <div class="col">
                    <?php echo JText::_("LNG_TYPE")?>
                    <strong><?php echo $this->escape($this->offer->offerType)?></strong>
                </div>
            </div>
        <?php } ?>

        <?php require_once 'offer_attributes.php'; ?>

        <?php if ($this->appSettings->enable_attachments) { ?>
        	<?php if (!empty($this->offer->attachments)) { ?>                             
                <div class="row item-section">
                	<div class="col">
                        <div class="section-title">
                            <?php echo JText::_("LNG_ATTACHMENTS") ?>
                        </div>
                        <?php require "offer_attachments.php"?>
                    </div>
				</div>
             <?php } ?>
        <?php } ?>
        
        <?php if (!empty($this->videos)) { ?>
        	<div class="row item-section">
        		<div class="col">
                    <div class="section-title">
                        <?php echo JText::_("LNG_VIDEOS") ?>
                    </div>
            	    <?php require_once 'offer_videos.php';?>
            	</div>
        	</div>
        <?php } ?>
        
        <div class="business-details item-section">
            <div class="row">
                <div class="col-md">
                    <?php if(!empty($this->offer->company)){?>
                        <div class="offer-business" itemprop="offeredBy" itemscope itemtype="http://schema.org/Organization">
                            <div class="business-head"><?php echo JText::_('LNG_COMPANY_DETAILS') ?></div>
                            <a class="business-name" <?php echo $newTab; ?> href="<?php echo JBusinessUtil::getCompanyLink($this->offer->company)?>"> <span itemprop="name"><?php echo $this->escape($this->offer->company->name)?></span></a>
                            <?php if(!empty($this->offer->company->phone) || !empty($this->offer->company->mobile)){?>
                                    <div class="business-item" itemprop="telephone">
                                    <?php if(!empty($this->offer->company->phone)){ ?>
                                        <i class="icon phone-o"></i> <a href="tel:<?php  echo $this->escape($this->offer->company->phone); ?>"><?php  echo $this->escape($this->offer->company->phone); ?></a> &nbsp;&nbsp;
                                    <?php }?> 
                                    </div>  

                                    <div class="business-item" itemprop="telephone"> 
                                    <?php if(!empty($this->offer->company->mobile)){ ?>
                                        <i class="icon mobile"></i> <a href="tel:<?php  echo $this->escape($this->offer->company->mobile); ?>"><?php  echo $this->escape($this->offer->company->mobile); ?></a>
                                    <?php } ?>
                                    </div>
                            <?php } ?>
                            <?php if(!empty($this->offer->company->website)){?>
                                    <div class="business-item" itemprop="url">
                                        <a target="_blank" itemprop="url" title="<?php echo $this->escape($this->offer->company->name)?> Website" onclick="jbdUtils.registerStatAction(<?php echo $this->offer->company->id ?>,<?php echo STATISTIC_ITEM_BUSINESS ?>,<?php echo STATISTIC_TYPE_WEBSITE_CLICK ?>)" href="<?php echo $this->escape($this->offer->company->website) ?>"><i class="icon link-square"></i> <?php echo JText::_('LNG_WEBSITE') ?></a>
                                    </div>
                            <?php } ?>
                        </div>
                    <?php } ?>
                </div>
                <?php if ((!empty($this->offer->latitude) && !empty($this->offer->longitude)) || $this->offer->item_type == OFFER_TYPE_PRODUCT) { ?>
                    <div class="col-md-8">
                        <div id="offer-map">
                            <?php require_once 'map.php';?>
                        </div>
                    </div>
                <?php } ?>
            </div>
        </div>

        <?php if ($this->appSettings->enable_reviews && $this->offer->item_type == OFFER_TYPE_OFFER) { ?>
            <div class="row item-section">
        		<div class="col">
                    <?php require_once 'offer_reviews.php';?>
                </div>
             </div>
        <?php } ?>
        
        <div id="offer-dialog" class="jbd-container" style="display: none">    
            <div class="jmodal-sm">
                <div class="jmodal-header">
                    <p class="jmodal-header-title"></p>
                    <a href="#close-modal" rel="modal:close" class="close-btn"><i class="la la-close "></i></a>
                </div>
                <div class="jmodal-body">
                    <div class="dialogContent">
                        <iframe id="offerIfr" height="500" src="about:blank">
                        </iframe>
                    </div>           
                </div>
            </div>        
        </div>
    </div>
    <?php require_once 'offer_util.php'; ?>
    <?php require_once JPATH_COMPONENT_SITE . '/include/bookmark_utils.php'; ?>
</div>