/
myown_patches.php
96 lines (86 loc) · 3.27 KB
/
myown_patches.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
<?php
/************************************************************************/
/* ATutor */
/************************************************************************/
/* Copyright (c) 2002-2010 */
/* Inclusive Design Institute */
/* http://atutor.ca */
/* */
/* 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. */
/************************************************************************/
// $Id$
define('AT_INCLUDE_PATH', '../../../include/');
require (AT_INCLUDE_PATH.'vitals.inc.php');
admin_authenticate(AT_ADMIN_PRIV_PATCHER);
if (isset($_POST['remove'], $_POST['myown_patch_id']))
{
header('Location: patch_delete.php?myown_patch_id='.$_POST['myown_patch_id']);
exit;
}
else if (isset($_POST['edit'], $_POST['myown_patch_id']))
{
header('Location: patch_edit.php?myown_patch_id='.$_POST['myown_patch_id']);
exit;
}
else if (!empty($_POST) && !isset($_POST['myown_patch_id'])) {
$msg->addError('NO_ITEM_SELECTED');
}
require(AT_INCLUDE_PATH.'header.inc.php');
?>
<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<table summary="" class="data" align="center" style="width: 95%;">
<thead>
<tr>
<th scope="col"> </th>
<th scope="col"><?php echo _AT('atutor_patch_id'); ?></th>
<th scope="col" class="hidecol700"><?php echo _AT('atutor_version_to_apply'); ?></th>
<th scope="col"><?php echo _AT('description'); ?></th>
<th scope="col" class="hidecol700"><?php echo _AT('last_modified'); ?></th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="5">
<div class="row buttons">
<input type="submit" name="edit" value="<?php echo _AT('edit'); ?>" />
<input type="submit" name="remove" value="<?php echo _AT('remove'); ?>" />
</div>
</td>
</tr>
<tr>
<td colspan="5"></td>
</tr>
</tfoot>
<tbody>
<?php
$include_javascript = true;
$sql = "SELECT * from %smyown_patches m order by last_modified desc";
$rows_mypatches = queryDB($sql, array(TABLE_PREFIX));
if(count($rows_mypatches) == 0){
?>
<tr>
<td colspan="5"><?php echo _AT('none_found'); ?></td>
</tr>
<?php
}
else
{
foreach($rows_mypatches as $row){
?>
<tr onmousedown="document.form['m<?php echo $row['myown_patch_id']; ?>'].checked = true; rowselect(this);" id="r_<?php echo $row['myown_patch_id']; ?>">
<td width="10"><input type="radio" name="myown_patch_id" value="<?php echo $row['myown_patch_id']; ?>" id="m<?php echo $row['myown_patch_id']; ?>" <?php if ($row['myown_patch_id']==$_POST['myown_patch_id']) echo 'checked'; ?> /></td>
<td><label for="m<?php echo $row['myown_patch_id']; ?>"><?php echo $row['atutor_patch_id']; ?></label></td>
<td class="hidecol700"><?php echo $row['applied_version']; ?></td>
<td><?php echo htmlspecialchars_decode(stripslashes($row['description'])); ?></td>
<td class="hidecol700"><?php echo $row['last_modified']; ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</form>
<?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>