             

<div class="portlet light bordered">
  <div class="portlet-title">
    <div style="cursor:pointer;" class="caption" onclick="$('#click_show_diseases').trigger('click');">
      <i class="fa fa-bolt font-blue-hoki"></i>
      <span class="caption-subject bold font-blue-hoki"> Impressions/Diagnosis  </span>
    </div>
    <div class="tools">
      <a id="click_show_diseases" href="" class="expand" data-original-title="" title=""> </a>
    </div>
  </div>
  <div class="portlet-body" style="display: none;">

    <div class="row">
     <div class="col-md-6 ">
       <div class="portlet light bordered">
         <div class="portlet-title">
           <div class="caption">
             <div class="row">
               <div class="col-md-12">
                 <div class="col-md-7 col-sm-8">
                   <input type="text" name="searchtext_query_diagnosis" id="searchtext_query_diagnosis" onKeyUp="MainsearchItemsName('view_items_query_diagnosis','#view_items_response_query_diagnosis',this.value);" class="form-control input-circle" placeholder="Diseases">
                 </div>
                 <div class="col-md-5">
                   <select onChange="MainsearchItemsName('view_items_query_diagnosis','#view_items_response_query_diagnosis',this.value);" name="disease_grp" id="disease_grp" class="form-control col-sm-4 input-circle">
                     <option value="diseases">Disease (WHO)</option>
                     <option value="diseases_stg">Disease (STG)</option>
                     <option value="diseases_facility">Disease (FACILITY)</option>
                   </select>
                 </div>
               </div>
             </div>     
           </div>
           <div class="tools">
             <a href="" class="collapse" data-original-title="" title=""> </a>
           </div>
         </div>
         <div class="portlet-body" id="view_items_div_query_diagnosis">
           <div class="slimScrollDiv" style="height: 245px;overflow-y: scroll;overflow-x: hidden;">
             <?php include 'view_items_query_diagnosis.php'; ?>   
           </div>
         </div>
       </div>
     </div>

     <div class="col-md-6 ">
       <div class="portlet light bordered" style="min-height:94px;">
         <div class="portlet-title">
           <div class="caption">
             <i class="fa fa-bolt font-blue-hoki"></i>
             <span class="caption-subject bold font-blue-hoki"> Diseases Added </span>
           </div>
           <div class="tools">
             <a href="" class="expand" data-original-title="" title=""> </a>
           </div>
         </div>
         <div class="portlet-body" >
           <div id="claimsno_query_diagnosis" class="slimScrollDiv" style="height: 250px;overflow-y: scroll"> 
            <?php include 'view_items_claims_query_diagnosis.php'; ?>  
          </div>
        </div>
      </div>
    </div>
  </div>    

</div>
</div>


<div class="portlet light bordered hide">
  <div class="portlet-title">
    <div style="cursor:pointer;" class="caption" onclick="$('#click_show_diagnostics').trigger('click');">
      <i class="fa fa-bolt font-blue-hoki"></i>
      <span class="caption-subject bold font-blue-hoki"> Lab Requests  </span>
    </div>
    <div class="tools">
      <a id="click_show_diagnostics" href="" class="expand" data-original-title="" title=""> </a>
    </div>
  </div>
  <div class="portlet-body" style="display: none;">
   <div class="row">
    <div class="col-md-5 ">
      <div class="portlet light bordered">
        <div class="portlet-title">
          <div class="caption">
           <div class="row">
             <div class="col-md-12">
               <div class="col-md-7 col-sm-8">
                 <input type="text" name="searchtext_invoice_diagnostic" id="searchtext_invoice_diagnostic" placeholder="Search" onkeyup="MainsearchItemsName('view_items_popup_diagnostics_2','#view_items_response_diagnostic',this.value); " class="form-control input-circle">
               </div>
               <div class="col-md-5">
                 <input type="hidden" name="mode_of_payment" id="mode_of_payment" value="<?php echo $mode_of_payment; ?>"> 
                 <select name="mode_of_payment_all" id="mode_of_payment_all" class="form-control input-circle">
                  <option value="cash" <?php if($mode_of_payment=='CASH' || $mode_of_payment){echo "selected";}?>>CASH</option>
                  <?php if($mode_of_payment=='insurance'){?>
                    <option value="insurance" <?php if($mode_of_payment=='insurance'){echo "selected";}?>>INSURANCE</option>
                  <?php }?>
                  <?php if($mode_of_payment=='company'){?>
                    <option value="company" <?php if($mode_of_payment=='company'){echo "selected";}?>>COMPANY</option>
                  <?php }?>
                  <?php if($mode_of_payment=='staff'){?>
                    <option value="staff" <?php if($mode_of_payment=='staff'){echo "selected";}?>>STAFF</option>
                  <?php }?>
                </select>
              </div>
            </div>
          </div>     
        </div>
      </div>
      <div class="portlet-body" id="">
        <div class="slimScrollDiv" style="height: 200px;overflow-y: scroll;overflow-x: hidden;">
         <?php include 'view_items_diagnostics.php'; ?>                                        
       </div>
     </div>
   </div>
 </div>

 <div class="col-md-7 ">
   <div class="portlet light bordered" style="min-height:94px;">
     <div class="portlet-title">
       <div class="caption">
         <i class="fa fa-bolt font-blue-hoki"></i>
         <span class="caption-subject bold font-blue-hoki"> Labs Added </span>
       </div>
       <div class="actions">
        <div class="btn-group btn-group-devided" data-toggle="buttons">
          <label onClick="getclaimno('forward_to_lab','claimsno_diagnostic','<?php echo $process_claim_no; ?>');" class="btn  green btn-outline btn-circle btn-sm">
            <input type="radio" name="options" class="toggle" id="option2">Forward to Front Desk <i class="fa fa-forward"></i>
          </label>
        </div>
      </div>
    </div>
    <div class="portlet-body">
     <div id="claimsno_diagnostic" class="slimScrollDiv" style="height: 205px;overflow-y: scroll;overflow-x: hidden;">
       <?php include 'view_items_claims_diagnostics.php'; ?>  
     </div>
   </div>
 </div>
</div>
</div> 
</div>
<div class="modal fade" id="all_diagnostics" tabindex="-1" role="dialog" aria-hidden="true" style="float:left">
  <div class="modal-dialog modal-full" style="float:left">
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title">Lab Requests
          <span style="float: right">
            <button type="button" class="btn dark btn-outline close_modal_now" data-dismiss="modal">Close</button>
            <button type="button" class="btn green" onclick="getclaimno('diagnostic_edit_claim_details_bulk','claimsno_diagnostic');">Done</button>
          </span>
        </h4>

      </div>
      <div class="modal-body" style="float:left"> 
        <?php
        $all_labs_category = mysql_query("SELECT DISTINCT category_name FROM service_items WHERE service='laboratory' AND category_name is not null ORDER BY category_name ASC");
        while ($labs_category = mysql_fetch_assoc($all_labs_category)) {
          ?>
          <div class="wrapper">
            <ul>
              <li class='redbold1'><span class="btn green" style="display: inline-block;width: 220px;height: 30px;padding-bottom: 10px;padding-top: 5px;padding-left: 5px;padding-right: 5px;"><?php echo $labs_category['category_name']; ?></span>
                <?php
                $sub_labs = mysql_query("SELECT * FROM service_items WHERE category_name = '" . $labs_category['category_name'] . "' AND service='laboratory' ORDER BY item ASC");
                while ($sub_row = mysql_fetch_assoc($sub_labs)) {
                  ?>
                  <ul>
                    <li class="bodytxthm222">
                      <input multiple="" name="item[]" type="checkbox" id="item<?php echo $sub_row['id']; ?>" value="<?php echo $sub_row['id']; ?>"/>
                      <span style="font-weight: normal;"><?php echo $sub_row['item']; ?></span></li>
                    </ul>
                  <?php } ?>              
                </li>
              </ul>
              <br class="all_diagnostics" />
            </div>
          <?php } ?>

          <div class="wrapper">
            <ul>
              <li class='redbold1'><span class="btn green" style="display: inline-block;width: 220px;height: 30px;padding-bottom: 10px;padding-top: 5px;padding-left: 5px;padding-right: 5px;"><?php echo 'Other Diagnostics'; ?></span>
                <?php
                $sub_labs = mysql_query("SELECT * FROM service_items WHERE (category_name is null OR category_name='') AND service='laboratory' ORDER BY item ASC");
                while ($sub_row = mysql_fetch_assoc($sub_labs)) {
                  ?>
                  <ul>
                    <li class="bodytxthm222">
                      <input multiple="" name="item[]" type="checkbox" value="<?php echo $sub_row['id']; ?>"/>
                      <span style="font-weight: normal;"><?php echo $sub_row['item']; ?></span></li>
                    </ul>
                  <?php } ?>              
                </li>
              </ul>
              <br class="all_diagnostics" />
            </div>

          </div>
          <div class="modal-footer">
            <button type="button" class="btn dark btn-outline close_modal_now" data-dismiss="modal">Close</button>
            <button type="button" class="btn green" onclick="getclaimno('diagnostic_edit_claim_details_bulk','claimsno_diagnostic');">Done</button>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div class="portlet light bordered">
    <div class="portlet-title">
      <div style="cursor:pointer;" class="caption" onclick="$('#click_show_drugs').trigger('click');">
        <i class="fa fa-bolt font-blue-hoki"></i>
        <span class="caption-subject bold font-blue-hoki"> Drug Prescriptions  </span>
      </div>
      <div class="tools">
        <a id="click_show_drugs" href="" class="expand" data-original-title="" title=""> </a>
      </div>
    </div>
    <div class="portlet-body" style="display: none;">
     <div class="row">
      <div class="col-md-4 ">
        <div class="portlet light bordered">
          <div class="portlet-title">
            <div class="caption">
             <i class="fa fa-eyedropper font-blue-hoki"></i>
             <span class="caption-subject bold font-blue-hoki"> Drugs </span>
           </div>
           <div class="actions">
            <div class="portlet-input input-inline">
              <div class="input-icon right">
                <i class="icon-magnifier"></i>
                <input type="text" name="searchtext_invoice_drug" id="searchtext_invoice_drug" placeholder="Search for Drugs" onkeyup="MainsearchItemsName('view_items_popup_drug_prescriptions','#view_items_response_drug_pres',this.value); " class="form-control input-circle">
              </div>
            </div>
          </div>
        </div>
        <div class="portlet-body" id="view_items_div_symptoms">
          <div class="slimScrollDiv" style="height: 235px;overflow-y: scroll">
           <?php include 'view_items_drug_prescriptions.php'; ?>                                        
         </div>
       </div>
     </div>
   </div>



   <div class="col-md-8 ">
     <div class="portlet light bordered" style="min-height:94px;">
       <div class="portlet-title">
         <div class="caption">
           <i class="fa fa-bolt font-blue-hoki"></i>
           <span class="caption-subject bold font-blue-hoki"> Prescribed Drugs </span>
         </div>
         <div class="actions">
          <div class="btn-group btn-group-devided" data-toggle="buttons">
            <label onClick="window.open('administrative/print_drug_prescription.php?&num=<?php echo $process_claim_no; ?>', '_blank', 'toolbar=0,resizable=1,scrollbars=1,menubar=1,width=' + screen.width + ', height=' + screen.height);" class="btn green btn-outline btn-circle btn-sm active">
              <input type="radio" name="options" class="toggle" id="option1">Print Prescription <i class="fa fa-print"></i>
            </label>
                                            <!-- <label onClick="bnfpage();" class="btn green btn-outline btn-circle btn-sm active">
                                                <input type="radio" name="options" class="toggle" id="option1">Forward to Front Desk <i class="fa fa-forward"></i>
                                              </label> -->
                                            <!-- <label onClick="getclaimno('process_claim_details','claimsno_drugs_prescriptions','<?php echo $process_claim_no; ?>');" class="btn  green btn-outline btn-circle btn-sm active">
                                                <input type="radio" name="options" class="toggle" id="option2">Forward to Pharmacy <i class="fa fa-forward"></i>
                                              </label> -->
                                            </div>
                                          </div>
                                        </div>
                                        <div class="portlet-body">
                                         <div id="claimsno_drugs_prescriptions" class="slimScrollDiv" style="height: 244px;overflow-y: scroll;overflow-x: hidden;">
                                           <?php include 'view_items_claims_drugs.php'; ?>  
                                         </div>
                                       </div>
                                     </div>
                                   </div>
                                 </div> 
                               </div>
                             </div>

                             <?php
                             $optical_info = mysql_fetch_assoc(mysql_query("SELECT * FROM optical_examination WHERE process_claim_no ='$process_claim_no' LIMIT 1", $courier));
                             ?>
                             <div class="portlet light bordered <?php if($_SESSION['security']==strtolower('ophthalmologist')){ echo 'hide';} ?>">
                              <div class="portlet-title">
                                <div style="cursor:pointer;" class="caption" onclick="$('#click_show_spectacle_prescriptions').trigger('click');">
                                  <i class="fa fa-bolt font-blue-hoki"></i>
                                  <span class="caption-subject bold font-blue-hoki"> Lens Prescriptions  </span>
                                </div>
                                <div class="tools">
                                  <div class="actions">
                                    <div class="btn-group btn-group-devided" data-toggle="buttons">                             
                                      <label data-toggle="modal" href="#large_lens" onclick="getSimpleData('get_lens_prescription_2', '<?php echo $process_claim_no.'_';?>', '#lens_prescription_wrapper');" class="btn green btn-outline btn-circle btn-sm active">
                                        <input type="radio" name="options" class="toggle" id="option2"> Add Lens Prescription <i class="fa fa-plus"></i>
                                      </label>

                                      

                                      <label id="refresh_tn_lens_presc" onclick="getSimpleData('fetch_all_lens_prescription_2', '<?php echo $process_claim_no;?>', '#all_prescription_wrapper');" class="btn red btn-outline btn-circle btn-sm active">
                                        <input type="radio" name="options" class="toggle" id="option2"> Refresh <i class="fa fa-refresh"></i>
                                      </label>
                                    </div>
                                  </div>
                                </div>
                              </div>
                              <div class="portlet-body">
                               <div class="row">
                                 <div class="col-md-12 " id="all_prescription_wrapper">

                                   <?php 
                                   $optical_info_query = mysql_query("SELECT * FROM optical_examination WHERE process_claim_no ='$process_claim_no'", $courier);
                                   if(mysql_num_rows($optical_info_query) > 0){ ?>
                                    <table class="table table-bordered">
                                      <tr>
                                        <th>&nbsp;</th>
                                        <th>&nbsp;</th>
                                        <th style="text-align:center;"> Sphere </th>
                                        <th style="text-align:center;"> Cylinder </th>
                                        <th style="text-align:center;"> Axis </th>
                                        <th style="text-align:center;"> VA </th>
                                        <th style="text-align:center;"> Add </th>
                                        <th style="text-align:center;"> VA </th>
                                        <th style="text-align:center;"> PD </th>
                                        <th style="text-align:center;"> TYPE </th>
                                        <th style="text-align:center;"> LENS </th>
                                        <th colspan="2" style="text-align:center;"> </th>
                                      </tr>


                                      <tbody>
                                        <?php
                                        $i=1;
                                        while($optical_info = mysql_fetch_assoc($optical_info_query)){ ?>
                                          <tr>
                                            <td rowspan="2"><?php echo $i; ?></td>
                                            <td>RIGHT</td>
                                            <td><?php echo $optical_info['od_sphere']; ?></td>
                                            <td><?php echo $optical_info['od_cylinder']; ?></td>
                                            <td><?php echo $optical_info['od_axis']; ?></td>
                                            <td><?php echo $optical_info['od_va']; ?></td>
                                            <td><?php echo $optical_info['od_add']; ?></td>
                                            <td><?php echo $optical_info['od_va2']; ?></td>
                                            <td><?php echo $optical_info['od_pd']; ?></td>
                                            <td rowspan="2" style="text-align:center;"><?php getSightRead($process_claim_no,$optical_info['lens_id_count']); ?></td>
                                            <td rowspan="2">
                                              <div class="alert bold" id="">
                                                <span id="lens_description_wrapper"> </span>
                                                <span style="font-size:12px;font-weight:normal"> <?php
                                                $lens_addition = PatientLensAddition($process_claim_no,$optical_info['lens_id_count']);
                                                echo $patient_lens_type['lens_type']; echo ' '.$optical_info['lens_type'].' '; if(!empty($optical_info['lens_index'])){ echo '('.$optical_info['lens_index'].')';} if(!empty($lens_addition)){ ?> - Additions (<span id="lens_description_wrapper2"><?php echo $lens_addition; ?></span>) <?php } ?> </span>
                                              </div>
                                            </td>
                                            <td rowspan="2" data-toggle="modal" href="#large_lens" onclick="getSimpleData('get_lens_prescription_2', '<?php echo $process_claim_no.'_'.$optical_info['lens_id_count'] ?>', '#lens_prescription_wrapper');" style="text-align:center;"><i class="fa fa-pencil"></i></td>
                                            <td rowspan="2" onclick="if(confirm('Delete this Lens Prescription?')){getSimpleData('delete_lens_prescription', '<?php echo $process_claim_no.'_'.$optical_info['lens_id_count'] ?>', '#lens_prescription_wrapper');}" style="text-align:center;color:red;cursor:pointer"><i class="fa fa-trash"></i></td>
                                          </tr>
                                          <tr>
                                            <td>LEFT</td>
                                            <td><?php echo $optical_info['os_sphere']; ?></td>
                                            <td><?php echo $optical_info['os_cylinder']; ?></td>
                                            <td><?php echo $optical_info['os_axis']; ?></td>
                                            <td><?php echo $optical_info['os_va']; ?></td>
                                            <td><?php echo $optical_info['os_add']; ?></td>
                                            <td><?php echo $optical_info['os_va2']; ?></td>
                                            <td><?php echo $optical_info['os_pd']; ?></td>
                                          </tr>



                                          <?php $i++; } ?>
                                        </tbody>
                                      </table>
                                    <?php } ?> 







                                    <div class="portlet light bordered" style="display:none;">
                                      <div class="portlet-title">
                                        <div class="caption">
                                          <i class="fa fa-bolt font-blue-hoki"></i>
                                          <span class="caption-subject bold font-blue-hoki"> Refraction </span>
                                        </div>
                                      </div>
                                      <div class="portlet-body">
                                        <table class="table table-bordered">
                                          <thead>
                                            <tr>
                                              <th>&nbsp;</th>
                                              <th> Sphere </th>
                                              <th> Cylinder </th>
                                              <th> Axis </th>
                                              <th> VA </th>
                                              <th> Add </th>
                                              <th> VA </th>
                                              <th> PD </th>
                                              <th nowrap> OD to OS &nbsp;
                                                <label class="mt-checkbox"><input onclick="Apply_od_os();" id="apply_od_os" type="checkbox">
                                                  <span></span>
                                                </label> </th>
                                              </tr>
                                            </thead>
                                            <tbody>
                                              <tr>
                                                <td> <label> OD </label> </td> 
                                                <td> 
                                                  <select name="od_sphere" id="od_sphere" class="form-control" style="width:100px">
                                                    <option <?php if($optical_info['od_sphere']=='PLANO'){ echo 'selected=""';} ?> value='PLANO'>PLANO</option>
                                                    <?php for($i=0.25;$i<=15;$i+=0.25){ ?>
                                                      <option <?php if($optical_info['od_sphere']=='-'.number_format($i,2)){ echo 'selected=""';} ?> value="-<?php echo number_format($i,2); ?>">-<?php echo number_format($i,2); ?></option>
                                                    <?php } ?>
                                                    <?php for($i=0.25;$i<=15;$i+=0.25){ ?>
                                                      <option <?php if($optical_info['od_sphere']=='+'.number_format($i,2)){ echo 'selected=""';} ?> value="+<?php echo number_format($i,2); ?>">+<?php echo number_format($i,2); ?></option>
                                                    <?php } ?>
                                                  </select>
                                                  <!-- <input type="text" name="od_sphere" id="od_sphere" class="form-control" value="<?php echo $optical_info['od_sphere']; ?>">  -->
                                                </td> 
                                                <td> 
                                                  <select name="od_cylinder" id="od_cylinder" class="form-control" style="width:100px">
                                                    <option <?php if($optical_info['od_cylinder']==''){ echo 'selected=""';} ?> value=''>EMPTY</option>
                                                    <option <?php if($optical_info['od_cylinder']=='PLANO'){ echo 'selected=""';} ?> value='PLANO'>PLANO</option>
                                                    <?php for($i=0.25;$i<=15;$i+=0.25){ ?>
                                                      <option <?php if($optical_info['od_cylinder']=='-'.number_format($i,2)){ echo 'selected=""';} ?> value="-<?php echo number_format($i,2); ?>">-<?php echo number_format($i,2); ?></option>
                                                    <?php } ?>
                                                    <?php for($i=0.25;$i<=15;$i+=0.25){ ?>
                                                      <option <?php if($optical_info['od_cylinder']=='+'.number_format($i,2)){ echo 'selected=""';} ?> value="+<?php echo number_format($i,2); ?>">+<?php echo number_format($i,2); ?></option>
                                                    <?php } ?>
                                                  </select>
                                                  <!-- <input type="text" name="od_cylinder" id="od_cylinder" class="form-control" value="<?php echo $optical_info['od_cylinder']; ?>">  -->
                                                </td> 
                                                <td> <input type="text" name="od_axis" id="od_axis" class="form-control" value="<?php echo $optical_info['od_axis']; ?>"> </td> 
                                                <td> <input type="text" name="od_va" id="od_va" class="form-control" value="<?php echo $optical_info['od_va']; ?>"> </td> 
                                                <td> <input type="text" name="od_add" id="od_add" class="form-control" value="<?php echo $optical_info['od_add']; ?>"> </td> 
                                                <td> <input type="text" name="od_va2" id="od_va2" class="form-control" value="<?php echo $optical_info['od_va2']; ?>"> </td> 
                                                <td> <input type="text" name="od_pd" id="od_pd" class="form-control" value="<?php echo $optical_info['od_pd']; ?>"> </td> 
                                                <td></td> 
                                              </tr>
                                              <tr>
                                                <td> <label> OS </label> </td> 
                                                <td> 
                                                  <select name="os_sphere" id="os_sphere" class="form-control" style="width:100px">
                                                    <option <?php if($optical_info['os_sphere']=='PLANO'){ echo 'selected=""';} ?> value='PLANO'>PLANO</option>
                                                    <?php for($i=0.25;$i<=15;$i+=0.25){ ?>
                                                      <option <?php if($optical_info['os_sphere']=='-'.number_format($i,2)){ echo 'selected=""';} ?> value="-<?php echo number_format($i,2); ?>">-<?php echo number_format($i,2); ?></option>
                                                    <?php } ?>
                                                    <?php for($i=0.25;$i<=15;$i+=0.25){ ?>
                                                      <option <?php if($optical_info['os_sphere']=='+'.number_format($i,2)){ echo 'selected=""';} ?> value="+<?php echo number_format($i,2); ?>">+<?php echo number_format($i,2); ?></option>
                                                    <?php } ?>
                                                  </select>
                                                  <!-- <input type="text" name="os_sphere" id="os_sphere" class="form-control" value="<?php echo $optical_info['os_sphere']; ?>"> -->
                                                </td> 
                                                <td>
                                                  <select name="os_cylinder" id="os_cylinder" class="form-control" style="width:100px">
                                                    <option <?php if($optical_info['os_cylinder']==''){ echo 'selected=""';} ?> value=''>EMPTY</option>
                                                    <option <?php if($optical_info['os_cylinder']=='PLANO'){ echo 'selected=""';} ?> value='PLANO'>PLANO</option>
                                                    <?php for($i=0.25;$i<=15;$i+=0.25){ ?>
                                                      <option <?php if($optical_info['os_cylinder']=='-'.number_format($i,2)){ echo 'selected=""';} ?> value="-<?php echo number_format($i,2); ?>">-<?php echo number_format($i,2); ?></option>
                                                    <?php } ?>
                                                    <?php for($i=0.25;$i<=15;$i+=0.25){ ?>
                                                      <option <?php if($optical_info['os_cylinder']=='+'.number_format($i,2)){ echo 'selected=""';} ?> value="+<?php echo number_format($i,2); ?>">+<?php echo number_format($i,2); ?></option>
                                                    <?php } ?>
                                                  </select>
                                                  <!-- <input type="text" name="os_cylinder" id="os_cylinder" class="form-control" value="<?php echo $optical_info['os_cylinder']; ?>">  -->
                                                </td> 
                                                <td> <input type="text" name="os_axis" id="os_axis" class="form-control" value="<?php echo $optical_info['os_axis']; ?>"> </td> 
                                                <td> <input type="text" name="os_va" id="os_va" class="form-control" value="<?php echo $optical_info['os_va']; ?>"> </td> 
                                                <td> <input type="text" name="os_add" id="os_add" class="form-control" value="<?php echo $optical_info['os_add']; ?>"> </td> 
                                                <td> <input type="text" name="os_va2" id="os_va2" class="form-control" value="<?php echo $optical_info['os_va2']; ?>"> </td> 
                                                <td> <input type="text" name="os_pd" id="os_pd" class="form-control" value="<?php echo $optical_info['os_pd']; ?>"> </td> 
                                                <td></td>
                                              </tr>
                                            </tbody>
                                          </table>
                                        </div>
                                      </div>
                                    </div> 

                                    <div class="col-md-12">
                                     <div class="portlet light bordered">
                                       <div class="portlet-body form">
                                         <div class="form-body">
                                           <div class="row">
                                             <div class="col-md-12" style="display:none;">
                                               <div class="col-md-4">
                                                 <div class="row">
                                                   <div class="form-group">
                                                     <label class="bold">GLASS</label>
                                                     <div class="mt-radio-list">
                                                       <?php
                                                       $patient_lens_type = mysql_fetch_assoc(mysql_query("SELECT lens_type FROM patient_lens_type WHERE process_claim_no='$process_claim_no'"));
                                                       $glass_lens = mysql_query("SELECT * FROM lens_types WHERE parent_name='GLASS'");
                                                       while ($row = mysql_fetch_assoc($glass_lens)) {
                                                         ?>
                                                         <label class="mt-radio mt-radio-outline"> <?php echo $row['lens_name']; ?>
                                                         <input <?php if($patient_lens_type['lens_type']=='Glass - '.$row['lens_name']){ echo 'checked=""'; } ?> onchange="lensPrescriptions(this.value);" type="radio" value="Glass - <?php echo $row['lens_name']; ?>" name="lens_type">
                                                         <span></span>
                                                       </label>
                                                     <?php } ?>
                                                   </div>
                                                 </div>

                                                 <div class="form-group">
                                                   <label class="bold">PLASTIC</label>
                                                   <div class="mt-radio-list">
                                                     <?php
                                                     $plastic_lens = mysql_query("SELECT * FROM lens_types WHERE parent_name='PLASTIC'");
                                                     while ($row = mysql_fetch_assoc($plastic_lens)) {
                                                       ?>
                                                       <label class="mt-radio mt-radio-outline"> <?php echo $row['lens_name']; ?>
                                                       <input <?php if($patient_lens_type['lens_type']=='Plastic - '.$row['lens_name']){ echo 'checked=""'; } ?> onchange="lensPrescriptions(this.value);" type="radio" value="Plastic - <?php echo $row['lens_name']; ?>" name="lens_type">
                                                       <span></span>
                                                     </label>
                                                   <?php } ?>
                                                 </div>
                                               </div>


                                               <div class="form-group">
                                                 <label class="bold">SIGHT/READING</label>
                                                 <div class="mt-radio-list">
                                                   <label class="mt-radio mt-radio-outline"> FOR SIGHT
                                                     <input <?php if($patient_lens_type['sight_reading']=='SIGHT'){ echo 'checked=""'; } ?> onchange="" type="radio" value="SIGHT" name="sight_reading">
                                                     <span></span>
                                                   </label>
                                                 </div>

                                                 <div class="mt-radio-list">
                                                   <label class="mt-radio mt-radio-outline"> FOR READING
                                                     <input <?php if($patient_lens_type['sight_reading']=='READING'){ echo 'checked=""'; } ?> onchange="" type="radio" value="READING" name="sight_reading">
                                                     <span></span>
                                                   </label>
                                                 </div>

                                               </div>


                                             </div>
                                           </div>
                                           <div class="col-md-4">
                                             <div class="row">
                                               <div class="form-group">
                                                 <label class="bold">POLYCARBONATE/OTHER</label>
                                                 <div class="mt-radio-list">
                                                   <?php
                                                   $poly_lens = mysql_query("SELECT * FROM lens_types WHERE parent_name='POLYCARBONATE/OTHER'");
                                                   while ($row = mysql_fetch_assoc($poly_lens)) {
                                                     ?>
                                                     <label class="mt-radio mt-radio-outline"> <?php echo $row['lens_name']; ?>
                                                     <input <?php if($patient_lens_type['lens_type']=='Polycarbonate - '.$row['lens_name']){ echo 'checked=""'; } ?> onchange="lensPrescriptions(this.value);" type="radio" value="Polycarbonate - <?php echo $row['lens_name']; ?>" name="lens_type">
                                                     <span></span>
                                                   </label>
                                                 <?php } ?>
                                               </div>
                                             </div>
                                             <div class="form-group">
                                               <label class="bold">CONTACT LENS</label>
                                               <div class="mt-radio-list">
                                                <?php
                                                $contact_lens = mysql_query("SELECT * FROM lens_types WHERE parent_name='CONTACT LENS'");
                                                while ($row = mysql_fetch_assoc($contact_lens)) {
                                                  ?>
                                                  <label class="mt-radio mt-radio-outline"> <?php echo $row['lens_name']; ?>
                                                  <input <?php if($patient_lens_type['lens_type']=='Contact Lens - '.$row['lens_name']){ echo 'checked=""'; } ?> onchange="lensPrescriptions(this.value);" type="radio" value="Contact Lens - <?php echo $row['lens_name']; ?>" name="lens_type">
                                                  <span></span>
                                                </label>
                                              <?php } ?>
                                            </div>
                                          </div>
                                        </div>
                                      </div>

                                      <div class="col-md-4">
                                       <div class="row">
                                         <div class="form-group">
                                           <label class="bold">ADDITIONS</label>
                                           <div class="mt-checkbox-list">
                                            <?php
                                            $additons = mysql_query("SELECT * FROM lens_types WHERE parent_name='ADDITIONS'");
                                            $additons_extra = mysql_query("SELECT * FROM lens_types WHERE parent_name='EXTRA ADDITIONS'");
                                            $lens_extra = mysql_query("SELECT * FROM lens_types WHERE parent_name='EXTRA LENS'");?>
                                            <select class="form-control" name="lens_type_main" id="lens_type_main">
                                              <option value="">Select Lens Type</option>
                                              <?php while ($row = mysql_fetch_assoc($additons)) {  ?> 
                                                <option <?php if($row['lens_name']==$optical_info['lens_type']){ echo 'selected=""';} ?> value="<?php echo $row['lens_name']; ?>"><?php echo $row['lens_name']; ?></option>
                                                <!-- <label class="mt-checkbox mt-checkbox-outline"> <?php echo $row['lens_name']; ?> -->
                                                 <!-- <input <?php //checkPatientLensAddition($process_claim_no, $row['lens_name'], $id); ?> class="addition_lens" onchange="displayLensPrescription();" type="checkbox" value="<?php echo $row['lens_name']; ?>" name="lens_addition[]" multiple=""> -->
                                                 <!-- <span></span> -->
                                                 <!-- </label> -->

                                               <?php } ?>
                                             </select>
                                             <hr>
                                             <select class="form-control" name="lens_index" id="lens_index">
                                              <option value="">Select Option</option>
                                              <?php while ($row = mysql_fetch_assoc($lens_extra)) { ?>
                                                <option <?php if($row['lens_name']==$optical_info['lens_index']){ echo 'selected=""';} ?> value="<?php echo $row['lens_name']; ?>"><?php echo $row['lens_name']; ?></option>
                                              <?php } ?>
                                            </select>
                                            <hr>
                                            <?php
                                            while ($row = mysql_fetch_assoc($additons_extra)) { ?>  
                                             <label class="mt-checkbox mt-checkbox-outline"> <?php echo $row['lens_name']; ?>
                                             <input <?php checkPatientLensAddition($process_claim_no, $row['lens_name'], '1'); ?> class="addition_lens" onchange="displayLensPrescription();" type="checkbox" value="<?php echo $row['lens_name']; ?>" name="lens_addition[]" multiple="">
                                             <span></span>
                                           </label>
                                         <?php } ?>
                                       </div>
                                     </div> 
                                   </div> 
                                 </div>
                               </div>
                             </div>
                           </div>

                           <div class="row">
                            <div class="alert bold" id="" style="display:none;">
                              <span id="lens_description_wrapper"> </span>
                              <span> <?php
                              $lens_addition = PatientLensAddition($process_claim_no,'1');
                              echo $patient_lens_type['lens_type']; echo ' '. $optical_info['lens_type'].' '; if(!empty($optical_info['lens_index'])){ echo '('.$optical_info['lens_index'].')';} if(!empty($lens_addition)){ ?> - Additions (<span id="lens_description_wrapper2"><?php echo $lens_addition; ?></span>) <?php } ?> </span>
                            </div>

                            <div style="display:none;" class="portlet light bordered <?php if($_SESSION['security']==strtolower('ophthalmologist')){ echo 'hide';} ?>">
                              <div class="portlet-title">
                                <div class="caption">
                                  <i class="fa fa-bolt font-blue-hoki"></i>
                                  <span class="caption-subject bold font-blue-hoki"> Contact Lens Prescription </span>
                                </div>
                                <div class="portlet-body">
                                  <table class="table table-bordered">
                                    <thead>
                                      <tr>
                                        <th> R </th>
                                        <th> L </th>
                                        <th> Base Curve </th>
                                        <th> Diameter </th>
                                      </tr>
                                    </thead>
                                    <tbody>
                                      <tr>
                                        <td> <input type="text" name="r_eye" id="r_eye" class="form-control" value="<?php echo $optical_info['r_eye']; ?>"> </td> 
                                        <td> <input type="text" name="l_eye" id="l_eye" class="form-control" value="<?php echo $optical_info['l_eye']; ?>"> </td> 
                                        <td> <input type="text" name="base_curve" id="base_curve" class="form-control" value="<?php echo $optical_info['base_curve']; ?>"> </td> 
                                        <td> <input type="text" name="diameter" id="diameter" class="form-control" value="<?php echo $optical_info['diameter']; ?>"> </td> 
                                      </tr>
                                    </tbody>
                                  </table>
                                </div>
                              </div>
                            </div>

                            <div class="portlet light bordered">
                             <div class="portlet-title">
                               <div style="cursor:pointer;" class="caption" onclick="$('#click_show_drawing2').trigger('click');$('#paint_toggler2').trigger('click');$('#paint_toggler2').trigger('click');">
                                 <span class="caption-subject bold font-blue-hoki"> Additional Comment </span>
                               </div>
                               <div class="tools">
                                 <a id="click_show_drawing2" href="" class="collapse" data-original-title="" title=""> </a>
                               </div>
                             </div>
                             <div class="portlet-body" style="display: block;">
                               <input type="hidden" name="process_claim_no" id="process_claim_no" value="<?php echo $process_claim_no; ?>">
                               <i style="display:none;" id="paint_toggler2" onclick="$('#wPaint2').wPaint('menuOrientation', $('#wPaint2').wPaint('menuOrientation') === 'vertical' ? 'horizontal' : 'vertical');"></i>
                               <div class="row">
                                 <div class="col-md-12" style="">
                                   <div id="wPaint2" style="position:relative;height:450px; background-color:#7a7a7a; margin:0px auto 20px auto;"></div>
                                 </div>
                                 <div class="col-md-12" id="consultation_drawing_wrapper2">
                                   <div class="demo-gallery">
                                     <ul id="lightgallery2" class="list-unstyled row">
                                       <?php
                                       $all_drawings = mysql_query("SELECT * FROM consultation_drawings WHERE process_claim_no = '$process_claim_no' AND type='additional_comment' ORDER BY id ASC", $courier);
                                       $i = 1;
                                       while ($row = mysql_fetch_assoc($all_drawings)) {
                                         ?>
                                         <li class="col-xs-6 col-sm-4 col-md-3" data-responsive="consultation/<?php echo $row['drawing_name']; ?> 375, consultation/<?php echo $row['drawing_name']; ?> 480, consultation/<?php echo $row['drawing_name']; ?> 800" data-src="consultation/<?php echo $row['drawing_name']; ?>" data-sub-html="<h4>Consultation Note <?php echo $i; ?></h4><p>Attached Consultation Note</p>">
                                           <a href="">
                                             <img style="height:120px" class="img-responsive" src="consultation/<?php echo $row['drawing_name']; ?>">
                                           </a>
                                         </li>
                                         <?php
                                         $i++;
                                       }
                                       ?>
                                     </ul>
                                   </div>
                                 </div>
                                 <textarea name="additional_note_type" id="additional_note_type" class="form-control" row="3" style="height:150px;" placeholder="Additional Note"><?php echo $row_rsodest_claim_no['additional_note']; ?></textarea>
                               </div>    
                             </div>
                           </div>

<!--     <div class="col-md-4 ">
         <div class="portlet light bordered">
             <div class="portlet-title">
                 <div style="cursor:pointer;" class="caption">
                     <div class="input-icon right">
                         <i class="icon-magnifier"></i>
                         <input type="hidden" name="process_claim_no" id="process_claim_no" value="<?php echo $process_claim_no; ?>">
                         <input type="text" name="searchtext_invoice_spectacle_prescriptions" id="searchtext_invoice_spectacle_prescriptions" placeholder="Search for Lens or Frames" onkeyup="MainsearchItemsName('view_items_popup_spectacle_prescriptions','#view_items_response_spectacle_prescriptions',this.value); " class="form-control input-circle">
                     </div>
                 </div>
             </div>
             <div class="portlet-body" id="view_items_div_symptoms">
                 <div class="slimScrollDiv" style="height: 235px;overflow-y: scroll">
                     <?php // include 'view_items_spectacle_prescriptions.php'; ?>                                        
                 </div>
             </div>
         </div>
       </div>-->
<!--     <div class="col-md-8 ">
         <div class="portlet light bordered" style="min-height:94px;">
             <div class="portlet-title">
                 <div class="caption">
                     <i class="fa fa-bolt font-blue-hoki"></i>
                     <span class="caption-subject bold font-blue-hoki"> Spectacle Prescriptions </span>
                 </div>
                 <div class="actions">
                     <div class="btn-group btn-group-devided" data-toggle="buttons">
                         <label onClick="Materialize.toast('Spectacle Prescriptions Forwarded to Front Desk Successfully', 4000, 'success');" class="btn  green btn-outline btn-circle btn-sm active">
                             <input type="radio" name="options" class="toggle" id="option2">Forward to Front Desk <i class="fa fa-forward"></i>
                         </label>
                     </div>
                 </div>
             </div>
             <div class="portlet-body">
                 <div id="claimsno_spectacle_prescriptions" class="slimScrollDiv" style="height: 244px;overflow-y: scroll;overflow-x: hidden;">
                     <?php // include 'view_items_claims_spectacle_prescriptions.php'; ?>  
                 </div>
             </div>
         </div>
       </div>-->
        <!-- </div> 
</div>
</div> -->

<?php
//if($_SESSION['area_specialisation'] == 'DENTIST'){
// $servicetypee = 'Dental';   
//}
//else if($_SESSION['area_specialisation'] == 'OPTICIAN'){
$servicetypee= 'Optical';   
//}else{
// $servicetypee= 'Medical';   
//}
?>
<div class="portlet light bordered">
  <div class="portlet-title">
    <div style="cursor:pointer;" class="caption" onclick="$('#click_show_medical_procedure').trigger('click');">
      <i class="fa fa-bolt font-blue-hoki"></i>
      <span class="caption-subject bold font-blue-hoki"> <?php echo $servicetypee;?> Procedure  </span>
    </div>
    <div class="tools">
      <a id="click_show_medical_procedure" href="" class="expand" data-original-title="" title=""> </a>
    </div>
  </div>
  <div class="portlet-body" style="display: none;">
   <div class="row">
    <div class="col-md-4 ">
      <div class="portlet light bordered">
        <div class="portlet-title">
          <div class="caption">
           <span class="caption-subject bold font-blue-hoki"> Procedure </span>
         </div>
         <div class="actions">
          <div class="portlet-input input-inline">
            <div class="input-icon right">
              <i class="icon-magnifier"></i>
              <input type="hidden" name="process_claim_no" id="process_claim_no" value="<?php echo $process_claim_no;?>">
              <input type="text" name="searchtext_invoice_medical_procedure" id="searchtext_invoice_medical_procedure" placeholder="Search for Procedures" onkeyup="MainsearchItemsName('view_items_popup_medical_procedures','#view_items_response_medical_procedures',this.value); " class="form-control input-circle">
            </div>
          </div>
        </div>
      </div>
      <div class="portlet-body" id="view_items_div_symptoms">
        <div class="slimScrollDiv" style="height: 235px;overflow-y: scroll">
         <?php include 'view_items_medical_procedures.php'; ?>                                        
       </div>
     </div>
   </div>
 </div>



 <div class="col-md-8 ">
   <div class="portlet light bordered" style="min-height:94px;">
     <div class="portlet-title">
       <div class="caption">
         <i class="fa fa-bolt font-blue-hoki"></i>
         <span class="caption-subject bold font-blue-hoki"> <?php echo $servicetypee;?> Procedures </span>
       </div>
       <div class="actions">
        <div class="btn-group btn-group-devided" data-toggle="buttons">
          <label onClick="getclaimno('process_claim_details','claimsno_drugs_prescriptions','<?php echo $process_claim_no; ?>');" class="btn  green btn-outline btn-circle btn-sm active">
            <input type="radio" name="options" class="toggle" id="option2">Forward to Front Desk <i class="fa fa-forward"></i>
          </label>
        </div>
      </div>
    </div>
    <div class="portlet-body">
     <div id="claimsno_medical_procedures" class="slimScrollDiv" style="height: 244px;overflow-y: scroll;overflow-x: hidden;">
       <?php include 'view_items_claims_medical_procedure.php'; ?>  
     </div>
   </div>
 </div>
</div>
</div> 
</div>
</div>

<div class="portlet light bordered">
  <div class="portlet-title">
    <div style="cursor:pointer;" class="caption" onclick="$('#click_show_file_attachment').trigger('click');">
      <i class="fa fa-bolt font-blue-hoki"></i>
      <span class="caption-subject bold font-blue-hoki"> File Attachment </span>
    </div>
    <div class="tools">
      <a id="click_show_file_attachment" href="" class="expand" data-original-title="" title=""> </a>
    </div>
  </div>
  <div class="portlet-body" style="display: none;">
    <div class="row">
      <div class="col-md-12">
       <div class="mt-comments" style="cursor: pointer;">
        <?php
        $patient_files = mysql_query("SELECT * FROM patient_file_attachments WHERE process_claim_no = '$process_claim_no' ORDER BY id ASC");
        $count_files = mysql_num_rows($patient_files);
        if($count_files > 0){
          $total_entry = $count_files;
          $file_identifier = 1;
          while($row_files = mysql_fetch_assoc($patient_files)){
            $path_info = pathinfo($row_files['file_path']);
            $ext = $path_info['extension'];
            $valid_formats = array("jpg","png","gif","bmp","icon");
            $valid_formats2 = array("docx","doc");
            $valid_formats3 = array("xlsx","xls");
            $valid_formats4 = array("pptx");
            $valid_formats5 = array("csv");
            $valid_formats6 = array("xml");
            $valid_formats7 = array("pdf");
            $valid_formats8 = array("txt"); ?>
            <div id="file_attachment_wrapper_<?php echo $file_identifier;?>" class="mt-comment" style="background-color: #FAFAFA;border: 1px solid #eee;">    
              <div class="mt-comment-img">
                <?php
                if(in_array(strtolower($ext),$valid_formats)) { ?>
                  <img src="<?php echo $row_files['file_path'];?>" style="height: 50px;width:50px;">
                  <?php      
                }
                else if(in_array(strtolower($ext),$valid_formats2)) { ?>
                  <img src="<?php echo '../'.FOLDER_NAME;?>images/word-iconx.png" style="width: 30px;height: 30px;">
                  <?php      
                }
                else if(in_array(strtolower($ext),$valid_formats3)) { ?>
                  <img src="<?php echo '../'.FOLDER_NAME;?>images/excel-iconx.png" style="width: 30px;height: 30px;">
                  <?php      
                }
                else if(in_array(strtolower($ext),$valid_formats4)) { ?>
                  <img src="<?php echo '../'.FOLDER_NAME;?>images/pp-iconx.png" style="width: 30px;height: 30px;">
                  <?php      
                }
                else if(in_array(strtolower($ext),$valid_formats5)) { ?>
                  <img src="<?php echo '../'.FOLDER_NAME;?>images/csv-iconx.png" style="width: 30px;height: 30px;">
                  <?php      
                }
                else if(in_array(strtolower($ext),$valid_formats6)) { ?>
                  <img src="<?php echo '../'.FOLDER_NAME;?>images/xml-iconx.png" style="width: 30px;height: 30px;">
                  <?php      
                }
                else if(in_array(strtolower($ext),$valid_formats7)) { ?>
                  <img src="<?php echo '../'.FOLDER_NAME;?>images/PDFx.png" style="width: 30px;height: 30px;">
                  <?php      
                }
                else if(in_array(strtolower($ext),$valid_formats8)) { ?>
                  <img src="<?php echo '../'.FOLDER_NAME;?>images/txt-iconx.png" style="width: 30px;height: 30px;">
                  <?php      
                }else{ ?>
                 <img src="<?php echo '../'.FOLDER_NAME;?>images/file-iconx.png" style="width: 30px;height: 30px;">
                 Other File
               <?php } ?>
             </div>
             <div class="mt-comment-body">
              <div class="mt-comment-info">
                <span class="mt-comment-author"> 
                  <a href="<?php echo $row_files['file_path'];?>" target="_blank">   FILE NAME : <?php echo $row_files['filename'];?> </a>
                </span>
                <span class="mt-comment-date"> <?php echo date('jS F, Y g:ia', strtotime($row_files['date_time'])); ?> </span>
              </div>
              <div class="mt-comment-text">TAGS : <?php echo $row_files['tags'];?></div>
              <div class="mt-comment-details">
                <ul class="mt-comment-actions" style="display: block">
                 <li><a style="color:red;" onclick="DeleteFileAttachment('delete_file','file_attachment_wrapper_', '<?php echo $file_identifier;?>','<?php echo $row_files['id']; ?>')"> Delete File <i class="fa fa-remove"></i></a></li>
                 <li><a onclick="AddNewRow('attach_another_file', 'file_attachment_wrapper_', '<?php echo $file_identifier;?>','<?php echo $patient_id.'@@@'.$medical_note_id.'@@@'.$process_claim_no?>')">Attach Another File <i class="fa fa-plus-circle"></i></a></li>
               </ul>
             </div>
           </div>
         </div>
         <?php $file_identifier++;  }  
       }
       else{ 
        $total_entry = 1;
        for ($index = $count_files + 1;$index <=1;$index++) { ?>
          <div onclick="AddNewRow('attach_another_file', 'file_attachment_wrapper_', '<?php echo $index; ?>','<?php echo $patient_id . '@@@' . $medical_note_id . '@@@' . $process_claim_no; ?>');$('.hide_this_div').hide();" id="file_attachment_wrapper_<?php echo $index; ?>" class="mt-comment hide_this_div" style="background-color: #FAFAFA;border: 1px solid #eee;">
            <form name="document_form_<?php echo $index; ?>" id="document_form_<?php echo $index; ?>" method="post" enctype="multipart/form-data" action="dental/ajaximage_add_document.php">
              <div class="mt-comment-body">
                <div class="mt-comment-details" style="text-align:center;cursor: pointer;">
                  <center> <label style="font-size:15px;">CLICK TO ATTACH A FILE </label></center> <br>
                </div>
              </div>
            </form>
          </div>
        <?php } } ?>
        <input type="hidden" name="total_entry" id="total_entry" value="<?php echo $total_entry;?>">
      </div>
    </div>
  </div>
</div>
</div>


<div class="portlet light bordered">
  <div class="portlet-title">
    <div style="cursor:pointer;" class="caption" onclick="$('#click_show_appointment').trigger('click');">
      <i class="fa fa-bolt font-blue-hoki"></i>
      <span class="caption-subject bold font-blue-hoki">Patient Status & Appointment Schedule </span>
    </div>
    <div class="tools">
      <a id="click_show_appointment" href="" class="collapse" data-original-title="" title=""> </a>
    </div>
  </div>
  <div class="portlet-body" style="display: block;">
    <div class="row">  
      <div class="col-md-12 ">
        <div class="portlet light bordered" style="min-height:94px;">
          <div class="portlet-body">
            <?php 
            $patient_status = mysql_fetch_assoc(mysql_query("SELECT * FROM process_claim_no WHERE patient_id = '$id' AND process_claim_no = '$process_claim_no'", $courier));
            $scheduler = mysql_query("SELECT * FROM scheduler WHERE patient_id = '$id' AND medical_note_id = '$medical_note_id'", $courier); 
            $count_scheduler = mysql_num_rows($scheduler); ?>
            <div class="row">
              <div class="col-md-12">
                <div class="form-body">
                  <div class="row">
                    <div class="col-md-8">
                      <select onchange="Patient_Status(this.value);" class="form-control" name="patient_status" id="patient_status">
                        <option <?php if($patient_status['consulting_room_status'] == 'discharged'){echo 'selected=""';} ?> value="discharged">Complete</option>
                        <option <?php if($patient_status['consulting_room_status'] == 'discharged_review'){echo 'selected=""';} ?> value="discharged_review">Review Required</option>
                        <option <?php if($patient_status['consulting_room_status'] == 'pending_spectacles'){echo 'selected=""';} ?> value="pending_diagnostic">Other</option>
                      </select>
                    </div>
                    <div class="col-md-4">
                      <div class="col-md-12">
                        <!--<input <?php if($count_scheduler > 0){echo 'checked=""';}?> onchange='if ($("#appointment_schedule").prop("checked") == true) { $(".appointment_wrapper").show();}else {$(".appointment_wrapper").hide();}' type="checkbox" name="appointment_schedule" id="appointment_schedule"> <label for="appointment_schedule"> Schedule Appointment </label>-->
                      </div>
                    </div>
                  </div>
                  <div class="row">
                    <div class="col-md-12">
                      <div class="form-body">
                       <hr>
                       <div id="date_of_review_div" class="col-md-12 hide_all_status" style="display:none">
                         <input value="<?php echo $patient_status['review_date'];?>" type="text" name="date_of_review_death" id="date_of_review_death" class="form-control date_time_picker" placeholder="Enter Date of Review">
                       </div>
                       <div class="row hide_all_status" id="transfered_div" style="display:none">
                         <hr>
                         <div class="col-md-12" id="searchfield">
                           <input value="<?php echo $patient_status['referred_hospital'];?>" type="text" name="referred_hospital_doctor" id="referred_hospital_doctor" class="form-control" placeholder="Please Enter Name of Hospital Or Doctor Referred to.">
                         </div>
                       </div>
                       <div class="row hide_all_status" id="reason_for_detention_div" style="display: none">
                         <hr>
                         <div class="col-md-12">
                          <textarea type="text" name="reason_for_detention" id="reason_for_detention" rows="3" class="form-control" placeholder="Please Enter Your Reason for Detention. If Any."><?php echo $patient_status['reason_for_detention']?></textarea>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div class="appointment_wrapper" <?php if($count_scheduler < 1){ ?> style="display: none;" <?php } ?>>
                <hr>
                <div id="clash_appointment_div">
                 <?php
                 if($count_scheduler > 0){
                   $row = mysql_fetch_assoc($scheduler); ?>            
                   <div class="alert alert-info alert-dismissable" style="border-radius: 0px">
                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button>
                    <span style="font-weight: normal;">This Consultation was Scheduled for an Appointment On <b><?php echo date('l, jS F Y @ g:ia', strtotime($row['start_date'].' '.$row['start_time']));?></b>.</span> <span id="strong_show" style="cursor: pointer;" onclick="$('#clash_appointment_wrapper_2').slideToggle(function(){if($(this).is(':hidden')) {$('#strong_show').text('See More');}else{$('#strong_show').text('See Less');}});">See More</span>
                  </div>
                <?php } ?>       
              </div>
              <div class="appointment_wrapper" id="clash_appointment_wrapper_2" style="display: none;">
                <div class="form-body hide_all" id="event_title_wrapper">
                  <div class="row">
                    <div class="col-md-12">
                      <input value="<?php echo $row['title'];?>" type="text" name="event_title" id="event_title" class="form-control" placeholder="Appointment Title">
                    </div>
                  </div>
                </div>
                <hr>

                <div class="form-body">
                  <div class="row">
                    <div class="col-md-6">
                      <input value="<?php if(!empty($row['start_date'])){echo $row['start_date'];}?>" onchange="$('#schedule_end_date').val(this.value);" type="text" name="schedule_start_date" id="schedule_start_date" class="form-control date_time_picker" placeholder="Start Date">
                    </div>
                    <div class="col-md-6">
                      <input value="<?php if(!empty($row['start_time'])){echo date('g:ia',  strtotime($row['start_time']));}?>" type="text" name="start_time_picker" id="start_time_picker" class="form-control time_picker" placeholder="Start Time">
                    </div>
                  </div>
                </div> 
                <hr>
                <div class="form-body">
                  <div class="row">
                    <div class="col-md-6">
                      <input value="<?php if(!empty($row['end_date'])){echo $row['end_date'];}?>" readonly="" onchange="$('#date_time_picker').val(this.value);" type="text" name="schedule_end_date" id="schedule_end_date" class="form-control" placeholder="End Date">
                    </div>
                    <div class="col-md-6">
                      <input value="<?php if(!empty($row['end_time'])){echo date('g:ia',  strtotime($row['end_time']));}?>" type="text" name="end_time_picker" id="end_time_picker" class="form-control time_picker" placeholder="End Time">
                    </div>
                  </div>
                </div>
                <hr>
                <div class="form-body">
                  <div class="row">
                    <div class="col-md-12">
                      <textarea name="description" id="description" class="form-control" placeholder="Description"><?php echo $row['description'];?></textarea>
                    </div>
                    <hr>
                    <div class="col-md-12 hide_all patient_wrapper" style="display: block;">
                      <input type="checkbox" name="send_sms" id="send_sms"> <label for="send_sms"> <i class="icon-envelope"></i> Send SMS Notification </label>
                    </div>
                  </div>
                </div>

              </div>
            </div>
          </div>

        </div>

      </div>
    </div>
  </div>
  <center><button id="save_patient_consultation" onclick="save_consultation('save_patient_consultation','<?php echo $patient_no."@@@".$id;?>','1','clash_appointment_div','<?php echo $medical_note_id ?>');return false;" class="btn btn green"> Save Consultation <i class="icon-ok"></i></button></center>
</div>
</div>
</div>


<div class="modal fade bs-modal-lg" id="large_lens" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog modal-lg">
    <div class="modal-content" id="lens_prescription_wrapper">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
      </div>
      <div class="modal-body"> </div>
    </div>
  </div>
</div>




