public function actionLv() { $model = new VipPaymentModel(); $_priceList = PriceList::returnPriceList(); foreach ($_priceList as $l => $p) { $priceList[$p] = $l; } for ($i = 1; $i <= 12; $i++) { $mouth[$i] = $i . '个月'; } if (isset($_POST['VipPaymentModel'])) { $dateTime = time(); $model->attributes = $_POST['VipPaymentModel']; $model->uid = Yii::app()->session['userInfo']['uid']; $model->username = Yii::app()->session['userInfo']['username']; $model->created_at = $dateTime; $model->orderId = $this->_createOrderSns(); if ($model->validate()) { //校验价格 $price = $model->payCode; $count = $model->count; $amount = $price * $count; if ($amount != $model->amount) { ShowMessage::error('数据有误!'); } $model->payCode = $priceList[$model->payCode]; $model->save(); //ShowMessage::success('添加成功!',Yii::app()->createUrl('vip/index')); } } $this->render('lv', array('model' => $model, 'priceList' => $priceList, 'mouth' => $mouth)); }
<?php ini_set('max_execution_time', 0); ini_set('memory_limit', '128M'); ob_start(); session_start(); include_once '../connection.php'; include_once "../model/PriceList.php"; $priceListObj = new PriceList(); if ($priceListObj->isCategoryList($_GET["idPriceList"])) { header('Location: categoryPriceListReport.php?tipoReporte=pdf&idPriceList=' . $_GET["idPriceList"] . '&listName=' . $_GET["listName"] . "&all=" . $_GET["all"]); } ?> <link href="../css/styles.css" rel="stylesheet" type="text/css" media="screen" /> <link href="../css/jquery-ui/jquery-ui.css" rel="stylesheet" type="text/css"/> <style> .tittle{ color:#C62; font-weight: bold; font-size:22px; text-align:center; padding-top: 40px; } </style> <page format="letter" backleft="30px" footer="date;page" backbottom="5" backtop="31"> <page_header> <div class="tittle" style="height: 80px; background: url(../images/logo.jpg) no-repeat;"> <?php echo htmlentities($_GET["listName"]); ?> </div>
table{ width:500px; } </style> <?php require_once '../includes/fpdf/pdf.php'; include_once "../model/PriceList.php"; $content = ob_get_clean(); $pdf = new PDF(); $title = htmlentities($_GET["listName"]); $pdf->SetTitle($title); $pdf->AddPage(); $i; global $i; $priceListObj = new PriceList(); /*$categories = $priceListObj->getCategories($_GET["idPriceList"],$_GET["all"]); foreach($categories as $category) { $pdf->escribir(utf8_decode($category),"","C"); $subcategories = $priceListObj->getSubcategories($_GET["idPriceList"], $category, $_GET["all"]); foreach($subcategories as $subcategory) { $pdf->escribir(utf8_decode($subcategory),"","S"); $items = $priceListObj->getSubcategoryItems($_GET["idPriceList"], $category, $subcategory, $_GET["all"]); foreach($items as $item) { $pdf->escribir(utf8_decode($item['name']),$item['price'],"I"); } }
/** * Creates and sends a Pricelist as a PDF document * * Does not return on success, just sends the list and dies happily instead. * Note that the $lang_id is ignored if it's defined for the Pricelist. * @param integer $lang_id The optional language ID * @return boolean False on failure */ static function send_pricelist($lang_id = null) { global $_ARRAYLANG; if (!$lang_id) { $lang_id = FRONTEND_LANG_ID; } $list_id = isset($_GET['list_id']) ? intval($_GET['list_id']) : null; if (!$list_id) { return \Message::error($_ARRAYLANG['TXT_SHOP_PRICELIST_ERROR_MISSING_LIST_ID']); } // Optional $currency_id = isset($_GET['currency_id']) ? intval($_GET['currency_id']) : null; $objList = new PriceList($list_id, $currency_id, $lang_id); if (!$objList->send_as_pdf()) { return \Message::error($_ARRAYLANG['TXT_SHOP_PRICELIST_ERROR_SENDING']); } exit; }
<page_footer> <div style="text-align: center">Prices subject to change due to availability and weather conditions</div> </page_footer> <?php $n = 51; $fila = 1; $col = 1; ?> <br/> <table align="left" border="0" cellpadding="0" cellspacing="10" style="width: 750px;"> <tr> <td> <table border="0" cellpadding="2" cellspacing="0" style="width: 250px;"> <?php include_once "../model/PriceList.php"; $priceListObj = new PriceList(); $categories = $priceListObj->getCategories($_GET["idPriceList"], $_GET["all"]); for ($icat = 0; $icat < count($categories); $icat++) { $category = $categories[$icat]; $fila += 3; ?> <tr> <td colspan="2"><h2><?php echo $category; ?> </h2></td> </tr> <?php $subcategories = $priceListObj->getSubcategories($_GET["idPriceList"], $category, $_GET["all"]); for ($isub = 0; $isub < count($subcategories); $isub++) { $subcategory = $subcategories[$isub];
session_start(); include_once '../connection.php'; ?> <link href="../css/styles.css" rel="stylesheet" type="text/css" media="screen" /> <link href="../css/jquery-ui/jquery-ui.css" rel="stylesheet" type="text/css"/> <page format="A4" backleft="30px" footer="page"> <?php $_GET["title"] = 'All lists report'; include 'header.php'; ?> <br/> <table align="center" border="1" cellpadding="2" cellspacing="0" class="ui-corner-all"> <?php $itemPrices = array(); include_once "../model/PriceList.php"; $priceListObj = new PriceList(); $lists = $priceListObj->getStandarPriceLists(); include_once "../model/Item.php"; $itemObj = new Item(); $items = $itemObj->getItemsList(); ?> <tr align="center"> <th style="width: 200px">Item</th> <?php foreach ($lists as $id => $value) { $itemPrices[] = $priceListObj->getAllItems($id); ?> <th style="width: 70px"><?php echo $value; ?> </th>
<table border="1" cellspacing="0" width="800" align="center" class="ui-corner-all"> <tr class="ui-widget-header"> <th> </th> <th>Item</th> <th>Base list price</th> <th>Lowest cost</th> <th>Adjustment</th> <th>Price</th> <th>Class</th> <th>Subcategory</th> </tr> <?php include_once "../model/PriceList.php"; $priceListObj = new PriceList(); if ($list["type"] == "I" && isset($_GET["baseList"]) == false) { if ($list["base_list"] == 104) { $items = $priceListObj->getItemsListBaseZero($_GET["idprice_list"]); } else { $items = $priceListObj->getItemsList($_GET["idprice_list"]); } } else { if ($_GET["baseList"] == 104) { $items = $priceListObj->getItemsListBaseZero($_GET["idprice_list"]); } else { $items = $priceListObj->getItemsList2($_GET["idprice_list"], $_GET["baseList"]); } } if (count($items) == 0) { $items[] = array("iditem" => "", "name" => "", "lowest_cost" => "", "base_list_price" => "", "price" => "", "adjustment" => "", "class" => "", "category" => "", "subcategory" => ""); } $i = 0;
public function d011($id = null) { if (!is_null($id)) { $result = PriceList::find($id); $result->delete(); ZiUtil::to_json(json_encode("{ success: true}")); return; } App::flash('error', 'Terjadi kesalahan pada inputan anda.'); App::redirect('pricelist.index'); }
<table border="1" cellspacing="0" width="800" align="center" class="ui-corner-all"> <tr class="ui-widget-header"> <th> </th> <th>Item</th> <th>Base list price</th> <th>Lowest cost</th> <th>Adjustment</th> <th>Price</th> <th>Class</th> <th>Subcategory</th> </tr> <?php include_once "../model/PriceList.php"; $priceListObj = new PriceList(); if ($list["type"] == "I") { $items = $priceListObj->getItemsList($_GET["idprice_list"]); } else { $items = $priceListObj->getItemsList($_GET["baseList"]); } if (count($items) == 0) { $items[] = array("iditem" => "", "name" => "", "lowest_cost" => "", "base_list_price" => "", "price" => "", "adjustment" => "", "class" => "", "category" => "", "subcategory" => ""); } $i = 0; foreach ($items as $item) { $price = $item["base_list_price"] + $item["adjustment"]; $diff = $price - $item["lowest_cost"]; if ($price <= $item["lowest_cost"] || $diff > $list["flag"]) { $class = "class='ui-state-error'"; } else { $class = ""; }
$msg = $priceList->editPriceList($items, $classes); $msgSplit = explode("_", $msg); if ($msgSplit[0] == "true") { $msg = "Price list edited"; $id = $msgSplit[1]; $edit = "&edit=true"; } else { $msg = utf8_encode($msg); } header("Location: ../view/priceListAdd.php?msg={$msg}&idprice_list={$id}" . $edit); break; case "deletePriceList": $priceList = new PriceList(); $priceLists = array(); foreach ($_POST as $key => $value) { if (substr($key, 0, 3) == 'chk') { $priceLists[] = $value; } } $msg = $priceList->deletePriceList($priceLists); if ($msg == "true") { $msg = "Price list deleted"; } $msg = utf8_encode($msg); header("Location: ../view/priceLists.php?msg={$msg}"); break; case "getPriceListItems": $priceList = new PriceList(); print json_encode($priceList->getPriceListItemsAlpha($_POST["idPriceList"])); break; }
<title>EFAP</title> <link href="../css/jquery-ui/jquery-ui.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="../js/jquery/jquery.js"></script> </head> <form method="post" name="form" id="form" action=""> <span> <b>Name List: </b> </span> <?php echo $_GET["listName"]; ?> <br/><br/> <table id="tablePrices" align="center" border="1" cellpadding="2" cellspacing="0" > <thead> <?php include_once "../model/PriceList.php"; $priceListObj = new PriceList(); $listPrices = $priceListObj->getPriceListItems($_GET["idPriceList"], ""); ?> <tr class='ui-widget-header' align="center"> <th>Name</th> <th>Price</th> </tr> </thead> <tbody> <?php foreach ($listPrices as $item) { ?> <tr> <td style="vertical-align: top;" align="left"> <?php echo $item["name"];
<?php header('Content-Type: text/xml'); require_once 'class.price_list.php'; try { $db = new MySQLDBase('127.0.0.1', 'root', '', 'metalls'); } catch (Exception $e) { echo "Ошибка\n" . $e->getMessage(); } $price = new PriceList($db, "nikel-price", $_GET); $price->getXML();
/** * Edit a pricelist * @global ADOConnection $objDatabase * @global array $_ARRAYLANG * @return boolean True on success, false otherwise */ static function view_pricelist_edit() { global $_ARRAYLANG; $list_id = null; $objList = PriceList::getFromPost(); if ($objList) { $result = $objList->store(); if ($result) { if (isset($_REQUEST['list_id'])) { unset($_REQUEST['list_id']); } //die("Showing lists"); return self::view_pricelists(); } } $list_id = isset($_GET['list_id']) ? $_GET['list_id'] : null; $objList = PriceList::getById($list_id); if (!$objList) { $objList = new PriceList(null); } $list_id = $objList->id(); self::$objTemplate->loadTemplateFile("module_shop_pricelist_details.html"); self::$objTemplate->setGlobalVariable($_ARRAYLANG); self::$objTemplate->setVariable(array('SHOP_PRICELIST_EDIT' => $_ARRAYLANG[$list_id ? 'TXT_SHOP_PRICELIST_EDIT' : 'TXT_SHOP_PRICELIST_ADD'], 'SHOP_PRICELIST_ID' => $list_id, 'SHOP_PRICELIST_LINK_PDF' => $list_id ? PriceList::getUrl($list_id) : '', 'SHOP_PRICELIST_NAME' => $objList->name(), 'SHOP_PRICELIST_LANGUAGE_MENUOPTIONS' => \Html::getOptions(\FWLanguage::getNameArray(), $objList->lang_id()), 'SHOP_PRICELIST_BORDER_CHECKED' => $objList->border() ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_PRICELIST_HEADER_CHECKED' => $objList->header() ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_PRICELIST_HEADER_LEFT' => $objList->header_left(), 'SHOP_PRICELIST_HEADER_RIGHT' => $objList->header_right(), 'SHOP_PRICELIST_FOOTER_CHECKED' => $objList->footer() ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_PRICELIST_FOOTER_LEFT' => $objList->footer_left(), 'SHOP_PRICELIST_FOOTER_RIGHT' => $objList->footer_right())); $category_ids = $objList->category_ids(); $category_all = false; if (empty($category_ids) || $category_ids == '*') { $category_all = true; self::$objTemplate->setVariable('SHOP_PRICELIST_CATEGORY_ALL_CHECKED', \Html::ATTRIBUTE_CHECKED); } // Get all categories $arrCategories = ShopCategories::getTreeArray(true, false); if (empty($arrCategories)) { Message::warning($_ARRAYLANG['TXT_SHOP_WARNING_NO_CATEGORIES']); } $i = 0; foreach ($arrCategories as $objCategory) { $category_id = $objCategory['id']; $selected = $category_all || preg_match('/(?:^|,)\\s*' . $category_id . '\\s*(?:,|$)/', $category_ids); //DBG::log("Category ID $category_id, ".($selected ? "selected" : "NOT")); self::$objTemplate->setVariable(array('SHOP_CATEGORY_ID' => contrexx_raw2xhtml($category_id), 'SHOP_CATEGORY_NAME' => contrexx_raw2xhtml($objCategory['name']), 'SHOP_CATEGORY_LEVELSPACE' => str_repeat('|----', $objCategory['level']), 'SHOP_CATEGORY_DISABLED' => $category_all ? \Html::ATTRIBUTE_DISABLED : '', 'SHOP_CATEGORY_CHECKED' => $selected ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_CATEGORY_ROWCLASS' => 'row' . (++$i % 2 + 1))); self::$objTemplate->parse('shop_category'); } return true; }
</div> <?php } ?> <table align="center" border="1" cellpadding="2" cellspacing="0" width="100%" class="ui-corner-all"> <thead> <tr class="ui-widget-header"> <th> </th> <th>Name</th> <th>Description</th> </tr> </thead> <tbody class="ui-widget-content"> <?php include_once "../model/PriceList.php"; $priceListObj = new PriceList(); if (isset($_POST['searchSalesList'])) { $lists = $priceListObj->getPriceLists('searchList', $_POST['salesUser']); } else { $lists = $priceListObj->getPriceLists($_SESSION['profile'], $_SESSION['username']); } $noEditableLists = $priceListObj->getNotEditablesLists(); foreach ($lists as $priceList) { ?> <tr onclick="loadPriceList('<?php echo $priceList['idprice_list']; ?> ')"> <td> <input type="checkbox" name="chk<?php echo $priceList['idprice_list'];
<?php ini_set('max_execution_time', 0); ini_set('display_errors', true); ini_set('memory_limit', '800M'); ob_start(); session_start(); include_once '../connection.php'; include_once "../model/PriceList.php"; $priceListObj = new PriceList(); if ($priceListObj->isCategoryList($_GET["idPriceList"])) { header('Location: categoryPriceListReport.php?tipoReporte=pdf&idPriceList=' . $_GET["idPriceList"] . '&listName=' . $_GET["listName"] . "&all=" . $_GET["all"]); } ?> <link href="../css/styles.css" rel="stylesheet" type="text/css" media="screen" /> <link href="../css/jquery-ui/jquery-ui.css" rel="stylesheet" type="text/css"/> <style> .tittle{ color:#C62; font-weight: bold; font-size:22px; text-align:center; padding-top: 40px; } </style> <?php $content = ob_get_clean(); require_once '../includes/fpdf/pdf.php'; $pdf = new PDF(); $title = htmlentities($_GET["listName"]);
/** * Returns a Pricelist with properties taken from the posted data * * Backend use only. Takes its arguments directly from the form values. * If no form has been posted, returns null. * @global array $_ARRAYLANG * @return Pricelist The Pricelist on success, * null otherwise */ static function getFromPost() { global $_ARRAYLANG; if (empty($_POST['bsubmit'])) { return null; } $list_id = isset($_POST['list_id']) ? intval($_POST['list_id']) : (isset($_GET['list_id']) ? intval($_GET['list_id']) : null); $objList = self::getById($list_id); if (!$objList) { $objList = new PriceList(null); } $objList->name(empty($_POST['name']) ? $_ARRAYLANG['TXT_NO_NAME'] : $_POST['name']); $objList->lang_id(empty($_POST['lang_id']) ? null : $_POST['lang_id']); $objList->border(!empty($_POST['border'])); $objList->header(!empty($_POST['header'])); $objList->header_left(contrexx_input2raw($_POST['header_left'])); $objList->header_right(contrexx_input2raw($_POST['header_right'])); $objList->footer(!empty($_POST['footer'])); $objList->footer_left(contrexx_input2raw($_POST['footer_left'])); $objList->footer_right(contrexx_input2raw($_POST['footer_right'])); $category_ids = ''; if (empty($_POST['category_all']) && !empty($_POST['category_id'])) { foreach ($_POST['category_id'] as $category_id) { $category_ids .= ($category_ids ? ',' : '') . contrexx_input2raw($category_id); } } // Both if no or all categories were selected, select all. if (empty($category_ids)) { $category_ids = '*'; } $objList->category_ids($category_ids); return $objList; }
<table border="1" id="tableClasses" cellspacing="0" width="400" align="center" class="ui-corner-all"> <thead> <tr class="ui-widget-header"> <th width="50%">Class</th> <th>Value</th> </tr> </thead> <tbody> <?php include_once "../model/Item.php"; $itemObj = new Item(); if ($list["type"] == "") { $classes = $itemObj->getClasses(); } else { include_once "../model/PriceList.php"; $priceListObj = new PriceList(); $classes = $priceListObj->getClasses($_GET["idprice_list"]); } foreach ($classes as $id => $value) { ?> <tr> <td align="center"><?php echo $id; ?> </td> <td><input type="text" id="txtClass<?php echo $id; ?> " name="txtClass<?php echo $id; ?>
<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> </head> <body> <?php require_once 'class.price_list.php'; try { $db = new MySQLDBase('127.0.0.1', 'root', '', 'metalls'); } catch (Exception $e) { echo "Ошибка\n" . $e->getMessage(); } $price = new PriceList($db, "nikel-price"); //$result = $price->insertItem($_GET); //$result = $price->updateItem(6, $_GET); $result = $price->removeItem(6); echo $result; ?> </body> </html>