Nobody can help
Hi all,
I have this page (articles) with form get method
and the final result need to show in pagination page,
when user submit the first time it's every thing work fine.
but in the pagination link how can make link with get and send all the parameter in the first time send with the form.
this link with pagination page
articles/index/page/2(need the all parameter send in the first time)
articles/index/page/3
articles/index/page/4
this the controller page
public function indexAction()
{
$article = array();
$dateFrom = null;
$dateTo = null;
if ($this->_hasParam('titleId') ){
$titleId = $this->_getParam('titleId');
}else{
$titleId = $this->getFirstTitleId($this->_publisherId);
}
if (!$this->ifTitleExist($titleId , $this->_publisherId)){
$this->_redirect('/articles');
}
if ($this->_hasParam('parsedfrom') && $this->_getParam('parsedfrom') != null ){
$this->view->dateFrom = $this->_getParam('parsedfrom');
$dateFrom = ( $this->is_date( $this->_getParam('parsedfrom') ) ? $this->_getParam('parsedfrom') : '00-00-0000' );
}else{
$this->view->dateFrom = 'Choose a Date';
}
if ($this->_hasParam('parsedto') && $this->_getParam('parsedto') != null ){
$this->view->dateTo = $this->_getParam('parsedto');
$dateTo = ( $this->is_date( $this->_getParam('parsedto') ) ? $this->_getParam('parsedto') : '99-99-9999' );
}else{
$this->view->dateTo = 'Choose a Date';
}
$titlesName = $this->getTitlesName($this->_publisherId);
$this->view->titlesName = $titlesName;
$this->view->titleId = $titleId;
$articles = $this->getArticlesFrom($titleId , $dateFrom , $dateTo);
$articleCount = 0;
foreach ($articles as $articleRow){
$article[$articleCount]['id'] = $articleRow['id'];
$article[$articleCount]['headline'] = $articleRow['headline'];
$article[$articleCount]['date'] = $articleRow['date'];
$article[$articleCount]['parsed_on_syn'] = $this->getArticleParsed($articleRow['id']);
$articleCount ++;
}
$page=$this->_getParam('page',1);
$paginator = Zend_Paginator::factory($article);
$paginator->setItemCountPerPage(2);
$paginator->setPageRange(5);
$paginator->setCurrentPageNumber($page);
$this->view->articles = $paginator;
}
and this the pagination view
<?php if ($this->last > 1){ ?>
<div class="pagination" style="width:100%">
<div style="float:left;width:28%">
</div>
<div style="float:right;width:70%;">
<!-- First page link -->
<?php if (isset($this->previous)): ?>
<a href="<?php echo $this->url(array('page' => $this->first)); ?>">Start</a>
<?php else: ?>
<span class="disabled">Start</span>
<?php endif; ?>
<!-- Previous page link -->
<?php /*
<?php if (isset($this->previous)): ?>
<a href="<?php echo $this->url(array('page' => $this->previous)); ?>">< Previous</a>
<?php else: ?>
<span class="disabled">< Previous</span>
<?php endif; ?>
*
*/
?>
<!-- Numbered page links -->
<?php foreach ($this->pagesInRange as $page): ?>
<?php if ($page != $this->current): ?>
<a href="<?php echo $this->url(array('page' => $page)); ?>"><?php echo $page; ?></a>
<?php else: ?>
<?php echo $page; ?>
<?php endif; ?>
<?php endforeach; ?>
<!-- Next page link -->
<?php /*
<?php if (isset($this->next)): ?>
<a href="<?php echo $this->url(array('page' => $this->next)); ?>">Next ></a>
<?php else: ?>
<span class="disabled">Next ></span>
<?php endif; ?>
*
*/
?>
<!-- Last page link -->
<?php if (isset($this->next)): ?>
<a href="<?php echo $this->url(array('page' => $this->last)); ?>">End</a>
<?php else: ?>
<span class="disabled">End</span>
<?php endif; ?>
</div>
</div>
<?php } ?>
and this the view page
<?php
echo $this->headLink()->setIndent(' ')
->setStylesheet($this->includeModifiedDate('/css/uitheme.css')) . "\n ";
echo $this->headLink()->setIndent(' ')
->setStylesheet($this->includeModifiedDate('/css/uidatepicker.css')) . "\n ";
echo $this->headLink()->setIndent(' ')
->setStylesheet($this->includeModifiedDate('/css/uicore.css')) . "\n ";
$this->headScript()->appendFile('/js/jquery/jquery-1.3.2.min.js');
$this->headScript()->appendFile('/js/jquery_plugins/ui.core.js');
$this->headScript()->appendFile('/js/jquery_plugins/ui.datepicker.js')
?>
<script type="text/javascript">
$(function(){
$('#parsedfrom').datepicker({
presets: {specificDate: 'Parsed From'},
dateFormat: 'yy-mm-dd'
});
$('#parsedto').datepicker({
presets: {specificDate: 'Parsed To'},
dateFormat: 'yy-mm-dd'
});
});
</script>
<body class="oneColLiqCtrHdr">
<div id="container">
<div id="header">
<div class="main-menu">
<ul>
<li><a href="/dashboard">Dashboard</a></li>
<li><a href="/publications">Publication</a></li>
<li><a href="/statements">Statements</a></li>
<li><a href="/articles">Articles</a></li>
<li><a href="/publisher">My Information</a></li>
<li><a href="/contacts">Contacts</a></li>
<li><a href="/support">Support</a></li>
<li><a href="/user/logout">Logout</a></li>
</ul>
</div>
<!-- end #header --></div>
<div id="mainContent">
<h1>Articles For Addustor</h1>
<form class="articles" id="articles" method="GET" action="articles">
<fieldset>
<div class="row">
<label for="titleId">Publication:</label>
<select id="titleId" name="titleId">
<?php
foreach ($this->titlesName as $titleName){
$select = '';
if($titleName['id'] == $this->titleId){ $select = 'selected'; }
echo '<option ' . $select . ' value="' . $this->escape($titleName['id']) . '">' . $this->escape($titleName['name']) . '</option>
';
}
?>
</select>
</div>
<div class="row1">
<label for="parsedfrom">Date From:</label>
<input type="text" value="<?php echo $this->dateFrom ; ?>" name="parsedfrom" id="parsedfrom" />
<div id="demoHeader" style="float: left; width: 200px;">
</div><!-- /demoHeader -->
<a id="dateFrom" href="javascript:void(0);">date</a>
</div>
<div class="row1">
<label for="parsedto">To:</label>
<input type="text" value="<?php echo $this->dateTo ; ?>" name="parsedto" id="parsedto" />
<a id="dateTo" href="javascript:void(0);">date</a>
</div>
<div class="row1">
<input type="submit" id="submit" name="submit" value="Submit" />
</div>
</fieldset>
</form>
<br />
<br />
<table class="publication">
<thead>
<tr>
<th class="fullname">Headline</th>
<th class="language">Date</th>
<th class="passed_syn">Parsed on Syndigate</th>
<th class="action">Actions</th>
</tr>
</thead>
<tbody>
<?php
if (count($this->articles) ){
foreach ($this->articles as $article){
echo '<tr>
<td class="name"><a href="/article?articleId=' . $this->escape($article['id']) . '">' . $this->escape($article['headline']) . '</a></td>
<td class="language">' . $this->escape($article['date']) . '</td>
<td class="passed_syn">' . $this->escape($article['parsed_on_syn']) . '</td>
<td class="action"><a href="/article/reportarticle?articleId=' . $this->escape($article['id']) . '">Report Problem</a></td>
</tr>' ;
}
}else {
echo '<tr>
<td colspan="4" style="text-align:center;">This title not have article</td>
</tr>';
}
?>
</tbody>
</table>
<?php echo $this->paginationControl($this->articles, 'Sliding', 'common/pagination.phtml'); ?>
<!-- end #mainContent --></div>
<div id="footer">
<p><center>Copyright © 2009 Syndigate.info</center></p>
<!-- end #footer --></div>
<!-- end #container --></div>
</body>
can any one help me
Nobody can help