|
| 1 | +<?php |
| 2 | +session_start(); |
| 3 | +if(!isset($_SESSION['id'])) |
| 4 | +{ |
| 5 | + header("Location: index.php"); |
| 6 | +} |
| 7 | + |
| 8 | +?> |
| 9 | +<!DOCTYPE html> |
| 10 | +<html xmlns="http://www.w3.org/1999/xhtml"> |
| 11 | +<head> |
| 12 | + <meta charset="utf-8" /> |
| 13 | + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| 14 | + <title>Accounts</title> |
| 15 | + <!-- BOOTSTRAP STYLES--> |
| 16 | + <link href="assets/css/bootstrap.css" rel="stylesheet" /> |
| 17 | + <!-- FONTAWESOME STYLES--> |
| 18 | + <link href="assets/css/font-awesome.css" rel="stylesheet" /> |
| 19 | + <!-- CUSTOM STYLES--> |
| 20 | + <link href="assets/css/custom.css" rel="stylesheet" /> |
| 21 | + <!-- GOOGLE FONTS--> |
| 22 | + <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' /> |
| 23 | +</head> |
| 24 | +<body> |
| 25 | + |
| 26 | + <!-- /. NAV BAR --> |
| 27 | + <?php |
| 28 | + include 'navheader.php'; |
| 29 | + ?> |
| 30 | + <!-- /. NAV TOP --> |
| 31 | + <?php |
| 32 | + include 'navtop.php'; |
| 33 | + ?> |
| 34 | + <!-- /. NAV SIDE --> |
| 35 | + <div id="page-wrapper" > |
| 36 | + <div id="page-inner"> |
| 37 | + <div class="row"> |
| 38 | + <div class="col-md-12"> |
| 39 | + <h2>ACCOUNTS </h2> |
| 40 | + </div> |
| 41 | + </div> |
| 42 | + <!-- /. ROW --> |
| 43 | + <hr /> |
| 44 | + <?php |
| 45 | + if(isset($_SESSION['comfrim'])){ |
| 46 | + ?> |
| 47 | + <div class="alert alert-success"> |
| 48 | + <?php echo $_SESSION['comfrim']; ?> |
| 49 | + </div> |
| 50 | + <?php |
| 51 | + |
| 52 | + unset($_SESSION['comfrim']); |
| 53 | + } |
| 54 | + ?> |
| 55 | + <div class="row"> |
| 56 | + <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> |
| 57 | + <div> |
| 58 | + <h3>Create Account</h3> |
| 59 | + <form action="create_account.php" method="post" > |
| 60 | + <label for="account_name">Account Name:</label> |
| 61 | + <input type="text" class="form-control" id="account_name" name="account_name" required> |
| 62 | + <label for="account_type">Account Type:</label> |
| 63 | + <select class="form-control" id="account_type" name="account_type" required> |
| 64 | + <option value="#"></option> |
| 65 | + <option value="asset">Asset</option> |
| 66 | + <option value="expense">Expense</option> |
| 67 | + <option value="equity">Equity</option> |
| 68 | + <option value="liability">Liability</option> |
| 69 | + <option value="income">Income</option> |
| 70 | + <option value="Revenue">Revenue</option> |
| 71 | + </select><br> |
| 72 | + <input type="submit" class="btn btn-primary" value="Create Account"> |
| 73 | + <input type="reset" class="btn btn-danger" value="clear"> |
| 74 | + </form> |
| 75 | + </div> |
| 76 | + </div> |
| 77 | + <div class="col-lg-6 col-md-6"> |
| 78 | + <h3>All accounts</h3> |
| 79 | + <table class="table table-striped table-bordered table-hover"> |
| 80 | + <thead> |
| 81 | + <tr > |
| 82 | + <th>#</th> |
| 83 | + <th>Account Name</th> |
| 84 | + <th>Account Type</th> |
| 85 | + <th colspan="2">Action</th> |
| 86 | + </tr> |
| 87 | + </thead> |
| 88 | + <tbody> |
| 89 | + |
| 90 | + <?php |
| 91 | + include "connection.php"; |
| 92 | + $q="select * from accounts"; |
| 93 | + $result=mysqli_query($conn,$q); |
| 94 | + $i=0; |
| 95 | + while($row=mysqli_fetch_array($result)) |
| 96 | + { |
| 97 | + $i++; |
| 98 | + ?> |
| 99 | + <tr> |
| 100 | + <td><?php echo $i; ?></td> |
| 101 | + <td><?php echo $row['account_name'] ?></td> |
| 102 | + <td><?php echo $row['account_type'] ?></td> |
| 103 | + <td><a href="#"><i class="fa fa-edit"></i></a></td> |
| 104 | + <td><a href="#"><i class="fa fa-trash-o"></i></a></td> |
| 105 | + </tr> |
| 106 | + |
| 107 | + <?php |
| 108 | + } |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | + ?> |
| 113 | + </tbody> |
| 114 | + </table> |
| 115 | + |
| 116 | + </div> |
| 117 | +</div> |
| 118 | + <!-- /. ROW --> |
| 119 | + </div> |
| 120 | + <!-- /. PAGE INNER --> |
| 121 | + |
| 122 | + </div> |
| 123 | + <!-- /. PAGE WRAPPER --> |
| 124 | + </div> |
| 125 | + <!-- /. Footer --> |
| 126 | + <?php |
| 127 | + include 'footer.php'; |
| 128 | + ?> |
| 129 | + <?php |
| 130 | + include 'scripts.php'; |
| 131 | + ?> |
| 132 | +</html> |
0 commit comments