<?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['sujet']) || isset($_POST['question']) || isset($_POST['article']) || isset($_POST['auteur'])) {
   $sujet = Securise($_POST['sujet']);
   $question = Securise($_POST['question']);
   $article = $_POST['article'];
   $auteur = Securise($_POST['auteur']);
      if($sujet != "" && $question != "" && $auteur != "" && $article != "") {
		
	  mysql_query("INSERT INTO cms_help (sujet,question,article,auteur,date) VALUES ('".$sujet."','".$question."','".addslashes($article)."','".$auteur."','".FullDate('full')."')") or die(mysql_error());
	  mysql_query("INSERT INTO cms_stafflog (pseudo,action,date) VALUES ('".$user['username']."','Création d\'une Question Fréquente','".FullDate('full')."')");
	  echo '<div id="ok">La question fr&eacute;quente 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 une Question Fr&eacute;quente</span><br>
 <script type="text/javascript" src="editeur_html/jscripts/tiny_mce/tiny_mce.js"></script>
 <script type="text/javascript">
	tinyMCE.init({
		// General options
		mode : "textareas",
		theme : "advanced",
		skin : "o2k7",
		plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",

		// Theme options
		theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
		theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,

		// Example word content CSS (should be your site CSS) this one removes paragraph margins
		content_css : "css/word.css",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "editeur_html/lists/template_list.js",
		external_link_list_url : "editeur_html/lists/link_list.js",
		external_image_list_url : "editeur_html/lists/image_list.js",
		media_external_list_url : "editeur_html/lists/media_list.js",

		// Replace values for the template plugin
		template_replace_values : {
			username : "Some User",
			staffid : "991234"
		}
	});
	</script><br>
 <form name='editor' method='post' action="?do=credits">
<td width='100' class='tbl'><b>Sujet:</b><br></td>
<td width='80%' class='tbl'><input type='text' name='sujet' value='' class='text' style='width: 240px'><br></td>
<br>
<td width='100' class='tbl'><b>Question:</b><br></td>
<td width='80%' class='tbl'><input type='text' name='question' value='' class='text' style='width: 240px'><br></td>
<br>
<td width='100' class='tbl'><b>Article:</b><br></td>
<td width='80%' class='tbl'><textarea name='article' wrap="discuss rows=12 cols=154" ></textarea><br></td>
<tr>
<td width='100' class='tbl'><b>Auteur:</b><br></td>
<td width='80%' class='tbl'><input type='text' name='auteur' value='' class='text' style='width: 240px'><br></td>
<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>