Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //require_once('auth.php');
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <title>Catalog</title>
- <link rel="stylesheet" href="footer.css" />
- </head>
- <body>
- <div class="wrapper">
- <? // am inlocuit aici user-ul din session pt ca n-am restul paginilor si nu pot seta sesiunea
- //$current_user = $_SESSION['SESS_FIRST_NAME'];
- //$current_user_id = $_SESSION['SESS_MEMBER_ID'];
- $current_user = "Mihai";
- $current_user_id = 1;
- ?>
- <h1>Bine ai venit, <?php echo $current_user ?></h1>
- <a href="logout.php">Logout</a>
- <a href="chpass.php">Schimba parola</a>
- <?
- require_once('config.php');
- //Connect to mysql server
- error_reporting (E_ALL ^ E_NOTICE);
- $link = mysql_connect($DB_HOST, $DB_USER, $DB_PASSWORD);
- if(!$link) {
- die('Failed to connect to server: ' . mysql_error());
- }
- //Select database
- $db = mysql_select_db($DB_DATABASE);
- if(!$db) {
- die("Unable to select database");
- }
- echo '<br><br>';
- $query=mysql_query("select * from elev where nume='".$current_user."'");
- $result=mysql_fetch_array($query);
- ?>
- <h1>Informatii elev</h1>
- <table border="1">
- <tr>
- <td>Nume si prenume</td>
- <td><? echo $result['nume']; ?></td>
- </tr>
- <tr>
- <td>Clasa</td>
- <td><? echo $result['clasa']; ?></td>
- </tr>
- <tr>
- <td>CNP</td>
- <td><? echo $result['cnp'] ?></td>
- </tr>
- </table>
- <?
- $query2 = mysql_query("SELECT * from materie");
- $a = array();
- $i = 0;
- while ($result2 = mysql_fetch_array($query2)) {
- $a[$i] = $result2['nume'];
- $i ++;
- }
- ?>
- <br><br>
- <h1>Note</h1>
- <table border="1"><b><tr>
- <? for($x = 0;$x < $i; $x ++) { ?>
- <tr>
- <th><? echo $a[$x]; ?></th>
- <? $matid = $x + 1;
- $sql = mysql_query("select nota from note where materie_id='".$matid."' and elev_id='".$current_user_id."'");
- while ($result = mysql_fetch_array($sql)) {
- echo "<td>".$result['nota']."</td>";
- }
- ?>
- </tr>
- <? } ?>
- </tr>
- </table>
- <br><br>
- <h1>Absente</h1>
- <table border="1">
- <tr>
- </tr>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement