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

if(!isset($_REQUEST['bot']))$_REQUEST['bot']="";
if ($_REQUEST['bot']==""){
	echo '<h2>!!! SELECCIONE UN REGISTRO !!!</h2>';
	echo '<meta content="1; url=cat_agencias_PR.php"  HTTP-EQUIV="REFRESH">';
}else{
	if(!isset($_REQUEST['tap2'])){
		include('cat_agencias_CL.php');
		$varible_clase = new clase();
		$res=$varible_clase->lista_busqueda($_REQUEST["bot"]);
		$reg=mysqli_fetch_array($res);
		$_REQUEST['tap2']=$reg['agdescrip'];
		$_REQUEST['n_reg']=$reg['n_reg'];
		$_REQUEST['atelefono']=$reg['atelefono'];
		$_REQUEST['afax']=$reg['afax'];
		$_REQUEST['amail']=$reg['amail'];
		$_REQUEST['adireccion']=$reg['adireccion'];
		$_REQUEST['select']=$reg['atipo'];
		$_REQUEST['acontacto']=$reg['acontacto'];
		}
?>
<style type="text/css">
<!--
.Estilo19 {font-size: 16px}
-->
</style>  	
<body onLoad = "self.focus (); document.frm1.tap2.focus ()">

<form name="frm1" method="post" action="" enctype="multipart/form-data">
  <p>
    <input name="bot" type="hidden" value="<?php
 echo $_REQUEST['bot'];?>"> 
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <table width="374" align="center">
    <tr>
      <th colspan="4">MODIFICAR AGENCIA</th>
    </tr>
    <tr>
      <th width="78"><strong>CODIGO</strong></th>
      <td width="280" colspan="3" style="#A15E8D"><span class="Estilo19">
        <input name="tclave" type="text" id="tclave" size="15" value="<?php
 echo $_REQUEST['n_reg'];?>">
      </span></td>
    </tr>
      <tr>
        <th width="78"><strong>DESCRIPCION</strong></th>
        <td colspan="3" style="#A15E8D"><label>
        <input name="tap2" id="tap2" type="text" tabindex="1" value="<?php
 echo $_REQUEST['tap2'];?>"
		  onBlur="may(this)" size="39"
		 <?php
 
		if(isset($_REQUEST['bot'])){
		echo 'value="'.$reg['agdescrip'].'"';
		}
		?>>
        </label></td>
      </tr>
      
      
      <tr>
        <th height="29"><strong>CONTACTO</strong></th>
        <td height="29" colspan="3" style="#A15E8D"><label>
          <input name="acontacto" type="text" id="acontacto" onBlur="may(this)" tabindex="2"  value="<?php
 echo $_REQUEST['acontacto'];?>" size="35">
        </label></td>
      </tr>
      <tr>
        <th height="29"><strong>DIRECCION</strong></th>
        <td height="29" colspan="3" style="#A15E8D"><label>
          <input name="adireccion" type="text" id="adireccion"  onBlur="may(this)" tabindex="3" value="<?php
 echo $_REQUEST['adireccion'];?>" size="35">
        </label></td>
      </tr>
      <tr>
        <th height="29"><strong>TELEFONO</strong></th>
        <td height="29" colspan="3" style="#A15E8D"><label>
          <input name="atelefono" type="text" id="atelefono"  tabindex="4" value="<?php
 echo $_REQUEST['atelefono'];?>" size="35">
        </label></td>
      </tr>
      <tr>
        <th height="29"><strong>E-MAIL</strong></th>
        <td height="29" colspan="3" style="#A15E8D"><label>
          <input name="amail" type="text" id="amail"  tabindex="5" value="<?php
 echo $_REQUEST['amail'];?>" size="35">
        </label></td>
      </tr>
      <tr>
        <th height="29"><strong>FAX</strong></th>
        <td height="29" colspan="3" style="#A15E8D"><label>
          <input name="afax" type="text" id="afax"  tabindex="6" value="<?php
 echo $_REQUEST['afax'];?>" size="35">
        </label></td>
      </tr>
      <tr>
        <th height="29"><strong>TIPO</strong></th>
        <td height="29" colspan="3" style="#A15E8D"><select name="select" tabindex="7">
  <option value="MINORISTA NACIONAL"<?php
if($_REQUEST['select']=="MINORISTA NACIONAL") echo 'selected';?>>MINORISTA NACIONAL</option>
  <option value="MAYORISTA NACIONAL"<?php
if($_REQUEST['select']=="MAYORISTA NACIONAL") echo 'selected';?>>MAYORISTA NACIONAL</option>
  <option value="MINORISTA EXTRANJERO"<?php
if($_REQUEST['select']=="MINORISTA EXTRANJERO") echo 'selected';?>>MINORISTA EXTRANJERO</option>
  <option value="MAYORISTA EXTRANJERO"<?php
if($_REQUEST['select']=="MAYORISTA EXTRANJERO") echo 'selected';?>>MAYORISTA EXTRANJERO</option>
        </select></td>
      </tr>
       
      <tr>
        <th height="29" colspan="4">
          <div align="center">
            <input name="bot1" type="button" class="original" tabindex="17" onClick="openpage('cat_agencias_MC.php','_self')" value="Modificar"/>
            <input name="bot4" type="button" class="bot_WsW" tabindex="18" onClick="openpage('cat_agencias_PR.php','_self')" value="Regresar"/>
          </div></th>
      </tr>
    </table>
</form>
 <?php
 } ?>
<?php
 mysqli_close($con);//169?>
</body>
</html>



