| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/ptcfinance/application/modules/admin/models/ |
Upload File : |
<?php
/***************************************************************
* Catabatic Technology Pvt. Ltd.
* File Name : Faq.php
* File Description : Faq Model
* Created By : Praveen Kumar
* Created Date: 05-September-2014
***************************************************************/
class Admin_Model_Board extends Zend_Db_Table_Abstract
{
function __construct()
{
}
/**
* checkNameExistsOrNot() method is used to get check name exists or not
* @param email string
* @return object
*/
public function checkNameExistsOrNot($name,$board_type)
{
$dbtable = Zend_Db_Table::getDefaultAdapter();
$select = $dbtable->select()
->from("tbl_board_directors",array('count(*) AS total_records'))
->where("name =?",$name)
->where("board_type =?",$board_type);
$result = $dbtable->fetchOne($select);
return $result;
}
/**
* add() method is used to add name
* @param array
* @return true
*/
public function add($addData=array())
{
$dbtable = new Zend_Db_Table('tbl_board_directors');
$dbtable->insert($addData);
}
/**
* checkEditNameExistsOrNot() method is used to get check name exists or not
* @param email string
* @return object
*/
public function checkEditNameExistsOrNot($board_id,$name,$board_type)
{
$dbtable = Zend_Db_Table::getDefaultAdapter();
$select = $dbtable->select()
->from("tbl_board_directors",array('count(*) AS total_records'))
->where("name =?",$name)
->where("board_type =?",$board_type)
->where('md5(concat("PTCBOARD",id))!=?',$board_id);
$result = $dbtable->fetchOne($select);
return $result;
}
/**
* edit() method is used to edit name
* @param array
* @return true
*/
public function edit($editData,$where)
{ echo "asdfas";
$dbtable = new Zend_Db_Table('tbl_board_directors');
$dbtable->update($editData,$where);
}
/**
* getAllBoardList() method is used to get all board user list
* @param email string
* @return object
*/
public function getAllBoardList()
{
$db = Zend_Db_Table::getDefaultAdapter();
$select = $db->select()
->from(array("tbl_board_directors"), array('*'))
->order('name');
$result = $db->fetchAll($select);
return $result;
}
/**
* getBoardDetailsById() method is used to get board details bu board id
* @param email string
* @return object
*/
public function getBoardDetailsById($board_id)
{
$dbtable = new Zend_Db_Table('tbl_board_directors');
$select = $dbtable->select()->where('md5(concat("PTCBOARD",id))= ?',$board_id);
$result = $dbtable->fetchRow($select);
return $result;
}
/**
* delete() method is used to add menu
* @param array
* @return true
*/
public function delete($board_id)
{
$dbtable = new Zend_Db_Table('tbl_board_directors');
$where = array('md5(concat("PTCBOARD",id))=?'=>$board_id);
$dbtable->delete($where);
}
/**
* checkOrderOfAppearanceExistsOrNot() method is used to get check orderOfAppearance exists or not
* @param email string
* @return object
*/
public function checkOrderOfAppearanceExistsOrNot($board_type,$orderOfAppearance)
{
$dbtable = Zend_Db_Table::getDefaultAdapter();
$select = $dbtable->select()
->from("tbl_board_directors",array('count(*) AS total_records'))
->where("board_type =?",$board_type)
->where("orderOfAppearance =?",$orderOfAppearance);
$result = $dbtable->fetchOne($select);
return $result;
}
/**
* checkEditOrderOfAppearanceExistsOrNot() method is used to get check orderOfAppearance exists or not
* @param email string
* @return object
*/
public function checkEditOrderOfAppearanceExistsOrNot($board_id,$board_type,$orderOfAppearance)
{
$dbtable = Zend_Db_Table::getDefaultAdapter();
$select = $dbtable->select()
->from("tbl_board_directors",array('count(*) AS total_records'))
->where("board_type =?",$board_type)
->where("orderOfAppearance =?",$orderOfAppearance)
->where('md5(concat("PTCBOARD",id))!=?',$board_id);
$result = $dbtable->fetchOne($select);
return $result;
}
}