Skip to content
admin_edito.php 6.78 KiB
Newer Older
Seblu's avatar
Seblu committed
<?php

function dispAdminEdito () {

if ($_SESSION["user_right"] < $GLOBALS["EPTV"] )
{
	return("T'es ouf");
}


$result = getAllEdito();


$str = '

<table width="80%" border="0" cellspacing="0" cellpadding="0">
	<tr>
	<td bgcolor="#000000">
	<table width="100%" border="0" cellspacing="1" cellpadding="2">
		<tr>
		<td>
			<b>
			<font class="titre_rubrique">
			&nbsp;e d i t o&nbsp;
			</font>
Seblu's avatar
Seblu committed
			</b>
Seblu's avatar
Seblu committed
		</td>
		</tr>

		<tr>
		<td>
Seblu's avatar
Seblu committed
			<FORM name="new_edito" method="post" action="index.php?html=AdminHome&section_admin=AdminAddEdito">
Seblu's avatar
Seblu committed
			<INPUT class="button" TYPE="submit" NAME="action" VALUE="  NOUVEL EDITO  "><BR> </TD>
			</FORM>
		</td>
		</tr>
Seblu's avatar
Seblu committed
		<tr>
Seblu's avatar
Seblu committed
		<td bgcolor="#303030">
Seblu's avatar
Seblu committed
		<table cellpadding="2" cellspacing="2" width="100%">
			<tr>
			<td>
			<table width="100%" border="0" cellspacing="2" cellpadding="2">
				';

					while ($edito = mysql_fetch_array($result)) {

						$result_user = getOneUserById($edito["edito_id_user"]);
						$member = mysql_fetch_array($result_user);

						$edito_id = $edito["edito_id"];

	$str .=	'
							<tr><td>
								<font class="texte_date">
								'.$edito["edito_date"].'
								</font>
								par: '
								.$member["user_pseudo"].
							'</td></tr>
Seblu's avatar
Seblu committed
							<tr><td>
								<font class="texte_normal">
								<b>'
								.$edito["edito_title"].
								'</b>
							</td></tr>

							<td width=60%>
								<font class="texte_normal">
								<small>'
								.$edito["edito_comment"].
								'</small>
							</td>
Seblu's avatar
Seblu committed
							<TD width=10% align=right>
Seblu's avatar
Seblu committed
								<FORM name="update_edito" method="post" action="index.php?html=AdminHome&section_admin=AdminModifEdito&edito_id='.$edito_id.'">
								<INPUT class="button" TYPE="submit" NAME="action" VALUE="  MODIFIER  ">
Seblu's avatar
Seblu committed
								</FORM>
Seblu's avatar
Seblu committed

								<FORM name="supp_edito" method="post" action="index.php?html=AdminHome&section_admin=AdminDelEdito&edito_id='.$edito_id.'">
Seblu's avatar
Seblu committed
								<INPUT class="button" TYPE="submit" NAME="action" VALUE="  SUPPRIMER  ">
Seblu's avatar
Seblu committed
								</FORM>
Seblu's avatar
Seblu committed
							</TD>
							</tr>
	';
Seblu's avatar
Seblu committed
	$str .= '
							<tr>
							<TD> <hr width="90%"> </TD>
							</tr>
Seblu's avatar
Seblu committed
					}


	$str .= '
			</table>
			</td>
			</tr>
		</table>
		</td>
		</tr>
	</table>
	</td>
	</tr>
</table>
';


return $str;

}


function dispAdminAddEdito () {

 $date = get_date();

Seblu's avatar
Seblu committed
 $str = '
Seblu's avatar
Seblu committed
<table width="80%" border="0" cellspacing="0" cellpadding="0">
	<tr>
	<td bgcolor="#000000">
	<table width="100%" border="0" cellspacing="1" cellpadding="2">
		<tr>
		<td>
			<b>
			<font color="#ffffff">
			&nbsp a d d &nbsp e d i t o &nbsp t o &nbsp d a t a b a s e
			</font>
Seblu's avatar
Seblu committed
			</b>
Seblu's avatar
Seblu committed
		</td>
Seblu's avatar
Seblu committed
		</tr>
Seblu's avatar
Seblu committed
	<tr>
Seblu's avatar
Seblu committed
	<td bgcolor="#303030">
Seblu's avatar
Seblu committed
	<table cellpadding="0" cellspacing="0" width="100%">
Seblu's avatar
Seblu committed
		<tr>
		    <form name="saisie" method="post" action="index.php?html=AdminHome&section_admin=AddEdito&edito_id='.$edito_id.'">
Seblu's avatar
Seblu committed
		    <TABLE CELLSPACING="0" CELLPADDING="10" BORDER="0">
Seblu's avatar
Seblu committed
			    <TR><TD> Titre: </TD>
			    <TD> <INPUT TYPE="text" NAME="edito_get_title" VALUE="" SIZE="50" MAXLENGTH="52"> </TD>
			    </TR>
Seblu's avatar
Seblu committed
			    <TR><TD> Date: </TD>
			    <TD> <INPUT TYPE="text" NAME="edito_get_date" VALUE="'.$date.'" SIZE="8" MAXLENGTH="10"> </TD>
			    </TR>

			    <TR><TD>Edito: </TD>
			    <TD>
			    <TEXTAREA rows="12" cols="38" name="edito_get_comment" ONFOCUS=""></textarea>
			    </TD>
			    </TR>
Seblu's avatar
Seblu committed
			    <TR>
				    <TD> </TD>
				    <TD> <INPUT class="button" TYPE="submit" NAME="action" VALUE="  UPLOADER  "> </TD>
			    </TR>
			    <TR>
			 	   <TD> </TD>
				   <TD> <INPUT class="button" TYPE="reset" NAME="action" VALUE=" RESET "> </TD>
			    </TR>
		    </TABLE>
		</FORM>
		</TR>
	</TABLE>
	</TD>
	</TR>
</TABLE>
';

return $str;
}



function dispAdminModifEdito () {

  $edito_id =$_GET['edito_id'];

  $result = getOneEdito($edito_id);


Seblu's avatar
Seblu committed
$str = '
Seblu's avatar
Seblu committed
<table width="80%" border="0" cellspacing="0" cellpadding="0">
	<tr>
	<td bgcolor="#000000">
	<table width="100%" border="0" cellspacing="1" cellpadding="2">
		<tr>
		<td>
			<b>
			<font color="#ffffff">
			&nbsp m o d i f y &nbsp e d i t o
			</font>
Seblu's avatar
Seblu committed
			</b>
Seblu's avatar
Seblu committed
		</td>
Seblu's avatar
Seblu committed
		</tr>
Seblu's avatar
Seblu committed
	<tr>
Seblu's avatar
Seblu committed
	<td bgcolor="#303030">
Seblu's avatar
Seblu committed
	<table cellpadding="0" cellspacing="0" width="100%">
Seblu's avatar
Seblu committed
		<tr>
Seblu's avatar
Seblu committed
	';

	  if (mysql_num_rows($result)){
Seblu's avatar
Seblu committed
	    $edito = mysql_fetch_array($result);
Seblu's avatar
Seblu committed
	  }

	  $str .= '
Seblu's avatar
Seblu committed
	    <form name="saisie" method="post" action="index.php?html=AdminHome&section_admin=ModifEdito&edito_id='.$edito_id.'">
Seblu's avatar
Seblu committed
	    <TABLE CELLSPACING="0" CELLPADDING="10" BORDER="0">
		<TR>
		<TD> Titre: </TD>
		<TD> <INPUT TYPE="text" NAME="edito_get_uptitle" VALUE="'.$edito["edito_title"].'" SIZE="50" MAXLENGTH="52"> </TD>
		</TR>
Seblu's avatar
Seblu committed
		<TR>
		<TD> Date: </TD>
		<TD> <INPUT TYPE="text" NAME="edito_get_update" VALUE="'.$edito["edito_date"].'" SIZE="8" MAXLENGTH="10"> </TD>
		</TR>

		<TR>
		<TD> Edito: </TD>
		<TD> <TEXTAREA rows="12" cols="38" name="edito_get_upcomment" ONFOCUS="">'.$edito["edito_comment"].'</TEXTAREA> </TD>
		</TR>

		<TR><TD>Poste par: </TD>
		<TD>
		';

		$id_user = getOneUserById($edito["edito_id_user"]);

		if (mysql_num_rows($id_user)){
Seblu's avatar
Seblu committed
		    $id_user = mysql_fetch_array($id_user);
Seblu's avatar
Seblu committed
		}

		$str .= $id_user["user_pseudo"].'</TD></TR>';

		$str .= '

		<TR>
		<TD> </TD>
		<TD> <INPUT class="button" TYPE="submit" NAME="action" VALUE="  UPDATE  "> </TD>
		</TR>

		<TR>
		<TD> </TD>
		<TD> <INPUT class="button" TYPE="reset" NAME="action" VALUE=" RESET "> </TD>
		</TR>
    	</TABLE>
	</FORM>
	</TR>
   </TABLE>
   </TD>
   </TR>
</TABLE>

';

return $str;
}



function dispAdminDelEdito () {

  $edito_id =$_GET['edito_id'];

  $result = getOneEdito($edito_id);


Seblu's avatar
Seblu committed
$str = '
Seblu's avatar
Seblu committed
<table width="80%" border="0" cellspacing="0" cellpadding="0">
	<tr>
	<td bgcolor="#000000">
	<table width="100%" border="0" cellspacing="1" cellpadding="2">
		<tr>
		<td>
			<b>
			<font color="#ffffff">
			&nbsp d e l e t e &nbsp e d i t o
			</font>
Seblu's avatar
Seblu committed
			</b>
Seblu's avatar
Seblu committed
		</td>
Seblu's avatar
Seblu committed
		</tr>
Seblu's avatar
Seblu committed
	<tr>
Seblu's avatar
Seblu committed
	<td bgcolor="#303030">
Seblu's avatar
Seblu committed
	<table cellpadding="0" cellspacing="0" width="100%">
Seblu's avatar
Seblu committed
		<tr>
Seblu's avatar
Seblu committed
	';

	  if (mysql_num_rows($result)){
Seblu's avatar
Seblu committed
	    $edito = mysql_fetch_array($result);
Seblu's avatar
Seblu committed
	  }

	  $str .= '
Seblu's avatar
Seblu committed
	    <form name="saisie" method="post" action="index.php?html=AdminHome&section_admin=DelEdito&edito_id='.$edito_id.'">
Seblu's avatar
Seblu committed
	    <TABLE CELLSPACING="0" CELLPADDING="10" BORDER="0">
Seblu's avatar
Seblu committed
		    <TR><TD> Titre: </TD>
		    <TD>'.$edito["edito_title"].'</TD>
		    </TR>
Seblu's avatar
Seblu committed
		    <TR><TD> Date: </TD>
		    <TD> '.$edito["edito_date"].'</TD>
		    </TR>

		    <TR><TD>Commentaire: </TD>
		    <TD>
		    '.$edito["edito_comment"].'
		    </TD>
		    </TR>';
Seblu's avatar
Seblu committed

		    $str .= '
Seblu's avatar
Seblu committed
		    <TR><TD>Poste par: </TD>
		    <TD>
		    ';

		    $id_user = getOneUserById($edito["edito_id_user"]);

		if (mysql_num_rows($id_user)){
Seblu's avatar
Seblu committed
		    $id_user = mysql_fetch_array($id_user);
Seblu's avatar
Seblu committed
		}

		$str .= $id_user["user_pseudo"].'</TD></TR>';

		$str .= '
		    <TR>
		    <TD> </TD>
		    <TD> <INPUT class="button" TYPE="submit" NAME="action" VALUE="  SUPPRIMER  "> </TD>
Seblu's avatar
Seblu committed
		    </TR>
Seblu's avatar
Seblu committed
    	</TABLE>
	</FORM>
	</TR>
   </TABLE>
   </TD>
   </TR>
</TABLE>

';

return $str;
}



?>