<?php
/* 	
 * 	Author 	: Wahyu /  Tanggal : 22-07-2014	
 * 	Revisi 	: Ferry
 *      Revisi  : Dhidhik, 22 Maret 2016,
 */
?>

<div id="cc" class="easyui-layout" data-options="fit:true, border:false">
    <div data-options="region:'west',split:true, border:true" title="" style="width:230px; background-color:#F8F8F8;">
        <div title="" style="padding:10px;overflow:auto;" data-options="selected:true" >				
            <div class="preference_menu">
                <ul>
                    <!--<li><a href="<?php echo site_url('setup/preference_account'); ?>" style="border-top:none;"><img src="<?php echo base_url(); ?>assets/custom/icons/clipboard-invoice.png" alt=""/><span>P/L Account</span></a></li>-->	
                    <li><a href="<?php echo site_url('setup/preference_item'); ?>"><img src="<?php echo base_url(); ?>assets/custom/icons/clipboard-invoice.png" alt=""/><span>Item Account.</span></a></li>	
                    <li><a href="<?php echo site_url('setup/preference_sales'); ?>"><img src="<?php echo base_url(); ?>assets/custom/icons/moneys.png" alt=""/><span>Sales Account</span></a></li>
                    <li><a href="<?php echo site_url('setup/preference_purchases'); ?>"><img src="<?php echo base_url(); ?>assets/custom/icons/sticky-notes.png" alt=""/><span>Purchases Account</span></a></li>	
                    <li><a href="<?php echo site_url('setup/preference_services'); ?>"><img src="<?php echo base_url(); ?>assets/custom/icons/calculator.png" alt=""/><span>Expense Account</span></a></li>
                    <li><a href="<?php echo site_url('setup/preference_advances'); ?>"><img src="<?php echo base_url(); ?>assets/custom/icons/calculator.png" alt=""/><span>Adv. Payment Account</span></a></li>
                    <li><a href="<?php echo site_url('setup/preference_expense'); ?>"><img src="<?php echo base_url(); ?>assets/custom/icons/calculator.png" alt=""/><span>Cash-Bon Account</span></a></li>
                    <li><a href="<?php echo site_url('setup/preference_others'); ?>"><img src="<?php echo base_url(); ?>assets/custom/icons/money-coin.png" alt=""/><span>Others Account</span></a></li>
                    <li><a href="<?php echo site_url('setup/preference_approval'); ?>"><img src="<?php echo base_url(); ?>assets/custom/icons/property.png" alt=""/><span>Sales Approval Limit</span></a></li>	
                    <li><a href="<?php echo site_url('setup/preference_miscellaneous'); ?>"><img src="<?php echo base_url(); ?>assets/custom/icons/folder-stand.png" alt=""/><span><b>Miscellaneous</b></span></a></li>
                </ul>
            </div>	
        </div>
    </div>

    <div data-options="region:'center',fit:true,plain:true, border:false" style="background:#eee;">
        <div id="form-wrapper" class="easyui-panel" border="false" style="width:1125px;height:544px;background:#FFF;border:#95B8E7 1px solid;">
            <div style="background:linear-gradient(to bottom,#EFF5FF 0,#E0ECFF 100%);height:27px;border-bottom:#95B8E7 1px solid;"></div>
            <div style="overflow:hidden;padding:1px;">
                <form id="preference_miscellaneous" name="preference_miscellaneous" method="post" class="preference_form">	
                    <table width="100%" cellspacing="1" cellpadding="1">
                        <tr>
                            <td valign="middle"><b>Invoice Aging Range</b></td>
                            <td width="650" height="15" align="left" valign="middle">
                                <input type="hidden" name="agingRangeID" id="agingRangeID" value="<?php if (!empty($aging_range)) {
                                foreach ($aging_range as $row) {
                                    echo"$row->PreferenceCode";
                                }
                            } else {
                                echo"IARange";
                            } ?>">
                                <input type="text" name="ValueAgingRange" id="ValueAgingRange" class="easyui-validatebox" size="2" value="<?php if (!empty($aging_range)) {
                                foreach ($aging_range as $row) {
                                    echo"$row->PreferenceValue";
                                }
                            } else {
                                echo"0";
                            } ?>" /> Day(s)
                            </td>					
                        </tr>

                        <tr>
                            <td valign="middle"><b>Tolerance Direct Sent Item</b></td>
                            <td width="650" height="15" align="left" valign="middle">
                                <?php if (!empty($tolerance)) {
                                    foreach ($tolerance as $rows): ?>
                                        <select id="ValueTolerance" class="easyui-combobox" name="ValueTolerance" style="width:650px;">											
                                            <option value="1" <?php if ($rows->PreferenceValue == '1') { ?> selected="selected" <?php } ?>>1</option>
                                            <option value="2" <?php if ($rows->PreferenceValue == '2') { ?> selected="selected" <?php } ?>>2</option>
                                            <option value="3" <?php if ($rows->PreferenceValue == '3') { ?> selected="selected" <?php } ?>>3</option>
                                            <option value="4" <?php if ($rows->PreferenceValue == '4') { ?> selected="selected" <?php } ?>>4</option>
                                            <option value="5" <?php if ($rows->PreferenceValue == '5') { ?> selected="selected" <?php } ?>>5</option>
                                            <option value="6" <?php if ($rows->PreferenceValue == '6') { ?> selected="selected" <?php } ?>>6</option>
                                            <option value="7" <?php if ($rows->PreferenceValue == '7') { ?> selected="selected" <?php } ?>>7</option>											
                                        </select>
                                            <?php endforeach;
                                        } else {
                                            ?>
                                    <input type="hidden" name="ToleranceID" id="ToleranceID" value="<?php echo"ToleranceID"; ?>">
                                    <select id="ValueTolerance" class="easyui-combobox" name="ValueTolerance" style="width:650px;">
                                        <option value="0" selected="selected">-</option>
                                        <option value="1">1</option>
                                        <option value="2">2</option>
                                        <option value="3">3</option>
                                        <option value="4">4</option>
                                        <option value="5">5</option>
                                        <option value="6">6</option>
                                        <option value="7">7</option> 											
                                    </select>
                                    <?php } ?>
                            </td>					
                        </tr>                    
                    </table>
                </form>
            </div>
        </div>

        <div style="padding:5px;text-align:right;width:1120px;">
            <a id="save_button" href="javascript:void(0)" class="easyui-linkbutton form-button" iconCls="icon-save" onclick="submit_form()">Save</a> 								
            <a href="javascript:void(0)" class="easyui-linkbutton  form-button" iconCls="icon-cancel" onclick="">Cancel</a>						
        </div>	
    </div>
</div>

<script type="text/javascript">
    function submit_form() {
//        $("#preference_miscellaneous").submit();
	custom_data('<?php echo"setup/preference_miscellaneous";  ?>/proses_post_data_miscellaneous','#preference_miscellaneous');
    }
</script>