<?php
/**
 * @package linea21.modules
 * @subpackage yellowpages
 * @author linea21 <info@linea21.com>
 * @version $id SVN
 * @access public
 * @license http://opensource.org/licenses/gpl-3.0.html
 */

//////////// Check Inclusion de pages //////////// 
if (!function_exists('AuthenthificationProcess')){ 
include_once("../lib/lib_common.php");
ReloadIndex('admin');
}
////////////

if(isset($_GET['state'])) {
    $state=$_GET['state'];
	if(isset($_POST['id']))	$yp_id=$_POST['id'];
	if(isset($_GET['id']))	$yp_id=$_GET['id'];
	$yp_object= new yellowpages;
	$result_update=$yp_object->StateYellowPages($yp_id, 'P', $sql_object);
	$link_confirm="confirm.php?rub=".$rub."&todo=mod&id=".$yp_id;
	if (MAIL_YELLOWPAGES==1) {
	include_once('../yellowpages/mail_actions.php');
	include_once('../mail/template.php');
	}
	echo $result_update;
	if($result_update) header("Location: ".$link_confirm);
	else  system_error();
}

	if(!isset($_GET['id']) && !isset($_POST['id'])) {
	$id="1";
} else {
	if(isset($_POST['id']))	$id=$_POST['id'];
	if(isset($_GET['id']))	$id=$_GET['id'];
}
include_once("../lib/lib_common.php"); 
$req_det= SQL_getdetyp($id);
$result=$sql_object->DBSelect($req_det);
$link_det=$rub_link."&amp;todo=det&amp;id="; 
$link_det_theme="index.php?rub=theme&amp;todo=det&amp;id="; 
$link_sup=$rub_link."&amp;todo=sup&amp;id=";
$link_mod=$rub_link."&amp;todo=mod&amp;id=";
$navtitle=$GLOBALS['lang']['yp']['det']." : ".$result[0]['yellowp_name'];
$display_title=formatTitleh2($result[0]['yellowp_name']);
?>
<div id="chemin">
	<ul>
		<li>
			<a href="index.php"><? echo $GLOBALS['lang']['way']['home'] ?></a>
		</li>
		<li>
			<a href="<?php echo $rub_link; ?>"><? echo $GLOBALS['lang']['menu']['yellowpages']?></a>
		</li>
		<li>
			<span><? echo formatnavTitle($navtitle); ?></span>
		</li>
	</ul>
</div>
  <!--end barre haute -->
<?php
include_once("quickicons.php");
?>
<div class="contentcontainer">
<?php
include_once($dir."/menurub.php");
?>
<div id="content">
		
		<? 
		$link_det_state=$rub_link."&todo=det&state=".$result[0]['yellowp_statut']."&amp;id="; 
		if ($result[0]['yellowp_statut']=='D') {  ?>
	<div class="mod_link">
	<a href="<? echo $link_det_state.$id ;?>"><?echo $GLOBALS['lang']['yp']['confirmation'];?></a>
	</div><br class="brendstep" />
		<?php } ?>
		<h2><?  echo $display_title; ?></h2>	
		 <? echo "<a href=\"".$link_sup.$id."\" title=\"".$GLOBALS['lang']['yp']['sup']."\" class=\"ico_sup2\">"; ?></a>
		<? echo "<a href=\"".$link_mod.$id."\" title=\"".$GLOBALS['lang']['yp']['mod']."\" class=\"ico_mod2\">"; ?></a>
		
		<dl class="dl2">
		<dt><? echo $GLOBALS['lang']['yp']['theme']; ?> : </dt>
		<dd><? 
		if ($result[0]['yellowp_theme']<>-1) echo "<a href=\"".$link_det_theme.$result[0]['yellowp_theme']."\" title=\"".formatText($result[0]['theme_name'], '2HTML')."\">".formatText($result[0]['theme_name'], '2HTML')."</a></dd>"; 
		else echo $GLOBALS['lang']['yp']['notheme']."</dd>"; 
		?>
		<dt><? echo $GLOBALS['lang']['yp']['name2']; ?> :</dt>
		<dd><? echo formatText(empty_nc($result[0]['yellowp_name']), '2HTML'); ?></dd>
		<dt><? echo $GLOBALS['lang']['yp']['activity'] ; ?>: </dt>
		<dd><? echo formatText(empty_nc($result[0]['yellowp_activity']), '2HTML'); ?></dd>
		<dt><? echo $GLOBALS['lang']['yp']['street'] ;?> : </dt>
		<dd><? echo formatText(empty_nc($result[0]['yellowp_street']), '2HTML');?></dd>
		<dt><? echo $GLOBALS['lang']['yp']['postal_code']; ?> : </dt>
		<dd><? echo formatText(empty_nc($result[0]['yellowp_postal_code']), '2HTML');?></dd>
		<dt><? echo $GLOBALS['lang']['yp']['city']; ?> : </dt>
		<dd><? echo formatText(empty_nc($result[0]['yellowp_city']), '2HTML');?></dd>
		<dt><? echo $GLOBALS['lang']['yp']['phone']; ?> : </dt>
		<dd><? echo formatText(empty_nc($result[0]['yellowp_phone']), '2HTML');?></dd>
		<dt><? echo $GLOBALS['lang']['yp']['fax'] ;?> : </dt>
		<dd><? echo formatText(empty_nc($result[0]['yellowp_fax']), '2HTML');?></dd>
		<dt><? echo $GLOBALS['lang']['yp']['email']; ?> : </dt>
		<dd><? echo "<a href=\"mailto:".$result[0]['yellowp_email']."\" title=\"" .formatText($result[0]['yellowp_email'], '2HTML')."\">" .formatText($result[0]['yellowp_email'], '2HTML')."</a>";?></dd>
		<dt><? echo $GLOBALS['lang']['yp']['website'] ;?> : </dt>
		<dd><? 
		if ($result[0]['yellowp_website']<>"")
		   echo "<a href=\"".$result[0]['yellowp_website']."\" title=\"".formatText($result[0]['yellowp_website'], '2HTML')."\">".formatText($result[0]['yellowp_website'], '2HTML')."</a></dd>";
		else    echo formatText(empty_nc($result[0]['yellowp_website']), '2HTML')."</dd>";
		
?>
		<dt><? echo $GLOBALS['lang']['divers']['date_crea']; ?> :</dt>
		<dd><? echo $result[0]['yellowp_date_crea'];?></dd>
		<dt><? echo $GLOBALS['lang']['divers']['statut']; ?>  :</dt>
		<dd><? if ($result[0]['yellowp_statut']=='D') {
		           echo $GLOBALS['lang']['yp']['draft'];
		       }
			   else echo display_statut($result[0]['yellowp_statut']);?></dd>
</dl>
</div>
<?php include_once($dir."/help.php"); ?>
</div>

