public function actionIndex() { $model = new CleaningTime(); $list = CleaningTime::model()->findAll(); $cleanDetails = Yii::app()->session['CleaningDetail']; //echo "<pre>";print_r($clean);die; //$zip=ServiceUser::model()->findAll(); $zip = UkPostcodes::model()->findAll(); //echo "<pre>";print_r($zip);die; foreach ($zip as $z) { } $post[] = $z->postcode; $uniquePost = array_unique($post); //code to get the welcome content $welcome = HomeWelcome::model()->find(array('condition' => 'status=1')); $why = WhyUsHome::model()->find(array('condition' => 'status=1')); $Stypes = ServiceTypes::model()->findAll(array('limit' => 3)); $homeImage = HomeImages::model()->findAll(array('condition' => 'status=1')); //echo "<pre>";print_r($homeImage);die; //echo "<pre>";print_r($Stypes);die; $ht = HtuseHome::model()->findAll(array('condition' => 'status=:c', 'limit' => 4, 'params' => array(':c' => 1))); //echo "<pre>";print_r($ht);die; $links = CmsPages::model()->findAll(); Yii::app()->params['MyArray'] = $links; $this->render('index', array('list' => $list, 'model' => $model, 'Post' => $uniquePost, 'wel' => $welcome, 'why' => $why, 'Stypes' => $Stypes, 'homeImage' => $homeImage, 'ht' => $ht, 'cleanDetails' => $cleanDetails)); }
public function actionAjaxHTDeactivate() { $id = $_REQUEST['id']; $rec = HtuseHome::model()->findByPk($id); if ($rec->status == 1) { $rec->status = 0; $rec->save(); } else { $rec->status = 1; $rec->save(); } }