public function indexAction() { $code = "fdUserBookmark"; $usersNs = new Zend_Session_Namespace("members"); $mapId1 = $usersNs->userId; $model = new Security_Model_SystemMapping(); /*---sorting ----*/ $order = trim($this->_getParam('order', "")); $col = trim($this->_getParam('col', "")); if ($order != "" && $col != "") { if ($col == "master_value") { $strOrderBy = "sm.master_value {$order}"; } else { if ($col == "map_id3") { $strOrderBy = "s.map_id3 {$order}"; } } } else { $strOrderBy = "s.map_id3"; } $this->view->sortOptions = array(); /*-----sorting----------*/ $where = "s.map_id1='{$mapId1}' and s.map_code='{$code}'"; $this->view->linkArray = array(); $this->view->search = ""; $page_size = Zend_Registry::get('page_size'); $page = $this->_getParam('page', 1); $table = $model->getMapper()->getDbTable(); $select = $table->select()->setIntegrityCheck(false)->from(array("sm" => 'system_master'), array("master_value"))->join(array("s" => "system_mapping"), "s.map_code='fdUserBookmark' and s.map_id1='{$mapId1}' and sm.master_code='fdMenu' and sm.master_id=s.map_id2", array("map_id1" => 'map_id1', "map_id2" => 'map_id2', "map_id3" => 'map_id3'))->group("s.map_id2")->order($strOrderBy); $paginator = Base_Paginator::factory($select); $paginator->setItemCountPerPage($page_size); $paginator->setCurrentPageNumber($page); $this->view->totalItems = $paginator->getTotalItemCount(); $this->view->paginator = $paginator; }
public function getLegendsValue($legend_id, $status = 1) { $model = new Security_Model_SystemMapping(); $table = $model->getMapper()->getDbTable(); $select = $table->select()->setIntegrityCheck(false)->from(array("a" => 'system_mapping'), array('map_code', 'group_id' => 'map_id1', 'legend_value_id' => 'map_id2'))->join(array("b" => 'system_master'), "a.map_id2=b.master_id and b.master_code='fdLegendsVal'", array('legend_value_title' => 'master_value', 'master_code'))->where("a.status='{$status}' and a.map_code='fdLegendsLegendsValMap' and a.map_id1='{$legend_id}'"); //echo $select->__toString(); exit; return $table->fetchAll($select); }
public function getRoles($sub_group_id,$status=1) { $model=new Security_Model_SystemMapping(); $table=$model->getMapper()->getDbTable(); $select = $table->select()->setIntegrityCheck(false)->from(array("a"=>'system_mapping'), array('map_code','sub_group_id'=>'map_id1','role_id'=>'map_id2')) ->join(array("b"=>'system_master'),"a.map_id2=b.master_id and b.master_code='fdUserRole'" ,array('role_title'=>'master_value', 'master_code')) ->where("a.status='{$status}' and a.map_code='fdSubGroupRoleMap' and a.map_id1='$sub_group_id'"); return $table->fetchAll($select); }
public function getAnimalColors($animal_id, $animal_type_id, $status = 1) { $subSQL = " and a.map_id1='{$animal_id}' and a.map_id2='{$animal_type_id}'"; if ($animal_type_id == "All") { $subSQL = ""; } $model = new Security_Model_SystemMapping(); $table = $model->getMapper()->getDbTable(); $select = $table->select()->setIntegrityCheck(false)->from(array("a" => 'system_mapping'), array('map_code', 'animal_type_id' => 'map_id2', 'animal_color_id' => 'map_id3'))->join(array("b" => 'system_master'), "a.map_id3=b.master_id and b.master_code='fdAnimalColor'", array('animal_color_title' => 'master_value', 'master_code'))->where("a.status='{$status}' and a.map_code='fdAnimalAnimalTypeAnimalColorMap' {$subSQL}"); return $table->fetchAll($select); }
public function dashboardAction() { //Start Dashboard bookmark listing $code1 = "fdUserBookmark"; $usersNs = new Zend_Session_Namespace("members"); $mapId1 = $usersNs->userId; $model = new Security_Model_SystemMapping(); $strOrderBy = "s.map_id3"; $this->view->sortOptions = array(); $this->view->linkArray = array(); $table = $model->getMapper()->getDbTable(); $select = $table->select()->setIntegrityCheck(false)->from(array("sm" => 'system_master'), array("master_value", "strval1", "strval3"))->join(array("s" => "system_mapping"), "s.map_code='{$code1}' and s.map_id1='{$mapId1}' and sm.master_code='fdMenu' and sm.strval1!='' and sm.master_id=s.map_id2", array("map_id1" => 'map_id1', "map_id2" => 'map_id2', "map_id3" => 'map_id3'))->group("s.map_id2")->order($strOrderBy); $this->view->bookmarks = $table->fetchAll($select); //End Dashboard bookmark listing //start dashboard Widgets $code2 = "fdWidget"; $model = new Security_Model_SystemMaster(); $table2 = $model->getMapper()->getDbTable(); $select = $table2->select()->setIntegrityCheck(false)->from(array("s" => 'system_master'), array("master_value"))->join(array("sm" => "system_mapping"), "sm.map_code='{$code2}' and sm.map_id1='{$mapId1}' and s.master_code=sm.map_code and s.master_id=sm.map_id2 and sm.intval1=1", array("master_id" => 'map_id2', "intval1" => 'intval1', "intval2" => 'intval2'))->order("sm.map_id3"); $this->view->widgets = $table2->fetchAll($select); //End widgets listing $this->view->pageHeading = "Dashboard"; }