<?php
session_start();
include("DMMYSQLG.php");
include("DSA1000.php");
include("DFJQUERY.inc");
include("DFJSISCI.inc");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="es-es">
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<head>
<div align="center">
  <form name="form1" method="post" action="">
    <table  align="center" bordercolor="#45CFCC" bordercolordark="#45CFCC">
      <tr> <th>CATALOGO TIPO DE PAGO</th> </tr>
      <tr> <th>BUSQUEDA</th> </tr>
      <tr>
            <td><input type="submit" name="Submit" value="Buscar" class="bot_WsW" />
		<img src="magnifier.png" alt="Buscar" onClick="alert('Buscar')" />
        <input name="tbus" type="text" onBlur="may(this)" size="30"/></td>
      </tr>
      <tr>
        <th>CATALOGO TIPO DE PAGO</th>
      </tr>
      <tr>
        <td><div align="center">
          <input name="tbus2" type="text" id="tbus" onBlur="may(this)" size="50"
		<?php
			if(isset($_POST['tbus'])){ 
				echo 'value="' . $_POST['tbus'] .  '"';
			}
		?>
		/>
        </div></td>
      </tr> 
    </table>
  </form>
</div>
<form name="frm1" method="post" action=""  >

<div align="center">
 <?php
 
	$sql = mysqli_query($con ,"SELECT * FROM dgtippag WHERE cancelado='0' order by tip_pag");
	include("DE10000.php");
	?>
<table width="661" border='1' bordercolor="#45CFCC" bordercolordark="#45CFCC">
      <tr>
        <th colspan="6"> 
          <div align="center">
 <input type="Submit" name="bot3" value="Agregar"  onClick="openpage('cat_pagos_AG.php','_self')"class="bot_WsW"/>
            <input type="Submit" name="bot3" value="Consultar"  onClick="openpage('cat_pagos_CO.php','_self')"class="bot_WsW"/>
            <input type="button" name="bot2" value="Modificar" onClick="openpage('cat_pagos_MO.php','_self')" class="original"/>
            <input type="button" name="bot1" value="Eliminar" onClick="openpage('cat_pagos_EL.php','_self')" class="bot_RjR"/>
            <input type="button" name="bot4" value="Imprimir " onClick="openpage('cat_pagos_IM.php','_self')" class="original"/>
          </div></th></tr>
      <tr>
        <th width="33"><div align="center">Sel</div></th>
        <th width="59"><div align="center">Clave</div></th>
        <th width="83"><div align="center">Iniciales</div></th>
        <th width="150"><div align="center">Descripcion</div></th>
        <th width="201"><div align="center">Tipo Movimiento Pago</div></th>
		<th width="95"><div align="center">Afectacion</div></th>
      </tr>  <?php
$vart=(isset($_POST['tbus']))?$_POST['tbus']:"";
	echo '<input name="txt_bus" type="hidden" value="'.$vart.'">';
        $vars=(isset($_POST['submit']))?$_POST['submit']:"";
	if($vars==""){
		echo '<input name="tip_bus" type="hidden" value="clave">';
	  	@$sql = mysqli_query($con ,"SELECT * FROM dgtippag WHERE desc_pag like '%".$vart."%' and cancelado='0'");
		
	}elseif($vars==""){
		echo '<input name="tip_bus" type="hidden" value="nombre">';
		@$sql = mysqli_query($con ,"SELECT * FROM dgtippag WHERE desc_pag like '%".$vart."%' and cancelado='0'");
	}
	while($reg =mysqli_fetch_array($sql)){
	  	echo "<tr>";
		echo '<td> <div align="center"><input name="bot" type="radio" value="'. $reg["tip_pag"].'"></div></td>';
		echo "<td> <div align='center' style=' '><strong>" . $reg["tip_pag"] . "</strong></div></td>";
		echo "<td> <div align='center' style=' '><strong>" . $reg["ini_pag"] . "</strong></div></td>";				
		echo "<td> <div align='center' style=' '><strong>" . $reg["desc_pag"] . "</strong></div></td>";
		
		if($reg["tip_mv_pag"]=="N"){
			$s = "NO APLICA REFERENCIA";
		}elseif($reg["tip_mv_pag"]=="R"){
			$s = "APLICA REFERENCIA NO VERIFICA";
		}elseif($reg["tip_mv_pag"]=="V"){
			$s = "APLICA REFERENCIA C/VERIFICACION DE DATOS";
		}
		echo '<td><div align="center"  ><strong>'.$s.'</strong></center></td>';
		
		if($reg["tip_aplica"]=="A"){
			$s = "ANTICIPOS";
		}elseif($reg["tip_aplica"]=="N"){
			$s = "NOTAS DE CREDITO";
		}else{
			$s = "";
		}
		echo '<td><div align="center"  ><strong>'.$s.'</strong></center></td>';
		echo "</tr>";
	}
	mysqli_close($con);?>
  </table>
</div>
</form>
</body>
</html>
