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 133
| $.each (data.TabResult, function(ligne, retourjson)
{
if(ligne==0)
{
$header=$('<tr/>').addClass('header');
$.each(retourjson, function(titre, retour)
{
// switch pour renommer ma ligne titre
switch(titre)
{
case "NI": titre="Num<br />Intervention"
break;
case "TypeInt": titre="";
break;
case "Auth": titre="";
break;
case "NF": if(TypeRech=="Fax") titre="Num<br />Fax"; if(TousDevisImp == 1) titre = "Type<br />Comm";
break;
case "Expe": if(TypeRech=="Mails") titre="Adresse<br />Expéditeur";
break;
case "Desti": if(TypeRech=="Mails") titre="Adresse<br />Destinataire";
break;
case "TDoc": titre="Type<br />Document";
break;
case "MtTotDoc": titre="Total<br />Imprimé";
break;
case "NDoc": titre="";
break;
case "CCli": titre="Code<br />Client";
break;
case "NCli": titre="Nom<br />Client";
break;
case "DCreat": titre="Date<br />Création";
break;
case "HCreat": titre="Heure<br />Création";
break;
case "DEnvoi": titre="Date<br />Envoi";
break;
case "HEnvoi": titre="Heure<br />Envoi";
break;
case "DValid": titre="Date<br />Validation";
break;
case "HValid": titre="Heure<br />Validation";
break;
case "CodeDem": titre="Code<br />Demandeur";
break;
case "CodeVal": titre="Validé<br />par";
break;
case "Tentative": titre="Nb Tentatives<br />Envoi"; if(TousDevisImp == 1) titre = "";
break;
case "CE": titre="Cause<br />Echec"; if(TousDevisImp == 1) titre = "";
break;
case "Envoi": titre="";
break;
case "Mess": titre="Estimation<br />avant envoi"; if(TousDevisImp == 1) titre = "";
break;
}
if(titre!="")
{
$cell=$('<td/>').html(titre);
$header.append($cell);
}
});
$('#myTable').append($header);
}
$ligne=$('<tr/>');
// Affiche tableau des select
if(TypeRech == "Fax" || TypeRech == "Mails")
{
// construit les lignes avec les données retour
$.each(retourjson, function(titre, retour)
{
// toutes les colonnes que je ne souhaite pas afficher
if(titre!="TypeInt" && titre!="Auth" && titre!="NDoc" && titre!="Envoi")
{
if(titre == 'MtTotDoc') retour = Arrondir(retour, 2);
if(titre == 'MtTotDoc') Total += +retour;
if(titre == 'MtTotDoc') retour += ' ';
if(retour == '0 ') retour = '- ';
if(retour == '00-00-0000' || retour == '00:00:00') retour = '';
$cell=$('<td/>').html(retour);
$ligne.append($cell);
}
});
}
// Affiche tableau "Tous les devis imprimés" checkbox cochée
if(TousDevisImp == 1)
{
// construit les lignes avec les données retour
$.each(retourjson, function(titre, retour)
{
// toutes les colonnes que je ne souhaite pas afficher
if(titre!="TypeInt" && titre!="Auth" && titre!="NDoc" && titre!="Envoi" && titre != "Expe" && titre != "Desti" && titre != "Tentative" && titre != "CE" && titre != "Mess")
{
if(titre == 'MtTotDoc') retour = Arrondir(retour, 2);
if(titre == 'MtTotDoc') Total += +retour;
if(titre == 'MtTotDoc') retour += ' ';
if(retour == '0 ') retour = '- ';
if(retour == '00-00-0000' || retour == '00:00:00') retour = '';
$cell=$('<td/>').html(retour);
$ligne.append($cell);
}
});
}
$('#myTable').append($ligne);
}); |
Partager