Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <?php
- $nom = $_POST['nom'];
- $crypt = new Crypto;
- $nom_decrypt = $crypt->cryptologin($nom,"decrypt");
- $file = './' . $nom_decrypt . '/clifou.s3db';
- if (file_exists($file)) {
- //$base=new SQLite3($file);
- }
- else
- {
- exit('Echec lors de l\'ouverture du fichier ' . $file);
- }
- //echo $file . "<br>";
- $livre = $_POST["livre"];
- $base=new SQLite3($file);
- /*
- $qnum = "SELECT * from PARAMS WHERE NAME='LASTCLI'";
- $res_cli = $base->query($qnum);
- $row_cli = $res_cli->fetchArray();
- $lastcli = $row_cli["VALUE"];
- //echo $lastcli. "<br>";
- $lastcli = $lastcli + 1;
- //echo $lastcli. "<br>";
- $qnum = "UPDATE PARAMS SET VALUE='" . $lastcli . "' WHERE NAME='LASTCLI'";
- $base->exec($qnum);
- */
- if ($_POST["tvacli"] == "") {
- $vatcat = "3";
- }
- else {
- $vatcat = "1";
- }
- $query = "INSERT INTO CLIFOU (NUMBER, TYPE, NAME1, ADRESS1, VATCAT, COUNTRY, VATNUMBER, CATEGORY, ZIPCODE, CITY) VALUES (" .
- // "'CAIS_" . sprintf('%05d', $lastcli) . "', '" .
- "'" . $_POST["numcli"] . "', '" .
- "1', '" .
- $_POST["nomcli"] . "', '" .
- $_POST["adrcli"] . "', '" .
- $vatcat . "', '" .
- $_POST["payscli"] . "', '" .
- $_POST["tvacli"] . "', '" .
- "C" . "', '" .
- $_POST["cpcli"] . "', '" .
- $_POST["loccli"] . "')";
- //echo $query . "<br>";
- $base->exec($query);
- ?>
- <script type="text/javascript">
- window.open("caisse_factcli.php?nom=<?php echo $nom; ?>&livre=<?php echo $livre; ?>", "_self");
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement