2008-07-17 Esteban Sanchez <estebans@artica.es>

* include/functions.php: Minimal style correction.

        * include/functions_db.php: Check sql_cache with empty() to avoid
        notices.

        * operation/agentes/status_monitor.php: Tab style correction.

        * general/logon_ok.php: Added missing field to SQL sentence which was 
        causing PHP notices.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@956 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
esanchezm 2008-07-17 06:41:39 +00:00
parent 347570ef42
commit 899619e246
5 changed files with 106 additions and 96 deletions

View File

@ -1,3 +1,15 @@
2008-07-17 Esteban Sanchez <estebans@artica.es>
* include/functions.php: Minimal style correction.
* include/functions_db.php: Check sql_cache with empty() to avoid
notices.
* operation/agentes/status_monitor.php: Tab style correction.
* general/logon_ok.php: Added missing field to SQL sentence which was
causing PHP notices.
2008-07-15 Esteban Sanchez <estebans@artica.es>
* ChangeLog: Fixed some indentation and lines length issues. Fixed

View File

@ -44,7 +44,7 @@ echo "<tr><td valign='top'>";
// Site news !
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo '<h2>' . $lang_label["site_news"] . '</h2>';
$sql_news = "SELECT subject,timestamp,text FROM tnews ORDER by timestamp DESC LIMIT 3";
$sql_news = "SELECT subject,timestamp,text,author FROM tnews ORDER by timestamp DESC LIMIT 3";
if ($result_news = mysql_query ($sql_news)){
echo '<table cellpadding="4" cellspacing="4" width="270" class="databox">';
while ($row = mysql_fetch_array ($result_news)) {

View File

@ -434,7 +434,7 @@ function format_for_graph ($number , $decimals = 1, $dec_point = ".", $thousands
return number_format ($number / 1000, 0, $dec_point, $thousands_sep )." K";
}
/* If it has decimals */
if (fmod ($number , 1))
if (fmod ($number, 1))
return number_format ($number, $decimals, $dec_point, $thousands_sep);
return number_format ($number, 0, $dec_point, $thousands_sep);
}

View File

@ -1321,9 +1321,9 @@ function get_db_all_rows_sql ($sql) {
global $sql_cache;
$retval = array();
if($sql_cache[$sql]) {
if (! empty ($sql_cache[$sql])) {
$retval = $sql_cache[$sql];
$sql_cache[saved]++;
$sql_cache['saved']++;
} else {
$result = mysql_query ($sql);
if (!$result) {
@ -1336,7 +1336,7 @@ function get_db_all_rows_sql ($sql) {
$sql_cache[$sql] = $retval;
mysql_free_result ($result);
}
if(!empty ($retval))
if (! empty ($retval))
return $retval;
return ""; //Return empty because NULL is a possible database value
}

View File

@ -173,15 +173,14 @@ $SQL_FINAL = $SQL_pre . $SQL;
$SQL_COUNT = $SQL_pre_count . $SQL;
$counter = get_db_sql ($SQL_COUNT);
if ( $counter > $config["block_size"]) {
if ( $counter > $config["block_size"]) {
pagination ($counter, $URL, $offset);
$SQL_FINAL .= " LIMIT $offset , ".$config["block_size"];
}
}
if ($counter > 0){
echo "
<table cellpadding='4' cellspacing='4' width='750' class='databox'>
if ($counter > 0) {
echo "<table cellpadding='4' cellspacing='4' width='750' class='databox'>
<tr>
<th>
<th>".$lang_label["agent"]."</th>
@ -194,7 +193,6 @@ if ($counter > 0){
$color =1;
$result=mysql_query($SQL_FINAL);
while ($data=mysql_fetch_array($result)){ //while there are agents
if ($color == 1){
$tdcolor="datos";
@ -209,7 +207,7 @@ if ($counter > 0){
$my_interval = $data[7];
}
if ($status == 2){
if ($status == 2) {
$seconds = time() - $data[9];
if ($seconds < ($my_interval*2))
@ -220,7 +218,7 @@ if ($counter > 0){
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$data["id_agente"]."&id_agente_modulo=".$data[0]."&flag=1&tab=data&refr=60'>";
echo "<img src='images/target.png'></a>";
echo "</td><td class='$tdcolor'>";
echo "<b><a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$data[5]."'>".strtoupper(substr($data[1],0,21))."</a></b>";
echo "<strong><a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$data[5]."'>".strtoupper(substr($data[1],0,21))."</a></strong>";
echo "</td><td class='$tdcolor'>";
echo "<img src='images/".show_icon_type($data[6])."' border=0></td>";
echo "<td class='$tdcolor'>". substr($data[2],0,21). "</td>";
@ -242,7 +240,7 @@ if ($counter > 0){
else
echo "<span>";
echo human_time_comparation($data[10]);
echo human_time_comparation ($data[10]);
echo "</span></td></tr>";
}
echo "</table>";