<?php session_start();
$idus=$_SESSION["usuario_id"];
require ('../conectar.php');
require ('funciones.php');
$sql="Select concat(nombre,' ',a_pat) as usuario FROM empleados where id_empleado='$idus'";
$sd=mysql_query($sql);
$s=mysql_fetch_array($sd);
$idpago=$_GET["idpago"];
?>
<html>
<head>
<style>
			  .datos{border:0;-moz-border-radius: 5px;-webkit-border-radius: 5px;border-radius: 5px;-khtml-border-radius: 5px;border-collapse: collapse;color:#0d0d0d;font-family:arial;width:99%;}
			  
			  .datos .trd{ color:#000000 min-height:20px !important;max-height:20px !important;height:20px !important; background:#CCCCCC; font-size:9px;border:solid 1px #000000;}
			  .datos .trd td{padding-left:10px; border-left:solid 1px;}
			  .datos .trb{ color:#000000; min-height:20px !important;max-height:20px !important;height:20px !important; font-size:9px;border:solid 1px #000000;}
			  .datos .trb td{padding-left:10px; border-left:solid 1px;}
			  
			  .loading{ position:fixed;left:50%;top:50%;width:250px;height:70px;margin-left:-125px;margin-top:-35px;display:none;background:url(images/bkloading.png);background-repeat:no-repeat;color:#ffffff;padding-top:25px;text-align:center;font-family:arial;font-size:12px;}
              </style>
</head>
<body>
<?php 

if(isset($_POST["comentario"]))
{
		$comentario=$_POST["comentario"];
		$idpago=$_POST["idpago"];


$sql="UPDATE pagos set comentario='$comentario' where id_pago='$idpago'";
		mysql_query($sql);

		

		}
$consulta="SELECT * from pagos where id_pago='$idpago'";
$re=mysql_query($consulta);
while($ls=mysql_fetch_array($re)){
?>
 <form method="post">
<table class="datos">
  <tr class="trd">
    <td width="149" height="29"><strong>Fecha</strong></td>
 <td>Comentario</td>
 </tr>
  <tr class="trb">
    <td height="62"><?php echo $ls['fecha'];?></td>
<td>
		<textarea rows="10" cols="40" name="comentario"  id="comentario" ><?echo $ls['comentario']."\n".fechatexto(date("Y-m-d"))."\n".$s['usuario'].":";?></textarea>
	</td>
  </tr>

</table><input type="hidden" id="idpago" name="idpago" value="<?echo$idpago?>">
<p align="center">
<input type="submit" name="registrar" id="registrar" value="Guardar"> </p>
<? }?>

</form>
</body>
</html>