~hexmode/+junk/main

« back to all changes in this revision

Viewing changes to install-files/apps/sqlitemanager1.2.0/include/tableproperties.php

  • Committer: Mark A. Hershberger
  • Date: 2008-01-05 19:38:56 UTC
  • Revision ID: hershberger@spawn-xp-20080105193856-6rnzgwa4nehue3qj
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
* Web based SQLite management
 
4
* Show and manage 'TABLE' properties
 
5
* @package SQLiteManager
 
6
* @author Fr�d�ric HENNINOT
 
7
* @version $Id: tableproperties.php,v 1.21 2006/04/14 15:16:52 freddy78 Exp $ $Revision: 1.21 $
 
8
*/
 
9
 
 
10
include_once INCLUDE_LIB.'SQLiteTableProperties.class.php';
 
11
$tableProp = &new SQLiteTableProperties($workDb);
 
12
if(!empty($table)){
 
13
        $tableProp->getTableProperties();
 
14
        switch($action){
 
15
                case '':
 
16
                default:                        
 
17
                        $tableProp->tablePropView();
 
18
                        break;
 
19
                case 'modify':
 
20
                case 'addChamp':
 
21
                        $tableProp->tableEditForm();
 
22
                        break;
 
23
                case 'save':
 
24
                case 'delete':
 
25
                case 'addprimary':
 
26
                case 'noprimary':
 
27
                        $tableProp->saveProp();
 
28
                        break;
 
29
                case 'unique':
 
30
                case 'index':
 
31
                        $tableProp->saveKey();
 
32
                        break;
 
33
                case 'insertElement':
 
34
                        $tableProp->formElement();
 
35
                        break;
 
36
                case 'insertFromFile':
 
37
                        $tableProp->formFromFile();
 
38
                        break;
 
39
                case 'saveFromFile':
 
40
                        $tableProp->saveFromFile();
 
41
                        break;
 
42
                case 'modifyElement':
 
43
                        $tableProp->formElement(urldecode(stripslashes($_GET['query'])), $_GET['pos']);
 
44
                        break;
 
45
                case 'saveElement':
 
46
                case 'deleteElement':
 
47
                        $tableProp->saveElement();
 
48
                        if(isset($GLOBALS['reBrowse']) && $GLOBALS['reBrowse']) include_once INCLUDE_LIB.'browse.php';
 
49
                        break;
 
50
                case 'empty':
 
51
                        $query = 'DELETE FROM '.brackets($table).';';
 
52
                        if($dbsel) $workDb->getResId($query);
 
53
                        displayQuery($query, false);
 
54
                        $redirect = "<script type=\"text/javascript\">parent.left.location='left.php?dbsel=".$dbsel."'; parent.main.location='main.php?dbsel=$dbsel&table=$table';</script>";                   
 
55
                        break;
 
56
                case 'export':
 
57
                        include_once INCLUDE_LIB.'SQLiteExport.class.php';
 
58
                        $export =& new SQLiteExport($workDb);                   
 
59
                        break;
 
60
                case 'select':
 
61
                        include_once INCLUDE_LIB.'SQLiteSelect.class.php';
 
62
                        $select =& new SQLiteSelect($workDb, $table);
 
63
                        break;            
 
64
                case 'selectElement':
 
65
                        $DisplayQuery = $tableProp->selectElement($table);
 
66
                        include INCLUDE_LIB.'browse.php';
 
67
                        break;            
 
68
                case 'operation':
 
69
                        include_once INCLUDE_LIB.'SQLiteDbOperation.class.php';
 
70
                        $export =& new SQLiteDbOperation($workDb);                      
 
71
                        break;
 
72
                }        
 
73
} else {
 
74
        switch($action){
 
75
                case '':
 
76
                default:
 
77
                        $tableProp->tableEditForm();
 
78
                        break;
 
79
                case 'add_table':
 
80
                        $tableProp->tableEditForm();
 
81
                        break;
 
82
        }        
 
83
}
 
84
?>
 
85
 
 
86
</body>
 
87
</html>