PHP notice

Undefined index: tahun

/var/www/html/protected/controllers/SiteController.php(594)

582                     $mat = new StdClass;
583                     $mat->result = [];
584 
585                     $provinces = Province::model()->findAll();
586 
587                     foreach($provinces as $province){
588 
589                         $q = Yii::app()->db->createCommand()
590                         ->select('COALESCE(SUM(volume),0) AS total_volume')
591                         ->from('app_mat_pairwise')
592                         ->where('prov_tujuan=:tujuan AND tahun=:tahun', array(
593                             ':tujuan'=>$province->name,
594                             ':tahun'=>$_GET['tahun']
595                             // ':komoditas'=>$_GET['komoditas']
596                         ))
597                         ->queryRow();
598 
599                         // $mat->komoditas = $_GET['komoditas'];
600                         $mat->result[] = array(
601                             'vol'=>$q['total_volume'],
602                             'name'=>$province->name,
603                             'coord'=>array('lat'=>$province->lat, 'lng'=>$province->lng)
604                         );
605                     }
606                 }

Stack Trace

#0
+
 /var/www/html/protected/controllers/SiteController.php(321): SiteController->htmlKonsumsi(array(array("komoditas" => null)))
316                     $content = $this->htmlProduksi($groups);
317                 }
318                 break;
319 
320                 case "konsumsi":{
321                     $content = $this->htmlKonsumsi($groups);
322                 }
323                 break;
324 
325                 case "pergerakan":{
326                     $content = $this->htmlPergerakan($groups);
#10
+
 /var/www/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-28 08:43:27 Apache/2.4.29 (Ubuntu) Yii Framework/1.1.14