<!DOCTYPE html>
<html lang="en">


<!-- Mirrored from akademi.dexignlab.com/codeigniter/demo/student by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 06 Mar 2024 10:51:33 GMT -->
<!-- Added by HTTrack -->
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /><!-- /Added by HTTrack -->

<head>
    <!-- Title -->
    <title> Edit Faculty</title>
    <!-- Meta -->

    <style>
        .custom-card {
            margin-top: 200px;
        }
    </style>

</head>

<body>

    <div class="row p-5 custom-card">
        <div class="col-lg-12">
            <div class="card ">
                <div class="card-body">
                    <h3 class="">Edit Faculty</h3>
                    <br>
                    <form action="<?php echo base_url(); ?>ApplicationController/update/<?php echo $records['id']; ?>" method="post" enctype="multipart/form-data">
                    <div class="row">
                        <div class="form-group col-md-4">
                            <label class="">Name</label>
                            <input type="text" class="form-control" name="facultyname" value="<?php echo $records['f_name']; ?>">
                        </div>

                        <div class="form-group col-md-4">
                            <label class="">Mobile</label>
                            <input name="mobile" id="mobile" type="number" class="form-control" placeholder="Mobile_number" value="<?php echo $records['f_mobile']; ?>" required>
                            <?php if ($this->session->flashdata('mobile')) : ?>
                                <span style="color: red;"><?= $this->session->flashdata('mobile') ?></span>
                                <?php unset($_SESSION['mobile']); ?>
                            <?php endif;  ?>
                        </div>
                        <div class="form-group col-md-4">
                            <label>Email</label>
                            <input name="email" id="email" type="email" class="form-control" placeholder="Email" value="<?php echo $records['f_email']; ?>" >
                            <?php if (form_error('email')) { ?>
                                <div id="summernote" class="alert alert-danger alert-dismissible fade show" role="alert">
                                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                        <span aria-hidden="true">×</span>
                                    </button>
                                    <?php echo form_error('email'); ?>
                                </div>
                            <?php } ?>
                        </div>
                        <div class="form-group col-md-4 mt-3">
                            <label>Password</label>
                            <input name="Password" id="Password" type="psw" class="form-control" placeholder="Password" value="<?php echo (isset($_POST[''])) ? $_POST[''] : ''; ?>" >
                            <?php if (form_error('Password')) { ?>
                                <div id="summernote" class="alert alert-danger alert-dismissible fade show" role="alert">
                                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                        <span aria-hidden="true">×</span>
                                    </button>
                                    <?php echo form_error('Password'); ?>
                                </div>
                            <?php } ?>
                        </div>
                        <div class="form-group col-md-4 mt-3">
                            <label>Confirm Password</label>
                            <input name="confirm_password" id="confirm_password" type="psw" class="form-control" placeholder="confirm_password" value="<?php echo (isset($_POST[''])) ? $_POST[''] : ''; ?>" >
                            <?php if (form_error('confirm_password')) { ?>
                                <div id="summernote" class="alert alert-danger alert-dismissible fade show" role="alert">
                                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                        <span aria-hidden="true">×</span>
                                    </button>
                                    <?php echo form_error('confirm_password'); ?>
                                </div>
                            <?php } ?>
                        </div>

                   
                    </div>

                    <div class="form-group mt-3 col-md-4 mt-3">
                            <div>
                                <button name="submit" type="submit" class="btn btn-primary waves-effect waves-light mr-1">
                                    Submit
                                </button>
                                <a href="<?php echo base_url('ApplicationController/faculty'); ?>" class="btn btn-secondary waves-effect">Cancel </a>
                            </div>
                        </div>
                    
                </form>

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







</body>

</html>

<script>
    function edit(id, name) {
        $('#tution_name_err').text(' ')

        $('#id').val(id)
        $('#tution_name').val(name)
        $('#formTitle').text('Edit Tution')

        $("#tutionModal").modal('show');

    }

    function deletetution(id, status) {

        $('#tutionId').val(id)
        $('#tutionStatus').val(status)
        $("#statusModal").show();
    }

    $('#open-modal').on('click', function() {

        $("#tutionModal").modal('show');
    });

    $('.closemodel').on('click', function() {

        $("#statusModal").hide();
    });

    $(document).ready(function() {
        $('#registration_form').validate({
            rules: {
                facultyname: {
                    required: true
                },
                mobile: {
                    required: true,
                    number: true
                },
                email: {
                    required: true,
                    email: true
                },
                Password: {
                    required: true
                },
                confirm_password: {
                    required: true,
                    equalTo: "#Password" // Ensure it matches the password field
                }
            },
            messages: {
                facultyname: {
                    required: "Please enter your name"
                },
                mobile: {
                    required: "Please enter your mobile number",
                    number: "Please enter a valid mobile number"
                },
                email: {
                    required: "Please enter your email address",
                    email: "Please enter a valid email address"
                },
                Password: {
                    required: "Please enter a password"
                },
                confirm_password: {
                    required: "Please confirm your password",
                    equalTo: "Passwords do not match"
                }
            },
            errorElement: 'span',
            errorPlacement: function(error, element) {
                error.addClass('invalid-feedback');
                element.closest('.form-group').append(error);
            },
            highlight: function(element, errorClass, validClass) {
                $(element).addClass('is-invalid');
            },
            unhighlight: function(element, errorClass, validClass) {
                $(element).removeClass('is-invalid');
            }
        });
    });


    let pwd1 = document.getElementById('login_pass'),
        eye1 = document.querySelector('.showPwd1');

    eye1.addEventListener('click', function() {
        toggleType1();
    })


    function toggleType1() {

        if (eye1.classList.contains('closed')) {
            pwd1.type = 'password';
        } else {
            pwd1.type = 'text';
        }
        eye1.classList.toggle('closed');
    }
    //end of password toggle


    //start of confirm password toggle
    let pwd2 = document.getElementById('login_pass2');
    eye2 = document.querySelector('.showPwd2');

    eye2.addEventListener('click', function() {
        toggleType2();
    })


    function toggleType2() {

        if (eye2.classList.contains('closed')) {
            pwd2.type = 'password';
        } else {
            pwd2.type = 'text';
        }
        eye2.classList.toggle('closed');
    }
</script>