this code is giving me _apl.php for example
Parse error: syntax error, unexpected ‘$this’ (T_VARIABLE) in /opt/NetMake/v81/wwwroot/scriptcase/app/***_apl.php on line 9470
which is not related to this code
on validate event
$msg = check_stock();
if (!$msg == ‘valid’)
{
sc_error_message($msg);
sc_error_exit();
}
check_stock()
if ({job_status} == ‘CLOSED’){
/**
- Selecting a field from another table using the recordset
*/
// Check for record
$check_sql = "SELECT part_id,part_qty FROM job_card_part WHERE job_id = " . {job_id};
echo $check_sql;
sc_set_fetchmode(0);
sc_select(rs, "SELECT part_id,part_qty FROM job_card_part WHERE job_id = " . {job_id});
while(!$rs->EOF)
{
$flag = true;
if ($rs->fields[part_qty] > 0)
{
// Check for stock balance start
$check_sql = “SELECT stk_bal "
. " FROM sc_stock”
. " WHERE part_id = $rs->fields[part_id] and service_center_id = [service_center_id]";
sc_lookup(rs, $check_sql);
if ({rs} === false)
{
$msg = "Access error. Message=". {rs_erro} . $check_sql;
$flag = false;
$rs->Close();
break;
}
elseif (empty({rs}))
{
$msg = "No Stock Available for this Part ";
$flag = false;
break;
}
else
{
if ($rs->fields[part_qty] > {rs[0][0]})
{
$msg = 'Part does not have sufficient balance. Available stock :' .{rs[0][0]};
$flag = false;
break;
}
}
// Check for stock balance end
}
$rs->MoveNext();
}
$rs->Close();
}
if ($flag)
{
return “valid”;
}
else
{
return $msg;
}