I have a ticketing support system and I have some rows when in call_edit.php file. I have 2 rows called staff and status . When someone sends us a ticket, the ticket status by default is open and the staff is row is empty (0 in my code) . I want to achieve that when I change the staff value from empty (0 in my code) to a name (kitty, John or else), the status automatically changes from open to Checking.
This is some of my php form:
<tr><td valign="top" style="width: 150px;">Status</td>
<td><select name='call_status'>
<option value='0'<?php if($site_calls->call_status == 0){echo ' selected';}?>>Open</option>
<option value='2'<?php if($site_calls->call_status == 2){echo ' selected';}?>>Checking</option>
<option value='1'<?php if($site_calls->call_status == 1){echo ' selected';}?>>Closed</option>
<option value='3'<?php if($site_calls->call_status == 3){echo ' selected';}?>>Deleted</option>
</select>
</td></tr>
<tr><td>Staff</td><td><select name='call_staff'>
<option value="0"></option>
<?php $staff_name = $db->get_results("select user_id,user_name from site_users where user_level<>1 order by user_name;");
foreach ($staff_name as $staff )
{?>
<option value='<?php echo $staff->user_id;?>'<?php if($staff->user_id == $call_staff){echo ' selected';}?>><?php echo $staff->user_name;?></option>
<?php } ?>
</select></td></tr>