<?php
ob_start();
require("../includes/check_auth_user.php");
require("../includes/dbconnect.php");
include('../includes/function.php');

$maindb = "site_passmain";
$trandb = "ordertran";

$formname = "Users List";
$file = "userlist.php";

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
$myyear = $_SESSION[$myyear];
mysqli_select_db($zdb);

if (isset($_POST["view"])) {
    $user = $_POST['user'];
    $discperc = $_POST[discperc];
    $expdt = $_POST[expdt];
    $usercond = "";

    if (!empty($user)) {
        $usercond = " AND `user`='$user' ";
    }

    $getpmain = mysqli_query($conn,"SELECT * FROM `$maindb` WHERE `srno`!='' $usercond ")or die(mysqli_error($conn));

    include("../includes/linkshead.php");
    ?>
    </head>
    <body>
        <div class="container" style="width:90%">
            <div class="row">
                <?php include("../includes/head_rep.php"); ?>
                <div class="col-lg-12 pad">
                    <table class="table table-condensed table-bordered">
                        <tr class="mySearchTr">
                            <th style="background-color: #B9408F;width:10%">Sr</th>
                            <th style="background-color: #B9408F;width:15%">User Id</th>
                            <th style="background-color: #B9408F; width:35%">Name</th>
                            <th style="background-color: #B9408F;width:40%">Email Id.</th>
                        </tr>
                        <?php
                        $ctr = 0;
                        while ($pmain = mysqli_fetch_array($getpmain)) {
                            $ctr++;

                            Echo "<tr style='background-color:white'>";
                            Echo "<td>$ctr</td>";
                            Echo "<td>$pmain[srno]</td>";
                            Echo "<td>$pmain[user]</td>";
                            Echo "<td>$pmain[email]</td>";
                            Echo "</tr>";
                        }
                        ?>
                    </table>
                </div>
            </div>
        </div>

        <?php include("../includes/linksfoot.php"); ?>
    </body>
    </html>
    <?
}
?>
