} echo '</select><br>Password<br><input type="password" name="password1" /><br>Confirm<br><input type="password" name="password2" /><br><input type="button" name ="reset" value="Reset" onclick="checkPassword(\'resetform\')"/><input type="hidden" name="resetpass" value="resetpass" /></form>'; } break; case 'editcat': //case for editing Catagory Info $c = new Catagory(); if (isset($_GET['catid'])) { if (isset($_POST['editcat']) and isset($_POST['catinfo'])) { if ($c->setInfo($_GET['catid'], $_POST['catinfo']) == 'done') { echo 'Done'; } else { echo "Sorry an error ocurred"; } } else { $catinfo = $c->getInfo($_GET['catid']); echo '<form method="POST" name="catinfoform"><table width="40%"><tr><td>Name</td><td>', $catinfo['name'], '</td></tr><tr><td>Info</td><td><textarea rows="10" cols="50" name="catinfo" >', $catinfo['info'], '</textarea></td></tr></table><input type="submit" value="Change" name="editcat"/></form>'; } } else { echo 'Select a Catgory<br>'; foreach ($c->getList() as $cat) { echo '<a href="admin.php?do=editcat&catid=', $cat['catid'], '">', $cat['name'], '</a><br>'; } } break; case 'addhead': // case addhead $h = new Head(); if (isset($_POST['addhead'])) { if ($_POST['password1'] == $_POST['password2'] and $_POST['password1'] != '') { if ($_POST['username'] and $_POST['name'] and $_POST['level'] and $_POST['phone']) {
<script src='js/jq.js' type='text/javascript'></script> <script src='js/function.js' type='text/javascript' ></script> </head> <body> <?php include "header.php"; include "sidebar.php"; ?> <?php include_once "class.inc.php"; if (isset($_GET['id'])) { echo '<div id="center"><center><table width="60%">'; $c = new Catagory(); $c->setId($_GET['id']); $cinfo = $c->getInfo($_GET['id']); $events = $c->getEvents(); $e = new Event(); echo '<tr><td>Catagory </td><td><b>', $c->escape(ucwords($cinfo['name'])), '</b></td></tr><tr><td>Info</td><td>', $c->escape($cinfo['info']), '</td></tr><tr><td>Catagory Head(s) </td><td>'; $count = 0; $cheads = $c->getHeads(); foreach ($cheads as $chead) { if ($count) { echo ", "; } echo "<a href='head.php?id={$chead['userid']}'>", $c->escape($chead['name']), "</a>"; $count++; } echo '</td></tr><tr><td><br><br></td></tr'; foreach ($events as $event) { $e->setId($event['eventid']);