<?php

/**************************************************************************/
/* Module Gbook MX v2.0 Copyright (c) 2004 by Víctor Simental             */
/* $Revision 30/01/2004 - $Id addsign.php - v4.1.2    EPX $               */ 
/* @URI: http://www.phpwebmasters.com                                     */ 
/* ============================================                           */
/* Based in Gbook MX v4.1.0 Copyright (c) 2003 by                         */
/* Víctor Simental - http://gbookmx.sourceforge.net                       */
/* ============================================                           */
/* GbookMX is Based in the Gbook v1.0 for PHP Nuke Copyright (c) 2003 by  */
/* http://www.PHP-Mania.com.ar                                            */
/* Programed and Design By Víctor Simental and German Cúevas              */
/* vicmx@phpwebmasters.com                                                */
/*                                                                        */
/* This program is free software. You can redistribute it and/or modify   */
/* it under the terms of the GNU General Public License as published by   */
/* the Free Software Foundation; either version 2 of the License.         */
/**************************************************************************/

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}
if(!@file_exists("modules/$module_name/copyright.php"))
	  die("<h1>Your Gbook MX its an copy ilegal<br> <b>DO NOT REMOVE THE COPYRIGHT. YOU'RE NOT ALLOWED TO REMOVE NOR EDIT THIS.!!!!</b></h1>");
   include("header.php");
   include("modules/$module_name/includes/javascript.php");
   cookiedecode($user);
   $username = $cookie[1];
   
   $bloqform = "<form action=\"modules.php?name=$module_name&amp;op=Add_Sign\" method=\"post\" name=\"book\" onsubmit=\"return validarform()\">\n";
   $bloqform .= "<table align='center' width='60%' cellpadding='0' cellspacing='0'>\n";
   $bloqform.="\t<tr align=\"center\"><td width='100%' valign='top' colspan='2'>\n<center><b><img src=\"modules/$module_name/images/view.gif\"><a href=\"modules.php?name=$module_name\">"._SEEGB."</a></b></center>\n<br></td></tr>\n";
   $bloqform .= "<tr><td valign='top' width='50%'><b>"._NOMBRE."</b>&nbsp;&nbsp;<img src=\"modules/$module_name/images/user.gif\" align=\"absmiddle\" alt='"._NOMBRE."'> <b>*</b> </td>\n<td valign='top' width='50%'>";
   if($username!=""){
	$bloqform.="<input type=\"hidden\" name=\"nombre\" value=\"".$username."\"><input type=\"hidden\" name=\"userrec\" value=\"1\"><b>".$username."</b>";
	}
		else
	{
	$bloqform.="<input type='text' name='nombre'><input type=\"hidden\" name=\"userrec\" value=\"0\">";
	}
   
   $bloqform.="</td>\n</tr>\n";
   $bloqform .= "<tr><td valign='top' width='50%'><b>"._EMAIL."</b>&nbsp;&nbsp;<img src=\"modules/$module_name/images/email.gif\" align=\"absmiddle\" alt='"._EMAIL."'> <b>*</b></td>\n<td valign='top' width='50%'><input type='text' name='email'></td>\n</tr>\n";
        
		if($genero_field == 1){
		$bloqform .= "<tr><td valign='top' width='50%'><b>"._GENERO."</b></td>\n<td valign='top' width='50%'>\n<select name=\"genero\">\n<option value=\"blank\" selected>"._SELGEN."</option>\n<option value=\"male\">"._MALE."</option>\n<option value=\"female\">"._FEMALE."</option>\n</select>&nbsp;&nbsp;<img src=\"modules/$module_name/images/male.gif\" align=\"absmiddle\" alt=\""._MALE."\">&nbsp;<img src=\"modules/$module_name/images/female.gif\" align=\"absmiddle\" alt=\""._FEMALE."\"> </td>\n</tr>\n";
		}
		
		if($pais_field == 1){
		$bloqform .= "<tr><td width='50%' valign='top'><b>"._PAIS."</b>&nbsp;&nbsp;<img src=\"modules/$module_name/images/location.gif\" align=\"absmiddle\" alt=\""._PAIS."\"></td><td width='50%' valign='top'><select name=\"bandera\" onChange=\"showcountry()\">\n<option name=\"bandera\" value=\"blank.gif\" selected>"._SELPAIS."</option>\n";
		$ruta = "modules/$module_name/images/flags/";
		
		$handle=opendir($ruta);
	while ($bandera = readdir($handle)) {
	    if ( (ereg("^([0-9a-z]+)([.]{1})([a-z0-9]{3})$",$bandera)) ) {
		//FIX door peter, voor oude versie van basename
		//$bandera=basename(strval($bandera),".gif");
		$bandera=basename(strval($bandera));
		if (substr($bandera, -4) == ".gif"){
		$bandera=substr($bandera, 0, -4);
		}
		//einde FIX
		$countrylist .= "$bandera ";
		}
	}
	closedir($handle);
	$countrylist = explode(" ", $countrylist);
	sort($countrylist);
	for ($i=0; $i < sizeof($countrylist); $i++) {
	if($countrylist[$i]!="") {
	$bloqform.="<option name=\"bandera\" value=\"$countrylist[$i].gif\">".ucfirst($countrylist[$i])."</option>\n";
	}
	}
	$bloqform.="</select>&nbsp;&nbsp;<img src=\"modules/$module_name/images/flags/blank.gif\" name=\"paises\" height=\"20\" width=\"27\">\n</td></tr>\n";
	}
	if($ciudad_field == 1){
	$bloqform.="\t<tr><td width='50%' valign='top'><b>"._CIUDAD."</b></td><td width='50%' valign='top'> <input type='text' name='ciudad'>&nbsp;&nbsp;<img src=\"modules/$module_name/images/location.gif\" align=\"absmiddle\" alt=\""._CIUDAD."\"></td></tr>\n";
	}
	if($icq_field == 1){
	$bloqform .="\t<tr><td width='50%' valign='top'><b>"._ICQ."</b>&nbsp;&nbsp;<img src=\"modules/$module_name/images/icq.gif\" align=\"absmiddle\" alt=\""._ICQ."\"></td><td width='50%' valign='top'><input type='text' name='icq'></td></tr>\n";
	}
	if($msn_field == 1){
	$bloqform .="\t<tr><td width='50%' valign='top'><b>"._MSN."</b>&nbsp;&nbsp;<img src=\"modules/$module_name/images/msn.gif\" align=\"absmiddle\" alt=\""._MSN."\"></td><td width='50%' valign='top'><input type='text' name='msn'></td></tr>\n";
	}
	if($yim_field == 1){
	$bloqform .="\t<tr><td width='50%' valign='top'><b>"._YIM."</b>&nbsp;&nbsp;<img src=\"modules/$module_name/images/yim.gif\" align=\"absmiddle\" alt=\""._YIM."\"></td><td width='50%' valign='top'><input type='text' name='yim'></td></tr>\n";
	}
	if($aim_field == 1){
	$bloqform .="\t<tr><td width='50%' valign='top'><b>"._AIM."</b>&nbsp;&nbsp;<img src=\"modules/$module_name/images/aim.gif\" align=\"absmiddle\" alt=\""._AIM."\"></td><td width='50%' valign='top'><input type='text' name='aim'></td></tr>\n";
	}
	if($website_field == 1){
	$bloqform .="\t<tr><td width='50%' valign='top'><b>"._WEBSITE."</b>&nbsp;&nbsp;<img src=\"modules/$module_name/images/home.gif\" align=\"absmiddle\" alt=\""._WEBSITE."\"></td><td width='50%' valign='top'><input type='text' name='url' value='http://'></td></tr>\n";
	}
	$bloqform .="\t<tr align=\"center\"><td width='100%' valign='top' colspan='2'><center><b>"._MENSAJE."</b>&nbsp;&nbsp;<img src=\"modules/$module_name/images/file.gif\" align=\"absmiddle\" alt=\""._MENSAJE."\"> *&nbsp;&nbsp;$lisbbcode</center></td></tr>\n";
	$bloqform .="\t<tr><td width='50%' valign='middle'><b>"._EMOTICONS."</b><br>$lissmilies<br>";
	
	if($html_code == 1){$bloqform.= ""._ACTIVEALLOWHTMLCODEON." <b>"._ON_."</b><br>";}else{$bloqform.= ""._ACTIVEALLOWHTMLCODEON." <b>"._OFF_."</b><br>";}
	if($allowhtml == 1){$bloqform.= ""._ACTIVEHTMLON." <b>"._ON_."</b><br>";}else{$bloqform.= ""._ACTIVEHTMLON." <b>"._OFF_."</b><br>";}
	if($emoticon == 1){$bloqform.= ""._ACTIVEEMOTICON." <b>"._ON_."</b><br>";}else{$bloqform.= ""._ACTIVEEMOTICON." <b>"._OFF_."</b><br>";
	}
	if (is_user($user)){
	$bloqform .="<input type=\"hidden\" name=\"gbook_user\" value=\"1\">\n";
	}	
	$bloqform .= "</center></td><td width='50%' valign='top'><textarea name='firma' wrap='virtual' cols='40' rows='10'></textarea>\n</td></tr>\n</td></tr></table>\n";
	$botones =" <center><input type=\"hidden\" name=\"op\">\n";
	$botones .="<input type=\"submit\" name=\"submit\" value=\""._SIGN."\" onClick=\"this.form.op.value='save';\">\n<input type=\"submit\" name=\"preview\" value=\""._PREVIEW."\" onClick=\"this.form.op.value='preview';\">\n<input type='reset' name='reset' value='"._RESET."'></form></center>\n";
	Table();
	echo $bbcodescript .$validate .$showcountry .$bloqform;
	echo "<br>";
	echo $botones;
	EndTable();
	include("footer.php");

?>