| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/(Del)pathways.org.hk/MIS20140127/old20140407/Receipt/ |
Upload File : |
<!DOCTYPE html>
<html>
<head>
<?php require_once '../include/head.php'; ?>
<?php require_once '../include/checkuser.php'; ?>
<?php require_once '../include/Nav_bar.php'; ?>
<?php include_once '../include/DBConnect.php'; ?>
<?php require_once '../include/Classes/PHPExcel.php' ?>
<?php require_once '../include/Classes/PHPExcel/IOFactory.php' ?>
<?php require_once '../include/Classes/PHPExcel/Writer/Excel2007.php' ?>
<script>
$(function() {
$('.date-picker').datetimepicker({pickTime: false});
});
</script>
</head>
<style>
.table{
background:#eeefde;
}
</style>
<body>
<?php
$today = date('Y-m-d');
$paydate = date('Y-m-d');
if (isset($_POST['go'])) {
$name = $_POST['name'];
$money = $_POST['money'];
$payof = $_POST['payof'];
$payway = $_POST['payway'];
$paywaytxt = $_POST['paywaytxt'];
$campus = $_POST['campus'];
$type = $_POST['type'];
$paydate = $_POST['paydate'];
$dontinsert = false;
$loadname;
$receiptNo = '0001';
if ($campus == 1) {
$loadname = "Pathway_receipt_New_02.xlsx";
} else if ($campus == 2) {
$loadname = "Pathway_receipt_New.xlsx";
} else {
$$dontinsert = true;
echo "<script>alert('plz select a campus!!!')</script>";
}
if ($dontinsert == false) {
$sth = $dbh->prepare("INSERT INTO `receive`(`receive_code`, `createby`, `createdate`, `lastupby`, `lastupdate`, `actived`, `deleted`, `receive_date`, `invoice_id`, `receive_from`, `payment_of`, `total_amount`, `is_cash`, `pay_txt`, `is_normal`, `campus_id`) VALUES (?,1,now(),1,now(),1,0,?,0,?,?,?,?,?,?,?)");
$sth->bindParam(1, $receiptNo);
$sth->bindParam(2, $paydate);
$sth->bindParam(3, $name);
$sth->bindParam(4, $payof);
$sth->bindParam(5, $money);
$sth->bindParam(6, $payway);
$sth->bindParam(7, $paywaytxt);
$sth->bindParam(8, $type);
$sth->bindParam(9, $campus);
$sth->execute();
echo "<script>alert('Insert data successful.')</script>";
echo("<script>location.href ='receipt_index.php';</script>");
}
}
?>
<!-- line between nav bar and content -->
<div class="text-right">
<ul class="breadcrumb">
<li class="active">Receipt</li>
</ul>
</div>
<!-- line between nav bar and content -->
<div class="container-fluid pathways-container">
<form id="search_form" class="form-inline" action="" method="POST">
<table border="0" class="table table-bordered table-hover table-condensed">
<tr>
<td><h3>Add Receipt</h3></td>
</tr>
<tr>
<td width="20%"><label>Type</label></td>
<td><label>Normal</label><input type="radio" name="type" value="0" checked=""> <label>Community Chest</label><input type="radio" name="type" value="1"></td>
</tr>
<tr>
<td width="20%"><label>Date</label></td>
<td><div class="input-append date-picker">
<input id="start_date" class="dateISO" type="text" maxlength="200" data-format="yyyy-MM-dd" name="paydate" value="<?= $today ?>" style="width:90px" required>
<span class="add-on">
<i class="icon-calendar" data-date-icon="icon-calendar" data-time-icon="icon-time"></i>
</span>
</div></td>
</tr>
<tr>
<td width="20%"><label>Received from:</label></td>
<td><input type="text" name="name"></td>
</tr>
<tr>
<td width="20%"><label >The sum of Hong Kong Dollars:</label></td>
<td><input type="text" name="money" value="" readonly=""></td>
</tr>
<tr>
<td width="20%"><label>Payment of:</label></td>
<td><input type="text" name="payof"></td>
</tr>
<tr>
<td width="20%"><label>By cash</label><input type="radio" name="payway" value="0" checked=""> <label>By cheque</label><input type="radio" name="payway" value="1"></td>
<td><input type="text" name="paywaytxt"></td>
</tr>
<tr>
<td width="20%">Campus:</td>
<td><select name="campus" required="true">
<option></option>
<?php
$query = "Select campus_id,campus_name from campus";
$result = $dbh->query($query);
$result->setFetchMode(PDO::FETCH_OBJ);
while ($row = $result->fetch()) {
print '<option value=' . $row->campus_id . '>' . $row->campus_name . '</option>';
}
?>
</select>
</td>
</tr>
</table>
<div class="pathways-inline-block">
<button class="btn" name="go" value="go" style="margin-left:30px" type="submit">save</button>
</div>
</form>
</div> <!-- /container -->
</body>
</html>