-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathperformanceBoard.php
More file actions
51 lines (48 loc) · 1.38 KB
/
performanceBoard.php
File metadata and controls
51 lines (48 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
session_start();
if(!isset($_SESSION['user_email'])) {
header('Location: login.html');
}
$userEmail = $_SESSION['user_email'];
$userName = $_SESSION['user_name'];
$file = file_get_contents('./config.txt', FILE_USE_INCLUDE_PATH);
$str = preg_split("/[\s,\n]+/", $file);
$sql_host = $str[1];
$sql_user = $str[3];
$sql_password = $str[5];
$sql_db = $str[7];
$conn = mysqli_connect($sql_host, $sql_user, $sql_password, $sql_db);
$query1 = "SELECT * FROM `companies` ORDER BY `name`";
$result1 = mysqli_query($conn, $query1);
echo("
<table id='t2'>
<caption><b><font color='white' size = '+2'>Company Details</font></b></caption>
<tr>
<th>
Company
</th>
<th>
Share Price (₹)
</th>
<th>
Performance
</th>
</tr>
");
while($row = mysqli_fetch_array($result1)) {
echo("
<tr>
<td>
".$row['name']."
</td>
<td>
".$row['share_price']."
</td>
<td>
".$row['performance']."%"."
</td>
</tr>
");
}
echo("</table>");
?>