Unhandled Error!

Division by zero

Document /phproad/modules/phpr/classes/phpr_pagination.php
Document type PHP document
Line 69
Exception class Phpr_PhpException

Code Highlight

		/**
		 * Evaluates the number of pages for the page size and row count specified in the object properties.
		 * @return integer
		 */
		private function evaluatePageCount( $PageSize, $RowCount )
		{
			$result = ceil($RowCount/$PageSize);
 
			if ( $result == 0 )
				$result = 1;
 
			return $result;
		}
# Call Stack Code Document Line
15 Phpr_Pagination->evaluatePageCount('lsk603757907effb5.63698099', '11') /phproad/modules/phpr/classes/phpr_pagination.php 171
14 Phpr_Pagination->setRowCount('11') /phproad/modules/db/classes/db_activerecord.php 2498
13 Db_ActiveRecord->paginate(-1, 'lsk603757907effb5.63698099') /modules/cms/classes/cms_controller.php(383) : eval()'d code 65
12 eval(()) /modules/cms/classes/cms_controller.php 383
11 Cms_Controller->evalWithException('?><? $this->render_partial('header'); ?> <!-- Additional Header elements --> <? $this->render_head(); ?> </head> <body> <? $this->render_partial('pageheader'); ?> <div id="hero"> <div class="wrap"><img src="<?= theme_resource_url('images/hero-content.jpg'); ?>" width="1000" height="108" /></div> </div><!-- #hero --> <div id="main"> <div class="wrap"> <div id="content" class="left"> <div class="left-side left"> <? $this->render_partial('left_menu', array('category_url_name' => '')); ?> </div> <div id="mid-content"> <? $brand = $this->request_param(0, 0); $keyword = $this->request_param(1, 0); $page_index = $this->request_param(2, 0); $records_per_page = $this->request_param(3, 0); $where = ''; $heading_text = "Search Results"; if ($brand && $brand != 'any') { $heading_text .= " | brand \"$brand\""; $categories = Shop_Category::create()->where("shop_categories.name LIKE '$brand'")->find_all(); if ($categories) { $ids = array(); foreach($categories as $c) $ids[] = $c->id; $sub_cats = get_sub_categories($categories); if (!empty($sub_cats)) { foreach($sub_cats as $cat) $ids[] = $cat->id; } if (!empty($ids)) $where = " (shop_categories.id IN (".implode(',',$ids)."))"; } } if ($keyword) { if ($where != "") $where .= " AND (shop_products.name LIKE '%$keyword%' OR shop_products.description LIKE '%$keyword%' OR shop_products.sku LIKE '%$keyword%' OR shop_option_matrix_records.sku LIKE '%$keyword%')"; else $where = "shop_products.name LIKE '%$keyword%' OR shop_products.description LIKE '%$keyword%' OR shop_products.sku LIKE '%$keyword%' OR shop_option_matrix_records.sku LIKE '%$keyword%' OR shop_categories.name LIKE '%$keyword%'"; $heading_text .= " | keyword \"$keyword\""; } $products = Shop_Product::create() ->apply_filters() ->join('shop_products_categories', 'shop_products_categories.shop_product_id = shop_products.id', "", 'inner') ->join('shop_categories', 'shop_categories.id = shop_products_categories.shop_category_id', "", 'inner') ->join('shop_option_matrix_records', 'shop_option_matrix_records.product_id = shop_products.id') ->order('shop_products.name'); if ($where) $products->where($where); $products->group("shop_products.id"); $page_index = isset($page_index) ? $page_index-1 : 0; $records_per_page = isset($records_per_page) && $records_per_page ? $records_per_page : 5; $pagination = $products->paginate($page_index, $records_per_page); $products = $products instanceof Db_ActiveRecord ? $products->find_all() : $products; $num_of_products = count($products); ?> <div class="product_list left"> <div class="breadcrumb">Search Results</div> <h1 class="page_header"><?=$heading_text?></h1> <? $this->render_partial('product_listing_with_pagination', array( 'products' => $products, 'num_of_products'=> $num_of_products, 'pagination'=>$pagination, 'pagination_base_url'=> root_url("search/$brand/$keyword"), 'records_per_page'=>$records_per_page )); ?> </div> </div><!-- #content --> <div id="sidebar" class="right"> <? $this->render_partial('button_links');?> <? $this->render_partial('compare_list');?> <? $this->render_partial('newsletter_form');?> </div><!-- #sidebar --> <div class="clear"></div> </div> </div><!-- #main --> <? $this->render_partial('footer'); ?>', 'CMS page', 'Search Results') /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(4) [0 => 'any', 1 => 'sv maps', 2 => 'lsk60375719f0a984.48474743', 3 => 'lsk603757907effb5.63698099']) /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('/search/any/sv maps/lsk60375719f0a984.48474743/lsk603757907effb5.63698099') /phproad/system/phproad.php 31
2 include('/home/everests/public_html/phproad/system/phproad.php') /boot.php 114
1 require_once('/home/everests/public_html/boot.php') /index.php 12