<!-- <div id="w" style="width:100%;height:100%;padding:10px">



<form id="frm" action="<?=site_url($this->modul.'/run_upload')?>" method="post" enctype="multipart/form-data" class="styleThese">

<input type="hidden" name="simpan" value="1">

<label>Outgoing file (.xls)</label> :

<input name="h" class="easyui-filebox" style="width:50%">

<?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t25') == 1 && $this->session->userdata('t31') == 1 ){ ?>
<a href="#" class="easyui-linkbutton" iconCls="icon-save" onClick="$('#frm').submit()">Upload</a>
<?php } ?>
<a href="http://103.18.29.14:81/doerpsgp//template/Format Upload Outgoing.xls" class="easyui-linkbutton" iconCls="icon-xls" onClick="$('#frm').submit()">Template</a>


</form> -->

  
<div id="w" style="width:100%;height:100%;padding:10px">



<form id="frm" action="<?=site_url($this->modul.'/run_upload')?>" method="post" enctype="multipart/form-data" class="styleThese">

<input type="hidden" name="simpan" value="1">

<label>Incoming Cronjob</label> :

<!-- <input name="h" class="easyui-filebox" style="width:50%"> -->

<?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t24') == 1 ){ ?>
    <a href="javascript:void(0)" id="btnTbh" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="addForm()">Execute Cronjob</a>  
<!-- <a href="#" class="easyui-linkbutton" iconCls="icon-save" onClick="$('#frm').submit()">Upload</a> -->
<?php } ?>
<!-- <a href="http://27.123.4.131:81/doerpfsi/template/Format Upload Incoming Scrap.xls" class="easyui-linkbutton" iconCls="icon-xls" onClick="$('#frm').submit()">Template</a> -->
</form>

<script>
    $('#btnTbh').click(function(){
		console.log(window.location.hostname)
	$.messager.progress({
        title: 'Processing',   // Title of the loading dialog
        msg: 'Please wait...', // Message displayed in the loading dialog
    });
	
    $.ajax({
        url: 'https://'+window.location.hostname+':8080/processCSVOut',
        type: 'GET',  // Assuming it's a GET request, you can change it to POST if needed
        success: function() {
			$('#dg_hdr').datagrid('reload');
           alert('Cron job triggered successfully:');

            // You can add further actions after the cron job is triggered if needed
        },
        error: function(xhr, status, error) {
			$.messager.progress('close');
		    Alert('Cron job triggered successfully:');
			// $('#dg_hdr').datagrid('reload');
        }
    });
});
</script>