<?php
    session_start();
    if (!isset($_SESSION['username'])) {
        header("Location: login.php");
        exit();
    }
    
    require_once('include/config.php');
    require_once('include/startup.php');                           
    $alltables = new AllTables();
    
    // $sql= "SELECT * FROM mst_company WHERE id = $G_companyid";
    $sql= "SELECT cmp_name FROM mst_company WHERE id = $G_companyid";
	$data = $alltables -> getInfo('',$sql);

    $company_name               = $data[0]['cmp_name'];
    
    
    // View Correspondence Address
    $sql="SELECT * FROM exhibitors_badges where cmp_id = $G_companyid ";
    $result = $conn->query($sql);
    
    $exhibitorbadges="";
    
    while($rows = $result->fetch_assoc()) {
         
        $exhibitorbadges .= "<tr>
                                <td>". $rows['name']."</td>
                                <td>". $rows['designation']."</td>
                                <td>". $rows['cmp_name']."</td>
                                <td>". $rows['email']."</td>
                                <td>". $rows['mobile_no']."</td>
                                <td>
                                    <button type='button' data-id='{$rows['id']}' class='btn btn-primary btn-sm viewBadgeBtn' data-bs-toggle='modal' data-bs-target='#exhibitorbadge'>View</button>
                                </td>
                            </tr>";
    }
    
    
    
    include('include/header.php');   
    include_once('exhibitors-badges1-demo.html');   
    include('include/footer.php');            
?>    