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/Avis.php

<?php

require_once '_framework/Model.php';

class Avis extends Model {

  public function getAllAvis() {

    $sql = 'select * from v_avis order by statut, date_avis';
    $avis = $this->runQuery($sql);
    return $avis->fetchAll();
  }

  public function getAvis($id) {
    $sql = 'select * from v_avis where id=?';
    $avis = $this->runQuery($sql, array($id));
    $rs = $avis->fetchAll();
    if ($rs && count($rs)) {
      return $rs; 
    }
    else
      throw new ErrorException("Aucun avis ne correspond à l'identifiant '$id'",0,E_USER_NOTICE);
  }
  
  public function getPrestataireAvis($id) {
    $sql = 'select * from v_avis where statut = 2 and prest_id = ?';
    return $this->runQuery($sql, array($id));
  }

  public function updateStatut($values) {
	$statut = $values[0];
	$avis_id = $values[1];
	$sql = 'update avis set	statut = ? where id=?';
	$this->runQuery($sql, $values);
	$sql = 'select prest_id from v_avis where id=?';
	$prestataire = $this->runQuery($sql, array($avis_id));
	$rs = $prestataire->fetch();
	$id = $rs['prest_id'];
	if($statut === 2) {
		$this->updateNotes($id);
	}
  }
  
  public function updateNotes($id){
	$sql = 'select
				(select round(avg(note1),2) from avis where prest_id = p.id and statut = 2 and not na1) as avg_c1,
				(select round(avg(note2),2) from avis where prest_id = p.id and statut = 2 and not na2) as avg_c2,
				(select round(avg(note3),2) from avis where prest_id = p.id and statut = 2 and not na3) as avg_c3,
				(select round(avg(note4),2) from avis where prest_id = p.id and statut = 2 and not na4) as avg_c4,
				(select round(avg(note5),2) from avis where prest_id = p.id and statut = 2 and not na5) as avg_c5,
				(select round(avg(note6),2) from avis where prest_id = p.id and statut = 2 and not na6) as avg_c6,
				(select round(avg(note7),2) from avis where prest_id = p.id and statut = 2 and not na7) as avg_c7,
				(select round(avg(note8),2) from avis where prest_id = p.id and statut = 2 and not na8) as avg_c8,
				(select round(avg(note9),2) from avis where prest_id = p.id and statut = 2 and not na9) as avg_c9,
				(select round(avg(note10),2) from avis where prest_id = p.id and statut = 2 and not na10) as avg_c10,
				round(round((select ifnull(sum(note1),0) from avis where prest_id = p.id and statut = 2 and not na1) +
					(select ifnull(sum(note2),0) from avis where prest_id = p.id and statut = 2 and not na2) +
					(select ifnull(sum(note3),0) from avis where prest_id = p.id and statut = 2 and not na3) +
					(select ifnull(sum(note4),0) from avis where prest_id = p.id and statut = 2 and not na4) + 
					(select ifnull(sum(note5),0) from avis where prest_id = p.id and statut = 2 and not na5) +
					(select ifnull(sum(note6),0) from avis where prest_id = p.id and statut = 2 and not na6) +
					(select ifnull(sum(note7),0) from avis where prest_id = p.id and statut = 2 and not na7) +
					(select ifnull(sum(note8),0) from avis where prest_id = p.id and statut = 2 and not na8) +
					(select ifnull(sum(note9),0) from avis where prest_id = p.id and statut = 2 and not na9) +
					(select ifnull(sum(note10),0) from avis where prest_id = p.id and statut = 2 and not na10),2) /
					(round((select count(note1) from avis where prest_id = p.id and statut = 2 and not na1) +
					(select count(note2) from avis where prest_id = p.id and statut = 2 and not na2) +
					(select count(note3) from avis where prest_id = p.id and statut = 2 and not na3) +
					(select count(note4) from avis where prest_id = p.id and statut = 2 and not na4) + 
					(select count(note5) from avis where prest_id = p.id and statut = 2 and not na5) +
					(select count(note6) from avis where prest_id = p.id and statut = 2 and not na6) +
					(select count(note7) from avis where prest_id = p.id and statut = 2 and not na7) +
					(select count(note8) from avis where prest_id = p.id and statut = 2 and not na8) +
					(select count(note9) from avis where prest_id = p.id and statut = 2 and not na9) +
					(select count(note10) from avis where prest_id = p.id and statut = 2 and not na10),2)),2) as avg_g
				from prestataires p
				where p.id = ?';
	$calc = $this->runQuery($sql, array($id));
	$rs = $calc->fetch();
	$avg_c1 = $rs['avg_c1'];
	$avg_c2 = $rs['avg_c2'];
	$avg_c3 = $rs['avg_c3'];
	$avg_c4 = $rs['avg_c4'];
	$avg_c5 = $rs['avg_c5'];
	$avg_c6 = $rs['avg_c6'];
	$avg_c7 = $rs['avg_c7'];
	$avg_c8 = $rs['avg_c8'];
	$avg_c9 = $rs['avg_c9'];
	$avg_c10 = $rs['avg_c10'];
	$avg_g = $rs['avg_g'];
	$values = array();
	array_push($values,$avg_c1);
	array_push($values,$avg_c2);
	array_push($values,$avg_c3);
	array_push($values,$avg_c4);
	array_push($values,$avg_c5);
	array_push($values,$avg_c6);
	array_push($values,$avg_c7);
	array_push($values,$avg_c8);
	array_push($values,$avg_c9);
	array_push($values,$avg_c10);
	array_push($values,$avg_g);
	array_push($values,$id);
	$sql = 'update prestataires set note1 = ?, note2 = ?, note3 = ?, note4 = ?, note5 = ?, note6 = ?, 
			note7 = ?, note8 = ?, note9 = ?, note10 = ?, note_g = ? 
			where id=?';
	$this->runQuery($sql, $values);
  }
    
  public function submitAvis($values) {
    $sql = 'insert into avis (prest_id,note1,note2,note3,note4,note5,note6,note7,note8,note9,note10, 
			na1,na2,na3,na4,na5,na6,na7,na8,na9,na10,remarque,anonyme,memb_nom,memb_email) 
			values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)';
    $this->runQuery($sql, $values);
  }
  
}
Unfortunately, it’s inconceivable to ensure the authenticity – Base de données MCPV "Prestataires"

Unfortunately, it’s inconceivable to ensure the authenticity

The Final Word Guide To Buying Reproduction Luggage

The sandals have a lightly padded footbed, which is a superb characteristic for comfort and regular wear. They can be found at Zappos, and Tuckernuck and are a best-selling sandal with over 440 reviews and a 4.5 star score (on Tuckernuck). You can find Hermes belts in Clemence Hermes Replica Bags, Box, Epsom and Swift leather-based sorts. Now, the second batch of Hermes belt dupes is sort of totally different. I would say that the above belts are more inspired variations than dupes.

However, if you do not want to promote your bag we advocate bringing it into a Hermes boutique and inquiring in regards to the authenticity of the Hermes bag. Unfortunately, it’s inconceivable to ensure the authenticity of a bag by looking a photos alone. We extremely advocate that you just only purchase Hermes bags from respected sellers who have a historical past of selling genuine and genuine purses. The shape of the bag and the handles are a wonderful indicator of whether the bag is genuine or faux. When standing, the bag ought to be neat and pronounced without any slouching or bulging in locations. The same applies to the handles which ought to stand straight up and down.

That’s one thing that would by no means occur to an unique bag as a outcome of its structure. In addition to the fact that the piping on Hermes baggage would not have such cords replica hermes, it clearly demonstrates poor leather quality. Bags of the French fashion house Hermes may be rightfully considered the most recognizable.

Step into the world of high style without burning a hole in your pocket. Hermes blanket dupes are different blankets that mimic the design intohermes, high quality, and style of the luxurious Hermes blankets but come at a more inexpensive worth point. Finding the best place to buy Hermes blanket dupes is important for guaranteeing quality and worth for your money.

Its key features are the square form, the discrete double handles, and its belt-shaped pull closure. This logo is written in a delicate, clean font that’s unaffected by the leather-based’s texture. It’s a red sign if the writing is excessively giant replica birkin bags, not foiled, or would not match the hardware. To accentuate the brand name, counterfeiters frequently make the stamp very massive and noticeable, so make sure the scale is acceptable. To authenticate the Hermes Constance bag begin by checking the general look method adopted by the material quality.

Every Birkin bag is hand-sewn by a talented artisan (sometimes even a gaggle of artisans), then buffed, painted, and polished, which takes as much as 48 hours to complete. Every detail is crafted to reflect the original Hermès pieces, supplying you with luxury at a fraction of the price. These footwear have the identical curves, sole finish, and higher detailing as original Hermès.

The Final Word Guide To Buying Reproduction Luggage The sandals have a lightly padded footbed, which is a superb characteristic for comfort and regular wear. They can be found at Zappos, and Tuckernuck and are a best-selling sandal with over 440 reviews and a 4.5 star score (on Tuckernuck). You can find Hermes belts in…

Leave a Reply

Your email address will not be published. Required fields are marked *