| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 4 |
|
| 5 |
echo '<table style="width:100%"> |
| 6 |
<thead> |
| 7 |
<tr> |
| 8 |
<th style="text-align:left;">' . __( 'Date', 'propertyhive' ) . ' / ' . __( 'Time', 'propertyhive' ) . '</th> |
| 9 |
<th style="text-align:left;">' . __( 'Subject', 'propertyhive' ) . '</th> |
| 10 |
<th style="text-align:left;">' . __( 'Status', 'propertyhive' ) . '</th> |
| 11 |
<th style="text-align:left;">' . __( 'Negotiator', 'propertyhive' ) . '</th> |
| 12 |
<th style="text-align:left;">' . __( 'Office', 'propertyhive' ) . '</th> |
| 13 |
</tr> |
| 14 |
</thead> |
| 15 |
<tbody>'; |
| 16 |
|
| 17 |
while ( $enquiries_query->have_posts() ) |
| 18 |
{ |
| 19 |
$enquiries_query->the_post(); |
| 20 |
|
| 21 |
$the_enquiry = new PH_Enquiry( get_the_ID() ); |
| 22 |
|
| 23 |
echo '<tr' . ( ($the_enquiry->status == 'closed') ? ' style="opacity:0.4"' : '' ) . '>'; |
| 24 |
echo '<td style="text-align:left;"><a href="' . get_edit_post_link( get_the_ID() ) . '">' . get_the_time( 'jS M Y' ) . ' ' . get_the_time( 'H:i' ) . '</a></td>'; |
| 25 |
echo '<td style="text-align:left;">' . get_the_title() . '</td>'; |
| 26 |
echo '<td style="text-align:left;">' . $the_enquiry->status . '</td>'; |
| 27 |
echo '<td style="text-align:left;">'; |
| 28 |
if ($the_enquiry->_negotiator_id == '' || $the_enquiry->_negotiator_id == 0) |
| 29 |
{ |
| 30 |
echo '<em>-- ' . __( 'Unassigned', 'propertyhive' ) . ' --</em>'; |
| 31 |
} |
| 32 |
else |
| 33 |
{ |
| 34 |
$userdata = get_userdata( $the_enquiry->_negotiator_id ); |
| 35 |
if ( $userdata !== FALSE ) |
| 36 |
{ |
| 37 |
echo $userdata->display_name; |
| 38 |
} |
| 39 |
else |
| 40 |
{ |
| 41 |
echo '<em>Unknown user</em>'; |
| 42 |
} |
| 43 |
} |
| 44 |
echo '</td>'; |
| 45 |
echo '<td style="text-align:left;">' . get_the_title( $the_enquiry->_office_id ) . '</td>'; |
| 46 |
echo '</tr>'; |
| 47 |
} |
| 48 |
|
| 49 |
echo ' |
| 50 |
</tbody> |
| 51 |
</table> |
| 52 |
<br>'; |