<div class="col-lg-9">
	<section class="panel form-wizard" id="w1">
		<header class="panel-heading">
			<h2 class="panel-title">上傳BIM元件</h2>
		</header>
		<div class="panel-body panel-body-nopadding">
			<div class="wizard-tabs">
				<ul class="wizard-steps">
					<li class="active">
						<a href="#w1-account" data-toggle="tab" class="text-center">
							<span class="badge hidden-xs">1</span>
							選擇檔案及類別
						</a>
					</li>
					<li>
						<a href="#w1-profile" data-toggle="tab" class="text-center">
							<span class="badge hidden-xs">2</span>
							填寫詳細資料
						</a>
					</li>
				</ul>
			</div>
			<form class="form-horizontal" novalidate="novalidate">
				<div class="tab-content">
					<div id="w1-account" class="tab-pane active">
						<div class="form-group">
							<label class="col-md-1 control-label">rfa上傳</label>
							<div class="col-md-6">
								<div class="fileupload fileupload-new" data-provides="fileupload">
									<div class="input-append">
										<div class="uneditable-input">
											<i class="fa fa-file fileupload-exists"></i>
											<span class="fileupload-preview"></span>
										</div>
										<span class="btn btn-default btn-file">
											<span class="fileupload-exists">變更檔案</span>
											<span class="fileupload-new">選擇檔案</span>
											<input type="file" />
										</span>
										<a href="#" class="btn btn-default fileupload-exists" data-dismiss="fileupload">移除檔案</a>
									</div>
								</div>
							</div>
						</div>												
					<div class="form-group">
						<label class="col-md-1 control-label">glb上傳</label>
						<div class="col-md-6">
							<div class="fileupload fileupload-new" data-provides="fileupload">
								<div class="input-append">
									<div class="uneditable-input">
										<i class="fa fa-file fileupload-exists"></i>
										<span class="fileupload-preview"></span>
									</div>
									<span class="btn btn-default btn-file">
										<span class="fileupload-exists">變更檔案</span>
										<span class="fileupload-new">選擇檔案</span>
										<input type="file" />
									</span>
									<a href="#" class="btn btn-default fileupload-exists" data-dismiss="fileupload">移除檔案</a>
								</div>
							</div>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-1 control-label">設備類別</label>
	
						<div class="col-sm-3">
						<select class="form-control mb-md">
							<?php include("./script/php/equipment_converter.php");
								foreach($equipment_name as $key => $name){										
									$js =  '<option value="'.$equipment_code[$key].'">'.$name.'</option>';
									echo($js);
								}											
							?>
							</select>
						</div>
					</div>		
				</div>
					<div id="w1-profile" class="tab-pane">
						<?php 
							include("./script/php/connectSQL_Component.php");												  
							$type = "CA";
							$COLUMN_NAME = [];
							$sql = "SELECT COLUMN_NAME 
							FROM INFORMATION_SCHEMA.COLUMNS
							WHERE TABLE_NAME = 'Arch_MEP_".$type."' ";
							$fetchResult = sqlsrv_query($conn, $sql);
							while($row = sqlsrv_fetch_array($fetchResult)){
								if($row["COLUMN_NAME"]!='id' && $row["COLUMN_NAME"]!='filePath')
								array_push($COLUMN_NAME,$row["COLUMN_NAME"]);
							}											
							$string = file_get_contents("./assets/columnTable.json");
							$json = json_decode($string, true);
							foreach($COLUMN_NAME as $key => $value){
								if($key % 4 == 0){
									echo('<div class="form-group">
									<label class="col-md-1 control-label" for="inputDefault">'.$json[0][$COLUMN_NAME[$key]].'</label>
									<div class="col-md-2">
										<input type="text" class="form-control" id="inputDefault">
									</div>');
								if($key + 1 < count($COLUMN_NAME))
									echo('<label class="col-md-1 control-label" for="inputDefault">'.$json[0][$COLUMN_NAME[$key+1]].'</label>
									<div class="col-md-2">
										<input type="text" class="form-control" id="inputDefault">
									</div>');
								if($key + 2 < count($COLUMN_NAME))
								echo('<label class="col-md-1 control-label" for="inputDefault">'.$json[0][$COLUMN_NAME[$key+2]].'</label>
									<div class="col-md-2">
										<input type="text" class="form-control" id="inputDefault">
									</div>');
								if($key + 3 < count($COLUMN_NAME))
									echo('<label class="col-md-1 control-label" for="inputDefault">'.$json[0][$COLUMN_NAME[$key+3]].'</label>
									<div class="col-md-2">
										<input type="text" class="form-control" id="inputDefault">
									</div>');								
									echo('</div>');
							
									
								}
								
							}
							sqlsrv_close( $conn );
						?>
					</div>
				</div>
			</form>
		</div>
		<div class="panel-footer">
			<ul class="pager">
				<li class="previous disabled">
					<a><i class="fa fa-angle-left"></i> 上一步</a>
				</li>
				<li class="finish hidden pull-right">
					<a>完成送出</a>
				</li>
				<li class="next">
					<a>下一步 <i class="fa fa-angle-right"></i></a>
				</li>
			</ul>
		</div>
	</section>
</div>