-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewStocks.php
executable file
·89 lines (76 loc) · 2.68 KB
/
viewStocks.php
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="css/buyStocks.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="js/viewStocks.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<?php include_once("inc/header.php");
include_once("checkSession.php");?>
<body>
<div class="container">
<h2>TRADING STOCKS</h2>
<p></p>
<table class="table table-bordered">
<thead>
<tr>
<th>Symbol</th>
<th>High</th>
<th>Low</th>
<th>Volume</th>
<th>Price</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
require_once 'login.php';
$conn = new mysqli($hn, $un, $pw, $db);
if ($conn->connect_error) die($conn->connect_error);
$query = "SELECT symbol,mxvalue,mnvalue,volume,lastvalue FROM live_data";
$result = $conn->query($query);
if (!$result) die ("Database access failed: " . $conn->error);
$rows = $result->num_rows;
$count=1;
for ($j = 0 ; $j < $rows ; ++$j) {
$result->data_seek($j);
$row = $result->fetch_array(MYSQLI_NUM);
?>
<form action="">
<tr>
<td><?php echo $row[0];?></td>
<td><?php echo $row[1];?></td>
<td><?php echo $row[2];?></td>
<td><?php echo $row[3];?></td>
<td><?php echo $row[4];?></td>
<td><button type="button" class="modalButton" data-toggle="modal" data-src="http://localhost/investment_assistant/graphnew.php?q=<?php echo $count?>" data-width="1000" data-height="600" data-target="#myModal" data-video-fullscreen="">View</button></td>
</tr>
</form>
<?php
$count++;} ?>
</tbody>
</table>
</div>
</body>
<div class="modal fade" id="myModal">
<div class="modal-dialog">
<div class="modal-content" style="width: 1100px;margin-left: -200px;">
<div class="modal-body">
<div class="close-button">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" frameborder="0"></iframe>
</div>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<?php include_once("inc/footer.php");?>
</html>