Commit a490b4c6 authored by Eric Seigne's avatar Eric Seigne
Browse files

insert sql ok

parent 56fbde56
......@@ -27,6 +27,45 @@ body {
.imgmini32 {
max-width: 32px;
max-height: 32px;
float:left;
position:relative;
}
.popupImage span {
position:absolute;
display:none;
}
.popupImage span img {
max-width: 600px;
max-height: 600px;
}
.popupImage:hover {
cursor:pointer;
max-width: 32px;
max-height: 32px;
}
.popupImage:hover span {
z-index: 50;
display:block;
top: 100px;
padding: 10px; /*size of the frame*/
background:#eae9d4; /*colour of the frame*/
/*add a drop shadow to the frame*/
-webkit-box-shadow: 0 0 20px rgba(0,0,0, .75));
-moz-box-shadow: 0 0 20px rgba(0,0,0, .75);
box-shadow: 0 0 20px rgba(0,0,0, .75);
/*give the corners a curve*/
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius:8px;
/**Style the caption**/
font-family: 'Droid Sans', sans-serif; /*Droid Sans is available from Google fonts*/
font-size:.9em;
text-align: center;
color: #495a62;
}
.titreRegroupement {
......
......@@ -25,6 +25,7 @@ include("parts/sidebar.html");
<th>Date</th>
<th>Information</th>
<th>Montant TTC</th>
<th>Statut</th>
<th>Action</th>
</tr>
</thead>
......@@ -33,30 +34,35 @@ include("parts/sidebar.html");
<td>01/12/2018</td>
<td>Décembre 2018</td>
<td class="text-right">824,70</td>
<td>Traitement en cours</td>
<td></td>
</tr>
<tr>
<td>01/11/2018</td>
<td>Novembre 2018</td>
<td class="text-right">1048,20</td>
<td>Payée le 10/12/2018 par virement</td>
<td></td>
</tr>
<tr>
<td>01/10/2018</td>
<td>Octobre 2018</td>
<td class="text-right">247,10</td>
<td>Payée le 14/11/2018 par virement</td>
<td></td>
</tr>
<tr>
<td>01/09/2018</td>
<td>Septembre 2018</td>
<td class="text-right">984,50</td>
<td>Payée le 4/10/2019 par chèque numéro 000XX981</td>
<td></td>
</tr>
<tr>
<td>01/08/2018</td>
<td>Août 2018</td>
<td class="text-right">1400,25</td>
<td>Payée le 14/09/2019 par chèque numéro 000XX981</td>
<td></td>
</tr>
</tbody>
......
......@@ -41,7 +41,7 @@ include("parts/sidebar.html");
<td>CB Perso</td>
<td class="text-right">20,58</td>
<td class="text-right">24,70</td>
<td><img class="imgmini32" src="uploads/001.jpeg"></td>
<td><a class="popupImage"><img src="uploads/001.jpeg" class="imgmini32"><span><img src="uploads/001.jpeg"></span></a></td>
<td></td>
</tr>
<tr>
......@@ -51,7 +51,7 @@ include("parts/sidebar.html");
<td>CB Perso</td>
<td class="text-right">16,50</td>
<td class="text-right">19,80</td>
<td><img class="imgmini32" src="uploads/002.jpeg"></td>
<td><a class="popupImage"><img src="uploads/002.jpeg" class="imgmini32"><span><img src="uploads/002.jpeg"></span></a></td>
<td></td>
</tr>
<tr>
......@@ -61,20 +61,18 @@ include("parts/sidebar.html");
<td>CB Pro</td>
<td class="text-right">16,50</td>
<td class="text-right">19,80</td>
<td><img class="imgmini32" src="uploads/003.jpeg"></td>
<td><a class="popupImage"><img src="uploads/003.jpeg" class="imgmini32"><span><img src="uploads/003.jpeg"></span></a></td>
<td></td>
</tr>
<tr>
<td colspan="3">Total paiements Pro</td>
<td class="text-right"></td>
<td class="text-right"></td>
<td colspan="5">Total paiements Pro</td>
<td class="text-right">19.80</td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="3">Total paiements Perso</td>
<td class="text-right"></td>
<td class="text-right"></td>
<td colspan="5">Total paiements Perso</td>
<td class="text-right">44.50</td>
<td></td>
<td></td>
</tr>
......@@ -87,39 +85,114 @@ include("parts/sidebar.html");
<tr>
<th>Date</th>
<th>Information</th>
<th>Type</th>
<th>Montant HT</th>
<th>Montant TTC</th>
<th>Paiement</th>
<th></th>
<th>Montant</th>
<th>Document</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>01/01/2019</td>
<td>Toulouse Sud</td>
<td>Péage</td>
<td class="text-right">20,58</td>
<td class="text-right">24,70</td>
<td><img class="imgmini32" src="uploads/001.jpeg"></td>
<td>10/01/2019</td>
<td>Ragazzi da peppone</td>
<td>CB Perso</td>
<td>HT</td>
<td class="text-right">58,95</td>
<td><a class="popupImage"><img src="uploads/2019-01-10-resto-jRtU2.jpeg" class="imgmini32"><span><img src="uploads/2019-01-10-resto-jRtU2.jpeg"></span></a></td>
<td></td>
<td></td>
</tr>
<tr>
<td>01/01/2019</td>
<td>St Selve</td>
<td>Péage</td>
<td class="text-right">16,50</td>
<td class="text-right">19,80</td>
<td><img class="imgmini32" src="uploads/002.jpeg"></td>
<td></td>
<td>---</td>
<td></td>
<td>TVA 10%</td>
<td class="text-right">5,90</td>
<td></td>
<td></td>
</tr>
<tr>
<td>06/01/2019</td>
<td>Toulouse Nord</td>
<td>Péage</td>
<td class="text-right">16,50</td>
<td class="text-right">19,80</td>
<td><img class="imgmini32" src="uploads/003.jpeg"></td>
<td></td>
<td>---</td>
<td></td>
<td>TTC</td>
<td class="text-right">64,85</td>
<td></td>
<td></td>
</tr>
<tr>
<td>17/01/2019</td>
<td>Le coquet</td>
<td>CB Perso</td>
<td>HT</td>
<td class="text-right"></td>
<td><a class="popupImage"><img src="uploads/ticket_de_caisse_demo-01.jpeg" class="imgmini32"><span><img src="uploads/ticket_de_caisse_demo-01.jpeg"></span></a></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>---</td>
<td></td>
<td>TVA 10%</td>
<td class="text-right">3.08</td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>---</td>
<td></td>
<td>TVA 20%</td>
<td class="text-right">3.00</td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>---</td>
<td></td>
<td>TTC</td>
<td class="text-right">51.90</td>
<td></td>
<td></td>
</tr>
<tr>
<td>18/01/2019</td>
<td>Nikki Beach - St Tropez</td>
<td>CB Perso</td>
<td>HT</td>
<td class="text-right"></td>
<td><a class="popupImage"><img src="uploads/ticket_de_caisse_demo-02.jpeg" class="imgmini32"><span><img src="uploads/ticket_de_caisse_demo-02.jpeg"></span></a></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>---</td>
<td></td>
<td>TVA 19.6%</td>
<td class="text-right">14749.16</td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>---</td>
<td></td>
<td>TVA 7%</td>
<td class="text-right">1146.43</td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>---</td>
<td></td>
<td>TTC</td>
<td class="text-right">107524.00</td>
<td></td>
<td></td>
</tr>
<tr>
......
<?php header('Access-Control-Allow-Origin: *'); ?>
<!doctype html>
<html lang="fr">
<head>
......@@ -31,44 +32,70 @@
return $text;
}
$mysqli = new mysqli("localhost", "openndfu", "UjMon5okph", "openndf");
if (mysqli_connect_errno()) {
printf("Échec de la connexion : %s\n", mysqli_connect_error());
exit();
}
$ladate = $_REQUEST['date'];
$total = $_REQUEST['total'];
$ht = $_REQUEST['ht'];
$typeFrais = $_REQUEST['typeFrais'];
$nom = $_REQUEST['nom'];
/*
$logFile = fopen("logs/debug.log", 'a');
$req_dump = print_r($_REQUEST, TRUE);
fwrite($logFile, $req_dump);
fclose($logFile);
*/
$k="";
$v="";
foreach ($_REQUEST as $key => $value) {
//Sauf le fichier
if($key != "afile") {
if($k != "")
$k .= ",";
if($v != "")
$v .= ",";
$k .= "`" . $mysqli->real_escape_string($key) . "`";
$v .= "'" . $mysqli->real_escape_string($value) . "'";
}
}
$sql = "INSERT INTO logs($k) VALUES ($v)";
$result = $mysqli->query($sql);
/*
$logFile = fopen("logs/debug.log", 'a');
$req_dump = print_r($_REQUEST, TRUE);
fwrite($logFile, $req_dump);
fwrite($logFile, $sql . "\n");
fclose($logFile);
*/
$target_dir = "uploads/";
$target_file = tempnam($target_dir, slugify($ladate . '-' . $nom));
unlink($target_file);
$target_file .= ".jpeg";
$imageContent = file_get_contents($_REQUEST['afile']);
$uploadOk = 1;
// Check if image file is a actual image or fake image
if(isset($ladate)) {
$fd = fopen($target_file, "w");
fwrite($fd, $imageContent);
fclose($fd);
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
if(isset($_REQUEST['afile'])) {
$target_dir = "uploads/";
$target_file = tempnam($target_dir, slugify($ladate . '-' . $nom));
unlink($target_file);
$target_file .= ".jpeg";
$imageContent = file_get_contents($_REQUEST['afile']);
$uploadOk = 1;
// Check if image file is a actual image or fake image
if(isset($ladate)) {
$fd = fopen($target_file, "w");
fwrite($fd, $imageContent);
fclose($fd);
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
/*
$check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
if($check !== false) {
echo "File is an image - " . $check["mime"] . ".";
$uploadOk = 1;
} else {
echo "File is not an image.";
$uploadOk = 0;
}
// Check if file already exists
if (file_exists($target_file)) {
$check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
if($check !== false) {
echo "File is an image - " . $check["mime"] . ".";
$uploadOk = 1;
} else {
echo "File is not an image.";
$uploadOk = 0;
}
// Check if file already exists
if (file_exists($target_file)) {
echo "Sorry, file already exists.";
$uploadOk = 0;
}
......@@ -95,6 +122,7 @@ if(isset($ladate)) {
}
}
*/
}
}
?>
</body>
......
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