 	<?php
    // Connect to the database (replace with your database credentials)
    $db = new mysqli('localhost', "tslibrary_user", "rb!tsl838", "tslibrary_data");

    if ($db->connect_error) {
        die("Connection failed: " . $db->connect_error);
    }

    // Query to select records from the book_allot_receive table
    $sql = "SELECT * FROM branchlogin where username='$user'";
    $result = $db->query($sql);

    if ($result->num_rows > 0) {
$i=0;
        while ($row = $result->fetch_assoc()) {
		          
        $i=$i+1;    
           		
        }
      
    } else {
        
    }

    $db->close();
    ?>
            <div class="col-xxl-4 col-md-6">
              <div class="card info-card sales-card">

                <div class="filter">
                  <a class="icon" href="#" data-bs-toggle="dropdown"><i class="bi bi-three-dots"></i></a>
                  <ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
                    <li class="dropdown-header text-start">
                      <h6>Filter</h6>
                    </li>

                    <li><a class="dropdown-item" href="#">Today</a></li>
                    <li><a class="dropdown-item" href="#">This Month</a></li>
                    <li><a class="dropdown-item" href="#">This Year</a></li>
                  </ul>
                </div>

                <div class="card-body">
                  <h5 class="card-title">Total Students<span>| Till Date</span></h5>
    
	<?php
    // Connect to the database (replace with your database credentials)
    $db = new mysqli('localhost', "tslibrary_user", "rb!tsl838", "tslibrary_data");

    if ($db->connect_error) {
        die("Connection failed: " . $db->connect_error);
    }

    // Query to select records from the book_allot_receive table
    $sql = "SELECT * FROM student_registration '";
    $result = $db->query($sql);

    if ($result->num_rows > 0) {
		$i=0;
        while ($row = $result->fetch_assoc())
			{
        $i=$i+1;    
   		
        }
      
    } else 
	{
        
    }

    $db->close();
    ?>
       <?php
$servername = "localhost"; // Replace with your actual server name
$username = "tslibrary_user";       // Replace with your actual username
$password = "rb!tsl838";       // Replace with your actual password
$dbname = "tslibrary_data";         // Replace with your actual database name

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

// SQL query to count rows
$sql = "SELECT COUNT(*) AS row_count FROM  student_registration"; // Replace with your actual table name
$result = $conn->query($sql);

if ($result) {
    // Fetch the result
    $row = $result->fetch_assoc();
    
    // Display the result
    $totalrow=$row['row_count'];
} else {
    echo "Error executing query: " . $conn->error;
}

// Close connection
$conn->close();
?>
  


         <div class="d-flex align-items-center">
                    <div class="card-icon rounded-circle d-flex align-items-center justify-content-center">
                      <i class="bi bi-cart"></i>
                    </div>
                    <div class="ps-3">
                      <h6><?php echo  $totalrow ?></h6>
                      <span class="text-success small pt-1 fw-bold">    </span> <span class="text-muted small pt-2 ps-1">increase</span>

                    </div>
                  </div>
                </div>

              </div>
            </div><!-- End Sales Card -->
