This topic is locked

how the same company employee uses the same end date.

6/25/2018 2:47:25 PM
PHPRunner General questions
ruzgarajans author

hello I can speak very little english,
my question;

have end dates for users,
how the same company employee uses the same end date.
note: paying or updating user : user_A

passive user: user_a1
etc: user,_____user_id_____company_id, active_enddate

user_A___1 ____10 _
1_2018-07-01

user_a1__2
10 __1_(user_A_ENDDATE)

user_B____
3___20_1__2019-10-10

user_b1_4___20___1__(user_B_enddate)

global $dal;

$dal_table=$dal->Table("users");

$rs = $dal_table->Query(AddFieldWrappers("Username")."='" . $username . "' and ".AddFieldWrappers("Password")."='" . $password . "'","");

$data1 = db_fetch_array($rs);

if($data1)

{

$begindate=$data1["Beginpay"];

$enddate=$data1["Endpay"];

$_SESSION["company_id"]=$data1["company_id"];

if(!$data1["active"])

{

$_SESSION["active"]=1;

return false;

}

if(strtotime($enddate)-strtotime($begindate)!=0 && (strtotime($enddate)-strtotime("now"))/(60*60*24)<0)

{

$_SESSION["active"]=1;

return false;

}

}

$_SESSION["active"]=0;


thank you very much.