-
Notifications
You must be signed in to change notification settings - Fork 0
/
cost_add.php
143 lines (132 loc) · 3.54 KB
/
cost_add.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
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<?php
$header = 20;
$subheader = "Cost";
include "desaign/configuration.php";
include "desaign/databases.php";
include "desaign/title.php" ;
include "desaign/css.php";
include "desaign/session.php";
$keterangan = "";
if(isset($_POST['submit'])){
$type_cost = $_POST['type_cost'];
$cost = $_POST['cost'];
$status = 1;
$insert = $conf->ins_cost($con,$type_cost,$cost,$status);
if($insert){
$keterangan = "success";
} else {
$keterangan = "gagal";
}
}
?>
</head>
<body class="page-header-fixed page-quick-sidebar-over-content page-sidebar-closed-hide-logo page-container-bg-solid">
<?php
include "desaign/nav_header.php";
?>
<div class="clearfix">
</div>
<!-- BEGIN CONTAINER -->
<div class="page-container">
<?php
include "desaign/menu.php";
?>
<!-- BEGIN CONTENT -->
<div class="page-content-wrapper">
<div class="page-content">
<!-- BEGIN PAGE HEADER-->
<div class="page-bar">
<ul class="page-breadcrumb">
<li>
<i class="fa fa-home"></i>
<a href="dashboard.php">Dashboard</a>
<i class="fa fa-angle-right"></i>
</li>
<li>
<a href="cost_add.php">Add Cost</a>
</li>
</ul>
</div>
<div class="row">
<div class="portlet box green ">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-money"></i> Add Cost
</div>
</div>
<div class="portlet-body form">
<?php if($keterangan == "success"){ ?>
<div class="alert alert-success display-show">
<button class="close" data-close="alert"></button>
<span>
Your Data Has Been Inserted, Thank You</span>
</div>
<?php echo "<script>window.setTimeout(function () {location.href='cost_list.php';}, 700);</script>";
} else if($keterangan == "gagal"){
?>
<div class="alert alert-danger display-show">
<button class="close" data-close="alert"></button>
<span>
Oooppss, data not match, please cek again</span>
</div>
<?php
} else {
}
?>
<form class="form-horizontal" action="" method="post" role="form">
<div class="form-body">
<div class="form-group">
<div class="col-md-2">
<label class="control-label" >Type Cost</label>
</div>
<div class="col-md-2">
<select required class="form-control" name="type_cost">
<option value=""></option>
<?php
$get_type_cost = $conf->get_type_cost($con);
while ($row = mysqli_fetch_assoc($get_type_cost)){
?>
<option value="<?php echo $row['id'] ?>"><?php echo $row['name'] ?></option>
<?php
}
?>
</select>
</div>
</div>
<div class="form-group">
<div class="col-md-2">
<label class="control-label">Cost</label>
</div>
<div class="col-md-3">
<input name="cost" required type="number" autocomplete="off" class="form-control">
</div>
</div>
<div class="form-actions">
<div class="col-md-offset-3 col-md-9">
<button type="submit" name="submit" value="1" class="btn green">Save</button>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- END PAGE HEADER-->
<!-- BEGIN DASHBOARD STATS -->
<div class="row">
</div>
</div>
</div>
<!-- END CONTENT -->
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<?php
include "desaign/copyright2.php";
include "desaign/script.php";
?>
</body>
<!-- END BODY -->
</html>