Ejemplo n.º 1
0
         $iaView->assign('items', $iaInvoice->getItemsByInvoiceId($invoice['id']));
         $iaView->disableLayout();
         echo $iaView->display('invoice');
         return;
     } else {
         return iaView::errorPage(iaView::ERROR_NOT_FOUND);
     }
 }
 iaUsers::reloadIdentity();
 if (isset($_POST['amount'])) {
     $amount = (double) $_POST['amount'];
     if ($amount > 0) {
         if ($amount >= (double) $iaCore->get('funds_min_deposit') && $amount <= (double) $iaCore->get('funds_max_deposit')) {
             $iaTransaction->createInvoice(iaLanguage::get('funds'), $amount, iaTransaction::TRANSACTION_MEMBER_BALANCE, iaUsers::getIdentity(true), $profilePageUrl);
         } else {
             iaLanguage::set('amount_incorrect', iaLanguage::getf('amount_incorrect', array('min' => $iaCore->get('funds_min_deposit'), 'max' => $iaCore->get('funds_max_deposit'), 'currency' => $iaCore->get('currency'))));
             $iaView->setMessages(iaLanguage::get('amount_incorrect'));
         }
     } else {
         $iaView->setMessages(iaLanguage::get('amount_incorrect'));
     }
 }
 $pagination = array('page' => 1, 'limit' => 10, 'total' => 0, 'template' => $profilePageUrl . 'funds/?page={page}');
 $pagination['page'] = isset($_GET['page']) && 1 < $_GET['page'] ? (int) $_GET['page'] : $pagination['page'];
 $pagination['page'] = ($pagination['page'] - 1) * $pagination['limit'];
 $transactions = $iaDb->all('SQL_CALC_FOUND_ROWS *', '`member_id` = ' . iaUsers::getIdentity()->id . ' ORDER BY `status`', $pagination['page'], $pagination['limit'], iaTransaction::getTable());
 $pagination['total'] = $iaDb->foundRows();
 $iaView->caption($iaView->title() . ': ' . number_format(iaUsers::getIdentity()->funds, 2, '.', '') . ' ' . $iaCore->get('currency'));
 $iaView->assign('pagination', $pagination);
 $iaView->assign('transactions', $transactions);
 $iaView->display('transactions');
Ejemplo n.º 2
0
             $iaView->setMessages(iaLanguage::get('this_transaction_already_passed'), iaView::ALERT);
             iaUtil::go_to($iaPage->getUrlByName('member_funds'));
         }
         break;
     case iaTransaction::REFUNDED:
     case iaTransaction::FAILED:
         $iaView->setMessages($messages);
         iaUtil::go_to($iaPage->getUrlByName('member_funds'));
         break;
     default:
         $error = true;
         $messages[] = 'Unknown status';
 }
 $iaView->setMessages($messages, $error ? iaView::ERROR : iaView::SUCCESS);
 $memberBalance = iaUsers::hasIdentity() ? iaUsers::getIdentity()->funds : 0;
 iaLanguage::set('funds_in_your_account', iaLanguage::getf('funds_in_your_account', array('sum' => $memberBalance, 'currency' => $iaCore->get('currency'))));
 $isBalancePayment = iaUsers::hasIdentity() && iaTransaction::TRANSACTION_MEMBER_BALANCE == $transaction['item'] && iaUsers::getIdentity()->id == $transaction['item_id'];
 $isFundsEnough = (bool) (!$isBalancePayment && iaUsers::hasIdentity() && iaUsers::getIdentity()->funds >= $transaction['amount']);
 // FIXME: solution to prevent csrf catching.
 // Should be replaced once it is possible to disable csrf checking for a single page.
 if (isset($_POST)) {
     $paymentPost = $_POST;
     if (isset($_SERVER['HTTP_ORIGIN'])) {
         $wwwChunk = 'www.';
         $referrerDomain = explode(IA_URL_DELIMITER, $_SERVER['HTTP_ORIGIN']);
         $referrerDomain = strtolower($referrerDomain[2]);
         $referrerDomain = str_replace($wwwChunk, '', $referrerDomain);
         $domain = explode(IA_URL_DELIMITER, $iaCore->get('baseurl'));
         $domain = strtolower($domain[2]);
         $domain = str_replace($wwwChunk, '', $domain);
         if ($referrerDomain !== $domain) {
Ejemplo n.º 3
0
 // latest lyrics
 if ($iaView->blockExists('latest_lyrics')) {
     $sql2 = "ORDER BY t1.`date_added` DESC LIMIT 0, " . $defaultLimit;
     $iaView->assign('latest_lyrics', $iaDb->getAll($sql . $sql2));
 }
 // popular lyrics
 if ($iaView->blockExists('popular_lyrics')) {
     $sql2 = "ORDER BY t1.`views_num` DESC LIMIT 0, " . $defaultLimit;
     $iaView->assign('popular_lyrics', $iaDb->getAll($sql . $sql2));
 }
 // new lyrics
 $new_lyrics = $iaLyric->getLyrics(false, 0, 50);
 if ($new_lyrics) {
     $new_lyrics = $iaItem->updateItemsFavorites($new_lyrics, 'lyrics');
 } else {
     iaLanguage::set('no_lyrics', str_replace('{%URL%}', $iaCore->packagesData['lyrics']['url'] . 'add/', iaLanguage::get('no_lyrics')));
 }
 $iaView->assign('new_lyrics', $new_lyrics);
 // genres
 $iaCore->iaDb->setTable('lyrics_genres');
 $genres_list = $iaCore->iaDb->all("*", "`status` = 'active' ORDER BY `title` ASC");
 $iaCore->iaDb->resetTable();
 $iaView->assign('genres_list', $genres_list);
 // top artists
 if ($iaView->blockExists('top_artists')) {
     $top_artists = $iaArtist->getTopArtists();
     $iaView->assign('top_artists', $top_artists);
 }
 // new artists
 if ($iaView->blockExists('new_artists')) {
     $new_artists = $iaArtist->getLatestArtists();