<div class="col-lg-10 col-lg-offset-1">
	<section class="panel">
		<header class="panel-heading" style="min-height:120px">
			<div class="col-lg-3"> <span> &nbsp; </span> </div>
			<div class="col-lg-6">
				<h4 class="text-center"><i class="fa fa-truck truck_icon"></i><br/> <b> <?php echo $view_type;?> Material</b></h4>
			</div>
			<div class="col-lg-3"><span> &nbsp; </span></div>
		</header>
		<div class="clear"></div>
		<div class="panel-body">
			<form class="form-horizontal"method="post" action="<?php echo base_url();?>commodity_ctrl/insert_meterial/<?php if(isset($ml_data['ml_id'])){ echo $ml_data['ml_id'];}?>">
				<div class="col-lg-12">
					<?php
						if(isset($ml_data['ml_id'])){
					?>
							<div class="form-group col-md-6">
								<label class="col-lg-4 col-sm-4">Material Code</label>
								<div class="col-lg-8">
									<input type="text" class="form-control" name="ml_code" value="<?php if(isset($ml_data['ml_code'])){ echo $ml_data['ml_code'];}?>" readonly required>
								</div>
							</div>
					<?php
						}
					?>
					<div class="form-group col-md-6">
						<label class="col-lg-4 col-sm-4">Material Name</label>
						<div class="col-lg-8">
							<input type="text" class="form-control" name="ml_name" value="<?php if(isset($ml_data['ml_name'])){ echo $ml_data['ml_name'];}?>" required>
						</div>
					</div>
					<div class="form-group col-md-6">
						<label  class="col-lg-4 col-sm-4">Commodity</label>
						<div class="col-lg-8">
							<select class="form-control" name="ml_com_id" required>
                                <option value="">--Select--</option>
								<?php
									foreach($com_list as $com_row){
								?>
                                		<option value="<?php echo $com_row['com_id']; ?>" <?php if(isset($ml_data['ml_com_id']) && $ml_data['ml_com_id']==$com_row['com_id']){ echo "selected=selected";}?>><?php echo $com_row['com_name']; ?></option>
										
								<?php
									}
								?>
                            </select>
						</div>
					</div>
					<div class="form-group col-md-6">
						<label class="col-lg-4 col-sm-4">Unit</label>
						<div class="col-lg-8">
							<select class="form-control" name="ml_unl_id" required>
                                <option value="">--Select--</option>
								<?php
									foreach($unl_list as $unl_row){
								?>
                                		<option value="<?php echo $unl_row['unl_id']; ?>" <?php if(isset($ml_data['ml_unl_id']) && $ml_data['ml_unl_id']==$unl_row['unl_id']){ echo "selected=selected";}?>><?php echo $unl_row['unl_unit']; ?></option>
										
								<?php
									}
								?>

                            </select>
						</div>
					</div>
					<div class="form-group col-md-6">
						<label  class="col-lg-4 col-sm-4">Bags</label>
						<div class="col-lg-8">
							<input type="text" class="form-control" name="ml_total_stock" value="<?php if(isset($ml_data['ml_total_stock'])){ echo $ml_data['ml_total_stock'];}?>" required>
						</div>
					</div>
					
					<div class="form-group col-md-6">
						<label class="col-lg-4 col-sm-4 ">Unit Weight</label>
						<div class="col-lg-8">
							<input type="text" class="form-control" name="ml_unit_kg" value="<?php if(isset($ml_data['ml_unit_kg'])){ echo $ml_data['ml_unit_kg'];}?>" required>
						</div>
					</div>
					

					<div class="form-group col-md-6">
						<div class="col-lg-6">
                            <button type="submit" class="btn btn-success pull-left">Save</button>
                        </div>
					</div>
				</div>
				
			</form>
		</div>
	</section>
</div>