Editing: lab_request-old.php
Kembali
<?php include 'includes/session.php'; ?> <?php include 'includes/header.php'; $range_to = date('m/d/Y'); $range_from = date('m/d/Y', strtotime('-30 day', strtotime($range_to))); $userid=$_SESSION["userID"]; $id_login= $_SESSION["uc"]; ?> <body class="hold-transition skin-blue sidebar-mini"> <div class="wrapper"> <?php include 'includes/navbar.php'; ?> <?php include 'includes/menubar.php'; ?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Lab. Test </h1> <ol class="breadcrumb"> <li><a href="home.php"><i class="fa fa-dashboard"></i> Home</a></li> <li class="active">Lab. Test</li> </ol> </section> <!-- Main content --> <section class="content"> <?php if(isset($_SESSION['error'])){ echo " <div class='alert alert-danger alert-dismissible'> <button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button> <h4><i class='icon fa fa-warning'></i> Error!</h4> ".$_SESSION['error']." </div> "; unset($_SESSION['error']); } if(isset($_SESSION['success'])){ echo " <div class='alert alert-success alert-dismissible'> <button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button> <h4><i class='icon fa fa-check'></i> Success!</h4> ".$_SESSION['success']." </div> "; unset($_SESSION['success']); } ?> <div class="row"> <div class="box"> <form method="POST" class="form-inline" id="listlabtest" target="_blank"> <table><tr> <td> <input type="text" class="form-control pull-right col-sm-8" id="idf" name="idf" placeholder="Type Test Lab Name Here"> </td> <td> <input type="text" class="form-control pull-right col-sm-8" id="reservation" name="date_range" value="<?php echo (isset($_GET['range'])) ? $_GET['range'] : $range_from.' - '.$range_to; ?>"> </td> <td><button type="button" class="btn btn-primary btn-sm btn-flat" id="printlab_request"><span class="glyphicon glyphicon-print"></span> Print</button> </td> </tr></table> </form> <div class="table-wrapper"> <table id="example1" class="fl-table"> <thead> <tr > <th width="17" class="hidden"></th> <th width="60"><strong>Tools</strong></th> <th width="60"><strong>Request No.</strong></th> <th width="47"><strong>ID Patient</strong></th> <th width="84"><strong>ID Doctor/Staff</strong></th> <th width="23"><strong>BX</th> <th width="63"><strong>Date Of Request</strong></th> <th width="43"><strong>Date Of Test</strong></th> <th width="33"><strong>Lab No.</strong></th> <th width="56"><strong>Urgency</strong></th> <th width="60" ><strong>Test Request</strong></th> <th width="51" ><strong>Test</strong></th> <th width="43" ><strong>Result</strong></th> <th width="4" ><strong>Other Test</strong></th> <th width="44" ><strong>Other Result</strong></th> <?php $queryw = " Select distinct *, p1.F_Name as n1,p1.L_Name as n2,dc.F_Name as dn1, dc.L_Name as dn2, ms.F_Name as ms1, ms.L_Name as ms2 From consultation AS T1 Left Join list_add_test AS T2 ON T1.Nom1 = T2.nor Left Join lab_test AS T3 ON T1.Nom1 = T3.nor Left Join doctor AS dc ON dc.SSN = T3.t_ssn Left Join patient AS p1 ON p1.SSN = T1.Patient_SSN Left Join medical_staff AS ms ON ms.SSN = T3.t_ssn where T1.Treatments = 'Lab Test' AND r_labtest <> 'Sim' group by T1.Nom1"; $resultw = $conn->query($queryw); $i=0; while($row = $resultw->fetch_assoc()){ $i++; if (!empty($row['dn1'])){ $dcname = $row['t_ssn']."<br>".$row['dn1']." ".$row['dn2']; }else{ $dcname = $row['t_ssn']."<br>".$row['ms1']." ".$row['ms2']; } ?> <tr> <td> <? if (!empty($row['Date_Of_Test'])){ echo " <button style='width:80px' class='btn btn-success btn-sm edit btn-flat' data-id='".$row['Nom1']."'><i class='fa fa-edit'></i> Edit</button><br><button style='width:80px' class='btn btn-success btn-sm addtest btn-flat' data-id='".$row['Nom1']."'><i class='fa fa-edit'></i> Add </button><br> <button style='width:80px' class='btn btn-danger btn-sm delete btn-flat' data-id='".$row['Nom1']."'><i class='fa fa-trash'></i> Delete</button><br> <button style='width:80px' class='btn btn-primary btn-sm print btn-flat' data-id='".$row['Nom1']."'><span class='glyphicon glyphicon-print'></i> Print</button><br> "; }else if (empty($row[5])){ echo "<button style='width:80px' class='btn btn-success btn-sm addnew btn-flat' data-id='".$row['Nom1']."'><i class='fa fa-edit'></i> New</button><br>"; }; ?> </td> <td><?php echo $row['Nom1'] ?> </td> <td><?php echo $row['Patient_SSN']."<br>".$row['n1']." ".$row['n2'] ?></td> <td><?php echo $dcname ?></td> <td><?php echo $row['bx'] ?></td> <td><?php echo $row['Date_Time'] ?></td> <td><?php echo $row['Date_Of_Test'] ?></td> <td><?php echo $row['lab_no'] ?></td> <td><?php echo $row['urgency'] ?></td> <td><?php echo $row['Findings'] ?></td> <td colspan="4"> <table border="0"> <thead> <td width="17"> <tr> <? $querycd = "select * from list_add_test where nor=".$row['Nom1']; $resultcd = $conn->query($querycd); while($rowcd = $resultcd->fetch_array()){ ?> <td ><?php echo $rowcd[2] ?></td> <td width="35" ><?php echo $rowcd[3] ?></td> <td width="23" ><?php echo $rowcd[4] ?></td> <td width="62" ><?php echo $rowcd[5] ?></td> </tr> <?php } ?> </table> </tr> <?php } ?> </table> </div> </div> </div> </section> </div> <?php include 'includes/footer.php'; ?> <?php include 'includes/lab_request_modal.php'; ?> </div> <?php include 'includes/scripts.php'; ?> <script> $(function(){ $('.addnew').click(function(e){ e.preventDefault(); $('#addnew').modal('show'); var id = $(this).data('id'); getRowAddtest(id); }); $('.edit').click(function(e){ e.preventDefault(); $('#edit').modal('show'); var id = $(this).data('id'); getRowAddtest(id); }); $('.delete').click(function(e){ e.preventDefault(); $('#delete').modal('show'); getRowAddtest(id); }); $('.addtest').click(function(e){ e.preventDefault(); $('#addtest').modal('show'); var id = $(this).data('id'); getRowAddtest(id); }); $('.print').click(function(e){ e.preventDefault(); $('#print').modal('show'); var id = $(this).data('id'); window.open('printlabtest.php?ids='+ id); }); $('#printlab_request').click(function(e){ e.preventDefault(); var id = document.getElementById('idf').value; var ir = document.getElementById('reservation').value; $('#listlabtest').attr('action', 'listlabtest_generate.php?ids='+ id + '&date_range=' + ir); $('#listlabtest').submit(); }); }); function getRowAddtest(id){ $.ajax({ type: 'POST', url: 'lab_addtest_row.php', data: {id:id}, dataType: 'json', success: function(response){ $('#posadd').val(response.Nom1); $('#posnew').val(response.Nom1); $('#posid').val(response.Nom1); $('#lssn').val(response.Patient_SSN); $('#lssn2').val(response.Patient_SSN); $('#tssn').val(response.Doctor_SSN); $('#tssn2').val(response.Doctor_SSN); $('#bx').val(response.bx); $('#del1').val(response.nor); $('#datepicker_add').val(response.Date_Of_Test); $('#labno1').val(response.lab_no); $('#urgency1').val(response.urgency); $('#reqphi').val(response.request_physician); } }); } </script> <?php include 'includes/datatable_initializer.php'; ?> </body> </html>
SIMPAN PERUBAHAN