Example #1
0
<th>Website</th>
<th>Night</th>
<th>Schools</th>
</tr>
<?php 
$pemail = strlen($username) != 0;
$ret = mysql_query("select code from club order by name");
if ($ret && mysql_num_rows($ret)) {
    while ($row = mysql_fetch_assoc($ret)) {
        $p = new Club($row["code"]);
        $p->fetchdets();
        $sch = $p->Schools ? 'Yes' : '-';
        print <<<EOT
<tr>
<td>{$p->display_code()}</td>
<td>{$p->display_name()}</td>
<td>{$p->display_contact()}</td>
<td>{$p->display_contphone()}</td>
<td>{$p->display_contemail($pemail)}</td>
<td>{$p->display_website()}</td>
<td>{$p->display_night()}</td>
<td>{$sch}</td>
</tr>
EOT;
    }
}
?>
</table>
</div>
</div>
</body>
Example #2
0
        if ($newcode != $club->Code) {
            checkclash($newcode);
            $qcode = mysql_real_escape_string($newcode);
            mysql_query("update club set code='{$qcode}' where {$club->queryof()}");
            $club->Code = $newcode;
        }
        $club->Name = $newname;
        $club->Contactfirst = $contfirst;
        $club->Contactlast = $contlast;
        $club->Contactemail = $contemail;
        $club->Contactphone = $contphone;
        $club->Website = $website;
        $club->Night = $night;
        $club->Schools = $sch;
        $club->update();
        $Title = "Club {$club->display_name()} updated OK";
        break;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<?php 
$Title = "Update individual club";
include 'php/head.php';
?>
<body>
<script language="javascript" src="webfn.js"></script>
<?php 
$showadmmenu = true;
include 'php/nav.php';
print <<<EOT
Example #3
0
include 'php/opendatabase.php';
include 'php/club.php';
try {
    $club = new Club();
    $club->fromget();
    $club->fetchdets();
} catch (ClubException $e) {
    $mess = $e->getMessage();
    include 'php/wrongentry.php';
    exit(0);
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<?php 
$Title = "Update Club {$club->display_name()}";
include 'php/head.php';
?>
<body>
<script language="javascript" src="webfn.js"></script>
<script language="javascript">
function formvalid()
{
      var form = document.clubform;
      if  (!nonblank(form.clubcode.value))  {
         alert("No club code given");
         return false;
      }
      if  (!nonblank(form.clubname.value))  {
      	alert("No club name given");
      	return false;
Example #4
0
?>
<h1>Update Clubs</h1>
<p>Please select the club to be updated from the following list.</p>
<p>To add a club click on one at random and just change the entries on the form or
select the "new club" menu option</p>
<table class="clubupd">
<tr>
<th>Abbrev</th>
<th>Name</th>
</tr>
<?php 
$ret = mysql_query("select code from club order by name");
if ($ret && mysql_num_rows($ret)) {
    while ($row = mysql_fetch_assoc($ret)) {
        $p = new Club($row["code"]);
        $p->fetchdets();
        print <<<EOT
<tr>
<td><a href="updindclub.php?{$p->urlof()}" title="Update club details">{$p->display_code()}</a></td>
<td><a href="updindclub.php?{$p->urlof()}" title="Update club details">{$p->display_name()}</a></td>
</tr>
EOT;
    }
}
?>
</table>
</div>
</div>
</body>
</html>
Example #5
0
if (!$ret) {
    $mess = "Cannot delete club";
    include 'php/dataerror.php';
    exit(0);
}
$nrows = mysql_affected_rows();
if ($nrows == 0) {
    $mess = "No clubs deleted";
    include 'php/dataerror.php';
    exit(0);
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<?php 
$Title = "Deletion of {$club->display_name()} complete";
include 'php/head.php';
print <<<EOT
<body>

EOT;
$showadmmenu = true;
include 'php/nav.php';
print <<<EOT
<h1>Deletion of {$club->display_name()} complete</h1>
<p>
Deletion of club {$club->display_name()} was successful.</p>
EOT;
?>
<p>Click <a href="clubupd.php" title="Resume club update">here</a> to return to the club update menu.</p>
</div>