I want to Generate a certain report
like only the accounts who's name is "zyra" or only the accounts that are made in a certain branch like only in "first branch" or in "Second Branch" etc.
or generate/print only the one who availed the service "Braces" or " cleaning of Teeth" and more to be specific..
my code as of now is like this
<?php
echo "<div name=\"repsel\">";
echo "<a href=\"genrep.php?action=userinfo\">User Information</a><br/>";
echo "<a href=\"genrep.php?action=usertreatment\">Users Accounts</a><br/>";
echo "<a href=\"genrep.php?action=appointments\">Appointments Made</a>";
echo "</div>";
//User Appointments load
if(isset($_GET["action"]) && $_GET["action"] == "appointments"){
$_POST['SUBMITTED']=true;
echo "<form method=\"post\" action=\"genrep.php?action=appointments\">";
echo "<input type='text' name='search'/>";
echo "Search by:<select name='typie'>";
echo "<option value='firstname'>name</option>";
echo "<option value='branch'>branch</option>";
echo "<option value='availed_service'>service</option>";
echo "<option value='address'>address</option>";
echo "<option value='dentistname'>dentist name</option>";
echo "</select>";
echo "<input type=\"submit\" name=\"SUBMITTED\" value=\"submit\">";
echo "</form>";
if(isset($_POST['SUBMITTED'])){
echo $type = $_POST['typie'];
echo "<br/>";
echo $what = $_POST['search'];
$zxc="SELECT * FROM appointments WHERE '$type' = '$what'";
$query=mysql_query($zxc) or die(mysql_error());
$_SESSION['print']=$zxc;
$_SESSION['ano']="Appointments";
echo "<p><a href=\"print.php\"><input type='submit' value='Print'/></a></p>";
echo "<table border=\"1\" >";
echo "<tr><td>First Name</td><td>Last Name</td><td>Address</td><td>Dentist Name</td><td>Availed Services</td><td>Payment</td><td>Date</td><td>Time</td><td>Remarks</td></tr>";
while($arr=mysql_fetch_array($query)){
echo "<tr><td>".$arr['firstname']."</td><td>".$arr['lastname']."</td><td>".$arr['address']."</td><td>".$arr['dentistname']."</td><td>".$arr['availed_service']."</td><td>".$arr['payment']."</td><td
>".$arr['date']."</td><td>".$arr['time']."</td><td>".$arr['remarks']."</td></tr>";
}
echo "</table>";
}
}
?>
but the problem is it wont show any output after submitting a query or a input
any help would be appreciated well.
i hope i explained it well..
This post has been edited by Syfer: 15 December 2011 - 03:10 AM

New Topic/Question
Reply




MultiQuote



|