Exemple #1
0
/**
 * Prints the number with the currency format
 */
function currencyNumber($number, $currency)
{
    $symbol = $symbol = currencySymbol($currency);
    if ($currency == 'USD' || $currency == 'GBP') {
        return $symbol . ' ' . number_format($number, 2);
    } else {
        return commaNumber($number, true) . ' ' . $symbol;
    }
}
function get_transactions($user, $currency = "all", $count, $format = "ucafdrst")
{
    global $mysqli, $db_table_prefix, $errors;
    $format = str_split($format);
    if ($currency != "all") {
        $args .= " and currency = '" . $currency . "'";
    }
    if ($count > 0) {
        $args .= " limit = " . $count;
    }
    $query = "Select userid, currency, amount, fiatcurrency, fiat, receiving_address, sending_address, timestamp from uc_transactions where userid = '{$user}'" . $args . " order by timestamp DESC";
    //Retrieve address balance
    $stmt = $mysqli->prepare($query);
    $stmt->execute();
    $stmt->bind_result($userid, $currency, $amount, $fiatcurrency, $fiat, $receiving_address, $sending_address, $timestamp);
    echo "<table>";
    while ($stmt->fetch()) {
        echo "<tr>";
        $transaction = array('u' => $userid, 'c' => $currency, 'a' => $amount, 'f' => $fiatcurrency, 'd' => $fiat, 'r' => $receiving_address, 's' => $sending_address, 't' => $timestamp);
        foreach ($format as $x) {
            if ($x == 't') {
                $transaction[$x] = date('m/d/Y', $transaction[$x]);
            }
            if ($x == 'f') {
                $transaction[$x] = currencySymbol($transaction[$x]);
            }
            if ($x == 'd') {
                $transaction[$x] = number_format((double) $transaction[$x], 2, '.', '');
            }
            echo "<td>" . $transaction[$x] . "</td>";
        }
        echo "</tr>";
    }
    echo "</table>";
    $stmt->close();
}
Exemple #3
0
        echo checkBasket();
        ?>
><?php 
        echo JText::_('COM_DATSOGALLERY_BASKET_ITEMS');
        ?>
 <span id="items"><?php 
        countItems();
        ?>
</span> <?php 
        echo dgTip(JText::_('COM_DATSOGALLERY_CHECKOUT'), $image = 'basket_go.png', '', JRoute::_('index.php?option=com_datsogallery&amp;task=checkout' . $itemid), '', $link = 1);
        ?>
 <div style="float: right"><?php 
        echo JText::_('COM_DATSOGALLERY_BASKET_SUBTOTAL');
        ?>
: <?php 
        echo currencySymbol($ad_pp_currency);
        ?>
<span id="subtotal"><?php 
        echo subTotal();
        ?>
</span></div></div>
<div id="dg_body_background_basket" class="dg_slider"<?php 
        echo checkBasket();
        ?>
>
  <?php 
        echo showBasket();
        ?>
</div>
<?php 
    }
Exemple #4
0
     if ($rowcounter % $ad_cp == 0) {
         echo '<tr>';
     }
     echo '<td width="' . $cw . '" class="dg_body_background_td" align="center" valign="top">';
     $ld = "<a href='" . JRoute::_("index.php?option=com_datsogallery&amp;task=image&amp;catid=" . $row->catid . "&amp;id=" . $row->id . $itemid) . "' title='" . $row->imgtitle . "'>";
     echo $ld;
     echo "<img src=\"" . resize($row->imgoriginalname, $ad_thumbwidth, $ad_thumbheight, $ad_crop, $ad_cropratio, 0, $row->catid) . "\" " . get_width_height($row->imgoriginalname, $ad_thumbwidth, $ad_thumbheight, $row->catid, $ad_cropratio) . " class=\"dgimg\" title=\"" . $row->imgtitle . "\" alt=\"" . $row->imgtitle . "\" /></a>";
     if ($ad_showdetail) {
         echo "<div style=\"width:" . $ad_thumbwidth . "px;margin:10px auto 0 auto;text-align:left;text-transform: uppercase;\">";
         echo $ad_showimgtitle ? $ld . '<span>' . $row->imgtitle . '</span></a><br />' : '';
         ?>
 <span>
   <?php 
         echo $ad_showfimgdate ? '<strong>' . JText::_('COM_DATSOGALLERY_DATE_ADD') . '</strong>: ' . strftime($ad_datef, $row->imgdate) . '<br />' : '';
         echo $task == 'purchases' ? '<strong>' . JText::_('COM_DATSOGALLERY_DATE_PURCHASED') . '</strong>: ' . strftime($ad_datef, strtotime($row->date)) . '<br />' : '';
         echo $task == 'purchases' ? '<strong>' . JText::_('COM_DATSOGALLERY_PRICE') . '</strong>: ' . currencySymbol($ad_pp_currency) . $row->imgprice . '<br />' : '';
         echo $ad_showimgcounter ? '<strong>' . JText::_('COM_DATSOGALLERY_HITS') . '</strong>: ' . $row->imgcounter . '<br />' : '';
         echo $ad_showdownloads ? '<strong>' . JText::_('COM_DATSOGALLERY_DOWNLOADS') . '</strong>: ' . $row->imgdownloaded . '<br />' : '';
         echo $ad_showrating ? showVote($row->id, $row->imgvotes, $row->imgvotesum) : '';
         if ($ad_showcomments) {
             $db->setQuery('SELECT COUNT(cmtid) FROM #__datsogallery_comments WHERE cmtpic = ' . $row->id . ' AND published = 1');
             $comments = $db->loadResult();
             $comments = $comments ? $comments : JText::_('COM_DATSOGALLERY_NO');
             echo "<strong>" . JText::_('COM_DATSOGALLERY_COMMENTS') . "</strong>: {$comments}";
         }
         ?>
 </span>
 <?php 
         echo '</div>';
     }
     echo '</td>';
Exemple #5
0
     if ($rowcounter % $ad_cp == 0) {
         echo '<tr>';
     }
     echo '<td width="' . $cw . '" class="dg_body_background_td" align="center" valign="top">';
     $ld = "<a href='" . JRoute::_("index.php?option=com_datsogallery&amp;task=image&amp;catid=" . $row->catid . "&amp;id=" . $row->id . $itemid) . "' title='" . $row->imgtitle . "'>";
     echo $ld;
     echo "<img src=\"" . resize($row->imgoriginalname, $ad_thumbwidth, $ad_thumbheight, $ad_crop, $ad_cropratio, 0, $row->catid) . "\" " . get_width_height($row->imgoriginalname, $ad_thumbwidth, $ad_thumbheight, $row->catid, $ad_cropratio) . " class=\"dgimg\" title=\"" . $row->imgtitle . "\" alt=\"" . $row->imgtitle . "\" /></a>";
     if ($ad_showdetail) {
         echo "<div style=\"width:" . $ad_thumbwidth . "px;margin:10px auto 0 auto;text-align:left;text-transform: uppercase;\">";
         echo $ad_showimgtitle ? $ld . '<span>' . $row->imgtitle . '</span></a><br />' : '';
         ?>
 <span>
   <?php 
         echo $ad_showfimgdate ? '<strong>' . JText::_('COM_DATSOGALLERY_DATE_ADD') . '</strong>: ' . strftime($ad_datef, $row->imgdate) . '<br />' : '';
         echo $task == 'purchases' ? '<strong>' . JText::_('COM_DATSOGALLERY_DATE_PURCHASED') . '</strong>: ' . strftime($ad_datef, strtotime($row->date)) . '<br />' : '';
         echo $task == 'purchases' ? '<strong>' . PRICE . '</strong>: ' . currencySymbol($ad_pp_currency) . $row->imgprice . '<br />' : '';
         echo $ad_showimgcounter ? '<strong>' . JText::_('COM_DATSOGALLERY_HITS') . '</strong>: ' . $row->imgcounter . '<br />' : '';
         echo $ad_showdownloads ? '<strong>' . JText::_('COM_DATSOGALLERY_DOWNLOADS') . '</strong>: ' . $row->imgdownloaded . '<br />' : '';
         echo $ad_showrating ? showVote($row->id, $row->imgvotes, $row->imgvotesum) : '';
         if ($ad_showcomments) {
             $db->setQuery('SELECT COUNT(cmtid) FROM #__datsogallery_comments WHERE cmtpic = ' . $row->id . ' AND published = 1');
             $comments = $db->loadResult();
             $comments = $comments ? $comments : JText::_('COM_DATSOGALLERY_NO');
             echo "<strong>" . JText::_('COM_DATSOGALLERY_COMMENTS') . "</strong>: {$comments}";
         }
         if ($task == 'favorites') {
             ?>
   <div class="favbox" style="float:right">
     <span class="favorites" id="<?php 
             echo $row->id;
             ?>
function showBasket()
{
    $db = JFactory::getDBO();
    $user = JFactory::getUser();
    require JPATH_COMPONENT_ADMINISTRATOR . DS . 'config.datsogallery.php';
    require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'images.datsogallery.php';
    $db->setQuery('SELECT a.*, c.image_id' . ' FROM #__datsogallery AS a,' . ' #__datsogallery_basket AS c' . ' WHERE a.id = c.image_id' . ' AND c.user_id = ' . (int) $user->id . ' GROUP BY a.id' . ' ORDER BY c.id ASC');
    $rows = $db->loadObjectList();
    $out = "";
    ?>
      <script type="text/javascript">
        datso(document).ready(function() {
            datso(".dg_item_id").click(function () {
                var id = datso(this).attr("id");
                var data = 'id=' + id;
                var parent = datso(this);
                datso(this).css({
                    opacity: '1.0'
                }, 50);
                datso.ajax({
                    type: "post",
                    url: siteurl + 'index.php?option=com_datsogallery&task=addtobasket&format=raw',
                    data: data,
                    cache: false,
                    success: function (response) {
                        parent.animate({
                            opacity: '0'
                        }, 300).hide(1);
                        datso(".dg_slider").html(response);
                        update_subtotal();
                        update_total();
                    }
                });
                return false;
            });
        });
      </script>
     <?php 
    if (count($rows) > 0) {
        foreach ($rows as $row) {
            $out .= "<div class=\"dg_basket\">\n";
            $out .= " <ul>\n";
            $out .= "   <li id=\"image\"><img src=\"" . resize($row->imgoriginalname, $ad_thumbwidth1, $ad_thumbheight1, $ad_crop, '1:1', 0, $row->catid) . "\" " . get_width_height($row->imgoriginalname, $ad_thumbwidth1, $ad_thumbheight1, $row->catid, '1:1') . " class=\"dgimg\" alt=\"\" /></li>\n";
            $out .= "   <li id=\"item\">" . shortName($row->imgtitle, 10) . "</li>\n";
            $out .= "   <li id=\"cost\"><span>" . JText::_('COM_DATSOGALLERY_PRICE') . ":</span> " . currencySymbol($ad_pp_currency) . $row->imgprice . "</li><br />\n";
            $out .= "   <li class=\"dg_basket_box\">\n";
            $out .= "     <span class=\"dg_item_id\" id=\"" . $row->id . "\">\n";
            $out .= "       <span title=\"" . JText::_('COM_DATSOGALLERY_REMOVE_FROM_BASKET') . "\"><span class=\"remove_from_basket\"></span></span>\n";
            $out .= "     </span>\n";
            $out .= "   </li>\n";
            $out .= " </ul>\n";
            $out .= "</div>\n";
        }
        $out .= "<div class=\"dg_clear\"></div>\n";
    } else {
        $out .= "<div style=\"font-size:16px;text-align:center;\">" . JText::_('COM_DATSOGALLERY_EMPTY_BASKET') . "</div>";
        $out .= "<div class=\"dg_clear\"></div>";
    }
    return $out;
}
function currencyPrefForm($user)
{
    $cs = currencySymbol($user);
    echo "Preffered Currency\n\t\t\t\t<select name='prefcurrency' id='currency'>\n\t\t\t\t\t<option value='pound'";
    if ($cs == "&pound;") {
        echo " selected='selected'";
    }
    echo ">&pound;</option>\n\t\t\t\t\t<option value='dollar'";
    if ($cs == "&dollar;") {
        echo " selected='selected'";
    }
    echo ">&dollar;</option>\n\t\t\t\t\t<option value='euro'";
    if ($cs == "&euro;") {
        echo " selected='selected'";
    }
    echo ">&euro;</option>\n\t\t\t\t</select>\n\t\t\t\t<button onclick=\"updateCurrency()\">Update</button>";
}
/* This file is part of the Prestashop Netbanx payment module (iitc).        *
 * Copyright Dave Barker 2009                                                *
 *                                                                           *
 * The Prestashop Netbanx payment module (iitc) is free software: you can    *
 * redistribute it and/or modify it under the terms of the GNU General Public*
 * License as published by the Free Software Foundation, either version 3    *
 * of the License, or (at your option) any later version.                    *
 *                                                                           *
 * the Prestashop Netbanx payment module (iitc) 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 *
 * GNU General Public License for more details.                              *
 *                                                                           *
 * You should have received a copy of the GNU General Public License         *
 * along with the Prestashop Netbanx payment module (iitc).                  *
 * If not, see <http://www.gnu.org/licenses/>.                               */
include dirname(__FILE__) . '/../../config/config.inc.php';
include dirname(__FILE__) . '/iitc_netbanx.php';
if (intval(Configuration::get('PS_REWRITING_SETTINGS')) === 1) {
    $rewrited_url = __PS_BASE_URI__;
}
if (!parseBoolString(Configuration::get("IITC_NETBANX_IFRAME"))) {
    include dirname(__FILE__) . '/../../header.php';
}
// Prepare information
$smarty->assign('reference', htmlentities($_GET['nbx_netbanx_reference']));
$smarty->assign('amount', currencySymbol($_GET['nbx_currency_code']) . formatAmount($_GET['nbx_payment_amount'], Configuration::get("IITC_NETBANX_MINORUNITS")));
$smarty->display(dirname(__FILE__) . '/success.tpl');
if (!parseBoolString(Configuration::get("IITC_NETBANX_IFRAME"))) {
    include dirname(__FILE__) . '/../../footer.php';
}