public function run() { $id = Yii::app()->request->getParam('id'); $type = Yii::app()->request->getParam('type'); $userId = Yii::app()->request->getParam('userId'); $hub = Yii::app()->request->getParam('hub'); $startTime = Yii::app()->request->getParam('startTime'); $endTime = Yii::app()->request->getParam('endTime'); $room = Yii::app()->request->getParam('room'); $data = array('type' => $type, 'userId' => $userId, 'hubId' => $hub, 'startTime' => $startTime, 'endTime' => $endTime, 'conferenceroomId' => $room); $proxy = new BReservation(); $dc = new BConference(); $dp = new BHub(); if (Yii::app()->request->isAjaxRequest) { $result = $proxy->updateReservation($data, $id); echo CJSON::encode($result); } else { $result = $proxy->getReservationInfo($id); $hub = $dp->getHubList($start, 10); $room = $dc->getRoomList($start, 10); if ($result['code'] == 200) { $this->controller->render('edit', array('data' => $result['data'], 'hub' => $hub['data'], 'room' => $room['data'])); } else { throw new CHttpException($result['code'], $result['message']); } } }
public function run() { $id = Yii::app()->request->getParam('id'); $proxy = new BConference(); $result = $proxy->deleteRoom($id); echo CJSON::encode($result); }
public function run() { $start = Yii::app()->request->getParam('start'); $proxy = new BConference(); $dp = new BHub(); $result = $proxy->getRoomList($start, 10); $hub = $dp->getHubList($start, 10); $this->controller->render('edit', array('room' => $result['data'], 'hub' => $hub['data'])); }
public function run() { $start = Yii::app()->request->getParam('start'); $proxy = new BConference(); $result = $proxy->getRoomList($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'); } }
public function run() { $name = Yii::app()->request->getParam('name'); $hub = Yii::app()->request->getParam('hub'); $price = Yii::app()->request->getParam('price'); $seats = Yii::app()->request->getParam('seats'); $floor = Yii::app()->request->getParam('floor'); $background = Yii::app()->request->getParam('background'); $data = array('name' => $name, 'hubId' => $hub, 'price' => $price, 'seats' => $seats, 'floor' => $floor, 'picture' => $background); $proxy = new BConference(); $result = $proxy->createRoom($data); if ($result['code'] == 200) { $this->controller->redirect('/room/list'); } else { throw new CHttpException($result['code'], $result['message']); } }
public function run() { $id = Yii::app()->request->getParam('id'); $name = Yii::app()->request->getParam('name'); $hub = Yii::app()->request->getParam('hub'); $price = Yii::app()->request->getParam('price'); $seats = Yii::app()->request->getParam('seats'); $floor = Yii::app()->request->getParam('floor'); $background = Yii::app()->request->getParam('background'); $data = array('name' => $name, 'hubId' => $hub, 'price' => $price, 'seats' => $seats, 'floor' => $floor, 'picture' => $background); $proxy = new BConference(); $dp = new Hubs(); if (Yii::app()->request->isAjaxRequest) { $result = $proxy->updateRoom($data, $id); echo CJSON::encode($result); } else { $hub = $dp->getHub(); $result = $proxy->getRoomInfo($id); $this->controller->render('edit', array('data' => $result['data'], 'hub' => $hub)); } }