<!---- 
    Author 	: Ladur
    Tanggal : 12-08-2014	
    Revisi 	:
-->
<?php
//---------Untuk privellege jika dia ada tombol save,suspen,jurnal----------
	if($group_user->SavePrivillage == 1){
		$cek_autority_save  = "";
	}
	else{
		$cek_autority_save 	= "disabled";
	}
	
	if($group_user->JournalPrivillage == 1){
		$cek_autority_journal  = "";
	}
	else{
		$cek_autority_journal 	= "disabled";
	}
	
	if($group_user->DeletePrivillage == 1){
		$cek_autority_delete  = "";
	}
	else{
		$cek_autority_delete 	= "disabled";
	}

    if($group_user->ReversePrivillage == 1){
        $cek_autority_reverse  = "";
    }
    else{
        $cek_autority_reverse    = "display:none";
    }
//-------------end----------------------------
?>
<div class="easyui-layout" data-options="fit:true,border:false">
	<?php 
		$trans_status = "";
		foreach($payment as $row): 
			$trans_status = $row->TransStatus;
	?>
	<!-- Top view-->
    <div id="form-header" data-options="region:'north',border:false" >
        <div id="form-header-wrapper">
            <table cellpadding="0" cellspacing="0" width="100%" height="100%" border="0">
            <tr>
                <td align="left" width="30%" id="top_button">
                    
                </td>
                <td align="center" width="40%"><span id="approval_information">
                <?php
                if($row->TransStatus == 4){
                    echo get_status_approval_header($row->TransStatus);
                }
                ?>
                </span></td>
                <td height="25" align="right" valign="middle">
                    <span class="form-title" style="margin-left:7px;">
                        <?=$menu_label?>
                    </span>
                </td>
            </tr>
            </table>		     	
        </div>			
    </div>
    <!-- End of top view -->
    
    <div id="form-body" data-options="region:'center',border:false">
    <?php if($trans_status==2){ ?>
        <div class="blanket"></div>
        <div class="finished-box"><b>Finished</b></div>
    <?php }else if($trans_status==3){ ?>
    	 <div class="blanket"></div>
         <div class="suspend-box"><b>Suspended</b></div>
	<?php
	}
	?>
        <div id="form-wrapper" class="easyui-panel" style="width:1180%;height:526px;padding:5px;" fit="true">
        	<form id="fm_payment" name="fm_payment" method="post">
				<input type="hidden" name="detail" id="detail" />
				<input type="hidden" name="id" id="id" value="<?php echo $row->CPayNumber;?>" />
                <input type="hidden" name="exsist_trans_status" id="exsist_trans_status" value="<?php echo $trans_status;?>" />
				<input type="hidden" name="code_appmgrspv" id="code_appmgrspv" />
				<input type="hidden" name="code_appdir" id="code_appdir" />
				<input type="hidden" name="copy_suspend" id="copy_suspend" />
                <input type="hidden" name="detail_id" id="detail_id">
                
                <!-- Form Header -->
                <table width="100%" height="141" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="50%" valign="top">
                    	<table width="100%" cellpadding="0" cellspacing="1" style="margin-top:4px;">
                        <tr height="20">
                        	<td width="150"><b>Paid From</b></td>
                            <td width="10"><b>:</b></td>
                            <td>
                            	<select name="cmb_bank_account" editable="true" class="combo-grid" <?php if($row->TransStatus == 3 || $row->TransStatus == 2){echo "disabled";}?>
                                	id="cmb_bank_account" 
                                    style="width:300px;height:24px;" 
                                	data-options="
                                        value:'<?= $row->BankPayment; ?>',
                                        panelWidth: 300,
                                        idField: 'AccountNumber',
                                        textField: 'AccountName',
                                        url: '<?= base_url().$menu_link; ?>/get_petty_cash/<?= $row->BranchCode;?>',               
                                        columns: [[                
                                            {field:'AccountNumber',title:'AccountNumber',width:100},  
                                            {field:'AccountName',title:'Account Name',width:190},
                                            {field:'CurrencyCode',title:'Currency Code',width:120}
                                        ]],
                                        fitColumns: true,
                                         onSelect: function(rowIndex, rowData){ 
                                            $('.app-button').linkbutton('disable');
                                           
                                            get_bank_balance(rowData.AccountNumber,rowData.CurrencyCode);  
                                          
                                        }
                                    " editable="false" required
                                >
                                </select>
                                
                            </td>
                        </tr>
                         <tr height="20">
                            <td width="150" valign="top" style="padding-top:4px;"><b><?php echo label_grid('check_no');?></b></td>
                            <td width="10" valign="top" style="padding-top:4px;"><b>:</b></td>
                            <td>
                                <input type="text" name="cheque_number" id="cheque_number" style="width:298px" value="<?=$row->ChequeNumber;?>" <?=in_array($row->TransStatus,array(1,2,3,9))?'disabled':'';?>>
                            </td>
                        </tr>
                        <tr height="20">
                        	<td width="150" valign="top" style="padding-top:4px;"><b>Memo</b></td>
                            <td width="10" valign="top" style="padding-top:4px;"><b>:</b></td>
                            <td>
                            	<textarea class="textbox" name="txa_memo" id="txa_memo" rows="4" style="width:298px;resize:none;white-space:normal;" <?php if($row->TransStatus == 3 || $row->TransStatus == 2 || $row->TransStatus == 5){echo "disabled";}?>><?php echo $row->CPayDesc;?></textarea>
                            </td>
                        </tr>
                        <tr height="20">
                        	<td width="150"><b>Amount</b></td>
                            <td width="10"><b>:</b></td>
                            <td>
                            	<input name="txt_amount" id="txt_amount" type="text" class="easyui-numberbox" value="<?php echo $row->CPayTotalAmount;?>" style="width:298px;height:20px;text-align:right" formatter="formatRp" 
                                    data-options="
                                        min:0,precision:2,decimalSeparator:',',groupSeparator:'.'
                                    " required readonly>
                                <!-- <a href="#" id="btn_calculate" class="easyui-linkbutton" data-options="iconCls:'icon-calculator',size:'small'" onclick="count_amount()"></a> -->
                            </td>
                        </tr>
                        
                        </table>
                    </td>
                    <td width="50%" valign="top">
                    	<table width="100%" cellpadding="0" cellspacing="1" style="margin-top:4px;">
                        <tr height="20">
                        	<td>&nbsp;</td>
                            <td width="190" style="background:#333399;text-align:center;color:#FFF;">Cash Payment No.</td>
                            <td width="122" style="background:#333399;text-align:center;color:#FFF;">Cash Payment Date</td>
                        </tr>
                        <tr height="20">
                        	<td>&nbsp;</td>
                            <td>
                            	<input type="text" name="txt_payment_no" id="txt_payment_no" class="easyui-validatebox" value="<?php echo $row->CPayNumber; ?>" style="width:200px;background-color:#E3E2E2;text-align:center;"  readonly/>
                            </td>
                            <td>
                            	<input type="text" name="txt_payment_date" id="txt_payment_date" class="easyui-datebox" style="width:122px;height:20px" editable="false" required readonly/>
                            </td>
                        </tr>
                        
                        </table>
                        <table width="100%" cellpadding="0" cellspacing="0" style="margin-top:0px;">
                        <tr height="20">
                            <td>&nbsp;</td>
                            <td width="150" style="background:#333399;text-align:center;color:#FFF;"><b>Available Balance (<span class='bank_balance_currency'></span>)</b></td>
                            
                        </tr>
                        <tr height="20">
                            <td>&nbsp;</td>
                            <td>
                                <input name="txt_bank_balance" id="txt_bank_balance" type="text" class="easyui-numberbox" style="width:326px;height:20px;text-align:right" formatter="formatRp" 
                                    data-options="
                                        precision:2,decimalSeparator:',',groupSeparator:'.',
                                        
                                    " readonly>
                            </td>
                            
                        </tr>
                        <tr height="20">
                            <td colspan="3" align="right" style="padding-top:10px;">
                                <span class="blink">PERINGATAN :</span>
                                <p>Form ini hanya dapat digunakan untuk melakukan transaksi dengan </p>
                                <p>total invoice sama dengan total faktur yang lebih kecil atau sama dengan Rp.250.000,00</p>
                            </td>
                        </tr>
                        </table>
                    </td>
                </tr>
                </table>
                <!-- End of Form header -->
                
                <!-- Datagrid -->
                <table id="dtg_payment" class="easyui-<?=(in_array($row->TransStatus,array(0,1,2,5)))?'datagrid':'edatagrid'?>"
                	toolbar="#tb_dtg_payment" idField="id" 
                    rownumbers="true" fitColumns="true" 
					singleSelect="true" 
                    style="height:340px;"
                    url="<?= base_url().$menu_link;?>/detail_payment/<?= $row->CPayNumber;?>" 
                    data-options = "
                        onBeforeLoad:function(){
                            $('#dtg_payment').datagrid('loadData', {'total':0,'rows':[]});
                        },
                        onBeginEdit:function(rowIndex){
                            editors = $('#dtg_payment').datagrid('getEditors',rowIndex);
                            /*====================on beg in edit saat grid di klik maka tombol save disable===================*/
                            save_button_begendedit('<?=$group_user->SavePrivillage;?>');
                            /*=================================end============================================================*/

                            
                        },
                        onEndEdit:function(indexRow,row,changes){
                            /*====================on beg in edit saat grid di klik maka tombol save disable===================*/
                            save_button_endedit('<?=$group_user->SavePrivillage;?>');
                            /*=================================end============================================================*/
                            var subtotal = 0;
                            var item =  $('#dtg_payment').datagrid('getRows');
                            $.each(item, function( index,value) {
                                subtotal += parseFloat(value.CPayAmount);
                            });

                            if(subtotal > 250000){
                                amount_value(subtotal);
                                var amount_edit = parseFloat(changes.CPayAmount);
                                subtotal -= amount_edit;

                            }

                            $('#total_amount').html(subtotal);
                            $('#txt_amount').numberbox('setValue',subtotal);
                        }
                    "
                >
					<thead>
                    <tr>
                        <th halign="center" align="left" valign="middle" data-options="field:'AccountName',width:400,align:'left'"  readonly='true'>Account Name</th>
                        <th halign="center" align="right" valign="middle" data-options="field:'CPayAmount',width:120,align:'center',editor:{type:'numberbox',options:{min:0.01,max:250000,precision:2,decimalSeparator:',',required:true}}" formatter="formatRp">Amount</th>
                        <th halign="center" align="left" valign="middle" data-options="field:'CPayMemo',width:400,align:'left',editor:'text'">Memo</th>
                        <th halign="center" align="left" valign="middle" data-options="field:'DepartmentName',width:150,align:'left',editor:'text'" editor="{type:'Department_Account_Name',options:{required:true}}">Department</th>
                        <th halign="center" align="left" valign="middle" data-options="field:'CPayDetailID',width:150,align:'left',editor:'text'" hidden='true'>CPayDetailID</th>
                        <th align="center" valign="middle" hidden='true' data-options="field:'DepartmentAccountCode',width:150,align:'left'" editor="{type:'Department_Account_Code',options:{required:true}}">Department Code</th>
                        <th align="center" valign="middle" hidden='true' data-options="field:'RowStatus',width:150,align:'left'" editor="{options:{required:true}}">Row Status</th>
                   	</tr>
					</thead>
				</table>
                
                <!-- Datagrid Toolbar -->
				<div id="tb_dtg_payment">
                    <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="remove_row()" <?= in_array($row->TransStatus,array(0,1,2,3)) ? 'disabled' : '' ?>>Delete</a>
				</div>
                <!-- End of Datagrid Toolbar -->
                <!-- End of Datagrid -->
                
            </form>
        </div>
    </div>
    <div id="form-footer" data-options="region:'south',border:false">
    	<table width="100%" cellpadding="0" cellspacing="0">
            <tr>
                <td>&nbsp;</td>
                <td align="right">
                <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-help" onclick="" plain="true">Help</a>
                <a href="javascript:void(0)" class="easyui-linkbutton form-button app-button" iconCls="icon-ok" onclick="app_mgr()" <?= (($this->session->userdata("jobtitle_status") != 1 || !in_array($row->TransStatus,array(4,6))) || (date('Y-m-d') < date('Y-m-d', strtotime($row->CPayDate))))?'disabled':''?>>App. Mgr</a>
                <a href="javascript:void(0)" class="easyui-linkbutton form-button app-button" iconCls="icon-reload" onclick="app_reverse()" <?=(in_array($row->TransStatus,array(1,2,9)))?'':'disabled'?> style="<?= $cek_autority_reverse;?>" >Reverse</a>
                <a href="javascript:void(0)" class="easyui-linkbutton form-button save-button" iconCls="icon-save" id="" onclick="update_payment();" <?=(in_array($row->TransStatus,array(0,1,2,3,5)))?'disabled':''?> <?php echo $cek_autority_save;?>>Save</a>
                <!-- <a href="javascript:void(0)" class="easyui-linkbutton form-button" iconCls="icon-print" onclick="parent.tab_edit('Print Payment', '<?=$menu_link?>', 'icon-print', 'to_preview_by_payment_number','<?php echo $row->CPayNumber;?>');">Preview & Print</a> -->   
                <a href="javascript:void(0)" class="easyui-linkbutton form-button" iconCls="icon-print" onclick="parent.tab_edit('Print Payment', '<?=$menu_link?>', 'icon-print', 'to_print_detail','<?php echo $row->CPayNumber;?>');" <?=(in_array($row->TransStatus,array(4,5,6,1,2,3,9)))?'':'disabled'?>>Preview & Print</a>
                <a href="javascript:void(0)" class="easyui-linkbutton form-button" iconCls="icon-cancel" onclick="<?=($this->session->userdata('jobtitle_status')==0)?'suspend(2)':'parent.tab_close(\'tt\')'?>" <?=(!in_array($row->TransStatus,array(0,4,6)))?'disabled':''?>><?=($this->session->userdata('jobtitle_status')==0)?'Cancel':'Close'?></a>	     
                </td>
             </tr>
         </table>
		</div>
    <?php endforeach;?>
</div>

<!-- Dialog Payment Department -->
<div id="dialog-payment-department" class="easyui-dialog" style="width:450px;height:523px;top:27px;background-color:#F8F8F8;padding:0px" closed="true" data-options="modal:true, iconCls:'icon-save'" buttons="#dialog-buttons-department-payment">
    <form id="form_payment_department" method="post" novalidate>
        <table width="100%" align="left" border="0">
            <tr>
                <td width="120" align="left" valign="middle"><b>Department Code</b></td>
                <td width="10"><b>:</b></td>
                
                <td colspan="2">
                    <input type="text" style="width:288px;height:20px" name="txt_department_code" id="txt_department_code" class="easyui-validatebox" placeholder="< Department Code >" onkeyup="search_payment_department_popup();" />
                </td>
            </tr>

            <tr>
                <td width="120" align="left" valign="middle"><b>Department Name</b></td>
                <td><b>:</b></td>

                <td colspan="2">
                    <input type="text" style="width:288px;height:20px" name="txt_department_name" id="txt_department_name" class="easyui-validatebox" placeholder="< Department Name >" onkeyup="search_payment_department_popup();" />
                </td>
            </tr>
            
            <tr>
                <td colspan="3">
                    <table id="tt_choose_department_payment" class="easyui-datagrid" 
                        url="<?php echo base_url(); ?>list/payment/all_department/<?php echo $this->session->userdata('company');?>" 
                        singleSelect="true" fitColumns="true" 
                        style="width:428px;height:388px;"
                    >
                        <thead>
                            <tr>
                                <th halign="center" width="170" field="DepartmentCode" sortable="true">Department Code</th>
                                <th halign="center" width="375" field="DepartmentName" sortable="true">Name</th>
                            </tr>
                        </thead>
                    </table>
                </td>
            </tr>
        </table>
    </form>
</div>

<!-- Dialog Button -->
<div id="dialog-buttons-department-payment" style="border:none;">
    <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onClick="choose_department_payment();">OK</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onClick="modal_close('dialog-payment-department');">Cancel</a>
</div>
<!-- End Tagor -->

<script type="text/javascript">

var SavePrivillage  = '<?=$group_user->SavePrivillage;?>';
var array_item = [];

$(document).ready(function(){

    var JournalPrivillage   = '<?=$group_user->JournalPrivillage;?>';
    var DeletePrivillage    = '<?=$group_user->DeletePrivillage;?>';
    var TransStatus         = '<?=$row->TransStatus;?>';

    load_page_edit('<?=$menu_label;?>','<?=$menu_link;?>','at_cashpayment','CPayNumber','<?=$row->CPayNumber;?>','<?=$row->CreatedAt;?>',JournalPrivillage,DeletePrivillage,TransStatus,4);

	<?php foreach($payment as $row): ?>
	$('#txt_payment_date').datebox('setValue', '<?php echo date("d-m-Y", strtotime($row->CPayDate));?>');
	<?php endforeach; ?>

    var bank_payment = '<?= $row->BankPayment; ?>';
    
    get_bank_balance(bank_payment,'IDR');
	
    $('#chk_suspend').click(function(){
		if($(this).is(':checked')){
			$('#copy_suspend').val('1');
		}
		else{
			$('#copy_suspend').val('');
		}
	});


    $('#fm_payment').click(function(){
        $('#dtg_payment').edatagrid('saveRow');
    });

});

function app_mgr(){
    var no_transaksi    = $('#txt_payment_no').val();

    checking_approval(no_transaksi,function(check){
        
        if(check.status == false){
            $('#code_appmgrspv').val('4');
            approved_data('<?=$menu_link?>','#fm_payment');
        }else{
            $.messager.alert('Unseccessfull',check.message,'error',function(){
                location.reload();
            });
        }
    });
}
	
function app_dir(){
	$.messager.confirm('Confirm','Setelah Di Approve Transaksi Akan Masuk Kedalam Coa, Silahkan Cek Kembali Transaksi Ini',function(r){
		if(r){	
			$('#code_appdir').val('5');
			edit_data('<?=$menu_link?>','#fm_payment');
		}
	});
}

	
function amount_value(value){
	if(value > 250000){
		$.messager.alert('Info','Amount tidak lebih dari 250.000');
		//$('#txt_amount').numberbox('setValue', 250000);
	}
}
    
function count_amount(){
	var total_amount = 0;
	var selected	= $('#dtg_payment').datagrid('getSelected');
	var index		= $('#dtg_payment').datagrid('getRowIndex', selected);
	var editor 		= $('#dtg_payment').datagrid('getEditors', index);
	
	$('#dtg_payment').edatagrid('saveRow');		
	var rows 	= $('#dtg_payment').datagrid('getRows');
	for(var i=0; i<rows.length; i++){
		total_amount += parseInt(rows[i].CPayAmount);
	}

	$('#total_amount').html(total_amount);
	$('#txt_amount').numberbox('setValue',total_amount);
}
    
function update_payment(){
	
	$('#dtg_payment').edatagrid('saveRow');
	var cek = $('#dtg_payment').datagrid('getRows');
	err  = 0;
	
	var transaksi = "";
	
	$.each(cek, function( index, value ) {
		if(transaksi != value.AccountNumber){
			err++;
			transaksi = value.AccountNumber;
		}
	});
	
	var total_amount = 0;
	
	for(var i=0; i<cek.length; i++){
		if(isNaN(cek[i].CPayAmount)){ cek[i].CPayAmount = 0; }
		total_amount += parseFloat(cek[i].CPayAmount);
	}
	$('#total_amount').html(total_amount);
	
	if(err == 0) {
		$.messager.alert('Unseccessfull','Harap di pilih satu Transaksi.','error',function(){
			$('#dtg_payment').datagrid('reload');
		});
	}
	else if(total_amount != $('#txt_amount').numberbox('getValue')){
		$.messager.alert('Unseccessfull','Total Payment tidak sama dengan Amount.','error',function(){
			$('#dtg_payment').datagrid('reload');
		});
	}
	else{
		if($('#txt_amount').numberbox('getValue') > 250000){
			$.messager.alert('Unseccessfull','Total Payment tidak lebih dari Rp. 250.000','error',function(){
				$('#dtg_payment').datagrid('reload');
			});
		}
		else{
				
			var login_as        = "<?= $this->session->userdata('username');?>";
            var created_by      = "<?= $row->CreatedBy;?>";
            var depart_by       = "<?= $row->DepartmentCode;?>";
            var depart_ses      = "<?= $this->session->userdata('department');?>";
            var jobtitle_status = "<?= $this->session->userdata('jobtitle_status');?>";

            var no_transaksi    = $('#txt_payment_no').val();
            var status          = '<?= $row->TransStatus;?>';
            

            checking_update(no_transaksi,status,function(check){
            
                if(check.status == true){
                    $('#dtg_payment').edatagrid('saveRow');
                    var i=$('#dtg_payment').datagrid('getRows');
                    var detail = JSON.stringify(i);
                    $("#detail").val(detail);
                    edit_data('<?=$menu_link?>','#fm_payment',created_by,login_as,depart_by,depart_ses,jobtitle_status);
                    $('#id_tojournal').val($('#txt_payment_no').val());
                    
                    if($('#id_tojournal').val() != ""){
                        $('#btn_journal').linkbutton('enable');
                    }
                }else{
                    $.messager.alert('Unseccessfull',check.message,'error',function(){
                        location.reload();
                    });
                }

            });
		}
	}
}

function app_reverse(){
    var no_transaksi    = $('#txt_payment_no').val();

    checking_reverse(no_transaksi,function(check){
        
        if(check.status == true){
            reversed_data('F','<?=$menu_link?>',no_transaksi, '<?=$menu_label?>');
        }else{
           $.messager.alert('Unseccessfull',check.message,'error',function(){
                location.reload();
            });
        }
    });
}

function open_department_payment() { 
   modal_open('Department','dialog-payment-department');
}

function choose_department_payment() {
    var selected_data = $('#tt_choose_department_payment').datagrid('getSelected');

    $('.Department_Account_Name').val(selected_data.DepartmentName);
    $('.Department_Account_Code').val(selected_data.DepartmentCode);

    modal_close('dialog-payment-department');
}
$.extend($.fn.datagrid.defaults.editors, {

    Department_Account_Name: {
        init: function(container, options){
            var input = $('<input type="text" class="Department_Account_Name" onClick="open_department_payment()" style="height:18px;" readonly/>').appendTo(container);
            return input.validatebox(options);
        },
        destroy: function(target){
            $(target).remove();
        },
        getValue: function(target){
            return $(target).val();
        },
        setValue: function(target, value){
            $(target).val(value);
        },
        resize: function(target, width){
            $(target)._outerWidth(width);
        }
    },
            
    Department_Account_Code: {
        init: function(container, options){
            var input = $('<input type="text" class="Department_Account_Code" onClick="open_payment_department()" style="height:18px;" readonly/>').appendTo(container);
            return input.validatebox(options);
        },
        destroy: function(target){
            $(target).remove();
        },
        getValue: function(target){
            return $(target).val();
        },
        setValue: function(target, value){
            $(target).val(value);
        },
        resize: function(target, width){
            $(target)._outerWidth(width);
        }
    }
});

function remove_row(){
    var item = $('#dtg_payment').datagrid('getData').total;

    if(item <= 1){
        $.messager.alert('Warning','Anda tidak dapat menghapus list item, minimum list item adalah satu (1)','error');
    }
    else {
        $('#dtg_payment').edatagrid('saveRow');     
        var selectedrow     = $('#dtg_payment').datagrid('getSelected');
        var row_index       = $('#dtg_payment').datagrid('getRowIndex', selectedrow);

        $.messager.confirm('Confirmation :', 'Anda yakin, Anda ingin menghapus account ini ?',  
            function(r){
                if (r){
                    // $('#dtg_payment').datagrid('updateRow',{
                    //     index:row_index,
                    //     row:{RowStatus          : 3}
                    // });
                   array_item.push(selectedrow.CPayDetailID);
                   $("#detail_id").val(JSON.stringify(array_item));
                   $('#dtg_payment').datagrid('deleteRow', row_index);
                   $('.app-button').linkbutton('disable');
                    var subtotal = 0;
                    var item =  $('#dtg_payment').datagrid('getRows');

                    $.each(item, function( index,value) {
                        subtotal += parseFloat(value.CPayAmount);
                    });

                    $('#total_amount').html(subtotal);
                    $('#txt_amount').numberbox('setValue',subtotal);
                }
            }
        );        
                    
    }        
}

function suspend(type){
    var created_by      = '<?php echo $row->CreatedBy;?>';
    var login_as        = '<?php echo$this->session->userdata('username');?>';
    var job_title       = '<?php echo $this->session->userdata('jobtitle_status');?>';
    var url             = '<?= base_url();?>custom/custom/checking_suspend';
    
    suspend_check_trans('F', type, '<?=$menu_link?>', $('#txt_payment_no').val(), '<?=$menu_label;?>', url, created_by, login_as, job_title);
}

//**===== End Tagor ====

</script>