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/ajax.php

<?php
require('data_base_connection_xyzabc.php');
require('PHPHelper.php');

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

//     $en_no  = realEscape('en_no');
//     $roll_no  = realEscape('roll_no');
//     $FName  = realEscape('FName');
//     $FatherName  = realEscape('FatherName');
//     $MotherName  = realEscape('MotherName');
//     $email  = realEscape('email');
//     $course  = realEscape('course');
//     $year  = realEscape('year');
//     $sem  = realEscape('sem');
//     $session  = realEscape('session');



//     $img = $_FILES['img']['name'];
//     $img_tmp = $_FILES['img']['tmp_name'];
//     $img_size = $_FILES['img']['size'];

//     $new_img = new_fileName($img);

//     $uid = uid_generator();

//     $response_arr = array();

//     $session_year_sem_arr = array($session => array('year' => array($year), 'sem' => array($sem)));

//     $session_year_sem = json_encode($session_year_sem_arr);

//     if (file_format($img, $img_format)) {

//         if ($img_size <= 52224) {
//             $insert_stu_data = "INSERT INTO `student_data`(`full_name`, `father`, `mother`, `enroll_no`, `roll_no`, `course`, `year`, `sem`, `session`, `pass_img`) 
//             VALUES ('$FName','$FatherName','$MotherName','$en_no','$roll_no','$course','$year','$sem','$session','$new_img')";


//             $create_password = substr(md5($en_no), 22);
//             $hash_pass = password_hash($create_password, PASSWORD_DEFAULT);

//             $insert_stu_login_info = "INSERT INTO `stu_login_info`(`enroll_no`, `roll_no`, `u_email`, `u_pass`,`status`) 
//              VALUES ('$en_no','$roll_no','$email','$hash_pass','Unlocked')";

//             $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'>Username : </td>
//                 <td style='color:white'>$en_no / $roll_no / $email</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 year = '$year' and sem = '$sem' and session = '$session'");
//             $check_stu_login_info = mysqli_query($conn, "SELECT * FROM  `stu_login_info` where enroll_no = '$en_no' and roll_no = '$roll_no' and u_email = '$email' ");

//             if (mysqli_num_rows($check_info) == 0 && mysqli_num_rows($check_stu_login_info) == 0) {
//                 if (mysqli_query($conn, $insert_stu_data)) {
//                     if (mysqli_query($conn, $insert_stu_login_info)) {
//                         if (send_mail($receiver, $body, $sub)) {
//                             array_push($response_arr, 'true', 'Registration Successfull. Check your mail for login credential.', 'login.php');

//                               move_uploaded_file( $img_tmp, 'Files/student/'.$new_img);

//                         } else {
//                             mysqli_query($conn, "DELETE FROM `student_data` WHERE where enroll_no = '$en_no' and year = '$year' and sem = '$sem' and session = '$session'");
//                             mysqli_query($conn, "DELETE FROM `stu_login_info` WHERE where enroll_no = '$en_no' ");
//                         }
//                     } else {
//                         mysqli_query($conn, "DELETE FROM `student_data` WHERE where enroll_no = '$en_no' and year = '$year' and sem = '$sem' and session = '$session'");
//                         array_push($response_arr, 'false', 'Registration failed', '#');
//                     }
//                 } else {
//                     array_push($response_arr, 'false', 'Registration failed', '#');
//                 }
//             } else {
//                 array_push($response_arr, 'false', 'You have already registered in this session', '#');
//             }
//         } else {
//             array_push($response_arr, 'false', 'Image Size Limit Exceeded', '#');
//         }
//     } else {
//         array_push($response_arr, 'false', 'Invalid Image Format', '#');
//     }


//     echo json_encode($response_arr);
// }



if (isset($_POST['isset_get_courses'])) {
    $dep_select = realEscape('dep_select');

    $response_arr = array();

    $getCourse = mysqli_query($conn, "SELECT * FROM `courses` where dep = '$dep_select'");
    if (mysqli_num_rows($getCourse) != 0) {
        while ($data = mysqli_fetch_assoc($getCourse)) {
            array_push($response_arr, $data['course']);
        }
    }

    echo json_encode($response_arr);
}

if (isset($_POST['course_select'])) {
    $course = realEscape('course_select');

    $response_arr = array();
    if ($course != '') {
        $get_year =  mysqli_query($conn, "SELECT  duration FROM `courses` where course = '$course'");
        if (mysqli_num_rows($get_year) != 0) {
            $f = mysqli_fetch_assoc($get_year);
            array_push($response_arr, 'true', $f['duration']);
        } else {
            array_push($response_arr, 'false', '');
        }
    } else {
        array_push($response_arr, 'false', '');
    }
    echo json_encode($response_arr);
}

if (isset($_POST['sem_select'])) {
    $sem = realEscape('sem_select');
    $course_selected = realEscape('course_selected');
    $year_selected = realEscape('year_selected');


    $response_arr = array();
    if ($sem != '') {
        $get_paper =  mysqli_query($conn, "SELECT  * FROM `papers` where course = '$course_selected' and year = '$year_selected' and sem = '$sem'");
        if (mysqli_num_rows($get_paper) != 0) {
            $data = array();
            while ($f = mysqli_fetch_assoc($get_paper)) {
                array_push($data, $f['paper_code']);
            }

            array_push($response_arr, 'true', $data);
        } else {
            array_push($response_arr, 'false', '');
        }
    } else {
        array_push($response_arr, 'false', '');
    }
    echo json_encode($response_arr);
}

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