db = $db;
}
static function addPaginator($data,$ctl,Zend_Controller_Request_Abstract $request)
{
$page = $request->getParam('page');
$paginator = Zend_Paginator::factory($data);
$paginator->setCurrentPageNumber($page);
$paginator->setItemCountPerPage(12);
$paginator->setView($ctl);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
$ctl->paginator = $paginator;
}
static function Msg($type,$content,$url=''){
$html = '
'."\r\n";
$html.= '
×'."\r\n";
$html.= $content."\r\n";
$html.= '
'."\r\n";
if(!empty($url))
{
if($url == -1){
$html.= ''."\r\n";
}else{
$html.= ''."\r\n";
}
}
return $html;
}
static function Error($type,$content,$url=''){
if(empty($type))
{
$AlertType = "alert-error";
}else{
$AlertType = $type;
}
$html = ''."\r\n";
$html.= '
×'."\r\n";
if(!is_array($content)) {
$html.= '
'.$content.'
'."\r\n";
}else{
$html.= '
'."\r\n";
foreach($content as $v) {
$html.='- '.$v.'
'."\r\n";
}
$html.= '
'."\r\n";
}
$html.= '
'."\r\n";
return $html;
}
}