Mini Shell

Direktori : /home/admin/web/mcpv.demarco.ddnsfree.com/public_html/external/prestataires2/models/
Upload File :
Current File : /home/admin/web/mcpv.demarco.ddnsfree.com/public_html/external/prestataires2/models/Prestataire.php

<?php

require_once '_framework/Model.php';
require_once '_framework/Crypto.php';
require_once '_framework/Configuration.php';

class Prestataire extends Model {
	
  private $crypto;
  
  function __construct() {
	$this->crypto = new Crypto();
  }

  public function getPrestataires() {
    $sql = 'select * from v_prestataires order by statut';
    $prestataires = $this->runQuery($sql);
	$records = $prestataires->fetchall();
    return $records;
  }
  public function getPendingPrestataires() {
    $sql = 'select * from v_prestataires where statut < 2 order by date_creat desc';
    $prestataires = $this->runQuery($sql);
	$records = $prestataires->fetchall();
    return $records;
  }

  public function getActivePrestataires() {
    $sql = 'select * from v_prestataires where statut = 2 order by note_g desc,lieu';
    $prestataires = $this->runQuery($sql);
	$records = $prestataires->fetchall();
    return $records;
  }

  public function getPrestataire($id) {
    $sql = 'select * from v_prestataires'
      . ' where id=?';
    $prestataires = $this->runQuery($sql, array($id));
	$records = $prestataires->fetchall();
    if ($records && count($records)) {
		return $records;
	}
    else
      throw new ErrorException("Aucun membre ne correspond à l'identifiant '$id'",0,E_USER_NOTICE);
  }

  public function addPrestataire($values) {
    $sql = 'insert into prestataires (fonct_id, nom, prenom, adresse, npa, lieu, tel, email, attrib1, attrib2, attrib3, remarque, statut, memb_creat)'
      . ' values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)';
    $this->runQuery($sql, $values);
  }

  public function deletePrestataire($id) {
    $sql = 'delete from prestataires'
      . ' where id=?';
    $prestataire = $this->runQuery($sql, array($id));
  }

  public function updatePrestataire($values) {
    $sql = 'update prestataires set nom=?, prenom=?, adresse=?, npa=?, lieu=?, tel=?, email=?, statut=?, attrib1=?, attrib2=?, attrib3=?, remarque=? '
      . ' where id=?';
    $prestataire = $this->runQuery($sql, $values);
  }

  public function updateStatut($values) {
    $sql = 'update prestataires set statut=? where id=?';
    $this->runQuery($sql, $values);
  }
  
  public function getUniqueNoms() {
    $sql = 'select distinct nom from v_prestataires where statut = 2 order by nom';
    $prestataires = $this->runQuery($sql);
	$records = $prestataires->fetchall();
    return $records;
  }
  
  public function getUniqueLieux() {
    $sql = 'select distinct lieu from v_prestataires where statut = 2 order by lieu';
    $prestataires = $this->runQuery($sql);
	$records = $prestataires->fetchall();
    return $records;
  }
  
  public function getUniqueFonctions() {
    $sql = 'select distinct fonction from v_prestataires where statut = 2 order by fonction';
    $prestataires = $this->runQuery($sql);
	$records = $prestataires->fetchall();
    return $records;
  }

}


June 16, 2021 – Page 2 – Base de données MCPV "Prestataires"

Day: June 16, 2021

High rollers tend to wager in hundred

Best Live Casino Games Evolution Games We’ve also learned about the exclusive perks of VIP clubs, the convenience of casino hotels and resorts, and the importance of safety and responsible gaming. All these elements come together to create a unique and exhilarating experience that is the world of casinos. So ジョイカジノ, when you’re ready to…

Read More

Get a profitable hand in Blackjack and double down for even

No 1 In Slots , Live Dealers And Casino Games The great point is, by law, all sweepstakes should offer gamers a no purchase required method to play, and have the prospect of winning. Pragmatic Play make awesome new slots, and have turn into an enormous sensation each on-line, and in casinos. They are in…

Read More