Ejemplo n.º 1
0
</script>
<?php 
include "header.php";
include "class.expense.dao.php";
$expense_type = $_GET["type"];
?>
<center>
	<h3>Add <?php 
echo $expense_type;
?>
</h3>
<form name = "frmExpense" method="POST" action="save.expense.php"  onsubmit = "return validateExpense();">
	<table cellspacing="5" cellpadding="5">
		<?php 
if (isset($_GET["id"])) {
    $dao = new DAOexpense();
    $vo = $dao->get($_GET["id"]);
    ?>
			<tr>
				<td> Expenditure Date </td>
				<td><input type = "text" name = "expense_date" value= "<?php 
    echo $vo->expense_date;
    ?>
 "/></td>
			</tr>
			<tr>
				<td> Category </td>
				<td><input type = "text" name = "category" value= "<?php 
    echo $vo->category;
    ?>
 "/></td>
Ejemplo n.º 2
0
<?php

session_start();
include "db.php";
include "class.expense.dao.php";
$dao = new DAOexpense();
$vo = new expense($_SESSION["uid"], $_POST["expense_type"], $_POST["expense_date"], $_POST["category"], $_POST["truck_id"], $_POST["description"], $_POST["amount"]);
if (isset($_POST["expense_id"])) {
    $vo->expense_id = $_POST["expense_id"];
}
$dao->save($vo);
if ($_POST["expense_type"] = Expense) {
    header("Location: expense.php?type=Expense");
} else {
    header("Location: maintenance.php?type=Maintenance");
}
Ejemplo n.º 3
0
<?php

session_start();
include "class.expense.dao.php";
include_once "header.php";
$dao = new DAOexpense();
$expense_type = $_GET["type"];
?>
<center><b><u><font face ="Britannic Bold"><h1>Expense</h1></font></u></b></center><br>
<a href="form.expense.php?type=<?php 
echo $expense_type;
?>
" class="btn btn-info">Add Expense</a><br>
<table class="table table-striped">
	<tr class ="info">
		<td>#</td>
		<td>Expenditure Date</td>
		<td>Category</td>
		<td>Truck</td>
		<td>Description</td>
		<td>Amount</td>
		<td><b>Edit</b></td>
		<td><b>Delete</b></td>
	</tr>

<?php 
$rec_per_page = 10;
if (isset($_GET['page'])) {
    $page = $_GET['page'];
} else {
    $page = 1;
Ejemplo n.º 4
0
<?php

include "db.php";
include "class.expense.dao.php";
$dao = new DAOexpense();
if (isset($_GET["id"])) {
    $vo = $dao->get($_GET["id"]);
    $dao->del($vo);
}
header("Location: expense.php");