Esempio n. 1
0
	function getDisplayTab($tab,$user,$ui)
	{

		$params=$this->params;

		global $_CB_framework,$_CB_database;

		$livesite = JURI::base();
		JPlugin::loadLanguage( 'com_alphauserpoints', JPATH_SITE );
		$tableclass = $params->get('tableclass', 1);
		$count_activity = $params->get('count_activity', 20);
		$return ="";
		$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';

		if ( file_exists($api_AUP)) {
			require_once ($api_AUP);
			$listActivity = AlphaUserPointsHelper::getListActivity('all', $user->id, $count_activity);
		}
		
		if(count($listActivity) >0) {
			$return .='<table width="95%" cellspacing="0" border="0">';
			$return .= '<tr class=\'sectiontableheader\'><th>';
			$return .='</th><th width="20%">';
			$return .= JText::_( 'AUP_DATE' );
			$return .='</th><th width="20%">';
			$return .= JText::_( 'AUP_ACTION' );
			$return .='</th><th width="6%">';
			$return .= JText::_( 'AUP_POINTS_UPPER' );
			$return .='</th><th>';
			$return .= JText::_( 'AUP_DETAIL' );
			$return .='</th></tr>';
			$i=0;
			foreach ( $listActivity as $activity ) {
				$i++;
				if($i>2) $i=1;
				$return .='<tr';
				if($tableclass) $return .=' class="sectiontableentry'.$i.'"';
				$return .=' ><td>';
					$icon = ( $activity->category!='' ) ? '<img src="'.JURI::base(true).DS.'components'.DS.'com_alphauserpoints'.DS.'assets'.DS.'images'.DS.'categories'.DS.$activity->category.'.gif" alt="" />' : '';
				$return .= $icon;
				$return .='</td><td>';
				$return .= '<span style="color:#333;">'.JHTML::_('date', $activity->insert_date, JText::_('d.m.Y')).'</span>&nbsp;<span style="color:#777;font-style:oblique;">'.JHTML::_('date', $activity->insert_date, JText::_('H:i:s')).'</span>';
					$color = $activity->points>0 ? "#009900" : ($activity->points<0 ? "#ff0000" : ($activity->points==0.00 ? "#777" : "#777"));
				$return .='</td><td style="color:'. $color .';">';
				$return .= JText::_( $activity->rule_name );
				$return .='</td><td style="text-align: right; color:'. $color .';">';
				$return .= $activity->points;
				$return .='&nbsp;&nbsp;</td><td  style="color:#777;">';
				$return .= $activity->datareference;
				$return .='</td></tr>';
			}
			$return .='</table>';
			$return .= '<br />' . JHTML::_('date', 'now', JText::_('l d.m.Y H:i'));
		} else $return .='<div align="center"><p>'.JText::_( 'AUP_THIS_INFORMATION_HAS_NOT_BEEN_PROVIDED' ).'</p></div>';
		return $return;
	}
Esempio n. 2
0
        echo '</td>';
        echo '</tr>';
    }
    echo '</tbody></table>';
    echo '<div class="pagination" >';
    echo $this->pagination->getResultsCounter();
    echo $this->pagination->getPagesLinks();
    echo $this->pagination->getPagesCounter();
    echo '</div>';
    echo JHtml::_('bootstrap.endTab');
}
if (!$use_as_catalog && $show_pointstab) {
    echo JHtml::_('bootstrap.addTab', 'dashboardTab', 'mypoints', '<i class="vmv-icon-star"></i> ' . JText::_('COM_VMVENDOR_DASHBOARD_MYPOINTSTITLE'));
    if ($use_aup = 0 && file_exists(JPATH_SITE . '/components/com_alphauserpoints/helper.php')) {
        require_once $api_AUP;
        $listActivity = AlphaUserPointsHelper::getListActivity('VMVendor', $user->id, $app->getCfg('list_limit'));
        $ref = AlphaUserPointsHelper::getAnyUserReferreID($user->id);
        echo '<div id="points_div"><h3>' . JText::_('COM_VMVENDOR_DASHBOARD_POINTS') . ' ' . AlphaUserPointsHelper::getCurrentTotalPoints($ref) . '</h3></div>';
        if (count($listActivity) > 0) {
            echo '<table class="table table-striped table-condensed table-hover table-bordered"><thead>';
            echo '<tr ><th width="15%">';
            echo JText::_('COM_VMVENDOR_DASHBOARD_AUP_DATE');
            echo '</th><th width="30%">';
            echo JText::_('COM_VMVENDOR_DASHBOARD_AUP_ACTION');
            echo '</th><th >';
            echo JText::_('COM_VMVENDOR_DASHBOARD_AUP_AMOUNT');
            echo '</th><th width="70%">';
            echo JText::_('COM_VMVENDOR_DASHBOARD_AUP_DETAIL');
            echo '</th></tr></thead><tbody>';
            $i = 0;
            foreach ($listActivity as $activity) {