1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
| function getHTTPObject() {
var xmlhttp;
if(window.XMLHttpRequest){
xmlhttp = new XMLHttpRequest();
}
else if (window.ActiveXObject){
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
if (!xmlhttp){
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
}
}
return xmlhttp;
}
var http = getHTTPObject(); // We create the HTTP Object
/*
Funtion Name=requestInfo
Param = url >> Url to call : id = Passing div id for multiple use ~ as a seprator for eg. div1~div2 :
redirectPage >> if you like to redirect to other page once the event success then
the response text = 1 and the redirectPage not left empty
*/
function requestInfo(url,id) {
//alert("Fonction trouvable request:"+url);
var temp=new Array();
http.open("GET", url, true);
http.onreadystatechange = function() {
if (http.readyState == 4) {
if(http.status==200) {
var results=http.responseText;
document.getElementById("showTable").innerHTML=results;
}
}
};
http.send(null);
}
/*
Function Name= emptyValidation
Desc = This function is used to validation for the empty field
Param fieldList = This arguments set as a string varialble. you just need to supply the textbox name
if the textbox is multiple then supply with ~ separator for eg. username~password
*/
function checkValidation(fieldList){
var field=new Array();
field=fieldList.split("~");
var counter=0;
for(i=0;i<field.length;i++) {
if(document.getElementById(field[i]).value=="") {
document.getElementById(field[i]).style.backgroundColor="#FF0000";
counter++;
} else {
document.getElementById(field[i]).style.backgroundColor="#FFFFFF";
}
}
if(counter>0) {
alert("The Field mark as red could not left empty");
return false;
} else {
return true;
}
}
function loginProcess() {
var var_entre_date=document.getElementById("entre_date").value;
var var_fin_date=document.getElementById("fin_date").value;
var var_choix_lieux=document.getElementById("choix_lieux").value;
var var_choix_tpe=document.getElementById("choix_tpe").value;
var var_cheque=document.getElementById("cheque").value;
var var_facture_client=document.getElementById("facture_client").value;
var var_type_transaction=document.getElementById("type_transaction").value;
var var_No_vendeur=document.getElementById("No_vendeur").value;
var var_errors="";
if(var_entre_date==""){
var_errors+="Vous avez oublié d'entrer la date de début<br />";
}
if(var_fin_date==""){
var_errors+="Vous avez oublié d'entrer la date de fin<br /> ";
}
if(var_choix_lieux==""){
var_errors+="Vous avez oublié de remplir le champ de choix lieux\n ";
}
if(var_choix_tpe==""){
//var_errors+="Vous avez oublié de remplir le champ de choix TPE\n ";
}
if(var_cheque==""){
//var_errors+="Vous avez oublié de remplir le champ chèque\n ";
}
if(var_facture_client==""){
//var_errors+="Vous avez oublié de remplir le champ No. facture/No. client\n ";
}
if(var_type_transaction==""){
//var_errors+="Vous avez oublié d'entrer le type de transaction\n ";
}
if(var_No_vendeur==""){
//var_errors+="Vous avez oublié d'entrer le No. de vendeur\n ";
}
if(var_errors==""){
//document.getElementById("default").style.display='none';
// Formattage de la date debut: yy-mm-jj(08-05-23)
var var_entre_date_format=var_entre_date.substring(6,8)+'-'+var_entre_date.substring(3,5)+'-'+var_entre_date.substring(0,2);
// transmission date fin au format:yy-mm-jj(08-05-23)
var var_fin_date_format=var_fin_date.substring(6,8)+'-'+var_fin_date.substring(3,5)+'-'+var_fin_date.substring(0,2);
document.getElementById("errors").innerHTML="";
requestInfo("includes/showTable.php?entre_date="+var_entre_date_format+"&fin_date="+var_fin_date_format+"&choix_lieux="+var_choix_lieux+"&choix_tpe="+var_choix_tpe+"&cheque="+var_cheque+"&facture_client="+var_facture_client+"&type_transaction="+var_type_transaction+"&No_vendeur="+var_No_vendeur,true,'showTable');
}else{
//document.getElementById("default").style.display='block';
document.getElementById("showTable").innerHTML="";
document.getElementById("errors").innerHTML=var_errors;
}
} |
Partager