Friday, 1 April 2016

<?php

session_start();

if (!$_SESSION["valid_user"])
        {
        // User not logged in, redirect to login page
        Header("Location: index.php");
        }
else{
//include("config.php");

 ?>
 <head>
 <style>
 .menu{
     width:100%;
    
     border-radius:8px;
     text-decoration:none;
     background-color:#800080;
 }
 .menu ul > li:hover > ul {
  margin:0;
  color:#808000;
    transition:0s 0s;
}
.submenu ul
{
  display: none;
}
.submenu li:hover > ul
{
  display: block;
}
.submenu ul.parent_hover
{
  display: block;
}

 </style>
 <?php
 $con=mysqli_connect("localhost","root","","ses");
 $user=$_SESSION['valid_user'];
 # echo $user;

 $sql="select * from  login where un='".$user."'";
 $result=mysqli_query($con,$sql);
 $sql1="select * from lidiya";
 $result1=mysqli_query($con,$sql1);?>
 <div class="container" style="width:100%;background:#800080;height:18.5%;">
 <div class="left" style="width:50%;float:left;"><img src="images/logo.png" style="background:#800080;border-radius:5px"></div>
 <div class="menu" style="width:50%;float:left;" ><ul style="list-style:none"><li><h3>Welcome &nbsp;<?php echo $user;?></h3><ul style="list-style:none"><li><div class="submenu"><a href="logout.php"><button style="text-decoration:none;background:#808000;border-radius:5px;">Logout</button></a></div></li></ul></li></ul>
 </div>
 </div></head>
<body style="background:#FFF8DC">
<a href="add.php" style="text-decoration:none;color:#fff;"><button style="text-decoration:none;background:#808000;border-radius:5px;height:5%;color#fff"><b>Add Today Report</b> </button></a></div>
 <?php while($row=mysqli_fetch_array($result1)){
     ?>
<!--<div style="margin-left:800px;">-->

<form action="update.php" method="post"><br><table class="" border="4px">
<tr><th>S.NO</th>
<th>Date</th>
<th>Title</th>
<th>Report</th>
<th>URL</th>
<th>Alter</th>
</tr>
<tr>
<td>
<input type="text" name="sno" readonly=readonly value="<?php echo $row["id"];?>" style="background-color:#FFF8DC"></td>
<td><input type="text" name="date" readonly=readonly style="background-color:#FFF8DC" value="<?php echo $row["date"];?>"></td>
<td><input type="text" name="title" readonly=readonly  style="background-color:#FFF8DC" value="<?php echo $row["title"];?>"></td>
<td><?php echo "<textarea readonly rows=\"1\" cols=\"50\">" .$row['report']. "</textarea>";?></td>
<td> <input type="text" name="url" readonly=readonly style="background-color:#FFF8DC" value="<?php echo $row["url"];?>"></td>
<?php echo "<td style='background:#FFA500'>" ?><input type="submit" style="background-color:#FFA500;"value="Edit"><?php "</td>";?>
</table>
</form>
 <?php }}?>

No comments:

Post a Comment