| Current Path : /home/wirbesti/unwaehlbar.ch/ |
| Current File : /home/wirbesti/unwaehlbar.ch/storeInfo.php |
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
set_error_handler(function ($level, $message, $file = '', $line = 0) {
throw new ErrorException($message, 0, $level, $file, $line);
});
require_once "settings.config.php";
require_once "DBConnection.php";
// Database Connection Code
$database = new DbConnection($config);
$id = intval($_GET['id']);
$bias = $_GET['bias'];
$info = urldecode($_GET['info']);
$language = $_GET['language'];
$date = date("Y-m-d H:i:s");
$type = $bias == "pro" ? 1 : 0;
$data = [
'created' => $date,
'id' => $id,
'language' => $language,
'evaluationtext' => $info,
'status' => 1,
'type' => $type
];
$insertSQL = "INSERT into `evaluation` (`created`,`politicianid`,`language`,`evaluationtext`,`status`, `type`) VALUES (:created,:id,:language,:evaluationtext,:status,:type)";
$getpoliticians = $database->dbc->prepare($insertSQL);
$getpoliticians->execute($data);
http_response_code(200);
?>