<div class="content-wrapper" ng-if="gUser.emp_first_name === 'Admin'">
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-6 offset-sm-1 offset-md-2 offset-lg-3 mt-5">
                <div class="alert alert-danger alert-dismissible">
                    <h5><i class="icon fas fa-ban"></i> Alert!</h5>
                    Please login as Hero.
                </div>
            </div>
        </div>
    </div>
</div>
<div class="content-wrapper" ng-if="gUser.emp_first_name !== 'Admin'">
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1 class="text-olive">
                        <go-back/>
                        <i class="fas fa-file-alt"></i> {{createButton.heading}}
                    </h1>
                </div>
                <div class="col-sm-6">
                    <div class="btn-group pull-right" role="group">
                        <button id="savebtn2" type="button" ng-if="opts.tab==='hero'" ng-click="Save(true)" class="savebtn btn btn-success"><i class="fas {{createButton.icon}}"></i> {{createButton.text}} as Draft</button>
                        <button id="savebtn" type="submit" ng-if="opts.tab==='hero'" ng-click="Save()" class="btn btn-success"><i class="fas {{createButton.icon}}"></i> {{createButton.text}}</button>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Main content -->
    <section class="container-fluid">
        <div class="row">
            <div class="col-sm-12">
                <div class="card card-primary card-outline card-outline-tabs">
                    <div class="card-header p-0" ng-if="opts.tab!=='mngr'">
                        <table class="table table-bordered table-sm p-0 m-0">
                            <tr>
                                <td><strong>Name:</strong><br>{{empInfo.emp_first_name + ' ' + empInfo.emp_middle_name + ' ' + empInfo.emp_last_name}} <span class="badge badge-danger">{{empInfo.emp_code}}</span></td>
                                <td><strong>DOJ:</strong><br>{{empInfo.emp_doj | date:'dd MMM yyyy'}}</td>
                                <td><strong>Location:</strong><br>{{empInfo.emp_location}}</td>
                                <td><strong>Department:</strong><br>{{empInfo.emp_department}}</td>
                                <td colspan="2"><strong>Manager Name:</strong><br>{{empInfo.lm_fn + ' ' + empInfo.lm_mn + ' ' + empInfo.lm_ln}} <span class="badge badge-danger">{{empInfo.lm_code}}</span></td>
                                <td colspan="2"><strong>Manager Name:</strong><br>{{empInfo.pm_fn + ' ' + empInfo.pm_mn + ' ' + empInfo.pm_ln}} <span class="badge badge-danger">{{empInfo.pm_code}}</span></td>
                            </tr>
                        </table>
                    </div>
                
                    <!-- <div class="card-body p-1">
                        <div class="card card-success" ng-repeat="diary in diaries">
                            <div class="card-header p-0 pointer" ng-click="diary.open=!diary.open">
                                <div class="row">
                                    <div class="col p-2 ml-2 mt-1"> Project: <strong> {{diary.proj_name}} </strong></div>
                                    <div class="col"><i class="m-2 fas pull-right {{diary.open ? 'fa-chevron-up':'fa-chevron-down'}}"></i></div>
                                </div>
                            </div>
                            <div class="card-body p-0" ng-if="diary.open">
                                <div ng-repeat="d in diary.data" class="mt-1">
                                    <label class="col-sm-12 alert alert-dark p-1"><i class="fas fa-chevron-right"></i> {{$index+1}}. {{d.aq_name}}</label>

                                    <div class="col-sm-12 input-group">
                                        <div class="col-sm-1"><label class="badge badge-success pointer alert p-2"> You: </label></div>

                                        <div class="col-sm-3" ng-if="d.aq_type === 'dropdown' || d.aq_type === 'dropdown_scale'"><select ng-disabled="true" ng-model="d.as_answer" ng-options="ag.key as (ag.value) for ag in d.aq_options" ng-disabled="opts.tab!=='hero'||d.as_manager_status==='active'||d.as_status==='active'" tabindex="{{($parent.$index+1)+($index+1)}}" class="form-control custom-select"></select></div>
                                        <div class="{{d.aq_comment ? 'col-sm-3' : 'col-sm-7'}}" ng-if="d.aq_type === 'shortanswer' || d.aq_type === 'longanswer' || d.aq_type === 'verylonganswer'"><textarea ng-disabled="true" ng-model="d.as_answer" class="form-control" rows="2" placeholder=""></textarea></div>
                                        <div class="col-sm-3" ng-if="d.aq_type === 'number' || d.aq_type === 'num_range'"><input ng-disabled="true" ng-model="d.as_answer" type="number" min="{{d.aq_options.min}}" max="{{d.aq_options.max}}" step="{{d.aq_options.step}}" class="form-control" placeholder=""/></div>
                                        <div ng-if="d.aq_type === 'tf'">
                                            <div class="form-check">
                                                <input ng-disabled="true" class="form-check-input" name="{{d.aq_type+$index}}" type="radio" id="{{'t'+$index}}" ng-model="d.as_answer"/>
                                                <label class="form-check-label" for="{{'t'+$index}}">True</label>
                                            </div>
                                            <div class="form-check">
                                                <input ng-disabled="true" class="form-check-input" name="{{d.aq_type+$index}}" type="radio" id="{{'f'+$index}}" ng-model="d.as_answer"/>
                                                <label class="form-check-label" for="{{'f'+$index}}">False</label>
                                            </div>
                                        </div>
                                        <div class="col-sm-4" ng-if="d.aq_comment"><textarea ng-disabled="true" tabindex="{{($parent.$index+1)+($index+2)}}" ng-model="d.as_comments" rows="2" class="form-control" placeholder=""></textarea></div>
                                        <div class="col-sm-4"></div>
                                    </div>

                                    <div class="col-sm-12 input-group" ng-if="opts.hideManagerInfo && d.aq_manager_reply">
                                        <div class="col-sm-1"><label class="badge badge-info pointer alert p-2">Manager:</label></div>
                                        <div class="col-sm-3" ng-if="d.aq_type === 'dropdown' || d.aq_type === 'dropdown_scale'"><select ng-disabled="d.as_manager_status==='active'" ng-model="d.as_manager_answer" ng-options="ag.key as (ag.value) for ag in d.aq_options" ng-disabled="opts.tab!=='hero'||d.as_manager_status==='active'||d.as_status==='active'" tabindex="{{($parent.$index+1)+($index+1)}}" class="form-control custom-select"></select></div>
                                        <div class="{{d.aq_comment ? 'col-sm-3' : 'col-sm-7'}}" ng-if="d.aq_type === 'shortanswer' || d.aq_type === 'longanswer' || d.aq_type === 'verylonganswer'"><textarea ng-disabled="d.as_manager_status==='active'" ng-model="d.as_manager_answer" class="form-control" rows="2" placeholder="Enter your response..."></textarea></div>
                                        <div class="col-sm-3" ng-if="d.aq_type === 'number' || d.aq_type === 'num_range'"><input ng-disabled="d.as_manager_status==='active'" ng-model="d.as_manager_answer" type="number" min="{{d.aq_options.min}}" max="{{d.aq_options.max}}" step="{{d.aq_options.step}}" class="form-control" placeholder="{{d.aq_options.min && d.aq_options.max ? 'Enter between ' + d.aq_options.min + ' to ' + d.aq_options.max : 'Enter any number'}}"/></div>
                                        <div ng-if="d.aq_type === 'tf'">
                                            <div class="form-check">
                                                <input ng-disabled="d.as_manager_status==='active'" class="form-check-input" name="{{d.aq_type+$index}}" type="radio" id="{{'t'+$index}}" ng-model="d.as_manager_answer"/>
                                                <label class="form-check-label" for="{{'t'+$index}}">True</label>
                                            </div>
                                            <div class="form-check">
                                                <input ng-disabled="d.as_manager_status==='active'" class="form-check-input" name="{{d.aq_type+$index}}" type="radio" id="{{'f'+$index}}" ng-model="d.as_manager_answer"/>
                                                <label class="form-check-label" for="{{'f'+$index}}">False</label>
                                            </div>
                                        </div>
                                        <div class="col-sm-4" ng-if="d.aq_comment"><textarea ng-disabled="d.as_manager_status==='active'" ng-model="d.as_manager_comments" rows="2" class="form-control" placeholder="Enter the manager comment"></textarea></div>
                                        <div class="col-sm-4" ng-if="d.aq_comment"><textarea ng-disabled="d.as_manager_status==='active'" ng-model="d.as_manager_internal_comments" rows="2" class="form-control" placeholder="Enter the internal manager comment, this comment will not be visible to hero!"></textarea></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div> -->



                    <!-- Syed moh bilal -->

                    <div class="card-body p-1">
                        <div class="card card-success" ng-repeat="diary in diaries">
                            <div class="card-header p-0 pointer" ng-click="diary.open=!diary.open">
                                <div class="row">
                                    <div class="col p-2 ml-2 mt-1"> Project: <strong> {{diary.proj_name}} </strong></div>
                                    <div class="col"><i class="m-2 fas pull-right {{diary.open ? 'fa-chevron-up':'fa-chevron-down'}}"></i></div>
                                </div>
                            </div>
                            <div class="card-body p-0" ng-if="diary.open">
                                <div ng-repeat="d in diariesDataAll" class="mt-1">

                                    <input type="hidden" ng-model="d.as_id" id="as_idd" value="{{d.as_id}}">
                                    <label class="col-sm-12 alert alert-dark p-1"><i class="fas fa-chevron-right"></i> {{$index+1}}. {{d.aq_name}}</label>

                                    <div class="col-sm-12 input-group">
                                        <div class="col-sm-1"><label class="badge badge-success pointer alert p-2"> You: </label></div>

                                        <div class="col-sm-3" ng-if="d.aq_type === 'dropdown' || d.aq_type === 'dropdown_scale'"><select ng-disabled="true" ng-model="d.as_answer" ng-options="ag.key as (ag.value) for ag in d.aq_options" ng-disabled="opts.tab!=='hero'||d.as_manager_status==='active'||d.as_status==='active'" tabindex="{{($parent.$index+1)+($index+1)}}" class="form-control custom-select"></select></div>
                                        <div class="{{d.aq_comment ? 'col-sm-3' : 'col-sm-7'}}" ng-if="d.aq_type === 'shortanswer' || d.aq_type === 'longanswer' || d.aq_type === 'verylonganswer'"><textarea ng-disabled="true" ng-model="d.as_answer" class="form-control" rows="2" placeholder=""></textarea></div>
                                        <div class="col-sm-3" ng-if="d.aq_type === 'number' || d.aq_type === 'num_range'"><input ng-disabled="true" ng-model="d.as_answer" value="{{d.as_answer}}" type="number" min="{{d.aq_options.min}}" max="{{d.aq_options.max}}" step="{{d.aq_options.step}}" class="form-control" placeholder=""/></div>
                                        <div ng-if="d.aq_type === 'tf'">
                                            <div class="form-check">
                                                <input ng-disabled="true" class="form-check-input" name="{{d.aq_type+$index}}" type="radio" id="{{'t'+$index}}" ng-model="d.as_answer"/>
                                                <label class="form-check-label" for="{{'t'+$index}}">True</label>
                                            </div>
                                            <div class="form-check">
                                                <input ng-disabled="true" class="form-check-input" name="{{d.aq_type+$index}}" type="radio" id="{{'f'+$index}}" ng-model="d.as_answer"/>
                                                <label class="form-check-label" for="{{'f'+$index}}">False</label>
                                            </div>
                                        </div>
                                        <div class="col-sm-4" ng-if="d.aq_comment"><textarea ng-disabled="true" tabindex="{{($parent.$index+1)+($index+2)}}" ng-model="d.as_comments" rows="2" class="form-control" placeholder=""></textarea></div>
                                        <div class="col-sm-4"></div>
                                    </div>

                                    <div class="col-sm-12 input-group" ng-if="opts.hideManagerInfo && d.aq_manager_reply">
                                        <div class="col-sm-1"><label class="badge badge-info pointer alert p-2">Manager:</label></div>
                                        <div class="col-sm-3" ng-if="d.aq_type === 'dropdown' || d.aq_type === 'dropdown_scale'"><select ng-disabled="d.as_manager_status==='active'" ng-model="d.as_manager_answer" ng-options="ag.key as (ag.value) for ag in d.aq_options" ng-disabled="opts.tab!=='hero'||d.as_manager_status==='active'||d.as_status==='active'" tabindex="{{($parent.$index+1)+($index+1)}}" class="form-control custom-select"></select></div>
                                        <div class="{{d.aq_comment ? 'col-sm-3' : 'col-sm-7'}}" ng-if="d.aq_type === 'shortanswer' || d.aq_type === 'longanswer' || d.aq_type === 'verylonganswer'"><textarea ng-disabled="d.as_manager_status==='active'" ng-model="d.as_manager_answer" class="form-control" rows="2" placeholder="Enter your response..."></textarea></div>
                                        <div class="col-sm-3" ng-if="d.aq_type === 'number' || d.aq_type === 'num_range'"><input ng-disabled="d.as_manager_status==='active'" ng-model="d.as_manager_answer" type="number" min="{{d.aq_options.min}}" max="{{d.aq_options.max}}" step="{{d.aq_options.step}}" class="form-control" placeholder="{{d.aq_options.min && d.aq_options.max ? 'Enter between ' + d.aq_options.min + ' to ' + d.aq_options.max : 'Enter any number'}}"/></div>
                                        <div ng-if="d.aq_type === 'tf'">
                                            <div class="form-check">
                                                <input ng-disabled="d.as_manager_status==='active'" class="form-check-input" name="{{d.aq_type+$index}}" type="radio" id="{{'t'+$index}}" ng-model="d.as_manager_answer"/>
                                                <label class="form-check-label" for="{{'t'+$index}}">True</label>
                                            </div>
                                            <div class="form-check">
                                                <input ng-disabled="d.as_manager_status==='active'" class="form-check-input" name="{{d.aq_type+$index}}" type="radio" id="{{'f'+$index}}" ng-model="d.as_manager_answer"/>
                                                <label class="form-check-label" for="{{'f'+$index}}">False</label>
                                            </div>
                                        </div>
                                        <div class="col-sm-4" ng-if="d.aq_comment"><textarea ng-disabled="d.as_manager_status==='active'" ng-model="d.as_manager_comments" rows="2" class="form-control" placeholder="Enter the manager comment"></textarea></div>
                                        <div class="col-sm-4" ng-if="d.aq_comment"><textarea ng-disabled="d.as_manager_status==='active'" ng-model="d.as_manager_internal_comments" rows="2" class="form-control" placeholder="Enter the internal manager comment, this comment will not be visible to hero!"></textarea></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>


                    <!-- bilAL -->
                </div>
            </div>
        </div>
    </section>
</div>
