Esempio n. 1
0
 public function testData()
 {
     $stores = new Stores($this->progress, $this->logger, $this->source, $this->destination, $this->recordTransformerFactory, $this->recordFactory, 'data');
     $this->assertTrue($stores->perform());
     foreach ($this->destinationDocuments as $documentName => $recordsCount) {
         $this->assertEquals($recordsCount, count($this->destination->getRecords($documentName, 0)));
     }
 }
Esempio n. 2
0
 public function getStore($store_slug = null)
 {
     $stores = Stores::where('store_slug', $store_slug)->lists('id');
     // Get Category According to SLUG
     $allCoupons = Coupons::whereIn('store_id', $stores)->paginate(20);
     // Get Coupons According to Category Selected
     $type = 'store';
     $data = array('pageTitle' => 'CouponJadu - Get Latest Coupons', 'allCoupons' => $allCoupons, 'allCategories' => $this->allCategories, 'allStores' => $this->allStores, 'type' => $type);
     return View::make('home', $data);
 }
Esempio n. 3
0
function storeslista()
{
    $results = array();
    $data = Stores::getList(STORES_NUM_STORES);
    $results['stores'] = $data['results'];
    $results['totalRows'] = $data['totalRows'];
    $results['pageTitle'] = $results['pageHeading'] . " | SystemBolaget";
    require TEMPLATE_PATH . "/storeslista.php";
}
Esempio n. 4
0
<?php

$sdl = new StoresDataLoader($db);
$stores = new Stores($db);
$pos = new POS($db);
$getset->setStandardValue("exact_search", false);
switch ($getset->header(FORM_ACTION)) {
    case FORM_ACTION_SAVE . "_store":
        require_once __DIR__ . '/edit/save_store.php';
        $result = $sdl->get($getset->header("search"), $getset->header("value"), $getset->header("exact_search"));
        break;
    case FORM_ACTION_SAVE . "_pos":
        require_once __DIR__ . '/edit/save_pos.php';
        $result = $sdl->get($getset->header("search"), $getset->header("value"), $getset->header("exact_search"));
        break;
    case FORM_ACTION_CREATE:
        $result = $sdl->get("", "");
        break;
    case FORM_ACTION_DELETE . "_store":
        $stores->delete_Store($getset->header("delete_id"));
        $result = $sdl->get($getset->header("search"), $getset->header("value"), $getset->header("exact_search"));
        $result = null;
        break;
    case FORM_ACTION_DELETE . "_pos":
        $pos->delete_POS($getset->header("delete_id"));
        $result = $sdl->get($getset->header("search"), $getset->header("value"), $getset->header("exact_search"));
        break;
    case FORM_ACTION_SEARCH:
        $result = $sdl->get($getset->header("search"), $getset->header("value"), $getset->header("exact_search"));
        break;
    default:
Esempio n. 5
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Stores the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Stores::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Esempio n. 6
0
function viewStore()
{
    if (!isset($_GET["storeId"]) || !$_GET["storeId"]) {
        homepage();
        return;
    }
    $results = array();
    $results['stores'] = Stores::getById((int) $_GET['storeId']);
    $results['pageTitle'] = $results['stores']->Address1 . " | SystemBolaget";
    require TEMPLATE_PATH . "/viewStore.php";
}
Esempio n. 7
0
 public function getEditCoupon($couponId)
 {
     $coupons = Coupons::whereId($couponId)->first();
     $categories = Categories::lists('category_name', 'id');
     $categories[''] = 'Select Category';
     $stores = Stores::lists('store_name', 'id');
     $stores[''] = 'Select Store';
     $data = array('userData' => $this->userData, 'pageTitle' => 'Edit Coupon', 'couponsDetails' => $coupons, 'categories' => $categories, 'stores' => $stores);
     return View::make('admin.editcoupon', $data);
 }
Esempio n. 8
0
function examplesMenu()
{
    Yii::import("application.modules.stores.models.Stores", true);
    Yii::import("application.modules.examples.models.Examples", true);
    $store_limit = Yii::app()->params['store_example_limit'];
    $example_limit = Yii::app()->params['before_after_limit'];
    $stores_examples = Stores::model()->findAll(array('limit' => "{$store_limit}", 'order' => "sequence", "condition" => "publish = 1 AND store_type='example' AND deleted = 0 "));
    $examples = Examples::model()->findAll(array("condition" => "publish = 1 AND status = 1 AND deleted = 0 LIMIT {$example_limit}"));
    return array('stores' => $stores_examples, 'examples' => $examples);
}