<?php
$this->load->view('admin/templates/header.php');
extract($privileges);
?>
<div id="content">
		<div class="grid_container">
			<?php 
				$attributes = array('id' => 'display_form');
				echo form_open('admin/location/change_location_status_global',$attributes) 
			?>
			<div class="grid_12">
				<div class="widget_wrap">
					<div class="widget_top">
						<span class="h_icon blocks_images"></span>
						<h6><?php echo $heading?></h6>
						<!--<div style="float: right;line-height:40px;padding:0px 10px;height:39px;">
						<?php if ($allPrev == '1' || in_array('2', $location)){?>
							<div class="btn_30_light" style="height: 29px;">
								<a href="javascript:void(0)" onclick="return checkBoxValidationAdmin('Active');" class="tipTop" title="Select any checkbox and click here to active records"><span class="icon accept_co"></span><span class="btn_link">Active</span></a>
							</div>
							<div class="btn_30_light" style="height: 29px;">
								<a href="javascript:void(0)" onclick="return checkBoxValidationAdmin('Inactive');" class="tipTop" title="Select any checkbox and click here to inactive records"><span class="icon delete_co"></span><span class="btn_link">Inactive</span></a>
							</div>
						<?php 
						}
						if ($allPrev == '1' || in_array('3', $location)){
						?>
							<div class="btn_30_light" style="height: 29px;">
								<a href="javascript:void(0)" onclick="return checkBoxValidationAdmin('Delete');" class="tipTop" title="Select any checkbox and click here to delete records"><span class="icon cross_co"></span><span class="btn_link">Delete</span></a>
							</div>
						<?php }?>
						</div>-->
					</div>
					<div class="widget_content">
						<table class="display" id="location_tbl">
						<thead>
						<tr>
							
							<th class="tip_top" title="Click to sort">
								 Location Name
							</th>
							<th class="center">
                            Symbol
							</th>
                            <th class="center" title="Click to sort">
                            Currency
							</th>
                            <th class="center" title="Click to sort">
								Country Shipping Cost
							</th> 
                            <th class="center" title="Click to sort">
								Country Tax
							</th> 
                            <th>
								Zones
							</th>
                            <th>
								Status
							</th>
							<th>
								Action
							</th>
						</tr>
						</thead>
						<tbody>
						<?php 
						if ($locationList->num_rows() > 0){
							foreach ($locationList->result() as $row){
						?>
						<tr>
							
							<td class="center  tr_select">
								<?php echo $row->name;?>
							</td>
							<td class="center tr_select ">
                                <?php echo html_entity_decode($row->currency_symbol);?>
							</td>
                            <td class="center tr_select ">
                                <?php echo $row->currency_type;?>
							</td>
                             <td class="center tr_select ">
                                <?php echo $row->shipping_cost;?>
							</td>
                            <td class="center tr_select ">
                                <?php echo $row->shipping_tax;?>
							</td>
                            <td class="center"> 
                            <div class="btn_30_light">
                                <a href="admin/location/display_tax_statelist/<?php echo $row->id;?>" class="tipTop" title="View Zones">
                                <span class="icon zones_co"></span>
                                <span class="btn_link">Zones</span>
                                </a>
                            </div>
                           
							</td>
							<td class="center">
							<?php 
							if ($allPrev == '1' || in_array('2', $location)){
								$mode = ($row->status == 'Active')?'0':'1';
								if ($mode == '0'){
							?>
								<span class="badge_style b_done">Active</span>
							<?php
								}else {	
							?>
								<span class="badge_style">InActive</span>
							<?php 
								}
							}else {
							?>
							<span class="badge_style b_done"><?php echo $row->status;?></span>
							<?php }?>
							</td>
							<td class="center">
							<?php if ($allPrev == '1' || in_array('2', $location)){?>
								<span><a class="action-icons c-edit" href="admin/location/edit_location_form/<?php echo $row->id;?>" title="Edit">Edit</a></span>
							<?php }?>
								<span><a class="action-icons c-suspend" href="admin/location/view_location/<?php echo $row->id;?>" title="View">View</a></span>
							<?php if ($allPrev == '1' || in_array('3', $location)){
							
							if($row->status!='Active'){
							
							?>
                            	
								<span><a class="action-icons c-delete" href="javascript:confirm_delete('admin/location/delete_location/<?php echo $row->id;?>')" title="Delete">Delete</a></span>
							<?php } }?>
							</td>
						</tr>
						<?php 
							}
						}
						?>
						</tbody>
						<tfoot>
						<tr>
							
							<th>
								 Location Name
							</th>
							<th class="center">
								Symbol
							</th>
							<th>
								 Currency
							</th>
                            <th>
								Country Tax
							</th>
                            <th>
								Zones
							</th>
                            <th>
								 Default
							</th>
							<th>
								 Action
							</th>
						</tr></tfoot>
						</table>
					</div>
				</div>
			</div>
			<input type="hidden" name="statusMode" id="statusMode"/>
		</form>	
			
		</div>
		<span class="clear"></span>
	</div>
</div>
<?php 
$this->load->view('admin/templates/footer.php');
?>