<?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' order by id";
$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">Advance Fee Receipt Open</strong>
                            </div>
                            <div class="card-body">
							<?php

include 'dbc.php';


$userid=$_SESSION["userid"];
$std_rollno=$_POST["std_rollno"];
$sqlrec = "SELECT * FROM admission where std_rollno='$std_rollno' and  user_id='$userid'";
$resultrec=$conn->query($sqlrec);
?>
                                <table id="bootstrap-data-table-export" class="table table-striped table-bordered">
                                    <thead>
									<?php
                                       echo "<tr>";
									   
									   
echo "<th >Roll No </th>";
echo "<th >Name </th>";
echo "<th >Rec Date </th>";
echo "<th >Month </th>";
echo "<th >T.Fee </th>";

echo "<th >Rec.Fee </th>";
echo "<th >Fine </th>";
echo "<th >App No </th>";

echo "<th >Ref </th>";




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

                                       while($students = $resultrec->fetch_assoc())
 
  {
  echo '<tr>';
	
	echo "<td>{$students['std_rollno']}<input type='hidden' name='std_rollno[$i]' value='{$students['std_rollno']}' /></td>";
	echo "<td>{$students['std_name']}<input type='hidden' name='std_name[$i]' value='{$students['std_name']}' /></td>";
	
	
	
	echo "<td><input type='date' size='8' name='rec_date[$i]' value='{$today}' /></td>";
	echo "<td><input type='text' size='8' name='my[$i]' value='{$my}' /></td>";
	echo "<td>{$students['mfee']}<input type='hidden' name='mfee1[$i]' value='{$students['mfee']}' /></td>";
	
	
	
	echo "<td><input type='text' size='8' name='mfee[$i]' /> <input type='text' size='8' name='disfee[$i]' value='0' /></td>";
	echo "<td><input type='text' size='8' name='fine[$i]' value='0' /></td>";
	echo "<td><input type='text' size='8' name='appno[$i]' value='0' /></td>";
echo "<td><input type='text' size='12' name='ref[$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
}

?>