/*************************************************************************** * Dolphin Smart Community Builder * ----------------- * begin : Mon Mar 23 2006 * copyright : (C) 2006 BoonEx Group * website : http://www.boonex.com/ * This file is part of Dolphin - Smart Community Builder * * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. * http://creativecommons.org/licenses/by/3.0/ * * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the Creative Commons Attribution 3.0 License for more details. * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, * see license.txt file; if not, write to marketing@boonex.com ***************************************************************************/ require_once( '../inc/header.inc.php' ); require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' ); require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' ); require_once( BX_DIRECTORY_PATH_INC . 'admin_design.inc.php' ); require_once( BX_DIRECTORY_PATH_INC . 'checkout.inc.php' ); require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' ); $sHead = ''; if (getParam("enable_aff") != 'on') { $sHead = "("._t("_affiliate_system_was_disabled").")"; } $logged['admin'] = member_auth( 1, true, true ); $tr = array(); $tr_query = ""; $order_num_disabled = 'disabled="disabled"'; $last_disabled = 'disabled="disabled"'; $date_disabled = 'disabled="disabled"'; $between_disabled = 'disabled="disabled"'; switch ( $_POST['calculation_type'] ) { case 'total': $tr_query = "SELECT * FROM `Transactions` WHERE `Status` = 'approved' ORDER BY `Date` DESC"; break; case 'order_num': $order_id = process_db_input( $_POST['tr_order_num'] ); $tr['order_num'] = process_pass_data( $_POST['tr_order_num'] ); $tr_query = "SELECT * FROM `Transactions` WHERE `gtwTransactionID` = '$order_id' AND `Status` = 'approved' ORDER BY `Date` DESC"; $order_num_disabled = ""; break; case 'last': $last_days = (int)$_POST['tr_last_days']; $tr['last_days'] = process_pass_data( $_POST['tr_last_days'] ); $tr_query = "SELECT * FROM `Transactions` WHERE ( TO_DAYS( NOW() ) - TO_DAYS( `Date` ) <= $last_days ) AND `Status` = 'approved' ORDER BY `Date` DESC"; $last_disabled = ""; break; case 'date': $exact_date = strtotime( $_POST['tr_exact_date'] ); $tr['exact_date'] = process_pass_data( $_POST['tr_exact_date'] ); if ( $exact_date != -1 ) { $tr_query = "SELECT * FROM `Transactions` WHERE TO_DAYS( FROM_UNIXTIME($exact_date) ) = TO_DAYS( `Date` ) AND `Status` = 'approved' ORDER BY `Date` DESC"; } else { $tr_query = ""; $tr['error_text'] = "Please specify correct dates"; } $date_disabled = ""; break; case 'between': // First date parse if ( $_POST['tr_between_date1'] == 'start' ) $between_date1 = 0; elseif ( $_POST['tr_between_date1'] == 'now' ) $between_date1 = time(); else $between_date1 = strtotime( $_POST['tr_between_date1'] ); // Second date parse if ( $_POST['tr_between_date2'] == 'start' ) $between_date2 = 0; elseif ( $_POST['tr_between_date2'] == 'now' ) $between_date2 = time(); else $between_date2 = strtotime( $_POST['tr_between_date2'] ); $tr['between_date1'] = process_pass_data( $_POST['tr_between_date1'] ); $tr['between_date2'] = process_pass_data( $_POST['tr_between_date2'] ); if ( $between_date1 != -1 && $between_date2 != -1 ) { $tr_query = "SELECT * FROM `Transactions` WHERE ( TO_DAYS( FROM_UNIXTIME($between_date1) ) <= TO_DAYS( `Date` ) AND TO_DAYS( FROM_UNIXTIME($between_date2) ) >= TO_DAYS( `Date` ) ) AND `Status` = 'approved' ORDER BY `Date` DESC"; } else { $tr_query = ""; $tr['error_text'] = "Please specify correct dates"; } $between_disabled = ""; break; } // Calculations if ( strlen($tr_query) ) { $fin = getFinanceStat( $tr ); } // Transactions if ( strlen($tr_query) ) { $tr_res = db_res( $tr_query ); $tr_num = mysql_num_rows( $tr_res ); } else { $tr_num = 0; } $_page['header'] = "Finance"; $_page['header_text'] = "Calculations and transactions"; ob_start(); ?>
$helpDivCode = ob_get_contents(); ob_end_clean(); TopCodeAdmin( $helpDivCode ); ContentBlockHead("Finance ".$sHead); if ( strlen($tr['error_text']) ) echo "Calculations for the query | |
Membership subscriptions | = $doll.$fin['membership_amount']; ?> |
Contact sales | = $doll.$fin['sales_amount']; ?> |
Events tickets | = $doll.$fin['sdating_amount']; ?> |
Total | = $doll.$fin['total']; ?> |
Transactions | |||||
No transactions available | |||||
Order number | Date | Member | Provider | Info | Sum paid, = $currency_code ?> |
= $tr_arr['gtwTransactionID'] ?> | = $tr_arr['Date'] ?> | = "{$tr_arr['IDMember']}" ?> | = $paymentProviders[$tr_arr['IDProvider']]['Caption'] ?> | Info | = sprintf( "%.2f", $tr_arr['Amount'] ) ?> |