2009-02-10 17:10:10 -08:00
|
|
|
<?php echo $paginator->options(array('url'=>$this->passedArgs)); ?>
|
|
|
|
|
|
2009-01-12 21:13:18 -08:00
|
|
|
<?php
|
|
|
|
|
echo $paginator->counter(array(
|
|
|
|
|
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
|
|
|
|
|
));
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
<table cellpadding="0" cellspacing="0" class="mer">
|
|
|
|
|
<tr>
|
|
|
|
|
<th><?php echo $paginator->sort('user_id');?></th>
|
|
|
|
|
<th><?php echo $paginator->sort('Date', 'created');?></th>
|
2009-01-22 18:43:39 -08:00
|
|
|
<th><?php echo $paginator->sort('principle_id');?></th>
|
2009-01-12 21:13:18 -08:00
|
|
|
<th><?php echo $paginator->sort('Enquiry Number', 'title');?></th>
|
|
|
|
|
<th><?php echo $paginator->sort('customer_id');?></th>
|
|
|
|
|
<th><?php echo $paginator->sort('contact_id');?></th>
|
|
|
|
|
<th><?php __('Email'); ?></th>
|
|
|
|
|
<th><?php __('Phone No'); ?></th>
|
|
|
|
|
<th><?php echo $paginator->sort('state_id');?></th>
|
|
|
|
|
<th><?php echo $paginator->sort('country_id');?></th>
|
2009-01-22 18:43:39 -08:00
|
|
|
|
2009-01-12 21:13:18 -08:00
|
|
|
<th><?php echo $paginator->sort('status_id');?></th>
|
|
|
|
|
<th><?php echo $paginator->sort('comments');?></th>
|
|
|
|
|
<th class="actions"><?php __('Actions');?></th>
|
|
|
|
|
</tr>
|
|
|
|
|
<?php
|
|
|
|
|
//$i = 0;
|
|
|
|
|
foreach ($enquiries as $enquiry):
|
|
|
|
|
$class = null;
|
|
|
|
|
//if ($i++ % 2 == 0) {
|
|
|
|
|
// $class = ' class="altrow"';
|
|
|
|
|
//}
|
|
|
|
|
/* Set Row colour to Yellow if the Job has been won and turned into an order */
|
|
|
|
|
if($enquiry['Status']['id'] == 3) {
|
|
|
|
|
$class = ' class="jobwon"';
|
|
|
|
|
}
|
|
|
|
|
else if($enquiry['Status']['id'] == 4) {
|
|
|
|
|
$class = ' class="joblost"';
|
|
|
|
|
}
|
2009-01-19 22:15:32 -08:00
|
|
|
else if($enquiry['Status']['id'] == 8) {
|
|
|
|
|
$class = ' class="joblost"';
|
|
|
|
|
}
|
|
|
|
|
else if($enquiry['Status']['id'] == 9) {
|
|
|
|
|
$class = ' class="joblost"';
|
|
|
|
|
}
|
|
|
|
|
else if($enquiry['Status']['id'] == 10) {
|
|
|
|
|
$class = ' class="joblost"';
|
|
|
|
|
}
|
|
|
|
|
else if($enquiry['Status']['id'] == 6) {
|
|
|
|
|
$class = ' class="information"';
|
|
|
|
|
}
|
2009-01-26 17:59:37 -08:00
|
|
|
else if($enquiry['Status']['id'] == 11) {
|
|
|
|
|
$class = ' class="informationsent"';
|
|
|
|
|
}
|
2009-01-20 21:02:41 -08:00
|
|
|
else if($enquiry['Status']['id'] == 5) {
|
|
|
|
|
$class = ' class="quoted"';
|
|
|
|
|
}
|
2009-01-12 21:13:18 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
<tr<?php echo $class;?>>
|
|
|
|
|
|
|
|
|
|
<?php $nameclass = null;
|
|
|
|
|
if($enquiry['Enquiry']['posted'] == 1) {
|
|
|
|
|
$nameclass = ' class="posted"';
|
|
|
|
|
}
|
2009-01-20 21:02:41 -08:00
|
|
|
else {
|
|
|
|
|
$nameclass = 'class="notposted"';
|
|
|
|
|
}
|
2009-01-12 21:13:18 -08:00
|
|
|
echo "<td $nameclass>";
|
|
|
|
|
?>
|
|
|
|
|
<?php
|
|
|
|
|
/* Take the First Letter from First/Last Names to make the initials. Could be a problem if Users have the Same Initials */
|
|
|
|
|
$firstname = $enquiry['User']['first_name'];
|
|
|
|
|
$lastname = $enquiry['User']['last_name']; ?>
|
|
|
|
|
<?php echo $html->link($firstname[0].$lastname[0], array('controller'=> 'users', 'action'=>'view', $enquiry['User']['id'])); ?>
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<?php
|
|
|
|
|
/* Change the date from MySQL DATETIME to a D M Y format */
|
|
|
|
|
echo date('j M Y',$time->toUnix($enquiry['Enquiry']['created'])); ?>
|
2009-01-22 18:43:39 -08:00
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<?php echo $html->link($enquiry['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id'])); ?>
|
2009-01-12 21:13:18 -08:00
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<?php echo $html->link($enquiry['Enquiry']['title'], array('controller'=>'enquiries', 'action'=>'view', $enquiry['Enquiry']['id'])); ?>
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<td>
|
|
|
|
|
<?php echo $html->link($enquiry['Customer']['name'], array('controller'=> 'customers', 'action'=>'view', $enquiry['Customer']['id'])); ?>
|
|
|
|
|
</td>
|
2009-02-03 17:49:44 -08:00
|
|
|
<td>
|
|
|
|
|
<?php echo $html->link($enquiry['Contact']['first_name'].' '.$enquiry['Contact']['last_name'], array('controller'=> 'contacts', 'action'=>'view', $enquiry['Contact']['id'])); ?>
|
2009-01-12 21:13:18 -08:00
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<? //BCC address to Con is hardcoded in here. ?>
|
|
|
|
|
<?php echo $html->link($enquiry['Contact']['email'], 'mailto:'.$enquiry['Contact']['email'].'?subject='.$enquiry['Enquiry']['title'].'&bcc=carpis@cmctechnologies.com.au'); ?>
|
|
|
|
|
</td>
|
2009-02-03 21:28:46 -08:00
|
|
|
<td>
|
2009-01-12 21:13:18 -08:00
|
|
|
<?php echo $enquiry['Contact']['phone']; ?>
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<?php echo $html->link($enquiry['State']['shortform'], array('controller'=> 'states', 'action'=>'view', $enquiry['State']['id'])); ?>
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<?php echo $html->link($enquiry['Country']['name'], array('controller'=> 'countries', 'action'=>'view', $enquiry['Country']['id'])); ?>
|
|
|
|
|
</td>
|
2009-01-22 18:43:39 -08:00
|
|
|
|
2009-01-12 21:13:18 -08:00
|
|
|
<td>
|
|
|
|
|
<?php echo $html->link($enquiry['Status']['name'], array('controller'=> 'statuses', 'action'=>'view', $enquiry['Status']['id'])); ?>
|
|
|
|
|
</td>
|
2009-01-22 18:43:39 -08:00
|
|
|
<td class = "comments">
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
$displayedComment = substr($enquiry['Enquiry']['comments'], 0, 260);
|
|
|
|
|
echo $displayedComment;
|
|
|
|
|
if(strlen($enquiry['Enquiry']['comments']) > strlen($displayedComment) ) {
|
2009-01-26 17:46:00 -08:00
|
|
|
echo '.... '.$html->link('view all', array('controller'=>'enquiries', 'action'=>'view', $enquiry['Enquiry']['id']));
|
2009-01-22 18:43:39 -08:00
|
|
|
}
|
|
|
|
|
?>
|
2009-01-12 21:13:18 -08:00
|
|
|
</td>
|
|
|
|
|
<td class="actions">
|
|
|
|
|
<?php echo $html->link(__('View', true), array('controller'=>'enquiries','action'=>'view', $enquiry['Enquiry']['id'])); ?>
|
|
|
|
|
<?php echo $html->link(__('Edit', true), array('controller'=>'enquiries','action'=>'edit', $enquiry['Enquiry']['id'])); ?>
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="paging">
|
2009-02-10 17:10:10 -08:00
|
|
|
|
2009-01-12 21:13:18 -08:00
|
|
|
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
|
|
|
|
|
| <?php echo $paginator->numbers();?>
|
|
|
|
|
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?>
|
|
|
|
|
</div>
|
|
|
|
|
|