<?php

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// HamLogWeb
//
// Par F5AGL - GRIP 2007-2008
//
// Email : f5agl@zapgillou.fr
//
// Cette création est mise à disposition selon le Contrat Paternité-Pas d'Utilisation Commerciale-Pas de Modification 2.0 France 
// disponible en ligne http://creativecommons.org/licenses/by-nc-nd/2.0/fr/ 
// ou par courrier postal à Creative Commons, 171 Second Street, Suite 300, San Francisco, California 94105, USA.
// 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Fichier : admin.php 
//
// Description : Centre de Configuration de HamLogWeb
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

$langue=$_GET['langue'];

// Variables globales
include ("../configmysql.php");
include ("../config.php");

if ($popeye=="")
	{
	?>
	<table style="background-color: rgb(0, 0, 0); width: 100%; text-align: left; margin-left: auto; margin-right: auto; "border="0"
	 cellpadding="2" cellspacing="2">
  	<tbody><tr>
      	<td style="text-align: center; width: 150px;"><img style="width: 81px; height: 81px;" alt="" src="../img/annuler.png"></td>
      	<td style="text-align: center; width: 817px;"><big style="font-family: Helvetica,Arial,sans-serif; color: rgb(255, 0, 0);">
	<span style="font-weight: bold;"><big style="color: rgb(255, 0, 0);"><big><?php echo $lg_CDC_avertissement; ?></big></big><br>
      	<span style="color: rgb(255, 102, 0);"><?php echo $lg_CDC_avertissementlgn1; ?></span></span>
	<br style="font-weight: bold; color: rgb(255, 102, 0);">
	<span style="font-weight: bold; color: rgb(255, 102, 0);"><?php echo $lg_CDC_avertissementlgn2; ?> </span>
	<a style="font-weight: bold; color: rgb(255, 102, 0);" href="./admin.php?contenu=paramgeneraux&langue=<?php echo $langue; ?>"><?php echo $lg_CDC_ici; ?></a></big></td>
    	</tr>
  	</tbody>
	</table>
	<?php
	}
else
	{
	define("AR_PASSWORD",$popeye);
	require("adminArea.php");
	}

//imap_timeout(1,3600);
//imap_timeout(2,3600);
//imap_timeout(3,3600);

ini_set('upload_max_filesize','50M');
ini_set('post_max_size','30M');
ini_set('max_execution_time','3600');
ini_set('max_input_time','3600');

?>
<head>
<title><?php echo $Site_Nom; ?> - <?php echo $lg_CDC_titre; ?></title>
<link rel="stylesheet" type="text/css" href="Css/ColorPicker.css" />
<script type="text/javascript" src="Js/CP_Class.js"></script>
<script type="text/javascript">
window.onload = function()
{
 fctLoad();
}
window.onscroll = function()
{
 fctShow();
}
window.onresize = function()
{
 fctShow();
}
</script>
</head>

<?php 

$contenu=$_GET['contenu'];
$ficsauve=$_GET['ficsauve'];
$livredorsup=$_GET['livredorsup'];


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// FONCTION AffichageLigneAdmin($Chaine);
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function AffichageLigneAdmin($Chaine)
	{
	?>
	<div style="text-align: left; margin-left: 40px;"><img style="width: 13px; height: 13px;" alt=""
 	src="../img/VoyantVert.gif"> <font style="font-weight: bold;" size="-1">
	<span style="font-family: Courier New,Courier,monospace;"><?php echo $Chaine; ?></span></font></div>
	<?php
	}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// FONCTION AffichageForm(nomdupanneau:string);
//
// Affichage d'un panneau de configuration
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function AffichageForm($nomdupanneau)
	{
	global $contenu; 
	global $lg_valide_code_libelle, $lg_valide_code;
	global $db_host,$db_login,$db_psw,$db_base,$db_table;
	global $langue, $lg_CDC_paramgeneraux, $lg_CDC_paramlinguistiques, $lg_CDC_paramcouleurs, $lg_CDC_parammenu, $lg_CDC_paramaccueil,
		$lg_CDC_paramentete, $lg_CDC_paramlogbook, $lg_CDC_paraminfoqsl, $lg_CDC_paramcartesqsl, $lg_CDC_paramlivredor,
		$lg_CDC_diplomedxcctitre, $lg_CDC_Error01, $lg_CDC_Error02, $lg_CDC_Error03, $lg_CDC_Error04, $lg_CDC_paramenteteactuellement,
		$lg_CDC_paramlivredorAuteur, $lg_CDC_suppression, $lg_CDC_paramcouleurscharg, $lg_CDC_paramcouleurssauv, $lg_CDC_paramcouleursnochg, 
		$lg_CDC_parammenupagessup, $lg_CDC_parammenufichierhtml, $lg_CDC_parammenulibelle, $lg_CDC_parammenusupplien, $lg_CDC_parammenuedition, 
		$lg_CDC_validation;
	global $site_www;
	global $livredorsup;

	if ($nomdupanneau==$lg_CDC_paramgeneraux) 		{ $trigramme="PPG"; }
	if ($nomdupanneau==$lg_CDC_paramlinguistiques) 		{ $trigramme="PPL"; }
	if ($nomdupanneau==$lg_CDC_paramcouleurs) 		{ $trigramme="PPC"; }
	if ($nomdupanneau==$lg_CDC_parammenu) 			{ $trigramme="PMN"; }
	if ($nomdupanneau==$lg_CDC_paramaccueil) 		{ $trigramme="CAC"; }
	if ($nomdupanneau==$lg_CDC_paramentete) 		{ $trigramme="CEN"; }
	if ($nomdupanneau==$lg_CDC_paramlogbook) 		{ $trigramme="CLB"; }
	if ($nomdupanneau==$lg_CDC_paraminfoqsl) 		{ $trigramme="CIQ"; }
	if ($nomdupanneau==$lg_CDC_paramcartesqsl)	 	{ $trigramme="CCQ"; }
	if ($nomdupanneau==$lg_CDC_paramlivredor) 		{ $trigramme="CLO"; }
	if ($nomdupanneau==$lg_CDC_diplomedxcctitre) 		{ $trigramme="DDX"; }


	?>
	<span style="font-family: Comic Sans MS; color: rgb(153, 0, 0); font-weight: bold;"><?php echo $nomdupanneau; ?></span>
	<br><br>
	<form name="objForm" method="post" action="./admin.php?contenu=validation_<?php echo $contenu; ?>" enctype="multipart/form-data">
  	<table style="text-align: left; background-color: rgb(204, 204, 204); width: 1000px;" border="0" cellpadding="2" cellspacing="2">
    	<tbody>
	<?php

	// Connexion au serveur MySQL
	$link = @mysql_connect($db_host,$db_login,$db_psw) or AfficherErreur(1,$lg_CDC_Error01 . mysql_error());

	// Connexion à la base MySQL
	$db_selected = @mysql_select_db($db_base, $link); if (!$db_selected) { AfficherErreur(1,$lg_CDC_Error02 . mysql_error()); }

	$sql = 'SELECT * FROM `'.$db_table.'_CONFIG`';

	$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_CONFIG  - ".$lg_CDC_Error04. mysql_error());  }

	while ($ligne=@mysql_fetch_row($result))
		{
		$i=0;
		while ($i<15)
			{
			$ligne[$i]=stripslashes($ligne[$i]);
			$i=$i+1;
			}
		if ($ligne[0]==$trigramme)
			{
			$champs_nom		= $ligne[1];
			$champs_type		= $ligne[4];
			$champs_longueur	= $ligne[2];
			if ($langue=="fr")
				{
				$champs_libelle		= stripslashes($ligne[9]);
				}
			else
				{
				$champs_libelle		= stripslashes($ligne[10]);
				}


			
			////////////////////////////////////////////////////////////////////////////////////////////////////
			//	
			// CHAMPS DE TYPE TXT
			// ------------------
			//
			// Type 	Saisie d'un champs texte
			// 
			
			if ($champs_type=="TXT")
				{
				$champs_valeur		= htmlspecialchars(stripslashes($ligne[3]));
				?>
				<tr>
				<td style="width: 300px;"><?php echo $champs_libelle; ?></td>
        			<td colspan="2" rowspan="1"><input type="text" size="<?php echo $champs_longueur; ?>"
 				 name="<?php echo $champs_nom; ?>" value="<?php echo $champs_valeur; ?>"></td>
      				</tr>
				<?php
				}

			////////////////////////////////////////////////////////////////////////////////////////////////////
			//
			// CHAMPS DE TYPE FIC
			// ------------------
			//
			// Type 	Sélection d'un fichier local et envoi sur le serveur distant
			// 
			// Nota		VALEUR contient le répertoire serveur de dépot du fichier, la variable n'est pas modifiée

			if ($champs_type=="FIC")
				{
				$champs_valeur		= $ligne[3];
				?>
				<tr>
				<td style="width: 300px;"><?php echo $champs_libelle; ?></td>
        			<td colspan="2" rowspan="1"><input type="file" name="<?php echo $champs_nom; ?>"></td>
      				</tr>
				<?php
				}

			////////////////////////////////////////////////////////////////////////////////////////////////////
			//
			// CHAMPS DE TYPE FIK
			// ------------------
			//
			// Type 	Sélection d'un fichier local et envoi sur le serveur distant (gestion 1 fichier / langue)
			// 
			
			if ($champs_type=="FIK")
				{
				$FIK_Langue		= "fr";
				$champs_valeur		= $ligne[5];
				$i=0;
				while (!($lg_valide_code[$i]=="#"))
					{
					if ($lg_valide_code[$i]==$FIK_Langue) { $FIK_Langue_Libelle=$lg_valide_code_libelle[$i]; }
					$i=$i+1;
					}
				?>
				<tr>
				<td style="width: 300px;"><?php echo $champs_libelle; ?></td>
				<td style="width: 100px;"><small><span style="font-weight: bold;"><small>
				<?php echo strtoupper($FIK_Langue_Libelle); ?> :</small> </span></small></td>
        			<td><input type="file" name="<?php echo $FIK_Langue.$champs_nom; ?>"> <?php echo $lg_CDC_paramenteteactuellement; ?> <?php echo $champs_valeur; ?></td>
      				</tr>
				<?php

				$FIK_Langue		= "uk";
				$champs_valeur		= $ligne[6];
				$i=0;
				while (!($lg_valide_code[$i]=="#"))
					{
					if ($lg_valide_code[$i]==$FIK_Langue) { $FIK_Langue_Libelle=$lg_valide_code_libelle[$i]; }
					$i=$i+1;
					}
				?>
				<tr>
				<td style="width: 300px;"><?php echo $champs_libelle; ?></td>
				<td style="width: 100px;"><small><span style="font-weight: bold;"><small>
				<?php echo strtoupper($FIK_Langue_Libelle); ?> :</small> </span></small></td>
        			<td><input type="file" name="<?php echo $FIK_Langue.$champs_nom; ?>"> <?php echo $lg_CDC_paramenteteactuellement; ?> <?php echo $champs_valeur; ?></td>
      				</tr>
				<?php

				}


 			////////////////////////////////////////////////////////////////////////////////////////////////////
			//
			// CHAMPS DE TYPE FIM
			// ------------------
			//
			// Type 	Sélection d'un fichier image local et envoi sur le serveur distant 
			// 
			// Nota		VALEUR contient le chemin complet (rep+nom) du fichier sur le serveur

			if ($champs_type=="FIM")
				{
				?>
				<tr>
				<td style="width: 300px;"><?php echo $champs_libelle; ?></td>
        			<td colspan="2" rowspan="1"><input type="file" name="<?php echo $champs_nom; ?>"></td>
      				</tr>
				<?php
				}


 			////////////////////////////////////////////////////////////////////////////////////////////////////
			//
			// CHAMPS DE TYPE TML
			// ------------------
			//
			// Type 	Saisie d'un texte avec gestion multilangues
			// 

			if ($champs_type=="TML")
				{
				$TML_Langue		= "fr";
				$champs_valeur		= htmlspecialchars($ligne[5]);
				$i=0;
				while (!($lg_valide_code[$i]=="#"))
					{
					if ($lg_valide_code[$i]==$TML_Langue) { $TML_Langue_Libelle=$lg_valide_code_libelle[$i]; }
					$i=$i+1;
					}
				?>
				<tr>
				<td style="width: 300px;"><?php echo $champs_libelle; ?></td>
        			<td style="width: 100px;"><small><span style="font-weight: bold;"><small>
				<?php echo strtoupper($TML_Langue_Libelle); ?> :</small> </span></small></td>
				<td><input type="text" size="<?php echo $champs_longueur; ?>" 
				name="<?php echo $TML_Langue.$champs_nom; ?>" value="<?php echo $champs_valeur; ?>"></td>
      				</tr>
				<?php

				$TML_Langue		= "uk";
				$champs_valeur		= htmlspecialchars($ligne[6]);
				$i=0;
				while (!($lg_valide_code[$i]=="#"))
					{
					if ($lg_valide_code[$i]==$TML_Langue) { $TML_Langue_Libelle=$lg_valide_code_libelle[$i]; }
					$i=$i+1;
					}
				?>
				<tr>
				<td style="width: 300px;"><?php echo $champs_libelle; ?></td>
        			<td style="width: 100px;"><small><span style="font-weight: bold;"><small>
				<?php echo strtoupper($TML_Langue_Libelle); ?> :</small> </span></small></td>
				<td><input type="text" size="<?php echo $champs_longueur; ?>" 
				name="<?php echo $TML_Langue.$champs_nom; ?>" value="<?php echo $champs_valeur; ?>"></td>
      				</tr>
				<?php
				}

 			////////////////////////////////////////////////////////////////////////////////////////////////////
			//
			// CHAMPS DE TYPE BOL
			// ------------------
			//
			// Type 	Saisie type "case à cocher" vrai/faux
			// 

			if ($champs_type=="BOL")
				{
				$champs_valeur		= $ligne[3];
				if ((substr($champs_valeur,0,4)=="true") or (substr($champs_valeur,0,3)=="\"1\"")) { $champs_valeur="checked=\"checked\""; } else { $champs_valeur=""; }
				?>
      				<tr>
        			<td style="width: 300px;"><?php echo $champs_libelle; ?></td>
        			<td colspan="2" rowspan="1"><input <?php echo $champs_valeur; ?> name="<?php echo $champs_nom; ?>" type="checkbox"></td>
      				</tr>
				<?php
				}

 			////////////////////////////////////////////////////////////////////////////////////////////////////
			//
			// CHAMPS DE TYPE LST
			// ------------------
			//
			// Type 	Saisie d'un item dans une liste
			// 
			// Ligne 1	[CDC] - TRG - NomVar
			// Ligne 2	[CDC] - Libellé
			// Ligne 3	[CDC] - Liste des codes
			// Ligne 4	[CDC] - Liste des libellés
			// Ligne 5	NomVar = 1 code sélectionné

			if ($champs_type=="LST")
				{
				$champs_liste		= $ligne[5];
				$champs_liste_libelle	= $ligne[6];
				$champs_valeur		= $ligne[3];
				global ${$champs_liste};
				global ${$champs_liste_libelle};
				?>
				<tr>
				<td style="width: 300px;"><?php echo $champs_libelle; ?></td>
				<td colspan="2" rowspan="1"><select name="<?php echo $champs_nom; ?>">
				<?php
				$i=0;
				while (!(substr(${$champs_liste}[$i],0,1)=="#"))
					{
					if (substr($champs_valeur,0,strlen(${$champs_liste}[$i]))==${$champs_liste}[$i]) 
						{ $selected="selected=\"selected\""; }
					  else  { $selected=""; }
					?>
					<option <?php echo $selected; ?> value="<?php echo ${$champs_liste}[$i]; ?>">
					<?php echo ${$champs_liste_libelle}[$i]; ?></option>
					<?php
					$i=$i+1;
					}
				?>
				</select>
        			<br>
        			</td>
      				</tr>
				<?php
				}

			////////////////////////////////////////////////////////////////////////////////////////////////////
			//
			// CHAMPS DE TYPE CLR
			// ------------------
			//
			// Type 	Sélectiond d'une couleur
			// 

			if ($champs_type=="CLR")
				{
				$champs_valeur		= $ligne[3];
				?>
				<tr>
				<td style="width: 300px;"><?php echo $champs_libelle; ?></td>
				<td style="width: 100px;">
				<input type="text" size="10" name="<?php echo $champs_nom; ?>" value="<?php echo $champs_valeur; ?>" 
				maxlength="7" style="font-family:Tahoma;font-size:x-small;">
				<img src="Img/color.gif" width="21" height="20" border="0" align="absmiddle" 
				onClick="fctShow(document.objForm.<?php echo $champs_nom; ?>);" style="cursor:pointer;">
				</td>
				<td style="background-color: <?php echo $champs_valeur; ?>;"></td>
      				</tr>
				<?php
				}

			}

		}

	// fermeture session sur le serveur MySQL
	@mysql_close($link);

	//////////////////////////////////////////////////////
	//
	// AFFICHAGE PANNEAU LIVRE D'OR
	// ----------------------------
	//
	// Affichage de chaque item du livre d'or avec lien de suppression
			
	if ($trigramme=="CLO")
		{
		// Connexion au serveur MySQL
		$link = @mysql_connect($db_host,$db_login,$db_psw) or AfficherErreur(1,$lg_CDC_Error01 . mysql_error());

		// Connexion à la base MySQL
		$db_selected = @mysql_select_db($db_base, $link); 
		if (!$db_selected) { AfficherErreur(1,$lg_CDC_Error02 . mysql_error()); }

		if (!($livredorsup==""))
			{
			// Il y a un message à supprimer
			$sql = 'SELECT * FROM `'.$db_table.'_LIVREDOR` ORDER BY `DATE` DESC, `TIME` DESC';

			$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LIVREDOR  - ".$lg_CDC_Error04. mysql_error());  }
			$i=-1;
			while ($i<$livredorsup)
				{
				$ligne=mysql_fetch_row($result);
				$i=$i+1;
				}
			
			$sql = 'DELETE FROM `'.$db_table.'_LIVREDOR` WHERE `NOM` = \''.addslashes($ligne[0]).'\' AND `DATE` = \''.addslashes($ligne[1]).'\' 			AND `TIME` = \''.addslashes($ligne[2]).'\' AND `TEXTE` = \''.addslashes($ligne[3]).'\' LIMIT 1';
			$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LIVREDOR  - ".$lg_CDC_Error04. mysql_error());  }
			}

		$sql = 'SELECT * FROM `'.$db_table.'_LIVREDOR` ORDER BY `DATE` DESC, `TIME` DESC';
		$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LIVREDOR  ".$lg_CDC_Error04. mysql_error());  }
		$i=0;
		while ($ligne=@mysql_fetch_row($result))
			{
			?>
			<tr>
			<td style="width: 300px;"><?php echo $lg_CDC_paramlivredorAuteur; ?> <?php echo $ligne[0]; ?></td>
        		<td colspan="2" rowspan="1">"<?php echo substr($ligne[3],0,40)."...  "; ?>" &nbsp; &nbsp; <small>
			<a style="font-weight: bold; color: rgb(255, 0, 0);" 
			href=<?php echo "\"".$site_www."admin/admin.php?contenu=pagelivredor&livredorsup=".$i."\""; ?>><?php echo $lg_CDC_suppression; ?></a></small>
			</td>
      			</tr>
			<?php
			$i=$i+1;
			}

		// fermeture session sur le serveur MySQL
		@mysql_close($link);
		}

	//////////////////////////////////////////////////////
	//
	// AFFICHAGE PANNEAU COULEURS
	// --------------------------
	//
	// Gestion du chargement et de la sauvegarde d'un thème couleurs

	if ($trigramme=="PPC")
		{
		?><tr><td style="width: 256px;">&nbsp;</td><td style="width: 198px;"></td><td style="width: 400px;"></td></tr><?php
		// Si panneau paramètres couleurs, afficher la boite de sélection d'un thème
		?><tr><td style="width: 256px;"><?php echo $lg_CDC_paramcouleurscharg; ?></td><td style="width: 198px;"></td><td>
		<select name="THEMECHARGEMENT">
		<option selected="selected" value=""><?php echo $lg_CDC_paramcouleursnochg; ?></option><?php
		$handle=opendir("./themescouleurs");
		while ($file = readdir($handle))
			{
			$extension = strstr($file, '.');
			if ($extension == ".TCL")
				{
				$nomtheme=substr($file,0,strlen($file)-4);
				?><option value="<?php echo $nomtheme; ?>"><?php echo $nomtheme; ?></option><?php
				}
			}
		?></select></td></tr><?php

		// et le champs + bouton de sauvegarde d'un thème
		?><tr><td style="width: 256px;"><?php echo $lg_CDC_paramcouleurssauv; ?></td><td style="width: 198px;"></td><td style="width: 400px;"><input type="text" size="40"
 				 name="THEMESAUVEGARDE" value=""></td></tr><?php

		}

	//////////////////////////////////////////////////////
	//
	// AFFICHAGE PANNEAU MENU
	// ----------------------
	//
	// Gestion des pages optionnelles

	if ($trigramme=="PMN")
		{
		// Afficher autant de pavé langue que de langues possibles dans config.php
			$i=0;
			while (!($lg_valide_code[$i]=="#"))
				{
				?><tr><td style="background-color: rgb(204, 204, 204);">&nbsp;</td>
				<td style="background-color: rgb(204, 204, 204);"></td></tr><?php
				?><tr><td style="background-color: rgb(204, 204, 204);">&nbsp;</td>
				<td style="background-color: rgb(204, 204, 204);"></td></tr><?php
				?><tr><td style="background-color: rgb(204, 204, 204);"><span style="font-weight: bold;"><?php echo $lg_CDC_parammenupagessup; ?> <?php echo $lg_valide_code_libelle[$i]; ?></span></td>
        			<td style="background-color: rgb(204, 204, 204);"></td></tr>
				<tr><td style="background-color: rgb(204, 204, 204);"><?php echo $lg_CDC_parammenulibelle; ?></td>
        			<td style="background-color: rgb(204, 204, 204);"><?php echo $lg_CDC_parammenufichierhtml; ?></td></tr><?php

				// Afficher menu.sup correspondant à la langue
				$fm=fopen("../menu.sup","r");
				while (!(feof($fm)))
					{
					$ligne=fgets($fm,4096);
					if (substr($ligne,0,4)=="[".$lg_valide_code[$i]."]")
						{
						$menulink=fgets($fm,4096);
						$menutext=fgets($fm,4096);
						$j=1;
						while (!(substr($menulink,0,5)=="[end]"))
							{
							$onclickedition="self.location.href='../htmledit.php?fichier=".trim($menulink)."'";
							?><tr>
        						<td><input size="25" value="<?php echo $menutext; ?>" 
							name="<?php echo $lg_valide_code[$i].$j."text"; ?>" ></td>
							<td><input size="25" value="<?php echo $menulink; ?>" 
							name="<?php echo $lg_valide_code[$i].$j."link"; ?>" 
							></td><td>(<?php echo $lg_CDC_parammenusupplien; ?><input 
							name="<?php echo $lg_valide_code[$i].$j."suppression"; ?>" type="checkbox">) &nbsp; 
							<input type="button" value="<?php echo $lg_CDC_parammenuedition; ?>" onClick="<?php echo $onclickedition; ?>"></td>
      							</tr>


							<?php					
							$menulink=fgets($fm,4096);
							$menutext=fgets($fm,4096);
							$j=$j+1;


							}
						}
					}

				fclose($fm);

				// Afficher une ligne vierge pour possiblité d'ajout
 				?><tr>
        			<td><input size="25" name="<?php echo $lg_valide_code[$i]."AjoutLibelle"; ?>" ></td>
       				<td><input size="25" name="<?php echo $lg_valide_code[$i]."AjoutLien"; ?>" ></td>
      				</tr><?php


				$i=$i+1;
				}
		}

	?>
	</tbody></table><br>
  	<div style="text-align: center;"><input value="<?php echo $lg_CDC_validation; ?>" type="submit"></div>
	</form>
	</div>
	<br>
	<?php

	return(true);
	}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// FONCTION Diplome_DXCC();
//
// Gestion DIPLOME DXCC
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function Diplome_DXCC()
	{
	global $db_host,$db_login,$db_psw,$db_base,$db_table;
	global $logbook_principal;
	global $lg_CDC_Error01, $lg_CDC_Error02, $lg_CDC_Error03, $lg_CDC_Error04;

	// Connexion au serveur MySQL
	$link = @mysql_connect($db_host,$db_login,$db_psw) or AfficherErreur(1,$lg_CDC_Error01 . mysql_error());

	// Connexion à la base MySQL
	$db_selected = @mysql_select_db($db_base, $link); if (!$db_selected) { AfficherErreur(1,$lg_CDC_Error02 . mysql_error()); }

	AffichageLigneAdmin("Mise à jour données diplome DXCC");

	$sql = 'SELECT `NUM` , `ALL` , `160M` , `80M` , `40M` , `30M` , `20M` , `17M` , `15M` , `12M` , `10M` , `6M` , `2M` FROM `'.$db_table.'_DXCC` ';	
	$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_DXCC  - ".$lg_CDC_Error04 . mysql_error());  }
	while ($ligne=@mysql_fetch_row($result))
		{
		$sql2 = 'UPDATE `'.$db_table.'_DXCC` SET `ALL` = \'----\', `160M` = \'----\', `80M` = \'----\', `40M` = \'----\', `30M` = \'----\', `20M` = \'----\', `17M` = \'----\', `15M` = \'----\', `12M` = \'----\', `10M` = \'----\', `6M` = \'----\', `2M` = \'----\' WHERE `'.$db_table.'_DXCC`.`NUM` = \''.$ligne[0].'\';'; 
		$result2 = @mysql_query($sql2);
		}

	$sql 	= 'SELECT `BAND` , `MODE` , `DXCC` , `QSL_RCVD` FROM `'.$db_table.'_LOG` WHERE `LOG` = \''.$logbook_principal.'\' AND `MODE` IN (\'CW\',\'RTTY\',\'SSB\',\'USB\',\'LSB\',\'FM\',\'AM\') AND `BAND` IN (\'160M\',\'80M\',\'40M\',\'30M\',\'20M\',\'17M\',\'15M\',\'12M\',\'10M\',\'6M\',\'2M\')';
	$result = mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LOG  - ".$lg_CDC_Error04 . mysql_error());  }
	while ($ligne=mysql_fetch_row($result))
		{
		$sql2 		= 'SELECT `NUM`, `ALL` FROM `'.$db_table.'_DXCC` WHERE `NUM` = \''.$ligne[2].'\'';
		$result2 	= mysql_query($sql2); if (!$result2) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LOG  - ".$lg_CDC_Error04 . mysql_error());  }
		$ligne2		= mysql_fetch_row($result2);
		
		$Car1=substr($ligne2[1],0,1); // MIXED
		$Car2=substr($ligne2[1],1,1); // PHONE
		$Car3=substr($ligne2[1],2,1); // CW
		$Car4=substr($ligne2[1],3,1); // RTTY

		if ($ligne[3]=="Y") 
			{
			$Car1="C";
			}
		else
			{
			if (!($Car1=="C")) { $Car1="W"; }
			}

		if ($ligne[1]=="CW")
			{
			if ($ligne[3]=="Y") 
				{
				$Car3="C";
				}
			else
				{
				if (!($Car3=="C")) { $Car3="W"; }
				}
			}
		else
			{
			if ($ligne[1]=="RTTY")
				{
				if ($ligne[3]=="Y") 
					{
					$Car4="C";
					}
				else
					{
					if (!($Car4=="C")) { $Car4="W"; }
					}
				}
			else
				{
				if ($ligne[3]=="Y") 
					{
					$Car2="C";
					}
				else
					{
					if (!($Car2=="C")) { $Car2="W"; }
					}
				}
			}

		$sql2 		= 'UPDATE `'.$db_table.'_DXCC` SET `ALL` = \''.$Car1.$Car2.$Car3.$Car4.'\' WHERE `'.$db_table.'_DXCC`.`NUM` = \''.$ligne[2].'\';'; 
		$result2	= @mysql_query($sql2);

		$sql2 		= 'SELECT `NUM`, `'.$ligne[0].'` FROM `'.$db_table.'_DXCC` WHERE `NUM` = \''.$ligne[2].'\'';
		$result2 	= mysql_query($sql2); if (!$result2) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LOG  - ".$lg_CDC_Error04 . mysql_error());  }
		$ligne2		= mysql_fetch_row($result2);

		$Car1=substr($ligne2[1],0,1); // MIXED
		$Car2=substr($ligne2[1],1,1); // PHONE
		$Car3=substr($ligne2[1],2,1); // CW
		$Car4=substr($ligne2[1],3,1); // RTTY

		if ($ligne[3]=="Y") 
			{
			$Car1="C";
			}
		else
			{
			if (!($Car1=="C")) { $Car1="W"; }
			}

		if ($ligne[1]=="CW")
			{
			if ($ligne[3]=="Y") 
				{
				$Car3="C";
				}
			else
				{
				if (!($Car3=="C")) { $Car3="W"; }
				}
			}
		else
			{
			if ($ligne[1]=="RTTY")
				{
				if ($ligne[3]=="Y") 
					{
					$Car4="C";
					}
				else
					{
					if (!($Car4=="C")) { $Car4="W"; }
					}
				}
			else
				{
				if ($ligne[3]=="Y")
					{
					$Car2="C";
					}
				else
					{
					if (!($Car2=="C")) { $Car2="W"; }
					}
				}
			}

		$sql2 		= 'UPDATE `'.$db_table.'_DXCC` SET `'.$ligne[0].'` = \''.$Car1.$Car2.$Car3.$Car4.'\' WHERE `'.$db_table.'_DXCC`.`NUM` = \''.$ligne[2].'\';'; 
		$result2	= @mysql_query($sql2);

		}	
	
	// fermeture session sur le serveur MySQL
	@mysql_close($link);

	}




////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// FONCTION AffichageGestionQSL();
//
// Affichage du panneau de gestion des QSL
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function AffichageGestionQSL()
	{
	global $db_host,$db_login,$db_psw,$db_base,$db_table;
	global $logbook_principal, $qslcards_vignette;
	global $lg_CDC_Error01, $lg_CDC_Error02, $lg_CDC_Error03, $lg_CDC_Error04, $lg_CDC_gestqsltitre, $lg_CDC_gestqslimport,
		$lg_CDC_gestqslsuppression, $lg_CDC_validation, $lg_CDC_gestqsllgn01, $lg_CDC_gestqsllgn02, $lg_CDC_gestqsllgn03,
		$lg_CDC_gestqsllgn04, $lg_CDC_gestqsllgn05, $lg_CDC_gestqsllgn06, $lg_CDC_gestqsllgn07,
		$lg_CDC_Date, $lg_CDC_Heure, $lg_CDC_Indicatif, $langue, $lg_CDC_suppression;

	// Connexion au serveur MySQL
	$link = @mysql_connect($db_host,$db_login,$db_psw) or AfficherErreur(1,$lg_CDC_Error01 . mysql_error());

	// Connexion à la base MySQL
	$db_selected = @mysql_select_db($db_base, $link); if (!$db_selected) { AfficherErreur(1,$lg_CDC_Error02 . mysql_error()); }

	// Affichage du sous-menu de gestion des logs
	?>
	<div style="text-align: left;"><big style="font-weight: bold;"><big><span style="color: rgb(153, 0, 0); 
	font-family: Comic Sans MS;"><?php echo $lg_CDC_gestqsltitre; ?></span></big></big><span style="font-weight: bold;"></span><br>
	</div><ul><li style="font-family: Comic Sans MS;"><a href="#IMPORT_QSL"><?php echo $lg_CDC_gestqslimport; ?></a></li>
  	<li><a href="#SUPPRESSION_QSL"><span style="font-family: Comic Sans MS;"><?php echo $lg_CDC_gestqslsuppression; ?></span></a></li>
  	
  	<span style="font-family: Comic Sans MS;"><br></span></ul>
	<hr style="width: 100%; height: 2px;">

	<?php
	// Import d'une qsl
	?>

	<form name="objForm" method="post"action="./admin.php?contenu=validation_importqsl&langue=<?php echo $langue; ?>" enctype="multipart/form-data">
  	<div style="text-align: left;"><span style="color: rgb(153, 0, 0); font-family: Comic Sans MS; font-weight: bold;"><a
 	name="IMPORT_QSL"></a><?php echo $lg_CDC_gestqslimport; ?></span></div><br><table style="background-color: rgb(204, 204, 204); width: 1000px; text-align: left; margin-left: auto; margin-right: auto;"
 	border="0" cellpadding="2" cellspacing="2">
    	<tbody>
      	<tr align="center">
        <td style="background-color: rgb(51, 51, 51);"colspan="2" rowspan="1">
        <span style="font-family: Arial; font-weight: bold; color: rgb(255, 255, 0);"><?php echo $lg_CDC_gestqsllgn01; ?></span></td>
        </tr><tr>
        <td style="width: 300px; font-family: Arial;"><small><?php echo $lg_CDC_gestqsllgn02; ?> <span style="font-weight: bold;"><?php echo $lg_CDC_gestqsllgn03; ?> <br>
        </span><small style="font-style: italic;"><?php echo $lg_CDC_gestqsllgn04; ?></small></small></td>
        <td colspan="1" rowspan="1"><input name="QSL_UP_JPG" type="file"></td>
      	</tr>
    	</tbody>
  	</table>
  	<br>
  	<table style="background-color: rgb(204, 204, 204); width: 1000px; text-align: left; margin-left: auto; margin-right: auto;"
	border="0" cellpadding="2" cellspacing="2">
    	<tbody>
      	<tr align="center">
        <td style="background-color: rgb(51, 51, 51);"colspan="2" rowspan="1"><span style="font-family: Arial; font-weight: bold; color: rgb(255, 255, 0);"><?php echo $lg_CDC_gestqsllgn05; ?></span></td>
      	</tr>
      	<tr>
        <td style="width: 300px; font-family: Arial;"><small><?php echo $lg_CDC_gestqsllgn06; ?></small></td>
        <td colspan="1" rowspan="1"><input size="30" name="QSL_UP_CALL"><br>
        </td>
      	</tr>
    	</tbody>
  	</table>
  	<small><span style="font-weight: bold;"></span></small><br>
  	<div style="text-align: center;"><input value="<?php echo $lg_CDC_validation; ?>" type="submit"></div>
	</form>
	<br>


	<?php
	// Suppression d'une qsl
	?>


	<hr style="width: 100%; height: 2px;">
	<div style="text-align: left;"><span style="color: rgb(153, 0, 0); font-family: Comic Sans MS; font-weight: bold;"><a
 	name="SUPPRESSION_QSL"></a><?php echo $lg_CDC_gestqslsuppression; ?></span></div><br>
	<form name="objForm" method="post" action="./admin.php?contenu=validation_suppressionqsl&langue=<?php echo $langue; ?>" enctype="multipart/form-data">
  	<table style="background-color: rgb(204, 204, 204); width: 1000px; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
    	<tbody>
      	<tr align="center">
        <td style="background-color: rgb(51, 51, 51); " colspan="5" rowspan="1"><span style="font-family: Arial; font-weight: bold; color: rgb(255, 255, 0);"><?php echo $lg_CDC_gestqsllgn07; ?></span></td>
      	</tr>
      	<tr>
        <td style="text-align: center; font-family: Helvetica,Arial,sans-serif; font-weight: bold; color: rgb(255, 102, 0); background-color: rgb(102, 0, 0); width: 133px;"><font size="-1">QSL<br>
        </font></td>
        <td style="text-align: center; font-family: Helvetica,Arial,sans-serif; font-weight: bold; color: rgb(255, 102, 0); background-color: rgb(102, 0, 0); width: 110px;" colspan="1" rowspan="1"><font size="-1"><?php echo $lg_CDC_Date; ?><br>
        </font></td>
        <td style="text-align: center; font-family: Helvetica,Arial,sans-serif; font-weight: bold; color: rgb(255, 102, 0); background-color: rgb(102, 0, 0); width: 110px;"><font size="-1"><?php echo $lg_CDC_Heure; ?></font></td>
        <td style="background-color: rgb(102, 0, 0); font-family: Helvetica,Arial,sans-serif; font-weight: bold; text-align: center; color: rgb(255, 102, 0); width: 233px;"><font size="-1"><?php echo $lg_CDC_Indicatif; ?></font></td>
        <td style="background-color: rgb(102, 0, 0); font-family: Helvetica,Arial,sans-serif; font-weight: bold; text-align: center; color: rgb(255, 102, 0); width: 117px;"><font size="-1"><?php echo $lg_CDC_suppresion; ?></font></td>
      	</tr>

	<?php
	$sql = 'SELECT * FROM `'.$db_table.'_QSL` ORDER BY `CALL` ASC ';
	$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_QSL  - ".$lg_CDC_Error04 . mysql_error());  }
	$i=0;
	while ($ligne=@mysql_fetch_row($result))
		{
		$f=$ligne[4];
		if (!(is_file("../qsl/thumbs/vignette_".$f)))
				{
				// Création vignette, car toutes les vignettes sont effacées lors de l'installation
				$src=imagecreatefromjpeg("../qsl/".$f);
				$taille=getimagesize("../qsl/".$f);
				// Le redimensionnement diffère selon que la largeur > hauteur ou le contraire
				if ($taille[0]>$taille[1])
					{
					$img=ImageCreateTrueColor($qslcards_vignette,round(($qslcards_vignette/$taille[0])*$taille[1]));
            				imagecopyresized($img,$src, 0,0,0,0, $qslcards_vignette,
					round(($qslcards_vignette/$taille[0])*$taille[1]),$taille[0],$taille[1]);
					}
				else
					{
					$img=ImageCreateTrueColor(round(($qslcards_vignette/$taille[1])*$taille[0]), $qslcards_vignette);
       					imagecopyresized($img,$src, 0,0,0,0,round(($qslcards_vignette/$taille[1])*$taille[0]), 
					$qslcards_vignette, $taille[0],$taille[1]);
					}
				// Enregistrement de la vignette
        			imagejpeg($img, "../qsl/thumbs/vignette_".$f);
				}


		?>

      		<tr>
        	<td style="font-family: Arial; text-align: center; width: 133px;">
		<img style="width: 100px;" alt="" src="../qsl/thumbs/vignette_<?php echo $ligne[4]; ?>"></td>
        	<td style="text-align: center; font-family: Helvetica,Arial,sans-serif; width: 110px;" colspan="1" rowspan="1"><?php echo $ligne[2]; ?></td>
        	<td style="text-align: center; font-family: Helvetica,Arial,sans-serif; width: 110px;"><?php echo $ligne[3]; ?></td>
                <td style="text-align: center; font-family: Helvetica,Arial,sans-serif; width: 233px;"><?php echo $ligne[1]; ?></td>
        	<td style="text-align: center; width: 117px;"><font size="-2"><input name="QSL_SUPP_REFQSO_<?php echo $i; ?>" type="checkbox"></font></td>
      		</tr>

		<?php 
		$i=$i+1;
		} ?>


    	</tbody>
  	</table>
  	<small><span style="font-weight: bold;"></span></small><br>
  	<div style="text-align: center;"><input value="<?php echo $lg_CDC_suppression; ?>" type="submit"></div>
	</form>
	<br>

	

	

	<?php

	// fermeture session sur le serveur MySQL
	@mysql_close($link);
	}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// FONCTION ValidationImportQslPhase1()
//
// Gestion de la validation de la fonction d'import d'une QSL
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function ValidationImportQslPhase1()
	{
	global $db_host,$db_login,$db_psw,$db_base,$db_table;
	global $logbook_principal;
	global $lg_CDC_Error01, $lg_CDC_Error02, $lg_CDC_Error03, $lg_CDC_Error04,
		$lg_CDC_Date, $lg_CDC_Heure, $lg_CDC_Indicatif, $lg_CDC_Bande, $lg_CDC_Mode,
		$lg_CDC_gestqsllgn08, $lg_CDC_gestqsllgn09, $lg_CDC_gestqsllgn10, $lg_CDC_gestqsllgn11, $lg_CDC_gestqsllgn12,
		$lg_CDC_gestqsllgn13, $lg_CDC_gestqsllgn14, $langue, $lg_CDC_Associer;

	$Import=false;

	// Récupération des variables postées
	$QSL_UP_JPG		=addslashes($_POST["QSL_UP_JPG"]);
	$QSL_UP_CALL		=strtoupper($_POST["QSL_UP_CALL"]);

	if (!(move_uploaded_file($_FILES["QSL_UP_JPG"]['tmp_name'],"../qsl/".$_FILES["QSL_UP_JPG"]['name'])==false))
		{
		AffichageLigneAdmin($lg_CDC_gestqsllgn08.$_FILES["QSL_UP_JPG"]['name']);
		$qsl_charge="./qsl/".$_FILES["QSL_UP_JPG"]['name'];
		
		// Afin d'éviter d'avoir des noms de fichier identique, on modifie le nom du fichier avec le call, et date et heure d'upload
		$fic_qsl="QSL_".date("ymdHis")."_".QSLNomFic($QSL_UP_CALL).".jpg";
		rename(".".$qsl_charge,"../qsl/".$fic_qsl);

		$Import=true; 
		AffichageLigneAdmin($lg_CDC_gestqsllgn09.$fic_qsl);
		}

	if ($Import==true)
		{
		?><br><div style="text-align: center;"><img style="width: 293px; height: 190px;" alt="<?php echo $lg_CDC_gestqsllgn10; ?>" src="../qsl/<?php echo $fic_qsl; ?>"><br></div><?php

		// Connexion au serveur MySQL
		$link = @mysql_connect($db_host,$db_login,$db_psw) or AfficherErreur(1,$lg_CDC_Error01 . mysql_error());

		// Connexion à la base MySQL
		$db_selected = @mysql_select_db($db_base, $link); 
		if (!$db_selected) { AfficherErreur(1,$lg_CDC_Error02 . mysql_error()); }

		?>
		<br>
		<form name="objForm" method="post" action="./admin.php?contenu=validation_qsoqsl&langue=<?php echo $langue; ?>&fic_qsl=<?php echo $fic_qsl; ?>&call_qsl=<?php echo $QSL_UP_CALL; ?>" enctype="multipart/form-data">
  		<table style="background-color: rgb(204, 204, 204); width: 1000px; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
    		<tbody>
      		<tr align="center">
        	<td style="background-color: rgb(51, 51, 51); width: 514px;" colspan="6" rowspan="1"><span style="font-family: Arial; font-weight: bold; color: rgb(255, 255, 0);"><?php echo $lg_CDC_gestqsllgn11; ?></span></td>
      		</tr>
      		<tr>
        	<td style="width: 150px; text-align: center; font-family: Helvetica,Arial,sans-serif; font-weight: bold; color: rgb(255, 102, 0); background-color: rgb(102, 0, 0);"><font size="-1"><?php echo $lg_CDC_Date; ?><br>
        	</font></td>
        	<td style="width: 150px; text-align: center; font-family: Helvetica,Arial,sans-serif; font-weight: bold; color: rgb(255, 102, 0); background-color: rgb(102, 0, 0);" colspan="1" rowspan="1"><font size="-1"><?php echo $lg_CDC_Heure; ?><br>
        	</font></td>
		<td style="width: 100px; text-align: center; font-family: Helvetica,Arial,sans-serif; font-weight: bold; color: rgb(255, 102, 0); background-color: rgb(102, 0, 0);"><font size="-1"><?php echo $lg_CDC_Bande; ?></font></td>
		<td style="width: 100px; text-align: center; font-family: Helvetica,Arial,sans-serif; font-weight: bold; color: rgb(255, 102, 0); background-color: rgb(102, 0, 0);"><font size="-1"><?php echo $lg_CDC_Mode; ?></font></td>
        	<td style="width: 150px; text-align: center; font-family: Helvetica,Arial,sans-serif; font-weight: bold; color: rgb(255, 102, 0); background-color: rgb(102, 0, 0);"><font size="-1"><?php echo $lg_CDC_Indicatif; ?></font></td>
        	<td style="width: 314px; text-align: center; font-family: Helvetica,Arial,sans-serif; font-weight: bold; color: rgb(255, 102, 0); background-color: rgb(102, 0, 0);"><font size="-1"><?php echo $lg_CDC_gestqsllgn12; ?></font></td>
      		</tr>
		<?php
		$sql = 'SELECT * FROM `'.$db_table.'_LOG` WHERE `CALL` LIKE \'%'.$QSL_UP_CALL.'%\'';
		$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LOG  - ".$lg_CDC_Error04 . mysql_error());  }
		$i=0;
		while ($ligne=@mysql_fetch_row($result))
			{
			

			?>
	      		<tr>
        		<td style="font-family: Arial; width: 150px; text-align: center;"><font size="-2"><?php echo $ligne[0]; ?></font></td>
        		<td style="width: 150px; text-align: center;" colspan="1" rowspan="1"><font size="-2"><?php echo $ligne[1]; ?></font></td>
        		<td style="width: 100px; text-align: center;"><font size="-2"><?php echo $ligne[3]; ?></font></td>
        		<td style="width: 100px; text-align: center;"><font size="-2"><?php echo $ligne[4]; ?></font></td>
        		<td style="width: 150px; text-align: center;"><font size="-2"><?php echo $ligne[2]; ?></font></td>
        		<td style="width: 314px; text-align: center;"><font size="-2"><input name="QSL_SUPP_REFQSO_<?php echo $i; ?>" type="checkbox"></font></td>
      			</tr>
      			<?php
			$i=$i+1;
			}

		if ($i>0)
			{
			?>
    			</tbody>
  			</table>
  			<small><span style="font-weight: bold;"></span></small><br>
  			<div style="text-align: center;"><input value="<?php echo $lg_CDC_Associer; ?>" type="submit"></div>
			</form>
			<?php
			}
		else
			{
			?>
			<tr align="center">
        		<td style="background-color: rgb(51, 51, 51); width: 514px;" colspan="6" rowspan="1"><span style="font-family: Arial; font-weight: bold; color: rgb(255, 255, 0);"><?php echo $lg_CDC_gestqsllgn13; ?></span></td>
      			</tr>
			</tbody>
  			</table>
			</form
			<?php
			
			AffichageLigneAdmin("<?php echo $lg_CDC_gestqsllgn14; ?>");
			unlink("../qsl/".$fic_qsl);
		
			}

		// fermeture session sur le serveur MySQL
		@mysql_close($link);

		}
	else
		{
		AffichageLigneAdmin("<?php echo $lg_CDC_gestqsllgn15; ?>");
		}
		
		
	}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// FONCTION ValidationImportQslPhase2()
//
// Gestion de la validation de la fonction d'import d'une QSL
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function ValidationImportQslPhase2()
	{
	global $db_host,$db_login,$db_psw,$db_base,$db_table;
	global $logbook_principal, $qslcards_vignette;
	global $lg_CDC_Error01, $lg_CDC_Error02, $lg_CDC_Error03, $lg_CDC_Error04, $langue;
	global $lg_CDC_gestqsllgn09, $lg_CDC_gestqsllgn16, $lg_CDC_gestqsllgn17, $lg_CDC_gestqsllgn18, $lg_CDC_gestqsllgn19, $lg_CDC_gestqsllgn20,
		$lg_CDC_gestqsllgn06;
	
	// Récupération des variables postées
	$fic_qsl		= $_GET['fic_qsl'];
	$call_qsl		= $_GET['call_qsl'];
	
	AffichageLigneAdmin($lg_CDC_gestqsllgn16);
	AffichageLigneAdmin($lg_CDC_gestqsllgn09.$fic_qsl);
	AffichageLigneAdmin($lg_CDC_gestqsllgn06." : ".$call_qsl);
	
	AffichageLigneAdmin($lg_CDC_gestqsllgn17);
	$src=imagecreatefromjpeg("../qsl/".$fic_qsl);
	$taille=getimagesize("../qsl/".$fic_qsl);
	// Le redimensionnement diffère selon que la largeur > hauteur ou le contraire
	if ($taille[0]>$taille[1])
		{
		$img=ImageCreateTrueColor($qslcards_vignette,round(($qslcards_vignette/$taille[0])*$taille[1]));
            	imagecopyresized($img,$src, 0,0,0,0, $qslcards_vignette,
		round(($qslcards_vignette/$taille[0])*$taille[1]),$taille[0],$taille[1]);
		}
	else
		{
		$img=ImageCreateTrueColor(round(($qslcards_vignette/$taille[1])*$taille[0]), $qslcards_vignette);
       		imagecopyresized($img,$src, 0,0,0,0,round(($qslcards_vignette/$taille[1])*$taille[0]), 
		$qslcards_vignette, $taille[0],$taille[1]);
		}

	// Enregistrement de la vignette
        imagejpeg($img, "../qsl/thumbs/vignette_".$fic_qsl);

	// Connexion au serveur MySQL
	$link = @mysql_connect($db_host,$db_login,$db_psw) or AfficherErreur(1,$lg_CDC_Error01 . mysql_error());

	// Connexion à la base MySQL
	$db_selected = @mysql_select_db($db_base, $link); 
	if (!$db_selected) { AfficherErreur(1,$lg_CDC_Error02 . mysql_error()); }

	$sql = 'SELECT * FROM `'.$db_table.'_LOG` WHERE `CALL` LIKE \'%'.$call_qsl.'%\'';
	$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LOG  - ".$lg_CDC_Error04 . mysql_error());  }
	$i=0;
	$aumoinsun=false;
	while ($ligne=@mysql_fetch_row($result))
		{
	
		$associer	=$_POST["QSL_SUPP_REFQSO_".$i];

		if ($associer=="on")
			{

			AffichageLigneAdmin($lg_CDC_gestqsllgn18.$ligne[2]." - ".$ligne[0]." ".$ligne[1]." (".$ligne[3]." - ".$ligne[4].")");
			$sql2 = 'INSERT INTO `'.$db_table.'_QSL` (`DXCC`, `CALL`, `QSL_DATE`, `QSL_TIME`, `NOMFIC`) VALUES (\''.$ligne[5].'\', \''.$ligne[2].'\', \''.$ligne[0].'\', \''.$ligne[1].'\', \''.$fic_qsl.'\');';
			$result2 = @mysql_query($sql2);
			$aumoinsun=true;
			}
		
		$i=$i+1;
		}

	if ($aumoinsun==false)
		{
		AffichageLigneAdmin($lg_CDC_gestqsllgn19);
		unlink("../qsl/".$fic_qsl);
		unlink("../qsl/thumbs/vignette_".$fic_qsl);
		}

	AffichageLigneAdmin($lg_CDC_gestqsllgn20);

	// fermeture session sur le serveur MySQL
	@mysql_close($link);
	
	}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// FONCTION SuppressionQSLOrphelines()
//
// Suppression des fichiers QSL non rattachés à un QSO
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function SuppressionQSLOrphelines()
	{
	global  $db_host,$db_login,$db_psw,$db_base,$db_table;
	global  $site_www;
	global $lg_CDC_Error01, $lg_CDC_Error02, $lg_CDC_Error03, $lg_CDC_Error04, $langue, $lg_CDC_gestqsllgn21;

	// Connexion au serveur MySQL
	$link = @mysql_connect($db_host,$db_login,$db_psw) or AfficherErreur(1,$lg_CDC_Error01 . mysql_error());

	// Connexion à la base MySQL
	$db_selected = @mysql_select_db($db_base, $link); if (!$db_selected) { AfficherErreur(1,$lg_CDC_Error02. mysql_error()); }

	// Suppression des QSL orphelines
	$dir = opendir("../qsl/");
	while ($f = readdir($dir))
		{
		if(is_file("../qsl/".$f))
			{			
			$sql = 'SELECT * FROM `'.$db_table.'_QSL` WHERE `NOMFIC` = \''.$f.'\'';
			$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_QSL  - ".$lg_CDC_Error04 . mysql_error());  }
			$ligne=@mysql_fetch_row($result);
			if ($ligne==false)
				{
				AffichageLigneAdmin($lg_CDC_gestqsllgn21.$f);
				@unlink("../qsl/".$f);
				@unlink("../qsl/thumbs/vignette_".$f);
				}
			}
		}

	// fermeture session sur le serveur MySQL
	@mysql_close($link);

	}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// FONCTION ValidationSuppressionQSL()
//
// Gestion de la validation de la suppression d'une QSL associée à un QSO
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function ValidationSuppressionQSL()
	{
	global $db_host,$db_login,$db_psw,$db_base,$db_table;
	global $logbook_principal;
	global $lg_CDC_Error01, $lg_CDC_Error02, $lg_CDC_Error03, $lg_CDC_Error04, $langue, $lg_CDC_gestqsllgn22, $lg_CDC_gestqsllgn23,
		$lg_CDC_gestqsllgn20;
	
	// Connexion au serveur MySQL
	$link = @mysql_connect($db_host,$db_login,$db_psw) or AfficherErreur(1,$lg_CDC_Error01 . mysql_error());

	// Connexion à la base MySQL
	$db_selected = @mysql_select_db($db_base, $link); 
	if (!$db_selected) { AfficherErreur(1,$lg_CDC_Error02 . mysql_error()); }

	$sql = 'SELECT * FROM `'.$db_table.'_QSL` ORDER BY `CALL` ASC ';
	$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_QSL  - ". $lg_CDC_Error04 . mysql_error());  }
	$i=0;
	while ($ligne=@mysql_fetch_row($result))
		{
	
		$associer	=$_POST["QSL_SUPP_REFQSO_".$i];

		if ($associer=="on")
			{

			AffichageLigneAdmin($lg_CDC_gestqsllgn22." (".$ligne[0]." ".$ligne[1]." ".$ligne[2]." ".$ligne[3].")");
			$sql2 = 'DELETE FROM `'.$db_table.'_QSL` WHERE `CALL` = \''.$ligne[1].'\' AND `QSL_DATE` = \''.$ligne[2].'\' AND `QSL_TIME` = \''.$ligne[3].'\' AND `NOMFIC` = \''.$ligne[4].'\' ';
			$result2 = @mysql_query($sql2);
			}
		
		$i=$i+1;
		}

	AffichageLigneAdmin($lg_CDC_gestqsllgn23);
	SuppressionQSLOrphelines();

	AffichageLigneAdmin($lg_CDC_gestqsllgn20);

	// fermeture session sur le serveur MySQL
	@mysql_close($link);
	
	}




////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// FONCTION AffichageGestionLog();
//
// Affichage du panneau de gestion du log
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function AffichageGestionLog()
	{
	global $db_host,$db_login,$db_psw,$db_base,$db_table;
	global $logbook_principal;
	global $lg_CDC_Error01, $lg_CDC_Error02, $lg_CDC_Error03, $lg_CDC_Error04, $langue, $lg_CDC_gestlogtitre, $lg_CDC_gestlogimport,
		$lg_CDC_gestlogsuppression, $lg_CDC_gestlogselection, $lg_CDC_gestloginfo, $lg_CDC_validation, $lg_CDC_SUPPRESSION,
		$lg_CDC_paramenteteactuellement, $lg_CDC_SELECTION, $lg_CDC_gestloglgn01, $lg_CDC_gestloglgn02, $lg_CDC_gestloglgn03,
		$lg_CDC_gestloglgn04, $lg_CDC_gestloglgn05, $lg_CDC_gestloglgn06, $lg_CDC_gestloglgn07, $lg_CDC_gestloglgn08,
		$lg_CDC_gestloglgn09, $lg_CDC_gestloglgn10, $lg_CDC_gestloglgn11, $lg_CDC_gestloglgn12, $lg_CDC_gestloglgn13,
		$lg_CDC_gestloglgn14, $lg_CDC_gestloglgn15, $lg_CDC_gestloglgn16, $lg_CDC_gestloglgn17, $lg_CDC_gestloglgn18, 
		$lg_CDC_gestloglgn19, $lg_CDC_gestloglgn20;

	// Connexion au serveur MySQL
	$link = @mysql_connect($db_host,$db_login,$db_psw) or AfficherErreur(1,$lg_CDC_Error01 . mysql_error());

	// Connexion à la base MySQL
	$db_selected = @mysql_select_db($db_base, $link); if (!$db_selected) { AfficherErreur(1,$lg_CDC_Error02 . mysql_error()); }

	// Affichage du sous-menu de gestion des logs
	?>
	<div style="text-align: left;"><big style="font-weight: bold;"><big><span style="color: rgb(153, 0, 0); 
	font-family: Comic Sans MS;"><?php echo $lg_CDC_gestlogtitre; ?></span></big></big><span style="font-weight: bold;"></span><br>
	</div><ul><li style="font-family: Comic Sans MS;"><a href="#IMPORT_LOG"><?php echo $lg_CDC_gestlogimport; ?></a></li>
  	<li><a href="#SUPPRESSION_LOG"><span style="font-family: Comic Sans MS;"><?php echo $lg_CDC_gestlogsuppression; ?></span></a></li>
  	<li><span style="font-family: Comic Sans MS;"><a href="#LOG_PRINCIPAL"><?php echo $lg_CDC_gestlogselection; ?></a></span></li>
  	<li><span style="font-family: Comic Sans MS;"><a href="#LOG_INFO"><?php echo $lg_CDC_gestloginfo; ?></a><br></span></li>
  	<span style="font-family: Comic Sans MS;"><br></span></ul>
	<hr style="width: 100%; height: 2px;">

	<?php
	// Import d'un log
	?>

	<form name="objForm" method="post" action="./admin.php?contenu=validation_importlog&langue=<?php echo $langue; ?>" enctype="multipart/form-data">
  	<div style="text-align: left;"><span style="color: rgb(153, 0, 0); font-family: Comic Sans MS; font-weight: bold;"><a
 	name="IMPORT_LOG"></a><?php echo $lg_CDC_gestlogimport; ?></span></div><br>
	<table style="background-color: rgb(204, 204, 204); width: 1000px; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
    	<tbody>
      	<tr align="center">
        <td style="background-color: rgb(51, 51, 51);" colspan="2" rowspan="1">
	<span style="font-family: Arial; font-weight: bold; color: rgb(255, 255, 0);"><?php echo $lg_CDC_gestloglgn01; ?></span></td>
      	</tr><tr>
        <td style="width: 300px; font-family: Arial;"><small><?php echo $lg_CDC_gestloglgn02; ?> <span style="font-weight: bold;">ADIF</span></small></td>
        <td colspan="1" rowspan="1"><input name="LOG_UP_ADIF" type="file"></td></tr>
	<tr>
        <td style="width: 300px; font-family: Arial;"><small><span style="font-weight: bold;"><?php echo $lg_CDC_gestloglgn03; ?></span> <?php echo $lg_CDC_gestloglgn04; ?></small></td>
        <td colspan="1" rowspan="1"><input size="30" name="LOG_ADIF"></td></tr>
	<tr><td style="width: 300px; font-family: Arial;"><small><?php echo $lg_CDC_gestloglgn05; ?></small></td>
        <td colspan="1" rowspan="1"><input name="LOG_UP_MULTIREQUETES" type="checkbox"><br></td>
      	</tr> 


	<?php
        // CABRILLO
	// <tr><td style="width: 300px; font-family: Arial;"><small>Upload d'un log au format <span style="font-weight: bold;">CABRILLO</span></small></td>
        // <td colspan="1" rowspan="1"><input name="LOG_UP_CABRILLO" type="file"><br></td></tr>
	?>

	</tbody></table>
  	<br><table style="background-color: rgb(204, 204, 204); width: 1000px; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
    	<tbody><tr align="center"><td style="background-color: rgb(51, 51, 51);" colspan="2" rowspan="1">
	<span style="font-family: Arial; font-weight: bold; color: rgb(255, 255, 0);"><?php $lg_CDC_gestloglgn10; ?></span></td>
      	</tr><tr><td style="width: 300px; font-family: Arial;"><small><?php echo $lg_CDC_gestloglgn06; ?> <span style="color: rgb(0, 0, 153); font-weight: bold;">HamLog</span><span
 	style="font-weight: bold;">Web</span></small></td>
        <td colspan="1" rowspan="1">

	<?php
	$sql = 'SELECT DISTINCT `LOG` FROM `'.$db_table.'_LOG`';
	$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LOG  - ".$lg_CDC_Error04 . mysql_error());  }
	?><select name="LOG_UP_CALL_LISTE"><?php
	?><option></option><?php
	while ($ligne=@mysql_fetch_row($result))
		{
		
		if (!($ligne[0]==""))   // on évacue le cas des QSO non affectés à un call
			{
			?><option><?php echo $ligne[0]; ?></option><?php
			}
		}
	?></select>

        <br></td></tr><tr><td style="width: 300px; font-family: Arial;"><small><?php echo $lg_CDC_gestloglgn19; ?></small></td>
        <td colspan="1" rowspan="1"><input size="30" name="LOG_UP_CALL_NEW"><br></td></tr></tbody></table>

	<br>
  	<table style="background-color: rgb(204, 204, 204); width: 1000px; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
    	<tbody>
      	<tr align="center"><td style="background-color: rgb(51, 51, 51);" colspan="2" rowspan="1"><span style="font-family: Arial; font-weight: bold; color: rgb(255, 255, 0);"><?php echo $lg_CDC_gestloglgn11; ?></span></td>
        </tr><tr><td style="width: 300px; font-family: Arial;"><small><?php echo $lg_CDC_gestloglgn07; ?></small></td>
        <td colspan="1" rowspan="1"><input checked="checked" name="LOG_UP_DATE" type="checkbox"><br></td>
      	</tr><tr><td style="width: 300px; font-family: Arial;"><small><?php echo $lg_CDC_gestloglgn08; ?></small></td>
        <td colspan="1" rowspan="1"><input checked="checked" name="LOG_UP_TIME" type="checkbox"><br></td></tr><tr>
	<td style="width: 300px; font-family: Arial;"><small><?php echo $lg_CDC_gestloglgn09; ?></small></td><td colspan="1" rowspan="1"><input size="100" name="LOG_UP_DESCRIPTION"></td>
      	</tr></tbody></table>


	<small><span style="font-weight: bold;"></span></small><br>
  	<div style="text-align: center;"><input value="<?php echo $lg_CDC_validation; ?>" type="submit"></div></form><br>


	<?php
	// Suppression d'un log
	?>


	<hr style="width: 100%; height: 2px;">
	<form name="objForm" method="post" action="./admin.php?contenu=validation_suppressionlog&langue=<?php echo $langue; ?>" enctype="multipart/form-data">
  	<div style="text-align: left;"><span style="color: rgb(153, 0, 0); font-family: Comic Sans MS; font-weight: bold;"><a name="SUPPRESSION_LOG"></a><?php echo $lg_CDC_gestlogsuppression; ?></span></div><BR>
  	<table style="background-color: rgb(204, 204, 204); width: 1000px; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
    	<tbody><tr align="center"><td style="background-color: rgb(51, 51, 51);" colspan="2" rowspan="1"><span style="font-family: Arial; font-weight: bold; color: rgb(255, 255, 0);"><?php echo $lg_CDC_gestloglgn12; ?></span></td>
      	</tr><tr><td style="width: 300px; font-family: Arial;"><small><?php echo $lg_CDC_gestloglgn13; ?>&nbsp;</small><small style="font-weight: bold;"><span
 	style="color: rgb(0, 0, 153);">HamLog</span>Web</small></td>
        <td colspan="1" rowspan="1">
	<?php
	$sql = 'SELECT DISTINCT `LOG` FROM `'.$db_table.'_LOG`';
	$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LOG  ".$lg_CDC_Error04. mysql_error());  }
	?><select name="LOG_DEL_LISTE"><?php
	while ($ligne=@mysql_fetch_row($result))
		{
		if (!($ligne[0]==""))   // on évacue le cas des QSO non affectés à un call
			{
			?><option><?php echo $ligne[0]; ?></option><?php
			}
		else
			{
			?><option value=""><?php echo $lg_CDC_gestloglgn20; ?></option><?php
			}
		}
	?></select>

        </td></tr></tbody></table><br><small><span style="font-weight: bold;"></span></small><br>
  	<div style="text-align: center;"><input value="<?php echo $lg_CDC_SUPPRESSION; ?>" type="submit"></div></form><br>

	<?php
	// Définition du log principal
	?>

	<hr style="width: 100%; height: 2px;">
	<form name="objForm" method="post" action="./admin.php?contenu=validation_logprincipal&langue=<?php echo $langue; ?>" enctype="multipart/form-data">
  	<div style="text-align: left;"><span style="color: rgb(153, 0, 0); font-family: Comic Sans MS; font-weight: bold;"><a
 	name="LOG_PRINCIPAL"></a><?php echo $lg_CDC_gestlogselection; ?> - <?php echo $lg_CDC_paramenteteactuellement; ?> "<?php echo $logbook_principal; ?>"</span></div><br>
  	<table style="background-color: rgb(204, 204, 204); width: 1000px; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
    	<tbody><tr align="center"><td style="background-color: rgb(51, 51, 51); width: 680px;" colspan="2" rowspan="1"><span style="font-family: Arial; font-weight: bold; color: rgb(255, 255, 0);"><?php echo $lg_CDC_gestloglgn14; ?><span
 	style="color: rgb(0, 0, 153);"> HamLog</span><span style="color: rgb(0, 0, 0);">Web</span></span></td>
      	</tr><tr align="center"><td style="width: 680px;" colspan="2"
 	rowspan="1"><small><span style="font-family: Arial;"><small><span
 	style="font-style: italic;"><?php echo $lg_CDC_gestloglgn15; ?><br style="font-style: italic;">
        </span><span style="font-style: italic;"><?php echo $lg_CDC_gestloglgn16; ?></span></small></span></small></td>
	</tr><tr><td style="width: 300px;"><small><span style="font-family: Arial;"><?php echo $lg_CDC_gestloglgn17; ?> <span style="color: rgb(0, 0, 153); font-weight: bold;">HamLog</span><span
 	style="font-weight: bold;">Web</span></span><span
 	style="font-family: Arial;"></span></small></td>
        <td style="width: 680px;">
	<?php
	$sql = 'SELECT DISTINCT `LOG` FROM `'.$db_table.'_LOG`';
	$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LOG  ". $lg_CDC_Error04. mysql_error());  }
	?><select name="LOG_PRINCIPAL_LISTE"><?php
	while ($ligne=@mysql_fetch_row($result))
		{
		if (!($ligne[0]==""))   // on évacue le cas des QSO non affectés à un call
			{
			?><option><?php echo $ligne[0]; ?></option><?php
			}
		}
	?></select>
        </td></tr></tbody></table><br><small><span style="font-weight: bold;"></span></small><br><div style="text-align: center;"><input
 	value="<?php echo $lg_CDC_SELECTION; ?>" type="submit"></div></form><br>

	<?php
	// Informations
	?>

	<hr style="width: 100%; height: 2px;"><span style="color: rgb(153, 0, 0); font-family: Comic Sans MS; font-weight: bold;">
	<a name="LOG_INFO"></a><?php echo $lg_CDC_gestloginfo; ?><br><br></span>
	<table style="background-color: rgb(192, 192, 192); text-align: left; margin-left: auto; margin-right: auto; width: 775px;" border="0" cellpadding="2" cellspacing="2">
  	<tbody><tr><td style="font-family: Arial; font-weight: bold; text-align: center; background-color: rgb(51, 51, 51); color: rgb(255, 255, 0); width: 156px;">log</td>
      	<td style="font-family: Arial; font-weight: bold; text-align: center; background-color: rgb(51, 51, 51); color: rgb(255, 255, 0); width: 115px;">QSO</td>
      	<td style="font-family: Arial; font-weight: bold; text-align: center; background-color: rgb(51, 51, 51); color: rgb(255, 255, 0); width: 115px;">DXCC</td>
      	<td style="font-family: Arial; font-weight: bold; text-align: center; background-color: rgb(51, 51, 51); color: rgb(255, 255, 0); width: 115px;"><?php echo $lg_CDC_gestloglgn18; ?></td>
    	</tr>

	<?php
	$sql = 'SELECT DISTINCT `LOG` FROM `'.$db_table.'_LOG`';
	$result0 = @mysql_query($sql); if (!$result0) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LOG  - ".$lg_CDC_Error04. mysql_error());  }
	while ($ligne=@mysql_fetch_row($result0))
		{
		// Calcul des données associées au call ligne[0]

		// Récupération nombre total de qso
		$sql = 'SELECT * FROM `'.$db_table.'_LOG` WHERE `LOG` LIKE \''.$ligne[0].'\'';
		$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LOG  - ".$lg_CDC_Error04 . mysql_error());  }
		$nbqso = @mysql_num_rows($result);

		// Calcul du nombre de DXCC contactés
		$dxccsql = 'SELECT DISTINCT NUM, UK FROM `'.$db_table.'_DXCC`, `'.$db_table.'_LOG` WHERE `NUM` LIKE '.$db_table.'_LOG.DXCC AND `LOG` LIKE \''.$ligne[0].'\'';
		$dxccresult = @mysql_query($dxccsql); if (!$dxccresult) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_DXCC  - ".$lg_CDC_Error04 . mysql_error());  }
		$nbdxcc = @mysql_num_rows($dxccresult);
		
		// Affichage des stats du log associé au call ligne[0]
		?>
		<tr><td style="width: 156px; font-family: Arial; text-align: center; font-weight: bold;"><?php echo $ligne[0]; ?></td>
      		<td style="width: 115px; font-family: Arial; text-align: center;"><?php echo $nbqso; ?></td>
      		<td style="width: 115px; font-family: Arial; text-align: center;"><?php echo $nbdxcc; ?></td>
      		<td style="width: 115px; font-family: Arial; text-align: center;"><?php 

		if ($logbook_principal==$ligne[0])
			{
			?><img alt="" src="../img/VoyantVert.gif"; ><?php
			}

		?></td>
    		</tr>
		<?php
		}
	?>

  	</tbody></table>
	<BR>

	<?php

	// fermeture session sur le serveur MySQL
	@mysql_close($link);
	}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// FONCTION StatLogPrincipal($callimport)
//
// Mise à jour des stats pour la page d'accueil en fonction du log principal
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function StatLogPrincipal($callimport)
	{
	global $db_host,$db_login,$db_psw,$db_base,$db_table;
	global $lg_CDC_Error01, $lg_CDC_Error02, $lg_CDC_Error03, $lg_CDC_Error04, $langue, $lg_CDC_gestqsllgn24, $lg_CDC_gestqsllgn25,
		$lg_CDC_gestqsllgn26, $lg_CDC_gestqsllgn27;

	AffichageLigneAdmin($lg_CDC_gestqsllgn24.$callimport);
	
	// Récupération nombre total de qso
	$sql = 'SELECT * FROM `'.$db_table.'_LOG` WHERE `LOG` LIKE \''.$callimport.'\'';
	$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LOG  - ".$lg_CDC_Error04 . mysql_error());  }
	$nbqso = @mysql_num_rows($result);
	AffichageLigneAdmin($lg_CDC_gestqsllgn25.$callimport." : " . $nbqso);
	
	$sql = 'UPDATE `'.$db_table.'_CONFIG` SET `VALEUR` = \''.$nbqso.'\' WHERE `'.$db_table.'_CONFIG`.`NOMVAR` = \'stat_nbqso\';'; 
	$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_CONFIG  - ".$lg_CDC_Error04. mysql_error());  }
	
	
	// Calcul du nombre de DXCC contactés
	$dxccsql = 'SELECT DISTINCT NUM, UK FROM `'.$db_table.'_DXCC`, `'.$db_table.'_LOG` WHERE `NUM` LIKE '.$db_table.'_LOG.DXCC AND `LOG` LIKE \''.$callimport.'\'';
	$dxccresult = @mysql_query($dxccsql); if (!$dxccresult) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_DXCC  - ".$lg_CDC_Error04. mysql_error());  }
	$nbdxcc = @mysql_num_rows($dxccresult);
	AffichageLigneAdmin($lg_CDC_gestqsllgn26.$callimport." : " . $nbdxcc);

	$sql = 'UPDATE `'.$db_table.'_CONFIG` SET `VALEUR` = \''.$nbdxcc.'\' WHERE `'.$db_table.'_CONFIG`.`NOMVAR` = \'stat_nbdxcccontactes\';'; 
	$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_CONFIG  - ".$lg_CDC_Error04 . mysql_error());  }
	
	// Calcul du nombre de DXCC confirmés, le calcul se fait sur la base du champs QSL_RCVD de la table log
	$dxccsql = 'SELECT DISTINCT NUM, UK FROM `'.$db_table.'_DXCC`, `'.$db_table.'_LOG` WHERE `NUM` LIKE '.$db_table.'_LOG.DXCC AND '.$db_table.'_LOG.QSL_RCVD LIKE \'Y\' AND `LOG` LIKE \''.$callimport.'\'';  
	$dxccresult = @mysql_query($dxccsql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_DXCC  - ".$lg_CDC_Error04 . mysql_error());  }
	$nbdxccconfirmes = mysql_num_rows($dxccresult);
	AffichageLigneAdmin($lg_CDC_gestqsllgn27.$callimport." : " . $nbdxccconfirmes);

	$sql = 'UPDATE `'.$db_table.'_CONFIG` SET `VALEUR` = \''.$nbdxccconfirmes.'\' WHERE `'.$db_table.'_CONFIG`.`NOMVAR` = \'stat_nbdxccconfirmes\';'; 
	$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_CONFIG  - ".$lg_CDC_Error04. mysql_error());  }
	}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// FONCTION ValidationLogPrincipal($call)
//
// Gestion de la validation de la fonction de validation du log principal
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function ValidationLogPrincipal($callprincipal)
	{
	global $db_host,$db_login,$db_psw,$db_base,$db_table;
	global $logbook_principal;
	global $lg_CDC_Error01, $lg_CDC_Error02, $lg_CDC_Error03, $lg_CDC_Error04, $langue, $lg_CDC_gestqsllgn28, $lg_CDC_gestqsllgn29;

	// Récupération des variables postées
	$LOG_PRINCIPAL_LISTE		=addslashes($callprincipal);

	AffichageLigneAdmin($lg_CDC_gestqsllgn28.$LOG_PRINCIPAL_LISTE);

	// Connexion au serveur MySQL
	$link = @mysql_connect($db_host,$db_login,$db_psw) or AfficherErreur(1,$lg_CDC_Error01 . mysql_error());

	// Connexion à la base MySQL
	$db_selected = @mysql_select_db($db_base, $link); 
	if (!$db_selected) { AfficherErreur(1,$lg_CDC_Error02 . mysql_error()); }

	// Modification de la variable de configuration
	$sql = 'UPDATE `'.$db_table.'_CONFIG` SET `VALEUR` = \''.$LOG_PRINCIPAL_LISTE.'\' WHERE `'.$db_table.'_CONFIG`.`NOMVAR` = \'logbook_principal\'';
	$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_CONFIG  - ".$lg_CDC_Error04. mysql_error());  }
	
	// Mise à jour des stats pour la page d'accueil
	StatLogPrincipal($LOG_PRINCIPAL_LISTE);

	AffichageLigneAdmin($lg_CDC_gestqsllgn29);

	$logbook_principal=$callprincipal;

	Diplome_DXCC();
	}



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// FONCTION ValidationImportLog()
//
// Gestion de la validation de la fonction d'import d'un log
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function ValidationImportLog()
	{
	global $qso_call,$qso_date,$qso_dateMM,$qso_dateYY,$qso_time,$qso_band,$qso_mode,$qso_rst_sent,$qso_rst_rcvd,$qso_dxcc,$qso_freq,$qso_qsl_rcvd,$qso_qsl_sent,$qso_qsl_rcvd,$qso_dxccnumber,$qso_name,$qso_qth;
	global $db_host,$db_login,$db_psw,$db_base,$db_table;
	global $logbook_principal;
	global $lg_CDC_Error01, $lg_CDC_Error02, $lg_CDC_Error03, $lg_CDC_Error04, $langue, $lg_CDC_gestqsllgn26, $lg_CDC_gestqsllgn25,
		$lg_CDC_gestqsllgn30, $lg_CDC_gestqsllgn20, $lg_CDC_gestqsllgn31, $lg_CDC_gestqsllgn32, $lg_CDC_gestqsllgn33, $lg_CDC_gestqsllgn34,
		$lg_CDC_gestqsllgn35, $lg_CDC_gestqsllgn36, $lg_CDC_gestqsllgn37, $lg_CDC_gestqsllgn38, $lg_CDC_gestqsllgn39, $lg_CDC_gestqsllgn40,
		$lg_CDC_gestqsllgn41;
	
	// Récupération des variables postées
	$LOG_UP_ADIF		=addslashes($_POST["LOG_UP_ADIF"]);
	$LOG_ADIF		=addslashes($_POST["LOG_ADIF"]);
	$LOG_UP_CABRILLO	=addslashes($_POST["LOG_UP_CABRILLO"]);
	$LOG_UP_MULTIREQUETES	=addslashes($_POST["LOG_UP_MULTIREQUETES"]);
	$LOG_UP_CALL_LISTE	=addslashes($_POST["LOG_UP_CALL_LISTE"]);
	$LOG_UP_CALL_NEW	=addslashes($_POST["LOG_UP_CALL_NEW"]);
	$LOG_UP_DATE		=addslashes($_POST["LOG_UP_DATE"]);
	$LOG_UP_TIME		=addslashes($_POST["LOG_UP_TIME"]);
	$LOG_UP_DESCRIPTION	=addslashes($_POST["LOG_UP_DESCRIPTION"]);

	$Import=false;
	$ImportAdif=false;
	$ImportCabrillo=false;

	AffichageLigneAdmin($lg_CDC_gestqsllgn30);

	if ($LOG_ADIF=="")
		{
		if (!(move_uploaded_file($_FILES["LOG_UP_ADIF"]['tmp_name'],"../log/".$_FILES["LOG_UP_ADIF"]['name'])==false))
			{
			AffichageLigneAdmin($lg_CDC_gestqsllgn31.$_FILES["LOG_UP_ADIF"]['name']);
			$log_charge="../log/".$_FILES["LOG_UP_ADIF"]['name'];
			$Import=true; $ImportAdif=true;
			}
		else
			{
			AffichageLigneAdmin($lg_CDC_gestqsllgn32);
			}
		}
	else
		{
		$log_charge="../log/".$LOG_ADIF;
		AffichageLigneAdmin($lg_CDC_gestqsllgn33.$LOG_ADIF);
		$Import=true; $ImportAdif=true;	
		}



	// CABRILLO 
	// if (!(move_uploaded_file($_FILES["LOG_UP_CABRILLO"]['tmp_name'],"../log/".$_FILES["LOG_UP_CABRILLO"]['name'])==false))
	//	{
	//	echo "<BR>_Import d'un fichier log au format CABRILLO : ".$_FILES["LOG_UP_ADIF"]['name'];
	//	$log_charge="../log/".$_FILES["LOG_UP_CABRILLO"]['name'];
	//	$Import=true; $ImportCabrillo=true;
	//	}

	if (!($LOG_UP_CALL_LISTE==""))
		{
		$callimport=$LOG_UP_CALL_LISTE;
		}
	else
		{
		$callimport=$LOG_UP_CALL_NEW;
		}

	if ($callimport=="")
		{
		$Import=false;
		AffichageLigneAdmin($lg_CDC_gestqsllgn34);
		}
	else
		{
		$callimport=strtoupper($callimport);
		AffichageLigneAdmin($lg_CDC_gestqsllgn35.$callimport);
		}

	if ($Import==true)
		{
		AffichageLigneAdmin($lg_CDC_gestqsllgn36.$db_table."_LOG");

		// Connexion au serveur MySQL
		$link = @mysql_connect($db_host,$db_login,$db_psw) or AfficherErreur(1,$lg_CDC_Error01 . mysql_error());

		// Connexion à la base MySQL
		$db_selected = @mysql_select_db($db_base, $link); 
		if (!$db_selected) { AfficherErreur(1,$lg_CDC_Error02 . mysql_error()); }

		// Suppression du log précédent de l'indicatif concerné
		$sql = 'DELETE FROM `'.$db_table.'_LOG` WHERE `LOG` LIKE \''.$callimport.'\'';
		$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LOG  - ".$lg_CDC_Error04. mysql_error());  }

		// Ouverture du fichier log
		$fd=fopen($log_charge,"r");
		$fcsv=fopen("temp.csv","w");

		if ($ImportAdif==true)
			{
			$ligneadif=fgets($fd);
			while ((!strstr(strtolower($ligneadif),"<eoh>")) and (!(feof($fd))))
				{
				$ligneadif=fgets($fd);
				}

			// Import des QSO dans la table MySQL
			$restant="";
			while (!(feof($fd)))
				{
				// on lit des lignes jusqu'à avoir un <eor> et on rajoute le bout précédent...
				$ligneadif=trim(fgets($fd)); $line=$restant.$ligneadif;
				while ((!strstr(strtolower($ligneadif),"<eor>")) and (!(feof($fd))))
					{
					$ligneadif=trim(fgets($fd));
					$line=$line.$ligneadif;
					}
				if (strstr(strtolower($ligneadif),"<eor>"))
					{
					$restant=substr(strstr(strtolower($ligneadif),"<eor>"),5,strlen($ligneadif)-5);
					};
				if (ADIF_LigneCall($line)==true)
					{
					$qso_name	=addslashes($qso_name);
					$qso_qth	=addslashes($qso_qth);
					if ($LOG_UP_MULTIREQUETES=="on")
						{
						// Import QSO par QSO, gourmand en requètes MySQL
						$sql = 'INSERT INTO `'.$db_table.'_LOG` (`QSO_DATE`, `TIME_ON`, `CALL`, `BAND`, `MODE`, `DXCC`, `QSL_SENT`, `QSL_RCVD`, `LOG`, `NAME`, `QTH`) VALUES 				(\''.$qso_date.'\', \''.$qso_time.'\', \''.$qso_call.'\', \''.$qso_band.'\', \''.$qso_mode.'\', \''.$qso_dxcc.'\', \''.$qso_qsl_sent.'\', \''.$qso_qsl_rcvd.'\', \''.$callimport.'\', \''.$qso_name.'\', \''.$qso_qth.'\')';
						$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LOG  - ".$lg_CDC_Error04 . mysql_error());  }
						}
					else
						{
						// Sinon préparation d'un fichier CSV pour import massif
						$chaine= "\"".$qso_date."\";\"".$qso_time."\";\"".$qso_call."\";\"".$qso_band."\";\"".$qso_mode."\";\"".$qso_dxcc."\";\"".$qso_qsl_sent."\";\"".$qso_qsl_rcvd."\";\"".$callimport."\";\"".$qso_name."\";\"".$qso_qth."\"\r\n";
						fwrite($fcsv,$chaine);
						}
					}				
				}

			}

		// CABRILLO
		// if ($ImportCabrillo==true)
		//	{
		//	}


		// Fermeture du fichier log
		fclose($fd);
		fclose($fcsv);
			
		if (!($LOG_UP_MULTIREQUETES=="on"))
			{
			// à ce stade, le fichier temp.csv est créé, il reste à le déverser dans la base de données mysql
			$sql = 'LOAD DATA LOCAL INFILE \'temp.csv\' 
				REPLACE INTO TABLE `'.$db_table.'_LOG` 
				FIELDS 
				TERMINATED BY \';\' 
				ENCLOSED BY \'"\' 
				ESCAPED BY \'|\' 
				LINES 
				TERMINATED BY \'\\r\\n\' 
				';
			$result = mysql_query($sql);
			}

		// Récupération nombre total de qso
		$sql = 'SELECT * FROM `'.$db_table.'_LOG` WHERE `LOG` LIKE \''.$callimport.'\'';
		$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LOG  - ".$lg_CDC_Error04 . mysql_error());  }
		$nbqso = @mysql_num_rows($result);
		AffichageLigneAdmin($lg_CDC_gestqsllgn25.$callimport.' : ' . $nbqso);	

		// Calcul du nombre de DXCC contactés
		$dxccsql = 'SELECT DISTINCT NUM, UK FROM `'.$db_table.'_DXCC`, `'.$db_table.'_LOG` WHERE `NUM` LIKE '.$db_table.'_LOG.DXCC AND `LOG` LIKE \''.$callimport.'\'';
		$dxccresult = @mysql_query($dxccsql); if (!$dxccresult) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_DXCC  - ".$lg_CDC_Error04. mysql_error());  }
		$nbdxcc = @mysql_num_rows($dxccresult);
		AffichageLigneAdmin($lg_CDC_gestqsllgn26.$callimport.' : ' . $nbdxcc);

		// effacement du fichier log téléchargé
		unlink($log_charge);
	

		// si il s'agit de l'import du log principal, les stats sont à mettre à jour
		if ($callimport==$logbook_principal)
			{
			StatLogPrincipal($callimport);
			}

		// si pas de log principal de défini, c'est celui ci par défaut
		if ($logbook_principal=="")
			{
			$logbook_principal=addslashes($callimport);
			ValidationLogPrincipal($logbook_principal);
			}

		// Sauvegarde des données connexes au call dans la base _LISTELOG
		if ($LOG_UP_DATE=="on") { $LOG_UP_DATE="Y"; } else { $LOG_UP_DATE="N"; }
		if ($LOG_UP_TIME=="on") { $LOG_UP_TIME="Y"; } else { $LOG_UP_TIME="N"; }
		$sql = 'DELETE FROM `'.$db_table.'_LISTELOG` WHERE `INDICATIF` LIKE \''.$callimport.'\'';
		$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LISTELOG  - ".$lg_CDC_Error04. mysql_error());  }
		$sql = 'INSERT INTO `'.$db_table.'_LISTELOG` (`INDICATIF`, `AFFDATE`, `AFFTIME`, `DESCRIPT`) VALUES (\''.$callimport.'\', \''.$LOG_UP_DATE.'\', \''.$LOG_UP_TIME.'\', \''.$LOG_UP_DESCRIPTION.'\');';
		$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LISTELOG  - ".$lg_CDC_Error04 . mysql_error());  }


		// Mise en forme texte d'affichage de la dernière mise à jour
		$fl=fopen("../Derniere_MAJ.txt","w");
		fwrite($fl,$lg_entete_derniereMAJ." log ".$callimport." - ".date("d/m/y"));
		fclose($fl);

		AffichageLigneAdmin($lg_CDC_gestqsllgn37);

		$dxccsql = 'SELECT DISTINCT NUM, UK FROM `'.$db_table.'_DXCC`, `'.$db_table.'_LOG` WHERE `NUM` LIKE '.$db_table.'_LOG.DXCC ORDER BY `UK` ASC';
		$dxccresult = @mysql_query($dxccsql); 

		$fl=fopen("../DXCC_Contactes.lst","w");
		while ($dxccligne=@mysql_fetch_row($dxccresult))
			{
			fwrite($fl,$dxccligne[0]."\r\n");
			fwrite($fl,$dxccligne[1]."\r\n");
			}
		fclose($fl);

		AffichageLigneAdmin($lg_CDC_gestqsllgn38);
		
		$sql 	= 'SELECT * FROM `'.$db_table.'_QSL` ';
		$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_QSL  - ".$lg_CDC_Error04 . mysql_error());  }
		while ($ligne=@mysql_fetch_row($result))
			{
			// Pour chaque item de la table _QSL, on va contrôler le DXCC associé
			$sql2 	 = 'SELECT * FROM `'.$db_table.'_LOG` WHERE `QSO_DATE` = \''.$ligne[2].'\' AND `TIME_ON` = \''.$ligne[3].'\' AND `CALL` = \''.$ligne[1].'\'';
			$result2 = @mysql_query($sql2); if (!$result2) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LOG  - ".$lg_CDC_Error04. mysql_error());  }
			$ligne2	 = @mysql_fetch_row($result2);
			if ($ligne2==false)
				{
				AffichageLigneAdmin($lg_CDC_gestqsllgn39.$ligne[1]." / ".$ligne[2]." / ".$ligne[3]);
				}
			else
				{
				if (!($ligne[0]==$ligne2[5]))
					{
					AffichageLigneAdmin($lg_CDC_gestqsllgn40.$ligne[1]." / ".$ligne[2]." / ".$ligne[3]);
					$sql2 	 = 'UPDATE `'.$db_table.'_QSL` SET `DXCC` = \''.$ligne2[5].'\' WHERE `'.$db_table.'_QSL`.`DXCC` = \''.$ligne[0].'\' AND `'.$db_table.'_QSL`.`CALL` = \''.$ligne[1].'\' AND `'.$db_table.'_QSL`.`QSL_DATE` = \''.$ligne[2].'\' AND `'.$db_table.'_QSL`.`QSL_TIME` = \''.$ligne[3].'\' ';
					$result2 = @mysql_query($sql2); if (!$result2) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_QSL  - ".$lg_CDC_Error04 . mysql_error());  }
					}
				}

			}

		// fermeture session sur le serveur MySQL
		@mysql_close($link);

		}
	else
		{
		AffichageLigneAdmin($lg_CDC_gestqsllgn41);
		}
		
	AffichageLigneAdmin($lg_CDC_gestqsllgn20);	

	if ($logbook_principal==$callimport)   { Diplome_DXCC(); }
		
	}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// FONCTION ValidationSuppressionLog()
//
// Gestion de la validation de la fonction de suppression
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function ValidationSuppressionLog()
	{
	global $db_host,$db_login,$db_psw,$db_base,$db_table;
	global $lg_CDC_Error01, $lg_CDC_Error02, $lg_CDC_Error03, $lg_CDC_Error04, $langue, $lg_CDC_gestqsllgn42, $lg_CDC_gestqsllgn20;

	// Récupération des variables postées
	$LOG_DEL_LISTE		=addslashes($_POST["LOG_DEL_LISTE"]);

	AffichageLigneAdmin($lg_CDC_gestqsllgn42.$LOG_DEL_LISTE);

	// Connexion au serveur MySQL
	$link = @mysql_connect($db_host,$db_login,$db_psw) or AfficherErreur(1,$lg_CDC_Error01 . mysql_error());

	// Connexion à la base MySQL
	$db_selected = @mysql_select_db($db_base, $link); 
	if (!$db_selected) { AfficherErreur(1,$lg_CDC_Error02 . mysql_error()); }

	// Suppression du log précédent de l'indicatif concerné
	$sql = 'DELETE FROM `'.$db_table.'_LOG` WHERE `LOG` LIKE \''.$LOG_DEL_LISTE.'\'';
	$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_LOG  - ".$lg_CDC_Error04 . mysql_error());  }
	
	// fermeture session sur le serveur MySQL
	@mysql_close($link);

	AffichageLigneAdmin($lg_CDC_gestqsllgn20);
	}



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// FONCTION AffichageValidation(contenu:string);
//
// Sauvegarde d'un panneau de configuration
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function AffichageValidation($nomdupanneau)
	{
	global  $lg_valide_code_libelle, $lg_valide_code;
	global  $logbook_info, $logbook_hw;
	global  $infoqsl_Fichier;
	global  $db_host,$db_login,$db_psw,$db_base,$db_table;
	global  $qslcards_vignette;
	global  $site_www;
	global $lg_CDC_Error01, $lg_CDC_Error02, $lg_CDC_Error03, $lg_CDC_Error04, $langue, $lg_CDC_MiseAJourEffectuee, $lg_CDC_ThemeSauvegarde,
		$lg_CDC_ThemeCharge;

	if ($nomdupanneau=="paramgeneraux") 		{ $trigramme="PPG"; }
	if ($nomdupanneau=="paramlinguistiques") 	{ $trigramme="PPL"; }
	if ($nomdupanneau=="paramcouleurs") 		{ $trigramme="PPC"; }
	if ($nomdupanneau=="parammenu") 		{ $trigramme="PMN"; }
	if ($nomdupanneau=="pageaccueil") 		{ $trigramme="CAC"; }
	if ($nomdupanneau=="pageentete") 		{ $trigramme="CEN"; }
	if ($nomdupanneau=="pagelogbook") 		{ $trigramme="CLB"; }
	if ($nomdupanneau=="pageinfoqsl") 		{ $trigramme="CIQ"; }
	if ($nomdupanneau=="pagecartesqsl") 		{ $trigramme="CCQ"; }
	if ($nomdupanneau=="pagelivredor") 		{ $trigramme="CLO"; }
	if ($nomdupanneau=="diplome_dxcc") 		{ $trigramme="DDX"; }

	// Connexion au serveur MySQL
	$link = @mysql_connect($db_host,$db_login,$db_psw) or AfficherErreur(1,$lg_CDC_Error01. mysql_error());

	// Connexion à la base MySQL
	$db_selected = @mysql_select_db($db_base, $link); if (!$db_selected) { AfficherErreur(1,$lg_CDC_Error02 . mysql_error()); }

	$sql = 'SELECT * FROM `'.$db_table.'_CONFIG`';

	$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_CONFIG  - ".$lg_CDC_Error04 . mysql_error());  }

	while ($ligne=@mysql_fetch_row($result))
		{
		$i=0;
		while ($i<15)
			{
			$ligne[$i]=stripslashes($ligne[$i]);
			$i=$i+1;
			}
		if ($ligne[0]==$trigramme)
			{
			$champs_nom		= $ligne[1];
			$champs_type		= $ligne[4];
			$champs_longueur	= $ligne[2];
			$champs_libelle		= $ligne[9];
			$champs_newvaleur	= addslashes($_POST[$champs_nom]);

			if ($champs_type=="TXT")
				{
				if ($champs_nom=="qsl_call") 		{ $qsl_call=$champs_newvaleur;  $champs_newvaleur="";}
				$ligne[3]=$champs_newvaleur;
				}

			if ($champs_type=="FIM")
				{
				if (!($_FILES[$champs_nom]['name']==""))
					{
					// Lecture Répertoire destination
					$IMG_RepDestination 	= $ligne[5];
					$ligne[3]=$IMG_RepDestination.$_FILES[$champs_nom]['name'];
					move_uploaded_file($_FILES[$champs_nom]['tmp_name'],".".$IMG_RepDestination.$_FILES[$champs_nom]['name']);
					}
				}


			if ($champs_type=="FIC")
				{
				$champs_valeur		= $ligne[3];
				// dans le cas du type FIC, la variable config.php contient en fait le répertoire de destination et non le nom du fichier
				move_uploaded_file($_FILES[$champs_nom]['tmp_name'],$champs_valeur.$_FILES[$champs_nom]['name']);
				}

			if ($champs_type=="FIK")
				{
				$FIK_Langue		= "fr";
				$FIK_rep		= "./img/";
				if (trim($_FILES[$FIK_Langue.$champs_nom]['name'])=="")
					{
					$ligne[5]="";
					}
				else
					{
					$ligne[5]=trim($FIK_rep).trim($_FILES[$FIK_Langue.$champs_nom]['name']);
					}
				move_uploaded_file(trim($_FILES[$FIK_Langue.$champs_nom]['tmp_name']),".".trim($FIK_rep).trim($_FILES[$FIK_Langue.$champs_nom]['name']));
				$FIK_Langue		= "uk";
				$FIK_rep		= "./img/";
				if (trim($_FILES[$FIK_Langue.$champs_nom]['name'])=="")
					{
					$ligne[6]="";
					}
				else
					{
					$ligne[6]=trim($FIK_rep).trim($_FILES[$FIK_Langue.$champs_nom]['name']);
					}
				move_uploaded_file(trim($_FILES[$FIK_Langue.$champs_nom]['tmp_name']),".".trim($FIK_rep).trim($_FILES[$FIK_Langue.$champs_nom]['name']));
				}

			if ($champs_type=="TML")
				{
				$TML_Langue		= "fr";
				$champs_newvaleur	= $_POST[$TML_Langue.$champs_nom];
				$ligne[5]=$champs_newvaleur;
				$TML_Langue		= "uk";
				$champs_newvaleur	= $_POST[$TML_Langue.$champs_nom];
				$ligne[6]=$champs_newvaleur;
				}

			if ($champs_type=="BOL")
				{
				if ($champs_newvaleur=="on")
					{ 
					$ligne[3]="true";
					}
				else
					{ 
					$ligne[3]="false";
					}

							}

			if ($champs_type=="LST")
				{
				$ligne[3]=$champs_newvaleur;
				}

			if ($champs_type=="CLR")
				{
				$ligne[3]=$champs_newvaleur;
				}
				
			$sql = 'UPDATE `'.$db_table.'_CONFIG` SET `VALEUR` = \''.addslashes($ligne[3]).'\', `OPTION2` = \''.addslashes($ligne[5]).'\', `OPTION3` = \''.addslashes($ligne[6]).'\', `OPTION4` = \''.addslashes($ligne[7]).'\', `OPTION5` = \''.addslashes($ligne[8]).'\', `ADMINFR` = \''.addslashes($ligne[9]).'\', `ADMINUK` = \''.addslashes($ligne[10]).'\', `ADMIN03` = \''.addslashes($ligne[11]).'\', `ADMIN04` = \''.addslashes($ligne[12]).'\', `ADMIN05` = \''.addslashes($ligne[13]).'\', `ADMIN06` = \''.addslashes($ligne[14]).'\' WHERE `NOMVAR` = \''.$champs_nom.'\' LIMIT 1;';
			$result2 = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_CONFIG  - ".$lg_CDC_Error04 . mysql_error());  }
			}

		}


	// fermeture session sur le serveur MySQL
	@mysql_close($link);	

	?>
	<div style="text-align: center;"><span style="font-family: Comic Sans MS; color: rgb(153, 0, 0); font-weight: bold;">
	<br><?php echo $lg_CDC_MiseAJourEffectuee; ?><br></span>
	<?php

	// SAUVEGARDE D'UN THEME COULEURS
	$ThemeASauver	= $_POST["THEMESAUVEGARDE"];
	if (!($ThemeASauver=="")) 
		{
		// Si le thème est à sauvegarder, alors on sauve les paramètres couleurs dans un fichier
		// Connexion au serveur MySQL
		$link = @mysql_connect($db_host,$db_login,$db_psw) or AfficherErreur(1,$lg_CDC_Error01 . mysql_error());

		// Connexion à la base MySQL
		$db_selected = @mysql_select_db($db_base, $link); if (!$db_selected) { AfficherErreur(1,$lg_CDC_Error02 . mysql_error()); }

		$sql = 'SELECT * FROM `'.$db_table.'_CONFIG` WHERE `RUBRIQUE` LIKE \'PPC\'';
		
		$result = @mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_CONFIG  - ".$lg_CDC_Error04 . mysql_error());  }

		@unlink("./themescouleurs/".$ThemeASauver.".TCL");
		$fd=fopen("./themescouleurs/".$ThemeASauver.".TCL","w");

		while ($ligne=mysql_fetch_row($result))
			{
			fwrite($fd,$ligne[1]."\r\n");
			fwrite($fd,$ligne[3]."\r\n");
			}
		fclose($fd);

		// fermeture session sur le serveur MySQL
		@mysql_close($link);

		?>
		<div style="text-align: center;"><span style="font-family: Comic Sans MS; color: rgb(153, 0, 0); font-weight: bold;">
		<br><?php echo $lg_CDC_ThemeSauvegarde; ?>"<?php echo $ThemeASauver; ?>" ...<br></span>
		<?php
		}

	// CHARGEMENT D'UN THEME COULEURS
	$ThemeACharger	= $_POST["THEMECHARGEMENT"];
	if (!($ThemeACharger=="")) 
		{
		// Connexion au serveur MySQL
		$link = @mysql_connect($db_host,$db_login,$db_psw) or AfficherErreur(1,$lg_CDC_Error01. mysql_error());

		// Connexion à la base MySQL
		$db_selected = @mysql_select_db($db_base, $link); if (!$db_selected) { AfficherErreur(1,$lg_CDC_Error02. mysql_error()); }

		$ft=fopen("./themescouleurs/".$ThemeACharger.".TCL","r");

		while (!(feof($ft)))
			{
			$couleurnomvar=fgets($ft,4096);
			$couleurvaleur=fgets($ft,4096);
			$sql = 'UPDATE `'.$db_table.'_CONFIG` SET `VALEUR` = \''.trim($couleurvaleur).'\' WHERE `NOMVAR` = \''.trim($couleurnomvar).'\'';
			$result = mysql_query($sql); if (!$result) { AfficherErreur(1,$lg_CDC_Error03.$db_table."_CONFIG  - ".$lg_CDC_Error04 . mysql_error());  }
			}

		fclose($ft);

		// fermeture session sur le serveur MySQL
		@mysql_close($link);

		?>
		<div style="text-align: center;"><span style="font-family: Comic Sans MS; color: rgb(153, 0, 0); font-weight: bold;">
		<br><?php echo $lg_CDC_ThemeCharge; ?> "<?php echo $ThemeACharger; ?>" ...<br></span>
		<?php
		}
		
	// En cas de validation du panneau couleur, mettre à jour la feuille de style du blog
	if ($trigramme=="PPC")
		{
		unlink("../blog/themes/F5AGL/style.css");
		$fs=fopen("../blog/themes/F5AGL/style.hlw","r");
		$fd=fopen("../blog/themes/F5AGL/style.css","w");
	
		// Connexion au serveur MySQL
		$link = @mysql_connect($db_host,$db_login,$db_psw) or AfficherErreur(1,$lg_CDC_Error01 . mysql_error());

		// Connexion à la base MySQL
		$db_selected = @mysql_select_db($db_base, $link); if (!$db_selected) { AfficherErreur(1,$lg_CDC_Error02 . mysql_error()); }

		while (!(feof($fs)))
			{
			$ligne=fgets($fs,4096);
			if (substr($ligne,0,5)=="[CDC]")
				{
				$code = substr(trim(strstr($ligne,"$")),1,strlen(trim(strstr($ligne,"$")))-1);
				fwrite($fd,"     ".substr($ligne,5,strlen($ligne)-8-strlen($code)));
				
				// reste à trouver le code de substitution

				$sql = 'SELECT * FROM `'.$db_table.'_CONFIG` WHERE `NOMVAR` LIKE \''.$code.'\'';

				$result = @mysql_query($sql); 

				$lignesql=@mysql_fetch_row($result);

				$valeur = $lignesql[3].";\r\n";

				fwrite($fd,$valeur);
				}
			else
				{
				fwrite($fd,$ligne);
				}
			}
		fclose($fs);
		fclose($fd);
		}

	// En cas de validation du panneau menu, mettre à jour MENU.SUP
	if ($trigramme=="PMN")
		{
		if (file_exists("../menu.tmp")) { unlink("../menu.tmp"); }
		$fm=fopen("../menu.tmp","w");
		$i=0;
		while (!($lg_valide_code[$i]=="#"))
			{
			fwrite($fm,"[".$lg_valide_code[$i]."]\r\n");
			$j=1;
			$NomDuLien	= $_POST[$lg_valide_code[$i].$j."link"];
			$NomDuText	= $_POST[$lg_valide_code[$i].$j."text"];
			$AGarder	= $_POST[$lg_valide_code[$i].$j."suppression"];
			while (!($NomDuLien==""))
				{
				if (!($AGarder=="on"))
					{
					fwrite($fm,$NomDuLien."\r\n");
					fwrite($fm,$NomDuText."\r\n");
					}
				$j=$j+1;
				$NomDuLien	= $_POST[$lg_valide_code[$i].$j."link"];
				$NomDuText	= $_POST[$lg_valide_code[$i].$j."text"];
				$AGarder	= $_POST[$lg_valide_code[$i].$j."suppression"];
				}
			$NomDuLien	= $_POST[$lg_valide_code[$i]."AjoutLien"];
			$NomDuText	= $_POST[$lg_valide_code[$i]."AjoutLibelle"];
			if (!($NomDuLien==""))
				{
				fwrite($fm,$NomDuLien."\r\n");
				fwrite($fm,$NomDuText."\r\n");
				}
			fwrite($fm,"[end]\r\n\r\n");
			$i=$i+1;
			}
		fclose($fm);
		unlink("../menu.sup");
		rename("../menu.tmp","../menu.sup");
		}

	
	}
 


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// GESTION DES DIPLOMES
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function Menu_Diplomes()
	{
	?>
	<div style="text-align: center;"><small style="font-weight: bold;">[ <a href="./admin.php?contenu=diplome_dxcc&langue=<?php echo $langue; ?>">DXCC</a> ]</small>
	<span style="font-weight: bold;"></span><br>
	</div>
	<?php
	}

function GestionDiplomes()
	{
	Menu_Diplomes();
	}

function GestionDiplome_DXCC()
	{
	Menu_Diplomes();
	AffichageForm("DIPLOME DXCC");
	}



       	
?>

<body
 style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"
 alink="#000099" link="#000099" vlink="#990099">
<div style="text-align: center;">
<div style="text-align: left;"><big
 style="font-family: Comic Sans MS; font-weight: bold; color: rgb(0, 0, 153);"><big><big><big>HamLog</big></big></big></big><big
 style="font-family: Comic Sans MS; color: rgb(102, 102, 102); font-weight: bold;"><big><big><big>Web
- <span style="color: rgb(153, 0, 0);"><?php echo $lg_CDC_titre; ?></span></big></big></big></big><br>
</div>
<div style="text-align: left; margin-left: 0px; width: 1205px;">
<div style="margin-left: 40px;">
<div style="margin-left: 0px; width: 1176px;"><a
 href="./admin.php?contenu=<?php echo $contenu; ?>&langue=fr"><img
 style="border: 0px solid ; width: 28px; height: 20px;" alt=""
 src="./Img/drapeaufr.gif"></a>
<a href="./admin.php?contenu=<?php echo $contenu; ?>&langue=uk"><img
 style="border: 0px solid ; width: 28px; height: 20px;" alt=""
 src="./Img/drapeauuk.gif"></a><span
 style="font-family: Arial; font-weight: bold; color: rgb(0, 0, 153);">&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; <?php echo $lg_CDC_par; ?>
 <a href="mailto:f5agl@zapgillou.fr">F5AGL
</a><br>
</span></div>
<span
 style="font-family: Arial; font-weight: bold; color: rgb(0, 0, 153);"></span></div>
<span
 style="font-family: Arial; font-weight: bold; color: rgb(0, 0, 153);"></span>
<hr style="width: 100%; height: 2px;"><span
 style="font-family: Arial; font-weight: bold; color: rgb(0, 0, 153);"></span>
<div style="text-align: left; font-family: Arial; margin-left: 0px;">
<div style="text-align: center;"></div>
<table style="text-align: left;" border="0"
 cellpadding="2" cellspacing="2">
  <tbody>
    <tr>
      <td
 style="width: 236px; font-weight: bold; text-align: center;"></td>
      <td style="font-weight: bold;"><small>[
      <a href="./admin.php?contenu=accueil&langue=<?php echo $langue; ?>"><?php echo $lg_CDC_menuhome; ?></a>
] -&nbsp;[ <a href="../index.php"><?php echo $lg_CDC_menuretour; ?></a>
]</small></td>
    </tr>
    <tr>
      <td style="width: 236px; font-weight: bold;"><small><?php echo $lg_CDC_menuparametres; ?></small></td>
      <td style="font-weight: bold;"><small>
[ <a href="./admin.php?contenu=paramgeneraux&langue=<?php echo $langue; ?>"><?php echo $lg_CDC_menugénéraux; ?></a>
] - [ <a href="./admin.php?contenu=paramlinguistiques&langue=<?php echo $langue; ?>"><?php echo $lg_CDC_menulinguistiques; ?></a>
] - [ <a href="./admin.php?contenu=paramcouleurs&langue=<?php echo $langue; ?>"><?php echo $lg_CDC_menucouleurs; ?></a>
] - [ <a href="./admin.php?contenu=parammenu&langue=<?php echo $langue; ?>"><?php echo $lg_CDC_menumenu; ?></a>
]</small></td>
    </tr>
    <tr>
      <td style="width: 236px; font-weight: bold;"><small><?php echo $lg_CDC_menuconfigpages; ?></small></td>
      <td style="font-weight: bold;"><small>[
      <a href="./admin.php?contenu=pageentete&langue=<?php echo $langue; ?>"><?php echo $lg_CDC_menuentete; ?></a>
] - [ <a href="./admin.php?contenu=pageaccueil&langue=<?php echo $langue; ?>"><?php echo $lg_CDC_menuaccueil; ?></a>
] - [ <a href="./admin.php?contenu=pagelogbook&langue=<?php echo $langue; ?>"><?php echo $lg_CDC_menulogbook; ?></a>
]
- [ <a href="./admin.php?contenu=pageblog&langue=<?php echo $langue; ?>"><?php echo $lg_CDC_menublog; ?></a>
] - [ <a href="./admin.php?contenu=pageinfoqsl&langue=<?php echo $langue; ?>"><?php echo $lg_CDC_menuinfoQSL; ?></a>
] - [ <a href="./admin.php?contenu=pagecartesqsl&langue=<?php echo $langue; ?>"><?php echo $lg_CDC_menucartesQSL; ?></a> ] - [ <a href="./admin.php?contenu=pagelivredor&langue=<?php echo $langue; ?>"><?php echo $lg_CDC_menulivredor; ?></a> ] - [ <a href="./admin.php?contenu=diplomes&langue=<?php echo $langue; ?>"><?php echo $lg_CDC_menudiplomes; ?></a>
]</small></td>
    </tr>
    <tr>
      <td style="width: 236px; font-weight: bold;"><small><?php echo $lg_CDC_menucontenu; ?></small></td>
      <td style="font-weight: bold;"><small>[
      <a href="./admin.php?contenu=contenulog&langue=<?php echo $langue; ?>"><?php echo $lg_CDC_menugestionlog; ?></a>
] - [ <a href="./admin.php?contenu=contenuqsl&langue=<?php echo $langue; ?>"><?php echo $lg_CDC_menugestionqsl; ?></a>
]</small></td>
    </tr>
  </tbody>
</table>
<div style="text-align: left;">
<hr style="width: 100%; height: 2px;"></div>
</div>
</div>
</div>




<?php

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// GESTION VALIDATION
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

switch ($contenu) 
	{
	case "contenulog"			:	AffichageGestionLog(); break;
	case "validation_importlog" 		: 	ValidationImportLog(); break; 
	case "validation_suppressionlog"	: 	ValidationSuppressionLog(); break;
	case "validation_logprincipal"		: 	ValidationLogPrincipal($_POST["LOG_PRINCIPAL_LISTE"]); break;

	case "contenuqsl"			:	AffichageGestionQSL(); break;
	case "validation_importqsl"		:	ValidationImportQslPhase1(); break;
	case "validation_qsoqsl"		:	ValidationImportQslPhase2(); break;
	case "validation_suppressionqsl"	:	ValidationSuppressionQSL(); break;

	case "paramgeneraux"			:	AffichageForm($lg_CDC_paramgeneraux); break;
	case "paramlinguistiques"		: 	AffichageForm($lg_CDC_paramlinguistiques); break;
	case "paramcouleurs"			:	AffichageForm($lg_CDC_paramcouleurs); break;
	case "parammenu"			:	AffichageForm($lg_CDC_parammenu); 
							// SAUVEGARDE EVENTUELLE D'UNE PAGE HTML ISSUE DE L'EDITEUR HTMLEDIT
							if (!($ficsauve==""))
								{
								if (file_exists($site_www.$ficsauve)) {	
								unlink($site_www.$ficsauve); }
								$fh=fopen("../".$ficsauve,"w");
								fwrite($fh,stripslashes($_POST['elm1']));
								fclose($fh);
								}
							break;

	case "pageaccueil"			: 	AffichageForm($lg_CDC_paramaccueil); break;
	case "pageentete"			:	AffichageForm($lg_CDC_paramentete); break;
	case "pagelogbook"			: 	AffichageForm($lg_CDC_paramlogbook); break;
	case "pageinfoqsl"			: 	AffichageForm($lg_CDC_paraminfoqsl); break;
	case "pagelivredor"			:	AffichageForm($lg_CDC_paramlivredor); break;
	case "diplomes"				: 	GestionDiplomes(); break;
	case "diplome_dxcc"			:	GestionDiplome_DXCC(); break;
	case "pagecartesqsl"			: 	AffichageForm($lg_CDC_paramcartesqsl); break;
	case "pageblog"				:	?><iframe src="<?php echo $site_www; ?>blog/admin" id="iframe" width="100%" height="2000px" frameborder="0"></iframe><?php
	case "edition"				:	Editeur($edition); break;

	default 				:	if (substr($contenu,0,10)=="validation")
								{
								AffichageValidation(substr($contenu,11,strlen($contenu)-11));
								}
	}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// ACCUEIL
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


if (($contenu=="accueil") or ($contenu==""))
{


if ($langue=="uk")
{
?>
<span
 style="font-family: Comic Sans MS; color: rgb(153, 0, 0); font-weight: bold;"></span><span
 style="font-family: Comic Sans MS; color: rgb(153, 0, 0);"><span
 style="font-family: Helvetica,Arial,sans-serif;">It is from
this page that you can manage your web site.&nbsp;<br>
<br>
</span><span style="font-family: Helvetica,Arial,sans-serif;"></span></span><span
 style="color: rgb(153, 0, 0); font-family: Helvetica,Arial,sans-serif;"><span
 style="text-decoration: underline; font-weight: bold;">PLEASE
READ DOCUMENTATION FOR MORE INFORMATIONS</span><br>
<br>
</span><span
 style="color: rgb(153, 0, 0); font-family: Helvetica,Arial,sans-serif;">73qro,</span><br
 style="color: rgb(153, 0, 0); font-family: Helvetica,Arial,sans-serif;">
<br
 style="color: rgb(153, 0, 0); font-family: Helvetica,Arial,sans-serif;">
<span
 style="color: rgb(153, 0, 0); font-family: Helvetica,Arial,sans-serif;">Gilles,
F5AGL.<br>
</span><span
 style="font-family: Comic Sans MS; color: rgb(153, 0, 0); font-weight: bold;"></span>
<?php
}
else
{
?>

<span
 style="font-family: Comic Sans MS; color: rgb(153, 0, 0); font-weight: bold;">ACCUEIL<br>
</span><span
 style="font-family: Comic Sans MS; color: rgb(153, 0, 0);"><br>
<span style="font-family: Helvetica,Arial,sans-serif;">C'est
depuis cette page que vous g&eacute;rez la configuration de votre
site web.<br>
<br>
</span><span style="font-family: Helvetica,Arial,sans-serif;">Diff&eacute;rents
panneaux vous sont propos&eacute;s en cliquant sur les liens
ci-dessus :</span><br
 style="color: rgb(153, 0, 0); font-family: Helvetica,Arial,sans-serif;">
</span>
<ul
 style="color: rgb(153, 0, 0); font-family: Helvetica,Arial,sans-serif;">
  <li>des panneaux de <span style="font-weight: bold;">param&eacute;trage</span>
comportant des param&egrave;tres communs &agrave; l'ensemble du
site,</li>
  <li>des panneaux de <span style="font-weight: bold;">configuration
des pages</span> comportant des param&egrave;tres
sp&eacute;cifiques &agrave; telle ou telle page,</li>
  <li>des panneaux de <span style="font-weight: bold;">contenu</span>
pour g&eacute;rer ... le contenu (log &amp; qsl).</li>
</ul>
<span
 style="color: rgb(153, 0, 0); font-family: Helvetica,Arial,sans-serif;"><span
 style="text-decoration: underline; font-weight: bold;">Reportez-vous
&agrave; la documentation pour de plus amples pr&eacute;cisions</span>.<br>
<br>
Bonne
configuration,</span><br
 style="color: rgb(153, 0, 0); font-family: Helvetica,Arial,sans-serif;">
<br
 style="color: rgb(153, 0, 0); font-family: Helvetica,Arial,sans-serif;">
<span
 style="color: rgb(153, 0, 0); font-family: Helvetica,Arial,sans-serif;">73qro,</span><br
 style="color: rgb(153, 0, 0); font-family: Helvetica,Arial,sans-serif;">
<br
 style="color: rgb(153, 0, 0); font-family: Helvetica,Arial,sans-serif;">
<span
 style="color: rgb(153, 0, 0); font-family: Helvetica,Arial,sans-serif;">Gilles,
F5AGL.<br>
</span><span
 style="font-family: Comic Sans MS; color: rgb(153, 0, 0); font-weight: bold;"></span>



<?php } } ?>
 

<?php

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Affichage des panneaux de configuration
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////




?>


<hr style="width: 100%; height: 2px;">
<div style="text-align: center;"><small><span
 style="font-family: Comic Sans MS; font-weight: bold;"><span
 style="color: rgb(0, 0, 153);">HamLog</span><span
 style="color: rgb(102, 102, 102);">Web</span></span>&nbsp;-
<a href="mailto:hamweb@zapgillou.fr">F5AGL</a><br>
<?php echo $lg_CDC_licence1; ?>&nbsp;<a
 href="http://creativecommons.org/licenses/by-nc-nd/2.0/fr/deed.en"><?php echo $lg_CDC_licence2; ?></a><br>
<small><small><small><small><small><small>&nbsp;</small></small></small></small></small></small></small></div>
</div>
</div>
<div style="text-align: center;">
<a href="http://www.php.net/"><img src="../img/php.png"
 style="border: 0pt none ;"></a> <a
 href="http://www.nvu.com/"><img src="../img/nvu.gif"
 style="border: 0pt none ;"></a> <a
 href="http://www.getfirefox.com/"><img src="../img/firefox.gif" style="border: 0pt none ;"></a> <a
 rel="license"
 href="http://creativecommons.org/licenses/by-nc-nd/2.0/fr/"><img
 alt="Creative Commons License" style="border-width: 0pt;"
 src="http://i.creativecommons.org/l/by-nc-nd/2.0/fr/80x15.png"></a></div>
</body>
</html>
