|
|
 |
| Index
» Projekty
» phpMyEdit
» Fórum
» Filtering with equal, not equal, greater, smaller? |
 |
roland
Založený: 24.03.2006
Príspevky: 25
Zaslal: 2006-12-15 08:56
Návrat hore
Odpovedať s citátom
|
Hello,
when I use filtering in List-Mode, I would like to have a Pulldown-Field beside the Filter-Field, where I can define the filtering value to >, <, = or <>.
I have seen this anytime anywhere, but I have no idea how to do that.
Can anybody help?
Thanks a lot
Roland
|
roland
Založený: 24.03.2006
Príspevky: 25
Zaslal: 2006-12-20 16:00
Návrat hore
Odpovedať s citátom
|
Hello, Does nobody have an idea, how to do it?
|
roland
Založený: 24.03.2006
Príspevky: 25
Zaslal: 2006-12-21 09:10
Návrat hore
Odpovedať s citátom
|
Thanks to Doug for your answer. I have learned, that I get the Pulldown-Field with <, <=, = >, >= when I use 'select = N'. What I am missing, is the parameter <>.
Example: I have a field status_id, which is linked to another table with these content:
status_id status
1 todo
2 planning
3 done
I would like to be able to filter all records, which do NOT have the status_id 3. Is there any way to do that. I know, that a workaround is the usage of $opts['filters']=... But this is not so flexible, because I always have to modify my definition file.
|
roland
Založený: 24.03.2006
Príspevky: 25
Zaslal: 2006-12-27 15:25
Návrat hore
Odpovedať s citátom
|
Thanks to Doug, it works perfect!
|
roland
Založený: 24.03.2006
Príspevky: 25
Zaslal: 2007-01-25 18:14
Návrat hore
Odpovedať s citátom
|
Hello all,
in this Thread (http://opensource.platon.sk/forum/projects/viewtopic.php?t=960), doug gave a good routine to make filters on the fly (see below).
I have build TWO Filterings ($FL2 and $FL3) in my definition-file. Both are working well, either FL2 OR FL3 - but now I want to combine them. What I mean, that $FL2 AND $FL3 will go into the WHERE-Clause. Is there a way to do that?
Thanks for your replies.
Roland.
| doug Napísal: |
I don't know if this will help. Perhaps you can create A HREF links at the bottom of the page to reload the page and create $opts['filters'] "on the fly". Also, create a link with no parameter that will clear the filter. I think the following example might give you some ideas.
Near top of form:
| Kód: |
$fl2 = array_key_exists('fl2', @$_REQUEST) ? strip_tags(stripslashes(trim(@$_REQUEST['fl2']))) : '';
if($fl2 > 0) {
$opts['cgi']['persist'] = array('fl2' => $fl2);
}
switch($fl2) {
Case 1:
$opts['filters'] = 'COUPLER = "1"'; // enter valid SQL
break;
Case 2:
$opts['filters'] = 'ADAPTER = "1"'; // enter valid SQL
break;
Case 3:
$opts['filters'] = 'STARTER = "1"'; // enter valid SQL
break;
Case 4:
$opts['filters'] = 'SADDLE = "1"'; // enter valid SQL
break;
Case 5:
$opts['filters'] = 'TEE = "1"'; // enter valid SQL
break;
Case 6:
$opts['filters'] = 'REDUCER = "1"'; // enter valid SQL
break;
Case 0:
default:
break;
} |
Near bottom of form:
| Kód: |
<?php if(empty($operation) && empty($morechange)) { ?>
Data Filters:<br>
<a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=1">Couplers</a><br>
<a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=2">Adapters</a><br>
<a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=3">Starters</a><br>
<a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=4">Saddles</a><br>
<a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=5">Tees</a><br>
<a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=6">Reducers</a><br>
<br><br><hr size="1">[V]iew<br>[C]hange<br>co[P]y<br>[D]elete
<?php }; ?> |
In the following code for version 5.6, here is how I determine the $operation variable near the top of the form (so that the links are only displayed in List mode):
| Kód: |
if(isset($_REQUEST['PME_sys_operation'])){
$operation = str_replace('PME_op_', '', $_REQUEST['PME_sys_operation']);
}elseif(isset($_REQUEST['PME_sys_morechange'])){
$operation = $_REQUEST['PME_sys_morechange']; // returns Apply
}elseif(isset($_REQUEST['PME_sys_moreadd'])){
$operation = $_REQUEST['PME_sys_moreadd']; // returns More
}elseif(isset($_REQUEST['PME_sys_savechange'])){
$operation = 'View';
}elseif(isset($opts['mfg_label_list_rec'])){
$operation = 'List Records';
} |
|
|
roland
Založený: 24.03.2006
Príspevky: 25
Zaslal: 2007-01-29 16:12
Návrat hore
Odpovedať s citátom
|
| doug Napísal: |
| Well, yes ... using some sort of if-then-else loop. Maybe you should post your existing filters. |
Hello Doug,
acutally, I have at the begin of my script:
| Kód: |
$fl2 = array_key_exists('fl2', @$_REQUEST) ? strip_tags(stripslashes(trim(@$_REQUEST['fl2']))) : '';
if($fl2 > 0) {
$opts['cgi']['persist'] = array('fl2' => $fl2);
}
switch($fl2) {
Case 1:
$opts['filters'] = 'stat_id = "1"'; // enter valid SQL
break;
Case 2:
$opts['filters'] = 'stat_id = "2"'; // enter valid SQL
break;
Case 3:
$opts['filters'] = 'stat_id = "3"'; // enter valid SQL
break;
Case 4:
$opts['filters'] = 'stat_id <> "4"'; // enter valid SQL
break;
Case 5:
$opts['filters'] = 'stat_id <> "5"'; // enter valid SQL
break;
Case 6:
$opts['filters'] = ''; // enter valid SQL
break;
Case 0:
default:
break;
}
//TEIL2 für ZWEITES Feld:
$fl3 = array_key_exists('fl3', @$_REQUEST) ? strip_tags(stripslashes(trim(@$_REQUEST['fl3']))) : '';
if($fl3 > 0) {
$opts['cgi']['persist'] = array('fl3' => $fl3);
}
switch($fl3) {
Case 1:
$opts['filters'] = 'projekte_id = "1"'; // enter valid SQL
break;
Case 2:
$opts['filters'] = 'projekte_id = "2"'; // enter valid SQL
break;
Case 3:
$opts['filters'] = 'projekte_id = "3"'; // enter valid SQL
break;
Case 4:
$opts['filters'] = ''; // enter valid SQL
break;
Case 0:
default:
break;
}
//Ende Testeinbau oben
|
Then, the normal field-definitions follows; after that, I have:
| Kód: |
// Now important call to phpMyEdit
require_once '../phpMyEdit.class.php';
new phpMyEdit($opts);
require_once('footer.inc.php');
//TESTeinbau unten beginn
if(empty($operation) && empty($morechange))
{
?>
<?php
};
//TESTeinbau unten ende
?>
|
The hrefs are in footer.inc.php:
| Kód: |
<ul id="navigation">
<li><a href="head.inc.php">ENDE</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=1">todo RK</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=2">todo del.</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=3">in Arbeit</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=4">n. erledigt</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=5">n. Idee</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=6">alle Stati</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl3=1">CB-Meeting</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl3=2">SuN-Meeting</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl3=3">PFAU-Meeting</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl3=4">alle Projekte</a></li>
</ul> |
|
roland
Založený: 24.03.2006
Príspevky: 25
Zaslal: 2007-02-01 18:04
Návrat hore
Odpovedať s citátom
|
Hello Doug,
in principal, your tip with dot/equal works.
But this implies, that I have to add the values in my a-href-section like this (see line with "in Arbeit":
| Kód: |
<ul id="navigation">
<li><a href="head.inc.php">ENDE</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=1">todo RK</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=2">todo del.</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=3&fl3=2">in Arbeit</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=4">n. erledigt</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=5">n. Idee</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=6">alle Stati</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl3=1">CB-Meeting</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl3=2">SuN-Meeting</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl3=3">PFAU-Meeting</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl3=4">alle Projekte</a></li>
</ul>
|
That means, for all possible combinations, I would need 24 a-hrefs.
I thought, I can select one of the fl2-values and one of the fl3-values, which finaly gives the string '?fl2=3&fl3=1' (example) to the script. Could it be done with 2 Pulldown-Menues (one for the fl2-Values, one for the FL3-values)?
Roland
|
roland
Založený: 24.03.2006
Príspevky: 25
Zaslal: 2008-08-06 09:10
Návrat hore
Odpovedať s citátom
|
Hello,
I want to continue this thread after long time...
Starting with the Post from Doug at 21.12.2006 16:40 - and all following entries - I have worked with this method of filtering serveral values (FL2 _and_ FL3) the whole time. But I ever have a small error - without real bad results; all is working, but now the error message become nerving me.
It is an Error in the Where-Statement of the SQL and says something like "and projekte_id='2'" is not a valid Where-Clause. This error normally occurs, when I edit a record und press the save button (but saving is OK).
This shows me, that obviously the Filter-String partly gets lost - normally is should be something like FL2=3&FL3=2 (which means that the variable Filter becomes: stat_id = "3" and projekte_id = "2".
First I thought, that the problem comes after the saving of the edited record, but now I have recognised, that FL2 is lost already, when I want to view, edit, copy or delete an entry in filtered List Mode. When I hold the Mouse on these buttons, I see in the Statusbar an entry like this: http://b634664.inetpsa.com/pme/task1/aufgaben.php?PME_sys_fl=0&PME_sys_fm=0&PME_sys_sfn[0]=0&&fl3=2&PME_sysoperation=PME_op_...
I guess, at the position of the &&, there should be &fl2=3&FL3=2.
But unfortunately my PHP-Knowledge is neary zero, so I need help from you to be able to fix this.
I hope somebody will be able to help
Roland
|
roland
Založený: 24.03.2006
Príspevky: 25
Zaslal: 2008-08-07 15:35
Návrat hore
Odpovedať s citátom
|
Hello,
does nobody has an idea?
Roland
|
roland
Založený: 24.03.2006
Príspevky: 25
Zaslal: 2008-08-11 16:56
Návrat hore
Odpovedať s citátom
|
Hello,
here is the complete script:
| Kód: |
-- aufgaben.php --
<?php
require_once('head.inc.php'); //sorgt dafür, dass obendrüber das PME-Menue geladen wird
require_once('config.inc.php'); //hier u.a. Verbindung zur Datenbank
include_once('..\dbug\dbug.php'); //hier event. das Debug-Tool dbug.php einbinden - aufruf später mit: new dbug('myvar')
?>
<h1>Aufgaben</h1>
<?php
require('footer_aufgaben.inc.php');
//EINBAU1 EIGENE FILTER (über Buttons) oben gemäß http://platon.sk/forum/projects/viewtopic.php?t=960
//Versuche mit Filter not= also <>
//weiterer Teil (mit den A HREFs ist in footer.inc.php !
//FL2 bzw. FL3 und FL4 sind Filter-Variablen, die definiert werden
//FL2 für die Filterung der Stati (erledigt, in Arbeit, etc.)
//FL3 zusätzlich zu FL2 nach CB, Sun und PFAU filtern Dazu müssen auch separate a-hrefs angelegt werden
//FL4 ist wie FL3, jedoch OHNE das "AND" in der Where-Klausel, um NUR CB, SuN, PFAU anzeigen zu können
//EINSCHRÄNKUNGEN!!!!!!!
// Bei Nutzung von fl2 & fl3 gibt es nach dem speichern einen SQL-Fehler (weil der Wert von fl2 verschwunden ist, und die Klausel mit 'and...' beginnt;
// hat aber keinerlei Einfluß auf die Funktion, Daten werden richtig gespeichert.
//Wenn der Kombifilter (also FL2 UND FL3 genutzt werden, erscheint beim Versuch, weitere Filter zu setzten oder Spalten zu sortieren, ein MySQL-Fehler!!
//Teil1 - FL2
$fl2 = array_key_exists('fl2', @$_REQUEST) ? strip_tags(stripslashes(trim(@$_REQUEST['fl2']))) : '';
if($fl2 > 0) {
$opts['cgi']['persist'] = array('fl2' => $fl2);
}
//echotest
//echo 'Z29 $fl2 = fl2 !\ n';
echo "Z29 fl2 = $fl2\n";
echo "--ende echotest1--";
//echotest ende
switch($fl2) {
Case 1:
$opts['filters'] = 'stat_id = "1"'; // enter valid SQL
break;
Case 2:
$opts['filters'] = 'stat_id = "2"'; // enter valid SQL
break;
Case 3:
$opts['filters'] = 'stat_id = "3"'; // enter valid SQL
break;
Case 4:
$opts['filters'] = 'stat_id <> "4"'; // enter valid SQL
break;
Case 5:
$opts['filters'] = 'stat_id <> "5"'; // enter valid SQL
break;
Case 6:
$opts['filters'] = ''; // enter valid SQL
break;
Case 0:
default:
break;
}
//Teil2 - FL3
$fl3 = array_key_exists('fl3', @$_REQUEST) ? strip_tags(stripslashes(trim(@$_REQUEST['fl3']))) : '';
if($fl3 > 0) {
$opts['cgi']['persist'] = array('fl3' => $fl3);
}
switch($fl3) {
Case 1:
$opts['filters'] .= ' and projekte_id = "1"'; // enter valid SQL
break;
Case 2:
$opts['filters'] .= ' and projekte_id = "2"'; // enter valid SQL
break;
Case 3:
$opts['filters'] .= ' and projekte_id = "3"'; // enter valid SQL
break;
Case 4:
$opts['filters'] = ''; // enter valid SQL
break;
Case 0:
default:
break;
}
//Teil3 - FL4
$fl4 = array_key_exists('fl4', @$_REQUEST) ? strip_tags(stripslashes(trim(@$_REQUEST['fl4']))) : '';
if($fl4 > 0) {
$opts['cgi']['persist'] = array('fl4' => $fl4);
}
switch($fl4) {
Case 1:
$opts['filters'] .= ' projekte_id = "1"'; // enter valid SQL
break;
Case 2:
$opts['filters'] .= ' projekte_id = "2"'; // enter valid SQL
break;
Case 3:
$opts['filters'] .= ' projekte_id = "3"'; // enter valid SQL
break;
Case 4:
$opts['filters'] = ''; // enter valid SQL
break;
Case 0:
default:
break;
}
//Ende Einbau1 oben
//Testeinbau Rest auf Forumsthreat 960
if(isset($_REQUEST['PME_sys_operation'])){
$operation = str_replace('PME_op_', '', $_REQUEST['PME_sys_operation']);
}elseif(isset($_REQUEST['PME_sys_morechange'])){
$operation = $_REQUEST['PME_sys_morechange']; // returns Apply
}elseif(isset($_REQUEST['PME_sys_moreadd'])){
$operation = $_REQUEST['PME_sys_moreadd']; // returns More
}elseif(isset($_REQUEST['PME_sys_savechange'])){
$operation = 'View';
}elseif(isset($opts['mfg_label_list_rec'])){
$operation = 'List Records';
}
//Ende Testeinbau Rest auf Forumsthreat 960
//echotest
//echo 'Z29 $fl2 = fl2 !\ n';
echo "Z108 fl2 = $fl2\n";
echo "Z108 fl3 = $fl3\n";
echo $opts['filters'];
echo $parts['where'];
echo "--ende echotest2--";
//echotest ende
/*
* IMPORTANT NOTE: This generated file contains only a subset of huge amount
* of options that can be used with phpMyEdit. To get information about all
* features offered by phpMyEdit, check official documentation. It is available
* online and also for download on phpMyEdit project management page:
*
* http://www.platon.sk/projects/main_page.php?project_id=5
*/
$opts['tb'] = 'aufgaben';
// Name of field which is the unique key
$opts['key'] = 'aufgaben_id';
// Type of key field (int/real/string/date etc.)
$opts['key_type'] = 'int';
// Sorting field(s)
$opts['sort_field'] = array('aufgaben_id');
// Number of records to display on the screen
// Value of -1 lists all records in a table
$opts['inc'] = -1;
// Number of lines to display on multiple selection filters
$opts['multiple'] = '2';
/* Table-level filter capability. If set, it is included in the WHERE clause
of any generated SELECT statement in SQL query. This gives you ability to
work only with subset of data from table.
$opts['filters'] = "column1 like '%11%' AND column2<17";
$opts['filters'] = "section_id = 9";
$opts['filters'] = "PMEtable0.sessions_count > 200";
*/
// Ausblenden aller ERLEDIGTEN Aufgaben (stat_id = 4)
// ************************ $opts['filters'] = "stat_id <> 4";
/* Field definitions
Fields will be displayed left to right on the screen in the order in which they
appear in generated list. Here are some most used field options documented.
['name'] is the title used for column headings, etc.;
['maxlen'] maximum length to display add/edit/search input boxes
['trimlen'] maximum length of string content to display in row listing
['width'] is an optional display width specification for the column
e.g. ['width'] = '100px';
['mask'] a string that is used by sprintf() to format field output
['sort'] true or false; means the users may sort the display on this column
['strip_tags'] true or false; whether to strip tags from content
['nowrap'] true or false; whether this field should get a NOWRAP
['required'] true or false; if generate javascript to prevent null entries
['select'] T - text, N - numeric, D - drop-down, M - multiple selection
['options'] optional parameter to control whether a field is displayed
L - list, F - filter, A - add, C - change, P - copy, D - delete, V - view
Another flags are:
R - indicates that a field is read only
W - indicates that a field is a password field
H - indicates that a field is to be hidden and marked as hidden
['URL'] is used to make a field 'clickable' in the display
e.g.: 'mailto:$value', 'http://$value' or '$page?stuff';
['URLtarget'] HTML target link specification (for example: _blank)
['textarea']['rows'] and/or ['textarea']['cols']
specifies a textarea is to be used to give multi-line input
e.g. ['textarea']['rows'] = 5; ['textarea']['cols'] = 10
['values'] restricts user input to the specified constants,
e.g. ['values'] = array('A','B','C') or ['values'] = range(1,99)
['values']['table'] and ['values']['column'] restricts user input
to the values found in the specified column of another table
['values']['description'] = 'desc_column'
The optional ['values']['description'] field allows the value(s) displayed
to the user to be different to those in the ['values']['column'] field.
This is useful for giving more meaning to column values. Multiple
descriptions fields are also possible. Check documentation for this.
*/
$opts['fdd']['aufgaben_id'] = array(
'name' => 'ID',
'select' => 'T',
'options' => 'AVCPDRL', // auto increment
'maxlen' => 3,
'default' => '0',
'sort' => true
);
$opts['fdd']['ma_id'] = array(
'name' => 'Ma',
'select' => 'N',
'maxlen' => 5,
'nowrap' => true,
'default' => '10', //sonstige Mitarbeiter
'required' => false,
'sort' => true,
'values' => array(
'table' => 'mitarbeiter',
'column' => 'mitarbeiter_id',
'description' => 'MA'
)
);
$opts['fdd']['aufgaben_datum'] = array(
'name' => 'Datum',
'select' => 'N',
'maxlen' => 10,
'nowrap' => true,
'default' => date('Y-m-d'),
'required' => true,
'sort' => true
);
/*
//Dieses Feld ist nicht in Benutzung
$opts['fdd']['aufgaben_stunden'] = array(
'name' => 'Stunden',
'select' => 'T',
'maxlen' => 5,
'default' => '0.00',
'required' => true,
'sort' => true,
'sql' => 'REPLACE(aufgaben_stunden,"." , ",")',
'sqlw' => 'REPLACE($val_qas,"," , ".")'
);
*/
//PD-Feld bei Add/Edit/Suche für Kategorie
$opts['fdd']['kat_id'] = array(
'name' => 'Kategorie',
'select' => 'D',
'maxlen' => 11,
'nowrap' => true,
'default' => '5', //delegieren
'options' => 'ACFL',
'required' => false,
'sort' => true,
'values' => array(
'table' => 'kategorien',
'column' => 'kategorien_id',
'description' => 'kategorien_name'
)
);
//PD-Feld bei Add/Edit/Suche für Projekte
$opts['fdd']['pro_id'] = array (
'name' => 'Projekt',
'options' => 'ACFL',
'nowrap' => true,
'select' => 'D', //bestimmt, ob das Filterfeld ein PD-feld ist oder ein Textfeld
'sort' => true,
'default' => '2', //SuN-Meeting
'values' => array( //Lookup in projekte
'table' => 'projekte',
'column' => 'projekte_id',
'description' => 'projekte_name'
)
);
//PD-Feld bei Add/Edit/Suche für Status
$opts['fdd']['stat_id'] = array(
'name' => 'Status',
'options' => 'ACFL',
'select' => 'D',
'maxlen' => 11,
'nowrap' => true,
'default' => '2', //Todo delegieren
'required' => false,
'sort' => true,
'values' => array(
'table' => 'status',
'column' => 'status_id',
'description' => 'status'
)
);
$opts['fdd']['aufgaben_taetigkeit'] = array(
'name' => 'Tätigkeit',
'select' => 'T',
// 'trimlen' => 60,
'maxlen' => 255,
'required' => true,
'sort' => true,
'textarea' => array(
'rows' => 1,
'cols' => 25
)
);
$opts['fdd']['aufgaben_H'] = array(
'name' => 'Hidden',
'select' => 'T',
// 'trimlen' => 60,
'maxlen' => 255,
'required' => false,
'sort' => true,
'textarea' => array(
'rows' => 1,
'cols' => 25
)
);
$opts['fdd']['aufgaben_printflag'] = array(
'name' => 'P',
'select' => 'N',
// 'trimlen' => 60,
'maxlen' => 1,
'required' => false,
'sort' => true,
);
$opts['fdd']['aufgaben_enddatum'] = array(
'name' => 'Enddatum',
'select' => 'N',
'maxlen' => 10,
'nowrap' => true,
//'default' => date('Y-m-d'),
'required' => false,
'sort' => true
);
// Now important call to phpMyEdit
require_once '../phpMyEdit.class.php';
new phpMyEdit($opts);
new dbug($opts);
//echotest
//echo 'Z29 $fl2 = fl2 !\ n';
echo "Z348 fl2 = $fl2\n";
echo "Z348 fl3 = $fl3\n";
echo $opts['filters'];
echo $parts['where'];
echo "--ende echotest3--";
//echotest ende
//require('footer_aufgaben.inc.php'); //testweise ausgeschaltet
//Einbau1 unten beginn (Gehört zu den FILTERN FL2, FL3, FL4 ...
if(empty($operation) && empty($morechange))
{
?>
<?php
};
//Einbau1 unten ende
?>
------------------------------
-- config.inc.php --
<?php
// MySQL host name, user name, password, database, and table
$opts['hn'] = 'localhost'; // host
$opts['un'] = 'root'; // username
$opts['pw'] = 'gozilla'; // password
$opts['db'] = 'pme_task1'; // database name
// Navigation style: B - buttons (default), T - text links, G - graphic links
// Buttons position: U - up, D - down (default)
$opts['navigation'] = 'UDG';
// Display special page elements
$opts['display'] = array(
'form' => true,
'query' => true,
'sort' => false,
'time' => false,
'tabs' => true
);
/* Get the user's default language and use it if possible or you can
specify particular one you want to use. Refer to official documentation
for list of available languages. */
$opts['language'] = $HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE'];
// Options you wish to give the users
// A - add, C - change, P - copy, V - view, D - delete,
// F - filter, I - initial sort suppressed
$opts['options'] = 'ACPVDF';
//Debug-Modus setzen (0=aus, 1=ein=
$debug_query = 0;
// From script header
if($_SERVER['REQUEST_METHOD'] == 'POST'){
function http_post_files_to_post_vars($files = null)
{
if ($files === null) { $files = $_FILES; }
global $HTTP_POST_VARS;
foreach ($files as $key => $ar) {
$value = $ar['name'];
$_POST[$key] = $value;
$HTTP_POST_VARS[$key] = $value;
}
};
@http_post_files_to_post_vars();
foreach($_FILES as $key => $val){
if(is_array($val)){
foreach (array_keys($val) as $key){
$val[$key] = stripslashes($val[$key]);
}
}
}
}
?>
----------------------------------
-- head.inc.php --
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<!-- <style type="text/css">
@import url(PME_Task_std.css);
</style>-->
<link rel="stylesheet"type="text/css" media="screen" href="../CSS/PME_Task_std.css">
</head>
<body>
<div id="header"><!--<img src="images/logo.gif" alt="PHP Usergroup Frankfurt am Main" />--></div>
<ul id="navigation">
<li><a href="aufgaben.php">Aufgaben</a></li>
<li><a href="aufgaben_kurz.php">Aufgaben Kurz</a></li>
<li><a href="projekte.php">Projekte</a></li>
<li><a href="kategorien.php">Kategorien</a></li>
<li><a href="kunden.php">Kunden</a></li>
<li><a href="mitarbeiter.php">Mitarbeiter</a></li>
<li><a href="status.php">Status</a></li>
<li><a href="../../index.html">BEENDEN</a></li>
</ul>
<?php
// greift nicht mehr, weil footer.inc.php jetzt OBEN am Start aufgerufen wird (in aufgaben.php)
//require_once('footer.inc.php');
//TESTeinbau unten ende
?>
----------------------------
-- footer_aufgaben.inc.php --
<!--<p id="footer">PHPUGFFM Workshop am 12.01.2005, <a href="phpmyedit.org">PHPmyEdit</a></p>-->
<!--<br>-->
<ul id="navigation">
<li><a href="head.inc.php">ENDE</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=1">TODO RK</a>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=1 & fl3=1">C</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=1 & fl3=2">S</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=1 & fl3=3">A</a></li>
</li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=2">TODO DEL.</a>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=2 & fl3=1">C</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=2 & fl3=2">S</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=2 & fl3=3">A</a></li>
</li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=3">IN ARBEIT</a>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=3 & fl3=1">C</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=3 & fl3=2">S</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=3 & fl3=3">A</a></li>
</li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=4">N. ERL.</a>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=4 & fl3=1">C</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=4 & fl3=2">S</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=4 & fl3=3">A</a></li>
</li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=5">N. IDEE</a>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=5 & fl3=1">C</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=5 & fl3=2">S</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=5 & fl3=3">A</a></li>
</li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl2=6">ALLE STATI</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl4=1">C</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl4=2">S</a></li>
<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl4=3">A</a></li>
<!--<li><a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?fl4=4">a</a></li>-->
</ul>
<!--<br><br><p id="footer"> - - - - </a></p>-->
</body>
</html>
----------------------------
|
|
roland
Založený: 24.03.2006
Príspevky: 25
Zaslal: 2008-08-12 13:55
Návrat hore
Odpovedať s citátom
|
Hello,
thanks for you comments.
I tried to suppress the blanks -> fl2=4&fl3=1, but this doesn't help, like you expected.
Here is the result of you debug-script (it does the same like the "new dbug($opts);", which I found in the web):
| Kód: |
$opts
Array
(
[hn] => localhost
[un] => root
[pw] => gozilla
[db] => pme_task1
[navigation] => UDG
[display] => Array
(
[form] => 1
[query] => 1
[sort] =>
[time] =>
[tabs] => 1
)
[language] => de
[options] => ACPVDF
[cgi] => Array
(
[persist] => Array
(
[fl3] => 1
)
)
[filters] => stat_id <> "4" and projekte_id = "1"
[tb] => aufgaben
[key] => aufgaben_id
[key_type] => int
[sort_field] => Array
(
[0] => aufgaben_id
)
[inc] => -1
[multiple] => 2
[fdd] => Array
(
[aufgaben_id] => Array
(
[name] => ID
[select] => T
[options] => AVCPDRL
[maxlen] => 3
[default] => 0
[sort] => 1
)
[ma_id] => Array
(
[name] => Ma
[select] => N
[maxlen] => 5
[nowrap] => 1
[default] => 10
[required] =>
[sort] => 1
[values] => Array
(
[table] => mitarbeiter
[column] => mitarbeiter_id
[description] => MA
)
)
[aufgaben_datum] => Array
(
[name] => Datum
[select] => N
[maxlen] => 10
[nowrap] => 1
[default] => 2008-08-12
[required] => 1
[sort] => 1
)
[kat_id] => Array
(
[name] => Kategorie
[select] => D
[maxlen] => 11
[nowrap] => 1
[default] => 5
[options] => ACFL
[required] =>
[sort] => 1
[values] => Array
(
[table] => kategorien
[column] => kategorien_id
[description] => kategorien_name
)
)
[pro_id] => Array
(
[name] => Projekt
[options] => ACFL
[nowrap] => 1
[select] => D
[sort] => 1
[default] => 2
[values] => Array
(
[table] => projekte
[column] => projekte_id
[description] => projekte_name
)
)
[stat_id] => Array
(
[name] => Status
[options] => ACFL
[select] => D
[maxlen] => 11
[nowrap] => 1
[default] => 2
[required] =>
[sort] => 1
[values] => Array
(
[table] => status
[column] => status_id
[description] => status
)
)
[aufgaben_taetigkeit] => Array
(
[name] => Tätigkeit
[select] => T
[maxlen] => 255
[required] => 1
[sort] => 1
[textarea] => Array
(
[rows] => 1
[cols] => 25
)
)
[aufgaben_H] => Array
(
[name] => Hidden
[select] => T
[maxlen] => 255
[required] =>
[sort] => 1
[textarea] => Array
(
[rows] => 1
[cols] => 25
)
)
[aufgaben_printflag] => Array
(
[name] => P
[select] => N
[maxlen] => 1
[required] =>
[sort] => 1
)
[aufgaben_enddatum] => Array
(
[name] => Enddatum
[select] => N
[maxlen] => 10
[nowrap] => 1
[required] =>
[sort] => 1
)
)
)
|
It shows, that the variable fl2 just "disappears" in the persist-array, while the content of the filter-variable is correct.
Can it be, that in the section switch($fl3) is something wrong and the fl2 will be ignored?
Or can it be that in this part
| Kód: |
if($fl3 > 0) {
$opts['cgi']['persist'] = array('fl3' => $fl3);
}
|
must be determined, if fl2 has a value?
Or should there needed a modification in phpMyEdit.class.php to enable, that there TWO variables must be handled?
I thank you for any tip
Roland
|
roland
Založený: 24.03.2006
Príspevky: 25
Zaslal: 2008-08-12 16:17
Návrat hore
Odpovedať s citátom
|
Hello Doug,
you are great!!
so it seems to works fine:
| Kód: |
$opts['cgi']['persist'] = array(
'fl2' => $fl2,
'fl3' => $fl3,
'fl4' => $fl4
);
|
Many Thanks
Roland
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|
|