<div class="page-content">
	<div class="page-header position-relative"></div>
	<!--/.page-header-->

	<div class="row-fluid">
		<div class="span12">
			<!--PAGE CONTENT BEGINS-->
			<?php echo $display_inventory;?>
			<div class="row-fluid">
				<div class="span12">
					<div class="widget-box">
						<div class="widget-header widget-header-blue widget-header-flat">
							<h4 class="lighter">Add Inventory</h4>
						</div>
						<div class="widget-body">
							<div class="widget-main">
								<div class="row-fluid">
									<div class="step-content row-fluid position-relative"
										id="step-container">
										<div class="step-pane active">
											<form class="form-horizontal" method="post" action="">
												<div class="row-fluid">

													<div class="control-group">
														<label class="control-label">Item Name </label>
														<div class="controls">
															<input type="text" class="span6" name="item_name" value="<?php if($edit_id['0']=='edit_id') echo $get_inventory['item_name']; else echo $item_name;?>">
														</div>
														<!-- /controls -->
													</div>
													
													<div class="control-group">
														<label class="control-label">Item Code </label>
														<div class="controls">
															<input type="text" class="span6" name="item_code" value="<?php if($edit_id['0']=='edit_id') echo $get_inventory['item_code']; else echo $item_code;?>">
														</div>
														<!-- /controls -->
													</div>
													
																										
													<div class="control-group">
													<label class="control-label">Purchase Date </label>
														<div class="controls">
														<div class="input-append">
															<input name="purchase_date" class="span12 date-picker" id="id-date-picker-1" 
															type="text" data-date-format="dd-mm-yyyy" value="<?php if($edit_id['0']=='edit_id') echo $get_inventory['purchase_date']; else echo $purchase_date;?>" />
															<span class="add-on">
																<i class="icon-calendar"></i>
															</span>
														</div>
														</div>
													</div>
													
													<div class="control-group">
														<label class="control-label">Location </label>
														<div class="controls">
															<select name="location">
															<option value="0">-------- Select Location --------</option>
															<?php 
															$get_location = $db->get_all('location');
															if(is_array($get_location)){
															foreach($get_location as $location){
																if($get_inventory['location']==$location['name']){
																	?>
																<option value="<?php echo $location['name'];?>" selected="selected"><?php echo $location['name'];?></option>
															<?php }else{
																?>
																<option value="<?php echo $location['name'];?>"><?php echo $location['name'];?></option>
																<?php } } }?>
															</select>
														</div>
														<!-- /controls -->
													</div>
													
													<div class="control-group">
														<label class="control-label">Item Amount </label>
														<div class="controls">
															<input type="text" class="span6" name="item_amount" value="<?php if($edit_id['0']=='edit_id') echo $get_inventory['item_amount']; else echo $item_amount;?>">
														</div>
														<!-- /controls -->
													</div>
													
												<div class="control-group">
														<label class="control-label">Installment </label>
														<div class="controls">
															<select name="installment" <?php if($edit_id['0']=='edit_id'){?> disabled="disabled" <?php }?>>
															<option value="0">------- Select Installment --------</option>
															<?php
															if($edit_id['0']=='edit_id'){
															if($get_inventory['installment']=='1'){?>
															<option value="1" selected="selected" id="installment_yes">Yes</option>
															<option value="2" id="installment_no">No</option>
															<?php }elseif($get_inventory['installment']=='2'){
																?>
															<option value="2" selected="selected" id="installment_no">No</option>
															<option value="1" id="installment_yes">Yes</option>
															<?php } }else{?>
															<option value="1" id="installment_yes">Yes</option>
															<option value="2" id="installment_no">No</option>
															<?php }?>
															</select>
														</div>
														<!-- /controls -->
													</div>
													<div <?php if($get_inventory['installment']!='1'){?> id="hide-pay-amount" style="display:none;" <?php }?>>	`
													<div class="row-fluid">
													<div class="span12">
													<div class="span6">
													<div class="control-group">
													<label class="control-label">Payment Amount </label>
														<div class="controls">
															<input name="payment_amount" class="span12" type="text" value="<?php 
															if($edit_id['0']=='edit_id') {
																$amount_ins=unserialize($get_inventory['payment_amount']);
																foreach($amount_ins as $a){
																	echo $a.',';
																}															
														} else echo $payment_amount;?>"/>
														</div>
													</div>
													</div>
													<div class="span6">
													<div class="control-group">
													<label class="control-label">Payment Date </label>
														<div class="controls">
														<div class="input-append">
															<input name="payment_date" class="span12 date-picker" 
															type="text" data-date-format="dd-mm-yyyy" value="<?php 
if($edit_id['0']=='edit_id') {
																$date_ins=unserialize($get_inventory['payment_date']);
																foreach($date_ins as $d){
																	echo $d.',';
																}															
														  }else echo $payment_date;?>"/>
															<span class="add-on">
																<i class="icon-calendar"></i>
															</span>
														</div>
														</div>
													</div>
													</div>
													</div>
													</div>
													</div>
												<!-- 	<div id="add-amt-date">
													<div class="row-fluid">
													<div class="span12">
													<div class="span10"></div>
													<div class="span2 text-success" id="add-content" style="padding-left:35px;cursor: pointer;"><input onclick="addRow(this.form);" type="button" value="Add row" /></div>
													</div>
													</div>													
													</div> -->
													
													<div class="control-group">
														<div class="controls">
															<span class="span12"> <input type="hidden" name="check"
																value="inventory">
																<button type="submit" name="inventory_submit"
																	class="btn btn-small btn-primary">Save</button>
															</span>
														</div>
														<!-- controls -->
													</div>
													<!-- control group -->


												</div>
												<!-- row fluid -->

											</form>
										</div>
									</div>



								</div>
								<!-- rowfluid -->
							</div>
							<!--/widget-main-->
						</div>
						<!--/widget-body-->
					</div>
					<!-- widget-box -->
				</div>
				<!-- span12 -->
			</div>
			<!-- row fluid -->

			<!--PAGE CONTENT ENDS-->
		</div>
		<!--/.span-->
	</div>
	<!--/.row-fluid-->
</div>
<!--/.page-content-->


</div>
<!--/.main-content-->

