/var/www/hkosl.com/onegolf/webadmin/event_modifyform.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?php
    
require_once('check_login.php');

    
$id = (int)$_GET["id"];

    
$row get_event($id);

    
$sql99        "SELECT * FROM sys_cms_login WHERE cmsloginid=?";
    
$parameters99 = array((int)$event_info{'lastupby'});
    
$row99        bind_pdo($sql99$parameters99"selectone");
?>
<!DOCTYPE html>
<html>
<head>
    <?php require_once('html_head.php'); ?>

    <script type="text/javascript" src="js/chosen_v1.4.1/chosen.jquery.min.js"></script>
    <link rel="stylesheet" href="js/chosen_v1.4.1/chosen.min.css">

    <script type="text/javascript">
        $(function () {
            $("#date").datepicker({dateFormat:"yy-mm-dd"});

            $("#players_id").chosen({search_contains: true});
        });
    </script>
</head>
<body>

<form action="event_modify.php" method="post" name="modifyform" enctype="multipart/form-data">
    <input type="hidden" name="id" value="<?= $row{'id'}; ?>">
    <table width="1000" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td height="70" align="right" valign="middle" class="icontxt">
                <table border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td width="50" align="center" style="font-size: 12px;">
                            <input type="image" alt="submit" src="images/iconSave.png" width="32" height="32" border="0"><br>
                            &nbsp;Save&nbsp;&nbsp;</a></td>
                        <td width="50" align="center">
                            <a href="event_index.php?msg=4"><img src="images/iconCancel.png" alt="Cancel" width="32" height="32" border="0"><br>
                                &nbsp;Cancel&nbsp;&nbsp;</a></td>
                        <td>&nbsp;</td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <span style="float:left;" class="pagetitletxt">
                    &nbsp;&nbsp;<b><img src="images/iconList.jpg" width="48" height="48" align="absmiddle"/> Modify
                        Events </b></span><span style="float:right;" class="msg">Last
                    Update: <?= $row99{'cmsusername'} . '&nbsp;&nbsp;&nbsp;' $row{'lastupdate'}; ?></span>
            </td>
        </tr>
        <tr>
            <td align="left" valign="middle"><!-- Content -->
                <table border="0" cellpadding="0" cellspacing="0">

                    <tr>
                        <td width="120" align="right" valign="top" class='content required'>Name</td>
                        <td class='content' valign="top">:&nbsp;</td>
                        <td class='content'>
                            <input type="text" class="content" name="name" value="<?=$row["name"]?>" required="required" style="width: 500px;"/>
                            <br><br>
                        </td>
                    </tr>

                    <tr>
                        <td width="120" align="right" valign="top" class='content required'>Location</td>
                        <td class='content' valign="top">:&nbsp;</td>
                        <td class='content'>
                            <input type="text" class="content" name="location" value="<?=$row["location"]?>" required="required" style="width: 500px;"/>
                            <br><br>
                        </td>
                    </tr>

                    <tr>
                        <td width="120" align="right" valign="top" class='content required'>Date</td>
                        <td class='content' valign="top">:&nbsp;</td>
                        <td class='content'>
                            <input type="text" class="content" name="date" value="<?=$row["date"]?>" id="date" required="required" style="width: 100px;"/>
                            <br><br>
                        </td>
                    </tr>

                    <tr>
                        <td width="120" align="right" valign="top" class='content required'>Max Par</td>
                        <td class='content' valign="top">:&nbsp;</td>
                        <td class='content'>
                            <?php
                                $max_par_info 
get_master_type_code("MAX_PAR"NULL);
                                foreach(
$max_par_info as $max_par){
                                    echo 
'<input type="radio" class="content" name="max_par" value="'.$max_par["code"].'" required="required" '.($row["max_par"] == $max_par["code"] ? 'checked' '').'/> '.$max_par["name_en"];
                                }
                            
?>
                            <br><br>
                        </td>
                    </tr>

                    <tr>
                        <td width="120" align="right" valign="top" class='content required'>Hole Par</td>
                        <td class='content' valign="top">:&nbsp;</td>
                        <td class='content'>
                            <?php
                                
for($i 1$i <= 18$i++){
                                    echo 
'Hole '.$i.' (Male) <input type="text" class="content" name="hole_'.$i.'_par_M" value="'.$row["hole_".$i."_par_M"].'" required="required" style="width: 100px;"/>&nbsp;&nbsp;&nbsp;';

                                    echo 
'(Female) <input type="text" class="content" name="hole_'.$i.'_par_F" value="'.$row["hole_".$i."_par_F"].'"required="required" style="width: 100px;"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';

                                    
//echo 'Index <input type="text" class="content" name="hole_'.$i.'_index" value="'.$row["hole_".$i."_index"].'" required="required" style="width: 100px;"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';

                                    
echo '<input type="checkbox" class="content" name="hole_'.$i.'_count" value="1" '.($row["hole_".$i."_count"]==1?'checked':'').' />Count it?<br><br>';
                                }

                            
?>

                        </td>
                    </tr>

                    <tr>
                        <td width="120" align="right" valign="top" class='content required'>Players</td>
                        <td class='content' valign="top">:&nbsp;</td>
                        <td class='content'>
                            <select name="players_id[]" id="players_id" style="width: 100%" multiple="multiple">
                                <?php
                                    $players_info 
get_player();
                                    
/*$exist_players_id = $row["players_id"];
                                    $exist_players_id_array = explode(",", $exist_players_id);*/

                                    
$sql "select * from event_player where event_id = ? order by sort ASC";
                                    
$parameters = array($id);
                                    
$exist_players_id_array bind_pdo($sql$parameters"selectall");

                                    foreach(
$players_info as $row){
                                        foreach(
$exist_players_id_array as $row2){
                                            if(
$row["id"] == $row2["player_id"]){
                                                
$selected "selected";
                                                break;
                                            }else{
                                                
$selected "";
                                            }
                                        }
                                        echo 
"<option value='".$row["id"]."' ".$selected.">".$row["name"]."</option>";
                                    }
                                
?>
                            </select>
                            <br><br>
                        </td>
                    </tr>

                    <tr>
                        <td width="120" align="right" valign="top" class='content'></td>
                        <td class='content' valign="top"></td>
                        <td class='content red'>
                            <br>
                            * Required Field
                            <br><br><br>
                        </td>
                    </tr>

                </table>
            </td>
        </tr>
    </table>
</form>
</body>
</html>