-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAccounts.php
More file actions
executable file
·121 lines (111 loc) · 4.26 KB
/
Accounts.php
File metadata and controls
executable file
·121 lines (111 loc) · 4.26 KB
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
<?php
session_start();
//if ($_SESSION['username'] == null) {
// header('Location: /index.php');
//}
?>
<?php include ($_SERVER['DOCUMENT_ROOT']."/includes/dcf_Populate_Accounts.php") ?>
<html lang="en">
<head>
<title>ACCOUNTS</title>
<!-- header is in the header.php file with all the scripts, css, and other files needed for formating -->
<?php include ($_SERVER['DOCUMENT_ROOT']."/includes/header.php") ?>
<body style="background-color:#FFFFFF">
<!-- horizontal navigation bar at the top of each page is in the navbar.php file -->
<?php include ($_SERVER['DOCUMENT_ROOT']."/includes/navbar.php") ?>
<div class="container">
<div class="row" style="margin-top: 40px">
<div class="row col-xs-2 col-sm-2 col-md-2 col-lg-1"></div>
<div class="row col-xs-10 col-sm-10 col-md-7 col-lg-7">
<h1 style="color: #DD9787; border-bottom: 3px solid #A6C48A;">ACCOUNTS</h1>
</div>
<div class="row col-xs-12 col-sm-12 col-md-3 col-lg-4">
<a href="http://www.mindthegaap.info/Create_Accounts.php"><button type="button" class="btn btn-success" style="margin-top: 2px; margin-bottom: 12px; background-color: #A6C48A; border-bottom: 5px solid #678D58; border-top: 0px; border-left: 0px; border-right: 0px;">CREATE ACCOUNT</button></a>
</div>
</div>
<?php if(!empty($_GET['addsuccess'])){ ?>
<div class="row">
<div class="col col-xs-2 col-lg-1"></div>
<div class="col col-xs-8 col-lg-10">
<?php if($_GET['addsuccess']=='true'){ ?>
<div class="alert alert-success" role="alert">
Account has been successfully created.
</div>
<?php }else{ ?>
<div class="alert alert-danger" role="alert">
There was a problem in account creation.
</div>
<?php } ?>
</div>
<div class="col col-xs-8 col-lg-1"></div>
</div>
<?php } ?>
<form action="Edit_Accounts.php" method="post">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<table id="example" name="example" class="display table-striped" cellspacing="10" width="100%" style="margin-left: auto; margin-right: auto; color: #DD9787">
<thead>
<tr>
<th>NAME</th>
<th>CATEGORY</th>
<th style="color:white;"> </th>
</tr>
</thead>
<!-- uncomment if search bar per column is wanted -->
<tfoot>
<tr>
<th>Name</th>
<th>CATEGORY</th>
<th style="color: white"> </th>
</tr>
</tfoot>
<tbody style="margin-bottom: 10px;">
<?php while($data = $result->fetch_assoc()) { ?>
<tr>
<td><?php echo $data["accountName"]; ?></td>
<td><?php echo $data["category"]; ?></td>
<td><button type="submit" class="btn btn-success" style="background-color: #A6C48A; border-bottom: 5px solid #678D58; border-top: 0px; border-left: 0px; border-right: 0px; padding-bottom: -5px" value = <?php echo $data["systemId"]?>>EDIT</button>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<input type="hidden" name="editButtonSelected" id="edit_ButtonSelected" value="defaultValue"/>
</form>
</div>
<script type="text/javascript">
//SINGLE SEARCH BAR FOR WHOLE DATATABLE
$(document).ready(function() {
$('#example').DataTable( {
"bSort": true
});
} );
//DATATABLE THAT ALLOWS FOR SEARCHING INDIVIDUAL COLUMNS
$(document).ready(function() {
// Setup - add a text input to each footer cell
$('#example tfoot th').each( function () {
var title = $(this).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
} );
// DataTable
var table = $('#example').DataTable();
// Apply the search
table.columns().every( function () {
var that = this;
$( 'input', this.footer() ).on( 'keyup change', function () {
if ( that.search() !== this.value ) {
that
.search( this.value )
.draw();
}
} );
} );
} );
$("button").click(function() {
//alert(this.value);
document.getElementById("edit_ButtonSelected").value = this.value;
});
//document.getElementById("edit_ButtonSelected").value = document.getElem
</script>
</body>
</html>