-
Notifications
You must be signed in to change notification settings - Fork 0
/
change_device_status.php
156 lines (153 loc) · 6.8 KB
/
change_device_status.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
<?php
include("includes/config.inc.php");
include("includes/crosssite.inc.php");
include("includes/simpleimage.php");
if ( isset ( $_GET['logout'] ) && $_GET['logout'] ==1 ) {
session_destroy();
header("location: index.php?token=".$token);
}
if (isset($_SESSION) && $_SESSION['login']=='')
{
session_destroy();
header("location: index.php?token=".$token);
}
if(isset($_POST['submit']))
{
$deviceId = mysql_real_escape_string($_POST['deviceId']);
$status = mysql_real_escape_string($_POST['status']);
$sql = "Update tbl_device_master set status = '$status' Where id = '$deviceId'";
$result = mysql_query($sql);
mysql_query($sql);
$_SESSION['sess_msg'] = 'Status Updated successfully';
header("location:manage_model.php?token=".$token);
exit();
}
if(isset($_REQUEST['id']) && $_REQUEST['id']){
$queryArr=mysql_query("select * from tbl_device_master where id =".$_REQUEST['id']);
$result=mysql_fetch_assoc($queryArr);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?=SITE_PAGE_TITLE?></title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.6 -->
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="assets/bootstrap/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="assets/bootstrap/css/ionicons.min.css">
<!-- daterange picker -->
<link rel="stylesheet" href="assets/plugins/daterangepicker/daterangepicker.css">
<!-- bootstrap datepicker -->
<link rel="stylesheet" href="assets/plugins/datepicker/datepicker3.css">
<!-- iCheck for checkboxes and radio inputs -->
<link rel="stylesheet" href="assets/plugins/iCheck/all.css">
<!-- Bootstrap Color Picker -->
<link rel="stylesheet" href="assets/plugins/colorpicker/bootstrap-colorpicker.min.css">
<!-- Bootstrap time Picker -->
<link rel="stylesheet" href="assets/plugins/timepicker/bootstrap-timepicker.min.css">
<!-- Select2 -->
<link rel="stylesheet" href="assets/plugins/select2/select2.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="assets/dist/css/AdminLTE.min.css">
<!-- AdminLTE Skins. Choose a skin from the css/skins
folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet" href="assets/dist/css/skins/_all-skins.min.css">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<!-- Custom CSS -->
<link rel="stylesheet" type="text/css" href="assets/dist/css/custom.css">
<script src="assets/bootstrap/js/jquery-1.10.2.js"></script>
<script src="assets/bootstrap/js/jquery-ui.js"></script>
<script type="text/javascript" src="js/manage_import_device.js"></script>
<script>
$(function() {
$( "#date_of_purchase" ).datepicker({dateFormat: 'yy-mm-dd'});
});
</script>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<!-- Site wrapper -->
<div class="wrapper">
<?php include_once("includes/header.php") ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Change Device Status
<!--<small>Control panel</small>-->
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
<li class="active">Change Device Status</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="box box-info small-panel">
<div class="box-header">
<h3 class="box-title">Update</h3>
</div>
<div class="box-body">
<?php if(isset($id) && $id !="") {?>
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<strong><i class="fa fa-check-circle" aria-hidden="true"></i></strong> <?= $id; ?>
</div>
<?php
}
?>
<?php if(isset($msg) && $msg !="") {?>
<div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<strong><i class="fa fa-exclamation-circle" aria-hidden="true"></i></strong> <?= $msg;?>
</div>
<?php
}
?>
<form name='myform' action="" method="post" onSubmit="return validate(this)">
<input type="hidden" name="submitForm" value="yes" />
<input type='hidden' name='cid' id='cid' value="<?php if(isset($_GET['id']) and $_GET['id']>0){ echo $_GET['id']; }?>"/>
<input type="hidden" name="device_id" id="device_id" value="<?php $query = mysql_query("select device_id from tbldeviceid")?>"/>
<!-- from-group -->
<div class="form-group">
<label>Device Id<i>*</i></label>
<input type="text" name="deviceId" id="deviceId" value="<?php if(isset($result['id'])) echo $result['id'];?>" class="form-control text_box" readonly>
</div>
<!-- /.form group -->
<div class="form-group">
<label>Status<i>*</i></label>
<select name="status" id="status" class="form-control drop_down">
<option value="">Select Status</option>
<option value="0">Instock</option>
<option value="2">Replacement</option>
<option value="3">Damage</option>
</select>
</div> <!-- /.form group -->
<div class="form-group"><!-- /.form group -->
<input type='submit' name='submit' class="btn btn-primary btn-sm" value="Submit" onClick="check();"/>
<input type='reset' name='reset' class="open btn btn-primary btn-sm" value="Reset" onClick="deleteCok();"/>
<input type='button' name='cancel' class="btn btn-primary btn-sm" value="Back"
onclick="window.location='manage_model.php?token=<?php echo $token ?>'"/>
</div> <!-- form-group -->
</form>
</div>
<!-- /.box-body -->
</div>
</section> <!-- end main content -->
</div><!-- /.content-wrapper -->
<?php include_once("includes/footer.php") ?>
</div><!-- ./wrapper -->
<script src="js/bootstrap.min.js"></script>
<!-- AdminLTE App -->
<script src="assets/dist/js/app.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="assets/dist/js/demo.js"></script>
</body>
</html>