This topic is locked

expired product

3/24/2012 9:58:24 AM
PHPRunner General questions
J
joiresende author

Hello,

I have a sales table where there are two fields (date of sale) and (date of purchase). need to block sales where ((purchase date) - (date of sale)) is greater than ninety days. and advise the User with the message expired product.

C
cgphp 3/24/2012

What do you mean when you say "need to block"? Could you provide more info about the logic of your app?

J
joiresende author 3/24/2012

Thanks for the reply, and sorry for my english.

What I need is not to block, but a warning that the product has expired.

Where ((purchase date) - (date of sale)) if is greater than ninety days expired product. And not let it be updated in the database.

Sergey Kornilov admin 3/26/2012

If you still need help with this 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. We also need to know what tables and fields are involved into this.

S
sickacid 3/27/2012

I've the same problem and i've solved with this code in List page: after record processed

This code calculate 31 days from now but you can use 2 var
$SC = $data["data_scadenza"];

$diff = abs(strtotime($SC) - strtotime(now()));

$days = floor($diff/(606024));

if ($days<31)

{

$row["rowstyle"]='style="background:yellow"'; //with this line U advise the user, the row became yellow

$record["edit_link"] = false;

$record["inlineedit_link"] = false;

}

J
joiresende author 3/27/2012

Simone thanks for the help. This tip may be a solution but I need to overcome if the product is not recorded in the database. (Not sold).