174 lines
5.9 KiB
PHP
Executable File
174 lines
5.9 KiB
PHP
Executable File
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
class Dashboard_Model extends CI_Model{
|
|
|
|
/**
|
|
* To store Country Related details into 'Tab_CountryMaster' table
|
|
* @param array $CountryMasterDatas : Its have all the Contry master datas
|
|
* @return $CountryMaster : This will return Last inserted id of Country Master
|
|
*/
|
|
function Add_CountryMaster($CountryMasterDatas)
|
|
{
|
|
|
|
$this->db->insert('Tab_CountryMaster',$CountryMasterDatas);
|
|
$id = $this->db->insert_id();
|
|
|
|
return $id;
|
|
}
|
|
|
|
/**
|
|
* To Update the values of Country detail on respective CounterCode and store into 'Tab_CountryMaster' table
|
|
* @param array $CountryMasterDatas : This will have all the edited Country Details
|
|
* @param number $Cc : This is Country code
|
|
*/
|
|
function Update_CountryMaster($CountryMasterDatas, $Cc)
|
|
{
|
|
$this->db->where('CountryCode',$Cc);
|
|
$this->db->update('Tab_CountryMaster',$CountryMasterDatas);
|
|
return TRUE;
|
|
}
|
|
|
|
/**
|
|
* To Get the Country Master Data from respective CounterCode from 'Tab_CountryMaster' table
|
|
* @param number $Cc : This is Country code
|
|
* @return array $CountryMasterDatas : This will have all the Country Master Datas
|
|
*/
|
|
function Get_CountryMaster($Cc)
|
|
{
|
|
$this->db->select('*');
|
|
$this->db->from('Tab_CountryMaster');
|
|
if($Cc != ''){
|
|
$this->db->where('CountryCode',$Cc);
|
|
}
|
|
$query = $this->db->get();
|
|
$CountryMasterDatas = $query->result();
|
|
return $CountryMasterDatas;
|
|
}
|
|
/**
|
|
* To store City Related details into 'Tab_CityMaster' table
|
|
* @param array $CityMasterDatas : Its have all the City master datas
|
|
* @return $CityMaster : This will return how many value are inserted (return as count)
|
|
*/
|
|
function Add_CityMaster($CityMasterDatas)
|
|
{
|
|
|
|
$this->db->insert('Tab_CityMaster',$CityMasterDatas);
|
|
$CityMaster = $this->db->insert_id();
|
|
|
|
return $CityMaster;
|
|
}
|
|
|
|
/**
|
|
* To Update the values of city detail on respective CityCode into 'Tab_CityMaster' table
|
|
* @param arry $CityMasterDatas : This will have all the edited city Details
|
|
* @param number $Cc : This is City code
|
|
*/
|
|
function Update_CityMaster($CityMasterDatas, $citycode)
|
|
{
|
|
$this->db->where('CityCode',$citycode);
|
|
$this->db->update('Tab_CityMaster',$CityMasterDatas);
|
|
return TRUE;
|
|
}
|
|
|
|
function Get_CityMaster($citycode)
|
|
{
|
|
$this->db->select('*');
|
|
$this->db->from('Tab_CityMaster');
|
|
if($citycode != ''){
|
|
$this->db->where('CityCode',$citycode);
|
|
}
|
|
$query = $this->db->get();
|
|
$CityMasterDatas = $query->result();
|
|
return $CityMasterDatas;
|
|
}
|
|
|
|
/**
|
|
* To store VisaType Related details into 'Tab_VisaTypeMaster' table
|
|
* @param array $VisaTypeMasterDatas : Its have all the Visa Type master datas
|
|
* @return $VisaTypeMaster : This will return Last inserted id of Visa Type Master
|
|
*/
|
|
function Add_VisaType($VisaTypeMasterDatas)
|
|
{
|
|
$this->db->insert('Tab_VisaTypeMaster',$VisaTypeMasterDatas);
|
|
$VisaTypeMaster = $this->db->insert_id();
|
|
|
|
return $VisaTypeMaster;
|
|
}
|
|
|
|
/**
|
|
* To Update the values of Visa type Detail on respective VisaNo and store into 'Tab_VisaTypeMaster' table
|
|
* @param array $VisaTypeMasterDatas : This will have all the edited Visa Type
|
|
* @param number $VisaNo : This is Visa code
|
|
*/
|
|
function Update_VisaType($VisaTypeMasterDatas,$VisaNo)
|
|
{
|
|
$this->db->where('VisaCode',$VisaNo);
|
|
$this->db->update('Tab_VisaTypeMaster',$VisaTypeMasterDatas);
|
|
return TRUE;
|
|
}
|
|
|
|
/**
|
|
* To Get the Visa Master Data from respective VisaNo from 'Tab_VisaTypeMaster' table
|
|
* @param number $VisaNo : This is VisaNo
|
|
* @return array $DocumentMasterdatas : This will have all the Visa Type Datas
|
|
*/
|
|
function Get_VisaTypeMaster($VisaNo='')
|
|
{
|
|
$this->db->select('*');
|
|
$this->db->from('Tab_VisaTypeMaster');
|
|
if($VisaNo != ''){
|
|
$this->db->where('VisaCode',$VisaNo);
|
|
}
|
|
$query =$this->db->get();
|
|
$DocumentMasterdatas = $query->result();
|
|
return $DocumentMasterdatas;
|
|
}
|
|
|
|
/**
|
|
* To store Document Related details into 'Tab_Documents' table
|
|
* @param array $DocumentMasterDatas : Its have all the document master datas
|
|
* @return $Documents : This will return Last Inserted Id of DocumentMaster
|
|
*/
|
|
function Add_Document($DocumentMasterDatas)
|
|
{
|
|
$this->db->insert('Tab_Documents',$DocumentMasterDatas);
|
|
$Documents = $this->db->insert_id();
|
|
return $Documents;
|
|
}
|
|
|
|
/**
|
|
* To Update the values of Country detail on respective CounterCode into 'Tab_Documents' table
|
|
* @param arry $CountryMasterDatas : This will have all the edited Country Details
|
|
* @param number $Cc : This is Country code
|
|
*/
|
|
function Update_Document($DocumentMasterDatas,$DocNo)
|
|
{
|
|
$this->db->where('DocumentCode',$DocNo);
|
|
$this->db->update('Tab_Documents',$DocumentMasterDatas);
|
|
return TRUE;
|
|
}
|
|
|
|
/**
|
|
* To Get the Document Master Data from respective DocumentNo from 'Tab_Documents' table
|
|
* @param number $DocNo : This is DocumentNo
|
|
* @return array $DocumentMasterdatas : This will have all the Document Datas
|
|
*/
|
|
function Get_DocumentMaster($DocNo='')
|
|
{
|
|
$this->db->select('*');
|
|
$this->db->from('Tab_Documents');
|
|
if($DocNo != ''){
|
|
$this->db->where('DocumentCode',$DocNo);
|
|
}
|
|
$query =$this->db->get();
|
|
$DocumentMasterdatas = $query->result();
|
|
return $DocumentMasterdatas;
|
|
}
|
|
/**To Get user count from Tab_Register table to display dashboard **/
|
|
function usercount(){
|
|
return $this->db->count_all_results('Tab_Register');
|
|
}
|
|
|
|
|
|
}
|