<? global $vis_language;
for($i=0; $i < $view_info['page_count']; $i++) $paging_list.='<option value="'.$i.'" '.(($view_info['page']==$i)?'selected="selected"':'').'>'.($i+1).'</option>'; ?>
    <section id="breadcrumb" class="row m-b m-l-none m-r-none">
		<div class="col-sm-6">
			<h3 class="m-b-xs text-black"><? echo $vis_language['TXTTAX'];?><span id="total_cnt"> (<? echo $taxInfo['total']; ?>)</span></h3>
			<ul class="breadcrumb bg-empty no-border m-b-xxs no-padder">
				<li><a class="link" href="#/home/quick_view/<? echo $vis_language['TXTHOME']; ?>"><?echo $vis_language['TXTHOME'];?></a></li>
				<li><a class="link" href="#/setting/setting_menu/<? echo $vis_language['TXTSETTINGS'];?>" onclick="$('#vis_workpanel_div').visExecution('load_module','<?echo $vis_language['TXTSETTINGS'];?>',{'vis_module':'setting','vis_operation':'setting_menu'});"><?echo $vis_language['TXTSETTINGS'];?></a></li>
				<li class="active"><? echo $vis_language['TXTTAX']; ?></li>
			</ul>
		</div>
		<div class="col-sm-6 text-right text-left-xs m-t-lg">
			<div class="btn-group">
				<a class="btn btn-rounded btn-primary btn-sm dropdown-toggle" href="javascript:void(0)" onclick="$('#vis_workpanel_div').visExecution('load_module','<? echo $vis_language['TXTADDTAX']?>',{'vis_module':'setting','vis_operation':'new_tax_rule', 'cache':true});"><i style="font-size:10px;" class="vh vh-plus"> </i><? echo " ".$vis_language['TXTADD']; ?></a>
			</div>
			<div class="btn-group">
			<button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="vh vh-action text-muted"></i> <b class="caret"></b></button>
            <ul class="dropdown-menu dropdown-menu-right text-left">
                <li><a href="javascript:void(0)" data-toggle="ajaxModal" data-modal-arguments="vis_module=setting&vis_operation=new_tax_rule_setting&vis_static_area=vis_client_merge_area"><? echo $vis_language['TXTTAXRULESETTING']; ?></a></li>
            </ul>
		</div>
		</div>
	</section>
		  <? if($view_info['page_count']>0)
   {
   ?>
<div class="col-lg-12">
	<form name="vis_tax_form" id="vis_tax_form">
	<section class="panel panel-default">
		<div class="row wrapper clr">
			  <div class="col-sm-9 tkt_left_menu">
				<? if(isset($operation['vis_draft']) && $operation['vis_draft']==1) { ?>
				<div class="btn-group select">
				  </div>
				<? }
					else { ?>
				<div class="vis_mass_action">
				<div class="btn-group">
				  <button class="btn bg-empty btn-sm dropdown-toggle action_btn" data-toggle="dropdown">
					<i class="vh vh-action"></i> <span class="caret"></span>
				  </button>
					<ul class="dropdown-menu">
						<li><a href="javascript:void(0);" onclick="$(this).visExecution('submit_form',{'vis_module':'setting', 'vis_operation':'change_setting_status', 'vis_form':'vis_tax_form', 'vis_switch':'tax','vis_current_module':'<?php echo $operation['vis_current_module']; ?>', 'vis_current_operation':'<?php echo $operation['vis_current_operation']; ?>','vis_is_enable':'1', 'vis_page':'<? echo $view_info['page']; ?>'})"><? echo $vis_language['TXTENABLE']; ?></a></li>
						<li><a href="javascript:void(0);" onclick="$(this).visExecution('submit_form',{'vis_module':'setting', 'vis_operation':'change_setting_status', 'vis_form':'vis_tax_form', 'vis_switch':'tax','vis_current_module':'<?php echo $operation['vis_current_module']; ?>','vis_current_operation':'<?php echo $operation['vis_current_operation']; ?>', 'vis_is_enable':'0', 'vis_page':'<? echo $view_info['page']; ?>'})"><? echo $vis_language['TXTDISABLE']; ?></a></li>
					</ul>
				</div>
				</div>
				<? }//else ?>
			  </div>
			  <div  class="col-sm-3 text-right text-center-xs tkt_right_menu" id="paging">
				 <select name="pageing" class="form-control input-sm selectpicker pull-right paging v-middle" onchange="$(this).parents('#vis_workpanel_div').visExecution('load_area',{'vis_module':'setting', 'vis_operation':'tax_list', 'vis_page':this.value})">
					<? echo $paging_list;?>
				  </select>
				  <div class="text-muted pull-right label_page"><? echo $vis_language['TXTPAGE']; ?>:</div>
			  </div>
			</div>
			<div class="table-responsive scroll-x">
			<table class="table table-hover b-t b-light m-b-none" data-ride="datatables">
			<thead class="table_head">
				<tr>
					<th>
						<div class="btn-group">
							<label class="checkbox m-n m-r-sm i-checks"  style="float: left;"><input type="checkbox"><i></i></label>
						</div>
					</th>
					<th class="txt_nowrap"><? echo $vis_language['TXTTITLE']; ?></th>
					<th class="txt_nowrap"><? echo $vis_language['TXTCREATEDATE']; ?></th>
					<th class="txt_nowrap"><? echo $vis_language['TXTRATE']; ?></th>
					<th class="txt_nowrap"><? echo $vis_language['TXTDISPLAYORDER']; ?></th>
					<th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>
					<th></th>
                    <th></th>
				</tr>
			</thead>
			<tbody>
			<?
			if($tax!=-1) for($i=0;$i<count($tax);$i++) {
			    if($tax[$i]['is_enabled']==1){ $status = $vis_language['TXTENABLED'];$lbl='vh-green-bg';} else {$status = $vis_language['TXTDISABLED'];$lbl='label-default';}
				echo '<tr><td width="30"><label class="checkbox m-n i-checks"><input type="checkbox" name="vis_global_mass_chk_'.$i.'" id="vis_global_mass_chk_'.$i.'" value="'.$tax[$i]['tax_id'].'" /><i></i></label></td>';
				echo '<td> <a href="#/setting/edit_tax/'.rawurlencode(str_replace('/', ' ', $tax[$i]['tax_name'])).'/'.$tax[$i]['tax_id'].'">'.$tax[$i]['tax_name'].'</a></td>';
				echo '<td><a href="#/setting/edit_tax/'.rawurlencode(str_replace('/', ' ', $tax[$i]['tax_name'])).'/'.$tax[$i]['tax_id'].'">'.format_datetime($tax[$i]['entry_date']).'</a></td><td><a href="#/setting/edit_tax/'.rawurlencode(str_replace('/', ' ', $tax[$i]['tax_name'])).'/'.$tax[$i]['tax_id'].'">'.$tax[$i]['rate'].'</a></td><td><a href="#/setting/edit_tax/'.rawurlencode(str_replace('/', ' ', $tax[$i]['tax_name'])).'/'.$tax[$i]['tax_id'].'">'.$tax[$i]['exec_order'].'</a></td>';
				echo '<td><span class="label '.$lbl.'">'.$status.'</span></td>';
                echo '<td align="right"><a class="link" href="#/setting/clone_tax/'.$tax[$i]['tax_id'].'">'.$vis_language['TXTCLONE'].'</a></td></td>';
				?>
				<td> <a href="javascript:void(0);" title="<? echo $vis_language['TXTDELETE']; ?>" class="text-muted" data-toggle="ajaxModal" data-modal-arguments="vis_module=setting&vis_operation=get_delete_tax&vis_tax_id=<? echo $tax[$i]['tax_id']; ?>&vis_static_area=vis_dl_tax_form&vis_page=<? echo $view_info['page']; ?>" ><i class="vh vh-delete-round"></a></td>
			<? echo '</tr>'; } ?>
			</tbody>
			</table>
			<script type="text/javascript">
				$(".selectpicker").selectpicker();
				$(document).ready(function() {
				$('[data-ride="datatables"]').dataTable({
					   "bpaginate": false,
						"sDom": 't', "bAutoWidth": false,
						"aoColumns": [
							{ "bSortable": false },
							null,
							null,
							null,
							null,
							null,
                            { "bSortable": false },
							{ "bSortable": false }
						]
					});
				});
			</script>
			</div>
			<footer class="wrapper panel-footer bg-white">
			  <div class="row">
				  <div class="col-sm-9 tkt_left_menu">
				<? if(isset($operation['vis_draft']) && $operation['vis_draft']==1) { ?>
				<div class="btn-group">
				  </div>
				<? }
					else { ?>
				<div class="vis_mass_action_footer">
				<div class="btn-group">
				  <button type="button" class="btn bg-empty btn-sm dropdown-toggle action_btn" data-toggle="dropdown">
					<i class="vh vh-action"></i>
					<span class="caret"></span>
				  </button>
					<ul class="dropdown-menu" role="menu">
						<li><a href="javascript:void(0);" onclick="$(this).visExecution('submit_form',{'vis_module':'setting', 'vis_operation':'change_setting_status', 'vis_form':'vis_tax_form', 'vis_switch':'tax','vis_current_module':'<?php echo $operation['vis_current_module']; ?>', 'vis_current_operation':'<?php echo $operation['vis_current_operation']; ?>','vis_is_enable':'1', 'vis_page':'<? echo $view_info['page']; ?>'})"><? echo $vis_language['TXTENABLE']; ?></a></li>
						<li><a href="javascript:void(0);" onclick="$(this).visExecution('submit_form',{'vis_module':'setting', 'vis_operation':'change_setting_status', 'vis_form':'vis_tax_form', 'vis_switch':'tax','vis_current_module':'<?php echo $operation['vis_current_module']; ?>','vis_current_operation':'<?php echo $operation['vis_current_operation']; ?>', 'vis_is_enable':'0', 'vis_page':'<? echo $view_info['page']; ?>'})"><? echo $vis_language['TXTDISABLE']; ?></a></li>
					</ul>
				</div>
				</div>
				<? }//else ?>
			  </div>
			  <div class="col-sm-3 text-right text-center-xs tkt_right_menu" id="paging">
				 <select name="pageing" class="form-control input-sm selectpicker pull-right paging v-middle" onchange="$(this).parents('#vis_workpanel_div').visExecution('load_area',{'vis_module':'setting', 'vis_operation':'tax_list', 'vis_page':this.value})">
					<? echo $paging_list;?>
				  </select>
				  <div class="text-muted pull-right label_page"><? echo $vis_language['TXTPAGE']; ?>:</div>
			  </div>

			  </div>
			</footer>
	</section>
	</form>
</div>
<script src="<?= VIS_PATH_SCRIPT; ?>dropdown_dropup.js"></script>
<?
}
else
{
 include(VIS_PATH_TEMPLATE.'no_record_yet.php');
} ?>
