</td></tr> <?php } //while } else { ?> <tr><td> <?php echo $choice; ?> </td> <td> <?php $per = round($count / $total * 100, 2); graphic($per); ?> </td> </tr> <?php } // else } // 2 while ?> </table> </div><br></td></tr> <?php } // 2 if
// Create a function to call our graphics generation page gd.php function graphic($blueval, $redval) { $pctrd = round($blueval * 100, 1); $pctbl = round($redval * 100, 1); $blueval = $blueval * 200; $redval = $redval * 200; echo " \r\n\t\t\t<table><tr><td align=\"center\">{$pctbl}%</td><td> \r\n\t\t\t<img src=\"" . INCLUDES . "gd.php?bluehg=" . $blueval . "&redhg=" . $redval . "\"height=\"100\"alt=\"Statistics\"title=\"Statistics\"/> \r\n\t\t\t</td><td align=\"center\">{$pctrd}%</td></tr></table>"; } // Create our layout for graphic display and repeatedly call the graphic() function echo " \r\n\t\t<tr><td colspan=\"3\"align=\"center\"> \r\n\t\t<table cellpadding=\"5\"border=\"1\"bgcolor=\"#cccccc\"> \r\n\t\t<tr><td align=\"center\"valign=\"bottom\">"; graphic($onsiteval, $offsiteval); echo "</td><td align=\"center\"valign=\"bottom\">"; graphic($winval, $macval); echo "</td><td align=\"center\"valign=\"bottom\">"; graphic($msval, $nsval); echo "</td></tr><tr><td align=\"center\">"; echo "Onsite v/s Offsite"; echo "</td><td align=\"center\">"; echo "Windows v/s Other"; echo "</td><td align=\"center\"align=\"center\">"; echo "Explorer v/s Other"; echo "</td></tr></table><tr>"; echo "<td align=\"center\"colspan=\"3\">"; echo " </td></tr><tr><td>Total Distinct Hits: <b>"; echo "{$total}</b></td>"; echo "<td align=\"center\"></td><td align=\"left\">"; // Analyze and calculate time elapsed data(i.e. Daily hits, hourly hits) $sql = "SELECT TO_DAYS(MAX(received)) - TO_DAYS(MIN(received)) AS record FROM {$dbsql}"; $results = mysql_query($sql); while ($myrow = mysql_fetch_assoc($results)) {