Example #1
0
                        } else {
                            return floor($delta / 86400) . ' days ago.';
                        }
                    }
                }
            }
        }
    }
}
if (isset($_POST["i"]) && $_POST["i"] != "" && is_numeric($_POST["i"])) {
    $lastId = $_POST["i"];
    $result = Query("SELECT * FROM chats WHERE id > '" . $lastId . "' ORDER BY id DESC LIMIT 20;");
    $output = "";
    $firstRow = true;
    $lastSent = "NEVER";
    while ($row = mysql_fetch_array($result)) {
        if ($firstRow) {
            $lastId = $row["id"];
            $lastSent = $row["time"];
            $firstRow = false;
        }
        $output = $row["user"] . "\t" . $row["msg"] . "\n" . $output;
    }
    $output = $lastId . "\n" . $output;
    if ($_POST["i"] == "0") {
        $output = $output . "\nConsole\tWelcome to A3P. Last message sent " . ($lastSent == "NEVER" ? $lastSent : niceTime(strtotime($lastSent)));
    }
    echo $output;
}
CloseConnection();
Example #2
0
function Foot()
{
    echo '</div></body>
	<div>
	<foot>' . flatmenu() . '</foot>
	 </div>
	<html>';
    CloseConnection();
}
Example #3
0
function DisplayData()
{
    SetUpForm("H");
    OpenConnectionandDatabase();
    $result = RunSelect("Band", "", "", "BandName", "");
    echo "<table style='border:1px solid black'>";
    echo "<th>Band</th><th>CDs Sold</th><th>Price</th><th>Manager %</th>\n\t\t<th>Recording %</th><th>Advance Amt</th><th>Distributer</th><th>Manufacturing</th><th>Gig Date</th>";
    while ($row = mysqli_fetch_assoc($result)) {
        echo "<tr>";
        foreach ($row as $col) {
            echo "<td style='border:1px solid black'>";
            echo $col;
            echo "</td>";
        }
        echo "</tr>";
    }
    echo "</table>";
    CloseConnection();
    FinishForm();
}