-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex2.php
195 lines (168 loc) · 6.19 KB
/
index2.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<?php
session_start();
?>
<?php
include "./dbcon.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page 2</title>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"
integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx"
crossorigin="anonymous"></script>
</head>
<body>
<nav class="page2">
<div class="left">
<div class="foo-logo">
<span style="margin-right: 10px;">
logo
</span>
</div>
<div class="heading">
<h1>
Football Picker
</h1>
</div>
</div>
<div class="user">
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
User
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<?php
if (isset($_SESSION['username']))
{
$template = "<p class=\"user\">".$_SESSION['username']."</p>";
echo $template;
echo "
<a class = \"logout\"href=\"logout.php\">Logout</a>
";
}
?>
<!-- <p>Username</p>
<button>Logout</button> -->
</div>
</div>
</div>
</nav>
<div class="player">
<h2 class="sub-heading mgL">Add A Player</h2>
<form action="index2.php" method="post">
<div class="player-content">
<div class="name">
<h2 class="sub-heading">Player Name</h2>
<input type="text" name="p_name" placeholder="Player Name" required>
</div>
<div class="cost">
<h2 class="sub-heading">Player Cost</h2>
<input type="text" name="p_cost" placeholder="Player Cost" required>
</div>
<button class="green" name="addPlayer">
Add a Player
</button>
</div>
</form>
</div>
<div class="currently">
<h2 class="sub-heading">Players Currently Added</h2>
<div class="cur-box">
<?php
if(isset($_POST['addPlayer'])){
$p_name = $_POST['p_name'];
$p_cost = $_POST['p_cost'];
$sql = "INSERT INTO `addplayer`(`p_name`, `p_cost`) VALUES ('$p_name','$p_cost')";
$add_p = mysqli_query($con,$sql);
}
$query="select * from addplayer";
$query_run = mysqli_query($con,$query);
$check_panel = mysqli_num_rows($query_run) > 0;
if($check_panel)
{
while($row = mysqli_fetch_array($query_run))
{
?>
<div class="border-box">
<div class="p-name">
<h1>Player Name:</h1>
<h2><?php echo $row['p_name'];?></h2>
</div>
<div class="p-cost">
<h1>Player Cost:</h1>
<h2><?php echo $row['p_cost'];?></h2>
</div>
<div class="action">
</div>
</div>
<?php
}
}else{
echo "no found";
}
?>
</div>
</div>
<div class="player">
<h2 class="sub-heading mgL">More Details</h2>
<form action="" method="post">
<div class="player-content">
<div class="name">
<h2 class="sub-heading">Size Of Team</h2>
<input type="number" name="team_size" placeholder="Size of Team" required>
</div>
<div class="cost">
<h2 class="sub-heading">Salary Cap</h2>
<input type="text" name="salary_cap" placeholder="Salary Cap" required>
</div>
<button class="green">
Generate
</button>
</div>
</form>
<div class="sport-btn">
<button>Generate</button>
</div>
</div>
<div class="more">
<div class="more-box">
</div>
<div class="more-box">
</div>
<div class="more-box">
</div>
<div class="more-box">
</div>
<div class="more-box">
</div>
<div class="more-box">
</div>
</div>
<div class="sport-btn">
<button>More</button>
</div>
<footer class="sport-footer">
<div class="foo-logo">
<span>
logo
</span>
</div>
<div class="heading">
<h1>
Football Picker
</h1>
</div>
</footer>
</body>
</html>