master edit

This commit is contained in:
venbatechnologies@gmail.com 2018-08-02 11:09:09 +05:30
parent f65139c9c4
commit cb7a626e61
12 changed files with 113 additions and 29 deletions

View File

@ -77,7 +77,7 @@ $query_builder = TRUE;
$hostname ="localhost";
$username ="root";
$password ="";
$database ="Visa_DB";
$database ="VISA";
$db['default'] = array(
'dsn' => '',

View File

@ -63,7 +63,8 @@ $route['SaveAll_country_master'] = 'Dashboard_Controller/SaveAll_country_master'
$route['GetAll_country_master'] = 'Dashboard_Controller/GetAll_country_master';
$route['city_master'] = 'Dashboard_Controller/city_master';
$route['Add_city_master'] = 'Dashboard_Controller/Add_city_master';
$route['SaveAll_city_master'] = 'Dashboard_Controller/SaveAll_city_master';
$route['GetAll_city_master'] = 'Dashboard_Controller/GetAll_city_master';
$route['visa_type_master'] = 'Dashboard_Controller/visa_type_master';

View File

@ -96,34 +96,56 @@ class Dashboard_Controller extends BaseController
*/
function city_master(){
$this->global['pageTitle'] = 'Visa : Country Master';
$data['getcity']= $this->Dashboard_Model->Get_CityMaster();
$data['getcity']= $this->Dashboard_Model->Get_CityMaster($citycode='');
$this->loadViews('city_master', $this->global,$data , NULL);
}
/**
* To Store City Master Values
*/
function Add_city_master(){
function SaveAll_city_master(){
$CityCode = $this->input->post('HideCityCode'); // value getting from hidden field
$CityMasterDatas =
array( 'CityName'=>$this->input->post('CityName'),
'CityDescription'=>$this->input->post('CitiesDescription'),
'CityDescription'=>$this->input->post('CityDescription'),
'IsActive'=>$this->input->post('IsActive') != '' ? 1 : 0);
if($CityCode == ''){
$Added = $this->Dashboard_Model->Add_CityMaster($CityMasterDatas);
if( $Added != "" ){
echo "<script>alert('Created Successfully ! City Code:$Added'); window.location.href='city_master';</script>";
echo $Added != "" ? "<script>alert('Created Successfully ! City Code:$Added');window.location.href='city_master';</script>"
: "<script>alert('Sorry Not Created ! Try Again '); window.location.href='city_master';</script>";
}
else
{
echo "<script>alert('Sorry Not Created ! Try Again '); window.location.href='city_master';</script>";
$Edited = $this->Dashboard_Model->Update_CityMaster($CityMasterDatas, $CityCode);
echo $Edited == True ? "<script>alert('Successfully Updated!');window.location.href='city_master';</script>"
: "<script>alert('Sorry Not Updated ! Try Again'); window.location.href='city_master';</script>";
}
}
/**
* View - city_master
* Get an argument From Ajax Call - 'citycode' is CITYCODE
* Return Datas to View Through JSON_encode
*/
function GetAll_city_master() {
$CityCode = $this->input->post('citycode');
$EditIt = $this->Dashboard_Model->Get_CityMaster($CityCode);
echo json_encode($EditIt);
}
/**
* This function used to load the Visa Type Master page
*/

0
application/controllers/Favourite_Controller.php Normal file → Executable file
View File

View File

@ -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 Last inserted id of City Master
* @return $CityMaster : This will return how many value are inserted (return as count)
*/
function Add_CityMaster($CityMasterDatas)
{
@ -57,11 +57,26 @@ class Dashboard_Model extends CI_Model{
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()
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;

0
application/models/Favourite_Model.php Normal file → Executable file
View File

View File

@ -180,6 +180,9 @@ span:nth-child(3) .slide-up:active {
margin-top: -50px;
margin-right: 15px;
float: left;
}
.nav-tabs-custom>.nav-tabs>li.active{
border-top-color:#dc2265 !important;
}
</style>
@ -204,11 +207,11 @@ span:nth-child(3) .slide-up:active {
<!-- Custom Tabs -->
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab_1" data-toggle="tab">View City</a></li>
<li><a href="#tab_2" data-toggle="tab">Add City</a></li>
<li class="active" id="viewcity"><a href="#viewcitytab" data-toggle="tab">View City</a></li>
<li id="addcity"><a href="#addeditcitytab" data-toggle="tab">Add/Edit City</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab_1">
<div class="tab-pane active" id="viewcitytab">
<h3 style="text-align:center;">View City</h3>
<table id="example2" class="table table-bordered table-hover">
<thead>
@ -227,9 +230,8 @@ span:nth-child(3) .slide-up:active {
<td><?php echo $gcity->CityCode;?></td>
<td><?php echo $gcity->CityName;?></td>
<td style="text-align:center;"><?php echo $gcity->IsActive == 1 ? '<span class="label label-success">Active</span>' : '<span class="label label-danger">Deactive</span>' ?></td>
<td style="text-align:center;"><a href="#Editcenter"><i class="fa fa-edit" data-toggle="tooltip" title="" data-original-title="Click here to view/Edit" style="color: #dc2265;"></i></a>
</td>
</tr>
<td style="text-align:center;"><span onclick="ToEditCityDetails(<?php echo $gcity->CityCode; ?>)"><i class="fa fa-edit" data-toggle="tooltip" data-original-title="Click here to view/Edit <?php echo $gcity->CityCode ?> Details" style="color: #dc2265;"></i></a>
</tr>
<?php }
}?>
@ -245,14 +247,14 @@ span:nth-child(3) .slide-up:active {
</table>
</div>
<!-- /.tab-pane -->
<div class="tab-pane" id="tab_2">
<h3 style="text-align:center;">Add City</h3>
<div class="tab-pane" id="addeditcitytab">
<h3 style="text-align:center;">Add/Edit City</h3>
<!-- form start -->
<form role="form" action="<?php echo base_url() ?>Add_city_master" method="post" style="padding:40px;">
<form role="form" action="<?php echo base_url() ?>SaveAll_city_master" method="post" style="padding:40px;">
<div class="row">
<div class="col-md-5 designinput">
<div class="form-group">
<input class="slide-up" id="card" name="CityName" type="text" placeholder="Enter city name" /><label for="City Name">City Name</label>
<input class="slide-up" id="CityName" name="CityName" type="text" placeholder="Enter city name" /><label for="City Name">City Name</label>
<!--<label for="exampleInputcountryname">Country Name</label>
<input type="text" class="form-control" id="exampleInputcountryname" placeholder="Enter country">-->
@ -262,7 +264,7 @@ span:nth-child(3) .slide-up:active {
<div class="row">
<div class="col-md-12">
<label for="Description">Description</label>
<textarea class="form-control" rows="3" name="CitiesDescription" placeholder="Enter ..." data-gramm="true" data-txt_gramm_id="d620fc04-2898-2668-7729-ac0c777081d4" data-gramm_id="d620fc04-2898-2668-7729-ac0c777081d4" spellcheck="false" data-gramm_editor="true" style="z-index: auto; position: relative; line-height: 20px; font-size: 14px; transition: none; background: transparent !important;"></textarea>
<textarea class="form-control" rows="3" id="CityDescription" name="CityDescription" placeholder="Enter ..." data-gramm="true" data-txt_gramm_id="d620fc04-2898-2668-7729-ac0c777081d4" data-gramm_id="d620fc04-2898-2668-7729-ac0c777081d4" spellcheck="false" data-gramm_editor="true" style="z-index: auto; position: relative; line-height: 20px; font-size: 14px; transition: none; background: transparent !important;"></textarea>
</div>
</div>
@ -270,10 +272,11 @@ span:nth-child(3) .slide-up:active {
<div class="col-md-2">
<div class="form-group">
<label>Active/Deactive
<input type="checkbox" class="flat-red" name="IsActive" checked>
<input type="checkbox" class="flat-red" name="IsActive" id="IsActive" checked>
</label>
</div>
</div>
<input id="hidecitycode" name="HideCityCode" type="hidden" readonly />
<div class="col-md-offset-6 col-md-4">
<button type="submit" class="btn btn-primary">Submit</button>
<div class="or-button">Or</div>
@ -324,5 +327,36 @@ span:nth-child(3) .slide-up:active {
radioClass : 'iradio_flat-green'
})
});
function ToEditCityDetails(arg){
$('#viewcity,#viewcitytab').removeClass("active");
$('#addcity,#addeditcitytab').addClass("active");
$.ajax({
data:{citycode:arg},
type:"POST",
url:"<?php echo base_url();?>GetAll_city_master",
success:function(data) {
//alert(data);
$.each(JSON.parse(data), function (i, item) {
$('#hidecitycode').val(item.CityCode);
$('#CityName').val(item.CityName);
$('#CityDescription').val(item.CityDescription);
if(item.IsActive == 0){
$('.icheckbox_flat-green').attr("aria-checked", false);
$('.icheckbox_flat-green').removeClass('checked');
}
else{
$('.icheckbox_flat-green').attr("aria-checked", true);
$('.icheckbox_flat-green').addClass('checked');
}
});
}
});
}
</script>

View File

@ -179,6 +179,9 @@ span:nth-child(3) .slide-up:active {
margin-top: -50px;
margin-right: 15px;
float: left;
}
.nav-tabs-custom>.nav-tabs>li.active{
border-top-color:#dc2265 !important;
}
</style>
@ -252,7 +255,7 @@ span:nth-child(3) .slide-up:active {
</div>
<!-- /.tab-pane -->
<div class="tab-pane" id="AddEditCountryTab">
<h3 style="text-align:center;">Add Country Master</h3>
<h3 style="text-align:center;">Add/Edit Country Master</h3>
<!-- form start -->
<form role="form" action="<?php echo base_url() ?>SaveAll_country_master" method="post" style="padding:40px;">
<div class="row">
@ -266,7 +269,7 @@ span:nth-child(3) .slide-up:active {
</div>
<div class="col-md-5 designinput">
<div class="form-group">
<input class="slide-up" id="capitalcity" name="CapitalCity" type="text" placeholder="Enter country capital" /><label for="capitalcity">CCapital</label>
<input class="slide-up" id="capitalcity" name="CapitalCity" type="text" placeholder="Enter country capital" /><label for="capitalcity">Country Capital</label>
<!--<label for="exampleInputcountrycapital">Country Capital</label>
<input type="text" class="form-control" id="exampleInputcountrycapital" placeholder="Enter country capital">-->
@ -380,6 +383,7 @@ span:nth-child(3) .slide-up:active {
else{
$('.icheckbox_flat-green').attr("aria-checked", true);
$('.icheckbox_flat-green').addClass('checked');
}
});

View File

@ -173,6 +173,9 @@ span:nth-child(3) .slide-up:active {
margin-top: -50px;
margin-right: 15px;
float: left;
}
.nav-tabs-custom>.nav-tabs>li.active{
border-top-color:#dc2265 !important;
}
</style>
@ -238,7 +241,7 @@ span:nth-child(3) .slide-up:active {
</div>
<!-- /.tab-pane -->
<div class="tab-pane" id="AddEditDocumentTab">
<h3 style="text-align:center;">View Document</h3>
<h3 style="text-align:center;">Add/Edit Document</h3>
<!-- form start -->
<form role="form" action="<?php echo base_url() ?>SaveAll_document_master" method="post" style="padding:40px;" enctype="multipart/form-data">
<div class="row">
@ -354,6 +357,7 @@ span:nth-child(3) .slide-up:active {
else{
$('.icheckbox_flat-green').attr("aria-checked", true);
$('.icheckbox_flat-green').addClass('checked');
}
$('#hidedocument').val(item.Document);

0
application/views/favourite.php Normal file → Executable file
View File

View File

@ -179,6 +179,9 @@ span:nth-child(3) .slide-up:active {
margin-top: -50px;
margin-right: 15px;
float: left;
}
.nav-tabs-custom>.nav-tabs>li.active{
border-top-color:#dc2265 !important;
}
</style>
@ -347,6 +350,7 @@ span:nth-child(3) .slide-up:active {
else{
$('.icheckbox_flat-green').attr("aria-checked", true);
$('.icheckbox_flat-green').addClass('checked');
}
});

0
assets/dist/img/loginbg.jpg vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 162 KiB