<?php include 'model.php'; include 'functions.php'; $result = bill($_POST['creditcardtype'], $_POST['creditcardnumber'], $_POST['firstname'], $_POST['lastname'], $_POST['country'], $_POST['address'], $_POST['amount']);
display_item($_GET['search']); } else { if (isset($_POST['block'])) { block_items(); } else { display_item(); } } } } } else { if ($page == "getdetails") { require_once "./include/getdetails.inc"; } else { if (isset($_POST['Bill'])) { bill(); } else { if (isset($_GET['view'])) { if ($_GET['view'] != NULL) { display_bill($_GET['view']); } else { global $tpl; $tpl->title = "Bill Details"; $tpl->content = $tpl->fetch("./template/billno.php.tpl"); $tpl->display("./template/index.php.tpl"); } } else { generate_bill(); } } }
// POST-ing data without using the form $errors = ""; if (!isset($_POST['desc']) || empty($_POST['desc'])) { $errors .= "Error: Description required<br />"; } if (!isset($_POST['amount']) || !is_numeric($_POST['amount'])) { $errors .= "Error: amount is required<br />"; } if (!isset($_POST['dept'])) { $errors .= "Error: department is required<br />"; } if (!isset($_POST['tender'])) { $errors .= "Error: tender is required<br />"; } if (empty($errors)) { bill($_POST['amount'], $_POST['desc'], $_POST['dept'], $_POST['tender']); } else { echo "<blockquote><i>" . $errors . "</i></blockquote>"; regularDisplay(); } } else { regularDisplay(); } function regularDisplay() { global $FANNIE_OP_DB, $DEFAULT_DEPT; $dbc = FannieDB::get($FANNIE_OP_DB); echo "<form action=index.php method=post>\n <table><tr><td>\n <b>Description</b></td><td>\n <input maxlength=30 type=text id=desc name=desc />\n </td></tr><tr><td><b>Amount</b></td><td>\n \$<input type=text name=amount /></td></tr>\n <tr><td><b>Department</b></td>\n <td><select name=dept>"; $numsQ = $dbc->prepare_statement("SELECT dept_no,dept_name FROM departments \n ORDER BY dept_no"); $numsR = $dbc->exec_statement($numsQ); while ($numsW = $dbc->fetch_row($numsR)) {
$bill = explode(',', $bill); $pub = $bill[1]; $priv = $bill[2]; if ($bill[3]) { $amount = trim($bill[3]); } if (!$amount) { $amount = $_REQUEST['amount']; } if (!$pub) { continue; } if (!$priv) { continue; } bill(array('pub' => $pub, 'priv' => $priv, 'printer' => $printer, 'amount' => $_REQUEST['amount'], 'reverse' => $reverse, 'funded_by', $funded_by)); } $pdf->Output(); function squares() { $width = 0.6; global $s, $pdf; $pdf->AddPage(); $pdf->SetDrawColor(0, 0, 0); for ($i = 0; $i < $s->page_width / $width; $i++) { $j = 1; for ($j = 0; $j < $s->page_height / $width; $j++) { $x = $i * $width; $y = $j * $width; $pdf->Rect($x, $y, $width, $width, 'D'); }