</nav>

                </div>

                <!--  END TOPBAR  -->



            </ul>



            <ul class="navbar-item flex-row ml-auto">

                <li class="nav-item align-self-center search-animated">

                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search toggle-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>

                    <form class="form-inline search-full form-inline search" role="search">

                        <div class="search-bar">

                            <input type="text" class="form-control search-form-control  ml-lg-auto" placeholder="Search...">

                        </div>

                    </form>

                </li>

            </ul>



            <ul class="navbar-item flex-row nav-dropdowns">

               



               



                <li class="nav-item dropdown notification-dropdown">

                    <a href="javascript:void(0);" class="nav-link dropdown-toggle" id="notificationDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">

                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-bell"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path><path d="M13.73 21a2 2 0 0 1-3.46 0"></path></svg><span class="badge badge-success"></span>

                    </a>

                    <div class="dropdown-menu position-absolute" aria-labelledby="notificationDropdown">

                        <div class="notification-scroll">

						  <?

		   





							 $query_not = $mysqli->prepare("select heading, content from notice_shop");



													$query_not->execute();



													$query_not->bind_result($heading, $content);

		   

		   ?>

		   <?

		                                 while ($query_not->fetch()){

		                                  ?>



                            <div class="dropdown-item">

                                <div class="media server-log">

                                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-server"><rect x="2" y="2" width="20" height="8" rx="2" ry="2"></rect><rect x="2" y="14" width="20" height="8" rx="2" ry="2"></rect><line x1="6" y1="6" x2="6" y2="6"></line><line x1="6" y1="18" x2="6" y2="18"></line></svg>

                                    <div class="media-body">

                                        <div class="data-info">

                                            <h6 class=""><? echo $heading;?></h6>

                                            <p class=""><? echo $content;?></p>

                                        </div>



                                        <div class="icon-status">

                                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>

                                        </div>

                                    </div>

                                </div>

                            </div>

							<? } ?>



                            



                            

                        </div>

                    </div>

                </li>

				

											

                <li class="nav-item dropdown user-profile-dropdown order-lg-0 order-1">

                    <a href="javascript:void(0);" class="nav-link dropdown-toggle user" id="user-profile-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">

                        <div class="media">

                            <img src="assets/img/90x90.jpg" class="img-fluid" alt="admin-profile">

                        </div>

                    </a>

                    <div class="dropdown-menu position-absolute" aria-labelledby="userProfileDropdown">

                        <div class="user-profile-section">

                            <div class="media mx-auto">

                                <div class="media-body">

                                    <h5>Name : <? echo $name;?></h5>

                                   
                                </div>

                            </div>

                        </div>

                        <div class="dropdown-item">

                            <a href="update_profile.php">

                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg> <span>Profile</span>

                            </a>

                        </div>

                       

                        <div class="dropdown-item">

                            <a href="logout.php">

                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-log-out"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg> <span>Log Out</span>

                            </a>

                        </div>

                    </div>



                </li>

            </ul>

        </header>

    </div>

    <!--  END NAVBAR  -->



    <!--  BEGIN MAIN CONTAINER  -->

    <div class="main-container" id="container">



        <div class="overlay"></div>

        <div class="search-overlay"></div>

        

        <!--  BEGIN CONTENT PART  -->

        <div id="content" class="main-content">

            <div class="layout-px-spacing">



                <div class="page-header">

                    <div class="page-title">

                        <h3><? echo $name;?></h3>

                    </div>

                    

                    <div class="toggle-switch">

                        <label class="switch s-icons s-outline  s-outline-secondary">

                            <input type="checkbox" checked="" class="theme-shifter">

                            <span class="slider round">

                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-sun"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg>



                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-moon"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>

                            </span>

                        </label>

                    </div>

                </div>



                <div class="row layout-top-spacing">



                 <div id="tableSimple" class="col-lg-12 col-12 layout-spacing">

                            <div class="statbox widget box box-shadow">

                                <div class="widget-header">

                                    <div class="row">

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

                                            <h4>Topup By You</h4>

                                        </div>

                                    </div>

                                </div>

                                <div class="widget-content widget-content-area">

                                    <div class="table-responsive">
									<table class="table table-bordered mb-4">
									<tr>
<form action="manage_billb.php?flag=1&pno=1&tab_id=tab1&default=manage_bill" method="post" name="myform">
<td colspan="6" align="left" bgcolor="#0099FF"><b>Search By Bill No</b><input type="text" name="bill_no" size="10"><input type="submit" value="Search"></td>
</form>


</tr>
<tr>
	<td width="27" align="left" bgcolor="#0099FF"><b>SL No.</b></td>
	<td width="64" align="left" bgcolor="#0099FF"><b>Date</b></td>
	<td width="82" align="left" bgcolor="#0099FF"><b>Bill No</b></td>
	<td width="95" align="left" bgcolor="#0099FF"><b>Amount</b></td>
	<td width="58" align="left" bgcolor="#0099FF"><b>Bill</b></td>
	
	
</tr>
<?
$stock_id=$_SESSION['admin_id'];

								if($flag!=1)
								 {
							     
								// $sql=mysql_query("select * from `report` order by `id`");
								 
								 $stmt2 = $mysqli->prepare('SELECT * FROM report_planb where stock_id=?');
$stmt2->bind_param('s', $stock_id);
												$stmt2->execute();
												$stmt2->store_result();
												$count=$stmt2->num_rows;
	
								
								}
								if($flag==1)
								 {
							     $count=1;
								}
								
								
								
								
										$nor=50; // $nor = Number of Row per page
										$pno=$_REQUEST['pno']; // $pno = Page Number
										if($pno==""){$pno=1;}
										
										 $er=($nor*$pno); // $er = Ending Row
										
									     $sr=($er-$nor)+1; // $sr = Starting Row 
								
if($flag!=1)
{								

$qry2 = $mysqli->prepare("select date,bill_no,total from report_planb where stock_id=?");
$qry2->bind_param('s', $stock_id);
$qry2->execute();
$qry2->bind_result($date,$bill_no,$total);

}
if($flag==1)
								 {
							     $bill_no=$_REQUEST['bill_no'];
								 $qry2 = $mysqli->prepare("select date,bill_no,total from report_planb where bill_no=? and stock_id=?");
										$qry2->bind_param('ss', $bill_no,$stock_id);
										$qry2->execute();
										$qry2->bind_result($date,$bill_no,$total);

								 
								
								}
								
						
while ($qry2->fetch())
{
 $i++;
 $rowno++;
 if($rowno>=$sr and $rowno<=$er)
{


?>
<tr>
	<td  align="left"><? echo $i;?></td>
	<td  align="left"><? echo $date;?></td>
	<td  align="left"><? echo $type;?><? echo $bill_no;?></td>
	<td  align="left">Rs. <? echo $total;?></td>
	<td  align="left"><a href="#" onClick="window.open('print_billplanb.php?bill_no=<? echo $bill_no;?>', '','width=740,height=500,scrollbars=yes,resizable=yes,toolbar=yes,directories=no,location=no,menubar=no,status=no,left=50,top=0'); return true;" ><b>Create Bill</b></a></td>
	
	
	
<? } }?>
<tfoot>
								<tr>
									<td colspan="11" >
										
										<input type="hidden" name="flag" value="<? echo $flag;?>" />
										
										
										<?php
											$pno=$_REQUEST['pno']; // $pno = Page Number
											if($pno==""){$pno=1;}
											?>
											
											
											<a href="manage_billb.php?pno=1&flag=<? echo $flag; ?>&bill_no=<? echo $bill_no;?>&tab_id=tab1&default=manage_bill" title="First Page">&laquo; First</a>
											<? if(($pno-1)>0) { ?>
											<a href="manage_billb.php?pno=<? print $pno-1; ?>flag=<? echo $flag; ?>&bill_no=<? echo $bill_no;?>&tab_id=tab1&default=manage_bill" title="Previous Page">&laquo; Previous</a>
											<? } else { ?>
											<a href="#" title="Previous Page">&laquo; Previous</a>
											<? } ?>
											<? 	
												$pn=0; 
												while($count>($pn*$nor))
												{ $pn++;
													?>
											<a href="manage_billb.php?pno=<? print $pn; ?>flag=<? echo $flag; ?>&bill_no=<? echo $bill_no;?>&tab_id=tab1&default=manage_bill"  class="<?php if($pno==$pn){?>number current<?php } else { ?>number<?php } ?>"  title="page <?php echo $pn;?>"> <? print $pn; ?>
											</a>
											<? } ?>
											<!--<a href="#" class="number current" title="2">2</a>
											<a href="#" class="number" title="3">3</a>
											<a href="#" class="number" title="4">4</a>-->
											<? if(($pno+1)<=ceil($count/$nor)) { ?>
											<a href="manage_billb.php?pno=<? print $pno+1; ?>&flag=<? echo $flag; ?>&bill_no=<? echo $bill_no;?>&tab_id=tab1&default=manage_bill" title="Next Page">Next &raquo;</a>
											<? } else { ?>
											<a href="#" title="Next Page">Next &raquo;</a>
											<? } ?>
											<a href="manage_billb.php?pno=<? print ceil($count/$nor); ?>&flag=<? echo $flag; ?>&bill_no=<? echo $bill_no;?>&tab_id=tab1&default=manage_bill" title="Last Page">Last &raquo;</a>
										
									</td>
								</tr>
							
							</tfoot>
</table>

									

                                        

                                    </div>



                                    



                                </div>

                            </div>

                        </div>



                    

                



                    



                    



                </div>