Example #1
0
    $cmd = $_REQUEST['settings_cmd'];
}
$mysql = new CMysql();
$mysql->connect($hostname, $mysql_user, $mysql_pass);
$mysql->usedb($dbname);
$mysql->set_main_table($main_table);
$mysql->set_main_form($main_form);
#$mysql->set_coll_cns($coll_cns);
$participants_list = "";
mysql_select_db($dbname) or die("Kan database {$dbname} niet openen");
print "<html>";
print "<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /></head>";
print "<body>";
$wedstrijd_id = $_REQUEST['wedstrijd_id'];
$c_query = "SELECT naam from wedstrijd WHERE wedstrijd_id = " . $wedstrijd_id . " LIMIT 1";
$c_result = $mysql->query($c_query);
$c_number = mysql_numrows($c_result);
if ($c_number > 0) {
    print "Deelnemers  " . mysql_result($c_result, 0, "naam") . "<BR>";
    $query = "SELECT participant.participant_id,participant.ref_gymnast,participant.is_aktief,participant.ref_level,participant.toestel,participant.blok,ref_wedstrijd,start_nr_1,start_nr_2,start_nr_3,gymnast_id,gymnast.naam,gymnast.is_aktief,gymnast.ref_club,gymnast.year_of_birth,club.naam,club.land,club.is_aktief,level_id,level.is_aktief,level.omschrijving,level.max_moeilijkheid FROM participant,gymnast,club,level WHERE ref_wedstrijd = '" . $wedstrijd_id . "' AND participant.ref_gymnast = gymnast.gymnast_id AND gymnast.ref_club = club.club_id AND participant.ref_level = level.level_id AND gymnast.is_aktief = '1' AND club.is_aktief = '1' AND level.is_aktief = '1' ORDER BY participant.participant_id,start_nr_1";
    $mysql->query("SET names 'utf8'");
    $result = $mysql->query($query);
    $number = mysql_numrows($result);
    /*print "<table>";*/
    for ($nr = 0; $nr < $number; $nr++) {
        $is_aktief = mysql_result($result, $nr, "participant.is_aktief");
        $toestel = mysql_result($result, $nr, "participant.toestel");
        $blok = mysql_result($result, $nr, "participant.blok");
        $start_nr_1 = mysql_result($result, $nr, "start_nr_1");
        $start_nr_2 = mysql_result($result, $nr, "start_nr_2");
        $start_nr_3 = mysql_result($result, $nr, "start_nr_3");
#
#  $_SESSION = array();
#  session_destroy();
#  //include("http://localhost/php/login.html");
#  exit;
# }
$mysql = new CMysql();
$mysql->connect($hostname, $mysql_user, $mysql_pass);
$mysql->usedb($dbname);
$mysql->set_main_table($main_table);
$mysql->set_main_form($main_form);
#$mysql->set_coll_cns($coll_cns);
mysql_select_db($dbname) or die("Kan database {$dbname} niet openen");
$query = "SELECT wedstrijd_id,password,is_aktief,is_locked,naam FROM wedstrijd WHERE wedstrijd_id = '" . $competition_nr . "' AND password = '******' AND is_aktief = '1' AND is_locked = '0' LIMIT 1";
print "query: {$query}<BR>";
$result = $mysql->query($query);
$number = mysql_numrows($result);
if ($number == 0) {
    print "<html><body>Fout: wedstrijd met nummer {$competition_nr} en opgegeven wachtwoord niet gevonden, of upload niet (meer) toegestaan<BR></body></html>\n";
    exit;
}
print "<html>";
print "<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /></head>";
print "<body>";
print "deelnemers:<BR>";
// Get a file into an array.  In this example we'll go through HTTP to get
// the HTML source of a URL.
#$lines = file('http://www.savannahdeckers.nl/scores/competition_36.csv');
// Loop through our array, show HTML source as HTML source; and line numbers too.
# ts_gymnast,club,toestel,startnr,positie,niveau,max_mh,b1,b2,b3,b4,b5,a1,tot,b1,b2,b3,b4,b5,a1,tot,b1,b2,b3,b4,b5,a1,tot,eindtotaal
$row = 1;
Example #3
0
    }
    if ($pair[0] == "extra_deduction") {
        $extra_deduction = $pair[1];
        $score_array = array("score" => $single_score, "deductions" => $deductions, "extra_deduction" => $extra_deduction, "jumps" => $jumps, "max_jump" => $max_jump);
        $all_scores[$gymnast_nr] = array($exercise => $score_array);
        $gymnast_ids[$gymnast_nr] = $gymnast_id;
    }
}
foreach ($all_scores as $gymnast_nr => $scores) {
    foreach ($scores as $exercise => $score) {
        #if ($gymnast_nr == $_REQUEST['current_gymnast'] && $exercise == $_REQUEST['current_exercise']) {
        #print "update<BR>";
        $query = "SELECT session_id,ref_jury_nr,ref_wedstrijd_nr,ref_gymnast,gymnast_nr,exercise,score_id FROM scores";
        $query = $query . " WHERE ref_jury_nr = \"" . $_REQUEST['ref_jury_nr'] . "\" and ref_wedstrijd_nr = \"" . $_REQUEST['ref_wedstrijd_nr'] . "\" and gymnast_nr = \"" . $gymnast_nr . "\" and exercise = \"" . $exercise . "\"";
        #$query = $query . " WHERE session_id =\"" . session_id() . "\" and ref_jury_nr = \"" . $_REQUEST['ref_jury_nr'] . "\" and ref_wedstrijd_nr = \"" . $_REQUEST['ref_wedstrijd_nr'] . "\" and gymnast_nr = \"" . $gymnast_nr . "\" and exercise = \"" . $exercise . "\"";
        $result = $mysql->query($query);
        $number = mysql_numrows($result);
        #print "number: $number<BR>";
        if ($number > 0) {
            $new_id = mysql_result($result, 0, "score_id");
            $new_query = "UPDATE `scores` SET `deductions`='" . $score['deductions'] . "',`extra_deduction`='" . $score['extra_deduction'] . "',`jumps`='" . $score['jumps'] . "',`max_jump`='" . $score['max_jump'] . "',`upload_time`=NOW(),`score`=" . $score['score'] . ",`ref_gymnast`=" . $gymnast_ids[$gymnast_nr];
            #$new_query = $new_query . " WHERE `session_id`=\"" . session_id() . "\" AND ref_jury_nr =\"" . $_REQUEST['ref_jury_nr'] . "\" AND ref_wedstrijd_nr =\"" . $_REQUEST['ref_wedstrijd_nr'] . "\" AND gymnast_nr = \"" . $gymnast_nr ."\" LIMIT 1";
            $new_query = $new_query . " WHERE ref_jury_nr =\"" . $_REQUEST['ref_jury_nr'] . "\" AND ref_wedstrijd_nr =\"" . $_REQUEST['ref_wedstrijd_nr'] . "\" AND gymnast_nr = \"" . $gymnast_nr . "\" LIMIT 1";
            $new_result = $mysql->query($new_query);
            #print "q: $new_query<BR>";
        } else {
            $new_query = "INSERT INTO `scores` (session_id,upload_time,ref_wedstrijd_nr,ref_jury_nr,jury_name,ref_gymnast,gymnast_nr,exercise,score,deductions,extra_deduction,jumps,max_jump) values('" . session_id() . "',NOW(),'" . $_REQUEST['ref_wedstrijd_nr'] . "','" . $_REQUEST['ref_jury_nr'] . "','" . $_REQUEST['jury_name'] . "','" . $gymnast_ids[$gymnast_nr] . "','" . $gymnast_nr . "','" . $exercise . "','" . $score['score'] . "','" . $score['deductions'] . "','" . $score['extra_deduction'] . "','" . $score['jumps'] . "','" . $score['max_jump'] . "')";
            #print "q: $new_query<BR>";
            $new_result = $mysql->query($new_query);
            $new_id = mysql_insert_id();
            #print "new_id: $new_id<BR>";