-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetting.php
292 lines (247 loc) · 8.42 KB
/
setting.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<!-- Author Name: Sudipto Ghosh-->
<!DOCTYPE html>
<html lang="en">
<?php require_once('check_login.php');?>
<?php include('head.php');?>
<?php include('header.php');?>
<?php include('sidebar.php');?>
<?php include('connect.php');?>
<script src="https://cdn.ckeditor.com/4.12.1/standard/ckeditor.js"></script>
<?php date_default_timezone_set('Asia/Kolkata');
$current_date = date('Y-m-d');
if(isset($_POST["btn_web"]))
{
extract($_POST);
if($_FILES['logo']['name']!=''){
$file_name = $_FILES['logo']['name'];
$file_type = $_FILES['logo']['type'];
$file_size = $_FILES['logo']['size'];
$file_tem_loc = $_FILES['logo']['tmp_name'];
$file_store = "uploadImage/Logo/".$file_name;
if (move_uploaded_file($file_tem_loc, $file_store)) {
echo "file uploaded successfully";
}
}
else{
$file_name=$_POST['old_image'];
}
$folder = "uploadImage/Logo/";
if (is_dir($folder))
{
if ($open = opendir($folder))
while (($logo=readdir($open)) !=false) {
if($logo=='.'|| $logo=="..") continue;
echo '<img src="uploadImage/Logo/'.$logo.'" width="100" height="100">';
}
closedir($open);
}
//UPDATE `manage_website` SET `id`=[value-1],`business_name`=[value-2],`business_email`=[value-3],`business_web`=[value-4],`portal_addr`=[value-5],`addr`=[value-6],`curr_sym`=[value-7],`curr_position`=[value-8],`front_end_en`=[value-9],`date_format`=[value-10],`def_tax`=[value-11],`logo`=[value-12] WHERE 1
$q1="UPDATE `manage_website` SET `business_name`='$business_name',`business_email`='$business_email',`business_web`='$business_web',`portal_addr`='$portal_addr' ,`addr`= '$addr',`curr_sym`= '$curr_sym',`curr_position`='$curr_position',`front_end_en`='$front_end_en' , `date_format` = '$date_format', `def_tax` = '$def_tax', `logo` = '$file_name'";
if ($conn->query($q1) === TRUE) {
$_SESSION['success']='Record Successfully Updated';
?>
<script type="text/javascript">
window.location = "setting.php";
</script>
<?php
} else {
$_SESSION['error']='Something Went Wrong';
}
?>
<script>
//window.location = "sms_config.php";
</script>
<?php
}
?>
<?php
$que="select * from manage_website";
$query=$conn->query($que);
while($row=mysqli_fetch_array($query))
{
//print_r($row);
extract($row);
$business_name = $row['business_name'];
$business_email = $row['business_email'];
$business_web = $row['business_web'];
$portal_addr = $row['portal_addr'];
$addr = $row['addr'];
$curr_sym = $row['curr_sym'];
$curr_position = $row['curr_position'];
$front_end_en = $row['front_end_en'];
$date_format = $row['date_format'];
$def_tax = $row['def_tax'];
$logo = $row['logo'];
}
?>
<div class="pcoded-content">
<div class="pcoded-inner-content">
<div class="main-body">
<div class="page-wrapper">
<div class="page-header">
<div class="row align-items-end">
<div class="col-lg-8">
<div class="page-header-title">
<div class="d-inline">
<h4>Settings</h4>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="page-header-breadcrumb">
<ul class="breadcrumb-title">
<li class="breadcrumb-item">
<a href="dashboard.php"> <i class="feather icon-home"></i> </a>
</li>
<li class="breadcrumb-item"><a href="setting.php">Settings</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="page-body">
<div class="row">
<div class="col-sm-12">
<div class="card">
<div class="card-block">
<div class="row">
<div class="col-lg-12 col-xl-12">
<div class="sub-title">Settings</div>
<ul class="nav nav-tabs tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#general" role="tab">General</a>
</li>
<!-- <li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#repair" role="tab">Repair</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#invoice" role="tab">Invoice</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#sms" role="tab">SMS</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#payment" role="tab">Payment</a>
</li> -->
</ul>
<div class="tab-content tabs card-block">
<div class="tab-pane active" id="general" role="tabpanel">
<div class="card-block">
<form id="main" method="POST" enctype="multipart/form-data">
<div class="form-group row">
<label class="col-sm-2 col-form-label">Company Name</label>
<div class="col-sm-4">
<input type="text" class="form-control" name="business_name" id="business_name" value="<?php echo $business_name;?>" required="">
<span class="messages"></span>
</div>
<label class="col-sm-2 col-form-label">Company Email</label>
<div class="col-sm-4">
<input type="text" class="form-control" name="business_email" id="business_email" value="<?php echo $business_email;?>" required="">
<span class="messages"></span>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Company Website</label>
<div class="col-sm-4">
<input type="text" class="form-control" name="business_web" id="business_web" value="<?php echo $business_web;?>" required="">
<span class="messages"></span>
</div>
<label class="col-sm-2 col-form-label">Company Portal Address</label>
<div class="col-sm-4">
<input type="text" class="form-control" name="portal_addr" id="postal_addr" value="<?php echo $portal_addr;?>" required="">
<span class="messages"></span>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Company Address</label>
<div class="col-sm-10">
<textarea name="addr" ><?php echo $addr;?></textarea>
<script>
CKEDITOR.replace( 'addr' );
</script>
<span class="messages"></span>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Currency Symbol</label>
<div class="col-sm-4">
<input type="text" class="form-control" name="curr_sym" id="curr_sym" value="<?php echo $curr_sym;?>" required="">
<span class="messages"></span>
</div>
<label class="col-sm-2 col-form-label">Currency Position</label>
<div class="col-sm-4">
<select class="form-control" id="curr_position" name="curr_position" required="">
<option value="<?php echo "right";?>"<?php if($curr_position=='right'){echo "selected";}?>>Right</option>
<option value="<?php echo "left";?>"<?php if($curr_position=='left'){echo "selected";}?>>Left</option>
</select>
<span class="messages"></span>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Enable Front End</label>
<div class="col-sm-4">
<select type="text" class="form-control" id="front_end_en" name="front_end_en" placeholder="Add yes/no" required="">
<option value="1" <?php if($front_end_en=='1'){echo "selected";}?>>Yes</option>
<option value="0" <?php if($front_end_en=='0'){echo "selected";}?>>No</option>
</select>
<span class="messages"></span>
</div>
<label class="col-sm-2 col-form-label">Date Format</label>
<div class="col-sm-4">
<select type="text" class="form-control" id="date_format" name="date_format" placeholder="Add yes/no" required="">
<option value="Y-m-d" <?php if($date_format=='Y-m-d'){echo "selected";}?>>Y-m-d</option>
<option value="d-m-Y" <?php if($date_format=='d-m-Y'){echo "selected";}?>>d-m-Y</option>
</select>
<span class="messages"></span>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Default Tax</label>
<div class="col-sm-4">
<input type="text" class="form-control" name="def_tax" id="def_tax" value="<?php echo $def_tax;?>" required="">
<span class="messages"></span>
</div>
<label class="col-sm-2 col-form-label">Company Logo</label>
<div class="col-sm-4">
<image class="profile-img" src="uploadImage/Logo/<?php echo $logo; ?>" style="width: 50%"></image>
<input type="hidden" value="<?=$logo?>" name="old_image">
<input type="file" class="form-control" name="logo">
<span class="messages"></span>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2"></label>
<div class="col-sm-10">
<button type="submit" name="btn_web" class="btn btn-primary m-b-0">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="#">
</div>
</div>
</div>
</div>
</div>
<?php include('footer.php');?>
<script>
$("input[name='def_tax']").TouchSpin({
min: 0,
max: 100000000,
step: 0.01,
decimals: 2,
boostat: 5,
maxboostedstep: 10,
// postfix: '%'
});
</script>