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


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

    global 
$dbh;

    if (!empty(
$_POST["event_id"]) && !empty($_POST["scores"])) {

        foreach(
$_POST["scores"] as $score_id => $row){
            foreach(
$row as $hole => $score){
                
$sql        "update scores set hole_" $hole " = ?, lastupby=?, lastupdate=? where id = ?";
                
$parameters = array((int)$score$_SESSION['cmsloginid'], $nowdate$score_id );
                
bind_pdo($sql$parameters);
            }
        }

        
header("Location: scores_modifyform.php?msg=2&event_id=".$_POST["event_id"]);

    }else{
        echo 
"<script>alert('Event ID and Scores cannot empty.'); location.href='scores_index.php'</script>";
        exit;
    }