<?php session_start();
include("./../config/config.php");  
include("./backend/validated_admin.php");  

?>
<!DOCTYPE html>
<html lang="en">
   <head>
      <meta charset="UTF-8">
      <title>Local Merchant - iCouponWorld | Coupons | Discounts| Promo Codes</title>
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <link id="favicon" rel="icon" type="image/x-icon" href="../images/web-images/home/favicon.png">
      <meta name="robots" content="index, follow" />
      <meta name="author" content="Design Collection">
      <meta name="description" content="Built for Local Merchant Success. A well-designed online shopping experience actually leads to more in-store sales.">
      <meta name="keywords" content="iCouponWorld stores, products, coupon, coupon code, promo code, cashback, offer, promotion, deal">
      <link rel="canonical" href="local-merchant.php"/>
      <!-- Viewport configuration, scaling options -->
      <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
      <!-- Bootstrap CSS -->
      <link href="../css/icouponworld.css" rel="stylesheet">
      <!-- CSS Stylesheet -->
      <link href="../css/dashboard.css" rel="stylesheet">
      <!-- Font Awesome icon -->
      <link href="../fontawesome/css/fontawesome.css" rel="stylesheet" />
      <!-- Roboto font  -->
      <link rel="preconnect" href="https://fonts.googleapis.com">
      <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
      <link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;1,100;1,300;1,400;1,500;1,700&display=swap" rel="stylesheet">
       <!-- sweetalert.min.js Begin  -->
      <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
      <!-- sweetalert.min.js End  -->
      <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
      <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
      <![endif]-->
   </head>
   <body>
      <!--unique id begin -->
      <div id="s_mm">
   
         <!--scroll-top Begin-->
         <div id="scroll-top">
            <!--sidebarwrapper Begin-->
            <div id="sidebarwrapper">
               <!--Sidebarmenu Begin-->
              <?php include("./includefiles/sidebar.php"); ?>
               <!--Sidebarmenu End-->
               <!--content-wrapper Begin-->
               <div id="content-wrapper" class="d-flex flex-column dashboard-navbar">
                  <div id="maincontent">
                     <!-- Navbar Topbar Begin-->
                      <?php include("./includefiles/header.php"); ?>
                     <!-- Navbar Topbar End-->
                     <!-- Container Begin-->
                     <div class="container-fluid px-4">
                        <div class="d-sm-flex align-items-center justify-content-between mb-4">
                           <h3>
                              Local Merchant
                           </h3>
                        </div>
                        <?php include("./includefiles/coupon_count.php"); ?>
                       
                           <!--Local Merchant Details Begin-->
                             <?php include("./cpages/merchant_profile.php"); ?>
                           <!--Local Merchant Details End-->
                       
                     </div>
                     <!-- Container End-->
                  </div>
           <!--Copyright Begin-->
           <?php include("./includefiles/footer.php"); ?>
                  <!--Copyright End-->
               </div>
               <!--content-wrapper End-->
            </div>
            <!--sidebarwrapper End-->
            <!--Scroll to top Begin-->
            <a class="scroll-to-top rounded" href="#scroll-top">
            <i class="fas fa-angle-up"></i>
            </a>
            <!--Scroll to top End-->
            <!-- Jquery Script -->
            <script src="../js/jquery-3.4.1.min.js"></script>
            <!-- Bootstrap Script -->
            <script src="../js/bootstrap.bundle.min.js"></script>
            <!-- dashboard-icouponworld.js Script -->
            <script src="../js/dashboard-icouponworld.js"></script>
            <!-- jQuery Datatable js Script Begin-->
            <script src="../js/jquery.dataTables.min.js"></script>
              <!-- jQuery Datatable js End -->
            <!-- dataTables.bootstrap5.min js Begin-->  
            <script src="../js/dataTables.bootstrap5.min.js"></script>
            <!-- dataTables.bootstrap5.min js End--> 
             <!--csv js-->
             <script src="../js/table2csv.js"></script>
             <script src="../js/pdfmake.min.js"></script>
            <script>
                $(document).ready(function () {
                  $(' #merchant tfoot th, #company_wise tfoot th').each(function () {
         var title = $(this).text();
         $(this).html('<input type="text" class="form-control" placeholder="Search ' + title + '" />');
         
         });
  var table = $(' #merchant , #company_wise').DataTable({
         searchPanes: true,
         initComplete: function () {
          // Apply the search
          this.api()
             .columns()
             .every(function () {
         
                var that = this;
                $('input', this.footer()).on('keyup change clear', function () {
                   if (that.search() !== this.value) {
                      that.search(this.value).draw();
                   }
                });
             });
         },
         });
         })
         
               </script>
         <script type="text/javascript">
        function tableToCSV() {
 
            // Variable to store the final csv data
            var csv_data = [];
 
            // Get each row data
            var rows = document.getElementsByClassName('user');
            for (var i = 0; i < rows.length; i++) {
 
                // Get each column data
                var cols = rows[i].querySelectorAll('.user1,.user2');
 
                // Stores each csv row data
                var csvrow = [];
                for (var j = 0; j < cols.length; j++) {
 
                    // Get the text data of each cell
                    // of a row and push it to csvrow
                    csvrow.push(cols[j].innerHTML);
                }
 
                // Combine each column value with comma
                csv_data.push(csvrow.join(","));
            }
 
            // Combine each row data with new line character
            csv_data = csv_data.join('\n');
 
            // Call this function to download csv file 
            downloadCSVFile(csv_data);
 
        }
 
        function downloadCSVFile(csv_data) {
 
            // Create CSV file object and feed
            // our csv_data into it
            CSVFile = new Blob([csv_data], {
                type: "text/csv"
            });
 
            // Create to temporary link to initiate
            // download process
            var temp_link = document.createElement('a');
 
            // Download csv file
            temp_link.download = "userdata.csv";
            var url = window.URL.createObjectURL(CSVFile);
            temp_link.href = url;
 
            // This link should not be displayed
            temp_link.style.display = "none";
            document.body.appendChild(temp_link);
 
            // Automatically click the link to
            // trigger download
            temp_link.click();
            document.body.removeChild(temp_link);
        }
        
        // ------------------------------------------merchant data to csv----------------------------------------------
        function tableToCSV1() {
 
 // Variable to store the final csv data
 var csv_data = [];

 // Get each row data
 var rows = document.getElementsByClassName('merchant');
 for (var i = 0; i < rows.length; i++) {

     // Get each column data
     var cols = rows[i].querySelectorAll('.merchant1,.merchant2');

     // Stores each csv row data
     var csvrow = [];
     for (var j = 0; j < cols.length; j++) {

         // Get the text data of each cell
         // of a row and push it to csvrow
         csvrow.push(cols[j].innerHTML);
     }

     // Combine each column value with comma
     csv_data.push(csvrow.join(","));
 }

 // Combine each row data with new line character
 csv_data = csv_data.join('\n');

 // Call this function to download csv file 
 downloadCSVFile1(csv_data);

}

function downloadCSVFile1(csv_data) {

 // Create CSV file object and feed
 // our csv_data into it
 CSVFile = new Blob([csv_data], {
     type: "text/csv"
 });

 // Create to temporary link to initiate
 // download process
 var temp_link = document.createElement('a');

 // Download csv file
 temp_link.download = "merchant-data.csv";
 var url = window.URL.createObjectURL(CSVFile);
 temp_link.href = url;

 // This link should not be displayed
 temp_link.style.display = "none";
 document.body.appendChild(temp_link);

 // Automatically click the link to
 // trigger download
 temp_link.click();
 document.body.removeChild(temp_link);
}
    </script>
         </div>
         <!--scroll-top End-->
      </div>
      <!--unique id End -->
   </body>
</html>
