-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpriority_set.php
More file actions
52 lines (47 loc) · 1.66 KB
/
Copy pathpriority_set.php
File metadata and controls
52 lines (47 loc) · 1.66 KB
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
<?
/***************************************************************************
* priority_set.php
* -------------------
* begin : Friday, Mar 28, 2008
* copyright : (C) 2008 J. David Baker
* email : me@jdavidbaker.com
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
include "includes/classes.inc.php";
$count = 1;
if(is_array($_POST['player_id'])) {
foreach($_POST['player_id'] as $player_id) {
if ($_POST['value']) {
$value = $count;
} else if ($_POST['newvalue']){
foreach($_POST['newvalue'] as $k){
$value = $k;
}
} else{
$value = 0;
}
$statement = "update selection set selection_priority = '$value'
where team_id = '".$login->team_id()."' and player_id = '$player_id'";
mysql_query($statement);
$count++;
}
}
// Delete any?
if (is_array($_POST['delete'])) {
foreach($_POST['delete'] as $player_id) {
$statement = "delete from selection where team_id = '".$login->team_id()."' and player_id = '$player_id'";
mysql_query($statement);
}
}
// Process the queue
process_pick_queue();
header("Location: priority.php");
?>