Hiding onyx2 directory

This commit is contained in:
Némunaire 2012-01-15 15:50:31 +01:00
commit c1aeb11c6d
149 changed files with 1 additions and 1 deletions

View file

@ -0,0 +1,537 @@
var GSPC_origin_liste = false;
var GSPC_liste = false;
var GSPC_lastSort = -1;
var GSPC_delay = null;
var nbParPage = 50;
//On charge la liste des porte-clés
function GSPC_loadList()
{
GSPC_origin_liste = false;
GSPC_liste = false;
GSPC_lastSort = -1;
$('nbpc').innerHTML = '<img src="applications/GSPC/loader.gif" alt="Chargement en cours ...">';
new Ajax.Request(
'ajax.php',
{
method: 'get',
parameters: {d: "action", a: "GSPC", p: "liste"},
onSuccess: GSPC_parseList,
onFailure: function() { printEtat(3); }
}
);
}
GSPC_loadList();
//Une fois la liste reçue, on la parse
function GSPC_parseList(transport, json)
{
$('nbpc').innerHTML = json.nombre;
var liste = transport.responseXML.documentElement.getElementsByTagName("liste")[0].getElementsByTagName("porteclef");
GSPC_origin_liste = new Array();
for (var i = 0; i < liste.length; i++)
{
var elt = liste[i];
GSPC_origin_liste.push([elt.getAttribute("id"), elt.getAttribute("nom"), elt.getAttribute("caracteristique"), elt.getAttribute("ligne"), elt.getAttribute("special")])
}
}
//Met en place le formulaire d'ajout de porte-clé
function GSPC_add()
{
if (GSPC_delay)
clearTimeout(GSPC_delay);
$('contenu').innerHTML = "";
var titre = document.createElement("h2");
titre.innerHTML = "Ajout d'un porte-clef à la base de données";
$('contenu').appendChild(titre);
GSPC_addScreen(false);
}
//Affiche la liste des porte-clés
function GSPC_list()
{
if (GSPC_delay)
clearTimeout(GSPC_delay);
window.scrollTo(0,0);
$('contenu').innerHTML = "";
var titre = document.createElement("h2");
titre.innerHTML = "Liste des porte-clefs";
$('contenu').appendChild(titre);
GSPC_liste = false;
GSPC_lastSort = -1;
GSPC_viewliste();
}
//Affiche la page de statistiques
function GSPC_stats()
{
if (GSPC_delay)
clearTimeout(GSPC_delay);
window.scrollTo(0,0);
$('contenu').innerHTML = "";
var titre = document.createElement("h2");
titre.innerHTML = "Statistiques";
$('contenu').appendChild(titre);
var tableau = document.createElement("div");
tableau.className = "table cols2";
tableau.id = "stats";
var tableau_head = document.createElement("div");
tableau_head.className = "head";
var head_th = document.createElement("span");
head_th.innerHTML = "Ligne";
tableau_head.appendChild(head_th);
var head_th = document.createElement("span");
head_th.innerHTML = "Nombre";
tableau_head.appendChild(head_th);
tableau.appendChild(tableau_head);
var tableau_body = document.createElement("div");
tableau_body.className = "body";
tableau_body.innerHTML = '<div class="lign elt0 foot">Téléchargement des statistiques en cours ... <img src="applications/GSPC/loader.gif" alt="Veuillez patienter"></div>';
tableau.appendChild(tableau_body);
$('contenu').appendChild(tableau);
new Ajax.Request(
'ajax.php',
{
method: 'get',
parameters: {d: "action", a: "GSPC", p: "stats"},
onSuccess: function(transport, json)
{
var stats = transport.responseXML.documentElement.getElementsByTagName("statistiques")[0];
var nbPC = stats.getElementsByTagName("ligne").length;
tableau_body.innerHTML = "";
for (var i = 0; i < nbPC; i++)
{
if (stats.getElementsByTagName("ligne")[i].getAttribute("nom") != "")
{
var lign = document.createElement("div");
lign.className = "elt" + (i%2);
GSPC_addStatLign(lign, stats.getElementsByTagName("ligne")[i].getAttribute("nom"));
var col = document.createElement("span");
col.innerHTML = stats.getElementsByTagName("ligne")[i].getAttribute("nom");
lign.appendChild(col);
var col = document.createElement("span");
col.innerHTML = stats.getElementsByTagName("ligne")[i].getAttribute("nombre");
lign.appendChild(col);
tableau_body.appendChild(lign);
}
}
lign.className += " foot";
},
onFailure: function() { printEtat(3); }
}
);
}
function GSPC_addStatLign(lign, ligne)
{
lign.onclick = function() { window.scrollTo(0,0); GSPC_viewligne(ligne) };
}
function GSPC_viewligne(ligne)
{
$('contenu').innerHTML = "";
var titre = document.createElement("h2");
titre.innerHTML = "Liste des porte-clefs de la ligne " + ligne;
$('contenu').appendChild(titre);
GSPC_delay_viewligne(ligne);
}
function GSPC_delay_viewligne(ligne)
{
if (GSPC_origin_liste == false)
GSPC_delay = setTimeout(GSPC_delay_viewligne, 200, ligne);
else
{
GSPC_liste = new Array();
for (var i = 0; i < GSPC_origin_liste.length; i++)
{
if (GSPC_origin_liste[i][3] == ligne)
GSPC_liste.push(GSPC_origin_liste[i]);
}
GSPC_lastSort = -1;
GSPC_viewliste();
}
}
function GSPC_addScreen(modif)
{
formulaire = document.createElement("form");
formulaire.id = "add"
formulaire.onsubmit = function(){ checkAndAdd(modif); return false; }
lab_nom = document.createElement("label");
lab_nom.innerHTML = "Nom/marque :";
lab_nom.setAttribute("for", "nompc");
inp_nom = document.createElement("input");
if(modif)
inp_nom.value = GSPC_liste[modif-1][1];
inp_nom.type = "text";
inp_nom.size = "34";
inp_nom.maxLength = "250";
inp_nom.id = "nompc";
lab_carac = document.createElement("label");
lab_carac.innerHTML = "Caractéristiques :";
lab_carac.setAttribute("for", "caracpc");
inp_carac = document.createElement("input");
if(modif)
inp_carac.value = GSPC_liste[modif-1][2];
inp_carac.type = "text";
inp_carac.size = "34";
inp_carac.maxLength = "250";
inp_carac.id = "caracpc";
lab_lign = document.createElement("label");
lab_lign.innerHTML = "Ligne :";
lab_lign.setAttribute("for", "lignepc");
inp_lign = document.createElement("input");
if(modif)
inp_lign.value = GSPC_liste[modif-1][3];
inp_lign.type = "text";
inp_lign.size = "10";
inp_lign.maxLength = "3";
inp_lign.id = "lignepc";
lab_quan = document.createElement("label");
lab_quan.innerHTML = "Quantité :";
lab_quan.setAttribute("for", "quantitepc");
sel_quan = document.createElement("select");
sel_quan.id = "quantitepc";
sel_quan_1 = document.createElement("option");
sel_quan_1.value = "1";
sel_quan_1.innerHTML = "Simple";
sel_quan_2 = document.createElement("option");
sel_quan_2.value = "2";
sel_quan_2.innerHTML = "Double";
sel_quan_3 = document.createElement("option");
sel_quan_3.value = "3";
sel_quan_3.innerHTML = "Triple";
sel_quan_4 = document.createElement("option");
sel_quan_4.value = "4";
sel_quan_4.innerHTML = "Quadruple";
inp_submit = document.createElement("input");
inp_submit.type = "submit";
if (modif)
inp_submit.value = "Modifier";
else
inp_submit.value = "Ajouter";
inp_submit.style.marginLeft = "165px";
formulaire.appendChild(lab_nom);
formulaire.appendChild(inp_nom);
formulaire.appendChild(document.createElement("br"));
formulaire.appendChild(lab_carac);
formulaire.appendChild(inp_carac);
formulaire.appendChild(document.createElement("br"));
formulaire.appendChild(lab_lign);
formulaire.appendChild(inp_lign);
formulaire.appendChild(document.createElement("br"));
formulaire.appendChild(lab_quan);
sel_quan.appendChild(sel_quan_1);
sel_quan.appendChild(sel_quan_2);
sel_quan.appendChild(sel_quan_3);
sel_quan.appendChild(sel_quan_4);
formulaire.appendChild(sel_quan);
formulaire.appendChild(document.createElement("br"));
if(modif)
sel_quan.value = GSPC_liste[modif-1][4];
formulaire.appendChild(document.createElement("br"));
formulaire.appendChild(inp_submit);
if (modif)
{
inp_del = document.createElement("input");
inp_del.type = "button";
inp_del.value = "Supprimer";
inp_del.onclick = function() { GSPC_del(modif); };
inp_del.style.marginLeft = "15px";
formulaire.appendChild(inp_del);
}
$('contenu').appendChild(formulaire);
$('nompc').focus();
confirmation = document.createElement("h3");
confirmation.style.color = "teal";
confirmation.id = "confirm";
$('contenu').appendChild(confirmation);
}
function GSPC_del(modif)
{
$('nompc').disabled = true;
$('caracpc').disabled = true;
$('lignepc').disabled = true;
$('quantitepc').disabled = true;
var ligne = GSPC_liste[modif-1][3];
new Ajax.Request(
'ajax.php?d=action&a=GSPC&p=del',
{
method: 'post',
parameters: {id: GSPC_liste[modif-1][0]},
onSuccess: function(transport, json)
{
if (json.statut != 1)
{
firstLoad();
alert("Vous avez été déconnecté. Le porte-clef n'a pas été enregistré");
}
else
{
$('contenu').innerHTML = "";
confirmation = document.createElement("h2");
confirmation.style.color = "teal";
confirmation.innerHTML = "Porte-clef supprimé avec succès !";
$('contenu').appendChild(confirmation);
$('nbpc').innerHTML = json.nombre;
GSPC_loadList();
GSPC_delay_viewligne(ligne);
}
},
onFailure: function() { printEtat(3); }
}
);
$('contenu').innerHTML = "<h2 class=\"vp\">Veuillez patienter suppression du porte-clef en cours ...</h2>";
}
function checkAndAdd(modif)
{
if(modif)
modif = "&id=" + GSPC_liste[modif-1][0];
else
modif = "";
if ($('nompc').value == "")
{
$('nompc').className = "erreur";
alert('Veuillez indiquer une marque ou un nom !');
$('nompc').focus();
}
else if ($('lignepc').value == "")
{
$('lignepc').className = "erreur";
alert('Veuillez indiquer une ligne !');
$('lignepc').focus();
}
else
{
$('nompc').disabled = true;
$('caracpc').disabled = true;
$('lignepc').disabled = true;
$('quantitepc').disabled = true;
new Ajax.Request(
'ajax.php?d=action&a=GSPC' + modif,
{
method: 'post',
parameters: {nom: $('nompc').value, caracteristique: $('caracpc').value, ligne: $('lignepc').value, quantite: $('quantitepc').value},
onSuccess: function(transport, json)
{
if (json.statut != 1)
{
firstLoad();
alert("Vous avez été déconnecté. Le porte-clef n'a pas été enregistré");
}
else
{
GSPC_loadList();
if(modif)
{
$('contenu').innerHTML = "";
confirmation = document.createElement("h2");
confirmation.style.color = "teal";
confirmation.innerHTML = "Porte-clef modifié avec succès !";
$('contenu').appendChild(confirmation);
$('nbpc').innerHTML = json.nombre;
GSPC_delay_viewligne(lign);
}
else
{
$('nompc').value = "";
$('nompc').className = "";
$('caracpc').value = "";
$('lignepc').className = "";
$('quantitepc').value = 1;
$('nompc').disabled = false;
$('caracpc').disabled = false;
$('lignepc').disabled = false;
$('quantitepc').disabled = false;
$('nbpc').innerHTML = json.nombre;
$('confirm').innerHTML = "Porte-clef ajouté avec succès !";
setTimeout("$('confirm').innerHTML = '';", 3500);
$('nompc').focus();
}
}
},
onFailure: function() { printEtat(3); }
}
);
if(modif)
{
lign = $('lignepc').value;
$('contenu').innerHTML = "<h2 class=\"vp\">Veuillez patienter, modification du porte-clef en cours ...</h2>";
}
}
}
function GSPC_viewliste()
{
var pagination = document.createElement("div");
pagination.className = "pagination top";
pagination.id = "pagination1";
$('contenu').appendChild(pagination);
var tableau = document.createElement("div");
tableau.className = "table cols3";
tableau.id = "list";
var tableau_head = document.createElement("div");
tableau_head.className = "head";
var head_th = document.createElement("span");
head_th.innerHTML = "Nom/Marque";
head_th.onclick = function(){ GSPC_showliste(1, 0); }
tableau_head.appendChild(head_th);
var head_th = document.createElement("span");
head_th.innerHTML = "Caractéristique";
head_th.onclick = function(){ GSPC_showliste(2, 0); }
tableau_head.appendChild(head_th);
var head_th = document.createElement("span");
head_th.innerHTML = "Ligne";
head_th.onclick = function(){ GSPC_showliste(3, 0); }
tableau_head.appendChild(head_th);
tableau.appendChild(tableau_head);
var tableau_body = document.createElement("div");
tableau_body.className = "body";
tableau_body.id = "bodyList";
tableau_body.innerHTML = '<div class="lign elt0 foot">Chargement de la liste en cours ... <img src="applications/GSPC/loader.gif" alt="Veuillez patienter"></div>';
tableau.appendChild(tableau_body);
$('contenu').appendChild(tableau);
var pagination = document.createElement("div");
pagination.className = "pagination bottom";
pagination.id = "pagination2";
$('contenu').appendChild(pagination);
GSPC_showliste(-1, 0);
}
function GSPC_showliste(tri, page)
{
if (GSPC_origin_liste == false)
setTimeout(GSPC_showliste, 200, tri);
else
{
if (GSPC_liste == false)
GSPC_liste = GSPC_origin_liste;
//On tente un tri
if (GSPC_lastSort != tri)
{
$('bodyList').innerHTML = '<div class="lign elt0 foot">Tri de la liste en cours ...</div>';
GSPC_liste = GSPC_liste.sort(function(a,b){return a[tri].localeCompare(b[tri]);});
GSPC_lastSort = tri;
}
nbPages = Math.ceil(GSPC_liste.length / nbParPage);
$('pagination1').innerHTML = "";
$('pagination2').innerHTML = "";
for (var i = 0; i < 4 && i < nbPages; i++)
GSPC_addLinkPagination(i);
if (page > 5 && i < nbPages)
{
$('pagination1').innerHTML += "...";
$('pagination2').innerHTML += "...";
}
for (var i = (page < 6?4:page - 2); (i < page + 3 && i < nbPages); i++)
GSPC_addLinkPagination(i);
if (page <= 5 && i < nbPages)
{
$('pagination1').innerHTML += "...";
$('pagination2').innerHTML += "...";
for (var i = Math.ceil(nbPages/2) - 2; i < nbPages/2 + 2; i++)
GSPC_addLinkPagination(i);
}
if (page + 3 < nbPages - 4)
{
$('pagination1').innerHTML += "...";
$('pagination2').innerHTML += "...";
}
for (var i = (page + 3 >= nbPages - 4?page + 3:nbPages - 4); (i < nbPages); i++)
GSPC_addLinkPagination(i);
start = page * nbParPage;
$('bodyList').innerHTML = "";
for (var i = 0; i < nbParPage && i + start < GSPC_liste.length; i++)
{
var lign = document.createElement("div");
lign.className = "elt" + (i%2);
GSPC_addLinkPC(lign, i + start);
var col = document.createElement("span");
col.innerHTML = GSPC_liste[i + start][1];
lign.appendChild(col);
var col = document.createElement("span");
col.innerHTML = GSPC_liste[i + start][2];
lign.appendChild(col);
var col = document.createElement("span");
col.innerHTML = GSPC_liste[i + start][3];
lign.appendChild(col);
$('bodyList').appendChild(lign);
}
lign.className += " foot"
}
}
function GSPC_addLinkPagination(page)
{
var lnkP = document.createElement("a");
lnkP.href = "javascript:GSPC_showliste(" + GSPC_lastSort + ", " + page + ");";
lnkP.innerHTML = page+1;
$('pagination1').appendChild(lnkP);
var lnkP = document.createElement("a");
lnkP.href = "javascript:GSPC_showliste(" + GSPC_lastSort + ", " + page + ");";
lnkP.innerHTML = page+1;
$('pagination2').appendChild(lnkP);
}
function GSPC_addLinkPC(elt, idPC)
{
elt.onclick = function() {
$('contenu').innerHTML = "";
var titre = document.createElement("h2");
titre.innerHTML = "Modification d'un porte-clef";
$('contenu').appendChild(titre);
GSPC_addScreen(idPC+1);
}
}
function GSPC_apropos()
{
aproposApp("GSPC", "contenu");
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

View file

@ -0,0 +1,280 @@
html {
height: 100%;
}
body {
background: -webkit-gradient(
linear,
left top,
left bottom,
color-stop(0.31, #9eeaff),
color-stop(0.66, #e4f9ff),
color-stop(1.00, #9eeaff)
);
background: -moz-linear-gradient(
center bottom,
#9eeaff 31%,
#e4f9ff 66%,
#9eeaff 100%
);
font-family: serif;
min-height: 80%;
}
a:link, a:visited {
text-decoration: none;
color:#000000;
}
h1 {
text-align: center;
margin-left: 250px;
}
#GSPC_menu a:link, #GSPC_menu a:visited, .pagination a:link, .pagination a:visited {
text-decoration: none;
color:#FFFFFF;
}
#GSPC_menu a:hover, .pagination a:hover, a:hover {
text-decoration: underline;
}
.news {
background: -webkit-gradient(
linear,
left top,
right bottom,
color-stop(0.31, #93b4ff),
color-stop(0.66, #c5ceff)
);
background: -moz-linear-gradient(
right bottom,
#93b4ff 31%,
#c5ceff 66%
);
border: 2px solid #5290ff;
border-radius: 17px;
box-shadow: 3px 4px 5px #444466;
height: 127px;
margin: auto;
padding: 20px;
text-align: left;
width: 75%;
}
.vp {
color: orange;
}
#GSPC_menu {
background: -webkit-gradient(
linear,
left top,
left bottom,
color-stop(0.31, #5290ff),
color-stop(0.90, #a3c4ff)
);
background: -moz-linear-gradient(
center bottom,
#5290ff 31%,
#a3c4ff 90%
);
border-right: 2px dotted white;
color:#FFFFFF;
font-weight: bold;
height: 100%;
left: 0px;
list-style: none;
margin: 0;
-webkit-padding-start: 0;
position: fixed;
text-align: center;
top: 0px;
width: 250px;
}
#GSPC_menu h2 {
margin-left: 69px;
}
#GSPC_menu li {
margin-bottom: 40px;
text-align: center;
width: 250px;
}
#GSPC_menu li[onclick] {
cursor: pointer;
}
#GSPC_menu li[onclick]:hover {
text-decoration: underline;
}
span#nompc img {
margin-top: 3px;
}
div#contenu {
margin-left: 250px;
text-align: center;
}
form#add {
background: -webkit-gradient(
linear,
left top,
right bottom,
color-stop(0.31, #c9b5e8),
color-stop(0.95, #e4daf4)
);
background: -moz-linear-gradient(
center bottom,
#c9b5e8 31%,
#e4daf4 95%
);
border: 1px solid #8A77A1;
border-radius: 25px;
box-shadow: 2px 2px 5px #333355;
height: 205px;
margin: auto;
padding: 13px;
text-align: left;
width: 456px;
}
label {
float: left;
display: block;
font-weight: bold;
margin: 10px 7px 10px 0;
text-align: right;
width: 170px;
}
label:hover {
text-decoration: underline;
}
input[type=text], select {
margin: 10px 0;
transition: background 0.75s;
-moz-transition: background 0.75s;
-webkit-transition: background 0.75s;
-o-transition: background 0.75s;
}
input, select {
background: #00EAF5;
border: #009AA5 solid 1px;
border-radius: 3px;
margin-top: 5px;
}
input:hover, input:focus, select:hover, select:focus {
background: #95cdff;
}
input#nompc {
font-variant: small-caps;
}
input#lignepc {
text-transform:uppercase;
}
input.erreur, select.erreur {
background: #CC0000;
border: #A59A00 solid 1px;
}
.table {
border: 1px solid black;
border-radius: 10px;
box-shadow: 3px 3px 5px #666666;
margin: auto;
}
.table .body div {
transition: background 500ms;
-moz-transition: background 500ms;
-webkit-transition: background 500ms;
-o-transition: background 500ms;
}
.table .body div.elt0 {
background: #5c93a0;
}
.table .body div.elt1 {
background: #5c96a5;
}
.table .body div:hover {
background: #73B14b;
}
.table.cols2 div span {
display: inline-block;
width: 50%;
}
.table.cols3 div span {
display: inline-block;
width: 45%;
}
.table.cols3 div span+span+span {
width: 10%;
}
.table.cols3 div.body span {
text-transform: uppercase;
}
.table.cols3 div.body span+span {
text-transform: none;
}
.table.cols3 div.body span+span+span {
text-transform: uppercase;
}
.table div.lign {
display: inline-block;
width: 100%;
}
.table .head {
background: #1070c9;
border-bottom: 1px solid black;
border-radius: 10px 10px 0 0;
font-weight: bolder;
display: block;
text-align: center;
width: 100%;
}
.table .foot { border-radius: 0 0 10px 10px; }
.table#stats {
width: 42%;
}
.table#list {
width: 83%;
}
.table#list .head {
cursor: pointer;
}
.table .body div {
cursor: pointer;
}
.pagination {
background: #1070c9;
border: 1px solid black;
color: white;
margin: auto;
width: 442px;
}
.pagination.top {
border-radius: 10px 10px 0 0;
border-bottom: none;
}
.pagination.bottom {
border-top: none;
border-radius: 0 0 10px 10px;
box-shadow: 0px 2px 7px #666666;
}
.pagination a {
cursor: pointer;
padding: 0 5px;
}