This topic is locked

Conditional Statements

11/9/2011 7:44:03 PM
PHPRunner General questions
K
kikoink02 author

Guys, I am trying to put this conditional statements in my add page. where should i put it?
if ($Receipt == 'Y')

{$max <=80 && $max >=1}

else

{$max <= && $max >=1}

____
if($time_in < $time_out)

else

end
i'm a noob please try to correct my codes.

Thanks in advance <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=18221&image=1&table=forumtopics' class='bbc_emoticon' alt=':D' />

Sergey Kornilov admin 11/9/2011

Where in PHPRunner you want to add this and what this code is supposed to do?

K
kikoink02 author 11/9/2011



Where in PHPRunner you want to add this and what this code is supposed to do?


In the ADD page it supposed to not let the users input time-in-date less than the time-out-date.
I have a radio button that have a option of 'Y' and 'N' if the user pick 'Y'

the user can only input 1 is the minimum and 80 is the maximum

and if the user pick 'N' the user can only input 1-50.

K
kikoink02 author 11/13/2011



Where in PHPRunner you want to add this and what this code is supposed to do?



Sir do you have any advice to what should i do? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=62453&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' />

C
cgphp 11/14/2011

In the "Before record added" event check if the time-in-date is greater than the time-out-date:

$rs = CustomQuery("SELECT time-out-date FROM table_name"); //extract the time-out-date from the database. Change the query to match your specific needs.

$record = db_fetch_array($rs);
if(time() > strtotime($record['time-out-date']))

{

return false;

}


It's hard to help you without seeing your actual files.

K
kikoink02 author 11/15/2011



In the "Before record added" event check if the time-in-date is greater than the time-out-date:

$rs = CustomQuery("SELECT time-out-date FROM table_name"); //extract the time-out-date from the database. Change the query to match your specific needs.

$record = db_fetch_array($rs);
if(time() > strtotime($record['time-out-date']))

{

return false;

}


It's hard to help you without seeing your actual files.


I havent tried it yet because our development server is down. Anyway Thanks for your help. Gladly appreciated it. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=62498&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' />

K
kikoink02 author 11/16/2011



In the "Before record added" event check if the time-in-date is greater than the time-out-date:

$rs = CustomQuery("SELECT time-out-date FROM table_name"); //extract the time-out-date from the database. Change the query to match your specific needs.

$record = db_fetch_array($rs);
if(time() > strtotime($record['time-out-date']))

{

return false;

}


It's hard to help you without seeing your actual files.



I have an error saying
Fatal error: Call to undefined function CustomQuery() in /var/www/NexusReimbursementSys/output/include/reimbursement_events.php on line 15

Sergey Kornilov admin 11/17/2011

Something is not right here. I recommend to post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

K
kikoink02 author 11/17/2011



In the "Before record added" event check if the time-in-date is greater than the time-out-date:

$rs = CustomQuery("SELECT time-out-date FROM table_name"); //extract the time-out-date from the database. Change the query to match your specific needs.

$record = db_fetch_array($rs);
if(time() > strtotime($record['time-out-date']))

{

return false;

}


It's hard to help you without seeing your actual files.



actually sir this was the error that it says "mysql_fetch_array() expects parameter 1 to be resource, string given"
i changed the CustomQuery to db_fetch_array. is that correct?