001.
<html>
002.
<head>
005.
<head>
006.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
007.
<meta charset=
"utf-8"
>
008.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
009.
<title>
010.
Customer
011.
</title>
012.
013.
<?php
014.
require_once
(
'auth.php'
);
015.
?>
016.
<link href=
"css/bootstrap.css"
rel=
"stylesheet"
>
017.
018.
<link rel=
"stylesheet"
type=
"text/css"
href=
"css/DT_bootstrap.css"
>
019.
020.
<link rel=
"stylesheet"
href=
"css/font-awesome.min.css"
>
021.
<style type=
"text/css"
>
022.
body {
023.
padding-top: 60px;
024.
padding-bottom: 40px;
025.
}
026.
.sidebar-nav {
027.
padding: 9px 0;
028.
}
029.
</style>
030.
<link href=
"css/bootstrap-responsive.css"
rel=
"stylesheet"
>
031.
032.
033.
<link href=
"../style.css"
media=
"screen"
rel=
"stylesheet"
type=
"text/css"
/>
034.
<!--sa poip up-->
035.
<script src=
"jeffartagame.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
036.
<script src=
"js/application.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
037.
<link href=
"src/facebox.css"
media=
"screen"
rel=
"stylesheet"
type=
"text/css"
/>
038.
<script src=
"lib/jquery.js"
type=
"text/javascript"
></script>
039.
<script src=
"src/facebox.js"
type=
"text/javascript"
></script>
040.
<script type=
"text/javascript"
>
041.
jQuery(document).ready(
function
($) {
042.
$(
'a[rel*=facebox]'
).facebox({
043.
loadingImage :
'src/loading.gif'
,
044.
closeImage :
'src/closelabel.png'
045.
})
046.
})
047.
</script>
048.
049.
050.
051.
<script language=
"javascript"
type=
"text/javascript"
>
052.
053.
054.
<!-- Begin
055.
var
timerID = null;
056.
var
timerRunning = false;
057.
function
stopclock (){
058.
if
(timerRunning)
059.
clearTimeout(timerID);
060.
timerRunning = false;
061.
}
062.
function
showtime () {
063.
var
now =
new
Date
();
064.
var
hours = now.getHours();
065.
var
minutes = now.getMinutes();
066.
var
seconds = now.getSeconds()
067.
var
timeValue =
""
+ ((hours >12) ? hours -12 :hours)
068.
if
(timeValue ==
"0"
) timeValue = 12;
069.
timeValue += ((minutes < 10) ?
":0"
:
":"
) + minutes
070.
timeValue += ((seconds < 10) ?
":0"
:
":"
) + seconds
071.
timeValue += (hours >= 12) ?
" P.M."
:
" A.M."
072.
document.clock.face.value = timeValue;
073.
timerID = setTimeout(
"showtime()"
,1000);
074.
timerRunning = true;
075.
}
076.
function
startclock() {
077.
stopclock();
078.
showtime();
079.
}
080.
window.onload=startclock;
081.
082.
</SCRIPT>
083.
084.
085.
</head>
086.
<?php
087.
function
createRandomPassword() {
088.
$chars
=
"003232303232023232023456789"
;
089.
srand((double)microtime()*1000000);
090.
$i
= 0;
091.
$pass
=
''
;
092.
while
(
$i
<= 7) {
093.
094.
$num
= rand() % 33;
095.
096.
$tmp
=
substr
(
$chars
,
$num
, 1);
097.
098.
$pass
=
$pass
.
$tmp
;
099.
100.
$i
++;
101.
102.
}
103.
return
$pass
;
104.
}
105.
$finalcode
=
'RS-'
.createRandomPassword();
106.
?>
107.
<body>
108.
<?php
include
(
'navfixed.php'
);?>
109.
<div
class
=
"container-fluid"
>
110.
<div
class
=
"row-fluid"
>
111.
<div
class
=
"span2"
>
112.
<div
class
=
"well sidebar-nav"
>
113.
<ul
class
=
"nav nav-list"
>
114.
<li><a href=
"index.php"
><i
class
=
"icon-dashboard icon-2x"
></i> Dashboard </a></li>
115.
<li><a href=
"sales.php?id=cash&invoice=<?php echo $finalcode ?>"
><i
class
=
"icon-shopping-cart icon-2x"
></i> Sales </a> </li>
116.
<li><a href=
"products.php"
><i
class
=
"icon-list-alt icon-2x"
></i> Products</a> </li>
117.
<li
class
=
"active"
><a href=
"customer.php"
><i
class
=
"icon-group icon-2x"
></i> Customers </a> </li>
118.
<li><a href=
"supplier.php"
><i
class
=
"icon-group icon-2x"
></i> Suppliers</a> </li>
119.
<li><a href=
"salesreport.php?d1=0&d2=0"
><i
class
=
"icon-bar-chart icon-2x"
></i> Sales Report</a> </li>
120.
<br><br><br><br><br><br>
121.
<li>
122.
<div
class
=
"hero-unit-clock"
>
123.
124.
<form name=
"clock"
>
125.
<font color=
"white"
>Time: <br></font> <input style=
"width:150px;"
type=
"submit"
class
=
"trans"
name=
"face"
value=
""
>
126.
</form>
127.
</div>
128.
</li>
129.
130.
131.
</ul>
132.
</div><!--/.well -->
133.
</div><!--/span-->
134.
<div
class
=
"span10"
>
135.
<div
class
=
"contentheader"
>
136.
<i
class
=
"icon-group"
></i> Customers
137.
</div>
138.
<ul
class
=
"breadcrumb"
>
139.
<li><a href=
"index.php"
>Dashboard</a></li> /
140.
<li
class
=
"active"
>Customers</li>
141.
</ul>
142.
143.
<div style=
"margin-top: -19px; margin-bottom: 21px;"
>
144.
<a href=
"index.php"
><button
class
=
"btn btn-default btn-large"
style=
"float: left;"
><i
class
=
"icon icon-circle-arrow-left icon-large"
></i> Back</button></a>
145.
<?php
146.
include
(
'../connect.php'
);
147.
148.
$result
=
$db
->prepare(
"SELECT * FROM customer ORDER BY customer_id DESC"
);
149.
$result
->execute();
150.
$rowcount
=
$result
->rowcount();
151.
?>
152.
<div style=
"text-align:center;"
>
153.
Total Number of Customers: <font color=
"green"
style=
"font:bold 22px 'Aleo';"
><?php
echo
$rowcount
;?></font>
154.
</div>
155.
</div>
156.
<input type=
"text"
name=
"filter"
style=
"padding:15px;"
id=
"filter"
placeholder=
"Search Customer..."
autocomplete=
"off"
/>
157.
<a rel=
"facebox"
href=
"addcustomer.php"
><Button type=
"submit"
class
=
"btn btn-info"
style=
"float:right; width:230px; height:35px;"
/><i
class
=
"icon-plus-sign icon-large"
></i> Add Customer</button></a><br><br>
158.
159.
<table
class
=
"table table-bordered"
id=
"resultTable"
data-responsive=
"table"
style=
"text-align: left;"
>
160.
<thead>
161.
<tr>
162.
<th width=
"17%"
> Customer ID </th>
163.
<th width=
"23%"
> Customer Name</th>
164.
<th width=
"10%"
> Address </th>
165.
<th width=
"10%"
> Contact Number</th>
166.
167.
<th width=
"17%"
> Note </th>
168.
169.
<th width=
"14%"
> Action </th>
170.
</tr>
171.
</thead>
172.
<tbody>
173.
174.
<?php
175.
include
(
'../connect.php'
);
176.
$result
=
$db
->prepare(
"SELECT * FROM customer ORDER BY customer_id DESC"
);
177.
$result
->execute();
178.
179.
for
(
$i
=0;
$row
=
$result
->fetch();
$i
++){
180.
?>
181.
<tr
class
=
"record"
>
182.
<td><?php
echo
$row
[
'customer_name'
]; ?></td>
183.
<td><?php
echo
$row
[
'prod_name'
]; ?></td>
184.
<td><?php
echo
$row
[
'address'
]; ?></td>
185.
<td><?php
echo
$row
[
'contact'
]; ?></td>
186.
187.
188.
<td><?php
echo
$row
[
'note'
]; ?></td>
189.
190.
191.
<td><a title=
"Click To Edit Customer"
rel=
"facebox"
href=
"editcustomer.php?id=<?php echo $row['customer_id']; ?>"
><button
class
=
"btn btn-warning btn-mini"
><i
class
=
"icon-edit"
></i> Edit </button></a>
192.
<a href=
"#"
id=
"<?php echo $row['customer_id']; ?>"
class
=
"delbutton"
title=
"Click To Delete"
><button
class
=
"btn btn-danger btn-mini"
><i
class
=
"icon-trash"
></i>
Delete
</button></a></td>
193.
</tr>
194.
<?php
195.
}
196.
?>
197.
198.
</tbody>
199.
</table>
200.
<div
class
=
"clearfix"
></div>
201.
202.
</div>
203.
</div>
204.
</div>
205.
<script src=
"js/jquery.js"
></script>
206.
<script type=
"text/javascript"
>
207.
$(
function
() {
208.
209.
210.
$(
".delbutton"
).click(
function
(){
211.
212.
213.
var
element = $(this);
214.
215.
216.
var
del_id = element.attr(
"id"
);
217.
218.
219.
var
info =
'id='
+ del_id;
220.
if
(confirm(
"Are you sure want to delete? There is NO undo!"
))
221.
{
222.
223.
$.ajax({
224.
type:
"GET"
,
225.
url:
"deletecustomer.php"
,
226.
data: info,
227.
success:
function
(){
228.
229.
}
230.
});
231.
$(this).parents(
".record"
).animate({ backgroundColor:
"#fbc7c7"
},
"fast"
)
232.
.animate({ opacity:
"hide"
},
"slow"
);
233.
234.
}
235.
236.
return
false;
237.
238.
});
239.
240.
});
241.
</script>
242.
</body>
243.
<?php
include
(
'footer.php'
);?>
244.
245.
</html>