PHP Error

Trying to get property of non-object

/home/corpgmaxcom/public_html/protected/views/site/pages/product.php(40)

28                                 
29                                 <!--begin right_product_page-->
30                                 <div class="right_product_page">
31                                 
32                                     <div class="brief_product_page">
33                                         <h1><?php echo $model->name; ?></h1>
34                                         <p class="price_product_page">Giá bán: <?php echo (!empty($_SESSION["cus_id"]))?myExt::formatPrice($model->agent_price):myExt::formatPrice($model->price); ?></p>
35                                         <table border="1" style="width: 100%;">
36                                             <tr>
37                                                 <td>Mã sản phẩm</td>
38                                                 <td><?php echo $model->code; ?></td>
39                                                 <td>Hãng sản xuất</td>
40                                                 <td><?php echo $model->brand->name; ?></td>
41                                             </tr>
42                                             <tr>
43                                                 <td>Đơn vị tính</td>
44                                                 <td><?php echo $model->unit; ?></td>
45                                                 <td>Xuất xứ</td>
46                                                 <td><?php echo $model->origin; ?></td>
47                                             </tr>
48                                             <tr>
49                                                 <td>Bảo hành</td>
50                                                 <td><?php echo $model->warranty; ?></td>
51                                                 <td>Khuyến mại</td>
52                                                 <td><?php echo $model->sale; ?></td>

Stack Trace

#4
+
 /home/corpgmaxcom/public_html/protected/controllers/SiteController.php(171): CController->render("pages/product", array("model" => Product))
166         Product::model()->updateByPk($model->id, array('hits' => (($model->hits==0)?1:($model->hits+1))));
167         
168         Seo::getSeo(1);
169         $this->pageTitle = $model->name . '|' . $this->pageTitle;
170         $this->description = $model->name . '|' . $this->description;
171         $this->render('pages/product', array('model' => $model));
172     }
173     
174     /*
175      * receive id of cat to show all it's product
176      */
#14
+
 /home/corpgmaxcom/public_html/index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11 
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
2024-03-29 14:49:19 LiteSpeed Yii Framework/1.1.7