Domain: amberpublishers.in
Server Adress: 86.38.243.169

privdayz.com

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

<?php
require('Common/Header.php');
if (isset($_POST['update'])) {
    $name_prefix = realEscape('name_prefix');
    $name = realEscape('name');
    $father = realEscape('father');
    $mother = realEscape('mother');
    $email = realEscape('email');
    $phone = realEscape('phone');
    $address = realEscape('address');
    $doa = realEscape('doa');
    $department = realEscape('department');
    $course = realEscape('course');
    $sem = realEscape('sem');

    $Update = "UPDATE `student_data` SET 
    `name_prefix`='$name_prefix',
    `full_name`='$name',
    `sem`='$sem',
    `dep`='$department',
    `course`='$course',
    `father`='$father',
    `mother`='$mother',
    `address`='$address',
    `email`='$email',
    `phone`='$phone',
    `admi_date` = '$doa'
     WHERE enroll_no='$f_s_d[enroll_no]'";

    $check = mysqli_query($conn, "SELECT * FROM `student_data` where email = '$email' and enroll_no != '$f_s_d[enroll_no]'");
    $row = mysqli_num_rows($check);
    if ($row == 0) {
        if (mysqli_query($conn, $Update)) {
            SuccessFun('Profile Updated Successfully');
        } else {
            DangerFun('Failed To Update Profile');
        }
    } else {
        DangerFun('This email id is in use');
    }
}

if (isset($_POST['pass_sub'])) {
    $file  = $_FILES['file']['name'];
    $filetmp  = $_FILES['file']['tmp_name'];

    $new_file = new_fileName($file);

    if (file_format($file, $img_format)) {
        $Update = "UPDATE `student_data` SET 
        `pass_img`='$new_file'
         WHERE enroll_no='$f_s_d[enroll_no]'";
        if (mysqli_query($conn, $Update)) {
            if ($f_s_d['pass_img'] != '') {
                if (file_exists('../Files/student/' . $f_s_d['pass_img'])) {
                    unlink('../Files/student/' . $f_s_d['pass_img']);
                }
            }

            move_uploaded_file($filetmp, '../Files/student/' . $new_file);
            SuccessFun('Profile Photo Updated Successfully');
        }
    } else {
        DangerFun('Invalid File Format');
    }
}
if (isset($_POST['sub_marksheet'])) {
    $file  = $_FILES['file']['name'];
    $filetmp  = $_FILES['file']['tmp_name'];

    $new_file = new_fileName($file);

    if (file_format($file, $img_format)) {
        $Update = "UPDATE `student_data` SET 
        `marksheet`='$new_file'
         WHERE enroll_no='$f_s_d[enroll_no]'";
        if (mysqli_query($conn, $Update)) {
            if ($f_s_d['marksheet'] != '') {
                if (file_exists('../Files/10th_marksheet/' . $f_s_d['marksheet'])) {
                    unlink('../Files/10th_marksheet/' . $f_s_d['marksheet']);
                }
            }

            move_uploaded_file($filetmp, '../Files/10th_marksheet/' . $new_file);
            SuccessFun('Marksheet Updated Successfully');
        }
    } else {
        DangerFun('Invalid File Format');
    }
}
if (isset($_POST['sub_fee_receipt'])) {
    $file  = $_FILES['file']['name'];
    $filetmp  = $_FILES['file']['tmp_name'];

    $new_file = new_fileName($file);

    if (file_format($file, $img_format)) {
        $Update = "UPDATE `student_data` SET 
        `fee_receipt`='$new_file'
         WHERE enroll_no='$f_s_d[enroll_no]'";
        if (mysqli_query($conn, $Update)) {
            if ($f_s_d['fee_receipt'] != '') {
                if (file_exists('../Files/student/' . $f_s_d['fee_receipt'])) {
                    unlink('../Files/student/' . $f_s_d['fee_receipt']);
                }
            }

            move_uploaded_file($filetmp, '../Files/student/' . $new_file);
            SuccessFun('Fee Receipt Updated Successfully');
        }
    } else {
        DangerFun('Invalid File Format');
    }
}


?>

<!--Content Wrapper-->
<!------------Top bar start-------------->
<!------------Top bar End--------------->

<!-- Begin Page Content -->
<div class="container-fluid">
    <form method="POST" enctype="multipart/form-data">
        <div class="card shadow">
            <div class="card-header">
                <h6 class="m-0 font-weight-bold text-primary text-md-left text-center " style="width:300px">Profile</h6>
            </div>
            <div class="card-body">
                <div class="row">
                    <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="<?php echo $f_s_d['name_prefix'] ?>"><?php echo $f_s_d['name_prefix'] ?></option>
                                <option value="MR.">MR.</option>
                                <option value="MS.">MS.</option>
                            </select>
                            <input type="text" name="name" class="form-control make_capital" value="<?php echo $f_s_d['full_name'] ?>">
                        </div>
                    </div>
                    <div class="col-lg-6 col-12 mb-3">
                        <label class="form-label label-color">Father's Name</label>
                        <input type="text" name="father" class="form-control make_capital" value="<?php echo $f_s_d['father'] ?>">
                    </div>
                    <div class="col-lg-6 col-12 mb-3">
                        <label class="form-label label-color">Mother's Name</label>
                        <input type="text" name="mother" class="form-control make_capital" value="<?php echo $f_s_d['mother'] ?>">
                    </div>
                    <div class="col-lg-6 col-12 mb-3">
                        <label class="form-label label-color">Email</label>
                        <input type="email" name="email" class="form-control" value="<?php echo $f_s_d['email'] ?>">
                    </div>
                    <div class="col-lg-6 col-12 mb-3">
                        <label class="form-label label-color">Phone Number</label>
                        <input type="number" name="phone" class="form-control" value="<?php echo $f_s_d['phone'] ?>">
                    </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="<?php echo $f_s_d['dep'] ?>"><?php echo $f_s_d['dep'] ?></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="<?php echo $f_s_d['course'] ?>"><?php echo $f_s_d['course'] ?></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="<?php echo $f_s_d['sem'] ?>"><?php echo $f_s_d['sem'] ?></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-12 mb-3">
                        <label class="form-label label-color">Date Of Admission</label>
                        <input type="date" name="doa" class="form-control" value="<?php echo $f_s_d['admi_date'] ?>" required>
                    </div>


                    <div class="col-lg-6 col-12 mb-3">
                        <label class="form-label label-color">Address</label>
                        <input type="text" name="address" class="form-control" value="<?php echo $f_s_d['address'] ?>">
                    </div>

                </div>

            </div>
            <div class="card-footer text-center">
                <button type="submit" name="update" class="btn btn-primary">Update</button>
            </div>
        </div>
    </form>


    <div class="row mt-5">
        <div class="col-12">
            <div class="card shadow mb-4">
                <div class="card-header py-3 d-flex justify-content-between align-items-center flex-wrap">
                    <h6 class="m-0 font-weight-bold text-primary" style="width:300px">Update Files</h6>
                </div>
                <div class="card-body">
                    <form method="POST" enctype="multipart/form-data" id="photo-form">
                        <div class="row border-bottom mb-3">
                            <div class="col-lg-4 col-md-4 col-12 mb-3 text-md-left text-center">
                                <?php
                                if ($f_s_d['pass_img'] != '') {
                                    $href = "../Files/student/$f_s_d[pass_img]";
                                } else {
                                    $href = "#";
                                }
                                ?>
                                <p>Profile Photo</p>
                                <img src="<?php echo $href ?>" height="100" class="table-pro-pic">
                            </div>
                            <div class="col-lg-4 col-md-4 col-12 mb-3 text-md-left text-center">
                                <input type="file" name="file" accept="image/*" class="form-control" required>
                                <span>
                                    Upload Only Passport Size Photo under 50KB
                                </span>
                            </div>
                            <div class="col-lg-4 col-md-4 col-12 mb-3 text-center">
                                <button type="submit" name="pass_sub" class="btn" style="background-color:#008080;color:#FFFFFF">Change</button>
                            </div>
                        </div>
                    </form>
                    <form method="POST" enctype="multipart/form-data" id="photo-form">
                        <div class="row border-bottom mb-3">
                            <div class="col-lg-4 col-md-4 col-12 mb-3 text-md-left text-center">
                                <?php
                                if ($f_s_d['marksheet'] != '') {
                                    $href = "../Files/10th_marksheet/$f_s_d[marksheet]";
                                } else {
                                    $href = "#";
                                }
                                ?>
                                <p>10th Marksheet</p>


                                <img src="<?php echo $href ?>" height="100" class="table-pro-pic">


                            </div>
                            <div class="col-lg-4 col-md-4 col-12 mb-3 text-md-left text-center">
                                <input type="file" name="file" accept="image/*" class="form-control" required>
                            </div>
                            <div class="col-lg-4 col-md-4 col-12 mb-3 text-center">
                                <button type="submit" name="sub_marksheet" class="btn" style="background-color:#008080;color:#FFFFFF">Change</button>
                            </div>
                        </div>
                    </form>
                    <form method="POST" enctype="multipart/form-data" id="fee-form">
                        <div class="row border-bottom mb-3">
                            <div class="col-lg-4 col-md-4 col-12 mb-3 text-md-left text-center">
                                <?php
                                if ($f_s_d['fee_receipt'] != '') {
                                    $href = "../Files/student/$f_s_d[fee_receipt]";
                                } else {
                                    $href = "#";
                                }
                                ?>
                                <p>Admission Fee Receipt</p>


                                <img src="<?php echo $href ?>" height="100" class="table-pro-pic">


                            </div>
                            <div class="col-lg-4 col-md-4 col-12 mb-3 text-md-left text-center">
                                <input type="file" name="file" accept="image/*" class="form-control" required>
                            </div>
                            <div class="col-lg-4 col-md-4 col-12 mb-3 text-center">
                                <button type="submit" name="sub_fee_receipt" class="btn" style="background-color:#008080;color:#FFFFFF">Change</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>


<?php require('Common/Footer.php') ?>


</body>

</html>

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