Domain: amberpublishers.in
Server Adress: 86.38.243.169

privdayz.com

/home/u866425823/domains/mastercleanindia.co.in/public_html/include/
Dosya Yükle :
Current File : /home/u866425823/domains/mastercleanindia.co.in/public_html/include/phphelper.php

    <?php
    session_start();

    require('db.php');
    $conection = $conn;
    date_default_timezone_set('Asia/Kolkata');

    require 'PHPMailer/src/Exception.php';
    require 'PHPMailer/src/PHPMailer.php';
    require 'PHPMailer/src/SMTP.php';

    use PHPMailer\PHPMailer\PHPMailer;
    use PHPMailer\PHPMailer\Exception;

    $states  = array(
        'Andhra Pradesh',
        'Arunachal Pradesh',
        'Assam',
        'Bihar',
        'Chhattisgarh',
        'Goa',
        'Gujarat',
        'Haryana',
        'Himachal Pradesh',
        'Jammu & Kashmir',
        'Jharkhand',
        'Karnataka',
        'Kerala',
        'Madhya Pradesh',
        'Maharashtra',
        'Manipur',
        'Meghalaya',
        'Mizoram',
        'Nagaland',
        'Odisha',
        'Punjab',
        'Rajasthan',
        'Sikkim',
        'Tamil Nadu',
        'Tripura',
        'Uttarakhand',
        'Uttar Pradesh',
        'West Bengal',
        'Andaman & Nicobar',
        'Chandigarh',
        'Dadra and Nagar Haveli',
        'Daman & Diu',
        'Delhi',
        'Lakshadweep',
        'Puducherry'
    );
    function send_mail($receiver, $body, $sub)
    {
        $mail = new PHPMailer();
        // $mail->SMTPDebug=3;
        $mail->IsSMTP();
        $mail->SMTPAuth = true;
        $mail->Host = "smtp.office365.com";
        $mail->Port = "587";
        $mail->IsHTML(true);
        $mail->CharSet = 'UTF-8';
        $mail->Username = "";
        $mail->Password = "";
        $mail->SMTPSecure = "tls";
        $mail->SMTPAuth = true;
        $mail->SetFrom("[email protected]", "Master Clean India");
        $mail->Subject = $sub;
        $mail->Body = $body;
        $mail->AddAddress($receiver);
        $mail->SMTPOptions = array('ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false,
            'allow_self_signed' => false
        ));
        if (!$mail->Send()) {
            return false;
        } else {
            return true;
        }
    }

    // ---------------------------- function to send an email to the admin that a new quote request has been made --------------------
    function quote_notification($name, $email, $phone, $message)
    {
        $mail = new PHPMailer();
        // $mail->SMTPDebug=3;
        $mail->IsSMTP();
        $mail->SMTPAuth = true;
        $mail->Host = "smtp.office365.com";
        $mail->Port = "587";
        $mail->IsHTML(true);
        $mail->CharSet = 'UTF-8';
        $mail->Username = "[email protected]";
        $mail->Password = "Master@2022#Clean";
        $mail->SMTPSecure = "STARTTLS";
        $mail->addReplyTo($email, $name);
        $mail->SetFrom("[email protected]", "Master Clean India");
        $mail->Subject = "New Quote Request from $name";
        $body = "<h3>Quote Request</h3>
        <p>Hi Admin,</p>
        <p>You have received a new quote request from $name. The details are as follows:</p>
        <p><b>Name:</b> $name</p>
        <p><b>Email:</b> $email</p>
        <p><b>Phone:</b> $phone</p>
        <p><b>Message:</b> $message</p>
        <p>You can reply to them by replying to this email.</p>
        <p>Regards,</p>
        <p>Master Clean India</p>";
        $mail->Body = $body;
        $mail->SMTPOptions = array('ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false,
            'allow_self_signed' => false
        ));
        $mail->addAddress("[email protected]");
        if (!$mail->Send()) {
            return false;
        } else {
            return true;
        }
    }
    // ---------------------------- function to send an email to the admin that a new contact request has been made --------------------
    function contact_notification($name, $email, $subject, $message)
    {
        $mail = new PHPMailer();
        // $mail->SMTPDebug=3;
        $mail->IsSMTP();
        $mail->SMTPAuth = true;
        $mail->Host = "smtp.office365.com";
        $mail->Port = "587";
        $mail->IsHTML(true);
        $mail->CharSet = 'UTF-8';
        $mail->Username = "[email protected]";
        $mail->Password = "Master@2022#Clean";
        $mail->SMTPSecure = "STARTTLS";
        $mail->addReplyTo($email, $name);
        $mail->SetFrom("[email protected]", "Master Clean India");
        $mail->Subject = "New Contact Request from $name";
        $body = "<h3>New Contact Request !!!</h3>
        <p>Hi Admin,</p>
        <p>You have received a new contact request from $name. The details are as follows:</p>
        <p><b>Name:</b> $name</p>
        <p><b>Email:</b> $email</p>
        <p><b>Subject:</b> $subject</p>
        <p><b>Message:</b> $message</p>
        <p>You can reply to them by replying to this email.</p>
        <p>Regards,</p>
        <p>Master Clean India</p>";
        $mail->Body = $body;
        $mail->SMTPOptions = array('ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false,
            'allow_self_signed' => false
        ));
        $mail->addAddress("[email protected]");
        if (!$mail->Send()) {
            return false;
        } else {
            return true;
        }
    }

    // ---------------------------- Message Function Start--------------------

    function  SuccessFun($Message)
    {
        echo "
            <div class='alert alert-success alert-dismissible fade show' role='alert'>
            <strong>$Message</strong>  
            <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
            <span aria-hidden='true'>&times;</span>
            </button>
            </div>
            ";
        echo "<script>
                if (window.history.replaceState) {
                window.history.replaceState(null, null, window.location.href)
                }
                </script>";
    }
    function  DangerFun($Message)
    {
        echo "
            <div class='alert alert-danger alert-dismissible fade show' role='alert'>
            <strong>$Message</strong>  
            <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
            <span aria-hidden='true'>&times;</span>
            </button>
            </div>
            ";
        echo "<script>
                if (window.history.replaceState) {
                window.history.replaceState(null, null, window.location.href)
                }
                </script>";
    }



    // ---------------------------- Message Function end--------------------


    // -------------------------------- Go back Start ----------------------
    function goback($id)
    {
        if (!isset($id)) {
            echo "<script>window.history.back()</script>";
        }
    }
    // -------------------------------- Go back end----------------------

    // ----------------------------------- Real_escape string start-------------
    function realEscape($data)
    {
        global $conection;
        $escape = mysqli_real_escape_string($conection, trim($_POST[$data]));
        return  $escape;
    }

    // ----------------------------------- Real_escape string end-------------

    // -----------------Some Pre-Defined Files Formate Array----------------

    $pdf_format = ['pdf', 'PDF'];
    $docx_format = ['docx', 'DOCX'];
    $excel = ['xls', 'csv', 'xlsx'];
    $img_format = ['jpg', 'JPG', 'jpeg', 'JPEG', 'png', 'PNG', 'gif', 'GIF', 'tif', 'tiff'];
    $img_pdf_format = ['pdf', 'PDF', 'jpg', 'JPG', 'jpeg', 'JPEG', 'png', 'PNG', 'gif', 'GIF', 'tif', 'tiff'];
    function file_format($file, array $file_format)
    {
        $get_file_ext = pathinfo($file, PATHINFO_EXTENSION);

        if (!in_array($get_file_ext, $file_format)) {
            return false;
        } else {
            return true;
        }
    }

    // function new_fileName($file_name)
    // {
    //     $new_file_ext = pathinfo($file_name, PATHINFO_EXTENSION);
    //     $new_name = substr(md5($file_name) . mt_rand(1000, 10000), 22) . '.' . $new_file_ext;
    //     return $new_name;
    // }


    //    ------------------------------------------ Delete Only Data Not File Function Start------------------  
    function delete_single($table, $col_id)
    {
        global $conection;
        $delete = "DELETE FROM `$table` WHERE  col_id = '$col_id'";
        if (mysqli_query($conection, $delete)) {
            $check = "SELECT * FROM `$table` WHERE col_id = '$col_id'";
            $check_query = mysqli_query($conection, $check);
            $check_row = mysqli_num_rows($check_query);
            if ($check_row != 0) {
                return false;
            } else {
                return true;
            }
        } else {
            return false;
        }
    }

    function delete_multiple($table_name, array $col_ids)
    {
        global $conection;
        $success = 0;
        for ($i = 0; $i < count($col_ids); $i++) {
            $Delete = "DELETE FROM `$table_name` WHERE col_id = '$col_ids[$i]'";
            $Select = "SELECT * FROM `$table_name` WHERE col_id = '$col_ids[$i]'";

            $query = mysqli_query($conection, $Select);
            $Row = mysqli_num_rows($query);

            if ($Row != 0) {
                if (mysqli_query($conection, $Delete)) {
                    $select_again = "SELECT * FROM `$table_name` WHERE col_id = '$col_ids[$i]'";
                    $query_again = mysqli_query($conection, $select_again);
                    $Check_row = mysqli_num_rows($query_again);
                    if ($Check_row == 0) {
                        $success++;
                    }
                }
            }
        }


        if ($success == 0) {

            DangerFun('Failed To Delete Data');
        } else {
            SuccessFun('Total ' . $success . ' Data Deleted Successfully');
        }
    }


    function delete_single_with_file($table_name, $col_ids, array $file_arr, $path)
    {
        //    add '/' in the path at last 

        global $conection;

        $Delete = "DELETE FROM `$table_name` WHERE col_id = '$col_ids'";
        $Select = "SELECT * FROM `$table_name` WHERE col_id = '$col_ids'";

        $query = mysqli_query($conection, $Select);
        $Row = mysqli_num_rows($query);
        $fetch_data = mysqli_fetch_assoc($query);
        if ($Row != 0) {
            if (mysqli_query($conection, $Delete)) {
                $select_again = "SELECT * FROM `$table_name` WHERE col_id = '$col_ids'";
                $query_again = mysqli_query($conection, $select_again);
                $Check_row = mysqli_num_rows($query_again);
                if ($Check_row == 0) {

                    for ($j = 0; $j < count($file_arr); $j++) {
                        if (file_exists($path . $fetch_data[$file_arr[$j]])) {
                            unlink($path . $fetch_data[$file_arr[$j]]);
                        }
                    }
                    return true;
                } else {
                    return false;
                }
            } else {
                return false;
            }
        } else {
            return false;
        }
    }

    function delete_multiple_with_file($table_name, array $col_ids, array $file_arr, $path)
    {
        //    add '/' in the path at last 

        global $conection;
        $success = 0;
        for ($i = 0; $i < count($col_ids); $i++) {
            $Delete = "DELETE FROM `$table_name` WHERE col_id = '$col_ids[$i]'";
            $Select = "SELECT * FROM `$table_name` WHERE col_id = '$col_ids[$i]'";

            $query = mysqli_query($conection, $Select);
            $Row = mysqli_num_rows($query);
            $fetch_data = mysqli_fetch_assoc($query);
            if ($Row != 0) {
                if (mysqli_query($conection, $Delete)) {
                    $select_again = "SELECT * FROM `$table_name` WHERE col_id = '$col_ids[$i]'";
                    $query_again = mysqli_query($conection, $select_again);
                    $Check_row = mysqli_num_rows($query_again);
                    if ($Check_row == 0) {
                        $success++;
                        for ($j = 0; $j < count($file_arr); $j++) {

                            if ($fetch_data[$file_arr[$j]] != '') {
                                if (file_exists($path . $fetch_data[$file_arr[$j]])) {
                                    unlink($path . $fetch_data[$file_arr[$j]]);
                                }
                            }
                        }
                    }
                }
            }
        }


        if ($success == 0) {

            DangerFun('Failed To Delete Data');
        } else {
            SuccessFun('Total ' . $success . ' Data Deleted Successfully');
        }
    }


    //  ------------------------------------------ Delete Only Data Not File Function End------------------  


    // ------------------------------------------ function to list services dynamically in the header------------------

    function list_services()
    {
        global $conection;
        $listServicesSQL = "SELECT * FROM services";
        $listServicesResult = mysqli_query($conection, $listServicesSQL);
        if ($listServicesResult) {
            while ($listServicesRow = mysqli_fetch_assoc($listServicesResult)) {
                $serviceId = $listServicesRow['id'];
                $serviceName = $listServicesRow['serviceName'];
                echo '
                                <li><a href="service-details.php?serviceid=' . $serviceId . '">' . $serviceName . '</a></li>
                            ';
            }
        } else {
            echo mysqli_error($conection);
        }
    }


    // ------------------------------------------ function to list all services on pages where it's called------------------

    function show_services()
    {
        global $conection;
        $listServiceQuery = "SELECT * FROM `services`;";
        $listServiceResult = mysqli_query($conection, $listServiceQuery);
        $delay = 0;
        while ($row = mysqli_fetch_assoc($listServiceResult)) {
            $serviceid = $row['id'];
            $serviceName = $row['serviceName'];
            $serviceDescription = $row['serviceDescription'];
            $icon = $row['icon'];
            $delay += 100;
            echo '
                          <div class="col-lg-4 col-md-6" data-aos="fade-up" data-aos-delay="' . $delay . '">
                             <div class="service-item position-relative">
                              <div class="icon">
                                <i class="fa-solid fa-' . $icon . '"></i>
                              </div>
                              <h3>' . $serviceName . '</h3>
                              <p>' . substr($serviceDescription, 0, 50) . '</p>
                              <a href="service-details.php?serviceid=' . $serviceid . '" class="readmore stretched-link">Learn more <i class="bi bi-arrow-right"></i></a>
                            </div>
                          </div>
                      ';
        }
    }

    // ------------------------------------------ service side menubar --------------------------------------------

    function service_side_menu_bar()
    {
        global $conection;
        $serviceSideMenuSQL = "SELECT * FROM `services`;";
        $serviceSideMenuResult = mysqli_query($conection, $serviceSideMenuSQL);
        while ($row = mysqli_fetch_assoc($serviceSideMenuResult)) {
            $serviceSideMenuid = $row['id'];
            $matchSideMenuId = $_GET['serviceid'];
            $serviceSideMenuName = $row['serviceName'];
            if ($matchSideMenuId == $serviceSideMenuid) {
                echo '
                <a id="services-list" href="service-details.php?serviceid=' . $serviceSideMenuid . '" class="d-flex align-items-center justify-content-between active">
                  <h4>' . $serviceSideMenuName . '</h4>
                  <i class="bi bi-chevron-right"></i>
                </a>
                ';
            } else {
                echo '
                <a id="services-list" href="service-details.php?serviceid=' . $serviceSideMenuid . '" class="d-flex align-items-center justify-content-between">
                  <h4>' . $serviceSideMenuName . '</h4>
                  <i class="bi bi-chevron-right"></i>
                </a>
                ';
            }
        }
    }

    // ------------------------------------------ get sectors --------------------------------------------
    function get_sectors()
    {
        global $conection;
        $getSectorsSQL = "SELECT * FROM `sectors`;";
        $getSectorsResult = mysqli_query($conection, $getSectorsSQL);
        while ($row = mysqli_fetch_assoc($getSectorsResult)) {
            $sectorId = $row['id'];
            $sectorName = $row['sectorName'];
            $sectorDescription = $row['sectorDescription'];
            $sectorImage = $row['image'];
            echo '
                 <div class="col-lg-6 list-sector" data-aos="fade-up" data-aos-delay="100">
                    <div class="card-item">
                        <div class="row">
                           <div class="col-xl-5">
                             <div class="card-bg" style="background-image: url(\'./assets/img/sectors/' . $sectorImage . '\')"></div>
                            </div>
                        <div class="col-xl-7 d-flex align-items-center">
                        <div class="card-body">
                           <h4 class="card-title">' . $sectorName . '</h4>
                           <p>' . substr($sectorDescription, 0, 175) . '...</p>
                           <a href="sector-details.php?sectorid=' . $sectorId . '" class="readmore stretched-link">Learn more <i class="bi bi-arrow-right"></i></a>
                        </div>
                    </div>
                    </div>
                    </div>
                    </div>
                        ';
        }
    }

    // ------------------------------------------ function to list sectors dynamically in the header------------------

    function list_sectors()
    {
        global $conection;
        $listSectorsSQL = "SELECT * FROM sectors";
        $listSectorsResult = mysqli_query($conection, $listSectorsSQL);
        while ($listSectorsRow = mysqli_fetch_assoc($listSectorsResult)) {
            $sectorId = $listSectorsRow['id'];
            $sectorName = $listSectorsRow['sectorName'];
            echo '
                                <li><a href="sector-details.php?sectorid=' . $sectorId . '">' . $sectorName . '</a></li>
                            ';
        }
    }


    // ------------------------------------------why we should clean your building--------------------------------------------

    function why_we_should_clean_your_building()
    {
        echo
        '
            <section id="alt-services" class="alt-services">
      <div class="container" data-aos="fade-up">

        <div class="row justify-content-around gy-4">
          <div class="col-lg-6 img-bg" style="background-image: url(assets/img/services/alt-services.webp);" data-aos="zoom-in" data-aos-delay="100"></div>

          <div class="col-lg-5 d-flex flex-column justify-content-center">
            <h3>Why we should clean your building?</h3>
            <p>Whether you are a new business or old, looking to outsource your cleaning services or have decided to discontinue your current contractor for not providing the cleaning services you need, Master Clean India Services Housekeeping Team will go an extra mile to make sure that you are satisfied. A clean Building/Floors is not only a positive reflection of your business, but is also a boost to your employees\' morale. We will make sure that your building projects an image that it is well cared for.</p>

            <div class="icon-box d-flex position-relative" data-aos="fade-up" data-aos-delay="100">
              <i class="fa-solid fa-user-tie flex-shrink-0"></i>
              <div>
                <h4><a href="" class="stretched-link">Professionally managed & maintained</a></h4>
                <p>Professional Cleaning services and related maintenance services by latest methods in the premises include management of housekeeping staff, cleanliness scheduling, inspection, evaluation and reporting.</p>
              </div>
            </div><!-- End Icon Box -->

            <div class="icon-box d-flex position-relative" data-aos="fade-up" data-aos-delay="200">
              <i class="fa-solid fa-gears flex-shrink-0"></i>
              <div>
                <h4><a href="" class="stretched-link">Wide Service Coverage</a></h4>
                <p>With Master Clean geographical foot print, skilled development program, multiple regional training centers and robust customer base, Master Clean India Services group venture is all set to offer end to end business support services to its clients.</p>
              </div>
            </div><!-- End Icon Box -->

            <div class="icon-box d-flex position-relative" data-aos="fade-up" data-aos-delay="300">
              <i class="fa-solid fa-users-between-lines flex-shrink-0"></i>
              <div>
                <h4><a href="" class="stretched-link">Best in class ROI</a></h4>
                <p>With a visionary leadership board and next generation thought leadership, Master Clean India Services is positioned to offer a unique value proposition to its partners who wants returns</p>
              </div>
            </div><!-- End Icon Box -->

            <div class="icon-box d-flex position-relative" data-aos="fade-up" data-aos-delay="400">
              <i class="fa-solid fa-shield flex-shrink-0"></i>
              <div>
                <h4><a href="" class="stretched-link">Always pushing for the best</a></h4>
                <p>Master Clean India Services aims to bring Indian Technology and Professional Team to India to create Healthy, Safe, Hygienic and Eco-friendly environmental society by involving Corporates, NGO\'s and Government bodies and Individuals in our endeavours.</p>
              </div>
            </div>
            <!-- End Icon Box -->

          </div>
        </div>

      </div>
    </section>
        ';
    }
    // ------------------------------------------core values --------------------------------------------

    function core_values()
    {
        echo
        '
            <section id="alt-services-2" class="alt-services section-bg">
      <div class="container" data-aos="fade-up">

        <div class="row justify-content-around gy-4">
          <div class="col-lg-5 d-flex flex-column justify-content-center">
            <h3>Core Values</h3>
            <p>No company can offer you a stronger guarantee than Master Clean India Services You may come to call it ultimate peace of mind. Our core values define the character of our business and guide the decisions we make and how we operate day to day.</p>

            <div class="icon-box d-flex position-relative" data-aos="fade-up" data-aos-delay="100">
              <i class="fa-solid fa-check flex-shrink-0"></i>
              <div>
                <h4><a href="" class="stretched-link">Upholding exceptional standards:</a></h4>
                <p>Our success is founded on the quality and consistency of our work. We take pride in everything that we do and are relentless in our pursuit of exceptional standards.</p>
              </div>
            </div><!-- End Icon Box -->

            <div class="icon-box d-flex position-relative" data-aos="fade-up" data-aos-delay="200">
              <i class="bi bi-patch-check flex-shrink-0"></i>
              <div>
                <h4><a href="" class="stretched-link">Acting with integrity and transparency:</a></h4>
                <p>We have a straight forward, open and honest approach to all of our relationships and we aim to conduct ourselves with integrity and to demonstrate transparency in all of our actions.</p>
              </div>
            </div><!-- End Icon Box -->

            <div class="icon-box d-flex position-relative" data-aos="fade-up" data-aos-delay="300">
              <i class="bi bi-brightness-high flex-shrink-0"></i>
              <div>
                <h4><a href="" class="stretched-link">Demonstrating real commitment to our clients:</a></h4>
                <p>Our business exists to serve our clients and we aim to build long term relationships. We are committed to conducting ourselves with integrity at all times and to working closely with clients to understand their needs and develop solutions that are of the highest quality while also remaining cost efficient.</p>
              </div>
            </div><!-- End Icon Box -->

            <div class="icon-box d-flex position-relative" data-aos="fade-up" data-aos-delay="400">
              <i class="bi bi-brightness-high flex-shrink-0"></i>
              <div>
                <h4><a href="" class="stretched-link">Championing Our People</a></h4>
                <p>The biggest asset of Master Clean Services Pvt. Ltd. is the people who provide the services for our clients. We are committed for treating them with fairness and respect and in providing a safe and supportive working environment in which they can thrive and progress their careers.</p>
              </div>
            </div><!-- End Icon Box -->
          </div>

          <div class="col-lg-6 img-bg" style="background-image: url(assets/img/services/alt-services-2.webp);" data-aos="zoom-in" data-aos-delay="100"></div>
        </div>

      </div>
    </section>

        ';
    }
    // ------------------------------------------ sector side menubar --------------------------------------------

    function sector_side_menu_bar()
    {
        global $conection;
        $sectorSideMenuSQL = "SELECT * FROM `sectors`;";
        $sectorSideMenuResult = mysqli_query($conection, $sectorSideMenuSQL);
        while ($row = mysqli_fetch_assoc($sectorSideMenuResult)) {
            $sectorSideMenuid = $row['id'];
            $matchSideMenuId = $_GET['sectorid'];
            $sectorSideMenuName = $row['sectorName'];
            if ($matchSideMenuId == $sectorSideMenuid) {
                echo '
                <a id="services-list" href="sector-details.php?sectorid=' . $sectorSideMenuid . '" class="d-flex align-items-center justify-content-between active">
                  <h4>' . $sectorSideMenuName . '</h4>
                  <i class="bi bi-chevron-right"></i>
                </a>
                ';
            } else {
                echo '
                <a id="services-list" href="sector-details.php?sectorid=' . $sectorSideMenuid . '" class="d-flex align-items-center justify-content-between">
                  <h4>' . $sectorSideMenuName . '</h4>
                  <i class="bi bi-chevron-right"></i>
                </a>
                ';
            }
        }
    }


    ?>

coded by Privdayz.com - Visit https://privdayz.com/ for more php shells.