$message = MSG_USER_DELETED; break; default: } // switch } $currencycode = getSellerCurrencySybol($artistid); $currencySymbol = getCurrencySybol($currencycode); /*---------Multicart 2.0 Upgradation---------*/ $hide_shipping_display = 0; $select_order = "SELECT prd.product_id \n FROM " . $tableprefix . "products prd," . $tableprefix . "orders ord," . $tableprefix . "order_details ord_det\n WHERE ord.order_id = ord_det.order_id\n AND ord_det.product_id = prd.product_id\n AND prd.vdigital_product = 'Y'\n AND ord.order_id = " . $orderid; $result_order = mysql_query($select_order) or die(mysql_error()); if (mysql_num_rows($result_order) > 0) { $hide_shipping_display = 1; } $sellerCurrency = getSellerCurrencySybol($artistid); $select_order_gift = "SELECT prd.product_id \n FROM " . $tableprefix . "products prd," . $tableprefix . "orders ord," . $tableprefix . "order_details ord_det," . $tableprefix . "categories cat\n WHERE ord.order_id = ord_det.order_id\n AND ord_det.product_id = prd.product_id\n AND prd.product_category = cat.category_id\n AND cat.gift_certificate_flag = 'Y'\n AND ord.order_id = " . $orderid; $result_order_gift = mysql_query($select_order_gift) or die(mysql_error()); if (mysql_num_rows($result_order_gift) > 0) { $hide_shipping_display = 1; } /*---------Multicart 2.0 Upgradation---------*/ //$qryopt1 .= " AND o.vorder_currency = cm.vcurrency_code "; $qryopt1 = " "; /* $sql=" SELECT o.*, u.user_name, u.email,s.order_status,od.product_discount,od.product_quantity, cm.nexchange_price,vcurrency_name, sum((od.product_price-(od.product_price*product_discount/100)) * od.product_quantity) as total ,sd.nshipping_cost FROM ".$tableprefix."orders o,".$tableprefix."currency_master cm INNER JOIN ".$tableprefix."users u ON o.user_id = u.user_id INNER JOIN ".$tableprefix."order_status s ON o.order_status = s.order_status_id INNER JOIN ".$tableprefix."order_details od ON o.order_id = od.order_id INNER JOIN ".$tableprefix."shipping_details sd ON sd.norder_id = od.order_id
include "../includes/functions.php"; if (get_magic_quotes_gpc()) { $_POST = array_map('stripslashes_deep', $_POST); $_GET = array_map('stripslashes_deep', $_GET); $_COOKIE = array_map('stripslashes_deep', $_COOKIE); } if (isset($_SESSION["sess_artistid"]) and $_SESSION["sess_artistid"] != "") { $artistid = $_SESSION["sess_artistid"]; } else { header("Location:login.php"); exit; } if (isset($_POST['gotoPage'])) { header("Location:" . $_SERVER['PHP_SELF'] . "?page=" . $_POST['gotoPage']); } $currencycode = getSellerCurrencySybol($artistid); $currencySymbol = getCurrencySybol($currencycode); $sql = "SELECT mto.* FROM " . $tableprefix . "madetoorder mto\n INNER JOIN " . $tableprefix . "products p ON mto.product_id = p.product_id "; if (isset($_GET["txtSearch"]) and $_GET["txtSearch"] != "") { $txtSearch = $_GET["txtSearch"]; $cmbSearchType = $_GET["cmbSearchType"]; } else { if (isset($_POST["txtSearch"]) and $_POST["txtSearch"] != "") { $txtSearch = $_POST["txtSearch"]; $cmbSearchType = $_POST["cmbSearchType"]; } } $qryopt = ""; $txtSearch = trim($txtSearch); $qryopt .= "WHERE p.product_artist_id = '" . mysql_real_escape_string($artistid) . "' "; if ($txtSearch != "") {
function exportCSV($artistid) { global $tableprefix; $adminCurrency = GetAdminCurrency(); $currencycode = getSellerCurrencySybol($artistid); $currencySymbol = getCurrencySybol($currencycode); $csv = new CSV(array('Order #', 'Order Total', 'Commission (%)', 'Total Tax Amount', 'Total Shipping Amount', 'Product Total Amount', 'Amount Received [ Product Total Amount - Admin Commision + Product Shipping + Tax ]', 'Date Paid(mm/dd/yyyy)', 'Payment Status'), ";"); $qryopt = ""; $qrybtw = ""; $sql = " SELECT sp.*,s.artist_name FROM " . $tableprefix . "artist_payments sp\n\t\tINNER JOIN " . $tableprefix . "artists s ON sp.artist_id = s.artist_id\n INNER JOIN " . $tableprefix . "orders o ON o.order_id = sp.order_id" . $qryopt . "\n\t\tWHERE sp.artist_id = '" . addslashes($artistid) . "' AND o.vpayment_status='C'" . $qrybtw . "order by sp.artist_payment_id DESC "; $rs = mysql_query($sql) or die("qqqq" . mysql_error()); $result = mysql_query($sql) or die("www" . mysql_error()); if (mysql_num_rows($result) > 0) { $i = 1; $total = 0; while ($row = mysql_fetch_array($rs)) { $txtPaymentDate = isNotNull($row["payment_date"] and $row["payment_date"] != "0000-00-00") ? dateFormat($row["payment_date"], "Y-m-d", "m/d/Y") : " Not Yet Settled;"; if ($row['payment_status'] == 'P') { $Paymentstatus = 'Pending'; } else { $Paymentstatus = 'Paid'; } $qryopt1 = " "; $taxtotal = 0; $sql1 = "SELECT o.*, u.user_name, u.email, od.product_discount,sum( (od.product_price-(od.product_price*product_discount/100)) * od.product_quantity) as total,sum(od.product_tax)as taxtotal\n\t\tFROM " . $tableprefix . "orders o\n\t\tINNER JOIN " . $tableprefix . "users u ON o.user_id = u.user_id\n\t\tINNER JOIN " . $tableprefix . "order_details od ON o.order_id = od.order_id\n\t\tWHERE od.artist_id = '" . $artistid . "'\n AND o.order_id = " . $row['order_id'] . "\n\t\tAND o.vpayment_status != 'P'" . $qryopt1 . " GROUP BY o.order_id ORDER BY o.order_date,o.order_id DESC "; $sellerCurrency = getSellerCurrencySybol($artistid); $result1 = mysql_query($sql1); if (mysql_num_rows($result1) != 0) { $row1 = mysql_fetch_array($result1); $ordernumber = $row1["order_id"]; $username = $row1["user_name"]; if ($row1['vorder_currency'] != $sellerCurrency and $row1['vorder_currency'] != "USD") { $get_conversion_price = getCurrencyrate($sellerCurrency); $ordertotal = $row1["total"]; } else { $ordertotal = $row1["total"]; } $taxtotal = $row1["taxtotal"]; } $select_shipping_cost = "SELECT sd.vshipping_name, sd.nshipping_cost,od.product_name\n FROM " . $tableprefix . "shipping_details sd," . $tableprefix . "order_details od\n WHERE od.product_id=sd.nshp_productid\n AND norder_id = " . $row['order_id'] . "\n AND nshp_status = 'C'\n AND od.artist_id = '" . $artistid . "'\n GROUP BY sd.nshp_productid order by od.product_name"; $result_shipping_cost = mysql_query($select_shipping_cost); if (mysql_num_rows($result_shipping_cost) > 0) { $totalshippingcost = 0; while ($shipping_row = mysql_fetch_array($result_shipping_cost)) { $totalshippingcost += $shipping_row['nshipping_cost']; } } $csv->addRow(array($row["order_id"], html_entity_decode($adminCurrency['currency_symbol']) . " " . number_format($row["seller_order_total_amount"], 2, '.', ''), $row["commission_percentage"], html_entity_decode($adminCurrency['currency_symbol']) . " " . number_format($taxtotal, 2, '.', ''), html_entity_decode($adminCurrency['currency_symbol']) . " " . number_format($totalshippingcost, 2, '.', ''), html_entity_decode($adminCurrency['currency_symbol']) . " " . number_format($row["total_amount"], 2, '.', ''), html_entity_decode($adminCurrency['currency_symbol']) . " " . number_format($row["amount_paid"], 2, '.', ''), $txtPaymentDate, $Paymentstatus)); $artistName = $row["artist_name"]; $i++; $total += $row["amount_paid"]; } if ($total > 0) { $csv->addRow(array(' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ')); $csv->addRow(array(' ', ' ', ' ', ' ', ' ', ' ', 'Total Seller Amount Received', html_entity_decode($currencySymbol) . " " . number_format($total, 2, '.', ''), ' ')); } } // export csv as a download $filename = 'order_payment_details_' . $artistName; //$filename = 'order_payment_details'.$artistid; $csv->export($filename); // *or* pass the csv data to a variable as a string //$string = $csv; }
function getSellerCartTotal($userid, $sellerid) { global $tableprefix; $sql = "SELECT c.*, (p.product_price+po.additional_price) AS product_price,p.product_artist_id,po.discount\n FROM " . $tableprefix . "cart c\n INNER JOIN " . $tableprefix . "product_options po ON po.product_option_id = c.product_option_id\n INNER JOIN " . $tableprefix . "products p ON p.product_id = po.product_id\n\t WHERE c.user_id = '" . addslashes($userid) . "' and p.product_artist_id='" . $sellerid . "' "; $result = mysql_query($sql); $total = 0; $itemcount = 0; $currency_attributes = displayCurrencyType(); if (mysql_num_rows($result) != 0) { while ($row = mysql_fetch_array($result)) { $get_convert_price = getSellerCurrency($row["product_id"]); $sellercurreny = getSellerCurrencySybol($row["product_artist_id"]); if ($currency_attributes[2] != "USD" and $sellercurreny != $currency_attributes[2]) { // user selected currency equllaent USD value // 1 USD equllaent user currency $get_convert_price = 1 / getUserCurrencyExvalue($currency_attributes[2]); $converted_price = $row["product_price"] * $get_convert_price; } else { if ($sellercurreny != "USD" and $sellercurreny != $currency_attributes[2]) { if ($get_convert_price != "") { $converted_price = $row["product_price"] * $get_convert_price; } // end if } else { $converted_price = $row["product_price"]; } } // end else $price = $row["quantity"] * $converted_price; if ($row["discount"] != "0") { $price = $price - $price * $row["discount"] / 100; } $total += $price; } } return $total; }
$sql = "SELECT sp.*, s.artist_name FROM " . $tableprefix . "artist_payments sp INNER JOIN " . $tableprefix . "artists s ON sp.artist_id = s.artist_id\n WHERE sp.artist_payment_id = '" . addslashes($paymentid) . "' "; $result = mysql_query($sql); if (mysql_num_rows($result) != 0) { $row = mysql_fetch_array($result); $txtArtistName = $row["artist_name"]; $txtOrderNumber = $row["order_id"]; $txtOrderTotal = $row["seller_order_total_amount"]; $txtTotalPaid = $row["amount_paid"]; $txtsellerTotal = $row["total_amount"]; $txtArtistCommission = $row["admin_commision_amount"]; $txtPaymentMarkedDate = isNotNull($row["date_marked_for_payment"]) ? dateFormat($row["date_marked_for_payment"], "Y-m-d", "m/d/Y") : ""; $txtPaymentDate = isNotNull($row["payment_date"] and $row["payment_date"] != "0000-00-00") ? dateFormat($row["payment_date"], "Y-m-d", "m/d/Y") : ""; $txtComments = $row["comments"]; $txtPaymentMethod = $row["payment_method"]; $PaymentStatus = $row['payment_status']; $currencycode = getSellerCurrencySybol($row['artist_id']); $currencySymbol = getCurrencySybol($currencycode); } include "../includes/htmltop.php"; ?> <link href="../style/calendar-win2k-cold-1.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="../includes/calendar.js"></script> <script type="text/javascript" src="../includes/calendar-setup.js"></script> <script type="text/javascript" src="../includes/calendar-en.js"></script> <SCRIPT> function confirmDelete(){ if(confirm("Are you sure you want to delete this record?") ){ return true; } return false; }
<th width="15%" align="left">Rate</th> <th width='13%' align="left">Qty</th> <th width='13%' align="left">Price</th> <th width='8%' align="left">Status</th> </tr> <?php $sql = "SELECT od.*, o.vorder_currency,o.taxrate,s.order_status,gm.ngift_product_id,gm.vgift_coupon_code\n FROM " . $tableprefix . "order_details od\n\t\t INNER JOIN " . $tableprefix . "order_status s ON s.order_status_id = od.item_status\n\t\t LEFT JOIN " . $tableprefix . "giftcertificates gm ON gm.ngift_product_id=od.product_id AND gm.ngift_order_id=od.order_id\n\t\t LEFT JOIN " . $tableprefix . "orders o ON o.order_id=od.order_id\n\t\t\t WHERE od.order_id = '" . addslashes($orderid) . "'\n AND (od.artist_id = '" . $artists[$i] . "')\n GROUP BY od.product_id"; //echo $sql . "<br>"; $result1 = mysql_query($sql); $k = 1; $subtotal = 0; $ddlStatus = "ddlStatus_" . $artists[$i]; $sellerCurrency = getSellerCurrencySybol($artists[$i]); $ddl = makeDropDownList($ddlStatus, $statlist, ${$ddlStatus}, false, "textbox", "", ""); $btnStatus = "btnGo_" . $artists[$i]; $btn = "<input class='button' type='submit' value='Go' name='" . $btnStatus . "' onClick='return confirmStatus();'> "; while ($rw = mysql_fetch_array($result1)) { $link = "<a class=links href='editmyproduct.php?productid=" . $rw["product_id"] . "'>"; $check = "<input type='checkbox' name='chkitems[]' value='" . $rw["order_detail_id"] . "' > "; $rate = $rw["product_price"]; $qty = $rw["product_quantity"]; $artistid = $rw["artist_id"]; $ddl = makeDropDownList($ddlStatus, $statlist, $rw['item_status'], false, "textbox", "", ""); $btnStatus = "btnGo_" . $artists[$i]; $btn = "<input class='button' type='submit' value='Go' name='" . $btnStatus . "' onClick='return confirmStatus();'> "; $rate = $rw["product_price"]; $shippingcost = $row1["nshipping_cost"]; $totaltax = $rw["taxrate"];