-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsort_priority.php
More file actions
36 lines (32 loc) · 1.35 KB
/
Copy pathsort_priority.php
File metadata and controls
36 lines (32 loc) · 1.35 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
<?
/***************************************************************************
* sort_priority.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";
// Re-sort the priority list for this user
$statement = "select * from selection where team_id = '".$login->team_id()."' and
selection_priority != '0'
order by selection_priority";
$result = mysql_query($statement);
$current = 10;
while ($row = mysql_fetch_array($result)) {
$statement = "update selection set selection_priority = '$current' where
team_id = '".$row['team_id']."' and player_id = '".$row['player_id']."'";
mysql_query($statement);
$current += 10;
}
header("Location: priority.php");
?>