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
|
$("#carte").live("pagebeforeshow", function(){
$(".LBL_NumTable").html("Table N°" + _numTable);
//
var _Resultat = "<h3>La carte.</h3>";
$.get("script_php/carte.php",
function(res){
var ancienne_categorie = "Null"
var ancien_type = "Null"
for(var i = 0; i < res.length; i++){
//Variables
var num_cat = res[i].I_NUM_CAT;
var num_typ = res[i].I_NUM_TYP;
var num_pro = res[i].I_NUM_PRO;
var description_cat = res[i].T_DESCRIPTION_CAT;
var description_typ = res[i].T_DESCRIPTION_TYP;
var nom_pro = res[i].T_NOM_PRO;
var image_pro = res[i].T_IMAGE_PRO;
//Recuperation des categories
if(num_cat != ancienne_categorie) {
if(i > 0) {
_Resultat += "</div></div>";
}
_Resultat += "<div data-role='collapsible'><h5>"+description_cat+"</h5><div data-role='listview' class='Carte_Lv' style='margin-left:0px;margin-right:0px;'>";
}
//Recuperation des types
if(num_typ != ancien_type) {
_Resultat += "<li data-role='list-divider' class='ui-bar-e'>"+description_typ+"</li>";
}
//Recuperation des produits
_Resultat += "<li style='padding:0px 0px 0px 0px;'><div class='Selecteur_Produit'><img src='"+image_pro+"' width='45' height='45' class='Min_Image'/><div class='Text_Liste_Produit'>"+nom_pro+"</div></div></li>"
//
ancien_type = num_typ
ancienne_categorie = num_cat;
}
$("#LaCartee").html(_Resultat).trigger('create');
},"json");
$(".Selecteur_Produit").click(function(){alert("");});
}); |