%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/alliance/domains/sedl.alnetis.fr/public_html/inc/classes/
Upload File :
Create Path :
Current File : /home/alliance/domains/sedl.alnetis.fr/public_html/inc/classes/PartnerForm.php

<?php

class PartnerForm extends Load {

	var $bd;
	var $language;
	var $sect;
	var $nom_table="partnerform";


	function __construct($connection) {
		parent::__construct();
		$this->clef_primaire='id_'.$this->nom_table;
		$this->bd = new BaseOps($connection);
		$this->language = new Lang($connection);
		$this->sect = new Section($connection);
	}

	
	function is_active() {
		$query = "SELECT * FROM `partnerform_config` WHERE config = 'active'";
		$data = $this->bd->select_array($query);
		return ($data['value'] == 1);
	}
	
	// Liste des des réponses du formulaire
	function liste_forms($edition=false, $submitted=false, $country=false, $limit=false, $debut=0, $brouillon=false)
	{
		$query = "SELECT * FROM `partnerform` WHERE 1=1";
		if($edition)
		{
			$query .= " AND edition = ".$edition;
		}
		if($submitted)
		{
			$query .= " AND submitted = 1";
		}
		if($brouillon)
		{
			$query .= " AND submitted = 0";
		}
		if($country)
		{
			$query .= " AND country = ".$country;
		}
		$query .= " ORDER BY date DESC,id DESC";
		if($limit)
		{
			$query .= " LIMIT ".$debut.",".$limit;
		}
		if($this->bd->isres($query))
		{
			$result = $this->bd->q($query);
			$nb = 0;
			while( $data = mysqli_fetch_assoc($result)) {
				$res[$nb] = array (
					'id' => $data['id'],
					'section' => $data['section'],
					'edition' => $data['edition'],
					'lang' => $data['lang'],
					'submitted' => $data['submitted'],
					'date' =>  $data['date'],
					'photo1' => $data['photo1'],
					'photo2' => $data['photo2'],
					'photo3' => $data['photo3'],
					'mayor' => $data['mayor'],
					'address' => $data['address'],
					'country' => $data['country'],
					'website' => $data['website'],
					'facebook' => $data['facebook'],
					'twitter' => $data['twitter'],
					'editionspart' => $data['editionspart'],
					'contactperson' => $data['contactperson'],
					'name' => $data['name'],
					'function' => $data['function'],
					'phone' => $data['phone'],
					'email' => $data['email'],
					'detail1' => $data['detail1'],
					'detail2' => $data['detail2'],
					'detail3' => $data['detail3'],
					'detail4' => $data['detail4'],
					'detail5a' => $data['detail5a'],
					'detail5b' => $data['detail5b'],
					'detail6a' => $data['detail6a'],
					'detail6b' => $data['detail6b'],
					'detail6c' => $data['detail6c'],
					'detail6d' => $data['detail6d'],
					'videos' => $data['videos']
					);
				$nb++;
			}
			return $res;
		}
		else {
			return null;
		}
	}
}

?>

Zerion Mini Shell 1.0