forked from webERP-team/webERP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GLJournalTemplates.php
64 lines (54 loc) · 1.85 KB
/
GLJournalTemplates.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
<?php
include ('includes/session.php');
$Title = _('Maintain journal templates');
$ViewTopic = 'GeneralLedger';
$BookMark = 'GLJournals';
include ('includes/header.php');
if (isset($_GET['delete'])) {
// Delete the lines
$SQL = "DELETE FROM jnltmpldetails WHERE templateid='" . $_GET['delete'] . "'";
$Result = DB_query($SQL);
// Delete the lines
$SQL = "DELETE FROM jnltmplheader WHERE templateid='" . $_GET['delete'] . "'";
$Result = DB_query($SQL);
prnMsg(_('The GL journal template has been removed from the database'), 'success');
}
$SQL = "SELECT templateid,
templatedescription,
journaltype
FROM jnltmplheader";
$Result = DB_query($SQL);
if (DB_num_rows($Result) == 0) {
prnMsg(_('There are no templates stored in the database.'), 'warn');
} else {
echo '<p class="page_title_text" >
<img class="page_title_icon" src="', $RootPath, '/css/', $_SESSION['Theme'], '/images/gl.png" title="" alt="" />', ' ', _('Maintain journal templates'), '
</p>';
echo '<table>
<tr>
<th colspan="4">', _('Available journal templates'), '</th>
</tr>
<tr>
<th>', _('Template ID'), '</th>
<th>', _('Template Description'), '</th>
<th>', _('Journal Type'), '</th>
</tr>';
while ($MyRow = DB_fetch_array($Result)) {
if ($MyRow['journaltype'] == 0) {
$JournalType = _('Normal');
} else {
$JournalType = _('Reversing');
}
echo '<tr class="striped_row">
<td>', $MyRow['templateid'], '</td>
<td>', $MyRow['templatedescription'], '</td>
<td>', $JournalType, '</td>
<td class="noPrint"><a href="', basename(__FILE__), '?delete=', urlencode($MyRow['templateid']), '" onclick="return MakeConfirm(\'' . _('Are you sure you wish to delete this template?') . '\', \'Confirm Delete\', this);">', _('Delete'), '</a></td>
</tr>';
}
echo '</table>';
include ('includes/footer.php');
exit;
}
include ('includes/footer.php');
?>