-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanage_subprojects.php
67 lines (65 loc) · 3.45 KB
/
manage_subprojects.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
<?php
// ReqHeap - a simple requirement management program.
//
// Copyright (C) 2007 Slav Peev , Matthias Gunter
// Programmed by i-nature.com
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// -----------------------------------------------------------------
//
// Page: "Manage subprojects" - page for managing subprojects for admin users
//check if logged
if ($_SESSION['rights']!="5") header("Location:index.php");
if ( ! isset($order) || $order=="") $order="s.s_name asc";
//$query="select s.*, p.p_id, p.p_name from subprojects s left outer join projects p on s.s_p_id=p.p_id and p.p_id in (".$project_list.") order by ".$order;
$query="select s.*, p.p_id, p.p_name from subprojects s left outer join projects p on s.s_p_id=p.p_id order by ".$order;
$rs = mysql_query($query) or die(mysql_error());
?>
<table border="0" width="100%">
<tr valign="top">
<td>
<form method="post" name="f" action="">
<table border="0" cellpadding="2" cellspacing="2" class="content" width="100%">
<tr class="gray">
<td colspan="9" align="left"><input type="button" onclick="document.location.href='index.php?inc=edit_subproject'" value="<?=$lng[28][4]?>"></td>
</tr>
<tr class="gray">
<td align="center" title="<?=$lng[28][5]?>"><a href="#" onclick="document.forms['f'].order.value='s.s_name <?if ($order=='s.s_name asc') echo "desc";else echo "asc";?>';document.forms['f'].submit();"><b><?=$lng[28][1]?></b></a></td>
<td align="center" title="<?=$lng[28][6]?>"><a href="#" onclick="document.forms['f'].order.value='s.s_desc <?if ($order=='s.s_desc asc') echo "desc";else echo "asc";?>';document.forms['f'].submit();"><b><?=$lng[28][2]?></b></a></td>
<td align="center" title="<?=$lng[28][7]?>"><a href="#" onclick="document.forms['f'].order.value='p.p_name <?if ($order=='p.p_name asc') echo "desc";else echo "asc";?>';document.forms['f'].submit();"><b><?=$lng[28][3]?></b></a></td>
</tr>
<?
$cnt=0;
while($row=mysql_fetch_array($rs))
{
?>
<tr class="<?if ($cnt) {echo "light_";$cnt=0;}else $cnt=1;?>blue">
<td align="left"><a href="index.php?inc=edit_subproject&s_id=<?=$row['s_id']?>"><?=htmlspecialchars($row['s_name'])?></a></td>
<td align="left"><?=$row['s_desc']?></td>
<td align="left"><a href="index.php?inc=view_project&p_switch=yes&project_id=<?=$row['p_id']?>&p_id=<?=$row['p_id']?>"><?=htmlspecialchars($row['p_name'])?></a></td>
</tr>
<?
}
?>
<tr class="gray">
<td colspan="9" align="left"><input type="button" onclick="document.location.href='index.php?inc=edit_subproject'" value="<?=$lng[28][4]?>"></td>
</tr>
</table>
<input type="hidden" name="inc" value="manage_subprojects">
<input type="hidden" name="order" value="">
</form>
</td>
</tr>
</table>