Commit 83df173c by JonathanMM

Merge branch 'overflow'

parents 02c7aef8 00e5aee7
......@@ -43,7 +43,9 @@ function getStatusByIdConso($idConso, $filtreWhere = null)
'nbFreeEDock' => $station['nbFreeEDock'],
'nbEDock' => $station['nbEDock'],
'latitude' => $station['latitude'],
'longitude' => $station['longitude']
'longitude' => $station['longitude'],
'overflow' => $station['overflow'],
'overflowActivation' => $station['overflowActivation']
);
}
return $retour;
......
......@@ -81,6 +81,7 @@
<th>Vélos mécaniques dispo</th>
<th>Vélos électriques dispo</th>
<th>Bornes libres</th>
<th>Park+ (overflow)</th>
</tr>
</thead>
</table>
......@@ -159,6 +160,15 @@
}
return data+'/'+row.nbEDock;
}
},{
data: 'overflow',
render: function(data, type, row, meta)
{
if(data == 'yes')
return 'oui';
else
return 'non';
}
}],
language: dtTraduction
});
......
......@@ -61,7 +61,9 @@ def creerDumpData(dateDebut):
`nbEDock` int(3) NOT NULL,
`nbBikeOverflow` int(3) NOT NULL,
`nbEBikeOverflow` int(3) NOT NULL,
`maxBikeOverflow` int(3) NOT NULL
`maxBikeOverflow` int(3) NOT NULL,
`overflow` varchar(4) DEFAULT NULL,
`overflowActivation` varchar(4) DEFAULT NULL
);
''')
c.execute('''
......@@ -97,7 +99,7 @@ def creerDumpData(dateDebut):
c = conn.cursor()
requete = mysql.cursor()
requete.execute('SELECT s.id, s.code, s.idConso, s.state, s.nbBike, s.nbEBike, s.nbFreeEDock, s.nbEDock, s.nbBikeOverflow, s.nbEBikeOverflow, s.maxBikeOverflow \
requete.execute('SELECT s.id, s.code, s.idConso, s.state, s.nbBike, s.nbEBike, s.nbFreeEDock, s.nbEDock, s.nbBikeOverflow, s.nbEBikeOverflow, s.maxBikeOverflow, s.overflow, s.overflowActivation \
FROM status s \
INNER JOIN `statusConso` c ON c.id = s.idConso \
WHERE (c.`date` >= "'+dateDebutStr+'" AND c.`date` < "'+dateFinStr+'")')
......@@ -106,7 +108,7 @@ def creerDumpData(dateDebut):
values = []
for cell in statut:
values.append(val(cell))
c.execute('INSERT INTO status (id, code, idConso, state, nbBike, nbEBike, nbFreeEDock, nbEDock, nbBikeOverflow, nbEBikeOverflow, maxBikeOverflow) VALUES \
c.execute('INSERT INTO status (id, code, idConso, state, nbBike, nbEBike, nbFreeEDock, nbEDock, nbBikeOverflow, nbEBikeOverflow, maxBikeOverflow, overflow, overflowActivation) VALUES \
('+', '.join(values)+')')
conn.commit()
......
......@@ -61,8 +61,8 @@ def getAllStation():
nbFreeEDock = int(etatStation['nbFreeDock'])+int(etatStation['nbFreeEDock'])
nbEDock = int(etatStation['nbDock'])+int(etatStation['nbEDock'])
requete = mysql.cursor()
requete.execute('INSERT INTO status (code, idConso, state, nbBike, nbEBike, nbFreeEDock, nbEDock, nbBikeOverflow, nbEBikeOverflow, maxBikeOverflow) VALUES \
('+str(codeStation)+', '+strIdConso+', "'+str(infoStation['state'])+'", '+str(nbBike)+', '+str(nbEbike)+', '+str(nbFreeEDock)+', '+str(nbEDock)+', '+str(etatStation['nbBikeOverflow'])+', '+str(etatStation['nbEBikeOverflow'])+', '+str(etatStation['maxBikeOverflow'])+')')
requete.execute('INSERT INTO status (code, idConso, state, nbBike, nbEBike, nbFreeEDock, nbEDock, nbBikeOverflow, nbEBikeOverflow, maxBikeOverflow, overflow, overflowActivation) VALUES \
('+str(codeStation)+', '+strIdConso+', "'+str(infoStation['state'])+'", '+str(nbBike)+', '+str(nbEbike)+', '+str(nbFreeEDock)+', '+str(nbEDock)+', '+str(etatStation['nbBikeOverflow'])+', '+str(etatStation['nbEBikeOverflow'])+', '+str(etatStation['maxBikeOverflow'])+', "'+str(etatStation['overflow'])+'", "'+str(etatStation['overflowActivation'])+'")')
#On met à jour la station au besoin
if codeStation in stationsFutur and nbEDock > 0:
......
......@@ -122,7 +122,9 @@ CREATE TABLE `status` (
`nbEDock` int(3) NOT NULL,
`nbBikeOverflow` int(3) NOT NULL,
`nbEBikeOverflow` int(3) NOT NULL,
`maxBikeOverflow` int(3) NOT NULL
`maxBikeOverflow` int(3) NOT NULL,
`overflow` varchar(4) DEFAULT NULL,
`overflowActivation` varchar(4) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment