<?php
 
session_start();
$com = "M";
include("DMMYSQLG.php");
include("DSA3000.php");
include("DMMYSQLG.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 ($_POST['bot']==""){
	echo '<h2>!!! SELECCIONE UN REGISTRO !!!</h2>';
	echo '<meta content="1; url=DI13000_PR.php"  HTTP-EQUIV="REFRESH">';
}else{
	include('DI13000_CL.php');
	$varible_clase = new clase();
	$res=$varible_clase->lista_busqueda($_POST["bot"]);
	$reg=mysqli_fetch_array($res);
?>

<body
<?php
 
if(isset($_POST['bot3'])){
	echo ' onLoad="deshab()"';
}
?>
>
<div id="Layer2"></div>
<form  name="frm1" method="post" action="">
<input name="bot" type="hidden" value="<?php
 echo $_POST["bot"]?>">
  <table  align="center">
    <tr>
      <th colspan="4" class=\"titulo\"><div align="center">MODIFICAR MODULO DE PARAMETROS</div></th>
    </tr>
    <tr>
      <td >Poloiza de Compras :</td>
      <td ><input name="t1" type="text" id="t1" tabindex="4"
	  <?php
 
		if(isset($_POST['bot'])){
		echo 'value="'.$reg['tip_pol_com'].'"';
		}
		?>
	  ></td>
      <td >Poliza Devolucion de Compras:</td>
      <td ><input name="t2" type="text" id="t2" tabindex="4"
	  <?php
 
		if(isset($_POST['bot'])){
		echo 'value="'.$reg['tip_pol_devcom'].'"';
		}
		?>
	  ></td>
    </tr>
    <tr>
      <td>Poliza de Ventas :</td>
      <td><input name="t3" type="text" id="t3" tabindex="4"
	  <?php
 
		if(isset($_POST['bot'])){
		echo 'value="'.$reg['tip_pol_ven'].'"';
		}
		?>
	  ></td>
      <td>Devolucion de Ventas  : </td>
      <td><input name="t4" type="text" id="t4" tabindex="4"
	  <?php
 
		if(isset($_POST['bot'])){
		echo 'value="'.$reg['tip_pol_devven'].'"';
		}
		?>
	  ></td>
    </tr>
    <tr>
      <td>Poliza Cargo Interno :</td>
      <td><input name="t5" type="text" id="t5" tabindex="4"
	  <?php
 
		if(isset($_POST['bot'])){
		echo 'value="'.$reg['tip_pol_cint'].'"';
		}
		?>
	  > </td>
	   <td>Devolucion Cargo Interno : </td>
      <td><input name="t6" type="text" id="t6" tabindex="4"
	  <?php
 
		if(isset($_POST['bot'])){
		echo 'value="'.$reg['tip_pol_devcint'].'"';
		}
		?>
	  ></td>
    </tr>
	<tr>
      <td>Poliza Caja :</td>
      <td><input name="t7" type="text" id="t7" tabindex="4"
	  <?php
 
		if(isset($_POST['bot'])){
		echo 'value="'.$reg['tip_pol_kja'].'"';
		}
		?>
	  > </td>
	   <td>Costo Ventas : </td>
      <td><input name="t8" type="text" id="t8" tabindex="4"
	  <?php
 
		if(isset($_POST['bot'])){
		echo 'value="'.$reg['tip_pol_cven'].'"';
		}
		?>
	  ></td>
    </tr>
    <tr>
      <tH colspan="4">&nbsp;</tH>
    </tr>
    <tr>
      <td>Afec/Contable Proveedor:</td>
      <td ><select name="t9" id="t9" tabindex="3">
<?php
 
if($reg['afec_c_pro']==1){
	echo '<option value="1" selected>(GL)OBAL</option>';
}else{
	echo '<option value="1">(GL)OBAL</option>';
}
if($reg['afec_c_pro']==0){
	echo '<option value="0" selected>(DE)TALLE</option>';
}else{
	echo '<option value="0">(DE)TALLE</option>';
}
?>
      </select></td>
      <td>Afec/Contable Clientes:</td>
      <td><select name="t10" id="t10" tabindex="3">
<?php
 
if($reg['afec_c_clie']==1){
	echo '<option value="1" selected>(GL)OBAL</option>';
}else{
	echo '<option value="1">(GL)OBAL</option>';
}
if($reg['afec_c_clie']==0){
	echo '<option value="0" selected>(DE)TALLE</option>';
}else{
	echo '<option value="0">(DE)TALLE</option>';
}
?>
      </select></td>
    </tr>
    <tr>
      <td>Cuentas Clientes Contado:</td>
      <td><input name="t11" type="text" id="t11" tabindex="20" onKeyPress="return validar(event)" size="15"
<?php
 
if(isset($_REQUEST['t5'])){
	echo 'value = "'.$_REQUEST['t5'].'"';
}
?>>
        <input type="button" name="Submit2222" value="Buscar" onClick="javascript:recibeid('DYCUENTAD.php','ob=t11','','Layer2'); " tabindex="10"></td>
      <td>Cuentas Clientes Credito  : </td>
      <td><input name="t12" type="text" id="t12" tabindex="20" onKeyPress="return validar(event)" size="15"
<?php
 
if(isset($_REQUEST['t5'])){
	echo 'value = "'.$_REQUEST['t5'].'"';
}
?>>
        <input type="button" name="Submit22223" value="Buscar" onClick="javascript:recibeid('DYCUENTAD.php','ob=t12','','Layer2'); " tabindex="10"></td>
    </tr>
    <tr>
      <td>Cuentas Proveedores :</td>
      <td><input name="t13" type="text" id="t13" tabindex="20" onKeyPress="return validar(event)" size="15"
<?php
 
if(isset($_REQUEST['t5'])){
	echo 'value = "'.$_REQUEST['t5'].'"';
}
?>>
        <input type="button" name="Submit22222" value="Buscar" onClick="javascript:recibeid('DYCUENTAD.php','ob=t13','','Layer2'); " tabindex="10"></td>
	  <td>Cuentas Seguros :</td>
      <td><input name="t14" type="text" id="t14" tabindex="20" onKeyPress="return validar(event)" size="15"
<?php
 
if(isset($_REQUEST['t5'])){
	echo 'value = "'.$_REQUEST['t5'].'"';
}
?>>
        <input type="button" name="Submit22224" value="Buscar" onClick="javascript:recibeid('DYCUENTAD.php','ob=t14','','Layer2'); " tabindex="10"></td>
    </tr>
	<tr>
      <td>Codigo Pro/gral   :</td>
      <td><select name="t16" id="t16" tabindex="17">
        <option>----------Selecciona----------</option>
        <?php
   
			@$resultado=mysqli_query($con ,"select * from dgcatpro");
			while($registro=mysqli_fetch_array($resultado)){
				echo '<option value="' . $registro['cod_pro'] . '">' . $registro['nom_pro'] . ' ' . $registro['ap_pat_pro'] .' ' . $registro['ap_mat_pro'] . '</option>';
			}			
		?>
      </select></td>
      <td> Tipo Cambio de Ventas  :</td>
      <td><input name="t15" type="text" id="t15" tabindex="20" onKeyPress="return validar(event)" size="15"
<?php
 
if(isset($_REQUEST['t5'])){
	echo 'value = "'.$_REQUEST['t5'].'"';
}
?>>
        <input type="button" name="Submit222222" value="Buscar" onClick="javascript:recibeid('DYCUENTAD.php','ob=t15','','Layer2'); " tabindex="10"></td>
	</tr>
    <tr>
      <td>Codigo Pub/gral  :</td>
      <td><select name="t17" id="t17" tabindex="17">
        <option>----------Selecciona----------</option>
        <?php
   
			@$resultado=mysqli_query($con ,"select * from dgcatcli order by nom_cli, ap_pat_cli, ap_mat_cli");
			while($registro=mysqli_fetch_array($resultado)){
				echo '<option value="' . $registro['cod_cli'] . '">' . $registro['nom_cli'] . ' ' . $registro['ap_pat_cli'] .' ' . $registro['ap_mat_cli'] . '</option>';
			}			
		?>
      </select></td>
	   <td>Trabaja Aseguradoras  : </td>
       <td><select name="t18" id="t18" tabindex="3">
<?php
 
if($reg['trab_aseg']==0){
	echo '<option value="0" selected>NO</option>';
}else{
	echo '<option value="0">NO</option>';
}
if($reg['trab_aseg']==1){
	echo '<option value="1" selected>SI</option>';
}else{
	echo '<option value="1">SI</option>';
}
?>
        </select></td>
    </tr>
	<tr>
      <td>% Min de Venta Adicional </td>
      <td><input name="t19" type="text" id="t19" tabindex="8"
	  <?php
 
		if(isset($_POST['bot'])){
		echo 'value="'.$reg['por_vad'].'"';
		}
		?>
		></td>
	   <td>Permite Modificar en Venta </td>
       <td><select name="t18" id="t18" tabindex="3">
<?php
 
if($reg['trab_aseg']==0){
	echo '<option value="0" selected>NO</option>';
}else{
	echo '<option value="0">NO</option>';
}
if($reg['trab_aseg']==1){
	echo '<option value="1" selected>SI</option>';
}else{
	echo '<option value="1">SI</option>';
}
?>
        </select></td>
    </tr>
    <tr>
      <td colspan="4"><div align="center">
		  <input type="button" name="Submit2" value="Guardar" onClick="openpage('DI13000_MC.php','_self')"/>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          <input type="button" name="Submit2" value="Regresar" onClick="openpage('DI13000_PR.php','_self')"/>
      </div></td>
    </tr>
  </table>
</form>
 <?php
 
if(isset($_POST['bot3'])){
	echo '<div align="center">
	<form id="form1" name="form1" action="DI13000_PR.php" target="_self">
		<input type="submit" name="submit" value="Regresar">
	</form>
	</div>';
	
}
?>
 </body>
<?php
 
mysqli_close($con);
}
?>
</html>