Skip to content

Instantly share code, notes, and snippets.

@sbuzonas
Created June 3, 2012 04:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbuzonas/2861936 to your computer and use it in GitHub Desktop.
Save sbuzonas/2861936 to your computer and use it in GitHub Desktop.
##php: mikeiee
<?php
$letter_url = "http://www.example.com/letter.php?";
?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Pending and Completed Application </title>
</head>
<body>
<?php
$conn = mysql_connect("localhost", "twastudent", "prac3");
mysql_select_db("MPS", $conn)
or die ('Database not found ' . mysql_error() );
$sql = "SELECT application.applicationnum, application.customernum, customer.surname, application.applicationstatus, application.permittype, application.applicationdate
FROM application, customer
WHERE (application.ID = customer.ID)
ORDER BY applicationdate ASC";
$rs = mysql_query($sql, $conn)
or die ('Problem with query' . mysql_error());
?>
<p> These are the completed Application </p>
<table border='1' summary='Completed Application'>
<tr>
<th>Application Number </th>
<th>Customer Number </th>
<th>Customer Surname </th>
<th>Permit Type </th>
<th>Application Status</th>
<th>Application Date</th>
</tr>
<?php
while ($row = mysql_fetch_array($rs)) { ?>
<tr>
<td><a href="<?php echo $letter_url . "applicationnum=" . $row['applicationnum'] ?>"><?php echo $row['applicationnum']?></a></td>
<td><?php echo $row['customernum']?></td>
<td><?php echo $row['surname']?></td>
<td><?php echo $row['permittype']?></td>
<td><?php echo $row['applicationstatus']?></td>
<td><?php echo $row['applicationdate']?></td>
</tr>
<?php } ?>
</table>
<p> These are the Pending Application </p>
<table border='1' summary='Completed Application'>
<tr>
<th>Application Number </th>
<th>Customer Number </th>
<th>Application Date </th>
<th>Application Status</th>
</tr>
<?php
$conn = mysql_connect("localhost", "twastudent", "prac3");
mysql_select_db("MPS", $conn)
or die ('Database not found ' . mysql_error() );
$sql = "SELECT applicationnum, customernum , applicationdate
FROM application
ORDER BY applicationdate ASC";
$rs = mysql_query($sql, $conn)
or die ('Problem with query' . mysql_error());
?>
<?php
while ($row = mysql_fetch_array($rs)) { ?>
<tr>
<td><?php echo $row['applicationnum']?></td>
<td><?php echo $row['customernum']?></td>
<td><?php echo $row['applicationdate']?></td>
<td><?php echo $row['applicationstatus']?></td>
</tr>
<?php } mysql_close($conn);?>
</table>
</body>
</html>
<?php
$letter_url = "http://www.example.com/letter.php?";
?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Pending and Completed Application </title>
</head>
<body>
<?php
$conn = mysql_connect("localhost", "twastudent", "prac3");
mysql_select_db("MPS", $conn)
or die ('Database not found ' . mysql_error() );
$sql = "SELECT application.applicationnum, application.customernum, customer.surname, application.applicationstatus, application.permittype, application.applicationdate
FROM application, customer
WHERE (application.ID = customer.ID)
ORDER BY applicationdate ASC";
$rs1 = mysql_query($sql, $conn)
or die ('Problem with query' . mysql_error());
?>
<?php
$conn = mysql_connect("localhost", "twastudent", "prac3");
mysql_select_db("MPS", $conn)
or die ('Database not found ' . mysql_error() );
$sql = "SELECT applicationnum, customernum , applicationdate
FROM application
ORDER BY applicationdate ASC";
$rs2 = mysql_query($sql, $conn)
or die ('Problem with query' . mysql_error());
?>
<p> These are the completed Application </p>
<table border='1' summary='Completed Application'>
<tr>
<th>Application Number </th>
<th>Customer Number </th>
<th>Customer Surname </th>
<th>Permit Type </th>
<th>Application Status</th>
<th>Application Date</th>
</tr>
<?php
while ($row = mysql_fetch_array($rs1)) { ?>
<tr>
<td><a href="<?php echo $letter_url . "applicationnum=" . $row['applicationnum'] ?>"><?php echo $row['applicationnum']?></a></td>
<td><?php echo $row['customernum']?></td>
<td><?php echo $row['surname']?></td>
<td><?php echo $row['permittype']?></td>
<td><?php echo $row['applicationstatus']?></td>
<td><?php echo $row['applicationdate']?></td>
</tr>
<?php } ?>
</table>
<p> These are the Pending Application </p>
<table border='1' summary='Completed Application'>
<tr>
<th>Application Number </th>
<th>Customer Number </th>
<th>Application Date </th>
<th>Application Status</th>
</tr>
<?php
while ($row = mysql_fetch_array($rs2)) { ?>
<tr>
<td><?php echo $row['applicationnum']?></td>
<td><?php echo $row['customernum']?></td>
<td><?php echo $row['applicationdate']?></td>
<td><?php echo $row['applicationstatus']?></td>
</tr>
<?php } mysql_close($conn);?>
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment