%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/alliance/domains/sedl.alnetis.fr/public_html/
Upload File :
Create Path :
Current File : /home/alliance/domains/sedl.alnetis.fr/public_html/a-partner-form.php

<?php
include_once("inc/config.php");
include_once("inc/functions.php");
include_once("inc/session.php");
include_once("inc/init.php");

// echo "<pre>";
// print_r($_POST);
// echo "</pre>";
$msg="";
$partnerform = new PartnerForm($connection);

if(!isset($_SESSION['section'])) {
	$_SESSION['section'] = 0;
}
if(!isset($_GET['id'])) {
	$_GET['id'] = $_SESSION['section'];
}
verif_co_sec($connection,$_GET['id'], "admin/partner-form.php");
$ske=false;

//Recuperation des données section
$query = "SELECT * FROM `section` WHERE id = ".$_GET['id'];
if(!$db->isres($query))
{
	if(estadmin()) {
		//header('Location:liste_partner-form.php');
	}
	else {
		include('a-404.php');
		exit(0);
	}
}
$data=$db->select_array($query);
$query = "SELECT * FROM `section_lang` WHERE lang = ".$_SESSION['lang']." AND section = ".$_GET['id'];
$data_lang = $db->select_array($query);
$this_edition=$edition->getCurrentEdition($aff="ins",$_SESSION['lang']);
if($this_edition['id']>=12){
	$parametresGet = http_build_query($_GET);
	$destination = 'partner-form2.php';
	if (!empty($parametresGet)) {
		$destination .= '?' . $parametresGet;
	}
	header('Location: ' . $destination);
	exit;
}
//Recuperation des données partnerform avant envoi
$query = "SELECT * FROM `partnerform` WHERE section = ".$_GET['id']." AND edition = ".$this_edition['id'];
if($db->isres($query)) {
	$form = $db->select_array($query);
} else {
	$form = null;
}

if(isset($_POST['post']) && $_POST['post'] == 1)
{
	// Serialize Detail5a
	  
	// Serialize Editionpart
	if(isset($_POST['editionspart'])) {
		foreach($_POST['editionspart'] as $key => $editionspart) {
			if(!is_numeric($editionspart)) {
				include('a-404.php');
				exit(0);
			}
		}
		$_POST['editionspart'] = serialize($_POST['editionspart']);
	}
	// verifier si c'est un brouillon ou non
	if(isset($_POST['brouillon']) && $_POST['brouillon'] == 1) {
		$submitted = 0;
	} else {
		$submitted = 1;
	}
	
	// Supression des données (CANCEL)
	if(isset($_POST['cancel']) && $_POST['cancel'] == 1) {
		if($form) {
			if($form['submitted'] == 1) {
				// on le repasse en brouillon
				$values = array(
					"submitted" => 0
				);
				$where = "id = ".$form['id'];
				$db->update("partnerform", $values, $where);
			}
			else {
				//suppression des données
				if(isset($form['photo1']) && $form['photo1'] != "") photo_supp($form['photo1']);
				if(isset($form['photo2']) && $form['photo2'] != "") photo_supp($form['photo2']);
				if(isset($form['photo3']) && $form['photo3'] != "") photo_supp($form['photo3']);
				$db->delete("partnerform", "id = ".$form['id']);
				$_POST = null;
			}
		} else {
			$_POST = null;
		}
	} else {
		
		// Vérification des données
		$erreur = false;
		if($submitted) {
			// Champs obligatoires
			$required = array(
				"mayor",
				"address",
				"country",
				//"editionspart",
				"contactperson",
				"name",
				"function",
				"email",
				"question1",
				"question2",
				"question3",
				"question4",
				"question5",
				"question6",
				"question7",
				"question8"
			);
			foreach($required as $fieldname) {
				if(empty($_POST[$fieldname])) $erreur = lang("part_fillup");
			}
		}
		
		// Vérification des photos
		if($_FILES['file_1']['name']!=""){
			$extensions_ok = array('jpg', 'jpeg', 'png', 'gif');
			$typeimages_ok = array(1,2,3);
			if(!$getimagesize = getimagesize($_FILES['file_1']['tmp_name'])) {
				$erreur= $trad->getText("The file is not a valid image");
			}
			// on vérifie le type de l'image
			if( (!in_array( get_extension($_FILES['file_1']['name']), $extensions_ok ))
			   or (!in_array($getimagesize[2], $typeimages_ok )))
			{
				foreach($extensions_ok as $text) { $extensions_string .= $text.', '; }
				$erreur= $trad->getText('Please select a file with this type ').' : '.substr($extensions_string, 0, -2).' !';
			}
		}
		if($_FILES['file_2']['name']!=""){
			$extensions_ok = array('jpg', 'jpeg', 'png', 'gif');
			$typeimages_ok = array(1,2,3);
			if(!$getimagesize = getimagesize($_FILES['file_2']['tmp_name'])) {
				$erreur= $trad->getText("The file is not a valid image");
			}
			// on vérifie le type de l'image
			if( (!in_array( get_extension($_FILES['file_2']['name']), $extensions_ok ))
			   or (!in_array($getimagesize[2], $typeimages_ok )))
			{
				foreach($extensions_ok as $text) { $extensions_string .= $text.', '; }
				$erreur= $trad->getText('Please select a file with this type ').' : '.substr($extensions_string, 0, -2).' !';
			}
		}
		if($_FILES['file_3']['name']!=""){
			$extensions_ok = array('jpg', 'jpeg', 'png', 'gif');
			$typeimages_ok = array(1,2,3);
			if(!$getimagesize = getimagesize($_FILES['file_3']['tmp_name'])) {
				$erreur= $trad->getText("The file is not a valid image");
			}
			// on vérifie le type de l'image
			if( (!in_array( get_extension($_FILES['file_3']['name']), $extensions_ok ))
			   or (!in_array($getimagesize[2], $typeimages_ok )))
			{
				foreach($extensions_ok as $text) { $extensions_string .= $text.', '; }
				$erreur= $trad->getText('Please select a file with this type ').' : '.substr($extensions_string, 0, -2).' !';
			}
		}
		
		if(!$erreur) {
			// Pas d'erreur on envoie les données
			
			// Photos
			if(isset($_FILES['file_1']['name']) && $_FILES['file_1']['name'] != null){
				$_POST['photo1'] = file_move("",$_FILES['file_1']['name'],$_FILES['file_1']['tmp_name']);	
			}
			if(isset($_FILES['file_2']['name']) && $_FILES['file_2']['name'] != null){
				$_POST['photo2'] = file_move("",$_FILES['file_2']['name'],$_FILES['file_2']['tmp_name']);	
			}
			if(isset($_FILES['file_3']['name']) && $_FILES['file_3']['name'] != null){
				$_POST['photo3'] = file_move("",$_FILES['file_3']['name'],$_FILES['file_3']['tmp_name']);	
			}
			if(isset($_POST['supp1']) && $_POST['supp1']) {
				photo_supp($form['photo1']);
				$_POST['photo1'] = null; }
			if(isset($_POST['supp2']) && $_POST['supp2']) {
				photo_supp($form['photo2']);
				$_POST['photo2'] = null; }
			if(isset($_POST['supp3']) && $_POST['supp3']) {
				photo_supp($form['photo3']);
				$_POST['photo3'] = null; }
		
			// création du tableau
			$values = array(
				"section" => $_GET['id'],
				"edition" => $this_edition['id'],
				"lang" => $_SESSION['lang'],
				"submitted" => $submitted,
				"date" => time(),
				"photo1" => $_POST['photo1'],
				"photo2" => $_POST['photo2'],
				"photo3" => $_POST['photo3'],
				"mayor" => $_POST['mayor'],
				"address" => $_POST['address'],
				"country" => $_POST['country'],
				"website" => $_POST['website'],
				"facebook" => $_POST['facebook'],
				//"editionspart" => $_POST['editionspart'],
				"twitter" => $_POST['twitter'],
				"contactperson" => $_POST['contactperson'],
				"name" => $_POST['name'],
				"function" => $_POST['function'],
				"phone" => $_POST['phone'],
				"email" => $_POST['email'],
				"budget" => $_POST['budget'],
				"currency" => $_POST['currency'],
				"question1" => $_POST['question1'],
				"question2" => $_POST['question2'],
				"question3" => $_POST['question3'],
				"question4" => $_POST['question4'],
				"question5" => $_POST['question5'],
				"question6" => $_POST['question6'],
				"question7" => $_POST['question7'],
				"question8" => $_POST['question8'],
				"question9" => $_POST['question9'],
				"question10" => $_POST['question10'],
				"impact" => $_POST['impact'],
				"videos" => $_POST['videos']
			);
			
			if(!$form) {
				// Pas encore de données enregistrées, ajout des données
				$db->insert("partnerform", $values);
				
				$msg='<br/>'.$admtext->getText("conf_partner_form",$_SESSION['lang']);
				
				$message=$admtext->getText("conf_partner_form",$_SESSION['lang']);
				$header = get_temp("templates/newsletter/header_page.php", $url_site);
				$footer = get_temp("templates/newsletter/header_page.php", $url_site);
				$message=$header.$message.$footer;
				
				$subject="=?UTF-8?B?".base64_encode(stripslashes("Confirmation de votre inscription"))."?=";
				$headers= "From: \"SEDL\" <".$email_contact.">\n";
				$headers.='Content-type: text/html; charset=utf-8';
				
				$mail = new PHPMailer();
				$mail->CharSet = 'UTF-8';
				$mail->From = "sedl@octomail.info";
				$mail->FromName = "SEDL";
				$mail->addReplyTo($email_contact);
				$mail->Subject =$subject;
				$mail->MsgHTML($message);

				$mail->IsSMTP(); // telling the class to use SMTP
				$mail->SMTPDebug  = 0;                     // enables SMTP debug information (for testing)
				$mail->SMTPAuth   = true;                  // enable SMTP authentication
				$mail->Host       = "smtp.octomail.info"; // sets the SMTP server
				$mail->Port       = 587;                    // set the SMTP port for the GMAIL server
				$mail->Username   = "sedl@octomail.info"; // SMTP account username
				$mail->Password   = "2UFvaB1eqj5QeQv8";   
				$mail->MsgHTML($message);
				
				$mail->AddAddress($_POST['email']);
				$mail->AddCC($email_contact);
				
				$mail->Send();
				$mail->ClearAddresses();
				
				
					
			} else {
				// On modifie les données
				$where = "id = ".$form['id'];
				$db->update("partnerform", $values, $where);
			}
		}
	}
}

//Recuperation des données
$query = "SELECT * FROM `partnerform` WHERE section = ".$_GET['id']." AND edition = ".$this_edition['id'];

if($db->isres($query)) {
	$form = $db->select_array($query);
	if(!isset($_POST['photo1'])) $_POST['photo1'] = $form['photo1'];
	if(!isset($_POST['photo2'])) $_POST['photo2'] = $form['photo2'];
	if(!isset($_POST['photo3'])) $_POST['photo3'] = $form['photo3'];
	if(!isset($_POST['mayor'])) $_POST['mayor'] = $form['mayor'];
	if(!isset($_POST['address'])) $_POST['address'] = $form['address'];
	if(!isset($_POST['country'])) $_POST['country'] = $form['country'];
	if(!isset($_POST['website'])) $_POST['website'] = $form['website'];
	if(!isset($_POST['facebook'])) $_POST['facebook'] = $form['facebook'];
	if(!isset($_POST['twitter'])) $_POST['twitter'] = $form['twitter'];
	//if(!isset($_POST['editionspart'])) $_POST['editionspart'] = $form['editionspart'];
	if(!isset($_POST['contactperson'])) $_POST['contactperson'] = $form['contactperson'];
	if(!isset($_POST['name'])) $_POST['name'] = $form['name'];
	if(!isset($_POST['function'])) $_POST['function'] = $form['function'];
	if(!isset($_POST['phone'])) $_POST['phone'] = $form['phone'];
	if(!isset($_POST['email'])) $_POST['email'] = $form['email'];
	if(!isset($_POST['detail1'])) $_POST['detail1'] = $form['detail1'];
	if(!isset($_POST['detail2'])) $_POST['detail2'] = $form['detail2'];
	if(!isset($_POST['detail3'])) $_POST['detail3'] = $form['detail3'];
	if(!isset($_POST['detail4'])) $_POST['detail4'] = $form['detail4'];
	if(!isset($_POST['budget'])) $_POST['budget'] = $form['budget'];
	if(!isset($_POST['currency'])) $_POST['currency'] = $form['currency'];
	if(!isset($_POST['detail5a'])) $_POST['detail5a'] = $form['detail5a'];
	if(!isset($_POST['detail5b'])) $_POST['detail5b'] = $form['detail5b'];
	if(!isset($_POST['detail6a'])) $_POST['detail6a'] = $form['detail6a'];
	if(!isset($_POST['detail6b'])) $_POST['detail6b'] = $form['detail6b'];
	if(!isset($_POST['detail6c'])) $_POST['detail6c'] = $form['detail6c'];
	if(!isset($_POST['detail6d'])) $_POST['detail6d'] = $form['detail6d'];
	if(!isset($_POST['videos'])) $_POST['videos'] = $form['videos'];
} else {
	$form = null;
	if(!isset($_POST['country'])) $_POST['country'] = $data['pays'];
}

//affichage du html
include("theme/html.php");
//affichage des metas
include("theme/meta.php");
echo "\n<title>".lang("part_titre")." - ".$info_titresite."</title>\n";
//affichage du header
$pagesection=true;
$sectionid=$_GET['id'];
if(estadmin()) include("theme/header_admin.php");
else include("theme/header_redacteur.php");

$this_edition=$edition->getCurrentEdition($aff="ins",$_SESSION['lang']);


?>

<div class="text_admin partnerform">
<h1><?=lang("part_titre");?></h1>

<?php
if($partnerform->is_active()) {
?>

<?php
if(isset($form['submitted']) && $form['submitted'] != 1) {
?>
<p class="infobloc"><?=lang("part_notsubmitted");?></p>
<?php
}
if(isset($form['submitted']) && $form['submitted'] == 1) {
?>
<p class="infobloc"><?=lang("part_submitted");?><?=$msg?></p>
<?php
}
if(isset($erreur) && $erreur) {
	echo "<p class=\"erreurbloc\">".$erreur."</p>";
}
?>

<?=lang("part_desc");?>

<form action="admin/partner-form.php?id=<?php echo $_GET['id']; ?>" enctype="multipart/form-data" method="post" class="form">
	<h2><?=lang("part_titre1");?></h2>
	<div class="ligne">
		<div class="plabel"><?=lang("part_mayor");?>&nbsp;<span class="etoile">*</span></div>
		<div class="field"><input type="text" name="mayor" value="<?php if(isset($_POST['mayor'])) echo $_POST['mayor']; ?>" /></div>
	</div>
	<div class="ligne" >
		<div class="plabel"><?=lang("part_address");?>&nbsp;<span class="etoile">*</span></div>
		<div class="field"><textarea name="address" size="3"><?php if(isset($_POST['address'])) echo strip_tags(html_entity_decode($_POST['address']));?></textarea>
		<!--<div class="limitres"><span class="res"></span> <?=lang("restant");?></div></div>-->
	</div>
	<div class="ligne">
		<div class="plabel"><?=lang("part_country");?>&nbsp;<span class="etoile">*</span></div>
		<div class="field">
			<select name="country">
				<?=$pays->getCountry($lang->getlangid(),$_POST['country'])?>
			</select>
		</div>
	</div>
	<div class="ligne">
		<div class="plabel"><?=lang("part_website");?></div>
		<div class="field"><input type="text" name="website" value="<?php if(isset($_POST['website'])) echo $_POST['website']; ?>" /></div>
	</div>
	<div class="ligne">
		<div class="plabel"><?=lang("part_facebook");?></div>
		<div class="field"><input type="text" name="facebook" value="<?php if(isset($_POST['facebook'])) echo $_POST['facebook']; ?>" /></div>
	</div>
	<div class="ligne">
		<div class="plabel"><?=lang("part_twitter");?></div>
		<div class="field"><input type="text" name="twitter" value="<?php if(isset($_POST['twitter'])) echo $_POST['twitter']; ?>" /></div>
	</div>
	<div class="ligne">
		<div class="plabel"><?=lang("part_contactperson");?>&nbsp;<span class="etoile">*</span></div>
		<div class="field"><input type="text" name="contactperson" value="<?php if(isset($_POST['contactperson'])) echo $_POST['contactperson']; ?>" /></div>
	</div>
	<div class="ligne">
		<div class="plabel"><?=lang("part_name");?>&nbsp;<span class="etoile">*</span></div>
		<div class="field"><input type="text" name="name" value="<?php if(isset($_POST['name'])) echo $_POST['name']; ?>" /></div>
	</div>
	<div class="ligne">
		<div class="plabel"><?=lang("part_function");?>&nbsp;<span class="etoile">*</span></div>
		<div class="field"><input type="text" name="function" value="<?php if(isset($_POST['function'])) echo $_POST['function']; ?>" /></div>
	</div>
	<div class="ligne">
		<div class="plabel"><?=lang("part_phone");?></div>
		<div class="field"><input type="text" name="phone" value="<?php if(isset($_POST['phone'])) echo $_POST['phone']; ?>" /></div>
	</div>
	<div class="ligne">
		<div class="plabel"><?=lang("part_email");?>&nbsp;<span class="etoile">*</span></div>
		<div class="field"><input type="text" name="email" value="<?php if(isset($_POST['email'])) echo $_POST['email']; ?>" /></div>
	</div>
	<h2><?=lang("part_titre2");?></h2>
	<div class="ligne ">
		<h3 class="plabel"><?=lang("part_stitre1");?>&nbsp;<span class="etoile">*</span></h3>
		<div class="pdesc"><?=lang("part_stitre1desc");?></div>
		<div class="field"><textarea name="detail1"><?php if(isset($_POST['detail1'])) echo strip_tags(html_entity_decode($_POST['detail1']));?></textarea>
		<!--<div class="limitres"><span class="res"></span> <?=lang("restant");?></div></div>-->
	</div>
	<div class="ligne ">
		<h3 class="plabel"><?=lang("part_stitre2");?>&nbsp;<span class="etoile">*</span></h3>
		<div class="pdesc"><?=lang("part_stitre2desc");?></div>
		<div class="field"><textarea name="detail2"><?php if(isset($_POST['detail2'])) echo strip_tags(html_entity_decode($_POST['detail2']));?></textarea>
		<!--<div class="limitres"><span class="res"></span> <?=lang("restant");?></div></div>-->
	</div>
	<div class="ligne ">
		<h3 class="plabel"><?=lang("part_stitre3");?>&nbsp;<span class="etoile">*</span></h3>
		<div class="field"><textarea name="detail3"><?php if(isset($_POST['detail3'])) echo strip_tags(html_entity_decode($_POST['detail3']));?></textarea>
		<!--<div class="limitres"><span class="res"></span> <?=lang("restant");?></div></div>-->
		
	</div>
	<div class="ligne">
		<h3 class="plabel"><?=lang("part_stitre3");?>&nbsp;<span class="etoile">*</span></h3>
		<div class="field"><input type="number" name="budget" value="<?php if(isset($_POST['budget'])) echo $_POST['budget']; ?>" /></div>
		<div class="field">	
			<select name="currency">
				<option <?=(isset($_POST['currency']) && $_POST['currency']=="€")?'selected="selected"':''?> value="€">€</option>
				<option <?=(isset($_POST['currency']) && $_POST['currency']=="TL")?'selected="selected"':''?> value="TL">TL</option>
				<option <?=(isset($_POST['currency']) && $_POST['currency']=="UAH")?'selected="selected"':''?> value="UAH">UAH</option>
			</select>
		</div>
	</div>
	<div class="ligne ">
		<h3 class="plabel"><?=lang("part_stitre4");?>&nbsp;<span class="etoile">*</span></h3>
		<div class="field"><textarea name="detail4"><?php if(isset($_POST['detail4'])) echo strip_tags(html_entity_decode($_POST['detail4']));?></textarea>
		<!--<div class="limitres"><span class="res"></span> <?=lang("restant");?></div></div>-->
	</div>
	<div class="ligne">
		<h3><?=lang("part_stitre5");?></h3>
		<div class="plabel"><?=lang("part_detail5a");?>&nbsp;<span class="etoile">*</span></div>
		<div class="field">
<?php
if(isset($_POST['detail5a']) && $_POST['detail5a'] != "")
{
	$_POST['detail5a'] = unserialize(strip_tags(html_entity_decode($_POST['detail5a'])));
}
?>
			<div><label><input type="checkbox" name="detail5a[0]" value="1"<?php if(isset($_POST['detail5a'][0]) && $_POST['detail5a'][0] =="1") echo ' checked'; ?> /> <?=lang("part_detail5a0");?></label></div>
			<div><label><input type="checkbox" name="detail5a[1]" value="1"<?php if(isset($_POST['detail5a'][1]) && $_POST['detail5a'][1] =="1") echo ' checked'; ?> /> <?=lang("part_detail5a1");?></label></div>
			<div><label><input type="checkbox" name="detail5a[2]" value="1"<?php if(isset($_POST['detail5a'][2]) && $_POST['detail5a'][2] =="1") echo ' checked'; ?> /> <?=lang("part_detail5a2");?></label></div>
		</div>
	</div>
	<div class="ligne ">
		<div class="plabel"><?=lang("part_detail5b");?>&nbsp;<span class="etoile">*</span></div>
		<div class="field"><textarea name="detail5b"><?php if(isset($_POST['detail5b'])) echo strip_tags(html_entity_decode($_POST['detail5b']));?></textarea>
		<!--<div class="limitres"><span class="res"></span> <?=lang("restant");?></div></div>-->
	</div>
	<div class="ligne ">
		<h3><?=lang("part_stitre6");?></h3>
		<div class="plabel"><?=lang("part_detail6a");?>&nbsp;<span class="etoile">*</span></div>
		<div class="field"><textarea name="detail6a"><?php if(isset($_POST['detail6a'])) echo strip_tags(html_entity_decode($_POST['detail6a']));?></textarea>
		<!--<div class="limitres"><span class="res"></span> <?=lang("restant");?></div></div>-->
	</div>
	<div class="ligne ">
		<div class="plabel"><?=lang("part_detail6b");?></div>
		<div class="field"><textarea name="detail6b"><?php if(isset($_POST['detail6b'])) echo strip_tags(html_entity_decode($_POST['detail6b']));?></textarea>
		<!--<div class="limitres"><span class="res"></span> <?=lang("restant");?></div></div>-->
	</div>
	<div class="ligne ">
		<div class="plabel"><?=lang("part_detail6c");?></div>
		<div class="field"><textarea name="detail6c"><?php if(isset($_POST['detail6c'])) echo strip_tags(html_entity_decode($_POST['detail6c']));?></textarea>
		<!--<div class="limitres"><span class="res"></span> <?=lang("restant");?></div></div>-->
	</div>
	<div class="ligne ">
		<div class="plabel"><?=lang("part_detail6d");?></div>
		<div class="field"><textarea name="detail6d"><?php if(isset($_POST['detail6d'])) echo strip_tags(html_entity_decode($_POST['detail6d']));?></textarea>
		<!--<div class="limitres"><span class="res"></span> <?=lang("restant");?></div></div>-->
	</div>
	<h3><?=lang("part_photos");?></h3>
	<div class="ligne">
		<div class="plabel top"><?=$admtext->getText("picture",$_SESSION['lang'])?> n°1</div>
		<div class="field"><input type="file" name="file_1" id="file_1" /><?php if($_POST['photo1']) echo '<div class="uploadifyQueueItem completed"><div class="cancel"><input type="checkbox" class="radio supphoto" name="supp1" id="supp1"> <label for="supp1">Supprimer</label></div><a href="uploads/'.$_POST['photo1'].'" class="zoom">'.$_POST['photo1'].'</a></div> '; ?></div>
		<div class="field"><input type="hidden" name="photo1" id="photo1" value="<?php echo $_POST['photo1']; ?>" /></div>
	</div>
		<div class="ligne">
		<div class="plabel top"><?=$admtext->getText("picture",$_SESSION['lang'])?> n°2</div>
		<div class="field"><input type="file" name="file_2" id="file_2" /><?php if($_POST['photo2']) echo '<div class="uploadifyQueueItem completed"><div class="cancel"><input type="checkbox" class="radio supphoto" name="supp2" id="supp2"> <label for="supp2">Supprimer</label></div><a href="uploads/'.$_POST['photo2'].'" class="zoom">'.$_POST['photo2'].'</a></div> '; ?></div>
		<div class="field"><input type="hidden" name="photo2" id="photo2" value="<?php echo $_POST['photo2']; ?>" /></div>
	</div>
		<div class="ligne">
		<div class="plabel top"><?=$admtext->getText("picture",$_SESSION['lang'])?> n°3</div>
		<div class="field"><input type="file" name="file_3" id="file_3" /><?php if($_POST['photo3']) echo '<div class="uploadifyQueueItem completed"><div class="cancel"><input type="checkbox" class="radio supphoto" name="supp3" id="supp3"> <label for="supp3">Supprimer</label></div><a href="uploads/'.$_POST['photo3'].'" class="zoom">'.$_POST['photo3'].'</a></div> '; ?></div>
		<div class="field"><input type="hidden" name="photo3" id="photo3" value="<?php echo $_POST['photo3']; ?>" /></div>
	</div>
	<div class="ligne">
		<div class="plabel top"> </div>
		<div class="field" colspan="2"><?=$admtext->getText("avert_responsable",$_SESSION['lang'])?></div>
	</div>
	<div class="ligne ">
		<h3 class="plabel"><?=lang("part_videos");?></h3>
		<div class="field"><textarea name="videos"><?php if(isset($_POST['videos'])) echo strip_tags(html_entity_decode($_POST['videos']));?></textarea>
		<!--<div class="limitres"><span class="res"></span> <?=lang("restant");?></div></div>-->
	</div>
	<input type="hidden" name="post" id="input_post" value="1" />
	<input type="hidden" name="brouillon" id="input_brouillon" value="0" />
	<input type="hidden" name="cancel" id="input_cancel" value="0" />
	<div class="bouton_admin flexcontent">
<?php
if(!(isset($form['submitted']) && $form['submitted'] == 1)) {
?>
		<input type="submit" class="bouton" id="submit_bouton" value="<?=lang("part_submit");?>" />
		<button class="bouton" id="brouillon_bouton"><?=lang("part_save");?></button>
		<button class="bouton confirm" id="cancel_bouton"><?=lang("part_cancel");?></button>
<?php
} else {
	if(estadmin()) { ?>
		<button class="bouton confirm" id="cancel_bouton"><?=lang("part_cancel");?></button>
<?php
	}
}
?>
	</div>
	<div><small><span class="etoile">*</span> <?=lang("part_mandatory");?></small></div>
</form>
</div>

<?php
if(isset($form['submitted']) && $form['submitted'] == 1) {
?>
<script type="text/javascript">
	$('.form input').prop( "disabled", true );
	$('.form textarea').prop( "disabled", true );
	$('.form select').prop( "disabled", true );
	$('#input_cancel').prop( "disabled", false );
	$('#input_post').prop( "disabled", false );
</script>
<?php
}
?>
<script type="text/javascript">
	function countWords(tx){
	  return tx.replace(/\w+/g,"x").replace(/[^x]+/g,"").length;
	}
	$('.').each(function() {
		var	textarea = $(this).find('textarea'),
			res = $(this).find('.res');
			set = 300;
		if($(this).attr('data-limit')) var set = $(this).attr('data-limit');
		textarea.keyup(function(e) {
			var tval = textarea.val(),
				tlength = countWords(textarea.val()),
				remain = parseInt(set - (tlength));
			if (remain <= 0) {
				var trimmed = textarea.val().split(/\s+/, 300).join(" ");
				textarea.val(trimmed);
				remain = 0;
			}
			res.text(remain);
		});
		textarea.change(function() {
			var	textarea = $(this);
			var tval = textarea.val(),
				tlength = countWords(textarea.val()),
				remain = parseInt(set - tlength);
			if (remain <= 0) {
				var trimmed = $(this).val().split(/\s+/, 300).join(" ");
				$(this).val(trimmed);
				remain = 0;
			}
			res.text(remain);
		});
		res.text(parseInt(set - countWords(textarea.val())));
	});
	
	$('#brouillon_bouton').click(function(e) {
		e.preventDefault();
		$('#input_brouillon').val(1);
		$('.form').submit();
	});
	
	$('#cancel_bouton').click(function(e) {
		e.preventDefault();
		$('#input_cancel').val(1);
		$('#input_cancel').val(1);
		$('.form').submit();
	});
</script>

<?php } else {
$datesplit = explode('-', $this_edition['date_debut']);
$annee = $datesplit['0'];
?>

<p><?=lang("part_closed1");?> <?=$annee;?> <?=lang("part_closed2");?></p>

<?

}

//affichage du footer
include("theme/footer.php");

?>

Zerion Mini Shell 1.0