function loadProductsExpected()
 {
     global $toC_Json;
     $data = osC_Products_Admin::getData($_REQUEST['products_id']);
     $data['products_date_available'] = osC_DateTime::getDate($data['products_date_available']);
     $response = array('success' => true, 'data' => $data);
     echo $toC_Json->encode($response);
 }
Esempio n. 2
0
 function listBackup()
 {
     global $toC_Json;
     $osC_DirectoryListing = new osC_DirectoryListing(DIR_FS_BACKUP);
     $osC_DirectoryListing->setIncludeDirectories(false);
     $osC_DirectoryListing->setExcludeEntries('.htaccess');
     $response = array();
     foreach ($osC_DirectoryListing->getFiles() as $file) {
         $response[] = array('file' => $file['name'], 'date' => osC_DateTime::getDate(osC_DateTime::fromUnixTimestamp(filemtime(DIR_FS_BACKUP . $file['name'])), true), 'size' => number_format(filesize(DIR_FS_BACKUP . $file['name'])));
     }
     $response = array(EXT_JSON_READER_ROOT => $response);
     echo $toC_Json->encode($response);
 }
Esempio n. 3
0
 function listGuestBook()
 {
     global $toC_Json, $osC_Database, $osC_Language;
     $start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start'];
     $limit = empty($_REQUEST['limit']) ? MAX_DISPLAY_SEARCH_RESULTS : $_REQUEST['limit'];
     $QguestBook = $osC_Database->query('select guest_books_id, title, email, url, guest_books_status, languages_id, content, date_added from :table_guest_books order by guest_books_id desc');
     $QguestBook->bindTable(':table_guest_books', TABLE_GUEST_BOOKS);
     $QguestBook->setExtBatchLimit($start, $limit);
     $QguestBook->execute();
     $records = array();
     while ($QguestBook->next()) {
         $records[] = array('guest_books_id' => $QguestBook->valueInt('guest_books_id'), 'title' => $QguestBook->value('title'), 'email' => $QguestBook->value('email'), 'url' => $QguestBook->value('url'), 'guest_books_status' => $QguestBook->value('guest_books_status'), 'languages' => $osC_Language->showImage(osC_Language_Admin::getData($QguestBook->valueInt('languages_id'), 'code')), 'content' => $QguestBook->value('content'), 'date_added' => osC_DateTime::getDate($QguestBook->value('date_added')));
     }
     $QguestBook->freeResult();
     $response = array(EXT_JSON_READER_TOTAL => $QguestBook->getBatchSize(), EXT_JSON_READER_ROOT => $records);
     echo $toC_Json->encode($response);
 }
Esempio n. 4
0
 function loadBanner()
 {
     global $toC_Json;
     $banner = osC_BannerManager_Admin::getData($_REQUEST['banner_id']);
     $data = array('title' => $banner['banners_title'], 'url' => $banner['banners_url'], 'banners_group' => $banner['banners_group'], 'html_text' => $banner['banners_html_text'], 'date_scheduled' => empty($banner['date_scheduled']) ? '' : osC_DateTime::getDate($banner['date_scheduled']), 'expires_date' => empty($banner['expires_date']) ? '' : osC_DateTime::getDate($banner['expires_date']), 'expires_impressions' => $banner['expires_impressions'], 'status' => $banner['status'] == '1' ? true : false);
     if (isset($banner['banners_image']) && !empty($banner['banners_image'])) {
         $data['banners_image'] = $banner['banners_image'];
     }
     $response = array('success' => true, 'data' => $data);
     echo $toC_Json->encode($response);
 }
 function loadSpecials()
 {
     global $toC_Json;
     $data = osC_Specials_Admin::getData($_REQUEST['specials_id']);
     $data['start_date'] = osC_DateTime::getDate($data['start_date']);
     $data['expires_date'] = osC_DateTime::getDate($data['expires_date']);
     $response = array('success' => true, 'data' => $data);
     echo $toC_Json->encode($response);
 }
 function loadPoll()
 {
     global $toC_Json, $osC_Database;
     $data = toC_Polls_Admin::getData($_REQUEST['polls_id']);
     $data['date_added'] = osC_DateTime::getDate($data['date_added']);
     $Qdescription = $osC_Database->query('select polls_title, languages_id from :table_polls_description where polls_id = :polls_id');
     $Qdescription->bindTable(':table_polls_description', TABLE_POLLS_DESCRIPTION);
     $Qdescription->bindInt(':polls_id', $_REQUEST['polls_id']);
     $Qdescription->execute();
     while ($Qdescription->next()) {
         $data['question_title[' . $Qdescription->valueInt('languages_id') . ']'] = $Qdescription->value('polls_title');
     }
     $Qdescription->freeResult();
     $response = array('success' => true, 'data' => $data);
     echo $toC_Json->encode($response);
 }
Esempio n. 7
0
 function loadCustomer()
 {
     global $toC_Json;
     $data = osC_Customers_Admin::getData($_REQUEST['customers_id']);
     $data['customers_dob'] = osC_DateTime::getDate($data['customers_dob']);
     $data['customers_password'] = '';
     $data['confirm_password'] = '';
     $response = array('success' => true, 'data' => $data);
     echo $toC_Json->encode($response);
 }
 function loadCoupons()
 {
     global $toC_Json, $osC_Database, $osC_Language;
     $coupons_id = isset($_REQUEST['coupons_id']) && is_numeric($_REQUEST['coupons_id']) ? $_REQUEST['coupons_id'] : null;
     if ($coupons_id > 0) {
         $data = toC_Coupons_Admin::getData($coupons_id);
         $data['start_date'] = osC_DateTime::getDate($data['start_date']);
         $data['expires_date'] = osC_DateTime::getDate($data['expires_date']);
         $Qcoupons = $osC_Database->query('select * from :table_coupons_description  where coupons_id = :coupons_id ');
         $Qcoupons->bindTable(':table_coupons_description', TABLE_COUPONS_DESCRIPTION);
         $Qcoupons->bindInt(':coupons_id', $coupons_id);
         $Qcoupons->execute();
         while ($Qcoupons->next()) {
             $data['coupons_name[' . $Qcoupons->value('language_id') . ']'] = $Qcoupons->value('coupons_name');
             $data['coupons_description[' . $Qcoupons->value('language_id') . ']'] = $Qcoupons->value('coupons_description');
         }
         $Qcoupons->freeResult();
         $data['coupons_restrictions'] = COUPONS_RESTRICTION_NONE;
         $Qctoc = $osC_Database->query('select ctoc.*,cd.categories_name from :table_coupons_to_categories ctoc left join :table_categories_description cd on ctoc.categories_id=cd.categories_id  where ctoc.coupons_id = :coupons_id and cd.language_id = :language_id ');
         $Qctoc->bindTable(':table_coupons_to_categories', TABLE_COUPONS_TO_CATEGORIES);
         $Qctoc->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);
         $Qctoc->bindInt(':language_id', $osC_Language->getID());
         $Qctoc->bindInt(':coupons_id', $coupons_id);
         $Qctoc->execute();
         if ($Qctoc->numberOfRows() > 0) {
             $data['coupons_restrictions'] = COUPONS_RESTRICTION_CATEGOREIS;
             while ($Qctoc->next()) {
                 $data['categories'][] = array('id' => $Qctoc->value('categories_id'), 'name' => $Qctoc->value('categories_name'));
             }
         }
         $Qctop = $osC_Database->query('select ctop.*,pd.products_name from :table_coupons_to_products ctop left join :table_products_description pd on ctop.products_id=pd.products_id  where ctop.coupons_id = :coupons_id and pd.language_id = :language_id ');
         $Qctop->bindTable(':table_coupons_to_products', TABLE_COUPONS_TO_PRODUCTS);
         $Qctop->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
         $Qctop->bindInt(':language_id', $osC_Language->getID());
         $Qctop->bindInt(':coupons_id', $coupons_id);
         $Qctop->execute();
         if ($Qctop->numberOfRows() > 0) {
             $data['coupons_restrictions'] = COUPONS_RESTRICTION_PRODUCTS;
             while ($Qctop->next()) {
                 $data['products'][] = array('id' => $Qctop->value('products_id'), 'name' => $Qctop->value('products_name'));
             }
         }
         $response = array('success' => true, 'data' => $data);
     } else {
         $response = array('success' => false);
     }
     echo $toC_Json->encode($response);
 }