 <section class="content-header">
    <h1>
        {{phrase.Transportation}}
    </h1>
</section>


<section class="content" ng-show="views.list">
  <a ng-if="userRole == 'admin'" ng-click="changeView('add')" class="floatRTL btn btn-success btn-flat pull-right marginBottom15">{{phrase.addTransport}}</a>  
  <div class="box col-xs-12">
      <div class="box-header">
          <h3 class="box-title">{{phrase.listTransport}}</h3>
          <div class="box-tools">
              <div class="input-group">
                  <input type="text" name="table_search" ng-model="searchText" class="form-control input-sm pull-right" style="width: 150px;" placeholder="{{phrase.Search}}">
                  <div class="input-group-btn">
                      <button class="btn btn-sm btn-default"><i class="fa fa-search"></i></button>
                  </div>
              </div>
          </div>
      </div>
      <div class="box-body table-responsive">
          <table class="table table-hover">
              <tbody><tr>
                  <th>{{phrase.ID}}</th>
                  <th>{{phrase.transportTitle}}</th>
                  <th>{{phrase.transportDesc}}</th>
                  <th>{{phrase.driverContact}}</th>
                  <th>{{phrase.Fare}}</th>
                  <th>{{phrase.Operations}}</th>
              </tr>
              <tr ng-repeat="transport in transports | filter:searchText">
                  <td>{{transport.id}}</td>
                  <td>{{transport.transportTitle}}</td>
                  <td>{{transport.transportDescription}}</td>
                  <td>{{transport.transportDriverContact}}</td>
                  <td>{{transport.transportFare}}</td>
                  <td>
                    <a ng-click="list(transport.id)" type="button" class="btn btn-info btn-flat" title="{{phrase.listSubs}}" tooltip><i class="fa fa-th-list"></i></a>
                    <a ng-if="userRole == 'admin'" ng-click="edit(transport.id)" type="button" class="btn btn-info btn-flat" title="{{phrase.Edit}}" tooltip><i class="fa fa-pencil"></i></a>
                    <a ng-if="userRole == 'admin'" ng-click="remove(transport,$index)" type="button" class="btn btn-danger btn-flat" title="{{phrase.Remove}}" tooltip><i class="fa fa-trash-o"></i></a>
                  </td>
              </tr>
              <tr ng-show="!transports.length"><td class="noTableData" colspan="6">{{phrase.noTransportation}}</td></tr>
          </tbody></table>
      </div>
  </div>
</section>

<section class="content" ng-show="views.add">
<a ng-click="changeView('list')" class="floatRTL btn btn-danger btn-flat pull-right marginBottom15">{{phrase.cancelAdd}}</a>  
  <div class="box col-xs-12">
    <div class="box-header">
        <h3 class="box-title">{{phrase.addTransport}}</h3>
    </div>
    <div class="box-body table-responsive">
      <form class="form-horizontal" name="addDorm" role="form" ng-submit="saveAdd()" novalidate>
        <div class="form-group" ng-class="{'has-error': addDorm.transportTitle.$invalid}">
          <label for="inputEmail3" class="col-sm-2 control-label">{{phrase.transportTitle}} * </label>
          <div class="col-sm-10">
            <input type="text" name="transportTitle" ng-model="form.transportTitle" class="form-control" required placeholder="{{phrase.transportTitle}}">
          </div>
        </div>
        <div class="form-group">
          <label for="inputPassword3" class="col-sm-2 control-label">{{phrase.transportDesc}}</label>
          <div class="col-sm-10">
            <textarea name="transportDescription" class="form-control" ng-model="form.transportDescription" placeholder="{{phrase.transportDesc}}"></textarea>
          </div>
        </div>
        <div class="form-group">
          <label for="inputPassword3" class="col-sm-2 control-label">{{phrase.driverContact}}</label>
          <div class="col-sm-10">
            <textarea name="transportDriverContact" class="form-control" ng-model="form.transportDriverContact" placeholder="{{phrase.driverContact}}"></textarea>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': addDorm.transportTitle.$invalid}">
          <label for="inputEmail3" class="col-sm-2 control-label">{{phrase.Fare}}</label>
          <div class="col-sm-10">
            <input type="text" name="transportFare" ng-model="form.transportFare" class="form-control" required placeholder="{{phrase.Fare}}">
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-default" ng-disabled="addDorm.$invalid">{{phrase.addTransport}}</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</section>

<section class="content" ng-show="views.edit">
  <a ng-click="changeView('list')" class="floatRTL btn btn-danger btn-flat pull-right marginBottom15">{{phrase.cancelEdit}}</a> 
  <div class="box col-xs-12">
    <div class="box-header">
        <h3 class="box-title">{{phrase.editTransport}}</h3>
    </div>
    <div class="box-body table-responsive">
      <form class="form-horizontal" name="editDorm" role="form" ng-submit="saveEdit()" novalidate>
        <div class="form-group" ng-class="{'has-error': editDorm.transportTitle.$invalid}">
          <label for="inputEmail3" class="col-sm-2 control-label">{{phrase.transportTitle}} * </label>
          <div class="col-sm-10">
            <input type="text" name="transportTitle" ng-model="form.transportTitle" class="form-control" required placeholder="{{phrase.transportTitle}}">
          </div>
        </div>
        <div class="form-group">
          <label for="inputPassword3" class="col-sm-2 control-label">{{phrase.transportDesc}}</label>
          <div class="col-sm-10">
            <textarea name="transportDescription" class="form-control" ng-model="form.transportDescription" placeholder="{{phrase.transportDesc}}"></textarea>
          </div>
        </div>
        <div class="form-group">
          <label for="inputPassword3" class="col-sm-2 control-label">{{phrase.driverContact}}</label>
          <div class="col-sm-10">
            <textarea name="transportDriverContact" class="form-control" ng-model="form.transportDriverContact" placeholder="{{phrase.driverContact}}"></textarea>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': editDorm.transportTitle.$invalid}">
          <label for="inputEmail3" class="col-sm-2 control-label">{{phrase.Fare}}</label>
          <div class="col-sm-10">
            <input type="text" name="transportFare" ng-model="form.transportFare" class="form-control" required placeholder="{{phrase.Fare}}">
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-default" ng-disabled="editDorm.$invalid">{{phrase.editTransport}}</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</section>

<section class="content" ng-show="views.listSubs">
  <a ng-click="changeView('list')" class="floatRTL btn btn-danger btn-flat pull-right marginBottom15">{{phrase.Return}}</a>
  <div class="box col-xs-12">
      <div class="box-header">
          <h3 class="box-title">{{phrase.listSubs}}</h3>
          <div class="box-tools">
              <div class="input-group">
                  <input type="text" name="table_search" ng-model="searchText" class="form-control input-sm pull-right" style="width: 150px;" placeholder="{{phrase.Search}}">
                  <div class="input-group-btn">
                      <button class="btn btn-sm btn-default"><i class="fa fa-search"></i></button>
                  </div>
              </div>
          </div>
      </div>
      <div class="box-body table-responsive">
          <table class="table table-hover">
              <tbody><tr>
                  <th>{{phrase.FullName}}</th>
                  <th>{{phrase.username}}</th>
                  <th>{{phrase.role}}</th>
                  <th>{{phrase.email}}</th>
                  <th>{{phrase.Contact}}</th>
              </tr>
              <tr ng-repeat="subscriber in transportsList | filter:searchText">
                  <td>{{subscriber.fullName}}</td>
                  <td>{{subscriber.username}}</td>
                  <td>{{subscriber.role}}</td>
                  <td>{{subscriber.email}}</td>
                  <td>{{subscriber.phoneNo}} <br/> {{subscriber.mobileNo}}</td>
              </tr>
              <tr ng-show="!transportsList.length"><td class="noTableData" colspan="5">{{phrase.noMatches}}</td></tr>
          </tbody></table>
      </div>
  </div>
</section>