Hi guys I'm having difficulties with trying to call a function when I use the html <form> action attribute.
$cm = new customer_module();
$rm = new room_module();
$c_array = $cm->getByStatus('CHECKED-IN');
foreach($c_array as $row)
{
$temp = $row['room_no'];
$r_array = $rm->getByRoomNumber($temp);
$rray = $r_array[0];
echo(
$cm->checkOutCustomer($row['last_name'],$row['first_name']).
"<tr>".
"<td>".$row['room_no']. "</td>".
"<td>".$rray['type']. "</td>".
"<td>".$row['last_name']. "</td>".
"<td>".$row['first_name']. "</td>".
"<td>".$row['phone_no']. "</td>".
"<form action="$cm->checkOutCustomer($row['last_name'],$row['first_name']);">".
"<td>"."<Button>Check Out</button>"."</td>".
"</form>".
//"<td>"."<input type='button' name='checkingOut' value='Check Out' />"."</td>".
"</tr>");
}
As you can see, I'm trying to run the code $cm->checkOutCustomer($row['last_name'],$row['first_name']) for the action attribute.
The code runs fine for the first line after my echo, but when I pasted it for action it seems there is a syntax problem with $cm.
Please advise me what the problem is and thanks a lot!