517 lines
23 KiB
PHP
517 lines
23 KiB
PHP
@extends('base.layout')
|
|
|
|
@section('content')
|
|
<div class="wrapper">
|
|
<div class="container-fluid">
|
|
<!-- end page title end breadcrumb -->
|
|
<div class="row">
|
|
<div class="col-lg-6">
|
|
<div class="card-box ribbon-box">
|
|
<div class="ribbon ribbon-primary">Pick Report Range</div>
|
|
<p class="m-b-0"></p>
|
|
<div class="form-row">
|
|
<div class="form-group col-md-3">
|
|
<select class="form-control" id="bulan" name="bulan">
|
|
<option value="ALL">Setahun</option>
|
|
<option value="01">Januari</option>
|
|
<option value="02">Februari</option>
|
|
<option value="03">Maret</option>
|
|
<option value="04">April</option>
|
|
<option value="05">Mei</option>
|
|
<option value="06">Juni</option>
|
|
<option value="07">Juli</option>
|
|
<option value="08">Agustus</option>
|
|
<option value="09">September</option>
|
|
<option value="10">Oktober</option>
|
|
<option value="11">November</option>
|
|
<option value="12">Desember</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group col-md-3">
|
|
<input type="text" name="tahun" id="tahun" class="form-control" value="{{ date('Y')}}">
|
|
</div>
|
|
<div class="form-group col-md-3">
|
|
<button type="button" class="btn btn-primary" id="btnReport">Detail</button>
|
|
</div>
|
|
<div class="form-group col-md-3">
|
|
<button type="button" class="btn btn-warning btn-block" id="btnrekap">Rekap Antibiotik</button>
|
|
<button type="button" class="btn btn-info btn-block" id="btnrekapglassreport">Rekap Glass Report</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-lg-6">
|
|
<div class="card-box ribbon-box">
|
|
<div class="ribbon ribbon-info">Pick Date Report</div>
|
|
<p class="m-b-0"></p>
|
|
<div class="form-row">
|
|
<div class="form-group col-md-3">
|
|
<input type="text" name="tanggal" id="tanggal" class="form-control">
|
|
</div>
|
|
<div class="form-group col-md-3">
|
|
<button type="button" class="btn btn-info" id="btndatereport">Show</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="divlaporan">
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<div class="card-box table-responsive">
|
|
<h4 class="m-t-0 header-title">Result</h4>
|
|
<button type="button" id="downexcell" class="btn btn-custom waves-light waves-effect">Export to Excell</button>
|
|
<div id="result"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="divlaporanharian">
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<div class="card-box table-responsive">
|
|
<h4 class="m-t-0 header-title">Result</h4>
|
|
<button type="button" id="downexcellharian" class="btn btn-custom waves-light waves-effect">Export to Excell</button>
|
|
<div id="resultharian"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div> <!-- end container -->
|
|
</div>
|
|
<div id="tempatctk" style="overflow: hidden; display: none;">
|
|
<div id="tabel_cetak"></div>
|
|
</div>
|
|
<input type="hidden" name="_token" id="token" value="{{ csrf_token() }}">
|
|
@endsection
|
|
|
|
@push('script')
|
|
<script type="text/javascript">
|
|
$(document).ready(function () {
|
|
$('#divlaporan').hide();
|
|
$('#divlaporanharian').hide();
|
|
$("#tanggal").datepicker({format: 'yyyy-mm-dd'});
|
|
$('#btnReport').click(function () {
|
|
var bulan = document.getElementById('bulan').value;
|
|
var tahun = document.getElementById('tahun').value;
|
|
var token = document.getElementById('token').value;
|
|
var source = {
|
|
datatype: "json",
|
|
datafields: [
|
|
{ name: 'id',type: 'text'},
|
|
{ name: 'nofoto',type: 'text'},
|
|
{ name: 'noregister',type: 'text'},
|
|
{ name: 'nmpasien',type: 'text'},
|
|
{ name: 'usia',type: 'text'},
|
|
{ name: 'l',type: 'text'},
|
|
{ name: 'p', type: 'text'},
|
|
{ name: 'jenis',type: 'text'},
|
|
{ name: 'ruangan',type: 'text'},
|
|
{ name: 'kesimpulan', type: 'text'},
|
|
{ name: 'poli', type: 'text'},
|
|
{ name: 'jkn', type: 'text'},
|
|
{ name: 'umm', type: 'text'},
|
|
{ name: 'swasta', type: 'text'},
|
|
{ name: 'gcu', type: 'text'},
|
|
{ name: 'tag', type: 'text'},
|
|
{ name: 'swasta', type: 'text'},
|
|
{ name: 'billing', type: 'text'},
|
|
{ name: 'ele', type: 'text'},
|
|
{ name: 'cito', type: 'text'},
|
|
{ name: 'daftar', type: 'text'},
|
|
{ name: 'foto',type: 'text'},
|
|
{ name: 'baca',type: 'text'},
|
|
{ name: 'export',type: 'text'},
|
|
{ name: 'created_at',type: 'text'},
|
|
{ name: 'nmdokter',type: 'text'},
|
|
{ name: 'nmppdssenior',type: 'text'},
|
|
{ name: 'nmmiddleppds',type: 'text'},
|
|
{ name: 'nmppdsjunior',type: 'text'},
|
|
{ name: 'nmppdsmiddle2',type: 'text'},
|
|
{ name: 'nmppdsjunior2',type: 'text'},
|
|
{ name: 'diagnosa2',type: 'text'},
|
|
{ name: 'modality',type: 'text'},
|
|
{ name: 'dlp',type: 'text'},
|
|
{ name: 'nm_spesimen',type: 'text'},
|
|
{ name: 'kd_spesimen',type: 'text'},
|
|
{ name: 'asalpasien',type: 'text'},
|
|
{ name: 'status',type: 'text'},
|
|
{ name: 'nmrs',type: 'text'},
|
|
{ name: 'berat',type: 'text'},
|
|
{ name: 'klinisi',type: 'text'},
|
|
{ name: 'klinis',type: 'text'},
|
|
{ name: 'tlppasien',type: 'text'},
|
|
{ name: 'nmanalis',type: 'text'},
|
|
{ name: 'verifikasi',type: 'text'},
|
|
{ name: 'noloket',type: 'text'},
|
|
{ name: 'jumlah',type: 'text'},
|
|
{ name: 'nmdrafter',type: 'text'},
|
|
{ name: 'tgldraft',type: 'text'},
|
|
{ name: 'nmpembaca',type: 'text'},
|
|
{ name: 'tgladendum',type: 'text'},
|
|
{ name: 'nmadendum',type: 'text'},
|
|
{ name: 'filefoto',type: 'text'},
|
|
{ name: 'durasi', type: 'text'},
|
|
],
|
|
updaterow : function (rowid, rowdata, commit) {commit(true);},
|
|
type : 'POST',
|
|
data : {bulan: bulan, tahun: tahun, _token: token },
|
|
url : '{{ route("reportPeriksa") }}',
|
|
};
|
|
var dataAdapter = new $.jqx.dataAdapter(source);
|
|
$('#divlaporan').show();
|
|
$('#divlaporanharian').hide();
|
|
$("#result").jqxGrid({
|
|
width : '100%',
|
|
enablebrowserselection : true,
|
|
filterable : true,
|
|
autoheight : true,
|
|
showfilterrow : true,
|
|
altrows : true,
|
|
source : dataAdapter,
|
|
pageable : true,
|
|
theme : "energyblue",
|
|
columnsresize : true,
|
|
selectionmode : 'multiplecellsextended',
|
|
columns : [
|
|
{ text: 'File Report', editable: false, sortable: false, filterable: false, datafield: 'filefoto', width: 80, cellsalign: 'left', align: 'center' },
|
|
{ text: 'No.Loket', datafield: 'noloket', width: 80, cellsalign: 'left', align: 'center' },
|
|
{ text: 'No.RM', datafield: 'noregister', width: 70, align: 'center', cellsalign: 'left'},
|
|
{ text: 'Nama', datafield: 'nmpasien', width: 160, cellsalign: 'left', align: 'center' },
|
|
{ text: 'No.HP', datafield: 'tlppasien', width: 100, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Umur', datafield: 'usia', width: 70, cellsalign: 'left', align: 'center' },
|
|
{ text: 'M', editable: false, sortable: false, filterable: false, datafield: 'l', width: 20, cellsalign: 'left', align: 'center' },
|
|
{ text: 'F', editable: false, sortable: false, filterable: false, datafield: 'p', width: 20, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Order', editable: false, sortable: false, filterable: false, datafield: 'jenis', width: 80, cellsalign: 'left', align: 'center' },
|
|
{ text: 'JKN', editable: false, sortable: false, filterable: false, columngroup: 'asuransi', datafield: 'jkn', width: 40, cellsalign: 'left', align: 'center' },
|
|
{ text: 'UMM', editable: false, sortable: false, filterable: false, columngroup: 'asuransi', datafield: 'umm', width: 40, cellsalign: 'left', align: 'center' },
|
|
{ text: 'TAG', editable: false, sortable: false, filterable: false, columngroup: 'asuransi', datafield: 'tag', width: 40, cellsalign: 'left', align: 'center' },
|
|
{ text: 'GCU', editable: false, sortable: false, filterable: false, columngroup: 'asuransi', datafield: 'gcu', width: 40, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Billing', editable: false, sortable: false, filterable: false, columngroup: 'asuransi', datafield: 'billing', width: 40, cellsalign: 'left', align: 'center' },
|
|
{ text: 'SWASTA', editable: false, sortable: false, filterable: false, columngroup: 'asuransi', datafield: 'swasta', width: 40, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Elective', editable: false, sortable: false, filterable: false, columngroup: 'urgensi', datafield: 'ele', width: 40, cellsalign: 'left', align: 'center' },
|
|
{ text: 'CITO', editable: false, sortable: false, filterable: false, columngroup: 'urgensi', datafield: 'cito', width: 40, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Sample Masuk', columngroup: 'waktu', datafield: 'daftar', width: 160, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Draft By', columngroup: 'waktu', datafield: 'nmdrafter', width: 150, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Tgl. Draft', columngroup: 'waktu', datafield: 'tgldraft', width: 80, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Expertise By', columngroup: 'waktu', datafield: 'nmpembaca', width: 150, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Supervisor', columngroup: 'waktu', datafield: 'nmdokter', width: 150, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Verifikasi', columngroup: 'waktu', datafield: 'verifikasi', width: 80, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Cetak', columngroup: 'waktu', datafield: 'export', width: 80, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Asal Pasien', datafield: 'asalpasien', width: 100, cellsalign: 'left', align: 'center'},
|
|
{ text: 'Asal RS', datafield: 'nmrs', width: 100, cellsalign: 'left', align: 'center'},
|
|
{ text: 'Klinisi', datafield: 'klinisi', width: 150, cellsalign: 'left', align: 'center'},
|
|
{ text: 'Klinis', datafield: 'klinis', width: 150, cellsalign: 'left', align: 'center'},
|
|
{ text: 'Analis', datafield: 'nmanalis', width: 150, cellsalign: 'left', align: 'center'},
|
|
{ text: 'PPDS', datafield: 'nmppdssenior', width: 150, cellsalign: 'left', align: 'center'},
|
|
{ text: 'Device', datafield: 'modality', width: 150, cellsalign: 'left', align: 'center'},
|
|
{ text: 'Code', datafield: 'kd_spesimen', width: 150, cellsalign: 'left', align: 'center'},
|
|
{ text: 'Speciment', datafield: 'nm_spesimen', width: 150, cellsalign: 'left', align: 'center'},
|
|
{ text: 'Template', datafield: 'dlp', width: 150, cellsalign: 'left', align: 'center'},
|
|
{ text: 'Duration', editable: false, sortable: false, filterable: false, datafield: 'durasi', width: 100, cellsalign: 'left', align: 'center'},
|
|
],
|
|
columngroups:
|
|
[
|
|
{ text: 'Riwayat Tindakan', align: 'center', name: 'waktu' },
|
|
{ text: 'Urgensi', align: 'center', name: 'urgensi' },
|
|
{ text: 'Insurance', align: 'center', name: 'asuransi' }
|
|
]
|
|
});
|
|
});
|
|
$('#btnrekap').click(function () {
|
|
var bulan = document.getElementById('bulan').value;
|
|
var tahun = document.getElementById('tahun').value;
|
|
var url = '{{url('/')}}/rekapantibiotik?bulan='+bulan+'?tahun='+tahun;
|
|
window.location.href = url;
|
|
});
|
|
$('#btnrekapglassreport').click(function () {
|
|
var bulan = document.getElementById('bulan').value;
|
|
var tahun = document.getElementById('tahun').value;
|
|
var url = '{{url('/')}}/glassreport?bulan='+bulan+'?tahun='+tahun;
|
|
window.location.href = url;
|
|
});
|
|
$('#btndatereport').click(function () {
|
|
var bulan = 'pertanggal';
|
|
var tahun = document.getElementById('tanggal').value;
|
|
var token = document.getElementById('token').value;
|
|
var source = {
|
|
datatype: "json",
|
|
datafields: [
|
|
{ name: 'id',type: 'text'},
|
|
{ name: 'nofoto',type: 'text'},
|
|
{ name: 'noregister',type: 'text'},
|
|
{ name: 'nmpasien',type: 'text'},
|
|
{ name: 'usia',type: 'text'},
|
|
{ name: 'l',type: 'text'},
|
|
{ name: 'p', type: 'text'},
|
|
{ name: 'jenis',type: 'text'},
|
|
{ name: 'ruangan',type: 'text'},
|
|
{ name: 'kesimpulan', type: 'text'},
|
|
{ name: 'poli', type: 'text'},
|
|
{ name: 'jkn', type: 'text'},
|
|
{ name: 'umm', type: 'text'},
|
|
{ name: 'swasta', type: 'text'},
|
|
{ name: 'gcu', type: 'text'},
|
|
{ name: 'tag', type: 'text'},
|
|
{ name: 'swasta', type: 'text'},
|
|
{ name: 'billing', type: 'text'},
|
|
{ name: 'ele', type: 'text'},
|
|
{ name: 'cito', type: 'text'},
|
|
{ name: 'daftar', type: 'text'},
|
|
{ name: 'foto',type: 'text'},
|
|
{ name: 'baca',type: 'text'},
|
|
{ name: 'export',type: 'text'},
|
|
{ name: 'created_at',type: 'text'},
|
|
{ name: 'nmdokter',type: 'text'},
|
|
{ name: 'nmppdssenior',type: 'text'},
|
|
{ name: 'nmmiddleppds',type: 'text'},
|
|
{ name: 'nmppdsjunior',type: 'text'},
|
|
{ name: 'nmppdsmiddle2',type: 'text'},
|
|
{ name: 'nmppdsjunior2',type: 'text'},
|
|
{ name: 'diagnosa2',type: 'text'},
|
|
{ name: 'modality',type: 'text'},
|
|
{ name: 'dlp',type: 'text'},
|
|
{ name: 'nm_spesimen',type: 'text'},
|
|
{ name: 'kd_spesimen',type: 'text'},
|
|
{ name: 'asalpasien',type: 'text'},
|
|
{ name: 'status',type: 'text'},
|
|
{ name: 'nmrs',type: 'text'},
|
|
{ name: 'berat',type: 'text'},
|
|
{ name: 'klinisi',type: 'text'},
|
|
{ name: 'klinis',type: 'text'},
|
|
{ name: 'tlppasien',type: 'text'},
|
|
{ name: 'nmanalis',type: 'text'},
|
|
{ name: 'verifikasi',type: 'text'},
|
|
{ name: 'noloket',type: 'text'},
|
|
{ name: 'jumlah',type: 'text'},
|
|
{ name: 'nmdrafter',type: 'text'},
|
|
{ name: 'tgldraft',type: 'text'},
|
|
{ name: 'nmpembaca',type: 'text'},
|
|
{ name: 'tgladendum',type: 'text'},
|
|
{ name: 'nmadendum',type: 'text'},
|
|
{ name: 'durasi', type: 'text'},
|
|
|
|
],
|
|
updaterow : function (rowid, rowdata, commit) {commit(true);},
|
|
type : 'POST',
|
|
data : {bulan: bulan, tahun: tahun, _token: token },
|
|
url : '{{ route("reportPeriksa") }}',
|
|
|
|
};
|
|
var dataAdapter = new $.jqx.dataAdapter(source);
|
|
$('#divlaporan').hide();
|
|
$('#divlaporanharian').show();
|
|
var editrowjabatan = -1;
|
|
$("#resultharian").jqxGrid({
|
|
width : '100%',
|
|
enablebrowserselection : true,
|
|
filterable : true,
|
|
autoheight : true,
|
|
showfilterrow : true,
|
|
altrows : true,
|
|
source : dataAdapter,
|
|
pageable : true,
|
|
theme : "energyblue",
|
|
columnsresize : true,
|
|
selectionmode : 'multiplecellsextended',
|
|
columns : [
|
|
{ text: 'File Report', editable: false, sortable: false, filterable: false, datafield: 'filefoto', width: 80, cellsalign: 'left', align: 'center' },
|
|
{ text: 'No.Loket', datafield: 'noloket', width: 80, cellsalign: 'left', align: 'center' },
|
|
{ text: 'No.RM', datafield: 'noregister', width: 70, align: 'center', cellsalign: 'left'},
|
|
{ text: 'Nama', datafield: 'nmpasien', width: 160, cellsalign: 'left', align: 'center' },
|
|
{ text: 'No.HP', datafield: 'tlppasien', width: 100, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Umur', datafield: 'usia', width: 70, cellsalign: 'left', align: 'center' },
|
|
{ text: 'M', editable: false, sortable: false, filterable: false, datafield: 'l', width: 20, cellsalign: 'left', align: 'center' },
|
|
{ text: 'F', editable: false, sortable: false, filterable: false, datafield: 'p', width: 20, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Order', editable: false, sortable: false, filterable: false, datafield: 'jenis', width: 80, cellsalign: 'left', align: 'center' },
|
|
{ text: 'JKN', editable: false, sortable: false, filterable: false, columngroup: 'asuransi', datafield: 'jkn', width: 40, cellsalign: 'left', align: 'center' },
|
|
{ text: 'UMM', editable: false, sortable: false, filterable: false, columngroup: 'asuransi', datafield: 'umm', width: 40, cellsalign: 'left', align: 'center' },
|
|
{ text: 'TAG', editable: false, sortable: false, filterable: false, columngroup: 'asuransi', datafield: 'tag', width: 40, cellsalign: 'left', align: 'center' },
|
|
{ text: 'GCU', editable: false, sortable: false, filterable: false, columngroup: 'asuransi', datafield: 'gcu', width: 40, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Billing', editable: false, sortable: false, filterable: false, columngroup: 'asuransi', datafield: 'billing', width: 40, cellsalign: 'left', align: 'center' },
|
|
{ text: 'SWASTA', editable: false, sortable: false, filterable: false, columngroup: 'asuransi', datafield: 'swasta', width: 40, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Elective', editable: false, sortable: false, filterable: false, columngroup: 'urgensi', datafield: 'ele', width: 40, cellsalign: 'left', align: 'center' },
|
|
{ text: 'CITO', editable: false, sortable: false, filterable: false, columngroup: 'urgensi', datafield: 'cito', width: 40, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Sample Masuk', columngroup: 'waktu', datafield: 'daftar', width: 160, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Draft By', columngroup: 'waktu', datafield: 'nmdrafter', width: 150, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Tgl. Draft', columngroup: 'waktu', datafield: 'tgldraft', width: 80, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Expertise By', columngroup: 'waktu', datafield: 'nmpembaca', width: 150, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Supervisor', columngroup: 'waktu', datafield: 'nmdokter', width: 150, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Verifikasi', columngroup: 'waktu', datafield: 'verifikasi', width: 80, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Cetak', columngroup: 'waktu', datafield: 'export', width: 80, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Asal Pasien', datafield: 'asalpasien', width: 100, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Asal RS', datafield: 'nmrs', width: 100, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Klinisi', datafield: 'klinisi', width: 150, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Klinis', datafield: 'klinis', width: 150, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Analis', datafield: 'nmanalis', width: 150, cellsalign: 'left', align: 'center' },
|
|
{ text: 'PPDS', datafield: 'nmppdssenior', width: 150, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Device', datafield: 'modality', width: 150, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Code', datafield: 'kd_spesimen', width: 150, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Speciment', datafield: 'nm_spesimen', width: 150, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Template', datafield: 'dlp', width: 150, cellsalign: 'left', align: 'center' },
|
|
{ text: 'Duration', editable: false, sortable: false, filterable: false, datafield: 'durasi', width: 100, cellsalign: 'left', align: 'center' },
|
|
],
|
|
columngroups:
|
|
[
|
|
{ text: 'Riwayat Tindakan', align: 'center', name: 'waktu' },
|
|
{ text: 'Urgensi', align: 'center', name: 'urgensi' },
|
|
{ text: 'Insurance', align: 'center', name: 'asuransi' }
|
|
]
|
|
});
|
|
});
|
|
$('#downexcell').click(function(){
|
|
var gridContent = $("#result").jqxGrid('exportdata', 'json');
|
|
data = $.parseJSON(gridContent);
|
|
var noOfContacts = data.length;
|
|
if(noOfContacts>0){
|
|
var table = document.createElement("table");
|
|
table.style.width = '100%';
|
|
table.setAttribute('border', '1');
|
|
table.setAttribute('cellspacing', '0');
|
|
table.setAttribute('cellpadding', '5');
|
|
table.setAttribute('id', 'tabelcetak');
|
|
table.setAttribute('class', 'text');
|
|
var col = [];
|
|
for (var i = 0; i < noOfContacts; i++) {
|
|
for (var key in data[i]) {
|
|
if (col.indexOf(key) === -1) {
|
|
col.push(key);
|
|
}
|
|
}
|
|
}
|
|
var tHead = document.createElement("thead");
|
|
var hRow = document.createElement("tr");
|
|
for (var i = 0; i < col.length; i++) {
|
|
var th = document.createElement("th");
|
|
th.innerHTML = col[i];
|
|
hRow.appendChild(th);
|
|
}
|
|
tHead.appendChild(hRow);
|
|
table.appendChild(tHead);
|
|
var tBody = document.createElement("tbody");
|
|
for (var i = 0; i < noOfContacts; i++) {
|
|
var bRow = document.createElement("tr");
|
|
for (var j = 0; j < col.length; j++) {
|
|
var td = document.createElement("td");
|
|
var isi = data[i][col[j]];
|
|
var isi2 = isi.toString();
|
|
var pjg = isi2.length;
|
|
if (pjg > 8){
|
|
if (pjg == 9 || pjg == 10 || pjg == 11 || pjg == 12 || pjg == 13){
|
|
if( isi2.indexOf(',') != -1 ){
|
|
var res = isi2.replace(/,/g, "");
|
|
td.innerHTML = res;
|
|
}
|
|
else {
|
|
var res = isi2;
|
|
td.setAttribute('style', 'mso-number-format: "\@";');
|
|
td.innerHTML = res;
|
|
}
|
|
}
|
|
else {
|
|
var res = isi2;
|
|
td.setAttribute('style', 'mso-number-format: "\@";');
|
|
td.innerHTML = res;
|
|
}
|
|
}
|
|
else {
|
|
var res = isi2.replace(/,/g, "");
|
|
td.innerHTML = res;
|
|
}
|
|
|
|
bRow.appendChild(td);
|
|
}
|
|
tBody.appendChild(bRow)
|
|
}
|
|
table.appendChild(tBody);
|
|
var divContainer = document.getElementById("tabel_cetak");
|
|
divContainer.innerHTML = "";
|
|
divContainer.appendChild(table);
|
|
}
|
|
|
|
$("#tabel_cetak").btechco_excelexport({
|
|
containerid: "tabel_cetak"
|
|
, datatype: $datatype.Table
|
|
});
|
|
return false;
|
|
});
|
|
$('#downexcellharian').click(function(){
|
|
var gridContent = $("#resultharian").jqxGrid('exportdata', 'json');
|
|
data = $.parseJSON(gridContent);
|
|
var noOfContacts = data.length;
|
|
if(noOfContacts>0){
|
|
var table = document.createElement("table");
|
|
table.style.width = '100%';
|
|
table.setAttribute('border', '1');
|
|
table.setAttribute('cellspacing', '0');
|
|
table.setAttribute('cellpadding', '5');
|
|
table.setAttribute('id', 'tabelcetak');
|
|
table.setAttribute('class', 'text');
|
|
var col = [];
|
|
for (var i = 0; i < noOfContacts; i++) {
|
|
for (var key in data[i]) {
|
|
if (col.indexOf(key) === -1) {
|
|
col.push(key);
|
|
}
|
|
}
|
|
}
|
|
var tHead = document.createElement("thead");
|
|
var hRow = document.createElement("tr");
|
|
for (var i = 0; i < col.length; i++) {
|
|
var th = document.createElement("th");
|
|
th.innerHTML = col[i];
|
|
hRow.appendChild(th);
|
|
}
|
|
tHead.appendChild(hRow);
|
|
table.appendChild(tHead);
|
|
var tBody = document.createElement("tbody");
|
|
for (var i = 0; i < noOfContacts; i++) {
|
|
var bRow = document.createElement("tr");
|
|
for (var j = 0; j < col.length; j++) {
|
|
var td = document.createElement("td");
|
|
var isi = data[i][col[j]];
|
|
var isi2 = isi.toString();
|
|
var pjg = isi2.length;
|
|
if (pjg > 8){
|
|
if (pjg == 9 || pjg == 10 || pjg == 11 || pjg == 12 || pjg == 13){
|
|
if( isi2.indexOf(',') != -1 ){
|
|
var res = isi2.replace(/,/g, "");
|
|
td.innerHTML = res;
|
|
}
|
|
else {
|
|
var res = isi2;
|
|
td.setAttribute('style', 'mso-number-format: "\@";');
|
|
td.innerHTML = res;
|
|
}
|
|
}
|
|
else {
|
|
var res = isi2;
|
|
td.setAttribute('style', 'mso-number-format: "\@";');
|
|
td.innerHTML = res;
|
|
}
|
|
}
|
|
else {
|
|
var res = isi2.replace(/,/g, "");
|
|
td.innerHTML = res;
|
|
}
|
|
|
|
bRow.appendChild(td);
|
|
}
|
|
tBody.appendChild(bRow)
|
|
}
|
|
table.appendChild(tBody);
|
|
var divContainer = document.getElementById("tabel_cetak");
|
|
divContainer.innerHTML = "";
|
|
divContainer.appendChild(table);
|
|
}
|
|
|
|
$("#tabel_cetak").btechco_excelexport({
|
|
containerid: "tabel_cetak"
|
|
, datatype: $datatype.Table
|
|
});
|
|
return false;
|
|
});
|
|
});
|
|
</script>
|
|
@endpush
|