<html class="noLogin-repair-bg">
<div class="app flex-row align-items-center">
  <div class="container ">
    <div class="row justify-content-center">
      <!-- <h1 class="loginPageTitle">免登入報修</h1> -->
      <div class="col-md-8">

        <div class="card-group mb-0 ">
          <div class="card loginCard p-4 ">
            <div class="card-body ">
              <form #knownLightRepair="ngForm">
                <div class="form-group">
                  <label for="questionType">問題分類</label>
                  <span *ngIf="questionType.invalid && (questionType.dirty || questionType.touched)">
                    <span class="invalidMessage" *ngIf="questionType?.errors.required">*此欄必填</span>
                  </span>
                  <select class="form-control" name="questionType" #questionType="ngModel" [(ngModel)]="repairData.questionType">
                    <option value= 0>系統操作問題</option>
                    <option value= 1>違規照片問題</option>
                  </select>
                </div>
                <div class="form-group">
                  <label for="title">標題</label>
                  <span *ngIf="title.invalid && (title.dirty || title.touched)">
                    <span class="invalidMessage" *ngIf="title?.errors.required">*此欄必填</span>
                  </span>
                  <input type="text" class="form-control" id="title" name="title" #title="ngModel" [(ngModel)]="repairData.title"
                    required placeholder="標題">
                </div>
                <div class="form-group">
                  <label for="content">問題描述</label>
                  <span *ngIf="content.invalid && (content.dirty || content.touched)">
                    <span class="invalidMessage" *ngIf="content?.errors.required">*此欄必填</span>
                  </span>
                  <textarea type="text" class="form-control" id="content" name="content" #content="ngModel" [(ngModel)]="repairData.content" placeholder="問題描述"></textarea>
                </div>
                <div class="form-group" *ngIf="repairData.questionType == 1">
                  <label for="sendto">故障站點</label>
                    <select class="form-control" [(ngModel)]="repairData.sendTo" name="email">
                      <option [ngValue]="siteInfo.CompanyEmail" *ngFor="let siteInfo of siteInformationList" >{{siteInfo.SiteName}}</option>
                    </select>
                </div>
                <div class="btn-footer">
                  <button type="button" class="btn btn-bar btn-danger" (click) = "backPreviousPage()">
                    <i class=" fa fa-chevron-left " aria-hidden="true "></i> 回上一頁</button>
                    <button type="submit" class="btn btn-success" [disabled]="!knownLightRepair.form.valid || !isLightNoExisted || result!=null" (click)="postRepairFormData()">送出
                    <i class=" fa fa-chevron-right " aria-hidden="true "></i>
                  </button>
                </div>
              </form>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
</html>
