PHP warning

Undefined variable $category

/home1/pushpcqz/public_html/pushpagiri.in/themes/user/views/doctor/details.php(55)

43         <div class=" doctorDeatilTxt">
44         <?=$details['description']?>
45         </div>
46         <br />
47         <?
48           $sql="select dept.cat_id from departments dept inner join dep_doctors dd on dd.dep_id = dept.id where dd.doctor_id = '".$details['id']."' group by dept.cat_id";
49           $cat=Yii::app()->db->createCommand($sql)->queryAll();
50           foreach($cat as $c){
51             $category[] =  $c['cat_id'];
52           }
53           
54         ?>
55         <? if (in_array("2", $category) || in_array("3", $category) ){?>
56         <a href="<?=Yii::app()->params['site_url']?>appointment" id="bookAnAppointmentBtn" name="" class="<?php if(isset($_SESSION['color'])){ if($_SESSION['color']=='R'){?>bookAnAppointmentBtn-red<?php }else if($_SESSION['color']=='G'){?>bookAnAppointmentBtn-green<?php }else{?>bookAnAppointmentBtn <?php }}else{?>bookAnAppointmentBtn<?}?>" id="subPageGalleryHeader">Book Appointment</a>
57         <? }?>
58       </div>
59     </div>
60   </div>
61 </section>
62 <section class="subPageGallery1" >
63   <div class="container doctorDetails">
64     <div class="row">
65       <h3 class="<?php if(isset($_SESSION['color'])){ if($_SESSION['color']=='R'){?>subPageGalleryHeader-red<?php }else if($_SESSION['color']=='G'){?>subPageGalleryHeader-green<?php }else{?>subPageGalleryHeader <?php }}else{?>subPageGalleryHeader<?} ?> ?>" id="subPageGalleryHeader">Our<span class="subPageGalleryHeader1"> Doctors</span></h3>
66       <div class="owl-carousel sub-team-carousel">
67           <? foreach($othdoc as $key=>$val){?>

Stack Trace

#4
+
 /home1/pushpcqz/public_html/pushpagiri.in/protected/controllers/DoctorController.php(106): CController->render("details", array("details" => Doctor, "othdoc" => array(), "department_data" => array(null)))
101         }
102         $deptid = rtrim($deptid,',');
103         $sql="select dp.title as dept_title,t.* from doctors t left join dep_doctors D on D.doctor_id=t.id join departments dp on D.dep_id = dp.id  where t.status='1' and t.id <> '$id' and D.dep_id in ('$deptid')";
104         $othdoc=Yii::app()->db->createCommand($sql)->queryAll();
105         
106         $this->render("details",array('details'=>$details,'othdoc'=>$othdoc,'department_data'=>$department_data));  
107     }
108     
109     public function actionList($keyword=null,$depid=null,$docid=null)
110     {
111         $this->layout="subpage";
#14
+
 /home1/pushpcqz/public_html/pushpagiri.in/index.php(12): CApplication->run()
07 defined('YII_DEBUG') or define('YII_DEBUG',true);
08 // specify how many levels of call stack should be shown in each log message
09 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
10 
11 require_once($yii);
12 Yii::createWebApplication($config)->run();
13 
14 
15 
16 
2024-03-19 11:06:28 Apache Yii Framework/1.1.14