Import initial du projet Production
This commit is contained in:
69
Modele/Tarifsoptiques.php
Executable file
69
Modele/Tarifsoptiques.php
Executable file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
require_once 'Framework/Modele.php';
|
||||
|
||||
class Tarifsoptiques extends Modele {
|
||||
|
||||
public function getListe()
|
||||
{
|
||||
if (est_anglophone())
|
||||
{
|
||||
$sql = 'SELECT codeTarifOptique as `code`, libelleEng as libelle FROM p_tarifoptique order by libelle';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT codeTarifOptique as `code`, libelle FROM p_tarifoptique order by libelle';
|
||||
}
|
||||
|
||||
$liste = $this->executerRequete($sql);
|
||||
|
||||
return $liste->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
public function creertarifoptiques($libelle, $libelleEng)
|
||||
{
|
||||
$codeSociete = $_SESSION['codeSociete'];
|
||||
$user = $_SESSION['login'];
|
||||
|
||||
$sql = 'call sp_creer_tarif_optiques(?, ?, ?, ?)';
|
||||
|
||||
$this->executerRequete($sql, array($codeSociete, $libelle, $libelleEng, $user));
|
||||
}
|
||||
|
||||
public function getListeTarif()
|
||||
{
|
||||
$codeSociete = $_SESSION['codeSociete'];
|
||||
|
||||
$sql = 'SELECT * FROM p_tarifoptique where codeSociete=? order by libelle';
|
||||
|
||||
$liste = $this->executerRequete($sql, array($codeSociete));
|
||||
return $liste->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
public function getunptarif($idTarif)
|
||||
{
|
||||
$sql = 'call sp_afficher_un_tarif_optiquee(?)';
|
||||
|
||||
$resultat = $this->executerRequete($sql, array($idTarif));
|
||||
|
||||
return $resultat->fetch(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
public function enregistrermodif($idTarif, $libelle, $libelleEng)
|
||||
{
|
||||
$user = $_SESSION['login'];
|
||||
|
||||
$sql = 'call sp_modifier_tarif_optique(?, ?, ?, ?)';
|
||||
|
||||
$this->executerRequete($sql, array($idTarif, $libelle, $libelleEng, $user));
|
||||
}
|
||||
|
||||
public function supprimer($idTarif)
|
||||
{
|
||||
$user = $_SESSION['login'];
|
||||
|
||||
$sql = 'call sp_supprimer_tarif_optique(?, ?)';
|
||||
|
||||
$this->executerRequete($sql, array($idTarif, $user));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user