-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpharmacypage_Doctor.php
148 lines (139 loc) · 6.16 KB
/
pharmacypage_Doctor.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
<title>Pharmacy Doctor</title>
<link rel="shortcut icon" href="<?php echo base_url('assets/image/logo.png') ?>">
<style type="text/css">
body{
background: url('<?php echo base_url('assets/image/11.jpg') ?>') no-repeat;
background-position: center;
background-size: cover;
font-family: sans-serif;
margin-top:100px;
}
#table td{
background-color: #0009;
}
.box{
margin-top: -30px;
background-color: #0009;
color:white;
}
tbody{
background-color: #0009;
}
</style>
<div class="container">
<div class="box">
<center><h2>Medicine Data</h2></center>
<br><br>
<table class="table table-bordered" id="table">
<thead>
<tr>
<th>No</th>
<th>Generic Name</th>
<th>Strength</th>
<th>form</th>
<th>price</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<?php $no=1; foreach ($data as $d ) {?>
<tr>
<td><?php echo $no++?></td>
<td><?php echo $d->generic_name?></td>
<td><?php echo $d->strength ?></td>
<td><?php echo $d->form ?></td>
<td>Rp.<?php echo $d->price ?></td>
<!--BUTTON EDIT-->
<td><button type="button" class="btn btn-warning" data-toggle="modal" data-target="#edit<?= $d->id ?>"><i class="fas fa-user-edit"></i></button></td>
<!-- BUTTON DELETE -->
<td><a type="button" class="btn btn-danger" href="<?= base_url() ?>index.php/welcome/deletemedicine/<?= $d->id ?>" onClick="return confirm('Confirm?')" ><i class="fas fa-user-times"></i></a></td>
</tr>
<?php } ?>
</tbody>
</table>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#add">ADD MEDICINE</button>
</div>
</div>
<!-- ADD MEDICINE MODAL-->
<div class="modal fade" id="add" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel1" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content" style=" background-color: #0009;
color: white;">
<div class="modal-header">
<center><h2>ADD MEDICINE</h2></center>
</div>
<div class="modal-body">
<form method="post" action="<?= base_url() ?>index.php/welcome/addmedicine/<?php echo $d->id ?>" enctype="multipart/form-data">
<input type="hidden" class="form-control" id="formGroupExampleInput" placeholder="id" name="id" required>
<div class="form-group">
<label for="formGroupExampleInput">Generic Name</label>
<input type="text" class="form-control" id="formGroupExampleInput" placeholder="generic_name" name="genericname" required >
</div>
<div class="form-group">
<label for="formGroupExampleInput">Strength</label>
<input type="text" class="form-control" id="formGroupExampleInput" placeholder="strength" name="strength"required>
</div>
<div class="form-group">
<label for="formGroupExampleInput2">Form</label>
<input type="text" class="form-control" id="formGroupExampleInput2" placeholder="Form" name="form" required>
</div>
<div class="form-group">
<label for="formGroupExampleInput2">Price</label>
<input type="text" class="form-control" id="formGroupExampleInput2" placeholder="Price" name="price" required>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" style="color: black";>Back</button>
<input type="submit" class="btn btn-primary" id="hapus" value="Add" placeholder="Simpan">
</div>
</form>
</div>
</div>
</div>
</div>
<!-- EDIT MEDICINE MODAL-->
<?php $no=1; foreach ($data as $d ) {?>
<div class="modal fade" id="edit<?php echo $d->id ?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content" style=" background-color: #0009;
color: white;">
<div class="modal-header">
<center><h2>EDIT MEDICINE </h2></center>
</div>
<div class="modal-body">
<form method="post" action="<?= base_url() ?>index.php/welcome/editmedicine/<?php echo $d->id ?>" enctype="multipart/form-data">
<input type="hidden" class="form-control" id="formGroupExampleInput" placeholder="id" name="id" value="<?php echo $d->id ?>" required>
<div class="form-group">
<label for="formGroupExampleInput">Generic Name</label>
<input type="text" class="form-control" id="formGroupExampleInput" placeholder="generic_name" name="genericname" value="<?php echo $d->generic_name ?>" required >
</div>
<div class="form-group">
<label for="formGroupExampleInput">Strength</label>
<input type="text" class="form-control" id="formGroupExampleInput" placeholder="strength" name="strength" value="<?php echo $d->strength ?>"required>
</div>
<div class="form-group">
<label for="formGroupExampleInput2">Form</label>
<input type="text" class="form-control" id="formGroupExampleInput2" placeholder="Form" name="form" value="<?php echo $d->form ?>" required>
</div>
<div class="form-group">
<label for="formGroupExampleInput2">Price</label>
<input type="text" class="form-control" id="formGroupExampleInput2" placeholder="Price" name="price" value="<?php echo $d->price?>" required>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" style="color: black;">Back</button>
<input type="submit" class="btn btn-primary" id="hapus" value="Edit" placeholder="Simpan">
</div>
</form>
</div>
</div>
</div>
<?php } ?>
</body>
<script type="text/javascript">
$(document).ready( function () {
$('#table').DataTable();
} );
</script>
</html>