<?php include("include/top.php");
if($_REQUEST["delete"]!="") {
    $id=$_REQUEST["delete"];
    mysqli_query($con,"update student set `status`='inactive' where `id`='".$id."'");?>
	?><script>
	window.location.href="manage_student.php";
	</script><?php 
} else { }

?>
 
<script>
function do_edit(i)
	{
		window.open("edit_student.php?id=" + i ,"_self");
	} 
	
	function do_view(i)
	{
		window.open("view_student.php?id=" + i ,"_self");
		
	}
	
function do_search(i)
	{
		//alert("dfkf");
		document.form1.h_page.value=i;
		document.form1.h_action.value="search";
		document.form1.submit();
	}
function do_delete(which_id)
	{
		//alert(which_id);
		var cnf=confirm("Are you sure?\n\nPress OK to proceed with delete.");
		if(cnf)
		{
			document.form1.h_id.value=which_id;	
			document.form1.h_action.value="delete";	
			document.form1.submit();
		}
    }
function lfn_SelectSection(p_Class)
	{
		document.getElementById('sec').disabled=false;
		
		$.ajax({
					type: "GET",
					url: "ajax_location.php?classID=" + p_Class,
					success: function(state) {
					   // alert(state);
					document.getElementById('sec').innerHTML=state;	
					}
		});
	}	
</script>
<!DOCTYPE html>
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>School Management System</title>
    <!-- Favicon and touch icons -->
    <link rel="shortcut icon" href="../assets/dist/img/ico/favicon.png" type="image/x-icon">
    
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">   
    <title>SCHOOL MANAGEMENT SYSTEM</title>
    <link rel="shortcut icon" href="../assets/dist/img/ico/favicon.png" type="image/x-icon">
   <link href="../assets/plugins/jquery-ui-1.12.1/jquery-ui.min.css" rel="stylesheet" type="text/css"/>
   <link href="../assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
   <link href="../assets/plugins/lobipanel/lobipanel.min.css" rel="stylesheet" type="text/css"/>
   <link href="../assets/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
   <link href="../assets/themify-icons/themify-icons.css" rel="stylesheet" type="text/css"/>
<link href="../assets/plugins/toastr/toastr.css" rel="stylesheet" type="text/css"/>
<link href="../assets/plugins/emojionearea/emojionearea.min.css" rel="stylesheet" type="text/css"/>
<link href="../assets/plugins/monthly/monthly.css" rel="stylesheet" type="text/css"/>
<link href="../assets/dist/css/stylehealth.min.css" rel="stylesheet" type="text/css"/>
<link href='../assets/dist/css/bootstrap-datepicker.min.css' rel='stylesheet' type='text/css'>


  
<link href='https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css' rel='stylesheet' type='text/css'>
<link href='https://cdn.datatables.net/buttons/1.5.6/css/buttons.dataTables.min.css' rel='stylesheet' type='text/css'>


    
</head>
<body class="hold-transition sidebar-mini">
    <!-- Site wrapper -->
    <div class="wrapper">
            <?php   include("include/header.php"); ?>
        <!-- =============================================== -->
        <!-- Left side column. contains the sidebar -->
            <?php   include("include/left_menu_index.php"); ?>       <!-- =============================================== -->
        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper">
            <!-- Content Header (Page header) -->
           <?php include("include/header_icon_title.php"); ?>



            <!-- Main content -->
            <section class="content" >
                <div class="row" >
                    <div class="col-sm-12" >
                        <div class="panel panel-bd " style="background-image:url(wall.jpg);">
                            <div class="panel-heading">
                                <div class="btn-group"> 
                                   <h4>Assignment of <?php echo $_REQUEST["class"]; ?> / <?php echo $_REQUEST["section"]; ?> </h4>
                                    </a>  
                                </div>        
                            </div>
                            <div class="panel-body">
                                   
                                    
 <h4>List of Assignment</h4>                                     
                                    <div class="table-responsive">
                                        
  <?php 
$i=1; 
			$sid=$_REQUEST["id"]; ?>                                      
                                        
	<table class="table table-bordered table-hover" >
										
                                            <thead>
                                                 <tr style="background-color:#9999FF">  
                                                      <th>Assignment</th>
                                                      <th>Subject</th>
                                                      <th>Publish date</th>
                                                      <th>File</th>
                                                      <th>Last Date</th>
                                                    <th>Submit</th>
                                                  
                                                      
                                                                                                          
                                                </tr>
                                            </thead>
                                            <tbody>

                                            <?php $x=0; $p=1;
			 $sid=$_REQUEST["id"];  $session=$_REQUEST["session"]; $class=$_REQUEST["class"];
			$qq=mysqli_query($con,"select * from home_work where `class`='".$class."'  and `status`='active'");
	while($ar=mysqli_fetch_array($qq,MYSQLI_ASSOC)) { ?>

  <tr>
        										     
                                                     <td><?php
													 echo $ar["title"];
													  ?><br>
													
													 </td>
                                                     <td><?php  echo $ar["subject"]; ?></td>
                                                     <td><?php $temp_date=date_create($ar["upload_date"]); echo date_format($temp_date,"d/m/Y"); ?> </td>
                                                     <td><a href="../assignment/<?php echo $ar['path']; ?>"><img src="../assignment/download.png" width="50"></a></td>
													  
                                                     <td><?php $temp_date=date_create($ar["submit_date"]); echo date_format($temp_date,"d/m/Y");  ?></td>
													 <td><a href="upload.php?homework_id=<?php echo $ar['id']; ?>&student_id=<?php echo $_REQUEST['id']; ?>"><img src="student.jpg" width="50"></a></td>
                                                    
                                                    
                                                        
                                                </tr>
	<?php $x++; } ?>

                                                                                             </tbody>
                                            
                                        </table>                                        
                                        
                                        
                                        
                                        
                                        
  <?php			
   function getIndianCurrency(float $number)
    {
        $decimal = round($number - ($no = floor($number)), 2) * 100;
        $hundred = null;
        $digits_length = strlen($no);
        $i = 0;
        $str = array();
        $words = array(0 => '', 1 => 'one', 2 => 'two',
            3 => 'three', 4 => 'four', 5 => 'five', 6 => 'six',
            7 => 'seven', 8 => 'eight', 9 => 'nine',
            10 => 'ten', 11 => 'eleven', 12 => 'twelve',
            13 => 'thirteen', 14 => 'fourteen', 15 => 'fifteen',
            16 => 'sixteen', 17 => 'seventeen', 18 => 'eighteen',
            19 => 'nineteen', 20 => 'twenty', 30 => 'thirty',
            40 => 'forty', 50 => 'fifty', 60 => 'sixty',
            70 => 'seventy', 80 => 'eighty', 90 => 'ninety');
        $digits = array('', 'hundred','thousand','lakh', 'crore');
        while( $i < $digits_length ) {
            $divider = ($i == 2) ? 10 : 100;
            $number = floor($no % $divider);
            $no = floor($no / $divider);
            $i += $divider == 10 ? 1 : 2;
            if ($number) {
                $plural = (($counter = count($str)) && $number > 9) ? 's' : null;
                $hundred = ($counter == 1 && $str[0]) ? ' and ' : null;
                $str [] = ($number < 21) ? $words[$number].' '. $digits[$counter]. $plural.' '.$hundred:$words[floor($number / 10) * 10].' '.$words[$number % 10]. ' '.$digits[$counter].$plural.' '.$hundred;
            } else $str[] = null;
        }
        $Rupees = implode('', array_reverse($str));
        $paise = ($decimal) ? "." . ($words[$decimal / 10] . " " . $words[$decimal % 10]) . ' Paise' : '';
        return ($Rupees ? $Rupees . '' : '') . $paise ;
    }
    $v= getIndianCurrency($x);
 $udf1="There are total. ".$v." .Assignment. Check it out.  Thank You ";  
             $text=strip_tags($udf1);
             $final_voice_text= preg_replace("/[^a-zA-Z.,]/", " ", $text);	?>
             <script>
    function findtext() {
    responsiveVoice.speak('<?php echo $final_voice_text; ?>');
    }
</script>                                      
                                        


<?php 
$i=1; 
			$sid=$_REQUEST["id"]; ?>
			
												
                                 
										
										
 <h4>List of Submitted Assignment</h4> 										
										<table class="table table-bordered table-hover" >
										
                                            <thead>
                                                 <tr style="background-color:#33CCFF">  
                                                      <th>Assignment Name</th>
                                                      <th>Submited date</th>
                                                      <th>Assignment</th>
                                                    <th>Submitted File</th>
													<th>Marks</th>
                                                     
                                                  
                                                      
                                                                                                          
                                                </tr>
                                            </thead>
                                            <tbody>

                                            <?php $i=1; $p=1;
			 $sid=$_REQUEST["id"];  $session=$_REQUEST["session"];
			$q=mysqli_query($con,"select * from submit_homework where `student_id`='".$sid."' and `status`='active'");
	while($qr=mysqli_fetch_array($q,MYSQLI_ASSOC)) { ?>

  <tr>
        										     
                                                     <td><?php $s_id= $qr["homework_id"];
													 $a=mysqli_query($con,"select * from home_work where `id`='".$s_id."'");
													 $ar=mysqli_fetch_array($a,MYSQLI_ASSOC);
													 echo $ar["title"];
													  ?><br>
													
													 </td>
                                                     
                                                     <td><?php $temp_date=date_create($qr["dsubmit_ate"]); echo date_format($temp_date,"d/m/Y"); ?> </td>
<td><a href="../assignment/<?php echo $ar['path']; ?>"><img src="../assignment/download.png" width="50"></a></td>
													 </td>                                                    
													<td><a href="<?php echo $root_link;?>/student_login/assignment_file/<?php echo $qr['path']; ?>"><img src="../assignment/download.png" width="50"></a></td>
													   
													   
                                                     
                                                    
                                                        
                                                
        										     
                                                     <td><?php echo $qr["obtain_no"];?></td>
													 </tr>
													 
	<?php } ?>

                                                                                             </tbody>
                                            
                                        </table>
										
										
<br>
										
									
                                        <input type="hidden" name="chk_counter" value="4" />
                                    </div>
<?php $p=1; $tt=0; $user_name=$_SESSION["user_name"];  
$qq=mysqli_query($con,"select ac_session,class,roll,section from student_history where `student_id_no`='".$user_name."' GROUP BY `ac_session` ORDER BY `ac_session` desc");
 while($qqr=mysqli_fetch_array($qq)) { $i=1; ?>

                            <a href="?id=<?php echo $_SESSION['user_name']; ?>&session=<?php echo $qqr['ac_session']; ?>&section=<?php echo $qqr['section']; ?>&class=<?php echo $qqr['class']; ?>&roll=<?php echo $qqr['roll']; ?>">    <input type="submit" style="width: 100%; height:35px; background-color:#FFFFCC; color:#000000" value="assignment : <?php echo $qqr['class']; ?> / <?php echo $qqr['section']; ?> / <?php echo $qqr['roll']; ?>">  </a> <br>

 <?php } ?><br>
 <a href="dashboard.php" ><img src="back.png" width="60"></a>
                            </div>
                        </div>
                    </div>
                </div>
            <!-- /.content -->
        </div> <!-- /.content-wrapper -->
         <?php  include("../include/footer.php"); ?> 


    </div> 
    <!-- Start Core Plugins
        =====================================================================-->
        <!-- jQuery -->
        <script src="../assets/plugins/jQuery/jquery-1.12.4.min.js" type="text/javascript"></script>
        <!-- jquery-ui --> 
        <script src="../assets/plugins/jquery-ui-1.12.1/jquery-ui.min.js" type="text/javascript"></script>
        <!-- Bootstrap -->
        <script src="../assets/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
        <!-- lobipanel -->
        <script src="../assets/plugins/lobipanel/lobipanel.min.js" type="text/javascript"></script>
        <!-- Pace js -->
        <script src="../assets/plugins/pace/pace.min.js" type="text/javascript"></script>
        <!-- SlimScroll -->
        <script src="../assets/plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script>
        <!-- FastClick -->
        <script src="../assets/plugins/fastclick/fastclick.min.js" type="text/javascript"></script>
        <!-- Hadmin frame -->
        <script src="../assets/dist/js/custom1.js" type="text/javascript"></script>
        <!-- End Core Plugins
        =====================================================================-->
        <!-- Start Page Lavel Plugins
        =====================================================================-->
        <!-- Toastr js -->
        <script src="../assets/plugins/toastr/toastr.min.js" type="text/javascript"></script>
        <!-- Sparkline js -->
        <script src="../assets/plugins/sparkline/sparkline.min.js" type="text/javascript"></script>
        <!-- Data maps js -->
        <script src="../assets/plugins/datamaps/d3.min.js" type="text/javascript"></script>
        <script src="../assets/plugins/datamaps/topojson.min.js" type="text/javascript"></script>
        <script src="../assets/plugins/datamaps/datamaps.all.min.js" type="text/javascript"></script>
        <!-- Counter js -->
        <script src="../assets/plugins/counterup/waypoints.js" type="text/javascript"></script>
        <script src="../assets/plugins/counterup/jquery.counterup.min.js" type="text/javascript"></script>
        <!-- ChartJs JavaScript -->
        <script src="../assets/plugins/chartJs/Chart.min.js" type="text/javascript"></script>
        <script src="../assets/plugins/emojionearea/emojionearea.min.js" type="text/javascript"></script>
        <!-- Monthly js -->
        <script src="../assets/plugins/monthly/monthly.js" type="text/javascript"></script>
        <!-- Data maps -->
        <script src="../assets/plugins/datamaps/d3.min.js" type="text/javascript"></script>
        <script src="../assets/plugins/datamaps/topojson.min.js" type="text/javascript"></script>
        <script src="../assets/plugins/datamaps/datamaps.all.min.js" type="text/javascript"></script>
      
        <!-- End Page Lavel Plugins
        =====================================================================-->
        <!-- Start Theme label Script
        =====================================================================-->
        <!-- Dashboard js -->
        <script src="../assets/dist/js/custom.js" type="text/javascript"></script>



  
</body>
</html>