|
From: Benjamin C. <bc...@us...> - 2002-03-28 19:13:24
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv22482
Modified Files:
query.php
Log Message:
Added a simple query page which is now the default query form
Index: query.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/query.php,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- query.php 28 Mar 2002 17:05:50 -0000 1.63
+++ query.php 28 Mar 2002 19:13:21 -0000 1.64
@@ -33,32 +33,37 @@
}
function show_query() {
- global $db, $t, $TITLE, $u;
+ global $db, $t, $TITLE, $u, $_gv;
- $t->set_file('content','queryform.html');
- $t->set_block('content', 'savequeryblock', 'sqblock');
- $t->set_block('savequeryblock','row','rows');
-
- if ($u != 'nobody') {
- // Grab the saved queries if there are any
- $rs = $db->query("select * from ".TBL_SAVED_QUERY." where user_id = '$u'");
- if (!$rs->numRows()) {
- $t->set_var('rows','');
- } else {
- while ($rs->fetchInto($row)) {
- $t->set_var(array(
- 'savedquerystring' => $row['saved_query_string'],
- 'savedqueryname' => stripslashes($row['saved_query_name']),
- 'savedqueryid' => $row['saved_query_id']
- ));
- $t->parse('rows', 'row', true);
+ // Show the advanced query form
+ if (!empty($_gv['form']) and $_gv['form'] == 'advanced') {
+ $t->set_file('content','queryform.html');
+ $t->set_block('content', 'savequeryblock', 'sqblock');
+ $t->set_block('savequeryblock','row','rows');
+
+ if ($u != 'nobody') {
+ // Grab the saved queries if there are any
+ $rs = $db->query("select * from ".TBL_SAVED_QUERY." where user_id = '$u'");
+ if (!$rs->numRows()) {
+ $t->set_var('rows','');
+ } else {
+ while ($rs->fetchInto($row)) {
+ $t->set_var(array(
+ 'savedquerystring' => $row['saved_query_string'],
+ 'savedqueryname' => stripslashes($row['saved_query_name']),
+ 'savedqueryid' => $row['saved_query_id']
+ ));
+ $t->parse('rows', 'row', true);
+ }
}
+ $t->parse('sqblock', 'savequeryblock', true);
+ } else {
+ $t->set_var('sqblock', '');
}
- $t->parse('sqblock', 'savequeryblock', true);
- } else {
- $t->set_var('sqblock', '');
+ } else { // or show the simple one
+ $t->set_file('content','queryform-simple.html');
}
-
+
$t->set_var(array(
'js' => build_project_js(),
'status' => build_select('status'),
|