View of /com_supacart/trunk/admin_files/html/affiliate.affiliate_details.php
Parent Directory
|
Revision Log
Revision 4 -
(download)
(annotate)
Tue Aug 4 12:46:30 2009 UTC (3 years, 9 months ago) by andphe
File size: 4281 byte(s)
Tue Aug 4 12:46:30 2009 UTC (3 years, 9 months ago) by andphe
File size: 4281 byte(s)
+ adding first set of files for version control
<?php defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); /** * * @version $Id: affiliate.affiliate_details.php 617 2007-01-04 19:43:08Z soeren_nb $ * @package SupaCart * @subpackage core * See COPYRIGHT.php for copyright notices and details. * @license GNU/GPL Version 2, see LICENSE.php * SupaCart is free software, originally derived from Virtuemart.. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See /administrator/components/com_supacart/COPYRIGHT.php for copyright notices and details. * * http://www.supacart.com */ mm_showMyFileName( __FILE__ ); search_header($VM_LANG->_PHPSHOP_AFFILIATE_LIST_LBL, 'affiliate', "affiliate_list"); // Enable the multi-page search result display $limitstart = mosgetparam( $_REQUEST, 'limitstart', 0); if ($keyword) { $list = "SELECT * FROM #__{sc}_vendor WHERE "; $count = "SELECT count(*) as num_rows FROM v#__{sc}_endor WHERE "; $q = "(vendor_name LIKE '%$keyword%' OR "; $q .= "vendor_store_desc LIKE '%$keyword%'"; $q .= ") "; $q .= "ORDER BY vendor_name ASC "; $list .= $q . " LIMIT $limitstart, " . SEARCH_ROWS; $count .= $q; } elseif ($vendor_category_id) { $q = ""; $list="SELECT * FROM #__{sc}_vendor, #__{sc}_vendor_category WHERE "; $count="SELECT count(*) as num_rows FROM #__{sc}_vendor,#__{sc}_vendor_category WHERE "; $q = "#__{sc}_vendor.vendor_category_id=#__{sc}_vendor_category.vendor_category_id "; $q .= "ORDER BY #__{sc}_vendor.vendor_name ASC "; $list .= $q . " LIMIT $limitstart, " . SEARCH_ROWS; $count .= $q; } else { $q = ""; $list = "SELECT * FROM #__users, #__{sc}_affiliate"; $list .= " WHERE #__users.user_info_id = #__{sc}_affiliate.user_id"; $list .= " AND #__users.id = '".$auth["user_id"]."'"; $list .= " ORDER BY company ASC"; $count = "SELECT count(*) as num_rows FROM #__{sc}_affiliate"; $list .= $q . " LIMIT $limitstart, " . SEARCH_ROWS; $count .= $q; } $db->query($count); $db->next_record(); $num_rows = $db->f("num_rows"); if ($num_rows == 0) { echo $VM_LANG->_PHPSHOP_NO_SEARCH_RESULT; } else { ?> <table class="adminlist"> <tr > <th width="28%"><?php echo $VM_LANG->_PHPSHOP_AFFILIATE_LIST_AFFILIATE_NAME ?></th> <th width="12%"><?php echo $VM_LANG->_PHPSHOP_AFFILIATE_LIST_AFFILIATE_ACTIVE ?></th> <th width="18%"><?php echo $VM_LANG->_PHPSHOP_AFFILIATE_LIST_MONTH_TOTAL?></th> <th width="31%"><?php echo $VM_LANG->_PHPSHOP_AFFILIATE_LIST_MONTH_COMMISSION?></th> <th width="11%"><?php echo $VM_LANG->_PHPSHOP_AFFILIATE_LIST_ADMIN ?></th> </tr> <?php $db->query($list); $i = 0; while ($db->next_record()) { if ($i++ % 2) $bgcolor=SEARCH_COLOR_1; else $bgcolor=SEARCH_COLOR_2; ?> <tr BGCOLOR=<?php echo $bgcolor ?>> <td width="28%" nowrap> <?php $url = SECUREURL . "?page=$modulename.affiliate_form&affiliate_id="; $url .= $db->f("affiliate_id"); echo "<A HREF=" . $sess->url($url) . ">"; echo $db->f("company"); echo "</A><BR>"; ?> </td> <td width="12%"><?php if($db->f("active")=='Y') echo "Yes"; else echo "No"; ?></td> <td width="18%"> <?php $dbt = new ps_DB; $q = "SELECT affiliate_id, SUM(order_subtotal) AS stotal FROM #__{sc}_orders,#__{sc}_affiliate_sale"; $q .=" WHERE #__{sc}_orders.order_id = #__{sc}_affiliate_sale.order_id"; $q .=" AND #__{sc}_affiliate_sale.affiliate_id = '".$db->f("affiliate_id")."'"; $q .=" GROUP BY affiliate_id"; $dbt->query($q); if($dbt->next_record()){ printf("%1.2f",$dbt->f("stotal")); } else echo "no sales"; ?> </td> <td width="31%"> <?php if($dbt->f("stotal")){ printf("%1.2f",$dbt->f("stotal") * ($db->f("rate")*0.01)); } else echo "none"; ?> </td> <td width="11%"><a href="<?php $sess->purl(SECUREURL . "?page=$modulename.affiliate_form&affiliate_id=" . $db->f("affiliate_id")) ?>">go</a></td> </tr> <?php } ?> </table> <?php search_footer('affiliate', "affiliate_list", $limitstart, $num_rows, $keyword); } ?>
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

