[go: up one dir, main page]

0% found this document useful (0 votes)
17 views33 pages

Program

The document contains PHP scripts for an Online Library Management System, including functionalities for admin login, dashboard, issuing books, and student signup. It manages user sessions, handles form submissions, and interacts with a database to perform operations like user authentication and book management. The HTML structure includes Bootstrap for styling and JavaScript for dynamic content loading and validation.

Uploaded by

nkarmy1710
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views33 pages

Program

The document contains PHP scripts for an Online Library Management System, including functionalities for admin login, dashboard, issuing books, and student signup. It manages user sessions, handles form submissions, and interacts with a database to perform operations like user authentication and book management. The HTML structure includes Bootstrap for styling and JavaScript for dynamic content loading and validation.

Uploaded by

nkarmy1710
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 33

Adminlogin.

php
<?php

session_start();

error_reporting(0);

include('includes/config.php');

if($_SESSION['alogin']!=''){

$_SESSION['alogin']='';

if(isset($_POST['login']))

$username=$_POST['username'];

$password=md5($_POST['password']);

$sql ="SELECT UserName,Password FROM admin WHERE UserName=:username and


Password=:password";

$query= $dbh -> prepare($sql);

$query-> bindParam(':username', $username, PDO::PARAM_STR);

$query-> bindParam(':password', $password, PDO::PARAM_STR);

$query-> execute();

$results=$query->fetchAll(PDO::FETCH_OBJ);

if($query->rowCount() > 0)

$_SESSION['alogin']=$_POST['username'];

echo "<script type='text/javascript'> document.location ='admin/dashboard.php'; </script>";

} else{
echo "<script>alert('Invalid Details');</script>";

?>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

<meta name="description" content="" />

<meta name="author" content="" />

<title>Online Library Management System</title>

<!-- BOOTSTRAP CORE STYLE -->

<link href="assets/css/bootstrap.css" rel="stylesheet" />

<!-- FONT AWESOME STYLE -->

<link href="assets/css/font-awesome.css" rel="stylesheet" />

<!-- CUSTOM STYLE -->

<link href="assets/css/style.css" rel="stylesheet" />

<!-- GOOGLE FONT -->

<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet'


type='text/css' />

</head>

<body>

<!------MENU SECTION START-->


<?php include('includes/header.php');?>

<!-- MENU SECTION END-->

<div class="content-wrapper">

<div class="container">

<div class="row pad-botm">

<div class="col-md-12">

<h4 class="header-line">ADMIN LOGIN FORM</h4>

</div>

</div>

<!--LOGIN PANEL START-->

<div class="row">

<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3" >

<div class="panel panel-info">

<div class="panel-heading">

LOGIN FORM

</div>

<div class="panel-body">

<form role="form" method="post">

<div class="form-group">

<label>Enter Username</label>

<input class="form-control" type="text" name="username" autocomplete="off" required />

</div>

<div class="form-group">
<label>Password</label>

<input class="form-control" type="password" name="password" autocomplete="off"


required />

</div>

<button type="submit" name="login" class="btn btn-info">LOGIN </button>

</form>

</div>

</div>

</div>

</div>

<!---LOGIN PABNEL END-->

</div>

</div>

<!-- CONTENT-WRAPPER SECTION END-->

<?php include('includes/footer.php');?>

<!-- FOOTER SECTION END-->

<script src="assets/js/jquery-1.10.2.js"></script>

<!-- BOOTSTRAP SCRIPTS -->

<script src="assets/js/bootstrap.js"></script>

<!-- CUSTOM SCRIPTS -->

<script src="assets/js/custom.js"></script>

</script>

</body>

</html>
Dashboard.php
<?php

session_start();

error_reporting(0);

include('includes/config.php');

if(strlen($_SESSION['alogin'])==0)

header('location:index.php');

else{?>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

<meta name="description" content="" />

<meta name="author" content="" />

<!--[if IE]>

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<![endif]-->

<title>Online Library Management System | Admin Dash Board</title>

<!-- BOOTSTRAP CORE STYLE -->

<link href="assets/css/bootstrap.css" rel="stylesheet" />


<!-- FONT AWESOME STYLE -->

<link href="assets/css/font-awesome.css" rel="stylesheet" />

<!-- CUSTOM STYLE -->

<link href="assets/css/style.css" rel="stylesheet" />

<!-- GOOGLE FONT -->

<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet'


type='text/css' />

</head>

<body>

<!------MENU SECTION START-->

<?php include('includes/header.php');?>

<!-- MENU SECTION END-->

<div class="content-wrapper">

<div class="container">

<div class="row pad-botm">

<div class="col-md-12">

<h4 class="header-line">ADMIN DASHBOARD</h4>

</div>

</div>

<div class="row">

<a href="manage-books.php">
<div class="col-md-3 col-sm-3 col-xs-6">

<div class="alert alert-success back-widget-set text-center">

<i class="fa fa-book fa-5x"></i>

<?php

$sql ="SELECT id from tblbooks ";

$query = $dbh -> prepare($sql);

$query->execute();

$results=$query->fetchAll(PDO::FETCH_OBJ);

$listdbooks=$query->rowCount();

?>

<h3><?php echo htmlentities($listdbooks);?></h3>

Books Listed

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

<a href="manage-issued-books.php">

<div class="col-md-3 col-sm-3 col-xs-6">

<div class="alert alert-warning back-widget-set text-center">

<i class="fa fa-recycle fa-5x"></i>

<?php

$sql2 ="SELECT id from tblissuedbookdetails where (RetrunStatus='' || RetrunStatus is null)";

$query2 = $dbh -> prepare($sql2);

$query2->execute();

$results2=$query2->fetchAll(PDO::FETCH_OBJ);

$returnedbooks=$query2->rowCount();

?>
<h3><?php echo htmlentities($returnedbooks);?></h3>

Books Not Returned Yet

</div>

</div>

</a>

<a href="reg-students.php">

<div class="col-md-3 col-sm-3 col-xs-6">

<div class="alert alert-danger back-widget-set text-center">

<i class="fa fa-users fa-5x"></i>

<?php

$sql3 ="SELECT id from tblstudents ";

$query3 = $dbh -> prepare($sql3);

$query3->execute();

$results3=$query3->fetchAll(PDO::FETCH_OBJ);

$regstds=$query3->rowCount();

?>

<h3><?php echo htmlentities($regstds);?></h3>

Registered Users

</div>

</div></a>

<a href="manage-authors.php">

<div class="col-md-3 col-sm-3 col-xs-6">

<div class="alert alert-success back-widget-set text-center">

<i class="fa fa-user fa-5x"></i>


<?php

$sq4 ="SELECT id from tblauthors ";

$query4 = $dbh -> prepare($sq4);

$query4->execute();

$results4=$query4->fetchAll(PDO::FETCH_OBJ);

$listdathrs=$query4->rowCount();

?>

<h3><?php echo htmlentities($listdathrs);?></h3>

Authors Listed

</div>

</div></a>

</div>

<div class="row">

<a href="manage-categories.php">

<div class="col-md-3 col-sm-3 rscol-xs-6">

<div class="alert alert-info back-widget-set text-center">

<i class="fa fa-file-archive-o fa-5x"></i>

<?php

$sql5 ="SELECT id from tblcategory ";

$query5 = $dbh -> prepare($sql5);

$query5->execute();

$results5=$query5->fetchAll(PDO::FETCH_OBJ);

$listdcats=$query5->rowCount();

?>
<h3><?php echo htmlentities($listdcats);?> </h3>

Listed Categories

</div>

</div></a>

</div>

</div>

</div>

<!-- CONTENT-WRAPPER SECTION END-->

<?php include('includes/footer.php');?>

<!-- FOOTER SECTION END-->

<!-- JAVASCRIPT FILES PLACED AT THE BOTTOM TO REDUCE THE LOADING TIME -->

<!-- CORE JQUERY -->

<script src="assets/js/jquery-1.10.2.js"></script>

<!-- BOOTSTRAP SCRIPTS -->

<script src="assets/js/bootstrap.js"></script>

<!-- CUSTOM SCRIPTS -->

<script src="assets/js/custom.js"></script>

</body>

</html>

<?php } ?>

Issue Book .php


<?php
session_start();

error_reporting(0);

include('includes/config.php');

if(strlen($_SESSION['alogin'])==0)

header('location:index.php');

else{

if(isset($_POST['issue']))

$studentid=strtoupper($_POST['studentid']);

$bookid=$_POST['bookid'];

$aremark=$_POST['aremark'];

$isissued=1;

$aqty=$_POST['aqty'];

if($aqty>0){

$sql="INSERT INTO tblissuedbookdetails(StudentID,BookId,remark)


VALUES(:studentid,:bookid,:aremark)";

$query = $dbh->prepare($sql);

$query->bindParam(':studentid',$studentid,PDO::PARAM_STR);

$query->bindParam(':bookid',$bookid,PDO::PARAM_STR);

$query->bindParam(':aremark',$aremark,PDO::PARAM_STR);

$query->execute();

$lastInsertId = $dbh->lastInsertId();

if($lastInsertId)
{

$_SESSION['msg']="Book issued successfully";

header('location:manage-issued-books.php');

else

$_SESSION['error']="Something went wrong. Please try again";

header('location:manage-issued-books.php');

} } else {

$_SESSION['error']="Book Not available";

header('location:manage-issued-books.php');

?>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

<meta name="description" content="" />

<meta name="author" content="" />

<title>Online Library Management System | Issue a new Book</title>

<!-- BOOTSTRAP CORE STYLE -->

<link href="assets/css/bootstrap.css" rel="stylesheet" />


<!-- FONT AWESOME STYLE -->

<link href="assets/css/font-awesome.css" rel="stylesheet" />

<!-- CUSTOM STYLE -->

<link href="assets/css/style.css" rel="stylesheet" />

<!-- GOOGLE FONT -->

<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet'


type='text/css' />

<script>

// function for get student name

function getstudent() {

$("#loaderIcon").show();

jQuery.ajax({

url: "get_student.php",

data:'studentid='+$("#studentid").val(),

type: "POST",

success:function(data){

$("#get_student_name").html(data);

$("#loaderIcon").hide();

},

error:function (){}

});

//function for book details

function getbook() {

$("#loaderIcon").show();
jQuery.ajax({

url: "get_book.php",

data:'bookid='+$("#bookid").val(),

type: "POST",

success:function(data){

$("#get_book_name").html(data);

$("#loaderIcon").hide();

},

error:function (){}

});

</script>

<style type="text/css">

.others{

color:red;

</style>

</head>

<body>

<!------MENU SECTION START-->

<?php include('includes/header.php');?>

<!-- MENU SECTION END-->

<div class="content-wrapper">

<div class="container">
<div class="row pad-botm">

<div class="col-md-12">

<h4 class="header-line">Issue a New Book</h4>

</div>

</div>

<div class="row">

<div class="col-md-10 col-sm-6 col-xs-12 col-md-offset-1">

<div class="panel panel-info">

<div class="panel-heading">

Issue a New Book

</div>

<div class="panel-body">

<form role="form" method="post">

<div class="form-group">

<label>Student id<span style="color:red;">*</span></label>

<input class="form-control" type="text" name="studentid" id="studentid"


onBlur="getstudent()" autocomplete="off" required />

</div>

<div class="form-group">

<span id="get_student_name" style="font-size:16px;"></span>

</div>

<div class="form-group">

<label>ISBN Number or Book Title<span style="color:red;">*</span></label>

<input class="form-control" type="text" name="booikid" id="bookid" onBlur="getbook()"


required="required" />
</div>

<div class="form-group" id="get_book_name">

</div>

<div class="form-group">

<label>Remark<span style="color:red;">*</span></label>

<textarea class="form-control" name="aremark" id="aremark" required></textarea>

</div>

<button type="submit" name="issue" id="submit" class="btn btn-info">Issue Book </button>

</form>

</div>

</div>

</div>

</div>

</div>

</div>

<!-- CONTENT-WRAPPER SECTION END-->

<?php include('includes/footer.php');?>

<!-- FOOTER SECTION END-->

<!-- JAVASCRIPT FILES PLACED AT THE BOTTOM TO REDUCE THE LOADING TIME -->

<!-- CORE JQUERY -->

<script src="assets/js/jquery-1.10.2.js"></script>

<!-- BOOTSTRAP SCRIPTS -->

<script src="assets/js/bootstrap.js"></script>

<!-- CUSTOM SCRIPTS -->


<script src="assets/js/custom.js"></script>

</body>

</html>

<?php } ?>

Signup .php
<?php

session_start();

include('includes/config.php');

error_reporting(0);

if(isset($_POST['signup']))

//Code for student ID

$count_my_page = ("studentid.txt");

$hits = file($count_my_page);

$hits[0] ++;

$fp = fopen($count_my_page , "w");

fputs($fp , "$hits[0]");

fclose($fp);

$StudentId= $hits[0];

$fname=$_POST['fullanme'];

$mobileno=$_POST['mobileno'];

$email=$_POST['email'];

$password=md5($_POST['password']);
$status=1;

$sql="INSERT INTO tblstudents(StudentId,FullName,MobileNumber,EmailId,Password,Status)


VALUES(:StudentId,:fname,:mobileno,:email,:password,:status)";

$query = $dbh->prepare($sql);

$query->bindParam(':StudentId',$StudentId,PDO::PARAM_STR);

$query->bindParam(':fname',$fname,PDO::PARAM_STR);

$query->bindParam(':mobileno',$mobileno,PDO::PARAM_STR);

$query->bindParam(':email',$email,PDO::PARAM_STR);

$query->bindParam(':password',$password,PDO::PARAM_STR);

$query->bindParam(':status',$status,PDO::PARAM_STR);

$query->execute();

$lastInsertId = $dbh->lastInsertId();

if($lastInsertId)

echo '<script>alert("Your Registration successfull and your student id is


"+"'.$StudentId.'")</script>';

else

echo "<script>alert('Something went wrong. Please try again');</script>";

?>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

<meta name="description" content="" />

<meta name="author" content="" />

<!--[if IE]>

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<![endif]-->

<title>Online Library Management System | Student Signup</title>

<!-- BOOTSTRAP CORE STYLE -->

<link href="assets/css/bootstrap.css" rel="stylesheet" />

<!-- FONT AWESOME STYLE -->

<link href="assets/css/font-awesome.css" rel="stylesheet" />

<!-- CUSTOM STYLE -->

<link href="assets/css/style.css" rel="stylesheet" />

<!-- GOOGLE FONT -->

<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet'


type='text/css' />

<script type="text/javascript">

function valid()

if(document.signup.password.value!= document.signup.confirmpassword.value)

alert("Password and Confirm Password Field do not match !!");

document.signup.confirmpassword.focus();
return false;

return true;

</script>

<script>

function checkAvailability() {

$("#loaderIcon").show();

jQuery.ajax({

url: "check_availability.php",

data:'emailid='+$("#emailid").val(),

type: "POST",

success:function(data){

$("#user-availability-status").html(data);

$("#loaderIcon").hide();

},

error:function (){}

});

</script>

</head>

<body>

<!------MENU SECTION START-->


<?php include('includes/header.php');?>

<!-- MENU SECTION END-->

<div class="content-wrapper">

<div class="container">

<div class="row pad-botm">

<div class="col-md-12">

<h4 class="header-line">User Signup</h4>

</div>

</div>

<div class="row">

<div class="col-md-9 col-md-offset-1">

<div class="panel panel-danger">

<div class="panel-heading">

SINGUP FORM

</div>

<div class="panel-body">

<form name="signup" method="post" onSubmit="return valid();">

<div class="form-group">

<label>Enter Full Name</label>

<input class="form-control" type="text" name="fullanme" autocomplete="off" required />

</div>

<div class="form-group">

<label>Mobile Number :</label>

<input class="form-control" type="text" name="mobileno" maxlength="10"


autocomplete="off" required />
</div>

<div class="form-group">

<label>Enter Email</label>

<input class="form-control" type="email" name="email" id="emailid"


onBlur="checkAvailability()" autocomplete="off" required />

<span id="user-availability-status" style="font-size:12px;"></span>

</div>

<div class="form-group">

<label>Enter Password</label>

<input class="form-control" type="password" name="password" autocomplete="off"


required />

</div>

<div class="form-group">

<label>Confirm Password </label>

<input class="form-control" type="password" name="confirmpassword" autocomplete="off"


required />

</div>

<button type="submit" name="signup" class="btn btn-danger" id="submit">Register Now


</button>

</form>

</div>

</div>

</div>

</div>

</div>

</div>
<!-- CONTENT-WRAPPER SECTION END-->

<?php include('includes/footer.php');?>

<script src="assets/js/jquery-1.10.2.js"></script>

<!-- BOOTSTRAP SCRIPTS -->

<script src="assets/js/bootstrap.js"></script>

<!-- CUSTOM SCRIPTS -->

<script src="assets/js/custom.js"></script>

</body>

</html>

Studentlogin.php
<?php

session_start();

error_reporting(0);

include('includes/config.php');

if($_SESSION['login']!=''){

$_SESSION['login']='';

if(isset($_POST['login']))

$email=$_POST['emailid'];

$password=md5($_POST['password']);

$sql ="SELECT EmailId,Password,StudentId,Status FROM tblstudents WHERE EmailId=:email and


Password=:password";
$query= $dbh -> prepare($sql);

$query-> bindParam(':email', $email, PDO::PARAM_STR);

$query-> bindParam(':password', $password, PDO::PARAM_STR);

$query-> execute();

$results=$query->fetchAll(PDO::FETCH_OBJ);

if($query->rowCount() > 0)

foreach ($results as $result) {

$_SESSION['stdid']=$result->StudentId;

if($result->Status==1)

$_SESSION['login']=$_POST['emailid'];

echo "<script type='text/javascript'> document.location ='dashboard.php'; </script>";

} else {

echo "<script>alert('Your Account Has been blocked .Please contact admin');</script>";

else{

echo "<script>alert('Invalid Details');</script>";

?>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

<meta name="description" content="" />

<meta name="author" content="" />

<title>Online Library Management System | </title>

<!-- BOOTSTRAP CORE STYLE -->

<link href="assets/css/bootstrap.css" rel="stylesheet" />

<!-- FONT AWESOME STYLE -->

<link href="assets/css/font-awesome.css" rel="stylesheet" />

<!-- CUSTOM STYLE -->

<link href="assets/css/style.css" rel="stylesheet" />

<!-- GOOGLE FONT -->

<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet'


type='text/css' />

</head>

<body>

<!------MENU SECTION START-->

<?php include('includes/header.php');?>

<!-- MENU SECTION END-->

<div class="content-wrapper">

<div class="container">

<!--Slider---->
<div class="row">

<div class="col-md-10 col-sm-8 col-xs-12 col-md-offset-1">

<div id="carousel-example" class="carousel slide slide-bdr" data-ride="carousel" >

<div class="carousel-inner">

</div>

<div class="item">

<img src="assets/img/2.jpg" alt="" />

</div>

</div>

<!--INDICATORS-->

<ol class="carousel-indicators">

<li data-target="#carousel-example" data-slide-to="0" class="active"></li>

<li data-target="#carousel-example" data-slide-to="1"></li>

</ol>

<!--PREVIUS-NEXT BUTTONS-->

<a class="left carousel-control" href="#carousel-example" data-slide="prev">

<span class="glyphicon glyphicon-chevron-left"></span>

</a>

<a class="right carousel-control" href="#carousel-example" data-slide="next">

<span class="glyphicon glyphicon-chevron-right"></span>

</a>

</div>

</div>

</div>
<hr />

<div class="row pad-botm">

<div class="col-md-12">

<h4 class="header-line">USER LOGIN FORM</h4>

</div>

</div>

<a name="ulogin"></a>

<!--LOGIN PANEL START-->

<div class="row">

<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3" >

<div class="panel panel-info">

<div class="panel-heading">

LOGIN FORM

</div>

<div class="panel-body">

<form role="form" method="post">

<div class="form-group">

<label>Enter Email id</label>

<input class="form-control" type="text" name="emailid" required autocomplete="off" />

</div>

<div class="form-group">

<label>Password</label>

<input class="form-control" type="password" name="password" required


autocomplete="off" />

<p class="help-block"><a href="user-forgot-password.php">Forgot Password</a></p>


</div>

<button type="submit" name="login" class="btn btn-info">LOGIN </button> | <a


href="signup.php">Not Register Yet</a>

</form>

</div>

</div>

</div>

</div>

<!---LOGIN PABNEL END-->

</div>

</div>

<!-- CONTENT-WRAPPER SECTION END-->

<?php include('includes/footer.php');?>

<!-- FOOTER SECTION END-->

<script src="assets/js/jquery-1.10.2.js"></script>

<!-- BOOTSTRAP SCRIPTS -->

<script src="assets/js/bootstrap.js"></script>

<!-- CUSTOM SCRIPTS -->

<script src="assets/js/custom.js"></script>

</body>

</html>

Dashboard.php
<?php
session_start();

error_reporting(0);

include('includes/config.php');

if(strlen($_SESSION['login'])==0)

header('location:index.php');

else{?>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

<meta name="description" content="" />

<meta name="author" content="" />

<title>Online Library Management System | User Dash Board</title>

<!-- BOOTSTRAP CORE STYLE -->

<link href="assets/css/bootstrap.css" rel="stylesheet" />

<!-- FONT AWESOME STYLE -->

<link href="assets/css/font-awesome.css" rel="stylesheet" />

<!-- CUSTOM STYLE -->

<link href="assets/css/style.css" rel="stylesheet" />

<!-- GOOGLE FONT -->

<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet'


type='text/css' />
</head>

<body>

<!------MENU SECTION START-->

<?php include('includes/header.php');?>

<!-- MENU SECTION END-->

<div class="content-wrapper">

<div class="container">

<div class="row pad-botm">

<div class="col-md-12">

<h4 class="header-line">User DASHBOARD</h4>

</div>

</div>

<div class="row">

<a href="listed-books.php">

<div class="col-md-4 col-sm-4 col-xs-6">

<div class="alert alert-success back-widget-set text-center">

<i class="fa fa-book fa-5x"></i>

<?php

$sql ="SELECT id from tblbooks ";

$query = $dbh -> prepare($sql);

$query->execute();

$results=$query->fetchAll(PDO::FETCH_OBJ);

$listdbooks=$query->rowCount();

?>
<h3><?php echo htmlentities($listdbooks);?></h3>

Books Listed

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

<div class="col-md-4 col-sm-4 col-xs-6">

<div class="alert alert-warning back-widget-set text-center">

<i class="fa fa-recycle fa-5x"></i>

<?php

$rsts=0;

$sid=$_SESSION['stdid'];

$sql2 ="SELECT id from tblissuedbookdetails where StudentID=:sid and (RetrunStatus=:rsts ||


RetrunStatus is null || RetrunStatus='')";

$query2 = $dbh -> prepare($sql2);

$query2->bindParam(':sid',$sid,PDO::PARAM_STR);

$query2->bindParam(':rsts',$rsts,PDO::PARAM_STR);

$query2->execute();

$results2=$query2->fetchAll(PDO::FETCH_OBJ);

$returnedbooks=$query2->rowCount();

?>

<h3><?php echo htmlentities($returnedbooks);?></h3>

Books Not Returned Yet

</div>

</div>

<?php

$ret =$dbh -> prepare("SELECT id from tblissuedbookdetails where StudentID=:sid");

$ret->bindParam(':sid',$sid,PDO::PARAM_STR);
$ret->execute();

$results22=$ret->fetchAll(PDO::FETCH_OBJ);

$totalissuedbook=$ret->rowCount();

?>

<a href="issued-books.php">

<div class="col-md-4 col-sm-4 col-xs-6">

<div class="alert alert-success back-widget-set text-center">

<i class="fa fa-book fa-5x"></i>

<h3><?php echo htmlentities($totalissuedbook);?></h3>

Total Issued Books

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

</div>

</div>

</div>

<!-- CONTENT-WRAPPER SECTION END-->

<?php include('includes/footer.php');?>

<!-- FOOTER SECTION END-->

<!-- JAVASCRIPT FILES PLACED AT THE BOTTOM TO REDUCE THE LOADING TIME -->

<!-- CORE JQUERY -->

<script src="assets/js/jquery-1.10.2.js"></script>

<!-- BOOTSTRAP SCRIPTS -->

<script src="assets/js/bootstrap.js"></script>

<!-- CUSTOM SCRIPTS -->

<script src="assets/js/custom.js"></script>
</body>

</html>

<?php } ?>

You might also like