-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathninvoices.php
executable file
·162 lines (153 loc) · 7.46 KB
/
ninvoices.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?php
session_start();
include('assets/configs/config.php');
include('assets/configs/checklogin.php');
check_login();
$aid=$_SESSION['admin_id'];
if(isset($_POST['add_invoice']))//get specific input from a certain button.
{
//declare and initialize some variables
$account=$_POST['account'];
$amount=$_POST['amount'];
$invoice_date=$_POST['invoice_date'];
$due_date=$_POST['due_date'];
$type=$_POST['type'];
$status=$_POST['status'];
//sql to inset the values to the database
$query="insert into invoice (account, amount, invoice_date, due_date, type, status) values(?,?,?,?,?,?)";
$stmt = $mysqli->prepare($query);
//bind the submitted values with the matching columns in the database.
$rc=$stmt->bind_param('ssssss', $account, $amount, $invoice_date, $due_date, $type, $status);
$stmt->execute();
//if binding is successful, then indicate that a new value has been added.
$success_msg= "Invoice Details Added";
}
?>
<!DOCTYPE html>
<html lang="en">
<?php include('assets/_partials/head.php');?>
<body class="hold-transition sidebar-mini">
<!--preloader-->
<div id="preloader">
<div id="status"></div>
</div>
<!-- Site wrapper -->
<div class="wrapper">
<?php include('assets/_partials/header.php');?>
<!-- =============================================== -->
<!-- Left side column. contains the sidebar -->
<aside class="main-sidebar">
<!-- sidebar -->
<?php include('assets/_partials/navbar.php');?>
<!-- /.sidebar -->
</aside>
<!-- =============================================== -->
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="header-icon">
<i class="fa fa-sticky-note-o"></i>
</div>
<div class="header-title">
<h1>Add Invoices</h1>
</div>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<!-- Form controls -->
<div class="col-sm-12">
<div class="panel panel-bd lobidrag">
<div class="panel-heading">
<div class="btn-group" id="buttonlist">
<i class="fa fa-sticky-note-o"></i> Invoices</a>
</div>
</div>
<!--Trigger a success message after the account has been created-->
<?php if(isset($success_msg))
{?>
<script>
setTimeout(function ()
{
swal("Success!","<?php echo $success_msg;?>!","success");
},
100);
</script>
<?php }?>
<div class="panel-body">
<form class="col-sm-12" method ="POST">
<div class="form-group">
<label>Bank Account </label>
<input type="text" name="account" class="form-control" required>
</div>
<div class="form-group">
<label>Amount Paid</label>
<input type="text" name="amount" required class="form-control" required>
</div>
<div class="form-group">
<label>Invoice Date</label>
<input type="date" name="invoice_date" class="form-control" required>
</div>
<div class="form-group">
<label>Due Date</label>
<input type="date" name="due_date" class="form-control" required>
</div>
<div class="form-group">
<label>Type</label>
<select name="type" class="form-control">
<option>Onetime</option>
</select>
</div>
<div class="form-group">
<label>Status</label>
<select name="status" class="form-control">
<option>Active</option>
<option>Inactive</option>
</select>
</div>
<div class="reset-button">
<a href="#" class="btn btn-warning">Reset</a>
<input type="submit" name="add_invoice" value="Submit" class="btn btn-add">
</div>
</form>
</div>
</div>
</div>
</div>
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php include('assets/_partials/footer.php');?>
</div>
<!-- ./wrapper -->
<!-- Start Core Plugins
=====================================================================-->
<!-- jQuery -->
<script src="assets/plugins/jQuery/jquery-1.12.4.min.js" type="text/javascript"></script>
<!-- jquery-ui -->
<script src="assets/plugins/jquery-ui-1.12.1/jquery-ui.min.js" type="text/javascript"></script>
<!-- Bootstrap -->
<script src="assets/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<!-- lobipanel -->
<script src="assets/plugins/lobipanel/lobipanel.min.js" type="text/javascript"></script>
<!-- Pace js -->
<script src="assets/plugins/pace/pace.min.js" type="text/javascript"></script>
<!-- SlimScroll -->
<script src="assets/plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<!-- FastClick -->
<script src="assets/plugins/fastclick/fastclick.min.js" type="text/javascript"></script>
<!-- CRMadmin frame -->
<script src="assets/dist/js/custom.js" type="text/javascript"></script>
<!-- End Core Plugins
=====================================================================-->
<!-- Start Theme label Script
=====================================================================-->
<!-- Dashboard js -->
<script src="assets/dist/js/dashboard.js" type="text/javascript"></script>
<!-- End Theme label Script
=====================================================================-->
</body>
<!-- Mirrored from thememinister.com/crm/ninvoices.html by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 04 Jul 2019 11:39:46 GMT -->
</html>