<?php
 
session_start();
$com = "M";
include("DMMYSQLG.php");
include("DSA3000.php");
include("DMMYSQLG.php");
require_once("DFJQUERY.inc");
include("DF30000.inc");
include("DF80000.php");
?>
<html>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<?php

if ($_REQUEST['bot']==""){
	echo '<h2>!!! SELECCIONE UN REGISTRO !!!</h2>';
	echo '<meta content="1; url=CXC10500_PR.php"  HTTP-EQUIV="REFRESH">';
}else{
	if(!isset($_REQUEST['tap2'])){
		include('CXC10500_CL.php');
		$varible_clase = new clase();
		$res=$varible_clase->lista_busqueda($_REQUEST["bot"]);
		$reg=mysqli_fetch_array($res);
		$_REQUEST['tap2']=$reg['pdescrip'];
		$_REQUEST['n_reg']=$reg['n_reg'];
		$_REQUEST['stipodaily']=$reg['stipodaily'];
		$_REQUEST['movimiento']=$reg['movimiento'];
		$_REQUEST['cuenta']=$reg['cuenta'];
		$_REQUEST['cheque']=$reg['cheque'];
		$_REQUEST['empresa']=$reg['empresa'];
		$_REQUEST['proveedor']=$reg['proveedor'];
		$_REQUEST['factura']=$reg['factura'];
		$_REQUEST['importe']=$reg['importe'];
		$_REQUEST['fechaexp']=chfecha($reg['fecha_exp'],'Y-m-d','d/m/Y');
	    $_REQUEST['fechacob']=chfecha($reg['fecha_cob'],'Y-m-d','d/m/Y');
		}
?>

<script language="javascript">
function ocultaMuestra(divVent){
	if(divVent.style.display=='none'){
		divVent.style.display='';

	}else{
		divVent.style.display='none';

	}
}	
	</script>
<body>

<form name="frm1" method="post" action="" enctype="multipart/form-data">
  <p>
    <input name="bot" type="hidden" value="<?php
 echo $_REQUEST['bot'];?>"> 
  </p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <table width="478"  align="center">
    <tr>
      <th colspan="4">CONSULTAR MOVIMIENTOS CUENTAS POR PAGAR. </th>
    </tr>
    <tr>
      <td width="85"><strong>CODIGO.</strong></td>
      <td width="377" colspan="3"><span class="Estilo19">
        <input name="n_reg" type="text" id="n_reg" tabindex="20" size="15" value="<?php
echo $_REQUEST['n_reg'];?>" disabled="disabled"
		 <?php
 
		if(isset($_REQUEST['bot'])){
		echo 'value="'.$reg['n_reg'].'"';
		}
		?>
		>
      </span></td>
    </tr>
  </table>
  <div id="divVent" style="display:">
    <table width="478"  align="center"  >
      <tr>
        <td><strong>TIPO DE MOVIMIENTO. </strong></td>
        <td colspan="3"><select name="movimiento" id="movimiento" tabindex="13" disabled="disabled">
          <option value="">--SELECCIONE--</option>
          <?php
 
$sql = mysqli_query($con ,"SELECT * FROM tipo_mov");
while($reg=mysqli_fetch_array($sql)){
	if($_REQUEST['movimiento']==$reg['pdescrip'] ){
		echo '<option value="' . $reg['pdescrip'] . '" selected>' . $reg['pdescrip'] . '</option>';
	}else{
		echo '<option value="' . $reg['pdescrip'] . '">' . $reg['pdescrip'] . '</option>';
	}
}
?>
        </select></td>
      </tr>
      <tr>
        <td><strong>CUENTA.</strong></td>
        <td width="180"><select name="cuenta" id="cuenta" tabindex="13" disabled="disabled">
          <option value="">--SELECCIONE--</option>
          <?php
 
$sql = mysqli_query($con ,"SELECT * FROM tip_cuentas");
while($reg=mysqli_fetch_array($sql)){
	if($_REQUEST['cuenta']==$reg['pdescrip'] ){
		echo '<option value="' . $reg['pdescrip'] . '" selected>' . $reg['pdescrip'] . '</option>';
	}else{
		echo '<option value="' . $reg['pdescrip'] . '">' . $reg['pdescrip'] . '</option>';
	}
}
?>
        </select></td>
        <td width="80"><strong>NUMERO DE CHEQUE. </strong></td>
        <td width="110"><label>
          <input name="cheque" type="text" disabled="disabled" id="cheque" value="<?php
echo $_REQUEST['cheque'];?>" size="15">
        </label></td>
      </tr>
      <tr>
        <td><strong>PROVEEDOR.</strong></td>
        <td colspan="3"><select name="proveedor" id="proveedor" tabindex="13" disabled="disabled">
          <option value="">--SELECCIONE--</option>
          <?php
 
$sql = mysqli_query($con ,"SELECT * FROM tip_proveedores");
while($reg=mysqli_fetch_array($sql)){
	if($_REQUEST['proveedor']==$reg['pdescrip'] ){
		echo '<option value="' . $reg['pdescrip'] . '" selected>' . $reg['pdescrip'] . '</option>';
	}else{
		echo '<option value="' . $reg['pdescrip'] . '">' . $reg['pdescrip'] . '</option>';
	}
}
?>
        </select></td>
      </tr>
      <tr>
        <td><strong>FACTURA.</strong></td>
        <td colspan="3"><select name="factura" id="factura" tabindex="13" disabled="disabled">
          <option value="">--------SELECCIONE--------</option>
          <?php
 
$sql = mysqli_query($con ,"SELECT * FROM faq_det");
while($reg=mysqli_fetch_array($sql)){
	if($_REQUEST['factura']==$reg['nparte1'] ){
		echo '<option value="' . $reg['nparte1'] . '" selected>' . $reg['nparte1'] . ' | '. $reg['can_ref'].'| '. $reg['acc_fec'].' | '.$reg['costo'].'</option>';
	}else{
		echo '<option value="' . $reg['nparte1'] . '">' . $reg['nparte1'] . ' | '. $reg['can_ref'].' | '. $reg['acc_fec'].' | '.$reg['costo'].'</option>';
	}
}
?>
        </select></td>
      </tr>
      <tr>
        <td><strong>FECHA DE EXPEDICION. </strong></td>
        <td><input name="fechaexp" type="text" id="fechaexp" size="10" onKeyPress="return validar(event)" value="<?php
echo $_REQUEST['fechaexp'];?>" onChange="javascript: document.getElementById('frm1').submit()" disabled="disabled">
          <script type="text/javascript">
	Calendar.setup(
			{
			  inputField  : "fechaexp",        // ID of the input field
			  ifFormat    : "%d/%m/%Y",    // the date format
			  button      : "bot_a"      // ID of the button
			}
		  );
        </script></td>
        <td><strong>FECHA DE COBRO. </strong></td>
        <td><input name="fechacob" type="text" id="fechacob" size="10" onKeyPress="return validar(event)" value="<?php
echo $_REQUEST['fechacob'];?>" onChange="javascript: document.getElementById('frm1').submit()" disabled="disabled">
          <script type="text/javascript">
	Calendar.setup(
			{
			  inputField  : "fechacob",        // ID of the input field
			  ifFormat    : "%d/%m/%Y",    // the date format
			  button      : "bot_b"      // ID of the button
			}
		  );
        </script></td>
      </tr>
      <tr>
        <td><strong>IMPORTE.</strong></td>
        <td colspan="3"><label>
          <input name="importe" type="text" id="importe" value="<?php
echo $_REQUEST['importe'];?>" disabled="disabled">
        </label></td>
      </tr>
      <tr>
        <td width="80"><strong>CONCEPTO.</strong></td>
        <td colspan="3"><label>
        <input name="tap2" id="tap2" type="text" tabindex="2" value="<?php
echo $_REQUEST['tap2'];?>"
		  onBlur="may(this)" size="50" disabled="disabled"
		 <?php
 
		if(isset($_REQUEST['bot'])){
		echo 'value="'.$reg['pdescrip'].'"';
		}
		?>>
        </label></td>
      </tr>
      <tr>
        <td height="29" colspan="4">
          <div align="center">
            <input type="button" name="bot4" value="Regresar" onClick="openpage('CXC10500_PR.php','_self')"/>
          </div></td>
      </tr>
    </table>
  </div>
  <div id="divArt" style="display:none">
</form>
    <?php
 
if(isset($_POST['bot3'])){
	echo '<div align="center"
<?php
 mysqli_close($con);?>>
	<form id="form1" name="form1" action="CXC10500_PR.php" target="_self">
		<input type="submit" name="submit" value="Regresar">
	</form>
	</div>';
	}
?>
 <?php
 
}
?>
</body>
</html>
<?php
 mysqli_close($con);?>
</body>
</html>
