예제 #1
0
 function delete($id)
 {
     $store = new store($id);
     //delete city
     $store->delete($store->product);
     $store->delete();
     //redirect to city
     redirect($this->admin . 'stores/list_all/');
 }
function print_store(store $store, $title = '')
{
    echo '<div><h3>' . $title . ' Store</h3><hr/><b>--Info--</b><pre>';
    echo 'count of items:' . $store->getItemsCount() . PHP_EOL;
    echo 'total price:' . $store->getTotalPrice() . PHP_EOL;
    echo 'total weight:' . $store->getTotalWeight() . PHP_EOL;
    echo '</pre><b>--Items--</b><table border="1"><tbody><tr><th>Price</th><th>Weight</th><th>Value</th></tr>';
    foreach ($store->getAllItems() as $index => $item) {
        echo '<tr><td>' . $item->getPrice() . '</td><td>' . $item->getWeight() . '</td><td>' . $item->getValue() . '</td></tr>';
    }
    echo '</tbody></table></div>';
}
예제 #3
0
 function test_delete()
 {
     $test_name = "Nordstrom";
     $test_id = 1;
     $test_store = new store($test_name, $test_id);
     $test_store->save();
     $test_name2 = "Bloomingdales";
     $test_id2 = 2;
     $test_store2 = new Store($test_name2, $test_id2);
     $test_store2->save();
     $test_store->delete();
     $result = Store::getAll();
     $this->assertEquals([$test_store2], $result);
 }
예제 #4
0
 function __construct()
 {
     store::$config = $this->config;
     store::$info = $this->info;
     store::$database = $this->database;
     store::$output = $this->output;
 }
예제 #5
0
파일: admin.php 프로젝트: ready4god2513/scs
 /**
  * Require administrator login
  * @Developer brandon
  * @Date Oct 11, 2010
  */
 public function __construct()
 {
     parent::__construct();
     $this->template = View::factory('layouts/admin');
     meta::set_title(store::name() . ' | Admin | ' . ucwords(Router::$controller));
     // Set the route for updating and creating files
     Kohana::config_set('routes.base_crud_route', 'admin/');
     // Require an admin login if we are in production.
     if (IN_PRODUCTION) {
         customer::require_admin_login();
     }
     ORM::factory('audit_trail')->create(array('user_id' => customer::current(), 'store_id' => store::get(), 'controller' => Router::$controller, 'method' => Router::$method, 'object_id' => $this->input->post('id')));
 }
예제 #6
0
파일: cart.php 프로젝트: ready4god2513/scs
 /**
  * Get the cart
  * @Developer brandon
  * @Date Oct 20, 2010
  */
 public static function get()
 {
     if (customer::logged_in()) {
         return customer::current()->load_cart();
     } else {
         if (Session::instance()->get('cart_' . store::get())) {
             return ORM::factory('cart', Session::instance()->get('cart_' . store::get()));
         } else {
             $cart = ORM::factory('cart');
             $cart->save();
             Session::instance()->set('cart_' . store::get(), (string) $cart);
             return $cart;
         }
     }
 }
예제 #7
0
파일: app.php 프로젝트: bborealis/shoes
$app->get("/brands", function () use($app) {
    return $app['twig']->render('brands.html.twig', array('brands' => Brand::getAll()));
});
$app->post("/brands", function () use($app) {
    $brand = new Brand($_POST['name']);
    $brand->save();
    return $app['twig']->render('brands.html.twig', array('brands' => Brand::getAll()));
});
$app->post("/add_brand", function () use($app) {
    $store = Store::find($_POST['store_id']);
    $brand = Brand::find($_POST['brand_id']);
    $store->addBrand($brand);
    return $app['twig']->render('store.html.twig', array('store' => $store, 'stores' => Store::getAll(), 'brands' => $store->getBrands(), 'all_brands' => Brand::getAll()));
});
$app->get("/store/{id}/edit", function ($id) use($app) {
    $store = store::find($id);
    return $app['twig']->render('store_edit.html.twig', array('store' => $store));
});
$app->patch("/store/{id}", function ($id) use($app) {
    $store = Store::find($id);
    $brands = $store->getBrands();
    $store->update($_POST['name']);
    return $app['twig']->render('store_edit.html.twig', array('store' => $store, 'brands' => $store->getBrands()));
});
$app->delete("/store/{id}", function ($id) use($app) {
    $store = Store::find($id);
    $store->delete();
    return $app['twig']->render("stores.html.twig", array('stores' => Store::getAll()));
});
$app->post("/delete_stores", function () use($app) {
    $GLOBALS['DB']->exec("DELETE FROM stores_brands;");
     $new_customer->set_city($city);
     $new_customer->set_country_id($customer_country_id);
     $new_customer->set_company($company);
     $new_customer->set_zone_id($customer_zone_id);
     $new_customer->set_state($state);
     $customer_id = $new_customer->create();
     $customer_default_address_id = $new_customer->get_default_address();
     smn_session_register('customer_id');
     smn_session_register('customer_first_name');
     smn_session_register('customer_default_address_id');
     smn_session_register('customer_country_id');
     smn_session_register('customer_zone_id');
 }
 //CREATE STORE IN THE DATABASE.....
 // systemsmanager begin - Dec 5, 2005
 $new_store = new store();
 $new_store->set_store_type($new_store_type);
 $new_store->set_customers_id($customer_id);
 $new_store->set_store_name($new_store_name);
 $new_store->set_store_description($store_description);
 $new_store->set_store_category($store_catagory);
 $new_store->set_store_logo('store_image');
 $customer_store_id = $new_store->create_store();
 smn_session_register('customer_store_id');
 $error_text = $new_store->put_logo_image();
 if ($error_text != '') {
     smn_session_register('error_text');
 }
 $new_store->put_store_description();
 $new_store->put_store_category();
 $new_store->put_store_admin();
  did not receive a copy of the oscMall System license and are unable 
  to obtain it through the world-wide-web, please send a note to    
  license@systemsmanager.net so we can mail you a copy immediately.
*/
ob_start();
global $page_name, $store;
if (!smn_session_is_registered('customer_id')) {
    $navigation->set_snapshot();
    smn_redirect(smn_href_link(FILENAME_LOGIN, '', 'NONSSL'));
}
include 'editor.php';
require DIR_WS_CLASSES . 'customer.php';
$profile_edit = new customer($store_id);
if ($store->is_store_owner($customer_id)) {
    require DIR_WS_CLASSES . 'store.php';
    $store_edit = new store($store_id);
}
if (isset($_POST['action']) && $_POST['action'] == 'process') {
    $error = false;
    // include validation functions (right now only email address)
    require DIR_WS_FUNCTIONS . 'validations.php';
    if (isset($_POST['state'])) {
        $zone_id = smn_db_prepare_input($_POST['state']);
    } else {
        $zone_id = false;
    }
    if (strlen($_POST['firstname']) < ENTRY_FIRST_NAME_MIN_LENGTH) {
        $error = true;
        $messageStack->add('account_edit', ENTRY_FIRST_NAME_ERROR);
    }
    if (strlen($_POST['lastname']) < ENTRY_LAST_NAME_MIN_LENGTH) {
예제 #10
0
파일: theme.php 프로젝트: ready4god2513/scs
 /**
  * Get a theme name from the database
  * @developer Brandon Hansen
  * @date Oct 13, 2010
  */
 public static function get()
 {
     return store::get()->theme->name;
 }
예제 #11
0
 /**
  * Show the overview of the store
  * @developer Brandon Hansen
  * @date Oct 23, 2010
  */
 public function index()
 {
     $this->template->set('content', View::factory('admin/stores/index')->set('store', store::get()));
 }
예제 #12
0
 function edit($id)
 {
     $cart = new Cartitem($id);
     if (!$cart->exists()) {
         show_404();
     }
     $cartDetail = $cart->cartdetail;
     if ($_SERVER['REQUEST_METHOD'] == "POST") {
         $cart->status = $this->input->post('cartStatus');
         $cart->description = $this->input->post('description');
         $cart->dateDeliver = $this->input->post('dateDeliver');
         $cart->prePaid = $this->input->post('prePaid');
         $cart->taxInfo = $this->input->post('taxInfo');
         $cart->linkOnline = $this->input->post('linkOnline');
         $cart->total = $this->input->post('hiTotal');
         $cart->shipType = $this->input->post('deliverMethod');
         $cart->paymentType = $this->input->post('payment');
         $cart->deliverStore_id = $this->input->post('branchReceive');
         $cart->paymentStore_id = $this->input->post('branchPayment');
         $cart->shipName = $this->input->post('info_name');
         $cart->shipEmail = $this->input->post('info_email');
         $cart->shipPhone = $this->input->post('info_phone');
         $cart->shipDescription = $this->input->post('info_description');
         $cart->shipAddress = $this->input->post('info_address');
         $cart->save();
         foreach ($cartDetail as $row) {
             $row->status = $this->input->post('cartDetailStatus_' . $row->id);
             $row->quantity = $this->input->post('cartDetailQuantity_' . $row->id);
             $row->inBox = $this->input->post('cartDetailInbox_' . $row->id);
             $row->price = $this->input->post('cartDetailPrice_' . $row->id);
             $row->save();
             $row->clear();
         }
         redirect('admin/carts/edit/' . $id);
     }
     $store = new store();
     $store->order_by('id', 'asc');
     $store->get_iterated();
     $dis['store'] = $store;
     $dis['menu_active'] = 'Giỏ hàng';
     $dis['cartdetail'] = $cartDetail;
     $dis['object'] = $cart;
     $dis['cart'] = $cart;
     $dis['title'] = "Chi tiết đơn hàng";
     $dis['base_url'] = base_url();
     $dis['view'] = 'cart/edit';
     $dis['nav_menu'] = array(array("type" => "back", "text" => "Back", "link" => "{$this->admin_url}carts/list_all/", "onclick" => ""));
     $this->viewadmin($dis);
 }
예제 #13
0
 function delete($query, $query_column)
 {
     parent::delete($query, $query_column);
 }
예제 #14
0
<?php

/*
  Copyright (c) 2002 - 2005 SystemsManager.Net

  SystemsManager Technologies
  oscMall System Version 4
  http://www.systemsmanager.net
  
  Portions Copyright (c) 2002 osCommerce
  
  This source file is subject to version 2.0 of the GPL license,   
  that is bundled with this package in the file LICENSE. If you
  did not receive a copy of the oscMall System license and are unable 
  to obtain it through the world-wide-web, please send a note to    
  license@systemsmanager.net so we can mail you a copy immediately.
*/
global $page_name;
if (!smn_session_is_registered('customer_id')) {
    $navigation->set_snapshot();
    smn_redirect(smn_href_link(FILENAME_LOGIN, '', 'NONSSL'));
}
$store = new store(0, $customer_id);
if (isset($_POST['action']) && $_POST['action'] == 'process') {
    $store->set_store_description(smn_db_prepare_input($_POST['store_description']));
    $store->update();
    $messageStack->add_session('account', SUCCESS_STORE_UPDATED, 'success');
    smn_redirect(smn_href_link(FILENAME_ACCOUNT, '', 'NONSSL'));
}
$breadcrumb->add(NAVBAR_TITLE_1, smn_href_link(FILENAME_ACCOUNT, '', 'NONSSL'));
$breadcrumb->add(NAVBAR_TITLE_2, smn_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'NONSSL'));
예제 #15
0
파일: theme.php 프로젝트: ready4god2513/scs
</head>
<body id="<?php 
echo theme::body_id();
?>
" class="<?php 
echo theme::body_class();
?>
">
	<div id="wrapper">
		<?php 
echo theme::render_header();
?>
		<div id="header">
			<div id="logo" class="left">
				<h1><?php 
echo html::anchor(url::site(), store::name());
?>
</h1>
			</div>
			<div id="navigation" class="right">
				<ul>
					<?php 
foreach (links::get('main') as $link) {
    ?>
						<li><?php 
    echo $link->display();
    ?>
</li>
					<?php 
}
?>
예제 #16
0
<?php

$arr = array("A \\'bbb", array('a', 'b', 'c'));
store::storeArray($arr, 'arr');
class store
{
    static function storeArray(&$array, $arrayName, $fileName = '')
    {
        if (empty($fileName)) {
            $fileName = 'store_' . $arrayName . '.php';
        }
        $contents = "\${$arrayName} = " . stripslashes(var_export($array, true));
        if (file_put_contents($fileName, $contents)) {
            return true;
        } else {
            return false;
        }
    }
}
예제 #17
0
   
    
    <div style="clear: both;margin-top:10px;border-top: 1px #000 dashed;padding-top:20px;">
        <div style="width: 200px;float:left;">
           <a title="Di động việt" href="<?php 
echo $base_url;
?>
"><img src="<?php 
echo $base_url;
?>
images/logo.png" alt="Di động việt" /></a>
        </div>
        <div style="width: 700px;float:left">
            DIDONGVIET.VN – Hệ THỐNG  WEBSITE BÁN LẺ THIẾT BỊ DI ĐỘNG CHÍNH HÃNG TẠI VIỆT NAM.<br />
            <?php 
$store = new store();
$store->order_by('position', 'asc');
$store->get_iterated();
?>
            <?php 
foreach ($store as $row) {
    ?>
            <?php 
    echo $row->name;
    ?>
: <?php 
    echo $row->address;
    ?>
<br />
            Điện thoại: <?php 
    echo $row->phone;
예제 #18
0
파일: admin.php 프로젝트: ready4god2513/scs
echo html::script('public/js/jquery');
echo html::script('public/js/admin');
?>
</head>
<body id="<?php 
echo Router::$controller;
?>
" class="<?php 
echo Router::$method;
?>
">
	<div class="container">
		<div id="header">
			<div id="logo" class="left">
				<h1><?php 
echo html::anchor('admin', store::name());
?>
</h1>
			</div>
			<ul id="sub-navigation" class="right">
				<li><?php 
echo html::anchor('admin/account', 'Account');
?>
</li>
				<li><?php 
echo html::anchor('admin/support', 'Support');
?>
</li>
				<li><?php 
echo html::anchor('customers/logout', 'Logout');
?>
예제 #19
0
                 zones: {' . implode(',', $zones_array) . '}
          }';
    } else {
        echo '{ hasZones: false }';
    }
    exit;
}
if (!class_exists('customer')) {
    require DIR_WS_CLASSES . 'customer.php';
}
$customerInfo = new customer($customer_id);
if (smn_session_is_registered('customer_store_id')) {
    if (!class_exists('store')) {
        require 'includes/classes/store.php';
    }
    $customersStore = new store($customer_store_id);
}
if (isset($_POST) && !empty($_POST) && $action == 'save') {
    $error = false;
    // include validation functions (right now only email address)
    require DIR_WS_FUNCTIONS . 'validations.php';
    $customer_first_name = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $dob = $_POST['dob_day'] . '-' . $_POST['dob_month'] . '-' . $_POST['dob_year'];
    $email_address = $_POST['email_address'];
    $company = $_POST['company'];
    $street_address = $_POST['street_address'];
    $postal_code = $_POST['postcode'];
    $city = $_POST['city'];
    $state = $_POST['state'];
    if (isset($_POST['zone_id'])) {
예제 #20
0
파일: cart.php 프로젝트: lxthien/batdongsan
 function showCart()
 {
     $step = 1;
     if ($this->uri->segment(2, "") != "") {
         $stepStr = $this->uri->segment(2, "");
         $stepStr = explode("-", $stepStr);
         $step = $stepStr[1];
         if ($step != '2' && $step != '3') {
             show_404();
         }
         if (!$this->_checkLogin()) {
             redirect('dang-nhap/' . 'gio-hang/buoc-' . $step);
         }
     }
     //get product from cookie
     $cartDetail = $this->getCartCookie();
     $product = new product();
     $productList = array(0);
     $store = new store();
     $store->get_iterated();
     $dis['store'] = $store;
     foreach ($cartDetail as $key => $value) {
         array_push($productList, $key);
     }
     $product->where_in('id', $productList);
     $product->get();
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $cart = new Cartitem();
         $cart->customer_id = $this->customer->id;
         $cart->shipType = $this->input->post('receiveType');
         $cart->paymentType = $this->input->post('payment');
         $cart->deliverStore_id = $this->input->post('branchReceive');
         $cart->paymentStore_id = $this->input->post('branchPayment');
         $cart->shipName = $this->input->post('info_name');
         $cart->shipEmail = $this->input->post('info_email');
         $cart->shipPhone = $this->input->post('info_phone');
         $cart->shipDescription = $this->input->post('info_description');
         $cart->shipAddress = $this->input->post('info_address');
         $cart->status = enum::CART_WAIT_FOR_PROCESS;
         $cart->save();
         $sum = 0;
         foreach ($product as $row) {
             $cartDetailItem = new Cartdetail();
             $cartDetailItem->cartitem_id = $cart->id;
             $cartDetailItem->product_id = $row->id;
             $cartDetailItem->quantity = $cartDetail[$row->id];
             $cartDetailItem->price = $row->getRealPriceNum();
             $cartDetailItem->productName = $row->name;
             $cartDetailItem->inBox = $row->inBox;
             $cartDetailItem->status = enum::CARTDETAIL_AVAILABLE;
             $cartDetailItem->save();
             $cartDetailItem->clear();
             $itemTotal = $cartDetail[$row->id] * $row->getRealPriceNum();
             $sum += $itemTotal;
         }
         $cart->total = $sum;
         $cart->save();
         $this->sendMailCustomer($cart->id);
         $this->sendMailCustomerService($cart->id);
         //save cart detail
         setcookie("userCart", json_encode(array()), mktime() . time() + 60 * 60 * 24 * 7, "/");
         $dis['view'] = 'cart/cart4';
     } else {
         $dis['step'] = $step;
         $dis['product'] = $product;
         $dis['cartDetail'] = $cartDetail;
         $dis['view'] = 'cart/cart1';
     }
     $dis['base_url'] = base_url();
     $this->viewfront($dis);
 }