Example #1
0
    public function load_store_category()
    {
        $site = $this->input->post('siteID');
        $ebay_id = $this->input->post('EbayID');
        $refresh = $this->input->post('refresh');
        $store_category_cache_name = $ebay_id . '_store_category_cache';
        $doc_root = getenv('DOCUMENT_ROOT');
        $store_category_cache_path = $doc_root . '/static/cache/' . $store_category_cache_name;
        $store_category_html = @file_get_contents($store_category_cache_path);
        if (!empty($store_category_html) && !$refresh) {
            echo $store_category_html;
            return;
        }
        $this->ebay_config['siteToUseID'] = get_site_id($site);
        $this->ebay_config['callName'] = 'GetStore';
        $this->load->library('ebayapi/EbaySession', $this->ebay_config);
        $xml = store_category($this->appToken);
        $resp = $this->xmlRequest($this->ebaysession, $xml);
        $resp = make_store_category_id_name($resp);
        $selected = true;
        $html = <<<HTML
    <select name="StoreCategoryID" id="StoreCategoryID">
        <option value="" selected="selected">-- none --</option>
HTML;
        foreach ($resp as $key => $value) {
            $html .= <<<HTML
<option value="{$key}">{$value}</option>
HTML;
        }
        $html .= <<<HTML
</select>
HTML;
        // save as cache!
        $num = file_put_contents($store_category_cache_path, $html);
        echo $html;
    }
Example #2
0
*/
require 'includes/application_top.php';
require DIR_WS_CLASSES . 'store.php';
require DIR_WS_CLASSES . 'customer.php';
$action = isset($_GET['action']) ? $_GET['action'] : '';
$error = false;
if (smn_not_null($action)) {
    switch ($action) {
        case 'setflag':
            require DIR_WS_FUNCTIONS . 'management.php';
            setflag();
            break;
        case 'insert_store_category':
        case 'update_store_category':
            require DIR_WS_FUNCTIONS . 'management.php';
            store_category($action);
            break;
        case 'delete_store_category_confirm':
            require DIR_WS_FUNCTIONS . 'management.php';
            delete_store_category_confirm();
            break;
        case 'delete_store_confirm':
            require DIR_WS_FUNCTIONS . 'management.php';
            delete_store_confirm();
            break;
        case 'move_store_category_confirm':
            require DIR_WS_FUNCTIONS . 'management.php';
            move_store_category_confirm();
            break;
        case 'move_store_confirm':
            require DIR_WS_FUNCTIONS . 'management.php';