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
|
function CreationPage(P_Terrain) {
WFichier = G_RepXML + G_TERRAIN + ".xml";
$(document).ready(
function()
{
$.ajax( {
type: "GET",
url: WFichier,
dataType: "xml",
success: function(xml)
{
$(xml).find('TERRAINS').each(
function() {
var WCode_Terrain = $(this).attr('code_terrain');
var WNom_Terrain = $(this).attr('nom_terrain');
// Application de la classe pour le nom de l'aérodrome.
var ObjCell = document.getElementById("Cell_Titre");
ObjCell.className = "SousTitre";
Cell_Titre.innerHTML = WNom_Terrain;
}
)
$(xml).find('SECTIONS SECTION').each(
function() {
var WNom_Section = $(this).attr('nom_section');
var WCell_Section = $(this).attr('cell_section');
// var ObjCell = document.getElementById(WCell_Section);
// ObjCell.className = "Section";
// ObjCell.innerHTML = WNom_Section;
// Ajout d'un ligne à la table Tab_Stage
var newRow = document.getElementById('Tab_Stage').insertRow(-1);
newRow.className = "LigneTitre";
var newCell = newRow.insertCell(0);
newCell.className = "Cellule1";
var newCell = newRow.insertCell(1);
newCell.className = "Cellule2";
newCell.className = "Titre";
newCell.innerHTML = WNom_Section;
var newCell = newRow.insertCell(2);
newCell.className = "Cellule1";
}
)
alert("APRES SECTION");
$(xml).find('SECTIONS ZONE_SAISIE').each(
function() {
var WLib = $(this).find('LIB').text();
var WElement = $(this).find('ELEMENT').text();
var WType = $(this).find('TYPE').text();
var WSize = $(this).find('SIZE').text();
var WMax_Car = $(this).find('MAX_CAR').text();
var WCellule = $(this).find('CELLULE').text();
var WLig = $(this).find('LIG').text();
var WCol = $(this).find('COL').text();
var WInit = $(this).find('INIT').text();
var WClasse = $(this).find('NOM_CLASSE').text();
// Création de l'élément
if (WElement == "")
{
};
alert("APRES ZONE_SAISIE");
var oInput = document.createElement(WElement);
oInput.setAttribute('type', WType);
oInput.setAttribute('size', WSize); // Taille de l'input à l'écran
oInput.setAttribute('maxlength', WMax_Car);
oInput.setAttribute('value', WInit);
var ObjTab = document.getElementById("Tab_Stage");
ObjTab.rows[WLig].cells[WCol].appendChild(oInput);
var WObjCell = document.getElementById(WCellule);
WObjCell.innerHTML = WLib;
alert("après");
}
)
}
}
);
}
);
} |