Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.145.62.46
Current Path : /var/www/html/oums/js/ |
| Current File : /var/www/html/oums/js/task_reminder_old.js |
function load_page()
{
load_page_data(window.location.href.substr(window.location.href.lastIndexOf('/')+1));
clrs_data();
load_data_grid(13, 1);
}
function clrs_data()
{
$(function(){$( "#txtstrtdate" ).datepicker({ dateFormat: "dd-mm-yy" });});
$(function(){$( "#txtlastdate" ).datepicker({ dateFormat: "dd-mm-yy" });});
$(function(){$( "#txtcompdate" ).datepicker({ dateFormat: "dd-mm-yy" });});
document.getElementById("txtstrtdate").value = get_today_date();
document.getElementById("txtlastdate").value = get_today_date();
}
function cncl_data()
{
}
function load_data_grid(page_limt,page_numb)
{
$("#page-container-form").attr("style","visibility:hidden");
$('#btn_addn').show();
$('#btn_del').show();
$('#btn_save').hide();
$('#btn_cncl').hide();
$('#page-container-main').show();
$('#page-container-grid').show();
$('#page-container-form').hide();
load_data="grid_data";
page_limt=page_limt;
page_numb=page_numb;
task_stat=document.getElementById("seltaskstat").value;
task_prio=document.getElementById("seltaskprio").value;
$.ajax({
type: "POST",
url: "phpscript/task_reminder.php",
data:
{
load_data:load_data,
page_limt:page_limt,
page_numb:page_numb,
task_stat:task_stat,
task_prio:task_prio
},
cache: false,
beforeSend: function()
{
//$('#page_content').html('<img src="images/animate_progress_bar.gif" alt="Processing..." height="50">');
},
success: function(data)
{
$('#page-container-grid').html(data);
},
error: function(data)
{
$("#page-container-grid").html("Error: "+data);
}
});
}
function load_page_limt(page_limt)
{
load_data_grid(page_limt, 1);
}
function form_data(page_mode,prim_data)
{
$("#page-container-form").attr("style","visibility:visible");
$('#btn_addn').hide();
$('#btn_del').hide();
$('#btn_save').show();
$('#btn_cncl').show();
$('#page-container-main').hide();
$('#page-container-grid').hide();
$('#page-container-form').show();
load_data="form_data";
page_mode=page_mode;
task_code=prim_data;
$.ajax({
type: "POST",
url: "phpscript/task_reminder.php",
data:
{
load_data:load_data,
page_mode:page_mode,
task_code:task_code
},
cache: false,
success: function(data)
{
//$('#page-container-form').html(data);
$("#txttasktitl").focus();
$('#tabl_remn').hide();
remind_me();
},
error: function(data)
{
$('#page-container-form').html("Error: "+data);
}
});
}
function save_page()
{
if(document.getElementById("txttasktitl").value=="")
{
alert("Please enter task title!");
txttasktitl.focus();
return false;
}
if(document.getElementById("txttaskdesc").value=="")
{
alert("Please enter task description!");
txttaskdesc.focus();
return false;
}
load_data="save_page";
page_mode=document.getElementById("txtpagemode").value;
task_code=document.getElementById("txttaskcode").value;
task_type=document.getElementById("txttasktype").value;
task_date=document.getElementById("txttaskdate").value;
task_titl=document.getElementById("txttasktitl").value;
task_desc=document.getElementById("txttaskdesc").value;
task_empl=document.getElementById("txttaskempl").value;
assn_empl=$('input[name=txtassnempl]:checked').val();
task_remk=document.getElementById("txttaskremk").value;
task_prio=document.getElementById("txttaskprio").value;
strt_date=document.getElementById("txtstrtdate").value;
last_date=document.getElementById("txtlastdate").value;
comp_date=document.getElementById("txtcompdate").value;
task_stat=document.getElementById("txttaskstat").value;
remn_occr=document.getElementById("txtremnoccr").value;
remn_intr=document.getElementById("txtremnintr").value;
$.ajax({
type: "POST",
url: "phpscript/task_reminder.php",
data:
{
load_data:load_data,
page_mode:page_mode,
task_code:task_code,
task_type:task_type,
task_date:task_date,
task_titl:task_titl,
task_desc:task_desc,
task_empl:task_empl,
assn_empl:assn_empl,
task_remk:task_remk,
task_prio:task_prio,
strt_date:strt_date,
last_date:last_date,
comp_date:comp_date,
task_stat:task_stat,
remn_occr:remn_occr,
remn_intr:remn_intr
},
cache: false,
beforeSend: function()
{
$('#page-container-form').html('<img src="images/animate_progress_bar.gif" alt="Processing..." height="50">');
},
success: function(data)
{
$('#page-container-form').html('');
alert(data.mesg);
load_data_grid(13, 1);
},
error: function(data)
{
$('#page-container-form').html('');
alert("Error: "+data);
//load_data_grid(13, 1);
}
});
}
$("#txtworkstat").change(function(){
if(document.getElementById("txtworkstat").value!='COMPLETED')
{
document.getElementById("txtcompdate").value='';
}
else
{
document.getElementById("txtcompdate").value=date('');
}
});
function remind_me()
{
if(document.getElementById("chkremnreqr").checked)
{
$("#tabl_remn").show();
}
else
{
$("#tabl_remn").hide();
}
}
|