• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Products类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: deleteAction

 /**
  * Delete a customer record
  */
 public function deleteAction()
 {
     $productsTable = new Products();
     $product = $productsTable->find($this->_getParam('id'))->current();
     !is_null($product) && $product->delete();
     $this->_redirect('/products');
 }
开发者ID:carriercomm,项目名称:billing-6,代码行数:10,代码来源:ProductsController.php


示例2: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     //$confirmation_code = str_random(30);
     $data = Input::except(array('_token'));
     $rule = array('custId' => 'required', 'custName' => 'required', 'custEmail' => 'required', 'prodId' => 'required', 'pname' => 'required', 'price' => 'required', 'stockUnit' => 'required', 'sales' => 'required', 'quantity' => 'required');
     $validator = Validator::make($data, $rule);
     if ($validator->fails()) {
         return Redirect::back()->withInput()->withErrors($validator);
     } else {
         $newproduct = new Products();
         $newproduct->prodId = Input::get('prodId');
         $newproduct->pname = Input::get('pname');
         $newproduct->descr = Input::get('descr');
         $newproduct->location = Input::get('location');
         $newproduct->purl = Input::get('purl');
         $newproduct->price = Input::get('price');
         $newproduct->pvat = Input::get('pvat');
         $newproduct->sales = Input::get('sales');
         $newproduct->svat = Input::get('svat');
         $newproduct->quantity = Input::get('quantity');
         $newproduct->swarn = Input::get('swarn');
         $newproduct->save();
         return Redirect::to('/back_end/manageProduct')->with('success', true)->with('message', 'Product Added Successfully');
     }
 }
开发者ID:Roc4rdho,项目名称:IMS_Soft400,代码行数:30,代码来源:purchaseController.php


示例3: getResult

 public function getResult()
 {
     // Date in the past
     header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
     // always modified
     header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
     // HTTP/1.1
     header("Cache-Control: no-store, no-cache, must-revalidate");
     header("Cache-Control: post-check=0, pre-check=0", false);
     // HTTP/1.0
     header("Pragma: no-cache");
     if (isset($_POST['process'])) {
     } else {
         $products = new Products();
         $this->licenseData['prices2'] = $this->licenseData['prices'];
         $this->licenseData['prices'] = json_encode($this->licenseData['prices']);
         $this->licenseData['licenses'] = json_encode($this->licenseData['lic']);
         $this->licenseData['bundle_prices'] = json_encode(isset($this->licenseData['bundle_prices']) ? $this->licenseData['bundle_prices'] : NULL);
         $this->licenseData['bundle_product_prices'] = json_encode(isset($this->licenseData['bundle_product_prices']) ? $this->licenseData['bundle_product_prices'] : NULL);
         $this->licenseData['offer_prices'] = json_encode($this->licenseData['offer_prices']);
         //	    $this->licenseData['geo_currency'] = json_encode($this->licenseData['geo_currency']);
         $this->licenseData['products'] = $products->getProductsShort(TRUE, FALSE, 3);
         $this->licenseData['product_versions'] = $products->getProductMajorVersions($this->productId);
         $this->licenseData['product'] = $products->getProductById($this->productId);
         $this->licenseData['currencies'] = json_encode($this->licenseData['currencies']);
         return $this->licenseData;
     }
 }
开发者ID:rjon76,项目名称:netspotapp,代码行数:28,代码来源:index.php


示例4: product_log

 function product_log($id, $status, $bean, $status_action, $old_status)
 {
     $productLog = new ProductLog();
     $product = new Products();
     $product->retrieve($id);
     if ($old_status != $status || empty($product->date_modified)) {
         $productLog->product_name = $product->name;
         $productLog->product_id = $product->id;
         $productLog->from_status = $old_status;
         $product->status = $status;
         $product->save($GLOBALS['check_notify']);
         $productLog->to_status = $product->status;
         var_dump($productLog->object_name);
         var_dump($productLog->object_id);
         $productLog->bean_name = $bean->object_name;
         $productLog->bean_id = $bean->id;
         var_dump($productLog->object_name);
         var_dump($productLog->object_id);
         var_dump($bean->object_name);
         var_dump($bean->object_id);
         $productLog->action = $status_action;
         if (!empty($_REQUEST['status_action'])) {
             $productLog->action = $_REQUEST['status_action'];
         }
         $productLog->save($GLOBALS['check_notify']);
     }
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:27,代码来源:ProductStatus.php


示例5: testMany

 public function testMany()
 {
     $this->_mock = new Mock_Database($this, array(array('many', "SELECT products.*\nFROM products", array(), null, array('return' => array(array('id' => 1), array('id' => 2)))), array('many', "SELECT products_options.*\nFROM products_options\nWHERE `product_id` IN (?, ?)", array(1, 2), null, array('return' => array(array('id' => 3, 'product_id' => 1), array('id' => 4, 'product_id' => 2))))));
     \Snowfire\Database\Model::database($this->_mock);
     $prod_model = new Products();
     $opt_model = new Products_Options();
     $this->assertEquals(array(array('id' => 1, 'options' => array(array('id' => 3, 'product_id' => 1))), array('id' => 2, 'options' => array(array('id' => 4, 'product_id' => 2)))), $prod_model->many(array('foreign_models' => array('options' => $opt_model))));
 }
开发者ID:snowfire,项目名称:database,代码行数:8,代码来源:ForeignOneToManyTest.php


示例6: exportAll

 /**
  *Export all orders, 
  *customers, product into a xml file
  *
  */
 public static function exportAll()
 {
     // create the xml customer file
     $customers = new Customers();
     $theCustomers = $customers->bulk_xml();
     // create the xml product
     $products = new Products();
     $theCustomers = $products->bulk_xml();
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:14,代码来源:Cronjobs.php


示例7: testObject

 public function testObject()
 {
     $product = new Product();
     $product->setTitle('title');
     $product->setSize('10k');
     $product->setUnitPrice('10');
     $product->setDescription('description');
     $products = new Products();
     $products->add($product);
     $this->assertArrayHasKey('total', $products->getItems());
 }
开发者ID:sela,项目名称:scraper,代码行数:11,代码来源:ProductsTest.php


示例8: createUserInterface

 /**
  * @see		ApplicationView::createUserInterface()
  */
 protected function createUserInterface()
 {
     parent::createUserInterface();
     $this->addStyle('/css/home.css');
     $resourceBundle = Application::getInstance()->getBundle();
     $products = $this->products->getProducts();
     if (count($products) == 0) {
         $this->contentPanel->addChild(new Heading(2))->addChild(new Text($resourceBundle->getString('NO_PRODUCT')));
     } else {
         $this->contentPanel->addChild(new ProductList())->setProductList($products);
     }
 }
开发者ID:rcastardo,项目名称:mvc-na-pratica,代码行数:15,代码来源:HomeView.php


示例9: get

 public function get($productid)
 {
     $this->authenticate();
     if (empty($productid)) {
         throw new Shineisp_Api_Exceptions(400002, ":: 'productid' field");
         exit;
     }
     $product = new Products();
     $details = $product->getAllInfo($productid);
     $details['ProductsUpgrades'] = ProductsUpgrades::getItemsbyProductID($productid);
     return $details;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:12,代码来源:Products.php


示例10: GetWaitingList

 public function GetWaitingList($id_user)
 {
     $sql = "SELECT wl.id_product, p.art, p.name, p.translit , p.img_1,\r\n\t\t\tp.price_opt, p.price_mopt, p.old_price_opt, p.visible\r\n\t\t\tFROM " . _DB_PREFIX_ . "waiting_list AS wl\r\n\t\t\tLEFT JOIN " . _DB_PREFIX_ . "product AS p\r\n\t\t\t\tON wl.id_product = p.id_product\r\n\t\t\tWHERE wl.id_user = '" . $id_user . "'\r\n\t\t\tORDER BY wl.id_product";
     if (!($arr = $this->db->GetArray($sql))) {
         return false;
     }
     foreach ($arr as &$value) {
         $Products = new Products();
         $value['images'] = $Products->GetPhotoById($value['id_product']);
     }
     return $arr;
 }
开发者ID:Arikito,项目名称:webking.xt,代码行数:12,代码来源:customers_c.php


示例11: findProductCoalesced

 /**
  * @param int $customerId
  * @param int $productId
  */
 public function findProductCoalesced($customerId, $productId)
 {
     $productsTable = new Products();
     $p = $productsTable->find($productId)->current();
     $cp = $this->find($productId, $customerId)->current();
     if ($cp) {
         $productCoalesced = array('product_id' => $cp->product_id, 'sku' => $cp->sku ?: $p->sku, 'name' => $cp->name ?: $p->name, 'description' => $cp->description ?: $p->description, 'unit_price' => $cp->unit_price ?: $p->unit_price);
     } else {
         $productCoalesced = array('product_id' => $p->product_id, 'sku' => $p->sku, 'name' => $p->name, 'description' => $p->description, 'unit_price' => $p->unit_price);
     }
     return $productCoalesced;
 }
开发者ID:carriercomm,项目名称:billing-6,代码行数:16,代码来源:CustomerProducts.php


示例12: init

 public function init()
 {
     // Set the custom decorator
     $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
     $translate = Shineisp_Registry::get('Zend_Translate');
     $this->addElement('text', 'quantity', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Quantity'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'setupfee', array('filters' => array('StringTrim'), 'label' => $translate->_('Setup fees'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'discount', array('filters' => array('StringTrim'), 'label' => $translate->_('Discount'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'cost', array('filters' => array('StringTrim'), 'label' => $translate->_('Cost'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('select', 'product_id', array('filters' => array('StringTrim'), 'required' => false, 'label' => $translate->_('Products'), 'class' => 'form-control'));
     $this->getElement('product_id')->setAllowEmpty(false)->setMultiOptions(Products::getList(true));
     $this->addElement('text', 'price', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Price'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('select', 'billing_cycle_id', array('label' => $translate->_('Billing Cycle'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('billing_cycle_id')->setAllowEmpty(false)->setMultiOptions(BillingCycle::getList(true));
     $this->addElement('text', 'date_start', array('filters' => array('StringTrim'), 'label' => $translate->_('Start Date'), 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat()));
     $this->addElement('text', 'date_end', array('filters' => array('StringTrim'), 'label' => $translate->_('Expiry Date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat()));
     $this->addElement('textarea', 'description', array('filters' => array('StringTrim'), 'label' => $translate->_('Description'), 'decorators' => array('Bootstrap'), 'rows' => 5, 'class' => 'form-control'));
     $this->addElement('textarea', 'parameters', array('filters' => array('StringTrim'), 'label' => $translate->_('Service Panel Configuration'), 'decorators' => array('Bootstrap'), 'rows' => 5, 'description' => $translate->_('Parameters model accepted: {"domain":{"name":"domain.com","tld":"2","action":"renewDomain","authcode":null}}'), 'class' => 'form-control'));
     $this->addElement('select', 'status_id', array('label' => $translate->_('Status'), 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('status_id')->setAllowEmpty(false)->setMultiOptions(Statuses::getList('orders'));
     $this->addElement('select', 'autorenew', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Auto Renewal'), 'class' => 'form-control', 'multioptions' => array(0 => 'NO', 1 => 'YES')));
     $this->addElement('multiselect', 'domains', array('label' => $translate->_('Available Domains'), 'decorators' => array('Bootstrap'), 'class' => 'form-control tmpitems'));
     $this->getElement('domains')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Domains::getList());
     $this->addElement('multiselect', 'domains_selected', array('label' => $translate->_('Selected domains'), 'decorators' => array('Bootstrap'), 'class' => 'form-control items'));
     $this->getElement('domains_selected')->setRegisterInArrayValidator(false);
     // Disable the Validator in order to manage a dynamic list.
     $this->addElement('hidden', 'detail_id');
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:28,代码来源:OrdersItemsForm.php


示例13: productsAction

 /**
  * compareAction
  * Compare the services between themselves
  */
 public function productsAction()
 {
     $code = $this->getRequest()->getParam('code');
     if ($code) {
         // Get all the data from the database
         $data = Products::GetProductsByGroupCode($code);
     }
     if (!empty($data['products'][0]['ProductsAttributesGroups']['name'])) {
         $this->view->headTitle()->prepend($this->translator->_("Compare %s", $data['products'][0]['ProductsAttributesGroups']['name']));
         $this->view->title = $data['products'][0]['ProductsAttributesGroups']['name'];
     } else {
         $this->view->title = $code;
     }
     // Check the existence of the mandatories attributes
     if (!empty($data['attributes'][0])) {
         $this->view->attributes = $data['attributes'];
     }
     // Check if there are values set for the group of the product selected
     if (!empty($data['attributes_values'][0])) {
         $this->view->values = $data['attributes_values'];
     }
     // Get the products
     if (!empty($data['products'][0])) {
         $this->view->products = $data['products'];
     }
     // Render the page
     $this->_helper->viewRenderer('index');
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:32,代码来源:CompareController.php


示例14: searchAction

 public function searchAction()
 {
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "Products", $_POST);
         $this->persistent->searchParams = $query->getParams();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
         if ($numberPage <= 0) {
             $numberPage = 1;
         }
     }
     $parameters = array();
     if ($this->persistent->searchParams) {
         $parameters = $this->persistent->searchParams;
     }
     $products = Products::find($parameters);
     if (count($products) == 0) {
         $this->flash->notice("没找到任何类型");
         return $this->forward("products/index");
     }
     $paginator = new Phalcon\Paginator\Adapter\Model(array("data" => $products, "limit" => 5, "page" => $numberPage));
     $page = $paginator->getPaginate();
     $this->view->setVar("page", $page);
 }
开发者ID:lookingatsky,项目名称:zhonghewanbang,代码行数:25,代码来源:ProductsController.php


示例15: Show

 public function Show($parameters)
 {
     $output = "";
     $ns = new Zend_Session_Namespace();
     $languageID = Languages::get_language_id($ns->lang);
     $mainviewhelper = new Zend_View();
     $mainviewhelper->addBasePath(APPLICATION_PATH . '/modules/default/views/');
     $view = new Zend_View();
     $view->addScriptPath('../library/Shineisp/Custom/views');
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     if (!empty($parameters['code'])) {
         $code = $parameters['code'];
     } else {
         return "";
     }
     // Get the products
     $data = Products::GetProductsByGroupCode($code, $languageID);
     // Check the existence of the mandatories attributes
     if (!empty($data['attributes'][0])) {
         $view->attributes = $data['attributes'];
     }
     // Check if there are values set for the group of the product selected
     if (!empty($data['attributes_values'][0])) {
         $view->values = $data['attributes_values'];
     }
     // Get the products
     if (!empty($data['products'][0])) {
         $view->products = $data['products'];
     }
     $view->mainviewhelper = $mainviewhelper;
     // Path of the template
     return $view->render('productsattributes.phtml');
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:33,代码来源:Productlistattributes.php


示例16: init

 public function init()
 {
     // Set the custom decorator
     $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
     $translate = Shineisp_Registry::get('Zend_Translate');
     $this->addElement('text', 'date_start', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Creation date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat()));
     $this->addElement('text', 'date_end', array('filters' => array('StringTrim'), 'label' => $translate->_('Expiry Date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat()));
     $this->addElement('text', 'quantity', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Quantity'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('textarea', 'message', array('filters' => array('StringTrim'), 'label' => $translate->_('Message'), 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12 form-control wysiwyg'));
     $this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'label' => $translate->_('Note'), 'description' => $translate->_('Write here a note. An email will be sent to the ISP staff.'), 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12 form-control wysiwyg'));
     $this->addElement('textarea', 'setup', array('filters' => array('StringTrim'), 'label' => $translate->_('Setup Configuration'), 'description' => $translate->_('Here you can read the service configuration written by the ISP modules. These information are read-only.'), 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12'));
     $this->addElement('select', 'order_id', array('label' => $translate->_('Orders'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('order_id')->setAllowEmpty(false)->setMultiOptions(Orders::getList(true));
     $this->addElement('multiselect', 'domains', array('label' => $translate->_('Available domains'), 'decorators' => array('Bootstrap'), 'class' => 'form-control col-lg-12 tmpitems'));
     $this->getElement('domains')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Domains::getList());
     $this->addElement('multiselect', 'domains_selected', array('label' => $translate->_('Selected domains'), 'decorators' => array('Bootstrap'), 'class' => 'form-control col-lg-12 items'));
     $this->getElement('domains_selected')->setRegisterInArrayValidator(false);
     // Disable the Validator in order to manage a dynamic list.
     $this->addElement('select', 'product_id', array('label' => $translate->_('Products'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('product_id')->setAllowEmpty(false)->setMultiOptions(Products::getList(true));
     $this->addElement('select', 'billing_cycle_id', array('label' => $translate->_('Billing Cycle'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('billing_cycle_id')->setAllowEmpty(false)->setMultiOptions(BillingCycle::getList(true));
     $this->addElement('select', 'status_id', array('label' => $translate->_('Status'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('status_id')->setAllowEmpty(false)->setMultiOptions(Statuses::getList('orders', false, true));
     $this->addElement('select', 'autorenew', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Auto Renewal'), 'description' => $translate->_('Enable or disable the automatic renewal of the service'), 'class' => 'form-control'));
     $this->getElement('autorenew')->setAllowEmpty(false)->setMultiOptions(array('1' => $translate->_('Yes, I would like to renew the service at the expiration date.'), '0' => $translate->_('No, I am not interested in the service renew.')));
     $this->addElement('hidden', 'detail_id');
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:28,代码来源:ServicesForm.php


示例17: actionUpdate

 public function actionUpdate($id)
 {
     self::validateAdmin();
     $platformList = Platform::getPlatformListByAdmin();
     $genreList = Genre::getGenresListByAdmin();
     $product = Products::getProductById($id);
     if (isset($_POST['submit'])) {
         $option['code'] = $_POST['code'];
         $option['name'] = $_POST['name'];
         $option['price'] = $_POST['price'];
         $option['platform_id'] = $_POST['platform_id'];
         $option['genre_id'] = $_POST['genre_id'];
         $option['brand'] = $_POST['brand'];
         $option['description'] = $_POST['description'];
         $option['availability'] = $_POST['availability'];
         $option['is_recomend'] = $_POST['is_recomend'];
         $option['is_new'] = $_POST['is_new'];
         $option['status'] = $_POST['status'];
         $errors = false;
         if (!isset($option['name']) || empty($option['name'])) {
             $errors[] = "Введите имя товара";
         }
         if ($errors == false) {
             Products::updateProduct($id, $option);
             if ($id) {
                 if (is_uploaded_file($_FILES['image']['tmp_name'])) {
                     move_uploaded_file($_FILES['image']['tmp_name'], $_SERVER["DOCUMENT_ROOT"] . "/upload/images/products/(" . $id . ").png");
                 }
             }
         }
         header("Location: /evkazolinAdminka/product/");
     }
     require_once ROOT . '/views/admin_product/update.php';
     return true;
 }
开发者ID:Evkazolinium,项目名称:Eshop_for_example,代码行数:35,代码来源:AdminProductController.php


示例18: listRss

function listRss()
{
    header("Content-Type: application/xml; charset=UTF-8");
    $location = Url::rss();
    if ($match = Uri::match('^(.*?)$')) {
        $location = ROOT_URL . $match[1];
        $reLocation = base64_encode($location);
        if ($loadData = Cache::loadKey($reLocation, 60)) {
            $loadData = json_decode($loadData, true);
            return $loadData;
        }
    }
    $inputData = array('limitShow' => 15, 'limitPage' => 0);
    if ($match = Uri::match('\\/page\\/(\\d+)')) {
        $inputData['limitPage'] = $match[1];
    }
    if ($match = Uri::match('\\/category\\/(\\d+)')) {
        $id = $match[1];
        $inputData['where'] = "where catid='{$id}'";
    }
    if ($match = Uri::match('rss\\/products')) {
        $loadData = Products::get($inputData);
    } else {
        $loadData = Post::get($inputData);
    }
    $reLocation = base64_encode($location);
    Cache::saveKey($reLocation, json_encode($loadData));
    return $loadData;
}
开发者ID:neworldwebsites,项目名称:noblessecms,代码行数:29,代码来源:rss.php


示例19: actionView

 public function actionView($productId)
 {
     $categories = array();
     $categories = Platform::getPlatformList();
     $product = Products::getProductById($productId);
     $productId = $product['id'];
     $platform = Platform::getPlatformById($product['platform_id']);
     $comments = Comment::getCommentsByProductId($productId);
     //COMMENTS
     if (isset($_POST['submit'])) {
         $userComment = $_POST['message'];
         $errors = false;
         if (!Comment::validateMessage($userComment)) {
             $errors[] = "Введите собщение";
         }
         if (User::isGuest()) {
             $userName = $_POST['name'];
             $userEmail = $_POST['email'];
             if (!User::validateUsername($userName)) {
                 $errors[] = "Неверное имя";
             }
             if (!User::validateEmail($userEmail)) {
                 $errors[] = "Неверный Email";
             }
             $userId = false;
         } else {
             $userId = User::validateLogged();
             $user = User::getUserById($userId);
             $userName = $user['name'];
         }
         Comment::addComment($userComment, $userId, $userName, $productId);
     }
     require_once ROOT . '/views/product/view.php';
     return true;
 }
开发者ID:Evkazolinium,项目名称:Eshop_for_example,代码行数:35,代码来源:ProductController.php


示例20: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function edit($id)
 {
     $discountTypes = ['' => 'Select Discount Type', 'percentage' => 'Percentage', 'fixed' => 'Fixed'];
     $statuses = Discounts::$statuses;
     $discount = Discounts::find($id);
     $product = Products::find($discount->product_id);
     return View::make('discounts.edit', compact('discountTypes', 'product', 'statuses', 'discount'));
 }
开发者ID:nurulimamnotes,项目名称:point-of-sale,代码行数:14,代码来源:DiscountsController.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Produto类代码示例发布时间:2022-05-23
下一篇:
PHP Producto类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap