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 => 'safe working at height']) /modules/shopproductbooking/controllers/booking.php 44
30 ProductBookingController::getProductDetails(array(1) [0 => 'safe working at height']) /modules/shopproductbooking/classes/shopproductbooking_module.php 33
29 ShopProductBooking_Module->get_product_option_matrix_property(array(4) [product => object(Shop_Product), options => array(0), property_name => 'x_remote_booking_delay', value => null])
28 call_user_func_array(array(2) [0 => object(ShopProductBooking_Module), 1 => 'get_product_option_matrix_property'], array(1) [0 => array(4)]) /phproad/system/class_functions.php 18
27 callFunction(array(2) [0 => object(ShopProductBooking_Module), 1 => 'get_product_option_matrix_property'], array(1) [0 => array(4)]) /phproad/modules/phpr/classes/phpr_events.php 85
26 Phpr_Events->fire_event(array(2) [name => 'shop:onGetProductOptionMatrixProperty', type => 'filter'], array(4) [product => object(Shop_Product), options => array(0), property_name => 'x_remote_booking_delay', value => null])
25 call_user_func_array(array(2) [0 => object(Phpr_Events), 1 => 'fire_event'], array(2) [0 => array(2), 1 => array(4)]) /phproad/modules/phpr/classes/phpr_extensible.php 159
24 Phpr_Extensible->__call('fire_event', array(2) [0 => array(2), 1 => array(4)]) /modules/shop/models/shop_product.php 3775
23 Backend_Events->fire_event(array(2) [name => 'shop:onGetProductOptionMatrixProperty', type => 'filter'], array(4) [product => object(Shop_Product), options => array(0), property_name => 'x_remote_booking_delay', value => null]) /modules/shop/models/shop_product.php 3775
22 Shop_Product->om('x_remote_booking_delay') /modules/cms/classes/cms_controller.php(383) : eval()'d code 2
21 eval(()) /modules/cms/classes/cms_controller.php 383
20 Cms_Controller->evalWithException('?><?php $bookingDelay = $product->om('x_remote_booking_delay'); if($bookingDelay === 0) { echo "<a href='/same-day-tool-hire/' class='same-day-loading'><img src='/themes/nthsv3/resources/images/d_headers/NTH-banners-sameday-strip.jpg' alt='Same-Day Tool Hire' title='Same-Day Tool Hire' loading='eager'></a>"; } ?>', 'CMS partial', 'product_card_banners', array(1) [product => object(Shop_Product)]) /modules/cms/classes/cms_controller.php 1020
19 Cms_Controller->render_partial('product_card_banners', array(1) [product => object(Shop_Product)]) /modules/cms/classes/cms_controller.php(383) : eval()'d code 11
18 eval(()) /modules/cms/classes/cms_controller.php 383
17 Cms_Controller->evalWithException('?><div class="five mobile-four columns"> <div class="desc"> <h2 style="font-size: 1.9em; margin-bottom: 1px; margin-top: 0;"> <a href="<?php echo $product->page_url('/product'); ?>/" data-gtm="Product Name (C)" style="color: #404040; "><?php echo h($product->name); ?></a> </h2> <p class="context"><?= ($product->x_context) ?></p> <?php if($product->list_reviews()->count > 20): ?> <div class="rating-<?php echo str_replace('.', '-', $product->rating_approved); ?>" style="margin: 1em 0;"> </div> <?php endif ?> <div class="catbul"><?php echo $product->x_bullets; ?></div> <?php $this->render_partial('product_card_banners', array('product' => $product)); ?> </div> </div>', 'CMS partial', 'product_card_header', array(1) [product => object(Shop_Product)]) /modules/cms/classes/cms_controller.php 1020
16 Cms_Controller->render_partial('product_card_header', array(1) [product => object(Shop_Product)]) /modules/cms/classes/cms_controller.php(383) : eval()'d code 29
15 eval(()) /modules/cms/classes/cms_controller.php 383
14 Cms_Controller->evalWithException('?><!-- <?php if( isset($paginate) && $paginate ) { $page_index = isset($page_index) ? $page_index-1 : 0; $records_per_page = isset($records_per_page) ? $records_per_page : 48; $pagination = $products->paginate($page_index, $records_per_page); } else { $pagination = null; } $products = $products instanceof Db_ActiveRecord ? $products->find_all() : $products; ?> --> <?php $foundit = 0 ; foreach ($products as $product){ if($product->x_bookpay == 123){ $foundit = 1 ; } } if(empty($foundit)) return ; ?> <?php $i = 0; foreach ($products as $product): ?> <?php if($product->x_bookpay == 123): ?> <div style="margin-bottom: 2em;" class="product-list-item"> <div class="twelve columns" style="height: 100%; margin-bottom: 2em; padding:1.5em 1.5em 0; min-height: 320px;"> <?php $this->render_partial('product_card_image', array('product' => $product)); ?> <?php $this->render_partial('product_card_header', array('product' => $product)); ?> <div class="four mobile-four columns"> <div class="product-mobile"> <?php $this->render_partial('product_card_banners', array('product' => $product)); ?> <div class="catbul"><?php echo $product->x_bullets; ?></div> </div> <div class="row desc"> <div class="twelve mobile-four columns product-price-wrap"> <span class="price">Our Price From: </span><span class="price"> <? if ($product->om('price') != 0.00): ?><?php echo format_currency($product->om('sale_price')); ?><? else: ?>POA<? endif; ?></span> </div> </div> <div class="twelve mobile-four columns ticks"> <p style="font-size: 1.1em; margin: 1em 0;">&nbsp;<i class="fas fa-check" style="color: #00b67A;"></i>&nbsp;&nbsp;Great Availability<br class="hide-for-small"/> <span>&nbsp;<i class="fas fa-check" style="color: #00b67A;"></i>&nbsp;&nbsp;Groups or Singles</span> <span class="hide-for-small">&nbsp;<i class="fas fa-check" style="color: #00b67A;"></i>&nbsp;&nbsp;100's of Locations</span> </p> </div> <? $productUrl = $product->page_url('/product') . '/'; if(!$product->has_om_records()) { $productUrl .= (strpos($productUrl, '?') ? '&' : '?') . 'booking_modal_show=1'; } ?> <div class="row"> <!--<div class="twelve mobile-four columns"> <a href="<?php echo $productUrl ?>" data-gtm="Button: Book & Pay Online (C)" title="Book &amp; Pay Online" class="button expand quotebutton" style="background-color: #00b67A; margin-bottom: 0.5em; 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="Button: Course Detail (C)" title="Course Detail" class="button expand quotebutton">Course Detail</a> </div> </div> <div class="row"> <div class="twelve columns" style="text-align: center; padding-top: 1em; color: #808080;"> <p style="color:#002B41;"><i class="fas fa-map-marker-alt"></i>&nbsp;&nbsp;Nationwide Training Centres</br> </p> </div> </div> </div> </div> </div> <?php endif; ?> <?php endforeach; ?> ', 'CMS partial', 'shop:product_list_training_21_2_row', array(6) [products => object(Shop_Product), class => 'three mobile-two', records_per_page => '80', paginate => '1', pagination_base_url => '/category/training', page_index => 'training']) /modules/cms/classes/cms_controller.php 1020
13 Cms_Controller->render_partial('shop:product_list_training_21_2_row', array(6) [products => object(Shop_Product), class => 'three mobile-two', records_per_page => '80', paginate => '1', pagination_base_url => '/category/training', page_index => 'training'], 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 249
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', 'Training') /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 => 'training']) /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/training') /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