<? require_once("checar.php"); 
session_name("SESION");
session_start(); 
require_once("coneccion.php");
$id=$_SESSION[id];
$pwd=$_SESSION[password];
$_SESSION[lugar]=6;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>.::Estadistica de Bibliotecas::.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="estilos1.css">
<script type="text/javascript" src="funciones6.js"></script>
<script LANGUAGE="JavaScript">
function x(myfield,e,dec)
{
if(numbersonly(myfield,e,dec)){
	sumar(myfield,e,dec);
	return true;
}
return false;
}


function sumar(myfield,e,dec){
cadena = myfield.name;
resultado = cadena.substr (0, 5); // subcadena = 'dos'
cad=new String(cadena);

var1=((myfield.name).substr(0,cad.length-1))+1;
var2=((myfield.name).substr(0,cad.length-1))+2;

var3=parseInt(document.forma[var1].value);
var4=parseInt(document.forma[var2].value);

if(var3>=0)var8=var3; else var8=0;
if(var4>=0)var9=var4; else var9=0;
var10=var8+var9;

if (resultado=="otros" && var10>=1) document.forma.especi.disabled=false;
if (resultado=="otros" && var10==0) {
	document.forma.especi.disabled=true;
	document.forma.especi.value="";
	}
	
//alert(resultado);

//if(parseInt(document.forma[var1].value>=0)){ var3=0;//var3=parseInt(document.forma[var1].value);}// else var3=0;
//if(parseInt(document.forma[var2].value>=0) var4=parseInt(document.forma[var2].value); else var4=0;

	document.forma[resultado].value=var10;
	
	kiko1=parseInt(document.forma.direc1.value);
	if(!(kiko1>=0)) kiko1=0;
	kiko2=parseInt(document.forma.proce1.value);
	if(!(kiko2>=0)) kiko2=0;
	kiko3=parseInt(document.forma.publi1.value);
	if(!(kiko3>=0)) kiko3=0;
	kiko4=parseInt(document.forma.bibli1.value);
	if(!(kiko4>=0)) kiko4=0;
	kiko5=parseInt(document.forma.admin1.value);
	if(!(kiko5>=0)) kiko5=0;	
	kiko6=parseInt(document.forma.servi1.value);
	if(!(kiko6>=0)) kiko6=0;		
	kiko7=parseInt(document.forma.otros1.value);
	if(!(kiko7>=0)) kiko7=0;				
	document.forma.person1.value=kiko1+kiko2+kiko3+kiko4+kiko5+kiko6+kiko7;
//	document.forma[resultado].value=parseInt(document.forma[var1].value)+parseInt(document.forma[var2].value); 	

	chavo1=parseInt(document.forma.direc2.value);
	if(!(chavo1>=0)) chavo1=0;
	chavo2=parseInt(document.forma.proce2.value);
	if(!(chavo2>=0)) chavo2=0;
	chavo3=parseInt(document.forma.publi2.value);
	if(!(chavo3>=0)) chavo3=0;
	chavo4=parseInt(document.forma.bibli2.value);
	if(!(chavo4>=0)) chavo4=0;
	chavo5=parseInt(document.forma.admin2.value);
	if(!(chavo5>=0)) chavo5=0;	
	chavo6=parseInt(document.forma.servi2.value);
	if(!(chavo6>=0)) chavo6=0;		
	chavo7=parseInt(document.forma.otros2.value);
	if(!(chavo7>=0)) chavo7=0;				
	
	document.forma.person2.value=chavo1+chavo2+chavo3+chavo4+chavo5+chavo6+chavo7;
	document.forma.person.value=parseInt(document.forma.person2.value)+parseInt(document.forma.person1.value);


}


function numbersonly(myfield, e, dec)
{
var key;
var keychar;
if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
{	//Capt_Val();
   	return true;
}
keychar = String.fromCharCode(key);
// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
{   
return true;
}
else if ((("0123456789").indexOf(keychar) > -1))
{	//Capt_Val();
   	return true;
}
else if (dec && (keychar == "."))
   {
   myfield.form.elements[dec].focus();
   
   return false;
   }
else
   return false;
}

function menu(){
	location.href="menu.php";
	}
	
function salir(){
	location.href="salir.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">
<form name="forma" >

<?
$sql = "SELECT * FROM cie_cct where row_id='$_SESSION[id]'";
$result = mysql_query($sql);  
$row = mysql_fetch_array($result);

$funcion02 = "SELECT * FROM personal where id='$_SESSION[id]'";
$funcion01 = mysql_query($funcion02);  
if($funcion01!='') $funcion = mysql_fetch_array($funcion01);
?>
<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>
 
<div id="transparencia"><div id="transparenciaMensaje"></div>
</div>    


<br>
<center> 	
<TABLE border=0  width="850" cellpadding=0 cellspacing=0 bordercolor="#FFFFFF" rules="none" class="tabla1" >
	<tr>
	    <td align="left"><button id="botonEnviar" onClick="menu()" type="button">Ir al menu</button></td>
    	<td align="right" ><strong><input type="button" value="SALIR" onClick="salir();"></strong></td>
    </tr>
    <tr>
	    <td colspan="2"><button id="botonEnviar" onClick="validaForm()" type="button" <? if($_SESSION[folio]==1) echo "disabled"; ?>>Guardar</button></td>
	</tr>
</TABLE>

<TABLE class="tabla1" width="850" align="center"  border=1 rules="none" cellspacing=0 cellpadding=2 bordercolor="#E4E4E4" >

  <tr bgcolor="#E4E4E4"> 
    <td colspan="5" ><font size="2" face="Arial"><strong>VI. PERSONAL POR FUNCION</strong></font></td>
  </tr>
  <tr bgcolor="#E4E4E4"> 
    <td width="12" valign="top"><font size="2" face="Arial">1.</font></td>
    <td colspan="4" bgcolor="#E4E4E4"><font size="2" face="Arial">Registre a todo el personal que labora en la biblioteca, de acuerdo con la funci&oacute;n que desempe&ntilde;a y estudios realizados, considerando los siguientes criterios:</font></td></tr>
<tr bgcolor="#E4E4E4">
<td><font size="2" face="Arial">A)</font></td>
<td colspan="4"><font size="2" face="Arial"> Registre el personal conforme a la funci&oacute;n que desempe&ntilde;a en la actualidad, independientemente de la fuente de pago o si percibe o no sueldo.</font></td>
</tr>
<tr bgcolor="#E4E4E4">
<td><font size="2" face="Arial">B)</font></td>
<td colspan="4"><font size="2" face="Arial"> Si una persona desempe&ntilde;a dos funciones, deber&aacute; anotarse s&oacute;lo una vez, considerando la funci&oacute;n a la que dedique mayor tiempo.</font></td>
</tr>
<tr bgcolor="#E4E4E4">
<td><font size="2" face="Arial">C)</font></td>
<td colspan="4"><font size="2" face="Arial"> Si en la biblioteca trabaja una sola persona, se anotara en el rengl&oacute;n de directivo.</font></td>
</tr>
<tr bgcolor="#E4E4E4">
<td><font size="2" face="Arial">D)</font></td>
<td colspan="4"><font size="2" face="Arial"> Ninguna persona que labore en la biblioteca deber&aacute; quedar excluida de esta secci&oacute;n.</font></td>
</tr>
  <tr > 
	<td colspan="5"><font size="2" face="Arial">
	  <div align="center"><strong>FUNCIONES</strong><BR>
      </div></font></td>
    </tr>
<tr>
<td colspan="2">&nbsp;</td>
<td colspan="3"  bgcolor="#E4E4E4"><div align="center"><font size="2" face="Arial"><STRONG>ESTUDIOS</STRONG></font></div></td>
</tr>
  <tr  bgcolor="#E4E4E4"> 
	<td>&nbsp;</td>
	<td width="178">&nbsp;</td>
	<td align="center"><div align="center"><font size="2" face="Arial">BIBLIOTECONOMIA, BIBLIOTECOLOGIA</font></div></td>        
	<td align="center"><div align="center"><font size="2" face="Arial">OTROS ESTUDIOS</font></div></td>
    <td align="center"><font size="2" face="arial"><strong>TOTAL</strong></font></td>
  </tr>  
  <tr > 
	<td>&nbsp;</td>
	<td><font size="2" face="Arial">DIRECTIVO</font></td>
	<td align="center"><input size="4" maxlength="1" name="direc1" onChange="return x(this,event)" value="<? echo $funcion[1]; ?>" <? if($_SESSION[folio]==1)echo "disabled";?>></td>       
    <td align="center"><input size="4" maxlength="1" name="direc2" onChange="return x(this,event)" value="<? echo $funcion[2]; ?>" <? if($_SESSION[folio]==1)echo "disabled";?>></td>
    <td align="center"><input size="4" maxlength="2" name="direc" value="<? echo $funcion[3]; ?>" readonly <? if($_SESSION[folio]==1)echo "disabled";?>></td>
	</tr>  
  <tr > 
	<td>&nbsp;</td>
	<td><font size="2" face="Arial">PROCESOS TECNICOS</font></td>
	<td align="center"><input size="4" maxlength="2" name="proce1" onChange="return x(this,event)" value="<? echo $funcion[4]; ?>" <? if($_SESSION[folio]==1)echo "disabled";?>></td>        
	<td align="center"><input size="4" maxlength="2" name="proce2" onChange="return x(this,event)" value="<? echo $funcion[5]; ?>" <? if($_SESSION[folio]==1)echo "disabled";?>></td>
    <td align="center"><input size="4" maxlength="2" name="proce" value="<? echo $funcion[6]; ?>" readonly <? if($_SESSION[folio]==1)echo "disabled";?> ></td>    
  </tr>  
  <tr > 
	<td>&nbsp;</td>
	<td><font size="2" face="Arial">SERVICIOS AL PUBLICO</font></td>
	<td align="center"><input size="4" maxlength="2" name="publi1" onChange="return x(this,event)"  value="<? echo $funcion[7]; ?>" <? if($_SESSION[folio]==1)echo "disabled";?>></td>        
	<td align="center"><input size="4" maxlength="2" name="publi2" onChange="return x(this,event)"  value="<? echo $funcion[8]; ?>" <? if($_SESSION[folio]==1)echo "disabled";?>></td>
    <td align="center"><input size="4" maxlength="2" name="publi" value="<? echo $funcion[9]; ?>" readonly <? if($_SESSION[folio]==1)echo "disabled";?>></td>        
  </tr>  
  <tr > 
	<td>&nbsp;</td>
	<td><FONT size="2" face="ARIAL">DE APOYO A LOS SERVICIOS BIBLIOTECARIOS</FONT></td>
	<td align="center"><input size="4" maxlength="2" name="bibli1" onChange="return x(this,event)" value="<? echo $funcion[10]; ?>" <? if($_SESSION[folio]==1)echo "disabled";?>></td>        
	<td align="center"><input size="4" maxlength="2" name="bibli2" onChange="return x(this,event)"  value="<? echo $funcion[11]; ?>" <? if($_SESSION[folio]==1)echo "disabled";?>></td>
    <td align="center"><input size="4" maxlength="2" name="bibli" value="<? echo $funcion[12]; ?>" readonly <? if($_SESSION[folio]==1)echo "disabled";?>></td>    
  </tr>  
  <tr > 
	<td>&nbsp;</td>
	<td><font size="2" face="Arial">ADMINISTRATIVO</font></td>
	<td align="center"><input size="4" maxlength="2" name="admin1" onChange="return x(this,event)"  value="<? echo $funcion[13]; ?>" <? if($_SESSION[folio]==1)echo "disabled";?>></td>        
	<td align="center"><input size="4" maxlength="2" name="admin2" onChange="return x(this,event)"  value="<? echo $funcion[14]; ?>" <? if($_SESSION[folio]==1)echo "disabled";?>></td>
    <td align="center"><input size="4" maxlength="2" name="admin" value="<? echo $funcion[15]; ?>" readonly <? if($_SESSION[folio]==1)echo "disabled";?>></td>        
  </tr>  
  <tr > 
	<td>&nbsp;</td>
	<td><font size="2" face="Arial">DE APOYO A LOS SERVICIOS ADMINISTRATIVOS</font></td>
	<td align="center"><input size="4" maxlength="2" name="servi1" onChange="return x(this,event)" value="<? echo $funcion[16]; ?>" <? if($_SESSION[folio]==1)echo "disabled";?>></td>        
	<td align="center"><input size="4" maxlength="2" name="servi2" onChange="return x(this,event)" value="<? echo $funcion[17]; ?>" <? if($_SESSION[folio]==1)echo "disabled";?>></td>
    <td align="center"><input size="4" maxlength="2" name="servi" value="<? echo $funcion[18]; ?>" readonly <? if($_SESSION[folio]==1)echo "disabled";?>></td>    
  </tr>  
  <tr > 
	<td>&nbsp;</td>
	<td><font size="2" face="Arial">OTROS**</font></td>
	<td align="center"><input size="4" maxlength="2" name="otros1" onChange="return x(this,event)" value="<? echo $funcion[19]; ?>"<? if($_SESSION[folio]==1)echo "disabled";?>></td>        
	<td  align="center"><input size="4" maxlength="2" name="otros2" onChange="return x(this,event)" value="<? echo $funcion[20]; ?>"<? if($_SESSION[folio]==1)echo "disabled";?>></td>
    <td align="center"><input size="4" maxlength="2" name="otros" value="<? echo $funcion[21]; ?>" readonly <? if($_SESSION[folio]==1)echo "disabled";?>></td>    
  </tr>  
  <tr>
  <TD>&nbsp;</TD>
  <TD><FONT size="2" face="ARIAL"><strong>TOTAL DE PERSONAL</strong></FONT></TD>
  <TD align="center"><input size="4" maxlength="3" readonly name="person1" value="<? echo $funcion[22]; ?>" <? if($_SESSION[folio]==1)echo "disabled";?>></TD>
  <TD align="center"><input size="4" maxlength="3" readonly name="person2" value="<? echo $funcion[23]; ?>" <? if($_SESSION[folio]==1)echo "disabled";?>></TD>
    <td align="center"><input size="4" maxlength="3" name="person" value="<? echo $funcion[24]; ?>" readonly <? if($_SESSION[folio]==1)echo "disabled";?>></td>    
  </tr>
  <tr>
  <TD>&nbsp;</TD>
  <TD><FONT size="2" face="ARIAL">**ESPECIFIQUE</FONT></TD>
  <TD colspan="2" align="left"><textarea id="temas" name="especi" cols="30" rows="1" <? if (!$funcion[19]>0 and !$funcion[20]>0) echo "disabled"; ?>  <? if($_SESSION[folio]==1)echo "disabled";?>><? echo $funcion[25];?></textarea>  </TD>
  </tr>
  </TABLE>
  </center>
</form>
<div id="mensajesAyuda">
	<div id="ayudaTitulo"></div>
	<div id="ayudaTexto"></div>
</div>

</body>
</html>
