Skip to content

Commit

Permalink
fixes css
Browse files Browse the repository at this point in the history
  • Loading branch information
moaath committed Jun 24, 2024
1 parent a5b5229 commit 38ee1b3
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 18 deletions.
2 changes: 1 addition & 1 deletion service/www/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function getAllUserProfiles($conn)
<div class="inner">
<h3 class="masthead-brand">ImagiDate</h3>
<nav class="nav nav-masthead justify-content-center">
<a class="nav-link active" href="index.php">Homepage</a>
<a class="nav-link" href="index.php">Homepage</a>
<a class="nav-link" href='profile.php?id=<?php echo $user_id; ?>'>Profile</a>
<a class="nav-link" href="logout.php">Logout</a>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion service/www/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<div class="inner">
<h3 class="masthead-brand">ImagiDate</h3>
<nav class="nav nav-masthead justify-content-center">
<a class="nav-link active" href="">About</a>
<a class="nav-link active" href="">Homepage</a>
<?php if ($logged_in): ?>
<a class="nav-link" href='profile.php?id=<?php echo $user_id; ?>'>Profile</a>
<a class="nav-link" href="logout.php">Logout</a>
Expand Down
41 changes: 27 additions & 14 deletions service/www/match.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
exit();
}

function yaml_dump(array $data){
function yaml_dump(array $data)
{
$result = "";
foreach ($data as $key => $value){
foreach ($data as $key => $value) {
$result .= "$key: $value\n";
}
return $result;
Expand All @@ -21,14 +22,16 @@ function yaml_dump(array $data){
$requested_username = $_POST["requested_username"];
$punchline = $_POST["punchline"];

if($username != $_SESSION["username"]){
if ($username != $_SESSION["username"]) {
echo "You need to provide your actual username, not some random shit";
exit();
}

$ALLOWED_LEN = 20;
if(strlen($username) > $ALLOWED_LEN || strlen($gender) > $ALLOWED_LEN
|| strlen($requested_username) > $ALLOWED_LEN){
if (
strlen($username) > $ALLOWED_LEN || strlen($gender) > $ALLOWED_LEN
|| strlen($requested_username) > $ALLOWED_LEN
) {
echo "Your Input seems to be wrong. Some parameter was too large";
exit();
}
Expand All @@ -42,9 +45,9 @@ function yaml_dump(array $data){
];

$yaml = yaml_dump($data);
if(isset($_POST["custom_filename"])){
if (isset($_POST["custom_filename"])) {
$yaml_file = 'uploads/' . bin2hex($_POST["custom_filename"]) . ".yaml";
}else{
} else {
$yaml_file = 'uploads/data.yaml';
}
file_put_contents($yaml_file, $yaml);
Expand Down Expand Up @@ -72,6 +75,7 @@ function yaml_dump(array $data){

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand All @@ -98,6 +102,7 @@ function yaml_dump(array $data){
}
</style>
</head>

<body>
<div class="text-center">
<a href="index.php">
Expand All @@ -106,20 +111,27 @@ function yaml_dump(array $data){
<h2>Match with your fav Person!</h2>
<p class="lead">Submit your information and a punchline to your crush and see what they will say!</p>
<form id="yamlForm" action="" class="form-signin" method="POST" enctype="multipart/form-data">

<label for="username" class="sr-only">Username</label>
<input type="text" class="form-control" id="username" name="username" placeholder="Username" maxlength="20" required>
<input type="text" class="form-control" id="username" name="username" placeholder="Username" maxlength="20"
required>
<label for="age" class="sr-only">Age</label>
<input type="number" class="form-control" id="age" name="age" placeholder="Age" required>
<label for="gender" class="sr-only">Gender</label>
<input type="text" class="form-control" id="gender" name="gender" placeholder="Gender" maxlength="20" required>
<select id="gender" name="gender" class="form-control">
<option value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select>
<label for="requested_username" class="sr-only">Requested Username</label>
<input type="text" class="form-control" id="requested_username" name="requested_username" placeholder="Username of your crush" maxlength="20" required>
<input type="text" class="form-control" id="requested_username" name="requested_username"
placeholder="Username of your crush" maxlength="20" required>
<label for="punchline" class="sr-only">Punchline</label>
<textarea type="text" class="form-control" id="punchline" name="punchline" placeholder="Your punchline" required></textarea>
<textarea type="text" class="form-control" id="punchline" name="punchline" placeholder="Your punchline"
required></textarea>
<br>
<button type="submit" class="btn btn-lg btn-primary btn-block">Submit</button>
<?php if($show_resp): ?>
<?php if ($show_resp): ?>
<a href='check_response.php'>Data sent succesfully! Checkout your crushes reponse!</a>
<?php endif; ?>
</form>
Expand All @@ -129,4 +141,5 @@ function yaml_dump(array $data){
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>

</html>
4 changes: 2 additions & 2 deletions service/www/profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ function displayComments($comments)
<div class="inner">
<h3 class="masthead-brand">ImagiDate</h3>
<nav class="nav nav-masthead justify-content-center">
<a class="nav-link active" href="index.php">Homepage</a>
<a class="nav-link" href='profile.php?id=<?php echo $user_id; ?>'>Profile</a>
<a class="nav-link" href="index.php">Homepage</a>
<a class="nav-link active" href='profile.php?id=<?php echo $user_id; ?>'>Profile</a>
<a class="nav-link" href="logout.php">Logout</a>
</nav>
</div>
Expand Down
7 changes: 7 additions & 0 deletions service/www/styles/match.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ body {
background-color: #252525;
}

.form-signin select[id="gender"] {
margin-bottom: -1px;
border-top-left-radius: 0;
border-top-right-radius: 0;
background-color: #252525;
}

.form-signin textarea{
margin-bottom: -1px;
border-bottom-right-radius: 0;
Expand Down

0 comments on commit 38ee1b3

Please sign in to comment.