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/../edit_games_and_sports.php
<?php include('include/sidebar.php'); ?>
<!-- Start Welcome area -->

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

<?php
$id=$_GET['id'];
if(isset($_FILES['image']['name'])){
    $title=$_POST['title'];
    $description=$_POST['description'];
    $img=$_FILES['image']['name'];
    if ($img!='') {
        $image=uniqid().$_FILES['image']['name'];
        $path = 'uploads/'.$image;
        unlink($_POST['img_url']);
    }else{
        $path=$_POST['img_url'];
    }

    if ($_FILES['image1']['name']!='') {
        $image1=uniqid().$_FILES['image1']['name'];
        $path1 = 'uploads/'.$image1;
        unlink($_POST['img_url1']);
    }else{
        $path1=$_POST['img_url1'];
    }

    if ($_FILES['image2']['name']!='') {
        $image2=uniqid().$_FILES['image2']['name'];
        $path2 = 'uploads/'.$image2;
        unlink($_POST['img_url2']);
    }else{
        $path2=$_POST['img_url2'];
    }


    $que="UPDATE games_and_sports SET image='$path',image1='$path1',image2='$path2',title='$title',description='$description' WHERE id='$id' LIMIT 1";

    
    if ($conn->query($que) === TRUE) {
        
        move_uploaded_file($_FILES['image']['tmp_name'], $path);
        move_uploaded_file($_FILES['image1']['tmp_name'], $path1);
        move_uploaded_file($_FILES['image2']['tmp_name'], $path2);
        echo '<script>alert("Updated successfully"); location.href="games_and_sports"</script>';
    }else {
      echo '<script>alert("Something went wrong");</script>';
  }
}

$q = "SELECT * FROM games_and_sports WHERE id='$id' limit 1";
$result  = mysqli_query($conn,$q);
$row = mysqli_fetch_assoc($result);
        // print_r($row);

?>
<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 Games and Sport</h2>
                                </div>
                            </div>
                        </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">
                       
                            <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">
                                         <form method="post" enctype="multipart/form-data">
                                        <div class="file-upload-inner ts-forms" style="margin-bottom:15px;">
                                            <div class="input prepend-small-btn">
                                                <div class="file-button">
                                                    Browse
                                                    <input type="file" name="image" accept="image/*" onchange="document.getElementById('prepend-small-btn').value = this.value;">
                                                </div>
                                                <input type="text" id="prepend-small-btn"  placeholder="Select Image" readonly>
                                                <input type="hidden" name="img_url" value="<?php echo $row['image'] ?>">
                                            </div>
                                        </div>
                                        <div class="file-upload-inner ts-forms" style="margin-bottom:15px;">
                                            <div class="input prepend-small-btn">
                                                <div class="file-button">
                                                    Browse
                                                    <input type="file" name="image1" accept="image/*" onchange="document.getElementById('prepend-small-btn1').value = this.value;">
                                                </div>
                                                <input type="text" id="prepend-small-btn1"  placeholder="Select Image" readonly>
                                                <input type="hidden" name="img_url1" value="<?php echo $row['image1'] ?>">
                                            </div>
                                        </div>
                                        <div class="file-upload-inner ts-forms" style="margin-bottom:15px;">
                                            <div class="input prepend-small-btn">
                                                <div class="file-button">
                                                    Browse
                                                    <input type="file" name="image2" accept="image/*" onchange="document.getElementById('prepend-small-btn2').value = this.value;">
                                                </div>
                                                <input type="text" id="prepend-small-btn2"  placeholder="Select Image" readonly>
                                                <input type="hidden" name="img_url2" value="<?php echo $row['image2'] ?>">
                                            </div>
                                        </div>
                                        <div class="input-group mg-b-pro-edt">

                                            <input type="text" class="form-control" name="title" name="title" placeholder="Title" value="<?php echo $row['title'] ?>">

                                        </div>
                                        <div class="input-group mg-b-pro-edt">

                                            <textarea rows="5" class="form-control" name="description" id="editor" placeholder="Description"><?php echo $row['description'] ?></textarea>

                                        </div>
                                        <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="games_and_sports" class="btn btn-ctl-bt waves-effect waves-light">cancel

                                            </a>

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

                                    <div class="text-center col-lg-6 col-md-6 col-sm-6 col-xs-12">
                                        <p>
                                            <?php if ($row['image']!='') { ?>
                                        <img src="<?php echo $row['image'] ?>" style="width: 50%;">
                                        <button id="image" onclick="delImage(<?php echo $row['id'] ?>,'image')" data-toggle="tooltip" title="Trash" class="butn pd-setting-ed bg-danger"><i class="fa fa-trash-o" aria-hidden="true"></i></button>
                                         <?php } ?>
                                    </p>
                                    <p>
                                        <?php if ($row['image1']!='') { ?>
                                         <img src="<?php echo $row['image1'] ?>" style="width: 50%;">
                                         <button id="image1" onclick="delImage(<?php echo $row['id'] ?>,'image1')" data-toggle="tooltip" title="Trash" class="butn pd-setting-ed bg-danger"><i class="fa fa-trash-o" aria-hidden="true"></i></button>
                                          <?php } ?>
                                     </p>
                                     <p>
                                        <?php if ($row['image2']!='') { ?>
                                         <img src="<?php echo $row['image2'] ?>" style="width: 50%;">
                                         
                                         <button id="image2" onclick="delImage(<?php echo $row['id'] ?>,'image2')" data-toggle="tooltip" title="Trash" class="butn pd-setting-ed bg-danger"><i class="fa fa-trash-o" aria-hidden="true"></i></button>
                                     <?php } ?>
                                     </p>
                                    </div>


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



                                    </div>

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

                </div>

            </div>

        </div>

    </div>

</div>

</div>
<script>
    function delImage(e,column) {
        // alert(column);
      var verify = confirm("Do you really want to delete!!!");
      if(verify) {
          $.ajax({
              url: "delete.php",
              type: "POST",
              data: {
                  uid: e,table_name:'games_and_sports',column:column,
              },
              success: function(response){
                 location.reload();
              },
          })
      }
  }
</script>
<?php include('include/footer.php'); ?>

MMCT - 2023