Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Thursday, March 28, 2024
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Example: persistent filters passed by A HREF links

phpMyEdit General     Example: persistent filters passed by A HREF links
Post new topic   Reply to topic   Goto page 1, 2, 3 ... 95, 96, 97  Next  
 
krausr     Joined: 09 Mar 2004   Posts: 1  
Post Posted: 2004-03-09 18:26
Back to top  Reply with quote     

I tried adapting this example like this:

$BoxID = @$_GET['BoxID'];

if(!isset($BoxID)) {
$BoxID = @$_POST['BoxID'];
}

$opts['cgi']['persist'] = array('BoxID' => $BoxID);
.
.
.
$opts['filters'] = "BoxID = '".$BoxID."'";

From the main page listing I click on the column labled BoxID via the URL feature with the url ending "...php?BoxID=00-151". My call to the next list page boxcontent.php produces the expected list, but when I edit or add to the list I get a script error. The debugger has a problem here...

function phpMyEdit_trim(str)
{
while (str.substring(0, 1) == " "
|| str.substring(0, 1) == "\n"
|| str.substring(0, 1) == "\r") <=====****
{
str = str.substring(1, str.length);


Any suggestions?

 
markcrobinson     Joined: 05 Oct 2004   Posts: 6  
Post Posted: 2004-10-09 00:11
Back to top  Reply with quote     

I call my form passina a state variable:
http://www.handicappedpets.com/cgi-bin/phpedit/vcontacts.php?state=CA
Works great, but after I view a record, the filter gets lost.
Is there a good way to maintain the filter?

 
bentuinstra     Joined: 12 Sep 2004   Posts: 29  
Post Posted: 2005-02-03 10:24
Back to top  Reply with quote     

Great example,

I now use this code but after I do an add or view It looses it's "persistent" filtering, and I don't see any record.

Any Ideas?

Code:
$x_user = @$_GET['x_user'];

if(!isset($x_user)) {
   $x_user = @$_POST['x_user'];
}
if($x_user > 0) {
    $opts['cgi']['persist'] = array('x_user' => $x_user);
}

switch($x_user){
   Case $x_user:
      $opts['filters'] = "PMEtable0.RESPONS = '$x_user' AND PMEtable0.STATUS = 'PENDING'";
       $responsable = $x_user;
      break;
   Case 0: // falls through to default
      default:
      break;
}


 
bentuinstra     Joined: 12 Sep 2004   Posts: 29  
Post Posted: 2005-02-11 08:55
Back to top  Reply with quote     

Hi Doug,

I've still one problem left, everything works fine untill I try to use this:

Code:
case Ben Tuinstra:


instead of:

Code:
Case 1:


It seems that the code has problems with a two part case name. I've tried all of these:

Code:
Case 'Ben Tuinstra':

case "Ben Tuinstra":

Case `Ben Tuinstra`:

Case 'Ben%20Tuinstra':


But nothing seems to works, If I could get this to work I could use WebGUI as my login manager and send the name of the logged in user to PME.

Any help highly appricated,

Cheers Ben

 
bentuinstra     Joined: 12 Sep 2004   Posts: 29  
Post Posted: 2005-02-14 08:56
Back to top  Reply with quote     

Hi Doug,

Ofcourse you are the expert, but to me it seems that the problem is not in the database. It seems to be in the case statement.

If I use:

Code:
Case 1:


works fine,

But

Code:
Case Ben Tuinstra:


Or all the versions I mentioned in my previous post don't.

It seems that the case statement or any other command in this construction doesn't like a case with a variable in two words.

But since you insist, I'll post here the database I'm working with.

Code:
#
# Table structure for table `trackit`
#

CREATE TABLE trackit (
  WO_NUM int(11) NOT NULL auto_increment,
  TASK varchar(50) default NULL,
  TYPE varchar(25) default NULL,
  REQUEST varchar(15) default NULL,
  REQDATE date default NULL,
  OPENBY varchar(15) default NULL,
  OPENDATE date default NULL,
  MODYBY varchar(15) default NULL,
  TIMESTAMP timestamp(14) NOT NULL,
  CLOSEDBY varchar(15) default NULL,
  CLOSEDATE date default NULL,
  ELAPSETIME time default NULL,
  ELAPSEMIN int(11) default NULL,
  PRIORITY varchar(15) default NULL,
  DUEDATE date default NULL,
  RESPONS varchar(15) default NULL,
  ASSIGNDATE date default NULL,
  COMPLETED date default NULL,
  HOURS int(15) default NULL,
  RATE decimal(10,2) default NULL,
  CHARGE varchar(15) default NULL,
  WS-NUM varchar(15) default NULL,
  DEPT_NUM int(11) default NULL,
  DEPARTMENT varchar(15) default NULL,
  PHONE varchar(15) default NULL,
  PHONE_EXT varchar(30) default NULL,
  LOCATION varchar(15) default NULL,
  DESCRIPTION longtext,
  WO_TEXT1 varchar(50) default NULL,
  WO_TEXT2 varchar(50) default NULL,
  WO_TEXT3 varchar(50) default NULL,
  WO_TEXT4 varchar(50) default NULL,
  WO_TEXT5 varchar(50) default NULL,
  WO_TEXT6 varchar(50) default NULL,
  WO_DATE1 date default NULL,
  WO_DATE2 date default NULL,
  WO_NUM1 int(11) default NULL,
  WO_INT1 int(11) default NULL,
  NOTE longtext,
  FT set('ONWAAR','WAAR') default NULL,
  COMPFLAG varchar(15) default NULL,
  STATUS set('PENDING','COMPLETED','DEFAULT','OVERDUE') default NULL,
  AGENTDATE date default NULL,
  AGENTLEVEL varchar(15) default NULL,
  AWS_NUM varchar(15) default NULL,
  APPLICATION varchar(25) default NULL,
  PRECEDER int(11) default NULL,
  PRIMARY KEY  (WO_NUM)
) TYPE=MyISAM AUTO_INCREMENT=399 ;


 
bentuinstra     Joined: 12 Sep 2004   Posts: 29  
Post Posted: 2005-02-14 15:00
Back to top  Reply with quote     

Hi Doug,

I didn't give you the complete story. Since this whole topic is about persistent filtering and there is a good example given in the first post, I took the whole basic thing (given in the first post) as basis for my reply.

Ofcourse I use the whole construction to read the user from the url line. When I try to test with "Ben Tuinstra" I put an ?xfl=Ben Tuinstra
after the url. So I pass the parameter to the php script.

The only problem I encounter is that when I use the whole construction with a name instead of a number. It seems that the parameter is only read good the first time you open the page. When you do a sort or a search then you lose the presistent filtering.

So to make this post as short as possible I removed all the obvious information. Sorry for that.

But to be complete, Let's say I open the script with this url:

Code:
<a href="mypets.php?xfl=Ben Tuinstra">All Pets</a>


And I have this in my code:
Code:

$xfl = @$_GET['xfl'];

if(!isset($xfl)) {
   $xfl = @$_POST['xfl'];
}

if($xfl > 0) {
   $opts['cgi']['persist'] = array('xfl' => $xfl);
}

switch($xfl){
   Case 'Ben Tuinstra':
      $opts['filters'] = 'PetType = "dog"';
      break;
   Case 2:
      $opts['filters'] = 'PetType = "cat"';
      break;
   Case 3:
      $opts['filters'] = 'PetType = "hamster"';
      break;
   Case 0: // falls through to default
   default:
      break;
}


It workst the first time I read the page, then when I want to do something in the page It looses it's persisting filtering. It seems not able to remember a xfl variable that consists of tho words even if they are enquoted.

Do you have any idea what could be wrong?

Kind regards Ben

 
bentuinstra     Joined: 12 Sep 2004   Posts: 29  
Post Posted: 2005-02-14 19:31
Back to top  Reply with quote     

Thanks Doug!

This seems to be the problem, thank you very much for your help. I'll test it tomorrow since I'm at home it's evening overhear. This would be really nice if this will do the job.

Thanks again, I will post a reply when I know if it works,

Ben

 
fotso     Joined: 20 Sep 2019   Posts: 2  
Post Posted: 2019-09-20 12:56
Back to top  Reply with quote     

This seems to be the problem, thank you very much for your help. I'll test it tomorrow since I'm at home it's evening overhear . This would be really nice if this will do the job.

Thanks again, I will post a reply when I know if it works,

 
jonelily954     Joined: 23 Sep 2019   Posts: 2  
Post Posted: 2019-09-23 13:33
Back to top  Reply with quote     

Thanks for sharing this marvelous post. I m very pleased to read this article.

mcafee.com/activate - Get started with McAfee Security. Step 1. Enter your code Step 2. Log in; Get protected Step 3. Enter your 25-digit activation code. Go for more mcafee.com/activate and mcafee.com/activate .
Setup Norton from norton.com/setup by entering 25 digits activation key. Visit norton.com/setup for downloading, installing and activating the best security products of Norton on your device.

office.com/setup - To get started with Microsoft Office download &amp; install office.com/setup . Find the product key for activation at office.com/setup .

 
fotso1234     Joined: 28 Sep 2019   Posts: 1  
Post Posted: 2019-09-28 17:23
Back to top  Reply with quote     

This seems to be the problem, thank you very much for your help. I'll test it tomorrow since I'm at home it's evening overhear . This would be really nice if this will do the job.

Thanks again, I will post a reply when I know if it works,

 
igeeksquad123     Joined: 18 Oct 2019   Posts: 8  
Post Posted: 2019-10-18 22:22
Back to top  Reply with quote     

geek squad tech support is one of the leading company for each office and enterprise shoppers. geek squad chat offer you services from the expertise and experienced professionals. Our specialists promise you to deliver fast, economical and efficient facilities for all of your digital and technology-based issues. geek squad chat with an agent See sample of current Geek Squad Protection Terms and Conditions for specific coverage and exclusions. Power surges can happen at any time, causing damage to your equipment. geek squad chat Most manufacturers&#8217; warranties don&#8217;t cover power surges, but with Geek Squad Protection, you don&#8217;t have to worry. geek squad appointment

 
ryansmith030     Joined: 22 Oct 2019   Posts: 1  
Post Posted: 2019-10-22 05:16
Back to top  Reply with quote     

McAfee antivirus gives the best security. It is one of the most trusted antivirus protection, and it guarantees to remove the 100% viruses. mcafee antivirus is the single defense program that fights with the viruses, malware, ransomware, spyware, unwanted programs, hackers and more to keep your device and data safe and secure.

mcafee.com/activate | office.com/setup | mcafee.com/activate | office.com/setup | mcafee.com/activate | mcafee.com/activate

 
williamlaxmi050     Joined: 12 Nov 2019   Posts: 1  
Post Posted: 2019-11-17 10:54
Back to top  Reply with quote     

geek squad appointment |
best buy geek squad appointment |
geek squad appointment scheduling |
schedule a geek squad appointment online |
schedule geek squad appointment |
geek squad in home appointment |

 
rostant     Joined: 23 Nov 2019   Posts: 1  
Post Posted: 2019-11-23 17:32
Back to top  Reply with quote     

This seems to be the problem, thank you very much for your help. I'll test it tomorrow since I'm at home it's evening overhear . This would be really nice if this will do the job.

Thanks again, I will post a reply when I know if it works,

 
pronosoft     Joined: 25 Dec 2019   Posts: 1  
Post Posted: 2019-12-25 18:33
Back to top  Reply with quote     

Hi Doug,

I've still one problem left, everything works fine untill I try to use this:

 
Post new topic   Reply to topic   Goto page 1, 2, 3 ... 95, 96, 97  Next  

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy