PK       ! j0      edit.phpnu [        <?php
/**
 * @package   akeebabackup
 * @copyright Copyright 2006-2026 Nicholas K. Dionysopoulos / Akeeba Ltd
 * @license   GNU General Public License version 3, or later
 */

defined('_JEXEC') || die;

/** @var \Akeeba\Component\AkeebaBackup\Administrator\View\Profile\HtmlView $this */

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

$wa = $this->getDocument()->getWebAssetManager();
$wa->useScript('keepalive')
	->useScript('form.validate');

?>
<form action="<?php echo Route::_('index.php?option=com_akeebabackup&view=Statistic&layout=edit&id=' . (int) $this->item->id); ?>"
      method="post" name="adminForm" id="profile-form"
      aria-label="<?php echo Text::_('COM_AKEEBABACKUP_BUADMIN_LOG_EDITCOMMENT', true); ?>"
      class="form-validate">

	<div>
		<div class="card">
			<div class="card-body">
				<?php echo $this->form->renderField('id'); ?>
				<?php echo $this->form->renderField('description'); ?>
				<?php echo $this->form->renderField('comment'); ?>
				<?php echo $this->form->renderField('frozen'); ?>
				<?php echo $this->form->renderField('profile_id'); ?>
				<?php echo $this->form->renderField('origin'); ?>
				<?php echo $this->form->renderField('status'); ?>
				<?php echo $this->form->renderField('backupstart'); ?>
				<?php echo $this->form->renderField('backupend'); ?>
			</div>
		</div>
	</div>

	<input type="hidden" name="task" value="">
	<?php echo HTMLHelper::_('form.token'); ?>
</form>PK       ! [o      html.phpnu [        <?php
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Toolbar\ToolbarHelper;
/**
 * @version        5.6.0
 * @package        Joomla
 * @subpackage     Joom Donation
 * @author         Tuan Pham Ngoc
 * @copyright      Copyright (C) 2009 - 2023 Ossolution Team
 * @license        GNU/GPL, see LICENSE.php
 */
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die ();

class DonationViewStatisticHtml extends OSFViewHtml
{
	public $hasModel = false;

	function display()
	{
		$config				= DonationHelper::getConfig();
	    $campaignId         = Factory::getApplication()->input->getInt('campaignId',0);
	    $payment_method     = Factory::getApplication()->input->getString('payment_method','');
	    $time_period        = Factory::getApplication()->input->getString('time_period','current_month');


        $model = OSFModel::getInstance('Campaigns', 'DonationModel', array('ignore_request' => true, 'remember_states' => false, 'table_prefix' => '#__jd_'));
        $model->filter_order('tbl.title')
            ->filter_order_Dir('asc')
            ->limitstart(0)
            ->limit(0);
        $this->campaigns = $model->getData();

        $this->donated_by_countries = DonationModelDonors::returnDonorsBasedOnCountry();

		$this->config       = DonationHelper::getConfig();
        $this->addToolbar();

        $db = Factory::getDbo ();
        $query = $db->getQuery(true);
        $options = array ();
        $options [] = HTMLHelper::_ ( 'select.option', 0, Text::_ ( 'JD_SELECT_CAMPAIGN' ), 'id', 'title' );
        $query->select('id, title')
            ->from('#__jd_campaigns')
            ->where('published = 1')
            ->order('title');
        $db->setQuery ($query);
        $options = array_merge ( $options, $db->loadObjectList () );
        $this->lists['campaigns'] = HTMLHelper::_ ( 'select.genericlist', $options, 'campaignId', ' class="input-large form-select" onChange="javascript:document.adminForm.submit();" style="display:inline;"', 'id', 'title', $campaignId );

        $query->clear();
        $options = array ();
        $options [] = HTMLHelper::_ ( 'select.option', '', Text::_ ( 'JD_SELECT_PAYMENT_OPTIONS' ), 'name', 'title' );
        $query->select('name, title')
            ->from('#__jd_payment_plugins')
            ->where('published = 1')
            ->order('title');
        $db->setQuery ($query);
        $options = array_merge ( $options, $db->loadObjectList () );
        $this->lists['payment_method'] = HTMLHelper::_ ( 'select.genericlist', $options, 'payment_method', ' class="input-large form-select" onChange="javascript:document.adminForm.submit();" style="display:inline;"', 'name', 'title', $payment_method );

        $options = array ();
        $options [] = HTMLHelper::_ ( 'select.option', 0, Text::_ ( 'JD_SELECT_TIME_PERIOD' ), 'value', 'text' );
        $options [] = HTMLHelper::_('select.option', 'this_week', Text::_('JD_THIS_WEEK'));
        $options [] = HTMLHelper::_('select.option', 'current_month', Text::_('JD_THIS_MONTH'));
        $options [] = HTMLHelper::_('select.option', 'last_month', Text::_('JD_LAST_MONTH'));
        $options [] = HTMLHelper::_('select.option', 'this_year', Text::_('JD_THIS_YEAR'));
        $options [] = HTMLHelper::_('select.option', 'last_year', Text::_('JD_LAST_YEAR'));
        $this->lists['time_period'] = HTMLHelper::_ ( 'select.genericlist', $options, 'time_period', ' class="input-large form-select" onChange="javascript:document.adminForm.submit();" style="display:inline;"', 'value', 'text', $time_period );

        $this->campaignId			= $campaignId;
        $this->payment_method		= $payment_method;
        $this->time_period			= $time_period;
		$this->bootstrapHelper		= new DonationHelperBootstrap($config->twitter_bootstrap_version);
		// Render sub-menu in dashboard
		if(Factory::getApplication()->input->getString('tmpl','') != "component")
		{
			DonationHelperHtml::renderSubmenu('statistic');
		}
		parent::display();
	}

    /**
     * Add toolbar to the view
     */
    protected function addToolbar()
    {
        ToolbarHelper::title(Text::_('JD_STATISTIC'), 'generic.png');
        $canDo = DonationHelper::getActions();
        ToolbarHelper::cancel();
        if ($canDo->get('core.admin'))
        {
            ToolbarHelper::preferences('com_jdonation');
        }
    }
}
PK       ! #o,   ,   
  index.htmlnu [        <html><body bgcolor="#FFFFFF"></body></html>PK       ! mNE9  9     tmpl/default_shortstatistics.phpnu [        <?php
use Joomla\CMS\Language\Text;
/**
 * @version        5.6.0
 * @package        Joomla
 * @subpackage     Joom Donation
 * @author         Tuan Pham Ngoc
 * @copyright      Copyright (C) 2009 - 2023 Ossolution Team
 * @license        GNU/GPL, see LICENSE.php
 */

// no direct access
defined('_JEXEC') or die;
$config = $this->config;
$decimals      = isset($config->decimals) ? $config->decimals : 2;
$dec_point     = isset($config->dec_point) ? $config->dec_point : '.';
$thousands_sep = isset($config->thousands_sep) ? $config->thousands_sep : ',';
if(DonationHelper::isMultipleCurrencies()){
	$active_currencies = $config->active_currencies;
	$active_currencies_array = explode(",",$active_currencies);			
	if((!in_array($config->currency,$active_currencies_array)) && ($config->currency != "")){
		$active_currencies_array[count($active_currencies_array)] = $config->currency;
	}
}
?>
<table class="table table-striped jdonation_dasboard">
	<thead>
	<tr>
		<th class="title" width="30%"><?php echo Text::_('JD_TIME') ?></th>
		<th class="title" width="30%"><?php echo Text::_('JD_NUMBER_DONATIONS') ?></th>
		<th class="title" width="40%" style="text-align:right;padding-right:40px;"><?php echo Text::_('JD_AMOUNT') ?></th>
	</tr>
	</thead>
	<tbody>
	<tr>
		<td>
			<?php echo Text::_('JD_TODAY'); ?>
		</td>
		<td class="center">
			<?php
			if(DonationHelper::isMultipleCurrencies()){
				foreach($active_currencies_array as $currency){
					if($this->data['today'][$currency]['total_donations'] > 0){
						echo "<strong>";
						echo $this->data['today'][$currency]['total_donations']; 
						echo "</strong>";
					}else{
						echo "0";
					}
					echo "<BR />";
				}
			}else{
				if($this->data['today']['total_donations'] > 0){
					echo "<strong>";
					echo $this->data['today']['total_donations']; 
					echo "</strong>";
				}else{
					echo "0";
				}
			}
			?>
		</td>
		<td style="text-align:right;padding-right:40px;">
			<?php 
				if(DonationHelper::isMultipleCurrencies()){
					foreach($active_currencies_array as $currency){
						echo number_format($this->data['today'][$currency]['total_amount'], $decimals, $dec_point, $thousands_sep);
						echo "&nbsp;";
						echo "<strong style='font-size:10px;'>";
						echo $currency;
						echo "</strong>";
						echo "<BR />";
					}
				}else{
					//echo DonationHelperHtml::formatAmount($config, $this->data['today']['total_amount']);
					echo number_format($this->data['today']['total_amount'], $decimals, $dec_point, $thousands_sep);
					echo "&nbsp;";
					echo "<strong style='font-size:10px;'>";
					echo $config->currency;
					echo "</strong>";
				}
			?>
		</td>
	</tr>
	<tr>
		<td>
			<?php echo Text::_('JD_YESTERDAY'); ?>
		</td>
		<td class="center">
			<?php
			if(DonationHelper::isMultipleCurrencies()){
				foreach($active_currencies_array as $currency){
					if($this->data['yesterday'][$currency]['total_donations'] > 0){
						echo "<strong>";
						echo $this->data['yesterday'][$currency]['total_donations']; 
						echo "</strong>";
					}else{
						echo "0";
					}
					echo "<BR />";
				}
			}else{
				if($this->data['yesterday']['total_donations'] > 0){
					echo "<strong>";
					echo $this->data['yesterday']['total_donations']; 
					echo "</strong>";
				}else{
					echo "0";
				}
			}
			?>
		</td>
		<td style="text-align:right;padding-right:40px;">
			<?php //echo DonationHelperHtml::formatAmount($config, $this->data['yesterday']['total_amount']) 
			if(DonationHelper::isMultipleCurrencies()){
				foreach($active_currencies_array as $currency){
					echo number_format($this->data['yesterday'][$currency]['total_amount'], $decimals, $dec_point, $thousands_sep);
					echo "&nbsp;";
					echo "<strong style='font-size:10px;'>";
					echo $currency;
					echo "</strong>";
					echo "<BR />";
				}
			}else{
				//echo DonationHelperHtml::formatAmount($config, $this->data['today']['total_amount']);
				echo number_format($this->data['yesterday']['total_amount'], $decimals, $dec_point, $thousands_sep);
				echo "&nbsp;";
				echo "<strong style='font-size:10px;'>";
				echo $config->currency;
				echo "</strong>";
			}
			?>
		</td>
	</tr>
	<tr>
		<td>
			<?php echo Text::_('JD_THIS_WEEK'); ?>
		</td>
		<td class="center">
			<?php //echo $this->data['this_week']['total_donations']; 
			if(DonationHelper::isMultipleCurrencies()){
				foreach($active_currencies_array as $currency){
					if($this->data['this_week'][$currency]['total_donations'] > 0){
						echo "<strong>";
						echo $this->data['this_week'][$currency]['total_donations']; 
						echo "</strong>";
					}else{
						echo "0";
					}
					echo "<BR />";
				}
			}else{
				if($this->data['this_week']['total_donations'] > 0){
					echo "<strong>";
					echo $this->data['this_week']['total_donations']; 
					echo "</strong>";
				}else{
					echo "0";
				}
			}
			
			?>
		</td>
		<td style="text-align:right;padding-right:40px;">
			<?php //echo DonationHelperHtml::formatAmount($config, $this->data['this_week']['total_amount']) 
			if(DonationHelper::isMultipleCurrencies()){
				foreach($active_currencies_array as $currency){
					echo number_format($this->data['this_week'][$currency]['total_amount'], $decimals, $dec_point, $thousands_sep);
					echo "&nbsp;";
					echo "<strong style='font-size:10px;'>";
					echo $currency;
					echo "</strong>";
					echo "<BR />";
				}
			}else{
				//echo DonationHelperHtml::formatAmount($config, $this->data['today']['total_amount']);
				echo number_format($this->data['this_week']['total_amount'], $decimals, $dec_point, $thousands_sep);
				echo "&nbsp;";
				echo "<strong style='font-size:10px;'>";
				echo $config->currency;
				echo "</strong>";
			}
			?>
		</td>
	</tr>
	</tbody>
</table>
PK       ! FVxA  A    tmpl/default_useful_links.phpnu [        <?php
/**
 * @version        4.9
 * @package        Joomla
 * @subpackage     Joom Donation
 * @author         Dang Thuc Dam
 * @copyright      Copyright (C) 2009 - 2017 Ossolution Team
 * @license        GNU/GPL, see LICENSE.php
 */
defined('_JEXEC') or die;
?>
<table class="table table-stripped table-bordered">
	<tbody>
		<tr>
			<td>
				<a href="http://http://joomdonationdocs.joomservices.com" target="_blank" title="Documentation">Documentation</a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="http://joomdonation.com/forum/joom-donation.html" target="_blank" title="Post your questions on forum and get answers from our support staffs and Joom Donation Community">Support Forum</a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="http://joomdonation.com/support-tickets.html" target="_blank" title="Submit support tickets to get support">Support Tickets</a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="mailto:services@joomdonation.com">Email support</a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="skype:tuanpnves?chat">Skype chat (<strong>URGENT ONLY</strong>)</a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="http://joomdonation.com/my-downloads.html" title="Access to Orders History to download latest version" target="_blank">Download Latest version</a>
			</td>
		</tr>
	</tbody>
</table>PK       ! Z>|	  	    tmpl/default_donors.phpnu [        <?php
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\HTML\HTMLHelper;
/**
 * @version        5.6.0
 * @package        Joomla
 * @subpackage     Joom Donation
 * @author         Tuan Pham Ngoc
 * @copyright      Copyright (C) 2009 - 2023 Ossolution Team
 * @license        GNU/GPL, see LICENSE.php
 */
defined('_JEXEC') or die;
?>
<table class="table table-striped jdonation_dasboard">
	<thead>
		<tr>
			<th class="title" width="18%"><?php echo Text::_('JD_FIRST_NAME')?></th>
			<th class="title" width="18%"><?php echo Text::_('JD_LAST_NAME')?></th>
			<th class="title center" width="25%"><?php echo Text::_('JD_DONATION_DATE')?></th>
            <th class="title center" width="15%"><?php echo Text::_('JD_TYPE')?></th>
			<th class="title" width="20%"><?php echo Text::_('JD_AMOUNT')?></th>
		</tr>
		<?php
			foreach ($this->latestDonors as $row)
			{ 
				$link = Route::_('index.php?option=com_jdonation&task=donor.edit&id='.(int)$row->id);
		?>
		<tr>
			<td><a href="<?php echo $link; ?>"><?php echo $row->first_name; ?></a></td>
			<td><?php echo $row->last_name; ?></td>			
			<td class="center" style="font-size:11px;"><?php echo  HTMLHelper::_('date', $row->created_date, $this->config->date_format.' H:i:s'); ?></td>
            <td class="center">
                <?php
                if ($row->donation_type == 'R')
                {
                    echo Text::_('JD_RECURRING') ;
                }
                else
                {
                    echo Text::_('JD_ONETIME') ;
                }
                ?>
            </td>
			<td style="text-align:right;">
				<?php
				$decimals      = isset($this->config->decimals) ? $this->config->decimals : 2;
				$dec_point     = isset($this->config->dec_point) ? $this->config->dec_point : '.';
				$thousands_sep = isset($this->config->thousands_sep) ? $this->config->thousands_sep : ',';
				echo number_format($row->amount, $decimals, $dec_point, $thousands_sep);
				echo "&nbsp;";
				echo "<strong style='font-size:10px;'>";
				if($row->currency_code != ""){
					echo $row->currency_code;
				}else{
					echo $this->config->currency;
				}
				echo "</strong>";
				?>
			</td>
		</tr>
		<?php
			} 
		?>
	</thead>
</table>
PK       ! f))  )    tmpl/default_statistics.phpnu [        <?php
use Joomla\CMS\Language\Text;
/**
 * @version        5.6.0
 * @package        Joomla
 * @subpackage     Joom Donation
 * @author         Tuan Pham Ngoc
 * @copyright      Copyright (C) 2009 - 2023 Ossolution Team
 * @license        GNU/GPL, see LICENSE.php
 */

// no direct access
defined('_JEXEC') or die;
$config = $this->config;
$decimals      = isset($config->decimals) ? $config->decimals : 2;
$dec_point     = isset($config->dec_point) ? $config->dec_point : '.';
$thousands_sep = isset($config->thousands_sep) ? $config->thousands_sep : ',';
if(DonationHelper::isMultipleCurrencies()){
	$active_currencies = $config->active_currencies;
	$active_currencies_array = explode(",",$active_currencies);			
	if((!in_array($config->currency,$active_currencies_array)) && ($config->currency != "")){
		$active_currencies_array[count($active_currencies_array)] = $config->currency;
	}
}
?>
<table class="table table-striped jdonation_dasboard">
	<thead>
	<tr>
		<th class="title" width="30%"><?php echo Text::_('JD_TIME') ?></th>
		<th class="title" width="30%"><?php echo Text::_('JD_NUMBER_DONATIONS') ?></th>
		<th class="title" width="40%" style="text-align:right;padding-right:40px;"><?php echo Text::_('JD_AMOUNT') ?></th>
	</tr>
	</thead>
	<tbody>

	<tr>
		<td>
			<?php echo Text::_('JD_LAST_WEEK'); ?>
		</td>
		<td class="center">
			<?php 
			if(DonationHelper::isMultipleCurrencies()){
				foreach($active_currencies_array as $currency){
					if($this->data['last_week'][$currency]['total_donations'] > 0){
						echo "<strong>";
						echo $this->data['last_week'][$currency]['total_donations']; 
						echo "</strong>";
					}else{
						echo "0";
					}
					echo "<BR />";
				}
			}else{
				if($this->data['last_week']['total_donations'] > 0){
					echo "<strong>";
					echo $this->data['last_week']['total_donations']; 
					echo "</strong>";
				}else{
					echo "0";
				}
			}
			?>
		</td>
		<td style="text-align:right;padding-right:40px;">
			<?php //echo DonationHelperHtml::formatAmount($config, $this->data['last_week']['total_amount']); 
			if(DonationHelper::isMultipleCurrencies()){
				foreach($active_currencies_array as $currency){
					echo number_format($this->data['last_week'][$currency]['total_amount'], $decimals, $dec_point, $thousands_sep);
					echo "&nbsp;";
					echo "<strong style='font-size:10px;'>";
					echo $currency;
					echo "</strong>";
					echo "<BR />";
				}
			}else{
				//echo DonationHelperHtml::formatAmount($config, $this->data['today']['total_amount']);
				echo number_format($this->data['last_week']['total_amount'], $decimals, $dec_point, $thousands_sep);
				echo "&nbsp;";
				echo "<strong style='font-size:10px;'>";
				echo $config->currency;
				echo "</strong>";
			}
			?>
		</td>
	</tr>

	<tr>
		<td>
			<?php echo Text::_('JD_THIS_MONTH'); ?>
		</td>
		<td class="center">
			<?php 
			if(DonationHelper::isMultipleCurrencies()){
				foreach($active_currencies_array as $currency){
					if($this->data['this_month'][$currency]['total_donations'] > 0){
						echo "<strong>";
						echo $this->data['this_month'][$currency]['total_donations']; 
						echo "</strong>";
					}else{
						echo "0";
					}
					echo "<BR />";
				}
			}else{
				if($this->data['this_month']['total_donations'] > 0){
					echo "<strong>";
					echo $this->data['this_month']['total_donations']; 
					echo "</strong>";
				}else{
					echo "0";
				}
			}
			?>
		</td>
		<td style="text-align:right;padding-right:40px;">
			<?php //echo DonationHelperHtml::formatAmount($config, $this->data['this_month']['total_amount']) 
			if(DonationHelper::isMultipleCurrencies()){
				foreach($active_currencies_array as $currency){
					echo number_format($this->data['this_month'][$currency]['total_amount'], $decimals, $dec_point, $thousands_sep);
					echo "&nbsp;";
					echo "<strong style='font-size:10px;'>";
					echo $currency;
					echo "</strong>";
					echo "<BR />";
				}
			}else{
				//echo DonationHelperHtml::formatAmount($config, $this->data['today']['total_amount']);
				echo number_format($this->data['this_month']['total_amount'], $decimals, $dec_point, $thousands_sep);
				echo "&nbsp;";
				echo "<strong style='font-size:10px;'>";
				echo $config->currency;
				echo "</strong>";
			}
			?>
		</td>
	</tr>
	<tr>
		<td>
			<?php echo Text::_('JD_LAST_MONTH'); ?>
		</td>
		<td class="center">
			<?php
			if(DonationHelper::isMultipleCurrencies()){
				foreach($active_currencies_array as $currency){
					if($this->data['last_month'][$currency]['total_donations'] > 0){
						echo "<strong>";
						echo $this->data['last_month'][$currency]['total_donations']; 
						echo "</strong>";
					}else{
						echo "0";
					}
					echo "<BR />";
				}
			}else{
				if($this->data['last_month']['total_donations'] > 0){
					echo "<strong>";
					echo $this->data['last_month']['total_donations']; 
					echo "</strong>";
				}else{
					echo "0";
				}
			}
			?>
		</td>
		<td style="text-align:right;padding-right:40px;">
			<?php //echo DonationHelperHtml::formatAmount($config, $this->data['last_month']['total_amount']) 
			if(DonationHelper::isMultipleCurrencies()){
				foreach($active_currencies_array as $currency){
					echo number_format($this->data['last_month'][$currency]['total_amount'], $decimals, $dec_point, $thousands_sep);
					echo "&nbsp;";
					echo "<strong style='font-size:10px;'>";
					echo $currency;
					echo "</strong>";
					echo "<BR />";
				}
			}else{
				//echo DonationHelperHtml::formatAmount($config, $this->data['today']['total_amount']);
				echo number_format($this->data['last_month']['total_amount'], $decimals, $dec_point, $thousands_sep);
				echo "&nbsp;";
				echo "<strong style='font-size:10px;'>";
				echo $config->currency;
				echo "</strong>";
			}
			?>
		</td>
	</tr>
	<tr>
		<td>
			<?php echo Text::_('JD_THIS_YEAR'); ?>
		</td>
		<td class="center">
			<?php 
			if(DonationHelper::isMultipleCurrencies()){
				foreach($active_currencies_array as $currency){
					if($this->data['this_year'][$currency]['total_donations'] > 0){
						echo "<strong>";
						echo $this->data['this_year'][$currency]['total_donations']; 
						echo "</strong>";
					}else{
						echo "0";
					}
					echo "<BR />";
				}
			}else{
				if($this->data['this_year']['total_donations'] > 0){
					echo "<strong>";
					echo $this->data['this_year']['total_donations']; 
					echo "</strong>";
				}else{
					echo "0";
				}
			}
			?>
		</td>
		<td style="text-align:right;padding-right:40px;">
			<?php //echo DonationHelperHtml::formatAmount($config, $this->data['this_year']['total_amount']) 
			
			if(DonationHelper::isMultipleCurrencies()){
				foreach($active_currencies_array as $currency){
					echo number_format($this->data['this_year'][$currency]['total_amount'], $decimals, $dec_point, $thousands_sep);
					echo "&nbsp;";
					echo "<strong style='font-size:10px;'>";
					echo $currency;
					echo "</strong>";
					echo "<BR />";
				}
			}else{
				//echo DonationHelperHtml::formatAmount($config, $this->data['today']['total_amount']);
				echo number_format($this->data['this_year']['total_amount'], $decimals, $dec_point, $thousands_sep);
				echo "&nbsp;";
				echo "<strong style='font-size:10px;'>";
				echo $config->currency;
				echo "</strong>";
			}
			?>
		</td>
	</tr>
	<tr>
		<td>
			<?php echo Text::_('JD_LAST_YEAR'); ?>
		</td>
		<td class="center">
			<?php
			if(DonationHelper::isMultipleCurrencies()){
				foreach($active_currencies_array as $currency){
					if($this->data['last_year'][$currency]['total_donations'] > 0){
						echo "<strong>";
						echo $this->data['last_year'][$currency]['total_donations']; 
						echo "</strong>";
					}else{
						echo "0";
					}
					echo "<BR />";
				}
			}else{
				if($this->data['last_year']['total_donations'] > 0){
					echo "<strong>";
					echo $this->data['last_year']['total_donations']; 
					echo "</strong>";
				}else{
					echo "0";
				}
			}
			?>
		</td>
		<td style="text-align:right;padding-right:40px;">
			<?php //echo DonationHelperHtml::formatAmount($config, $this->data['last_year']['total_amount']) 
			if(DonationHelper::isMultipleCurrencies()){
				foreach($active_currencies_array as $currency){
					echo number_format($this->data['last_year'][$currency]['total_amount'], $decimals, $dec_point, $thousands_sep);
					echo "&nbsp;";
					echo "<strong style='font-size:10px;'>";
					echo $currency;
					echo "</strong>";
					echo "<BR />";
				}
			}else{
				//echo DonationHelperHtml::formatAmount($config, $this->data['today']['total_amount']);
				echo number_format($this->data['last_year']['total_amount'], $decimals, $dec_point, $thousands_sep);
				echo "&nbsp;";
				echo "<strong style='font-size:10px;'>";
				echo $config->currency;
				echo "</strong>";
			}
			?>
		</td>
	</tr>
	<tr>
		<td>
			<?php echo Text::_('JD_TOTAL_DONATIONS'); ?>
		</td>
		<td class="center">
			<?php 
			if(DonationHelper::isMultipleCurrencies()){
				foreach($active_currencies_array as $currency){
					if($this->data['total_donations'][$currency]['total_donations'] > 0){
						echo "<strong>";
						echo $this->data['total_donations'][$currency]['total_donations']; 
						echo "</strong>";
					}else{
						echo "0";
					}
					echo "<BR />";
				}
			}else{
				if($this->data['total_donations']['total_donations'] > 0){
					echo "<strong>";
					echo $this->data['total_donations']['total_donations']; 
					echo "</strong>";
				}else{
					echo "0";
				}
			}
			?>
		</td>
		<td style="text-align:right;padding-right:40px;">
			<?php //echo DonationHelperHtml::formatAmount($config, $this->data['total_donations']['total_amount']) 
			if(DonationHelper::isMultipleCurrencies()){
				foreach($active_currencies_array as $currency){
					echo number_format($this->data['total_donations'][$currency]['total_amount'], $decimals, $dec_point, $thousands_sep);
					echo "&nbsp;";
					echo "<strong style='font-size:10px;'>";
					echo $currency;
					echo "</strong>";
					echo "<BR />";
				}
			}else{
				//echo DonationHelperHtml::formatAmount($config, $this->data['today']['total_amount']);
				echo number_format($this->data['total_donations']['total_amount'], $decimals, $dec_point, $thousands_sep);
				echo "&nbsp;";
				echo "<strong style='font-size:10px;'>";
				echo $config->currency;
				echo "</strong>";
			}
			?>
		</td>
	</tr>
	</tbody>
</table>
PK       ! #o,   ,     tmpl/index.htmlnu [        <html><body bgcolor="#FFFFFF"></body></html>PK       ! f  f    tmpl/default.phpnu [        <?php
use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;
/**
 * @version        4.3
 * @package        Joomla
 * @subpackage     Joom Donation
 * @author         Tuan Pham Ngoc
 * @copyright      Copyright (C) 2009 - 2023 Ossolution Team
 * @license        GNU/GPL, see LICENSE.php
 */
defined('_JEXEC') or die;
$jinput					= Factory::getApplication()->input;
$config					= Factory::getConfig();
$bootstrapHelper		= $this->bootstrapHelper;
$rowFluidClass			= $bootstrapHelper->getClassMapping('row-fluid');
$span12Class			= $bootstrapHelper->getClassMapping('span12');
$span7Class				= $bootstrapHelper->getClassMapping('span7');
$span5Class				= $bootstrapHelper->getClassMapping('span5');

?>
<script type="text/javascript" src="<?php echo Uri::root(); ?>media/com_jdonation/assets/js/jquery.flot.min.js"></script>
<script type="text/javascript" src="<?php echo Uri::root(); ?>media/com_jdonation/assets/jquery.flot.pie.min.js"></script>
<form name="adminForm" id="adminForm" action="index.php?option=com_jdonation&view=statistic" method="post">
    <div class="<?php echo $rowFluidClass; ?>" style="background-color: #f0f1f5;" id="donationStatistic">
        <div class="<?php echo $span12Class; ?>">
            <div class="donationGraph">
                <table class="table dashboard-table" style="width:100%;">
                    <tbody>
                    <tr>
                        <td class="dashboard-table-header" style="width:50%;">
                            <?php echo Text::_('JD_DONATION_REPORT'); ?>
                        </td>
						<td class="dashboard-table-header" style="width:50%; text-align:right;padding-right:30px;">
							<a href="<?php echo Uri::root();?>administrator/index.php?option=com_jdonation&view=statistic&tmpl=component&campaignId=<?php echo $jinput->getInt('campaignId', 0);?>&payment_method=<?php echo $jinput->getString('payment_method','');?>&time_period=<?php echo $jinput->getString('time_period', '0');?>" title="Print this page" target="_blank">
								<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-printer-fill" viewBox="0 0 16 16">
								  <path d="M5 1a2 2 0 0 0-2 2v1h10V3a2 2 0 0 0-2-2H5zm6 8H5a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1z"/>
								  <path d="M0 7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2h-1v-2a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2H2a2 2 0 0 1-2-2V7zm2.5 1a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1z"/>
								</svg>
							</a>
						</td>
                    </tr>
                    <tr>
                        <td style="width:100%;" colspan="2">
                            <?php
                            global $currentMonthOffset;
                            $currentMonthOffset = (int)date('m');
                            if ($jinput->getInt('month',0) != 0)
                                $currentMonthOffset = $jinput->getInt('month',0);
                            ?>
                            <div class="monthly-stats">
                                <p>
                                    <label>
                                        <strong><?php echo Text::_('JD_FILTER');?>:</strong>
                                    </label>
                                    <?php
                                    if($this->config->use_campaign)
                                    {
                                        echo $this->lists['campaigns'];
                                    }
                                    echo $this->lists['payment_method'];
                                    echo $this->lists['time_period'];
                                    ?>
                                </p>
                                <div class="inside">
                                    <div id="placeholder" style="width:100%; height:300px; position:relative;"></div>
                                    <script type="text/javascript">
                                        /* <![CDATA[ */
                                        jQuery(function(){
                                            function weekendAreas(axes)
                                            {
                                                var markings = [];
                                                var d = new Date(axes.xaxis.min);
                                                // go to the first Saturday
                                                d.setUTCDate(d.getUTCDate() - ((d.getUTCDay() + 1) % 7));
                                                d.setUTCSeconds(0);
                                                d.setUTCMinutes(0);
                                                d.setUTCHours(0);
                                                var i = d.getTime();
                                                do
                                                {
                                                    // when we don't set yaxis, the rectangle automatically
                                                    // extends to infinity upwards and downwards
                                                    markings.push({ xaxis: { from: i, to: i + 2 * 24 * 60 * 60 * 1000 } });
                                                    i += 7 * 24 * 60 * 60 * 1000;
                                                }
                                                while(i < axes.xaxis.max);
                                                return markings;
                                            }
                                            <?php
                                            global $currentMonthOffset;
                                            $month          = $currentMonthOffset;
                                            $year           = (int) date('Y');
                                            $firstDay       = strtotime("{$year}-{$month}-01");
                                            $lastDay        = strtotime('-1 second', strtotime('+1 month', $firstDay));
                                            $after          = date('Y-m-d H:i:s', $firstDay);
                                            $before         = date('Y-m-d H:i:s', $lastDay);

                                            switch ($this->time_period)
                                            {
                                                case 'this_week':
                                                    $date   = Factory::getDate('now', $config->get('offset'));
                                                    $monday = clone $date->modify( 'Monday this week');
                                                    $monday->setTime(0, 0, 0);
                                                    $monday->setTimezone(new DateTimeZone('UCT'));
                                                    $fromDate = $monday->toSql(true);
                                                    $sunday   = clone $date->modify('Sunday this week');
                                                    $sunday->setTime(23, 59, 59);
                                                    $sunday->setTimezone(new DateTimeZone('UCT'));
                                                    $toDate = $sunday->toSql(true);
                                                    break;
                                                case 'current_month':
                                                    $date = Factory::getDate('now', $config->get('offset'));
                                                    $date->setDate($date->year, $date->month, 1);
                                                    $date->setTime(0, 0, 0);
                                                    $date->setTimezone(new DateTimeZone('UCT'));
                                                    $fromDate = $date->toSql(true);
                                                    $date     = Factory::getDate('now', $config->get('offset'));
                                                    $date->setDate($date->year, $date->month, $date->daysinmonth);
                                                    $date->setTime(23, 59, 59);
                                                    $date->setTimezone(new DateTimeZone('UCT'));
                                                    $toDate = $date->toSql(true);
                                                    break;
                                                case 'last_month':
                                                    $date = Factory::getDate('first day of last month', $config->get('offset'));
                                                    $date->setTime(0, 0, 0);
                                                    $date->setTimezone(new DateTimeZone('UCT'));
                                                    $fromDate = $date->toSql(true);
                                                    $date     = Factory::getDate('last day of last month', $config->get('offset'));
                                                    $date->setTime(23, 59, 59);
                                                    $date->setTimezone(new DateTimeZone('UCT'));
                                                    $toDate = $date->toSql(true);
                                                    break;
                                                case 'this_year':
                                                    $date = Factory::getDate('now', $config->get('offset'));
                                                    $date->setDate($date->year, 1, 1);
                                                    $date->setTime(0, 0, 0);
                                                    $date->setTimezone(new DateTimeZone('UCT'));
                                                    $fromDate = $date->toSql(true);
                                                    $date     = Factory::getDate('now', $config->get('offset'));
                                                    $date->setDate($date->year, 12, 31);
                                                    $date->setTime(23, 59, 59);
                                                    $date->setTimezone(new DateTimeZone('UCT'));
                                                    $toDate = $date->toSql(true);
                                                    break;
                                                case 'last_year':
                                                    $date = Factory::getDate('now', $config->get('offset'));
                                                    $date->setDate($date->year - 1, 1, 1);
                                                    $date->setTime(0, 0, 0);
                                                    $date->setTimezone(new DateTimeZone('UCT'));
                                                    $fromDate = $date->toSql(true);
                                                    $date     = Factory::getDate('now', $config->get('offset'));
                                                    $date->setDate($date->year - 1, 12, 31);
                                                    $date->setTime(23, 59, 59);
                                                    $date->setTimezone(new DateTimeZone('UCT'));
                                                    $toDate = $date->toSql(true);
                                                    break;
                                            }

                                            $orders         = DonationModelDonors::getMonthlyReport($this->time_period, $this->campaignId, $this->payment_method);
                                            $orderCounts    = array();
                                            $orderAmounts   = array();
                                            // Blank date ranges to begin
                                            $firstDay       = strtotime($fromDate);
                                            $lastDay        = strtotime($toDate);
                                            if ((date('m') - $currentMonthOffset)==0) :
                                                $upTo       = date('d', strtotime('NOW'));
                                            else :
                                                $upTo       = date('d', $lastDay);
                                            endif;
                                            $count          = 0;
                                            while ($count < $upTo)
                                            {
                                                $time       = strtotime(date('Ymd', strtotime('+ '.$count.' DAY', $firstDay))).'000';
                                                $orderCounts[$time] = 0;
                                                $orderAmounts[$time] = 0;
                                                $count++;
                                            }
                                            if ($orders)
                                            {
                                                foreach ($orders as $order)
                                                {
                                                    $time = strtotime(date('Ymd', strtotime($order->created_date))) . '000';
                                                    if (isset($orderCounts[$time]))
                                                    {
                                                        $orderCounts[$time]++;
                                                    }
                                                    else
                                                    {
                                                        $orderCounts[$time] = 1;
                                                    }
                                                    if (isset($orderAmounts[$time]))
                                                    {
                                                        $orderAmounts[$time] = $orderAmounts[$time] + $order->amount;
                                                    }
                                                    else
                                                    {
                                                        $orderAmounts[$time] = (float) $order->amount;
                                                    }
                                                }
                                            }
                                            ?>
                                            var d = [
                                                <?php
                                                $values = array();
                                                foreach ($orderCounts as $key => $value)
                                                {
                                                    $values[] = "[$key, $value]";
                                                }
                                                echo implode(',', $values);
                                                ?>
                                            ];
                                            for(var i = 0; i < d.length; ++i) d[i][0] += 60 * 60 * 1000;
                                            var d2 = [
                                                <?php
                                                $values = array();
                                                foreach ($orderAmounts as $key => $value)
                                                {
                                                    $values[] = "[$key, $value]";
                                                }
                                                echo implode(',', $values);
                                                ?>
                                            ];
                                            for(var i = 0; i < d2.length; ++i) d2[i][0] += 60 * 60 * 1000;
                                            var plot = jQuery.plot(jQuery("#placeholder"), [
                                                { label: "<?php echo Text::_('JD_NUMBER_DONATIONS'); ?>", data: d },
                                                { label: "<?php echo Text::_('JD_TOTAL_DONATED_AMOUNT'); ?>", data: d2, yaxis: 2 }
                                            ], {
                                                series: {
                                                    lines: { show: true },
                                                    points: { show: true }
                                                },
                                                grid: {
                                                    show: true,
                                                    aboveData: false,
                                                    color: '#ccc',
                                                    backgroundColor: '#fff',
                                                    borderWidth: 2,
                                                    borderColor: '#ccc',
                                                    clickable: false,
                                                    hoverable: true,
                                                    markings: weekendAreas
                                                },
                                                xaxis: {
                                                    mode: "time",
                                                    timeformat: "%d %b",
                                                    tickLength: 1,
                                                    minTickSize: [1, "day"]
                                                },
                                                yaxes: [
                                                    { min: 0, tickSize: 1, tickDecimals: 0 },
                                                    { position: "right", min: 0, tickDecimals: 2 }
                                                ],
                                                colors: ["#ffbbb3", "#b53526"]
                                            });
                                            function showTooltip(x, y, contents){
                                                jQuery('<div id="tooltip">' + contents + '</div>').css({
                                                    position: 'absolute',
                                                    display: 'none',
                                                    top: y + 5,
                                                    left: x + 5,
                                                    border: '1px solid #fdd',
                                                    padding: '2px',
                                                    'background-color': '#fee',
                                                    opacity: 0.80
                                                }).appendTo("body").fadeIn(200);
                                            }
                                            var previousPoint = null;
                                            jQuery("#placeholder").bind("plothover", function(event, pos, item){
                                                if(item){
                                                    if(previousPoint != item.dataIndex){
                                                        previousPoint = item.dataIndex;
                                                        jQuery("#tooltip").remove();
                                                        if(item.series.label == "<?php echo Text::_('JD_NUMBER_DONATIONS','jigoshop'); ?>"){
                                                            var y = item.datapoint[1];
                                                            showTooltip(item.pageX, item.pageY, item.series.label + " - " + y);
                                                        } else {
                                                            var y = item.datapoint[1].toFixed(2);
                                                            showTooltip(item.pageX, item.pageY, item.series.label + " - <?php echo '$'; ?>" + y);
                                                        }
                                                    }
                                                }
                                                else {
                                                    jQuery("#tooltip").remove();
                                                    previousPoint = null;
                                                }
                                            });
                                        });
                                        /* ]]> */
                                    </script>
                                </div>
							</td>
						</tr>
                    </tbody>
                </table>
            </div>
            <?php
            if($this->config->use_campaign)
            {
                ?>
                <div class="campaignProgressBars">
                    <div class="campaignProgressBarsheading">
                        <?php
                        echo strtoupper(Text::_('JD_CAMPAIGNS_STATISTIC'));
                        ?>
                    </div>
                    <?php
                    foreach ($this->campaigns as $item)
                    {
						if($item->goal > 0)
						{
							$donatedPercent = ceil($item->total_donated/ $item->goal *100);
						}
						else
						{
							$donatedPercent = 100;
						}
                        ?>
                        <div class="<?php echo $rowFluidClass; ?>">
                            <div class="<?php echo $span12Class; ?>">
                                <strong>
                                    <?php
                                    echo $item->title;
                                    ?>
                                </strong>
                                <?php
                                if($item->start_date != "" && $item->start_date != "0000-00-00 00:00:00")
                                {
                                    ?>
                                    <span class="campaignCreated">
                                        <?php echo $item->start_date; ?>
                                    </span>
                                    <?php
                                }
                                ?>
                                <div class="progress">
                                    <div class="bar" style="width: <?php echo $donatedPercent; ?>%"></div>
                                </div>
                                <div class="<?php echo $rowFluidClass; ?>">
                                    <div class="span6" style="color:gray;">
                                        <?php echo Text::_('JD_RAISED'); ?>
                                        <strong>
                                            <?php echo DonationHelperHtml::formatAmount($this->config, $item->total_donated,$item->currency_symbol); ?>
                                        </strong>
                                        &nbsp;
                                        -
                                        &nbsp;
                                        <?php echo Text::_('JD_DONATED'); ?>
                                        <strong>
                                            <?php echo $donatedPercent; ?>%
                                        </strong>
                                    </div>
                                    <div class="span6" style="text-align: right;">
                                        <?php echo Text::_('JD_GOAL'); ?>
                                        <strong>
                                            <?php echo DonationHelperHtml::formatAmount($this->config, $item->goal,$item->currency_symbol) ; ?>
                                        </strong>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <?php
                    }
                    ?>
                </div>
                <?php
            }
            if(count($this->donated_by_countries))
            {
                ?><div class="countriesStatistic">
                    <div class="countriesStatisticheading">
                        <?php
                        echo strtoupper(Text::_('JD_DONATION_RECORDS_BY_LOCATION'));
                        ?>
                    </div>
                    <?php
                    foreach ($this->donated_by_countries as $row)
                    {
                        ?>
                        <div class="country_title">
                            <?php
                            if($row->country != "")
                            {
                                echo $row->country;
                            }
                            else
                            {
                                echo "Not set";
                            }
                            ?>
                        </div>
                        <div class="donated_amount">
                            <?php echo DonationHelperHtml::formatAmount($this->config, $row->donated_amount,$row->currency_symbol); ?>
                        </div>
                        <?php
                    }
                    ?>
                </div>
                <?php
            }
            ?>
        </div>
    </div>
    <input type="hidden" name="task" value="" />
    <?php echo HTMLHelper::_( 'form.token' ); ?>
</form>
<script type="text/javascript">
<?php
if($jinput->input->getString('tmpl','') == "component")
{
	?>
		window.print();
	<?php
}
?>
</script>
PK         ! j0                    edit.phpnu [        PK         ! [o                   html.phpnu [        PK         ! #o,   ,   
              index.htmlnu [        PK         ! mNE9  9               +  tmpl/default_shortstatistics.phpnu [        PK         ! FVxA  A              /  tmpl/default_useful_links.phpnu [        PK         ! Z>|	  	              B5  tmpl/default_donors.phpnu [        PK         ! f))  )              >  tmpl/default_statistics.phpnu [        PK         ! #o,   ,               h  tmpl/index.htmlnu [        PK         ! f  f              8i  tmpl/default.phpnu [        PK    	 	   6    