Changeset 914 for trunk/Modules/IS/IS.php
- Timestamp:
- Sep 22, 2021, 10:34:30 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/IS/IS.php
r912 r914 549 549 } 550 550 551 function GetParam(string $Name, string $Default): string 552 { 553 $Result = $Default; 554 if (array_key_exists($Name, $_POST) and ($_POST[$Name] != '')) 555 { 556 $Result = $_POST[$Name]; 557 } 558 if (array_key_exists($Name, $_GET) and ($_GET[$Name] != '')) 559 { 560 $Result = $_GET[$Name]; 561 } 562 return $Result; 563 } 564 551 565 function ShowTable(string $Table, string $Filter = '', string $Title = '', string $RowActions = '', string $ExcludeColumn = ''): string 552 566 { … … 604 618 $FilterName = $this->System->FormManager->Type->ExecuteTypeEvent($UseType, 'OnFilterName', 605 619 array('Name' => $ItemIndex, 'Type' => $FormItem['Type'])); 606 if (array_key_exists('Filter'.$ItemIndex, $_POST) and ($_POST['Filter'.$ItemIndex] != '')) 620 621 $SqlOperator = array( 622 'like' => 'LIKE', 623 'notlike' => 'NOT LIKE', 624 'equal' => '=', 625 'notequal' => '!=', 626 'less' => '<', 627 'lessorequal' => '<=', 628 'greater' => '>', 629 'greaterorequal' => '>=', 630 'isnull' => 'IS NULL', 631 'isnotnull' => 'IS NOT NULL', 632 ); 633 $Operator = $this->GetParam('FilterOp'.$ItemIndex, 'like'); 634 if (array_key_exists($Operator, $SqlOperator)) 635 { 636 $OperatorSql = $SqlOperator[$Operator]; 637 } else $OperatorSql = $SqlOperator['like']; 638 639 $FilterValue = $this->GetParam('Filter'.$ItemIndex, ''); 640 if ($FilterValue != '') 607 641 { 608 642 if ($UserFilter != '') $UserFilter .= ' AND '; 609 $UserFilter .= '('.$FilterName.' LIKE "%'.$_POST['Filter'.$ItemIndex].'%")'; 643 $UserFilter .= '('.$FilterName.' '.$OperatorSql; 644 if (($Operator == 'like') or ($Operator == 'notlike')) $UserFilter .= ' "%'.$FilterValue.'%")'; 645 else if (($Operator == 'isnull') or ($Operator == 'isnotnull')) $UserFilter .= ')'; 646 else $UserFilter .= ' "'.$FilterValue.'")'; 610 647 } 611 648 } 612 649 } 650 echo($UserFilter); 613 651 if ($UserFilter != '') 614 652 {
Note:
See TracChangeset
for help on using the changeset viewer.