212 lines
5.9 KiB
PHP
Executable File
212 lines
5.9 KiB
PHP
Executable File
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
|
|
require APPPATH . '/libraries/BaseController.php';
|
|
/**
|
|
* Class : Dashboard_Controller
|
|
* Dashboard_Controller class to control the Master Data.
|
|
* @author : Surendiran.M
|
|
* @version : 1.1
|
|
* @since : 27/07/2018
|
|
*/
|
|
class Dashboard_Controller extends BaseController
|
|
{
|
|
/**
|
|
* This is default constructor of the class
|
|
*/
|
|
public function __construct(){
|
|
parent::__construct();
|
|
$this->load->model('Dashboard_Model');
|
|
}
|
|
|
|
/**
|
|
* Index Page for this controller.
|
|
*/
|
|
public function index()
|
|
{
|
|
$this->Dashboard();
|
|
}
|
|
|
|
/**
|
|
* This function used to load the Dashboard page
|
|
*/
|
|
function Dashboard()
|
|
{
|
|
$this->global['pageTitle'] = 'Visa : Dashboard';
|
|
$this->loadViews('Dashboard', $this->global,NULL , NULL);
|
|
}
|
|
|
|
/**
|
|
* This function used to load the Country Master page
|
|
*/
|
|
function country_master(){
|
|
$this->global['pageTitle'] = 'Visa : Country Master';
|
|
$this->loadViews('country_master', $this->global,NULL , NULL);
|
|
}
|
|
|
|
/**
|
|
* To Store Country Master Values
|
|
*/
|
|
function Add_country_master(){
|
|
|
|
|
|
$CountryMasterDatas =
|
|
array( 'CountryName'=>$this->input->post('CountryName'),
|
|
'CapitalCity'=>$this->input->post('CapitalCity'),
|
|
'CountryDescription'=>$this->input->post('Editor'));
|
|
|
|
$Added = $this->Dashboard_Model->Add_CountryMaster($CountryMasterDatas);
|
|
|
|
|
|
if( $Added >= 1 ){
|
|
echo "<script>alert('Saved Successfully!');</script>";
|
|
redirect ( 'country_master' );
|
|
}
|
|
else
|
|
{
|
|
echo "<script>alert('Saved Unsuccessfully!');</script>";
|
|
redirect ( 'country_master' );
|
|
}
|
|
|
|
}
|
|
|
|
/**
|
|
* This function used to load the City Master page
|
|
*/
|
|
function city_master(){
|
|
$this->global['pageTitle'] = 'Visa : Country Master';
|
|
$this->loadViews('city_master', $this->global,NULL , NULL);
|
|
}
|
|
|
|
/**
|
|
* To Store City Master Values
|
|
*/
|
|
function Add_city_master(){
|
|
|
|
$CityMasterDatas =
|
|
array( 'CityName'=>$this->input->post('CityName'),
|
|
'CityDescription'=>$this->input->post('CitiesDescription'));
|
|
|
|
$Added = $this->Dashboard_Model->Add_CityMaster($CityMasterDatas);
|
|
|
|
|
|
if( $Added >= 1 ){
|
|
echo "<script>alert('Saved Successfully!');</script>";
|
|
redirect ( 'city_master' );
|
|
}
|
|
else
|
|
{
|
|
echo "<script>alert('Saved Unsuccessfully!');</script>";
|
|
redirect ( 'city_master' );
|
|
}
|
|
|
|
}
|
|
|
|
/**
|
|
* This function used to load the Visa Type Master page
|
|
*/
|
|
function visa_type_master(){
|
|
$this->global['pageTitle'] = 'Visa : Visa Type Master';
|
|
$this->loadViews('visa_type_master', $this->global,NULL , NULL);
|
|
}
|
|
|
|
/**
|
|
* To Store Visa Type Master Values
|
|
*/
|
|
function Add_visa_type_master(){
|
|
|
|
$VisaTypeMasterDatas =
|
|
array( 'VisaName'=>$this->input->post('VisaName'),
|
|
'VisaDescription'=>$this->input->post('VisaDescription'));
|
|
|
|
$Added = $this->Dashboard_Model->Add_VisaType($VisaTypeMasterDatas);
|
|
|
|
|
|
if( $Added >= 1 ){
|
|
echo "<script>alert('Saved Successfully!');</script>";
|
|
redirect ( 'visa_type_master' );
|
|
}
|
|
else
|
|
{
|
|
echo "<script>alert('Saved Unsuccessfully!');</script>";
|
|
redirect ( 'visa_type_master' );
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
* This function used to load the Document page
|
|
*/
|
|
function document_master(){
|
|
$this->global['pageTitle'] = 'Visa : Upload Document';
|
|
$this->loadViews('document_upload', $this->global,NULL , NULL);
|
|
}
|
|
|
|
/**
|
|
* To Store Visa's File & Documents Datas
|
|
*/
|
|
function Add_document_master(){
|
|
|
|
$DocumentMasterDatas =
|
|
array( 'DocumentName'=>$this->input->post('DocumentName'),
|
|
'Document'=>$this->uploadFile(),
|
|
'DocumentDescription'=>$this->input->post('Description'));
|
|
|
|
$Added = $this->Dashboard_Model->Add_Document($DocumentMasterDatas);
|
|
|
|
|
|
if( $Added >= 1 ){
|
|
echo "<script>alert('Saved Successfully!');</script>";
|
|
|
|
}
|
|
else
|
|
{
|
|
echo "<script>alert('Saved Unsuccessfully!');</script>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/**
|
|
* To upload IGR files
|
|
*/
|
|
function uploadFile()
|
|
{
|
|
$config['upload_path'] = 'assets/dist/img/Uploads';
|
|
$config['allowed_types'] = 'png|jpg|jpeg|pdf|docx';
|
|
$config['file_name'] = $_FILES['DocumentFile']['name'];
|
|
|
|
//Load upload library and initialize configuration
|
|
$this->load->library('upload',$config);
|
|
$this->upload->initialize($config);
|
|
|
|
|
|
if($this->upload->do_upload('DocumentFile'))
|
|
{
|
|
$uploadData = $this->upload->data();
|
|
$uploadfilename = $uploadData['file_name'];
|
|
return $uploadfilename;
|
|
}
|
|
else
|
|
{
|
|
$error = array('error' => $this->upload->display_errors());
|
|
$uploadfilename = '';
|
|
return 0;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
* This function used to load the Dashboard page
|
|
*/
|
|
function country_visa_details(){
|
|
$this->global['pageTitle'] = 'Visa : CountryWise Visa Details';
|
|
$data['records'] = $this->Dashboard_Model->Get_CountryMaster();
|
|
$this->loadViews('country_visa_details',$this->global,$data, NULL);
|
|
}
|
|
|
|
|
|
}
|
|
|
|
?>
|