<commit_before><?php
class Customers extends Users {
	private $usual_fields;
	public function __construct(){
		parent::__construct();
		$this->usual_fields = array("id_user", "cont_person", "phones", "discount", "id_contragent", "id_city",
									"id_delivery", "bonus_card", "bonus_balance", "bonus_discount", "balance",
									"sex", "birthday", "address_ur", "b_year", "b_month", "b_day");
	}
	// Покупатель по id
	public function SetFieldsById($id, $all = 0){
		global $User;
		$User->SetFieldsById($id, $all);
		$sql = "SELECT *
			FROM  "._DB_PREFIX_."customer
			WHERE id_user = ".$id;
		if(!$this->fields = $this->db->GetOneRowArray($sql)){
			return false;
		}
		return $this->fields;
	}

	public function SetList($email_klient){
		$sql = "SELECT u.name, u.id_user, cu.cont_person, cu.phones
			FROM "._DB_PREFIX_."user u, "._DB_PREFIX_."customer cu
			WHERE email  LIKE \"%$email_klient%\"
			AND cu.id_user = u.id_user
			ORDER BY name";
		$kl=$this->db->GetArray($sql);
		return $kl;
	}

	//Получение списка избранных товаров
	public function GetListFavorites($id_user){
		$sql = "SELECT f.id_product, p.art, p.name,p.translit , p.img_1,
			p.price_opt, p.price_mopt
			FROM "._DB_PREFIX_."favorites AS f
			LEFT JOIN "._DB_PREFIX_."product AS p
				ON f.id_product = p.id_product
			WHERE f.id_user = '".$id_user."'
			ORDER BY id_favorite";
		if(!$arr = $this->db->GetArray($sql)){
			return false;
		}
		foreach($arr as &$value){
			$products = new Products();
			$value['images'] = $products->GetPhotoById($value['id_product']);
		}
		return $arr;
	}

	//Добавление Избранного товара
	public function AddFavorite($id_user, $id_product){
		$f['id_user'] = $id_user;
		$f['id_product'] = $id_product;
		$this->db->StartTrans();
		if(!$this->db->Insert(_DB_PREFIX_.'favorites', $f)){
			$this->db->FailTrans();
			G::DieLoger("SQL error - $sql");
			return false;
		}
		$this->db->CompleteTrans();
		return true;
	}

	//Удаление Избранного товара
	public function DelFavorite($id_user, $id_product){
		$sql = "DELETE FROM "._DB_PREFIX_."favorites
			WHERE id_user = '".$id_user."'
			AND id_product = '".$id_product."'";
		$this->db->StartTrans();
		if(!$this->db->Query($sql)){
			$this->db->FailTrans();
			G::DieLoger("SQL error - $sql");
			return false;
		}
		$this->db->CompleteTrans();
		return true;
	}
	//Получение списка ожидания
	public function GetWaitingList($id_user){
		$sql = "SELECT wl.id_product, p.art, p.name, p.translit , p.img_1,
			p.price_opt, p.price_mopt, p.old_price_opt
			FROM "._DB_PREFIX_."waiting_list AS wl
			LEFT JOIN "._DB_PREFIX_."product AS p
				ON wl.id_product = p.id_product
			WHERE wl.id_user = '".$id_user."'
			ORDER BY id_followprice";
		if(!$arr = $this->db->GetArray($sql)){
			return false;
		}
		foreach($arr as &$value){
			$products = new Products();
			$value['images'] = $products->GetPhotoById($value['id_product']);
		}
		return $arr;
	}
<commit_msg>Избранное, Список ожидания - (исправлена ошибка php)<commit_after><?php
class Customers extends Users {
	private $usual_fields;
	public function __construct(){
		parent::__construct();
		$this->usual_fields = array("id_user", "cont_person", "phones", "discount", "id_contragent", "id_city",
									"id_delivery", "bonus_card", "bonus_balance", "bonus_discount", "balance",
									"sex", "birthday", "address_ur", "b_year", "b_month", "b_day");
	}
	// Покупатель по id
	public function SetFieldsById($id, $all = 0){
		global $User;
		$User->SetFieldsById($id, $all);
		$sql = "SELECT *
			FROM  "._DB_PREFIX_."customer
			WHERE id_user = ".$id;
		if(!$this->fields = $this->db->GetOneRowArray($sql)){
			return false;
		}
		return $this->fields;
	}

	public function SetList($email_klient){
		$sql = "SELECT u.name, u.id_user, cu.cont_person, cu.phones
			FROM "._DB_PREFIX_."user u, "._DB_PREFIX_."customer cu
			WHERE email  LIKE \"%$email_klient%\"
			AND cu.id_user = u.id_user
			ORDER BY name";
		$kl=$this->db->GetArray($sql);
		return $kl;
	}

	//Получение списка избранных товаров
	public function GetListFavorites($id_user){
		$sql = "SELECT f.id_product, p.art, p.name,p.translit , p.img_1,
			p.price_opt, p.price_mopt
			FROM "._DB_PREFIX_."favorites AS f
			LEFT JOIN "._DB_PREFIX_."product AS p
				ON f.id_product = p.id_product
			WHERE f.id_user = '".$id_user."'
			ORDER BY f.id_product";
		if(!$arr = $this->db->GetArray($sql)){
			return false;
		}
		foreach($arr as &$value){
			$products = new Products();
			$value['images'] = $products->GetPhotoById($value['id_product']);
		}
		return $arr;
	}

	//Добавление Избранного товара
	public function AddFavorite($id_user, $id_product){
		$f['id_user'] = $id_user;
		$f['id_product'] = $id_product;
		$this->db->StartTrans();
		if(!$this->db->Insert(_DB_PREFIX_.'favorites', $f)){
			$this->db->FailTrans();
			G::DieLoger("SQL error - $sql");
			return false;
		}
		$this->db->CompleteTrans();
		return true;
	}

	//Удаление Избранного товара
	public function DelFavorite($id_user, $id_product){
		$sql = "DELETE FROM "._DB_PREFIX_."favorites
			WHERE id_user = '".$id_user."'
			AND id_product = '".$id_product."'";
		$this->db->StartTrans();
		if(!$this->db->Query($sql)){
			$this->db->FailTrans();
			G::DieLoger("SQL error - $sql");
			return false;
		}
		$this->db->CompleteTrans();
		return true;
	}
	//Получение списка ожидания
	public function GetWaitingList($id_user){
		$sql = "SELECT wl.id_product, p.art, p.name, p.translit , p.img_1,
			p.price_opt, p.price_mopt, p.old_price_opt
			FROM "._DB_PREFIX_."waiting_list AS wl
			LEFT JOIN "._DB_PREFIX_."product AS p
				ON wl.id_product = p.id_product
			WHERE wl.id_user = '".$id_user."'
			ORDER BY wl.id_product";
		if(!$arr = $this->db->GetArray($sql)){
			return false;
		}
		foreach($arr as &$value){
			$products = new Products();
			$value['images'] = $products->GetPhotoById($value['id_product']);
		}
		return $arr;
	}

{'fraction_non_alphanumeric': 0.17903855953796502, 'fraction_numerical': 0.0010191948360794973, 'mean_word_length': 3.981387478849408, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '787680', 'n_tokens_mistral': 2535, 'n_tokens_neox': 2274, 'n_words': 459}