Repository navigation
Expand file tree
/
Copy pathadmin.php
More file actions
133 lines (121 loc) · 3.6 KB
/
Copy pathadmin.php
File metadata and controls
133 lines (121 loc) · 3.6 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
122
123
124
125
126
127
128
129
130
131
132
133
<?php
ini_set("display_errors", 0);
$fname = "config.txt";
$message = "";
if(isset($_POST["top_cherry"]))
{
$fp = fopen($fname, "w");
fwrite($fp, json_encode($_POST));
fclose($fp);
$message = "<center id='msg_success'>Successfully Saved!</center>";
}
$fp = fopen($fname, "r");
$data = fread($fp, filesize($fname));
fclose($fp);
$arr = json_decode($data);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Table Configurator Admin</title>
<link rel="stylesheet" type="text/css" href="style/admin.css" />
</head>
<script type="text/javascript" src="js/library/jquery.min.js"></script>
<script type="text/javascript" src="js/library/jquery-ui.min.js"></script>
<body>
<div id="header-area">
<img src="img/img_logo.png" id="btn_logo"></img>
<h3>Admin</h3>
</div>
<div id="admin-body">
<form method="POST">
<center>Please Update Price information</center>
<table id="tbl_main">
<tr>
<td>
<h3>Table Top:</h3>
<table class="tbl_info">
<tr>
<td>Cherry Table Top</td>
<td><input type="text" name="top_cherry" value="<?php echo $arr->top_cherry; ?>"></td>
</tr>
<tr>
<td>Mahagony Table Top</td>
<td><input type="text" name="top_mahagony" value="<?php echo $arr->top_mahagony; ?>"></td>
</tr>
<tr>
<td>Maple Table Top</td>
<td><input type="text" name="top_maple" value="<?php echo $arr->top_maple; ?>"></td>
</tr>
<tr>
<td>Walnut Table Top</td>
<td><input type="text" name="top_walnut" value="<?php echo $arr->top_walnut; ?>"></td>
</tr>
<tr>
<td>White Oak Table Top</td>
<td><input type="text" name="top_white" value="<?php echo $arr->top_white; ?>"></td>
</tr>
</table>
</td>
<td>
<h3>Table Regs:</h3>
<table class="tbl_info">
<tr>
<td>Black Steel Legs</td>
<td><input type="text" name="reg_black" value="<?php echo $arr->reg_black; ?>"></td>
</tr>
<tr>
<td>Raw Steel Legs</td>
<td><input type="text" name="reg_raw" value="<?php echo $arr->reg_raw; ?>"></td>
</tr>
<tr>
<td>Stainless Steel Legs</td>
<td><input type="text" name="reg_stainless" value="<?php echo $arr->reg_stainless; ?>"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<h3>Manufacturing Price:</h3>
<table class="tbl_info">
<tr>
<td>Table Top</td>
<td><input type="text" name="txt_tbltop" value="<?php echo $arr->txt_tbltop; ?>"></td>
</tr>
<tr>
<td>Table Regs</td>
<td><input type="text" name="txb_tblreg" value="<?php echo $arr->txb_tblreg; ?>"></td>
</tr>
</table>
</td>
<td>
<h3>Other Expenses:</h3>
<table class="tbl_info">
<tr>
<td>Overhead</td>
<td><input type="text" name="txt_overhead" value="<?php echo $arr->txt_overhead; ?>"></td>
</tr>
<tr>
<td>Hardware</td>
<td><input type="text" name="txt_hardware" value="<?php echo $arr->txt_hardware; ?>"></td>
</tr>
<tr>
<td>Profit Margin</td>
<td><input type="text" name="txt_profit" value="<?php echo $arr->txt_profit; ?>"></td>
</tr>
<tr>
<td>Shipping/Handling</td>
<td><input type="text" name="txt_shipping" value="<?php echo $arr->txt_shipping; ?>"></td>
</tr>
</table>
</td>
</tr>
</table>
<?php echo $message; ?>
<center>
<input type="submit" id="btn_save" value="Save">
</center>
</form>
</div>
</body>