MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: /home/asjudine/public_html/cartera_modificar_nominas.php
<?php 
require_once("mainfile.php");
include ("config.php");
global $dbi;

require_once("Conectarse.php");


if(isset($_POST["guardar"]))
		{
			
			$ced2 = $_GET["ced2"] ;
$numcon = $_GET["numcon"] ;
			
		if($_POST[unidt] != "")
		{
		
		$control3 = mysql_query('SELECT codigo, unidad FROM descuentos WHERE id = "' . $_POST[unidt] . '"  ');
			if (!$control3) {
				die('Invalid query: ' . mysql_error());
			} 	 
		list($codcd, $unidt) = mysql_fetch_row($control3);
		}else{
		$codcd=$_POST[ds];
		$unidt=$_POST[ud];
		}

		
		$mssql = mysql_query("UPDATE  cartera_estado_contable  set valor_cuota = '" . $_POST[val] . "', cuota = '" . $_POST[cuo] . "', mescuota = '" . $_POST[mi] . "', anocuota = '" . $_POST[ai] . "', codigo_descuento   = '" .$codcd. "', unidad_descuento    = '" .$unidt. "', fecha_registro = '" . $_POST[fr] . "', fecha_nomina = '" . $_POST[fenom] . "' WHERE id = '" . $_GET["id"]  . "' ");	
		if (!$mssql) {
				die('Invalid query primer UPDATE: ' . mysql_error());
			}
			
				 	$control = mysql_query('SELECT * FROM  cartera_estado_contable  WHERE id = "' . $_GET["id"] . '" ORDER BY cuota ASC ');
			if (!$control) {
				die('Invalid query: ' . mysql_error());
			}
			list($idr, $codigo, $nombre, $contrato, $tipo, $cuota, $mes_inicio, $ano_inicio, $valor, $fecha_registro, $fecha_nomina, $formapago) = mysql_fetch_row($control);
				
						$result2 = mysql_query('SELECT codigo, unidad  FROM descuentos WHERE codigo = "' ."$formapago". '" and unidad = "' ."$uni". '" ');
		  if (!$result2) {
				die('Invalid query 2: ' . mysql_error());
			}

					list($cod_descuento, $unidad_descuento) = mysql_fetch_row($result2);		

		echo "<script>alert('Los datos fueron modificados correctamente');</script>";
		echo "<SCRIPT LANGUAGE='javascript'>window.location.href='estado_contable_nomina.php?ced2=$ced2&numcon=$numcon'</SCRIPT>";
	  	}
		
		
		
		
	
		

	 	$control = mysql_query('SELECT * FROM  cartera_estado_contable  WHERE id = "' . $_GET["id"] . '" ORDER BY cuota ASC ');
			if (!$control) {
				die('Invalid query: ' . mysql_error());
			}
			list($idr, $codigo, $nombre, $contrato, $tipo, $cuota, $mes_inicio, $ano_inicio, $valor, $fecha_registro, $fecha_nomina, $formapago, $uni) = mysql_fetch_row($control);
				
					$result2 = mysql_query('SELECT codigo, unidad  FROM descuentos WHERE codigo = "' ."$formapago". '" and unidad = "' ."$uni". '" ');
		  if (!$result2) {
				die('Invalid query 2: ' . mysql_error());
			}

					list($cod_descuento, $unidad_descuento) = mysql_fetch_row($result2);		



$sql2 = mysql_query('SELECT * FROM descuentos WHERE estado = "1"  order by unidad ');
			if (!$sql2) {
				die('Invalid query: ' . mysql_error());
			} 
$row_sql2 = mysql_fetch_assoc($sql2);
$totalRows_sql2 = mysql_num_rows($sql2); 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Modificación </title>
<style type="text/css">
<!--
.est_cont1 {	font-family: "Times New Roman", Times, serif;
	font-size: 12px;
	font-style: normal;
	font-weight: normal;
	color: #4068F4;
	background-color: #E6FFF1;
	margin: 1px;
	padding: 1px;
	height: auto;
	width: auto;
	border: thin double #33CC66;
}
.est_cont2 {
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-style: normal;
	font-weight: normal;
	color: #000000;
	background-color: #F0F5CF;
	height: 18px;
	width: auto;
	border: thin solid #FABF85;


}
.Estilo1 {	color: #FF6600;
	font-weight: bold;
}
.Estilo3 {color: #2492FF;
	font-weight: bold;
}
.Estilo50 {color: #CC3333;
	font-family: "Arial Narrow";
	font-weight: bold;
}
.est_cont21 {font-family: Geneva, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-style: normal;
	font-weight: normal;
	color: #2B39EC;
	background-color: #F0F5CF;
	height: 18px;
	width: auto;
	border: thin solid #FABF85;
}


body {
	background-image: url(ELEMENTOS/gri06.jpg ); 
.Estilo50 {color: #CC3333;
	font-family: "Arial Narrow";
	font-weight: bold;
}
-->
</style>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
  <div align="center">
    <p><span class="Estilo1">RELACION DE PAGOS</span></p>
    <table width="335" border="1" class="est_cont1">
      <tr>
        <th width="62" height="19" scope="col"><div align="right"><strong>Valor :</strong></div></th>
        <th width="73" scope="col"><div align="left">
            <input name="val" type="text" class="est_cont2" id="val" value="<?php echo $valor ?>" size="13" maxlength="13" readonly/>
        </div></th>
        <th width="99" scope="col"><div align="right"><strong>Cuota :</strong></div></th>
        <th width="71" scope="col"><div align="left">
            <input name="cuo" type="text" class="est_cont2" id="cuo" value="<?php echo $cuota ?>" size="13" maxlength="13" readonly/>
        </div></th>
      </tr>
      <tr>
        <td><div align="right"><strong>Mes Inicio :</strong></div></td>
        <td><div align="left">
            <input name="mi" type="text" class="est_cont2" id="mi" value="<?php echo $mes_inicio ?>" size="13" maxlength="13" readonly/>
        </div></td>
        <td><div align="right"><strong>Año Inicio :</strong></div></td>
        <td><div align="left">
            <input name="ai" type="text" class="est_cont2" id="ai" value="<?php echo $ano_inicio ?>" size="13" maxlength="13" readonly/>
        </div></td>
      </tr>
      <tr>
       <td><div align="right"><strong>Fecha Nomina :</strong></div></td>
        <td><div align="left">
            <input name="fenom" type="text" class="est_cont2" id="fenom" value="<?php echo $fecha_nomina ?>" size="13" maxlength="13" readonly />
        </div></td>

        <td><div align="right"><strong>Fecha Registro :</strong></div></td>
        <td><div align="left">
            <input name="fr" type="text" class="est_cont2" id="fr" value="<?php echo $fecha_registro ?>" size="13" maxlength="13" readonly/>
        </div></td>
      </tr>
      <tr>
        <td><div align="right"><strong>Descuento :</strong></div></td>
        <td><div align="left">
          <input name="ds" type="text" class="est_cont2" id="ds" value="<?php echo $cod_descuento?>" size="13" maxlength="13" readonly="" />
        </div></td>
        <td><div align="right"><strong>Unidad :</strong></div></td>
        <td><input name="ud" type="text" class="est_cont2" id="ud" value="<?php echo $unidad_descuento?>" size="13" maxlength="13" readonly="" /></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td colspan="3"><select name="unidt" class="est_cont21" id="unidt">
          <option value="">--SELECIONE UNIDAD Y CODIGO--</option>
          <?php
     do {  
?>
          <option value="<?php echo $row_sql2['id'];?>"><?php echo $row_sql2['unidad'].'-'.$row_sql2['codigo']?></option>
          <?php
} while ($row_sql2 = mysql_fetch_assoc($sql2));
  $rows2 = mysql_num_rows($sql2);
  if($rows2 > 0) {
      mysql_data_seek($sql2, 0);
       $row_sql2 = mysql_fetch_assoc($sql2);
  }
?>
        </select></td>
      </tr>
    </table>
    <p>
   <input name="guardar" type="submit" class="Estilo3" id="guardar" value="Guardar" />

    </p>
    <p>
      <input name="menu2" type="button" class="Estilo50" id="menu2" onclick="window.location.href='menu_cartera_nomina.php'" value="IR AL MENU" />
	  
			<?php 
			$ced2 = $_GET["ced2"] ;   
			$numcon = $_GET["numcon"] ;
			
			
			echo "<input type='button' value='Volver al Estado' name=boton class=estilo1 onClick =window.location.href='estado_contable_nomina.php?ced2=$ced2&numcon=$numcon','','top=50,left=100,toolbar=no,scrollbars=yes,width=790,height=280,status=yes'></a>"; ?>
	</p>
 
  </div>
</form>
</body>
</html>