<?php
session_start();
if($_SESSION["username"]=="")
{
 	echo "You are not Logged in Please <a href='index.html'>Sign in </a> First ";
}
else
{
date_default_timezone_set("Asia/Karachi");
$today=date("Y-m-d");
$month = date("m",strtotime($today));
		$year = date("Y",strtotime($today));
		 $month_name = date("F", mktime(0, 0, 0, $month, 10));
		 $my=$month_name . " " . $year;
		include 'dbc.php';
$userid=$_SESSION["userid"]; 
		 $sql3="SELECT * FROM chartofaccounts where acc_type='Cash' or acc_type='Bank' and user_id='$userid'";
$result1 = $conn->query($sql3);

?>
<!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en">
<!--<![endif]-->

<head>
   <?php include("includes/header.php") ?>
</head>

<body>


    <!-- Left Panel -->

    <?php include("includes/menu.php") ?><!-- /#left-panel -->

    <!-- Left Panel -->

    <!-- Right Panel -->

    <div id="right-panel" class="right-panel">

        <!-- Header-->
        <header id="header" class="header">

             <?php include("includes/headermenu.php") ?>

        </header><!-- /header -->
        <!-- Header-->

        <div class="breadcrumbs">
            <div class="col-sm-6">
                <div class="page-header float-left">
                    <div class="page-title">
                        <h1><? echo "" . $_SESSION["userid"]; ?></h1>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="page-header float-right">
                    <div class="page-title">
                        <ol class="breadcrumb text-right">
                            <li class="active"><? echo "" . $_SESSION["username"]; ?></li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>

        <div class="content mt-3">
            <div class="animated fadeIn">
                <div class="row">

                    <div class="col-md-14">
                        <div class="card">
                            <div class="card-header">
                                <strong class="card-title">Fee Receipt Open</strong>
                            </div>
                            <div class="card-body">
							<?php

include 'dbc.php';


$userid=$_SESSION["userid"];
$adm_no=$_REQUEST["adm_no"];
$sqlrec = "SELECT * FROM issueslip where adm_no='$adm_no' and  user_id='$userid' order by id desc";
$resultrec=$conn->query($sqlrec);
?>
                                <table id="bootstrap-data-table-export" class="table table-striped table-bordered">
                                    <thead>
									<?php
                                       echo "<tr>";
									   echo "<th >Slip No</th>";
									   
echo "<th >Adm No </th>";
echo "<th >Fee Month </th>";
echo "<th >Rec Date </th>";
echo "<th >Fee Bal </th>";
echo "<th >- </th>";
echo "<th >- </th>";
echo "<th >- </th>";
echo "<th >- </th>";
echo "<th >- </th>";
echo "<th >- </th>";
echo "<th >Fine </th>";




echo "</tr>";
?>
                                    </thead>
									
                                    <tbody>
									<?php
									$a = 0;
									echo "<form name='form_update' method='post' action='Fee_Receipt_Save.php'>\n";

                                       while($students = $resultrec->fetch_assoc())
 
  {
  echo '<tr>';
	echo "<td>{$students['id']}<input type='hidden' name='id[$i]' value='{$students['id']}' /></td>";
	echo "<td>{$students['adm_no']}<input type='hidden' name='adm_no[$i]' value='{$students['adm_no']}' /></td>";
	
	echo "<td>{$students['month_period']}</td>";
	
	echo "<td><input type='text' size='8' name='rec_date[$i]' value='{$today}' /></td>";
	
	echo "<td><input type='text' size='8' name='mfee[$i]' value='{$students['feebal']}' readonly/> <input type='text' size='8' name='feerec[$i]' value='0' /></td>";
	
	echo "<td><input type='text' size='8' name='feedisc1[$i]' value='{$students['feedisc1']}' readonly/><input type='text' size='8' name='fee1[$i]' value='{$students['fee1bal']}' readonly/><input type='text' size='8' name='fee1rec[$i]' value='0' /></td>";
	
	echo "<td><input type='text' size='8' name='feedisc2[$i]' value='{$students['feedisc2']}' readonly/><input type='text' size='8' name='fee2[$i]' value='{$students['fee2bal']}' readonly/><input type='text' size='8' name='fee2rec[$i]' value='0' /></td>";
	
	echo "<td><input type='text' size='8' name='feedisc3[$i]' value='{$students['feedisc3']}' readonly/><input type='text' size='8' name='fee3[$i]' value='{$students['fee3bal']}' readonly/><input type='text' size='8' name='fee3rec[$i]' value='0' /></td>";
	
	echo "<td><input type='text' size='8' name='feedisc4[$i]' value='{$students['feedisc4']}' readonly/><input type='text' size='8' name='fee4[$i]' value='{$students['fee4bal']}' readonly/><input type='text' size='8' name='fee4rec[$i]' value='0' /></td>";
	
	echo "<td><input type='text' size='8' name='feedisc5[$i]' value='{$students['feedisc5']}' readonly/><input type='text' size='8' name='fee5[$i]' value='{$students['fee5bal']}' readonly/><input type='text' size='8' name='fee5rec[$i]' value='0' /></td>";
	
	echo "<td><input type='text' size='8' name='feedisc6[$i]' value='{$students['feedisc6']}' readonly/><input type='text' size='8' name='fee6[$i]' value='{$students['fee6bal']}' readonly/><input type='text' size='8' name='fee6rec[$i]' value='0' /></td>";
	
echo "<td><input type='text' size='8' name='fine[$i]' value='0' /></td>";
	echo '</tr>';
	++$a;
}
?>
												
												<div class="row form-group">
                                                                    <div class="col col-md-3"><label for="select" class=" form-control-label">G/L Account</label></div>
                                                                    <div class="col-12 col-md-4">
                                                                        <select name="acc_name_dr" id="acc_name_dr" class="form-control">
                                                                            <?php
  while($user_data3=$result1->fetch_assoc())
  {
  ?>
              <option value="<? echo $user_data3['acc_name']; ?>"><? echo $user_data3["acc_name"]; ?></option>
              <?php
  }
  ?>
                                                                        </select>
                                                                    </div>
                                                                </div>				
												
													
                                                       <?php
	
		echo '<tr>';
echo "<td><input type='submit' value='Receive' /></td>";
echo '</tr>';
echo "</form>";
  


  ?>
                                       
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>


                </div>
            </div><!-- .animated -->
        </div> <!-- .content -->
    </div><!-- /#right-panel -->

    <!-- Right Panel -->

   <?php include("includes/footermenu.php") ?>

</body>

</html>
<?php
}
?>