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
| /******************************************************************************************/
/****************************Fichier JS pour la génération du tableau*******************/
/******************************************************************************************/
/******************************************************************************************/
function createTable(tbody, rows, cols){
var select_month = document.getElementById("select_month"); // Récupération du menu déroulant pour les mois
for(i=0;i<10;i++){
var option = document.createElement("OPTION"); // Création de la balise OPTION
option.innerText += "Juillet 2011"; // Affectation du texte ( A remplir en fonction de la BDD)
select_month.appendChild(option);
}
var row_entete = document.getElementById("row_entete"); // row_entete : Première ligne du tableau représentant les en-tetes
var nb_lots = //select count(*) from lots
var tab_lots = // select nom_lot from lots
var tab_act = // select nom_act from activité
for(i=0;i<nb_lots;i++){ // 30 a remplacer par nb_col
var nb_lots= // select count(id_act) from correspond where id_lots = tab_lots[i]
var th = document.createElement("th");
var div = document.createElement("div");
th.className="vertical";
th.id="en-tete"+i;
div.className="vertical";
div.innerText += "[Projet]Lot_machin_bidule";
th.appendChild(div); // On met div dans th
row_entete.appendChild(th); // on met th dans la ligne d'en-tetes
alert(row_entete.innerHTML);
}
/* Création du bouton pour passer au mois suivant*/
var month= document.getElementById("month");
var next_month = document.createElement("input");
next_month.type="submit";
next_month.value="Mois Suivant";
next_month.src="images/connect.png";
next_month.id="next_month";
month.appendChild(next_month);
} |
Partager