Tema: If y self??
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/07/2008, 07:30
nirvana_ve1
 
Fecha de Ingreso: junio-2008
Mensajes: 25
Antigüedad: 15 años, 10 meses
Puntos: 0
Exclamación If y self??

hola estoy haciendo un sistema de gestion que me calcule segun el porcentaje de puntos acumulado un msj para cada nivel.. el me calcula todo fino.. el problema es q cuando un usuario tiene tareas asignadas y no las ha evaluado se sobre escribe al mensaje que muestre otro usuario.. como si se copiara los msjs ayuda por fa! este es el codigo

<?php
$mensaje1='<span class="Estilo3"> menos de 49 </span>';
$mensaje2='50 - 55' ;
$mensaje3='56 - 60' ;
$mensaje4='61 - 65' ;
$mensaje5='66 - 70' ;
$mensaje6='71 - 75' ;
$mensaje7='76 - 80' ;
$mensaje8='81 - 85' ;
$mensaje9='<img src="imagenes/excelente.jpg">86 - 90' ;
$mensaje10='<img src="imagenes/casi_casi.gif">91 - 95';
$mensaje11='<span class="Estilo5"><img src="imagenes/578.gif"><strong>Excelente, </strong>';
?>

<link href="Level2_Arial_Forms.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--

function GP_popupConfirmMsg(msg) { //v1.0
document.MM_returnValue = confirm(msg);
}
//-->
</script>
<style type="text/css">
<!--
a {
font-weight: bold;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
-->
</style>
<link href="Level2_Verdana_Text.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.Estilo1 {color: #FFFFFF}
.Estilo2 {color: #000000}
.Estilo3 {color: #FF0000}
.Estilo4 {color: #0000FF}
.Estilo5 {
color: #0000CC;
font-weight: bold;
}
-->
</style>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<table width="564" border="0">
<tr>
<td width="558" class="xbig"> <img src="imagenes/info_suminvoice.gif" width="48" height="48">Cronograma</td>
</tr>
<tr>
<td><div align="justify">Aqui se muestra la lista de empleados, las tareas asignadas por cada empleado el puntaje acumulado y su grado de efectividad de acuerdo a las gestiones asignadas que haya realizado y las que no. </div></td>
</tr>
<tr>
<td height="19"><table width="558" border="2" cellspacing="0" bordercolor="#000066">
<tr>
<td bgcolor="#E3E9F1"><div align="center" class="Estilo5"><a href="jpgraph-1.26/src/Examples/grafica.php">Gr&aacute;fica de efectividad </a></div></td>
</tr>
<tr>
<td bgcolor="#E3E9F1"><div align="center" class="Estilo4"><a href="niveles%20de%20puntuacion.php">Tabla de Descripci&oacute;n de puntuaci&oacute;n</a></div></td>
</tr>
</table> </td>
</tr>
</table>
<table width="50" border="0" align="left">
<tr>
<td width="774" height="201"><table width="774" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" height="185">
<!--DWLayoutTable-->
<tr>
<td width="774" height="185" valign="top" bgcolor="#FFFFFF"><table width="774" border="0" align="left" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="774" height="95" valign="top" bgcolor="#FFFFFF"><table width="762" border="0" cellpadding="0" cellspacing="2" bgcolor="#FFFFFF" class="tabla">
<!--DWLayoutTable-->
<tr bgcolor="#A4B4C1">
<td height="8" colspan="7" bgcolor="#B1C3D9" class="Estilo4 Estilo1 titulos"><span class="Estilo2 Estilo7"><em><strong>Nivel de Desempe&ntilde;o de los Empleados:</strong></em></span></td>
</tr>
<tr bgcolor="#A4B4C1">
<td height="42" bgcolor="#7794AE" class="Estilo4 Estilo1 titulos"><div align="center" class="Estilo1">Cedula</div></td>
<td height="42" bgcolor="#7794AE" class="Estilo4 Estilo1 titulos"><div align="center" class="Estilo1">Nombre</div></td>
<td height="42" bgcolor="#7794AE" class="Estilo4 Estilo1 titulos"><div align="center" class="Estilo1">Apellido</div></td>
<td height="42" bgcolor="#7794AE" class="Estilo4 Estilo1 titulos"><div align="center" class="Estilo1">Cargo</div></td>
<td bgcolor="#7794AE" class="Estilo4 Estilo1 titulos"><div align="center" class="Estilo1 small"><strong>N&ordm; Tareas Asignadas </strong></div></td>
<td height="42" bgcolor="#FF9900" class="small"><div align="center">Puntaje Acumulado por Tareas </div></td>
<td width="172" height="42" bgcolor="#FFCC00" class="Estilo4 Estilo1 titulos"><div align="center" class="Estilo2"><strong>Grado de efectividad </strong></div></td>
</tr>
<?php do { ?>
<tr valign="middle" bgcolor="#E9E9E9">
<td width="78" bgcolor="#E3E9F1" class="titulos"><div align="center"><span class="Estilo15"><font face="Arial" size="1"><strong><font face="Arial" size="1"><?php echo $row_rsListadoCat['cedula']; ?></font></strong></font></span></div></td>
<td width="84" height="21" bgcolor="#E3E9F1" class="titulos"><div align="center"><font face="Arial" size="1"><strong><font face="Arial" size="1"><?php echo $row_rsListadoCat['nombre']; ?></font></strong></font></div></td>
<td width="85" bgcolor="#E3E9F1" class="titulos"><div align="center"><font face="Arial" size="1"><strong><font face="Arial" size="1"><?php echo $row_rsListadoCat['apellido']; ?></font></strong></font></div></td>
<td width="73" bgcolor="#E3E9F1" class="titulos"><div align="center"><font face="Arial" size="1"><strong><font face="Arial" size="1"><?php echo $row_rsListadoCat['cargo']; ?></font></strong></font></div></td>
<td width="114" bgcolor="#E3E9F1" class="titulos"><div align="center">
<?php
$stock=$row_rsListadoCat['cedula'];
require_once('Connections/connFlashblog.php');
if (!isset($codigo))
$link = mysql_connect($hostname_connFlashblog, $username_connFlashblog , $password_connFlashblog);
mysql_select_db($database_connFlashblog);
/////// acumulamos cantidad de tareas asignadas
$test11_t = mysql_query("SELECT COUNT(*) from gestion where empleado like '$stock'");
$test1_t = mysql_fetch_row($test11_t);
$test1_t[0];

echo $test1_t[0];




?>
</div></td>
<td width="140" bgcolor="#FFCCCC" class="titulos"><div align="center">
<h5>
<?php
$stock=$row_rsListadoCat['cedula'];
require_once('Connections/connFlashblog.php');
if (!isset($codigo))
$link = mysql_connect($hostname_connFlashblog, $username_connFlashblog , $password_connFlashblog);
mysql_select_db($database_connFlashblog);
/////// acumulamos los puntos
$test11xx = mysql_query("SELECT SUM(valor) from gestion where empleado like '$stock'");
$test1x = mysql_fetch_row($test11xx);


if ( $test1x[0] == '0')
{
echo '0';

}
else
if ( $test1x[0] >= '1')
{
$variable2=$test1x[0];
$variable1=$test1_t[0];
$calculo= $variable2;
//echo $calculo;
//$decimales='2';
//function porcentaje($variable2,$variable1,$decimales){
//return number_format($variable2/$variable1 ,2);
//}

$porciento = $calculo/$variable1;
$decimales=number_format($porciento, 2);
echo $decimales;


}



?>
% </h5>
</div></td>
<td bgcolor="#FFFFCC" class="titulos">&nbsp;
<?php if ( $test1_t[0]== '0' )
{ echo 'No tiene Tareas asignada'; }
else

if ( $test1_t[0]>= '1' )
{

$puntaje= $porciento;

if ( $puntaje <= '49')
{ echo $mensaje1; } else
if ( $puntaje >= '50'and $puntaje <='55')
{ echo $mensaje2; } else
if ( $puntaje >= '56'and $puntaje <='60')
{ echo $mensaje3; } else
if ( $puntaje >= '61' and $puntaje <='65')
{ echo $mensaje4; } else
if ( $puntaje >= '66' and $puntaje <='70')
{ echo $mensaje5; } else
if ( $puntaje >= '71' and $puntaje <= '75')
{ echo $mensaje6; } else
if ( $puntaje >= '76' and $puntaje <= '80')
{ echo $mensaje7; } else
if ( $puntaje >= '81' and $puntaje <= '85')
{ echo $mensaje8; } else
if ( $puntaje >= '86' and $puntaje <= '90')
{ echo $mensaje9; } else
if ( $puntaje >= '91' and $puntaje <= '95')
{ echo $mensaje10; } else
if ( $puntaje >= '96' and $puntaje <= '100')
{ echo $mensaje11; }
}
?>
<?php


mysql_free_result($rsCategorias);

mysql_free_result($rsListadoCat);
?>
<p>
<p>
<p>
<p>