<?php
 
session_start();
include("DMMYSQLG.php");
include("DF30000.inc");
include("DF80000.php");
?>
<html>
<head>
<title>CENTRO COSTOS</title>

</head>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>

<body>
<form name="frm1" method="post" action="">
<?php
 
for($j=0;$j<=119;$j++)
{
	$c[]= "t" . $j;
	echo '<input name="' . $c[$j-1] . '" type="hidden" value="' . $_POST[$c[$j-1]] .'">';
}
?>
  <table width="722" border="0" align="center">

    <tr>
      <th colspan="6" class="titulo"><div align="center">AGREGAR SEGMENTOS. </div></th>
    </tr>
    <tr>
      <td width="85"><strong>AGENCIA.</strong></td>
      <td colspan="2"><select name="t39" id="t39" tabindex="7" onChange="javascript: document.getElementById('frm1').submit()">
        <option selected>-----SELECCIONE-----</option>
        <?php
 
	@$resultado1=mysqli_query($con ,"select * from valeryus07");
	while($registro1=mysqli_fetch_array($resultado1)){
		if ($_POST['t39'] == $registro1['agdescrip']){
			echo '<option value="' . $registro1['agdescrip'] . '" selected>' . $registro1['agdescrip'] . '</option>';
		}else {
			echo '<option value="' . $registro1['agdescrip'] . '">' . $registro1['agdescrip'] . '</option>';
		}
	}
?>
      </select></td>
      <td width="101"><strong>EMPRESA.</strong></td>
      <td colspan="2"><select name="t38" id="t38"  tabindex="8" onChange="javascript: document.getElementById('frm1').submit()">
        <option>-----SELECCIONE-----</option>
        <?php
 
	@$resultado1=mysqli_query($con ,"select * from fcompas");
	while($registro1=mysqli_fetch_array($resultado1)){
	if($_POST['t38'] == $registro1['pdesco']){
		echo '<option value="' . $registro1['pdesco'] . '"selected>' . $registro1['pdesco'] . '</option>';
	}else{
		echo '<option value="' . $registro1['pdesco'] . '">' . $registro1['pdesco'] . '</option>';
	}
}
?>
      </select></td>
    </tr>
    <tr>
      <td><strong>MERCADO.</strong></td>
      <td colspan="2"><select name="t33" id="t33" tabindex="7" onChange="javascript: document.getElementById('frm1').submit()">
        <option selected>-----SELECCIONE-----</option>
        <?php
 
	@$resultado1=mysqli_query($con ,"select * from tipmerca");
	while($registro1=mysqli_fetch_array($resultado1)){
		if ($_POST['t33'] == $registro1['tdescrip']){
			echo '<option value="' . $registro1['tdescrip'] . '" selected>' . $registro1['tdescrip'] . '</option>';
		}else {
			echo '<option value="' . $registro1['tdescrip'] . '">' . $registro1['tdescrip'] . '</option>';
		}
	}
?>
      </select></td>
      <td><strong>PLAN.</strong></td>
      <td colspan="2"><select name="t53" id="t53"  tabindex="8" onChange="javascript: document.getElementById('frm1').submit()">
        <option>-----SELECCIONE-----</option>
        <?php
 
	@$resultado1=mysqli_query($con ,"SELECT * FROM pplan");
	while($registro1=mysqli_fetch_array($resultado1)){
	if($_POST['t53'] == $registro1['pdescrip']){
		echo '<option value="' . $registro1['pdescrip'] . '"selected>' . $registro1['pdescrip'] . '</option>';
	}else{
		echo '<option value="' . $registro1['pdescrip'] . '">' . $registro1['pdescrip'] . '</option>';
	}
}
?>
      </select></td>
    </tr>
    <tr>
      <td><strong>SMERF.</strong></td>
      <td colspan="2"><select name="t56" id="t56" tabindex="7" onChange="javascript: document.getElementById('frm1').submit()">
        <option selected>-----SELECCIONE-----</option>
        <?php
 
	@$resultado1=mysqli_query($con ,"SELECT * FROM fsmerf");
	while($registro1=mysqli_fetch_array($resultado1)){
		if ($_POST['t56'] == $registro1['descripcion']){
			echo '<option value="' . $registro1['descripcion'] . '" selected>' . $registro1['descripcion'] . '</option>';
		}else {
			echo '<option value="' . $registro1['descripcion'] . '">' . $registro1['descripcion'] . '</option>';
		}
	}
?>
      </select></td>
      <td><strong>SEGMENTO.</strong></td>
      <td colspan="2"><select name="t52" id="t52"  tabindex="8" onChange="javascript: document.getElementById('frm1').submit()">
        <option>-----SELECCIONE-----</option>
        <?php
 
	@$resultado1=mysqli_query($con ,"SELECT * FROM valeryus06");
	while($registro1=mysqli_fetch_array($resultado1)){
	if($_POST['t52'] == $registro1['descripcion']){
		echo '<option value="' . $registro1['descripcion'] . '"selected>' . $registro1['descripcion'] . '</option>';
	}else{
		echo '<option value="' . $registro1['descripcion'] . '">' . $registro1['descripcion'] . '</option>';
	}
}
?>
      </select></td>
    </tr>
    
    <tr>
      <th colspan="6" class="titulo"><div align="center">AGREGAR TARIFAS Y FORMA DE PAGO. </div></th>
    </tr>
    <tr>
      <td><strong>FORMA DE PAGO.</strong></td>
      <td colspan="2"><select name="t68" id="t68" tabindex="7" onChange="javascript: document.getElementById('frm1').submit()">
        <option>-----SELECCIONE-----</option>
        <?php
 
$sql = mysqli_query($con ,"SELECT * FROM valeryus09 WHERE pmontomax = 'ABONO' AND ppago = 'SI'");
while($reg=mysqli_fetch_array($sql)){
	if($_POST['t68']==$reg['descripcion'] ){
		echo '<option value="' . $reg['descripcion'] . '" selected>' . $reg['descripcion'] . '</option>';
	}else{
		echo '<option value="' . $reg['descripcion'] . '">' . $reg['descripcion'] . '</option>';
	}
}
?>
      </select></td>
      <td><strong>NUMERO DE TARJETA.</strong></td>
      <td colspan="2"><input name="t43" type="text" tabindex="13" onKeyPress="return soloNumeros(event)" size="25"
	  <?php

				if(isset($_POST['t43'])){ 
			echo 'value="' . $_POST['t43'] .  '"';
			}
		?>/></td>
    </tr>
    <tr>
      <td><strong>CODIGO DE SEGURIDAD.</strong></td>
      <td width="198"><input name="t37" type="text" tabindex="6" onKeyPress="return soloNumeros(event)" size="15"
	  <?php

				if(isset($_POST['t37'])){ 
			echo 'value="' . $_POST['t37'] .  '"';
			}
		?>/></td>
      <td width="52"><strong>LIMITE.</strong></td>
      <td><input name="t58" type="text" tabindex="28" size="10" maxlength="10"
	  <?php

				if(isset($_POST['t58'])){ 
			echo 'value="' . $_POST['t58'] .  '"';
			}
		?> onKeyPress="return soloNumeros(event)"/></td>
      <td width="65"><strong>SALDO.</strong></td>
      <td width="181"><input name="t35" type="text" onKeyPress="return validar(event)" size="10" maxlength="5"
<?php

if(isset($_POST['t33'])){ 
	@$resultado1=mysqli_query($con ,"select * from dxcoloni where cve_col=$_POST['t33']");
	while(@$registro1=mysqli_fetch_array($resultado1)){
		echo ' value="' . $registro1['cod_pos'] . '"';
	}
}
?>/></td>
    </tr>
    <tr>
      <th colspan="6">NOTAS.</th>
    </tr>
    <tr>
      <td colspan="6">
	    <div align="center">
	      <textarea name="t60" cols="80" rows="4" id="t60" tabindex="4"
	  onBlur="may(this)"><?php

				if(isset($_POST['t60'])){ //este es el truco
					echo $_POST['t60'];
				}
			?>
	    </textarea>
        </div></td>
      </tr>
    
    
    <tr>
      <td colspan="6"><div align="center">
           
          <input type="button" name="Submit3" value="Regresar" onClick="openpage('DZA11111.php','_self')">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
          <input type="button" name="Submit" value="Siguiente" onClick="openpage('DZA11113.php','_self')">
      </div></td>
    </tr>
  </table>
</form>
</body>
</html>
