This topic is locked

date ??????

4/6/2009 9:56:21 AM
PHPRunner General questions
A
all3ssaf author

I have a table that has a (user_id) field and a (date) field
If the date is two days after the enterd date shall be view red color
======
Can I look for the late date only (red) in the search box !!!!??

A
all3ssaf author 4/7/2009
M
mmponline 4/7/2009

Not sure if thios will help. I use it to turn dtae to red when it for example reach tody. Thus overdue. If you play around with the -1 in the if row, you should be able to set when or how to turn to red - future and past using + or - certain days.
Add this snippet in custom on the specific field in visual editor.

if($value)

{

// split $value to array

$arr = db2time($value);

// construct time

$t = mktime($arr[3],$arr[4],$arr[5],$arr[1],$arr[2],$arr[0]);

// compare time with current time subtracted by 1 days

if($t < time()-1*60*60*24)

$value = "<font color=red>".$value."</font>";

}


I pre-format my date to green and it then turns red on date reached.
Hoep this will work for you. It works great for me in both v4, 5 and 5.1
Regards

A
all3ssaf author 4/9/2009

?? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=39982&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />


ok <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=39982&image=2&table=forumreplies' class='bbc_emoticon' alt=':)' />
Can I look for the only (red) in the search box !!!!??

J
Jane 4/9/2009

Hi,
I'm not sure that I understand your question.

Do you want to filter records in the search suggest popup or filter records on the main list?

A
all3ssaf author 4/9/2009

Hi,

I'm not sure that I understand your question.

Do you want to filter records in the search suggest popup or filter records on the main list?


yes i want to filter records in the search , Only the red Result Show <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=40012&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' /> ?????

J
Jane 4/10/2009

Hi,
to filter records on the list page edit SQL query on the Edit SQL query tab.

To filter records in the search suggest popup edit generated..._searchsuggest.php file manually.

A
all3ssaf author 4/10/2009

Hi,

to filter records on the list page edit SQL query on the Edit SQL query tab.

To filter records in the search suggest popup edit generated..._searchsuggest.php file manually.


Good I do this on the list page
if($value)

{

// split $value to array

$arr = db2time($value);

// construct time

$t = mktime($arr[3],$arr[4],$arr[5],$arr[1],$arr[2],$arr[0]);

// compare time with current time subtracted by 1 days

if($t < time()-16060*24)

$value = "<font color=red>".$value."</font>";

}
Now I want to filter records on Another View page i Will edit SQL query on the Edit SQL query I want Only (red) result <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=40031&image=1&table=forumreplies' class='bbc_emoticon' alt=':unsure:' />

What is the code

A
all3ssaf author 4/13/2009



Good I do this on the list page
if($value)

{

// split $value to array

$arr = db2time($value);

// construct time

$t = mktime($arr[3],$arr[4],$arr[5],$arr[1],$arr[2],$arr[0]);

// compare time with current time subtracted by 1 days

if($t < time()-16060*24)

$value = "<font color=red>".$value."</font>";

}
Now I want to filter records on Another View page i Will edit SQL query on the Edit SQL query I want Only (red) result <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=40102&image=1&table=forumreplies' class='bbc_emoticon' alt=':unsure:' />

What is the code


????

J
Jane 4/14/2009

Hi,
use MySQL functions in your SQL query:

http://dev.mysql.com/doc/refman/5.0/en/dat...-functions.html
Here is just a sample:

WHERE DateDiff(now(), FieldName)<1

A
all3ssaf author 4/15/2009

Hi,

use MySQL functions in your SQL query:

http://dev.mysql.com/doc/refman/5.0/en/dat...-functions.html
Here is just a sample:


ok this is my SQL
-------------------
SELECT

table1.BARCODE,

table1.ID,

table1.'DATE

'out'.'DATE' AS DATE1,

'out'.VID,

FROM table1

LEFT OUTER JOIN 'out' ON table1.ID = 'out'.VID
-------------------
i want to filter records
() IS Empty
([color="#0000FF"]BARCODE) NOT Show if the (
([color="#0000FF"]BARCODE) NOT Show if the DATE1) IS NOT Empty

J
Jane 4/16/2009

Hi,
unfortunately it's impossible to add/remove fields in SQL query based on the WHERE clause.

If you want to not show BARCODE value on the list/view pages use custom format on the "View as" settings dialog on the Visual Editor tab.