Unhandled Error!

Undefined index: HTTP_REFERER

Document /modules/shopproductbooking/controllers/booking.php
Document type PHP document
Line 163
Exception class Phpr_PhpException

Code Highlight

        $bookingDomain = Phpr::$config->get("BOOKING_FORM_DOMAIN",
            "booking." . str_replace("www.", "", $_SERVER['HTTP_HOST'])
        );
        if($dev = Phpr::$request->getField('dev_domain')) {
            $bookingDomain = str_replace("booking", "booking-$dev", $bookingDomain);
        }
        elseif(preg_match('/(?<=dev_domain=)[a-z]+/', $_SERVER['HTTP_REFERER'], $matches)) {
            $bookingDomain = str_replace("booking", "booking-{$matches[0]}", $bookingDomain);
        }
        return $bookingDomain;
    }
 
	public function getRemoteBookingForm() {
# Call Stack Code Document Line
32 ProductBookingController::getBookingDomain(()) /modules/shopproductbooking/controllers/booking.php 88
31 ProductBookingController::getRemoteProductDetails(array(1) [0 => '040070']) /modules/shopproductbooking/controllers/booking.php 44
30 ProductBookingController::getProductDetails(array(1) [0 => '040070']) /modules/shopproductbooking/classes/shopproductbooking_module.php 58
29 ShopProductBooking_Module->after_product_fetch(object(Shop_Product))
28 call_user_func_array(array(2) [0 => object(ShopProductBooking_Module), 1 => 'after_product_fetch'], array(1) [0 => object(Shop_Product)]) /phproad/system/class_functions.php 18
27 callFunction(array(2) [0 => object(ShopProductBooking_Module), 1 => 'after_product_fetch'], array(1) [0 => object(Shop_Product)]) /phproad/modules/phpr/classes/phpr_events.php 79
26 Phpr_Events->fire_event(array(1) [name => 'shop:onAfterProductRecordFetch'], object(Shop_Product))
25 call_user_func_array(array(2) [0 => object(Phpr_Events), 1 => 'fire_event'], array(2) [0 => array(1), 1 => object(Shop_Product)]) /phproad/system/class_functions.php 18
24 callFunction(array(2) [0 => object(Phpr_Events), 1 => 'fire_event'], array(2) [0 => array(1), 1 => object(Shop_Product)]) /phproad/modules/phpr/classes/phpr_events.php 153
23 Phpr_Events->fireEvent('shop:onAfterProductRecordFetch', object(Shop_Product))
22 call_user_func_array(array(2) [0 => object(Phpr_Events), 1 => 'fireEvent'], array(2) [0 => 'shop:onAfterProductRecordFetch', 1 => object(Shop_Product)]) /phproad/modules/phpr/classes/phpr_extensible.php 159
21 Phpr_Extensible->__call('fireEvent', array(2) [0 => 'shop:onAfterProductRecordFetch', 1 => object(Shop_Product)]) /modules/shop/models/shop_product.php 1861
20 Backend_Events->fireEvent('shop:onAfterProductRecordFetch', object(Shop_Product)) /modules/shop/models/shop_product.php 1861
19 Shop_Product->after_fetch(()) /phproad/modules/db/classes/db_activerecord.php 444
18 Db_ActiveRecord->_find_fill(array(3) [0 => array(138), 1 => array(138), 2 => array(138)], null) /phproad/modules/db/classes/db_activerecord.php 540
17 Db_ActiveRecord->find_all_internal(null, array(0), null) /phproad/modules/db/classes/db_activerecord.php 559
16 Db_ActiveRecord->find_all(()) /modules/cms/classes/cms_controller.php(383) : eval()'d code 2
15 eval(()) /modules/cms/classes/cms_controller.php 383
14 Cms_Controller->evalWithException('?><?php $products = $products instanceof Db_ActiveRecord ? $products->find_all() : $products; ?> <?php $foundit = 0 ; foreach ($products as $product){ if($product->x_bookpay <= 1 or $product->x_bookpay >= 200){ $foundit = 1 ; } } if(empty($foundit)) return ; ?> <div class="row"> <?php foreach ($products as $product): ?> <?php if($product->x_bookpay <= 1 or $product->x_bookpay >= 200): ?> <div class="four columns" style="margin: 1em auto; height: 100%; min-height: 400px;"> <div class="images" style="border: 1px solid #404040; text-align: center; padding: 1em; min-height: 360px;"> <div class="desc"> <h3 style="font-size: 1.5em;"> <a href="<?php echo $product->page_url('/product'); ?>/" data-gtm="Popular: <?php echo h($product->name); ?> (C)" style="color: #404040;"><?php echo h($product->name); ?></a> </h3> <p class="hide-for-small" style="padding: 0 1em 1em; margin: 0; min-height: 2.2em;"><?= ($product->x_context) ?></p> </div> <div> <span><p>DIY &amp; Trade&nbsp;&nbsp;|&nbsp;&nbsp; <?php if($product->om('is_on_sale')): ?> <span style="color: #c8102e">Save <?php $sale_price_or_discount = $product->om('x_remote_discount') ?: $product->om('sale_price_or_discount'); if(strpos($sale_price_or_discount, '%')) { echo round($sale_price_or_discount); echo "&#37;"; } else { echo format_currency(ltrim($sale_price_or_discount, '-')); } ?> <?php endif; ?></span>&nbsp;&nbsp;|&nbsp;&nbsp;Best Availability </span> </div> <a href="<?php echo $product->page_url('/product'); ?>/" data-gtm="Popular: <?php echo h($product->name); ?> (C)" style="padding: 0.5em;"> <?php $images = $product->om('images'); ?> <?php if($images->count): ?> <img class="primary" loading="lazy" style="display: block; margin-left: auto; margin-right: auto;" src="<?php echo $images[0]->getThumbnailPath(260, 260); ?>" title="<?php echo $product->name; ?>" alt="<?php echo $product->name; ?>" width="100%" height="100%" /> <?php endif; ?> </a> <?php $days1Multiplier = 0.6; $percentages = $product->om('x_remote_percentages'); if($percentages && !empty($percentages['days_1'])) { $days1Multiplier = $percentages['days_1']/100; } ?> <div class="row desc" style="margin: 1em;"> <div class="six mobile-two columns" style=""> <span class="price">Average UK Price</span><span class="base" style="color: #c8102e; font-size: 1.2em; font-weight: 700; text-decoration: line-through;"> <? if ($product->x_weekly_only != 1): ?> <?php echo format_currency($product->om('x_remote_price')*$days1Multiplier); ?> <? else: ?> <?php echo format_currency($product->om('x_remote_price')); ?> <? endif; ?> </span> </div> <div class="six mobile-two columns"> <span class="price">Our Price From</span><span class="price" style="color: #0058aa; font-size: 1.2em; font-weight: 700;"> <? if ($product->x_weekly_only != 1): ?> <?php echo format_currency($product->om('x_remote_sale_price')*$days1Multiplier); ?> <? else: ?> <?php echo format_currency($product->om('x_remote_sale_price')); ?> <? endif; ?> </span> </div> </div> <div class="row"> <!--<div class="three columns hide-for-small" style="padding: 0 0 0 1em;"> <a href="<?php echo $product->page_url('/product'); ?>/" title="More" class="button expand quotebutton" style="border-radius: 1em; border: 1px solid #0058aa; background-color: white; margin-bottom: 0; color: #0058aa !important;">More</a> </div> <div class="twelve columns"> <a href="<?php echo $product->page_url('/product'); ?>/" data-gtm="Popular: <?php echo h($product->name); ?> (C)" title="Book &amp; Pay Online" class="button expand quotebutton" style="background-color: #00b67A; margin-bottom: 0; border-radius: 0.5em; font-size: 1.1em; "><i class="fas fa-calendar-alt"></i>&nbsp; Book &amp; Pay Online</a> </div>--> <div class="twelve mobile-four columns"> <a href="<?php echo $product->page_url('/product'); ?>/" data-gtm="Popular: <?php echo h($product->name); ?> (C)" title="Details &amp; Booking" class="button expand quotebutton"><i class="fas fa-calendar-alt"></i>&nbsp;&nbsp; Details &nbsp;&amp;&nbsp; Booking</a> </div> </div> <div class="row"> <div class="twelve columns" style="text-align: center; padding-top: 1em; color: #808080;"> <p> <i class="fas fa-truck"></i> <?php if($product->om('x_allow_delivery') > 0 && $product->om('x_min_delivery_charge') > 0) { echo "&nbsp;&nbsp;<span style='font-weight: 700;'>Low Cost</span> Delivery"; } elseif ($product->om('x_allow_delivery') > 0 && $product->om('x_min_delivery_charge') < 1) { echo "&nbsp;&nbsp;<span style='font-weight: 700;'>FREE</span> Delivery"; } ?> </p> </div> </div> </div></div> <?php endif; ?> <?php endforeach; ?> </div> ', 'CMS partial', 'shop:product_list_popular_products', array(1) [products => object(Shop_Product)]) /modules/cms/classes/cms_controller.php 1020
13 Cms_Controller->render_partial('shop:product_list_popular_products', array(1) [products => object(Shop_Product)], array(4) [cache => '1', cache_vary_by => array(1), cache_versions => array(1), cache_ttl => '86400']) /modules/cms/classes/cms_controller.php(383) : eval()'d code 154
12 eval(()) /modules/cms/classes/cms_controller.php 383
11 Cms_Controller->evalWithException('?><section class="content" style="padding:0px;"> <section class="category <?php echo $category->url_name; ?>"> <div class="row"> <!--<div class="two columns"> <? foreach ($category->images as $image): ?> <img src="<?= $image->getThumbnailPath(400, 400) ?>"/> <? endforeach ?> </div>--> <div class="twelve columns"> <div id="category-page"> <? if ($category): $subcategories = $category->list_children('front_end_sort_order'); $has_subcategories = $subcategories->count; $has_products = $category->eval_num_of_products(); ?> <? if ($category): ?> <?php $this->render_partial('category_breadcrumb'); ?> <? endif ?> <h1><em><?php if(!empty($category->title)): ?><?= $category->title ?><?php else: ?><?= $category->name ?><?php endif; ?></em></h1> <? if ($category->short_description): ?> <div class="description"> <p class="description" style="font-size: 1.1em;"><?= ($category->short_description) ?></p> </div> <? endif ?> <?php $this->render_partial('free_delivery_cat'); ?> <? if ($has_subcategories): ?> <ul class="product-list"> <? $i=0 ; $showEvery = 4 ; foreach ($subcategories as $subcategory): ?> <?php if( is_int(($i-0) / $showEvery) && $i >0 ): ?> <? $this->render_partial('random_usp_drama') ?> <?php endif ?> <li class="<?php echo isset($class) ? $class : 'four'; ?> columns catcol" style="height: 100%;"> <div class="images" style="border: 0.1em solid #404040; margin: 0.5em; text-align: center; padding: 1em;"> <div class="desc"> <h2 style="font-size: 1.5em;"> <? if(!empty($subcategory->x_catfalse)): ?> <a href="<?= $subcategory->x_catfalse ?>" data-gtm="SubCat Name (C)" title="<?= h($subcategory->name) ?>" class="product-list"><?= h($subcategory->name) ?></a> <? else: ?> <a href="<?= $subcategory->page_url('category') ?>/" data-gtm="SubCat Name (C)" title="<?= h($subcategory->name) ?>" class="product-list"><?= h($subcategory->name) ?></a> <? endif ?> </h2> <div> <? if(!empty($subcategory->x_catfalse)): ?> <a href="<?= $subcategory->x_catfalse ?>" data-gtm="SubCat Image (C)" title="<?= h($subcategory->name) ?>" class="product-list" style="padding: 1em 0;"> <? else: ?> <a href="<?= $subcategory->page_url('category') ?>/" data-gtm="SubCat Image (C)" title="<?= h($subcategory->name) ?>" class="product-list" style="padding: 1em 0;"> <? endif ?> <img class="primary" style="display: block; margin-left: auto; margin-right: auto;" src="<?= $subcategory->image_url(0, 260, 'auto') ?>" title="<?= h($subcategory->name) ?>" width="260" height="260" alt="<?= h($subcategory->name) ?>" loading="eager" max-width="100%" max-height="100%"/> </a> </div> <div class="row"> <div class="twelve columns"> <p class="hide-for-small" style="padding: 0 1em;"><?= ($subcategory->x_catcontext) ?></p> <? if(!empty($subcategory->x_catfalse)): ?> <a href="<?= $subcategory->x_catfalse ?>" data-gtm="Button: View the Range (C)" title="View the Range" class="button expand quotebutton">View the Range</a> <? else: ?> <a href="<?= $subcategory->page_url('category') ?>/" data-gtm="Button: View the Range (C)" title="View the Range" class="button expand quotebutton">View the Range</a> <? endif ?> </div> </div> </li> <?php $i++; ?> <? endforeach ?> </ul> <? endif ?> </div> </div> </div> </section> <? if ($has_subcategories): ?> <? if ($category->description): ?> <section class="category-description"> <div class="row"> <div class="twelve columns"> <div class="description"> <p class="description"> <?= ($category->description) ?> <? if(strpos($_SERVER['REQUEST_URI'], 'power-and-lighting-hire') !== false):?> <?php $this->render_partial('dlink_power_lighting'); ?> <? elseif(strpos($_SERVER['REQUEST_URI'], 'plant-hire') !== false):?> <?php $this->render_partial('dlink_plant'); ?> <? elseif(strpos($_SERVER['REQUEST_URI'], 'powered-access-hire') !== false):?> <?php $this->render_partial('dlink_powered_access'); ?> <? elseif(strpos($_SERVER['REQUEST_URI'], 'cleaning-equipment-hire') !== false):?> <?php $this->render_partial('dlink_cleaning'); ?> <? elseif(strpos($_SERVER['REQUEST_URI'], 'access-equipment-hire') !== false):?> <?php $this->render_partial('dlink_access'); ?> <? elseif(strpos($_SERVER['REQUEST_URI'], 'lifting-equipment-hire') !== false):?> <?php $this->render_partial('dlink_lifting'); ?> <? elseif(strpos($_SERVER['REQUEST_URI'], 'climate-control-hire') !== false):?> <?php $this->render_partial('dlink_climate'); ?> <? elseif(strpos($_SERVER['REQUEST_URI'], 'garden-tool-hire') !== false):?> <?php $this->render_partial('dlink_gardening'); ?> <? elseif(strpos($_SERVER['REQUEST_URI'], 'building') !== false):?> <?php $this->render_partial('dlink_building'); ?> <? endif ?> </p> <p class="description"><?php $this->render_partial('category_qa'); ?></p> </div> </div> </div> </section> <? endif ?> <? if(!empty($category->x_popular_group)): ?> <hr /> <section class="productslatest" style="background-color: #ffffff; margin-bottom: 1em;"> <div class="row"> <div class="twelve columns"> <h2>Popular <?php echo $category->name; ?> Products</h2> <?php $group = Shop_CustomGroup::create()->find_by_code($category->x_popular_group); if($group): ?> <?php $this->render_partial('shop:product_list_popular_products', array( 'products' => $group->list_products() ), array( 'cache'=>true, 'cache_vary_by'=>array('url'), 'cache_versions'=>array('catalog'), 'cache_ttl'=>86400 )); ?> <?php endif; ?> </div> </div> </section> <? endif ?> <? endif ?> <!--<div id="category-products"> <? $this->render_partial('shop:categories') ?> </div>--> <? if (!$has_subcategories && !$has_products): ?> <p>This category does not contain any products or subcategories.</p> <p><a href="<?= root_url('/')?>" title="Return to the home page">Return to the home page</a></p> <? endif ?> <? else: ?> <h1>Category not found</h1> <p>Sorry, the specified category cannot be found.</p> <p><a href="<?= root_url('/')?>" title="Return to the home page">Return to the home page</a></p> <? endif ?> </div> <div class="clearfix"></div> </div> </div> </section> </section> <? if (!$has_subcategories && $has_products): ?> <section class="content category-products"> <section class="category <?php echo $category->url_name; ?>"> <div class="row"> <div class="nine columns"> <div class="product-list-diy-trade"> <?php $this->render_partial('shop:product_list_diy_trade_21_2_row', array( 'products' => $category->list_products(array('sorting'=>array('price desc'))), 'class' => 'four mobile-four', 'records_per_page' => 80, 'paginate'=> true, 'pagination_base_url' => $category->page_url('/category'), 'page_index' => $this->request_param(-1, 0) ), array( 'cache'=>true, 'cache_vary_by'=>array('url'), 'cache_versions'=>array('catalog'), 'cache_ttl'=>86400 )); ?> </div> <div id="product_list" class="product-list-trade-only"> <?php $this->render_partial('shop:product_list_trade_only_21_2_row', array( 'products' => $category->list_products(array('sorting'=>array('price desc'))), 'class' => 'three mobile-two', 'records_per_page' => 80, 'paginate'=> true, 'pagination_base_url' => $category->page_url('/category'), 'page_index' => $this->request_param(-1, 0) ), array( 'cache'=>true, 'cache_vary_by'=>array('url'), 'cache_versions'=>array('catalog'), 'cache_ttl'=>86400 )); ?> </div> <div class="product-list-training"> <!--<div id="product_list">--> <?php $this->render_partial('shop:product_list_training_21_2_row', array( 'products' => $category->list_products(array('sorting'=>array('price desc'))), 'class' => 'three mobile-two', 'records_per_page' => 80, 'paginate'=> true, 'pagination_base_url' => $category->page_url('/category'), 'page_index' => $this->request_param(-1, 0) ), array( 'cache'=>true, 'cache_vary_by'=>array('url'), 'cache_versions'=>array('catalog'), 'cache_ttl'=>86400 )); ?> <!--</div>--> </div> <div class="product-list-sale" id="product_list"> <?php $this->render_partial('shop:product_list_for_sale', array( 'products' => $category->list_products(array('sorting'=>array('price desc'))), 'class' => 'three mobile-two', 'records_per_page' => 80, 'paginate'=> true, 'pagination_base_url' => $category->page_url('/category'), 'page_index' => $this->request_param(-1, 0) ), array( 'cache'=>true, 'cache_vary_by'=>array('url'), 'cache_versions'=>array('catalog'), 'cache_ttl'=>86400 )); ?> </div> <? if ($category->description): ?> <!--<p class="description"><?= ($category->description) ?></p>--> <div class="description"> <?= $category->description ?> <?php $this->render_partial('category_qa'); ?> </div> <? endif ?> <!--<p class="description"><?= ($category->description) ?></p>--> </div> <div class="three columns" style="position: -webkit-sticky; /* Safari */ position: sticky; top: 1rem;"> <?php $this->render_partial('call_free') ?> <div class="twelve columns random-usp"> <?php $this->render_partial('random_usp') ?> </div> <div class="twelve columns random-blog"> <?php $this->render_partial('random_blog') ?> </div> </div> </div> </section> </section> <? endif ?> <?= $this->render_partial('white_diesel_modal') ?> <?= $this->render_partial('insurance_modal') ?>', 'CMS page', 'Cleaning Equipment Hire') /modules/cms/classes/cms_controller.php 608
10 Cms_Controller->eval_page_content(()) /modules/cms/classes/cms_controller.php 198
9 Cms_Controller->open(object(Cms_Page), array(1) [0 => 'cleaning-equipment-hire']) /controllers/application.php 72
8 Application->On404(())
7 call_user_func_array(array(2) [0 => object(Application), 1 => 'On404'], array(0)) /phproad/modules/phpr/classes/phpr_controller.php 170
6 Phpr_Controller->executeAction('On404', array(0)) /phproad/modules/phpr/classes/phpr_controller.php 84
5 Phpr_Controller->_run('On404', array(0)) /phproad/modules/phpr/classes/phpr_response.php 64
4 Phpr_Response->open404(()) /phproad/modules/phpr/classes/phpr_response.php 37
3 Phpr_Response->open('/category/cleaning-equipment-hire') /phproad/system/phproad.php 31
2 include('/var/www/vhosts/nationaltoolhireshops.co.uk/httpdocs/phproad/system/phproad.php') /boot.php 114
1 require_once('/var/www/vhosts/nationaltoolhireshops.co.uk/httpdocs/boot.php') /index.php 23