<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>

            <?php

            if (empty($check_resignation) || $check_resignation[0]->approve_by_supervisor === "0" || $check_resignation[0]->approve_by_hr === "0") { ?>
                <div class="panel-body">

                    <?php echo form_open_multipart('resignation/Resignation/create_resignation', 'class="form-inner"') ?>


                    <div class="form-group row">
                        <label for="res_message" class="col-xs-3 col-form-label"><?php echo display('message') ?>
                            *</label>
                        <div class="col-xs-9">
                        <textarea name="res_message" class="form-control tinymce"
                                  placeholder="<?php echo "Type your reason" ?>" rows="7"></textarea>
                        </div>
                    </div>

                    <div class="form-group row">
                        <label for="res_attachment" class="col-xs-3 col-form-label"><?php echo "Attachment" ?> </label>
                        <div class="col-xs-9">
                            <input name="res_attachment" type="file" class="form-control" id="res_attachment"
                                   placeholder="<?php echo "Attachment" ?>">
                        </div>
                    </div>

                    <div class="form-group row">
                        <label for="res_initiate_date" class="col-xs-3 col-form-label"><?php echo "Resignation Date" ?> </label>
                        <div class="col-xs-9">
                            <input name="res_initiate_date" value="<?php echo date('Y-m-d') ?>" type="date" class="form-control" id="res_initiate_date"
                                   placeholder="<?php echo "Initiate Date" ?>" readonly>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="notice_date" class="col-xs-3 col-form-label"><?php echo "Notice Time Period" ?> </label>
                        <div class="col-xs-9">
                            <input name="notice_date" type="date" class="datepicker form-control" id="notice_date"
                                   placeholder="<?php echo "Notice Time Period" ?>">
                        </div>
                    </div>

                    <?php
                    foreach ($emp_details as $emp) { ?>
                        <input type="hidden" name="supervisor_id" value="<?php echo $emp->super_visor_id ?>">
                        <input type="hidden" name="employee_id" value="<?php echo $emp->employee_id ?>">
                    <?php } ?>


                    <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"
                                onclick="return confirm('<?php echo "Are you sure to submit. You cannot edit after submission." ?>') "><?php echo display('send') ?></button>
                    </div>

                    <?php echo form_close() ?>
                </div>
            <?php } else if (!empty($check_resignation) && $check_resignation[0]->approve_by_supervisor == 1 && $check_resignation[0]->approve_by_hr == 1) { ?>
                <div class="panel-body">
                    <div class="alert alert-success">Your resignation has been accepted.
                    </div>
                </div>
            <?php } else if (!empty($check_resignation[0]) && $check_resignation[0]->approve_by_supervisor == '' || $check_resignation[0]->approve_by_hr == '') { ?>
                <div class="panel-body">
                    <div class="alert alert-success">Your resignation has been sent. Please wait for the management's
                        response.
                    </div>
                </div>
            <?php }
            ?>

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