/**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return MapFloorPlan the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = MapFloorPlan::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
 /**
  * @return string the Floor Num
  */
 public function getFloorNum($fid)
 {
     $MapFloorPlanRecord = MapFloorPlan::model()->findByAttributes(array('id' => $_GET["fid"]));
     return $MapFloorPlanRecord->floor_num;
 }
 protected function loadFloorPlan($floorId)
 {
     //if the project property is null, create it based on input id
     if ($this->_floorplan === null) {
         $this->_floorplan = MapFloorPlan::model()->findByPk($floorId);
         if ($this->_floorplan === null) {
             throw new CHttpException(404, 'The requested floor plan does not exist.');
         }
     }
     return $this->_floorplan;
 }