Skip to content

Commit

Permalink
Fixed everything 👍
Browse files Browse the repository at this point in the history
  • Loading branch information
smallfoot47 committed Apr 18, 2022
1 parent f66210e commit f472035
Show file tree
Hide file tree
Showing 10 changed files with 1,955 additions and 1,689 deletions.
14 changes: 0 additions & 14 deletions admin.php

This file was deleted.

2,520 changes: 1,286 additions & 1,234 deletions index.html

Large diffs are not rendered by default.

Empty file added pages/registration/admin.php
Empty file.
170 changes: 170 additions & 0 deletions pages/registration/fetch.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
<?php
// define('username', 'sathian');
// define('password', 'face');

// function isValidUsername($user) {
// echo "I was called";
// if ($user == 'username')
// return true;
// return false;
// }

// function isValidPassword($pass) {
// echo "I was also called";
// if ($pass == 'password')
// return true;
// return false;
// }

function Sathian() {
$_INCLUDE_DIR = $_SERVER['DOCUMENT_ROOT'] . '/pravidhi-2022/includes/';
require_once $_INCLUDE_DIR . 'dependencies.php';

if (count($_POST) > 0) {
$user = $_POST['cUsername'];
$pass = $_POST['cPass'];

if (true) {
consoleBug("validated");
header("Location:" . $_SERVER['DOCUMENT_ROOT'] . "/pravidhi-2022/fetch.php");
} else {
consoleBug("invalidated");
// throwAlert(
echo "credentials invalid";
// );
header("Location:" . $_SERVER['DOCUMENT_ROOT'] . "/pravidhi-2022/index.html");
}
} else
consoleBug('no post');
}

Sathian();

function gandan() {
$_INCLUDE_DIR = $_SERVER['DOCUMENT_ROOT'] . '/pravidhi-2022/includes/';
require_once $_INCLUDE_DIR . 'dependencies.php';

$select = new Table_Field_Rel(
"individualregistered",
"clubname", //0
"eventname", //1
"regno", //2
"name", //3
"sem", //4
"branch", //5
"email", //6
"phno"
);

$query = new MySQL_Query_Capsule($select);
consoleBug($query);
$out = $dbc->RelayQuery($query);

$a = array();

foreach ($out as $_trivial => $eventTuple) {
$b = array();

consoleBug(">>");
foreach ($eventTuple as $_trivial1 => $eventAttr) {
consoleBug("attr: $eventAttr");
array_push($b, $eventAttr);
}

array_push($a, $b);
}

consoleBug($a[0][0]);
echo("<h1>Individual event table</h1>")
?>

<table style=" border: 1px solid black;">
<tr>
<th>clubname</th>
<th>eventname</th>
<th>regno</th>
<th>name</th>
<th>sem</th>
<th>branch</th>
<th>email</th>
<th>phno</th>

</tr>

<?php
foreach ($a as $v){
echo('<tr style=" border: 1px solid black;">');
foreach($v as $value){
echo(' <td style=" border: 1px solid black;">'.$value.'</td>');
}
echo('</tr>');
}

?>
<?php
$select = new Table_Field_Rel(
"groupregister",
"clubname", //0
"eventname", //1
"regno",
//2
"name",
"teamname", //3
"sem", //4
"branch", //5
"email", //6
"phno"
);

$query = new MySQL_Query_Capsule($select);
consoleBug($query);
$out = $dbc->RelayQuery($query);

$a = array();

foreach ($out as $_trivial => $eventTuple) {
$b = array();

consoleBug(">>");
foreach ($eventTuple as $_trivial1 => $eventAttr) {
consoleBug("attr: $eventAttr");
array_push($b, $eventAttr);
}

array_push($a, $b);
}
}

gandan();
?>
</table>

<br>
<h1>Group events table</h1>
<table style=" border: 1px solid black;">
<tr>
<th>clubname</th>
<th>eventname</th>
<th>regno</th>
<th>name</th>
<th>teamname</th>
<th>sem</th>
<th>branch</th>
<th>email</th>
<th>phno</th>

</tr>
<?php
foreach ($a as $v){
echo('<tr style=" border: 1px solid black;">');
foreach($v as $value){
echo(' <td style=" border: 1px solid black;">'.$value.'</td>');
}
echo('</tr>');
}

?>


</table>

Loading

0 comments on commit f472035

Please sign in to comment.