par
Henrigo » 22 sept. 2016, 13:09
Il te faut quoi comme paramètre pour générer le PDF ?
sinon ta solution en JS en valable (par contre faut un lien vers le script qui génère le PDF.
@+
voici le script en question
drucker.php
<?php
require_once __DIR__ . '/connection.php';
$id = $_POST['id'];
$img_id = $_POST['img_id'];
$type = $_POST['type'];
$user = $_POST['user'];
$sessionID = $_POST['sessionID'];
$location = $_POST['location'];
$path = $_POST['img_path'];
$check = $dbConnect->prepare('SELECT COUNT(*) FROM drucker
WHERE prod_id = :id
AND img_id = :img_id
AND img_path = :img_path
AND type = :type
AND user = :user
AND sessionID = :sessionID');
$check->bindValue(':id', $id);
$check->bindValue(':img_id', $img_id);
$check->bindValue(':img_path', $path);
$check->bindValue(':type', $type);
$check->bindValue(':user', $user);
$check->bindValue(':sessionID', $sessionID);
$check->execute();
if ((int)$check->fetchColumn() === 0) {
$stm = $dbConnect->prepare('INSERT INTO drucker (prod_id, img_id, img_path, type, user, sessionID) VALUES (:prod_id, :img_id, :img_path, :type, :user, :sessionID)');
$stm->bindValue(':prod_id', $id);
$stm->bindValue(':img_id', $img_id);
$stm->bindValue(':img_path', $path);
$stm->bindValue(':type', $type);
$stm->bindValue(':user', $user);
$stm->bindValue(':sessionID', $sessionID);
$stm->execute();
}
header("Location:" . $location);
[quote="moogli"]Il te faut quoi comme paramètre pour générer le PDF ?
sinon ta solution en JS en valable (par contre faut un lien vers le script qui génère le PDF.
@+[/quote]
voici le script en question
drucker.php
[php]<?php
require_once __DIR__ . '/connection.php';
$id = $_POST['id'];
$img_id = $_POST['img_id'];
$type = $_POST['type'];
$user = $_POST['user'];
$sessionID = $_POST['sessionID'];
$location = $_POST['location'];
$path = $_POST['img_path'];
$check = $dbConnect->prepare('SELECT COUNT(*) FROM drucker
WHERE prod_id = :id
AND img_id = :img_id
AND img_path = :img_path
AND type = :type
AND user = :user
AND sessionID = :sessionID');
$check->bindValue(':id', $id);
$check->bindValue(':img_id', $img_id);
$check->bindValue(':img_path', $path);
$check->bindValue(':type', $type);
$check->bindValue(':user', $user);
$check->bindValue(':sessionID', $sessionID);
$check->execute();
if ((int)$check->fetchColumn() === 0) {
$stm = $dbConnect->prepare('INSERT INTO drucker (prod_id, img_id, img_path, type, user, sessionID) VALUES (:prod_id, :img_id, :img_path, :type, :user, :sessionID)');
$stm->bindValue(':prod_id', $id);
$stm->bindValue(':img_id', $img_id);
$stm->bindValue(':img_path', $path);
$stm->bindValue(':type', $type);
$stm->bindValue(':user', $user);
$stm->bindValue(':sessionID', $sessionID);
$stm->execute();
}
header("Location:" . $location);[/php]