Am coding using PHP and HTML. I want to create a simple system that allows once to create an account then logs in. Once logged in one can search the admission letter using index number. Then it displays the ref number the index number the name and the admission letter where he or she will download or print the admission letter.
I have done this. the only challenge am getting is displaying the pdf file fro printing
code
<body class="materialdesign">
<div class="wrapper-pro">
<?php include_once('includes/sidebar.php');?>
<?php include_once('includes/header.php');?>
<!-- Breadcome start-->
<div class="breadcome-area mg-b-30 small-dn">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="breadcome-list shadow-reset">
<div class="row">
<div class="col-lg-12">
<ul class="breadcome-menu">
<li><a href="dashboard.php">Home</a> <span class="bread-slash">/</span>
</li>
<li><span class="bread-blod">Search Admission Letter</span>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Breadcome End-->
<!-- Static Table Start -->
<div class="data-table-area mg-b-15">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="sparkline13-list shadow-reset">
<div class="sparkline13-hd">
<div class="main-sparkline13-hd">
<h1>Search <span class="table-project-n"></span> Admission Letter</h1>
<div class="sparkline13-outline-icon">
<span class="sparkline13-collapse-link"><i class="fa fa-chevron-up"></i></span>
<span><i class="fa fa-wrench"></i></span>
<span class="sparkline13-collapse-close"><i class="fa fa-times"></i></span>
</div>
</div>
</div>
<div class="sparkline13-graph">
<div class="datatable-dashv1-list custom-datatable-overright">
<form method="post">
<div class="form-group-inner">
<div class="row">
<div class="col-lg-3">
<label class="login2 pull-right pull-right-pro">KNEC Index Number</label>
</div>
<div class="col-lg-9">
<input id="searchdata" type="text" name="searchdata" required="true" class="form-control" placeholder="Type your Index number">
</div>
</div>
</div>
<div class="form-group-inner">
<div class="login-btn-inner">
<div class="row">
<div class="col-lg-3"></div>
<div class="col-lg-9">
<div class="login-horizental cancel-wp pull-left">
<button class="btn btn-sm btn-primary login-submit-cs" type="submit" name="search">Search</button>
</div>
</div>
</div>
</div>
</div>
</form>
<?php
if(isset($_POST['search']))
{
$sdata=$_POST['searchdata'];
?>
<h4 align="center">Result for "<?php echo $sdata;?>" Index Number </h4>
<table id="table" data-toggle="table" data-pagination="true" data-search="true" data-show-columns="true" data-show-pagination-switch="true" data-show-refresh="true" data-key-events="true" data-show-toggle="true" data-resizable="true" data-cookie="true" data-cookie-id-table="saveId" data-show-export="true" data-click-to-select="true" data-toolbar="#toolbar">
<thead>
<tr>
<th data-field="state" data-checkbox="true"></th>
<th>S.No</th>
<th>Ref Number</th>
<th>Name</th>
<th >Index Number</th>
<th >Admission Letter</th>
<th data-field="action">Action</th>
</tr>
</thead>
<tbody>
<?php
$sql="SELECT * from tbladmission where indexno like '$sdata%'";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $row)
{ ?>
<tr>
<td></td>
<td><?php echo htmlentities($cnt);?></td>
<td><?php echo htmlentities($row->Refno);?></td>
<td><?php echo htmlentities($row->indexno);?></td>
<td><?php echo htmlentities($row->fname);?></td>
<td><?php echo htmlentities($row->admissionletter);?></td>
</tr>
</tbody>
<?php
$cnt=$cnt+1;
} } else { ?>
<tr>
<td colspan="8"> No record found against this search</td>
</tr>
<?php } }?>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Static Table End -->
</div>
</div>
<?php include_once('includes/footer.php');?>
i have already done the login part. the only problem is display the admission letter in form of a pdf for printing or downloading
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.
PHP (from the English Hypertext Preprocessor - hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites.
The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.
https://www.php.net/
HTML (English "hyper text markup language" - hypertext markup language) is a special markup language that is used to create sites on the Internet.
Browsers understand html perfectly and can interpret it in an understandable way. In general, any page on the site is html-code, which the browser translates into a user-friendly form. By the way, the code of any page is available to everyone.
https://www.w3.org/html/
Welcome to the Q&A site for web developers. Here you can ask a question about the problem you are facing and get answers from other experts. We have created a user-friendly interface so that you can quickly and free of charge ask a question about a web programming problem. We also invite other experts to join our community and help other members who ask questions. In addition, you can use our search for questions with a solution.
Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.
Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.