Data line

This commit is contained in:
CHIEFSOFT\ameye
2024-05-27 10:09:59 -04:00
parent 4c1ba8e01b
commit 0ce4088225
2 changed files with 55 additions and 2 deletions
+37 -2
View File
@@ -100,8 +100,14 @@ class Confg extends Bko_Controller {
$this->load->library('table');
$this->table->set_template($this->template);
$mysql = "SELECT id,code,country,phone_code,
allow::date,
$mysql = "SELECT id,code,country,phone_code,
(CASE WHEN
allow IS NULL
THEN '<div id=\"allow-'||code||'\" ><button onclick=\"allowStatus('''||code||''',1);\" type=\"button\" class=\"btn btn-danger\">Enable</button></div>'
ELSE
'<a id=\"allow-'||code||'\" ><button onclick=\"allowStatus('''||code||''',0);\" >'||allow::date::text||'</a>'
END)
AS Allow,
'<a href=\"#\" >'|| jobs::date||'</a>' AS Jobs,
status
FROM country
@@ -169,6 +175,35 @@ class Confg extends Bko_Controller {
}
}
public function allowCountry(){
if ($_GET) {
$countyry_code = trim( $this->input->get('countyry_code') );
$action = trim($this->input->get('action'));
//echo "ameye-ameye 22 - ".$countyry_code;
if($countyry_code !='' & $action !='' & $action == 1 ){
$sql1 = "UPDATE country SET allow=now() WHERE code= '$countyry_code' ";
$this->db->query($sql1);
echo 'Updated';
}
// else{
// echo 'Not Updated';
// }
if($countyry_code !='' & $action !='' & $action == 0 ){
$sql1 = "UPDATE country SET allow=NULL WHERE code= '$countyry_code' ";
$this->db->query($sql1);
echo 'Disabled';
}
// else{
// echo 'Not Updated';
// }
}
}
public function updateHelpfaq(){
if ($_GET) {
$faq_id = $this->input->get('faq_id');
@@ -17,4 +17,22 @@
</div>
</form>
<script type="text/javascript">
<!--
function allowStatus(countyry_code,action){
alert(countyry_code);
$('#allow-'+countyry_code).html('Processing...');
// $('#acc' + countyry_code).prop('disabled', true);
$.ajax({
url: "/confg/allowCountry?countyry_code=" + countyry_code + "&action=" + action
}).done(function (data) {
$('#allow-'+countyry_code).html(data);
// $('#acc' + countyry_code).prop('disabled', false);
});
return false;
}
// -->