-
Notifications
You must be signed in to change notification settings - Fork 0
/
view_medi.php
146 lines (142 loc) · 5.38 KB
/
view_medi.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
<?php
session_start();
include('config.php');
error_reporting(0);
if($_SESSION['login']!=''){
$_SESSION['login']='';
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="description" content="" />
<meta name="author" content="" />
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<![endif]-->
<title></title>
<!-- BOOTSTRAP CORE STYLE -->
<link href="assets/css/bootstrap.css" rel="stylesheet" />
<!-- FONT AWESOME STYLE -->
<link href="assets/css/font-awesome.css" rel="stylesheet" />
<!-- CUSTOM STYLE -->
<link href="assets/css/style.css" rel="stylesheet" />
<!-- GOOGLE FONT -->
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
<script type="text/javascript">
function valid()
{
if(document.signup.password.value!= document.signup.confirmpassword.value)
{
alert("Password and Confirm Password Field do not match !!");
document.signup.confirmpassword.focus();
return false;
}
return true;
}
</script>
<script>
function checkAvailability() {
$("#loaderIcon").show();
jQuery.ajax({
url: "check_availability.php",
data:'emailid='+$("#emailid").val(),
type: "POST",
success:function(data){
$("#user-availability-status").html(data);
$("#loaderIcon").hide();
},
error:function (){}
});
}
</script>
</head>
<body>
<!------MENU SECTION START-->
<?php include('includes/header.php');?>
<!-- MENU SECTION END-->
<div class="content-wrapper">
<div class="container">
<div class="row">
<div class="col-md-12 col-md-offset-0">
<!-- Advanced Tables -->
<div class="panel panel-default">
<div class="panel-heading">
View Medicines
</div>
<div class="panel-body">
<form role="form" method="post" action="">
<div class="form-group">
<label>Search</label>
<input class="form-control" type="text" name="name" required autocomplete="off" />
</div>
<button type="submit" name="login" class="btn btn-info">Search Medicine </button>
</form><br>
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover" id="dataTables-example">
<thead>
<tr>
<th>#</th>
<th>Medicine Name</th>
<th>Photo</th>
<th>Type</th>
<th>Cost</th>
<th>Exp.</th>
<th>Purpose</th>
<th>Discription</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
//require_once("../config.php");
if(isset($_POST['login']))
{
$name=$_POST['name'];
$query =mysql_query("select * from medicins where mname='$name' or purpose='$name'");
}else{
$query =mysql_query("select * from medicins");
}
$records = mysql_num_rows($query);
$i=1;
while($row = mysql_fetch_array($query))
{
?>
<form role="form" method="post" action="admin_user_update.php">
<tr class="odd gradeX">
<td class="center"><?php echo $i;?></td>
<td class="center"><?php echo $row['mname'];?></td>
<td class="center"><a href="../admin/medicins/<?php echo $row['mphoto'];?>">Download</a></td>
<td class="center"><?php echo $row['type'];?></td>
<td class="center"><?php echo $row['cost'];?></td>
<td class="center"><?php echo $row['exp'];?></td>
<td class="center"><?php echo $row['purpose'];?></td>
<td class="center"><?php echo $row['discrip'];?></td>
</form>
<td><a href="medi_delete.php?id=<?php echo $row['id'];?>" onclick="return confirm('Are you sure you want to delete?');"" > <button class="btn btn-danger"><i class="fa fa-pencil"></i> Delete</button></td>
</tr>
<?php
$i++;
}
?>
</tbody>
</table>
</div>
</div>
</div>
<!--End Advanced Tables -->
</div>
</div>
</div>
</div>
<!-- CONTENT-WRAPPER SECTION END-->
<?php include('includes/footer.php');?>
<script src="assets/js/jquery-1.10.2.js"></script>
<!-- BOOTSTRAP SCRIPTS -->
<script src="assets/js/bootstrap.js"></script>
<!-- CUSTOM SCRIPTS -->
<script src="assets/js/custom.js"></script>
</body>
</html>