<?php

define('GLOBAL_PATH', '../../../../');
define('ROOT_PATH', '../../../');
define('CURRENT_CATEGORY', 'athletica_tech');
define('CURRENT_PAGE', 'results');
require_once ROOT_PATH . 'lib/inc.init.php';
require_once ROOT_PATH . 'lib/cls.result_high.php';
$serie = $_POST['serie'];
$height = $_POST['height'];
$height = formatResultDB($height);
$height_out = insertHeight($height, CFG_CURRENT_EVENT);
createHeightTable(CFG_CURRENT_EVENT);
createResultTable(CFG_CURRENT_EVENT);
echo $height_out;
Beispiel #2
0
define('GLOBAL_PATH', '../../../../');
define('ROOT_PATH', '../../../');
define('CURRENT_CATEGORY', 'athletica_tech');
define('CURRENT_PAGE', 'results');
require_once ROOT_PATH . 'lib/inc.init.php';
require_once ROOT_PATH . 'lib/cls.result_tech.php';
$return = "error";
$ath_res = $_POST['ath_res'];
$ath_wind = $_POST['ath_wind'];
$ath_id = $_POST['ath_id'];
$res_id = $_POST['res_id'];
$round = $_POST['round'];
$event = $_POST['event'];
$attempt = $_POST['attempt'];
$ath_res_db = formatResultDB($ath_res);
$ath_wind_db = formatWindDB($ath_res, $ath_wind);
if ($ath_res_db == 'error') {
    $return = 'result';
} else {
    try {
        $sql_sex = "SELECT Geschlecht \r\n                          FROM kategorie \r\n                     LEFT JOIN wettkampf USING(xKategorie) \r\n                     LEFT JOIN start USING(xWettkampf) \r\n                     LEFT JOIN serienstart USING(xStart) \r\n                         WHERE xSerienstart = :ath_id;";
        $query_sex = $glb_connection_server->prepare($sql_sex);
        $query_sex->bindValue(':ath_id', $ath_id);
        $query_sex->execute();
        $sex = $query_sex->fetch(PDO::FETCH_ASSOC);
        $sex = $sex['Geschlecht'];
        $points = calcPoints($event, $ath_res_db, $fraction = 0, $sex, $ath_id);
        $res_id_sql = !is_null($res_id) ? "xResultat = :res_id, " : "";
        $sql = "INSERT INTO resultat\r\n                        SET " . $res_id_sql . "\r\n                            Leistung = :ath_res\r\n                            , Info = :ath_wind\r\n                            , Punkte = :ath_pts\r\n                            , xSerienstart = :ath_id\r\n                ON DUPLICATE KEY UPDATE\r\n                            Leistung = :ath_res\r\n                            , Info = :ath_wind\r\n                            , Punkte = :ath_pts\r\n                            , xSerienstart = :ath_id\r\n                            ;";
        $query = $glb_connection_server->prepare($sql);