137 lines
4.1 KiB
PHP
137 lines
4.1 KiB
PHP
<?php
|
|
require_once 'Framework/Modele.php';
|
|
|
|
class Detailprescription extends Modele {
|
|
|
|
public function getdetailprescription($numeroPrescription)
|
|
{
|
|
$sql = 'call sp_p_get_detail_prescription(?)';
|
|
|
|
$resultat = $this->executerRequete($sql, array($numeroPrescription));
|
|
|
|
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getdetailprescription_pha($numeroBonOrdonnance)
|
|
{
|
|
$sql = 'call sp_p_get_detail_prescription_pha(?)';
|
|
|
|
$resultat = $this->executerRequete($sql, array($numeroBonOrdonnance));
|
|
|
|
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function ajoutermedicament($codeMedicament)
|
|
{
|
|
$codeTarifMedicament = $_SESSION['p_codeTarifMedicament_C'];
|
|
$numeroPrescription = $_SESSION['p_numeroPrescription_C'];
|
|
$user = $_SESSION['p_login'];
|
|
$tm = $_SESSION['p_tm_C'];
|
|
$accesAjoutPh = $_SESSION['p_accesAjoutPh_C'];
|
|
/*
|
|
var_dump($codeTarifMedicament);
|
|
var_dump($numeroPrescription);
|
|
var_dump($codeMedicament);
|
|
var_dump($user);
|
|
var_dump($accesAjoutPh);
|
|
die();
|
|
*/
|
|
$sql = 'call sp_p_ajouter_medicament(?, ?, ?, ?, ?, ?)';
|
|
|
|
$this->executerRequete($sql, array($codeTarifMedicament, $numeroPrescription, $codeMedicament, $user, $tm, $accesAjoutPh));
|
|
}
|
|
|
|
public function ajoutermedicamentpha($codeMedicament)
|
|
{
|
|
$codeTarifMedicament = $_SESSION['p_codeTarifMedicament_C'];
|
|
$numeroPrescription = $_SESSION['p_numeroPrescription_C'];
|
|
$user = $_SESSION['p_login'];
|
|
$tm = $_SESSION['p_tm_C'];
|
|
$idSaisie = $_SESSION['p_idSaisie'];
|
|
$accesAjoutPh = $_SESSION['p_accesAjoutPh_C'];
|
|
|
|
$sql = 'call sp_p_ajouter_medicament_pha(?, ?, ?, ?, ?, ?, ?)';
|
|
|
|
$this->executerRequete($sql, array($codeTarifMedicament, $numeroPrescription, $codeMedicament, $user, $tm, $idSaisie, $accesAjoutPh));
|
|
}
|
|
|
|
public function majquantite($idMedicament, $quantite)
|
|
{
|
|
$tm = $_SESSION['p_tm_C'];
|
|
|
|
$sql = 'call sp_p_maj_quantite_medicament(?, ?, ?)';
|
|
|
|
$this->executerRequete($sql, array($idMedicament, $quantite, $tm));
|
|
}
|
|
|
|
|
|
public function majposologie($idMedicament, $posologie)
|
|
{
|
|
$sql = 'UPDATE p_detailprescription SET
|
|
posologie = ?
|
|
WHERE (id=?);';
|
|
|
|
$this->executerRequete($sql, array($posologie,$idMedicament));
|
|
}
|
|
|
|
public function majquantitepha($idMedicament, $quantite)
|
|
{
|
|
$tm = $_SESSION['p_tm_C'];
|
|
|
|
$sql = 'call sp_p_maj_quantite_medicament_pha(?, ?, ?)';
|
|
|
|
$this->executerRequete($sql, array($idMedicament, $quantite, $tm));
|
|
}
|
|
|
|
public function majprixpha($idMedicament, $prix)
|
|
{
|
|
$tm = $_SESSION['p_tm_C'];
|
|
|
|
// $sql = 'call sp_p_maj_quantite_medicament_pha(?, ?, ?)';
|
|
$sql = 'call sp_p_maj_prix_medicament_pha(?, ?, ?)';
|
|
|
|
$this->executerRequete($sql, array($idMedicament, $prix, $tm));
|
|
}
|
|
|
|
public function supprimer($idMedicament)
|
|
{
|
|
$sql = 'call sp_p_supprimer_medicament_prescription(?)';
|
|
|
|
$this->executerRequete($sql, array($idMedicament));
|
|
}
|
|
|
|
public function demanderaccordpha($idMedicament)
|
|
{
|
|
$codeSociete = $_SESSION['p_codeSociete'];
|
|
|
|
$sql = 'call sp_p_demanderaccordpha(?, ?)';
|
|
|
|
$this->executerRequete($sql, array($idMedicament, $codeSociete));
|
|
}
|
|
|
|
// $_SESSION['p_idMedicament_a_remplacer'] = $idMedicament;
|
|
public function remplacermedicament($codeMedicamentNouv)
|
|
{
|
|
$idMedicamentAnc = $_SESSION['p_idMedicament_a_remplacer'];
|
|
$codeTarifMedicament = $_SESSION['p_codeTarifMedicament_C'];
|
|
$numeroPrescription = $_SESSION['p_numeroPrescription_C'];
|
|
$user = $_SESSION['p_login'];
|
|
$tm = $_SESSION['p_tm_C'];
|
|
|
|
$sql = 'call sp_p_remplacer_medicament(?, ?, ?, ?, ?, ?)';
|
|
|
|
$this->executerRequete($sql, array($codeTarifMedicament, $numeroPrescription, $codeMedicamentNouv, $user, $tm, $idMedicamentAnc));
|
|
}
|
|
|
|
|
|
public function getmedicamentsremplaces($numeroBonOrdonnance)
|
|
{
|
|
$numeroBonOrdonnance = $_SESSION['p_numeroBonOrdonnance_C'];
|
|
|
|
$sql = 'call sp_p_get_medicaments_remplaces(?)';
|
|
|
|
$resultat = $this->executerRequete($sql, array($numeroBonOrdonnance));
|
|
|
|
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
} |