<?php session_start(); include "class.transaction.dao.php"; include_once "header.php"; $dao = new DAOtransaction(); ?> <center><b><u><font face ="Britannic Bold"><h1>Transaction</h1></font></u></b></center><br> <a href="form.transaction.php" class="btn btn-info">Add transaction</a><br> <table class="table table-striped"> <tr class ="info"> <td>#</td> <td>Title</td> <td>Date</td> <td>Type</td> <td>Info</td> <td>Amount</td> <td>Sender</td> <td>Receiver</td> <td>Description</td> <td>Is Paid</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;
<?php include "db.php"; include "class.transaction.dao.php"; $dao = new DAOtransaction(); if (isset($_GET["id"])) { $vo = $dao->get($_GET["id"]); $dao->del($vo); } header("Location: transaction.php");
} return true; } </script> <?php include "header.php"; include "class.transaction.dao.php"; ?> <center> <h3>Add Transaction</h3> <form name = "frmTransaction" method="POST" action="save.transaction.php" onsubmit = "return validateTransaction();"> <table cellspacing="5" cellpadding="5"> <?php if (isset($_GET["id"])) { $dao = new DAOtransaction(); $vo = $dao->get($_GET["id"]); ?> <tr> <td> Transaction Title </td> <td><input type = "text" name = "title" value= "<?php echo $vo->title; ?> "/></td> </tr> <tr> <td> Date </td> <td><input type = "text" name = "date" value= "<?php echo $vo->date; ?> "/></td>
<?php session_start(); include "db.php"; include "class.transaction.dao.php"; $dao = new DAOtransaction(); $vo = new transaction($_SESSION["uid"], $_POST["title"], $_POST["date"], $_POST["type"], $_POST["info"], $_POST["amount"], $_POST["sender"], $_POST["receiver"], $_POST["description"], $_POST["is_paid"]); if (isset($_POST["tid"])) { $vo->tid = $_POST["tid"]; } $dao->save($vo); header("Location: transaction.php");