Mr.Fn4ticHz Shell
Server IP : 162.240.98.243  /  Your IP : 3.135.249.220
Web Server : Apache
System : Linux server.bti.yaw.mybluehostin.me 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : btiyawmy ( 1003)
PHP Version : 7.2.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/btiyawmy/public_html/login.easenup.in/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/btiyawmy/public_html/login.easenup.in//testmedifinal.php
<?php
session_start();
require_once("../LoginManager.php");
require_once("../DBManager.php");
include("dashboarddocument.php");
include("header.php");
?>

<?php
session_start();
include("dbconnection.php");
require_once('../DBManager.php');
require_once("../LoginManager.php");
require_once('../patientmanager.php');
if(isset($_POST[opdmedicine]))
{
		PatientManager::Medicine("$_GET[prescriptionid]","$_GET[patientid]","$_POST[DRUGS]","$_POST[Dose]","$_POST[Route]","$_POST[Frequency]","$_POST[duration]","$_POST[potential]","$_POST[poa]","$_POST[status]","$_POST[Action]","$_POST[availability]","$_POST[batchno]","$_POST[st0]","$_POST[st1]","$_POST[st2]","$_POST[st3]","$_POST[st4]","$_POST[st5]","$_POST[drid]","$_POST[treatmentid]","$_POST[entered_by]");
	 }
	 
elseif(isset($_POST[status]))

	{
		PatientManager::medimgnt("$_GET[prescriptionid]","$_GET[patientid]","$_POST[medicine_id]","$_POST[DRUGS]","$_POST[timeslot]","$_POST[admissiondate]","$_POST[status]","$_POST[entered_by]");
	 }
	 if(isset($_POST[statusmedicineva]))
{ 
$sql ="UPDATE medicinede SET status='$_POST[status]' WHERE prescriptionid='$_GET[prescriptionid]' AND patientid='$_GET[patientid]' AND id='$_GET[id]'";
if($qsql = mysqli_query($con,$sql))
		{
    echo "<script>
 window.history.go(-1)</script>";
     } 
    
}

?>

<?php
include("dbconnection.php");
if(isset($_GET[delid]))
{
	$sql ="DELETE FROM medicinede WHERE id='$_GET[delid]'";
	$qsql=mysqli_query($con,$sql);
	if(mysqli_affected_rows($con) == 1)
	{
		echo "<script>alert('Deleted successfully..');</script>";
	}
}
?>


<?php
include("dbconnection.php");
if(isset($_GET[delid]))
{
	$sql12911 ="DELETE FROM medication_mng WHERE id='$_GET[delid]'";
	$qsql12911=mysqli_query($con,$sql12911);
	if(mysqli_affected_rows($con) == 1)
	{
		echo "<script>alert('Un-done successfully..');</script>";
	}
}
?>

<?php session_start();
require_once("../patientmanager.php");
require_once("../DBManager.php");

?>



    <title>Title of the document</title>
<style>
      #loaderImg {
         position: absolute;
         top: 0;
         bottom: 0;
         left: 0;
         right: 0; 
         margin: auto;
         border: 10px solid grey;
         border-radius: 50%;
         border-top: 10px solid black;
         width: 100px;
         height: 100px;
         animation: spin 1s linear infinite;
      }
      @keyframes spin {
         0% {
            -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
         }
         100% {
            -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
         }
      }
   </style>
    <style>

      .modal {
        display: none;
        position: fixed;
        z-index: 8;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: auto;
        background-color: rgb(0, 0, 0);
        background-color: rgba(0, 0, 0, 0.4);
      }
      .modal-content {
        margin: 50px auto;
        border: 1px solid #999;
        width: 60%;
      }
      h2,p {
        margin: 0 0 20px;
        font-weight: 400;
  
      }     
     .form1 {
        padding: 25px;
        margin: 25px;
        box-shadow: 0 2px 5px #f5f5f5;
        background: #eee;
      }
      input,
      textarea, select {
        width: 100%;
        padding: 6px;
        margin-bottom: 20px;
        border: 1px solid #1c87c9;
        outline: none;
      }
      .contact-form button {
        width: 100%;
        padding: 10px;
        border: none;
        background: #1c87c9;
        font-size: 16px;
        font-weight: 400;
        color: #fff;
      }
      button:hover {
        background: #2371a0;
      }
      .close {
        color: #aaa;
        float: right;
        font-size: 58px;
        font-weight: bold;
      }
      .close:hover,
      .close:focus {
        color: black;
        text-decoration: none;
        cursor: pointer;
      }
      button.button {
        display: inline-block;
       
        border-bottom: #02274a 1px solid;
     
        font-size: 19px;
        cursor: pointer;
      }
      
      button.button:hover {
    
        border-bottom: #a99567 1px solid;
        color: #a99567;
      }

 
    </style>
     <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>

     <script type="text/javascript">
$(document).ready(function(){
    $('#myForm').submit(function() {
     $('#loaderImg').show(); 
      return true;
    });
});
  </script>

  <script>
  $( function() {
    $.widget( "custom.combobox", {
      _create: function() {
        this.wrapper = $( "<span>" )
          .addClass( "custom-combobox" )
          .insertAfter( this.element );
 
        this.element.hide();
        this._createAutocomplete();
        this._createShowAllButton();
      },
 
      _createAutocomplete: function() {
        var selected = this.element.children( ":selected" ),
          value = selected.val() ? selected.text() : "";
 
        this.input = $( "<input>" )
          .appendTo( this.wrapper )
          .val( value )
          .attr( "title", "" )
          .addClass( "custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left" )
          .autocomplete({
            delay: 0,
            minLength: 0,
            source: $.proxy( this, "_source" )
          })
          .tooltip({
            classes: {
              "ui-tooltip": "ui-state-highlight"
            }
          });
 
        this._on( this.input, {
          autocompleteselect: function( event, ui ) {
            ui.item.option.selected = true;
            this._trigger( "select", event, {
              item: ui.item.option
            });
          },
 
          autocompletechange: "_removeIfInvalid"
        });
      },
 
      _createShowAllButton: function() {
        var input = this.input,
          wasOpen = false;
 
        $( "<a>" )
          .attr( "tabIndex", -1 )
          .attr( "title", "Show All Items" )
          .tooltip()
          .appendTo( this.wrapper )
          .button({
            icons: {
              primary: "ui-icon-triangle-1-s"
            },
            text: false
          })
          .removeClass( "ui-corner-all" )
          .addClass( "custom-combobox-toggle ui-corner-right" )
          .on( "mousedown", function() {
            wasOpen = input.autocomplete( "widget" ).is( ":visible" );
          })
          .on( "click", function() {
            input.trigger( "focus" );
 
            // Close if already visible
            if ( wasOpen ) {
              return;
            }
 
            // Pass empty string as value to search for, displaying all results
            input.autocomplete( "search", "" );
          });
      },
 
      _source: function( request, response ) {
        var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
        response( this.element.children( "option" ).map(function() {
          var text = $( this ).text();
          if ( this.value && ( !request.term || matcher.test(text) ) )
            return {
              label: text,
              value: text,
              option: this
            };
        }) );
      },
 
      _removeIfInvalid: function( event, ui ) {
 
        // Selected an item, nothing to do
        if ( ui.item ) {
          return;
        }
 
        // Search for a match (case-insensitive)
        var value = this.input.val(),
          valueLowerCase = value.toLowerCase(),
          valid = false;
        this.element.children( "option" ).each(function() {
          if ( $( this ).text().toLowerCase() === valueLowerCase ) {
            this.selected = valid = true;
            return false;
          }
        });
 
        // Found a match, nothing to do
        if ( valid ) {
          return;
        }
 
        // Remove invalid value
        this.input
          .val( "" )
          .attr( "title", value + " didn't match any item" )
          .tooltip( "open" );
        this.element.val( "" );
        this._delay(function() {
          this.input.tooltip( "close" ).attr( "title", "" );
        }, 2500 );
        this.input.autocomplete( "instance" ).term = "";
      },
 
      _destroy: function() {
        this.wrapper.remove();
        this.element.show();
      }
    });
 
    $( "#combobox" ).combobox();
    $( "#toggle" ).on( "click", function() {
      $( "#combobox" ).toggle();
    });
  } );
  </script>
<style>
.center {
   border: 1px solid grey;
   text-align:;
}

</style>

   <style>

 
 
 .p{
     color: black;
          font-weight: 900;
 }
/* Automatic Serial Number Row */
.css-serial {
     font-weight: 900;
       color: black;
 counter-reset: serial-number; /* Set the serial number counter to 0 */
}
.css-serial td:first-child:before {
 counter-increment: serial-number; /* Increment the serial number counter */
 content: counter(serial-number); /* Display the counter */
}
</style>
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
         <h3 align='center'>Medication Management </h3>
         
<div class='center'>
<table id="example2"  id ="demo" class="table table-bordered table-hover">
    
    <tr>
        <th>Medication Details</th>
        <th>Administered</th>
        <th>Towards</th>
        <th>Action</th>
    </tr>
         
<?php
include("dbconnection.php");

$today = date('Y/m/d');

$sql ="SELECT * FROM medication_mng WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND  admissiondate='$today'";
$qsql = mysqli_query($con,$sql);
while($rs123 = mysqli_fetch_array($qsql))
{
    $sql99 ="SELECT * FROM medicinede WHERE DRUGS='$rs123[DRUGS]'  AND prescriptionid='$rs123[prescriptionid]'";
$qsql99 = mysqli_query($con,$sql99);
if($rs= mysqli_fetch_array($qsql99))
{

echo" <tr>";
 echo "<td><b>Drug : </b>";

  if (is_numeric($rs[DRUGS]))
{

$sql1 ="SELECT * FROM medicine_stok WHERE medicine_id='$rs[DRUGS]'";
$qsql1 = mysqli_query($con,$sql1);
while($rs1 = mysqli_fetch_array($qsql1))
echo"$rs1[DRUGS_name]";
}
else
{
    echo"$rs[DRUGS]";
    }
echo" <br><b>Dose : </b>$rs[Dose]<br><b>Route : </b>$rs[Route]<br>"; echo "<b>Frequency :</b> ";
	   
switch ($rs[Frequency]) {
  case '01':
    echo "OD (Once Daily)";
    break;
      case '2':
    echo "BID/b.i.d. (twice a day)";
    break;
     case '3':
    echo "TID/t.id. (three times a day)";
    break;
     case '04':
    echo "QID/q.i.d. (four times a day)";
    break;
     case '1':
    echo "QHS (every bedtime)";
    break;
    
     case '6':
    echo "Q4h (every 4 hours)";
    break;
    
     case '4':
    echo "Q4-6h (every 4 to 6 hours)";
    break;
    
     case '1':
    echo "QWK (every week)";
    break;
    
        default:
    echo "";
} 
  if (is_numeric($rs123[entered_by]))
{
$sqldoctor= "SELECT * FROM site_users WHERE userno='$rs123[entered_by]'";
			$qsqldoctor = mysqli_query($con,$sqldoctor);
			while($rsdoctor = mysqli_fetch_array($qsqldoctor))
			{
echo"
		   </td><td> <b>By :</b>$rsdoctor[name] 
		   
		   <br><b>At :</b> $rs123[created_at]</td>";
			}
     echo"<td>$rs123[status]  <br>"; 
//   echo  "$rs123[timeslot]";
   echo "
     </td>
    
    
    	 <td><a href='testmedifinal.php?prescriptionid=$rs123[prescriptionid]&patientid=$rs123[patientid]&delid=$rs123[id]'><i class='fa fa-undo' style='font-size:20px;'></i></a></td>
    	
    	 
    	     </tr>  ";

}
}
}
?>
  <tr > <td colspan='4'><a href='show_testmedifinal.php?prescriptionid=<?php echo $_GET['prescriptionid'] ?>&patientid=<?php echo $_GET['patientid'] ?>' style='float:right;margin:12px;'><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M0 96C0 43 43 0 96 0H384h32c17.7 0 32 14.3 32 32V352c0 17.7-14.3 32-32 32v64c17.7 0 32 14.3 32 32s-14.3 32-32 32H384 96c-53 0-96-43-96-96V96zM64 416c0 17.7 14.3 32 32 32H352V384H96c-17.7 0-32 14.3-32 32zM208 112v48H160c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h48v48c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V224h48c8.8 0 16-7.2 16-16V176c0-8.8-7.2-16-16-16H272V112c0-8.8-7.2-16-16-16H224c-8.8 0-16 7.2-16 16z" /></svg> view</a></td></tr>
</table>
</div>
<br><br>

<div class='center'>
    <label>Select Slot </label>
    
    	<select  type="search" class="light-table-filter" data-table="order-table" name="Education"  class="form-control">
									  <option value="" disabled selected> Select Slot</option>
									  <?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='00:00-01:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='00:00-01:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='00:00-01:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='00:00-01:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='00:00-01:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='00:00-01:00'>00:00-01:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='01:00-02:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='01:00-02:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='01:00-02:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='01:00-02:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='01:00-02:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='01:00-02:00'>01:00-02:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='02:00-03:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='02:00-03:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='02:00-03:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='02:00-03:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='02:00-03:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='02:00-03:00'>02:00-03:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='03:00-04:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='03:00-04:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='03:00-04:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='03:00-04:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='03:00-04:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='03:00-04:00'>03:00-04:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='04:00-05:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='04:00-05:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='04:00-05:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='04:00-05:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='04:00-05:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='04:00-05:00'>04:00-05:00</option>"; 
}
?><?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='05:00-06:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='05:00-06:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='05:00-06:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='05:00-06:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='05:00-06:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='05:00-06:00'>05:00-06:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='06:00-07:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='06:00-07:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='06:00-07:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='06:00-07:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='06:00-07:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='06:00-07:00'>06:00-07:00</option>"; 
}
?><?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='07:00-08:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='07:00-08:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='07:00-08:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='07:00-08:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='07:00-08:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='07:00-08:00'>07:00-08:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='08:00-09:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='08:00-09:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='08:00-09:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='08:00-09:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='08:00-09:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='08:00-09:00'>08:00-09:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='09:00-10:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='09:00-10:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='09:00-10:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='09:00-10:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='09:00-10:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='09:00-10:00'>09:00-10:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='10:00-11:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='10:00-11:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='10:00-11:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='10:00-11:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='10:00-11:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='10:00-11:00'>10:00-11:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='11:00-12:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='11:00-12:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='11:00-12:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='11:00-12:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='11:00-12:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='11:00-12:00'>11:00-12:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='12:00-13:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='12:00-13:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='12:00-13:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='12:00-13:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='12:00-13:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='12:00-13:00'>12:00-13:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='13:00-14:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='13:00-14:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='13:00-14:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='13:00-14:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='13:00-14:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='13:00-14:00'>13:00-14:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='14:00-15:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='14:00-15:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='14:00-15:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='14:00-15:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='14:00-15:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='14:00-15:00'>14:00-15:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='15:00-16:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='15:00-16:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='15:00-16:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='15:00-16:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='15:00-16:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='15:00-16:00'>15:00-16:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='16:00-17:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='16:00-17:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='16:00-17:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='16:00-17:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='16:00-17:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='16:00-17:00'>16:00-17:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='17:00-18:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='17:00-18:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='17:00-18:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='17:00-18:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='17:00-18:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='17:00-18:00'>17:00-18:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='18:00-19:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='18:00-19:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='18:00-19:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='18:00-19:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='18:00-19:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='18:00-19:00'>18:00-19:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='19:00-20:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='19:00-20:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='19:00-20:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='19:00-20:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='19:00-20:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='19:00-20:00'>19:00-20:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='19:00-20:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='20:00-21:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='20:00-21:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='20:00-21:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='20:00-21:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='20:00-21:00'>20:00-21:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='21:00-22:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='21:00-22:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='21:00-22:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='21:00-22:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='21:00-22:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='21:00-22:00'>21:00-22:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='22:00-23:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='22:00-23:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='22:00-23:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='22:00-23:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='22:00-23:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='22:00-23:00'>22:00-23:00</option>"; 
}
?>
<?php
include("dbconnection.php");
$sql100 ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st0='23:00-00:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st1='23:00-00:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st2='23:00-00:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st3='23:00-00:00' OR patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active' AND st4='23:00-00:00'";
$qsql100 = mysqli_query($con,$sql100);
if($rs100 = mysqli_fetch_array($qsql100))
{
   echo"<option value='23:00-00:00'>23:00-00:00</option>"; 
}
?>
</select>



 <div id='divmb'></div>

  <table id="example2"  id ="demo" class="order-table table table-bordered table-hover css-serial">
    
    <tr>
        <th>Sr. No</th>
        <th>Time Slot</th>
        <th>Medication Details</th>
        <th>Action</th>
    </tr>

<?php
include("dbconnection.php");


$today = date('Y/m/d');
$sql ="SELECT * FROM medicinede WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]' AND status='Active'  ORDER BY id ASC";
$qsql = mysqli_query($con,$sql);
while($rs = mysqli_fetch_array($qsql))
{
    
    	if($rs[st0]!='')
{
$DisplayForm=True;
$sql7 ="SELECT * FROM medication_mng WHERE  prescriptionid='$_GET[prescriptionid]' AND timeslot='$rs[st0]' AND medicine_id='$rs[id]'  AND  admissiondate='$today'";
$qsql7 = mysqli_query($con,$sql7);
if($rs7 = mysqli_fetch_array($qsql7))
{
    $DisplayForm=False;
echo "";
}
if($DisplayForm)
{
echo"<tr><td></td><td>$rs[st0]</td>";
 echo "<td>&nbsp;<b>Drug : </b>";
  if (is_numeric($rs[DRUGS]))
{
$sql1 ="SELECT * FROM medicine_stok WHERE medicine_id='$rs[DRUGS]'";
$qsql1 = mysqli_query($con,$sql1);
while($rs1 = mysqli_fetch_array($qsql1))
echo"$rs1[DRUGS_name]";
}
else
{
    echo"$rs[DRUGS]";
    }
echo" <br><b>Dose : </b>$rs[Dose]<br><b>Route : </b>$rs[Route]<br>"; echo "<b>Frequency :</b> ";
	   
switch ($rs[Frequency]) {
  case '01':
    echo "OD (Once Daily)";
    break;
      case '2':
    echo "BID/b.i.d. (twice a day)";
    break;
     case '3':
    echo "TID/t.id. (three times a day)";
    break;
     case '04':
    echo "QID/q.i.d. (four times a day)";
    break;
     case '1':
    echo "QHS (every bedtime)";
    break;
    
     case '6':
    echo "Q4h (every 4 hours)";
    break;
    
     case '4':
    echo "Q4-6h (every 4 to 6 hours)";
    break;
    
     case '1':
    echo "QWK (every week)";
    break;
    
        default:
    echo "";
} echo"";
echo"<br> Note: $rs[potential]</td>

              		 <td>
              		 <div class='btn-group'>
	  <button type='button' class='btn btn-default dropdown-toggle' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
	    Action <span class='caret'></span>
	  </button>
	  <ul class='dropdown-menu'>
	  <li><form name='status' method='post'>
	  
	  <input type='hidden' name='medicine_id' value='$rs[id]'>
	  <input type='hidden' name='timeslot' value='$rs[st0]'><input type='hidden' name='DRUGS' value='$rs[DRUGS]'>
    <button style='height:auto;width:100%; padding:10px' value='Disperse' name='status' type='submit'>  Disperse</button>
     <button style='height:auto;width:100%;padding:10px' value='Ignore' name='status' type='submit'>  Ignore</button>
       
</form>
<a href='testmedifinal.php?prescriptionid=$rs[prescriptionid]&patientid=$rs[patientid]&delid=$rs[id]' class='btn btn-primary' style='margin:10px 10px;color:#000000;'>Remove</a>
</li><li>
<a href='ordercreate.php?prescriptionid=$rs[prescriptionid]&patientid=$rs[patientid]&id=$rs[id]' data-modal='modalOne' class='btn btn-success' style='margin:10px;color:#000000;'>Create Order</a>
</li>
	    </ul>
	</div>
             </td>
              					
          </tr>                   
";
}
}


	if($rs[st1]!='')
{
$DisplayForm=True;
$sql7 ="SELECT * FROM medication_mng WHERE  prescriptionid='$_GET[prescriptionid]' AND timeslot='$rs[st1]' AND medicine_id='$rs[id]' AND  admissiondate='$today'";
$qsql7 = mysqli_query($con,$sql7);
if($rs7 = mysqli_fetch_array($qsql7))
{
    $DisplayForm=False;
echo "";
}
if($DisplayForm)
{
echo"<tr><td></td><td>$rs[st1]</td>";
 echo "<td>&nbsp;<b>Drug : </b>";
  if (is_numeric($rs[DRUGS]))
{
$sql1 ="SELECT * FROM medicine_stok WHERE medicine_id='$rs[DRUGS]'";
$qsql1 = mysqli_query($con,$sql1);
while($rs1 = mysqli_fetch_array($qsql1))
echo"$rs1[DRUGS_name]";
}
else
{
    echo"$rs[DRUGS]";
    }
echo" <br><b>Dose : </b>$rs[Dose]<br><b>Route : </b>$rs[Route]<br>"; echo "<b>Frequency :</b> ";
	   
switch ($rs[Frequency]) {
  case '01':
    echo "OD (Once Daily)";
    break;
      case '2':
    echo "BID/b.i.d. (twice a day)";
    break;
     case '3':
    echo "TID/t.id. (three times a day)";
    break;
     case '04':
    echo "QID/q.i.d. (four times a day)";
    break;
     case '1':
    echo "QHS (every bedtime)";
    break;
    
     case '6':
    echo "Q4h (every 4 hours)";
    break;
    
     case '4':
    echo "Q4-6h (every 4 to 6 hours)";
    break;
    
     case '1':
    echo "QWK (every week)";
    break;
    
        default:
    echo "";
} echo"";
echo"<br> Note: $rs[potential]</td>

              		 <td>
              		 <div class='btn-group'>
	  <button type='button' class='btn btn-default dropdown-toggle' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
	    Action <span class='caret'></span>
	  </button>
	  <ul class='dropdown-menu'>
	  <li><form name='status' method='post'>
	  
	  <input type='hidden' name='medicine_id' value='$rs[id]'>
	  <input type='hidden' name='timeslot' value='$rs[st1]'><input type='hidden' name='DRUGS' value='$rs[DRUGS]'>
    <button style='height:auto;width:100%; padding:10px' value='Disperse' name='status' type='submit'>  Disperse</button>
     <button style='height:auto;width:100%;padding:10px' value='Ignore' name='status' type='submit'>  Ignore</button>
       
</form>
<a href='testmedifinal.php?prescriptionid=$rs[prescriptionid]&patientid=$rs[patientid]&delid=$rs[id]' class='btn btn-primary' style='margin:10px 10px;color:#000000;'>Remove</a>
</li><li>
<a href='ordercreate.php?prescriptionid=$rs[prescriptionid]&patientid=$rs[patientid]&id=$rs[id]' data-modal='modalOne' class='btn btn-success' style='margin:10px;color:#000000;'>Create Order</a>
</li>
	    </ul>
	</div>
             </td>
              					
          </tr>                   
";
}
}


	if($rs[st2]!='')
{
$DisplayForm=True;
$sql7 ="SELECT * FROM medication_mng WHERE  prescriptionid='$_GET[prescriptionid]' AND timeslot='$rs[st2]' AND medicine_id='$rs[id]' AND  admissiondate='$today'";
$qsql7 = mysqli_query($con,$sql7);
if($rs7 = mysqli_fetch_array($qsql7))
{
    $DisplayForm=False;
echo "";
}
if($DisplayForm)
{
echo"<tr><td></td><td>$rs[st2]</td>";
 echo "<td>&nbsp;<b>Drug : </b>";
  if (is_numeric($rs[DRUGS]))
{
$sql1 ="SELECT * FROM medicine_stok WHERE medicine_id='$rs[DRUGS]'";
$qsql1 = mysqli_query($con,$sql1);
while($rs1 = mysqli_fetch_array($qsql1))
echo"$rs1[DRUGS_name]";
}
else
{
    echo"$rs[DRUGS]";
    }
echo" <br><b>Dose : </b>$rs[Dose]<br><b>Route : </b>$rs[Route]<br>"; echo "<b>Frequency :</b> ";
	   
switch ($rs[Frequency]) {
  case '01':
    echo "OD (Once Daily)";
    break;
      case '2':
    echo "BID/b.i.d. (twice a day)";
    break;
     case '3':
    echo "TID/t.id. (three times a day)";
    break;
     case '04':
    echo "QID/q.i.d. (four times a day)";
    break;
     case '1':
    echo "QHS (every bedtime)";
    break;
    
     case '6':
    echo "Q4h (every 4 hours)";
    break;
    
     case '4':
    echo "Q4-6h (every 4 to 6 hours)";
    break;
    
     case '1':
    echo "QWK (every week)";
    break;
    
        default:
    echo "";
} echo"";
echo"<br> Note: $rs[potential]</td>

              		 <td>
              		 <div class='btn-group'>
	  <button type='button' class='btn btn-default dropdown-toggle' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
	    Action <span class='caret'></span>
	  </button>
	  <ul class='dropdown-menu'>
	  <li><form name='status' method='post'>
	  
	  <input type='hidden' name='medicine_id' value='$rs[id]'>
	  <input type='hidden' name='timeslot' value='$rs[st2]'><input type='hidden' name='DRUGS' value='$rs[DRUGS]'>
   <button style='height:auto;width:100%; padding:10px' value='Disperse' name='status' type='submit'>  Disperse</button>
     <button style='height:auto;width:100%;padding:10px' value='Ignore' name='status' type='submit'>  Ignore</button>
       
</form>
<a href='testmedifinal.php?prescriptionid=$rs[prescriptionid]&patientid=$rs[patientid]&delid=$rs[id]' class='btn btn-primary' style='margin:10px 10px;color:#000000;'>Remove</a>
</li><li>
<a href='ordercreate.php?prescriptionid=$rs[prescriptionid]&patientid=$rs[patientid]&id=$rs[id]' data-modal='modalOne' class='btn btn-success' style='margin:10px;color:#000000;'>Create Order</a>
</li>
	    </ul>
	</div>
             </td>
              					
          </tr>                   
";
}
}



	if($rs[st3]!='')
{
$DisplayForm=True;
$sql7 ="SELECT * FROM medication_mng WHERE  prescriptionid='$_GET[prescriptionid]' AND timeslot='$rs[st3]' AND medicine_id='$rs[id]'  AND  admissiondate='$today'";
$qsql7 = mysqli_query($con,$sql7);
if($rs7 = mysqli_fetch_array($qsql7))
{
    $DisplayForm=False;
echo "";
}
if($DisplayForm)
{
echo"<tr><td></td><td>$rs[st3]</td>";
 echo "<td>&nbsp;<b>Drug : </b>";
  if (is_numeric($rs[DRUGS]))
{
$sql1 ="SELECT * FROM medicine_stok WHERE medicine_id='$rs[DRUGS]'";
$qsql1 = mysqli_query($con,$sql1);
while($rs1 = mysqli_fetch_array($qsql1))
echo"$rs1[DRUGS_name]";
}
else
{
    echo"$rs[DRUGS]";
    }
echo" <br><b>Dose : </b>$rs[Dose]<br><b>Route : </b>$rs[Route]<br>"; echo "<b>Frequency :</b> ";
	   
switch ($rs[Frequency]) {
  case '01':
    echo "OD (Once Daily)";
    break;
      case '2':
    echo "BID/b.i.d. (twice a day)";
    break;
     case '3':
    echo "TID/t.id. (three times a day)";
    break;
     case '04':
    echo "QID/q.i.d. (four times a day)";
    break;
     case '1':
    echo "QHS (every bedtime)";
    break;
    
     case '6':
    echo "Q4h (every 4 hours)";
    break;
    
     case '4':
    echo "Q4-6h (every 4 to 6 hours)";
    break;
    
     case '1':
    echo "QWK (every week)";
    break;
    
        default:
    echo "";
} echo"";
echo"<br> Note: $rs[potential]</td>

              		 <td>
              		 <div class='btn-group'>
	  <button type='button' class='btn btn-default dropdown-toggle' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
	    Action <span class='caret'></span>
	  </button>
	  <ul class='dropdown-menu'>
	  <li><form name='status' method='post'>
	  
	  <input type='hidden' name='medicine_id' value='$rs[id]'>
	  <input type='hidden' name='timeslot' value='$rs[st3]'><input type='hidden' name='DRUGS' value='$rs[DRUGS]'>
    <button style='height:auto;width:100%; padding:10px' value='Disperse' name='status' type='submit'>  Disperse</button>
     <button style='height:auto;width:100%;padding:10px' value='Ignore' name='status' type='submit'>  Ignore</button>
       
</form>
<a href='testmedifinal.php?prescriptionid=$rs[prescriptionid]&patientid=$rs[patientid]&delid=$rs[id]' class='btn btn-primary' style='margin:10px 10px;color:#000000;'>Remove</a>
</li><li>
<a href='ordercreate.php?prescriptionid=$rs[prescriptionid]&patientid=$rs[patientid]&id=$rs[id]' data-modal='modalOne' class='btn btn-success' style='margin:10px;color:#000000;'>Create Order</a>
</li>
	    </ul>
	</div>
             </td>
              					
          </tr>                   
";
}
}


	if($rs[st4]!='')
{
$DisplayForm=True;
$sql7 ="SELECT * FROM medication_mng WHERE  prescriptionid='$_GET[prescriptionid]' AND timeslot='$rs[st4]' AND medicine_id='$rs[id]' AND  admissiondate='$today'";
$qsql7 = mysqli_query($con,$sql7);
if($rs7 = mysqli_fetch_array($qsql7))
{
    $DisplayForm=False;
echo "";
}
if($DisplayForm)
{
echo"<tr><td></td><td>$rs[st4]</td>";
 echo "<td>&nbsp;<b>Drug : </b>";
  if (is_numeric($rs[DRUGS]))
{
$sql1 ="SELECT * FROM medicine_stok WHERE medicine_id='$rs[DRUGS]'";
$qsql1 = mysqli_query($con,$sql1);
while($rs1 = mysqli_fetch_array($qsql1))
echo"$rs1[DRUGS_name]";
}
else
{
    echo"$rs[DRUGS]";
    }
echo" <br><b>Dose : </b>$rs[Dose]<br><b>Route : </b>$rs[Route]<br>"; echo "<b>Frequency :</b> ";
	   
switch ($rs[Frequency]) {
  case '01':
    echo "OD (Once Daily)";
    break;
      case '2':
    echo "BID/b.i.d. (twice a day)";
    break;
     case '3':
    echo "TID/t.id. (three times a day)";
    break;
     case '04':
    echo "QID/q.i.d. (four times a day)";
    break;
     case '1':
    echo "QHS (every bedtime)";
    break;
    
     case '6':
    echo "Q4h (every 4 hours)";
    break;
    
     case '4':
    echo "Q4-6h (every 4 to 6 hours)";
    break;
    
     case '1':
    echo "QWK (every week)";
    break;
    
        default:
    echo "";
} echo"";
echo"<br> Note: $rs[potential]</td>

              		 <td>
              		 <div class='btn-group'>
	  <button type='button' class='btn btn-default dropdown-toggle' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
	    Action <span class='caret'></span>
	  </button>
	  <ul class='dropdown-menu'>
	  <li><form name='status' method='post'>
	  
	  <input type='hidden' name='medicine_id' value='$rs[id]'>
	  <input type='hidden' name='timeslot' value='$rs[st4]'><input type='hidden' name='DRUGS' value='$rs[DRUGS]'>
    <button style='height:auto;width:100%; padding:10px' value='Disperse' name='status' type='submit'>  Disperse</button>
     <button style='height:auto;width:100%;padding:10px' value='Ignore' name='status' type='submit'>  Ignore</button>
       
</form>
<a href='testmedifinal.php?prescriptionid=$rs[prescriptionid]&patientid=$rs[patientid]&delid=$rs[id]' class='btn btn-primary' style='margin:10px 10px;color:#000000;'>Remove</a>
</li><li>
<a href='ordercreate.php?prescriptionid=$rs[prescriptionid]&patientid=$rs[patientid]&id=$rs[id]' data-modal='modalOne' class='btn btn-success' style='margin:10px;color:#000000;'>Create Order</a>
</li>
	    </ul>
	</div>
             </td>
              					
          </tr>                   
";
}
}


	if($rs[st5]!='')
{
$DisplayForm=True;
$sql7 ="SELECT * FROM medication_mng WHERE  prescriptionid='$_GET[prescriptionid]' AND timeslot='$rs[st5]' AND medicine_id='$rs[id]' AND  admissiondate='$today'";
$qsql7 = mysqli_query($con,$sql7);
if($rs7 = mysqli_fetch_array($qsql7))
{
    $DisplayForm=False;
echo "";
}
if($DisplayForm)
{
echo"
<tr><td></td><td>$rs[st5]</td>";
 echo "<td>&nbsp;<b>Drug : </b>";
  if (is_numeric($rs[DRUGS]))
{
$sql1 ="SELECT * FROM medicine_stok WHERE medicine_id='$rs[DRUGS]'";
$qsql1 = mysqli_query($con,$sql1);
while($rs1 = mysqli_fetch_array($qsql1))
echo"$rs1[DRUGS_name]";
}
else
{
    echo"$rs[DRUGS]";
    }
echo" <br><b>Dose : </b>$rs[Dose]<br><b>Route : </b>$rs[Route]<br>"; echo "<b>Frequency :</b> ";
	   
switch ($rs[Frequency]) {
  case '01':
    echo "OD (Once Daily)";
    break;
      case '2':
    echo "BID/b.i.d. (twice a day)";
    break;
     case '3':
    echo "TID/t.id. (three times a day)";
    break;
     case '04':
    echo "QID/q.i.d. (four times a day)";
    break;
     case '1':
    echo "QHS (every bedtime)";
    break;
    
     case '6':
    echo "Q4h (every 4 hours)";
    break;
    
     case '4':
    echo "Q4-6h (every 4 to 6 hours)";
    break;
    
     case '1':
    echo "QWK (every week)";
    break;
    
        default:
    echo "";
} echo"";
echo"<br> Note: $rs[potential]</td>

              		 <td>
              		 <div class='btn-group'>
	  <button type='button' class='btn btn-default dropdown-toggle' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
	    Action <span class='caret'></span>
	  </button>
	  <ul class='dropdown-menu'>
	  <li><form name='status' method='post'>
	  
	  <input type='hidden' name='medicine_id' value='$rs[id]'>
	  <input type='hidden' name='timeslot' value='$rs[st5]'><input type='hidden' name='DRUGS' value='$rs[DRUGS]'>
   <button style='height:auto;width:100%; padding:10px' value='Disperse' name='status' type='submit'>  Disperse</button>
     <button style='height:auto;width:100%;padding:10px' value='Ignore' name='status' type='submit'>  Ignore</button>
       
</form>
<a href='testmedifinal.php?prescriptionid=$rs[prescriptionid]&patientid=$rs[patientid]&delid=$rs[id]' class='btn btn-primary' style='margin:10px 10px;color:#000000;'>Remove</a>
</li><li>
<a href='ordercreate.php?prescriptionid=$rs[prescriptionid]&patientid=$rs[patientid]&id=$rs[id]' data-modal='modalOne' class='btn btn-success' style='margin:10px;color:#000000;'>Create Order</a>
</li>
	    </ul>
	</div>
             </td>
              					
          </tr>         
          
          
         
";
}
}
}
?>
 </table>  

<p align="right">
      <button class="button" data-modal="modalOne"> Add Medication</button>
    </p>



 <div id="modalOne" class="modal">
      <div class="modal-content">
        <div class="contact-form">
          <a class="close">&times;</a>
                   <div style = "display:none;" id = "loaderImg"> <div class="loader"> </div> </div>

   
                   <form name="opdmedicine" method="post" id="myForm">

<label>Drug Name</label> <input onkeyup="this.value = this.value.toUpperCase();" onchange="drmdiload(this.value)"  name='DRUGS' type='text' list='DRUGS' />
<datalist name='DRUGS' id='DRUGS'>
 
				<?php
include("dbconnection.php");
require_once('../DBManager.php');
require_once('../LoginManager.php');
$narayan=LoginManager::currentUser();
$usertype=LoginManager::getUserTypeByuname("$narayan");
	$sql1 ="SELECT * FROM site_users WHERE userno='$usertype'";
		$qsql1 = mysqli_query($con,$sql1);
		if($re = mysqli_fetch_array($qsql1))
		{
$sql ="SELECT * FROM medicine_stok WHERE admin_id='$re[entered_by]'";
$qsql = mysqli_query($con,$sql);
while($rs = mysqli_fetch_array($qsql))
{
     echo " 
<option value>Select one...</option>
     <option value='$rs[medicine_id]'>$rs[DRUGS_name]-$rs[Dose]</option>
                   
          
          ";
}
}
?> 
  </datalist>	
<div id='divmedidr'>
						<label>Dose</label>
				
				<input type="text" placeholder="In mg" name="Dose" id="dose" class="form-control" />
						<label>Cotegory</label>
					<select onchange="cotegory(this.value)" class="form-control" name="Category" id="Category">
    <option value="" disabled selected>Category </option>
    <option value="Injectable">Injectable </option>
      <option value="IV Fluid">IV Fluid </option>
    <option value="Capsule">Capsule </option>
     <option value="Tablet">Tablet </option>
         <option value="Syrup">Syrup </option>
             <option value="Powder">Powder </option>
                         <option value="Ointment">Ointment</option>
                           <option value="Drop">Drop</option>
                                <option value="Solution">Solution</option>
                                    <option value="Patch">Patch</option>
    </select>
				</div>
			<label>Route</label>
				<select class="form-control" name="Route" id="Route" name="Route">
    <option value="" disabled selected>Route  </option>
    <option value="Orally">Orally</option>
    <option value="IV/IM">IV/IM</option>
    <option value="Sublingually/ Buccally">Sublingually/ Buccally</option>
    <option value="Vaginally">Vaginally</option>
    <option value="Ocular/ Otic"> Ocular/ Otic </option>
    <option value="Nasally">Nasally</option>
    <option value="Inhalation/Nebulization">Inhalation/Nebulization</option>
    <option value="cutaneously/systemic">cutaneously/systemic</option>
    <option value="transdermally">transdermally</option>
    <option value="Rectal">Rectal</option>
	</select>
				<label>	Frequency</label>
				<select class="form-control" onchange="frequency(this.value)"  name="Frequency" id="Frequency" class="form-control">
    <option value="" disabled selected>Frequency  </option>
    <option value="01">OD (Once Daily)</option>
    <option value="2">BID/b.i.d. (twice a day)</option>
    <option value="3">TID/t.id. (three times a day)</option>
    <option value="04">QID/q.i.d. (four times a day)</option>
    <option value="1"> QHS (every bedtime) </option>
    <option value="6">Q4h (every 4 hours)</option>
    <option value="4">Q4-6h (every 4 to 6 hours)</option>
    <option value="1">QWK (every week)</option>
	</select>
<div id='frequency'></div>


	    	<div>
	    <label>Duration</label>
	    <input type="number" placeholder='In Days' name="duration">
	    	</div>

	    	    <label>Note</label>
	    <input type="text" placeholder="Instruction, Potential side effects, Food Intake" name="potential">
<input type="hidden" name="status" value="Active">
<input type="hidden" name="poa" value="ipd_Medicine" >
	
       <input type="submit" value="Add" name="opdmedicine">
      </form>
         
   </div>   </div>   </div>
   <table id="example2"  id ="demo" class="table table-bordered table-hover">
<?php
			$sql ="SELECT * FROM addaspatient WHERE prescriptionid='$_GET[prescriptionid]' AND patientid='$_GET[patientid]'";
		$qsql = mysqli_query($con,$sql);
		if($rs = mysqli_fetch_array($qsql))
		{
            echo " <tbody>
                    
          
     ";
}
?>  
   </tbody>
</table> 
            <script>
      let modalBtns = [...document.querySelectorAll(".button")];
      modalBtns.forEach(function(btn) {
        btn.onclick = function() {
          let modal = btn.getAttribute('data-modal');
          document.getElementById(modal)
            .style.display = "block";
        }
      });
      let closeBtns = [...document.querySelectorAll(".close")];
      closeBtns.forEach(function(btn) {
        btn.onclick = function() {
          let modal = btn.closest('.modal');
          modal.style.display = "none";
        }
      });
      window.onclick = function(event) {
        if(event.target.className === "modal") {
          event.target.style.display = "none";
        }
      }
    </script>
    <script>
 function drmdiload(drmeid)
{
	    if (window.XMLHttpRequest) {
            // code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp = new XMLHttpRequest();
        } else {
            // code for IE6, IE5
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange = function() {
            if (this.readyState == 4 && this.status == 200) {
                document.getElementById("divmedidr").innerHTML = this.responseText;
            }
        };
        xmlhttp.open("GET","loaddrug.php?drmeid="+drmeid,true);
        xmlhttp.send();
}
          
 function frequency(frid)
{
	    if (window.XMLHttpRequest) {
            // code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp = new XMLHttpRequest();
        } else {
            // code for IE6, IE5
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange = function() {
            if (this.readyState == 4 && this.status == 200) {
                document.getElementById("frequency").innerHTML = this.responseText;
            }
        };
        xmlhttp.open("GET","loadfrequency.php?frid="+frid,true);
        xmlhttp.send();
}
             
     
</script>
  </body>
</html>



<script>
 function mobile(mbid)
{
	    if (window.XMLHttpRequest) {
            // code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp = new XMLHttpRequest();
        } else {
            // code for IE6, IE5
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange = function() {
            if (this.readyState == 4 && this.status == 200) {
                document.getElementById("divmb").innerHTML = this.responseText;
            }
        };
        xmlhttp.open("GET","loadtimeslot.php?mbid="+mbid,true);
        xmlhttp.send();
}
            
     
</script>

Anon7 - 2022
AnonSec Team