Domain: amberpublishers.in
Server Adress: 86.38.243.169

privdayz.com

/home/u866425823/domains/sugam.kmclu.ac.in/public_html/
Dosya Yükle :
Current File : //home/u866425823/domains/sugam.kmclu.ac.in/public_html/stu_registration_form.php

<?php
session_start();
require('header.php');
if (!isset($_SESSION['stu_reg_start_id'])) {
    echo "<script>window.history.back()</script>";
}


if (isset($_POST['student_registration'])) {

    $en_no  = realEscape('en_no');
    $roll_no  = realEscape('roll_no');
    $name_prefix  = realEscape('name_prefix');
    $FName  = realEscape('FName');
    $FatherName  = realEscape('FatherName');
    $MotherName  = realEscape('MotherName');
    $email  = realEscape('email');
    $phone_number  = realEscape('phone_number');
    $department  = realEscape('department');
    $course  = realEscape('course');
    $address = realEscape('address');
    $sem = realEscape('sem');
    $admi_date = realEscape('admi_date');


    $passport_size_img = $_FILES['passport_size_img']['name'];
    $tmp_passport_size_img = $_FILES['passport_size_img']['tmp_name'];
    $tenth_marksheet = $_FILES['tenth_marksheet']['name'];
    $tmp_tenth_marksheet = $_FILES['tenth_marksheet']['tmp_name'];
    $fee_receipt = $_FILES['fee_receipt']['name'];
    $tmp_fee_receipt = $_FILES['fee_receipt']['tmp_name'];


    $new_passport_size_img = new_fileName($passport_size_img);
    $new_tenth_marksheet = new_fileName($tenth_marksheet);
    $new_fee_receipt = new_fileName($fee_receipt);

    $size_passport_size_img = $_FILES['passport_size_img']['size'];
    $size_tenth_marksheet = $_FILES['tenth_marksheet']['size'];
    $size_fee_receipt = $_FILES['fee_receipt']['size'];

    $uid = uid_generator();


    if (file_format($passport_size_img, $img_format) && file_format($tenth_marksheet, $img_format) && file_format($fee_receipt, $img_format)) {

        if ($size_passport_size_img <= 52224 && $size_tenth_marksheet <= 52224 && $size_fee_receipt <= 52224) {

            $create_password = substr(md5($en_no . mt_rand(10000, 100000)), 22);
            $hash_pass = password_hash($create_password, PASSWORD_DEFAULT);


            $update_student = "UPDATE `student_data` SET 
            `name_prefix`='$name_prefix',
            `full_name`='$FName',
            `father`='$FatherName',
            `mother`='$MotherName',
            `address`='$address',
            `email`='$email',
            `phone`='$phone_number',
            `sem`='$sem',
            `dep`='$department',
            `admi_date`='$admi_date',
            `course`='$course',
            `pass_img`='$new_passport_size_img',
            `marksheet`='$new_tenth_marksheet',
            `fee_receipt`='$new_fee_receipt',
            `password`='$hash_pass',
            `profile_status`='completed'
             WHERE enroll_no = '$en_no' and roll_no ='$roll_no'";

            $receiver = $email;
            $sub = "Registration Successfull";
            $body = "
            <table style='background-color: black; padding: 40px 20px;'>
            <tr>
                <th style='text-align: center;font-size: 20px;color: green;padding: 20px 0;' colspan='2'>Registration Successfull</th>
            </tr>
            <tr>
                <td style='color:white'>Registered Email Id: </td>
                <td style='color:white'>Use your registered email address to login into your account.</td>
            </tr>
            <tr>
                <td style='color:white'>Password:</td>
                <td style='color:white'>$create_password</td>
            </tr>
           </table>
            ";

            $check_info = mysqli_query($conn, "SELECT * FROM `student_data` where enroll_no = '$en_no' and roll_no = '$roll_no' and profile_status = 'completed'");


            if (mysqli_num_rows($check_info) == 0) {
                if (mysqli_query($conn, $update_student)) {
                    if (send_mail($receiver, $body, $sub)) {
                        move_uploaded_file($tmp_passport_size_img, 'Files/student/' . $new_passport_size_img);
                        move_uploaded_file($tmp_tenth_marksheet, 'Files/10th_marksheet/' . $new_tenth_marksheet);
                        move_uploaded_file($tmp_fee_receipt, 'Files/student/' . $new_fee_receipt);
                        $_SESSION['reg_success'] = true;
                        SuccessFun("Registration Successfull. Check your mail for login credential. <a href='login.php'>Login Now</a>");
                    }
                } else {
                    DangerFun('Registration failed');
                }
            } else {
                DangerFun('You are already registered');
            }
        } else {
            DangerFun('Document Size Limit Exceeded');
        }
    } else {
        DangerFun('Invalid Document Format');
    }
}

?>

<section class="page-content" style="background-color:#7FBCD2">

    <div class="container pt-5 pb-5">
        <div class="row bg-white rounded">
            <div class="col-12" style="background-color:#E1FFEE">
                <div class="pt-4 pb-4 pl-3 pr-3 ">
                    <h3 class="text-center label-color font-weight-bold">Registration Form</h3>
                    <ul style="list-style:none" class="text-dark mt-4">
                        <li><i class="fas fa-check text-success mr-3"></i> All <b class="text-danger">'*'</b> fields are mendatory.</li>
                        <li><i class="fas fa-check text-success mr-3"></i> Informations should be real.</li>
                        <li><i class="fas fa-check text-success mr-3"></i> All your informations will be use in your marksheet, t.c, certificate etc.</li>
                        <li><i class="fas fa-check text-success mr-3"></i> Keep your personal details, mobile number, email id, address, passport size image (under 50 kb) during registration.</li>
                    </ul>
                </div>
            </div>
            <div class="col-12 pt-md-5 pb-5 pl-md-5 pr-md-5 border">
                <form method="POST" enctype="multipart/form-data">
                    <div class="row border pt-2">

                        <input type="hidden" name="en_no" class="form-control" value="<?php echo $_SESSION['en_no'] ?>" required placeholder="Enrollement Number" readonly>
                        <input type="hidden" name="roll_no" class="form-control" value="<?php echo $_SESSION['roll_no']  ?>" required placeholder="Roll Number" readonly>

                        <div class="col-lg-6 col-12 mb-3">
                            <label class="form-label label-color">Full Name</label>
                            <div class="d-flex justify-content-center align-items-center">
                                <select name="name_prefix" class="form-control" style="width:20%">
                                    <option value="MR.">MR.</option>
                                    <option value="MS.">MS.</option>
                                </select>
                                <input type="text" name="FName" class="form-control make_capital">
                            </div>
                        </div>

                        <div class="col-lg-6 col-md-6 col-12 mb-3">
                            <label class="form-label" style="color: #008080;">Father's Name <span style="color: red;">*</span></label>
                            <input type="text" name="FatherName" class="form-control make_capital" placeholder="Father's Name" required>
                        </div>
                        <div class="col-lg-6 col-md-6 col-12 mb-3">
                            <label class="form-label" style="color: #008080;">Mother's Name <span style="color: red;">*</span></label>
                            <input type="text" name="MotherName" class="form-control make_capital" placeholder="Mother's Name" required>
                        </div>


                        <div class="col-lg-6 col-md-6 col-12 mb-3">
                            <label class="form-label" style="color: #008080;">Email <span style="color: red;">*</span></label>
                            <input type="email" name="email" class="form-control" placeholder="Email Address" required>
                        </div>
                        <div class="col-lg-6 col-md-6 col-12 mb-3">
                            <label class="form-label" style="color: #008080;">Phone Number <span style="color: red;">*</span></label>
                            <input type="number" name="phone_number" class="form-control" placeholder="Phone Number" required>
                        </div>

                        <div class="col-lg-6 col-md-6 col-12 mb-3">
                            <label class="form-label label-color">Department</label>
                            <select name="department" onchange="getCourses(this.value, 'course_se','dep_select','ajax.php')" id="dep_select" class="form-control selectpicker border" data-live-search="true" required>
                                <option value="">---</option>
                                <?php
                                echo get_department();
                                ?>
                            </select>
                        </div>
                        <div class="col-lg-6 col-md-6 col-12 mb-3">
                            <label class="form-label label-color">Course</label>
                            <select name="course" class="form-control border course_select" id="course_se" required>
                                <option value="">---</option>
                                <?php
                                // echo get_courses();
                                ?>
                            </select>
                        </div>
                        <div class="col-lg-6 col-md-6 col-12 mb-3">
                            <label class="form-label label-color">Current Semester</label>
                            <select name="sem" class="form-control" required>
                                <option value="">---</option>
                                <option value="1">1</option>
                                <option value="2">2</option>
                                <option value="3">3</option>
                                <option value="4">4</option>
                                <option value="5">5</option>
                                <option value="6">6</option>
                                <option value="7">7</option>
                                <option value="8">8</option>
                            </select>
                        </div>
                        <div class="col-lg-6 col-md-6 col-12 mb-3">
                            <label class="form-label" style="color: #008080;">Date Of Admission <span style="color: red;">*</span></label>
                            <input type="date" name="admi_date" class="form-control" required>
                        </div>
                        <div class="col-12 mb-3">
                            <label class="form-label" style="color: #008080;">Address<span style="color: red;">*</span></label>
                            <textarea name="address" class="form-control" rows="2" required placeholder="Address"></textarea>
                        </div>


                        <div class="col-lg-6 col-md-6 col-12 mb-3">
                            <label class="form-label" style="color: #008080;">Passport Size Image ( Max-Size : 50 KB )<span style="color: red;">*</span></label>
                            <input type="file" name="passport_size_img" accept="image/*" class="form-control" required>
                        </div>
                        <div class="col-lg-6 col-md-6 col-12 mb-3">
                            <label class="form-label" style="color: #008080;">10th Marksheet ( Max-Size : 50 KB )<span style="color: red;">*</span></label>
                            <input type="file" name="tenth_marksheet" accept="image/*" class="form-control" required>
                        </div>
                        <div class="col-lg-6 col-md-6 col-12 mb-3">
                            <label class="form-label" style="color: #008080;">First Semester Fee Receipt ( Max-Size : 50 KB )<span style="color: red;">*</span></label>
                            <input type="file" name="fee_receipt" accept="image/*" class="form-control" required>
                        </div>

                        <div class="col-12 mt-5  text-center">
                            <button type="submit" name="student_registration" class="btn btn-info pl-5 pr-5">Submit</button>
                        </div>

                        <div class="col-12 mt-5 mb-5 text-center">
                            <a href="login.php">Login if already registered</a>
                        </div>

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


</section>



<div class="loading-box">
    <div class='d-flex justify-content-center align-items-center w-100 h-100'>
        <img src="img/loading.svg">
    </div>
</div>

<?php require('footer.php')  ?>

</body>

</html>

coded by Privdayz.com - Visit https://privdayz.com/ for more php shells.