database.list.php 4.35 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php

/*
	Datatypes:
	- INTEGER
	- DOUBLE
	- CURRENCY
	- VARCHAR
	- TEXT
	- DATE
*/



// Name of the list
16
if($_SESSION['s']['user']['typ'] == 'admin') {
17
	$liste["name"]     = "database_admin";
18
} else {
19
	$liste["name"]     = "database";
20
}
21
22

// Database table
23
$liste["table"]    = "web_database";
24
25

// Index index field of the database table
26
$liste["table_idx"]   = "database_id";
27
28

// Search Field Prefix
29
$liste["search_prefix"]  = "search_";
30
31

// Records per page
32
$liste["records_per_page"]  = "15";
33
34

// Script File of the list
35
$liste["file"]    = "database_list.php";
36
37

// Script file of the edit form
38
$liste["edit_file"]   = "database_edit.php";
39
40

// Script File of the delete script
41
$liste["delete_file"]  = "database_del.php";
42
43

// Paging Template
44
$liste["paging_tpl"]  = "templates/paging.tpl.htm";
45
46

// Enable auth
47
$liste["auth"]    = "yes";
48
49
50
51
52
53
54


/*****************************************************
* Suchfelder
*****************************************************/


55
56
57
58
59
60
61
$liste["item"][] = array( 'field'  => "active",
	'datatype' => "VARCHAR",
	'formtype' => "SELECT",
	'op'  => "=",
	'prefix' => "",
	'suffix' => "",
	'width'  => "",
Marius Cramer's avatar
Marius Cramer committed
62
	'value'  => array('y' => "<div id=\"ir-Yes\" class=\"swap\"><span>".$app->lng('Yes')."</span></div>", 'n' => "<div class=\"swap\" id=\"ir-No\"><span>".$app->lng('No')."</span></div>"));
63
64
65
66
67
68
69
70

$liste["item"][] = array( 'field'  => "remote_access",
	'datatype' => "VARCHAR",
	'formtype' => "SELECT",
	'op'  => "=",
	'prefix' => "",
	'suffix' => "",
	'width'  => "",
Marius Cramer's avatar
Marius Cramer committed
71
	'value'  => array('y' => "<div id=\"ir-Yes\" class=\"swap\"><span>".$app->lng('Yes')."</span></div>", 'n' => "<div class=\"swap\" id=\"ir-No\"><span>".$app->lng('No')."</span></div>"));
72
73
74
75
76
77
78
79
80
81
82
83
84

$liste["item"][] = array( 'field'  => "type",
	'datatype' => "VARCHAR",
	'formtype' => "SELECT",
	'op'  => "=",
	'prefix' => "",
	'suffix' => "",
	'width'  => "",
	'value'  => array(
		'mongo' => "MongoDB",
		'mysql' => "MySQL"
	)
);
85

86
if($_SESSION['s']['user']['typ'] == 'admin') {
87
88
89
90
91
92
93
	$liste["item"][] = array( 'field'  => "sys_groupid",
		'datatype' => "INTEGER",
		'formtype' => "SELECT",
		'op'  => "=",
		'prefix' => "",
		'suffix' => "",
		'datasource' => array (  'type' => 'SQL',
Marius Cramer's avatar
Marius Cramer committed
94
95
			//'querystring' => 'SELECT groupid, name FROM sys_group WHERE groupid != 1 ORDER BY name',
			'querystring' => "SELECT sys_group.groupid,CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), IF(client.contact_firstname != '', CONCAT(client.contact_firstname, ' '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as name FROM sys_group, client WHERE sys_group.groupid != 1 AND sys_group.client_id = client.client_id ORDER BY client.company_name, client.contact_name",
96
97
98
99
100
			'keyfield'=> 'groupid',
			'valuefield'=> 'name'
		),
		'width'  => "",
		'value'  => "");
101
102
}

103
$liste["item"][] = array( 'field'  => "server_id",
104
	'datatype' => "INTEGER",
105
106
107
108
109
	'formtype' => "SELECT",
	'op'  => "like",
	'prefix' => "%",
	'suffix' => "%",
	'datasource' => array (  'type' => 'SQL',
110
		'querystring' => 'SELECT a.server_id, a.server_name FROM server a, web_database b WHERE (a.server_id = b.server_id) AND ({AUTHSQL-B}) ORDER BY a.server_name',
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
		'keyfield'=> 'server_id',
		'valuefield'=> 'server_name'
	),
	'width'  => "",
	'value'  => "");

$liste["item"][] = array( 'field'  => "parent_domain_id",
	'datatype' => "VARCHAR",
	'filters'   => array( 0 => array( 'event' => 'SHOW',
			'type' => 'IDNTOUTF8')
	),
	'formtype' => "SELECT",
	'op'  => "=",
	'prefix' => "",
	'suffix' => "",
	'datasource' => array (  'type' => 'SQL',
		'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
		'keyfield'=> 'domain_id',
		'valuefield'=> 'domain'
	),
	'width'  => "",
	'value'  => "");

$liste["item"][] = array( 'field'  => "database_user_id",
	'datatype' => "INTEGER",
	'formtype' => "SELECT",
	'op'  => "=",
	'prefix' => "",
	'suffix' => "",
	'datasource' => array (  'type' => 'SQL',
		'querystring' => 'SELECT database_user_id, database_user FROM web_database_user WHERE {AUTHSQL} ORDER BY database_user',
		'keyfield'=> 'database_user_id',
		'valuefield'=> 'database_user'
	),
	'width'  => "",
	'value'  => "");
147

148
$liste["item"][] = array(    'field'        => "database_name",
149
150
151
152
153
154
155
	'datatype'    => "VARCHAR",
	'formtype'    => "TEXT",
	'op'        => "like",
	'prefix'    => "%",
	'suffix'    => "%",
	'width'        => "",
	'value'        => "");
156

157
?>