| Server IP : 61.19.30.66 / Your IP : 216.73.216.59 Web Server : Apache/2.2.22 (Ubuntu) System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 User : www-data ( 33) PHP Version : 5.3.10-1ubuntu3.48 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /var/www/gpa/klwsc/ |
Upload File : |
<?
require_once "../config/confiteacher.inc.php";
require_once "../config/connectdb.php";
require_once "head.php";
$ttt=$objResult["teachcode"];
$crsql="SELECT (years) FROM `config`" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$years=$dcrd[0];
$crsql="SELECT (termx) FROM `config`" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$termxs=$dcrd[0];
?>
<?php
//index.php
$connect = mysqli_connect("localhost", "root", "klw3322", "klw");
mysqli_query($connect, "SET NAMES UTF8");
$message = '';
if(isset($_POST["upload"]))
{
if($_FILES['product_file']['name'])
{
$filename = explode(".", $_FILES['product_file']['name']);
if(end($filename) == "csv")
{
$handle = fopen($_FILES['product_file']['tmp_name'], "r");
while($data = fgetcsv($handle))
{
$product_id = mysqli_real_escape_string($connect, $data[0]);
$ids = mysqli_real_escape_string($connect, $data[1]);
$product_category = mysqli_real_escape_string($connect, $data[2]);
$product_name = mysqli_real_escape_string($connect, $data[3]);
$product_price = mysqli_real_escape_string($connect, $data[4]);
$k2 = mysqli_real_escape_string($connect, $data[5]);
$p2 = mysqli_real_escape_string($connect, $data[6]);
$a2= mysqli_real_escape_string($connect, $data[7]);
$k3 = mysqli_real_escape_string($connect, $data[8]);
$p3 = mysqli_real_escape_string($connect, $data[9]);
$a3= mysqli_real_escape_string($connect, $data[10]);
$k4 = mysqli_real_escape_string($connect, $data[11]);
$p4 = mysqli_real_escape_string($connect, $data[12]);
$a4= mysqli_real_escape_string($connect, $data[13]);
$k5 = mysqli_real_escape_string($connect, $data[14]);
$p5 = mysqli_real_escape_string($connect, $data[15]);
$a5= mysqli_real_escape_string($connect, $data[16]);
$k6 = mysqli_real_escape_string($connect, $data[17]);
$p6 = mysqli_real_escape_string($connect, $data[18]);
$a6= mysqli_real_escape_string($connect, $data[19]);
$midterm = mysqli_real_escape_string($connect, $data[20]);
$final= mysqli_real_escape_string($connect, $data[21]);
$query = "
UPDATE transcriptintall
SET
mid = '$midterm',
final1 = '$final',
scor1k = '$product_category',
scor1p = '$product_name',
scor1a = '$product_price',
scor2k = '$k2',
scor2p = '$p2',
scor2a = '$a2',
scor3k = '$k3',
scor3p = '$p3',
scor3a = '$a3',
scor4k = '$k4',
scor4p = '$p4',
scor4a = '$a4',
scor5k = '$k5',
scor5p = '$p5',
scor5a = '$a5',
scor6k = '$k6',
scor6p = '$p6',
scor6a = '$a6'
WHERE id='$product_id' and IDstudent = '$ids'
";
mysqli_query($connect, $query);
}
fclose($handle);
header("location: index.php?updation=1");
}
else
{
$message = '<label class="text-danger">Please Select CSV File only</label>';
}
}
else
{
$message = '<label class="text-danger">Please Select File</label>';
}
}
if(isset($_GET["updation"]))
{
$message = '<label class="text-success">Product Updation Done</label>';
}
$query = "SELECT * FROM transcriptintall join klw on klw.Username=transcriptintall.idstin where yearsx='$years' and termx='$termxs' and teachin='$ttt' group by codin asc,idgrupin asc";
$result = mysqli_query($connect, $query);
?>
<!DOCTYPE html>
<html>
<head>
<title>Update gpa</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<meta charset="utf8">
</head>
<body>
<br />
<div class="container">
<h2 align="center">Update GPA</a></h2>
<?php echo $message; ?>
>>>><a href="../data/sentgpa.php">back</a>
<br />
<div class="table-responsive">
<table class="table table-bordered table-striped">
<tr>
<th>x</th>
<th>code</th>
<th>group</th>
<th>0</th>
<th>1</th>
<th>1.5</th>
<th>2</th>
<th>2.5</th>
<th>3</th>
<th>3.5</th>
<th>4</th>
<th>I</th>
</tr>
<?php
$i=1;
while($row = mysqli_fetch_array($result))
{
$product=$row["codin"];
$student=$row["IDstudent"];
$Name=$row["Name"];
$surname=$row["surname"];
$xLevel=$row["cllass"];
$room=$row["idgrupin"];
$crsql="SELECT count(idstin) FROM `transcriptintall`
WHERE yearsx='$years' and termx='$termxs' and teachin='$ttt' and codin='%$product%' ";
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$numlearn=$dcrd[0];
$crsql="SELECT count( idstin) FROM `transcriptintall`
WHERE grade2 = '0' and yearsx='$years' and termx='$termxs' and teachin='$ttt' and codin='$product' ";
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$grad0=$dcrd[0];
$crsql="SELECT count( idstin) FROM `transcriptintall`
WHERE grade2 = '1' and yearsx='$years' and termx='$termxs' and teachin='$ttt' and codin='$product' ";
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$grad1=$dcrd[0];
echo '
<tr>
<td>'.$i.'</td>
<td><a href=indexup2.php?id='.$product.'&&room='.$room.'>'.$product.'</td>
<td>'.$room.'</td>
<td>'.$grad0.'</td>
<td>'.$k2.'</td>
<td>'.$numlearn.'</td>
<td>'.$k2.'</td>
<td>'.$p2.'</td>
<td>'.$a2.'</td>
<td>'.$k3.'</td>
<td>'.$p3.'</td>
<td></td>
</tr>
';
$i++;
}
?>
</table>
</div>
</div>
</body>