modification pdo
This commit is contained in:
37
Class/class.newFiche.php
Normal file
37
Class/class.newFiche.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
class Class_newFiche
|
||||
{
|
||||
private $pdo = null;
|
||||
|
||||
|
||||
public function __construct(PdoGsb $pDO)
|
||||
{
|
||||
$this->pdo = $pDO->getPdoGsb();
|
||||
}
|
||||
|
||||
|
||||
public function listFraisForfaitaires(): array
|
||||
{
|
||||
$req = 'SELECT "fLibelle", "fMontant" FROM forfait';
|
||||
$result = $this->pdo->prepare($req);
|
||||
$result->execute();
|
||||
|
||||
return $result->fetchAll();
|
||||
}
|
||||
|
||||
public function endInter(string $id)
|
||||
{
|
||||
$req = "UPDATE intervention
|
||||
SET iHeureFin = NOW()
|
||||
WHERE iCis = :cis AND iId = :idInter AND iHeureFin IS NULL";
|
||||
|
||||
$cis = explode('-', $id)[0];
|
||||
$idInter = explode('-', $id)[1];
|
||||
|
||||
$result = PdoBD::$monPdo->prepare($req);
|
||||
$result->bindParam(':cis', $cis);
|
||||
$result->bindParam(':idInter', $idInter);
|
||||
$result->execute();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user