AJAX pagination working on Enquiry table on user views

This commit is contained in:
Karl Cordes 2011-03-17 11:01:15 +11:00
parent 1f33242874
commit 7bd1abe2c7
3 changed files with 50 additions and 42 deletions

View file

@ -1,14 +1,23 @@
<?php echo $javascript->link('jquery.jeditable.mini'); ?>
<?=$javascript->link('ajax_pagination'); ?>
<?php echo $paginator->options(array('url'=>$this->passedArgs)); ?>
<?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)
'format' => __('Page %page% of %pages%, showing %current% Enquiries out of %count% total, starting on record %start%, ending on %end%', true)
));
?>
<div class="paging">
<?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>
<table cellpadding="0" cellspacing="0" class="mer">
<tr>
<th><?php echo $paginator->sort('user_id');?></th>

View file

@ -3,51 +3,51 @@
<span id="userID" style="display: none;"><?=$user['User']['id']?></span>
<div class="users view">
<h2><?php __('User: '.$user['User']['username'] );?></h2>
<dl><?php $i = 0; $class = ' class="altrow"';?>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Username'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $user['User']['username']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('First Name'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $user['User']['first_name']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Last Name'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $user['User']['last_name']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Email'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($user['User']['email'], 'mailto:'.$user['User']['email']); ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Job Title'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $user['User']['job_title']; ?>
&nbsp;
</dd>
</dl>
<h2><?php __('User: '.$user['User']['username'] );?></h2>
<dl><?php $i = 0; $class = ' class="altrow"';?>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Username'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $user['User']['username']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('First Name'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $user['User']['first_name']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Last Name'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $user['User']['last_name']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Email'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($user['User']['email'], 'mailto:'.$user['User']['email']); ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Job Title'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $user['User']['job_title']; ?>
&nbsp;
</dd>
</dl>
</div>
<div class="related">
<h3><?php __('Enquiries Assigned to this User');?></h3>
<button id="show" class="showHide">Show</button>
<button id="hide" class="showHide">Hide</button>
<h3><?php __('Enquiries Assigned to this User');?></h3>
<button id="show" class="showHide">Show</button>
<button id="hide" class="showHide">Hide</button>
<div id="enquiryTable">
<div id="ajaxLoad" style="display:none;"><?php echo $html->image('ajax-loader.gif'); ?></div>
</div>
<div id="ajaxLoad" style="display:none;"><?php echo $html->image('ajax-loader.gif'); ?></div>
<div id="enquiryTable">
<? /* If there are enquiries for this user, render the enquiries table passing the $enquiries array */ ?>
<?php if (!empty($user['Enquiry'])) {
//echo $this->element('enquiry_table', $user['Enquiry']);
}
else {
echo "No Enquiries for this User";
}
?>
//echo $this->element('enquiry_table', $user['Enquiry']);
}
else {
echo "No Enquiries for this User";
}
?>
</div>
</div>

View file

@ -4,7 +4,6 @@ $(function() {
$('#enquiryTable').hide();
$("#ajaxLoad").hide();
$("#ajaxLoad").bind("ajaxSend", function() {
$(this).show();
}).bind("ajaxComplete", function() {