<script type="text/javascript">
$(document).ready(function() {
    /* Build the DataTable with third column using our custom sort functions */
    var oTable = $("#test").dataTable( {
        "iDisplayLength": 25,
		 "aLengthMenu": [5,10,25,50,100],
		 "asSorting": [ "asc"], "aTargets": [ 1 ],
		 "sPaginationType": "full_numbers", "aoColumns": [  
			null, 
			null, 
			null, 
			null, 
			null, 
			null, 
			null, 
			 ]});
     oTable.fnSort( [ [1,'asc'] ] );
}); 


</script>
<div id="content">                        
<div class="wrap">
                  
<div class="head">
	<div class="info">
		<h1><?php echo element('compName', $this->session->userdata('logged_in')) ?> [ 
			<?php echo element('compNo', $this->session->userdata('logged_in')) ?> ]</h1>
			<ul class="breadcrumb">
            	<li><a href='<?php echo base_url()."home" ?>'><?php echo $this->lang->line('dashboard') ?></a> <span class="divider">-</span></li>
                <li><a href='<?php echo base_url()."ic/home" ?>'> <?php echo $this->lang->line('module') ?></a> <span class="divider">-</span></li>
                <li class="active"><?php echo $this->lang->line('title') ?></li>
            </ul>
	</div>
                        
	<div class="search">
		<form action="<?php echo base_url() ?>admin/search" method="post">
			<input name="search_text" type="text" placeholder="search..."/>                                
            <button type="submit"><span class="i-magnifier"></span></button>
		</form>
	</div>                        
</div>  <!-- Head -->                                                                  
<div class="row-fluid">
	<div class="span12">
			<?php 
				$hidden = array('order_time' => date('Y-m-d H-i-s'),
					'ID' => $header->ID);
				$attrib = array('id'=>'validate'); 
				echo form_open('', $attrib, $hidden);?>
            	<div class="block">
                	<div class="head">
                    	<h2><?php echo $this->lang->line('title') ?></h2>
				</div>
			<div class="content np">
            	<div class="controls-row"><!-- Row 4-->
                	<div id="gallery">
                        	<div class="pic" align="center">
                            <?php if($header->imageFile){?>
                            	<a class="fancybox" href="<?php echo base_url(). 'images/' .  $header->imageFile ?>">
                                	<img class="img-polaroid" src="<?php echo base_url(). 'images/thumbs/' . $header->imageFile;?>" />
                                </a>
                            <?php } ?>
                            </div>
                    </div>
           		</div><!-- End Row 4-->
                	<div class="controls-row">
            		<div class="span2"><?php echo $this->lang->line('itemCode') ?></div>
                   	<div class="span10">
                            	<?php 								
								$data = array(
									'name'=>'itemCode', 
									'id'=>'itemCode', 
									'disabled'=>'itemCode', 
									'class'=>'span5',); 
								echo form_input($data, $header->itemCode); ?>
                  </div>
                  </div>
                	<div class="controls-row">
            		<div class="span2"><?php echo $this->lang->line('itemName') ?></div>
                   	<div class="span10">
                            	<?php 								
								$data = array(
									'name'=>'name', 
									'id'=>'name', 
									'disabled'=>'name', 
									'class'=>'span5',); 
								echo form_input($data, $header->name); ?>
                  </div>
                  </div>
                	<div class="controls-row">
            		<div class="span2"><?php echo $this->lang->line('itemDescription') ?></div>
                   	<div class="span10">
                            	<?php 								
								$data = array(
									'name'=>'description', 
									'id'=>'description', 
									'disabled'=>'description', 
									'class'=>'span12',); 
								echo form_input($data, $header->description); ?>
                  </div>
                  </div>
         </div> <!-- Block grid-->                                   
      </div> <!-- scCol-->                                   
     </div> <!-- row-fluid scRow-->                                   
	<div class="row-fluid scRow">                            
	  <div class="span12 scCol">
	 	<div class="block" id="journalTable">
            	<div class="head">
                	<h2><?php echo $this->lang->line('details') ?></h2>
                    	<ul class="buttons">
                        </ul>                                        
                </div>
          	<div class="content np table-sorting">
            	<table cellpadding="0" cellspacing="0" width="100%" id="test" class="editable">
                	<thead>
                    <tr>
            			<th style="display:none"></th>
            			<th width="5">#</th>
            			<th><?php echo $this->lang->line('location')?></th>
            			<th><?php echo $this->lang->line('description')?></th>
            			<th><?php echo $this->lang->line('address')?></th>
            			<th class="tac"><?php echo $this->lang->line('um')?></th>
            			<th class="tar"><?php echo $this->lang->line('qthOH')?></th>
            		</tr>
        			</thead>
       				 <tbody>
			<?php $bil = 0;
				if($datatbls){
				foreach($datatbls as $datatbl):
				$bil++?>
            	<tr>
                	<td id="fldid"  style="display:none"><?php echo $datatbl->ID; ?></td>
                	<td><?php echo $bil; ?></td>
                	<td id="locCode"><?php echo $datatbl->locCode; ?></td>
                	<td id="desc"><?php echo $datatbl->desc; ?></td>
                	<td id="address"><?php echo $datatbl->address; ?><br><?php echo $datatbl->city; ?>&nbsp;&nbsp;&nbsp;<?php echo $datatbl->stateName; ?></td>
                	<td class="tac" id="umCode"><?php echo $datatbl->umCode; ?></td>
                	<td class="tar" id="onHandQty"><?php echo $datatbl->onHandQty; ?></td>
                </tr>
            <?php endforeach; }?>
					</tbody>
			</table>                                         
			</div><!-- content -->
            <div class="footer">
            	<div class="side fr">
                	<div class="btn-group">
                    </div>
                </div>
            </div>                                    
			</div><!-- content -->
		</div><!-- block -->
        </form>
	</div><!-- span12 -->
</div><!-- fluid -->
</div>
</div>
