<!-- ng-if="!myAccess.masterAdd && !myAccess.masterEdit && !myAccess.masterDelete " -->
<!-- <div class="content-wrapper">
    <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-warning alert-dismissible">
                    <h5><i class="icon fas fa-ban"></i> Warning!</h5>Unauthorised Access.
                </div>
            </div>
        </div>
    </div>
</div> -->

<div class="content-wrapper" class="modal-demo">
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1 class="text-{{page.color}}">
                        <go-back/>
                        <i class="fas {{page.icon}}"></i> {{page.name | titlecase}} {{page.type}}
                    </h1>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item"><a ng-href="{{baseurl}}/dashboard">Home</a></li>
                        <li class="breadcrumb-item text-blue"> <a ng-href="{{baseurl}}/requisitions/dashboard/">{{page.name|capitalize}}</a></li>
                        <li class="breadcrumb-item active">{{page.type}}</li>
                    </ol>
                </div>
            </div>
        </div>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="card card-outline card-success">
                    <div class="card-body" id="formCard">
                        <div class="row">
                            <div class="form-group col-sm-6">
                                <label for="account_name">Account Name</label>
                                <ui-select id="proj_account" ng-model="req.acc_id" theme="bootstrap" title="Select a Account" ng-change="getProject(req.acc_id)">
                                    <ui-select-match placeholder="Select or search a Account in the list...">{{$select.selected.acc_company_name}}</ui-select-match>
                                    <ui-select-choices repeat="p.id as p in accountOptions | filter: $select.search | orderBy : 'acc_company_name'">
                                        <span ng-bind-html="p.acc_company_name | highlight: $select.search"></span>
                                    </ui-select-choices>
                                </ui-select>
                                <!-- <ui-select id="employee" ng-model="filter.employee" theme="bootstrap" title="Select a Hero" class="" ng-change="dateChanged(filter.employee)">
                                    <ui-select-match placeholder="Select or search a Hero in the list...">{{$select.selected.name}}</ui-select-match>
                                    <ui-select-choices repeat="e.id as e in employee | filter: $select.search">
                                        <span ng-bind-html="e.name | highlight: $select.search"></span>
                                    </ui-select-choices>
                                </ui-select> -->
                                <!-- <select id="proj_account" class="form-control custom-select" ng-change="getProject(req.acc_id)" ng-model="req.acc_id" 
                                ng-options="o.id as o.acc_company_name for o in accountOptions"/>
                                </select> -->
                            </div>
                            <div class="form-group col-sm-6">
                                <label for="project_name">Project Name</label>
                                <select id="project" class="form-control custom-select" ng-model="req.proj_id"
                                 ng-options="pr.id as pr.proj_name for pr in projectOptions">
                                </select>
                            </div>
                            <div class="form-group col-sm-6">
                                <label for="revenue_center_id">Revenue Center</label>
                                <select id="revenue_center_id" class="form-control custom-select"
                                        ng-model="req.revenue_center_id" ng-options="rc.revenuecenterid as (rc.rc_name) for rc in revenueCenters">
                                </select>
                            </div>
                            <div class="form-group col-sm-3">
                                <label for="position_type">Position Type</label>
                                <select id="position_type" class="form-control" ng-model="req.position_type" required>
                                    <option value="new">New</option>
                                    <option value="pool">Pool</option>
                                    <option value="shadow">Shadow</option>
                                    <option value="replacement">Replacement</option>
                                </select>
                            </div>
                            <div class="form-group col-sm-3" ng-if="req.position_type=='replacement'">
                                <label for="replacement_of">Replacement Of</label>
                                <ui-select id="proj_account" ng-model="req.replacement_of" theme="bootstrap" title="Select a Account" >
                                    <ui-select-match placeholder="Select or search a Heroes in the list...">{{$select.selected.emp_first_name +' '+ $select.selected.emp_last_name}}</ui-select-match>
                                    <ui-select-choices repeat="rep.employeeid as rep in replacement_to_hero | filter: $select.search">
                                        <span ng-bind-html="(rep.emp_first_name+' '+rep.emp_last_name) | highlight: $select.search"></span>
                                    </ui-select-choices>
                                </ui-select>
                                <!-- <select id="replacement_of" class="form-control custom-select" ng-model="req.replacement_of" 
                                    ng-options="l.employeeid as (l.emp_first_name+' '+l.emp_last_name) for l in replacement_to_hero">
                                </select> -->
                            </div>                            

                            <div class="form-group col-sm-6">
                                <label for="designation">Attechment For JD <span style="color:red">(Optional)</span></label>
                                <input type="file" file-model="req.attechment" required="required" class="form-control fileinput">
                            </div>
                            <div class="form-group col-sm-6">
                                <label for="designation">Designation</label>
                                <ui-select id="proj_account" ng-model="req.desg_id" theme="bootstrap" title="Select a Account">
                                    <ui-select-match placeholder="Select or search a Designation in the list...">{{$select.selected.desg_name}}</ui-select-match>
                                    <ui-select-choices repeat="d.id as d in designationOptions | filter: $select.search">
                                        <span ng-bind-html="d.desg_name | highlight: $select.search"></span>
                                    </ui-select-choices>
                                </ui-select>
                                <!-- <select id="designation" class="form-control custom-select" ng-model="req.desg_id"
                                 ng-options="ps.id as ps.desg_name for ps in designationOptions">
                                </select> -->
                            </div>
                            <div class="form-group col-sm-6">
                                <label for="min_exp">Min Exp</label>
                                <input type="text" id="min_exp" class="form-control" ng-model="req.min_exp" placeholder="Min Exp">
                            </div>
                            <div class="form-group col-sm-6">
                                <label for="allocation">Allocation Hours</label>
                                <input type="text" id="allocation" class="form-control" ng-model="req.allocation_hours" placeholder="Allocation">
                            </div>
                            <div class="form-group col-sm-6">
                                <label for="max_exp">Max Exp</label>
                                <input type="text" id="max_exp" class="form-control" ng-model="req.max_exp" placeholder="Max Exp">
                            </div>
                            <div class="form-group col-sm-6">
                                <label for="billing_type">Billing Type</label>
                                <select placeholder="Billing Type" id="billing_type" class="form-control" ng-model="req.billing_type" required>
                                    <option value="hourly">Hourly</option>
                                    <option value="daily">Daily</option>
                                </select>
                            </div>
                            <div class="form-group col-sm-6">
                                <label for="billing_hours">Billing Hours</label>
                                <input type="text" id="billing_hours" class="form-control" ng-model="req.billing_hours" placeholder="Billing Hours">
                            </div>
                        
                            <!-- <div class="form-group col-sm-6">
                                <label for="raised_on">Raised On</label>
                                <input id="raised_on" type=text date-picker
                                           placeholder='Raised On (DD-MM-YYYY)'
                                           dateformat='dd-mm-yy'
                                           maxlength="10"
                                           ng-required='false'
                                           class='form-control'
                                           ng-model='req.raised_on'>
                            </div> <div class="form-group col-sm-6">
                                <label for="position_closed_on">Position Closed On</label>
                                <input id="position_closed_on" type=text date-picker
                                           placeholder='Position Closed On (DD-MM-YYYY)'
                                           dateformat='dd-mm-yy'
                                           maxlength="10"
                                           ng-required='false'
                                           class='form-control'
                                           ng-model='req.position_closed_on'>
                            </div> -->
                            <div class="form-group col-sm-6">
                                <label for="needed_by">Needed By</label>
                                <input id="needed_by" type=text date-picker
                                           placeholder='Needed_By (DD-MM-YYYY)'
                                           dateformat='dd-mm-yy'
                                           maxlength="10"
                                           ng-required='false'
                                           class='form-control'
                                           ng-model='req.needed_by'>
                            </div>
                            <div class="form-group col-sm-6">
                                <label for="eng_duration">Engagement Duration (Weeks)</label>
                                <input type="text" id="eng_duration" class="form-control" ng-model="req.eng_duration" placeholder="Engagement Duration">
                            </div>
                            <div class="form-group col-sm-6">
                                <label for="on_behalf_of">Created On The Behalf Of</label>
                                <select id="on_behalf_of" class="form-control custom-select"
                                        ng-model="req.on_behalf_of" ng-selected="l.employeeid==myself_id" 
                                        ng-options="l.employeeid as (l.emp_first_name+' '+l.emp_last_name) for l in managerOptions">
                                </select>
                            </div>
                            <div class="form-group col-sm-6">
                                <label for="description">Brief Description / Skill Set</label>
                                <textarea id="description" class="form-control" ng-model="req.description" placeholder="For Ex- Salesforce, PHP etc."></textarea>
                            </div>
                            <!-- <div class="form-group col-sm-6">
                                <label for="requirement_status">Requirement Status</label>
                                <select id="req_status" class="form-control custom-select" disabled ng-model="req.req_status"
                                 ng-options="ps.id as ps.status_name for ps in statusList">
                                </select>
                            </div>
                            <div class="form-group col-sm-6">
                                <label for="requirement_status">Sourcing Status</label>
                                <select id="requirement_status" class="form-control custom-select" ng-model="req.sourcing_status">
                                    <option value="internal">Internal</option>
                                    <option value="external">External</option>
                               </select>
                            </div> -->
                        
                        </div>
                            <div class="row">
                                <div class="col-12">
                                    <button type="button" class="btn btn-danger" ng-click="reset()"><i class="fas fa-times"></i> Reset</button>
                                    <button type="button" class="btn btn-success float-right" ng-click="add()"><i class="fas fa-save"></i> {{page.name | titlecase}} {{page.type}} </button>
                                </div>
                            </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
