<?PHP
#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|
#|                                                                        #|
#|         JabboCMS - Website and Content Management System               #|
#|         Copyright © 2011 Jor.dan. All rights reserved.                 #|
#|																		  #|
#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|

include("../global.php");

	if(!session_is_registered(username))
	{
		Redirect("".$url."/index.php");
		exit();
	}
	
	if($user['rank'] < 4) {
	Redirect("".$url."/index.php");
	exit();
	}
	
	if(isset($_POST['titre']) || isset($_POST['desc']) || isset($_POST['image']) || isset($_POST['url'])) {
   $titre = Securise($_POST['titre']);
   $desc = Securise($_POST['desc']);
   $image = Securise($_POST['image']);
   $url = $_POST['url'];
      if($titre != "" && $desc != "" && $image != "" && $url != "") {
      mysql_query("INSERT INTO cms_stafflog (pseudo,action,date) VALUES ('".$user['username']."','Création d\'une Campagne à la une.','".FullDate('full')."')");
	  mysql_query("INSERT INTO cms_une (`titre`,`desc`,`url`,`image`,`auteur`,`date`) VALUES ('".$titre."','".$desc."','".$url."','".$image."','".$user['username']."','".FullDate('full')."')") or die(mysql_error());
	  echo '<div id="ok">La campagne vient d\'&ecirc;tre ajout&eacute;.</div>';
	  } else {
	  echo '<div id="pasok">Merci de remplir les champs vide</div>';
	  }
  }
			
?>
<link href="./template/style.css" rel="stylesheet" type="text/css"><body>
 <p><span class="HEADLINE">Cr&eacute;e un &eacute;v&egrave;nement &agrave; la une.</span><br>
 Ici, tu peux cr&eacute;er des campagnes &agrave; la une pour informer les nouveaut&eacute;s en plus des articles.
 <br>
 <br>
 <form name='editor' method='post' action="?do=credits">
<td width='100' class='tbl'><b>Titre:</b><br></td>
<td width='80%' class='tbl'><input type='text' name='titre' value='' class='text' style='width: 240px'><br></td>
<br>
<td width='100' class='tbl'><b>Description:</b><br></td>
<td width='80%' class='tbl'><input type='text' name='desc' value='' class='text' style='width: 240px'><br></td>
<br>
<td width='100' class='tbl'><b>Image:</b><br></td>
<td width='80%' class='tbl'><input type='text' name='image' value='' class='text' style='width: 240px'><br></td>
<br>
<td width='100' class='tbl'><b>Url:</b><br></td>
<td width='80%' class='tbl'><input type='text' name='url' value='' class='text' style='width: 240px'><br></td>
<tr><br>
<td align='center' colspan='2' class='tbl'>
<input type='submit' name='submit' value='Ex&eacute;cuter' class='submit'></form>
</tr>
<br>
</body>
</html>

</tr>