diff --git a/application/config/routes.php b/application/config/routes.php index aba2167..de803ee 100755 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -57,6 +57,7 @@ $route['translate_uri_dashes'] = FALSE; $route['Routes'] = 'Dashboard_Controller/index'; $route['Dashboard'] = 'Dashboard_Controller/Dashboard'; + $route['country_master'] = 'Dashboard_Controller/country_master'; $route['SaveAll_country_master'] = 'Dashboard_Controller/SaveAll_country_master'; $route['GetAll_country_master'] = 'Dashboard_Controller/GetAll_country_master'; @@ -66,17 +67,18 @@ $route['Add_city_master'] = 'Dashboard_Controller/Add_city_master'; $route['visa_type_master'] = 'Dashboard_Controller/visa_type_master'; -$route['Add_visa_type_master'] = 'Dashboard_Controller/Add_visa_type_master'; +$route['SaveAll_visa_type_master'] = 'Dashboard_Controller/SaveAll_visa_type_master'; +$route['GetAll_visa_type'] = 'Dashboard_Controller/GetAll_visa_type_master'; $route['document_master'] = 'Dashboard_Controller/document_master'; -$route['Add_document_master'] = 'Dashboard_Controller/Add_document_master'; +$route['SaveAll_document_master'] = 'Dashboard_Controller/SaveAll_document_master'; +$route['GetAll_document_master'] = 'Dashboard_Controller/GetAll_document_master'; $route['country_visa_details'] = 'Dashboard_Controller/country_visa_details'; $route['favourite'] = 'Favourite_Controller/favourite'; - $route['loginMe'] = 'Login_Controller/loginMe'; $route['forgotPassword'] = "Login_Controller/forgotPassword"; $route['resetPasswordUser'] = "Login_Controller/resetPasswordUser"; diff --git a/application/controllers/Dashboard_Controller.php b/application/controllers/Dashboard_Controller.php index dc997c9..e56827f 100755 --- a/application/controllers/Dashboard_Controller.php +++ b/application/controllers/Dashboard_Controller.php @@ -69,7 +69,7 @@ class Dashboard_Controller extends BaseController else{ $Edited = $this->Dashboard_Model->Update_CountryMaster($CountryMasterDatas, $CountryCode); - echo $Edited == True ? "" + echo $Edited == True ? "" : ""; } @@ -129,67 +129,112 @@ class Dashboard_Controller extends BaseController */ function visa_type_master(){ $this->global['pageTitle'] = 'Visa : Visa Type Master'; - $data['getvisatype']= $this->Dashboard_Model->Get_VisaTypeMaster(); + $data['getvisatype']= $this->Dashboard_Model->Get_VisaTypeMaster($VisaNo=''); $this->loadViews('visa_type_master', $this->global,$data , NULL); } /** * To Store Visa Type Master Values */ - function Add_visa_type_master(){ + function SaveAll_visa_type_master(){ + $VisaCode = $this->input->post('HideVisaCode'); // value getting from hidden field $VisaTypeMasterDatas = array( 'VisaName'=>$this->input->post('VisaName'), 'VisaDescription'=>$this->input->post('VisaDescription'), 'IsActive'=>$this->input->post('IsActive') != '' ? 1 : 0); - $Added = $this->Dashboard_Model->Add_VisaType($VisaTypeMasterDatas); - - - if( $Added != "" ){ - echo ""; + if($VisaCode == ''){ + + $Added = $this->Dashboard_Model->Add_VisaType($VisaTypeMasterDatas); + + echo $Added != "" ? "" + : ""; + + } - else - { - echo ""; - } - + else{ + $Edited = $this->Dashboard_Model->Update_VisaType($VisaTypeMasterDatas,$VisaCode); + + echo $Edited == True ? "" + : ""; + + } + } + /** + * View - visa_type_master + * Get an argument From Ajax Call - 'arg' is VisaNo + * Return Datas to View Through JSON_encode + */ + function GetAll_visa_type_master() { + + $VisaNo = $this->input->post('arg'); + + $EditIt = $this->Dashboard_Model->Get_VisaTypeMaster($VisaNo); + + echo json_encode($EditIt); + + } + /** * This function used to load the Document page */ function document_master(){ $this->global['pageTitle'] = 'Visa : Upload Document'; - $data['getdocument'] =$this->Dashboard_Model->Get_DocumentMaster(); + $data['getdocument'] =$this->Dashboard_Model->Get_DocumentMaster($DocNo=''); $this->loadViews('document_upload', $this->global,$data , NULL); } /** * To Store Visa's File & Documents Datas */ - function Add_document_master(){ + function SaveAll_document_master(){ + $DocNo = $this->input->post('HideDocumentCode'); // value getting from hidden field + $Doc = $this->input->post('HideDocument'); // value getting from hidden field + $DocumentMasterDatas = array( 'DocumentName'=>$this->input->post('DocumentName'), - 'Document'=>$this->uploadFile(), + 'Document'=>$Doc == '' ? $this->uploadFile() : $Doc , 'DocumentDescription'=>$this->input->post('Description'), 'IsActive'=>$this->input->post('IsActive') != '' ? 1 : 0); - $Added = $this->Dashboard_Model->Add_Document($DocumentMasterDatas); - - - if( $Added != "" ){ - echo ""; + if($DocNo == ''){ + + $Added = $this->Dashboard_Model->Add_Document($DocumentMasterDatas); + + echo $Added != "" ? "" + : ""; + } - else - { - echo ""; + else{ + $Edited = $this->Dashboard_Model->Update_Document($DocumentMasterDatas,$DocNo); + + echo $Edited == True ? "" + : ""; + } } + /** + * View - document_upload + * Get an argument From Ajax Call - 'arg' is DocumentNo + * Return Datas to View Through JSON_encode + */ + function GetAll_document_master() { + + $DocNo = $this->input->post('arg'); + + $EditIt = $this->Dashboard_Model->Get_DocumentMaster($DocNo); + + echo json_encode($EditIt); + + } + /** * To upload IGR files */ diff --git a/application/models/Dashboard_Model.php b/application/models/Dashboard_Model.php index bf1511e..9e6c345 100755 --- a/application/models/Dashboard_Model.php +++ b/application/models/Dashboard_Model.php @@ -5,7 +5,7 @@ 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 how many value are inserted (return as count) + * @return $CountryMaster : This will return Last inserted id of Country Master */ function Add_CountryMaster($CountryMasterDatas) { @@ -16,9 +16,9 @@ class Dashboard_Model extends CI_Model{ return $id; } - /** - * To Update the values of Country detail on respective CounterCode into 'Tab_CountryMaster' table - * @param arry $CountryMasterDatas : This will have all the edited Country Details + /** + * 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) @@ -29,9 +29,9 @@ class Dashboard_Model extends CI_Model{ } /** - * To Update the values of Country detail on respective CounterCode into 'Tab_CountryMaster' table - * @param arry $CountryMasterDatas : This will have all the edited Country Details + * 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) { @@ -47,7 +47,7 @@ class Dashboard_Model extends CI_Model{ /** * 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) + * @return $CityMaster : This will return Last inserted id of City Master */ function Add_CityMaster($CityMasterDatas) { @@ -69,8 +69,8 @@ class Dashboard_Model extends CI_Model{ /** * To store VisaType Related details into 'Tab_VisaTypeMaster' table - * @param array $VisaTypeMasterDatas : Its have all the City master datas - * @return $CityMaster : This will return how many value are inserted (return as count) + * @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) { @@ -80,19 +80,39 @@ class Dashboard_Model extends CI_Model{ return $VisaTypeMaster; } - function Get_VisaTypeMaster() - { - $this->db->select('*'); - $this->db->from('Tab_VisaTypeMaster'); - $query = $this->db->get(); - $VisaTypeMasterDatas = $query->result(); - return $VisaTypeMasterDatas; + /** + * 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 how many value are inserted (return as count) + * @return $Documents : This will return Last Inserted Id of DocumentMaster */ function Add_Document($DocumentMasterDatas) { @@ -100,11 +120,31 @@ class Dashboard_Model extends CI_Model{ $Documents = $this->db->insert_id(); return $Documents; } - - function Get_DocumentMaster() + + /** + * 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; diff --git a/application/views/country_visa_details.php b/application/views/country_visa_details.php index d6f9ea0..9eb3b03 100755 --- a/application/views/country_visa_details.php +++ b/application/views/country_visa_details.php @@ -220,15 +220,21 @@ span:nth-child(3) .slide-up:active {