<? require_once("checar.php"); 
session_name("SESION");
session_start(); 
$id=$_SESSION[id];
$pwd=$_SESSION[password];
$_SESSION[lugar]=11;
require_once("coneccion.php");
?>
<!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" />
<!-- <link rel="stylesheet" type="text/css" href="estilos1.css"> -->
<title>.:Sistema de Captura de Bibliotecas:.</title>
<script>
	function menu(){
		location.href="menu.php";
	}
	function salir(){
		location.href="salir.php";
	}	
	function oficializar(){
		location.href="acuse.php";
	}	
</script>
<style type="text/css">
.foot {	
	
	margin:0 auto;
	width:920px;
	padding:10px;
	margin-top:20px;
	background:#545454 url(bg-foot.jpg) no-repeat center top;
	
	position:relative;
	font-size:11px;
	/*text-transform:uppercase;*/
	line-height:1.4em;
}


.foot-texto {
	text-align:left;
	color:#ddd;
	padding:10px;
	padding-left:80px;
	background: url(bg-escudo-sonora.jpg) no-repeat  left center;

}

.foot-texto strong {
	color:#FFF;
	text-transform:uppercase;
}

.foot-texto a {
	color:#ddd;
}

.logo-ns-foot {
	background:url(logo-ns-foot.jpg) no-repeat center;
	width:137px;
	height:43px;
	position:absolute;
	top:25px;
	right:15px;
}
/*.contacto-aviso {
	background: #FFC63B url(bg-menu-portales-a-color.jpg) repeat-x bottom;
	padding:10px 5px;
	color:#ffffff;*/
	
.contacto-aviso {
	background: #3E5D72 url(bg-menu-res.jpg) repeat-x bottom;
	padding:10px 5px;
	color:#3E5D72;
}

<!--
@font-face { 
@font-family: MiFuente; 
src: url('http://148.235.6.240/upeo/insreal/geo_sans_light/GeosansLight.ttf'); 
} 
-->
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<?
$sql = "SELECT * FROM cie_cct where row_id='$id'";
$result = mysql_query($sql);  
$row = mysql_fetch_array($result); ?>
<center>
<table width="806" border="0">
<tr> <td colspan="4" align="center"><img src="header.png" width="1000" height="120"></td> </tr>
<tr class="contacto-aviso">
    <td height="35" colspan="4" align="center" valign="bottom"><font face="Arial, Helvetica, sans-serif" color="#FFFFFF" size="+2">S</font><font face="Arial, Helvetica, sans-serif" color="#FFFFFF">ISTEMA  DE </font><font color="#FFFFFF" size="+2" face="Arial, Helvetica, sans-serif">B</font><font face="Arial, Helvetica, sans-serif" color="#FFFFFF">IBLIOTECAS - </font><font color="#FFFFFF" size="+2" face="Arial, Helvetica, sans-serif">2014</font></td>
    <!--<td height="39" colspan="4" align="left" ><font face="MiFuente" color="#E9690B" size="+2">SEGUIMIENTO de Estructuras Educativas</font></td>-->
  </tr>
</table>
	<table width="1000" border="0">
	<tr>
		<td width="71"><font face="Arial, Helvetica, sans-serif" color="#000000" size="-1">ESCUELA:</font></td>
		<td width="767"> <font color="#17375E" face="Arial, Helvetica, sans-serif"><strong><? echo $row["nombrect"];?></strong></font> </td> 
		<td width="39"><font face="Arial, Helvetica, sans-serif" color="#000000" size="-1">CCT:</font></td>
		<td width="105"> <font face="Arial, Helvetica, sans-serif" color="#17375E"><strong><? echo $row["clavecct"];?></strong></font> </td> 
	</tr>

	</table>
</center>
<br />
<br />
<br />
<br />
<br />
<br />
<center>
<TABLE width="700" border=0 cellpadding=0 cellspacing=0 bordercolor="#FFFFFF" rules="none" class="tabla1" >
   
<? 
$result = mysql_query("select * from seguimiento where id='$id'");
$avance = mysql_fetch_array($result);
$m1 = $avance[1];
$m3 = $avance[2];
$m4 = $avance[3];
$m5 = $avance[4];
$m6 = $avance[5];
$m7 = $avance[6];
if($m1==1 and $m3==1 and $m4==1 and $m5==1 and $m6==1 and $m7==1){
	$fecha=(date("Y/m/d")); 
	$hora=(date("H:i:s")); 
	$tiempo=$fecha."-". $hora."-1";
	$a = split("/",$fecha);
	$folio=($a[2].$a[1].$id.($a[0]-2014));
	if($re=mysql_query("update seguimiento set f_ter='$tiempo', folio='$folio' where id='$id'")){
		$mensaje = "Fecha de terminacion registrada - Cuestionario terminado<br>SU NUMERO DE FOLIO ES: $folio";
		$_SESSION[folio]=1;
		}
	else $mensaje="Error al Registrar oficialización";
	
	?>
          
	<tr>
    	<td height="50" align="center"><font size="3" face="Arial, Helvetica, sans-serif"><? echo $mensaje; ?></font></td>
	</tr>

	<tr>
    	<td align="center"><input width="30" type="button" onclick="oficializar();" value="Imprimir Acuse de Oficializaci&oacute;n" /></td>
	</tr>
    
    <? 
	}
else {?>
	<script>
	location.href="menu.php";
	</script>
    <? 
	}?>
	<tr>
	    <td align="center" colspan="2" height="200"><input type="button" value="  IR AL MENU  " onClick="menu();">&nbsp;<input type="button" value="       SALIR      " onClick="salir();"></td>
	</tr>
	<tr>
	    <td colspan="2" height="50">&nbsp;</td>
	</tr>     
</table>
  <p>&nbsp;</p>
</center>

</body>
</html>
