Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kishan0725 committed Mar 16, 2020
1 parent d000988 commit 8a4ea29
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 185 deletions.
186 changes: 46 additions & 140 deletions admin-panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ function generate_bill(){
';

}

return $output;
}


if(isset($_GET["generate_bill"])){
echo "<script>alert('Bill paid successfully!');</script>";
require_once("TCPDF/tcpdf.php");
$obj_pdf = new TCPDF('P',PDF_UNIT,PDF_PAGE_FORMAT,true,'UTF-8',false);
$obj_pdf -> SetCreator(PDF_CREATOR);
Expand Down Expand Up @@ -283,14 +284,7 @@ function clickDiv(id) {
<center><h4>Create an appointment</h4></center><br>
<form class="form-group" method="post" action="admin-panel.php">
<div class="row">
<!--<div class="col-md-4"><label>First Name:</label></div>
<div class="col-md-8"><input type="text" class="form-control" name="fname"></div><br><br>
<div class="col-md-4"><label>Last Name:</label></div>
<div class="col-md-8"><input type="text" class="form-control" name="lname"></div><br><br>
<div class="col-md-4"><label>Email id:</label></div>
<div class="col-md-8"><input type="text" class="form-control" name="email"></div><br><br>
<div class="col-md-4"><label>Contact Number:</label></div>
<div class="col-md-8"><input type="text" class="form-control" name="contact"></div><br><br> -->

<!-- <?php

$con=mysqli_connect("localhost","root","","myhmsdb");
Expand All @@ -303,12 +297,7 @@ function clickDiv(id) {
echo json_encode($docarray);

?> -->
<!-- <div class="col-md-4"><label for="spec">Specialization:</label></div>
<div class="col-md-8">
<select name="spec" class="form-control" id="spec">
<option value="" disabled selected>Select Specialization</option>

</select> -->


<div class="col-md-4">
<label for="spec">Specialization:</label>
Expand All @@ -324,18 +313,53 @@ function clickDiv(id) {

<br><br>

<div class="col-md-4"><label for="doctor">Doctors:</label></div>
<script>
document.getElementById('spec').onchange = function foo() {
let spec = this.value;
console.log(spec)
let docs = [...document.getElementById('doctor').options];

docs.forEach((el, ind, arr)=>{
arr[ind].setAttribute("style","");
if (el.getAttribute("data-spec") != spec ) {
arr[ind].setAttribute("style","display: none");
}
});
};

</script>

<div class="col-md-4"><label for="doctor">Doctors:</label></div>
<div class="col-md-8">
<select name="doctor" class="form-control" id="doctor" required="required">
<option value="" disabled selected>Select Doctor</option>

<?php display_docs(); ?>
</select>
</div><br/><br/>


<script>
document.getElementById('doctor').onchange = function updateFees(e) {
var selection = document.querySelector(`[value=${this.value}]`).getAttribute('data-value');
document.getElementById('docFees').value = selection;
};
</script>





<!-- <div class="col-md-4"><label for="doctor">Doctors:</label></div>
<div class="col-md-8">
<select name="doctor" class="form-control" id="doctor1" required="required">
<option value="" disabled selected>Select Doctor</option>
<?php
display_docs();
?>

</select>
</div>
<br><br>
<br><br> -->

<script>
<!-- <script>
document.getElementById("spec").onchange = function updateSpecs(event) {
var selected = document.querySelector(`[data-value=${this.value}]`).getAttribute("value");
console.log(selected);
Expand All @@ -353,7 +377,7 @@ function clickDiv(id) {
}
}
}
</script>
</script> -->


<!-- <script>
Expand All @@ -365,124 +389,6 @@ function clickDiv(id) {
};
</script> -->

<!-- <script>
document.getElementById('spec').onchange = function foo() {
let spec = this.value;
let docs = [...document.getElementById('doctor').options];
docs.forEach((el, ind, arr)=>{
arr[ind].setAttribute("style","");
if (el.getAttribute("data-spec") != spec ) {
arr[ind].setAttribute("style","display: none");
}
});
};
</script> -->


<!-- <div class="col-md-4"><label for="doctor">Doctors:</label></div>
<div class="col-md-8">
<select name="doctor" class="form-control" id="doctor" required="required">
<option value="" disabled selected>Select Doctor</option>
<option value="ashok" data-spec="General">Ashok</option>
<option value="arun" data-spec="Cardiologist">Arun</option>
<option value="Dinesh" data-spec="General">Dinesh</option>
<option value="Ganesh" data-spec="Pediatrician">Ganesh</option>
<option value="Kumar" data-spec="Pediatrician">Kumar</option>
<option value="Amit" data-spec="Cardiologist">Amit</option>
<option value="Abbis" data-spec="Neurologist">Abbis</option>

</select>
<script>
document.getElementById('doctor').onchange = function updateFees(e) {
document.getElementById('docFees').value = document.querySelector(`[value=${this.value}]`).getAttribute('data-value');
};
</script>
</div><br/><br/> -->

<script>
document.getElementById('doctor1').onchange = function updateFees(e) {
var selection = document.querySelector(`[value=${this.value}]`).getAttribute('data-value');
document.getElementById('docFees').value = selection;
};
</script>

<!-- <div class="col-md-4">
<label for="spec">Specialization:</label>
</div>
<div class="col-md-8">
<select name="spec" class="form-control" id="spec">
<option value="" disabled selected>Select Specialization</option>
<option value="General">General</option>
<option value="Cardiologist">Cardiologist</option>
<option value="Pediatrician">Pediatrician</option>
<option value="Neurologist">Neurologist</option>
</select>
<script>
document.getElementById('spec').onchange = function foo() {
let spec = this.value;
let docs = [...document.getElementById('doctor').options];
docs.forEach((el, ind, arr)=>{
arr[ind].setAttribute("style","");
if (el.getAttribute("data-spec") != spec ) {
arr[ind].setAttribute("style","display: none");
}
});
};

</script>
</div><br/><br/>

<div class="col-md-4"><label for="doctor">Doctors:</label></div>
<div class="col-md-8">
<select name="doctor" class="form-control" id="doctor" required="required">
<option value="" disabled selected>Select Doctor</option>
<option value="Ashok" data-spec="General">Ashok</option>
<option value="arun" data-spec="Cardiologist">arun</option>
<option value="Dinesh" data-spec="General">Dinesh</option>
<option value="Ganesh" data-spec="Pediatrician">Ganesh</option>
<option value="Kumar" data-spec="Pediatrician">Kumar</option>
<option value="Amit" data-spec="Cardiologist">Amit</option>
<option value="Abbis" data-spec="Neurologist">Abbis</option>
</select>
</div><br/><br/> -->


<!-- <script>
document.getElementById("spec").onchange = function(event) {
var selected = this.innerHTML;

var options = document.getElementById("doctor1").querySelectorAll("option");

for (i = 0; i < options.length; i++) {
var currentOption = options[i];
var category = options[i].getAttribute("data-value");

if (category == selected) {
currentOption.style.display = "block";
} else {
currentOption.style.display = "none";
}
}
}
</script> -->






<!-- <div class="col-md-4"><label for="doctor">Doctors:</label></div>
<div class="col-md-8">
<select name="doctor" class="form-control" id="doctor1" required="required">
<option value="" disabled selected>Select Doctor</option>
<?php display_docs();?>
</select>
<script>
document.getElementById('doctor').onchange = function updateFees(e) {
document.getElementById('docFees').value = document.querySelector(`[value=${this.value}]`).getAttribute('data-value');
};
</script>
</div><br><br> -->


<div class="col-md-4"><label for="consultancyfees">
Expand Down
23 changes: 12 additions & 11 deletions admin-panel1.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
$doctor=$_POST['doctor'];
$dpassword=$_POST['dpassword'];
$demail=$_POST['demail'];
$spec=$_POST['special'];
$docFees=$_POST['docFees'];
$query="insert into doctb(username,password,email,docFees)values('$doctor','$dpassword','$demail','$docFees')";
$query="insert into doctb(username,password,email,spec,docFees)values('$doctor','$dpassword','$demail','$spec','$docFees')";
$result=mysqli_query($con,$query);
if($result)
{
Expand Down Expand Up @@ -62,7 +63,7 @@
if (document.getElementById('dpassword').value ==
document.getElementById('cdpassword').value) {
document.getElementById('message').style.color = '#5dd05d';
document.getElementById('message').innerHTML = 'Matching';
document.getElementById('message').innerHTML = 'Matched';
} else {
document.getElementById('message').style.color = '#f55252';
document.getElementById('message').innerHTML = 'Not Matching';
Expand Down Expand Up @@ -149,7 +150,7 @@ function alphaOnly(event) {
<div class="tab-pane fade show active" id="list-dash" role="tabpanel" aria-labelledby="list-dash-list">
<div class="container-fluid container-fullw bg-white" >
<div class="row">
<div class="col-sm-4" style="left: 5%">
<div class="col-sm-4">
<div class="panel panel-white no-radius text-center">
<div class="panel-body">
<span class="fa-stack fa-2x"> <i class="fa fa-square fa-stack-2x text-primary"></i> <i class="fa fa-users fa-stack-1x fa-inverse"></i> </span>
Expand All @@ -168,7 +169,7 @@ function clickDiv(id) {
</div>
</div>

<div class="col-sm-4" style="left: 10%">
<div class="col-sm-4" style="left: -3%">
<div class="panel panel-white no-radius text-center">
<div class="panel-body" >
<span class="fa-stack fa-2x"> <i class="fa fa-square fa-stack-2x text-primary"></i> <i class="fa fa-users fa-stack-1x fa-inverse"></i> </span>
Expand All @@ -184,7 +185,7 @@ function clickDiv(id) {
</div>


<div class="col-sm-4" style="left: 12%">
<div class="col-sm-4">
<div class="panel panel-white no-radius text-center">
<div class="panel-body" >
<span class="fa-stack fa-2x"> <i class="fa fa-square fa-stack-2x text-primary"></i> <i class="fa fa-paperclip fa-stack-1x fa-inverse"></i> </span>
Expand All @@ -201,7 +202,7 @@ function clickDiv(id) {
</div>

<div class="row">
<div class="col-sm-4" style="left: 20%;margin-top: 5%;">
<div class="col-sm-4" style="left: 13%;margin-top: 5%;">
<div class="panel panel-white no-radius text-center">
<div class="panel-body" >
<span class="fa-stack fa-2x"> <i class="fa fa-square fa-stack-2x text-primary"></i> <i class="fa fa-list-ul fa-stack-1x fa-inverse"></i> </span>
Expand All @@ -217,7 +218,7 @@ function clickDiv(id) {
</div>


<div class="col-sm-4" style="left: 24%;margin-top: 5%">
<div class="col-sm-4" style="left: 18%;margin-top: 5%">
<div class="panel panel-white no-radius text-center">
<div class="panel-body" >
<span class="fa-stack fa-2x"> <i class="fa fa-square fa-stack-2x text-primary"></i> <i class="fa fa-plus fa-stack-1x fa-inverse"></i> </span>
Expand Down Expand Up @@ -502,10 +503,10 @@ function clickDiv(id) {
<div class="col-md-8">
<select name="special" class="form-control" id="special" required="required">
<option value="head" name="spec" disabled selected>Select Specialization</option>
<option value="heart" name="spec">General</option>
<option value="homeo" name="spec">Cardiologist</option>
<option value="accu" name="spec">Neurologist</option>
<option value="accu" name="spec">Pediatrician</option>
<option value="General" name="spec">General</option>
<option value="Cardiologist" name="spec">Cardiologist</option>
<option value="Neurologist" name="spec">Neurologist</option>
<option value="Pediatrician" name="spec">Pediatrician</option>
</select>
</div><br><br>
<div class="col-md-4"><label>Email ID:</label></div>
Expand Down
15 changes: 10 additions & 5 deletions myhmsdb.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Mar 15, 2020 at 04:49 PM
-- Generation Time: Mar 16, 2020 at 02:34 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.4

Expand Down Expand Up @@ -76,7 +76,9 @@ INSERT INTO `appointmenttb` (`pid`, `ID`, `fname`, `lname`, `gender`, `email`, `
(2, 8, 'Alia', 'Bhatt', 'Female', '[email protected]', '8976897689', 'Ganesh', 550, '2020-03-21', '10:00:00', 1, 1),
(5, 9, 'Gautam', 'Shankararam', 'Male', '[email protected]', '9070897653', 'Ganesh', 550, '2020-03-19', '20:00:00', 1, 0),
(4, 10, 'Kishan', 'Lal', 'Male', '[email protected]', '8838489464', 'Ganesh', 550, '0000-00-00', '14:00:00', 1, 0),
(4, 11, 'Kishan', 'Lal', 'Male', '[email protected]', '8838489464', 'Dinesh', 700, '2020-03-27', '15:00:00', 1, 1);
(4, 11, 'Kishan', 'Lal', 'Male', '[email protected]', '8838489464', 'Dinesh', 700, '2020-03-27', '15:00:00', 1, 1),
(9, 12, 'William', 'Blake', 'Male', '[email protected]', '8683619153', 'Kumar', 800, '2020-03-26', '12:00:00', 1, 1),
(9, 13, 'William', 'Blake', 'Male', '[email protected]', '8683619153', 'Tiwary', 450, '2020-03-26', '14:00:00', 1, 1);

-- --------------------------------------------------------

Expand Down Expand Up @@ -131,7 +133,8 @@ INSERT INTO `doctb` (`username`, `password`, `email`, `spec`, `docFees`) VALUES
('Ganesh', 'ganesh123', '[email protected]', 'Pediatrician', 550),
('Kumar', 'kumar123', '[email protected]', 'Pediatrician', 800),
('Amit', 'amit123', '[email protected]', 'Cardiologist', 1000),
('Abbis', 'abbis123', '[email protected]', 'Neurologist', 1500);
('Abbis', 'abbis123', '[email protected]', 'Neurologist', 1500),
('Tiwary', 'tiwary123', '[email protected]', 'Pediatrician', 450);

-- --------------------------------------------------------

Expand Down Expand Up @@ -192,7 +195,9 @@ CREATE TABLE `prestb` (

INSERT INTO `prestb` (`doctor`, `pid`, `ID`, `fname`, `lname`, `appdate`, `apptime`, `disease`, `allergy`, `prescription`) VALUES
('Dinesh', 4, 11, 'Kishan', 'Lal', '2020-03-27', '15:00:00', 'Cough', 'Nothing', 'Just take a teaspoon of Benadryl every night'),
('Ganesh', 2, 8, 'Alia', 'Bhatt', '2020-03-21', '10:00:00', 'Severe Fever', 'Nothing', 'Take bed rest');
('Ganesh', 2, 8, 'Alia', 'Bhatt', '2020-03-21', '10:00:00', 'Severe Fever', 'Nothing', 'Take bed rest'),
('Kumar', 9, 12, 'William', 'Blake', '2020-03-26', '12:00:00', 'Sever fever', 'nothing', 'Paracetamol -> 1 every morning and night'),
('Tiwary', 9, 13, 'William', 'Blake', '2020-03-26', '14:00:00', 'Cough', 'Skin dryness', 'Intake fruits with more water content');

--
-- Indexes for dumped tables
Expand All @@ -218,7 +223,7 @@ ALTER TABLE `patreg`
-- AUTO_INCREMENT for table `appointmenttb`
--
ALTER TABLE `appointmenttb`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;

--
-- AUTO_INCREMENT for table `patreg`
Expand Down
Loading

0 comments on commit 8a4ea29

Please sign in to comment.