Rom Za Rom Za - 2 months ago 5
PHP Question

Taking name of staff member who choosed status

I have something like this

|SUBJECT| |E-mail| |STATUS|
test1 cos@mail.com OPEN
test2 cos2@mail.com IN PROGRESS
test3 cos3@mail.com CLOSED


It's something like a ticket systems. When I want to open for example subject test1 I have all informations like Who, when, etc and also I have question from customer and I can reply and set status to: OPEN, IN PROGESS, CLOSED etc.

And it works fine but I wanna one addition.

I wanna something like:

|SUBJECT| |E-mail| |STATUS|
test1 cos@mail.com OPEN by Name Surname
test2 cos2@mail.com IN PROGRESS by Name Surname
test3 cos3@mail.com CLOSED by Name Surname


When I setting status I wanna take Name and Surname from my Staff and display it in my ticket view.

here is code: Choose status

<select class="select2" name="status">
<?php
foreach($statuses as $status) : ?>

<option value="<?php echo $status['status']; ?>">Set to <?php echo ucwords($status['status']); ?> </option>

<?php endforeach; ?>
</select>


There is table like above:

<td><?php echo $ticket['subject'];?></td>
<td><?php echo $ticket['email'];?></td>
<td><?php echo ucfirst($ticket['status']);?></td>


I have bookmark Staff when I have all my "moderators"

$staff['name']
$staff['surname']


How Can I set who changed the status?

Answer

The comments have more robust and better ideas, but this will probably get to where you want to go:

<option value="<?php echo $status['status'].' by '.$staff['name'].' '.$staff['surname']; ?>">Set to <?php echo ucwords($status['status']); ?> </option>