Ejemplo n.º 1
0
    echo "The maximum for {$title} is {$maxValue} <br/>";
    ?>
	
	
	<table>
	<tr>
	<th> <?php 
    echo "{$title}";
    ?>
 </th>
	</tr>


<?php 
    foreach ($temparray as $value) {
        printrow($value);
    }
    ?>
</table>

	
<?php 
} else {
    ?>
<fieldset >
<legend >Statistical Analysis</legend>
<form method="get">

Enter Data Title:  <input type="text" name="title" size="30" /><br />

Enter Data Separated By Commas: <input type="text" name="data" size="30" /><br />
Ejemplo n.º 2
0
function rconstatus($ip, $port, $rcon_pass)
{
    $result = rcon($ip, $port, $rcon_pass, "status");
    $result = explode("\n", $result);
    print "<table class=\"table table-hover table-bordered\">\n";
    print "<thead>";
    printheadrow(array("ID", "Current score", "Ping", "Name", "IP", "Rate"));
    print "</thead>\n";
    array_shift($result);
    // 1st line : map q3wcp9
    array_shift($result);
    // 2nd line : col headers
    array_shift($result);
    // 3rd line : -- ------ ----
    array_pop($result);
    array_pop($result);
    // two empty lines at the end
    foreach ($result as $line) {
        $player = $line;
        preg_match_all("/^\\s*(\\d+)\\s*(\\d+)\\s*(\\d+)(.*?)(\\d*)\\s*(\\S*)\\s*(\\d*)\\s*(\\d*)\\s*\$/", $player, $out);
        $num = $out[1][0];
        $score = $out[2][0];
        $ping = $out[3][0];
        $name = trim($out[4][0]);
        //$lastmsg = $out[5][0];
        $address = $out[6][0];
        if ($address != 'bot') {
            $addressip = preg_replace("/:.*\$/", "", $address);
            $address = "{$address}";
        }
        //$qport = $out[7][0];
        $rate = $out[8][0];
        printrow(array($num, $score, $ping, $name, $address, $rate), "");
    }
    print "\n</table>\n";
}
Ejemplo n.º 3
0
 function BuildCabinet($cabid, $face = "front")
 {
     $cab = new Cabinet($cabid);
     $cab->GetCabinet();
     $order = $cab->U1Position == "Top" ? false : true;
     $dev = new Device();
     $dev->Cabinet = $cab->CabinetID;
     $dev->ParentDevice = 0;
     $bounds = array('max' => array('position' => 0, 'height' => 0), 'min' => array('position' => 0, 'height' => 0));
     // Read in all the devices and make sure they fit the cabinet.  If not expand it
     foreach ($dev->Search() as $device) {
         if ($device->Position == 0) {
             continue;
         }
         $pos = $order ? $device->Position : $device->Position - $device->Height;
         if ($device->Position > $bounds['max']['position']) {
             $bounds['max']['position'] = $device->Position;
             $bounds['max']['height'] = $device->Height;
         }
         if ($pos < $bounds['min']['position']) {
             $bounds['min']['position'] = $pos;
             $bounds['min']['height'] = 1;
         }
     }
     if ($order) {
         $top = max($cab->CabinetHeight, $bounds['max']['position'] + $bounds['max']['height'] - 1);
         $bottom = min(0, $bounds['min']['position']);
     } else {
         // Reverse order
         $top = min(1, $bounds['min']['position'] - $bounds['min']['height']);
         $bottom = max($cab->CabinetHeight, $bounds['max']['position']);
     }
     // Build cabinet HTML
     switch ($face) {
         case "rear":
             $cab->Location = "{$cab->Location} (" . __("Rear") . ")";
             break;
         case "side":
             $cab->Location = "{$cab->Location} (" . __("Side") . ")";
             break;
         default:
             // Leave the location alone
     }
     // helper function to print the rows of the cabinet table
     if (!function_exists("printrow")) {
         function printrow($i, $top, $bottom, $order, $face, &$htmlcab, $cabobject)
         {
             $error = $i > $cabobject->CabinetHeight || $i <= 0 && $order || $i < 0 && !$order ? ' error' : '';
             if ($order) {
                 $x = $i <= 0 ? $i - 1 : $i;
             } else {
                 $x = $i >= 0 ? $i + 1 : $i;
             }
             if ($i == $top) {
                 if ($face == "rear") {
                     $rs = "-rear";
                 } elseif ($face == "side") {
                     $rs = "-side";
                 } else {
                     $rs = "";
                 }
                 $rowspan = abs($top) + abs($bottom);
                 $height = (abs($top) + abs($bottom)) * ceil(220 * (1.75 / 19)) . "px";
                 $htmlcab .= "\t<tr id=\"pos{$x}\"><td class=\"pos{$error}\">{$x}</td><td rowspan={$rowspan}><div id=\"servercontainer{$rs}\" class=\"freespace\" style=\"width: 220px; height: {$height}\" data-face=\"{$face}\"></div></td></tr>\n";
             } else {
                 $htmlcab .= "\t<tr id=\"pos{$x}\"><td class=\"pos{$error}\">{$x}</td></tr>\n";
             }
         }
     }
     // If they have rights to the device then make the picture clickable
     $clickable = $cab->Rights != "None" ? "\t\t<a href=\"cabnavigator.php?cabinetid={$cab->CabinetID}\">\n\t" : "";
     $clickableend = $cab->Rights != "None" ? "\n\t\t</a>\n" : "";
     $htmlcab = "<table class=\"cabinet\" id=\"cabinet{$cab->CabinetID}\">\n\t<tr><th colspan=2>{$clickable}{$cab->Location}{$clickableend}</th></tr>\n\t<tr><td>Pos</td><td>Device</td></tr>\n";
     // loop here for the height
     // numbered high to low, top to bottom
     if ($order) {
         for ($i = $top; $i > $bottom; $i--) {
             printrow($i, $top, $bottom, $order, $face, $htmlcab, $cab);
         }
     } else {
         // numbered low to high, top to bottom
         for ($i = $top; $bottom > $i; $i++) {
             printrow($i, $top, $bottom, $order, $face, $htmlcab, $cab);
         }
     }
     $htmlcab .= "</table>\n";
     // Wrap it in a nice div
     $htmlcab = '<div class="cabinet">' . $htmlcab . '</div>';
     // debug information
     // print "Cabinet:  $cab->CabinetID   Top: $top   Bottom: $bottom<br>\n";
     return $htmlcab;
 }
Ejemplo n.º 4
0
<center><h1>Thanksgiving Dates</h1>
<em>It's never too early to start planning!<br/>
Thanksgiving is the greatest holiday of the year!</em><br/>
<br/>
<img src="football.png" alt="Turkey and Football" height="150" width="500" /><br />


<table>
<tr>
	<th> Year </th> <th> Date </th>
</tr>
<?php 
for ($year = 2013; $year <= 2023; $year += 1) {
    $color = swapcolor($color);
    $date = thanksgivingdate($year);
    printrow($color, $year, $date);
}
?>



</table>
</body>
</html>



<?php 
function swapcolor($color)
{
    if ($color == "gold") {