function doDetail()
 {
     if ($category = $this->request->get('category')) {
         $value = isset($_COOKIE['category_detail'][$category]) ? $_COOKIE['category_detail'][$category] : 0;
         $value = (int) (!$value);
         $this->response->setcookie("category_detail[{$category}]", $value, $value ? time() + 3600 * 24 * 30 : time(), "/");
         if ($this->request->getInteger('js') !== 1) {
             $this->redirect(array('controller' => 'projects', 'action' => 'display'));
         } else {
             if ($value == 1) {
                 $this->view->set('item', Category::findCategory($category));
             } else {
                 $this->response->commit();
                 exit;
             }
         }
     }
 }
Example #2
0
<?php

include 'manager/_pi/base.php';
?>
	<? startblock('section') ?>
  <aside>
   <?php 
include 'manager/includes/side_panel.php';
?>
  </aside>
  <article id=frame_box>
  	<hgroup>
     <? if(isset($_REQUEST['id'])):
			     $category = Category::findCategory($_REQUEST['id']);	?>
     	    <h1><?php 
echo $category->fldCategoryName;
?>
</h1>
     <? else: ?>
          <h1>Products</h1>
     <? endif ?> 
      <hr />
    </hgroup>
     <?
     if(isset($_REQUEST['id'])) {
			$count_record=Products::countProductsByCategory($_REQUEST['id']); 
		 } else {
	   		$count_record=Products::countProducts();
		 }

			if($count_record != 0) {