<style>
	#sample_editable_1_filter{
	float: right!important;
	}
</style>
<?php if(getCompany($_SESSION['user_id']) == 0){ ?>
<center style="margin-top:70px">
Please complete your <strong><a href="/company/edit">Company Information</a></strong> to proceed.
<?php }else{ ?>
<div class="row">
	<div class="col-md-12">
		<div class="portlet box blue-hoki" id="form_wizard_1">
			<div class="portlet-title">
				<div class="caption">
					<i class=" icon-layers"></i>
					<span class="caption-subject sbold uppercase"> Create Purchase Order -
					<span class="step-title"> Step 1 of 3 </span>
					</span>
				</div>
			</div>
			<div class="portlet-body form">
				<form id="stepy_form" class="form-horizontal" method="POST">
					<div class="form-wizard">
						<div class="form-body">
							<ul class="nav nav-pills nav-justified steps">
								<li>
									<a href="#tab1" data-toggle="tab" class="step">
									<span class="number"> 1 </span>
									<span class="desc">
									<i class="fa fa-check"></i> Buyer & Forwarder </span>
									</a>
								</li>
								<li>
									<a href="#tab2" data-toggle="tab" class="step">
									<span class="number"> 2 </span>
									<span class="desc">
									<i class="fa fa-check"></i> Seller </span>
									</a>
								</li>
								<li>
									<a href="#tab3" data-toggle="tab" class="step">
									<span class="number"> 3 </span>
									<span class="desc">
									<i class="fa fa-check"></i> Items </span>
									</a>
								</li>
							</ul>
							<div id="bar" class="progress progress-striped" role="progressbar">
								<div class="progress-bar progress-bar-success"> </div>
							</div>
							<div class="tab-content">
								<div id='suksesupdate' class="alert alert-success alert-block fade in" style='display:none;'>
									<strong><i class="icon-ok-sign"></i>Success!</strong>Yehaa.. Your pasword has been updated. Reload page in few seconds..
								</div>
								<div id='gagalupdate' class="alert alert-danger alert-block fade in" style='display:none;'>
									<strong><i class="icon-ok-sign"></i>Whoops!</strong>
									<h4>
									You have some form errors. Please check below. 
								</div>
								<div class="tab-pane active" id="tab1">
									<h4 class="block"><span class="caption-subject font-dark bold uppercase">Buyer & Forwarder Details</span></h4>
									<h4 class="form-section">List Forwarder</h4>
									<div class="form-group forwarder_id">
										<label class="control-label col-md-3">Forwarder 
										<i class="fa fa-info-circle tooltips" data-placement="bottom" data-original-title="Choose followed or you can follow new company by choosing Follow New Company."></i>
										</label>
										<div class="col-md-4">
											<p id="select_forwarder" style="margin-top: 5px;" class="contact-list"><a>Please select forwarder</a></p>
											<input style="display:none;" class="form-control" name="forwarder_id" id="forwarder_id"/>
											<p id="forwarder" style="margin-top: 5px;"  class="contact-list"></p>
										</div>
									</div>
									<h4 class="form-section">Buyer Details</h4>
									<!--<div class="form-group">
										<label class="control-label col-md-3">Marking Number</label>
										<div class="col-md-4">
											<input class=" form-control" id="marking_no" name="marking_no" minlength="2" type="text" readonly />
										</div>
										</div>-->
									<div class="form-group">
										<label class="control-label col-md-3">Purchase Number</label>
										<div class="col-md-4">
											<input class=" form-control" id="purchase_no" name="purchase_no" minlength="2" type="text"  />
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3">Company Name</label>
										<div class="col-md-4">
											<input class=" form-control" id="company_name" name="company_name"  value="<?php echo getCompanyData($_SESSION['user_id'], "user_id", "name");?>" minlength="2" type="text"  />
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3">Tax No</label>
										<div class="col-md-4">
											<input class="form-control" name="company_tax_no" id="company_tax_no" value="<?php echo getCompanyData($_SESSION['user_id'], "user_id", "tax_no");?>" type="text"  />
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3">Company Address</label>
										<div class="col-md-4">
											<input class="form-control" name="company_address" id="company_address" value="<?php echo getCompanyData($_SESSION['user_id'], "user_id", "address");?>" type="text"  />
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3">Company City</label>
										<div class="col-md-4">
											<input class="form-control" name="company_city" id="company_city" value="<?php echo getCompanyData($_SESSION['user_id'], "user_id", "city");?>" type="text"  />
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3">Company Zip</label>
										<div class="col-md-4">
											<input class="form-control" name="company_zip" id="company_zip" value="<?php echo getCompanyData($_SESSION['user_id'], "user_id", "zip");?>" type="text"  />
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3">Company State</label>
										<div class="col-md-4">
											<input class="form-control" name="company_state" id="company_state" value="<?php echo getCompanyData($_SESSION['user_id'], "user_id", "state");?>" type="text"  />
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3">Company Country</label>
										<div class="col-md-4">
											<input class="form-control" name="company_country" id="company_country" value="<?php echo getCompanyData($_SESSION['user_id'], "user_id", "country");?>" type="text"  />
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3">Contact Person</label>
										<div class="col-md-4">
											<input class="form-control" name="company_contact_person" id="company_contact_person" value="<?php echo getCompanyData($_SESSION['user_id'], "user_id", "contact_person");?>" type="text"  />
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3">Contact Person No</label>
										<div class="col-md-4">
											<input class="form-control" name="company_contact_person_no" id="company_contact_person_no" value="<?php echo getCompanyData($_SESSION['user_id'], "user_id", "contact_person_no");?>" type="text"  />
										</div>
									</div>
								</div>
								<div class="tab-pane" id="tab2">
									<h4 class="block"><span class="caption-subject font-dark bold uppercase">Seller Details</span></h4>
									<h4 class="form-section">Supplier Details</h4>
									<div class="form-group">
										<label class="control-label col-md-3">Supplier Company Name</label>
										<div class="col-md-4">
											<input class="form-control" name="supplier_company_name" id="supplier_company_name" type="text"  />
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3">Contact Person</label>
										<div class="col-md-4">
											<input class="form-control" name="supplier_contact_person" id="supplier_contact_person" type="text"  />
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3">Contact Person No</label>
										<div class="col-md-4">
											<input class="form-control" name="supplier_contact_person_no" id="supplier_contact_person_no" type="text"  />
										</div>
									</div>
									<h4 class="form-section">Bank Details</h4>
									<div class="form-group">
										<label class="control-label col-md-3">Bank Name</label>
										<div class="col-md-4">
											<input class="form-control" name="bank_name" id="bank_name" type="text" />
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3">Bank Address</label>
										<div class="col-md-4">
											<input class="form-control" name="bank_address" id="bank_address" type="text" />
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3">Account No</label>
										<div class="col-md-4">
											<input class="form-control" name="bank_acc_no" id="bank_acc_no" type="text" />
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3">Swift Code</label>
										<div class="col-md-4">
											<input class="form-control" name="bank_swiftcode" id="bank_swiftcode" type="text" />
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3">Choose Currency</label>
										<div class="col-md-4">
											<select class="form-control" onchange="" name="order_currency" id="order_currency">
												<option>Please choose your currency</option>
												<option value="USD">United States of America (USD)</option>
												<option value="RMB">China (RMB)</option>
												<option value="MYR">Malaysia (MYR)</option>
											</select>
										</div>
									</div>
									<!--<div class="form-group">
										<div class="mt-repeater">
											<div data-repeater-list="custom_form">
												<div data-repeater-item class="row">
													<div class="col-md-12" style="margin-bottom:10px">
														<div class="col-md-1">
														</div>
														<div class="col-md-2">
															<input type="text" placeholder="Form Name" name="form_name" id="form_name" class="form-control" /> 
														</div>
														<div class="col-md-4"> 
															<input type="text" placeholder="Form Value"  name="form_value" id="form_value" class="form-control" /> 
														</div>
														<div class="col-md-1">
															<a href="javascript:;" data-repeater-delete class="btn btn-danger">
															<i class="fa fa-close"></i>
															</a>
														</div>
													</div>
												</div>
											</div>
											<hr>
											<div class="col-md-12">
												<div class="col-md-1">
												</div>
												<div class="col-md-2">
													<a href="javascript:;" data-repeater-create class="btn btn-info mt-repeater-add">
													<i class="fa fa-plus"></i> Add New Input
													</a>
												</div>
											</div>
										</div>
									</div>-->
								</div>
								<div class="tab-pane" id="tab3">
									<h4 class="block"><span class="caption-subject font-dark bold uppercase">Items</span></h4>
									<div class="table-toolbar">
										<div class="row">
											<div class="col-md-6">
											</div>
										</div>
									</div>
									<table class="table table-striped table-hover table-bordered" id="sample_editable_1">
										<thead>
											<tr>
												<th> No   		 </th>
												<th> Product Name</th>
												<th> Item Code   </th>
												<th> Model No    </th>
												<th> Description </th>
												<th> Quantity    </th>
												<th> UOM         </th>
												<th> Unit Price  </th>
												<th> Sub Total   </th>
												<th> Actions     </th>
											</tr>
										</thead>
										<tbody>
										</tbody>
										<tfoot>
											<tr>
												<td colspan="8">
													<center>
														<a id="sample_editable_1_new" class="btn green">
														<i class="fa fa-plus"></i>
														</a>
													</center>
												</td>
											</tr>
										</tfoot>
									</table>
									<div class="row">
										<div class="col-md-6">
											<div class="form-group">
												<label class="control-label col-md-3">Remark</label>
												<div class="col-md-9">
													<textarea name="item_remark" id="item_remark" class="form-control" rows="5" aria-invalid="false"></textarea>
												</div>
											</div>
										</div>
										<div class="col-md-6">
											<div class="well">
												<div class="row static-info align-reverse">
													<div class="col-md-3 name"> Total: </div>
													<div class="col-md-8 value"> <span id="currency" class="currency"></span> <span id="total" class="total">0.00</span> </div>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
							<div class="form-actions">
								<div class="row  pull-right">
									<div class="col-md-12">
										<a href="javascript:;" class="btn default button-previous">
										<i class="fa fa-angle-left"></i> Back </a>
										<a href="javascript:;" class="btn btn-outline green button-next"> Continue
										<i class="fa fa-angle-right"></i>
										</a>
										<button type="submit" class="btn green button-submit" id="finish"> Finish!</button>
									</div>
								</div>
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
<div class="modal fade" id="modal_success" role="basic" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-body">
				<div class="row text-center">
					<div class="col-sm-6 col-sm-offset-3">
						<h2 style="margin-top:10px" class="font-green-meadow">Success</h2>
						<i class="fa fa-check-circle fa-6 font-green-meadow" style="margin-top:30px;font-size: 80px;" aria-hidden="true"></i>
						<div id="success-content">
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div class="modal fade" id="form_contact_list" role="basic" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
				<h4 class="modal-title">Contact List</h4>
			</div>
			<div class="modal-body">
				<?php if($_SESSION['group_id'] == 2){ ?>
				<div class="row" style="margin-bottom:10px;">
					<div class="col-md-6 col-sm-6">
					</div>
					<div class="col-md-6 col-sm-6">
						<div class="pull-right">
							<a href="/companies" target="_blank" class="btn blue btn-circle exit"> Add New <i class="fa fa-plus"></i></a>
						</div>
					</div>
				</div>
				<?php } ?>
				<table class="table table-striped table-hover table-bordered" id="contact">
				<thead>
					<tr>
						<th>
							<center>Company Logo</center>
						</th>
						<th>
							<center>Name</center>
						</th>
						<th>
							<center>Office Number</center>
						</th>
						<th>
							<center>Status</center>
						</th>
						<th>
							<center>Action</center>
						</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td class="table-status"></td>
						<td class="table-title"></td>
						<td class="table-title"></td>
						<td class="table-title"></td>
						<td class="table-title"></td>
					</tr>
				</tbody>
			</table>
			</div>
			<div class="modal-footer">
				<a class="btn dark btn-outline" class="close" data-dismiss="modal" aria-hidden="true">Close</a>
				<a class="btn btn-primary" class="close" data-dismiss="modal" aria-hidden="true">Save Changes</a>
			</div>
			</form>
		</div>
		<!-- /.modal-content -->
	</div>
	<!-- /.modal-dialog -->
</div>
<div class="modal fade" id="modal_success" role="basic" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-body">
				<div id="success-content"></div>
			</div>
		</div>
	</div>
</div>
<div class="modal fade in" id="user-detail" tabindex="-1" role="basic" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
			</div>
			<div class="modal-body" id="getCode"> 
			</div>
		</div>
	</div>
</div>
<div class="modal fade in" id="add-user" tabindex="-1" role="basic" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
			</div>
			<div class="modal-body form">
				<div class="form-horizontal form-row-seperated">
					<div class="form-group">
						<div class="col-md-12">
							<div class="input-group">
								<input type="text" id="typeahead_example_modal_3" name="typeahead_example_modal_3" class="form-control" />
								<span class="input-group-addon">
								<i class="fa fa-search" aria-hidden="true"></i>
								</span>
							</div>
						</div>
					</div>
					<div id="getCode2">
						<div class="row">
							<br>
							<center>No result found.</center>
							<br>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<?php } ?>