Skip to content

Commit

Permalink
0.5.4 rev 3483
Browse files Browse the repository at this point in the history
  • Loading branch information
nightflyza committed May 16, 2014
1 parent ba9459f commit 4180f7c
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 40 deletions.
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.4 rev 3481
0.5.4 rev 3483
2 changes: 1 addition & 1 deletion config/alter.ini
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ NMCHANGE=0
;Highlight rows in online module
ONLINE_LIGHTER=1
;OpenPayz support
OPENPAYZ_SUPPORT=1
OPENPAYZ_SUPPORT=0
;OpenPayz manual mode?
OPENPAYZ_MANUAL=1
;OpenPayz cash type
Expand Down
79 changes: 44 additions & 35 deletions modules/general/openpayz/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,42 @@ function zb_OPGetCount() {
}


function zb_OPShowGraphs() {
$query="SELECT * from `op_transactions` ORDER by `date` ASC";
$all= simple_queryall($query);
$psysdata=array();
$result= wf_Link('?module=openpayz', __('Back'), true, 'ubButton');
if (!empty($all)) {
foreach ($all as $io=>$each) {
$timestamp= strtotime($each['date']);
$date= date("Y-m-d",$timestamp);
if (isset($psysdata[$each['paysys']][$date]['count'])) {
$psysdata[$each['paysys']][$date]['count']++;
$psysdata[$each['paysys']][$date]['summ']=$psysdata[$each['paysys']][$date]['summ']+$each['summ'];
} else {
$psysdata[$each['paysys']][$date]['count']=1;
$psysdata[$each['paysys']][$date]['summ']=$each['summ'];
}
}
}

if (!empty($psysdata)) {
foreach ($psysdata as $psys=>$opdate) {
$gdata=__('Date').','.__('Count').','.__('Cash')."\n";
foreach ($opdate as $datestamp=>$optrans) {
$gdata.=$datestamp.','.$optrans['count'].','.$optrans['summ']."\n";
}

$result.=wf_tag('div', false, 'dashtask', '');
$result.=wf_tag('span').$psys.wf_tag('span',true).wf_delimiter();
$result.= wf_Graph($gdata, '600', '200',false);
$result.=wf_tag('div',true);
}

}
show_window(__('Graphs'), $result);
}

function web_OPShowTransactions() {
global $alter_conf;
$perpage=100;
Expand Down Expand Up @@ -97,7 +133,8 @@ function web_OPShowTransactions() {
}
$result= wf_TableBody($rows, '100%', '0', 'sortable');
$result.=$paginator;
show_window(__('OpenPayz transactions'),$result);
$graphs= wf_Link('?module=openpayz&graphs=true', wf_img('skins/icon_stats.gif',__('Graphs')), false, '');
show_window(__('OpenPayz transactions').' '.$graphs,$result);
}

function zb_OPTransactionSetProcessed($transactionid) {
Expand Down Expand Up @@ -143,41 +180,13 @@ function zb_OPTransactionGetData($transactionid) {
}
}

function zb_OPShowGraphs() {
$curyear=date("Y");
//$query="SELECT * from `op_transactions` WHERE `date` LIKE '".$curyear."-%'";
$query="SELECT * from `op_transactions`";
$all= simple_queryall($query);
$psysdata=array();
if (!empty($all)) {
foreach ($all as $io=>$each) {
$timestamp= strtotime($each['date']);
$date= date("Y-m",$timestamp);
// $date='2014';
if (isset($psysdata[$each['paysys']][$date]['count'])) {
$psysdata[$each['paysys']][$date]['count']++;
$psysdata[$each['paysys']][$date]['summ']=$psysdata[$each['paysys']][$date]['summ']+$each['summ'];
} else {
$psysdata[$each['paysys']][$date]['count']=1;
$psysdata[$each['paysys']][$date]['summ']=$each['summ'];
}
}
}
debarr($psysdata);
if (!empty($psysdata)) {


foreach ($psysdata as $psys=>$opdate) {
foreach ($opdate as $datestamp=>$optrans) {

}

}

}
}
zb_OPShowGraphs();


if (!wf_CheckGet(array('graphs'))) {
web_OPShowTransactions();
} else {
zb_OPShowGraphs();
}


} else {
Expand Down
2 changes: 1 addition & 1 deletion modules/general/zbsannouncements/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct() {
*/

protected function loadData() {
$query = "SELECT * from `zbsannouncements` ORDER by `id` ASC;";
$query = "SELECT * from `zbsannouncements` ORDER by `id` DESC;";
$all = simple_queryall($query);
if (!empty($all)) {
foreach ($all as $io => $each) {
Expand Down
1 change: 1 addition & 0 deletions userstats/languages/russian/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,6 @@
$lang['def']['Announcements'] = 'Объявления';
$lang['def']['Do not have any announcements.'] = 'На данный момент нету никаких объявлений.';
$lang['def']['Some announcements is available'] = 'Доступны важные объявления';
$lang['def']['This module is disabled'] = 'Этот модуль сейчас отключен';

?>
2 changes: 2 additions & 0 deletions userstats/languages/ukrainian/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,6 @@
$lang['def']['Announcements'] = 'Оголошення';
$lang['def']['Do not have any announcements.'] = 'На даний момент немає жодних оголошень.';
$lang['def']['Some announcements is available'] = 'Доступні важливі оголошення';
$lang['def']['This module is disabled'] = 'Цей модуль зараз вимкнено';

?>
8 changes: 6 additions & 2 deletions userstats/modules/general/announcements/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


function zbs_AnnouncementsShow() {
$query="SELECT * from `zbsannouncements` WHERE `public`='1'";
$query="SELECT * from `zbsannouncements` WHERE `public`='1' ORDER by `id` DESC";
$all= simple_queryall($query);
$result='';
if (!empty($all)) {
Expand All @@ -31,6 +31,10 @@ function zbs_AnnouncementsShow() {
show_window('',$result);
}


if ($us_config['AN_ENABLED']) {
zbs_AnnouncementsShow();
} else {
show_window(__('Sorry'), __('This module is disabled'));
}

?>

0 comments on commit 4180f7c

Please sign in to comment.