Editing: report_tbc_request.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> TBC Test</h1> <ol class="breadcrumb"> <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li> <li class="active">TBC 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="col-xs-12"> <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 TBC Test Name/ID 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><strong>No.</strong></th> <th><strong>Request No.</strong></th> <th><strong>ID Patient</strong></th> <th><strong>ID Doctor/Staff</strong></th> <th><strong>Date Of Request</strong></th> <th><strong>Date Of Test</strong></th> <th><strong>Request Test</strong></th> <th><strong>Aldeia</strong></th> <th><strong>Chefe Familia</strong></th> <th><strong>Status HIV</strong></th> <th><strong>Status TBC</strong></th> <th><strong></strong></th> </tr> </thead> <tbody> <?php $queryw = " Select distinct *,p1.F_name as n1,p1.L_Name as n2, dc.F_Name as d1, dc.L_Name as d2,ms.F_Name as m1, ms.L_Name as m2 From consultation AS T1 Left Join tbc_test AS T2 ON T2.nor = T1.Nom1 left Join patient AS p1 ON p1.SSN = T2.l_ssn Left Join doctor AS dc ON dc.SSN = T2.t_ssn Left Join medical_staff AS ms ON ms.SSN = T2.t_ssn where T1.Treatments = 'TBC'"; $resultw = $conn->query($queryw); $i=0; while($row = $resultw->fetch_assoc()){ $i++; if (!empty($row['d1'])){ $dcname = $row['d1']." ".$row['d2']; }else{ $dcname = $row['m1']." ".$row['m2']; } echo " <tr> <td>".$i."</td> <td>".$row['Nom1']."</td> <td>".$row['Patient_SSN']." <br> ".$row['n1']." ".$row['n2']."</td> <td>".$row['t_ssn']." <br> ".$dcname."</td> <td>".$row['Date_Time']."</td> <td>".$row['Date_Of_Test']."</td> <td>".$row['Findings']."</td> <td >".$row['aldeia']."</td> <td >".$row['chefefamilia']."</td><td >"; if ($row['statushiv'] == 1){ echo "Positivo"; } if ($row['statushiv'] == 2){ echo "Negaivo"; } if ($row['statushiv'] == 3){ echo "La hatene"; } echo "</td><td>"; if ($row['pg11'] == 'on'){ echo "Iha"; } if ($row['pg11'] == ''){ echo "La iha"; } echo "</td><td>"; if (!empty($row['Date_Of_Test'])){ echo "<button class='btn btn-primary btn-sm print btn-flat' data-id='".$row['Nom1']."'><span class='glyphicon glyphicon-print'></i> Print</button>"; }} ?> </td> </tr> </tbody> <thead> </table> </div> </div> </div> </section> </div> <?php include 'includes/footer.php'; ?> <?php include 'includes/tbc_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'); getRowAddPat(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('printtbc.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', 'listtbctest_generate.php?ids='+ id + '&date_range=' + ir); $('#listlabtest').submit(); }); }); function getRowAddtest(id){ $.ajax({ type: 'POST', url: 'lab_tbc_row.php', data: {id:id}, dataType: 'json', success: function(response){ $('#posadd').val(response.Nom1); $('#posnew').val(response.Nom1); $('#posid').val(response.Nom1); $('#del1').val(response.Nom1); $('#lssn1').val(response.l_ssn); $('#tssn1').val(response.t_ssn); $('#datepicker_add').val(response.Date_Of_Test); $('#aldeia2').val(response.aldeia); $('#chefefamilia2').val(response.chefefamilia); $('#aspasien2').val(response.aspasien); $('#todan2').val(response.todan); $('#bmi2').val(response.bmi); $('#durasaunhela2').val(response.durasaunhela); $('#vitalila2').val(response.vitalila); $('#morasuluk2').val(response.morasuluk); $('#aimoruk2').val(response.aimoruk); $('#statushiv2').val(response.statushiv); $('#vasinabcg22').val(response.vasinabcg); } }); } function getRowAddPat(id){ $.ajax({ type: 'POST', url: 'lab_tbc_add_row.php', data: {id:id}, dataType: 'json', success: function(response){ $('#posdel').val(response.Nom1); $('#posnew').val(response.Nom1); } }); } </script> <?php include 'includes/datatable_initializer.php'; ?> </body> </html>
SIMPAN PERUBAHAN