Ejemplo n.º 1
0
 public function run()
 {
     $id = Yii::app()->request->getParam('id');
     $proxy = new BCompany();
     $result = $proxy->deleteCompany($id);
     echo CJSON::encode($result);
 }
Ejemplo n.º 2
0
 public function run()
 {
     $id = Yii::app()->request->getParam('id');
     $name = Yii::app()->request->getParam('name');
     $email = Yii::app()->request->getParam('email');
     $phone = Yii::app()->request->getParam('phone');
     $website = Yii::app()->request->getParam('website');
     $logo = Yii::app()->request->getParam('logo');
     $background = Yii::app()->request->getParam('background');
     $location = Yii::app()->request->getParam('location');
     $hub = Yii::app()->request->getParam('hub');
     $service = Yii::app()->request->getParam('service');
     $facebook = Yii::app()->request->getParam('facebook');
     $linkedin = Yii::app()->request->getParam('linkedin');
     $introduction = Yii::app()->request->getParam('content');
     $data = array('name' => $name, 'email' => $email, 'phone' => $phone, 'website' => $website, 'logo' => $logo, 'background' => $background, 'location' => $location, 'hubId' => $hub, 'serviceid' => $service, 'facebookid' => $facebook, 'linkedinid' => $linkedin, 'introduction' => $introduction);
     $proxy = new BCompany();
     $dp = new BHub();
     $dc = Service::model()->findAll('status!=0');
     if (Yii::app()->request->isAjaxRequest) {
         $result = $proxy->updateCompany($data, $id);
         echo CJSON::encode($result);
     } else {
         $result = $proxy->getCompanyInfo($id);
         $hub = $dp->getHubList($start, 10);
         if ($result['code'] == 200) {
             $this->controller->render('edit', array('data' => $result['data'], 'hub' => $hub['data'], 'service' => $dc));
         } else {
             throw new CHttpException($result['code'], $result['message']);
         }
     }
 }
Ejemplo n.º 3
0
 public function run()
 {
     $start = Yii::app()->request->getParam('start');
     $proxy = new BCompany();
     $result = $proxy->getCompanyList($start, 10);
     $count = $result['count'];
     if (Yii::app()->request->isAjaxRequest) {
         $data = array('recordsTotal' => $count, 'recordsFiltered' => $count, 'data' => $result['data']);
         echo CJSON::encode($data);
     } else {
         $this->controller->render('list', array('count' => $count));
     }
 }
Ejemplo n.º 4
0
 public function run()
 {
     $name = Yii::app()->request->getParam('name');
     $email = Yii::app()->request->getParam('email');
     $phone = Yii::app()->request->getParam('phone');
     $logo = Yii::app()->request->getParam('logo');
     $background = Yii::app()->request->getParam('background');
     $website = Yii::app()->request->getParam('website');
     $location = Yii::app()->request->getParam('location');
     $hub = Yii::app()->request->getParam('hub');
     $service = Yii::app()->request->getParam('service');
     $facebook = Yii::app()->request->getParam('facebook');
     $linkedin = Yii::app()->request->getParam('linkedin');
     $introduction = Yii::app()->request->getParam('introduction');
     $data = array('name' => $name, 'email' => $email, 'phone' => $phone, 'website' => $website, 'logo' => $logo, 'background' => $background, 'location' => $location, 'hubId' => $hub, 'serviceid' => $service, 'facebookid' => $facebook, 'linkedinid' => $linkedin, 'introduction' => $introduction);
     $proxy = new BCompany();
     $result = $proxy->createCompany($data);
     if ($result['code'] == 200) {
         $this->controller->redirect('/company/list');
     } else {
         throw new CHttpException($result['code'], $result['message']);
     }
 }