This topic is locked

14 Days Job Timeout

2/14/2008 1:59:47 AM
PHPRunner General questions
S
swanside author

Hello.

My database as this table in it select job.`Order_Date`,

job.`File_No`,

job.`Job_No`,

job.`Customer_ID`,

job.`Order_Time`,

job.`Contract`,

job.`Order_Site_Address`,

job.`Job_Description`,

job.`VAT`,

job.`Invoice_Printed`,

job.`Invoice_Printing_Date`,

job.`Invoice_Tax_Date`,

job.`Payment_Received`,

job.`CustomerRef`,

job.`Customer_Name`,

job.`Payment_Due_date`,

job.`Payment_Date`,

job.`Locked`,

job.`Note`

From `job`



and this table

select `Job_No`,

`Engineer_Name`,

`Paying_Rate`,

`Account_ID`,

`Working_Hrs`,

`Sheet_Returned`

From `labour`


What I want to do is 14 days after the job has been entered using the job.`Order_Date`, to reference this if the filed of labour.`Sheet_Returned`, has not been made true, I want it to either change in color to red, or list this job in another view, but even when it has been listed, if the labour.`Sheet_Returned`, gets made true, as this is a tick box, I want the job to be taken out of this extra view or change color back to its original color?
Any help on this please?
Cheers

Paul.

J
Jane 2/14/2008

Paul,
use Custom format on the "View as" settings dialog for this purpose.
Select Sheet_Returned value from labour table and change cell color.

Here are some examples:

http://www.asprunner.com/forums/index.php?showtopic=5163

S
swanside author 2/14/2008

Thanks Jane.
I made a new custom View and selected these fields.

select job.`Order_Date`,

job.`File_No`,

job.`Job_No`,

job.`Contract`,

job.`Order_Site_Address`,

job.`Job_Description`,

job.`CustomerRef`,

job.`Customer_Name`,

labour.`Engineer_Name`,

labour.`Working_Hrs`,

labour.`Sheet_Returned`

From `job`

left join labour on

job.Job_No = labour.Job_No


I then in the visual editor selected the sheets returned and entered this code into the view as custon section

$str = "<table width=100% bgcolor=";

if ($value="TRUE")

$str.="green";

if ($value="FALSE")

$str.="red";

str.="><tr><td>".$value."</td></tr></table>";

$value=$str;


WHen I run my program, I get this error
Parse error: syntax error, unexpected T_CONCAT_EQUAL in C:\wamp\www\helpdesk\include\commonfunctions.php on line 481
ANy ideas please?
Thanks Paul

Sergey Kornilov admin 2/14/2008

Use double equals sign:

if ($value=="TRUE")

S
swanside author 2/14/2008

Sorry, I didnt see the part about using the $str and not str.
Anyway, I have the code OK now, and the program runs, but instead of me seeing a checkbox for sheet_returned, I see either a 0 or a -1 where before I put the code in it was either ticked or not ticked?

J
Jane 2/15/2008

Paul,
where do you use this code?

S
swanside author 2/18/2008

Jane,
I am in the visual editor and double click on the Sheet_Returned box which is a checkbox, I selkect custom and enter the code there.
Ideally, what I am trying to do is when a job gets entered I have now() in the date field so i get the current date and time the job is entered. I would like to make this line go red or any different color when the job gets to 14 days old? if thats possible?
Thanks

Paul.

J
Jane 2/19/2008

Paul,
it's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and send to support@xlinesoft.com a URL to your pages along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.