<?php
/* This file is used to display all cards that have been created
It is expected that in production, this feature will be rather
useless because of the number of accounts that will build up
over time. Some sort of method for clearing old accounts will
need to be implemented. For now, AllCards is the first step
in building a reporting system.
This file C. Carl H. Peterson 2004 and released under the GPL.
If you didn't get a copy of the GPL with this, do a search for
GPL and find it your self. Remember, I copyrighted this so if
you are using it you better have a license to use it. GPl
works for me.
*/
if ($buttonID=="DL_BillingPlan") {
if ($_POST['delBp']=='')
{
echo "<p class=\"information\"> You haven't choose any Billing Plan to delete !!</p>";
}
else
{
$q1="DELETE From BillingPlan Where ID='". $_POST['delBp'] ."'";
$insert1 = $oreon->database->database->query($q1) or die("Query database error !");
echo "<p class=\"information\">Successfully deleted Billing plan </p>";
}
}
else {
$q1 = "select Id,NameBp,TimeBp,PriceBp,TypeBp,CurrencyBp From BillingPlan WHERE LocationID='".$_SESSION['locID']."'"; // get all the timed cards
echo "<p class=\"information\">All Billing plan are listed here :</p>";
$result1=$oreon->database->database->query($q1); // <------ FIGURE OUT HOW MANY RESULTS WE ARE PULLING
if (!$result1) {
$_SESSION['error']='Invalid request : ' . "Query database error !";
echo "<script Language=\"JavaScript\"> window.location.href='".$_SERVER['HTTP_REFERER']."';</script>";
return;
}
$numrows=$oreon->database->database->result_num_rows($result1);
if ($numrows == 0)
{
$_SESSION['error']=" No billing plan found, please create one or more !";
echo "<script Language=\"JavaScript\"> window.location.href='".$_SERVER['HTTP_REFERER']."';</script>";
return;
}
echo "<table width=\"650\" border=2>";
echo"<tr>";
echo "<td class=\"bpcell\" width=180>";
echo "<b>Name</b>";
echo "</td>";
echo "<td class=\"bpcell\" width=80>";
echo "<b>Minutes/Mo/Days</b>";
echo "</td>";
echo "<td class=\"bpcell\" width=80>";
echo "<b>Price</b>";
echo "</td>";
echo "<td class=\"bpcell\" width=80>";
echo "<b>Type</b>";
echo "</td>";
echo "</tr>";
printf('<form name="center" id="center" action="phpmyprepaid.php" method="post">');
$count=0;
while ($row = $oreon->database->database->fetch_object($result1)) {
if(!isset($shade)) { $shade = 2;}
$array[] = $row;
$Id= $row->Id;
$Name= $row->NameBp;
$Time=$row->TimeBp;
$Type=$row->TypeBp;
$Price=$row->PriceBp;
$Currency=$row->CurrencyBp;
echo("<tr>");
if($shade == 1) { echo('<td STYLE="background-color: #F2F7FB">'); }
else{ echo('<td STYLE="background-color: #cde5f4">'); }
printf('<input type="radio" name="delBp" value="%s" %s/> %s<br />',
$row->Id,
(isset($_REQUEST['delBp']) and $_REQUEST['delBp'] == $row->TimeBp) ? 'checked="checked" ' : '',
$row->NameBp);
echo("</td>");
if($shade == 1) { echo('<td STYLE="background-color: #F2F7FB">'); }
else{ echo('<td STYLE="background-color: #cde5f4">'); }
if ($Type=="Expiration")
$Value=date_from_attribute($Time,$dateFormat);
if ($Type=="Time")
$Value=time2str($Time);
else if ($Type=="Octets")
$Value=octets2str($Time);
echo("<small>".$Value."</small>");
echo("</td>");
if($shade == 1) { echo('<td STYLE="background-color: #F2F7FB">'); }
else{ echo('<td STYLE="background-color: #cde5f4">'); }
echo("<small>".$Price);
echo(" ".$Currency."</small>");
echo("</td>");
if($shade == 1) { echo('<td STYLE="background-color: #F2F7FB">'); }
else{ echo('<td STYLE="background-color: #cde5f4">'); }
echo($Type);
echo("</td>");
echo("</tr>");
if($shade == 1) { $shade = 2;}else{ $shade = 1; }
}
echo "</table>";
echo('<input type="hidden" name="buttonID" value="DL_BillingPlan">');
echo "<br>";
echo ('<td align="right"><tr>');
echo ("<input type=\"submit\" name=\"submit\" class=\"smallButton\" value=\"Delete billing plan \"/>");
echo ('</td></tr>');
echo '</form>';
echo "<br>";
}
?>