This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$uid = $_GET['uid']; | |
$int = '0'; // default int | |
$conn = mysqli_connect('localhost', 'root', 'admin', 'vote'); | |
$sql = "SELECT uid FROM list WHERE uid = '$uid'"; | |
$result = mysqli_query($conn, $sql); | |
$check = mysqli_num_rows($result); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: RTG | |
* Date: 6/8/2017 | |
* Time: 9:23 PM | |
*/ | |
function getStatus($value): string { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import requests | |
import json | |
import datetime | |
import csv | |
import time | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQL Configuration | |
- Admin Database: 'admin_data' | |
- Student Database: 'students_data' | |
SQL DB: 'admin_data' | |
- Parameters: | |
- Username, Password, Status(Coordinator, Admin, Finance) | |
- ```"CREATE TABLE `admin_data` ( | |
`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function onRegister(string $username, string $password, $email, $status = "0", $createdBy = "register"): bool { // createdOn and createdIP Internal | |
$createdOn = date("Y/m/d"); | |
$createdIP = "0.0.0.0"; | |
$stmt = $this->returnSQLConnection()->prepare("INSERT INTO `users` (`username`, `password`, `email`, `status`, `createdOn`, `createdBy`, `createdIP`) VALUES (?, ?, ?, ?, ?, ?, ?)"); | |
$stmt->bind_param("sssssss", $username, $password, $email, $status, $createdOn, $createdBy, $createdIP); | |
$result = $stmt->execute(); | |
var_dump($result); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function setFinance($month, $year, $param, $money) { | |
if ($this->checkFinance($month, $year) !== false) { // UPDATE | |
switch (strtolower($param)) { | |
case "inbound": | |
$previousInbound = $this->returnPrevInbound($month, $year); | |
$newInbound = $previousInbound + $money; | |
$run = $this->updateDatabase($month, $year, "inbound", $newInbound); | |
if ($run === true) { | |
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Information at below: I've explained | |
// Inside Website: | |
<?php | |
error_reporting(1); | |
require 'includes/Handler.php'; | |
$api = new Handler(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$line = explode(", ", $api->returnCourseHandler()->returnPreviousCompletedCourse($username)); | |
// The response I get from this array if I print_r is "Array ( [0] => C1 [1] => C2 )" | |
if (in_array("C1", $line)) { | |
echo " | |
<div class='col-md-4'> | |
<div class='card'> | |
<div class='card-header'> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// What I want to do | |
// Some teachers will have a lot of Levels, like S4, S5, S6 | |
// Each Level has its own rate per hour | |
// I want to know how i can filter each level? | |
<?php | |
switch ($_GET['parameter']) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
ini_set('max_execution_time', 300); //300 seconds = 5 minutes. In case if your CURL is slow and is loading too much (Can be IPv6 problem) | |
error_reporting(E_ALL); | |
define('OAUTH2_CLIENT_ID', '1234567890'); | |
define('OAUTH2_CLIENT_SECRET', 'verysecretclientcode'); |
OlderNewer