<?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
 
$ayuda = 'DN1400A_AG.php';
include("DYAYUDA.php");
?>
<body <?php
 
	if(isset($_POST['bot3'])){
		echo ' onLoad="deshab()"';
	}
	?>>
<form name="frm1" method="post" action="">
<?php
 
	include("DN14000_CL.php");
	$varc= new clase();
	
	if(($varc->revisar())!="ok") echo '<meta content="1; url=DN14000_PR.php" HTTP-EQUIV="REFRESH">';
	$arlst=$varc->lista_completa();
	$armes[1][]="01";
	$armes[1][]="ENERO";
	$armes[2][]="02";
	$armes[2][]="FEBRERO";
	$armes[3][]="03";
	$armes[3][]="MARZO";
	$armes[4][]="04";
	$armes[4][]="ABRIL";
	$armes[5][]="05";
	$armes[5][]="MAYO";
	$armes[6][]="06";
	$armes[6][]="JUNIO";
	$armes[7][]="07";
	$armes[7][]="JULIO";
	$armes[8][]="08";
	$armes[8][]="AGOSTO";
	$armes[9][]="09";
	$armes[9][]="SEPTIEMBRE";
	$armes[10][]="10";
	$armes[10][]="OCTUBRE";
	$armes[11][]="11";
	$armes[11][]="NOVIEMBRE";
	$armes[12][]="12";
	$armes[12][]="DICIEMBRE";
	$arpol=array(1=>"GENERAL", "DEPARTAMENTO", "EMPRESA");
	$sqag=mysqli_query($con ,"select * from dnareage");
	$sqag2=mysqli_query($con ,"select * from dnareage");
?>
  
  <table  align="center">
    <tr>
      <th colspan="9" scope="col"> CAPTURA DE PARAMETROS GENERALES</th>
    </tr>
    <tr>
      <td  nowrap>% Ries Trabajo : </td>
      <td colspan="2" nowrap class="inputcodigo"><div align="center">
        <input name="tert" type="text" id="tert" value="<?php
 
		if(!isset($_POST['seacs']) && !isset($_POST['seafa'])) echo $arlst["por_rtrab"];
		else echo $_POST['tert'];
		?>">
      </div></td>
      <td  nowrap>Tope SM Ries/Trabajo:</td>
      <td colspan="2" nowrap class="inputcodigo"><div align="center">
        <input name="tesmrt" type="text" id="tesmrt" value="<?php
 if(!isset($_POST['seacs']) && !isset($_POST['seafa'])) echo $arlst["top_rtrab"];
		else echo $_POST['tesmrt'];?>">
      </div></td>
      <td nowrap>Tope SM SDI:</td>
      <td  colspan="2" nowrap class="inputcodigo"><div align="center">
        <input name="tetsmsdi" type="text" id="tetsmsdi" value="<?php
  if(!isset($_POST['seacs']) && !isset($_POST['seafa'])) echo $arlst["top_sdi"];
		else echo $_POST['tetsmsdi'];?>">
      </div></td>
    </tr>
    <tr>
      <td nowrap>% Subsidio Determinado : </td>
      <td colspan="2" nowrap class="inputcodigo"><div align="center">
        <input name="tesd" type="text" id="tesd" value="<?php
 if(!isset($_POST['seacs']) && !isset($_POST['seafa'])) echo $arlst["por_subsi"];
		else echo $_POST['tesd'];?>">
      </div></td>
      <td nowrap>Tab ISPT Apl/Nomina : </td>
      <td colspan="2" nowrap class="inputcodigo"><div align="center">
        <input name="tetisptan" type="text" id="tetisptan" value="<?php
  if(!isset($_POST['seacs']) && !isset($_POST['seafa'])) echo $arlst["cve_tab_nom"];
		else echo $_POST['tetisptan'];?>">
      </div></td>
      <td nowrap>Tab ISPT Apl/Anual : </td>
      <td colspan="2" nowrap class="inputcodigo"><div align="center">
        <input name="tetisptaa" type="text" id="tetisptaa" value="<?php
 if(!isset($_POST['seacs']) && !isset($_POST['seafa'])) echo $arlst["cve_tab_anu"];
		else echo $_POST['tetisptaa'];?>">
      </div></td>
    </tr>
    <tr>
      <td nowrap>% Impuesto Sobre Nomina : </td>
      <td colspan="2" nowrap class="inputcodigo"><div align="center">
        <input name="teisn" type="text" id="teisn" value="<?php
 if(!isset($_POST['seacs']) && !isset($_POST['seafa'])) echo $arlst["apl_por_snom"];
		else echo $_POST['teisn'];?>">
      </div></td>
      <td nowrap>Area Geogr&aacute;fica General : </td>
      <td colspan="2" nowrap class="inputcodigo"><div align="center">
		<select name="seagg" id="seagg">
		<?php
 
		while($arag=mysqli_fetch_array($sqag)){
			if(!isset($_POST['seacs']) && !isset($_POST['seafa'])){ 
				if($arlst["are_geo_gen"]==$arag["cve_arge"]) echo '<option value="'.$arag["cve_arge"].'" selected>'.$arag["des_arge"].'</option>';
				else echo '<option value="'.$arag["cve_arge"].'">'.$arag["des_arge"].'</option>';
			}
			elseif($_POST['seagg']==$arag["cve_arge"]) echo '<option value="'.$arag["cve_arge"].'" selected>'.$arag["des_arge"].'</option>';
			else echo '<option value="'.$arag["cve_arge"].'">'.$arag["des_arge"].'</option>';
		}
		?>
		</select>
      </div></td>
      <td nowrap>Del D.F.: </td>
      <td colspan="2" nowrap class="inputcodigo"><div align="center">
        <select name="seddf" id="seddf">
        <?php
 
		while($arag=mysqli_fetch_array($sqag2)){
			if(!isset($_POST['seacs']) && !isset($_POST['seafa'])){ 
				if($arlst["are_geo_df"]==$arag["cve_arge"]) echo '<option value="'.$arag["cve_arge"].'" selected>'.$arag["des_arge"].'</option>';
				else echo '<option value="'.$arag["cve_arge"].'">'.$arag["des_arge"].'</option>';
			}
			elseif($_POST['seddf']==$arag["cve_arge"]) echo '<option value="'.$arag["cve_arge"].'" selected>'.$arag["des_arge"].'</option>';
			else echo '<option value="'.$arag["cve_arge"].'">'.$arag["des_arge"].'</option>';
		}
		?>
		</select>
      </div></td>
    </tr>
    <tr>
      <td nowrap>Apl/Cuota Sindical: </td>
      <td  nowrap class="inputcodigo"><div align="center">
        <select name="seacs" id="seacs" onChange="javascript: document.getElementById('frm1').submit()">
          <option value="SI" <?php
 if(!isset($_POST['seacs']) && !isset($_POST['seafa'])){ 
		  if($arlst["apl_csin"]=="SI") echo 'selected';
		  }
		elseif($_POST['seacs']=="SI") echo 'selected';?>>SI</option>
          <option value="NO" <?php
 if(!isset($_POST['seacs']) && !isset($_POST['seafa'])){ 
		  if($arlst["apl_csin"]=="NO") echo 'selected';
		  }
		elseif($_POST['seacs']=="NO") echo 'selected';?>>NO</option>
          </select>
      </div></td>
      <td nowrap>% Cuota Sindical: </td>
      <td nowrap class="inputcodigo"><div align="center">
        <input name="tecs" type="text" id="tecs" 
		<?php
 
		if(!isset($_POST['seacs']) && !isset($_POST['seafa'])){ 
			if($arlst["apl_csin"]=="NO"){ 
				echo ' disabled="disabled" value=" "';
				}
			else{
				echo ' value="'.$arlst["pcs_sin"].'"';
			}
		}
		elseif(isset($_POST['seacs'])){
			if($_POST['seacs']=="NO"){ 
				echo ' disabled="disabled" value=" "';
				}
			else{
				echo ' value="'.$_POST['tecs'].'"';
			}
		}
		else{
			echo ' value="'.$_POST['tecs'].'"';
		}
		?>>
      </div></td>
      <td nowrap>Apl/Fondo Ahorro : </td>
      <td nowrap class="inputcodigo"><div align="center">
        <select name="seafa" id="seafa" onChange="javascript: document.getElementById('frm1').submit()">
          <option value="SI" <?php
  if(!isset($_POST['seacs']) && !isset($_POST['seafa'])){ 
		  if($arlst["apl_faho"]=="SI") echo 'selected';
		  }
		elseif($_POST['seafa']=="SI") echo 'selected';?>>SI</option>
          <option value="NO" <?php
 if(!isset($_POST['seacs']) && !isset($_POST['seafa'])){ 
		  if($arlst["apl_faho"]=="NO") echo 'selected';
		  }
		elseif($_POST['seafa']=="NO") echo 'selected';?>>NO</option>
          </select>
      </div></td>
      <td nowrap>% Fondo Ahorro: </td>
      <td colspan="2" nowrap class="inputcodigo"><div align="center">
        <input name="tefa" type="text" id="tefa" 
		<?php
 
		if(!isset($_POST['seacs']) && !isset($_POST['seafa'])){
			if($arlst["apl_faho"]=="NO"){ 
				echo ' disabled="disabled" value=" "';
				}
			else{
				echo ' value="'.$arlst["pfh_sin"].'"';
			}
		
		} 
		elseif(isset($_POST['seafa'])){
			if($_POST['seafa']=="NO"){ 
				echo ' disabled="disabled" value=" "';
				}
			else{
				echo ' value="'.$_POST['tefa'].'"';
			}
		}
		else{
			echo ' value="'.$_POST['tefa'].'"';
		}
		?>>
      </div></td>
    </tr>
    <tr>
      <td nowrap>Poliza:</td>
      <td colspan="2" nowrap class="inputcodigo"><div align="center">
        <select name="sepol" id="sepol">
        <?php
 
		for($i=1; $i<=count($arpol); $i++){
		if(!isset($_POST['seacs']) && !isset($_POST['seafa'])){ 
			if($arlst["apl_pol"]==$arpol[$i]) echo '<option value="'.$arpol[$i].'" selected>'.$arpol[$i].'</option>';
				else echo '<option value="'.$arpol[$i].'">'.$arpol[$i].'</option>';
		}
		elseif($_POST['sepol']==$arpol[$i]) echo '<option value="'.$arpol[$i].'" selected>'.$arpol[$i].'</option>';
		else echo '<option value="'.$arpol[$i].'">'.$arpol[$i].'</option>';
		}
		?>
        </select>
      </div></td>
      <td nowrap>Proceso Poliza: </td>
      <td colspan="2" nowrap class="inputcodigo"><div align="center">
        <select name="sepp" id="sepp">
          <option value="CATPERCDEPTO" <?php
 if(!isset($_POST['seacs']) && !isset($_POST['seafa'])){ 
		  if($arlst["pro_pol"]=="CATPERCDEPTO") echo 'selected';
		  }
		elseif($_POST['sepp']=="CATPERCDEPTO") echo 'selected';?>>CAT/PERC + DEPTO</option>
          <option value="DEPTOCATPERC"  <?php
 if(!isset($_POST['seacs']) && !isset($_POST['seafa'])){ 
		  if($arlst["pro_pol"]=="DEPTOCATPERC") echo 'selected';
		  }
		elseif($_POST['sepp']=="DEPTOCATPERC") echo 'selected';?>>DEPTO + CAT/PERC</option>
        </select>
      </div></td>
      <td nowrap>Listado:</td>
      <td colspan="2" nowrap class="inputcodigo"><div align="center">
        <select name="selis" id="selis">
          <option value="GENERAL"  <?php
  if(!isset($_POST['seacs']) && !isset($_POST['seafa'])){ 
		  if($arlst["lis_nom"]=="GENERAL") echo 'selected';
		  }
		elseif($_POST['selis']=="GENERAL") echo 'selected';?>>GENERAL</option>
          <option value="DETALLE"  <?php
 if(!isset($_POST['seacs']) && !isset($_POST['seafa'])){ 
		  if($arlst["lis_nom"]=="DETALLE") echo 'selected';
		  }
		elseif($_POST['selis']=="DETALLE") echo 'selected';?>>DETALLE</option>
          </select>
      </div></td>
    </tr>
    <tr>
      <td colspan="2" nowrap><div align="center">&nbsp;</div></td>
      <td nowrap>A&ntilde;o Proceso: </td>
      <td nowrap class="inputcodigo"><div align="center">
        <input name="teaxopro" type="text" id="teaxopro" value="<?php
 if(!isset($_POST['seacs']) && !isset($_POST['seafa'])) echo $arlst["axo_pro"];
		else echo $_POST['teaxopro'];?>">
      </div></td>
      <td nowrap><div align="center">&nbsp;</div></td>
      <td nowrap>Mes Proceso: </td>
      <td nowrap class="inputcodigo"><div align="center">
        <select name="semp" id="semp">
		<?php

		for($i=1; $i<=12; $i++){
			if(!isset($_POST['seacs']) && !isset($_POST['seafa'])){ 
		  		if($arlst["mes_pro"]==$armes[$i][0]) echo '<option value="'.$armes[$i][0].'" selected>'.$armes[$i][1].'</option>';
				else echo '<option value="'.$armes[$i][0].'">'.$armes[$i][1].'</option>';
		}
		elseif($_POST['semp']==$armes[$i][0]) echo '<option value="'.$armes[$i][0].'" selected>'.$armes[$i][1].'</option>';
		else echo '<option value="'.$armes[$i][0].'">'.$armes[$i][1].'</option>';
		}
		?>
          </select>
      </div></td>
      <td colspan="2" nowrap><div align="center">&nbsp;</div></td>
    </tr>
    <tr>
      <td colspan="9"><div align="center">
        <input type="button" name="Submit" value="Guardar" onClick="openpage('DN14000_MC.php','_self')">
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="button" name="Submit2" value="Regresar" onClick="openpage('DN14000_PR.php','_self')">
      &nbsp;</div></td>
    </tr>
  </table>
</form>
<?php
 
if(isset($_POST['bot3'])){
	echo '<div align="center">
	<form id="form1" name="form1" action="DN14000_PR.php" target="_self">
		<input type="submit" name="submit" value="Regresar">
	</form>
	</div>';
	
}
mysqli_close($con);
?>
</body>
</html>
