Aggiunta associazione
This commit is contained in:
21
associazione/cercaart.php
Normal file
21
associazione/cercaart.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
include_once ("funzioni.php");
|
||||
|
||||
$produttore = $_GET['produttore'];
|
||||
$categoria = $_GET['categoria'];
|
||||
|
||||
$query = "SELECT id, nome FROM wf_materiale WHERE categoria = '$categoria' AND produttore = '$produttore' AND attivo = 1 ORDER BY nome";
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
|
||||
$mat='<option>SELEZIONARE</option>';
|
||||
while ($dato = mysql_fetch_array ( $res )) {
|
||||
$mat.='<option value="'.$dato['id'].'">'.$dato['nome'].'</option>';
|
||||
}
|
||||
|
||||
$v_result = array('status'=>'OK', 'mat'=>$mat);
|
||||
|
||||
$json = json_encode($v_result);
|
||||
echo $json;
|
||||
|
||||
?>
|
||||
30
associazione/cercamat.php
Normal file
30
associazione/cercamat.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
include_once ("funzioni.php");
|
||||
|
||||
$articolo = $_GET['articolo'];
|
||||
|
||||
$query = "SELECT vendita, taglie FROM wf_materiale WHERE id = $articolo";
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
|
||||
$dato = mysql_fetch_array ( $res );
|
||||
$art = $dato['vendita'];
|
||||
|
||||
|
||||
$dato = $dato['taglie'];
|
||||
if (str_replace(' ', '', $dato) != "" ) {
|
||||
$taglie = explode (" ", $dato);
|
||||
$tag='<option>SELEZIONARE</option>';
|
||||
foreach ($taglie as &$taglia) {
|
||||
$tag.='<option value="'.$taglia.'">'.$taglia.'</option>';
|
||||
}
|
||||
} else {
|
||||
$tag='<option>N/D</option>';
|
||||
}
|
||||
|
||||
$v_result = array('status'=>'OK', 'art'=>$art, 'tag'=>$tag);
|
||||
|
||||
$json = json_encode($v_result);
|
||||
echo $json;
|
||||
|
||||
?>
|
||||
28
associazione/cercaprod.php
Normal file
28
associazione/cercaprod.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
include_once ("funzioni.php");
|
||||
|
||||
$categoria = $_GET['categoria'];
|
||||
|
||||
$query = "SELECT produttore FROM wf_materiale WHERE categoria = '$categoria' AND attivo = 1 GROUP BY produttore ORDER BY produttore";
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
|
||||
$prod='<option value="">SELEZIONARE</option>';
|
||||
while ($dato = mysql_fetch_array ( $res )) {
|
||||
$prod.='<option value="'.$dato['produttore'].'">'. $dato['produttore'] .'</option>';
|
||||
}
|
||||
|
||||
$query = "SELECT id, nome, produttore FROM wf_materiale WHERE categoria = '$categoria' AND attivo = 1 ORDER BY produttore, nome";
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
|
||||
$mat='<option>SELEZIONARE</option>';
|
||||
while ($dato = mysql_fetch_array ( $res )) {
|
||||
$mat.='<option value="'.$dato['id'].'">'.$dato['nome'].' - '.$dato['produttore'].' </option>';
|
||||
}
|
||||
|
||||
$v_result = array('status'=>'OK', 'prod'=>$prod, 'mat'=>$mat);
|
||||
|
||||
$json = json_encode($v_result);
|
||||
echo $json;
|
||||
|
||||
?>
|
||||
41
associazione/funzioni.php
Normal file
41
associazione/funzioni.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
function categoria ($data) {
|
||||
global $DB_ID;
|
||||
|
||||
$query = " SELECT
|
||||
categoria
|
||||
FROM
|
||||
wf_categoria
|
||||
WHERE
|
||||
STR_TO_DATE('$data', '%d.%m.%Y')
|
||||
BETWEEN
|
||||
DATE_SUB(CONCAT(YEAR(NOW()),'-01-01 00:00:00'), INTERVAL fine YEAR)
|
||||
AND
|
||||
DATE_SUB(CONCAT(YEAR(NOW()),'-12-31 00:00:00'), INTERVAL inizio YEAR)
|
||||
";
|
||||
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
$categoria = "";
|
||||
while ($dato = mysql_fetch_array ($res)) {
|
||||
$categoria .= $dato['categoria']." - ";
|
||||
}
|
||||
return substr($categoria, 0, -3);
|
||||
}
|
||||
|
||||
function differenza ($ora, $prima, $inverso=0) {
|
||||
$valore = $ora-$prima;
|
||||
if ($inverso) {
|
||||
if ( $valore >= 0) {
|
||||
return "<div align=\"center\" style=\"color:#FF0000;font-size: 10px\">+$valore</div>";
|
||||
} else {
|
||||
return "<div align=\"center\" style=\"color:#00FF00;font-size: 10px\">$valore</div>";
|
||||
}
|
||||
} else {
|
||||
if ($valore >= 0) {
|
||||
return "<div align=\"center\" style=\"color:#00FF00;font-size: 10px\">+$valore</div>";
|
||||
} else {
|
||||
return "<div align=\"center\" style=\"color:#FF0000;font-size: 10px\">$valore</div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
1
associazione/index.php
Symbolic link
1
associazione/index.php
Symbolic link
@@ -0,0 +1 @@
|
||||
ordini_lista.php
|
||||
300
associazione/iscritti_edit.php
Executable file
300
associazione/iscritti_edit.php
Executable file
@@ -0,0 +1,300 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
include_once ("funzioni.php");
|
||||
$UTENTE = login();
|
||||
$DIRITTI = diritti('Utente');
|
||||
view_top();
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
$post = addslashes_array ($_POST);
|
||||
extract($post);
|
||||
|
||||
$certificato = sistemadata($certificato);
|
||||
$nascita_data = sistemadata($nascita_data);
|
||||
|
||||
if (is_null ($tcintura) || $tcintura == "") {
|
||||
$tcintura = 0;
|
||||
}
|
||||
|
||||
if ($id) {
|
||||
$query = " UPDATE
|
||||
wf_iscritto
|
||||
SET
|
||||
nome = '$nome',
|
||||
cognome = '$cognome',
|
||||
id_cintura = $id_cintura,
|
||||
tcintura = $tcintura,
|
||||
id_palestra = $id_palestra,
|
||||
certificato = STR_TO_DATE('$certificato', '%d.%m.%Y'),
|
||||
sesso = '$sesso',
|
||||
nascita_data = STR_TO_DATE('$nascita_data', '%d.%m.%Y'),
|
||||
commento = '$commento'
|
||||
WHERE
|
||||
id = $id
|
||||
";
|
||||
} else {
|
||||
$query = " INSERT INTO
|
||||
wf_iscritto
|
||||
SET
|
||||
attivo = 1,
|
||||
nome = '$nome',
|
||||
cognome = '$cognome',
|
||||
id_cintura = $id_cintura,
|
||||
tcintura = $tcintura,
|
||||
id_palestra = $id_palestra,
|
||||
certificato = STR_TO_DATE('$certificato', '%d.%m.%Y'),
|
||||
sesso = '$sesso',
|
||||
nascita_data = STR_TO_DATE('$nascita_data', '%d.%m.%Y'),
|
||||
commento = '$commento'
|
||||
";
|
||||
}
|
||||
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
if ($id == "") {
|
||||
$id = mysql_insert_id();
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
document.location.href='iscritti_lista.php?id=<?php print $id ?>'
|
||||
</script>
|
||||
<?php
|
||||
exit;
|
||||
} elseif (isset($_GET['id'])) {
|
||||
$id = $_GET['id'];
|
||||
}
|
||||
?>
|
||||
|
||||
<form name="" method="post">
|
||||
<input type="hidden" name="id" value="<?php print $id ?>">
|
||||
<?php
|
||||
|
||||
$query = " SELECT
|
||||
id,
|
||||
attivo,
|
||||
nome,
|
||||
cognome,
|
||||
id_cintura,
|
||||
tcintura,
|
||||
id_palestra,
|
||||
DATE_FORMAT(certificato, '%d.%m.%Y') AS certificato,
|
||||
sesso,
|
||||
DATE_FORMAT(nascita_data, '%d.%m.%Y') AS nascita_data,
|
||||
commento
|
||||
FROM
|
||||
wf_iscritto
|
||||
WHERE
|
||||
id = $id
|
||||
";
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
$dato = mysql_fetch_array ( $res );
|
||||
|
||||
(livello_modulo($DIRITTI) == "Admin") ? $query_admin = "" : $query_admin = "
|
||||
JOIN
|
||||
wf_utenti
|
||||
ON
|
||||
wf_palestra.id = wf_utenti.id_palestra
|
||||
AND
|
||||
wf_utenti.id_utenti = ".$UTENTE['id'];
|
||||
|
||||
$query = " SELECT
|
||||
wf_palestra.id,
|
||||
wf_palestra.palestra
|
||||
FROM
|
||||
wf_palestra
|
||||
$query_admin
|
||||
WHERE
|
||||
wf_palestra.attivo = 1
|
||||
ORDER BY
|
||||
palestra
|
||||
";
|
||||
$res_palestra = mysql_query( $query, $DB_ID );
|
||||
|
||||
$query = " SELECT
|
||||
id,
|
||||
cintura
|
||||
FROM
|
||||
wf_cinture
|
||||
ORDER BY
|
||||
kup desc,
|
||||
dan
|
||||
";
|
||||
$res_cintura = mysql_query( $query, $DB_ID );
|
||||
|
||||
$query = " SELECT
|
||||
DATE_FORMAT(data, '%d.%m.%Y') AS data,
|
||||
peso,
|
||||
altezza,
|
||||
cooper,
|
||||
sargeant,
|
||||
slungo,
|
||||
pallaav,
|
||||
pallaind,
|
||||
mobart,
|
||||
flesstro,
|
||||
cingolo,
|
||||
calcisx,
|
||||
calcidx,
|
||||
commenti
|
||||
FROM
|
||||
wf_storico
|
||||
WHERE
|
||||
wf_storico.id_iscritto = $id
|
||||
ORDER BY
|
||||
wf_storico.data DESC
|
||||
LIMIT 1
|
||||
";
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
$storico = mysql_fetch_array ( $res );
|
||||
|
||||
$tabella = new html (0,"90%",array(5,20,5,20,5,5,5,20,0));
|
||||
$tabella->intestazione (array("","Cognome","","Nome","","Sesso","","Data di nascita",""));
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
if ($dato['attivo']) {
|
||||
?>
|
||||
<td class="spazioh"><a href="wf_gest.php?azione=wf_off&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/attivo.gif" ALT="Atleta Attivo" TITLE="Atleta Attivo"></a></td>
|
||||
<?php } else { ?>
|
||||
<td class="spazioh"><a href="wf_gest.php?azione=wf_on&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/non_attivo.gif" ALT="Atleta non Attivo" TITLE="Atleta non Attivo"></a></td>
|
||||
<?php } ?>
|
||||
<td class="colip"><input size=20% type="text" name=cognome value="<?php print $dato['cognome'] ?>"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size=20% type="text" name=nome value="<?php print $dato['nome'] ?>"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip">
|
||||
<select name=sesso>
|
||||
<option value="F" <?php if ($dato['sesso'] == "F") { print "selected=\"selected\"";}?>>F</option>
|
||||
<option value="M" <?php if ($dato['sesso'] == "M") { print "selected=\"selected\"";}?>>M</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input id="nascita_data" class="data" size=10% type="text" name=nascita_data value="<?php print $dato['nascita_data'] ?>"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga(5);
|
||||
$tabella->close();
|
||||
|
||||
$tabella = new html (0,"90%",array(5,15,5,15,5,10,5,15,5,15,0));
|
||||
$tabella->intestazione (array("","Palestra","","Cintura","","Lunghezza","","Categoria","","Scad. certificato",""));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip">
|
||||
<select name=id_palestra>
|
||||
<?php while ($dato_palestra = mysql_fetch_array ( $res_palestra )) { ?>
|
||||
<option value="<?php print $dato_palestra['id']?>" <?php if ($dato['id_palestra'] == $dato_palestra['id']) { print "selected=\"selected\"";}?>><?php print $dato_palestra['palestra']?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip">
|
||||
<select name=id_cintura>
|
||||
<?php while ($dato_cintura = mysql_fetch_array ( $res_cintura )) { ?>
|
||||
<option value="<?php print $dato_cintura['id']?>" <?php if ($dato['id_cintura'] == $dato_cintura['id']) { print "selected=\"selected\"";}?>><?php print $dato_cintura['cintura']?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size=5% type="text" name=tcintura value="<?php print $dato[tcintura] ?>"> cm.</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print categoria($dato['nascita_data']) ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input id="certificato" class="data" size=10% type="text" name=certificato value="<?php print $dato['certificato'] ?>"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->close();
|
||||
|
||||
$tabella = new html (0,"90%",array(5,85,0));
|
||||
$tabella->riga(10);
|
||||
$tabella->intestazione (array("","Commenti",""));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td><textarea name="commento" rows="5" cols="100%"><?php print $dato[commento]?></textarea></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->close();
|
||||
|
||||
$tabella = new html (0,"90%",array(40,5,10,5,40));
|
||||
$tabella->riga(20);
|
||||
$tabella->intestazione (array("","Conferma","","Ritorna",""), array("","textc","","textc",""));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="textc"><input type="image" alt="Conferma" src="<?php print $CONF[base_url] ?>/img/applica.png" value="Conferma"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="textc"><a href="iscritti_lista.php" alt="Ritorna" ><img src="<?php print $CONF['base_url'] ?>/img/redx.png"></a></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga(40);
|
||||
$tabella->close();
|
||||
|
||||
if (!empty ($storico)) {
|
||||
|
||||
$tabella = new html (0,"90%",array(5,40,10,40,5));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td><hr align="center" size="2" width="100%" color="#FFC350"></td>
|
||||
<td class="textc"><?php print $storico[data] ?></td>
|
||||
<td><hr align="center" size="2" width="100%" color="#FFC350"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->close();
|
||||
|
||||
$tabella = new html (0,"90%",array(2,7,1,7,1,6,1,7,1,7,1,5,1,5,1,7,1,7,1,7,1,6,1,6,2,4,0));
|
||||
$tabella->intestazione (array("","Peso","","Altezza","","Cooper","","Sargeant","","Fles. Tr.","","Calci SX","","Calci DX","","S. Lungo","","Arti S. Av","","Arti S. Ind","","Mob. Art.","","Cingolo","","",""));
|
||||
|
||||
$img = "<a href=\"iscritti_storico.php?id=$id\"><img src=\"$CONF[base_url]/img/modify.gif\"></a>";
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="peso" value="<?php print $storico[peso] ?>" <?php print $tipo ?>> Kg</input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="2" name="altezza" value="<?php print $storico[altezza] ?>" <?php print $tipo ?>> cm</input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="cooper" value="<?php print $storico[cooper] ?>" <?php print $tipo ?>> m</input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="sargeant" value="<?php print $storico[sargeant] ?>" <?php print $tipo ?>> cm</input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="flesstro" value="<?php print $storico[flesstro] ?>" <?php print $tipo ?>> cm</input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="calcisx" value="<?php print $storico[calcisx] ?>" <?php print $tipo ?>></input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="calcidx" value="<?php print $storico[calcidx] ?>" <?php print $tipo ?>></input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="slungo" value="<?php print $storico[slungo] ?>" <?php print $tipo ?>> cm</input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="pallaav" value="<?php print $storico[pallaav] ?>" <?php print $tipo ?>> cm</input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="pallaind" value="<?php print $storico[pallaind] ?>" <?php print $tipo ?>> cm</input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="mobart" value="<?php print $storico[mobart] ?>" <?php print $tipo ?>> °</input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="cingolo" value="<?php print $storico[cingolo] ?>" <?php print $tipo ?>></input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="spazioh"><?php print $img ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->close();
|
||||
} else {
|
||||
$tabella = new html (0,"90%",array(48,4,48));
|
||||
$tabella->intestazione (array("","Storico",""), array("","textc",""));
|
||||
?>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="textc"><a href="iscritti_storico.php?id=<?php print $id ?>"><img src="<?php print $CONF[base_url] ?>/img/modify.gif"></a></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<?php
|
||||
$tabella->close();
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
<?php view_footer(); ?>
|
||||
104
associazione/iscritti_lista.php
Executable file
104
associazione/iscritti_lista.php
Executable file
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
include_once ("funzioni.php");
|
||||
$UTENTE = login();
|
||||
$DIRITTI = diritti('Utente');
|
||||
view_top();
|
||||
|
||||
$ordine = "cognome, nome";
|
||||
|
||||
if (!is_null($_GET[o]))
|
||||
$ordine = $_GET[o];
|
||||
|
||||
?>
|
||||
|
||||
<form name="" method="post">
|
||||
<?php $tabella = new html (0,"90%", array (3,5,2,15,2,15,2,10,2,10,2,10,2,10,0)); ?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="spazioh"><a href="iscritti_edit.php"><img src="<?php print $CONF['base_url'] ?>/img/addresource.png"></a></td>
|
||||
<td colspan=13 class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga();
|
||||
|
||||
(livello_modulo($DIRITTI) == "Admin") ? $query_admin = "" : $query_admin = "
|
||||
AND
|
||||
wf_iscritto.attivo = 1
|
||||
";
|
||||
|
||||
$query = " SELECT
|
||||
wf_iscritto.id,
|
||||
wf_iscritto.attivo,
|
||||
wf_iscritto.cognome,
|
||||
wf_iscritto.nome,
|
||||
wf_cinture.cintura,
|
||||
wf_palestra.palestra,
|
||||
TIMESTAMPDIFF(DAY, wf_iscritto.certificato, NOW()) AS giorni,
|
||||
DATE_FORMAT(wf_iscritto.nascita_data, '%d.%m.%Y') AS nascita_data,
|
||||
DATE_FORMAT(wf_iscritto.certificato, '%d.%m.%Y') AS certificato
|
||||
FROM
|
||||
wf_iscritto
|
||||
JOIN
|
||||
wf_cinture
|
||||
ON
|
||||
wf_iscritto.id_cintura = wf_cinture.id
|
||||
JOIN
|
||||
wf_palestra
|
||||
ON
|
||||
wf_iscritto.id_palestra = wf_palestra.id
|
||||
JOIN
|
||||
wf_utenti
|
||||
ON
|
||||
wf_palestra.id = wf_utenti.id_palestra
|
||||
WHERE
|
||||
wf_utenti.id_utenti = ".$UTENTE['id']."
|
||||
AND
|
||||
wf_utenti.attivo = 1
|
||||
$query_admin
|
||||
GROUP BY
|
||||
id
|
||||
ORDER BY
|
||||
attivo desc,
|
||||
$ordine
|
||||
";
|
||||
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
$tabella->intestazione (array("", "", "", "<a class=\"descrizione\" href=\"?o=cognome,nome\">Cognome<a>", "", "<a class=\"descrizione\" href=\"?o=nome,cognome\">Nome<a>", "", "<a class=\"descrizione\" href=\"?o=id_cintura,cognome,nome\">Cintura<a>", "", "<a class=\"descrizione\" href=\"?o=wf_iscritto.nascita_data DESC,cognome,nome\">Categoria<a>", "", "<a class=\"descrizione\" href=\"?o=palestra,cognome,nome\">Palestra<a>", "", "<a class=\"descrizione\" href=\"?o=wf_iscritto.certificato,cognome,nome\">Scad. Cert.<a>", ""));
|
||||
$tabella->riga();
|
||||
while ($dato = mysql_fetch_array ( $res )) {
|
||||
|
||||
$colore = "black";
|
||||
if ($dato['giorni'] > -30) $colore = "orange";
|
||||
if ($dato['giorni'] > 0 || is_null ($dato['giorni'])) $colore = "red";
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
if ($dato['attivo']) {
|
||||
?>
|
||||
<td class="col3btn"><a href="wf_gest.php?azione=wf_off&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/attivo.gif" ALT="Utente attivo" TITLE="Utente attivo"></a></td>
|
||||
<?php } else { ?>
|
||||
<td class="col3btn"><a href="wf_gest.php?azione=wf_on&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/non_attivo.gif" ALT="Utente non attivo" TITLE="Utente non attivo"></a></td>
|
||||
<?php } ?>
|
||||
<td class="col3btn"><a href="iscritti_edit.php?id=<?php print $dato['id'] ?>"><img src="<?php print $CONF['base_url'] ?>/img/modify.gif" ALT="Modifica Utente" TITLE="Modifica Utente"></a></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['cognome'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['nome'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['cintura'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print categoria($dato['nascita_data']) ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['palestra'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip" style="color:<?php print $colore ?>"><?php print $dato['certificato'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
$tabella->close();
|
||||
?>
|
||||
</form>
|
||||
<?php view_footer(); ?>
|
||||
233
associazione/iscritti_storico.php
Executable file
233
associazione/iscritti_storico.php
Executable file
@@ -0,0 +1,233 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
include_once ("funzioni.php");
|
||||
$UTENTE = login();
|
||||
$DIRITTI = diritti('Utente');
|
||||
view_top();
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
$post = addslashes_array ($_POST);
|
||||
extract($post);
|
||||
|
||||
if ($op == "nuovo" ) {
|
||||
$query = " INSERT INTO
|
||||
wf_storico
|
||||
(id_iscritto, peso, altezza, data)
|
||||
VALUES
|
||||
($id,0,0,NOW())
|
||||
";
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
} else if ($op == "salva") {
|
||||
$data = sistemadata($data);
|
||||
|
||||
$query = " UPDATE
|
||||
wf_storico
|
||||
SET
|
||||
data = STR_TO_DATE('$data', '%d.%m.%Y'),
|
||||
peso = $peso,
|
||||
altezza = $altezza,
|
||||
cooper = $cooper,
|
||||
sargeant = $sargeant,
|
||||
slungo = $slungo,
|
||||
pallaav = $pallaav,
|
||||
pallaind = $pallaind,
|
||||
mobart = $mobart,
|
||||
flesstro = $flesstro,
|
||||
cingolo = $cingolo,
|
||||
calcisx = $calcisx,
|
||||
calcidx = $calcidx,
|
||||
commenti = '$commenti'
|
||||
WHERE
|
||||
id = $storico
|
||||
";
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
}
|
||||
|
||||
} else if (isset($_GET['id'])) {
|
||||
$id = $_GET['id'];
|
||||
}
|
||||
|
||||
$query = " SELECT
|
||||
nome,
|
||||
cognome
|
||||
FROM
|
||||
wf_iscritto
|
||||
WHERE
|
||||
id = $id
|
||||
";
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
$atleta = mysql_fetch_array ( $res );
|
||||
|
||||
$query = " SELECT
|
||||
wf_storico.id,
|
||||
DATE_FORMAT(wf_storico.data, '%d.%m.%Y') AS data,
|
||||
wf_storico.peso,
|
||||
wf_storico.altezza,
|
||||
wf_storico.cooper,
|
||||
wf_storico.sargeant,
|
||||
wf_storico.slungo,
|
||||
wf_storico.pallaav,
|
||||
wf_storico.pallaind,
|
||||
wf_storico.mobart,
|
||||
wf_storico.flesstro,
|
||||
wf_storico.cingolo,
|
||||
wf_storico.calcisx,
|
||||
wf_storico.calcidx,
|
||||
wf_storico.commenti
|
||||
FROM
|
||||
wf_storico
|
||||
WHERE
|
||||
wf_storico.id_iscritto = $id
|
||||
ORDER BY
|
||||
wf_storico.id DESC,
|
||||
wf_storico.data DESC
|
||||
";
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
|
||||
$tabella = new html (0,"90%",array(5,15,5,30,30,15,0));
|
||||
$tabella->intestazione (array("","Nuova Rilevazione","","","","Scheda anagrafica",""), array("","textc","","","","textc",""));
|
||||
?>
|
||||
<form name="" method="post">
|
||||
<input type="hidden" name="id" value="<?php print $id ?>">
|
||||
<input type="hidden" name="op" value="nuovo">
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="textc"><input type="image" src="<?php print $CONF['base_url'] ?>/img/addresource.png"></input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colipb"><?php print $atleta[cognome]." ".$atleta[nome] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="textc"><a href="iscritti_edit.php?id=<?php print $id ?>"><img src="<?php print $CONF['base_url'] ?>/img/redx.png"></a></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
</form>
|
||||
<?php
|
||||
|
||||
$st = array ();
|
||||
$rilevazioni = 0;
|
||||
while ($dato = mysql_fetch_array ( $res )) {
|
||||
$st[$rilevazioni++] = $dato;
|
||||
}
|
||||
$ultimo = $st[$rilevazioni-1];
|
||||
|
||||
$tabella->riga(20);
|
||||
$tabella->close();
|
||||
|
||||
for ($conta=0;$conta<$rilevazioni;$conta++) {
|
||||
$dato = $st[$conta];
|
||||
$tipo = "readonly";
|
||||
if ($conta == 0 && ($op == "nuovo" || $op == "modifica")) {
|
||||
$tipo = "";
|
||||
$img = "<input type=\"image\" src=\"$CONF[base_url]/img/applica.png\"></input>";
|
||||
$operazione = "salva";
|
||||
} else if ($conta == 0) {
|
||||
$img = "<input type=\"image\" src=\"$CONF[base_url]/img/modify.gif\"></input>";
|
||||
$operazione = "modifica";
|
||||
} else {
|
||||
$img = "<img src=\"$CONF[base_url]/img/spazio.gif\">";
|
||||
}
|
||||
|
||||
if ($conta == 0) {
|
||||
?>
|
||||
<form name="" method="post">
|
||||
<input type="hidden" name="id" value="<?php print $id ?>">
|
||||
<input type="hidden" name="storico" value="<?php print $dato[id] ?>">
|
||||
<input type="hidden" name="op" value="<?php print $operazione ?>">
|
||||
<?php }
|
||||
|
||||
$tabella = new html (0,"90%",array(5,40,10,40,5));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td><hr align="center" size="2" width="100%" color="#FFC350"></td>
|
||||
<td class="textc"><input id="data" <?php if ($tipo == "") { print "class=\"data\""; } ?> type="text" size="8" name="data" value="<?php print $dato[data] ?>" <?php print $tipo ?>></input></td>
|
||||
<td><hr align="center" size="2" width="100%" color="#FFC350"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->close();
|
||||
|
||||
$tabella = new html (0,"90%",array(2,7,1,7,1,6,1,7,1,7,1,5,1,5,1,7,1,7,1,7,1,6,1,6,2,4,0));
|
||||
$tabella->intestazione (array("","Peso","","Altezza","","Cooper","","Sargeant","","Fles. Tr.","","Calci SX","","Calci DX","","S. Lungo","","Arti S. Av","","Arti S. Ind","","Mob. Art.","","Cingolo","","",""));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="peso" value="<?php print $dato[peso] ?>" <?php print $tipo ?>> Kg</input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="2" name="altezza" value="<?php print $dato[altezza] ?>" <?php print $tipo ?>> cm</input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="cooper" value="<?php print $dato[cooper] ?>" <?php print $tipo ?>> m</input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="sargeant" value="<?php print $dato[sargeant] ?>" <?php print $tipo ?>> cm</input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="flesstro" value="<?php print $dato[flesstro] ?>" <?php print $tipo ?>> cm</input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="calcisx" value="<?php print $dato[calcisx] ?>" <?php print $tipo ?>></input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="calcidx" value="<?php print $dato[calcidx] ?>" <?php print $tipo ?>></input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="slungo" value="<?php print $dato[slungo] ?>" <?php print $tipo ?>> cm</input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="pallaav" value="<?php print $dato[pallaav] ?>" <?php print $tipo ?>> cm</input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="pallaind" value="<?php print $dato[pallaind] ?>" <?php print $tipo ?>> cm</input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="mobart" value="<?php print $dato[mobart] ?>" <?php print $tipo ?>> °</input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" name="cingolo" value="<?php print $dato[cingolo] ?>" <?php print $tipo ?>></input></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="spazioh"><?php print $img ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php if (($conta+1 < $rilevazioni) && ($op != "nuovo") && ($op != "modifica")) { ?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print differenza ($dato[peso], $st[$conta+1][peso], 1); print differenza ($dato[peso], $ultimo[peso], 1) ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print differenza ($dato[altezza], $st[$conta+1][altezza]); print differenza ($dato[altezza], $ultimo[altezza]) ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print differenza ($dato[cooper], $st[$conta+1][cooper]); print differenza ($dato[cooper], $ultimo[cooper]) ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print differenza ($dato[sargeant], $st[$conta+1][sargeant]); print differenza ($dato[sargeant], $ultimo[sargeant]) ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print differenza ($dato[flesstro], $st[$conta+1][flesstro]); print differenza ($dato[flesstro], $ultimo[flesstro]) ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print differenza ($dato[calcisx], $st[$conta+1][calcisx]); print differenza ($dato[calcisx], $ultimo[calcisx]) ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print differenza ($dato[calcidx], $st[$conta+1][calcidx]); print differenza ($dato[calcidx], $ultimo[calcidx]) ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print differenza ($dato[slungo], $st[$conta+1][slungo]); print differenza ($dato[slungo], $ultimo[slungo]) ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print differenza ($dato[pallaav], $st[$conta+1][pallaav]); print differenza ($dato[pallaav], $ultimo[pallaav]) ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print differenza ($dato[pallaind], $st[$conta+1][pallaind]); print differenza ($dato[pallaind], $ultimo[pallaind]) ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print differenza ($dato[mobart], $st[$conta+1][mobart]); print differenza ($dato[mobart], $ultimo[mobart]) ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print differenza ($dato[cingolo], $st[$conta+1][cingolo]); print differenza ($dato[cingolo], $ultimo[cingolo]) ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
<td class="spazioh"><div align="left" style="font-size: 10px">Precedente</div><div align="left" style="font-size: 10px">Prima</div></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF[base_url] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
$tabella->riga(5);
|
||||
$tabella->close();
|
||||
|
||||
$tabella = new html (0,"90%",array(2,96,0));
|
||||
$tabella->intestazione (array("","Commenti",""));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td><textarea name="commenti" rows="2" cols="118" <?php print $tipo ?>><?php print $dato[commenti]?></textarea></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga(20);
|
||||
$tabella->close();
|
||||
|
||||
if ($conta == 0) { ?>
|
||||
</form>
|
||||
<?php }
|
||||
|
||||
}
|
||||
view_footer(); ?>
|
||||
53
associazione/jsl/ordini_edit.js
Normal file
53
associazione/jsl/ordini_edit.js
Normal file
@@ -0,0 +1,53 @@
|
||||
$(function(){
|
||||
$("#categoria").on("change",function(e){
|
||||
var questo = $(this);
|
||||
var zero = 0;
|
||||
|
||||
$.ajax({
|
||||
url: "cercaprod.php",
|
||||
data: { 'categoria': questo.val()},
|
||||
dataType: "json",
|
||||
success: function(r) {
|
||||
if (r.status=="OK"){
|
||||
$("#produttore").html(r.prod);
|
||||
$("#materiale").html(r.mat);
|
||||
$("#vendita").val(zero.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#produttore").on("change",function(e){
|
||||
var questo = $(this);
|
||||
var cat = document.getElementById("categoria");
|
||||
var zero = 0;
|
||||
|
||||
$.ajax({
|
||||
url: "cercaart.php",
|
||||
data: { 'produttore': questo.val(), 'categoria': cat.value},
|
||||
dataType: "json",
|
||||
success: function(r) {
|
||||
if (r.status=="OK"){
|
||||
$("#materiale").html(r.mat);
|
||||
$("#vendita").val(zero.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#materiale").on("change",function(e){
|
||||
var questo = $(this);
|
||||
|
||||
$.ajax({
|
||||
url: "cercamat.php",
|
||||
data: { 'articolo': questo.val()},
|
||||
dataType: "json",
|
||||
success: function(r) {
|
||||
if (r.status=="OK"){
|
||||
$("#vendita").val(r.art);
|
||||
$("#taglia").html(r.tag);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
270
associazione/jsl/ordini_edit_main.js
Normal file
270
associazione/jsl/ordini_edit_main.js
Normal file
@@ -0,0 +1,270 @@
|
||||
$(function(){
|
||||
$("#articoli").on("change",function(e){
|
||||
var questo = $(this);
|
||||
|
||||
window.location = '?articoli=' + questo.val();
|
||||
});
|
||||
|
||||
|
||||
$("#categoria1").on("change",function(e){
|
||||
var questo = $(this);
|
||||
var zero = 0;
|
||||
|
||||
$.ajax({
|
||||
url: "cercaprod.php",
|
||||
data: { 'categoria': questo.val()},
|
||||
dataType: "json",
|
||||
success: function(r) {
|
||||
if (r.status=="OK"){
|
||||
$("#produttore1").html(r.prod);
|
||||
$("#materiale1").html(r.mat);
|
||||
$("#vendita1").val(zero.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#produttore1").on("change",function(e){
|
||||
var questo = $(this);
|
||||
var cat = document.getElementById("categoria1");
|
||||
var zero = 0;
|
||||
|
||||
$.ajax({
|
||||
url: "cercaart.php",
|
||||
data: { 'produttore': questo.val(), 'categoria': cat.value},
|
||||
dataType: "json",
|
||||
success: function(r) {
|
||||
if (r.status=="OK"){
|
||||
$("#materiale1").html(r.mat);
|
||||
$("#vendita1").val(zero.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#materiale1").on("change",function(e){
|
||||
var questo = $(this);
|
||||
|
||||
$.ajax({
|
||||
url: "cercamat.php",
|
||||
data: { 'articolo': questo.val()},
|
||||
dataType: "json",
|
||||
success: function(r) {
|
||||
if (r.status=="OK"){
|
||||
$("#vendita1").val(r.art);
|
||||
$("#taglia1").html(r.tag);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("#categoria2").on("change",function(e){
|
||||
var questo = $(this);
|
||||
var zero = 0;
|
||||
|
||||
$.ajax({
|
||||
url: "cercaprod.php",
|
||||
data: { 'categoria': questo.val()},
|
||||
dataType: "json",
|
||||
success: function(r) {
|
||||
if (r.status=="OK"){
|
||||
$("#produttore2").html(r.prod);
|
||||
$("#materiale2").html(r.mat);
|
||||
$("#vendita2").val(zero.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#produttore2").on("change",function(e){
|
||||
var questo = $(this);
|
||||
var cat = document.getElementById("categoria2");
|
||||
var zero = 0;
|
||||
|
||||
$.ajax({
|
||||
url: "cercaart.php",
|
||||
data: { 'produttore': questo.val(), 'categoria': cat.value},
|
||||
dataType: "json",
|
||||
success: function(r) {
|
||||
if (r.status=="OK"){
|
||||
$("#materiale2").html(r.mat);
|
||||
$("#vendita2").val(zero.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#materiale2").on("change",function(e){
|
||||
var questo = $(this);
|
||||
|
||||
$.ajax({
|
||||
url: "cercamat.php",
|
||||
data: { 'articolo': questo.val()},
|
||||
dataType: "json",
|
||||
success: function(r) {
|
||||
if (r.status=="OK"){
|
||||
$("#vendita2").val(r.art);
|
||||
$("#taglia2").html(r.tag);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#categoria3").on("change",function(e){
|
||||
var questo = $(this);
|
||||
var zero = 0;
|
||||
|
||||
$.ajax({
|
||||
url: "cercaprod.php",
|
||||
data: { 'categoria': questo.val()},
|
||||
dataType: "json",
|
||||
success: function(r) {
|
||||
if (r.status=="OK"){
|
||||
$("#produttore3").html(r.prod);
|
||||
$("#materiale3").html(r.mat);
|
||||
$("#vendita3").val(zero.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#produttore3").on("change",function(e){
|
||||
var questo = $(this);
|
||||
var cat = document.getElementById("categoria3");
|
||||
var zero = 0;
|
||||
|
||||
$.ajax({
|
||||
url: "cercaart.php",
|
||||
data: { 'produttore': questo.val(), 'categoria': cat.value},
|
||||
dataType: "json",
|
||||
success: function(r) {
|
||||
if (r.status=="OK"){
|
||||
$("#materiale3").html(r.mat);
|
||||
$("#vendita3").val(zero.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#materiale3").on("change",function(e){
|
||||
var questo = $(this);
|
||||
|
||||
$.ajax({
|
||||
url: "cercamat.php",
|
||||
data: { 'articolo': questo.val()},
|
||||
dataType: "json",
|
||||
success: function(r) {
|
||||
if (r.status=="OK"){
|
||||
$("#vendita3").val(r.art);
|
||||
$("#taglia3").html(r.tag);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#categoria4").on("change",function(e){
|
||||
var questo = $(this);
|
||||
var zero = 0;
|
||||
|
||||
$.ajax({
|
||||
url: "cercaprod.php",
|
||||
data: { 'categoria': questo.val()},
|
||||
dataType: "json",
|
||||
success: function(r) {
|
||||
if (r.status=="OK"){
|
||||
$("#produttore4").html(r.prod);
|
||||
$("#materiale4").html(r.mat);
|
||||
$("#vendita4").val(zero.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#produttore4").on("change",function(e){
|
||||
var questo = $(this);
|
||||
var cat = document.getElementById("categoria4");
|
||||
var zero = 0;
|
||||
|
||||
$.ajax({
|
||||
url: "cercaart.php",
|
||||
data: { 'produttore': questo.val(), 'categoria': cat.value},
|
||||
dataType: "json",
|
||||
success: function(r) {
|
||||
if (r.status=="OK"){
|
||||
$("#materiale4").html(r.mat);
|
||||
$("#vendita4").val(zero.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#materiale4").on("change",function(e){
|
||||
var questo = $(this);
|
||||
|
||||
$.ajax({
|
||||
url: "cercamat.php",
|
||||
data: { 'articolo': questo.val()},
|
||||
dataType: "json",
|
||||
success: function(r) {
|
||||
if (r.status=="OK"){
|
||||
$("#vendita4").val(r.art);
|
||||
$("#taglia4").html(r.tag);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#categoria5").on("change",function(e){
|
||||
var questo = $(this);
|
||||
var zero = 0;
|
||||
|
||||
$.ajax({
|
||||
url: "cercaprod.php",
|
||||
data: { 'categoria': questo.val()},
|
||||
dataType: "json",
|
||||
success: function(r) {
|
||||
if (r.status=="OK"){
|
||||
$("#produttore5").html(r.prod);
|
||||
$("#materiale5").html(r.mat);
|
||||
$("#vendita5").val(zero.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#produttore5").on("change",function(e){
|
||||
var questo = $(this);
|
||||
var cat = document.getElementById("categoria5");
|
||||
var zero = 0;
|
||||
|
||||
$.ajax({
|
||||
url: "cercaart.php",
|
||||
data: { 'produttore': questo.val(), 'categoria': cat.value},
|
||||
dataType: "json",
|
||||
success: function(r) {
|
||||
if (r.status=="OK"){
|
||||
$("#materiale5").html(r.mat);
|
||||
$("#vendita5").val(zero.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#materiale5").on("change",function(e){
|
||||
var questo = $(this);
|
||||
|
||||
$.ajax({
|
||||
url: "cercamat.php",
|
||||
data: { 'articolo': questo.val()},
|
||||
dataType: "json",
|
||||
success: function(r) {
|
||||
if (r.status=="OK"){
|
||||
$("#vendita5").val(r.art);
|
||||
$("#taglia5").html(r.tag);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
191
associazione/materiale_edit.php
Executable file
191
associazione/materiale_edit.php
Executable file
@@ -0,0 +1,191 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
include_once ("funzioni.php");
|
||||
$UTENTE = login();
|
||||
$DIRITTI = diritti('Admin');
|
||||
view_top();
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
$post = addslashes_array ($_POST);
|
||||
extract($post);
|
||||
|
||||
if ($categoria == 'Nuovo') {
|
||||
$categoria = $ncat;
|
||||
$query = "INSERT INTO wf_cat_materiale SET nome = '$categoria', attivo = 1";
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
}
|
||||
|
||||
if ($produttore == 'Nuovo') {
|
||||
$produttore = $nprod;
|
||||
$query = "INSERT INTO wf_prod_materiale SET nome = '$produttore', attivo = 1";
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
}
|
||||
|
||||
$vendita +=0;
|
||||
|
||||
if ($id) {
|
||||
$query = " UPDATE
|
||||
wf_materiale
|
||||
SET
|
||||
nome = '$nome',
|
||||
categoria = '$categoria',
|
||||
produttore = '$produttore',
|
||||
nota = '$nota',
|
||||
taglie = UPPER('$taglie'),
|
||||
vendita = $vendita
|
||||
WHERE
|
||||
id = $id
|
||||
";
|
||||
} else {
|
||||
$query = " INSERT INTO
|
||||
wf_materiale
|
||||
SET
|
||||
attivo = 1,
|
||||
nome = '$nome',
|
||||
categoria = '$categoria',
|
||||
produttore = '$produttore',
|
||||
nota = '$nota',
|
||||
taglie = UPPER('$taglie'),
|
||||
vendita = $vendita
|
||||
";
|
||||
}
|
||||
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
if ($id == "") {
|
||||
$id = mysql_insert_id();
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
document.location.href='materiale_lista.php?id=<?php print $id ?>'
|
||||
</script>
|
||||
<?php
|
||||
exit;
|
||||
|
||||
|
||||
} elseif (isset($_GET['id'])) {
|
||||
$id = $_GET['id'];
|
||||
}
|
||||
?>
|
||||
|
||||
<form name="" method="post">
|
||||
<input type="hidden" name="id" value="<?php print $id ?>">
|
||||
<?php
|
||||
|
||||
$query = " SELECT
|
||||
id,
|
||||
attivo,
|
||||
nome,
|
||||
categoria,
|
||||
produttore,
|
||||
nota,
|
||||
taglie,
|
||||
vendita
|
||||
FROM
|
||||
wf_materiale
|
||||
WHERE
|
||||
id = $id
|
||||
";
|
||||
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
$dato = mysql_fetch_array ( $res );
|
||||
|
||||
$query = " SELECT
|
||||
id,
|
||||
nome
|
||||
FROM
|
||||
wf_cat_materiale
|
||||
ORDER BY
|
||||
nome
|
||||
";
|
||||
|
||||
$res_cat_materiale = mysql_query( $query, $DB_ID );
|
||||
|
||||
$query = " SELECT
|
||||
id,
|
||||
nome
|
||||
FROM
|
||||
wf_prod_materiale
|
||||
ORDER BY
|
||||
nome
|
||||
";
|
||||
|
||||
$res_prod_materiale = mysql_query( $query, $DB_ID );
|
||||
|
||||
$tabella = new html (0,"90%",array(2,15,2,20,2,15,2,15,2,15,2,10,0));
|
||||
$tabella->intestazione (array("", "Articolo", "", "Categoria", "", "Produttore", "", "Taglia", "", "Note", "", "Vendita €", ""));
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
if ($dato['attivo']) {
|
||||
?>
|
||||
<td rowspan=2 class="spazioh"><a href="wf_gest.php?azione=wf_mat_off&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/attivo.gif" ALT="Articolo Attivo" TITLE="Articolo Attivo"></a></td>
|
||||
<?php } else { ?>
|
||||
<td rowspan=2 class="spazioh"><a href="wf_gest.php?azione=wf_mat_on&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/non_attivo.gif" ALT="Articolo non Attivo" TITLE="Articolo non Attivo"></a></td>
|
||||
<?php } ?>
|
||||
<td rowspan=2 class="colip"><input type="text" name=nome value="<?php print $dato['nome'] ?>"></td>
|
||||
<td rowspan=2 class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip">
|
||||
<select name=categoria>
|
||||
<option value="">Seleziona</option>
|
||||
<?php while ($dato_cat_materiale = mysql_fetch_array ( $res_cat_materiale )) { ?>
|
||||
<option value="<?php print $dato_cat_materiale['nome']?>" <?php if ($dato['categoria'] == $dato_cat_materiale['nome']) { print "selected=\"selected\"";}?>><?php print $dato_cat_materiale['nome']?></option>
|
||||
<?php } ?>
|
||||
<option value="Nuovo">Nuovo</option>
|
||||
</select>
|
||||
</td>
|
||||
<td rowspan=2 class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip">
|
||||
<select name=produttore>
|
||||
<option value="">Seleziona</option>
|
||||
<?php while ($dato_prod_materiale = mysql_fetch_array ( $res_prod_materiale )) { ?>
|
||||
<option value="<?php print $dato_prod_materiale['nome']?>" <?php if ($dato['produttore'] == $dato_prod_materiale['nome']) { print "selected=\"selected\"";}?>><?php print $dato_prod_materiale['nome']?></option>
|
||||
<?php } ?>
|
||||
<option value="Nuovo">Nuovo</option>
|
||||
</select>
|
||||
</td>
|
||||
<td rowspan=2 class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td rowspan=2 class="colip"><input type="text" name=taglie value="<?php print $dato['taglie'] ?>"></td>
|
||||
<td rowspan=2 class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td rowspan=2 class="colip"><input type="text" name=nota value="<?php print $dato['nota'] ?>"></td>
|
||||
<td rowspan=2 class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td rowspan=2 class="colip"><input type="text" name=vendita value="<?php print $dato['vendita'] ?>"></td>
|
||||
<td rowspan=2 class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="colip"><input type="text" name=ncat value=""></td>
|
||||
<td class="colip"><input type="text" name=nprod value=""></td>
|
||||
</tr>
|
||||
<?php $tabella->riga(5); ?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td valign="top" class="descrizione">Inserire il nome del nuovo articolo</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td valign="top" class="descrizione">Selezionare la categoria o selezionando "Nuovo" inserire nel campo sottostante la nuova categoria</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td valign="top" class="descrizione">Selezionare il produttore o selezionando "Nuovo" inserire nel campo sottostante il nuovo produttore</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td valign="top" class="descrizione">Inserire tutte le taglie separate da uno spazio (es. XS S M L XL). Lasciare il campo vuoto se non utile.</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<?php
|
||||
$tabella->riga(5);
|
||||
$tabella->close();
|
||||
|
||||
$tabella = new html (0,"90%",array(5,20,0));
|
||||
$tabella->riga(); ?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="spaziov" colspan=10><input type="submit" value="Conferma"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<?php $tabella->close(); ?>
|
||||
</form>
|
||||
<?php view_footer(); ?>
|
||||
78
associazione/materiale_lista.php
Executable file
78
associazione/materiale_lista.php
Executable file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
include_once ("funzioni.php");
|
||||
$UTENTE = login();
|
||||
$DIRITTI = diritti('Admin');
|
||||
view_top();
|
||||
?>
|
||||
|
||||
<form name="" method="post">
|
||||
<?php $tabella = new html (0,"90%", array (3,5,2,30,2,20,2,10,2,10,2,10,0)); ?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="spazioh"><a href="materiale_edit.php"><img src="<?php print $CONF['base_url'] ?>/img/addresource.png"></a></td>
|
||||
<td colspan=11 class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga();
|
||||
$query = " SELECT
|
||||
wf_materiale.id,
|
||||
wf_materiale.attivo,
|
||||
wf_materiale.nome,
|
||||
wf_materiale.taglie,
|
||||
wf_materiale.nota,
|
||||
wf_materiale.vendita,
|
||||
wf_materiale.categoria,
|
||||
wf_materiale.produttore
|
||||
FROM
|
||||
wf_materiale
|
||||
ORDER BY
|
||||
wf_materiale.attivo desc,
|
||||
wf_materiale.categoria,
|
||||
wf_materiale.produttore,
|
||||
wf_materiale.nome
|
||||
";
|
||||
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
$tabella->intestazione (array("", "", "", "Articolo", "", "Produttore", "", "Taglie", "","Nota", "", "Vendita", ""));
|
||||
$tabella->riga();
|
||||
$artold = "";
|
||||
while ($dato = mysql_fetch_array ( $res )) {
|
||||
|
||||
if ($artold != $dato['categoria']) {
|
||||
if ($artold != "") $tabella->riga();
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh" colspan="3"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colipb" colspan="10"><?php print $dato['categoria'] ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<?php
|
||||
if ($dato['attivo']) {
|
||||
?>
|
||||
<td class="col3btn"><a href="wf_gest.php?azione=wf_art_off&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/attivo.gif" ALT="Articolo attivo" TITLE="Articolo attivo"></a></td>
|
||||
<?php } else { ?>
|
||||
<td class="col3btn"><a href="wf_gest.php?azione=wf_art_on&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/non_attivo.gif" ALT="Articolo non attivo" TITLE="Articolo non attivo"></a></td>
|
||||
<?php } ?>
|
||||
<td class="col3btn"><a href="materiale_edit.php?id=<?php print $dato['id'] ?>"><img src="<?php print $CONF['base_url'] ?>/img/modify.gif" ALT="Modifica articolo" TITLE="Modifica articolo"></a></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['nome'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['produttore'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['taglie'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['nota'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['vendita'] ?> €</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$artold = $dato['categoria'];
|
||||
}
|
||||
$tabella->close();
|
||||
?>
|
||||
</form>
|
||||
<?php view_footer(); ?>
|
||||
318
associazione/ordini_edit.php
Executable file
318
associazione/ordini_edit.php
Executable file
@@ -0,0 +1,318 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
include_once ("funzioni.php");
|
||||
$UTENTE = login();
|
||||
$DIRITTI = diritti('Utente');
|
||||
view_top();
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
extract($_POST);
|
||||
|
||||
$c_ordine = sistemadata($c_ordine);
|
||||
$c_pagamento = sistemadata($c_pagamento);
|
||||
$c_consegna = sistemadata($c_consegna);
|
||||
$f_ordine = sistemadata($f_ordine);
|
||||
$f_consegna = sistemadata($f_consegna);
|
||||
$s_pagamento = sistemadata($s_pagamento);
|
||||
$s_consegna = sistemadata($s_consegna);
|
||||
|
||||
($c_ordine != "") ? $c_ordine_q = "STR_TO_DATE('$c_ordine', '%d.%m.%Y')" : $c_ordine_q = "NULL";
|
||||
($c_pagamento != "") ? $c_pagamento_q = "STR_TO_DATE('$c_pagamento', '%d.%m.%Y')" : $c_pagamento_q = "NULL";
|
||||
($c_consegna != "") ? $c_consegna_q = "STR_TO_DATE('$c_consegna', '%d.%m.%Y')" : $c_consegna_q = "NULL";
|
||||
($f_ordine != "") ? $f_ordine_q = "STR_TO_DATE('$f_ordine', '%d.%m.%Y')" : $f_ordine_q = "NULL";
|
||||
($f_consegna != "") ? $f_consegna_q = "STR_TO_DATE('$f_consegna', '%d.%m.%Y')" : $f_consegna_q = "NULL";
|
||||
($s_pagamento != "") ? $s_pagamento_q = "STR_TO_DATE('$s_pagamento', '%d.%m.%Y')" : $s_pagamento_q = "NULL";
|
||||
($s_consegna != "") ? $s_consegna_q = "STR_TO_DATE('$s_consegna', '%d.%m.%Y')" : $s_consegna_q = "NULL";
|
||||
|
||||
|
||||
if ($id_materiale_nuovo != "") {
|
||||
$id_materiale = $id_materiale_nuovo;
|
||||
}
|
||||
|
||||
$query = " UPDATE
|
||||
wf_ordini
|
||||
SET
|
||||
id_materiale = $id_materiale,
|
||||
taglia = UPPER('$taglia'),
|
||||
c_ordine = $c_ordine_q,
|
||||
c_pagamento = $c_pagamento_q,
|
||||
c_consegna = $c_consegna_q,
|
||||
f_ordine = $f_ordine_q,
|
||||
f_consegna = $f_consegna_q,
|
||||
s_pagamento = $s_pagamento_q,
|
||||
s_consegna = $s_consegna_q,
|
||||
materiale = (SELECT nome FROM wf_materiale WHERE id = $id_materiale),
|
||||
categoria = (SELECT categoria FROM wf_materiale WHERE id = $id_materiale),
|
||||
produttore = (SELECT produttore FROM wf_materiale WHERE id = $id_materiale),
|
||||
costo = (SELECT vendita FROM wf_materiale WHERE id = $id_materiale)
|
||||
WHERE
|
||||
id = $id
|
||||
";
|
||||
|
||||
// print $query; exit;
|
||||
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
if ($id == "") {
|
||||
$id = mysql_insert_id();
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
document.location.href='index.php'
|
||||
</script>
|
||||
<?php
|
||||
exit;
|
||||
|
||||
} elseif (isset($_GET['id'])) {
|
||||
$id = $_GET['id'];
|
||||
}
|
||||
?>
|
||||
|
||||
<form name="" method="post" id="ordine">
|
||||
<input type="hidden" name="id" value="<?php @print $id ?>">
|
||||
<?php
|
||||
@$query = " SELECT
|
||||
wf_ordini.id,
|
||||
wf_ordini.id_iscritto,
|
||||
wf_iscritto.nome,
|
||||
wf_iscritto.cognome,
|
||||
wf_ordini.materiale,
|
||||
wf_ordini.categoria,
|
||||
wf_ordini.produttore,
|
||||
wf_ordini.id_materiale,
|
||||
wf_ordini.taglia,
|
||||
wf_ordini.costo,
|
||||
DATE_FORMAT(wf_ordini.c_ordine, '%d.%m.%Y') AS c_ordine,
|
||||
DATE_FORMAT(wf_ordini.c_pagamento, '%d.%m.%Y') AS c_pagamento,
|
||||
DATE_FORMAT(wf_ordini.c_consegna, '%d.%m.%Y') AS c_consegna,
|
||||
DATE_FORMAT(wf_ordini.f_ordine, '%d.%m.%Y') AS f_ordine,
|
||||
DATE_FORMAT(wf_ordini.f_consegna, '%d.%m.%Y') AS f_consegna,
|
||||
DATE_FORMAT(wf_ordini.s_pagamento, '%d.%m.%Y') AS s_pagamento,
|
||||
DATE_FORMAT(wf_ordini.s_consegna, '%d.%m.%Y') AS s_consegna
|
||||
FROM
|
||||
wf_ordini
|
||||
JOIN
|
||||
wf_iscritto
|
||||
ON
|
||||
wf_ordini.id_iscritto = wf_iscritto.id
|
||||
WHERE
|
||||
wf_ordini.id = $id
|
||||
";
|
||||
@$res = mysql_query( $query, $DB_ID );
|
||||
@$dato = mysql_fetch_array ( $res );
|
||||
|
||||
(livello_modulo($DIRITTI) == "Admin") ? $query_admin = "" : $query_admin = "
|
||||
JOIN
|
||||
wf_utenti
|
||||
ON
|
||||
wf_iscritto.id_palestra = wf_utenti.id_palestra
|
||||
AND
|
||||
wf_utenti.id_utenti = ".$UTENTE['id']."
|
||||
AND
|
||||
wf_utenti.attivo = 1";
|
||||
|
||||
$query = " SELECT
|
||||
wf_iscritto.id,
|
||||
wf_iscritto.nome,
|
||||
wf_iscritto.cognome
|
||||
FROM
|
||||
wf_iscritto
|
||||
$query_admin
|
||||
WHERE
|
||||
wf_iscritto.attivo = 1
|
||||
ORDER BY
|
||||
wf_iscritto.cognome,
|
||||
wf_iscritto.nome
|
||||
";
|
||||
$res_atleti = mysql_query( $query, $DB_ID );
|
||||
|
||||
$tabella = new html (0,"90%",array(5,50,0));
|
||||
$tabella->intestazione (array("","Atleta",""));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colipb">
|
||||
<?php if ($dato['id_iscritto'] == "") { ?>
|
||||
<select name=id_iscritto>
|
||||
<?php while ($dato_atleta = mysql_fetch_array ( $res_atleti )) { ?>
|
||||
<option value="<?php print $dato_atleta['id']?>" <?php if ($dato['id_iscritto'] == $dato_atleta['id']) { print "selected=\"selected\"";}?>><?php print $dato_atleta['cognome']." ".$dato_atleta['nome']?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<?php } else { ?>
|
||||
<?php print $dato['cognome']." ".$dato['nome'] ?>
|
||||
<input type="hidden" name="id_iscritto" value="<?php print $dato['id_iscritto'] ?>">
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga(30);
|
||||
$tabella->close();
|
||||
?>
|
||||
<input type="hidden" name="id_materiale" value="<?php @print $dato['id_materiale'] ?>">
|
||||
<?php
|
||||
$tabella = new html (0,"90%",array(5,15,5,15,5,15,5,15,5,0));
|
||||
$tabella->intestazione (array("","Categoria","","Produttore","","Materiale","","Taglia","","Costo",""));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input type="text" readonly value="<?php print $dato['categoria'] ?>"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input type="text" readonly value="<?php print $dato['produttore'] ?>"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input type="text" readonly value="<?php print $dato['materiale'] ?>"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input type="text" readonly value="<?php print $dato['taglia'] ?>"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input type="text" size="5%" readonly value="<?php print $dato['costo'] ?>"> €</td>
|
||||
</tr>
|
||||
<?php if ($dato['id_materiale'] == "" || $dato['f_ordine'] == "" || is_null($dato['f_ordine'])) { ?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip">
|
||||
<select name="categoria" id="categoria">
|
||||
<option value="">SELEZIONARE</option>
|
||||
<?php
|
||||
$query = "SELECT categoria FROM wf_materiale WHERE attivo = 1 GROUP BY categoria ORDER BY categoria";
|
||||
$res_categoria = mysql_query( $query, $DB_ID );
|
||||
while ($dato_categoria = mysql_fetch_array ( $res_categoria )) {
|
||||
print "<option value=\"$dato_categoria[categoria]\">$dato_categoria[categoria]</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip">
|
||||
<select name="produttore" id="produttore">
|
||||
<option value="">Selezionare prima la categoria</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip">
|
||||
<select name="id_materiale_nuovo" id="materiale">
|
||||
<option value="">Selezionare prima la categoria</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip">
|
||||
<select name="taglia" id="taglia">
|
||||
<option value="">Selezionare prima il materiale</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td class="colip"><input type="text" id="vendita" name="vendita" size="5%" readonly value=""> €</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
$tabella->riga(30);
|
||||
$tabella->close();
|
||||
|
||||
$tabella = new html (0,"90%",array(5,90,5));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip">Atleta</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td><hr></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga(5);
|
||||
$tabella->close();
|
||||
|
||||
$tabella = new html (0,"90%",array(5,10,5,10,5,10,0));
|
||||
$tabella->intestazione (array("","Ordine","","Pagamento","","Consegna",""));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colipb"><?php $nomec = "c_ordine"; ($dato[$nomec] == "") ? print "<input id=\"$nomec\" class=\"data\" size=8% type=\"text\" name=$nomec value=\"".date("d/m/Y")."\"></td>" : print $dato[$nomec]."<input type=\"hidden\" name=\"$nomec\" value=\"".$dato[$nomec]."\">" ?>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colipb"><?php $nomec = "c_pagamento"; ($dato[$nomec] == "") ? print "<input id=\"$nomec\" class=\"data\" size=8% type=\"text\" name=$nomec value=\"".$dato[$nomec]."\"></td>" : print $dato[$nomec]."<input type=\"hidden\" name=\"$nomec\" value=\"".$dato[$nomec]."\">" ?>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colipb"><?php $nomec = "c_consegna"; ($dato[$nomec] == "") ? ($dato['s_consegna'] == "") ? print " " :print "<input id=\"$nomec\" class=\"data\" size=8% type=\"text\" name=$nomec value=\"".$dato[$nomec]."\"></td>" : print $dato[$nomec]."<input type=\"hidden\" name=\"$nomec\" value=\"".$dato[$nomec]."\">" ?>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga(30);
|
||||
$tabella->close();
|
||||
|
||||
if (livello_modulo($DIRITTI) == "Admin") {
|
||||
$tabella = new html (0,"90%",array(5,90,5));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip">Fornitore</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td><hr></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga(5);
|
||||
$tabella->close();
|
||||
|
||||
$tabella = new html (0,"90%",array(5,10,5,10,0));
|
||||
$tabella->intestazione (array("","Ordine","","Consegna",""));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colipb"><?php $nomec = "f_ordine"; ($dato[$nomec] == "") ? print "<input id=\"$nomec\" class=\"data\" size=8% type=\"text\" name=$nomec value=\"".$dato[$nomec]."\"></td>" : print $dato[$nomec]."<input type=\"hidden\" name=\"$nomec\" value=\"".$dato[$nomec]."\">" ?>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colipb"><?php $nomec = "f_consegna"; ($dato[$nomec] == "") ? print "<input id=\"$nomec\" class=\"data\" size=8% type=\"text\" name=$nomec value=\"".$dato[$nomec]."\"></td>" : print $dato[$nomec]."<input type=\"hidden\" name=\"$nomec\" value=\"".$dato[$nomec]."\">" ?>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga(30);
|
||||
$tabella->close();
|
||||
} else { ?>
|
||||
<input type="hidden" name="f_ordine" value="<?php print $dato['f_ordine'] ?>">
|
||||
<input type="hidden" name="f_consegna" value="<?php print $dato['f_consegna'] ?>">
|
||||
<?php }
|
||||
|
||||
$tabella = new html (0,"90%",array(5,90,5));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip">Squadra</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td><hr></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga(5);
|
||||
$tabella->close();
|
||||
|
||||
$tabella = new html (0,"90%",array(5,10,5,10,0));
|
||||
$tabella->intestazione (array("","Consegna","","Pagamento",""));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colipb"><?php $nomec = "s_consegna"; ($dato[$nomec] == "") ? ($dato['f_consegna'] == "") ? print " " : print "<input id=\"$nomec\" class=\"data\" size=8% type=\"text\" name=$nomec value=\"".$dato[$nomec]."\"></td>" : print $dato[$nomec]."<input type=\"hidden\" name=\"$nomec\" value=\"".$dato[$nomec]."\">" ?>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colipb"><?php $nomec = "s_pagamento"; ($dato[$nomec] == "") ? ($dato['c_pagamento'] == "") ? print " " : print "<input id=\"$nomec\" class=\"data\" size=8% type=\"text\" name=$nomec value=\"".$dato[$nomec]."\"></td>" : print $dato[$nomec]."<input type=\"hidden\" name=\"$nomec\" value=\"".$dato[$nomec]."\">" ?>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga(30);
|
||||
$tabella->close();
|
||||
|
||||
$tabella = new html (0,"90%",array(5,20,0));
|
||||
$tabella->riga(); ?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="spaziov" colspan=10><input type="submit" value="Conferma"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<?php $tabella->close(); ?>
|
||||
</form>
|
||||
<?php view_footer(); ?>
|
||||
252
associazione/ordini_edit_main.php
Executable file
252
associazione/ordini_edit_main.php
Executable file
@@ -0,0 +1,252 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
include_once ("funzioni.php");
|
||||
$UTENTE = login();
|
||||
$DIRITTI = diritti('Utente');
|
||||
view_top();
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
extract($_POST);
|
||||
|
||||
if ($id_iscritto != "") {
|
||||
|
||||
$c_ordine = sistemadata($c_ordine);
|
||||
$c_pagamento = sistemadata($c_pagamento);
|
||||
$c_consegna = sistemadata($c_consegna);
|
||||
|
||||
($c_ordine != "") ? $c_ordine_q = "STR_TO_DATE('$c_ordine', '%d.%m.%Y')" : $c_ordine_q = "NULL";
|
||||
($c_pagamento != "") ? $c_pagamento_q = "STR_TO_DATE('$c_pagamento', '%d.%m.%Y')" : $c_pagamento_q = "NULL";
|
||||
($c_consegna != "") ? $c_consegna_q = "STR_TO_DATE('$c_consegna', '%d.%m.%Y')" : $c_consegna_q = "NULL";
|
||||
|
||||
|
||||
for ($i=1;$i<=$articoli;$i++) {
|
||||
$id_materiale = "id_materiale$i";
|
||||
$taglia = "taglia$i";
|
||||
if ($$id_materiale != "") {
|
||||
|
||||
if ($$taglia == "N/D") $$taglia = "";
|
||||
|
||||
$query = " INSERT INTO
|
||||
wf_ordini
|
||||
SET
|
||||
id_iscritto = $id_iscritto,
|
||||
id_materiale = ".$$id_materiale.",
|
||||
taglia = UPPER('".$$taglia."'),
|
||||
c_ordine = $c_ordine_q,
|
||||
c_pagamento = $c_pagamento_q,
|
||||
c_consegna = $c_consegna_q,
|
||||
materiale = (SELECT nome FROM wf_materiale WHERE id = ".$$id_materiale."),
|
||||
categoria = (SELECT categoria FROM wf_materiale WHERE id = ".$$id_materiale."),
|
||||
produttore = (SELECT produttore FROM wf_materiale WHERE id = ".$$id_materiale."),
|
||||
costo = (SELECT vendita FROM wf_materiale WHERE id = ".$$id_materiale.")
|
||||
";
|
||||
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
document.location.href='index.php'
|
||||
</script>
|
||||
<?php
|
||||
exit;
|
||||
|
||||
} elseif (isset($_GET['articoli'])) {
|
||||
$articoli = $_GET['articoli'];
|
||||
} else {
|
||||
$articoli = 1;
|
||||
}
|
||||
?>
|
||||
|
||||
<form name="" method="post" id="ordine">
|
||||
<input type="hidden" name="id" value="<?php @print $id ?>">
|
||||
<input type="hidden" name="articoli" value="<?php @print $articoli ?>">
|
||||
<?php
|
||||
@$query = " SELECT
|
||||
wf_ordini.id,
|
||||
wf_ordini.id_iscritto,
|
||||
wf_iscritto.nome,
|
||||
wf_iscritto.cognome,
|
||||
wf_materiale.nome AS materiale,
|
||||
wf_cat_materiale.nome AS categoria,
|
||||
wf_ordini.id_materiale,
|
||||
wf_ordini.taglia,
|
||||
wf_ordini.costo,
|
||||
DATE_FORMAT(wf_ordini.c_ordine, '%d.%m.%Y') AS c_ordine,
|
||||
DATE_FORMAT(wf_ordini.c_pagamento, '%d.%m.%Y') AS c_pagamento,
|
||||
DATE_FORMAT(wf_ordini.c_consegna, '%d.%m.%Y') AS c_consegna,
|
||||
DATE_FORMAT(wf_ordini.f_ordine, '%d.%m.%Y') AS f_ordine,
|
||||
DATE_FORMAT(wf_ordini.f_consegna, '%d.%m.%Y') AS f_consegna,
|
||||
DATE_FORMAT(wf_ordini.s_pagamento, '%d.%m.%Y') AS s_pagamento,
|
||||
DATE_FORMAT(wf_ordini.s_consegna, '%d.%m.%Y') AS s_consegna
|
||||
FROM
|
||||
wf_ordini
|
||||
JOIN
|
||||
wf_iscritto
|
||||
ON
|
||||
wf_ordini.id_iscritto = wf_iscritto.id
|
||||
JOIN
|
||||
wf_materiale
|
||||
ON
|
||||
wf_ordini.id_materiale = wf_materiale.id
|
||||
JOIN
|
||||
wf_cat_materiale
|
||||
ON
|
||||
wf_materiale.id_cat_materiale = wf_cat_materiale.id
|
||||
WHERE
|
||||
wf_ordini.id = $id
|
||||
";
|
||||
@$res = mysql_query( $query, $DB_ID );
|
||||
@$dato = mysql_fetch_array ( $res );
|
||||
|
||||
(livello_modulo($DIRITTI) == "Admin") ? $query_admin = "" : $query_admin = "
|
||||
JOIN
|
||||
wf_utenti
|
||||
ON
|
||||
wf_iscritto.id_palestra = wf_utenti.id_palestra
|
||||
AND
|
||||
wf_utenti.id_utenti = ".$UTENTE['id']."
|
||||
AND
|
||||
wf_utenti.attivo = 1";
|
||||
|
||||
$query = " SELECT
|
||||
wf_iscritto.id,
|
||||
wf_iscritto.nome,
|
||||
wf_iscritto.cognome
|
||||
FROM
|
||||
wf_iscritto
|
||||
$query_admin
|
||||
WHERE
|
||||
wf_iscritto.attivo = 1
|
||||
ORDER BY
|
||||
wf_iscritto.cognome,
|
||||
wf_iscritto.nome
|
||||
";
|
||||
$res_atleti = mysql_query( $query, $DB_ID );
|
||||
|
||||
$tabella = new html (0,"90%",array(5,30,5,5,30,0));
|
||||
$tabella->intestazione (array("","Atleta","","","",""));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colipb">
|
||||
<select name=id_iscritto>
|
||||
<option value="">SELEZIONARE</option>
|
||||
<?php while ($dato_atleta = mysql_fetch_array ( $res_atleti )) { ?>
|
||||
<option value="<?php print $dato_atleta['id']?>"><?php print $dato_atleta['cognome']." ".$dato_atleta['nome']?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip">
|
||||
<select name="articoli" id="articoli">
|
||||
<option value="1" <?php ($articoli == 1) ? print "selected=\"selected\"" : FALSE ?>>1</option>
|
||||
<option value="2" <?php ($articoli == 2) ? print "selected=\"selected\"" : FALSE ?>>2</option>
|
||||
<option value="3" <?php ($articoli == 3) ? print "selected=\"selected\"" : FALSE ?>>3</option>
|
||||
<option value="4" <?php ($articoli == 4) ? print "selected=\"selected\"" : FALSE ?>>4</option>
|
||||
<option value="5" <?php ($articoli == 5) ? print "selected=\"selected\"" : FALSE ?>>5</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="descrizione">Numero di articoli da ordinare, modificare questo valore comporta il reset di tutti gli altri campi</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga(30);
|
||||
$tabella->close();
|
||||
|
||||
$tabella = new html (0,"90%",array(5,20,5,20,5,20,5,20,5,20,0));
|
||||
$tabella->intestazione (array("","Categoria","","Produttore","","Materiale","","Taglia","","Costo",""));
|
||||
|
||||
for ($i=1;$i<=$articoli;$i++) {
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip">
|
||||
<select name="categoria<?php print $i ?>" id="categoria<?php print $i ?>">
|
||||
<option value="">SELEZIONARE</option>
|
||||
<?php
|
||||
$query = "SELECT categoria FROM wf_materiale WHERE attivo = 1 GROUP BY categoria ORDER BY categoria";
|
||||
$res_categoria = mysql_query( $query, $DB_ID );
|
||||
while ($dato_categoria = mysql_fetch_array ( $res_categoria )) {
|
||||
print "<option value=\"$dato_categoria[categoria]\">$dato_categoria[categoria]</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip">
|
||||
<select name="produttore<?php print $i ?>" id="produttore<?php print $i ?>">
|
||||
<option value="">Selezionare prima la categoria</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip">
|
||||
<select name="id_materiale<?php print $i ?>" id="materiale<?php print $i ?>">
|
||||
<option value="">Selezionare prima la categoria</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
|
||||
|
||||
<td class="colip">
|
||||
<select name="taglia<?php print $i ?>" id="taglia<?php print $i ?>">
|
||||
<option value="">Selezionare prima il materiale</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input type="text" id="vendita<?php print $i ?>" name="vendita<?php print $i ?>" size="5%" readonly value=""> €</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga(5);
|
||||
}
|
||||
$tabella->riga(30);
|
||||
$tabella->close();
|
||||
|
||||
$tabella = new html (0,"90%",array(5,90,5));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip">Atleta</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td><hr></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga(5);
|
||||
$tabella->close();
|
||||
|
||||
$tabella = new html (0,"90%",array(5,10,5,10,5,10,0));
|
||||
$tabella->intestazione (array("","Ordine","","Pagamento","","Consegna",""));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colipb"><input id="c_ordine" class="data" size=8% type="text" name=c_ordine value="<?php print date("d/m/Y") ?>"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colipb"><input id="c_pagamento" class="data" size=8% type="text" name=c_pagamento value=""></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colipb"><input id="c_consegna" class="data" size=8% type="text" name=c_consegna value=""></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga(30);
|
||||
$tabella->close();
|
||||
|
||||
|
||||
$tabella = new html (0,"90%",array(5,20,0));
|
||||
$tabella->riga(); ?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="spaziov" colspan=10><input type="submit" value="Conferma"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<?php $tabella->close(); ?>
|
||||
</form>
|
||||
<?php view_footer(); ?>
|
||||
343
associazione/ordini_lista.php
Executable file
343
associazione/ordini_lista.php
Executable file
@@ -0,0 +1,343 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
$UTENTE = login();
|
||||
$DIRITTI = diritti('Utente');
|
||||
view_top();
|
||||
|
||||
if (isset($_POST['comando'])) {
|
||||
$filtro = $_POST['filtro'];
|
||||
|
||||
switch ($filtro) {
|
||||
case 0:
|
||||
$subquery = "";
|
||||
break;
|
||||
case 1:
|
||||
$subquery = "AND c_ordine IS NOT NULL AND f_ordine IS NULL AND f_consegna IS NULL AND c_consegna IS NULL";
|
||||
break;
|
||||
case 2:
|
||||
$subquery = "AND f_ordine IS NOT NULL AND f_consegna IS NULL AND c_consegna IS NULL";
|
||||
break;
|
||||
case 3:
|
||||
$subquery = "AND f_consegna IS NOT NULL AND c_consegna IS NULL";
|
||||
break;
|
||||
case 4:
|
||||
$subquery = "AND c_consegna IS NOT NULL";
|
||||
break;
|
||||
|
||||
};
|
||||
|
||||
switch ($_POST['comando']) {
|
||||
case "pagamento":
|
||||
$variabile = "c_pagamento";
|
||||
break;
|
||||
case "versamento":
|
||||
$variabile = "s_pagamento";
|
||||
break;
|
||||
case "ritiro":
|
||||
$variabile = "s_consegna";
|
||||
break;
|
||||
case "consegna":
|
||||
$variabile = "c_consegna";
|
||||
break;
|
||||
case "ordinato":
|
||||
$variabile = "f_ordine";
|
||||
break;
|
||||
case "ricezione":
|
||||
$variabile = "f_consegna";
|
||||
break;
|
||||
}
|
||||
|
||||
foreach ($_POST as $key => $value) {
|
||||
if ($key == 'comando')
|
||||
continue;
|
||||
|
||||
$query = "UPDATE wf_ordini SET $variabile = NOW() WHERE id = $key AND $variabile IS NULL";
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
}
|
||||
} else {
|
||||
$filtro = 0;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function invia(comando) {
|
||||
var r = confirm("Confermi l'ordine di "+comando);
|
||||
|
||||
if (r == true) {
|
||||
document.getElementById("idcomando").value = comando;
|
||||
document.getElementById("ordini").submit();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
if (livello_modulo($DIRITTI) == "Admin") {
|
||||
$query_admin = "";
|
||||
} else {
|
||||
$query_admin = "
|
||||
JOIN
|
||||
wf_utenti
|
||||
ON
|
||||
wf_iscritto.id_palestra = wf_utenti.id_palestra
|
||||
AND
|
||||
wf_utenti.id_utenti = ".$UTENTE['id']."
|
||||
AND
|
||||
wf_utenti.attivo = 1";
|
||||
}
|
||||
|
||||
@$query = " SELECT
|
||||
wf_ordini.id,
|
||||
wf_ordini.taglia,
|
||||
wf_ordini.categoria,
|
||||
wf_ordini.produttore,
|
||||
wf_ordini.materiale AS articolo,
|
||||
wf_ordini.costo AS vendita,
|
||||
wf_iscritto.nome,
|
||||
wf_iscritto.cognome,
|
||||
wf_palestra.sigla,
|
||||
DATE_FORMAT(wf_ordini.c_ordine, '%d.%m.%Y') AS c_ordine,
|
||||
DATE_FORMAT(wf_ordini.c_pagamento, '%d.%m.%Y') AS c_pagamento,
|
||||
DATE_FORMAT(wf_ordini.c_consegna, '%d.%m.%Y') AS c_consegna,
|
||||
DATE_FORMAT(wf_ordini.f_ordine, '%d.%m.%Y') AS f_ordine,
|
||||
DATE_FORMAT(wf_ordini.f_consegna, '%d.%m.%Y') AS f_consegna,
|
||||
DATE_FORMAT(wf_ordini.s_consegna, '%d.%m.%Y') AS s_consegna,
|
||||
DATE_FORMAT(wf_ordini.s_pagamento, '%d.%m.%Y') AS s_pagamento
|
||||
FROM
|
||||
wf_ordini
|
||||
JOIN
|
||||
wf_iscritto
|
||||
ON
|
||||
wf_ordini.id_iscritto = wf_iscritto.id
|
||||
JOIN
|
||||
wf_palestra
|
||||
ON
|
||||
wf_iscritto.id_palestra = wf_palestra.id
|
||||
$query_admin
|
||||
WHERE
|
||||
(wf_ordini.s_pagamento IS NULL
|
||||
OR
|
||||
wf_ordini.c_consegna IS NULL)
|
||||
$subquery
|
||||
ORDER BY
|
||||
wf_ordini.c_consegna,
|
||||
wf_ordini.s_consegna,
|
||||
wf_ordini.f_consegna,
|
||||
wf_ordini.f_ordine,
|
||||
wf_iscritto.cognome,
|
||||
wf_iscritto.nome
|
||||
";
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
|
||||
$query = " SELECT
|
||||
COALESCE(SUM(wf_ordini.costo), 0) AS euro
|
||||
FROM
|
||||
wf_ordini
|
||||
JOIN
|
||||
wf_iscritto
|
||||
ON
|
||||
wf_ordini.id_iscritto = wf_iscritto.id
|
||||
$query_admin
|
||||
WHERE
|
||||
wf_ordini.c_pagamento IS NULL
|
||||
";
|
||||
$res_euro = mysql_query( $query, $DB_ID );
|
||||
$incassare = mysql_fetch_array ( $res_euro )['euro'];
|
||||
|
||||
$query = " SELECT
|
||||
COALESCE(SUM(wf_ordini.costo), 0) AS euro
|
||||
FROM
|
||||
wf_ordini
|
||||
JOIN
|
||||
wf_iscritto
|
||||
ON
|
||||
wf_ordini.id_iscritto = wf_iscritto.id
|
||||
$query_admin
|
||||
WHERE
|
||||
wf_ordini.c_pagamento IS NOT NULL
|
||||
AND
|
||||
wf_ordini.c_consegna IS NULL
|
||||
";
|
||||
$res_euro = mysql_query( $query, $DB_ID );
|
||||
$incassato = mysql_fetch_array ( $res_euro )['euro'];
|
||||
|
||||
$query = " SELECT
|
||||
COALESCE(SUM(wf_ordini.costo), 0) AS euro
|
||||
FROM
|
||||
wf_ordini
|
||||
JOIN
|
||||
wf_iscritto
|
||||
ON
|
||||
wf_ordini.id_iscritto = wf_iscritto.id
|
||||
$query_admin
|
||||
WHERE
|
||||
wf_ordini.c_pagamento IS NOT NULL
|
||||
AND
|
||||
wf_ordini.c_consegna IS NOT NULL
|
||||
AND
|
||||
wf_ordini.s_pagamento IS NULL
|
||||
";
|
||||
$res_euro = mysql_query( $query, $DB_ID );
|
||||
$versare = mysql_fetch_array ( $res_euro )['euro'];
|
||||
|
||||
$tabella = new html (0,"90%", array (20,10,2,10,2,10,0));
|
||||
$tabella->intestazione (array("", "Incassare", "", "Incassato", "", "Versare", ""), array("", "descrizione_c", "", "descrizione_c", "", "descrizione_c", ""));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="descrizione_c"><?php print $incassare ?> €</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="descrizione_c"><?php print $incassato ?> €</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="descrizione_c"><?php print $versare ?> €</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->close();
|
||||
|
||||
$tabella = new html (0,"90%", array (1,10,0));
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="spazioh"><a href="ordini_edit_main.php"><img src="<?php print $CONF['base_url'] ?>/img/addresource.png"></a></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->close();
|
||||
|
||||
$tabella = new html (0,"90%", array (20,6,2,6,2,6,2,5,2,8,0));
|
||||
$tabella->intestazione (array("", "Tutto", "", "Richiesto", "", "Ordinato", "", "Arrivato", "", "Consegnato", ""), array("", "descrizione_c", "", "descrizione_c", "", "descrizione_c", "", "descrizione_c", "descrizione_c", ""));
|
||||
?>
|
||||
<form id="ordini" name="ordini" method="post" >
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="campoc"><input onChange="this.form.submit()" type="radio" name="filtro" value="0" <?php if ($filtro == 0) print 'checked' ?>></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="campoc"><input onChange="this.form.submit()" type="radio" name="filtro" value="1" <?php if ($filtro == 1) print 'checked' ?>></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="campoc"><input onChange="this.form.submit()" type="radio" name="filtro" value="2" <?php if ($filtro == 2) print 'checked' ?>></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="campoc"><input onChange="this.form.submit()" type="radio" name="filtro" value="3" <?php if ($filtro == 3) print 'checked' ?>></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="campoc"><input onChange="this.form.submit()" type="radio" name="filtro" value="4" <?php if ($filtro == 4) print 'checked' ?>></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga();
|
||||
$tabella->close();
|
||||
|
||||
$tabella = new html (0,"90%", array (1,3,1,3,1,3,1,3,1,10,1,10,1,20,1,5,1,15,1,8,1,20,1,10,0));
|
||||
?>
|
||||
<input type="hidden" id="idcomando" name="comando" value="">
|
||||
<?php
|
||||
$tabella->intestazione ( array( "", "",
|
||||
"", "",
|
||||
"", "",
|
||||
"", "id",
|
||||
"", "Categoria",
|
||||
"", "Produttore",
|
||||
"", "Articolo",
|
||||
"", "Taglia",
|
||||
"", "Atleta",
|
||||
"", "Costo",
|
||||
"", "Stato",
|
||||
"", "Pagamento",
|
||||
"")
|
||||
);
|
||||
$tabella->riga();
|
||||
while ($dato = mysql_fetch_array ( $res )) {
|
||||
|
||||
if (!is_null($dato['c_ordine'])) $stato = "Richiesto ".$dato['c_ordine'];
|
||||
if (!is_null($dato['f_ordine'])) $stato = "Ordinato ".$dato['f_ordine'];
|
||||
if (!is_null($dato['f_consegna'])) $stato = "Arrivato ".$dato['f_consegna'];
|
||||
if (!is_null($dato['s_consegna'])) $stato = "Palestra ".$dato['s_consegna'];
|
||||
if (!is_null($dato['c_consegna'])) $stato = "Consegnato ".$dato['c_consegna'];
|
||||
|
||||
$pagamento = "No";
|
||||
if (!is_null($dato['c_pagamento'])) $pagamento = "Pagato ".$dato['c_pagamento'];
|
||||
if (!is_null($dato['s_pagamento'])) $pagamento = "Versato ".$dato['s_pagamento'];
|
||||
?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="spazioh"><?php (is_null($dato['f_ordine'])) ? print "<a href=\"wf_gest.php?azione=wf_ordrm&id=".$dato[id]."\"><img src=\"".$CONF['base_url']."/img/trash.png\"></a>" : print "<img src=\"".$CONF['base_url']."/img/spazio.gif\">";?>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="spazioh"><input type="checkbox" name="<?php print $dato['id']?>"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="col3btn"><a href="ordini_edit.php?id=<?php print $dato['id'] ?>"><img src="<?php print $CONF['base_url'] ?>/img/modify.gif" ALT="Modifica articolo" TITLE="Modifica articolo"></a></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['id'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['categoria'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['produttore'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['articolo'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['taglia'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print "(".$dato['sigla'].") ".$dato['cognome']." ".$dato['nome'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['vendita'] ?> €</td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $stato ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $pagamento ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga();
|
||||
}
|
||||
$tabella->close();
|
||||
|
||||
if (livello_modulo($DIRITTI) != "Admin") {
|
||||
$tabella = new html (0,"90%", array (2,10,2,10,2,10,2,10,0));
|
||||
$tabella->intestazione ( array(
|
||||
"", "Consegnati<br>al responsabile",
|
||||
"", "Consegnati<br>all'atleta",
|
||||
"", "Pagati<br>dall'atleta",
|
||||
"", "Versati<br>alla squadra",
|
||||
""),
|
||||
array("","textc","","textc","","textc","","textc","")
|
||||
);
|
||||
} else {
|
||||
$tabella = new html (0,"90%", array (2,10,2,10,2,10,2,10,2,10,2,10,0));
|
||||
$tabella->intestazione ( array( "", "Ordinati<br>al fornitore",
|
||||
"", "Ricevuti<br>dal fornitore",
|
||||
"", "Consegnati<br>al responsabile",
|
||||
"", "Consegnati<br>all'atleta",
|
||||
"", "Pagati<br>dall'atleta",
|
||||
"", "Versati<br>alla squadra",
|
||||
""),
|
||||
array( "","textc",
|
||||
"","textc",
|
||||
"","textc",
|
||||
"","textc",
|
||||
"","textc",
|
||||
"","textc","")
|
||||
);
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<?php if (livello_modulo($DIRITTI) == "Admin") { ?>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="textc"><a href="javascript:invia('ordinato')"><img src="<?php print $CONF['base_url'] ?>/img/applica.png"></a></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="textc"><a href="javascript:invia('ricezione')"><img src="<?php print $CONF['base_url'] ?>/img/applica.png"></a></td>
|
||||
<?php } ?>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="textc"><a href="javascript:invia('ritiro')"><img src="<?php print $CONF['base_url'] ?>/img/applica.png"></a></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="textc"><a href="javascript:invia('consegna')"><img src="<?php print $CONF['base_url'] ?>/img/applica.png"></a></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="textc"><a href="javascript:invia('pagamento')"><img src="<?php print $CONF['base_url'] ?>/img/applica.png"></a></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="textc"><a href="javascript:invia('versamento')"><img src="<?php print $CONF['base_url'] ?>/img/applica.png"></a></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
</form>
|
||||
<?php
|
||||
$tabella->close();
|
||||
view_footer();
|
||||
?>
|
||||
91
associazione/palestre_edit.php
Executable file
91
associazione/palestre_edit.php
Executable file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
include_once ("funzioni.php");
|
||||
$UTENTE = login();
|
||||
$DIRITTI = diritti('Admin');
|
||||
view_top();
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
extract($_POST);
|
||||
|
||||
if ($id) {
|
||||
$query = " UPDATE
|
||||
wf_palestra
|
||||
SET
|
||||
palestra = '$palestra',
|
||||
sigla = '$sigla'
|
||||
WHERE
|
||||
id = $id
|
||||
";
|
||||
} else {
|
||||
$query = " INSERT INTO
|
||||
wf_palestra
|
||||
SET
|
||||
attivo = 1,
|
||||
palestra = '$palestra',
|
||||
sigla = '$sigla'
|
||||
";
|
||||
}
|
||||
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
// if ($id == "") {
|
||||
// $id = mysql_insert_id();
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
document.location.href='palestre_lista.php'
|
||||
</script>
|
||||
<?php
|
||||
exit;
|
||||
// }
|
||||
|
||||
} elseif (isset($_GET['id'])) {
|
||||
$id = $_GET['id'];
|
||||
}
|
||||
?>
|
||||
|
||||
<form name="" method="post">
|
||||
<input type="hidden" name="id" value="<?php print $id ?>">
|
||||
<?php
|
||||
|
||||
$query = " SELECT
|
||||
id,
|
||||
attivo,
|
||||
palestra,
|
||||
sigla
|
||||
FROM
|
||||
wf_palestra
|
||||
WHERE
|
||||
id = $id
|
||||
";
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
$dato = mysql_fetch_array ( $res );
|
||||
|
||||
$tabella = new html (1,"90%",array(5,20,2,10,0));
|
||||
$tabella->intestazione (array("","Palestra","", "Sigla", ""));
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
if ($dato['attivo']) {
|
||||
?>
|
||||
<td class="spazioh"><a href="wf_gest.php?azione=wf_palestra_off&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/attivo.gif" ALT="Atleta Attivo" TITLE="Atleta Attivo"></a></td>
|
||||
<?php } else { ?>
|
||||
<td class="spazioh"><a href="wf_gest.php?azione=wf_palestra_on&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/non_attivo.gif" ALT="Atleta non Attivo" TITLE="Atleta non Attivo"></a></td>
|
||||
<?php } ?>
|
||||
<td class="colip"><input size="20" type="text" name=palestra value="<?php print $dato['palestra'] ?>"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><input size="3" type="text" name=sigla value="<?php print $dato['sigla'] ?>"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella = new html (0,"90%",array(5,20,0));
|
||||
$tabella->riga(); ?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="spaziov" colspan=10><input type="submit" value="Conferma"></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<?php $tabella->close(); ?>
|
||||
</form>
|
||||
<?php view_footer(); ?>
|
||||
69
associazione/palestre_lista.php
Executable file
69
associazione/palestre_lista.php
Executable file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
include_once ("funzioni.php");
|
||||
$UTENTE = login();
|
||||
$DIRITTI = diritti('Admin');
|
||||
view_top();
|
||||
?>
|
||||
|
||||
<form name="" method="post">
|
||||
<?php $tabella = new html (0,"90%", array (3,5,2,15,2,10,2,5,0)); ?>
|
||||
<tr>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="spazioh"><a href="iscritti_edit.php"><img src="<?php print $CONF['base_url'] ?>/img/addresource.png"></a></td>
|
||||
<td colspan=7 class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga();
|
||||
$query = " SELECT
|
||||
wf_palestra.id,
|
||||
wf_palestra.attivo,
|
||||
wf_palestra.palestra,
|
||||
wf_palestra.sigla,
|
||||
count(wf_iscritto.id_palestra) AS iscritti
|
||||
FROM
|
||||
wf_palestra
|
||||
LEFT OUTER JOIN
|
||||
wf_iscritto
|
||||
ON
|
||||
wf_iscritto.id_palestra = wf_palestra.id
|
||||
AND
|
||||
wf_iscritto.attivo = 1
|
||||
GROUP BY
|
||||
wf_palestra.id,
|
||||
wf_palestra.attivo,
|
||||
wf_palestra.palestra
|
||||
ORDER BY
|
||||
attivo desc,
|
||||
palestra
|
||||
";
|
||||
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
$tabella->intestazione (array("", "", "", "Palestra", "", "Sigla", "", "Iscritti", ""));
|
||||
$tabella->riga();
|
||||
while ($dato = mysql_fetch_array ( $res )) {
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
if ($dato['attivo']) {
|
||||
?>
|
||||
<td class="col3btn"><a href="wf_gest.php?azione=wf_palestra_off&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/attivo.gif" ALT="Utente attivo" TITLE="Palestra attiva"></a></td>
|
||||
<?php } else { ?>
|
||||
<td class="col3btn"><a href="wf_gest.php?azione=wf_palestra_on&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/non_attivo.gif" ALT="Utente non attivo" TITLE="Palestra non attiva"></a></td>
|
||||
<?php } ?>
|
||||
<td class="col3btn"><a href="palestre_edit.php?id=<?php print $dato['id'] ?>"><img src="<?php print $CONF['base_url'] ?>/img/modify.gif" ALT="Modifica palestra" TITLE="Modifica palestra"></a></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['palestra'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['sigla'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['iscritti'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
$tabella->close();
|
||||
?>
|
||||
</form>
|
||||
<?php view_footer(); ?>
|
||||
30
associazione/sql/20171004.sql
Normal file
30
associazione/sql/20171004.sql
Normal file
@@ -0,0 +1,30 @@
|
||||
ALTER TABLE `wf_iscritto` DROP `id_categoria`, DROP `via`, DROP `cap`, DROP `citta`, DROP `provincia`, DROP `cf`, DROP `stato`, DROP `nascita_luogo`, DROP `nascita_provincia`, DROP `gen_cognome`, DROP `gen_nome`, DROP `gen_cf`, DROP `gen_sesso`, DROP `gen_stato`, DROP `gen_nascita_data`, DROP `gen_nascita_luogo`, DROP `gen_nascita_provincia`, DROP `telefono`, DROP `mail`, DROP `data_richiesta`, DROP `data_delibera`, DROP `c_soc`, DROP `data_fita`, DROP `tessera`;
|
||||
|
||||
ALTER TABLE `wf_iscritto` ADD `tcintura` INT NULL AFTER `nascita_data`, ADD `commento` TEXT NULL AFTER `tcintura`;
|
||||
|
||||
DROP TABLE IF EXISTS `wf_versionedb`;
|
||||
CREATE TABLE `wf_versionedb` (
|
||||
`versione` varchar(32) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
INSERT INTO `wf_versionedb` (`versione`) VALUES('20171004');
|
||||
|
||||
CREATE TABLE `wf_storico` (
|
||||
`id` bigint(20) UNSIGNED NOT NULL,
|
||||
`id_iscritto` bigint(20) UNSIGNED NOT NULL,
|
||||
`data` date NOT NULL,
|
||||
`peso` int(11) NOT NULL DEFAULT '0',
|
||||
`altezza` int(11) NOT NULL DEFAULT '0',
|
||||
`cooper` int(11) NOT NULL DEFAULT '0',
|
||||
`sargeant` int(11) NOT NULL DEFAULT '0',
|
||||
`slungo` int(11) NOT NULL DEFAULT '0',
|
||||
`palla` int(11) NOT NULL DEFAULT '0',
|
||||
`mobart` int(11) NOT NULL DEFAULT '0',
|
||||
`flesstro` int(11) NOT NULL DEFAULT '0',
|
||||
`cingolo` int(11) NOT NULL DEFAULT '0',
|
||||
`calcisemicirc` int(11) NOT NULL DEFAULT '0',
|
||||
`commenti` text
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE `wf_storico` ADD PRIMARY KEY (`id`);
|
||||
ALTER TABLE `wf_storico` ADD INDEX(`id_iscritto`);
|
||||
10
associazione/sql/20171011.sql
Normal file
10
associazione/sql/20171011.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
UPDATE `wf_versionedb` SET `versione`='20171011' WHERE 1;
|
||||
ALTER TABLE `wf_storico` CHANGE `peso` `peso` DECIMAL(11,2) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `wf_storico` CHANGE `id` `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||
ALTER TABLE `wf_storico` DROP `calcisemicirc`;
|
||||
ALTER TABLE `wf_storico` ADD `calcisx` INT UNSIGNED NULL AFTER `cingolo`, ADD `calcidx` INT UNSIGNED NULL AFTER `calcisx`;
|
||||
ALTER TABLE `wf_storico` CHANGE `palla` `pallaav` INT(11) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `wf_storico` ADD `pallaind` INT NOT NULL DEFAULT '0' AFTER `pallaav`;
|
||||
ALTER TABLE `wf_storico` CHANGE `peso` `peso` DECIMAL(11,2) UNSIGNED NOT NULL DEFAULT '0.00', CHANGE `altezza` `altezza` INT(11) UNSIGNED NOT NULL DEFAULT '0', CHANGE `cooper` `cooper` INT(11) UNSIGNED NOT NULL DEFAULT '0', CHANGE `sargeant` `sargeant` INT(11) UNSIGNED NOT NULL DEFAULT '0', CHANGE `slungo` `slungo` INT(11) UNSIGNED NOT NULL DEFAULT '0', CHANGE `pallaav` `pallaav` INT(11) UNSIGNED NOT NULL DEFAULT '0', CHANGE `pallaind` `pallaind` INT(11) UNSIGNED NOT NULL DEFAULT '0', CHANGE `mobart` `mobart` INT(11) UNSIGNED NOT NULL DEFAULT '0', CHANGE `calcisx` `calcisx` INT(10) UNSIGNED NOT NULL DEFAULT '0', CHANGE `calcidx` `calcidx` INT(10) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `wf_storico` CHANGE `peso` `peso` DECIMAL(11,1) UNSIGNED NOT NULL DEFAULT '0.0';
|
||||
ALTER TABLE `wf_storico` CHANGE `data` `data` DATE NULL DEFAULT NULL;
|
||||
3
associazione/sql/20171015.sql
Normal file
3
associazione/sql/20171015.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
ALTER TABLE `wf_versionedb` ADD `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`id`);
|
||||
UPDATE `wf_versionedb` SET `versione` = '20171015' WHERE `wf_versionedb`.`id` = 1;
|
||||
ALTER TABLE `wf_iscritto` CHANGE `tcintura` `tcintura` INT(11) NULL DEFAULT '0';
|
||||
2
associazione/sql/20171022.sql
Normal file
2
associazione/sql/20171022.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
UPDATE `wf_versionedb` SET `versione` = '20171022' WHERE `wf_versionedb`.`id` = 1;
|
||||
ALTER TABLE `wf_materiale` DROP `acquisto`;
|
||||
3
associazione/sql/20171119.sql
Normal file
3
associazione/sql/20171119.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
UPDATE `wf_versionedb` SET `versione` = '20171119' WHERE `wf_versionedb`.`id` = 1;
|
||||
|
||||
ALTER TABLE `wf_ordini` ADD `materiale` VARCHAR(256) NOT NULL AFTER `id_materiale`, ADD `costo` DECIMAL(5,2) NOT NULL DEFAULT '0' AFTER `materiale`;
|
||||
11
associazione/sql/20180820.sql
Normal file
11
associazione/sql/20180820.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
UPDATE `wf_versionedb` SET `versione` = '20180820' WHERE `wf_versionedb`.`id` = 1;
|
||||
ALTER TABLE `wf_cat_materiale` DROP `ordine`;
|
||||
|
||||
CREATE TABLE `pannello`.`wf_prod_materiale` ( `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT , `nome` VARCHAR(32) NOT NULL , `attivo` BOOLEAN NOT NULL , PRIMARY KEY (`id`), UNIQUE (`nome`)) ENGINE = InnoDB;
|
||||
ALTER TABLE `wf_prod_materiale` CHANGE `attivo` `attivo` TINYINT(1) NOT NULL DEFAULT '1';
|
||||
ALTER TABLE `wf_materiale` ADD `categoria` VARCHAR(64) NOT NULL AFTER `nome`;
|
||||
ALTER TABLE `wf_materiale` ADD `produttore` VARCHAR(64) NOT NULL AFTER `id_cat_materiale`, ADD `id_prod_materiale` BIGINT UNSIGNED NOT NULL AFTER `produttore`;
|
||||
|
||||
ALTER TABLE `wf_ordini` ADD `categoria` VARCHAR(64) NULL AFTER `materiale`, ADD `produttore` VARCHAR(64) NULL AFTER `categoria`;
|
||||
ALTER TABLE `wf_materiale` ADD `data` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `attivo`;
|
||||
ALTER TABLE `wf_ordini` CHANGE `id_utente` `id_utente` BIGINT(20) UNSIGNED NULL;
|
||||
4
associazione/sql/20180824.sql
Normal file
4
associazione/sql/20180824.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
UPDATE `wf_versionedb` SET `versione` = '20180824' WHERE `wf_versionedb`.`id` = 1;
|
||||
|
||||
ALTER TABLE `wf_materiale` ADD `taglie` VARCHAR(512) NULL AFTER `nota`;
|
||||
ALTER TABLE `wf_palestra` ADD `sigla` VARCHAR(2) NOT NULL AFTER `palestra`;
|
||||
181
associazione/sql/config.sql
Normal file
181
associazione/sql/config.sql
Normal file
@@ -0,0 +1,181 @@
|
||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||
SET time_zone = "+00:00";
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8mb4 */;
|
||||
|
||||
USE `pannello`;
|
||||
|
||||
INSERT INTO `moduli` (`id`, `nome`, `ordine`, `superadmin`, `prefisso`, `directory`, `attivo`, `descrizione`) VALUES(6, 'Associazione', 50, 0, 'wf_', 'associazione', 1, 'Gestione Associazione');
|
||||
|
||||
INSERT INTO `moduli_page` (`id`, `id_moduli`, `nome`, `ordine`, `pagina`, `livello`, `attivo`) VALUES(18, 6, 'Iscritti', 30, 'iscritti_lista.php', 5, 1);
|
||||
INSERT INTO `moduli_page` (`id`, `id_moduli`, `nome`, `ordine`, `pagina`, `livello`, `attivo`) VALUES(19, 6, 'Palestre', 40, 'palestre_lista.php', 5, 1);
|
||||
INSERT INTO `moduli_page` (`id`, `id_moduli`, `nome`, `ordine`, `pagina`, `livello`, `attivo`) VALUES(20, 6, 'Accessi', 10, 'utenze_lista.php', 10, 1);
|
||||
INSERT INTO `moduli_page` (`id`, `id_moduli`, `nome`, `ordine`, `pagina`, `livello`, `attivo`) VALUES(21, 6, 'Materiale', 20, 'materiale_lista.php', 10, 1);
|
||||
|
||||
INSERT INTO `permessi` (`id_utenti`, `id_moduli`, `accesso`, `modifica`) VALUES(1, 6, 0, '2017-09-02 12:03:56');
|
||||
|
||||
DROP TABLE IF EXISTS `wf_categoria`;
|
||||
CREATE TABLE `wf_categoria` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`categoria` varchar(64) NOT NULL,
|
||||
`inizio` int(10) DEFAULT NULL,
|
||||
`fine` int(10) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
INSERT INTO `wf_categoria` (`id`, `categoria`, `inizio`, `fine`) VALUES(1, 'Esordienti B', 6, 7);
|
||||
INSERT INTO `wf_categoria` (`id`, `categoria`, `inizio`, `fine`) VALUES(2, 'Esordienti A', 8, 9);
|
||||
INSERT INTO `wf_categoria` (`id`, `categoria`, `inizio`, `fine`) VALUES(3, 'Cadetti B', 10, 11);
|
||||
INSERT INTO `wf_categoria` (`id`, `categoria`, `inizio`, `fine`) VALUES(4, 'Cadetti A', 12, 14);
|
||||
INSERT INTO `wf_categoria` (`id`, `categoria`, `inizio`, `fine`) VALUES(5, 'Junior', 15, 17);
|
||||
INSERT INTO `wf_categoria` (`id`, `categoria`, `inizio`, `fine`) VALUES(6, 'Senior A', 17, 35);
|
||||
INSERT INTO `wf_categoria` (`id`, `categoria`, `inizio`, `fine`) VALUES(7, 'Senior B', 35, 99);
|
||||
|
||||
DROP TABLE IF EXISTS `wf_cat_materiale`;
|
||||
CREATE TABLE `wf_cat_materiale` (
|
||||
`id` bigint(20) UNSIGNED NOT NULL,
|
||||
`nome` varchar(64) NOT NULL,
|
||||
`ordine` int(11) DEFAULT NULL,
|
||||
`attivo` tinyint(1) NOT NULL DEFAULT '1'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
DROP TABLE IF EXISTS `wf_cinture`;
|
||||
CREATE TABLE `wf_cinture` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`cintura` varchar(64) NOT NULL,
|
||||
`kup` int(11) NOT NULL,
|
||||
`dan` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
INSERT INTO `wf_cinture` (`id`, `cintura`, `kup`, `dan`) VALUES(1, 'bianca', 10, 0);
|
||||
INSERT INTO `wf_cinture` (`id`, `cintura`, `kup`, `dan`) VALUES(2, 'bianca superiore', 9, 0);
|
||||
INSERT INTO `wf_cinture` (`id`, `cintura`, `kup`, `dan`) VALUES(3, 'gialla', 8, 0);
|
||||
INSERT INTO `wf_cinture` (`id`, `cintura`, `kup`, `dan`) VALUES(4, 'gialla superiore', 7, 0);
|
||||
INSERT INTO `wf_cinture` (`id`, `cintura`, `kup`, `dan`) VALUES(5, 'verde', 6, 0);
|
||||
INSERT INTO `wf_cinture` (`id`, `cintura`, `kup`, `dan`) VALUES(6, 'verde superiore', 5, 0);
|
||||
INSERT INTO `wf_cinture` (`id`, `cintura`, `kup`, `dan`) VALUES(7, 'blu', 4, 0);
|
||||
INSERT INTO `wf_cinture` (`id`, `cintura`, `kup`, `dan`) VALUES(8, 'blu superiore', 3, 0);
|
||||
INSERT INTO `wf_cinture` (`id`, `cintura`, `kup`, `dan`) VALUES(9, 'rossa', 2, 0);
|
||||
INSERT INTO `wf_cinture` (`id`, `cintura`, `kup`, `dan`) VALUES(10, 'rossa superiore', 1, 0);
|
||||
INSERT INTO `wf_cinture` (`id`, `cintura`, `kup`, `dan`) VALUES(11, 'nera 1° dan', 0, 1);
|
||||
INSERT INTO `wf_cinture` (`id`, `cintura`, `kup`, `dan`) VALUES(12, 'nera 2° dan', 0, 2);
|
||||
INSERT INTO `wf_cinture` (`id`, `cintura`, `kup`, `dan`) VALUES(13, 'nera 3° dan', 0, 3);
|
||||
INSERT INTO `wf_cinture` (`id`, `cintura`, `kup`, `dan`) VALUES(14, 'nera 4° dan', 0, 4);
|
||||
|
||||
DROP TABLE IF EXISTS `wf_iscritto`;
|
||||
CREATE TABLE `wf_iscritto` (
|
||||
`id` int(2) NOT NULL,
|
||||
`attivo` tinyint(1) NOT NULL DEFAULT '1',
|
||||
`cognome` varchar(32) DEFAULT NULL,
|
||||
`nome` varchar(32) DEFAULT NULL,
|
||||
`id_cintura` bigint(20) DEFAULT NULL,
|
||||
`id_palestra` bigint(20) DEFAULT NULL,
|
||||
`id_categoria` bigint(20) DEFAULT NULL,
|
||||
`certificato` date DEFAULT NULL,
|
||||
`via` varchar(32) DEFAULT NULL,
|
||||
`cap` varchar(10) DEFAULT NULL,
|
||||
`citta` varchar(16) DEFAULT NULL,
|
||||
`provincia` varchar(2) DEFAULT NULL,
|
||||
`cf` varchar(16) DEFAULT NULL,
|
||||
`sesso` varchar(1) DEFAULT NULL,
|
||||
`stato` varchar(16) DEFAULT NULL,
|
||||
`nascita_data` date DEFAULT NULL,
|
||||
`nascita_luogo` varchar(16) DEFAULT NULL,
|
||||
`nascita_provincia` varchar(2) DEFAULT NULL,
|
||||
`gen_cognome` varchar(32) DEFAULT NULL,
|
||||
`gen_nome` varchar(32) DEFAULT NULL,
|
||||
`gen_cf` varchar(16) DEFAULT NULL,
|
||||
`gen_sesso` varchar(1) DEFAULT NULL,
|
||||
`gen_stato` varchar(16) DEFAULT NULL,
|
||||
`gen_nascita_data` date DEFAULT NULL,
|
||||
`gen_nascita_luogo` varchar(16) DEFAULT NULL,
|
||||
`gen_nascita_provincia` varchar(2) DEFAULT NULL,
|
||||
`telefono` varchar(15) DEFAULT NULL,
|
||||
`mail` varchar(64) DEFAULT NULL,
|
||||
`data_richiesta` date DEFAULT NULL,
|
||||
`data_delibera` date DEFAULT NULL,
|
||||
`c_soc` varchar(10) DEFAULT NULL,
|
||||
`data_fita` date DEFAULT NULL,
|
||||
`tessera` varchar(10) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
DROP TABLE IF EXISTS `wf_materiale`;
|
||||
CREATE TABLE `wf_materiale` (
|
||||
`id` bigint(20) UNSIGNED NOT NULL,
|
||||
`nome` varchar(64) NOT NULL,
|
||||
`id_cat_materiale` bigint(20) UNSIGNED NOT NULL,
|
||||
`nota` varchar(128) DEFAULT NULL,
|
||||
`acquisto` decimal(5,2) NOT NULL,
|
||||
`vendita` decimal(5,2) NOT NULL,
|
||||
`attivo` tinyint(1) NOT NULL DEFAULT '1'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
DROP TABLE IF EXISTS `wf_ordini`;
|
||||
CREATE TABLE `wf_ordini` (
|
||||
`id` bigint(20) UNSIGNED NOT NULL,
|
||||
`id_utente` bigint(20) UNSIGNED NOT NULL,
|
||||
`id_iscritto` bigint(20) UNSIGNED NOT NULL,
|
||||
`id_materiale` bigint(20) UNSIGNED NOT NULL,
|
||||
`taglia` varchar(16) NOT NULL,
|
||||
`c_ordine` date DEFAULT NULL,
|
||||
`c_pagamento` date DEFAULT NULL,
|
||||
`c_consegna` date DEFAULT NULL,
|
||||
`f_ordine` date DEFAULT NULL,
|
||||
`f_pagamento` date DEFAULT NULL,
|
||||
`f_consegna` date DEFAULT NULL,
|
||||
`s_consegna` date DEFAULT NULL,
|
||||
`s_pagamento` date DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
DROP TABLE IF EXISTS `wf_palestra`;
|
||||
CREATE TABLE `wf_palestra` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`palestra` varchar(64) NOT NULL,
|
||||
`attivo` tinyint(1) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
DROP TABLE IF EXISTS `wf_utenti`;
|
||||
CREATE TABLE `wf_utenti` (
|
||||
`id` bigint(20) UNSIGNED NOT NULL,
|
||||
`id_palestra` bigint(20) UNSIGNED NOT NULL,
|
||||
`id_utenti` bigint(20) UNSIGNED NOT NULL,
|
||||
`attivo` tinyint(1) NOT NULL DEFAULT '1',
|
||||
`modifica` datetime NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE `wf_categoria`
|
||||
ADD PRIMARY KEY (`id`),
|
||||
ADD UNIQUE KEY `categoria` (`categoria`);
|
||||
|
||||
ALTER TABLE `wf_cat_materiale`
|
||||
ADD PRIMARY KEY (`id`),
|
||||
ADD UNIQUE KEY `id` (`id`);
|
||||
|
||||
ALTER TABLE `wf_cinture`
|
||||
ADD PRIMARY KEY (`id`),
|
||||
ADD UNIQUE KEY `cintura` (`cintura`);
|
||||
|
||||
ALTER TABLE `wf_iscritto`
|
||||
ADD PRIMARY KEY (`id`),
|
||||
ADD KEY `anag` (`cognome`,`nome`);
|
||||
|
||||
ALTER TABLE `wf_materiale`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
ALTER TABLE `wf_ordini`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
ALTER TABLE `wf_palestra`
|
||||
ADD PRIMARY KEY (`id`),
|
||||
ADD UNIQUE KEY `palestra` (`palestra`);
|
||||
|
||||
ALTER TABLE `wf_utenti`
|
||||
ADD PRIMARY KEY (`id`),
|
||||
ADD UNIQUE KEY `id_palestra` (`id_palestra`,`id_utenti`);
|
||||
|
||||
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
38
associazione/utente_update.php
Executable file
38
associazione/utente_update.php
Executable file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
$UTENTE = login();
|
||||
$DIRITTI = diritti('Admin');
|
||||
|
||||
$user_id = $_GET['user_id'];
|
||||
$accesso = $_GET['accesso'];
|
||||
$palestra = $_GET['palestra'];
|
||||
|
||||
$query = " INSERT INTO
|
||||
wf_utenti
|
||||
SET
|
||||
id_utenti = $user_id,
|
||||
id_palestra = ( SELECT
|
||||
id
|
||||
FROM
|
||||
wf_palestra
|
||||
WHERE
|
||||
palestra = '$palestra' AND attivo = 1
|
||||
),
|
||||
attivo = $accesso,
|
||||
modifica = NOW()
|
||||
ON DUPLICATE KEY UPDATE
|
||||
attivo = $accesso,
|
||||
modifica = NOW()
|
||||
";
|
||||
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
|
||||
/* Attivare solo per debug
|
||||
$fp = fopen('out.txt', 'w');
|
||||
fwrite($fp, $stato);
|
||||
fwrite($fp, "\n");
|
||||
fwrite($fp, $query);
|
||||
fwrite($fp, "\n");
|
||||
fclose($fp);
|
||||
*/
|
||||
?>
|
||||
89
associazione/utenze_lista.php
Executable file
89
associazione/utenze_lista.php
Executable file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
include_once ("funzioni.php");
|
||||
$UTENTE = login();
|
||||
$DIRITTI = diritti('Admin');
|
||||
view_top();
|
||||
|
||||
$tabella = new html (0,"90%", array (5,2,15,2,8,2,15,0));
|
||||
$tabella->riga();
|
||||
|
||||
$query = " SELECT
|
||||
utenti.id,
|
||||
utenti.utente,
|
||||
livelli.nome,
|
||||
wf_palestra.palestra
|
||||
FROM
|
||||
utenti
|
||||
JOIN
|
||||
permessi
|
||||
ON
|
||||
utenti.id = permessi.id_utenti
|
||||
AND
|
||||
permessi.accesso > 0
|
||||
JOIN
|
||||
livelli
|
||||
ON
|
||||
permessi.accesso = livelli.livello
|
||||
JOIN
|
||||
moduli
|
||||
ON
|
||||
permessi.id_moduli = moduli.id
|
||||
AND
|
||||
moduli.nome = 'Associazione'
|
||||
|
||||
LEFT OUTER JOIN
|
||||
wf_utenti
|
||||
ON
|
||||
wf_utenti.id_utenti = utenti.id
|
||||
AND
|
||||
wf_utenti.attivo = 1
|
||||
LEFT OUTER JOIN
|
||||
wf_palestra
|
||||
ON
|
||||
wf_utenti.id_palestra = wf_palestra.id
|
||||
AND
|
||||
wf_palestra.attivo = 1
|
||||
ORDER BY
|
||||
utente,
|
||||
palestra
|
||||
|
||||
";
|
||||
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
$tabella->intestazione (array("", "", "Utente", "", "Accesso", "", "Palestra", ""));
|
||||
$tabella->riga();
|
||||
$preid = 10000000;
|
||||
while ($dato = mysql_fetch_array ( $res )) {
|
||||
if ( $preid != $dato['id'] ) {
|
||||
$tabella->riga(20);
|
||||
} else {
|
||||
$tabella->riga(10);
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<?php if ( $preid != $dato['id'] ) { ?>
|
||||
<td class="col3btn"><a href="utenze_permessi.php?id=<?php print $dato['id'] ?>"><img src="<?php print $CONF['base_url'] ?>/img/dettagli.png" width="15" height="15" ALT="Modifica accessi" TITLE="Modifica accessi"></a></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['utente'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['nome'] ?></td>
|
||||
<?php } else { ?>
|
||||
<td class="colip"> </td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"> </td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"> </td>
|
||||
<?php } ?>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="colip"><?php print $dato['palestra'] ?></td>
|
||||
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
<?php
|
||||
$preid = $dato['id'];
|
||||
}
|
||||
$tabella->close();
|
||||
?>
|
||||
<?php view_footer(); ?>
|
||||
107
associazione/utenze_permessi.php
Executable file
107
associazione/utenze_permessi.php
Executable file
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
$UTENTE = login();
|
||||
$DIRITTI = diritti('Admin');
|
||||
view_top();
|
||||
|
||||
$query = " SELECT
|
||||
wf_palestra.palestra,
|
||||
wf_utenti.attivo
|
||||
FROM
|
||||
wf_palestra
|
||||
LEFT OUTER JOIN
|
||||
wf_utenti
|
||||
ON
|
||||
wf_utenti.id_palestra = wf_palestra.id
|
||||
AND
|
||||
wf_utenti.id_utenti = ".$_GET['id']."
|
||||
WHERE
|
||||
wf_palestra.attivo = 1
|
||||
|
||||
|
||||
|
||||
|
||||
";
|
||||
|
||||
$permessi = mysql_query( $query, $DB_ID );
|
||||
|
||||
$query = " SELECT
|
||||
utente,
|
||||
admin
|
||||
FROM
|
||||
utenti
|
||||
WHERE
|
||||
id = ".$_GET['id']."
|
||||
AND
|
||||
attivo = 1
|
||||
";
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
$dato = mysql_fetch_array ($res);
|
||||
?>
|
||||
<script type="text/javascript" src="<?php print $CONF['base_url']?>/jquery/jquery-1.8.0.min.js"></script>
|
||||
|
||||
<?php
|
||||
$tabella = new html (0,"90%", array (0)); ?>
|
||||
<tr>
|
||||
<td align="center">
|
||||
|
||||
<?php $tabella1 = new html (0,"40%", array (20,0)); ?>
|
||||
<tr>
|
||||
<?php if ($dato['admin']) { ?>
|
||||
<td rowspan=2 class="col3btn"><img src="<?php print $CONF['base_url'] ?>/img/admin.png" ALT="Admin" TITLE="Admin"></td>
|
||||
<?php } else { ?>
|
||||
<td rowspan=2 class="col3btn"><img src="<?php print $CONF['base_url'] ?>/img/utente.png" ALT="Utente" TITLE="Utente"></td>
|
||||
<?php } ?>
|
||||
<td class="col3campo2"><?php print $dato['utente'] ?></td>
|
||||
</tr>
|
||||
<?php $tabella1->close(); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $tabella->riga(); ?>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<?php
|
||||
$tabella2 = new html (0,"60%", array(30,0));
|
||||
while ($dato = mysql_fetch_array ( $permessi )) { ?>
|
||||
<tr>
|
||||
<td class="col3campo2"><?php print $dato['palestra']?></td>
|
||||
<td>
|
||||
<select name='<?php print $dato['palestra']?>' class="cambio" >
|
||||
<option name='<?php print $dato['palestra']?>' value='0' <?php if ($dato['attivo'] == 0 OR $dato['attivo'] == NULL) { print "selected"; } ?>>Negato</option>
|
||||
<option name='<?php print $dato['palestra']?>' value='1' <?php if ($dato['attivo'] == 1) { print "selected"; } ?>>Permesso</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella2->riga();
|
||||
}
|
||||
$tabella2->close();
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $tabella->close(); ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('.cambio').on('change', function(){
|
||||
var usr = <?php print $_GET['id'] ?>;
|
||||
var acc = $(this).val();
|
||||
var pal = $(this).attr('name');
|
||||
|
||||
$.ajax({
|
||||
url: "utente_update.php",
|
||||
dataType: "json",
|
||||
data: {
|
||||
user_id: usr,
|
||||
accesso: acc,
|
||||
palestra: pal
|
||||
},
|
||||
success: function(data) {
|
||||
// data contiene i ritorni dalla pagina chiamata ma devono essere in json
|
||||
}
|
||||
} );
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
<?php view_footer(); ?>
|
||||
1
associazione/versione.txt
Normal file
1
associazione/versione.txt
Normal file
@@ -0,0 +1 @@
|
||||
20180820
|
||||
83
associazione/wf_gest.php
Executable file
83
associazione/wf_gest.php
Executable file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
$UTENTE = login();
|
||||
$DIRITTI = diritti('Utente');
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
function confirmation(testo) {
|
||||
alert(testo)
|
||||
document.location.href='main.php'
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<?php
|
||||
if (isset($_GET['id'])) {
|
||||
$id = $_GET['id'];
|
||||
if (isset($_GET['azione'])) {
|
||||
$azione = $_GET['azione'];
|
||||
$genera = 0;
|
||||
switch ($azione) {
|
||||
case "wf_ordrm":
|
||||
$query = "DELETE FROM wf_ordini WHERE id = $id";
|
||||
$testo = "Confermate la cancellazione dell'ordine?";
|
||||
break;
|
||||
case "wf_on":
|
||||
$query = "UPDATE wf_iscritto SET attivo = 1 WHERE id = $id";
|
||||
$testo = "Confermate l'abilitazione dell'utente?";
|
||||
break;
|
||||
case "wf_off":
|
||||
$query = "UPDATE wf_iscritto SET attivo = 0 WHERE id = $id";
|
||||
$testo = "Confermate la disabilitazione dell'utente?";
|
||||
break;
|
||||
|
||||
case "wf_palestra_on":
|
||||
$query = "UPDATE wf_palestra SET attivo = 1 WHERE id = $id";
|
||||
$testo = "Confermate l'abilitazione della palestra?";
|
||||
break;
|
||||
case "wf_palestra_off":
|
||||
$query = "UPDATE wf_palestra SET attivo = 0 WHERE id = $id";
|
||||
$testo = "Confermate la disabilitazione della palestra?";
|
||||
break;
|
||||
|
||||
case "wf_art_on":
|
||||
$query = "UPDATE wf_materiale SET attivo = 1 WHERE id = $id";
|
||||
$testo = "Confermate l'abilitazione dell'articolo?";
|
||||
break;
|
||||
case "wf_art_off":
|
||||
$query = "UPDATE wf_materiale SET attivo = 0 WHERE id = $id";
|
||||
$testo = "Confermate la disabilitazione dell'articolo?";
|
||||
break;
|
||||
|
||||
default:
|
||||
$testo = "Regola non implementata";
|
||||
break;
|
||||
}
|
||||
|
||||
if (isset($_GET['ref'])) {
|
||||
$ref = pack ('H*', $_GET['ref']);
|
||||
mysql_query( $query, $DB_ID );
|
||||
if ($genera) genera($DB_ID);
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
document.location.href="<?php print $ref ?>"
|
||||
</script>
|
||||
<?php } else {
|
||||
$ref = unpack ('H*', $_SERVER["HTTP_REFERER"]);
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var r = confirm("<?php print $testo ?>");
|
||||
if (r == true) {
|
||||
document.location.href="<?php print $_SERVER['REQUEST_URI']?>&ref=<?php print $ref[1] ?>"
|
||||
} else {
|
||||
document.location.href="<?php print $_SERVER['HTTP_REFERER']?>"
|
||||
}
|
||||
</script>
|
||||
<?php }
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user