<div class="row">
    <div class="col-sm-12 col-md-12">
        <div class="panel panel-bd lobidrag">
            <div class="panel-heading">
                <div class="panel-title">
                    <h4><?php echo(!empty($title) ? $title : null) ?></h4>
                </div>
            </div>
            <div class="panel-body">
                <?php
                if (isset($getStatus)) {
                    echo form_open_multipart('recruitment/Candidate/update_recruitment_status', 'class = "form-inner"');
                } else {
                    echo form_open_multipart('recruitment/Candidate/add_recruitment_status', 'class = "form-inner"');
                }

                ?>
                <div class="row">
                    <div class="col-sm-6">
                        <div class="form-group">
                            <input type="hidden" name="status_id"
                                   value="<?php echo isset($getStatus) ? $getStatus[0]->status_id : '' ?>">
                            <label for="status"><?php echo "Status" ?></label>
                            <select class="form-control" name="status" id="status">
                                <option <?php echo isset($getStatus) ? $getStatus[0]->status == '1' ? 'selected' : '' : '' ?>
                                        value="1">In Progress
                                </option>
                                <option <?php echo isset($getStatus) ? $getStatus[0]->status == '2' ? 'selected' : '' : '' ?>
                                        value="2">On Hold
                                </option>
                                <option <?php echo isset($getStatus) ? $getStatus[0]->status == '3' ? 'selected' : '' : '' ?>
                                        value="3">Closed
                                </option>
                            </select>
                        </div>

                    </div>
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label for="manager_name"><?php echo "Manager Name" ?> </label>
                            <select name="manager_name" class="form-control">
                                <option value="">Select One</option>
                                <?php foreach ($emplist as $emp) { ?>
                                    <option <?php echo isset($getStatus) ? $getStatus[0]->manager_name == $emp->employee_id ? 'selected' : '' : '' ?>
                                            value="<?php echo $emp->employee_id ?>"><?php echo $emp->first_name . ' ' . $emp->last_name ?></option>
                                <?php } ?>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label for="department_id"><?php echo "Department Name" ?></label>
                            <select name="department_id" class="form-control">
                                <option value="">Select One</option>
                                <?php foreach ($department as $dpt) { ?>
                                    <option <?php echo isset($getStatus) ? $getStatus[0]->department_id == $dpt->dept_id ? 'selected' : '' : '' ?>
                                            value="<?php echo $dpt->dept_id ?>"><?php echo $dpt->department_name ?></option>
                                <?php } ?>
                            </select>
                        </div>

                    </div>
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label for="designation"><?php echo "Designation" ?> </label>
                            <select name="designation" class="form-control">
                                <option value="">Select One</option>
                                <?php foreach ($position as $pos) { ?>
                                    <option <?php echo isset($getStatus) ? $getStatus[0]->designation == $pos->pos_id ? 'selected' : '' : '' ?>
                                            value="<?php echo $pos->pos_id ?>"><?php echo $pos->position_name ?></option>
                                <?php } ?>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label for="num_of_positions"><?php echo "Number of Positions" ?></label>
                            <input type="number" class="form-control" id="num_of_positions"
                                   name="num_of_positions" placeholder="Number of Positions"
                                   value="<?php echo isset($getStatus) ? $getStatus[0]->num_of_positions : '' ?>">
                        </div>

                    </div>
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label for="closed_positions"><?php echo "Closed Positions" ?> </label>
                            <input type="text" class="form-control" id="closed_positions"
                                   name="closed_positions" placeholder="Closed Positions"
                                   value="<?php echo isset($getStatus) ? $getStatus[0]->closed_positions : '' ?>">
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label for="rrd"><?php echo "Requisition Received Date" ?></label>
                            <input type="date" class="form-control" id="rrd"
                                   name="rrd" placeholder="Requisition Received Date"
                                   value="<?php echo isset($getStatus) ? $getStatus[0]->rrd : '' ?>">
                        </div>

                    </div>
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label for="deadline"><?php echo "Deadline" ?> </label>
                            <input type="date" class="form-control" id="deadline"
                                   name="deadline" placeholder="Closed Positions"
                                   value="<?php echo isset($getStatus) ? $getStatus[0]->deadline : '' ?>">
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label for="budget"><?php echo "Budget" ?></label>
                            <input type="number" class="form-control" id="budget"
                                   name="budget" placeholder="Budget"
                                   value="<?php echo isset($getStatus) ? $getStatus[0]->budget : '' ?>">
                        </div>

                    </div>
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label for="qualifications"><?php echo "Qualifications" ?> </label>
                            <textarea class="form-control" name="qualifications"
                                      id="qualifications"><?php echo isset($getStatus) ? $getStatus[0]->qualifications : '' ?></textarea>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label for="exp_required"><?php echo "Experience Required" ?></label>
                            <input type="text" class="form-control" id="exp_required"
                                   name="exp_required" placeholder="Experience Required"
                                   value="<?php echo isset($getStatus) ? $getStatus[0]->exp_required : '' ?>">
                        </div>

                    </div>
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label for="employee_type"><?php echo "Employment Type" ?> </label>
                            <select class="form-control" name="employee_type" id="employee_type">
                                <option <?php echo isset($getStatus) ? $getStatus[0]->employee_type == '1' ? 'selected' : '' : '' ?>
                                        value="1">Full Time
                                </option>
                                <option <?php echo isset($getStatus) ? $getStatus[0]->employee_type == '2' ? 'selected' : '' : '' ?>
                                        value="2">Part Time
                                </option>
                                <option <?php echo isset($getStatus) ? $getStatus[0]->employee_type == '3' ? 'selected' : '' : '' ?>
                                        value="3">Contract
                                </option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label for="responsible_person"><?php echo "Responsible Person (HR/Recruitment)" ?></label>
                            <input type="text" class="form-control" id="responsible_person"
                                   name="responsible_person" placeholder="Responsible Person (HR/Recruitment)"
                                   value="<?php echo isset($getStatus) ? $getStatus[0]->responsible_person : '' ?>">
                        </div>

                    </div>
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label for="close_date"><?php echo "Close Date" ?> </label>
                            <input type="date" class="form-control" id="close_date"
                                   name="close_date" placeholder="Close Date"
                                   value="<?php echo isset($getStatus) ? $getStatus[0]->close_date : '' ?>">
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label for="candidate_finalized"><?php echo "Candidate Finalized" ?></label>
                            <input type="text" class="form-control" id="candidate_finalized"
                                   name="candidate_finalized" placeholder="Candidate Finalized"
                                   value="<?php echo isset($getStatus) ? $getStatus[0]->candidate_finalized : '' ?>">
                        </div>

                    </div>
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label for="extra_comment"><?php echo "Extra Comment" ?> </label>
                            <textarea class="form-control" name="extra_comment"
                                      id="extra_comment"><?php echo isset($getStatus) ? $getStatus[0]->extra_comment : '' ?></textarea>
                        </div>
                    </div>
                </div>
                <div class="form-group form-group-margin text-right">
                    <button type="reset" class="btn btn-primary w-md m-b-5"><?php echo display('reset') ?></button>
                    <button type="submit"
                            class="btn btn-success w-md m-b-5"><?php echo isset($getStatus) ? 'Update' : 'Submit' ?></button>
                </div>
                <?php echo form_close() ?>
            </div>

        </div>
    </div>
</div>
