<!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=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">  
         .tabela {float:left;  
            background-color: #00CCFF; layer-background-color: #00CCFF; border: 1px none #000000; border-width: 2px;
         }  
      </style>  
      <!--[if IE]>  
         <style type="text/css">  
            .tabela {float:left;  
            background-color: #00CCFF; layer-background-color: #00CCFF; border: 1px none #000000; border-width: 2px;
         }  
         </style>  
      <![endif]-->  

</head>
<body>
<span style="float:left;margin-right: 20px;margin-left: 20px;"><img src="logo_Educafro.png" width="163" height="159" /><img src="logosenuc.png" width="520" height="183" /></span>
<?php
global $dal;
$sql2 = "select * from senuc_score where idnucleo ='".$_SESSION["idnucleo"]."' order by ano desc, mes desc";
$rs2 = CustomQuery($sql2);
$data2 = db_fetch_array($rs2);
$_SESSION['score'] = $data2['score'];
$_SESSION['ano_score'] = $data2['ano'];
$_SESSION['mes_score'] = $data2['mes'];


$sql3 = "select count(*) as nprof  from senuc_professores where idnucleo ='".$_SESSION["idnucleo"]."' and ativo=1";
$rs3 = CustomQuery($sql3);
$data3 = db_fetch_array($rs3);
$_SESSION['nprof'] = $data3['nprof'];

$sql4 = "select count(*) as naluno  from senuc_aluno where idnucleo ='".$_SESSION["idnucleo"]."' and ativo=1";
$rs4 = CustomQuery($sql4);
$data4 = db_fetch_array($rs4);
$_SESSION['naluno'] = $data4['naluno'];

$sql5 = "select count(*) as ncoordenador from senuc_coordenador where idnucleo ='".$_SESSION["idnucleo"]."' and ativo=1";
$rs5 = CustomQuery($sql5);
$data5 = db_fetch_array($rs5);
$_SESSION['ncoordenador'] = $data5['ncoordenador'];




if($_SESSION['score']<=200){
$_SESSION['pontuacao']=1;}
else if($_SESSION['score']>200 and $_SESSION['score']<=400 ){
$_SESSION['pontuacao']=2;}
else if($_SESSION['score']>400 and $_SESSION['score']<=700 ){
$_SESSION['pontuacao']=3;}
else if($_SESSION['score']>700 and $_SESSION['score']<=900 ){
$_SESSION['pontuacao']=4;}
else {
$_SESSION['pontuacao']=5;}

function getEstrelas($numero_estrelas, $nome_hidden_estrelas){
	$retorno = "";
	$i=0;
	if ($nome_hidden_estrelas == ""){
		for ($i=0;$i<=4;$i++){
			if ($numero_estrelas<=$i){$retorno .= "<img src=\"estrela2.gif\" width=\"16\" height=\"16\">";}
			else{$retorno .= "<img src=\"estrela1.gif\" width=\"16\" height=\"16\">";}
		}
	}
	else{
		if ($numero_estrelas == 0){
			$retorno .= "<img src=\"estrela2.gif\" aceso=\"0\" alt=\"1 estrela\" id=\"star1\" onclick=\"changeStar(this, 1, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela2.gif\" aceso=\"0\" alt=\"2 estrelas\" id=\"star2\" onclick=\"changeStar(this, 2, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela2.gif\" aceso=\"0\" alt=\"3 estrelas\" id=\"star3\" onclick=\"changeStar(this, 3, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela2.gif\" aceso=\"0\" alt=\"4 estrelas\" id=\"star4\" onclick=\"changeStar(this, 4, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela2.gif\" aceso=\"0\" alt=\"5 estrelas\" id=\"star5\" onclick=\"changeStar(this, 5, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
		}
		elseif ($numero_estrelas == 1){
			$retorno .= "<img src=\"estrela1.gif\" aceso=\"1\" alt=\"1 estrela\" id=\"star1\" onclick=\"changeStar(this, 1, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela2.gif\" aceso=\"0\" alt=\"2 estrelas\" id=\"star2\" onclick=\"changeStar(this, 2, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela2.gif\" aceso=\"0\" alt=\"3 estrelas\" id=\"star3\" onclick=\"changeStar(this, 3, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela2.gif\" aceso=\"0\" alt=\"4 estrelas\" id=\"star4\" onclick=\"changeStar(this, 4, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela2.gif\" aceso=\"0\" alt=\"5 estrelas\" id=\"star5\" onclick=\"changeStar(this, 5, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
		}
		elseif ($numero_estrelas == 2){
			$retorno .= "<img src=\"estrela1.gif\" aceso=\"1\" alt=\"1 estrela\" id=\"star1\" onclick=\"changeStar(this, 1, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela1.gif\" aceso=\"1\" alt=\"2 estrelas\" id=\"star2\" onclick=\"changeStar(this, 2, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela2.gif\" aceso=\"0\" alt=\"3 estrelas\" id=\"star3\" onclick=\"changeStar(this, 3, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela2.gif\" aceso=\"0\" alt=\"4 estrelas\" id=\"star4\" onclick=\"changeStar(this, 4, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela2.gif\" aceso=\"0\" alt=\"5 estrelas\" id=\"star5\" onclick=\"changeStar(this, 5, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
		}
		elseif ($numero_estrelas == 3){
			$retorno .= "<img src=\"estrela1.gif\" aceso=\"1\" alt=\"1 estrela\" id=\"star1\" onclick=\"changeStar(this, 1, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela1.gif\" aceso=\"1\" alt=\"2 estrelas\" id=\"star2\" onclick=\"changeStar(this, 2, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela1.gif\" aceso=\"1\" alt=\"3 estrelas\" id=\"star3\" onclick=\"changeStar(this, 3, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela2.gif\" aceso=\"0\" alt=\"4 estrelas\" id=\"star4\" onclick=\"changeStar(this, 4, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela2.gif\" aceso=\"0\" alt=\"5 estrelas\" id=\"star5\" onclick=\"changeStar(this, 5, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
		}
		elseif ($numero_estrelas == 4){
			$retorno .= "<img src=\"estrela1.gif\" aceso=\"1\" alt=\"1 estrela\" id=\"star1\" onclick=\"changeStar(this, 1, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela1.gif\" aceso=\"1\" alt=\"2 estrelas\" id=\"star2\" onclick=\"changeStar(this, 2, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela1.gif\" aceso=\"1\" alt=\"3 estrelas\" id=\"star3\" onclick=\"changeStar(this, 3, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela1.gif\" aceso=\"1\" alt=\"4 estrelas\" id=\"star4\" onclick=\"changeStar(this, 4, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela2.gif\" aceso=\"0\" alt=\"5 estrelas\" id=\"star5\" onclick=\"changeStar(this, 5, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
		}
		elseif ($numero_estrelas == 5){
			$retorno .= "<img src=\"estrela1.gif\" aceso=\"1\" alt=\"1 estrela\" id=\"star1\" onclick=\"changeStar(this, 1, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela1.gif\" aceso=\"1\" alt=\"2 estrelas\" id=\"star2\" onclick=\"changeStar(this, 2, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela1.gif\" aceso=\"1\" alt=\"3 estrelas\" id=\"star3\" onclick=\"changeStar(this, 3, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela1.gif\" aceso=\"1\" alt=\"4 estrelas\" id=\"star4\" onclick=\"changeStar(this, 4, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
			$retorno .= "<img src=\"estrela1.gif\" aceso=\"1\" alt=\"5 estrelas\" id=\"star5\" onclick=\"changeStar(this, 5, 'estrelas')\" style=\"cursor:hand\" width=\"16\" height=\"16\">";
		}
		$retorno .= "<input type=\"hidden\" id=\"estrelas\" name=\"$nome_hidden_estrelas\" value=\"$numero_estrelas\">";
	}		
	return $retorno;
}

if($_SESSION["UserName"]){
?>
 

 <table class="tabela"  height="180" width="550" border="0" cellspacing="2" cellpadding="2">
 
<tr>
    <th scope="row"><font size="+2" color="#FFFFFF" > NÚCLEO :</font> </th>
    <td><font size="+2" color="#FFFF66"><?php echo $_SESSION['nucleo']; ?></font></td>
  </tr>
  <tr>
    <th scope="row"><br /><font size="+2" color="#FFFFFF">PONTUAÇÃO :</font></th>
    <td><br /><?php echo getEstrelas($_SESSION['pontuacao'], "estrelas"); ?></td>
  </tr>
  <tr>
    <th scope="row"><br /><font size="-1" color="#FFFFFF">ÚLTIMOS LANÇAMENTOS : <?php echo " ".$_SESSION['mes_score']." / ".$_SESSION['ano_score']; ?></font></th>
    <td><br /><font size="-1" color="#FFFFFF">SCORE ATUAL : <?php echo $_SESSION['score']." PONTOS"; ?></font></td>
  </tr>
<tr>
    <th scope="row"><br /><font size="-1" color="#FFFFFF">ALUNOS : <?php echo $_SESSION['naluno']; ?></font></th>
    <td><br /><font size="-1" color="#FFFFFF">PROFESSORES : <?php echo $_SESSION['nprof']; ?></font></td>
  </tr>
<tr>
    <th scope="row"><br /><font size="-1" color="#FFFFFF">COORDENADORES : <?php echo $_SESSION['ncoordenador']; ?></font></th>
    
  </tr>

</table> 




</body>
</html>
<?php
}
?>