| Current Path : /var/www/html/venkat/projectjan2016/project1/ |
| Current File : /var/www/html/venkat/projectjan2016/project1/editstore.php |
<?php
include("phome.php");
$faculty = addslashes($_POST['faculty']);
$projectid = addslashes($_POST['projectid']);
if ($faculty == "#") {
header("location:edit.php");
}
$quer12=mysql_query("select semester, guide from projectsubmit where projectid = '$projectid'") or die("Invalid Access a!!!");
while ($row = mysql_fetch_array( $quer12 )) {
$faculty1=$row['guide'];
$semester=$row['semester'];
}
$quer12=mysql_query("select id from faculty where name ='$faculty'") or die("Invalid Access a!!!");
while ($row = mysql_fetch_array( $quer12 )) {
$facultyid=$row['id'];
}
$pv1=rand();
$rest = substr($faculty, 3,3);
$kk = substr($r, 0,2);
$id=$rest.$pv1;
$query = "update projectsubmit set verified = 'no',accepted = 'n', guide = '$faculty', facultyid = '$facultyid',newid = '$id', register = '$r' WHERE projectid = '$projectid'";
mysql_query($query) or die(mysql_error());
mysql_insert_id();
$query = "update projectsubmit set projectid = '$id' WHERE newid = '$id'";
mysql_query($query) or die(mysql_error());
mysql_insert_id();
$query = "update projectsubmit set verified = 'yes' WHERE rollno = '$r'";
mysql_query($query) or die(mysql_error());
mysql_insert_id();
if(strlen($avail) == 6){
$avai1 = substr($avail,4,2);
}
else {
$avai1 = substr($avail,2,2);
}
$quer1=mysql_query("select * from faculty where name='$faculty'") or die("Invalid Access2 !!!");
if($row = mysql_fetch_array( $quer1 )) {
$avail1=$row[$avai1];
if($semester == 5 && $kk == "ri") {
$ri1 = $row['ri1'];
}
}
if($semester == 5 && $kk == "ri") {
$ri1=$ri1 + 1;
$query ="update faculty set ri1= '$ri1' WHERE name = '$faculty'";
mysql_query($query) or die(mysql_error());
mysql_insert_id();
}
$avail1 = $avail1 - 1;
$query ="update faculty set $avai1= '$avail1' WHERE name = '$faculty'";
mysql_query($query) or die(mysql_error());
mysql_insert_id();
if(!isset($faculty1)) {
header("location:edit.php");
}
$quer1=mysql_query("select * from faculty where name='$faculty1'") or die("Invalid Access2 !!!");
if($row = mysql_fetch_array( $quer1 )) {
$avail1 =$row[$avai1];
if($semester == 5 && $kk == "ri") {
$ri1 = $row['ri1'];
}
}
if($semester == 5 && $kk == "ri" ) {
$ri1=$ri1 - 1;
$query ="update faculty set ri1= '$ri1' WHERE name = '$faculty1'";
mysql_query($query) or die(mysql_error());
mysql_insert_id();
}
$avail1 = $avail1 + 1;
$query ="update faculty set $avai1 = '$avail1' WHERE name = '$faculty1'";
mysql_query($query) or die(mysql_error());
mysql_insert_id();
date_default_timezone_set('Asia/Calcutta');
$dated = date('h:i:s', time());
$dated1 = date('a', time());
$dated2='06:30:00';
$dated3='pm';
$ssss = date("N");
$my_t= date("Y/m/d")."-".date("h:i:sa");
$query ="update projectstudent set change1 = '$my_t' WHERE rollno = '$r'";
mysql_query($query) or die(mysql_error());
mysql_insert_id();
?>
<center>
<br> <font color="red"> Successfully Updated. Please Verify the below and ask your project partners to accept the updation by logging in to the portal.</font>
</center>
<br>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="form1" enctype="multipart/form-data" method="post" action="pchoose.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><strong>Project Details</strong></td>
</tr>
<tr>
<td><b>Project Id</font></td>
<td><b>Roll No.</font></td>
<td><b>Name</font></td>
<td><b><center>Title </center></font></td>
<td><b>Guide</font></td>
<td><b>Co-Guide</font></td>
<td><b>Date of Cre./Veri.</font></td>
<td><b>Verified</font></td>
</tr>
<?php
$quer1=mysql_query("select projectid from projectsubmit where rollno='$r'") or die("Invalid Access2 !!!");
if($row = mysql_fetch_array( $quer1 ))
{
$id=$row['projectid'];
}
$quer1=mysql_query("select * from projectsubmit where projectid='$id'") or die("Invalid Access3 !!!");
while($row = mysql_fetch_array( $quer1 ))
{
$id=$row['projectid'];
$rollno=$row['rollno'];
$name=$row['name'];
$title=$row['title'];
$faculty=$row['guide'];
$coguide=$row['coguide'];
$date=$row['date'];
$verified=$row['verified'];
$register=$row['register'];
?>
<tr>
<td><?php echo($id); ?></font></td>
<td><?php if ($rollno == $register) { echo "<b>"; } echo($rollno); ?></font></td>
<td><?php echo($name); ?></font></td>
<td><?php echo($title); ?></font></td>
<td><?php echo($faculty); ?></font></td>
<td><?php echo($coguide); ?></font></td>
<td><?php echo($date); ?></font></td>
<td><?php echo($verified); ?></font></td>
</tr>
<?php
}
?>
</table>
</table>