/var/www/hkosl.com/onegolf/webadmin/ajax.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
    
require_once('basic_info.php');

    global 
$dbh;

    if (
$_GET["for"] == "update_scores") {
        if(!empty(
$_POST["id"]) && !empty($_POST["hole"])){
            
$sql "update scores set hole_".(int)$_POST["hole"]." = ? where id = ?";
            
$parameters = array((int)$_POST["scores"], (int)$_POST["id"]);
            
bind_pdo($sql$parameters);

            echo 
1;
        }
    }

    if (
$_GET["for"] == "update_sort") {
        if(!empty(
$_POST["event_id"]) && !empty($_POST["player_id"]) && !empty($_POST["sort"])){
            
$sql "update event_player set sort = ? where event_id = ? and player_id = ?";
            
$parameters = array((int)$_POST["sort"], (int)$_POST["event_id"], (int)$_POST["player_id"]);
            
bind_pdo($sql$parameters);

            echo 
1;
        }
    }