Exemple #1
0
 public function listIdNames($like)
 {
     $select = $this->_db->select();
     $select->from(array('c' => 'mst_counselor'), array('c.id'))->joinLeft(array('d' => 'devotee'), 'c.did=d.did', array())->joinLeft(array('cn' => 'mst_center'), 'cn.id=d.center_id', array('name' => new Zend_Db_Expr("CONCAT(d.display_name, '(', cn.name, ';id-', c.id ,')')")))->where('d.isactive = ?', 'Y')->where($this->_db->quoteInto('d.encoded_search_name LIKE ?', '%' . Rgm_Basics::encodeDiacritics($like) . '%'))->order('d.encoded_search_name');
     $result = $this->_db->fetchAll($select);
     return $result;
 }
Exemple #2
0
 public function listIndentificationInfo($like)
 {
     $search = explode(" ", $like);
     $sqlWhere = "";
     $sql = "SELECT d.did,d.first_name,d.middle_name,d.last_name,d.organization_name,d.display_name,c.name centername, d.pics" . " FROM devotee AS d" . " Left Join mst_center AS c ON d.center_id = c.id";
     $sqlWhere = " where d.contact_type='I' and d.isactive='Y' and d.did<>1";
     /*
     $tmp="";
     for($i=0;$i <count($search);$i++){
         $tmp = $tmp . ($tmp==""?"":" OR ") . $this->_db->quoteInto("d.encoded_search_name LIKE ?", Rgm_Basics::encodeDiacritics($search[$i]) ."%"); 
     }
     if($tmp!=""){
         $sqlWhere = $sqlWhere . " and (" . $tmp . ")";
     }
     */
     $sqlWhere = $sqlWhere . " AND " . $this->_db->quoteInto("d.encoded_search_name LIKE ?", Rgm_Basics::encodeDiacritics($like) . "%");
     $sql = $sql . $sqlWhere . " order by d.encoded_search_name LIMIT 20";
     $results = $this->getAdapter()->fetchAll($sql);
     return $results;
 }
Exemple #3
0
 public function listUsersIds($options = array())
 {
     $defaults = array('searchname' => '', 'searchlogin' => '', 'sortfield' => 'd.encoded_search_name', 'sortorder' => 'ASC');
     $options = array_merge($defaults, $options);
     $select = $this->_db->select();
     $select->from(array('u' => 'mst_user'), array('u.id'))->joinLeft(array('r' => 'mst_user_role'), 'u.role_id = r.id', array())->joinLeft(array('d' => 'devotee'), 'u.did=d.did', array())->joinLeft(array('cn' => 'mst_country'), 'd.country_id = cn.id', array())->joinLeft(array('a' => 'mst_asram'), 'd.asram_status_id = a.id', array())->joinLeft(array('c' => 'mst_center'), 'd.center_id = c.id', array())->joinLeft(array('con' => 'mst_counselor'), 'd.counselor_id = con.id', array())->joinLeft(array('con_dev' => 'devotee'), 'con.did=con_dev.did', array())->joinLeft(array('astcon' => 'mst_astcounselor'), 'd.ast_counselor_id = astcon.id', array())->joinLeft(array('astcon_dev' => 'devotee'), 'astcon.did=astcon_dev.did', array())->joinLeft(array('hg' => 'mst_guru'), 'd.ini_guru_id = hg.id', array())->joinLeft(array('sg' => 'mst_guru'), 'd.sanyas_guru_id = sg.id', array())->joinLeft(array('o' => 'mst_user'), 'u.owner_uid=o.id', array())->joinLeft(array('o_dev' => 'devotee'), 'o.did=o_dev.did', array())->joinLeft(array('e' => 'mst_user'), 'u.entered_by_uid=e.id', array())->joinLeft(array('e_dev' => 'devotee'), 'e.did=e_dev.did', array())->joinLeft(array('m' => 'mst_user'), 'u.modi_by_uid=m.id', array())->joinLeft(array('m_dev' => 'devotee'), 'm.did=m_dev.did', array())->where($this->_db->quoteInto('d.encoded_search_name LIKE ?', '%' . Rgm_Basics::encodeDiacritics($options['searchname']) . '%'))->orWhere($this->_db->quoteInto('u.login LIKE ?', '%' . $options['searchlogin'] . '%'));
     $results = $this->getAdapter()->fetchAll($select);
     return $results;
 }