-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinterestSelection.php
89 lines (73 loc) · 3.27 KB
/
interestSelection.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
<?php
include "error.php";
?>
<!DOCTYPE html>
<html>
<head>
<title>In the Moment</title>
<link rel="stylesheet" href="https://unpkg.com/onsenui/css/onsenui.css">
<link rel="stylesheet" href="https://unpkg.com/onsenui/css/onsen-css-components.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css?version=2">
<link rel="stylesheet" type="text/css" href="css/interestcss.css?version=2">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/material-design-iconic-font/2.2.0/css/material-design-iconic-font.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
</head>
<body>
<ons-page id="bg">
<?php
include "header.php";
?>
<div style="text-align: center;">
<h1 style="margin: 8%;" class="title" id="textclr">Select the categories that you are interested in:</h1>
</div>
<div>
<!-- dynamically create the interest button based on interest retrieved from the database-->
<?php
include "start.php";
$colourArray = array("#284754", "#3B83A3", "#00A79D", "#F78360", "#6ABEE2");
$id = $_GET['id'];
$_SESSION['user'] = $id;
// user must choose a persona first
if(isset($_SESSION['user'])){
$user = $_SESSION['user'];
$sql="SELECT interestID FROM userinterest WHERE userID = $user";
$result = mysqli_query($db,$sql);
$count=0;
while ($rowResult = mysqli_fetch_assoc($result)) {
$sqlInterest="SELECT * FROM interest WHERE interestID = ".$rowResult['interestID'];
$resultInterest = mysqli_query($db,$sqlInterest);
$row = mysqli_fetch_assoc($resultInterest);
if ($count%2 ==0){
echo '<ons-row class="user_cover">';
}
echo ' <ons-col class="interest" id = "'.$row['interestID'].'">
<div class="user_thumbnail" style="background-color: '.$colourArray[$count].'"><ons-icon icon="'.$row['image'].'"></ons-icon></div>
<div class="username" id="user_2_name" style="font-size:1em">'.$row['name'].'</div>
</ons-col>';
$count++;
if ($count%2 ==0){
echo '</ons-row>';
}
}
} else {
header("Location:login.php");
}
?>
</div>
<ons-row class="user_cover">
<ons-button modifier=" large--cta" style="display: inline-block;margin-right: auto; margin-left: auto; color:white" onclick="submitInterest()">
<span class="noMargin">Submit</span>
</ons-button>
</ons-row>
</ons-page>
<script src="https://unpkg.com/onsenui/js/onsenui.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous">
</script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous">
</script>
<script type="text/javascript" src="js/eventHandling.js?version=5"></script>
</body>
</html>