<div class="paddedleft paddedtop" ng-controller="SearchController">
<div class="row-fluid">
<label ng-show="showMsg" class="error"><strong>{{'label.search.query.matched.results.exceeds.max.length' |
    translate}}</strong></label>

<div class="span5">
    <div ng-repeat="result in searchResults">
        <div class="blockquoteresult" ng-class="{grbgcolor: result.entityId == selected}">
            <span ng-show="result.entityType  == 'LOAN' || result.entityType  == 'SAVING'">
                <a href="#/view{{result.entityType | lowercase}}account/{{result.entityId}}">{{result.entityName}}</a>&nbsp;|&nbsp;#{{result.entityAccountNo}}</a>
            </span>
            <span ng-show="result.entityType  == 'CLIENT'">
                <a href="#/view{{result.entityType | lowercase}}/{{result.entityId}}">{{result.entityName}}</a>&nbsp;|&nbsp;#{{result.entityAccountNo}}</a>
            </span>
            <span ng-show="result.entityType  == 'GROUP'">
                <a href="#/view{{result.entityType | lowercase}}/{{result.entityId}}">{{result.entityName}}</a>&nbsp;</a>
            </span>
            <span ng-show="result.entityType  == 'CENTER'">
                <a href="#/view{{result.entityType | lowercase}}/{{result.entityId}}">{{result.entityName}}</a>&nbsp;</a>
            </span>
            <span ng-show="result.entityType  == 'CLIENTIDENTIFIER'">
                <a href="#/viewclient/{{result.parentId}}">{{result.entityName}}</a>&nbsp;</a>
            </span>
            <span ng-show="result.entityType  == 'CLIENT'">
              <a ng-click="getClientDetails(result.entityId)"
                 title="{{'label.input.additionalinformation'| translate}}"><i class="icon-zoom-in"></i></a>
            </span>
            <span ng-show="result.entityType  == 'GROUP'">
              <a ng-click="getGroupDetails(result.entityId)" title="{{'label.input.additionalinformation'| translate}}"><i
                      class="icon-zoom-in"></i></a>
            </span>
            <span ng-show="result.entityType  == 'CENTER'">
              <a ng-click="getCenterDetails(result.entityId)"
                 title="{{'label.input.additionalinformation'| translate}}"><i class="icon-zoom-in"></i></a>
            </span>
            <br>
            <span data-ng-show="result.entityType  == 'CLIENT' ||result.entityType  == 'GROUP' || result.entityType  == 'CENTER' "><strong>{{'label.heading.entity'
                | translate}}</strong>:{{result.entityType}}&nbsp;|&nbsp;<strong>{{ 'label.heading.office' | translate
                }}</strong>:{{result.parentName}}</span>
            <span data-ng-show="result.entityType  == 'CLIENTIDENTIFIER'"><strong>{{'label.heading.entity' |
                translate}}</strong>:{{'label.heading.clientid' | translate}}&nbsp;|&nbsp;<strong>{{
                'label.heading.client' | translate }}</strong>:{{result.parentName}}</span>
            <span data-ng-show="result.entityType  == 'LOAN' || result.entityType  == 'SAVING'"><strong>{{'label.heading.entity' | translate}}</strong>:{{result.entityType}}&nbsp;|&nbsp;<strong>{{
                'label.heading.' + result.parentType | translate }}</strong>:{{result.parentName}}</span>
            <span><br/></span>
        </div>
    </div>
</div>
<h3 data-ng-show="flag" style="position: absolute;top: 40%;left: 30%;"><strong>{{ 'label.nodatafound' | translate
    }}</strong></h3>

<div class="span7">
    <div ng-show="client">
        <br/>

        <div>
                    <span class="pull-left">
                      <i class="icon-user icon-3x"></i>
                    </span>
                    <span class="pull-left">
                      <h3>
                          &nbsp;
                          {{client.displayName}}
                          &nbsp;
                          <i class="icon-circle {{client.status.value | StatusLookup}}"></i>
                          &nbsp;
                      </h3>
                    </span>
        </div>
        <br/>
        <table width="100%" class="table">
            <tr class="graybg">
                <th>{{'label.heading.loanaccount'| translate}}</th>
                <th></th>
                <th>{{'label.heading.loantype'| translate}}</th>
                <th>{{'label.heading.status'| translate}}</th>
                <th></th>
            </tr>
            <tr ng-repeat="loanaccount in clientAccounts.loanAccounts | filter:isNotClosed">
                <td>
                    {{loanaccount.productName}}
                </td>
                <td>
                    {{loanaccount.accountNo}}
                </td>
                <td>{{loanaccount.loanType.value}}</td>
                <td>{{loanaccount.status.value}}</td>
                <td><i class="icon-stop {{loanaccount.status.code | StatusLookup}}"></i></td>
            </tr>
            <tr>
                <td colspan="5">&nbsp;</td>
            </tr>
            <tr class="graybg">
                <th>{{'label.heading.savingaccount'| translate}}</th>
                <th></th>
                <th>{{'label.heading.balance'| translate}}</th>
                <th>{{'label.heading.status'| translate}}</th>
                <th></th>
            </tr>
            <tr ng-repeat="savingaccount in clientAccounts.savingsAccounts">
                <td>
                    {{savingaccount.productName}}
                </td>
                <td>{{savingaccount.accountNo}}</td>
                <td>{{savingaccount.accountBalance | number}}</td>
                <td>{{savingaccount.status.value}}</td>
                <td>
                    <i class="icon-stop {{savingaccount.status.code | StatusLookup}}"></i>
                </td>
            </tr>
        </table>
    </div>
    <div ng-show="center">
        <br/>

        <div>
                <span class="pull-left">
                  <i class="icon-map-marker icon-3x"></i>
                </span>
                <span class="pull-left">
                  <h3 class="table-font-nav">
                      &nbsp;
                      {{center.name}}
                      &nbsp;
                      <i class="icon-circle {{center.status.value | StatusLookup}}"></i>
                      &nbsp;
                  </h3>
                </span>
        </div>
        <br/>
        <table width="100%" class="table">
            <tr class="graybg">
                <th>{{'label.heading.loanaccount'| translate}}</th>
                <th></th>
                <th>{{'label.heading.loantype'| translate}}</th>
                <th>{{'label.heading.status'| translate}}</th>
                <th></th>
            </tr>
            <tr ng-repeat="loanaccount in centerAccounts.loanAccounts | filter:isNotClosed">
                <td>
                    {{loanaccount.productName}}
                </td>
                <td>
                    {{loanaccount.accountNo}}
                </td>
                <td>{{loanaccount.loanType.value}}</td>
                <td>{{loanaccount.status.value}}</td>
                <td><i class="icon-stop {{loanaccount.status.code | StatusLookup}}"></i></td>
            </tr>
            <tr>
                <td colspan="5">&nbsp;</td>
            </tr>
            <tr class="graybg">
                <th>{{'label.heading.savingaccount'| translate}}</th>
                <th></th>
                <th>{{'label.heading.balance'| translate}}</th>
                <th>{{'label.heading.status'| translate}}</th>
                <th></th>
            </tr>
            <tr ng-repeat="savingaccount in centerAccounts.savingsAccounts">
                <td>
                    {{savingaccount.productName}}
                </td>
                <td>{{savingaccount.accountNo}}</td>
                <td>{{savingaccount.accountBalance | number}}</td>
                <td>{{savingaccount.status.value}}</td>
                <td>
                    <i class="icon-stop {{savingaccount.status.code | StatusLookup}}"></i>
                </td>
            </tr>
        </table>
    </div>
    <div ng-show="group">
        <br/>

        <div>
                    <span class="pull-left">
                      <i class="icon-group icon-3x"></i>
                    </span>
                    <span class="pull-left">
                      <h3>
                          &nbsp;
                          {{group.name}}
                          &nbsp;
                          <i class="icon-circle {{group.status.value | StatusLookup}}"></i>
                          &nbsp;
                      </h3>
                    </span>
        </div>
        <br/>
        <table width="100%" class="table">
            <tr class="graybg">
                <th>{{'label.heading.loanaccount'| translate}}</th>
                <th></th>
                <th>{{'label.heading.loantype'| translate}}</th>
                <th>{{'label.heading.status'| translate}}</th>
                <th></th>
            </tr>
            <tr ng-repeat="loanaccount in groupAccounts.loanAccounts | filter:isNotClosed">
                <td>
                    {{loanaccount.productName}}
                </td>
                <td>
                    {{loanaccount.accountNo}}
                </td>
                <td>{{loanaccount.loanType.value}}</td>
                <td>{{loanaccount.status.value}}</td>
                <td><i class="icon-stop {{loanaccount.status.code | StatusLookup}}"></i></td>
            </tr>
            <tr>
                <td colspan="5">&nbsp;</td>
            </tr>
            <tr class="graybg">
                <th>{{'label.heading.savingaccount'| translate}}</th>
                <th></th>
                <th>{{'label.heading.balance'| translate}}</th>
                <th>{{'label.heading.status'| translate}}</th>
                <th></th>
            </tr>
            <tr ng-repeat="savingaccount in groupAccounts.savingsAccounts">
                <td>
                    {{savingaccount.productName}}
                </td>
                <td>{{savingaccount.accountNo}}</td>
                <td>{{savingaccount.accountBalance | number}}</td>
                <td>{{savingaccount.status.value}}</td>
                <td>
                    <i class="icon-stop {{savingaccount.status.code | StatusLookup}}"></i>
                </td>
            </tr>
        </table>
    </div>
</div>
</div>
</div>