<?php require_once('Connections/conexioninv.php'); ?>

<?php

session_start();

$fecha11 = date("d-m-Y"); 
$fecha12 = date("d-m-Y"); 
$mmsigla = "";

if (!$_SESSION){
echo '<script language = javascript>
self.location = "index.php"
</script>';
}
	
$txtcedula = "";
$txtbuscar = "";	
$txtbuscar2 = "";	
$txtbuscar3 = "";	
$mmsigla = $_SESSION['mmsigla'];

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$txtficha = $_POST["txtficha"];
//$txtbuscar = $_SESSION["txtbuscar"];

$varProducto_Recordset1 = "-1";
if (isset($_GET["departamento"])) {
  $varProducto_Recordset1 = $_GET["departamento"];
}
$varProducto2_Recordset1 = "-1";
if (isset($_GET["categoria"])) {
  $varProducto2_Recordset1 = $_GET["categoria"];
}


	mysql_select_db($database_conexioninv, $conexioninv);
	$query_Recordset1 = sprintf("SELECT * FROM productos WHERE sigla = '$mmsigla' AND productos.ficha LIKE %s", GetSQLValueString("%" . $txtficha . "%", "text"));
	$Recordset1 = mysql_query($query_Recordset1, $conexioninv) or die(mysql_error());
	$row_Recordset1 = mysql_fetch_assoc($Recordset1);
	$totalRows_Recordset1 = mysql_num_rows($Recordset1);	

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Policia Nacional</title>
<link rel="shortcut icon" href="images/favicon.ico" />
<style type="text/css">
#apDiv1 {
	position:absolute;
	left:17px;
	top:0px;
	width:1933px;
	height:92px;
	z-index:1;
}
#apDiv2 {
	position:absolute;
	left:1192px;
	top:186px;
	width:105px;
	height:127px;
	z-index:1;
}
#apDiv3 {
	position:absolute;
	left:1px;
	top:1px;
	width:100%;
	height:150px;
	z-index:1;
}
#apDiv4 {
	position:absolute;
	left:4px;
	top:153px;
	width:190px;
	height:390px;
	z-index:2;
	background-color: #FFFF99;
}
#apDiv5 {
	position:absolute;
	left:14px;
	top:242px;
	width:994px;
	height:161px;
	z-index:3;
	font-weight: bold;
}
#apDiv5 pre {
	font-family: Verdana, Geneva, sans-serif;
	font-size: 12px;
}
#apDiv5 table tr td strong {
	color: #03F;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
}

.brillo:hover {
	background-color: #FCF;
	font-weight: normal;
	font-size: 12px;
	font-family: Arial, Helvetica, sans-serif;
	color: #000;
	font-style: normal;
}
#Layer1 {
	position:absolute;
	left:3px;
	top:191px;
	width:841px;
	height:56px;
	z-index:4;
}
.producto1 {background-color: #FFF;
	width: 260px;
	float: left;
	margin: auto;
	font-size: 11px;
	font-family: Arial, Helvetica, sans-serif;
	background-image: url(images/fondoproducto.jpg);
	background-repeat: no-repeat;
}
#apDiv12 {
	position:absolute;
	left:191px;
	top:158px;
	width:44px;
	height:20px;
	z-index:28;
	font-size: 14px;
}
#apDiv {	position:absolute;
	left:2px;
	top:190px;
	width:222px;
	height:111px;
	z-index:2;
	background-color: #CCCCCC;
	border-bottom-color: #000000;
	border-bottom-width: 2px;
	border-color: #000000;
	border-right-color: #000000;
	color: #000000;
}
#apDiv6 {
	position:absolute;
	left:245px;
	top:157px;
	width:274px;
	height:21px;
	z-index:29;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 16px;
	font-weight: bold;
	color: #009;
}
#apDiv7 {
	position:absolute;
	left:0px;
	top:178px;
	width:100%;
	height:1px;
	z-index:30;
	background-color: #FF9933;
}
.style4 {
	font-family: Arial, Helvetica, sans-serif;
	color: #D6D6D6;
}
.style7 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: normal;
}
#Layer20 {position:absolute;
	left:189px;
	top:-83px;
	width:103px;
	height:22px;
	z-index:125;
}
#Layer6 {	position:absolute;
	left:9px;
	top:126px;
	width:173px;
	height:23px;
	z-index:126;
}
.style9 {
	color: #0033CC;
	font-weight: bold;
}
.style10 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: normal;
	text-align: left;
}
.style11 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 18px;
	font-weight: bold;
	color: #000066;
}
.style14 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	color: #000;
}
.style12 {font-size: 12px}
.style4 strong {
	color: #000099;
}
.titulos {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	font-weight: bold;
	color: #F00;
}
.tituloprinc {
	font-family: Euphemia;
	font-size: 16px
	font-weight: bold;
	color: #F00;
}
#form1 label .style7 {
	font-size: 14px;
}
body table tr td p {
	text-align: center;
	font-size: 18px;
	font-weight: bold;
}
body table tr td p {
	font-size: 14px;
	font-family: Arial, Helvetica, sans-serif;
	text-align: left;
}
#form1 table tr td .style7 {
	text-align: right;
}
body table tr td {
	font-weight: bold;
}
body table tr td p {
	text-align: center;
	font-weight: normal;
}
body table tr td {
	font-weight: bold;
}
body table tr td {
	font-size: 16px;
	font-family: Arial, Helvetica, sans-serif;
}
body table tr td p {
	font-weight: bold;
}
body table tr td p {
	font-size: 12px;
	font-family: Arial, Helvetica, sans-serif;
	font-weight: normal;
	text-align: left;
}
.detalle {
	font-family: Euphemia;
	font-size: 17px;
	text-align: justify;
	font-weight: normal;
}
body table tr td table tr td {
	font-family: Arial, Helvetica, sans-serif;
	text-align: center;
	font-weight: normal;
	font-size: 12px;
}
.segundotit {
	font-family: Euphemia;
	font-size: 16px;
	color: #F00;
}
.tittulo1 {
	font-family: Euphemia;
	font-size: 18px;
}
.style71 {font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: normal;
	text-align: left;
}
.negr {
	font-weight: bold;
	color: #006;
}
normal {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: normal;
}
normal {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: normal;
}
.tit2 {
	font-size: 14px;
	font-weight: bold;
}
.accion {
	font-size: 12px;
}
nombres {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: bold;
	color: #F00;
}
nombr {
	font-weight: bold;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	color: #F00;
}
.detpersona {
	font-weight: bold;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #006;
}
.style14 {
	font-size: 14px;
}
.nombr {
	font-weight: bold;
	color: #F00;
	text-align: left;
	font-size: 14px;
}
inicio {
	font-weight: bold;
}
.inicio {
	font-size: 14px;
	text-align: left;
}
.tittulo1 {
	font-weight: bold;
}
.nomostrar {	font-weight: normal;
	text-align: left;
	font-size: 14px;
}
.style101 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: normal;
}
.brillo:hover {
	background-color: #FCF;
	font-weight: normal;
	font-size: 12px;
	font-family: Arial, Helvetica, sans-serif;
	color: #000;
	font-style: normal;
	text-align: left;
}
.desglose {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: normal;
	text-align: left;
}
.total {
	font-size: 14px;
	font-weight: bold;
}
.aria {font-family: Arial, Helvetica, sans-serif;
}
.arial {font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: normal;
	color: #000;
	text-align: left;
}
.desglose1 {	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight: normal;
	text-align: center;
}
.izq {text-align: left;
}
.izq {text-align: left;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #009;
}
.izq {text-align: left;
}
.style102 {font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: normal;
	text-align: center;
}
</style>
</head>
<body>
<table width="1024" border="0" align="center">
  <tr>
    <td align="center"><table width="800" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><a href="index1.php"><span class="style102"><img src="imagenes/<?php echo $_SESSION['mmimagenag']; ?>" alt="Fotografia" width="125" height="125" border="0" align="top" /></span></a></td>
        </tr>
        <tr>
          <td class="tittulo1">REPUBLICA DOMINICANA</td>
        </tr>
        <tr>
          <td class="tit2">POLICIA NACIONAL </td>
        </tr>
        <tr>
          <td class="tit2">TODO POR LA PATRIA</td>
        </tr>
      </table>
      <p class="inicio"><a href="index1.php">Inicio</a></p>
      <p class="nomostrar">
        <?php if ($totalRows_Recordset1 == 0) { // Show if recordset empty ?>
No se encontro ningun registro para esta busqueda
<?php } // Show if recordset empty ?>
      </p>
      <?php if ($totalRows_Recordset1 > 0) { // Show if recordset not empty ?>
        <span class="tituloprinc">REPORTE DE ARTICULOS POR No. DE FICHA</span><span class="total"><br />
        <br />
        </span>
        <table width="100%" height="40" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; padding-top: 10px; font-size: 12px;" bordercolor="#CCCCCC" align="center">
          <tr bgcolor="#C7D9BB" class="aria">
            <th width="204" class="izq" scope="col">DESCRIPCION</th>
            <th width="60" class="izq" scope="col">FICHA</th>
            <th width="112" height="18" class="izq" scope="col">MARCA</th>
            <th width="119" class="izq" scope="col">MODELO</th>
            <th width="105" class="izq" scope="col">CUADRANTE</th>
            <th width="122" class="izq" scope="col">CORREDOR</th>
            <th width="155" class="izq" scope="col">DEPARTAMENTO</th>
            <th width="132" class="izq" scope="col">HACIENDA</th>
            <th width="51" class="izq" scope="col">ACCION</th>
            </tr>
          <?php do { ?>
          <tr class="brillo">
            <td class="desglose"><?php echo  strtoupper($row_Recordset1['descripcion']); ?></span></td>
            <td class="desglose"><?php echo  strtoupper($row_Recordset1['ficha']); ?></td>
            <td class="desglose"><?php echo  strtoupper($row_Recordset1['marca']); ?></td>
            <td class="desglose"><?php echo  strtoupper($row_Recordset1['modelo']); ?></td>
            <td class="desglose"><?php echo  strtoupper($row_Recordset1['cuadrante']); ?></td>
            <td class="desglose"><?php echo  strtoupper($row_Recordset1['corredor']); ?></td>
            <td class="desglose"><?php echo  strtoupper($row_Recordset1['departamento']); ?></td>
            <td class="desglose"><?php echo  strtoupper($row_Recordset1['registro']); ?></td>
            <td class="desglose">&nbsp;&nbsp; <a href="edit_productos_veh.php?recordID=<?php echo $row_Recordset1['id']; ?>">Editar</a></td>
            </tr>
          <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
        </table>
        <span class="total">        </span>
<?php } // Show if recordset not empty ?>
        <p><span class="total">TOTAL DE REGISTRO : <?php echo $totalRows_Recordset1 ?></span></p></td>
  </tr>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
