예제 #1
0
    print "<b>Entry successfully added</b>\n";
}
?>
<hr>
<?php 
/* Display entries */
$qh = mysql_query("select name, email, msg from guestbook order by entry_id desc");
if ($qh === false) {
    die("Cannot select entries from guestbook: " . mysql_error() . "\n");
}
function disprow($id, $val)
{
    $id = stripslashes($id);
    $val = stripslashes($val);
    print "<tr>\n";
    print "<td width=20%><b>{$id}</b>:</td>\n";
    print "<td>{$val}</td>\n";
    print "</tr>\n";
    print "<tr><td colspan=2></tr>\n";
}
print "<table border=1 cellpadding=1 width=75%>\n";
while ($row = mysql_fetch_array($qh, MYSQL_ASSOC)) {
    disprow('Name', $row['name']);
    disprow('Email', $row['email']);
    disprow('Message', $row['msg']);
}
print "</table>";
?>
</body>
</html>
예제 #2
0
echo "<table class=gb><thead>";
echo "<tr><th>Category Name</th><th>Display<sup>*</sup></th><th>Scale (optional)</th><th>Drops &amp; Category total</th><th id=weighthdr>";
if ($useweights == 0) {
    echo "Fixed Category Point Total (optional)<br/>Blank to use point sum";
} else {
    if ($useweights == 1) {
        echo "Category Weight (%)";
    }
}
echo '</th><th>Remove</th></tr></thead><tbody id="cattbody">';
disprow(0, $row);
$query = "SELECT id,name,scale,scaletype,chop,dropn,weight,hidden,calctype FROM imas_gbcats WHERE courseid='{$cid}'";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
while ($row = mysql_fetch_assoc($result)) {
    $id = $row['id'];
    disprow($id, $row);
}
echo "</tbody></table>";
//echo "<p><input type=submit name=addnew value=\"Add New Category\"/></p>";
echo '<p><input type="button" value="Add New Category" onclick="addcat()" /></p>';
echo '</fieldset>';
echo '<div class="submit"><input type=submit name=submit value="' . _('Save Changes') . '"/></div>';
echo "</form>";
echo '<p class="small"><sup>*</sup>When a category is set to Expanded, both the category total and all items in the category are displayed.<br/> ';
echo 'When a category is set to Collapsed, only the category total is displayed, but all the items are still counted normally.<br/>';
echo 'When a category is set to Hidden, nothing is displayed, and no items from the category are counted in the grade total. </p>';
echo '<p class="small"><sup>*</sup>If you drop any items, a calc type of "average percents" is required. If you are using a points earned / possible ';
echo 'scoring system and use the "average percents" method in a category, the points for the category may be a somewhat arbitrary value.</p>';
//echo "<p><a href=\"gbsettings.php?cid=$cid&addnew=1\">Add New Category</a></p>";
function disprow($id, $row)
{