Hello,
I have this "Server" tab script on a button I created on the list page and worked well in PHPR 6.1. I see that when I create a button in PHPR 6.2 "$keys" are no longer available. How do I use "getCurrentRecord()" to get my key or other values.
//Like button
global $conn;
$strSQLExists = "SELECT ir, ps FROM case_analysis_person_ir_link WHERE ps = ".$_SESSION["UserID"]." AND ir = ".$keys["DR"]." AND person_like = 1";
$rsExists = db_query($strSQLExists,$conn);
$data=db_fetch_array($rsExists);
$strSQLExists = "SELECT ir, ps FROM case_analysis_person_ir_link WHERE ps = ".$_SESSION["UserID"]." AND ir = ".$keys["DR"]." AND person_like = 0";
$rsExists = db_query($strSQLExists,$conn);
$data1=db_fetch_array($rsExists);
if($data)
{
$result['txt'] = "You already LIKE This!";
}
else if($data1)
{
global $dal;
if($keys['DR'])
{
$tblEvents = $dal->Table("case_analysis_person_ir_link");
$tblEvents->Param["ir"]=$keys["DR"];
$tblEvents->Value["person_like"]=1;
$tblEvents->Update();
$result["txt"] = "You now RE-LIKE this IR!";
}}
else
{
global $dal;
if($keys['DR'])
{
$tblEvents = $dal->Table("case_analysis_person_ir_link");
$tblEvents->Value["ir"]=$keys["DR"];
$tblEvents->Value["ps"]=$_SESSION["UserID"];
$tblEvents->Value["person_like"]=1;
$tblEvents->Add();
$result["txt"] = "You now LIKE this IR!";
}}
Thanks for your help,
Brian