Files
simrs-jatim/tindakan_ranap.php
2024-04-19 14:04:41 +07:00

41 lines
1.5 KiB
PHP

<?php
include 'core/main.php';
include 'include/function.php';
?>
<script>
jQuery(document).ready(function(){
jQuery('.add').click(function(){
var kode = jQuery(this).attr('id');
var dokter = jQuery('#dokter_'+kode).val();
var ruang = jQuery('#noruang').val();
jQuery.post('<?php echo _BASE_;?>cart_ranap_savetmp.php',{kode:kode,dokter:dokter,ruang:ruang},function(data){
jQuery('#cart_tindakan').load('<?php echo _BASE_;?>cart_ranap_loadtmp.php');
});
});
});
</script>
<?php
if($_REQUEST['loadtindakan_ranap'] == 'true'){
echo $sql = 'select * from m_tarif2012 where kelas = "'.$_REQUEST['kelas'].'"';
$sql = $db->query($sql);
if($sql->numRows() > 0){
echo '<table width="400px">';
echo '<tr><th>Nama Tindakan</th><th>Tarif</th><th>Dokter</th><th>Aksi</th></tr>';
foreach($sql->fetchAll() as $data){
$j = str_replace('.','_',$data['kode_tindakan']);
echo '<tr><td>'.$data['nama_tindakan'].'</td><td>'.format_uang($data['tarif']).'</td><td>';
$sqld = $db->query('select a.*, b.NAMADOKTER from m_dokter_pengganti a join m_dokter b on b.KDDOKTER = a.kddokter');
if($sqld->numRows() > 0){
echo '<select name="dokter[]" class="dokter text" id="dokter_'.$j.'">';
foreach($sqld->fetchAll() as $d){
echo '<option value="'.$d['kddokter'].'">'.$d['NAMADOKTER'].'</option>';
}
echo '</select>';
}
echo '</td><td><input type="button" name="add" value="add" class="text add" id="'.$j.'"></td></tr>';
}
echo '</table>';
}
}
?>