Last change
on this file since 4 was 4, checked in by george, 17 years ago |
Práce na nové verzi. Přidány různé soubory.
|
-
Property svn:executable
set to
*
|
File size:
1.2 KB
|
Line | |
---|
1 | <?php
|
---|
2 | include('global.php');
|
---|
3 |
|
---|
4 | if(array_key_exists('Operation', $_GET)) $Operation = $_GET['Operation']; else $Operation = '';
|
---|
5 | switch($Operation)
|
---|
6 | {
|
---|
7 | case 'Add':
|
---|
8 | $Output = ShowAdd();
|
---|
9 | break;
|
---|
10 | case 'Delete':
|
---|
11 | $Output = ShowDelete();
|
---|
12 | break;
|
---|
13 | case 'Edit':
|
---|
14 | $Output = ShowEdit();
|
---|
15 | break;
|
---|
16 | default:
|
---|
17 | $Output = ShowNone();
|
---|
18 | }
|
---|
19 | ShowPage($Output);
|
---|
20 |
|
---|
21 | function ShowNone()
|
---|
22 | {
|
---|
23 | global $Database;
|
---|
24 | $Table = array(
|
---|
25 | 'Header' => array('Název velièiny', 'Operace'),
|
---|
26 | 'Rows' => array(),
|
---|
27 | );
|
---|
28 |
|
---|
29 | $Result = $Database->select('measure', '*');
|
---|
30 | while($Measure = $Result->fetch_array())
|
---|
31 | {
|
---|
32 | array_push($Table['Rows'], array($Measure['Name'], Link('?Operation=Edit&MeasureId='.$Measure['Id'], 'Editovat').' '.Link('?Operation=Delete&MeasureId='.$Measure['Id'], 'Odstranit')));
|
---|
33 | }
|
---|
34 | $Output = '<h3>Seznam mìøení</h3>'.Table($Table).Link('?Operation=Add', 'Pøidat');
|
---|
35 | return($Output);
|
---|
36 | }
|
---|
37 |
|
---|
38 | function ShowEdit()
|
---|
39 | {
|
---|
40 | global $Database;
|
---|
41 | $DbResult = $Database->select('measure', '*', 'Id='.$_GET['MeasureId']);
|
---|
42 | $Values = array();
|
---|
43 | $Values = $DbResult->fetch_array();
|
---|
44 | return(ShowEditTable('Measure', $Values));
|
---|
45 | }
|
---|
46 |
|
---|
47 | ?>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.