Skip to content
admin_links.php 5.72 KiB
Newer Older
Seblu's avatar
Seblu committed
<?php

function	dispAdminLinks()
{

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

$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 l l &nbsp l i n k s
				</font>
Seblu's avatar
Seblu committed
				</b>
Seblu's avatar
Seblu committed
			</td>
			</tr>
Seblu's avatar
Seblu committed

			<FORM name="new_news" method="post" action="index.php?html=AdminHome&section_admin=AdminAddLink">
Seblu's avatar
Seblu committed
   			<TR>
  			<TD><INPUT class="button" TYPE="submit" NAME="action" VALUE="  NOUVEAU LIEN  "><BR> </TD>
			</TR>
 			</FORM>
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%">
				<tr>
				<td>
				<table width="100%" border="0" cellspacing="0" cellpadding="4">

				';

Seblu's avatar
Seblu committed
	$result = getAllLinks();

Seblu's avatar
Seblu committed

	if (mysql_num_rows($result)){
		for ($cpt = 0; $cpt < mysql_numrows($result); $cpt++) {
			$link = mysql_fetch_array($result);
Seblu's avatar
Seblu committed
			$element_id = $link["link_id"];
Seblu's avatar
Seblu committed
			$str .= '
				<TR>
				<TD>
				<b>
				'.$link["link_link"].'
				</b>
				</TD>
				</TR>

				<TR><TD>
				<font class="texte_normal">
				<small>
				'.$link["link_comment"].'
Seblu's avatar
Seblu committed
				</font>
				</small>
Seblu's avatar
Seblu committed
				</TD></TR>

Seblu's avatar
Seblu committed
			<TD width="20%" align="right">
 			 	<FORM name="update_news" method="post" action="index.php?html=AdminHome&section_admin=AdminModifLink&element_id='.$element_id.'">
 			 	<INPUT class="button" TYPE="submit" NAME="action" VALUE="  MODIFIER  ">
Seblu's avatar
Seblu committed
  				</FORM>

Seblu's avatar
Seblu committed

 				<FORM name="supp_news" method="post" action="index.php?html=AdminHome&section_admin=AdminDelLink&element_id='.$element_id.'">
Seblu's avatar
Seblu committed
 				<INPUT class="button" TYPE="submit" NAME="action" VALUE="  SUPPRIMER  ">
				</FORM>
			</TD>
			</TR>

 			<TR><TD>
  			 <hr width="90%">
			</TD></TR>


		';
		}
	}



$str .= '
				</TR>
				</table>
				</td>
				</tr>
			</table>
			</td>
			</tr>
		</table>
		</td>
		</tr>
	</table>
Seblu's avatar
Seblu committed
	';

return $str;


}

function	dispAdminAddLink() {

 $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 l i n k &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=AddLink&element_id='.$element_id.'">
Seblu's avatar
Seblu committed
		    <TABLE CELLSPACING="0" CELLPADDING="10" BORDER="0">
Seblu's avatar
Seblu committed
			    <TR><TD> Lien: </TD>
			    <TD> <INPUT TYPE="text" NAME="input_get_link" VALUE="" SIZE="50" MAXLENGTH="52"> </TD>
			    </TR>
Seblu's avatar
Seblu committed
			    <TR><TD>Commentaire: </TD>
			    <TD>
			    <TEXTAREA rows="3" cols="38" name="input_get_comment" ONFOCUS=""></textarea>
			    </TD>
			    </TR>

			    <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	dispAdminModifLink() {
Seblu's avatar
Seblu committed
 $element_id =$_GET['element_id'];

 $result = getOneLinkById($element_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 l i n k
			</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
    $link = 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=ModifLink&element_id='.$element_id.'">
Seblu's avatar
Seblu committed
	    <TABLE CELLSPACING="0" CELLPADDING="10" BORDER="0">
Seblu's avatar
Seblu committed
 		   <TR><TD> Lien: </TD>
		    <TD> <INPUT TYPE="text" NAME="input_get_link" VALUE="'.$link["link_link"].'" SIZE="30" MAXLENGTH="30"> </TD>
		    </TR>
Seblu's avatar
Seblu committed
		    <TR><TD>Commentaire: </TD>
		    <TD>
		    <TEXTAREA rows="5" cols="38" name="input_get_comment" ONFOCUS="">'.$link["link_comment"].'</textarea>
		    </TD>
		    </TR>
	    </TD>
	    </TR>

	    <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>
Seblu's avatar
Seblu committed
    	</TABLE>
	</FORM>
	</TR>
   </TABLE>
   </TD>
   </TR>
</TABLE>
Seblu's avatar
Seblu committed
';

return $str;

}



function	dispAdminDelLink() {

$element_id =$_GET['element_id'];

$result = getOneLinkById($element_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 l i n k
			</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
	    $link = 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=DelLink&element_id='.$element_id.'">
Seblu's avatar
Seblu committed
	    <TABLE CELLSPACING="0" CELLPADDING="10" BORDER="0">
Seblu's avatar
Seblu committed
		    <TR><TD> Lien: </TD>
		    <TD>'.$link["link_link"].'</TD>
		    </TR>
Seblu's avatar
Seblu committed
		    <TR><TD>Commentaire: </TD>
		    <TD>
		    '.$link["link_comment"].'
		    </TD>
		    </TR>

		    <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);
}

?>