Version 0.3: replace Prototype by JQuery and use bootstrap
This commit is contained in:
parent
32b69fbd20
commit
ad51d9da73
39 changed files with 19615 additions and 8436 deletions
8
htdocs/applications/GSM/album.js
Normal file
8
htdocs/applications/GSM/album.js
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
function Album(elt)
|
||||
{
|
||||
this.id = elt.getAttribute("id");
|
||||
this.type = parseInt(elt.getAttribute("type"));
|
||||
this.titre = elt.getAttribute("titre");
|
||||
if (elt.hasAttribute("couleur"))
|
||||
this.color = elt.getAttribute("couleur");
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -13,7 +13,7 @@ $nom = gpc('auteur', 'post');
|
|||
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($nom);
|
||||
$chanteurs = $bdd->query("SELECT chanteur FROM gsm WHERE chanteur LIKE '$nom%' GROUP BY chanteur;");
|
||||
$chanteurs = $bdd->query("SELECT artiste FROM gsm_titres WHERE artiste LIKE '$nom%' GROUP BY artiste;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (!empty($chanteurs) && !empty($nom))
|
||||
|
|
@ -21,7 +21,7 @@ if (!empty($chanteurs) && !empty($nom))
|
|||
print "<ul>\n";
|
||||
foreach ($chanteurs as $chanteur)
|
||||
{
|
||||
print ' <li>'.$chanteur["chanteur"]."</li>\n";
|
||||
print ' <li>'.$chanteur["artiste"]."</li>\n";
|
||||
}
|
||||
print "</ul>";
|
||||
}
|
||||
|
|
|
|||
45
htdocs/applications/GSM/chanson.js
Normal file
45
htdocs/applications/GSM/chanson.js
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
function Chanson(elt)
|
||||
{
|
||||
this.albums = new Array();
|
||||
if (elt)
|
||||
{
|
||||
this.id = elt.getAttribute("id");
|
||||
this.titre = elt.getAttribute("titre");
|
||||
this.artiste = elt.getAttribute("artiste");
|
||||
|
||||
for (var albm in elt.getElementsByTagName("inalbum"))
|
||||
{
|
||||
if (albm.isInt())
|
||||
this.albums.push(elt.getElementsByTagName("inalbum")[albm].getAttribute("id"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Chanson.prototype.inAlbum = function(idAlbum, types)
|
||||
{
|
||||
for (var i = 0; i < this.albums.length; i++)
|
||||
{
|
||||
if (
|
||||
(typeof(idAlbum) == 'undefined' || this.albums[i] == idAlbum) &&
|
||||
(typeof(types) == 'undefined' || types.in_array(GSM_liste_CDs[this.albums[i]].type))
|
||||
)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Chanson.prototype.search = function(titre, artiste, album, types)
|
||||
{
|
||||
if (
|
||||
(titre == '' || this.titre.toLowerCase().indexOf(titre.toLowerCase()) >= 0) &&
|
||||
(artiste == '' || this.artiste.toLowerCase().indexOf(artiste.toLowerCase()) >= 0)
|
||||
)
|
||||
{
|
||||
for (var i = 0; i < this.albums.length; i++)
|
||||
{
|
||||
if (album == '' || GSM_liste_CDs[this.albums[i]].titre.toLowerCase().indexOf(album.toLowerCase()) >= 0)
|
||||
return (types.length == 0 || types.in_array(GSM_liste_CDs[this.albums[i]].type));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -2,10 +2,10 @@
|
|||
{
|
||||
border: solid 1px black;
|
||||
display: table-cell;
|
||||
height: 11.5cm;
|
||||
height: 12cm;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
width: 11.5cm;
|
||||
width: 12cm;
|
||||
}
|
||||
|
||||
.front .title, .front .cd
|
||||
|
|
@ -24,9 +24,10 @@
|
|||
.back
|
||||
{
|
||||
border: solid 1px black;
|
||||
color: black;
|
||||
display: table;
|
||||
height: 11.1cm;
|
||||
width: 14.4cm;
|
||||
height: 11.8cm;
|
||||
width: 15.3cm;
|
||||
}
|
||||
|
||||
.back .title
|
||||
|
|
@ -43,10 +44,10 @@
|
|||
.back .left, .back .right
|
||||
{
|
||||
display: block;
|
||||
height: 11.1cm;
|
||||
height: 11.8cm;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
width: 0.7cm;
|
||||
width: 0.8cm;
|
||||
}
|
||||
.back .left
|
||||
{
|
||||
|
|
@ -71,6 +72,7 @@
|
|||
{
|
||||
-webkit-transform: rotate(-90deg);
|
||||
-moz-transform: rotate(-90deg);
|
||||
transform: rotate(-90deg);
|
||||
text-align: center;
|
||||
width: 11.1cm;
|
||||
}
|
||||
|
|
@ -78,6 +80,7 @@
|
|||
{
|
||||
-webkit-transform: rotate(90deg);
|
||||
-moz-transform: rotate(90deg);
|
||||
transform: rotate(90deg);
|
||||
text-align: center;
|
||||
width: 11cm;
|
||||
}
|
||||
|
|
@ -95,5 +98,5 @@
|
|||
.back .author
|
||||
{
|
||||
float: right;
|
||||
width: 50%;
|
||||
width: 45%;
|
||||
}
|
||||
|
|
@ -6,11 +6,8 @@ body
|
|||
width: 18cm;
|
||||
}
|
||||
|
||||
h1 {
|
||||
display: none;
|
||||
}
|
||||
#GSM_menu {
|
||||
display: none;
|
||||
#bt-menu, h1, menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.back .center
|
||||
|
|
@ -18,7 +15,3 @@ h1 {
|
|||
overflow:hidden;
|
||||
height: 11.1cm;
|
||||
}
|
||||
.back .center ol
|
||||
{
|
||||
-webkit-margin-before: 0.5em;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
html {
|
||||
height: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
|
|
@ -19,27 +19,26 @@ body {
|
|||
);
|
||||
|
||||
font-family: serif;
|
||||
margin-bottom: 10px;
|
||||
min-height: 80%;
|
||||
min-height: 80%;
|
||||
}
|
||||
|
||||
a:link, a:visited {
|
||||
text-decoration: none;
|
||||
color:#000000;
|
||||
text-decoration: none;
|
||||
color:#000000;
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
margin-left: 250px;
|
||||
text-align: center;
|
||||
margin-left: 250px;
|
||||
}
|
||||
|
||||
.pagination a:link, .pagination a:visited {
|
||||
text-decoration: none;
|
||||
color:#FFFFFF;
|
||||
text-decoration: none;
|
||||
color:#FFFFFF;
|
||||
}
|
||||
|
||||
.pagination a:hover, a:hover {
|
||||
text-decoration: underline;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.news {
|
||||
|
|
@ -60,9 +59,9 @@ h1 {
|
|||
border-radius: 17px;
|
||||
box-shadow: 3px 4px 5px #444466;
|
||||
|
||||
height: 127px;
|
||||
height: 140px;
|
||||
margin: auto;
|
||||
padding: 20px;
|
||||
padding: 0 20px;
|
||||
text-align: left;
|
||||
width: 75%;
|
||||
}
|
||||
|
|
@ -71,7 +70,7 @@ h1 {
|
|||
color: orange;
|
||||
}
|
||||
|
||||
#GSM_menu {
|
||||
menu {
|
||||
background: -webkit-gradient(
|
||||
linear,
|
||||
left top,
|
||||
|
|
@ -92,36 +91,35 @@ h1 {
|
|||
left: 0px;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
-webkit-padding-start: 0;
|
||||
padding: 0;
|
||||
position: fixed;
|
||||
text-align: center;
|
||||
top: 0px;
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
#GSM_menu h2 {
|
||||
menu h2 {
|
||||
margin-left: 69px;
|
||||
}
|
||||
|
||||
#GSM_menu li {
|
||||
menu > li {
|
||||
margin-bottom: 40px;
|
||||
text-align: center;
|
||||
width: 250px;
|
||||
}
|
||||
#GSM_menu li[onclick] {
|
||||
menu > li ul {
|
||||
margin-left: 20px;
|
||||
}
|
||||
menu > li li {
|
||||
margin-top: 5px;
|
||||
}
|
||||
menu li[onclick] {
|
||||
cursor: pointer;
|
||||
}
|
||||
#GSM_menu li[onclick]:hover {
|
||||
menu li[onclick]:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
label {
|
||||
font-weight: bold;
|
||||
}
|
||||
label:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
form {
|
||||
background: -webkit-gradient(
|
||||
linear,
|
||||
|
|
@ -138,101 +136,40 @@ form {
|
|||
border: 1px solid #ff9b42;
|
||||
border-radius: 25px;
|
||||
box-shadow: 2px 2px 5px #553333;
|
||||
}
|
||||
|
||||
form#addAlbms {
|
||||
margin: auto;
|
||||
padding: 13px;
|
||||
text-align: left;
|
||||
width: 345px;
|
||||
}
|
||||
form#addAlbms div {
|
||||
text-align: center;
|
||||
}
|
||||
form#addAlbms div#testColor {
|
||||
background-color: black;
|
||||
border: solid 1px black;
|
||||
display: inline-block;
|
||||
height: 1em;
|
||||
margin-left: 5px;
|
||||
margin-bottom: -4px;
|
||||
width: 2em;
|
||||
}
|
||||
|
||||
form#ajout {
|
||||
height: 182px;
|
||||
margin: 10px auto;
|
||||
padding: 13px;
|
||||
text-align: left;
|
||||
width: 642px;
|
||||
}
|
||||
form#ajout input[type=text] {
|
||||
width: 444px;
|
||||
}
|
||||
form#ajout select {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
form#ajout label {
|
||||
float: left;
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
margin: 10px 7px 10px 0;
|
||||
text-align: right;
|
||||
width: 110px;
|
||||
}
|
||||
form#ajout 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: #FF6600;
|
||||
border: #CA2A20 solid 1px;
|
||||
border-radius: 3px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
input:hover, input:focus, select:hover, select:focus {
|
||||
background: #CC6600;
|
||||
}
|
||||
|
||||
input.erreur, select.erreur {
|
||||
background: #CC0000;
|
||||
form#addAlbum {
|
||||
padding: 14px;
|
||||
width: 456px;
|
||||
}
|
||||
|
||||
div#GSM_menu {
|
||||
background: url(backmenu.png);
|
||||
color:#FFFFFF;
|
||||
top: 0px;
|
||||
font-weight: bold;
|
||||
height: 1200px;
|
||||
padding-top: 30px;
|
||||
position: fixed;
|
||||
text-align: center;
|
||||
left: 0px;
|
||||
width: 250px;
|
||||
background: url(backmenu.png);
|
||||
color:#FFFFFF;
|
||||
top: 0px;
|
||||
font-weight: bold;
|
||||
height: 1200px;
|
||||
padding-top: 30px;
|
||||
position: fixed;
|
||||
text-align: center;
|
||||
left: 0px;
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
div#GSM_menu h2 {
|
||||
margin-bottom: 40px;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
div#contenu {
|
||||
margin-left: 250px;
|
||||
text-align: center;
|
||||
margin-left: 250px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.table {
|
||||
border: 1px solid black;
|
||||
border-radius: 10px;
|
||||
box-shadow: 3px 3px 5px #666666;
|
||||
margin: auto;
|
||||
margin: auto;
|
||||
}
|
||||
.table .body div {
|
||||
transition: background 500ms;
|
||||
|
|
@ -241,32 +178,32 @@ div#contenu {
|
|||
-o-transition: background 500ms;
|
||||
}
|
||||
.table .body div.elt0 {
|
||||
background: #ec7d60;
|
||||
background: #ec7d60;
|
||||
}
|
||||
.table .body div.elt1 {
|
||||
background: #f68063;
|
||||
background: #f68063;
|
||||
}
|
||||
.table .body div:hover {
|
||||
background: #fa8022;
|
||||
background: #fa8022;
|
||||
}
|
||||
.table.cols2 div span {
|
||||
display: inline-block;
|
||||
display: inline-block;
|
||||
width: 40%;
|
||||
}
|
||||
.table.cols3 div span {
|
||||
display: inline-block;
|
||||
display: inline-block;
|
||||
width: 40%;
|
||||
}
|
||||
.table.cols3 div span+span+span {
|
||||
width: 20%;
|
||||
}
|
||||
.table div.lign {
|
||||
display: inline-block;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.table .head {
|
||||
background: #f26340;
|
||||
background: #f26340;
|
||||
border-bottom: 1px solid black;
|
||||
border-radius: 10px 10px 0 0;
|
||||
font-weight: bolder;
|
||||
|
|
@ -278,21 +215,21 @@ div#contenu {
|
|||
|
||||
.table.stats {
|
||||
float: left;
|
||||
margin: 0 1%;
|
||||
margin: 0 1%;
|
||||
width: 31%;
|
||||
}
|
||||
.table#list {
|
||||
width: 83%;
|
||||
}
|
||||
.table#list .head {
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
}
|
||||
.table .body div {
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
background: #f26340;
|
||||
background: #f26340;
|
||||
border: 1px solid black;
|
||||
color: white;
|
||||
margin: auto;
|
||||
|
|
@ -308,13 +245,13 @@ div#contenu {
|
|||
box-shadow: 0px 2px 7px #666666;
|
||||
}
|
||||
.pagination a {
|
||||
cursor: pointer;
|
||||
padding: 0 5px;
|
||||
cursor: pointer;
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.front, .back
|
||||
{
|
||||
background: white;
|
||||
background: white;
|
||||
}
|
||||
.back .center
|
||||
{
|
||||
|
|
@ -322,10 +259,11 @@ div#contenu {
|
|||
}
|
||||
.back ol li:hover
|
||||
{
|
||||
background-color: teal;
|
||||
background-color: teal;
|
||||
}
|
||||
|
||||
div.autocomplete {
|
||||
margin-top: 20px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
div.autocomplete
|
||||
{
|
||||
margin-top: 20px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,531 +7,441 @@ 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_origin_liste = false;
|
||||
GSPC_liste = false;
|
||||
GSPC_lastSort = -1;
|
||||
$('#nbpc').html('<img src="applications/GSPC/loader.gif" alt="Chargement en cours ...">');
|
||||
|
||||
$.ajax({
|
||||
url: "ajax.php",
|
||||
data: {d: "action", a: "GSPC", p: "liste"},
|
||||
}).done(GSPC_parseList).fail(function(jqXHR, textStatus) {
|
||||
printState(7, textStatus);
|
||||
});
|
||||
}
|
||||
GSPC_loadList();
|
||||
|
||||
//Une fois la liste reçue, on la parse
|
||||
function GSPC_parseList(transport, json)
|
||||
function GSPC_parseList(data)
|
||||
{
|
||||
$('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")])
|
||||
}
|
||||
$('#nbpc').html(data.documentElement.getAttribute("nombre"));
|
||||
|
||||
var liste = data.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);
|
||||
if (GSPC_delay)
|
||||
clearTimeout(GSPC_delay);
|
||||
|
||||
GSPC_addScreen(false);
|
||||
$('#contenu').html("<h2>Ajout d'un porte-clef à la base de données</h2>");
|
||||
|
||||
GSPC_addScreen(false);
|
||||
}
|
||||
|
||||
//Affiche la liste des porte-clés
|
||||
function GSPC_list()
|
||||
{
|
||||
if (GSPC_delay)
|
||||
clearTimeout(GSPC_delay);
|
||||
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);
|
||||
window.scrollTo(0,0);
|
||||
|
||||
GSPC_liste = false;
|
||||
GSPC_lastSort = -1;
|
||||
$('#contenu').html("<h2>Liste des porte-clefs</h2>");
|
||||
|
||||
GSPC_viewliste();
|
||||
GSPC_liste = false;
|
||||
GSPC_lastSort = -1;
|
||||
|
||||
GSPC_viewliste();
|
||||
}
|
||||
|
||||
//Affiche la page de statistiques
|
||||
function GSPC_stats()
|
||||
{
|
||||
if (GSPC_delay)
|
||||
clearTimeout(GSPC_delay);
|
||||
if (GSPC_delay)
|
||||
clearTimeout(GSPC_delay);
|
||||
|
||||
window.scrollTo(0,0);
|
||||
|
||||
$('contenu').innerHTML = "";
|
||||
var titre = document.createElement("h2");
|
||||
titre.innerHTML = "Statistiques";
|
||||
$('contenu').appendChild(titre);
|
||||
window.scrollTo(0,0);
|
||||
|
||||
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);
|
||||
$('#contenu').html("<h2>Statistiques</h2>");
|
||||
|
||||
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;
|
||||
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').append(tableau);
|
||||
|
||||
tableau_body.innerHTML = "";
|
||||
$.ajax({
|
||||
url: "ajax.php",
|
||||
data: { d: "action", a: "GSPC", p: "stats" }
|
||||
}).done(function(data) {
|
||||
var stats = data.documentElement.getElementsByTagName("statistiques")[0];
|
||||
var nbPC = stats.getElementsByTagName("ligne").length;
|
||||
|
||||
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); }
|
||||
}
|
||||
);
|
||||
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";
|
||||
}).fail(function(jqXHR, textStatus) {
|
||||
printState(7, textStatus);
|
||||
});
|
||||
}
|
||||
|
||||
function GSPC_addStatLign(lign, ligne)
|
||||
{
|
||||
lign.onclick = function() { window.scrollTo(0,0); GSPC_viewligne(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);
|
||||
$('#contenu').html("<h2>Liste des porte-clefs de la ligne " + ligne + "</h2>");
|
||||
|
||||
GSPC_delay_viewligne(ligne);
|
||||
}
|
||||
|
||||
function GSPC_delay_viewligne(ligne)
|
||||
{
|
||||
if (GSPC_origin_liste == false)
|
||||
GSPC_delay = setTimeout(GSPC_delay_viewligne, 200, ligne);
|
||||
else
|
||||
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++)
|
||||
{
|
||||
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();
|
||||
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";
|
||||
formulaire.id = "add";
|
||||
formulaire.className = "form-horizontal";
|
||||
formulaire.onsubmit = function() { checkAndAdd(modif); return false; }
|
||||
formulaire.innerHTML = '<div class="form-group"><label for="nompc" class="col-sm-5 control-label">Nom/marque :</label><div class="col-sm-7"><input type="text" id="nompc" maxlength="250" class="form-control"></div></div> <div class="form-group"><label for="caracpc" class="col-sm-5 control-label">Caractéristiques :</label><div class="col-sm-7"><input type="text" id="caracpc" maxlength="250" class="form-control"></div></div> <div class="form-group"><label for="lignepc" class="col-sm-5 control-label">Ligne :</label><div class="col-sm-7"><input type="text" id="lignepc" maxlength="3" size="5" class="form-control"></div></div> <div class="form-group"><label for="quantitepc" class="col-sm-5 control-label">Quantité :</label><div class="col-sm-7"><select class="form-control" id="quantitepc"><option value="1">Simple</option><option value="2">Double</option><option value="3">Triple</option><option value="4">Quadruple</option></select></div></div>';
|
||||
|
||||
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";
|
||||
if(modif)
|
||||
{
|
||||
formulaire.innerHTML += '<button type="submit" class="btn btn-primary">Modifier</button>';
|
||||
|
||||
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";
|
||||
inp_del = document.createElement("button");
|
||||
inp_del.type = "button";
|
||||
inp_del.className = "btn btn-danger";
|
||||
inp_del.innerHTML = '<span class="glyphicon glyphicon-trash"></span> Supprimer';
|
||||
inp_del.style.marginLeft = "15px";
|
||||
formulaire.appendChild(inp_del);
|
||||
}
|
||||
else
|
||||
formulaire.innerHTML += '<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span> Ajouter</button>';
|
||||
|
||||
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";
|
||||
$('#contenu').append(formulaire);
|
||||
|
||||
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";
|
||||
if(modif)
|
||||
{
|
||||
$('#nompc').val(GSPC_liste[modif-1][1]);
|
||||
$('#caracpc').val(GSPC_liste[modif-1][2]);
|
||||
$('#lignepc').val(GSPC_liste[modif-1][3]);
|
||||
$('#quantitepc').val(GSPC_liste[modif-1][4]);
|
||||
}
|
||||
|
||||
$('#nompc').focus();
|
||||
$('#add button.btn-danger').click(function() { GSPC_del(modif); });
|
||||
|
||||
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);
|
||||
$('#contenu').append(confirmation);
|
||||
}
|
||||
|
||||
function GSPC_del(modif)
|
||||
{
|
||||
$('nompc').disabled = true;
|
||||
$('caracpc').disabled = true;
|
||||
$('lignepc').disabled = true;
|
||||
$('quantitepc').disabled = true;
|
||||
$('#nompc').prop("disabled", true);
|
||||
$('#caracpc').prop("disabled", true);
|
||||
$('#lignepc').prop("disabled", true);
|
||||
$('#quantitepc').prop("disabled", true);
|
||||
|
||||
var ligne = GSPC_liste[modif-1][3];
|
||||
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;
|
||||
$.ajax({
|
||||
url: "ajax.php?d=action&a=GSPC&p=del",
|
||||
type: "post",
|
||||
data: { id: GSPC_liste[modif-1][0] },
|
||||
}).done(function(data) {
|
||||
if (data.documentElement.getAttribute("statut") != 1)
|
||||
{
|
||||
firstLoad();
|
||||
alert("Vous avez été déconnecté. Le porte-clef n'a pas été supprimé");
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#contenu').html('<div class="alert alert-success"><strong>Porte-clef supprimé avec succès</strong></div>');
|
||||
$('#nbpc').innerHTML = data.documentElement.getAttribute("nombre");
|
||||
|
||||
GSPC_loadList();
|
||||
GSPC_delay_viewligne(ligne);
|
||||
}
|
||||
},
|
||||
onFailure: function() { printEtat(3); }
|
||||
}
|
||||
);
|
||||
GSPC_loadList();
|
||||
GSPC_delay_viewligne(ligne);
|
||||
}
|
||||
}).fail(function(jqXHR, textStatus) {
|
||||
printState(7, textStatus);
|
||||
});
|
||||
|
||||
$('contenu').innerHTML = "<h2 class=\"vp\">Veuillez patienter suppression du porte-clef en cours ...</h2>";
|
||||
$('#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(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); }
|
||||
}
|
||||
);
|
||||
$('#nompc').parent().parent().removeClass("has-error");
|
||||
$('#lignepc').parent().parent().removeClass("has-error");
|
||||
if ($('#nompc').val() == "")
|
||||
{
|
||||
$('#nompc').parent().parent().addClass("has-error");
|
||||
alert('Veuillez indiquer une marque ou un nom !');
|
||||
$('#nompc').focus();
|
||||
}
|
||||
else if ($('#lignepc').val() == "")
|
||||
{
|
||||
$('#lignepc').parent().parent().addClass("has-error");
|
||||
alert('Veuillez indiquer une ligne !');
|
||||
$('#lignepc').focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#nompc').prop("disabled", true);
|
||||
$('#caracpc').prop("disabled", true);
|
||||
$('#lignepc').prop("disabled", true);
|
||||
$('#quantitepc').prop("disabled", true);
|
||||
|
||||
$.ajax({
|
||||
url: 'ajax.php?d=action&a=GSPC' + modif,
|
||||
type: "POST",
|
||||
data: { nom: escapeHtml($('#nompc').val()),
|
||||
caracteristique: escapeHtml($('#caracpc').val()),
|
||||
ligne: escapeHtml($('#lignepc').val()),
|
||||
quantite: escapeHtml($('#quantitepc').val())
|
||||
},
|
||||
}).done(function(data) {
|
||||
if (data.documentElement.getAttribute("statut") != 1)
|
||||
{
|
||||
firstLoad();
|
||||
alert("Vous avez été déconnecté. Le porte-clef n'a pas été enregistré");
|
||||
}
|
||||
else
|
||||
{
|
||||
GSPC_loadList();
|
||||
|
||||
if(modif)
|
||||
{
|
||||
lign = $('lignepc').value;
|
||||
$('contenu').innerHTML = "<h2 class=\"vp\">Veuillez patienter, modification du porte-clef en cours ...</h2>";
|
||||
$('#contenu').html('<div class="alert alert-success">Porte-clef modifié avec succès !</div>');
|
||||
$('#nbpc').html(data.documentElement.getAttribute("nombre"));
|
||||
|
||||
GSPC_delay_viewligne(lign);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#nompc').val("");
|
||||
$('#nompc').parent().parent().removeClass("has-error");
|
||||
$('#caracpc').val("");
|
||||
$('#lignepc').parent().parent().removeClass("has-error");
|
||||
$('#quantitepc').val(1);
|
||||
|
||||
$('#nompc').prop("disabled", false);
|
||||
$('#caracpc').prop("disabled", false);
|
||||
$('#lignepc').prop("disabled", false);
|
||||
$('#quantitepc').prop("disabled", false);
|
||||
|
||||
$('#nbpc').html(data.documentElement.getAttribute("nombre"));
|
||||
|
||||
$('#confirm').html('<div class="alert alert-success">Porte-clef ajouté avec succès !</div>');
|
||||
setTimeout("$('confirm').innerHTML = '';", 3500);
|
||||
|
||||
$('#nompc').focus();
|
||||
}
|
||||
}
|
||||
}).fail(function(jqXHR, textStatus) {
|
||||
printState(7, textStatus);
|
||||
});
|
||||
|
||||
if(modif)
|
||||
{
|
||||
lign = $('#lignepc').val();
|
||||
$('#contenu').html("<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 pagination = document.createElement("div");
|
||||
pagination.className = "pagination top";
|
||||
pagination.id = "pagination1";
|
||||
$('#contenu').append(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);
|
||||
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').append(tableau);
|
||||
|
||||
GSPC_showliste(-1, 0);
|
||||
var pagination = document.createElement("div");
|
||||
pagination.className = "pagination bottom";
|
||||
pagination.id = "pagination2";
|
||||
$('#contenu').append(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;
|
||||
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;
|
||||
}
|
||||
//On tente un tri
|
||||
if (GSPC_lastSort != tri)
|
||||
{
|
||||
$('#bodyList').html('<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);
|
||||
nbPages = Math.ceil(GSPC_liste.length / nbParPage);
|
||||
$('#pagination1').html("");
|
||||
$('#pagination2').html("");
|
||||
for (var i = 0; i < 4 && i < nbPages; i++)
|
||||
GSPC_addLinkPagination(i);
|
||||
if (page > 5 && i < nbPages)
|
||||
{
|
||||
$('#pagination1').append("...");
|
||||
$('#pagination2').append("...");
|
||||
}
|
||||
for (var i = (page < 6?4:page - 2); (i < page + 3 && i < nbPages); i++)
|
||||
GSPC_addLinkPagination(i);
|
||||
if (page <= 5 && i < nbPages)
|
||||
{
|
||||
$('#pagination1').append("...");
|
||||
$('#pagination2').append("...");
|
||||
for (var i = Math.ceil(nbPages/2) - 2; i < nbPages/2 + 2; i++)
|
||||
GSPC_addLinkPagination(i);
|
||||
}
|
||||
if (page + 3 < nbPages - 4)
|
||||
{
|
||||
$('#pagination1').append("...");
|
||||
$('#pagination2').append("...");
|
||||
}
|
||||
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"
|
||||
}
|
||||
start = page * nbParPage;
|
||||
$('#bodyList').html("");
|
||||
|
||||
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').append(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);
|
||||
var lnkP = document.createElement("a");
|
||||
lnkP.href = "javascript:GSPC_showliste(" + GSPC_lastSort + ", " + page + ");";
|
||||
lnkP.innerHTML = page + 1;
|
||||
$('#pagination1').append(lnkP);
|
||||
var lnkP = document.createElement("a");
|
||||
lnkP.href = "javascript:GSPC_showliste(" + GSPC_lastSort + ", " + page + ");";
|
||||
lnkP.innerHTML = page + 1;
|
||||
$('#pagination2').append(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);
|
||||
}
|
||||
elt.onclick = function() {
|
||||
$('#contenu').html('<h2>Modification d\'un porte-clef</h2>');
|
||||
|
||||
GSPC_addScreen(idPC + 1);
|
||||
}
|
||||
}
|
||||
|
||||
function GSPC_apropos()
|
||||
{
|
||||
aproposApp("GSPC", "contenu");
|
||||
aproposApp("GSPC", "contenu");
|
||||
}
|
||||
|
|
@ -19,7 +19,7 @@ body {
|
|||
);
|
||||
|
||||
font-family: serif;
|
||||
min-height: 80%;
|
||||
min-height: 80%;
|
||||
}
|
||||
|
||||
a:link, a:visited {
|
||||
|
|
@ -59,7 +59,7 @@ h1 {
|
|||
border-radius: 17px;
|
||||
box-shadow: 3px 4px 5px #444466;
|
||||
|
||||
height: 127px;
|
||||
height: 200px;
|
||||
margin: auto;
|
||||
padding: 20px;
|
||||
text-align: left;
|
||||
|
|
@ -91,7 +91,7 @@ h1 {
|
|||
left: 0px;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
-webkit-padding-start: 0;
|
||||
padding: 0;
|
||||
position: fixed;
|
||||
text-align: center;
|
||||
top: 0px;
|
||||
|
|
@ -140,42 +140,13 @@ form#add {
|
|||
border: 1px solid #8A77A1;
|
||||
border-radius: 25px;
|
||||
box-shadow: 2px 2px 5px #333355;
|
||||
height: 205px;
|
||||
height: 250px;
|
||||
margin: auto;
|
||||
padding: 13px;
|
||||
padding: 14px;
|
||||
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;
|
||||
}
|
||||
|
|
@ -183,11 +154,6 @@ input#lignepc {
|
|||
text-transform:uppercase;
|
||||
}
|
||||
|
||||
input.erreur, select.erreur {
|
||||
background: #CC0000;
|
||||
border: #A59A00 solid 1px;
|
||||
}
|
||||
|
||||
.table {
|
||||
border: 1px solid black;
|
||||
border-radius: 10px;
|
||||
|
|
|
|||
Reference in a new issue