当前位置: 首页>>代码示例>>PHP>>正文


PHP ps_DB::query方法代码示例

本文整理汇总了PHP中ps_DB::query方法的典型用法代码示例。如果您正苦于以下问题:PHP ps_DB::query方法的具体用法?PHP ps_DB::query怎么用?PHP ps_DB::query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ps_DB的用法示例。


在下文中一共展示了ps_DB::query方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: count

 function traverse_tree_down(&$mymenu_content, $category_id = '0', $level = '0')
 {
     static $ibg = 0;
     global $db, $mosConfig_live_site;
     $db = new ps_DB();
     $level++;
     $query = "SELECT category_name as cname, category_id as cid, category_child_id as ccid " . "FROM #__{vm}_category as a, #__{vm}_category_xref as b " . "WHERE a.category_publish='Y' AND " . " b.category_parent_id='{$category_id}' AND a.category_id=b.category_child_id " . "ORDER BY category_parent_id, list_order, category_name ASC";
     $db->query($query);
     $categories = $db->record;
     if (!($categories == null)) {
         $i = 1;
         $numCategories = count($categories);
         foreach ($categories as $category) {
             $ibg++;
             $Treeid = $ibg;
             $itemid = isset($_REQUEST['Itemid']) ? '&Itemid=' . intval($_REQUEST['Itemid']) : "";
             $mymenu_content .= str_repeat("\t", $level - 1);
             if ($level > 1 && $i == 1) {
                 $mymenu_content .= ",";
             }
             $mymenu_content .= "['" . $category->cname;
             $mymenu_content .= "','href=\\'" . sefRelToAbs('index.php?option=com_virtuemart&page=shop.browse&category_id=' . $category->cid . '&Treeid=' . $Treeid . $itemid) . "\\''\n ";
             /* recurse through the subcategories */
             $this->traverse_tree_down($mymenu_content, $category->ccid, $level);
             $mymenu_content .= str_repeat("\t", $level - 1);
             /* let's see if the loop has reached its end */
             if ($i == sizeof($categories) && $level == 1) {
                 $mymenu_content .= "]\n";
             } else {
                 $mymenu_content .= "],\n";
             }
             $i++;
         }
     }
 }
开发者ID:rafarubert,项目名称:megafiltros,代码行数:35,代码来源:vm_tigratree.php

示例2: authUser

function authUser($acc, $pwd)
{
    if ($acc && $pwd) {
        $db = new ps_DB();
        $pwd = md5($pwd);
        $sql = "select ID, name, authority from account where username='{$acc}' and password='{$pwd}' ";
        $db->query($sql);
        if ($db->next_record()) {
            return $db->f('ID');
        } else {
            return 0;
        }
    } else {
        return 0;
    }
}
开发者ID:ookeyLai,项目名称:ikareHealth,代码行数:16,代码来源:mymessages.php

示例3: while

 function traverse_tree_down(&$mymenu_content, $category_id = '0', $level = '0')
 {
     static $ibg = 0;
     global $mosConfig_live_site, $sess;
     $level++;
     $query = "SELECT category_name, category_id, category_child_id " . "FROM #__{vm}_category as a, #__{vm}_category_xref as b " . "WHERE a.category_publish='Y' AND " . " b.category_parent_id='{$category_id}' AND a.category_id=b.category_child_id " . "ORDER BY category_parent_id, list_order, category_name ASC";
     $db = new ps_DB();
     $db->query($query);
     while ($db->next_record()) {
         $itemid = '&Itemid=' . $sess->getShopItemid();
         if ($ibg != 0) {
             $mymenu_content .= ",";
         }
         $mymenu_content .= "\n[ '<img src=\"' + ctThemeXPBase + 'darrow.png\" alt=\"arr\" />','" . $db->f("category_name", false) . "','" . sefRelToAbs('index.php?option=com_virtuemart&page=shop.browse&category_id=' . $db->f("category_id") . $itemid) . "',null,'" . $db->f("category_name", false) . "'\n ";
         $ibg++;
         /* recurse through the subcategories */
         $this->traverse_tree_down($mymenu_content, $db->f("category_child_id"), $level);
         /* let's see if the loop has reached its end */
         $mymenu_content .= "]";
     }
 }
开发者ID:albertobraschi,项目名称:Hab,代码行数:21,代码来源:vm_JSCook.php

示例4: switch

 function _tax_based_on_vendor_address($ship_to_info_id = '')
 {
     global $auth;
     global $vmLogger;
     switch (TAX_MODE) {
         case '0':
             return false;
         case '1':
             return true;
         case '17749':
             $ship_to_info_id = !empty($ship_to_info_id) ? $ship_to_info_id : vmGet($_REQUEST, 'ship_to_info_id');
             $db = new ps_DB();
             $q = "SELECT country FROM #__{vm}_user_info WHERE user_info_id='" . $ship_to_info_id . "'";
             $db->query($q);
             $db->next_record();
             $ship_country = $db->f("country");
             if (!array_key_exists('country', $auth) || empty($ship_country)) {
                 $vmLogger->debug('shopper\'s country is not known; defaulting to vendor-based tax');
                 return true;
             }
             if ($ship_to_info_id) {
                 $vmLogger->debug('shopper shipping in ' . $ship_country);
                 $auth_country = $ship_country;
             } else {
                 $vmLogger->debug('shopper is in ' . $auth['country']);
                 $auth_country = $auth['country'];
             }
             return ps_checkout::country_in_eu_common_vat_zone($auth_country);
         default:
             $vmLogger->warning('unknown TAX_MODE "' . TAX_MODE . '"');
             return true;
     }
 }
开发者ID:noikiy,项目名称:owaspbwa,代码行数:33,代码来源:ps_checkout.php

示例5: update

 /**
  * update export module
  * @param array
  * @return bool
  * @author Manfred Dennerlein
  */
 function update(&$d)
 {
     global $vmLogger, $VM_LANG;
     $db = new ps_DB();
     $ps_vendor_id = $_SESSION['ps_vendor_id'];
     $timestamp = time();
     if (!$this->validate_update($d)) {
         return False;
     }
     if (!empty($d['export_class'])) {
         $export_class = basename($d['export_class']);
         if (include_once CLASSPATH . 'export/' . $export_class . '.php') {
             $_EXPORT = new $export_class();
         }
     } else {
         include_once CLASSPATH . 'export/ps_xmlexport.php';
         $_EXPORT = new ps_xmlexport();
     }
     if ($_EXPORT->configfile_writeable()) {
         $_EXPORT->write_configuration($d);
         $vmLogger->info($VM_LANG->_('VM_CONFIGURATION_CHANGE_SUCCESS', false));
     } else {
         $vmLogger->err(sprintf($VM_LANG->_('VM_CONFIGURATION_CHANGE_FAILURE', false), CLASSPATH . "export/" . $_EXPORT->classname . ".cfg.php"));
         return false;
     }
     $fields = array('export_enabled' => $d['export_enabled'], 'export_config' => $d['export_config']);
     if (!$d['iscore']) {
         $fields['export_name'] = $d['export_name'];
         $fields['export_desc'] = $d['export_desc'];
         $fields['export_class'] = $d['export_class'];
     }
     $db->buildQuery('INSERT', '#__{vm}_export', $fields, 'WHERE export_id=' . (int) $d['export_id'] . " AND vendor_id='{$ps_vendor_id}'");
     return $db->query() !== false;
 }
开发者ID:BackupTheBerlios,项目名称:kmit-svn,代码行数:40,代码来源:ps_export.php

示例6: uniqid

    $closeSameLevel = "false";
}
$menu_htmlcode = "";
// what should be used as the base of the tree?
// ( could be *first* menu item, *site* name, *module*, *menu* name or *text* )
$base = "first";
// in case *text* should be the base node, what text should be displayed?
$basetext = "";
// what category_id is selected?
$category_id = vmRequest::getInt('category_id');
// select menu items from database
$query = "SELECT category_id,category_parent_id,category_name FROM #__{vm}_category, #__{vm}_category_xref ";
$query .= "WHERE #__{vm}_category.category_publish='Y' AND ";
$query .= "#__{vm}_category.category_id=#__{vm}_category_xref.category_child_id ";
$query .= "ORDER BY category_parent_id, list_order, category_name ASC";
$db->query($query);
$db->next_record();
// how many menu items in this menu?
$row = $db->num_rows();
// create a unique tree identifier, in case multiple dtrees are used
// (max one per module)
$tree = "d" . uniqid("tree_");
// start creating the content
// create left aligned table, load the CSS stylesheet and dTree code
$menu_htmlcode .= "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"100%\"><tr><td align=\"left\">\n";
$menu_htmlcode .= "<link rel=\"stylesheet\" href=\"{$js_src}/dtree/dtree.css\" type=\"text/css\" />\n";
$menu_htmlcode .= "<script type=\"text/javascript\" src=\"{$js_src}/dtree/dtree.js\"></script>\n";
$menu_htmlcode .= "<script type=\"text/javascript\">\n";
// create the tree, using the unique name
// pass the live_site parameter on so dTree can find the icons
$menu_htmlcode .= "{$tree} = new dTree('{$tree}',\"{$js_src}\");\n";
开发者ID:dalinhuang,项目名称:joomla-goods-china,代码行数:31,代码来源:vm_dtree.php

示例7: date

 /**
  * Voids a previous transaction with Payflow Pro
  *
  * @param array $d
  * @return boolean
  */
 function void_authorization(&$d)
 {
     global $vendor_mail, $vendor_currency, $VM_LANG, $vmLogger;
     $database = new ps_DB();
     require_once CLASSPATH . "connectionTools.class.php";
     if (empty($d['order_number'])) {
         $vmLogger->err("Error: No Order Number provided.");
         return false;
     }
     /*** Get the Configuration File for authorize.net ***/
     require_once CLASSPATH . "payment/" . __CLASS__ . ".cfg.php";
     if (PFP_TYPE != 'A') {
         return true;
     }
     // Get the Account Password securely from the database
     $database->query("SELECT " . VM_DECRYPT_FUNCTION . "(payment_passkey,'" . ENCODE_KEY . "') as passkey FROM #__{vm}_payment_method WHERE payment_class='" . __CLASS__ . "'");
     $transaction = $database->record[0];
     if (empty($transaction->passkey)) {
         $vmLogger->err($VM_LANG->_('PHPSHOP_PAYMENT_ERROR'), false);
         return false;
     }
     $db = new ps_DB();
     $q = "SELECT * FROM #__{vm}_orders, #__{vm}_order_payment WHERE ";
     $q .= "order_number='" . $d['order_number'] . "' ";
     $q .= "AND #__{vm}_orders.order_id=#__{vm}_order_payment.order_id";
     $db->query($q);
     if (!$db->next_record()) {
         $vmLogger->err("Error: Order not found.");
         return false;
     }
     $expire_date = date("my", $db->f("order_payment_expire"));
     $cvv2_code = $db->f("order_payment_code");
     // DECODE Account Number
     $dbaccount = new ps_DB();
     $q = "SELECT " . VM_DECRYPT_FUNCTION . "(order_payment_number,'" . ENCODE_KEY . "')\r\n          AS account_number from #__{vm}_order_payment WHERE order_id='" . $db->f("order_id") . "'";
     $dbaccount->query($q);
     $dbaccount->next_record();
     // Get user billing information
     $dbbt = new ps_DB();
     $qt = "SELECT * FROM #__{vm}_user_info WHERE user_id='" . $db->f("user_id") . "'";
     $dbbt->query($qt);
     $dbbt->next_record();
     $user_info_id = $dbbt->f("user_info_id");
     if ($user_info_id != $db->f("user_info_id")) {
         // Get user's alternative shipping information
         $dbst = new ps_DB();
         $qt = "SELECT * FROM #__{vm}_user_info WHERE user_info_id='" . $db->f("user_info_id") . "' AND address_type='ST'";
         $dbst->query($qt);
         $dbst->next_record();
     } else {
         $dbst = $dbbt;
     }
     $tempstr = $dbaccount->f('account_number') . $db->f('order_total') . date('YmdGis');
     $request_id = md5($tempstr);
     //Authnet vars to send
     $formdata = array('PARTNER' => PFP_PARTNER, 'VENDOR' => PFP_VENDOR, 'USER' => PFP_USER, 'PWD' => $transaction->passkey, 'TEST' => PFP_TEST_REQUEST, 'AMT' => $db->f('order_total'), 'TRXTYPE' => 'V', 'TENDER' => 'C', 'CURRENCY' => $vendor_currency, 'NAME' => strtoupper(substr($dbbt->f("first_name"), 0, 15) . substr($dbbt->f("last_name"), 0, 15)), 'STREET' => substr($dbbt->f("address_1"), 0, 30), 'CITY' => substr($dbbt->f("city"), 0, 40), 'STATE' => substr($dbbt->f("state"), 0, 40), 'ZIP' => substr($dbbt->f("zip"), 0, 9), 'CUSTREF' => substr($db->f('order_number'), 0, 12), 'ORIGID' => $db->f('order_payment_trans_id'), 'ACCT' => $dbaccount->f('account_number'), 'CVV2' => $cvv2_code, 'EXPDATE' => $expire_date);
     //build the post string
     $poststring = '';
     foreach ($formdata as $key => $val) {
         $poststring .= urlencode($key) . "=" . urlencode($val) . "&";
     }
     // strip off trailing ampersand
     $poststring = substr($poststring, 0, -1);
     if (PFP_TEST_REQUEST == 'TRUE') {
         $host = 'pilot-payflowpro.verisign.com';
     } else {
         $host = 'payflowpro.verisign.com';
     }
     $headers[] = "X-VPS-Timeout: 30";
     $headers[] = "X-VPS-VIT-OS-Name: " . PHP_OS;
     // Name of your OS
     $headers[] = "X-VPS-VIT-OS-Version: " . PHP_OS;
     // OS Version
     $headers[] = "X-VPS-VIT-Client-Type: PHP/cURL";
     // What you are using
     $headers[] = "X-VPS-VIT-Client-Version: 0.01";
     // For your info
     $headers[] = "X-VPS-VIT-Client-Architecture: x86";
     // For your info
     $headers[] = "X-VPS-VIT-Client-Certification-Id: " . PFP_CLIENT_CERTIFICATION_ID;
     // get this from Todd @ payflowintegrator@paypal.com
     $headers[] = "X-VPS-VIT-Integration-Product: " . phpversion() . "::cURL";
     // For your info, would populate with application name
     $headers[] = "X-VPS-VIT-Integration-Version: 0.01";
     // Application version
     $headers[] = "X-VPS-Request-ID: " . $request_id;
     $result = vmConnector::handleCommunication("https://{$host}:443/transaction", $poststring, $headers);
     if (!$result) {
         $vmLogger->err('The transaction could not be completed.');
         return false;
     }
     $result = strstr($result, 'RESULT');
     $valArray = explode('&', $result);
     foreach ($valArray as $val) {
//.........这里部分代码省略.........
开发者ID:rafarubert,项目名称:megafiltros,代码行数:101,代码来源:payflow_pro.php

示例8: deleteState

 function deleteState(&$d)
 {
     $db = new ps_DB();
     if (empty($d['state_id'])) {
         $GLOBALS['vmLogger']->err('Please select a state to delete!');
         return false;
     }
     if (!is_array($d['state_id'])) {
         $d['state_id'] = array($d['state_id']);
     }
     foreach ($d['state_id'] as $state_id) {
         $q = 'DELETE FROM #__{vm}_state where state_id=' . (int) $state_id . ' LIMIT 1';
         $db->query($q);
     }
     return True;
 }
开发者ID:BackupTheBerlios,项目名称:kmit-svn,代码行数:16,代码来源:ps_country.php

示例9: array

    /**
     * Show all configuration parameters for this payment method
     * @returns boolean False when the Payment method has no configration
     */
    function show_configuration()
    {
        global $VM_LANG;
        $database = new ps_DB();
        /** Read current Configuration ***/
        require_once CLASSPATH . "payment/" . $this->classname . ".cfg.php";
        ?>
      <table>
        <tr>
            <td><strong><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_2CHECKOUT_LOGIN');
        ?>
</strong></td>
            <td>
                <input type="text" name="TWOCO_LOGIN" class="inputbox" value="<?php 
        echo TWOCO_LOGIN;
        ?>
" />
            </td>
            <td><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_2CHECKOUT_LOGIN_EXPLAIN');
        ?>
</td>
        </tr>
        <tr>
            <td><strong><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_2CHECKOUT_SECRETWORD');
        ?>
</strong></td>
            <td>
                <input type="text" name="TWOCO_SECRETWORD" class="inputbox" value="<?php 
        echo TWOCO_SECRETWORD;
        ?>
" />
            </td>
            <td><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_2CHECKOUT_SECRETWORD_EXPLAIN');
        ?>
</td>
        </tr>
        <tr>
            <td><strong><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_PAYMENT_ORDERSTATUS_SUCC');
        ?>
</strong></td>
            <td>
                <select name="TWOCO_VERIFIED_STATUS" class="inputbox" >
                <?php 
        $q = "SELECT order_status_name,order_status_code FROM #__{vm}_order_status ORDER BY list_order";
        $database->query($q);
        $rows = $database->record;
        $order_status_code = array();
        $order_status_name = array();
        foreach ($rows as $row) {
            $order_status_code[] = $row->order_status_code;
            $order_status_name[] = $row->order_status_name;
        }
        for ($i = 0; $i < sizeof($order_status_code); $i++) {
            echo "<option value=\"" . $order_status_code[$i];
            if (TWOCO_VERIFIED_STATUS == $order_status_code[$i]) {
                echo "\" selected=\"selected\">";
            } else {
                echo "\">";
            }
            echo $order_status_name[$i] . "</option>\n";
        }
        ?>
                    </select>
            </td>
            <td><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_PAYMENT_ORDERSTATUS_SUCC_EXPLAIN');
        ?>
            </td>
        </tr>
            <tr>
            <td><strong><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_PAYMENT_ORDERSTATUS_FAIL');
        ?>
</strong></td>
            <td>
                <select name="TWOCO_INVALID_STATUS" class="inputbox" >
                <?php 
        for ($i = 0; $i < sizeof($order_status_code); $i++) {
            echo "<option value=\"" . $order_status_code[$i];
            if (TWOCO_INVALID_STATUS == $order_status_code[$i]) {
                echo "\" selected=\"selected\">";
            } else {
                echo "\">";
            }
            echo $order_status_name[$i] . "</option>\n";
        }
        ?>
                    </select>
            </td>
            <td><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_PAYMENT_ORDERSTATUS_FAIL_EXPLAIN');
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:kmit-svn,代码行数:101,代码来源:ps_twocheckout.php

示例10: array

    /**
     * Show all configuration parameters for this payment method
     * @returns boolean False when the Payment method has no configration
     */
    function show_configuration()
    {
        global $VM_LANG, $mosConfig_live_site;
        $db = new ps_DB();
        /** Read current Configuration ***/
        require_once CLASSPATH . "payment/" . __CLASS__ . ".cfg.php";
        ?>
    
			<table style="text-align: left;">
        <tr>
            <td><strong><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_EPAY_MERCHANTNUMBER');
        ?>
</strong></td>
            <td>
                <input type="text" name="EPAY_MERCHANTNUMBER" class="inputbox" value="<?php 
        echo EPAY_MERCHANTNUMBER;
        ?>
" />
            </td>
            <td><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_EPAY_MERCHANTNUMBER_EXPLAIN');
        ?>
</td>
        </tr>
        <tr>
            <td><strong><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_PAYPAL_STATUS_SUCCESS');
        ?>
</strong></td>
            <td>
                <select name="EPAY_VERIFIED_STATUS" class="inputbox" >
                <?php 
        $q = "SELECT order_status_name,order_status_code FROM #__{vm}_order_status where order_status_code != 'P' ORDER BY list_order";
        $db->query($q);
        $order_status_code = array();
        $order_status_name = array();
        while ($db->next_record()) {
            $order_status_code[] = $db->f("order_status_code");
            $order_status_name[] = $db->f("order_status_name");
        }
        for ($i = 0; $i < sizeof($order_status_code); $i++) {
            echo "<option value=\"" . $order_status_code[$i];
            if (EPAY_VERIFIED_STATUS == $order_status_code[$i]) {
                echo "\" selected=\"selected\">";
            } else {
                echo "\">";
            }
            echo $order_status_name[$i] . "</option>\n";
        }
        ?>
                    </select>
            </td>
            <td><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_PAYPAL_STATUS_SUCCESS_EXPLAIN');
        ?>
            </td>
        </tr>
            <tr>
            <td><strong><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_PAYPAL_STATUS_FAILED');
        ?>
</strong></td>
            <td>
                <select name="EPAY_INVALID_STATUS" class="inputbox" >
                <?php 
        $q = "SELECT order_status_name,order_status_code FROM #__{vm}_order_status ORDER BY list_order";
        $db->query($q);
        $order_status_code = array();
        $order_status_name = array();
        while ($db->next_record()) {
            $order_status_code[] = $db->f("order_status_code");
            $order_status_name[] = $db->f("order_status_name");
        }
        for ($i = 0; $i < sizeof($order_status_code); $i++) {
            echo "<option value=\"" . $order_status_code[$i];
            if (EPAY_INVALID_STATUS == $order_status_code[$i]) {
                echo "\" selected=\"selected\">";
            } else {
                echo "\">";
            }
            echo $order_status_name[$i] . "</option>\n";
        }
        ?>
                    </select>
            </td>
            <td><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_PAYPAL_STATUS_FAILED_EXPLAIN');
        ?>
</td>
        </tr>
        <script language="JavaScript">
          function enableDisableAll() {
            if (document.all.EPAY_CARDTYPES_0.checked) {
              document.all.EPAY_CARDTYPES_1.disabled = true;
              document.all.EPAY_CARDTYPES_2.disabled = true;
//.........这里部分代码省略.........
开发者ID:noikiy,项目名称:owaspbwa,代码行数:101,代码来源:ps_epay.php

示例11: while

    <a class="vmicon vmicon-16-editadd" href="<?php 
    $sess->purl($_SERVER['PHP_SELF'] . "?page={$modulename}.user_address_form&amp;user_id={$user_id}");
    ?>
" >
	(<?php 
    echo $VM_LANG->_('PHPSHOP_USER_FORM_ADD_SHIPTO_LBL');
    ?>
)</a> 
	
	<table class="adminlist"> 
		<tr> 
			<td > 
				  <?php 
    $qt = "SELECT * from #__{vm}_user_info WHERE user_id='{$user_id}' AND address_type='ST'";
    $dbt = new ps_DB();
    $dbt->query($qt);
    if (!$dbt->num_rows()) {
        echo "No shipping addresses.";
    } else {
        while ($dbt->next_record()) {
            $url = $sess->url($_SERVER['PHP_SELF'] . "?page={$modulename}.user_address_form&user_id={$user_id}&user_info_id=" . $dbt->f("user_info_id"));
            echo '&raquo; <a href="' . $sess->url($url) . '">';
            echo $dbt->f("address_type_name") . "</a><br/>";
        }
    }
    ?>
 
			</td> 
		</tr> 
	</table>
	</fieldset>
开发者ID:noikiy,项目名称:owaspbwa,代码行数:31,代码来源:admin.user_form.php

示例12:

 /**
  * Retrieves the Customer Number of the user specified by ID
  *
  * @param int $id
  * @return string
  */
 function get_customer_num($id)
 {
     $db = new ps_DB();
     $q = "SELECT customer_number FROM #__{vm}_shopper_vendor_xref ";
     $q .= "WHERE user_id='" . $id . "' ";
     $db->query($q);
     $db->next_record();
     return $db->f("customer_number");
 }
开发者ID:BackupTheBerlios,项目名称:kmit-svn,代码行数:15,代码来源:ps_shopper_group.php

示例13: if



$query  = "SELECT DISTINCT m.manufacturer_id, m.mf_name
					FROM #__{vm}_manufacturer m
					LEFT JOIN #__{vm}_product_mf_xref mx ON mx.manufacturer_id = m.manufacturer_id
					LEFT JOIN #__{vm}_product p ON p.product_id = mx.product_id
					LEFT JOIN #__{vm}_product_category_xref cx ON cx.product_id = p.product_id
					WHERE cx.category_id =".(int)$category_id;
$query .= " ORDER BY m.mf_name ASC";

$query_all  = "SELECT m.manufacturer_id,m.mf_name FROM #__{vm}_manufacturer m ";
$query_all .= "ORDER BY m.mf_name ASC";

$db = new ps_DB;
if ($auto == 1 && !empty( $category_id ) ) {
	$db->query( $query );
} else {
	$db->query( $query_all );
}
$res = $db->record;
if( empty( $res )) {
	if( $auto == 1 ) {
		$db->query( $query_all );
		$res = $db->record;
	} else {
		echo 'No manufacturers defined!';
		return;
	}
}
?>
<?php if( $show_linklist == 1 ) { ?>
开发者ID:rubengarcia0510,项目名称:tienda,代码行数:29,代码来源:mod_virtuemart_manufacturers.php

示例14: Array

 /**
  * Build a Credit Card list for each CreditCard Payment Method
  * Uses JavsScript from mambojavascript: changeDynaList()
  *
  * @param ps_DB $db_cc
  * @return string
  */
 function creditcard_lists(&$db_cc)
 {
     global $mainframe;
     if (vmIsJoomla('1.5')) {
         $document = JFactory::getDocument();
         $document->addScript('includes/js/joomla.javascript.js');
     }
     $db = new ps_DB();
     $db_cc->next_record();
     // Build the Credit Card lists for each CreditCard Payment Method
     $script = "<script language=\"javascript\" type=\"text/javascript\">\n";
     $script .= "<!--\n";
     $script .= "var originalOrder = '1';\n";
     $script .= "var originalPos = '" . $db_cc->f("payment_method_name") . "';\n";
     $script .= "var orders = new Array();\t// array in the format [key,value,text]\n";
     $i = 0;
     $db_cc->reset();
     while ($db_cc->next_record()) {
         $accepted_creditcards = explode(",", $db_cc->f("accepted_creditcards"));
         $cards = array();
         foreach ($accepted_creditcards as $value) {
             if (!empty($value)) {
                 $q = 'SELECT creditcard_code,creditcard_name FROM #__{vm}_creditcard WHERE creditcard_id=' . (int) $value;
                 $db->query($q);
                 $db->next_record();
                 $cards[$db->f('creditcard_code')] = shopMakeHtmlSafe($db->f('creditcard_name'));
             }
         }
         foreach ($cards as $code => $name) {
             $script .= "orders[" . $i++ . "] = new Array( '" . addslashes($db_cc->f("payment_method_name")) . "','{$code}','{$name}' );\n";
         }
     }
     $script .= "function changeCreditCardList() { \n";
     $script .= "var selected_payment = null;\n      for (var i=0; i<document.adminForm.payment_method_id.length; i++)\n         if (document.adminForm.payment_method_id[i].checked)\n            selected_payment = document.adminForm.payment_method_id[i].id;\n";
     $script .= "changeDynaList('creditcard_code',orders,selected_payment, originalPos, originalOrder);\n";
     $script .= "}\n";
     $script .= "//-->\n";
     $script .= "</script>\n";
     $script .= '<noscript>' . ps_html::selectList('creditcard_code', key($cards), $cards) . '</noscript>';
     return $script;
 }
开发者ID:noikiy,项目名称:owaspbwa,代码行数:48,代码来源:ps_creditcard.php

示例15: stdClass

    $file = new stdClass();
    $file->file_id = 'product_images';
    $file->file_name = IMAGEPATH . 'product/' . $db->f('file_name');
    $file->product_name = $db->f('product_name');
    $file->file_url = IMAGEURL . 'product/' . $db->f('file_name');
    $file->product_thumb_image = $db->f('product_thumb_image');
    $file->file_title = $db->f('file_name');
    $file->file_is_image = 1;
    $file->file_product_id = $product_id;
    $file->file_extension = strrchr($db->f('file_name'), '.');
    $file->file_published = $db->f('product_publish');
    $files[] = $file;
}
$dbf = new ps_DB();
$sql = 'SELECT attribute_value FROM #__{vm}_product_attribute WHERE `product_id` = ' . $product_id . ' AND attribute_name=\'download\'';
$dbf->query($sql);
$downloadFiles = array();
while ($dbf->next_record()) {
    $downloadFiles[] = $dbf->f('attribute_value');
}
$q = "SELECT file_id, file_is_image, file_product_id, file_extension, file_url, file_published, file_name, file_title, file_image_thumb_height, file_image_thumb_width FROM #__{vm}_product_files  ";
$q .= "WHERE file_product_id = '{$product_id}' ";
$q .= "ORDER BY file_is_image DESC";
$db->query($q);
$db->next_record();
if (!empty($files)) {
    $db->record = array_merge($files, $db->record);
}
if ($db->num_rows() < 1 && $task != "cancel") {
    vmRedirect($_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.file_form&product_id={$product_id}&no_menu=" . @$_REQUEST['no_menu']);
}
开发者ID:albertobraschi,项目名称:Hab,代码行数:31,代码来源:product.file_list.php


注:本文中的ps_DB::query方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。