HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-31-18-78 6.17.0-1017-aws #17~24.04.1-Ubuntu SMP Tue May 26 21:09:53 UTC 2026 aarch64
User: ubuntu (1000)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /var/www/nclive/technc/state_list.php
<?php 
include 'config.php'; 
include 'header.php';
include 'sidebar.php';
include 'top_header.php';

$countQuery="select count(*) as total from sp_states";
$sqlQuery=$db->prepare($countQuery);
$sqlQuery->execute();
$counts=$sqlQuery->fetch();

$stateQuery="Select state_id, state_name, state_slug, image_icon, state_code, header_order, header_status from sp_states order by state_name";
$sqlState=$db->prepare($stateQuery);
$sqlState->execute();

?>

<main id="main-container">
    <div class="content content-narrow">
        <div class="row">
            <div class="col-lg-12">
                <h2 class="content-heading">State List</h2>
                <table class="table table-striped table-hover text-capitalize">
					<thead>
                        <tr class="info">
							<th>S.No</th>
                            <th>State Name</th>
                            <th>State Slug</th>
                  			<th>Code</th>
                  			<th>HStatus</th>
                  			<th>HOrder</th>
                            <th>Edit</th>
                            <th>Delete</th>
						</tr>
					</thead>
              		<?php 
                    $i=1;
                    while($rSt=$sqlState->fetch()){ 
                  							 
                  	?>
                  	<tr>
                    	<td><?php echo $i; ?></td>
                    	<td><?php echo $rSt['state_name']; ?></td>
                    	<td><?php echo $rSt['state_slug']; ?></td>
                    	<td><?php echo $rSt['state_code']; ?></td>
                    	<td><?php echo $rSt['header_status']; ?></td>
						<td><?php echo $rSt['header_order']; ?></td>
						<td><img src="images/<?php echo $rSt['image_icon']; ?>" style="width:50px; height:50px;"></td>
                    
                    	<td>
						<a href='./state_edit?state_id=<?php echo $rSt['state_id']; ?>'>
						<button name="edit" class="btn btn-info" title="Edit State">Edit</button></a></td>
					</tr>
					<?php $i++; } ?>
                  	<tr class="info">
                  		<th colspan='4'>Total States</th>
                  		<td colspan='4'><?php  echo $counts['total']; ?></td>
                  	</tr> 
                </table>
            </div>
        </div>
    </div>
</main>

<?php  include 'footer.php'; ?>