query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
sequencelengths
0
30
negative_scores
sequencelengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Filter the query on the extendesc column Example usage: $query>filterByExtendesc('fooValue'); // WHERE extendesc = 'fooValue' $query>filterByExtendesc('%fooValue%', Criteria::LIKE); // WHERE extendesc LIKE '%fooValue%'
public function filterByExtendesc($extendesc = null, $comparison = null) { if (null === $comparison) { if (is_array($extendesc)) { $comparison = Criteria::IN; } } return $this->addUsingAlias(PricingTableMap::COL_EXTENDESC, $extendesc, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterByDescription($description = null)\n\t{\n\t\tif(preg_match('/[\\%\\*]/', $description)) {\n\t\t\treturn $this->addUsingAlias(cre8ContentTypePeer::DESCRIPTION, str_replace('*', '%', $description), Criteria::LIKE);\n\t\t} else {\n\t\t\treturn $this->addUsingAlias(cre8ContentTypePeer::DESCRIPTION, $description, Criteria::EQUAL);\n\t\t}\n\t}", "public function core_filter_geoFilter_listingDescription($desc)\n {\n //If you wanted to filter the description before it is displayed on\n //category browsing pages, this is the way to do it.\n\n //FILTER the desc here..\n\n return $desc;\n }", "public function generate_filter_string_ext($ext_config, $object_type)\n\t{\n\t\tif (!array_key_exists($object_type, $ext_config->upload_allowed_extensions))\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t\t$extensions = $ext_config->upload_allowed_extensions[$object_type];\n\n\t\t$filters = array(sprintf(\n\t\t\t\"{title: '%s', extensions: '%s'}\",\n\t\t\taddslashes(ucfirst(strtolower($this->user->lang('ALLOWED')))),\n\t\t\taddslashes(implode(',', $extensions))\n\t\t));\n\n\t\treturn implode(',', $filters);\n\t}", "public function filterByExt($ext = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($ext)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $ext)) {\n $ext = str_replace('*', '%', $ext);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(DocumentJobPeer::EXT, $ext, $comparison);\n }", "public function findByExtension() {\n $value = func_get_args();\n return $this->findBy('extension', $value);\n }", "public function findProductWhereDescLorem(){\n $q = $this->createQueryBuilder('prod')\n ->where('prod.description = :lorem')\n ->setParameter('lorem','lorem')\n ->getQuery();\n\n return $q->getResult();\n }", "public function core_filter_geoFilter_listingShortenDescription($desc)\n {\n //If you wanted to filter the description before it is displayed on\n //category browsing pages, this is the way to do it.\n\n //FILTER the desc here..\n\n //NOTE: If this is being called, you know that listingDescription was\n //probably already called for the same text.\n\n return $desc;\n }", "public function listExtendColumns($host)\n {\n $host->bindEvent('list.overrideColumnValue', function ($record, $column, $value){\n return $this->listOverrideColumnValue1($record, $column);\n });\n }", "public function searchPoItemDescAction($desc, $minDate, $maxDate)\n {\n\t$filterDate = PoManagerControllerUtility::convertDateFilter($minDate, $maxDate);\n\n\t$repository = $this->getDoctrine()\n\t ->getManager()\n\t\t\t ->getRepository('AchPoManagerBundle:PoItem');\n\t$poItems = $repository->findDescription($desc, $filterDate);\n\t\n\t$request = $this->getRequest();\n\n\treturn $this->generateResponse($request, $poItems);\n\t\n }", "public function isExt ($ext);", "public function scopeExtension($query, $value)\n {\n $query->whereExtension($value);\n }", "public function search_2()\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\t\t\n\t\tif($this->responsable != ''){\n\t\t\t$criteria->addCondition(\"responsable in (select id from empleados where nombre_completo ilike '%\".$this->responsable.\"%')\");\n\t\t}\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('LOWER(nombre)',strtolower($this->nombre),true);\n\t\t//$criteria->compare('responsable',$this->responsable,true);\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "private function getExtensao($paramArquivo) {\n $arquivo = explode('.', $paramArquivo ['name']);\n $extensao = strtolower(end($arquivo));\n return $extensao;\n }", "protected function applyDescriptionFilter(string $value)\n {\n $this->excludeKeyWords('description',$value);\n }", "public function setExtensionFilter(array $extension= array()) {\n return $this->extensionsfilter = $extension;\n }", "private function filterExtension($array, $ext_str)\r\n {\r\n $filter_array = array();\r\n \r\n // create a negative number used below when checking substr\r\n $str_pos = \"-\".strlen($ext_str);\r\n \r\n foreach($array as $item)\r\n {\r\n if($ext_str == substr($item, $str_pos)){array_push($filter_array, $item);}\r\n \r\n }\r\n \r\n return $filter_array;\r\n \r\n }", "public function filterByDescription($description = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($description)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $description)) {\n $description = str_replace('*', '%', $description);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(SalesPeer::DESCRIPTION, $description, $comparison);\n }", "public function addFilterFieldDescription($name, FieldDescriptionInterface $fieldDescription);", "public function addExtInfo($key, $value)\n {\n return $this->addField('ext_info_' . $key, 'Extra info ' . $key, '#^.{0,255}$#u', false, 255, $value);\n }", "public function hasFilterFieldDescription($name);", "public function filterByDescricao($descricao = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($descricao)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $descricao)) {\n\t\t\t\t$descricao = str_replace('*', '%', $descricao);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(VideoPeer::DESCRICAO, $descricao, $comparison);\n\t}", "public function searchInactive() {\n // should not be searched.\n $sort = new CSort();\n $sort->attributes = array('AdvertisementName' => array('asc' => 'offer_title', 'desc' => 'offer_title desc',),\n 'location' => array('asc' => 'location', 'desc' => 'location desc',),\n 'exp_date' => array('asc' => 'exp_date', 'desc' => 'exp_date desc',),\n 'city' => array('asc' => 'city', 'desc' => 'city desc',),\n 'updated_date' => array('asc' => 'updated_date', 'desc' => 'updated_date desc',),\n 'Vendor' => array('asc' => 'v.description', 'desc' => 'v.description desc',),\n );\n\n $criteria = new CDbCriteria;\n //$criteria->with = array('vendor');\n $criteria->select = \"t.id, v.description,offer_title, exp_date, t.city, (CASE (in_airport) WHEN 1 THEN CONCAT(concourse, ' ',gate) ELSE store_address END) AS location, updated_date\";\n $criteria->join = \"INNER JOIN vendor v ON v.id = t.vendor_id\";\n $criteria->order = \"updated_date desc\";\n $criteria->compare('t.status', 'Inactive', true);\n return new CActiveDataProvider(get_class($this), array(\n 'criteria' => $criteria,\n 'sort' => $sort,\n ));\n }", "protected function setExtensionsSql()\n {\n $prefix = $this->query->getModelRegistry('primary_prefix', 'a');\n\n $this->query->select($prefix . '.' . 'id');\n $this->query->select($prefix . '.' . 'extension_id');\n $this->query->select($prefix . '.' . 'catalog_type_id');\n $this->query->select($prefix . '.' . 'title');\n $this->query->select($prefix . '.' . 'namespace');\n $this->query->select($prefix . '.' . 'alias');\n $this->query->select($prefix . '.' . 'contentfields');\n\n $list = '5000, 7000, 8000, 9000, 10000, 12000';\n\n $this->query->where('column', $prefix . '.' . 'catalog_type_id', 'IN', 'string', $list);\n $this->query->where('column', $prefix . '.' . 'id', '<>', 'column', $prefix . '.' . 'catalog_type_id');\n\n $this->query->orderBy($prefix . '.' . 'catalog_type_id');\n $this->query->orderBy($prefix . '.' . 'title');\n\n return $this;\n }", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('image', $this->image, true);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('idModule', $this->idModule, true);\n $criteria->compare('order', $this->order, true);\n $criteria->compare('t.title_ua', $this->title_ua, true);\n $criteria->compare('title_ru', $this->title_ru, true);\n $criteria->compare('title_en', $this->title_en, true);\n $criteria->compare('idType', $this->idType, true);\n $criteria->compare('isFree', $this->isFree, true);\n $criteria->compare('durationInMinutes', $this->durationInMinutes, true);\n $criteria->compare('understand_rating', $this->understand_rating);\n $criteria->compare('interesting_rating', $this->interesting_rating);\n $criteria->compare('accessibility_rating', $this->accessibility_rating);\n $criteria->compare('verified', $this->verified);\n\n $criteria->with = array('ModuleTitle');\n $criteria->compare('ModuleTitle.title_ua', $this->ModuleTitle, true);//???? ModuleTitle.module_name change on ModuleTitle.title_ua\n $criteria->addCondition('`order`>0');\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array(\n 'pageSize' => '50',\n ),\n 'sort' => array('attributes' => array(\n 'defaultOrder' => array(\n 'order' => CSort::SORT_ASC,\n ),\n 'ModuleTitle' => array(\n 'asc' => $expr = 'ModuleTitle.title_ua',\n 'desc' => $expr . ' DESC',\n ),\n 'order' => array(\n 'asc' => $expr = '`order`',\n 'desc' => $expr . ' DESC',\n ),\n 'title_ua' => array(\n 'asc' => $expr = 'title_ua',\n 'desc' => $expr . ' DESC',\n ),\n 'title_ru' => array(\n 'asc' => $expr = 'title_ru',\n 'desc' => $expr . ' DESC',\n ),\n 'title_en' => array(\n 'asc' => $expr = 'title_en',\n 'desc' => $expr . ' DESC',\n ),\n 'idType' => array(\n 'asc' => $expr = 'idType',\n 'desc' => $expr . ' DESC',\n ),\n 'isFree' => array(\n 'asc' => $expr = 'isFree',\n 'desc' => $expr . ' DESC',\n ),\n )),\n ));\n }", "public function disable_extension()\n {\n\t\t$this->EE->db->where('class', 'Dashee_ext');\n\t\t$this->EE->db->delete('extensions');\n }", "public static function allExtended($extendedParameters = null)\n {\n /* @var $modelClass BaseModelInterface */\n $modelClass = get_called_class();\n if ($extendedParameters === null) {\n $extendedParameters = new ExtendedModelParameters();\n $extendedParameters->setModelClass($modelClass);\n $extendedParameters->setSortings($modelClass::getDefaultSorting());\n } elseif ($extendedParameters->getModelClass() !== null) {\n $modelClass = $extendedParameters->getModelClass();\n } else {\n $extendedParameters->setModelClass($modelClass);\n }\n\n /**\n * set pagination\n */\n Paginator::currentPageResolver(function () use ($extendedParameters) {\n return $extendedParameters->getPage();\n });\n\n if ($extendedParameters->getDecryptionKey()) {\n /** @var Builder $query */\n $query = $modelClass::withDecryptKey($extendedParameters->getDecryptionKey());\n } else {\n /** @var Builder $query */\n $query = $modelClass::query();\n }\n\n /**\n * filtering\n */\n if (!empty($extendedParameters->getComplexFilters())) {\n self::addComplexFilters($query, $extendedParameters->getComplexFilters());\n }\n $query->where(function (Builder $q) use ($extendedParameters) {\n // add not empty and not null filters\n // (->whereNotNull('field')->where('field', '<>', ''))\n self::addNotEmptyFilters($q, $extendedParameters->getNotEmptyFilters());\n\n // add filters\n // (->where('field', 'attribute'))\n self::addFilters($q, $extendedParameters->getFilters(), $extendedParameters->getDecryptionKey());\n\n // add OR filters\n // (->orWhere('field', 'attribute1')->orWhere('field', 'attribute2'))\n\n self::addOrFilters($q, $extendedParameters->getOrFilters(), $extendedParameters->getDecryptionKey());\n });\n\n $query->where(function (Builder $q) use ($extendedParameters) {\n // add LIKE filters\n // (->where('field', 'LIKE', '%attribute%'))\n self::addSearches($q, $extendedParameters->getSearches(), $extendedParameters->getDecryptionKey());\n\n // add OR LIKE filters\n // (->orWhere('field', 'LIKE', '%attribute1%')->orWhere('field', 'LIKE', '%attribute2%'))\n self::addOrSearches($q, $extendedParameters->getOrSearches(), $extendedParameters->getDecryptionKey());\n });\n\n /**\n * sorting\n */\n // add sorting\n // (->orderBy(field, direction))\n self::addSortings($query, $extendedParameters->getSortings(), $extendedParameters->getDecryptionKey());\n\n /**\n * pagination\n */\n /** @var LengthAwarePaginator $lAPaginator */\n $lAPaginator = $query->paginate(\n min($extendedParameters->getPagination(), $modelClass::$maxPagination),\n $extendedParameters->getColumns()\n );\n\n /**\n * inclusion\n */\n // include relations over multiple levels\n // (->load('relation'))\n self::addIncludes($lAPaginator, $extendedParameters->getIncludes());\n\n return $lAPaginator;\n }", "public function search_extend()\n {\n $criteria = new CDbCriteria;\n // $criteria->addCondition('t.id <>' . Yii::app()->user->id);\n //选择的组织架构ID\n // if (!empty($this->branch_id)) {\n // $criteria->distinct = true;\n // $branch = Branch::model()->findByPk($this->branch_id);\n // if (!empty($branch)) {\n // $criteria->addInCondition('branch_id', $branch->getChildrenIdsAndSelf());\n // }\n // }else{\n // \t$employee = Employee::model()->findByPk(Yii::app()->user->id);\n\t // $branch_ids = array();\n\t // $branch_ids = $employee->AllBranchIds;\n\t // $criteria->distinct = true;\n\t // $criteria->addInCondition('branch_id', $branch_ids);\n // }\n\n \t$employee = Employee::model()->findByPk(Yii::app()->user->id);\n $branch_ids = array();\n $branch_ids = $employee->AllBranchIds;\n $criteria->distinct = true;\n $criteria->addInCondition('branch_id', $branch_ids);\n\n\n\n if($this->activityName!=''){\n\t\t\t$criteria->with[] = 'cai_redpacket';\n\t\t\t$criteria->compare('cai_redpacket.name',$this->activityName);\n\t\t}\n // $criteria->compare('username', $this->username, true);\n // $criteria->compare('mobile', $this->mobile, true);\n // $criteria->compare('tel', $this->tel, true);\n // $criteria->compare('name', $this->name, true);\n // $criteria->compare('oa_username', $this->oa_username, true);\n // $criteria->compare('email', $this->email, true);\n // $criteria->compare('state', $this->state);\n\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function filterByPdesc($pdesc = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($pdesc)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AliProductTableMap::COL_PDESC, $pdesc, $comparison);\n }", "public static function checkKeyInExtField($keyword=null, $field=null)\n {\n if (!($field = $field ? $field : $_GET['ext_field']) || !$keyword) return false;\n $arr = explode(',', $field);\n return (array_search($keyword, $arr) === false) ? false : true;\n }", "public function isExtentionEnabled()\r\n\t{\r\n\t\treturn $this->scopeConfig->getValue('advancedSorting/general/active');\r\n\t}" ]
[ "0.52757347", "0.5252631", "0.52311575", "0.51344764", "0.5005266", "0.49893588", "0.49025863", "0.48644024", "0.48415038", "0.4794027", "0.47672227", "0.47225648", "0.47096163", "0.47072816", "0.470098", "0.4699877", "0.46994367", "0.46415266", "0.4585849", "0.45650503", "0.45543042", "0.4541881", "0.45358238", "0.45101193", "0.45068944", "0.4497265", "0.44599417", "0.4446074", "0.4443757", "0.44423923" ]
0.65059096
0
Filter the query on the minprice column Example usage: $query>filterByMinprice(1234); // WHERE minprice = 1234 $query>filterByMinprice(array(12, 34)); // WHERE minprice IN (12, 34) $query>filterByMinprice(array('min' => 12)); // WHERE minprice > 12
public function filterByMinprice($minprice = null, $comparison = null) { if (is_array($minprice)) { $useMinMax = false; if (isset($minprice['min'])) { $this->addUsingAlias(PricingTableMap::COL_MINPRICE, $minprice['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($minprice['max'])) { $this->addUsingAlias(PricingTableMap::COL_MINPRICE, $minprice['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(PricingTableMap::COL_MINPRICE, $minprice, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterByPrice($min_max){\n $min_max_array = explode(', ', $min_max);\n $min_price = $min_max_array[0];\n $max_price = $min_max_array[1];\n\n $products = DB::table('products')\n ->join('subcategories', 'products.subcategory_id', '=', 'subcategories.id')\n ->join('categories', 'subcategories.category_id', '=', 'categories.id')\n ->select('products.*', 'categories.categories_name')\n ->where('products.price','>=', $min_price)\n ->where('products.price','<=', $max_price)\n ->Paginate(12);\n return json_encode($products);\n }", "public function minPrice(){\n //$prices=\\DB::table('min_price')->get();\n\n $prices= \\DB::table('pricedata')\n ->select('fuelTypeID',\\DB::raw('min(fuelPrice) as min_price'))\n -> groupBy ('fuelTypeID')\n ->get();\n\n return response()->json( $prices);\n }", "public function setMinPrice()\n {\n if (\n (isset($_GET['q']) && !isset($_GET['min'])) ||\n ! isset($_GET['q'])\n ) {\n if (Mage::getVersion() < '1.7.0.2') {\n $this->_productCollection->getSelect()->reset('order');\n $this->_productCollection->getSelect()->order('final_price','asc');\n $this->_minPrice = round($this->_productCollection->getFirstItem()->getFinalPrice());\n } else {\n $this->_minPrice = floor($this->_productCollection->getMinPrice());\n }\n\n $this->_searchSession->setMinPrice($this->_minPrice);\n } else {\n $this->_minPrice = $this->_searchSession->getMinPrice();\n }\n }", "function getMin($item){\n return $item->price;\n}", "public function filterAvailableProductsByPrice($minPrice, $maxPrice) {\n\n if ($this->PriceList && $this->nr_products_available) {\n\n //verificam daca preturile produselor salvate in priceList se incadreaza in intervalul min si max\n $nr_available = 0;\n foreach ($this->PriceList as $price) {\n //echo \"Pret:\".$price.' MinPrice:'.$minPrice.' Maxprice:'.$maxPrice;\n if ($minPrice <= $price && $price <= $maxPrice) {\n $nr_available++;\n //exit(\"Incrementez\");\n }\n }\n //updatam numarul de produse disponibile\n $this->nr_products_available = $nr_available;\n }\n }", "public function filterByPrice($price = null, $comparison = null)\n {\n if (is_array($price)) {\n $useMinMax = false;\n if (isset($price['min'])) {\n $this->addUsingAlias(AliStockcardSTableMap::COL_PRICE, $price['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($price['max'])) {\n $this->addUsingAlias(AliStockcardSTableMap::COL_PRICE, $price['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AliStockcardSTableMap::COL_PRICE, $price, $comparison);\n }", "public static function min( $realMin ) {\n if( !conf::get('filter_array') ) {\n return $realMin;\n }\n $filter = conf::get('filter_array');\n if( !isset($filter['min_cost']) ) {\n return $realMin;\n }\n $min = (int) $filter['min_cost'][0];\n if( $min < $realMin ) {\n return $realMin;\n }\n return $min;\n }", "protected function minimum($value)\n {\n if ($value) {\n return $this->builder->where('price1' ,\">=\", $value);\n }\n\n return $this->builder;\n }", "public static function min( $realMin ) {\n if( !Config::get('filter_array') ) {\n return $realMin;\n }\n $filter = Config::get('filter_array');\n if( !isset($filter['min_cost']) ) {\n return $realMin;\n }\n $min = (int) $filter['min_cost'][0];\n if( $min < $realMin ) {\n return $realMin;\n }\n return $min;\n }", "public function getProductsSQL($section,$skipPrice=false){\n $sql = ' FROM sr_shop_product AS p LEFT OUTER JOIN sr_shop_product AS m ON p.`id`=m.`parent_id`';\n $conditions = array();\n foreach($section['filterOptions'] as $optionId){\n $filter = $_REQUEST['filters'][$optionId];\n if(!is_array($filter) || !count($filter)) continue;\n foreach($filter as &$f){\n $f = \"'\".Helpers::mysql_escape($f).\"'\";\n }\n $tableAlias = 'o'.(int)$optionId;\n $sql .=\"INNER JOIN sr_shop_option_value AS \".$tableAlias.\"\n ON p.`id`=\".$tableAlias.\".`main_product_id` \";\n array_push($conditions,\n $tableAlias.'.option_id='.(int)$optionId.' AND '.$tableAlias.\".`value` in (\".implode(',',$filter).\")\"\n );\n }\n $conditions = count($conditions) ? ' AND '.implode(' AND ',$conditions) : '';\n $priceFilter = '';\n if(!$skipPrice){\n $price_from = (float)$_REQUEST['price_from'];\n $price_to = (float)$_REQUEST['price_to'];\n if($price_from>0){\n $priceFilter.=' AND ((m.sale_price>0 AND m.sale_price>='.$price_from.') ||\n (m.sale_price=0 AND m.price>0 AND m.price>='.$price_from.') ||\n (m.price IS NULL AND p.sale_price>0 AND p.sale_price>='.$price_from.') ||\n (m.price IS NULL AND p.sale_price=0 AND p.price>0 AND p.price>='.$price_from.'))';\n }\n if($price_to>0){\n $priceFilter.=' AND ((m.sale_price>0 AND m.sale_price<='.$price_to.') ||\n (m.sale_price=0 AND m.price>0 AND m.price<='.$price_to.') ||\n (m.price IS NULL AND p.sale_price>0 AND p.sale_price<='.$price_to.') ||\n (m.price IS NULL AND p.sale_price=0 AND p.price>0 AND p.price<='.$price_to.'))';\n }\n }\n $sql .= 'WHERE p.`parent_id`=0 and p.`active`=1 and p.`section_id` in ('.$section['cat_ids'].')'.$conditions.$priceFilter.' ORDER BY p.`instock` desc, p.`order` asc';\n return $sql;\n }", "public function filterBySmProdPriceId($smProdPriceId = null, $comparison = null)\n {\n if (is_array($smProdPriceId)) {\n $useMinMax = false;\n if (isset($smProdPriceId['min'])) {\n $this->addUsingAlias(TblProdSmallerTableMap::COL_SM_PROD_PRICE_ID, $smProdPriceId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($smProdPriceId['max'])) {\n $this->addUsingAlias(TblProdSmallerTableMap::COL_SM_PROD_PRICE_ID, $smProdPriceId['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(TblProdSmallerTableMap::COL_SM_PROD_PRICE_ID, $smProdPriceId, $comparison);\n }", "public function filterByPriceprice1($priceprice1 = null, $comparison = null)\n {\n if (is_array($priceprice1)) {\n $useMinMax = false;\n if (isset($priceprice1['min'])) {\n $this->addUsingAlias(PricingTableMap::COL_PRICEPRICE1, $priceprice1['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($priceprice1['max'])) {\n $this->addUsingAlias(PricingTableMap::COL_PRICEPRICE1, $priceprice1['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PricingTableMap::COL_PRICEPRICE1, $priceprice1, $comparison);\n }", "function getItemsByPrice($dbh, $min, $max)\r\n{\r\n \r\n $stmt = $dbh->prepare ( \"SELECT * FROM items WHERE items.price >= ? and items.price <= ?\"); \r\n\r\n $stmt->bindParam(1,$min);\r\n $stmt->bindParam(2,$max);\r\n\r\n if ($stmt->execute()) \r\n {\r\n $data = array();\r\n \r\n while ($row = $stmt->fetch()) \r\n { \r\n array_push($data, $row['name'], $row['price'], $row['quantity'],$row['quality']);\r\n }\r\n echo json_encode($data);\r\n \r\n }\r\n}", "public function filterByPrice($price = null, $comparison = null)\n {\n if (is_array($price)) {\n $useMinMax = false;\n if (isset($price['min'])) {\n $this->addUsingAlias(AliProductTableMap::COL_PRICE, $price['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($price['max'])) {\n $this->addUsingAlias(AliProductTableMap::COL_PRICE, $price['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AliProductTableMap::COL_PRICE, $price, $comparison);\n }", "public function scopeSelectMinAndMaxPrice($query)\n {\n return $query->select(DB::raw('MAX(price) as max_price'), DB::raw('MIN(price) as min_price'));\n }", "public function select_min_value_of_pro($cat_id)\n {\n $this->db->select_min('price');\n $this->db->from('product_information');\n $this->db->where('product_information.category_id', $cat_id);\n $query = $this->db->get();\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return false;\n }", "public function GetMinimumPrice($customer_id, $value1, $value2) {\r\n\r\n \t$query = $this->_hotelPDO->prepare(\"SELECT * FROM `master_hotel_price` WHERE `customer_id` = '$customer_id' AND ((`rack_epi` BETWEEN '$value1' AND '$value2') OR (`rack_cpi` BETWEEN '$value1' AND '$value2') OR (`rack_mapi` BETWEEN '$value1' AND '$value2') OR (`rack_apai` BETWEEN '$value1' AND '$value2') OR (`btb_epi` BETWEEN '$value1' AND '$value2') OR (`btb_cpi` BETWEEN '$value1' AND '$value2') OR (`btb_mapi` BETWEEN '$value1' AND '$value2') OR (`sea_epi` BETWEEN '$value1' AND '$value2') OR (`sea_cpi` BETWEEN '$value1' AND '$value2') OR (`sea_mapi` BETWEEN '$value1' AND '$value2') OR (`sea_apai` BETWEEN '$value1' AND '$value2') OR (`prom_epi` BETWEEN '$value1' AND '$value2') OR (`prom_cpi` BETWEEN '$value1' AND '$value2') OR (`prom_mapi` BETWEEN '$value1' AND '$value2') OR (`prom_apai` BETWEEN '$value1' AND '$value2'))\");\r\n \t$query->execute() or die($this->_hotelPDO->error);\r\n \t$rows = $query->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n \treturn $rows;\r\n }", "public function filterByPrice($price = null, $comparison = null)\n {\n if (is_array($price))\n {\n $useMinMax = false;\n if (isset($price['min']))\n {\n $this->addUsingAlias(CollectionItemOfferPeer::PRICE, $price['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($price['max']))\n {\n $this->addUsingAlias(CollectionItemOfferPeer::PRICE, $price['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax)\n {\n return $this;\n }\n if (null === $comparison)\n {\n $comparison = Criteria::IN;\n }\n }\n return $this->addUsingAlias(CollectionItemOfferPeer::PRICE, $price, $comparison);\n }", "public function price_filter( $filtered_posts = array() ) {\n\t global $wpdb;\n\n\t if ( isset( $_GET['max_price'] ) || isset( $_GET['min_price'] ) ) {\n\n\t\t\t$matched_products = array();\n\t\t\t$min = isset( $_GET['min_price'] ) ? floatval( $_GET['min_price'] ) : 0;\n\t\t\t$max = isset( $_GET['max_price'] ) ? floatval( $_GET['max_price'] ) : 9999999999;\n\n\t $matched_products_query = apply_filters( 'estimategadget_price_filter_results', $wpdb->get_results( $wpdb->prepare( '\n\t \tSELECT DISTINCT ID, post_parent, post_type FROM %1$s\n\t\t\t\tINNER JOIN %2$s ON ID = post_id\n\t\t\t\tWHERE post_type IN ( \"product\", \"product_variation\" )\n\t\t\t\tAND post_status = \"publish\"\n\t\t\t\tAND meta_key IN (\"' . implode( '\",\"', apply_filters( 'estimategadget_price_filter_meta_keys', array( '_price' ) ) ) . '\")\n\t\t\t\tAND meta_value BETWEEN %3$d AND %4$d\n\t\t\t', $wpdb->posts, $wpdb->postmeta, $min, $max ), OBJECT_K ), $min, $max );\n\n\t if ( $matched_products_query ) {\n\t foreach ( $matched_products_query as $product ) {\n\t if ( $product->post_type == 'product' ) {\n\t $matched_products[] = $product->ID;\n\t }\n\t if ( $product->post_parent > 0 && ! in_array( $product->post_parent, $matched_products ) ) {\n\t $matched_products[] = $product->post_parent;\n\t }\n\t }\n\t }\n\n\t // Filter the id's\n\t if ( 0 === sizeof( $filtered_posts ) ) {\n\t\t\t\t$filtered_posts = $matched_products;\n\t } else {\n\t\t\t\t$filtered_posts = array_intersect( $filtered_posts, $matched_products );\n\n\t }\n\t $filtered_posts[] = 0;\n\t }\n\n\t return (array) $filtered_posts;\n\t}", "public function cat_price_range_pro($min, $max, $cat_id)\n {\n $this->db->select('*');\n $this->db->from('product_information');\n $this->db->where('category_id', $cat_id);\n $this->db->where('price >=', $min);\n $this->db->where('price <=', $max);\n $this->db->order_by('product_name');\n $query = $this->db->get();\n if ($query->num_rows() > 0) {\n return $query->result();\n }\n return false;\n }", "public function scopeWhenMinAndMaxPrice($query, $data)\n {\n if (isset($data['min_price']) and !__isEmpty($data['min_price'])) {\n $query->where('price', '>=', calculateBaseCurrency($data['min_price']));\n }\n\n if (isset($data['max_price']) and !__isEmpty($data['max_price'])) {\n $query->where('price', '<=', calculateBaseCurrency($data['max_price']));\n }\n\n return $query;\n }", "public function getMinMaxPrice($data) { /* todo-materialize Remove before release! */\n\t\tif (!empty($data['config_tax'])) {\n\t\t\t$sql = \"SELECT MIN(IF(tp.tax_percent IS NOT NULL, IFNULL(ps.price, p.price) + (IFNULL(ps.price, p.price) * tp.tax_percent / 100) + IFNULL(ta.tax_amount, 0), IFNULL(ps.price, p.price)) * '\" . (float)$data['currency_ratio'] . \"') AS min_price, MAX(IF(tp.tax_percent IS NOT NULL, IFNULL(ps.price, p.price) + (IFNULL(ps.price, p.price) * tp.tax_percent / 100) + IFNULL(ta.tax_amount, 0), IFNULL(ps.price, p.price)) * '\" . (float)$data['currency_ratio'] . \"') AS max_price\";\n\t\t} else {\n\t\t\t$sql = \"SELECT MIN(IFNULL(ps.price, p.price) * '\" . (float)$data['currency_ratio'] . \"') AS min_price, MAX(IFNULL(ps.price, p.price) * '\" . (float)$data['currency_ratio'] . \"') AS max_price\";\n\t\t}\n\n\t\t$sql .= \" FROM \" . DB_PREFIX . \"product p LEFT JOIN \" . DB_PREFIX . \"product_to_category p2c ON (p.product_id = p2c.product_id) LEFT JOIN \" . DB_PREFIX . \"product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN (SELECT product_id, price FROM \" . DB_PREFIX . \"product_special ps WHERE ps.customer_group_id = '\" . (int)$this->config->get('config_customer_group_id') . \"' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) ORDER BY ps.priority ASC, ps.price ASC LIMIT 1) AS ps ON (p.product_id = ps.product_id)\";\n\n\t\tif (!empty($data['config_tax'])) {\n\t\t\t$sql .= \" LEFT JOIN (SELECT tr2.tax_class_id, tr1.rate AS tax_percent FROM \" . DB_PREFIX . \"tax_rate tr1 INNER JOIN \" . DB_PREFIX . \"tax_rate_to_customer_group tr2cg ON (tr1.tax_rate_id = tr2cg.tax_rate_id) LEFT JOIN \" . DB_PREFIX . \"tax_rule tr2 ON (tr1.tax_rate_id = tr2.tax_rate_id) WHERE tr1.type = 'P' AND tr2cg.customer_group_id = '\" . (int)$this->config->get('config_customer_group_id') . \"' ORDER BY tr2.priority) AS tp ON (p.tax_class_id = tp.tax_class_id) LEFT JOIN (SELECT tr2.tax_class_id, tr1.rate AS tax_amount FROM \" . DB_PREFIX . \"tax_rate tr1 INNER JOIN \" . DB_PREFIX . \"tax_rate_to_customer_group tr2cg ON (tr1.tax_rate_id = tr2cg.tax_rate_id) LEFT JOIN \" . DB_PREFIX . \"tax_rule tr2 ON (tr1.tax_rate_id = tr2.tax_rate_id) WHERE tr1.type = 'F' AND tr2cg.customer_group_id = '\" . (int)$this->config->get('config_customer_group_id') . \"' ORDER BY tr2.priority) AS ta ON (p.tax_class_id = ta.tax_class_id)\";\n\t\t}\n\n\t\t$sql .= \" WHERE p.date_available <= NOW() AND p.status = '1' AND p2s.store_id = '\" . (int)$this->config->get('config_store_id') . \"'\";\n\n\t\tif (!empty($data['category_id'])) {\n\t\t\t$sql .= \" AND p2c.category_id = '\" . (int)$data['category_id'] . \"'\";\n\t\t}\n\n\t\t$query = $this->db->query($sql);\n\n\t\treturn $query->row;\n\t}", "function getPriceFilter($price)\n {\n $products = product::whereBetween('sale_price', [0, $price])->get();\n return view('products')->with('products', $products);\n }", "public function getMinPrice( )\n\t{\n\t\t$Unit = new Product_Unit();\n\t\tforeach ( $Unit->findList( array( 'ProductId = '.$this->Id ), 'Price asc', 0, 1 ) as $Unit );\n\t\t\n\t\treturn $Unit->Price;\n\t\t\n\t}", "function filterHouses($start, $end, $guests, $minPrice, $maxPrice) {\r\n\t\tglobal $conn;\r\n\r\n\t\t$stmt = $conn->prepare('SELECT Houses.* , (Houses.SingleBeds + 2*Houses.DoubleBeds) AS Guests, Reservation.StartDate, Reservation.EndDate FROM Houses\r\n\t\t\t\t\t\t\t\tLEFT JOIN Reservation ON Reservation.HouseID = Houses.ID\r\n\t\t\t\t\t\t\t\tWHERE ((Reservation.StartDate > \"11-6-2019\" OR Reservation.EndDate < \"13-7-2019\"))\r\n\t\t\t\t\t\t\t\tAND Guests > ? \r\n\t\t\t\t\t\t\t\tAND DailyCost > \"50\"' );\r\n\t\t\r\n\t\t// $stmt->execute();\r\n\t\t// $guests=2;\r\n\t\t// $stmt->execute(array($guests));\r\n\t\t\r\n\t\t// $stmt->execute([$start, $end, $guests, $minPrice]);\r\n\t\treturn $stmt->fetchAll();\r\n\t}", "private function addMiniMaxPriceList(Product $bundleProduct, $selectionsCollection, $searchMin, $useRegularPrice)\n {\n $selectionsCollection->addPriceFilter($bundleProduct, $searchMin, $useRegularPrice);\n $selectionsCollection->setPage(0, 1);\n\n $selection = $selectionsCollection->getFirstItem();\n\n if (!$selection->isEmpty()) {\n $this->priceList[] = $this->selectionFactory->create(\n $bundleProduct,\n $selection,\n $selection->getSelectionQty(),\n [\n 'useRegularPrice' => $useRegularPrice,\n ]\n );\n }\n }", "public function filterByPrice($price = null, $comparison = null)\n {\n if (is_array($price)) {\n $useMinMax = false;\n if (isset($price['min'])) {\n $this->addUsingAlias(OrdersLinesPeer::PRICE, $price['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($price['max'])) {\n $this->addUsingAlias(OrdersLinesPeer::PRICE, $price['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(OrdersLinesPeer::PRICE, $price, $comparison);\n }", "public function min($field);", "public function filterBySmProdNormalprice($smProdNormalprice = null, $comparison = null)\n {\n if (is_array($smProdNormalprice)) {\n $useMinMax = false;\n if (isset($smProdNormalprice['min'])) {\n $this->addUsingAlias(TblProdSmallerTableMap::COL_SM_PROD_NORMALPRICE, $smProdNormalprice['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($smProdNormalprice['max'])) {\n $this->addUsingAlias(TblProdSmallerTableMap::COL_SM_PROD_NORMALPRICE, $smProdNormalprice['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(TblProdSmallerTableMap::COL_SM_PROD_NORMALPRICE, $smProdNormalprice, $comparison);\n }", "public function scopePrice($query, $min = null, $max = null)\n {\n if($min)\n $query->where('internet_price', '>=', $min);\n if($max)\n $query->where('internet_price', '<=', $max)->where('internet_price', '!=', 0);\n return $query;\n }" ]
[ "0.61551964", "0.5982418", "0.59678733", "0.58378834", "0.57249796", "0.56865096", "0.55973595", "0.5591657", "0.55772614", "0.5476192", "0.53929573", "0.5378266", "0.5332881", "0.5328747", "0.5322231", "0.5310985", "0.5284125", "0.528286", "0.5270253", "0.52429354", "0.52300274", "0.52155614", "0.5172495", "0.516144", "0.5149109", "0.5140976", "0.5125747", "0.5120822", "0.5111117", "0.50896627" ]
0.68627423
0
Filter the query on the spcord column Example usage: $query>filterBySpcord('fooValue'); // WHERE spcord = 'fooValue' $query>filterBySpcord('%fooValue%', Criteria::LIKE); // WHERE spcord LIKE '%fooValue%'
public function filterBySpcord($spcord = null, $comparison = null) { if (null === $comparison) { if (is_array($spcord)) { $comparison = Criteria::IN; } } return $this->addUsingAlias(PricingTableMap::COL_SPCORD, $spcord, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function filterColumn(Builder $builder, string $column, string $value)\n {\n Delegator::make([\n new ListFilter($builder),\n new WildcardFilter($builder),\n new ComparisonFilter($builder),\n new NullFilter($builder),\n new EqualsFilter($builder),\n ])->execute($column, $value);\n }", "function filterStr($field, $value) {\n if (\"$value\" !== '') {\n if ($value[0] === '=') {\n $this->where($field, '=', trim( substr($value, 1) ));\n } else {\n $wrapped = $this->table->grammar->wrap($field);\n\n switch ($value[0]) {\n case '^':\n $cond = '= 1';\n case '?':\n isset($cond) or $cond = '!= 0';\n $this->raw_where(\"LOCATE(?, $wrapped) $cond\", array($value));\n break;\n\n case '%':\n $this->raw_where(\"$wrapped LIKE ?\", array($value));\n break;\n\n default:\n $this->where($field, '=', trim($value));\n break;\n }\n }\n }\n }", "function scstfilter(){\n\t\t$this->rapyd->load('datagrid','datafilter');\n\t\t$this->rapyd->uri->keep_persistence();\n\n\t\t$atts = array(\n\t\t\t\t'width' => '800',\n\t\t\t\t'height' => '600',\n\t\t\t\t'scrollbars' => 'yes',\n\t\t\t\t'status' => 'yes',\n\t\t\t\t'resizable' => 'yes',\n\t\t\t\t'screenx' => \"'+((screen.availWidth/2)-400)+'\",\n\t\t\t\t'screeny' => \"'+((screen.availHeight/2)-300)+'\"\n\t\t\t);\n\t\t$modbus=array(\n\t\t\t'tabla' =>'sprv',\n\t\t\t'columnas'=>array(\n\t\t\t\t'proveed' =>'C&oacute;digo Proveedor',\n\t\t\t\t'nombre'=>'Nombre',\n\t\t\t\t'rif'=>'RIF'),\n\t\t\t'filtro' =>array('proveed'=>'C&oacute;digo Proveedor','nombre'=>'Nombre'),\n\t\t\t'retornar'=>array('proveed'=>'proveed'),\n\t\t\t'titulo' =>'Buscar Proveedor');\n\t\t$boton=$this->datasis->modbus($modbus);\n\n\t\t$filter = new DataFilter('Filtro de Compras');\n\t\t$filter->db->select=array('numero','fecha','vence','nombre','montoiva','montonet','proveed','control');\n\t\t$filter->db->from('b2b_scst');\n\n\t\t$filter->fechad = new dateonlyField('Desde', 'fechad','d/m/Y');\n\t\t$filter->fechah = new dateonlyField('Hasta', 'fechah','d/m/Y');\n\t\t$filter->fechad->clause =$filter->fechah->clause ='where';\n\t\t$filter->fechad->db_name =$filter->fechah->db_name='fecha';\n\t\t$filter->fechah->size=$filter->fechad->size=10;\n\t\t$filter->fechad->operator=\">=\";\n\t\t$filter->fechah->operator=\"<=\";\n\n\t\t$filter->numero = new inputField('Factura', 'numero');\n\t\t$filter->numero->size=20;\n\n\t\t$filter->proveedor = new inputField('Proveedor','proveed');\n\t\t$filter->proveedor->append($boton);\n\t\t$filter->proveedor->db_name = 'proveed';\n\t\t$filter->proveedor->size=20;\n\n\t\t$action = \"javascript:window.location='\".site_url('sincro/b2b/index').\"'\";\n\t\t$filter->button('btn_regresa', 'Regresar', $action, 'TR');\n\t\t$filter->buttons('reset','search');\n\t\t$filter->build();\n\n\t\t$uri = anchor('sincro/b2b/scstedit/show/<#id#>','<#numero#>');\n\n\t\t$grid = new DataGrid();\n\t\t$grid->order_by('fecha','desc');\n\t\t$grid->per_page = 15;\n\t\t$grid->column_orderby('Factura',$uri,'control');\n\t\t$grid->column_orderby('Fecha' ,'<dbdate_to_human><#fecha#></dbdate_to_human>','fecha',\"align='center'\");\n\t\t$grid->column_orderby('Vence' ,'<dbdate_to_human><#vence#></dbdate_to_human>','vence',\"align='center'\");\n\t\t$grid->column_orderby('Nombre' ,'nombre','nombre');\n\t\t$grid->column_orderby('IVA' ,'montoiva' ,'montoiva',\"align='right'\");\n\t\t$grid->column_orderby('Monto' ,'montonet' ,'montonet',\"align='right'\");\n\t\t$grid->column_orderby('Control','pcontrol' ,'pcontrol',\"align='right'\");\n\t\t$grid->build();\n\t\t//echo $grid->db->last_query();\n\n\t\t$data['content'] =$filter->output.$grid->output;\n\t\t$data['head'] = $this->rapyd->get_head();\n\t\t$data['title'] =heading('Compras de B2B');\n\t\t$this->load->view('view_ventanas', $data);\n\t}", "public static function _generateSQLColumnFilter($column, $search_value, PDO $pdoLink, $sRangeSeparator = '~')\n {\n if (preg_match(\"/^\\[(=|!=)\\]$/i\", $search_value, $match)) {\n return $column.' '.$match[1].' '.$pdoLink->quote('');\n }\n\n if (preg_match(\"/^\\[(!|<=|>=|=|<|>|<>|!=)\\](.+)/i\", $search_value, $match)) {\n if ($match[1] == '!=' && $match[2] == 'null') {\n return $column.' IS NOT NULL';\n } elseif ($match[1] == '=' && $match[2] == 'null') {\n return $column.' IS NULL';\n } elseif ($match[1] == '!') {\n return $column.' NOT LIKE '.$pdoLink->quote('%'.$match[2].'%');\n } else {\n return $column.' '.$match[1].' '.$pdoLink->quote($match[2] == 'empty' ? '' : $match[2]);\n }\n } elseif (strpos($search_value, 'lenght:') === 0) {\n return 'CHAR_LENGTH('.$column.') = '.(int) substr($search_value, strlen('lenght:'));\n } elseif (strpos($search_value, 'reg:') === 0) { //&& $column['sFilter']['regex'] === true) {\n return $column.' REGEXP '.$pdoLink->quote(substr($search_value, strlen('reg:')));\n } elseif (preg_match('/(.*)(!?'.$sRangeSeparator.')(.*)/i', $search_value, $matches) && !empty($matches[1]) && !empty($matches[3])) {\n // TODO : use type to format the search value (eg STR_TO_DATE)\n return $column.($matches[2][0] == '!' ? ' NOT' : '')\n .' BETWEEN '.$pdoLink->quote($matches[1]).' AND '.$pdoLink->quote($matches[3]);\n } elseif (strpos($search_value, 'in:') === 0) {\n $search_value = substr($search_value, strlen('in:'));\n\n return $column.' IN('.$search_value.')';\n } elseif (strpos($search_value, '!in:') === 0) {\n $search_value = substr($search_value, strlen('in:'));\n\n return $column.' NOT IN('.$search_value.')';\n } else {\n return $column.' LIKE '.$pdoLink->quote('%'.$search_value.'%');\n }\n }", "public function scopeFilteredByString($query, $page, $column, $value){\n return self::where($column, \"like\", \"%$value%\")\n ->orderBy(\"created_at\", \"desc\")\n ->offset(self::PER_PAGE * ($page - 1))\n ->limit(self::PER_PAGE);\n }", "public function like($column, $value) { return $this->addCondition($column, $value, Criterion::LIKE); }", "function filter($col, $value=\"\")\n\t{\n\t\tif(empty($value)) return false;\n\t\t$select = $this->getSelect();\n\t\tif( preg_match(\"/^\\*/\", $col ) )\n\t\t\t$select->having( substr($col,1).\" = ?\", $value);\n\t\telse\n\t\t\t$select->where(\"$col = ?\", $value);\n\t\treturn true;\n\n\t}", "public function filterBySystem($sGUID)\n {\n $oGateway = $this->getGateway();\n $sAlias = $this->getDefaultAlias();\n if(false === empty($sAlias)) {\n $sAlias = $sAlias .'.';\n }\n \n $paramType = $oGateway->getMetaData()->getColumn('system_id')->getType();\n \n return $this->andWhere($sAlias.\"system_id = \".$this->createNamedParameter($sGUID,$paramType));\n \n }", "public function filterbySalesPerson($salesperson = null) {\n\t\t$this->condition('sp1', 'SalesHistory.ArspSaleper1 = ?', $salesperson);\n\t\t$this->condition('sp2', 'SalesHistory.ArspSaleper2 = ?', $salesperson);\n\t\t$this->condition('sp3', 'SalesHistory.ArspSaleper3 = ?', $salesperson);\n\t\t$this->where(array('sp1', 'sp2', 'sp3'), 'or'); \t\t\t\t // combine 'cond1' and 'cond2' with a logical OR\n\t\treturn $this;\n\t }", "public function filterOptionRecipientName($collection, $column)\n {\n $filterValue = $column->getFilter()->getValue();\n if (!$filterValue)\n {\n return;\n }\n\n // remove spaces\n $filterValue = $this->removeSpaces($filterValue);\n\n $collection->getSelect()\n ->where('CONCAT(recipient_firstname, recipient_lastname) LIKE ?', \"%{$filterValue}%\");\n }", "public static function brokerByColumnSearch($column = '', $value = '')\n {\n return false;\n }", "public function where_like($column_name, $value) {\n return $this->_add_simple_where($column_name, 'LIKE', $value);\n }", "public function where_like( $column_name, $value = null ) {\n\t\treturn $this->_add_simple_where( $column_name, 'LIKE', $value );\n\t}", "public static function apply(Builder $builder, $value) {\n \n return $builder->whereRaw('LOWER(`products`.`name`) LIKE ? ',[trim(strtolower($value)).'%']);\n }", "public function filter($value, $row = null) {\n $arr = explode(' ', $value);\n return $this->_filter($arr[0], $row);\n }", "function SearchSuppliers($Field, $Criteria, $user, $password) {\n\t\t$Errors = array();\n\t\t$db = db($user, $password);\n\t\tif (gettype($db)=='integer') {\n\t\t\t$Errors[0]=NoAuthorisation;\n\t\t\treturn $Errors;\n\t\t}\n\t\t$sql='SELECT supplierid\n\t\t\tFROM suppliers\n\t\t\tWHERE '.$Field.\" LIKE '%\".$Criteria.\"%' ORDER BY supplierid\";\n\t\t$result = DB_Query($sql, $db);\n\t\t$i=0;\n\t\t$SupplierList = array();\n\t\twhile ($myrow=DB_fetch_array($result)) {\n\t\t\t$SupplierList[$i]=$myrow[0];\n\t\t\t$i++;\n\t\t}\n\t\treturn $SupplierList;\n\t}", "public function buscarCampo($campo, $valor) {\n\t\treturn $this->Find ( \"{$campo} like '%{$valor}%' \" );\n\t}", "public function where($column, $operator = '', $value = '');", "public function filterBySystem($sGUID)\n {\n $oGateway = $this->getGateway();\n $sAlias = $this->getDefaultAlias();\n if(false === empty($sAlias)) {\n $sAlias = $sAlias .'.';\n }\n \n $paramType = $oGateway->getMetaData()->getColumn('system_id')->getType();\n \n $this->andWhere($sAlias.\"score_group_id IS NULL\");\n \n return $this->andWhere($sAlias.\"system_id = \".$this->createNamedParameter($sGUID,$paramType));\n \n }", "protected function where_clause_SWSectors_ID()\n\t{\n\t\tif(!method_exists($this->incoming_record, 'get_SWSectors_ID'))\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t\t$SWSectors_ID = $this->incoming_record->get_SWSectors_ID();\n\t\t$where_fragment = '';\n\t\tif(!empty($SWSectors_ID))\n\t\t{\n\t\t\t$SWSectors_ID = (array)$SWSectors_ID;\n\t\t\tforeach($SWSectors_ID as $key => $id)\n\t\t\t{\n\t\t\t\t$SWSectors_ID[$key] = $this->db->quote($id);\n\t\t\t}\n\t\t\t$where_fragment = \" and SWSectors_ID in (\".implode(',',$SWSectors_ID).\")\";\n\t\t}\n\t\treturn $where_fragment;\n\t}", "public function soundexCondition($field, $value, $inverse = false)\n {\n if ($value[0] == '!') {\n return \"soundex($field) NOT like concat('%',substring(soundex('\".substr($value, 1, Tools::atk_strlen($value)).\"') from 2),'%')\";\n } else {\n return \"soundex($field) like concat('%',substring(soundex('$value') from 2),'%')\";\n }\n }", "function sap_filter_where( $where = '' ) {\n $where .= \" OR (mt1.meta_key = 'sap_site_id' AND CAST(mt1.meta_value AS CHAR) = '')\";\n return $where;\n}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('cp_id',$this->cp_id);\n\n\t\t$criteria->compare('cp_name',$this->cp_name,true);\n/*\n\t\t$criteria->compare('cp_englishname',$this->cp_englishname,true);\n\n\t\t$criteria->compare('cp_pinyinshortname',$this->cp_pinyinshortname,true);\n\n\t\t$criteria->compare('cp_pinyinlongname',$this->cp_pinyinlongname,true);\n\n\t\t$criteria->compare('cp_district',$this->cp_district);\n\n\t\t$criteria->compare('cp_address',$this->cp_address,true);\n\n\t\t$criteria->compare('cp_avgrentprice',$this->cp_avgrentprice);\n\n\t\t$criteria->compare('cp_developer',$this->cp_developer,true);\n\n\t\t$criteria->compare('cp_propertyprice',$this->cp_propertyprice);\n\n\t\t$criteria->compare('cp_propertyname',$this->cp_propertyname,true);\n\n\t\t$criteria->compare('cp_openingtime',$this->cp_openingtime);\n\n\t\t$criteria->compare('cp_defanglv',$this->cp_defanglv);\n\n\t\t$criteria->compare('cp_area',$this->cp_area);\n\n\t\t$criteria->compare('cp_fengearea',$this->cp_fengearea,true);\n\n\t\t$criteria->compare('cp_floorheight',$this->cp_floorheight,true);\n\n\t\t$criteria->compare('cp_form',$this->cp_form,true);\n\n\t\t$criteria->compare('cp_introduce',$this->cp_introduce,true);\n\n\t\t$criteria->compare('cp_traffic',$this->cp_traffic,true);\n\n\t\t$criteria->compare('cp_carport',$this->cp_carport,true);\n\n\t\t$criteria->compare('cp_propertyserver',$this->cp_propertyserver,true);\n\n\t\t$criteria->compare('cp_roommating',$this->cp_roommating,true);\n\n\t\t$criteria->compare('cp_peripheral',$this->cp_peripheral,true);\n\n\t\t$criteria->compare('cp_x',$this->cp_x,true);\n\n\t\t$criteria->compare('cp_y',$this->cp_y,true);\n*/\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function pesquisaCliente($pesquisa){\n $query = 'SELECT * FROM clientes WHERE LOWER(nome) LIKE :pesquisa';\n $this->db->query($query);\n\n //trata a pesquisa fazendo ser lower case\n $pesquisa = strtolower($pesquisa);\n //concatena os caracteres para fazer o like no sql (pesquisa os termos em qualquer posicao)\n $pesquisa = '%' . $pesquisa . '%';\n //faz o bind\n $this->db->bind(':pesquisa', $pesquisa);\n //faz a consulta\n $resposta = $this->db->resultSet();\n return $resposta;\n }", "public function filter(string $column, string $operator, $value, int $perPage)\n {\n return $this->model->where($column, $operator, $value)->paginate($perPage);\n }", "public function filter(Builder $dataSource)\r\n {\r\n $model = $dataSource->getModel();\r\n $filters = [];\r\n\r\n if ($this->_separated) {\r\n foreach ($this->_fields as $field => $criteria) {\r\n if ($field === static::COLUMN_ID) {\r\n $value = (int) $this->_value;\r\n if (!is_numeric($this->_value)) {\r\n continue;\r\n }\r\n $field = $model->getPrimary();\r\n } elseif ($field === static::COLUMN_NAME) {\r\n $field = $model->getNameExpr();\r\n }\r\n if (null === $this->_value) {\r\n $filter = new \\Elastica\\Query\\Filtered();\r\n $filterMissing = new \\Elastica\\Filter\\Missing($field);\r\n //$filterMissing->addParam(\"existence\", true);\r\n //$filterMissing->addParam(\"null_value\", true);\r\n $filter->setFilter($filterMissing);\r\n\r\n $filters[] = $filter;\r\n } else {\r\n if ($criteria === static::CRITERIA_EQ) {\r\n $filter = new \\Elastica\\Query\\Term();\r\n $filter->setTerm($field, $this->_value);\r\n $filters[] = $filter;\r\n } elseif ($criteria === static::CRITERIA_IN) {\r\n if (is_array($this->_value)) {\r\n $filter = new \\Elastica\\Query\\Terms($field, $this->_value);\r\n } else {\r\n $filter = new \\Elastica\\Query\\Term();\r\n $filter->setTerm($field, $this->_value);\r\n }\r\n $boost = $this->getBoostParam($field);\r\n $filter->setParam('boost', $boost);\r\n $filters[] = $filter;\r\n } elseif ($criteria === static::CRITERIA_NOTEQ) {\r\n $filter = new \\Elastica\\Query\\Term();\r\n $filter->setTerm($field, $this->_value);\r\n $boost = $this->getBoostParam($field);\r\n $filter->setParam('boost', $boost);\r\n $filters[] = $filter;\r\n } elseif ($criteria === static::CRITERIA_LIKE) {\r\n $filter = new \\Elastica\\Query\\Match();\r\n $filter->setField($field, $this->_value);\r\n $boost = $this->getBoostParam($field);\r\n $filter->setParam('boost', $boost);\r\n $filters[] = $filter;\r\n } elseif ($criteria === static::CRITERIA_BEGINS) {\r\n //$filter = new \\Elastica\\Query\\Prefix();\r\n //$filter->setPrefix($field, $this->_value);\r\n //$filters[] = $filter;\r\n $filter = new \\Elastica\\Query\\QueryString();\r\n $filter->setQuery($this->_value);\r\n $filter->setDefaultField($field);\r\n $boost = $this->getBoostParam($field);\r\n $filter->setParam('boost', $boost);\r\n $filters[] = $filter;\r\n } elseif ($criteria === static::CRITERIA_MORE) {\r\n $filter = new \\Elastica\\Query\\Range($field, ['gt' => $this->_value]);\r\n $boost = $this->getBoostParam($field);\r\n $filter->setParam('boost', $boost);\r\n $filters[] = $filter;\r\n } elseif ($criteria === static::CRITERIA_LESS) {\r\n $filter = new \\Elastica\\Query\\Range($field, ['lt' => $this->_value]);\r\n $boost = $this->getBoostParam($field);\r\n $filter->setParam('boost', $boost);\r\n $filters[] = $filter;\r\n } elseif ($criteria === static::CRITERIA_MORER) {\r\n $filter = new \\Elastica\\Query\\Range($field, ['gte' => $this->_value]);\r\n $boost = $this->getBoostParam($field);\r\n $filter->setParam('boost', $boost);\r\n $filters[] = $filter;\r\n } elseif ($criteria === static::CRITERIA_LESSER) {\r\n $filter = new \\Elastica\\Query\\Range($field, ['lte' => $this->_value]);\r\n $boost = $this->getBoostParam($field);\r\n $filter->setParam('boost', $boost);\r\n $filters[] = $filter;\r\n }\r\n }\r\n }\r\n } else {\r\n $filters = new \\Elastica\\Query\\MultiMatch();\r\n $fields = [];\r\n foreach ($this->_fields as $field => $criteria) {\r\n if ($field === static::COLUMN_ID) {\r\n $value = (int) $this->_value;\r\n if (!is_numeric($this->_value)) {\r\n continue;\r\n }\r\n $field = $model->getPrimary();\r\n } elseif ($field === static::COLUMN_NAME) {\r\n $field = $model->getNameExpr();\r\n }\r\n $boost = $this->getBoostParam($field);\r\n $fields[] = $field.'^'.$boost;\r\n }\r\n $slop = $this->getSlopParam();\r\n $filters->setParam('slop', $slop);\r\n $filters->setFields($fields);\r\n $filters->setTieBreaker(0.3);\r\n $filters->setType(\\Elastica\\Query\\MultiMatch::TYPE_BEST_FIELDS);\r\n //$filters->setType(\\Elastica\\Query\\MultiMatch::TYPE_MOST_FIELDS);\r\n $filters->setQuery($this->_value);\r\n }\r\n\r\n\r\n return $filters;\r\n }", "public function conditionSearchShip($param)\n {\n $sql = $this->where(function ($query) use ($param) {\n // Filer by ship name\n return $query->where('m_ship.name', 'LIKE', '%' . $param['filter-ship-name'] . '%');\n })\n // Filter by company name JP or company name ENG\n ->where(function ($query) use ($param) {\n return $query->where('m_company.name_jp', 'LIKE', '%' . $param['filter-company'] . '%')\n ->orWhere('m_company.name_en', 'LIKE', '%' . $param['filter-company'] . '%');\n })\n // Filter by ship classification name\n ->where(function ($query) use ($param) {\n return $query->where('m_ship_classification.name_jp', 'LIKE', '%' . $param['filter-classification'] . '%')\n ->orWhere('m_ship_classification.name_en', 'LIKE', '%' . $param['filter-classification'] . '%');\n })\n // Filter by type of ship\n ->where('m_ship_type.type', 'LIKE', '%' . $param['filter-ship-type'] . '%')\n // Filter by type of ship\n ->where('m_ship.imo_number', 'LIKE', '%' . $param['filter-imo-number'] . '%')\n // Filter by ship nation name\n ->where(function ($query) use ($param) {\n return $query->where('m_nation.name_jp', 'LIKE', '%' . $param['filter-ship-nation'] . '%')\n ->orWhere('m_nation.name_en', 'LIKE', '%' . $param['filter-ship-nation'] . '%');\n });\n\n if (!empty($param['filter-service-name'])) {\n // Filter by service name\n $sql->where(function ($query) use ($param) {\n return $query->where('m_service.name_jp', 'LIKE', '%' . $param['filter-service-name'] . '%')\n ->orWhere('m_service.name_en', 'LIKE', '%' . $param['filter-service-name'] . '%');\n });\n }\n\n return $sql;\n }", "protected function generateSQLColumnFilter($column, $search_value)\n {\n return self::_generateSQLColumnFilter($column, $search_value, $this->pdoLink, isset($this->sRangeSeparator) ? $this->sRangeSeparator : '~');\n }", "public function filterBySp1($sp1 = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($sp1)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(OrdrhedTableMap::COL_SP1, $sp1, $comparison);\n }", "protected function where_clause_squad()\n\t{\n\t\tif(!method_exists($this->incoming_record, 'get_squad'))\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t$squad = $this->incoming_record->get_squad();\n\t\t$where_fragment = '';\n\t\tif($squad != '')\n\t\t{\n\t\t\t$where_fragment=\" and u.squad like {$this->db->quote($squad.'%')}\";\n\t\t}\n\t\treturn $where_fragment;\n\t}" ]
[ "0.5329504", "0.51917535", "0.5133844", "0.49163163", "0.48566377", "0.48286313", "0.47843027", "0.47459438", "0.47403342", "0.46921262", "0.46452573", "0.46137473", "0.46038434", "0.4571684", "0.44988894", "0.4488533", "0.44563654", "0.44538563", "0.44307044", "0.44228113", "0.44222683", "0.44155708", "0.44127434", "0.44071358", "0.4403815", "0.4403811", "0.44019917", "0.4401944", "0.43962327", "0.4394135" ]
0.634841
0
Filter the query on the vendorid column Example usage: $query>filterByVendorid('fooValue'); // WHERE vendorid = 'fooValue' $query>filterByVendorid('%fooValue%', Criteria::LIKE); // WHERE vendorid LIKE '%fooValue%'
public function filterByVendorid($vendorid = null, $comparison = null) { if (null === $comparison) { if (is_array($vendorid)) { $comparison = Criteria::IN; } } return $this->addUsingAlias(PricingTableMap::COL_VENDORID, $vendorid, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterByProductId($value) {\n $this->_filter->equalTo($this->_nameMapping['product'], $value);\n }", "public function showProductByBrand(int $vendorId) {\n \n }", "public function filterByUser(int $id);", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(CustomerPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function getVendorName($virtuemart_vendor_id ){\n\n\t\treturn $this->getFieldOfObjectWithLangFallBack('#__virtuemart_vendors_','slug','virtuemart_vendor_id',(int)$virtuemart_vendor_id);\n\t}", "public function setVendorId(?string $value): void {\n $this->getBackingStore()->set('vendorId', $value);\n }", "public function VendorList($id=null){\n\t\t\n\t\t$this->db->select('*');\n\t\t$this->db->from('vendor');\n\t\tif($id!=null){\n\t\t\t$this->db->where('vendor_id',$id);\n\t\t}\n\t\t$result = $this->db->get();\n\t\treturn $result->result_array();\n\t\t\n\t}", "public function setVendorId($val)\n {\n $this->_propDict[\"vendorId\"] = $val;\n return $this;\n }", "public function idSearch($id) {\n $this->db->select(\"ID, Name, PriceBuy, PriceSell\");\n $this->db->from(\"vegetable\");\n $this->db->where(\"ID\", $id);\n\n return $this->db->get();\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(ItemPropertyPeer::ID, $key, Criteria::EQUAL);\n\t}", "public static function vendor_information($vendor_id) {\n\t\t$query = '\"vendors_infos\".\"lang_id\" = (case when (select count(vendors_infos.id) as totalcount from vendors_infos where vendors_infos.lang_id = ' . getCurrentLang() . ' and vendors.id = vendors_infos.id) > 0 THEN ' . getCurrentLang() . ' ELSE 1 END)';\n\t\t$vendor = Vendors::leftJoin('vendors_infos', 'vendors_infos.id', '=', 'vendors.id')\n\t\t\t->select('vendors_infos.vendor_name', 'vendors_infos.vendor_description')\n\t\t\t->whereRaw($query)\n\t\t\t->where('vendors_infos.id', '=', $vendor_id)\n\t\t\t->first();\n\t\treturn $vendor;\n\t}", "public function getRelatedCustomerIdByVendorId($vendorId){\n $connection = $this->getConnection();\n $select = $connection->select();\n $select->from(\n $this->getTable('ves_vendor_user'),\n 'customer_id'\n )->where(\n 'vendor_id = :vendor_id'\n )->where(\n 'is_super_user = :is_super_user'\n );\n $bind = [\n 'vendor_id' => $vendorId,\n 'is_super_user' => 1,\n ];\n $customerId = $connection->fetchOne($select,$bind);\n \n return $customerId;\n }", "public function getVendorObject($v_id){\n $this->load->database();\n if($v_id==-1){\n $result = $this->db->select('*')->from('vendor_details')->get()->result();\n return($result);\n }\n else{\n $result = $this->db->select('*')->from('vendor_details')->where('v_id', $v_id)->get()->result();\n return($result);\n }\n }", "public function get_all_offerings_by_vendor($vendor_id) {\n $this->db->select('business_services.*,business_services.id as business_service_id,business_services_details.*,business_programs.*');\n $this->db->from('business_services');\n $this->db->join('business_services_details', 'business_services_details.service_id = business_services.id');\n $this->db->join('business_programs', 'business_services.program_id = business_programs.id');\n $this->db->where('business_programs.business_id', $vendor_id);\n $query = $this->db->get();\n $query_result = $query->result();\n return $query_result;\n }", "public function search($params) {\n $query = ProductVendor::find();\n\n // add conditions that should always apply here\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n $this->load($params);\n if (!isset($params[\"ProductVendor\"][\"compareOp\"])) {\n $operator = '';\n } else {\n $operator = $params[\"ProductVendor\"][\"compareOp\"];\n }\n if (!isset($params[\"ProductVendor\"][\"compare\"])) {\n $val = '';\n } else {\n $val = $params[\"ProductVendor\"][\"compare\"];\n }\n\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n // grid filtering conditions\n $query->andFilterWhere([\n 'id' => $this->id,\n 'product_id' => $this->product_id,\n 'vendor_id' => $this->vendor_id,\n 'qty' => $this->qty,\n 'sku' => $this->sku,\n 'offer' => $this->offer,\n 'handling_time' => $this->handling_time,\n 'pick_up_location' => $this->pick_up_location,\n 'free_shipping' => $this->free_shipping,\n 'courier_handover' => $this->courier_handover,\n 'offer_price' => $this->offer_price,\n 'full_fill' => $this->full_fill,\n 'vendor_status' => $this->vendor_status,\n 'admin_status' => $this->admin_status,\n 'CB' => $this->CB,\n 'UB' => $this->UB,\n 'DOC' => $this->DOC,\n 'DOU' => $this->DOU,\n ]);\n\n $query->andFilterWhere(['like', 'offer_note', $this->offer_note])\n ->andFilterWhere(['like', 'conditions', $this->conditions])\n ->andFilterWhere([$operator, 'price', $val])\n ->andFilterWhere(['like', 'field1', $this->field1])\n ->andFilterWhere(['like', 'field2', $this->field2])\n ->andFilterWhere(['like', 'field3', $this->field3]);\n\n return $dataProvider;\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(CanonTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(sfGuardUserPeer::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(SalesPeer::REFNO, $key, Criteria::EQUAL);\n }", "public function get_all_packages_by_vendor($id) {\n $this->db->select('business_programs.*');\n $this->db->from('business_programs');\n $this->db->where('business_id', $id);\n $query = $this->db->get();\n $query_result = $query->result();\n return $query_result;\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(EquipoPeer::IDEQUIPO, $key, Criteria::EQUAL);\n\t}", "function selectAllProductsByVendor($dbc, $vendor) {\n $q = selectAllProductsQuery().' WHERE '.PRODUCT_TABLE::$VEND_ID.'=\\''.$vendor.'\\';';\n $r = mysqli_query($dbc, $q);\n if($r) {\n $array = array();\n while ($row = mysqli_fetch_assoc($r)) {\n $array[] = $row;\n }\n return $array;\n }\n return array();\n }", "protected function _deleteInvendorVendor($vendorId){ \t\n \t$model = $this->load($vendorId); \t\n \t$vendorCode = $model->getLbVendorCode();\n \t$vendorCollection = Mage::getModel('dropship360/ranking')->load($vendorCode,'lb_vendor_code');\n \t$request = array('lb_vendor_name'=>$vendorCollection->getLbVendorName(),'updated_by'=>Mage::getSingleton('admin/session')->getUser()->getUsername(),'product_sku'=>$model->getProductSku(),'lb_vendor_code'=>$model->getLbVendorCode(),'cost'=>$model->getCost(),'stock'=>$model->getStock(),'updated_at' => now());\n \ttry{\n\t\t\t$model->delete();\n\t\t\t$this->_saveInventoryLog('delete',$request);\n\t\t\t$this->_productInventorySubtract = $this->_productInventorySubtract + $request['stock'];\n\t\t\tMage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('%s Deleted Successfully ',$request['lb_vendor_name']));\n \t}catch(Exception $e){\n \t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\n \t}\n }", "public function getFieldId()\n {\n return 'product_vendor';\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(SepomexPeer::SEPOMEX_ID, $key, Criteria::EQUAL);\n }", "public function DeleteVendor($id){\n\t\t\n\t\t$this->db->where('vendor_id',$id);\n\t\t$this->db->delete('vendor');\n\t\treturn true;\n\t}", "public function setVendor($value)\n {\n return $this->set(self::VENDOR, $value);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(StuffPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function findItemsByVendorId($vendor_id, $status = 'active') {\n\t\t//set search conditions based upon desired item state\n\t\tif($status == 'active'){\n\t\t\t$conditions = array(\n\t\t\t\t'Item.vendor_id' => $vendor_id,\n\t\t\t\t'Item.active' => 1\n\t\t\t);\n\t\t} elseif ($status == 'inactive') {\n\t\t\t$conditions = array(\n\t\t\t\t'Item.vendor_id' => $vendor_id,\n\t\t\t\t'Item.active' => 0\n\t\t\t);\n\t\t} elseif ($status == 'all') {\n\t\t\t$conditions = array(\n\t\t\t\t'Item.vendor_id' => $vendor_id\n\t\t\t);\n\t\t}\n\t\t//find the requested items\n\t\t$items = $this->find('all', array(\n\t\t\t'conditions' => $conditions,\n\t\t\t'contain' => array(\n\t\t\t\t'Vendor'\n\t\t\t),\n\t\t\t'order' => array(\n\t\t\t\t'Item.name')\n\t\t));\n\t\t\n\t\t//grouping and setup from old needs reorder\n\t\t$vendors = $this->Vendor->find('all', array(\n\t\t\t'conditions' => array('Vendor.type' => 'vendor')\n\t\t));\n\n\t\t$existing = $otherVendors = array();\n\n\t\t$count = 0;\n\t\tforeach ($items as $index => $item) {\n\t\t\t$vendor = empty($item['Vendor']['name']) ? 'X' : $item['Vendor']['name'];\n\n\t\t\t$existing[$item['Vendor']['id']] = $item['Vendor']['id']; //to filter the full vendo list\n\n\t\t\t$item['Item']['index'] = $item['Item']['id'];\n\t\t\t$lowStock[$vendor][] = $item;\n\t\t\t$itemData[$item['Item']['id']] = $item;\n\t\t}\n\n\t\tforeach ($vendors as $index => $vendor) {\n\t\t\t$vendorAccess[$vendor['Vendor']['id']] = $vendor['Vendor'];\n\t\t\tif (!isset($existing[$vendor['Vendor']['id']])) {\n\t\t\t\t$otherVendors[] = $vendor;\n\t\t\t}\n\t\t}\n\t\t$itemData['vendorAccess'] = $vendorAccess;\n\t\treturn compact('lowStock', 'itemData', 'otherVendors');\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(AliProductTableMap::COL_PCODE, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(TblProdSmallerTableMap::COL_PROD_ID, $key, Criteria::EQUAL);\n }" ]
[ "0.5973345", "0.5758303", "0.55169487", "0.54266274", "0.54101497", "0.53754133", "0.53646624", "0.53636086", "0.52970576", "0.5234452", "0.51833355", "0.51808393", "0.51745963", "0.51646876", "0.5074881", "0.5067078", "0.5060439", "0.5059637", "0.5051762", "0.50451255", "0.5043972", "0.50324047", "0.5022782", "0.50022477", "0.49901986", "0.49659956", "0.4965845", "0.49525136", "0.49410805", "0.49347934" ]
0.59596497
1
Filter the query on the vendoritemid column Example usage: $query>filterByVendoritemid('fooValue'); // WHERE vendoritemid = 'fooValue' $query>filterByVendoritemid('%fooValue%', Criteria::LIKE); // WHERE vendoritemid LIKE '%fooValue%'
public function filterByVendoritemid($vendoritemid = null, $comparison = null) { if (null === $comparison) { if (is_array($vendoritemid)) { $comparison = Criteria::IN; } } return $this->addUsingAlias(PricingTableMap::COL_VENDORITEMID, $vendoritemid, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(ItemPropertyPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function findItemsByVendorId($vendor_id, $status = 'active') {\n\t\t//set search conditions based upon desired item state\n\t\tif($status == 'active'){\n\t\t\t$conditions = array(\n\t\t\t\t'Item.vendor_id' => $vendor_id,\n\t\t\t\t'Item.active' => 1\n\t\t\t);\n\t\t} elseif ($status == 'inactive') {\n\t\t\t$conditions = array(\n\t\t\t\t'Item.vendor_id' => $vendor_id,\n\t\t\t\t'Item.active' => 0\n\t\t\t);\n\t\t} elseif ($status == 'all') {\n\t\t\t$conditions = array(\n\t\t\t\t'Item.vendor_id' => $vendor_id\n\t\t\t);\n\t\t}\n\t\t//find the requested items\n\t\t$items = $this->find('all', array(\n\t\t\t'conditions' => $conditions,\n\t\t\t'contain' => array(\n\t\t\t\t'Vendor'\n\t\t\t),\n\t\t\t'order' => array(\n\t\t\t\t'Item.name')\n\t\t));\n\t\t\n\t\t//grouping and setup from old needs reorder\n\t\t$vendors = $this->Vendor->find('all', array(\n\t\t\t'conditions' => array('Vendor.type' => 'vendor')\n\t\t));\n\n\t\t$existing = $otherVendors = array();\n\n\t\t$count = 0;\n\t\tforeach ($items as $index => $item) {\n\t\t\t$vendor = empty($item['Vendor']['name']) ? 'X' : $item['Vendor']['name'];\n\n\t\t\t$existing[$item['Vendor']['id']] = $item['Vendor']['id']; //to filter the full vendo list\n\n\t\t\t$item['Item']['index'] = $item['Item']['id'];\n\t\t\t$lowStock[$vendor][] = $item;\n\t\t\t$itemData[$item['Item']['id']] = $item;\n\t\t}\n\n\t\tforeach ($vendors as $index => $vendor) {\n\t\t\t$vendorAccess[$vendor['Vendor']['id']] = $vendor['Vendor'];\n\t\t\tif (!isset($existing[$vendor['Vendor']['id']])) {\n\t\t\t\t$otherVendors[] = $vendor;\n\t\t\t}\n\t\t}\n\t\t$itemData['vendorAccess'] = $vendorAccess;\n\t\treturn compact('lowStock', 'itemData', 'otherVendors');\n\t}", "public function search($params) {\n $query = ProductVendor::find();\n\n // add conditions that should always apply here\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n $this->load($params);\n if (!isset($params[\"ProductVendor\"][\"compareOp\"])) {\n $operator = '';\n } else {\n $operator = $params[\"ProductVendor\"][\"compareOp\"];\n }\n if (!isset($params[\"ProductVendor\"][\"compare\"])) {\n $val = '';\n } else {\n $val = $params[\"ProductVendor\"][\"compare\"];\n }\n\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n // grid filtering conditions\n $query->andFilterWhere([\n 'id' => $this->id,\n 'product_id' => $this->product_id,\n 'vendor_id' => $this->vendor_id,\n 'qty' => $this->qty,\n 'sku' => $this->sku,\n 'offer' => $this->offer,\n 'handling_time' => $this->handling_time,\n 'pick_up_location' => $this->pick_up_location,\n 'free_shipping' => $this->free_shipping,\n 'courier_handover' => $this->courier_handover,\n 'offer_price' => $this->offer_price,\n 'full_fill' => $this->full_fill,\n 'vendor_status' => $this->vendor_status,\n 'admin_status' => $this->admin_status,\n 'CB' => $this->CB,\n 'UB' => $this->UB,\n 'DOC' => $this->DOC,\n 'DOU' => $this->DOU,\n ]);\n\n $query->andFilterWhere(['like', 'offer_note', $this->offer_note])\n ->andFilterWhere(['like', 'conditions', $this->conditions])\n ->andFilterWhere([$operator, 'price', $val])\n ->andFilterWhere(['like', 'field1', $this->field1])\n ->andFilterWhere(['like', 'field2', $this->field2])\n ->andFilterWhere(['like', 'field3', $this->field3]);\n\n return $dataProvider;\n }", "public function filterByProductId($value) {\n $this->_filter->equalTo($this->_nameMapping['product'], $value);\n }", "public function filterByPrimaryKey($key)\n {\n return $this->addUsingAlias(CollectionItemOfferPeer::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(EquipoPeer::IDEQUIPO, $key, Criteria::EQUAL);\n\t}", "public function search($item_id)\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n if(isset($_GET['option_id'])) $option_id = $_GET['option_id'];\n if($option_id > 0) $criteria->compare('t.option_id',$option_id);\n\n\t\t$criteria->compare('t.id',$this->id);\n\t\t$criteria->compare('t.item_id',$item_id);\n\t\t$criteria->compare('t.option_value_id',$this->option_value_id);\n\t\t$criteria->compare('t.quantity',$this->quantity);\n\t\t$criteria->compare('t.subtract',$this->subtract);\n\t\t$criteria->compare('t.price',$this->price);\n\n $criteria->with = array('optionVal');\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'sort'=>array('defaultOrder'=>'optionVal.position'),\n\t\t));\n\t}", "public function searchItemByFilter($filterData)\n {\n// print_r($filterData);\n $sql = \"SELECT items.name as item_name, items.description, items.id as item_id, items.image, items.price, items.thumbnail,\n user.first_name, user.last_name, user.sfsu_id, user.username, category.name as category_name\n FROM items, category, user WHERE items.cataegory_id = category.id\n and items.user_id = user.id\n and items.name LIKE :search_term\";\n $parameters = array();\n $parameters[':search_term'] = '%' . $filterData->searchTerm . '%';\n if (isset($filterData->category_id) && $filterData->category_id != -1) {\n $sql.=' and category.id = :cat_id';\n $parameters[':cat_id'] = $filterData->category_id;\n }\n if (isset($filterData->price_from) && isset($filterData->price_to) && \n $filterData->price_from != -1 && $filterData->price_to != -1) \n {\n $sql.=' and items.price >= :price_from and items.price <= :price_to';\n $parameters[':price_from'] = $filterData->price_from;\n $parameters[':price_to'] = $filterData->price_to;\n }\n// echo \"$sql\";\n $query = $this->db->prepare($sql);\n// echo '[ PDO DEBUG ]: ' . Helper::debugPDO($sql, $parameters); exit();\n $query->execute($parameters);\n return $query->fetchAll();\n }", "public function search($params) {\n\t\t$query = AeExtPurchaseProductModel::find();\n\n\t\t$dataProvider = new ActiveDataProvider([\n\t\t\t\t'query' => $query,\n\t\t\t]);\n\n\t\t$this->load($params);\n\n\t\tif (!$this->validate()) {\n\t\t\t// uncomment the following line if you do not want to any records when validation fails\n\t\t\t// $query->where('0=1');\n\t\t\treturn $dataProvider;\n\t\t}\n\n\t\t$query->andFilterWhere([\n\t\t\t\t'id' => $this->id,\n\t\t\t\t'app_id' => $this->app_id,\n\t\t\t\t'price' => $this->price,\n\t\t\t]);\n\n\t\t$query->andFilterWhere(['like', 'name', $this->name])\n\t\t->andFilterWhere(['like', 'type', $this->type])\n\t\t->andFilterWhere(['like', 'code_ios', $this->code_ios])\n\t\t->andFilterWhere(['like', 'code_android', $this->code_android])\n\t\t->andFilterWhere(['like', 'description', $this->description])\n\t\t->andFilterWhere(['like', 'image', $this->image])\n\t\t->andFilterWhere(['like', 'icon', $this->icon]);\n\n\t\treturn $dataProvider;\n\t}", "function selectAllProductsByVendor($dbc, $vendor) {\n $q = selectAllProductsQuery().' WHERE '.PRODUCT_TABLE::$VEND_ID.'=\\''.$vendor.'\\';';\n $r = mysqli_query($dbc, $q);\n if($r) {\n $array = array();\n while ($row = mysqli_fetch_assoc($r)) {\n $array[] = $row;\n }\n return $array;\n }\n return array();\n }", "public function filterByItemid($itemid = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($itemid)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(WhseitempackTableMap::COL_ITEMID, $itemid, $comparison);\n }", "public function filterByVendorid($vendorid = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($vendorid)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PricingTableMap::COL_VENDORID, $vendorid, $comparison);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(ItemInCartTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function searchItems($phrase=\"\") {\n $sql = \"SELECT item_id, name, state, owner_id FROM items WHERE item_id IS NOT NULL AND state > '0' AND name LIKE :p \".F::getUserConstraints();\n $query = $this->db->prepare($sql);\n $query->execute(array(':p' => \"%\".$phrase.\"%\"));\n return $query->fetchAll(); \n }", "function filter_exists($item, $get_by = 'filter_id')\n{\n\tglobal $dbprefix, $SQL, $plugin;\n\n\t$query = array(\n\t\t\t\t\t'SELECT'\t=> 'f.filter_id',\n\t\t\t\t\t'FROM'\t\t=> \"{$dbprefix}filters f\",\n\t\t\t\t\t'WHERE'\t\t=> \"f.\" . $get_by . \" = \" . ($get_by == 'filter_id' ? intval($item) : \"'\" . $SQL->escape($item) . \"'\")\n\t\t\t\t);\n\n\t($hook = $plugin->run_hook('filter_exists_func')) ? eval($hook) : null; //run hook\n\n\t$result\t= $SQL->build($query);\n\treturn $SQL->num($result);\n}", "public function filterByItemid($itemid = null, $comparison = null)\n {\n if (is_array($itemid)) {\n $useMinMax = false;\n if (isset($itemid['min'])) {\n $this->addUsingAlias(ItemInCartTableMap::COL_ITEMID, $itemid['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($itemid['max'])) {\n $this->addUsingAlias(ItemInCartTableMap::COL_ITEMID, $itemid['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ItemInCartTableMap::COL_ITEMID, $itemid, $comparison);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(AliProductTableMap::COL_PCODE, $key, Criteria::EQUAL);\n }", "public function showProductByBrand(int $vendorId) {\n \n }", "function getVendorBySearchKey($conn, $key)\n{\n $conn->connectToDatabase();\n $sql = 'SELECT * FROM `Vendor` WHERE `vendorName` LIKE \"%'.$key.'%\" ';\n $dataset = $conn->selectData($sql);\n $conn->closeConnection();\n\n return $dataset;\n}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(TblProdSmallerTableMap::COL_PROD_ID, $key, Criteria::EQUAL);\n }", "public function filterByItemId($itemId = null, $comparison = null)\n {\n if (is_array($itemId))\n {\n $useMinMax = false;\n if (isset($itemId['min']))\n {\n $this->addUsingAlias(CollectionItemOfferPeer::ITEM_ID, $itemId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($itemId['max']))\n {\n $this->addUsingAlias(CollectionItemOfferPeer::ITEM_ID, $itemId['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax)\n {\n return $this;\n }\n if (null === $comparison)\n {\n $comparison = Criteria::IN;\n }\n }\n return $this->addUsingAlias(CollectionItemOfferPeer::ITEM_ID, $itemId, $comparison);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(DonatedItemTableMap::COL_DI_ID, $key, Criteria::EQUAL);\n }", "function productVendorUnitListing($searchText = '', $page = '', $segment = '',$vendor_id ,$product_id)\n {\n $this->db->select('`product_vendor_unit`.`status` AS `status`,`product_vendor_unit`.`id` AS `id`,`product`.`name` AS `product_name`,`vendor`.`name` AS `vendor_name`,`unit`.`name` AS `unit_name`,`unit`.`id` AS `unit_id`');\n $this->db->from('product_vendor_unit');\n\t\t$this->db->join('product', 'product.id = product_vendor_unit.product_id'); \n\t\t$this->db->join('vendor', 'vendor.id = product_vendor_unit.vendor_id');\n\t\t$this->db->join('unit', 'unit.id = product_vendor_unit.unit_id');\n\t\t$likeCriteria = \"product_vendor_unit.product_id='\".$product_id.\"' AND product_vendor_unit.vendor_id='\".$vendor_id.\"'\";\n if(!empty($searchText)) {\n $likeCriteria .= \" AND vendor.name LIKE '%\".$searchText.\"%'\n\t\t\t\t\t\t\tOR unit.name LIKE '%\".$searchText.\"%'\n\t\t\t\t\t\t\tOR product.name LIKE '%\".$searchText.\"%'\";\n }\n\t\t$this->db->where($likeCriteria);\n\t\tif($page!='' && $segment!=''){\n\t\t\t$this->db->limit($page, $segment);\n\t\t}else{\n\t\t\t$this->db->limit($page, 0);\n\t\t}\n $query = $this->db->get();\n \n $result = $query->result(); \n\t\t\n return $result;\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('item_id', $this->item_id);\n\n $criteria->compare('item_qty', $this->item_qty);\n\n $criteria->compare('item_price', $this->item_price);\n\n $criteria->compare('item_total', $this->item_total);\n\n $criteria->compare('item_attribute_id', $this->item_attribute_id);\n\n $criteria->compare('item_product_id', $this->item_product_id);\n\n $criteria->compare('item_product_name', $this->item_product_name);\n\n $criteria->compare('order_id', $this->order_id);\n\n return new CActiveDataProvider('OrderItem', array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('item_id',$this->item_id,false);\n\t\t$criteria->compare('item_name',$this->item_name,true);\n\t\t$criteria->compare('item_brand_id',$this->item_brand_id,false);\n\t\t$criteria->compare('item_status',$this->item_status,false);\n $criteria->compare('item_ctime',$this->item_ctime,true);\n $criteria->compare('item_type_id',$this->item_type_id,false);\n /*\n\t\t$criteria->compare('item_start_time',$this->item_start_time,true);\n\t\t$criteria->compare('item_end_time',$this->item_end_time,true);\n\t\t$criteria->compare('item_intro',$this->item_intro,true);\n\t\t$criteria->compare('item_apply_num_plus',$this->item_apply_num_plus,true);\n\t\t$criteria->compare('item_apply_num',$this->item_apply_num,true);\n\t\t$criteria->compare('item_piece',$this->item_piece,true);\n */\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function filterItemsBrowseParams($params)\n {\n // Check if this is a direct query (not from advanced search).\n if (isset($params['controller']) && isset($params['action'])) {\n // Include submembers in search by virtually unsetting collection_id and collection\n if ($params['controller'] == 'items' && $params['action'] == 'browse' && isset($params['search']) && !empty($params['collection']) && $params['collection'] > 0) {\n $params['iiif_collection_id'] = $params['collection'];\n if (!empty($params['collection_id'])) {\n $collection = $params['collection_id'];\n $params['collection_id'] = '';\n }\n if (!empty($params['collection'])) {\n $collection = $params['collection'];\n $params['collection'] = '';\n }\n }\n }\n return $params;\n }", "public function filterByItemid($itemid = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($itemid)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PricingTableMap::COL_ITEMID, $itemid, $comparison);\n }", "function get_applications_by_itemid($itemids, $field = 'applicationid') {\n zbx_value2array($itemids);\n $result = array();\n $db_applications = DBselect('SELECT DISTINCT app.' . $field . ' AS result' . ' FROM applications app,items_applications ia' . ' WHERE app.applicationid=ia.applicationid' . ' AND ' . dbConditionInt('ia.itemid', $itemids));\n while ($db_application = DBfetch($db_applications)) {\n array_push($result, $db_application['result']);\n }\n\n return $result;\n }", "public static function FilterItem(&$item, Request $request)\n {\n $whereItem = [];\n $whereExtra = [];\n\n if ($request->cat && !empty($request->cat)) {\n $whereItem[] = ['category_id', $request->cat];\n }\n\n if ($request->input_item && !empty($request->input_item)) {\n $whereItem[] = ['description', 'like', '%'.$request->input_item.'%'];\n $whereItem[] = ['internal_id', 'like', '%'.$request->input_item.'%'];\n $whereExtra[] = ['name', 'like', '%'.$request->input_item.'%'];\n }\n\n foreach ($whereItem as $index => $wItem) {\n if($index < 1) {\n $item->Where([$wItem]);\n }else{\n $item->orWhere([$wItem]);\n }\n }\n\n if (!empty($whereExtra)) {\n $item\n ->orWhereHas('brand', function ($query) use ($whereExtra) {\n $query->where($whereExtra);\n })\n ->orWhereHas('category', function ($query) use ($whereExtra) {\n $query->where($whereExtra);\n });\n }\n }", "public function search($params, $slug)\n {\n $query = Items::find()->where(['entity_id' => (Entities::findOne(['slug' => $slug]))->id])->orderBy('id DESC');\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query\n ]);\n\n $this->load($params);\n\n $this->detachBehavior('slug');\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->++where('0=1');\n return $dataProvider;\n }\n\n $query->joinWith('optionsName');\n // grid filtering conditions\n $query->andFilterWhere([\n 'id' => $this->id,\n 'cms_items.entity_id' => $this->entity_id,\n 'cms_items.date_0' => $this->date_0,\n 'cms_items.date_1' => $this->date_1,\n 'cms_items.date_2' => $this->date_2,\n 'cms_items.date_3' => $this->date_3,\n 'cms_items.date_4' => $this->date_4,\n 'cms_items.status' => $this->status,\n ]);\n\n $query->andFilterWhere(['like', 'slug', $this->slug])\n ->andFilterWhere(['like', 'cms_items.text_1_0', $this->text_1_0])\n ->andFilterWhere(['like', 'cms_items.text_1_1', $this->text_1_1])\n ->andFilterWhere(['like', 'cms_items.text_1_2', $this->text_1_2])\n ->andFilterWhere(['like', 'cms_items.text_1_3', $this->text_1_3])\n ->andFilterWhere(['like', 'cms_items.text_1_4', $this->text_1_4])\n ->andFilterWhere(['like', 'cms_items.text_2_0', $this->text_2_0])\n ->andFilterWhere(['like', 'cms_items.text_2_1', $this->text_2_1])\n ->andFilterWhere(['like', 'cms_items.text_2_2', $this->text_2_2])\n ->andFilterWhere(['like', 'cms_items.text_2_3', $this->text_2_3])\n ->andFilterWhere(['like', 'cms_items.text_2_4', $this->text_2_4])\n ->andFilterWhere(['like', 'cms_items.text_3_0', $this->text_3_0])\n ->andFilterWhere(['like', 'cms_items.text_3_1', $this->text_3_1])\n ->andFilterWhere(['like', 'cms_items.text_3_2', $this->text_3_2])\n ->andFilterWhere(['like', 'cms_items.text_3_3', $this->text_3_3])\n ->andFilterWhere(['like', 'cms_items.text_3_4', $this->text_3_4])\n ->andFilterWhere(['like', 'cms_items.text_4_0', $this->text_4_0])\n ->andFilterWhere(['like', 'cms_items.text_4_1', $this->text_4_1])\n ->andFilterWhere(['like', 'cms_items.text_4_2', $this->text_4_2])\n ->andFilterWhere(['like', 'cms_items.text_4_3', $this->text_4_3])\n ->andFilterWhere(['like', 'cms_items.text_4_4', $this->text_4_4])\n ->andFilterWhere(['like', 'cms_items.text_5_0', $this->text_5_0])\n ->andFilterWhere(['like', 'cms_items.text_5_1', $this->text_5_1])\n ->andFilterWhere(['like', 'cms_items.text_5_2', $this->text_5_2])\n ->andFilterWhere(['like', 'cms_items.text_5_3', $this->text_5_3])\n ->andFilterWhere(['like', 'cms_items.text_5_4', $this->text_5_4])\n ->andFilterWhere(['like', 'cms_items.text_6_0', $this->text_6_0])\n ->andFilterWhere(['like', 'cms_items.text_6_1', $this->text_6_1])\n ->andFilterWhere(['like', 'cms_items.text_6_2', $this->text_6_2])\n ->andFilterWhere(['like', 'cms_items.text_6_3', $this->text_6_3])\n ->andFilterWhere(['like', 'cms_items.text_6_4', $this->text_6_4])\n ->andFilterWhere(['like', 'cms_items.text_7_0', $this->text_7_0])\n ->andFilterWhere(['like', 'cms_items.text_7_1', $this->text_7_1])\n ->andFilterWhere(['like', 'cms_items.text_7_2', $this->text_7_2])\n ->andFilterWhere(['like', 'cms_items.text_7_3', $this->text_7_3])\n ->andFilterWhere(['like', 'cms_items.text_7_4', $this->text_7_4]);\n\n foreach ($this->categories as $key => $category) {\n if (!empty($this->$category)) {\n $id = explode('_', $this->$category)[1];\n $option = Options::findOne($id);\n $query->andWhere(['cms_items.id' => OaI::getItemIdsByOption($option->slug)]);\n };\n }\n return $dataProvider;\n\n }" ]
[ "0.5615121", "0.54726315", "0.5448796", "0.5397945", "0.5292468", "0.52286553", "0.50583845", "0.5027007", "0.5019439", "0.49768174", "0.49560475", "0.49435124", "0.49346164", "0.49315313", "0.492257", "0.4836711", "0.4812266", "0.47694054", "0.47423074", "0.47362363", "0.47195163", "0.46929634", "0.46918303", "0.46787924", "0.46704113", "0.46701366", "0.466288", "0.4652982", "0.4623783", "0.461464" ]
0.63599116
0
Filter the query on the shipfromid column Example usage: $query>filterByShipfromid('fooValue'); // WHERE shipfromid = 'fooValue' $query>filterByShipfromid('%fooValue%', Criteria::LIKE); // WHERE shipfromid LIKE '%fooValue%'
public function filterByShipfromid($shipfromid = null, $comparison = null) { if (null === $comparison) { if (is_array($shipfromid)) { $comparison = Criteria::IN; } } return $this->addUsingAlias(PricingTableMap::COL_SHIPFROMID, $shipfromid, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function queryVendoridShipfromid($vendorID, $shipfromID) {\n\t\t$q = $this->query();\n\t\t$q->filterByVendorid($vendorID);\n\t\t$q->filterByShipfromid($shipfromID);\n\t\treturn $q;\n\t}", "public static function validateVendorShipfromid($vendorID, $shipfromID) {\n\t\t$validate = self::getValidator();\n\t\treturn $validate->vendorShipfromid($vendorID, $shipfromID);\n\t}", "public function setShipFrom(Shipper $value)\n {\n $this->shipFrom = $value;\n }", "public function filterByStrfrom($strfrom = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($strfrom)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $strfrom)) {\n\t\t\t\t$strfrom = str_replace('*', '%', $strfrom);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(LogMailPeer::STRFROM, $strfrom, $comparison);\n\t}", "public function filterByUser(int $id);", "public function filterByProductId($value) {\n $this->_filter->equalTo($this->_nameMapping['product'], $value);\n }", "public function searchListShip($companyId, $shipId, $shipName)\n {\n\n if ($shipName != null) {\n $shipName = \"%\" . $shipName . \"%\";\n }\n\n $query = DB::table('m_ship')->select([\n 'm_ship.id',\n 'm_ship.name'\n ]);\n\n if ($companyId != null || $companyId != '') {\n\n $query = $query\n ->join('m_company', 'm_company.id', 'm_ship.company_id')\n ->where('m_company.del_flag', 0)\n ->where('m_ship.del_flag', 0)\n ->where('m_company.id', $companyId);\n\n if ($shipId != null) {\n $query = $query->where('m_ship.id', $shipId);\n }\n\n if ($shipName != null) {\n $query = $query->whereRaw('m_ship.name LIKE ?', $shipName);\n }\n } else {\n $query = $query->where('m_ship.del_flag', 0);\n\n if ($shipId != null) {\n $query = $query->where('m_ship.id', $shipId);\n }\n\n if ($shipName != null) {\n $query = $query->whereRaw('m_ship.name LIKE ?', $shipName);\n }\n }\n\n return $query->get();\n }", "public function filterByOrderId($value) {\n $this->_filter->equalTo('order_id', $value);\n }", "public function conditionSearchShip($param)\n {\n $sql = $this->where(function ($query) use ($param) {\n // Filer by ship name\n return $query->where('m_ship.name', 'LIKE', '%' . $param['filter-ship-name'] . '%');\n })\n // Filter by company name JP or company name ENG\n ->where(function ($query) use ($param) {\n return $query->where('m_company.name_jp', 'LIKE', '%' . $param['filter-company'] . '%')\n ->orWhere('m_company.name_en', 'LIKE', '%' . $param['filter-company'] . '%');\n })\n // Filter by ship classification name\n ->where(function ($query) use ($param) {\n return $query->where('m_ship_classification.name_jp', 'LIKE', '%' . $param['filter-classification'] . '%')\n ->orWhere('m_ship_classification.name_en', 'LIKE', '%' . $param['filter-classification'] . '%');\n })\n // Filter by type of ship\n ->where('m_ship_type.type', 'LIKE', '%' . $param['filter-ship-type'] . '%')\n // Filter by type of ship\n ->where('m_ship.imo_number', 'LIKE', '%' . $param['filter-imo-number'] . '%')\n // Filter by ship nation name\n ->where(function ($query) use ($param) {\n return $query->where('m_nation.name_jp', 'LIKE', '%' . $param['filter-ship-nation'] . '%')\n ->orWhere('m_nation.name_en', 'LIKE', '%' . $param['filter-ship-nation'] . '%');\n });\n\n if (!empty($param['filter-service-name'])) {\n // Filter by service name\n $sql->where(function ($query) use ($param) {\n return $query->where('m_service.name_jp', 'LIKE', '%' . $param['filter-service-name'] . '%')\n ->orWhere('m_service.name_en', 'LIKE', '%' . $param['filter-service-name'] . '%');\n });\n }\n\n return $sql;\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(AliSmsTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function setShipFrom(\\ericchew87\\WWEXSpeedShip2PHP\\Structs\\SimpleShipmentAddress $shipFrom = null)\n {\n if (is_null($shipFrom) || (is_array($shipFrom) && empty($shipFrom))) {\n unset($this->shipFrom);\n } else {\n $this->shipFrom = $shipFrom;\n }\n return $this;\n }", "public function getIdShip($idShip = null)\n {\n return DB::table('m_ship')->select([\n 'm_ship.id',\n 'm_ship.name',\n 'm_company.currency_id',\n 'm_currency.code'\n ])\n ->join('m_company', 'm_company.id','m_ship.company_id')\n ->join('m_currency', 'm_currency.id','m_company.currency_id')\n ->where('m_company.del_flag', 0)\n ->where('m_currency.del_flag', 0)\n ->where('m_ship.del_flag', 0)\n ->where('m_ship.id', $idShip)\n ->first();\n }", "public function filterById($id = null)\n\t{\n\t\tif (is_array($id)) {\n\t\t\treturn $this->addUsingAlias(CollectorBuddyPeer::ID, $id, Criteria::IN);\n\t\t} else {\n\t\t\treturn $this->addUsingAlias(CollectorBuddyPeer::ID, $id, Criteria::EQUAL);\n\t\t}\n\t}", "public function setShipTo(Shipper $value)\n {\n $this->shipTo = $value;\n }", "public function withShipFromAddress($value)\n {\n $this->setShipFromAddress($value);\n return $this;\n }", "public function filterId(int $id): self;", "function SetFrom ( $from ) {\n\t\tif( ($pos = strpos( $from, ',')) === false )\t\t\t$this->from = $from;\n\t\telse\t\t\t\t\t\t\t\t\t\t\t\t\t$this->from = trim( substr( $from, 0, $pos ) );\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(DeliveryTypeTableMap::COL_DELIVERY_TYPE_ID, $key, Criteria::EQUAL);\n }", "public function getShip($idShip = null, $param = [])\n {\n // Check exists param id ship\n $queryShip = DB::table('m_ship')\n ->join('m_company', function($join) {\n if (isset($param['company']) && count($param['company']) > 0) {\n $join->on('m_ship.company_id', '=', 'm_company.id')\n ->whereIn('m_company.id', $param['company'])\n ->where('m_company.del_flag', Constant::DELETE_FLAG_FALSE);\n } else {\n $join->on('m_ship.company_id', '=', 'm_company.id')\n ->where('m_company.del_flag', Constant::DELETE_FLAG_FALSE);\n }\n })\n ->join('m_nation', function($join) {\n $join->on('m_ship.nation_id', '=', 'm_nation.id')\n ->where('m_nation.del_flag', Constant::DELETE_FLAG_FALSE);\n })\n ->join('m_currency', function($join) {\n $join->on('m_company.currency_id', '=', 'm_currency.id')\n ->where('m_company.del_flag', Constant::DELETE_FLAG_FALSE);\n })\n ->join('m_ship_classification', function($join) {\n $join->on('m_ship.classification_id', '=', 'm_ship_classification.id')\n ->where('m_ship_classification.del_flag', Constant::DELETE_FLAG_FALSE);\n })\n ->join('m_ship_type', function($join) {\n $join->on('m_ship.type_id', '=', 'm_ship_type.id')\n ->where('m_ship_type.del_flag', Constant::DELETE_FLAG_FALSE);\n })\n ->select([\n \"m_ship.id as ship_id\",\n \"m_ship.name as ship_name\",\n \"m_ship.imo_number as ship_imo_number\",\n \"m_ship.mmsi_number as ship_mmsi_number\",\n \"m_ship.register_number as ship_register_number\",\n \"m_ship.width as ship_width\",\n \"m_ship.height as ship_height\",\n \"m_ship.water_draft as ship_water_draft\",\n \"m_ship.total_weight_ton as ship_total_weight_ton\",\n \"m_ship.total_ton as ship_weight_ton\",\n \"m_ship.member_number as ship_member_number\",\n \"m_ship.remark as ship_remark\",\n \"m_ship.url_1 as ship_url_1\",\n \"m_ship.url_2 as ship_url_2\",\n \"m_ship.url_3 as ship_url_3\",\n \"m_company.id as company_id\",\n \"m_company.name_jp as company_name\",\n \"m_nation.name_jp as nation_name\",\n \"m_ship_classification.name_jp as ship_classify\",\n \"m_ship_type.type as ship_type\",\n DB::raw('(select count(m_ship_s.id) from m_ship m_ship_s where m_ship_s.company_id=m_ship.company_id) as total_ship')\n ])\n ->where('m_ship.del_flag', Constant::DELETE_FLAG_FALSE);\n\n if (empty($idShip) || is_null($idShip)) {\n return $queryShip->get();\n }\n\n return $queryShip->where([\n 'm_ship.id' => $idShip\n ])\n ->first();\n }", "public function filterByExchangeId($value, $operator = Rule::OP_EQ)\n\t{\n\t\treturn $this->filterBy('exchange_id', $value, $operator);\n\t}", "public function filterByShipdate($shipdate = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($shipdate)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(OrdrhedTableMap::COL_SHIPDATE, $shipdate, $comparison);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(SalesPeer::REFNO, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(AliStockcardSTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\r\n\t{\r\n\t\treturn $this->addUsingAlias(FlightPeer::ID, $key, Criteria::EQUAL);\r\n\t}", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(CustomerPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function setShipFromAddress($value) \n {\n $this->_fields['ShipFromAddress']['FieldValue'] = $value;\n return;\n }", "public function addCanShipFilter()\n {\n $orderItemTable = $this->getTable('sales_order_item');\n $pickupLocationTable = $this->getTable(SetupSchema::TABLE_ORDER_PICKUP_LOCATION);\n\n $select = $this->getSelect();\n $select->join(\n ['order_item' => $orderItemTable],\n 'main_table.entity_id = order_item.order_id',\n []\n );\n $select->joinLeft(\n ['pickup_location' => $pickupLocationTable],\n 'main_table.shipping_address_id = pickup_location.recipient_address_id',\n []\n );\n\n $this->addFieldToFilter(sprintf('main_table.%s', OrderInterface::IS_VIRTUAL), 0);\n $this->addFieldToFilter(OrderInterface::STATE, ['nin' => [\n \\Magento\\Sales\\Model\\Order::STATE_HOLDED,\n \\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW,\n \\Magento\\Sales\\Model\\Order::STATE_CANCELED,\n ]]);\n\n $this->addExpressionFieldToSelect(\n 'qty_to_ship',\n 'FLOOR(SUM({{qty_ordered}}) - SUM({{qty_shipped}}))',\n [\n 'qty_ordered' => 'order_item.qty_ordered',\n 'qty_shipped' => 'order_item.qty_shipped',\n ]\n );\n $this->addExpressionFieldToSelect(\n 'locked',\n 'SUM(COALESCE(locked_do_ship, 0))',\n [\n 'qty_ordered' => 'order_item.qty_ordered',\n 'qty_shipped' => 'order_item.qty_shipped',\n ]\n );\n\n $select->group(['main_table.entity_id']);\n $select->having('qty_to_ship > 0 AND locked = 0');\n $select->where('pickup_location.pickup_location_id IS NULL');\n }", "public function filterByCustidShiptoid($custID, $shiptoID = '') {\n\t\t$this->filterByCustid($custID);\n\t\tif ($shiptoID) {\n\t\t\t$this->filterByShiptoid($shiptoID);\n\t\t}\n\t\treturn $this;\n\t}", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(FormsPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function actionStatusfilter($status_id)\n {\n \t\n \t$searchModel = new OrdersSearch();\n \t/*$dataProvider = ([\n \t\t\t'query' => $query,\n \t]);*/\n \t\n \t//$searchModel->order_status_id = '1';\n \t\n $dataProvider = $searchModel->searchstatus(Yii::$app->request->queryParams, $status_id);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n \t//return $this->redirect(Yii::$app->request->referrer);\n }" ]
[ "0.67753357", "0.5779572", "0.5667653", "0.54893154", "0.53205717", "0.51962787", "0.5101293", "0.5099663", "0.50484467", "0.49425983", "0.49149567", "0.48871619", "0.48282966", "0.4773577", "0.47557667", "0.47355264", "0.47147644", "0.46879587", "0.46816164", "0.46815112", "0.46779713", "0.4659892", "0.4649928", "0.46440023", "0.4643903", "0.46408817", "0.46389043", "0.46375918", "0.46311787", "0.46265632" ]
0.65967935
1
Filter the query on the nsitemgroup column Example usage: $query>filterByNsitemgroup('fooValue'); // WHERE nsitemgroup = 'fooValue' $query>filterByNsitemgroup('%fooValue%', Criteria::LIKE); // WHERE nsitemgroup LIKE '%fooValue%'
public function filterByNsitemgroup($nsitemgroup = null, $comparison = null) { if (null === $comparison) { if (is_array($nsitemgroup)) { $comparison = Criteria::IN; } } return $this->addUsingAlias(PricingTableMap::COL_NSITEMGROUP, $nsitemgroup, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addGroupFilter($groupName)\n\t{\n\t\t$gid = GRP_getIdByName($groupName);\n\n\t\tif (is_numeric($gid))\n\t\t{\n\t\t\t$this->groupWHERE = \"clients.id=clientgroups.clientid AND clientgroups.groupid=$gid\";\n\t\t\t$this->groupFROM = ', clientgroups';\n\t\t}\n\t}", "public function filterByGroup($group, $comparison = Criteria::EQUAL)\n {\n return $this\n ->useGroupVictimsQuery()\n ->filterByGroup($group, $comparison)\n ->endUse();\n }", "public function buildGroupMembersFilter($groupName) {\n\t\tif (is_array($groupName)) {\n\t\t\t$groupName = $this->getGroupName($groupName);\n\t\t}\n\n\t\tif (!$this->groupExists($groupName)) {\n\t\t\tthrow new NotFoundException(__('LDAP group %s which you\\'re trying to use does not exists', $groupName));\n\t\t}\n\n\t\t// escape user input\n\t\t$groupName = $this->escape($groupName);\n\n\t\t// build the filter ldap query\n\t\t$filter = $this->_config['ldap_groupmemberlist_filter'];\n\t\t$filter = str_replace(\"%GROUP%\", $groupName, $filter);\n\n\t\treturn $filter;\n\t}", "function ItemDataSGroups($group=\"Basic\",$key=\"\",$value=\"\")\n {\n if (empty($this->ItemDataGroups))\n {\n $this->MyMod_Data_Groups_Initialize();\n }\n\n return $this->MyHash_HashHashes_Get($this->ItemDataSGroups,$group,$key);\n }", "function gmw_ps_filter_bp_groups_query( $query_args, $gmw ) {\n\n /****** keywords ******/\n if ( ! empty( $gmw['form_values']['keywords'] ) ) {\n $query_args['search_terms'] = $gmw['form_values']['keywords'];\n }\n\n /****** Orderby ******/\n $orderby = gmw_ps_get_orderby_value( $gmw );\n\n // abort if no value found\n if ( '' != $orderby ) {\n $query_args['type'] = $orderby;\n }\n\n /****** Group Types *****/\n $output = gmw_ps_bp_get_object_types_query( $gmw, 'group', 'bpgt' );\n\t\n\tif ( false != $output['usage'] ) {\n\t\t$query_args[ $output['usage'] ] = $output['types'];\n\t}\n\n return $query_args;\n}", "public function getGroupSearch($group)\n {\n $group = $this->_db->query(\"select * from my_groups, my_status where `group` like '%$group%' and my_status.id_status = my_groups.id_status\");\n return $group->fetchall();\n }", "public function whereGroup($group, $group_connector = 'and')\n {\n\n }", "public function scopeInGroup($query, $group)\n {\n $groupColumn = (array) $this->getGroupColumn();\n $group = is_null($group) ? [ null ] : array_values((array) $group);\n foreach ($group as $i => $value) {\n $query->where($groupColumn[$i], $value);\n }\n }", "public function group($group = []) {\n\t\t$this->_queryOptions['group'] = array_merge($this->_queryOptions['group'], $group);\n\t}", "protected function getGroupWhere()\n\t{\n\t\t$ar = $this->getOwner();\n\n\t\t$where = '';\n\t\tif (!is_array($this->groupDetect)) $this->groupDetect = array($this->groupDetect);\n\n\t\tforeach ($this->groupDetect as $fieldName) {\n\t\t\tassert('is_string($fieldName)');\n\n\t\t\t$value = $ar->$fieldName;\n\n\t\t\tif (is_null($value)) {\n\t\t\t\t$where[] = \"({$fieldName} IS NULL)\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$where[] = sprintf(\"{$fieldName} = '%s'\", addslashes($value));\n\t\t}\n\n\t\treturn '(' . implode(' AND ', $where) . ')';\n\t}", "function cacsp_filter_query_for_bp_group( $query ) {\n\t// Only modify 'event' queries.\n\t$post_types = $query->get( 'post_type' );\n\tif ( ! in_array( 'cacsp_paper', (array) $post_types ) ) {\n\t\treturn;\n\t}\n\n\t$bp_group = $query->get( 'bp_group', null );\n\tif ( null === $bp_group ) {\n\t\treturn;\n\t}\n\n\tif ( ! is_array( $bp_group ) ) {\n\t\t$group_ids = array( $bp_group );\n\t} else {\n\t\t$group_ids = $bp_group;\n\t}\n\n\t// Empty array will always return no results.\n\tif ( empty( $group_ids ) ) {\n\t\t$query->set( 'post__in', array( 0 ) );\n\t\treturn;\n\t}\n\n\t// Convert group IDs to a tax query.\n\t$tq = $query->get( 'tax_query' );\n\t$group_terms = array();\n\tforeach ( $group_ids as $group_id ) {\n\t\t$group_terms[] = 'group_' . $group_id;\n\t}\n\n\t$tq[] = array(\n\t\t'taxonomy' => 'cacsp_paper_group',\n\t\t'terms' => $group_terms,\n\t\t'field' => 'name',\n\t\t'operator' => 'IN',\n\t);\n\n\t$query->set( 'tax_query', $tq );\n}", "function ItemDataGroups($group=\"Basic\",$key=\"\",$value=\"\")\n {\n if (empty($this->ItemDataGroups))\n {\n $this->MyMod_Data_Groups_Initialize();\n }\n\n return $this->MyHash_HashHashes_Get($this->ItemDataGroups,$group,$key);\n }", "public function hook_group()\n {\n add_filter(RP_WCDPD::get_items_filter_prefix($this->context) . $this->item_key . '_groups', array($this, 'register_group'), $this->group_position);\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('group.name', $this->group_name, true);\n\t\t$criteria->compare('t.name',$this->name,true);\n\t\tif (!empty($this->group_name) && strpos('общая', strtolower($this->group_name)) !== false) {\n\t\t\t$criteria->compare('common',1,false,'OR');\n\t\t}\n\t\t$criteria->compare('t.name',$this->name,true);\n\t\t$criteria->compare('number',$this->number,true);\n\t\t$criteria->compare('addition',$this->addition,true);\n\t\t$criteria->compare('timeout',$this->timeout);\n\t\t$criteria->compare('prefix',$this->prefix);\n\t\t$criteria->with = array('group');\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'pagination' => array(\n\t\t\t\t'pageSize' => 100,\n\t\t\t),\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function filterByGroupId($groupId = null, $comparison = null)\n {\n if (is_array($groupId)) {\n $useMinMax = false;\n if (isset($groupId['min'])) {\n $this->addUsingAlias(AliProductTableMap::COL_GROUP_ID, $groupId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($groupId['max'])) {\n $this->addUsingAlias(AliProductTableMap::COL_GROUP_ID, $groupId['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AliProductTableMap::COL_GROUP_ID, $groupId, $comparison);\n }", "public function filterByGroup($id)\n {\n $oGateway = $this->getGateway();\n $sAlias = $this->getDefaultAlias();\n if(false === empty($sAlias)) {\n $sAlias = $sAlias .'.';\n }\n \n $paramType = $oGateway->getMetaData()->getColumn('voucher_group_id')->getType();\n \n return $this->andWhere($sAlias.\"voucher_group_id = \".$this->createNamedParameter($id,$paramType));\n \n }", "public function searchgroupsAction() {\n if ($this->getRequest()->isPost()) {\n $groupName = $_POST['searchTerm'];\n\n $groups = $this->_helper->db->getTable('InciteGroup')->findGroupByPartialName($groupName);\n $groups_arr = array();\n foreach ((array) $groups as $group) {\n $groups_arr[] = array('id' => $group->id, 'name' => $group->name);\n }\n\n echo json_encode($groups_arr);\n }\n }", "public function getgroupsAction()\n {\n $this->checkAjaxToken();\n $result = array();\n // FIXME SECURITY check this\n if (SecurityUtil::checkPermission('Groups::', 'ANY', ACCESS_OVERVIEW)) {\n $args = array('keyword' => $this->request->getPost()->get('keyword'), 'op' => $this->request->getPost()->get('op', 'likefirst'));\n $args['op'] = in_array($args['op'], array('search', 'likefirst')) ? $args['op'] : 'likefirst';\n $tables = DBUtil::getTables();\n $grpColumn = $tables['groups_column'];\n $value = DataUtil::formatForStore($args['keyword']);\n // check matches in the database\n switch ($args['op']) {\n case 'search':\n $value = '%' . $value;\n case 'likefirst':\n $value .= '%';\n $value = \"'{$value}'\";\n break;\n }\n $where = 'WHERE ' . $grpColumn['name'] . ' LIKE ' . $value;\n $results = DBUtil::selectFieldArray('groups', 'name', $where, $grpColumn['name'], false, 'gid');\n foreach ($results as $gid => $gname) {\n $result[] = array('value' => $gid, 'caption' => DataUtil::formatForDisplay($gname));\n }\n }\n return new Zikula_Response_Ajax_Json(array('data' => $result));\n }", "public function filterGroupflag($groupflag = null)\n {\n $this->_group_filter = $groupflag;\n }", "public function findGroupItems() {\n\t\t\t$group = new \\Product\\Group();\n\t\t\tif (!$group->get($_REQUEST['code'])) $this->error(\"Product Group Not Found\");\n\t\t\tif ($group->error()) $this->error(\"Error finding group: \".$group->error());\n\t\t\tif (! $group->id) $this->error(\"Group not found\");\n\n\t\t\t$items = $group->items();\n\t\t\tif ($group->error()) $this->error(\"Error finding items: \".$group->error());\n\t\n\t\t\t$response = new \\HTTP\\Response();\n\t\t\t$response->success = 1;\n\t\t\t$response->item = $items;\n\n\t\t\tprint $this->formatOutput($response);\n\t\t}", "public function group(string $group);", "function openlucius_core_get_all_nodes_in_group($group_nid, $keyed = FALSE) {\n // Get all node ids that have the shared_group_reference $group_nid.\n $query = db_select('field_data_field_shared_group_reference', 'g')\n ->fields('g', array('entity_id'))\n ->condition('g.field_shared_group_reference_nid', $group_nid, '=')\n ->execute();\n\n // Return the query results.\n return $keyed ? $query->fetchAllKeyed(0, 0) : $query->fetchCol();\n}", "private function processGlobalSetGroup($group) {\n\t\t$criteria = new GlobalSetQuery('craft\\elements\\GlobalSet');\n\t\t$criteria->id = $group;\n\t\t$elements = $criteria->all();\n\n\t\t$results = [];\n\t\tforeach ($elements as $element) {\n\t\t\t$results[] = [\n\t\t\t\t'id' => $element->id,\n\t\t\t\t'icon' => '@vendor/craftcms/cms/src/icons/globe.svg',\n\t\t\t\t'title' => $element->name,\n\t\t\t\t'url' => $element->cpEditUrl,\n\t\t\t];\n\t\t}\n\t\treturn $results;\n\t}", "function fnGroup($group) {\n\tif($group != '') {\n\t\tif(preg_match('/^\\s*?GROUP BY.*$/',$group)){\n\t\t\t$strGroup = \" \".$group;\n\t\t} else {\n\t\t\t$strGroup = \" GROUP BY \".$group;\n\t\t}\n\t\treturn $strGroup;\n\t} else {\n\t\treturn;\n\t}\n}", "public function filterByAdjustmentGroup($sGUID)\n {\n $oGateway = $this->getGateway();\n $sAlias = $this->getDefaultAlias();\n if(false === empty($sAlias)) {\n $sAlias = $sAlias .'.';\n }\n \n $paramType = $oGateway->getMetaData()->getColumn('rule_group_id')->getType();\n \n return $this->andWhere($sAlias.\"rule_group_id = \".$this->createNamedParameter($sGUID,$paramType));\n \n }", "public function _add_simple_group_filter()\n\t{\n\t\t//check for the \"sgid\" get parameter\n\t\tif (isset($_GET['sgid']) AND !is_array($_GET['sgid']) AND intval($_GET['sgid']) >= 0)\n\t\t{\n\t\t\t//get the table prefix\n\t\t\t$table_prefix = Kohana::config('database.default.table_prefix');\n\t\t\t\n\t\t\t//get the params\n\t\t\t$sg_id = intval($_GET['sgid']);\n\t\t\t$params = Event::$data;\n\t\t\tarray_push($params,\t'i.id IN (SELECT DISTINCT incident_id FROM '.$table_prefix.'simplegroups_groups_incident WHERE simplegroups_groups_id = '. $sg_id. ')');\n\t\t\t\n\t\t\t//figure out if we're on the backend or not, and if we're not hide private categories\n\t\t\t$only_public = (strpos(url::current(), \"admin/\") === 0) ? \"\" : \" AND sgc.category_visible = 1 \"; \n\t\t\t\n\t\t\t$category_ids = $this->_get_group_categories();\t\t\t\n\t\t\t// Check if there are any category ids\n\t\t\tif (count($category_ids) > 0)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t//what's the logical operator:\n\t\t\t\tif($this->_get_logical_operator() == \"or\")\n\t\t\t\t{\n\t\t\t\t\t//first we need to find out what the original SQL for categories looked like:\n\t\t\t\t\t$category_sql = $this->_create_default_category_sql();\n\t\t\t\t\t$i = 0;\n\t\t\t\t\t$found_it = false;\n\t\t\t\t\tforeach($params as $key=>$value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(strcmp($value, $category_sql) == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$i = $key;\n\t\t\t\t\t\t\t$found_it = true;\n\t\t\t\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\t//if we found it, lets remove it.\n\t\t\t\t\tif($found_it)\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($params[$i]);\n\t\t\t\t\t}\n\t\t\t\t\tif(strlen($category_sql) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$category_sql = ' OR ('.$category_sql.')' ;\n\t\t\t\t\t}\n\t\t\t\t\t$category_ids = implode(\",\", $category_ids);\n\t\t\t\t\tarray_push($params,\n\t\t\t\t\t\t'(i.id IN (SELECT DISTINCT incident_id FROM '.$table_prefix.'simplegroups_incident_category sgic '.\n\t\t\t\t\t\t\t'INNER JOIN '.$table_prefix.'simplegroups_category sgc ON (sgc.id = sgic.simplegroups_category_id) '.\n\t\t\t\t\t\t\t'WHERE (sgc.id IN ('. $category_ids . ') OR sgc.parent_id IN ('.$category_ids.'))'.$only_public.' ) '.$category_sql. ')');\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tforeach($category_ids as $c)\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($params,\n\t\t\t\t\t\t'i.id IN (SELECT DISTINCT incident_id FROM '.$table_prefix.'simplegroups_incident_category sgic '.\n\t\t\t\t\t\t\t'INNER JOIN '.$table_prefix.'simplegroups_category sgc ON (sgc.id = sgic.simplegroups_category_id) '.\n\t\t\t\t\t\t\t'WHERE ((sgc.id = '. $c . ') OR sgc.parent_id = (' . $c . '))'.$only_public.' ) ');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tEvent::$data = $params;\n\t\t}\n\t}", "public function group($group);", "public function filterByForumOfGroup($forumOfGroup = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($forumOfGroup)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $forumOfGroup)) {\n\t\t\t\t$forumOfGroup = str_replace('*', '%', $forumOfGroup);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(ForumForumPeer::FORUM_OF_GROUP, $forumOfGroup, $comparison);\n\t}", "public function checkGroup()\n {\n if (strpos($this->query, 'GROUP')) {\n return true;\n }\n\n return $this->query = $this->query . \" GROUP BY user.id\";\n }", "public function addGroupQuery($value) {}" ]
[ "0.552336", "0.5436663", "0.54020983", "0.5335206", "0.52751255", "0.5267214", "0.52096915", "0.5185109", "0.5171222", "0.51559055", "0.511631", "0.51079124", "0.5076993", "0.50066125", "0.5001172", "0.49943462", "0.49874765", "0.4983453", "0.49808517", "0.4978032", "0.49547216", "0.49421462", "0.4939689", "0.49356487", "0.4934506", "0.4928983", "0.49156028", "0.4914504", "0.48855978", "0.48788083" ]
0.6967799
0
End of function / ================================================================================== PRODUCT REPORT DETAILS ================================================================================== / get data
public function product_report_details(){ $id = $_REQUEST[ 'id' ]; $this -> db -> select('sum(si.currentstock) as currentstock, ip.id as pid, ip.itemcode, ip.itemimage, ip.itemname, ip.sellprice, ii.createdby, ii.created_at, sti.storename, sta.statustitle '); $this -> db -> from('item_parent as ip'); $this -> db -> join('item_info as ii', 'ip.id = ii.parentid', 'left'); $this -> db -> join('stock_info as si', 'ii.id = si.itemid', 'left'); $this -> db -> join('store_info as sti', 'ii.store = sti.id', 'left'); $this -> db -> join('status_info as sta', 'ip.status = sta.id'); $this -> db -> where('itemcode = "'.$id.'"'); $query = $this->db->get(); if ($query->num_rows() > 0) { foreach ($query->result() as $row) { $this -> db -> select('sizeshortcode, currentstock'); $this -> db -> from('item_info as ii'); $this -> db -> join('size_info as siz', 'siz.id = ii.size'); $this -> db -> join('stock_info as si', 'ii.id = si.itemid'); $this -> db -> where('ii.parentid', $row->pid); $query1 = $this->db->get(); $data1 = array( 'currentstock' => $row->currentstock, 'itemcode' => $row->itemcode, 'itemimage' => $row->itemimage, 'itemname' => $row->itemname, 'sellprice' => $row->sellprice, 'createdby' => $row->createdby, 'created_at' => $row->created_at, 'storename' => $row->storename, 'statustitle' => $row->statustitle, 'stock_info' => $query1->result() ); $data[] = $data1; } return $data; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function index_product_details($data) {\n $register = $this->xml_select->IndexPage->selectproducthome;\n $result = $this->mysqli->query($register);\n if ($result->num_rows) {\n while ($row = $result->fetch_assoc()) {\n $products[] = $row;\n }\n }\n return $products;\n }", "public function product_report_details() {\n\t\t$dataarr = array();\n\t\t$metadata = array();\n\t\t$metadata = $this->M_common->session_info();\n\t\t$metadata[\"title\"] \t\t= 'Product Report Details :: Metro Lifestyle';\n\t\t$dataarr['metadata'] \t= $metadata;\n\n\t\t$dataarr['productreportdetails'] = $this->M_product->product_report_details();\n\t\t$this->load->view( 'admin/products/reports/report-details', $dataarr );\n\t}", "function getData() {\t\t\n\t\tif(isset($_SESSION['pharmacyId'])) {\n\t\t\t$productModel = new ProductModel();\n\t\t\t$content = $productModel->grabAll($_SESSION['pharmacyId']);\n\t\t\t$data['products'] = $content;\n\t\t\t$data['counter'] = sizeof($content);\n\t\t\treturn $data;\n\t\t}\n\t}", "private function _data(){\n\t\t$email = $this->user_email = $this->session->userdata('EMAIL');\n\t\t$email = '[email protected]';\n\t\t$this->load->model('invoice/ec_bapp','bapp');\n\t\treturn $this->bapp->fields('EC_BAPP.ID,NO_PO,PO_ITEM,SHORT_TEXT,CREATE_AT,VND_HEADER.VENDOR_NAME')->as_array()->get_all_with_vendor(array('EC_BAPP.EMAIL' => $email , 'EC_BAPP.STATUS' => '2'));\n\t}", "function productDetail()\n\t{\n\t\t$this->lastViewedProducts($_GET['prodid']);\n\t\t$_SESSION['prodid']=$_GET['prodid'];\n\t\t$sql=\"SELECT quantity,msrp FROM msrp_by_quantity_table WHERE product_id =\".(int)$_GET['prodid'];\n\t\t$pquery = new Bin_Query();\n\t\tif($pquery->executeQuery($sql))\n\t\t{\t\t\n\t\t\t$flag = $pquery->totrows;\n\t\t\t\n\t\t}\n\t\tif($flag==0)\n\t\t{\n\t\t\t\n\t\t\t$sql= \"SELECT * FROM product_inventory_table a \n\t\t\tINNER JOIN products_table b ON a.product_id = b.product_id\n\t\t\tWHERE b.product_id =\".(int)$_GET['prodid'];\n\t\t\n\t\t\t$query = new Bin_Query();\n\t\t\t$rating=$this->reviewRating();\n\t\t\t$reviewcount=$this->reviewCount();\n\t\t\t$count=$reviewcount[0]['review'];\n\t\t\t\n\t\t\tif($query->executeQuery($sql))\n\t\t\t{\t\t\n\t\t\t\treturn Display_DProductDetail::productDetail($query->records,$rating,$count);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \"Products Not Available in Stock\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t$sql=\"SELECT b.product_id,b.title,b.cse_enabled,b.price as oprice,b.msrp,c.msrp as\n\t\t\tprice,c.quantity,b.description,b.sku,b.tag,b.brand,b.weight,b.dimension,b.image,b.model,a.soh,b.meta_desc,b.meta_keywords \n\t\t\tFROM product_inventory_table a\n\t\t\tINNER JOIN products_table b ON a.product_id = b.product_id \n\t\t\tINNER JOIN msrp_by_quantity_table c ON b.product_id=c.product_id WHERE c.product_id =\".(int)$_GET['prodid'];\n\t\t\t$query = new Bin_Query();\n\t\t\t$rating=$this->reviewRating();\n\t\t\t$reviewcount=$this->reviewCount();\n\t\t\t\n\t\t\tif($query->executeQuery($sql))\n\t\t\t{\t\t\n\t\t\t\treturn Display_DProductDetail::productDetail($query->records,$rating,$reviewCount);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \"Not Found\";\n\t\t\t}\n\t\t}\n\n\t\t\n\t}", "public function getDetails() {\n\n\t\tglobal $details;\n\t\t\n\t\t// query string\n\t\t$fields = array(\n\t\t\t'key' => '2015201520159',\n\t\t\t'out' => 'json',\n\t\t);\n\t\t\n\t\t$details = 'http://atlas.atdw.com.au/productsearchservice.svc/product?' . http_build_query($fields);\n\t}", "function getProductDetail()\r\n{\r\n\tglobal $DB, $objComm;\r\n\t$SQL = $SQL=\"SELECT \r\n\t\tproduct_type.product_type,\r\n\t\tproduct_type.id\tAS ptID,\t\r\n\t\tproduct.id AS pID,\r\n\t\tproduct.product_type_id,\r\n\t\tproduct.product_name,\r\n\t\tproduct.product_image,\r\n\t\tproduct.product_price,\r\n\t\tproduct.product_variations,\r\n\t\tproduct.product_size,\r\n\t\tproduct.product_color,\r\n\t\tSUBSTRING(product.product_desc,1,50) AS product_desc,\r\n\t\tDATE(product.product_date) AS product_date,\r\n\t\tproduct.product_status,\r\n\t\tproduct.product_total_products,\r\n\t\tproduct.product_remain_total_products\r\n\t\tFROM product_type \r\n\t\tJOIN product ON product_type.id=product.product_type_id\r\n\t\tWHERE product_status='Active' AND product.id='\".$_REQUEST[\"id\"].\"' AND product.product_remain_total_products > 0 ORDER BY product_type.id ASC\";\r\n\r\n\t\t$DATAproduct=$DB->fetchOne($SQL,\"\");\r\n\t\t$DATAproduct->status=\"OK\";$DATAproduct->msg=\"WELL DONE\";\r\n\techo json_encode($DATAproduct);\r\n}", "public function productsdetails_get()\n\n {\n\n // $token = $_SERVER['HTTP_TOKEN'];\n\n $p_id = $this->input->get('p_id');\n\n $pf_id = $this->input->get('pf_id');\n\n $data = array(\n\n 'status' => 0,\n\n 'code' => -1,\n\n 'msg' => 'Bad Request',\n\n 'data' => null\n\n );\n\n $getProductDetails = $this->Api_model->getProductDetails($p_id,$pf_id);\n\n if (isset($getProductDetails)) {\n\n $data = array(\n\n 'status' => 1,\n\n 'code' => 1,\n\n 'msg' => 'success',\n\n 'data' => $getProductDetails\n\n );\n\n }else{\n\n $data = array(\n\n 'status' => 1,\n\n 'code' => 1,\n\n 'msg' => 'success',\n\n 'data' => null\n\n );\n\n }\n\n $this->response($data, REST_Controller::HTTP_OK);\n\n }", "public function getDetails( ) {\n\t\t\n\t\treturn $this->db->get_row( \n\t\t\t$this->db->prepare( \"SELECT * FROM `{$this->products}` WHERE `productId` = '%d'\", $this->id ) \n\t\t);\n\t}", "public function product_reports() {\n\t\t$dataarr = array();\n\t\t$metadata = array();\n\t\t$metadata = $this->M_common->session_info();\n\t\t$metadata[\"title\"] \t\t= 'Product Reports :: Metro Lifestyle';\n\t\t$dataarr['metadata'] \t= $metadata;\n\n\t\t$dataarr['productreports'] = $this->M_product->product_reports();\n\t\t$this->load->view( 'admin/products/reports/view-reports', $dataarr );\n\t}", "public function getDataDetail() {\n\t\tif (! is_array ( $this->document_data_detail ) || count ( $this->document_data_detail ) < 1) {\n\t\t\t$data_id = $this->getDocumentDataID ();\n\t\t\t$type_id = $this->getDocumentTypeID ();\n\t\t\t$rawdata = array ();\n\t\t\t$QDataDetail = $this->getDatabase ();\n\t\t\t$QDataDetail->select ();\n\t\t\t$QDataDetail->columns ( array (\n\t\t\t\t\t'document_data_detail_id',\n\t\t\t\t\t'system_language_id',\n\t\t\t\t\t'document_data_detail_title',\n\t\t\t\t\t'document_data_detail_information',\n\t\t\t\t\t'document_data_detail_created_date',\n\t\t\t\t\t'document_data_detail_created_by',\n\t\t\t\t\t'document_data_detail_modified_date',\n\t\t\t\t\t'document_data_detail_modified_by' \n\t\t\t) );\n\t\t\t$QDataDetail->from ( array (\n\t\t\t\t\t'cdd' => 'document_data_detail' \n\t\t\t) );\n\t\t\t$QDataDetail->where ( array (\n\t\t\t\t\t'cdd.document_data_id' => $data_id,\n\t\t\t\t\t'cdd.document_data_detail_delete_status' => '0' \n\t\t\t) );\n\t\t\t$QDataDetail->execute ();\n\t\t\tif ($QDataDetail->hasResult ()) {\n\t\t\t\twhile ( $QDataDetail->valid () ) {\n\t\t\t\t\t$rawdata = $QDataDetail->current ();\n\t\t\t\t\t\n\t\t\t\t\t$rawdata ['document_data_detail_created_date_format'] = \"\";\n\t\t\t\t\tif ($rawdata ['document_data_detail_created_date'] !== \"0000-00-00 00:00:00\") {\n\t\t\t\t\t\t$datetime = new \\DateTime ( $rawdata ['document_data_detail_created_date'] );\n\t\t\t\t\t\t$rawdata ['document_data_detail_created_date_format'] = $datetime->format ( 'H:i:s d-F-Y' );\n\t\t\t\t\t}\n\t\t\t\t\t$rawdata ['document_data_detail_modified_date_format'] = \"\";\n\t\t\t\t\tif ($rawdata ['document_data_detail_modified_date'] !== \"0000-00-00 00:00:00\") {\n\t\t\t\t\t\t$datetime = new \\DateTime ( $rawdata ['document_data_detail_modified_date'] );\n\t\t\t\t\t\t$rawdata ['document_data_detail_modified_date_format'] = $datetime->format ( 'H:i:s d-F-Y' );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$cryptID = $this->Encrypt ( $rawdata ['document_data_detail_id'] );\n\t\t\t\t\t$rawdata ['document_data_detail_id_modify'] = $cryptID;\n\t\t\t\t\t\n\t\t\t\t\t$this->document_data_detail [$rawdata ['system_language_id']] = $rawdata;\n\t\t\t\t\t$QDataDetail->next ();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->document_data_detail;\n\t}", "protected function fetchData()\n {\n\n //Admin order details\n return $this->i->grabMultiple(Locator::firstElement('//table/tbody/tr')); \n }", "public function getProductData(Mage_Catalog_Model_Product $product)\n {\n try {\n\t\t\tif($product->getMsrpEnabled()==1){\n\t\t\t\t$price = \"\";\n\t\t\t}else if($product->getFinalPrice() < $product->getPrice()){\n\t\t\t\t$price = $product->getFinalPrice()*100;\n\t\t\t}else{\n\t\t\t\t$price = $product->getPrice()*100;\n\t\t\t} \t\n $data = array('url' => str_replace('index.php/','',str_replace('admin.','www.', $product->getProductUrl())),\n 'title' => htmlspecialchars($product->getName()),\n //'date' => '',\n 'key' => 'url',\n 'keys' => array('sku' => $product->getSku()),\n 'spider' => 1,\n 'price' => $price,\n 'description' => strip_tags($product->getDescription()),\n 'tags' => htmlspecialchars($this->getProductMetaKeyword($product->getId())),\n 'inventory' => $product->getStockItem() ? $product->getStockItem()->getStockQty() : 0,\n 'images' => array(),\n 'vars' => array('sku' => $product->getSku(),\n 'storeId' => '',\n 'typeId' => $product->getTypeId(),\n 'status' => $product->getStatus(),\n 'categoryId' => $product->getCategoryId(),\n 'categoryIds' => $product->getCategoryIds(),\n 'websiteIds' => $product->getWebsiteIds(),\n 'storeIds' => $product->getStoreIds(),\n //'attributes' => $product->getAttributes(),\n 'groupPrice' => $product->getGroupPrice(),\n 'formatedPrice' => $product->getFormatedPrice(),\n 'calculatedFinalPrice' => $product->getCalculatedFinalPrice(),\n 'minimalPrice' => $product->getMinimalPrice(),\n 'specialPrice' => $product->getSpecialPrice(),\n 'specialFromDate' => $product->getSpecialFromDate(),\n 'specialToDate' => $product->getSpecialToDate(),\n 'relatedProductIds' => $product->getRelatedProductIds(),\n 'upSellProductIds' => $product->getUpSellProductIds(),\n 'getCrossSellProductIds' => $product->getCrossSellProductIds(),\n 'isSuperGroup' => $product->isSuperGroup(),\n 'isGrouped' => $product->isGrouped(),\n 'isConfigurable' => $product->isConfigurable(),\n 'isSuper' => $product->isSuper(),\n 'isSalable' => $product->isSalable(),\n 'isAvailable' => $product->isAvailable(),\n 'isVirtual' => $product->isVirtual(),\n 'isRecurring' => $product->isRecurring(),\n 'isInStock' => $product->isInStock(),\n 'weight' => $product->getSku()\n )\n );\n\n // Add product images\n /* if(self::validateProductImage($product->getImage())) {\n $data['images']['full'] = array (\"url\" => $product->getImageUrl());\n }\n\n if(self::validateProductImage($product->getSmallImage())) {\n $data['images']['smallImage'] = array(\"url\" => $product->getSmallImageUrl($width = 88, $height = 77));\n }\n\n if(self::validateProductImage($product->getThumbnail())) {\n $data['images']['thumb'] = array(\"url\" => $product->getThumbnailUrl($width = 75, $height = 75));\n }*/\n if(self::validateProductImage($product->getImage())) {\n\t\t $pImage = $product->getImage();\n\t\t $pImageUrl = \"\";\n\t\t $pImageUrl = Mage::helper('sailthruemail')->getSailthruProductImage($pImage);\n\t\t if(empty($pImageUrl)){\n\t\t $pImageUrl = $product->getImageUrl();\n\t\t }\t\t \n $data['images']['full'] = array (\"url\" => str_replace('admin.','www.',$pImageUrl));\n }\n\n if(self::validateProductImage($product->getSmallImage())) {\n\t\t $pSmallImage \t= $product->getSmallImage();\n\t\t $pSmallImageUrl \t= \"\";\n\t\t $pSmallImageUrl = Mage::helper('sailthruemail')->getSailthruProductImage($pSmallImage,'300x300');\n\t\t if(empty($pSmallImageUrl)){\n\t\t $pSmallImageUrl= $product->getSmallImageUrl($width = 300, $height = 300);\n\t\t }\t\t \n $data['images']['smallImage'] = array(\"url\" => str_replace('admin.','www.',$pSmallImageUrl));\n }\n\n if(self::validateProductImage($product->getThumbnail())) {\n\t\t $pThumbnail \t= $product->getThumbnail();\n\t\t $pThumbnailUrl \t\t= \"\";\n\t\t $pThumbnailUrl \t= Mage::helper('sailthruemail')->getSailthruProductImage($pThumbnail,'300x300'); \t\n\t\t if(empty($pThumbnailUrl)){\n\t\t $pThumbnailUrl = $product->getThumbnailUrl($width = 300, $height = 300);\n\t\t } \t\n $data['images']['thumb'] = array(\"url\" => str_replace('admin.','www.',$pThumbnailUrl));\n }\n\n return $data;\n\n } catch(Exception $e) {\n Mage::logException($e);\n }\n\n }", "public function get_productdetails($editpdata){\n\t\t$editpdata = $_REQUEST[ 'editpdata' ];\n\t\t$this -> db -> select('\n\t\t\tsum(si.currentstock) as currentstock,\n\t\t\tip.id as pid, ip.itemcode, ip.itemimage, ip.itemname, ip.sellprice, ip.remark, ii.createdby, ii.created_at, sti.storename, sta.statustitle, group_concat(siz.sizeshortcode) AS sizecode, group_concat(si.currentstock) AS stock, ip.store\n\t\t');\n//\t\t, ii.id as iid,ii.size, ii.color,, ii.updatedby, ii.updated_at, ii.itemid, ii.parentid, ii.store, ii.status\n\t\t$this -> db -> from('item_parent as ip');\n\t\t$this -> db -> join('item_info as ii', 'ip.id = ii.parentid', 'left');\n\t\t$this -> db -> join('stock_info as si', 'ii.id = si.itemid', 'left');\n\t\t$this -> db -> join('store_info as sti', 'ii.store = sti.id', 'left');\n\t\t$this -> db -> join('size_info as siz', 'siz.id = ii.size', 'left');\n\t\t$this -> db -> join('status_info as sta', 'ip.status = sta.id');\n\t\t$this -> db -> where('itemcode = ' . \"'\" . $editpdata . \"'\");\n\t\t$this -> db -> group_by('pid');\n\t\t$query = $this->db->get();\n//\t\t$this -> db -> select('*');\n//\t\t$this -> db -> from('item_info');\n//\t\t$this -> db -> where('itemcode = ' . \"'\" . $editpdata . \"'\");\n//\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n return $query->row();\n }else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function index()\n\t{\n\t\t$productDetails = $this->productDetailRepository->all();\n\n\t\treturn $this->sendResponse($productDetails->toArray(), \"ProductDetails retrieved successfully\");\n\t}", "function getProductDetails($pid,$str_attribute=\"\")\n\t{\n\t\t$sql_product = \"SELECT * FROM \". tablename('products').\" WHERE id = '\".$pid.\"'\";\n\t\t$query_product = $this->db->query($sql_product);\n $res_product = $query_product->row();\n $ary_product_dtls = $this->object_to_array($res_product);\n // .. End Get Product Details\n\n\n $str_attribute=trim($str_attribute);\n\n $search_attribute=\"\";\n if($str_attribute!=\"\")\n {\n \t$search_attribute=\" and op.product_attribute='\".$str_attribute.\"' \";\n }\n\n\t\t// Start Get No of quantity order placed for this product\n $sql_qnty_ordered = \"SELECT SUM(op.quantity) AS qnty_ordered\n FROM \". tablename('ordered_products').\" as op \n LEFT JOIN \". tablename('orders').\" as o ON op.order_id = o.id \n WHERE op.product_id = '\".$pid.\"' \".$search_attribute.\" and o.delivery_status!='4' \n GROUP BY op.product_id\";\n $query_qnty_ordered = $this->db->query($sql_qnty_ordered);\n $res_qnty_ordered = $query_qnty_ordered->row();\n\n $qnty_ordered=0;\n if(!empty($res_qnty_ordered))\n {\n if(!empty($res_qnty_ordered->qnty_ordered))\n {\n $qnty_ordered=$res_qnty_ordered->qnty_ordered;\n }\n }\n $ary_product_dtls['qnty_ordered']=$qnty_ordered;\n // .. End Get No of quantity order placed for this product\n\n\n // Start Get Quantity for the product\n $product_qnty=0;\n if($str_attribute!=\"\")\n {\n \t$sql_product_qnty = \"SELECT SUM(quantity) AS product_qnty\n\t FROM \". tablename('product_stock').\" WHERE pid = '\".$pid.\"' and stockdet='\".$str_attribute.\"' \";\n\n\t $query_product_qnty = $this->db->query($sql_product_qnty);\n\t $res_product_qnty = $query_product_qnty->row();\n\n\t \n\t if(!empty($res_product_qnty))\n\t {\n\t if(!empty($res_product_qnty->product_qnty))\n\t {\n\t $product_qnty=$res_product_qnty->product_qnty;\n\t }\n\t }\n }\n \n if($product_qnty<=0)\n {\n $product_qnty=$res_product->stock;\n }\n\n $ary_product_dtls['product_qnty']=$product_qnty;\n // .. End Get Quantity for the product\n \n \n // somnath - stock in, out calculation starts\n \n // stock in calculation for a product\n $sql = \"SELECT SUM(op.quantity) AS stockin\n FROM \" . tablename('ordered_products') . \" as op \n LEFT JOIN \" . tablename('orders') . \" as o ON op.order_id = o.id\n LEFT JOIN \" . tablename('entry') . \" as e ON e.id = o.entry_id\n WHERE o.order_type IN(2,4,5,7,9) AND op.status='1' AND e.company_id IN(\".$this->session->userdata('selected_branch_str').\") AND o.flow_type='0' AND op.product_id = '\" . $pid . \"' AND (op.return_status != '4' and op.return_status != '5' and op.return_status != '6') and o.delivery_status!='4' and (o.is_paid = '1' OR o.payment_method = 'COD') \n GROUP BY op.product_id\";\n\n $query = $this->db->query($sql);\n $stockin = $query->row();\n $stockin_qty = 0;\n if($stockin) {\n $stockin_qty = $stockin->stockin;\n }\n \n // stock out calculation for a product\n $sql = \"SELECT SUM(op.quantity) AS stockout\n FROM \" . tablename('ordered_products') . \" as op \n LEFT JOIN \" . tablename('orders') . \" as o ON op.order_id = o.id\n LEFT JOIN \" . tablename('entry') . \" as e ON e.id = o.entry_id\n WHERE o.order_type IN(1,3,6,8,9) AND op.status='1' AND e.company_id IN(\".$this->session->userdata('selected_branch_str').\") AND o.flow_type='1' AND op.product_id = '\" . $pid . \"' AND (op.return_status != '4' and op.return_status != '5' and op.return_status != '6') and o.delivery_status!='4' and (o.is_paid = '1' OR o.payment_method = 'COD') \n GROUP BY op.product_id\";\n\n $query = $this->db->query($sql);\n $stockout = $query->row();\n $stockout_qty = 0;\n if($stockout) {\n $stockout_qty = $stockout->stockout;\n }\n \n \n \n //somnath - stock in, out calculation ends\n\n\n // Start Get Availbale Stock for the product\n //$available_qnty=$product_qnty-$qnty_ordered;\n $available_qnty = ($product_qnty + $stockin_qty) - $stockout_qty; // somnath - new stock calculation with in, out calculation\n if($available_qnty<=0 || $available_qnty==NULL)\n {\n $available_qnty=0;\n }\n\n $ary_product_dtls['available_qnty']=$available_qnty;\n // .. End Get Availbale Stock for the product\n\n\n // Start Get Price for the product\n $product_price=0;\n if($str_attribute!=\"\")\n {\n \t$sql_product_price = \"SELECT price AS product_price\n\t FROM \". tablename('product_stock').\" WHERE pid = '\".$pid.\"' and stockdet='\".$str_attribute.\"' \";\n\n\t $query_product_price = $this->db->query($sql_product_price);\n\t $res_product_price = $query_product_price->row();\n\n\t \n\t if(!empty($res_product_price))\n\t {\n\t if(!empty($res_product_price->product_price))\n\t {\n\t $product_price=$res_product_price->product_price;\n\t }\n\t }\n }\n\n \n if($product_price<=0)\n {\n $product_price=$res_product->price;\n }\n\n $ary_product_dtls['product_price']=$product_price;\n // .. End Get Quantity for the product\n\n // Get All Discount\n $resrplugin= $this->checkproductdiscountplugin();\n $ary_product_dtls['all_discount_dtls']=array();\n $ary_product_dtls['on_sale']='N';\n if(!empty($resrplugin))\n {\n\t $ary_all_discount= $this->getalldiscountforproduct($pid,$str_attribute);\n\n\t if(!empty($ary_all_discount))\n\t {\n\t $ary_product_dtls['all_discount_dtls']=$ary_all_discount;\n $ary_product_dtls['on_sale']='Y';\n\t }\n }\n //.. Get All Discount\n\n return $ary_product_dtls;\n \n /* //echo \"<pre>\";\n print_r( $ary_product_dtls);\n exit;*/\n\t}", "public function actionFetchPrintData()\n {\n\t\tYii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n\n return Lookup::fetchPrintData(Yii::$app->request->post());\n }", "public function getDataForProductPage($pageType, $result)\n {\n $currencyCode = $this->_currencyCode;\n $attribute_data = $this->_gtmHelper->getAttributeMappingData();\n $product_data_arr =[];\n $product_data_arr['id'] = $result[1]['product']['id'];\n $product_data_arr['name'] = $result[1]['product']['name'];\n $product_data_arr['category'] = $result[1]['product']['category'];\n $product_data_arr['variant'] = $result[1]['product']['variant'];\n $product_data_arr['price'] = $result[1]['product']['price'];\n $product_data_arr['brand'] = $result[1]['product']['brand'];\n $product_data_arr['type'] = $result[1]['product']['product_type'];\n $product_data_arr['ratings'] = $result[1]['product']['ratings'];\n if (!empty($attribute_data)) {\n foreach ($attribute_data as $attr_key => $attr_value) {\n if (isset($result[1]['product']['attributes'][$attr_value])) {\n if ($attr_value == 'quantity_and_stock_status') {\n if (isset($result[1]['product']['attributes'][$attr_value])) {\n $in_stock = $result[1]['product']['attributes'][$attr_value]['value'];\n $attr_value = ($in_stock['is_in_stock'] == 1) ? __('in stock') : __('out of stock');\n }\n $product_data_arr[$attr_key] = $attr_value;\n } else {\n $product_data_arr[$attr_key] = $result[1]['product']['attributes'][$attr_value]['value'];\n }\n }\n }\n }\n \n $productType = $result[1]['product']['product_type'];\n $productArray = [\n 'event' => 'uaevent',\n 'eventCategory' => 'Ecommerce',\n 'eventAction'=> 'Product Detail',\n 'eventLabel' => $result[1]['product']['name'].'::'. $result[1]['product']['id']\n ];\n $actionField = [\n 'action' => 'detail',\n 'list' => 'category-page'\n ];\n $productArray['ecommerce']['currencyCode'] = $currencyCode;\n $productArray['ecommerce']['detail']['actionField'] = $actionField;\n $productArray['ecommerce']['detail']['products'] = $product_data_arr;\n\n return $productArray;\n }", "private function export_details(){\n $id_lang = (int)Context::getContext()->language->id;\n $start = 0;\n $limit = 100000;\n $order_by = 'id_product';\n $order_way = 'DESC';\n $id_category = false;\n $only_active = true;\n $context = null;\n\n $file = 'productdetails.csv';\n \n $f=fopen('uploads_products/'.$file, 'w');\n \n $all_products = Product::getProducts($id_lang, $start, $limit, $order_by, $order_way, $id_category,\n $only_active, $context);\n\n fwrite($f, \"Id_product;Nom;reference;description;descriptioncourte;caractéristique,caracatéristqiue_value,imageurl \\r\\n\");\n $data[0]=array(\"Id_product\",\"Nom\",\"reference\",\"description\",\"descriptioncourte\",\"caractéristique\",\"caracatéristqiue_value\",\"imageurl\");\n foreach($all_products as $product){\n \n $productObj = new Product((int)$product['id_product'] ,$id_lang , 1 );\n \n /** get all features*/\n\n $features = $productObj->getFeatures();\n \n foreach ($features as $feature){\n $feature_name = Feature::getFeature($id_lang, $feature[\"id_feature\"]);\n $featurevalues = FeatureValue::getFeatureValuesWithLang($id_lang,$feature[\"id_feature\"] , false); \n }\n \n /** get all images */\n $imgs = $productObj->getImages(Context::getContext()->language->id , null);\n $img = $productObj->getCover($product['id_product']);\n $link = new Link();\n //var_dump($productObj->name);die;\n $img_url = $link->getImageLink(isset($productObj->link_rewrite) ? $productObj->link_rewrite : $productObj->name , (int)$img['id_image']);\n \n $image_list = $img_url ;\n\n foreach($imgs as $image){\n $img_url2 = $link->getImageLink(isset($productObj->link_rewrite) ? $productObj->link_rewrite : $productObj->name, (int)$image['id_image']);\n if($img_url !== $img_url2 ){\n $image_list .=\",\".$img_url2 ;\n }\n }\n \n $id_produit = $productObj->id;\n $name = $productObj->name ;\n $reference = $productObj->reference ;\n $description_short = $productObj->description_short;\n $description = $productObj->description ; \n \n $feature_ch = '';\n foreach($featurevalues as $featurevalue){\n $feature_ch .='-'.$featurevalue[\"value\"].';';\n }\n \n $data[$productObj->id] = \n array($id_produit,$name,$reference,$description,$description_short,$feature_name[\"name\"],$feature_ch,$image_list);\n \n } \n \n $fp = fopen(dirname(__FILE__).'/uploads_products/'.$file, 'w');\n \n foreach ($data as $fields) {\n if(is_array($fields)){\n fputcsv($fp, $fields);\n }\n }\n fclose($fp);\n $filesize = filesize(dirname(__FILE__).'/uploads_products/'.$file);\n\n header('Content-Type: text/csv; charset=utf-8');\n header('Cache-Control: no-store, no-cache');\n header('Content-Disposition: attachment; filename=\"'.$file.'\"');\n header('Content-Length: '.$filesize);\n readfile(dirname(__FILE__).'/uploads_products/'.$file);\n }", "function getDetailAssociatedProducts($module, $focus) {\n\tglobal $log, $adb, $theme, $app_strings;\n\t$log->debug('> getDetailAssociatedProducts ' . $module . ',' . get_class($focus));\n\n\tif (strpos(GlobalVariable::getVariable('Inventory_DoNotUseLines', '', $module), $module)!==false) {\n\t\treturn '';\n\t}\n\tif (vtlib_isModuleActive('Products')) {\n\t\t$hide_stock = 'no';\n\t} else {\n\t\t$hide_stock = 'yes';\n\t}\n\tif ($module != 'PurchaseOrder') {\n\t\tif (GlobalVariable::getVariable('Application_B2B', '1')=='1') {\n\t\t\t$acvid = (isset($focus->column_fields['account_id']) ? $focus->column_fields['account_id'] : (isset($focus->column_fields['accid']) ? $focus->column_fields['accid'] : 0));\n\t\t} else {\n\t\t\t$acvid = (isset($focus->column_fields['contact_id']) ? $focus->column_fields['contact_id'] : (isset($focus->column_fields['ctoid']) ? $focus->column_fields['ctoid'] : 0));\n\t\t}\n\t} else {\n\t\t$acvid = $focus->column_fields['vendor_id'];\n\t}\n\n\t$cbMap = cbMap::getMapByName($module.'InventoryDetails', 'MasterDetailLayout');\n\t$MDMapFound = ($cbMap!=null && isPermitted('InventoryDetails', 'index')=='yes');\n\tif ($MDMapFound) {\n\t\t$cbMapFields = $cbMap->MasterDetailLayout();\n\t}\n\n\t//Get the taxtype of this entity\n\t$taxtype = getInventoryTaxType($module, $focus->id);\n\t$currencytype = getInventoryCurrencyInfo($module, $focus->id);\n\n\t$output = '';\n\t//Header Rows\n\t$output .= '\n\t<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"0\" class=\"crmTable detailview_inventory_table\" id=\"proTab\">\n\t<tr valign=\"top\" class=\"detailview_inventory_header\">\n\t\t<td colspan=\"2\" class=\"dvInnerHeader\"><b>' . $app_strings['LBL_ITEM_DETAILS'] . '</b></td>\n\t\t<td class=\"dvInnerHeader\" align=\"center\" colspan=\"2\"><b>' .\n\t\t\t$app_strings['LBL_CURRENCY'] . ' : </b>' . getTranslatedCurrencyString($currencytype['currency_name']) . ' (' . $currencytype['currency_symbol'] . ')\n\t\t</td>\n\t\t<td class=\"dvInnerHeader\" align=\"center\" colspan=\"2\"><b>' .\n\t\t\t$app_strings['LBL_TAX_MODE'] . ' : </b>' . $app_strings[$taxtype] . '\n\t\t</td>\n\t</tr>\n\t<tr valign=\"top\" class=\"detailview_inventory_subheader\">\n\t\t<td width=40% class=\"lvtCol\"><font color=\"red\">*</font>\n\t\t\t<b>' . $app_strings['LBL_ITEM_NAME'] . '</b>\n\t\t</td>';\n\n\t//Additional information column\n\t$output .= '<td width=20% class=\"lvtCol\"><b>' . $app_strings['LBL_INFORMATION'] . '</b></td>';\n\n\t$price_label = $_REQUEST['module'] == 'PurchaseOrder' ? $app_strings['LBL_PURCHASE_PRICE'] : $app_strings['LBL_LIST_PRICE'];\n\t$output .= '\n\t\t<td width=10% class=\"lvtCol\"><b>' . $app_strings['LBL_QTY'] . '</b></td>\n\t\t<td width=10% class=\"lvtCol\" align=\"right\"><b>' . $price_label . '</b></td>\n\t\t<td width=10% nowrap class=\"lvtCol\" align=\"right\"><b>' . $app_strings['LBL_TOTAL'] . '</b></td>\n\t\t<td width=10% valign=\"top\" class=\"lvtCol\" align=\"right\"><b>' . $app_strings['LBL_NET_PRICE'] . '</b></td>\n\t</tr>';\n\n\tif (in_array($module, getInventoryModules())) {\n\t\t$query = \"select case when vtiger_products.productid != '' then vtiger_products.productname else vtiger_service.servicename end as productname,\" .\n\t\t\t\" case when vtiger_products.productid != '' then 'Products' else 'Services' end as entitytype,\" .\n\t\t\t\" case when vtiger_products.productid != '' then vtiger_products.unit_price else vtiger_service.unit_price end as unit_price,\" .\n\t\t\t\" case when vtiger_products.productid != '' then vtiger_products.qtyinstock else 'NA' end as qtyinstock, vtiger_inventoryproductrel.* \" .\n\t\t\t\" from vtiger_inventoryproductrel\" .\n\t\t\t\" left join vtiger_products on vtiger_products.productid=vtiger_inventoryproductrel.productid \" .\n\t\t\t\" left join vtiger_service on vtiger_service.serviceid=vtiger_inventoryproductrel.productid \" .\n\t\t\t\" where id=? ORDER BY sequence_no\";\n\t}\n\n\t$result = $adb->pquery($query, array($focus->id));\n\t$num_rows = $adb->num_rows($result);\n\t$netTotal = '0.00';\n\tfor ($i = 1; $i <= $num_rows; $i++) {\n\t\t$sub_prod_query = $adb->pquery('SELECT productid from vtiger_inventorysubproductrel WHERE id=? AND sequence_no=?', array($focus->id, $i));\n\t\t$subprodname_str = '';\n\t\tif ($adb->num_rows($sub_prod_query) > 0) {\n\t\t\tfor ($j = 0; $j < $adb->num_rows($sub_prod_query); $j++) {\n\t\t\t\t$sprod_id = $adb->query_result($sub_prod_query, $j, 'productid');\n\t\t\t\t$sprod_name = getProductName($sprod_id);\n\t\t\t\t$str_sep = '';\n\t\t\t\tif ($j > 0) {\n\t\t\t\t\t$str_sep = ':';\n\t\t\t\t}\n\t\t\t\t$subprodname_str .= $str_sep . ' - ' . $sprod_name;\n\t\t\t}\n\t\t}\n\t\t$subprodname_str = str_replace(':', '<br>', $subprodname_str);\n\n\t\t$productid = $adb->query_result($result, $i - 1, 'productid');\n\t\t$entitytype = $adb->query_result($result, $i - 1, 'entitytype');\n\t\t$productname = $adb->query_result($result, $i - 1, 'productname');\n\t\t$productname = '<a href=\"index.php?action=DetailView&record='.$productid.'&module='.$entitytype.'\">'.$productname.'</a>';\n\t\t$productname.= \"<span type='vtlib_metainfo' vtrecordid='{$productid}' vtfieldname='\".($entitytype=='Products' ? 'productname' : 'servicename').\"' vtmodule='$entitytype' style='display:none;'></span>\";\n\t\tif ($subprodname_str != '') {\n\t\t\t$productname .= \"<br/><span style='color:#C0C0C0;font-style:italic;'>\" . $subprodname_str . \"</span>\";\n\t\t}\n\t\t$comment = $adb->query_result($result, $i - 1, 'comment');\n\t\t$qtyinstock = $adb->query_result($result, $i - 1, 'qtyinstock');\n\t\t$qtyinstockshow = CurrencyField::convertToUserFormat($qtyinstock, null, true);\n\t\t$qty = $adb->query_result($result, $i - 1, 'quantity');\n\t\t$qtyshow = CurrencyField::convertToUserFormat($qty, null, true);\n\t\t$listprice = $adb->query_result($result, $i - 1, 'listprice');\n\t\t$total = $qty * $listprice;\n\n\t\t//Product wise Discount calculation - starts\n\t\t$discount_percent = $adb->query_result($result, $i - 1, 'discount_percent');\n\t\t$discount_amount = $adb->query_result($result, $i - 1, 'discount_amount');\n\t\t$totalAfterDiscount = $total;\n\n\t\t$productDiscount = '0.00';\n\t\tif ($discount_percent != 'NULL' && $discount_percent != '') {\n\t\t\t$productDiscount = $total * $discount_percent / 100;\n\t\t\t$totalAfterDiscount = $total - $productDiscount;\n\t\t\t//if discount is percent then show the percentage\n\t\t\t$discount_info_message = \"$discount_percent % \" . $app_strings['LBL_LIST_OF'] . ' '.\n\t\t\t\t\t\t\t\t\t\tCurrencyField::convertToUserFormat($total, null, true).\" = \".\n\t\t\t\t\t\t\t\t\t\tCurrencyField::convertToUserFormat($productDiscount, null, true);\n\t\t} elseif ($discount_amount != 'NULL' && $discount_amount != '') {\n\t\t\t$productDiscount = $discount_amount;\n\t\t\t$totalAfterDiscount = $total - $productDiscount;\n\t\t\t$discount_info_message = $app_strings['LBL_DIRECT_AMOUNT_DISCOUNT'] . \" = \". CurrencyField::convertToUserFormat($productDiscount, null, true);\n\t\t} else {\n\t\t\t$discount_info_message = $app_strings['LBL_NO_DISCOUNT_FOR_THIS_LINE_ITEM'];\n\t\t}\n\t\t//Product wise Discount calculation - ends\n\n\t\t$netprice = $totalAfterDiscount;\n\t\t//Calculate the individual tax if taxtype is individual\n\t\tif ($taxtype == 'individual') {\n\t\t\t$taxtotal = '0.00';\n\t\t\t$tax_info_message = $app_strings['LBL_TOTAL_AFTER_DISCOUNT'] . \" = \".CurrencyField::convertToUserFormat($totalAfterDiscount, null, true).\" \\\\n\";\n\t\t\tforeach (getTaxDetailsForProduct($productid, 'all', $acvid) as $taxItem) {\n\t\t\t\t$tax_name = $taxItem['taxname'];\n\t\t\t\t$tax_label = $taxItem['taxlabel'];\n\t\t\t\t$tax_value = getInventoryProductTaxValue($focus->id, $productid, $tax_name);\n\t\t\t\t$individual_taxamount = $totalAfterDiscount * $tax_value / 100;\n\t\t\t\t$taxtotal = $taxtotal + $individual_taxamount;\n\t\t\t\t$tax_info_message .= \"$tax_label : $tax_value % = \".CurrencyField::convertToUserFormat($individual_taxamount, null, true).\" \\\\n\";\n\t\t\t}\n\t\t\t$tax_info_message .= \"\\\\n \" . $app_strings['LBL_TOTAL_TAX_AMOUNT'] . \" = \". CurrencyField::convertToUserFormat($taxtotal, null, true);\n\t\t\t$netprice = $netprice + $taxtotal;\n\t\t}\n\n\t\t$sc_image_tag = '';\n\t\tif ($module == 'Invoice') {\n\t\t\tswitch ($entitytype) {\n\t\t\t\tcase 'Services':\n\t\t\t\t\tif (vtlib_isModuleActive('ServiceContracts')) {\n\t\t\t\t\t\t$sc_image_tag = '<a href=\"index.php?module=ServiceContracts&action=EditView&service_id=' . $productid . '&sc_related_to='\n\t\t\t\t\t\t\t. $focus->column_fields['account_id'] . '&start_date=' . DateTimeField::convertToUserFormat($focus->column_fields['invoicedate'])\n\t\t\t\t\t\t\t. '&return_module=' . $module . '&return_id=' . $focus->id . '\"><img border=\"0\" src=\"' . vtiger_imageurl('handshake.gif', $theme)\n\t\t\t\t\t\t\t. '\" title=\"' . getTranslatedString('LBL_ADD_NEW', $module).\" \".getTranslatedString('ServiceContracts', 'ServiceContracts')\n\t\t\t\t\t\t\t. '\" style=\"cursor: pointer;\" align=\"absmiddle\" /></a>';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Products':\n\t\t\t\t\tif (vtlib_isModuleActive('Assets')) {\n\t\t\t\t\t\t$sc_image_tag = '<a onclick=\"return window.open(\\'index.php?module=Assets&return_module=Invoice&action=Popup&popuptype=detailview&select=enable'\n\t\t\t\t\t\t\t. '&form=EditView&form_submit=false&return_action=DetailView&productid='.$productid.'&invoiceid='.$focus->id.'&return_id=' . $focus->id\n\t\t\t\t\t\t\t. '&recordid='.$focus->id.'\\', \\'test\\', cbPopupWindowSettings)\"'\n\t\t\t\t\t\t\t. ' onmouseout=\"vtlib_listview.trigger(\\'invoiceasset.onmouseout\\', this)\" onmouseover=\"vtlib_listview.trigger(\\'cell.onmouseover\\', this)\">'\n\t\t\t\t\t\t\t. '<img border=\"0\" src=\"' . vtiger_imageurl('barcode.png', $theme) . '\" title=\"' . getTranslatedString('LBL_ADD_NEW', $module)\n\t\t\t\t\t\t\t. ' '.getTranslatedString('Assets', 'Assets'). '\" style=\"cursor: pointer;\" align=\"absmiddle\" /><span style=\"display:none;\" '\n\t\t\t\t\t\t\t. 'vtmodule=\"Assets\" vtfieldname=\"invoice_product\" vtrecordid=\"'.$focus->id.'::'.$productid.'::'.$i.'\" type=\"vtlib_metainfo\"></span></a>';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$sc_image_tag = '';\n\t\t\t}\n\t\t}\n\n\t\t//For Product Name\n\t\t$output .= '\n\t\t\t<tr valign=\"top\" class=\"detailview_inventory_row\">\n\t\t\t\t<td class=\"crmTableRow small lineOnTop detailview_inventory_namecell\" '\n\t\t\t\t\t.'onmouseover=\"vtlib_listview.trigger(\\'cell.onmouseover\\', this);\" onmouseout=\"vtlib_listview.trigger(\\'cell.onmouseout\\', this);\">'\n\t\t\t\t\t. $productname . '&nbsp;' . $sc_image_tag . '<br>' . $comment\n\t\t\t\t\t. '</td>';\n\t\t//Upto this added to display the Product name and comment\n\n\t\t$output .= '<td class=\"crmTableRow small lineOnTop detailview_inventory_stockcell\">';\n\t\tif ($module != 'PurchaseOrder' && $hide_stock == 'no') {\n\t\t\t$output .= '<b>'.$app_strings['LBL_QTY_IN_STOCK'].':</b>&nbsp;'.$qtyinstockshow;\n\t\t}\n\t\tif ($MDMapFound) {\n\t\t\t$invdTabid = getTabid('InventoryDetails');\n\t\t\tforeach ($cbMapFields['detailview']['fields'] as $mdfield) {\n\t\t\t\tif ($mdfield['fieldinfo']['name']=='id') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$output .= '<br>';\n\t\t\t\t$output .= '<b>'.$mdfield['fieldinfo']['label'].'</b>:&nbsp;';\n\t\t\t\t$crmEntityTable = CRMEntity::getcrmEntityTableAlias('InventoryDetails');\n\t\t\t\t$mdrs = $adb->pquery(\n\t\t\t\t\t'select '.$mdfield['fieldinfo']['name'].',vtiger_inventorydetails.inventorydetailsid from vtiger_inventorydetails\n\t\t\t\t\t\tinner join '.$crmEntityTable.' on vtiger_crmentity.crmid=vtiger_inventorydetails.inventorydetailsid\n\t\t\t\t\t\tinner join vtiger_inventorydetailscf on vtiger_inventorydetailscf.inventorydetailsid=vtiger_inventorydetails.inventorydetailsid\n\t\t\t\t\t\twhere vtiger_crmentity.deleted=0 and related_to=? and lineitem_id=?',\n\t\t\t\t\tarray($focus->id,$adb->query_result($result, $i - 1, 'lineitem_id'))\n\t\t\t\t);\n\t\t\t\tif ($mdrs) {\n\t\t\t\t\t$col_fields = array();\n\t\t\t\t\t$col_fields[$mdfield['fieldinfo']['name']] = $adb->query_result($mdrs, 0, $mdfield['fieldinfo']['name']);\n\t\t\t\t\t$col_fields['record_id'] = $adb->query_result($mdrs, 0, 'inventorydetailsid');\n\t\t\t\t\t$foutput = getDetailViewOutputHtml($mdfield['fieldinfo']['uitype'], $mdfield['fieldinfo']['name'], $mdfield['fieldinfo']['label'], $col_fields, 0, $invdTabid, $module);\n\t\t\t\t\tif ($foutput[2]==69) { // image\n\t\t\t\t\t\t$foutput = str_replace('style=\"max-width: 500px;\"', 'style=\"max-width: 100px;\"', $foutput[1]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$foutput = $foutput[1];\n\t\t\t\t\t}\n\t\t\t\t\t$output .= $foutput;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$output .= '</td>';\n\t\t$output .= '<td class=\"crmTableRow small lineOnTop detailview_inventory_qtycell\">' . $qtyshow . '</td>';\n\t\t$output .= '\n\t\t\t<td class=\"crmTableRow small lineOnTop detailview_inventory_lpricecell\" align=\"right\">\n\t\t\t\t<table width=\"100%\" border=\"0\" cellpadding=\"5\" cellspacing=\"0\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td align=\"right\">' . CurrencyField::convertToUserFormat($listprice, null, true) . '</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td align=\"right\">\n\t\t\t\t\t\t\t(-)&nbsp;<b><a href=\"javascript:;\" onclick=\"alert(\\'' . $discount_info_message . '\\'); \">' . $app_strings['LBL_DISCOUNT'] . ' : </a></b>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td align=\"right\" nowrap>' . $app_strings['LBL_TOTAL_AFTER_DISCOUNT'] . ' : </td>\n\t\t\t\t\t</tr>';\n\t\tif ($taxtype == 'individual') {\n\t\t\t$output .= '\n\t\t\t\t<tr>\n\t\t\t\t\t<td align=\"right\" nowrap>\n\t\t\t\t\t\t(+)&nbsp;<b><a href=\"javascript:;\" onclick=\"alert(\\'' . $tax_info_message . '\\');\">' . $app_strings['LBL_TAX'] . ' : </a></b>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>';\n\t\t}\n\t\t$output .= '\n\t\t\t\t</table>\n\t\t\t</td>';\n\n\t\t$output .= '\n\t\t\t<td class=\"crmTableRow small lineOnTop detailview_inventory_totalscell\" align=\"right\">\n\t\t\t\t<table width=\"100%\" border=\"0\" cellpadding=\"5\" cellspacing=\"0\">\n\t\t\t\t\t<tr><td align=\"right\">' . CurrencyField::convertToUserFormat($total, null, true) . '</td></tr>\n\t\t\t\t\t<tr><td align=\"right\">' . CurrencyField::convertToUserFormat($productDiscount, null, true) . '</td></tr>\n\t\t\t\t\t<tr><td align=\"right\" nowrap>' . CurrencyField::convertToUserFormat($totalAfterDiscount, null, true) . '</td></tr>';\n\n\t\tif ($taxtype == 'individual') {\n\t\t\t$output .= '<tr><td align=\"right\" nowrap>' . CurrencyField::convertToUserFormat($taxtotal, null, true) . '</td></tr>';\n\t\t}\n\n\t\t$output .= '\n\t\t\t\t</table>\n\t\t\t</td>';\n\t\t$output .= '<td class=\"crmTableRow small lineOnTop detailview_inventory_npricecell\" valign=\"bottom\" align=\"right\">';\n\t\t$output .= CurrencyField::convertToUserFormat($netprice, null, true) . '</td>';\n\t\t$output .= '</tr>';\n\t\tlist($v1, $v2, $v3, $v4, $output) = cbEventHandler::do_filter('corebos.filter.inventory.itemrow.detail', array($module, $focus, $result, $i, $output));\n\t\t$netTotal = $netTotal + $netprice;\n\t}\n\n\t$output .= '</table>';\n\n\t//$netTotal should be equal to $focus->column_fields['hdnSubTotal']\n\t$netTotal = empty($focus->column_fields['hdnSubTotal']) ? $focus->column_fields['hdnsubtotal'] : $focus->column_fields['hdnSubTotal'];\n\n\t//Display the total, adjustment, S&H details\n\t$output .= '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\" class=\"crmTable detailview_inventory_totals\">';\n\t$output .= '<tr id=\"detailview_inventory_subtotalrow\">';\n\t$output .= '<td width=\"88%\" class=\"crmTableRow small\" align=\"right\"><b>' . $app_strings['LBL_NET_TOTAL'] . '</td>';\n\t$output .= '<td width=\"12%\" class=\"crmTableRow small\" align=\"right\"><b>' . CurrencyField::convertToUserFormat($netTotal, null, true) . '</b></td>';\n\t$output .= '</tr>';\n\n\t//Decide discount\n\t$finalDiscount = '0.00';\n\t$final_discount_info = '0';\n\t$hdnDiscountPercent = empty($focus->column_fields['hdnDiscountPercent']) ? $focus->column_fields['hdndiscountpercent'] : $focus->column_fields['hdnDiscountPercent'];\n\t$hdnDiscountAmount = empty($focus->column_fields['hdnDiscountAmount']) ? $focus->column_fields['hdndiscountamount'] : $focus->column_fields['hdnDiscountAmount'];\n\tif ($hdnDiscountPercent != '0') {\n\t\t$finalDiscount = ($netTotal * $hdnDiscountPercent / 100);\n\t\t$final_discount_info = $hdnDiscountPercent . ' % ' . $app_strings['LBL_LIST_OF'] . ' '\n\t\t\t.CurrencyField::convertToUserFormat($netTotal, null, true) . ' = '. CurrencyField::convertToUserFormat($finalDiscount, null, true);\n\t} elseif ($hdnDiscountAmount != '0') {\n\t\t$finalDiscount = $hdnDiscountAmount;\n\t\t$final_discount_info = CurrencyField::convertToUserFormat($finalDiscount, null, true);\n\t}\n\n\t//Alert the Final Discount amount even it is zero\n\t$final_discount_info = $app_strings['LBL_FINAL_DISCOUNT_AMOUNT'] . \" = $final_discount_info\";\n\t$final_discount_info = 'onclick=\"alert(\\'' . $final_discount_info . '\\');\"';\n\n\t$output .= '<tr id=\"detailview_inventory_totaldiscrow\">';\n\t$output .= '<td align=\"right\" class=\"crmTableRow small lineOnTop\">';\n\t$output .= '(-)&nbsp;<b><a href=\"javascript:;\" ' . $final_discount_info . '>' . $app_strings['LBL_DISCOUNT'] . '</a></b></td>';\n\t$output .= '<td align=\"right\" class=\"crmTableRow small lineOnTop\">' . CurrencyField::convertToUserFormat($finalDiscount, null, true) . '</td>';\n\t$output .= '</tr>';\n\n\tif ($taxtype == 'group') {\n\t\t$taxtotal = '0.00';\n\t\t$final_totalAfterDiscount = $netTotal - $finalDiscount;\n\t\t$tax_info_message = $app_strings['LBL_TOTAL_AFTER_DISCOUNT'] . \" = \". CurrencyField::convertToUserFormat($final_totalAfterDiscount, null, true).\" \\\\n\";\n\t\t//First we should get all available taxes and then retrieve the corresponding tax values\n\t\t$ipr_cols = $adb->getColumnNames('vtiger_inventoryproductrel');\n\t\t//if taxtype is group then the tax should be same for all products in vtiger_inventoryproductrel table\n\t\tforeach (getAllTaxes('available', '', 'edit', $focus->id) as $taxItem) {\n\t\t\t$tax_name = $taxItem['taxname'];\n\t\t\t$tax_label = $taxItem['taxlabel'];\n\t\t\tif (in_array($tax_name, $ipr_cols)) {\n\t\t\t\t$tax_value = $adb->query_result($result, 0, $tax_name);\n\t\t\t} else {\n\t\t\t\t$tax_value = $taxItem['percentage'];\n\t\t\t}\n\t\t\tif ($tax_value == '' || $tax_value == 'NULL') {\n\t\t\t\t$tax_value = '0.00';\n\t\t\t}\n\n\t\t\t$taxamount = ($netTotal - $finalDiscount) * $tax_value / 100;\n\t\t\t$taxtotal = $taxtotal + $taxamount;\n\t\t\t$tax_info_message .= \"$tax_label : $tax_value % = \". CurrencyField::convertToUserFormat($taxamount, null, true) .\" \\\\n\";\n\t\t}\n\t\t$tax_info_message .= \"\\\\n \" . $app_strings['LBL_TOTAL_TAX_AMOUNT'] . \" = \". CurrencyField::convertToUserFormat($taxtotal, null, true);\n\n\t\t$output .= '<tr id=\"detailview_inventory_taxtotalrow\">';\n\t\t$output .= '<td align=\"right\" class=\"crmTableRow small\">';\n\t\t$output .= '(+)&nbsp;<b><a href=\"javascript:;\" onclick=\"alert(\\'' . $tax_info_message . '\\');\">' . $app_strings['LBL_TAX'] . '</a></b></td>';\n\t\t$output .= '<td align=\"right\" class=\"crmTableRow small\">' . CurrencyField::convertToUserFormat($taxtotal, null, true) . '</td>';\n\t\t$output .= '</tr>';\n\t}\n\n\t$hdnS_H_Amount = empty($focus->column_fields['hdnS_H_Amount']) ? $focus->column_fields['hdns_h_amount'] : $focus->column_fields['hdnS_H_Amount'];\n\t$shAmount = ($hdnS_H_Amount != '') ? $hdnS_H_Amount : '0.00';\n\tif (GlobalVariable::getVariable('Inventory_Show_ShippingHandlingCharges', 1, $module)) {\n\t\t$output .= '<tr id=\"detailview_inventory_shippingrow\">';\n\t\t$output .= '<td align=\"right\" class=\"crmTableRow small\">(+)&nbsp;<b>' . $app_strings['LBL_SHIPPING_AND_HANDLING_CHARGES'] . '</b></td>';\n\t\t$output .= '<td align=\"right\" class=\"crmTableRow small\">' . CurrencyField::convertToUserFormat($shAmount, null, true) . '</td>';\n\t\t$output .= '</tr>';\n\t}\n\n\t//calculate S&H tax\n\t$shtaxtotal = '0.00';\n\t//First we should get all available taxes and then retrieve the corresponding tax values\n\t//if taxtype is group then the tax should be same for all products in vtiger_inventoryproductrel table\n\t$shtax_info_message = $app_strings['LBL_SHIPPING_AND_HANDLING_CHARGE'] . \" = \". CurrencyField::convertToUserFormat($shAmount, null, true) .\"\\\\n\";\n\t$shtaxexist = false;\n\tforeach (getAllTaxes('available', 'sh', 'edit', $focus->id) as $taxItem) {\n\t\t$shtaxexist = true;\n\t\t$shtax_name = $taxItem['taxname'];\n\t\t$shtax_label = $taxItem['taxlabel'];\n\t\t$shtax_percent = getInventorySHTaxPercent($focus->id, $shtax_name);\n\t\t$shtaxamount = $shAmount * $shtax_percent / 100;\n\t\t$shtaxtotal = $shtaxtotal + $shtaxamount;\n\t\t$shtax_info_message .= \"$shtax_label : $shtax_percent % = \". CurrencyField::convertToUserFormat($shtaxamount, null, true) .\" \\\\n\";\n\t}\n\t$shtax_info_message .= \"\\\\n \" . $app_strings['LBL_TOTAL_TAX_AMOUNT'] . \" = \". CurrencyField::convertToUserFormat($shtaxtotal, null, true);\n\n\tif ($shtaxexist) {\n\t\t$output .= '<tr id=\"detailview_inventory_shiptaxrow\">';\n\t\t$output .= '<td align=\"right\" class=\"crmTableRow small\">(+)&nbsp;<b><a href=\"javascript:;\" onclick=\"alert(\\'' . $shtax_info_message . '\\')\">';\n\t\t$output .= $app_strings['LBL_TAX_FOR_SHIPPING_AND_HANDLING'] . '</a></b></td>';\n\t\t$output .= '<td align=\"right\" class=\"crmTableRow small\">' . CurrencyField::convertToUserFormat($shtaxtotal, null, true) . '</td>';\n\t\t$output .= '</tr>';\n\t}\n\n\t$txtAdjustment = empty($focus->column_fields['txtAdjustment']) ? $focus->column_fields['txtadjustment'] : $focus->column_fields['txtAdjustment'];\n\t$adjustment = ($txtAdjustment != '') ? $txtAdjustment : '0.00';\n\t$output .= '<tr id=\"detailview_inventory_adjustrow\">';\n\t$output .= '<td align=\"right\" class=\"crmTableRow small\">&nbsp;<b>' . $app_strings['LBL_ADJUSTMENT'] . '</b></td>';\n\t$output .= '<td align=\"right\" class=\"crmTableRow small\">' . CurrencyField::convertToUserFormat($adjustment, null, true) . '</td>';\n\t$output .= '</tr>';\n\n\t$hdnGrandTotal = empty($focus->column_fields['hdnGrandTotal']) ? $focus->column_fields['hdngrandtotal'] : $focus->column_fields['hdnGrandTotal'];\n\t$grandTotal = ($hdnGrandTotal != '') ? $hdnGrandTotal : '0.00';\n\t$output .= '<tr id=\"detailview_inventory_grandtotrow\">';\n\t$output .= '<td align=\"right\" class=\"crmTableRow small lineOnTop\"><b>' . $app_strings['LBL_GRAND_TOTAL'] . '</b></td>';\n\t$output .= '<td align=\"right\" class=\"crmTableRow small lineOnTop\" data-qagrandtotal=\"'.$grandTotal.'\">'.CurrencyField::convertToUserFormat($grandTotal, null, true).'</td>';\n\t$output .= '</tr>';\n\t$output .= '</table>';\n\n\t$log->debug('< getDetailAssociatedProducts');\n\treturn $output;\n}", "public function report_data() {\n\n\t\t// Permission\n\t\t$this->session_lib->check_permission('p_sale_report');\n\n\t\t// Log\n\n\t\t$attr = array(\n\t\t\t\t\t\t'filterStatus' => $this->filter_status(),\n\t\t\t\t\t);\n\n\t\t$this->layout_lib->default_template('transaction/sales/report-data', $attr);\n\t\t\n\t}", "public function getproductinfo($data)\n {\n $pid = $data['productid'];\n $proinfo=$this->db->query(\"SELECT * FROM `\" . DB_PREFIX . \"product` WHERE `product_id`= $pid\"); \n return $proinfo->rows; \n }", "public function getProductInfoDetail($id){\n \t$db=$this->getAdapter();\n \t$sql = \"SELECT p.pro_id,p.cate_id,p.stock_type,p.item_name,p.item_code,p.price_per_qty,p.brand_id,\n \tp.photo,p.is_avaliable,p.remark,c.Name,b.Name As branch_name\n \tFROM tb_product AS p\n \tINNER JOIN tb_category AS c ON c.CategoryID=p.cate_id\n \tINNER JOIN tb_branch AS b ON b.branch_id=p.brand_id\n \tWHERE p.pro_id=\".$id.\" LIMIT 1\";\n \t$rows = $db->fetchRow($sql);\n \treturn ($rows);\n }", "public static function getProductData(){\n return DB::table('tbl_product')->orderBy('id', 'asc')->get(); \n }", "public function actionGet()\r\n {\r\n $count = 0;\r\n $sum = 0;\r\n $delivery_sum = 0;\r\n $data = [];\r\n if(isset(\\Yii::$app->session['product']))\r\n {\r\n /*\r\n var_dump(\\Yii::$app->session['product']);\r\n exit;\r\n */\r\n \r\n foreach (\\Yii::$app->session['product'] as $hash => $value){\r\n\r\n if(isset($value['object_id']) && $value['object_id']!=\"\")\r\n {\r\n if($value['object_type'] == OrderProduct::OBJECT_TYPE_EVENT)\r\n {\r\n $product = \\common\\models\\event\\Event::findOne($value['object_id']);\r\n $cImg = new \\common\\components\\CImage();\r\n\r\n $img = \"\";\r\n if(isset($product->productObjectUser->product))\r\n $img = $cImg->getFile($product->productObjectUser->product->firstPictureShortPath, 100, 140, 'center');\r\n\r\n $name = $product->host_name;\r\n $price = 10;\r\n }\r\n\r\n if(isset($product->id))\r\n {\r\n $data[$hash] = $value;\r\n $data[$hash]['name'] = $name;\r\n $data[$hash]['img'] = $img;\r\n $data[$hash]['price'] = $price;\r\n $data[$hash]['delivery_price'] = 0; /*isset($deliveryPrice->price) ? $deliveryPrice->price*$data[$hash]['count']:\"\";*/\r\n $count+=$data[$hash]['count'];\r\n\r\n $sum += $price * $data[$hash]['count'];\r\n $delivery_sum += $data[$hash]['delivery_price'];\r\n }\r\n }\r\n }\r\n }\r\n return [\r\n 'products'=>$data,\r\n 'count'=>$count,\r\n 'sum'=>$sum,\r\n 'delivery_sum'=>$delivery_sum,\r\n ];\r\n }", "public function read() {\n // Joining with tables that are linked to products\n $this->db->select('sum(quantite) as quantity, sum(prix_ht_produit * quantite) as all_price, sum(prix_ht_produit) as price, produit.description_court_produit, produit.description_long_produit, produit.prix_ht_produit, produit.tva_produit, panier.id_produit, panier.id')\n ->from('produit')\n ->join('sous_rubrique', 'produit.id_sous_rubrique = sous_rubrique.id_sous_rubrique')\n ->join('rubrique', 'sous_rubrique.id_rubrique = rubrique.id_rubrique')\n ->join('fournisseur', 'produit.id_fournisseur = fournisseur.id_fournisseur')\n ->join('panier', 'produit.id_produit = panier.id_produit')\n ->join('client', 'panier.id_client = client.id_client')\n ->where('panier.id_client', $this->session->id)\n // Grouped by id_product to display the different products\n ->group_by('produit.id_produit');\n\n return $this->db->get()->result();\n }", "private function get_details() {\n\t\t$client = \\Tigron\\Cp\\Client\\Soap::get('invoice_contact');\n\t\t$this->details = $client->get_by_id($this->id);\n\t}", "function getProductDetail($pdId, $lang)\n\n{\n\t$_SESSION['shoppingReturnUrl'] = $_SERVER['REQUEST_URI'];\n\n\t// get the product information from database\n\n\t$sql = \"SELECT (SELECT text\n FROM language_items\n WHERE (lang='_en' or lang='$lang')\n AND item= ( select concat('product_',pd_reference,'_name') from tbl_product where pd_id = $pdId)\n AND text <> ''\n ORDER by lang asc limit 1) as pd_name, \n\t\t\t(SELECT text \n\t\t\t FROM language_items \n\t\t\t WHERE (lang='_en' or lang='$lang') \n\t\t\t \tAND item= ( select concat('product_',pd_reference,'_desc') from tbl_product where pd_id = $pdId)\n\t\t\t \tAND text <> '' \n\t\t\t ORDER by lang asc limit 1) as pd_description, \n\t\t\t(SELECT text \n\t\t\t FROM language_items \n\t\t\t WHERE (lang='_en' or lang='$lang') \n\t\t\t\tAND item=(select concat('product_',pd_reference,'_desc2') from tbl_product where pd_id = $pdId) \n\t\t\t\tAND text <> ''\n\t\t \t ORDER by lang asc limit 1) as pd_description2,\n\t\t\tta_price, pd_image, pd_image_large, sum(pi_stock_qty) as pd_qty, count(pi_flavor) as nof_stock, pi_weight, pi_shipping_weight, pd_default_order_qty, pd_active, pd_vo_group\n\t\t\tFROM tbl_product, tbl_product_item, tbl_tariff \n\t\t\tWHERE pd_id = $pdId\n\t\t\tAND pd_id = ta_pd_id\n\t\t\tAND ta_category = 0\n\t\t\tAND pi_pd_id = pd_id\n\t\t\tAND pd_active = 1\n\t\t\tGROUP BY pd_id\";\n\n\t$result = dbQuery($sql);\n\n\t$row = dbFetchAssoc($result);\n\n\textract($row);\n\n\t$row['pd_description'] = nl2br($row['pd_description']);\n\t$row['pd_description2'] = nl2br($row['pd_description2']);\n\n\tif ($row['pd_image']) {\n\t\t$row['pd_image'] = PRODUCT_IMAGE_DIR . $row['pd_image'];\n\t} else {\n\t\t$row['pd_image'] = PRODUCT_IMAGE_DIR . 'no-image-large.png';\n\t}\n\n\tif ($row['pd_image_large']) {\n\t\t$row['pd_image_large'] = PRODUCT_IMAGE_LARGE_DIR . $row['pd_image_large'];\n\t} else {\n\t\t$row['pd_image_large'] = PRODUCT_IMAGE_LARGE_DIR . 'no-image-large.png';\n\t}\n\n\t$row['cart_url'] = \"miniCart.php?action=add&p=$pdId\";\n\n\treturn $row;\n\n}", "public function readproductall()\n\t{\n\t\t$takedataproductall = $this->Model_main->read_all_product();\n\t\t$data = array();\n\t\tforeach ($takedataproductall as $showkan) {\n\t\t\t$list = array();\n\t\t\t$list[] = '<div class=\"col-xl-2 col-lg-3 col-md-3 col-sm-6 d-flex align-items-stretch mt-4\">\n\t\t\t<div style=\"width: 110%;\" class=\"icon-box\">\n\t\t\t\t<div class=\"icon\">\n\t\t\t\t\t<img style=\"height: 100%;\" src=\"' . base_url() . 'assets/front/img/product/' . $showkan['picture'] . '\">\n\t\t\t\t</div>\n\t\t\t\t<h5><a href=\"\">' . $showkan['name'] . '</a></h5>\n\t\t\t\t\n\t\t\t</div>\n\t\t</div>';\n\t\t\t$data[] = $list;\n\t\t}\n\t\techo json_encode($data);\n\t}", "public function info() {\n\t\t$productData = array(\t'id' \t\t\t=> $this->id,\n\t\t\t\t\t\t\t\t'sku' \t\t\t=> $this->sku,\n\t\t\t\t\t\t\t\t'name'\t\t\t=> $this->name,\n\t\t\t\t\t\t\t\t'image_url'\t\t=> $this->image_url,\n\t\t\t\t\t\t\t\t'product_url'\t=> $this->product_url,\n\t\t\t\t\t\t\t\t//Checks if product currently has special price\n\t\t\t\t\t\t\t\t'current_price' => ($this->current_price > $this->current_special & $this->current_special >0 ?$this->current_special: $this->current_price),\n\t\t\t\t\t\t\t\t'current_cost'\t=> $this->current_cost,\n\t\t\t\t\t\t\t\t'manufacturer'\t=> $this->manufacturer,\n\t\t\t\t\t\t\t\t'vendor'\t\t=> $this->vendor,\n\t\t\t\t\t\t\t\t'type'\t\t\t=> $this->type,\n\t\t\t\t\t\t\t\t'status'\t\t=> $this->status,\n\t\t\t\t\t\t\t\t'updated_at'\t=> $this->updated_at\n\n\t\t\t\t\t);\n\t\treturn $productData;\n\t}" ]
[ "0.6846281", "0.684537", "0.6800068", "0.6611972", "0.65849525", "0.65731686", "0.655564", "0.6517419", "0.6505052", "0.6471041", "0.6466786", "0.64302933", "0.6380623", "0.62695414", "0.62634075", "0.6262086", "0.6210108", "0.6209513", "0.6195376", "0.618898", "0.61653256", "0.6159928", "0.6154748", "0.61335", "0.61322135", "0.6129908", "0.6128914", "0.6127199", "0.6119203", "0.6116723" ]
0.70491445
0
End of function / ================================================================================== PRODUCT SETUP:COLOR ================================================================================== / insert data and return last insert id
public function color_insert($data) { //Transfering data to Model $this->db->trans_start(); $this->db->insert('item_color', $data); $insert_id = $this->db->insert_id(); $this->db->trans_complete(); return $insert_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function InsertProduct($title, $published, $cat1, $cat2, $image, $specs, $sku, $price, $colors)\n //inserts this campaign object into the DB as a new row\n{\n $created = date('Y-m-d h:i:s');\n\n try{\n\n require 'connect.php';\n\n $data = array('id' => NULL, 'title' => $title, 'published' => $published, 'cat1' => $cat1, 'cat2' => $cat2, 'image' => $image, 'specs' => $specs, 'sku' => $sku, 'price' => $price, 'colors' => $colors, 'created' => $created);\n $STH = $DBH->prepare(\"INSERT INTO products (id, title, published, cat1, cat2, image, specs, sku, price, colors, created) value (:id, :title, :published, :cat1, :cat2, :image, :specs, :sku, :price, :colors, :created)\");\n $STH->execute($data);\n\n //$this->id = $DBH->lastInsertId();\n }\n catch(PDOException $e) {\n echo $e->getMessage();\n }\n\n\n}", "public function product_insert($colorproduct,$sizeproduct){\n\t\t$this->db->set('product_name',$this->input->post('product_name'));\n\t\t$this->db->set('product_description',$this->input->post('product_description')); \n\t\t$this->db->set('product_price',$this->input->post('rate'));\n\t\t$this->db->set('category_id', $this->input->post('product_category'));\n\t\t$this->db->set('color_id', $colorproduct);\n\t\t$this->db->set('size_id', $sizeproduct);\n\t\t$this->db->set('created_date', date(\"Y-m-d H:i:s\"));\n\t\t$this->db->set('created_by', $this->session->userid);\n\t\t$query = $this->db->insert('products');\n\t\t$response=$this->db->insert_id();\n\t\treturn $response;\n\t}", "public function addData()\r\n\t{\r\n\t\t$this->datecreated = time();\n\n\r\n\t\t$sql = 'INSERT INTO ' . TABLE_PREFIX . 'internallink (\n\t\t\t\t\til_setting,\n\t\t\t\t\til_keylink,\n\t\t\t\t\til_exception,\n\t\t\t\t\til_status,\n\t\t\t\t\til_datecreated\r\n\t\t\t\t\t)\r\n\t\t VALUES(?, ?, ?, ?, ?)';\r\n\t\t$rowCount = $this->db->query($sql, array(\n\t\t(string)$this->setting,\n\t\t(string)$this->keylink,\n\t\t(string)$this->exception,\n\t\t(int)$this->status,\n\t\t(int)$this->datecreated\r\n\t\t))->rowCount();\r\n\r\n\t\t$this->id = $this->db->lastInsertId();\r\n\t\treturn $this->id;\r\n\t}", "private function insert() {\n // use prepared statements\n // save an insert id\n }", "abstract public function insert_id();", "public function insertid();", "abstract public function getInsertId();", "function insert_id()\n\t{\n\t\treturn self::$instance->insert_id;\n\t}", "abstract public function Insert_ID();", "public function insert($data) {\n\t\t$data['CollectorID']\t= 21;\n\t\t$data['UpdaterID']\t= 21;\t\t\n\t\t\n\t\t$newID = parent::insert($data);\t\t\n\t\t$this->setDateSession();\t\t\t\t\n\t\treturn $newID;\n\t}", "abstract public function insertid();", "function lastInsertId(){\n $product = new productModel();\n return $product->lastInsertId();\n }", "public function GetInsertID();", "public function lastInsertId(){\n\t\treturn parent::getLastInsertId($this->connection);\t\t\n\t}", "public function lastInsertId(){\n\t\t$this->dbh->lastInsertId();\n\t}", "public function insert(){\n\t\t$arr = array('global_id' => $this->v_global_id\n\t\t\t\t\t,'global_key' => $this->v_global_key\n\t\t\t\t\t,'global_name' => $this->v_global_name\n\t\t\t\t\t,'global_description' => $this->v_global_description\n\t\t\t\t\t,'global_value' => $this->v_global_value\n\t\t\t\t\t,'setting_name' => $this->v_setting_name\n\t\t\t\t\t,'setting_key' => $this->v_setting_key);\n\t\ttry{\n\t\t\t$this->collection->insert($arr, array('safe'=>true));\n\t\t\t$this->v_mongo_id = isset($arr['_id'])?$arr['_id']:'';\n\t\t\treturn $this->v_mongo_id;\n\t\t}catch(MongoCursorException $e){\n\t\t\t$this->v_error_code = $e->getCode();\n\t\t\t$this->v_error_message = $e->getMessage();\n\t\t\t$this->my_error();\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function insert(){\n\t\t$arr = array('company_id' => $this->v_company_id\n\t\t\t\t\t,'company_name' => $this->v_company_name\n\t\t\t\t\t,'company_code' => $this->v_company_code\n\t\t\t\t\t,'relationship' => $this->v_relationship\n ,'logo_file'=> $this->v_logo_file\n\t\t\t\t\t,'bussines_type' => $this->v_bussines_type\n\t\t\t\t\t,'industry' => $this->v_industry\n\t\t\t\t\t,'website' => $this->v_website\n\t\t\t\t\t,'modules' => $this->v_modules\n\t\t\t\t\t,'sales_rep_id' => $this->v_sales_rep_id\n\t\t\t\t\t,'email_sales_rep' => $this->v_sales_rep_email\n\t\t\t\t\t,'email_head_office' => $this->v_email_head_office\n ,'csr_id'=>$this->v_csr_id\n\t\t\t\t\t,'status' => $this->v_status\n\t\t\t\t\t,'company_template_id' => $this->v_company_template_id\n );\n\t\ttry{\n\t\t\t$this->collection->insert($arr, array('safe'=>true));\n\t\t\t$this->v_mongo_id = isset($arr['_id'])?$arr['_id']:'';\n\t\t\treturn $this->v_mongo_id;\n\t\t}catch(MongoCursorException $e){\n\t\t\t$this->v_error_code = $e->getCode();\n\t\t\t$this->v_error_message = $e->getMessage();\n\t\t\t$this->my_error();\n\t\t\treturn NULL;\n\t\t}\n\t}", "abstract protected function insertid();", "public function save()\r\n {\r\n //get database connection\r\n $db = dbConn::getConnection();\r\n \r\n //run pre-hook activities\r\n $this->preHook();\r\n\r\n //create new row if id is blank\r\n if ($this->id == '')\r\n {\r\n \r\n //prepare and bind values\r\n $sql = $this->insert();\r\n \r\n //get sql statement with placeholders\r\n $statement = $db->prepare($sql);\r\n $columnValues = $this->getColumnValues();\r\n \r\n $i = 1;\r\n foreach($columnValues as $value)\r\n {\r\n $statement->bindValue($i, $value);\r\n $i++;\r\n }\r\n \r\n $statement->execute();\r\n \r\n //good practice for an orm to return id\r\n return $db->lastInsertId();\r\n } \r\n else\r\n {\r\n //run sql update\r\n $sql = $this->update();\r\n \r\n //check to see if the record you want to update exists\r\n $statement = $db->prepare($sql);\r\n $statement->execute();\r\n \r\n //good practice for an orm to return id\r\n return $this->id;\r\n }\r\n }", "static function create($table,$data = array()) { \r\n\r\n\t \tself::$db -> insert($table,$data); \r\n\t \treturn self::$db -> insert_id(); \r\n }", "public function insert_id() : int\n {\n return 1;\n }", "function getEventID() {\n return $this->db->insert_id();\n }", "public function save()\n {\n $this->_data = $this->beforeSave();\n $insert = $this->insertTable($this->_main_table,$this->_data);\n if($insert['result'] != 'success'){\n $this->throwException($insert['msg']);\n }\n $id = $insert['data'];\n $this->addData('id',$id);\n return $id;\n }", "public function addColor(){\n if ($this->addNewColor == null){\n $this->addNewColor = $this->editProductId;\n }\n elseif ($this->addNewColor != null){\n $this->addNewColor = null;\n }\n }", "function InsertNewRecord($post) {\n $this->db->insert('item_category',$post);\n $last_id = $this->db->insert_id();\n return $last_id;\n }", "public function insert(): int\n {\n $req = 'INSERT INTO '.$this->table.' SET status = :status, role = :role, first_name = :first_name, last_name = :last_name, public_name = :public_name, email_address = :email_address, password = :password, creation_date = NOW(), last_update_date = NOW(), publication_date = NOW()';\n $query = $this->pdo->prepare($req);\n $query->execute(array(\n ':status' => $this->status,\n ':role' => $this->role,\n ':first_name' => $this->first_name,\n ':last_name' => $this->last_name,\n ':public_name' => $this->public_name,\n ':email_address' => $this->email_address,\n ':password' => $this->password\n ));\n\n return $this->pdo->lastInsertId();\n }", "public function insertId ()\n {\n return $this->insertId;\n }", "function insert($table,$data)\n {\n $this->db->insert($table, $data);\n //echo $this->db->last_query(); die();\n $insert_id = $this->db->insert_id();\n return $insert_id;\n }", "function db_insert_id() {\r\n\t return mysqli_insert_id($this->database_connection);\r\n\t}", "private function insert(){\n $this->db->insert($this::DB_TABLE_NAME, $this);\n $this->{$this::DB_TABLE_PK_VALUE} = $this->db->insert_id();\n }" ]
[ "0.69774806", "0.6545187", "0.6521278", "0.6426004", "0.63860345", "0.6347908", "0.63256466", "0.62708604", "0.62673205", "0.6238964", "0.6238668", "0.62369055", "0.6225077", "0.620856", "0.6204456", "0.6191065", "0.61804396", "0.6171831", "0.6169025", "0.615859", "0.61352247", "0.61225945", "0.61201656", "0.611527", "0.6115128", "0.6113322", "0.6111143", "0.6109807", "0.6102115", "0.61015856" ]
0.7688641
0
End of function / ================================================================================== PRODUCT SETUP:CATEGORY ================================================================================== / insert data and return last insert id
public function category_insert($data) { //Transfering data to Model $this->db->trans_start(); $this->db->insert('item_category', $data); $insert_id = $this->db->insert_id(); $this->db->trans_complete(); return $insert_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function InsertNewRecord($post) {\n $this->db->insert('item_category',$post);\n $last_id = $this->db->insert_id();\n return $last_id;\n }", "abstract public function insert_id();", "function store_categoria_producto($data)\n {\n\t\t$insert = $this->db->insert('categoria_producto', $data);\n\t return $this->db->insert_id();\n\t}", "private function insert() {\n // use prepared statements\n // save an insert id\n }", "function InsertProduct($title, $published, $cat1, $cat2, $image, $specs, $sku, $price, $colors)\n //inserts this campaign object into the DB as a new row\n{\n $created = date('Y-m-d h:i:s');\n\n try{\n\n require 'connect.php';\n\n $data = array('id' => NULL, 'title' => $title, 'published' => $published, 'cat1' => $cat1, 'cat2' => $cat2, 'image' => $image, 'specs' => $specs, 'sku' => $sku, 'price' => $price, 'colors' => $colors, 'created' => $created);\n $STH = $DBH->prepare(\"INSERT INTO products (id, title, published, cat1, cat2, image, specs, sku, price, colors, created) value (:id, :title, :published, :cat1, :cat2, :image, :specs, :sku, :price, :colors, :created)\");\n $STH->execute($data);\n\n //$this->id = $DBH->lastInsertId();\n }\n catch(PDOException $e) {\n echo $e->getMessage();\n }\n\n\n}", "public function getNewInsertedIdCategories()\n\t{\n\t\t$newInsertedId = $GLOBALS['xoopsDB']->getInsertId();\n\t\treturn $newInsertedId;\n\t}", "public function insert($data)\n {\n $qb = $this->createQueryBuilder();\n\n $categories = $data['category'];\n unset($data['category']);\n\n $data['created_at'] = (new \\DateTime())->format('Y-m-d H:i:s');\n\n $query = $qb->insert(array_keys($data))->getQuery();\n $this->db->prepare($query);\n $this->db->execute(array_values($data));\n $qb->flush();\n\n $productId = $this->db->lastInsertId();\n\n //Inset Product Category\n $productCategoryModel = new ProductCategoryModel();\n foreach($categories as $category) {\n $productCategoryModel->insert([\n 'product_id' => $productId,\n 'category_id' => $category,\n 'created_at' => $data['created_at']\n ]);\n }\n\n return $productId;\n }", "abstract protected function insertid();", "public function insert($data) {\n\t\t$data['CollectorID']\t= 21;\n\t\t$data['UpdaterID']\t= 21;\t\t\n\t\t\n\t\t$newID = parent::insert($data);\t\t\n\t\t$this->setDateSession();\t\t\t\t\n\t\treturn $newID;\n\t}", "abstract public function insertid();", "public function afterInsert()\n {\n\n $ids = explode(',',$this->owner->categoryIds);\n foreach ($ids as $id){\n $assign = new ProductToCategory([\n 'product_id' => $this->owner->id,\n 'category_id' => $id,\n ]);\n $assign->save();\n }\n\n }", "abstract public function Insert_ID();", "private function insert(){\n $this->db->insert($this::DB_TABLE_NAME, $this);\n $this->{$this::DB_TABLE_PK_VALUE} = $this->db->insert_id();\n }", "public function sql_insert()\n\t{\n\t\tparent::sql_insert();\n\t\tif (!is_null($this->categories))\n\t\tforeach ($this->categories as $cat) {\n\t\t\tCategorizedItem::add($cat, $this->slug);\n\t\t}\n\t}", "abstract public function getInsertId();", "public function save()\n {\n $productId = intval($this->getProductId());\n\n $result[\"success\"] = true;\n $result[\"message\"] = \"\";\n\n $table = \"product_category\";\n $fieldset = array(\"category_id\");\n $valueset = array($this->getCategoryId());\n\n if($productId > 0){\n $condition = \"AND product_id=\".$productId;\n if(Connection::updateData($table,$fieldset,$valueset,$condition)){\n $result[\"success\"] = true;\n $result[\"message\"] = \"Update Successful.\";\n }else {\n $result[\"success\"] = false;\n $result[\"message\"] = \"Update Failed.\";\n }\n }\n else{\n $insert_id = 0;\n if(Connection::insertData($table,$fieldset,$valueset,$insert_id)){\n $result[\"success\"] = true;\n $result[\"message\"] = \"Insert Successful.\";\n $this->setProductId($insert_id);\n }else{\n $result[\"success\"] = false;\n $result[\"message\"] = \"Insert Failed.\";\n }\n }\n\n return $result;\n\n }", "public function product_insert($data) {\n //Transfering data to Model\n\t\t$this->db->trans_start();\n\t\t$this->db->insert('item_parent', $data);\n\t\t$insert_id = $this->db->insert_id();\n\t\t$this->db->trans_complete();\n\t\treturn $insert_id;\t\t\n \t}", "public function insertid();", "function store()\n {\n $this->dbInit();\n query( \"INSERT INTO eZTodo_Priority SET\n ID='$this->ID',\n Title='$this->Title'\" );\n return mysql_insert_id();\n }", "function add_category($cat_name) {\n global $conn, $active_company;\n\n \t$sql = sprintf(\"SELECT id FROM itemcategory WHERE name=%s\",sqlprep($cat_name));\n \t$result = $conn->Execute($sql) or print($conn->ErrorMsg());\n \t$catpk = $result->fields[0];\n \n \tif (!$catpk and $cat_name) {\n $sql = sprintf(\"INSERT INTO itemcategory (name) VALUES (%s)\",sqlprep($cat_name));\n\t $result = $conn->Execute($sql) or print($conn->ErrorMsg());\n\t $catpk = $conn->Insert_ID();\n \t}\n\treturn $catpk ;\n }", "public function Insert()\n\t{\n\t\t$DB = new DB;\n\t\t$this->strQuery=\"Insert into t_category (parent_id,category_name,category_description)\n\t\tValues (\".$this->parent_id.\",'\".$this->category_name.\"','\".$this->category_description.\"')\";\t\t\n\t\t$DB->Execute($this->strQuery);\n\t\t\n\t}", "function _insert($data){\n\t\t$this->load->model('Mdl_category_assign');\n\t\t$this->Mdl_category_assign->_insert($data);\n\t}", "public function insert(){\n\t\t$arr = array('company_id' => $this->v_company_id\n\t\t\t\t\t,'company_name' => $this->v_company_name\n\t\t\t\t\t,'company_code' => $this->v_company_code\n\t\t\t\t\t,'relationship' => $this->v_relationship\n ,'logo_file'=> $this->v_logo_file\n\t\t\t\t\t,'bussines_type' => $this->v_bussines_type\n\t\t\t\t\t,'industry' => $this->v_industry\n\t\t\t\t\t,'website' => $this->v_website\n\t\t\t\t\t,'modules' => $this->v_modules\n\t\t\t\t\t,'sales_rep_id' => $this->v_sales_rep_id\n\t\t\t\t\t,'email_sales_rep' => $this->v_sales_rep_email\n\t\t\t\t\t,'email_head_office' => $this->v_email_head_office\n ,'csr_id'=>$this->v_csr_id\n\t\t\t\t\t,'status' => $this->v_status\n\t\t\t\t\t,'company_template_id' => $this->v_company_template_id\n );\n\t\ttry{\n\t\t\t$this->collection->insert($arr, array('safe'=>true));\n\t\t\t$this->v_mongo_id = isset($arr['_id'])?$arr['_id']:'';\n\t\t\treturn $this->v_mongo_id;\n\t\t}catch(MongoCursorException $e){\n\t\t\t$this->v_error_code = $e->getCode();\n\t\t\t$this->v_error_message = $e->getMessage();\n\t\t\t$this->my_error();\n\t\t\treturn NULL;\n\t\t}\n\t}", "function addNewCategory($categoryInfo)\n {\n $this->db->trans_start();\n $this->db->insert('category', $categoryInfo);\n \n $insert_id = $this->db->insert_id();\n \n $this->db->trans_complete();\n \n return $insert_id;\n }", "public function insert() {\n \n // Does the SlugCategory object already have an ID?\n if ( !is_null( $this->id ) ) trigger_error ( \"SlugCategory::insert(): Attempt to insert a SlugCategory object that already has its ID property set (to $this->slugCategoryId).\", E_USER_ERROR );\n \n // Insert the SlugCategory\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"INSERT INTO slugCategories ( slugCategoryParentId, slugCategoryName, slugCategoryDescription ) VALUES ( :slugCategoryParentId, :slugCategoryName, :slugCategoryDescription )\";\n $st = $conn->prepare ( $sql );\n $st->bindValue( \":slugCategoryParentId\", $this->slugCategoryParentId, PDO::PARAM_INT );\n $st->bindValue( \":slugCategoryName\", $this->slugCategoryName, PDO::PARAM_STR );\n $st->bindValue( \":slugCategoryDescription\", $this->slugCategoryDescription, PDO::PARAM_STR );\n $st->execute();\n $this->slugCategoryId = $conn->lastInsertId();\n $conn = null;\n }", "function lastInsertId(){\n $product = new productModel();\n return $product->lastInsertId();\n }", "public function insert(){\n\t\t$arr = array('global_id' => $this->v_global_id\n\t\t\t\t\t,'global_key' => $this->v_global_key\n\t\t\t\t\t,'global_name' => $this->v_global_name\n\t\t\t\t\t,'global_description' => $this->v_global_description\n\t\t\t\t\t,'global_value' => $this->v_global_value\n\t\t\t\t\t,'setting_name' => $this->v_setting_name\n\t\t\t\t\t,'setting_key' => $this->v_setting_key);\n\t\ttry{\n\t\t\t$this->collection->insert($arr, array('safe'=>true));\n\t\t\t$this->v_mongo_id = isset($arr['_id'])?$arr['_id']:'';\n\t\t\treturn $this->v_mongo_id;\n\t\t}catch(MongoCursorException $e){\n\t\t\t$this->v_error_code = $e->getCode();\n\t\t\t$this->v_error_message = $e->getMessage();\n\t\t\t$this->my_error();\n\t\t\treturn NULL;\n\t\t}\n\t}", "function add_disease_category($params)\n {\n $this->db->insert('disease_category',$params);\n return $this->db->insert_id();\n }", "function Save()\n\t{\n\t\t$Database = new DatabaseConnection();\n\t\t$this->pog_query = \"select `supplier_category_id` from `supplier_category` where `supplier_category_id`='\".$this->supplier_categoryId.\"' LIMIT 1\";\n\t\t$Database->Query($this->pog_query);\n\t\tif ($Database->Rows() > 0)\n\t\t{\n\t\t\t$this->pog_query = \"update `supplier_category` set \n\t\t\t`name`='\".$Database->Escape($this->name).\"' where `supplier_category_id`='\".$this->supplier_categoryId.\"'\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->pog_query = \"insert into `supplier_category` (`name` ) values (\n\t\t\t'\".$Database->Escape($this->name).\"' )\";\n\t\t}\n\t\t$Database->InsertOrUpdate($this->pog_query);\n\t\tif ($this->supplier_categoryId == \"\")\n\t\t{\n\t\t\t$this->supplier_categoryId = $Database->GetCurrentId();\n\t\t}\n\t\treturn $this->supplier_categoryId;\n\t}", "public function insert_product($data)\n {\n\n $this->db->insert('product', $data);\n $id = $this->db->insert_id();\n return $id;\n }" ]
[ "0.70707226", "0.6896239", "0.68608636", "0.685172", "0.6825215", "0.6817674", "0.6803923", "0.6765793", "0.6758371", "0.675563", "0.6738452", "0.6725255", "0.6686069", "0.6680734", "0.6651637", "0.66339874", "0.66331106", "0.6629725", "0.6580626", "0.6579337", "0.657204", "0.6549538", "0.6544192", "0.65434605", "0.65265435", "0.652154", "0.64869344", "0.64865476", "0.64795196", "0.6475415" ]
0.74344975
0
End of function / ================================================================================== PRODUCT SETUP:SIZE DIMENSION ================================================================================== / check existing data
public function dimension_check($src) { $this -> db -> select('*'); $this -> db -> from('item_dimension'); $this -> db -> where('id = ' . "'" . $src . "'"); $query = $this->db->get(); if ($query->num_rows() > 0) { foreach ($query->result() as $row) { $data[] = $row; } return $data; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function checkData()\n {\n $this->checkTable();\n }", "private function validateInitData() {\n if(!AppValidation::isMatrixDimensionsValidated($this->_dimensions)) {\n $this->setErrorMessage(\"Matrix Dimension <span>{$this->_dimensions}</span> Is Invalid!\");\n return false;\n }\n if(!AppValidation::isNumberOfOperationsValidated($this->_operations)) {\n $this->setErrorMessage(\"Number Of Operations <span>{$this->_operations}</span> Is Invalid!\");\n return false;\n }\n return true;\n }", "public function checkData();", "public function hasOutOfSizeProduct(): bool\n {\n }", "protected abstract function setUpEmptyDataSet();", "public function hasData(){\n return $this->_has(6);\n }", "private function checkDeviceData()\n {\n \\PHPUnit\\Framework\\Assert::assertTrue(\n $this->signifydCases->getCaseInfoBlock()->isAvailableDeviceData(),\n 'Device data are not available on case page in Signifyd console.'\n );\n }", "abstract public function update_metadata_size();", "function _check_sizes($table_name, $primary_key, $fields, $id_name, $skip_size_check = false, $skip_null_check = false, $save_bytes = false, $return_on_error = false)\n{\n require_code('database_action');\n\n // Check constraints\n $take_unicode_into_account = $save_bytes ? 3 : 4;\n $data_sizes = array(\n // The maximum size fields could be from a database-neutral perspective\n 'AUTO' => 4,\n 'AUTO_LINK' => 4,\n 'INTEGER' => 4,\n 'UINTEGER' => 4,\n 'REAL' => 4,\n 'SHORT_INTEGER' => 2,\n 'BINARY' => 1,\n 'MEMBER' => 4,\n 'GROUP' => 4,\n 'TIME' => 4,\n 'LONG_TRANS' => 4,\n 'SHORT_TRANS' => 4,\n 'LONG_TRANS__COMCODE' => 255 + 1,\n 'SHORT_TRANS__COMCODE' => 255 + 1,\n 'SHORT_TEXT' => $primary_key ? (150) : (255 + 1), /* We underestimate for primary key, as it is very unlikely to be very high and the higher limit only exists on our own 'xml' database driver as a run-time limit */\n 'LONG_TEXT' => 255 + 1,\n 'ID_TEXT' => $primary_key ? (16) : (80 + 1), /* We underestimate for primary key, as it is very unlikely to be very high and the higher limit only exists on our own 'xml' database driver as a run-time limit */\n 'MINIID_TEXT' => 40 + 1,\n 'IP' => 15 + 1,\n 'LANGUAGE_NAME' => 5 + 1,\n 'URLPATH' => 255 + 1,\n 'unicode_SHORT_TEXT' => $take_unicode_into_account * 255 + 1,\n 'unicode_LONG_TEXT' => $take_unicode_into_account * 255 + 1,\n 'unicode_ID_TEXT' => $take_unicode_into_account * 80 + 1,\n 'unicode_IP' => $take_unicode_into_account * 15 + 1,\n 'unicode_LANGUAGE_NAME' => $take_unicode_into_account * 5 + 1,\n 'unicode_URLPATH' => $take_unicode_into_account * 255 + 1,\n 'unicode_MD5' => $take_unicode_into_account * 33 + 1\n );\n $keywords = get_db_keywords();\n //if (in_array(strtoupper($table_name), $keywords)) fatal_exit($table_name . ' is a keyword'); // No point, as we have table prefixes\n $key_size = 0;\n $total_size = 0;\n $key_size_unicode = 0;\n $total_size_unicode = 0;\n foreach ($fields as $name => $field) {\n $key = ($field[0] == '*');\n if ($key) {\n $field = substr($field, 1);\n }\n $full_text = ($field[0] == '#');\n if ($full_text) {\n $field = substr($field, 1);\n }\n $null = ($field[0] == '?');\n if ($null) {\n $field = substr($field, 1);\n }\n $size_restricted = (strpos($name, '(') !== false);\n if ($size_restricted) {\n $name = preg_replace('#\\(.*\\)$#', '', $name);\n }\n\n if ($key) {\n $key_size += $data_sizes[$field];\n }\n if (!isset($data_sizes[$field])) {\n $data_sizes[$field] = 10; // 10=arbitrary default\n }\n $total_size += $data_sizes[$field];\n if ($key) {\n $key_size_unicode += $data_sizes[(array_key_exists('unicode_' . $field, $data_sizes) ? 'unicode_' : '') . $field];\n }\n $total_size_unicode += $data_sizes[(array_key_exists('unicode_' . $field, $data_sizes) ? 'unicode_' : '') . $field];\n\n if (($null) && (!$skip_null_check) && (($field == 'MINIID_TEXT') || ($field == 'ID_TEXT') || ($field == 'LANGUAGE_NAME') || ($field == 'IP') || ($field == 'URLPATH') || ($field == 'LONG_TEXT') || ($field == 'SHORT_TEXT'))) { // Needed for Oracle, really\n fatal_exit('You may not have a NULL string field');\n }\n /*if (($key) && (substr($id_name, 0, 1) != '#') && (!$size_restricted) && (($field == 'LONG_TEXT'))) { We now size restrict using \"(255)\"\n fatal_exit('You may not use a ' . $field . ' field for part of a key');\n }*/\n if (($key) && ($primary_key) && ($null)) {\n fatal_exit('No field that may be NULL may be a part of a primary key');\n }\n if (in_array(strtoupper($name), $keywords)) {\n fatal_exit($name . ' is a keyword');\n }\n if (preg_match('#^[\\w]+$#', $name) == 0) {\n fatal_exit('Inappropriate identifier: ' . $name);\n }\n if (strlen($name) > DB_MAX_FIELD_IDENTIFIER_SIZE) {\n fatal_exit('Inappropriate identifier, too long: ' . $name);\n }\n }\n if ((!$skip_size_check) && (substr($id_name, 0, 1) != '#')) {\n if ($key_size >= ($primary_key ? DB_MAX_PRIMARY_KEY_SIZE : DB_MAX_KEY_SIZE)) {\n if ($return_on_error) {\n return false;\n }\n fatal_exit('Key too long at ' . integer_format($key_size) . ' bytes [' . $id_name . ']'); // 252 for firebird\n }\n if (($total_size >= DB_MAX_ROW_SIZE) && ($table_name != 'f_member_custom_fields')) {\n if ($return_on_error) {\n return false;\n }\n fatal_exit('Fieldset (row) too long at ' . integer_format($total_size) . ' bytes [' . $id_name . ']');\n }\n if ($key_size_unicode >= DB_MAX_KEY_SIZE_UNICODE) {\n if ($return_on_error) {\n return false;\n }\n fatal_exit('Unicode version of key too long at ' . integer_format($key_size_unicode) . ' bytes [' . $id_name . ']'); // 252 for firebird\n }\n if (($total_size_unicode >= DB_MAX_ROW_SIZE_UNICODE) && ($table_name != 'f_member_custom_fields')) {\n if ($return_on_error) {\n return false;\n }\n fatal_exit('Unicode version of fieldset (row) too long at ' . integer_format($total_size_unicode) . ' bytes [' . $id_name . ']');\n }\n }\n return true;\n}", "public function CheckConfigRealmData() {\n if(!$this->realmData || !is_array($this->realmData) || !isset($this->realmData[1])) {\n $this->Log()->writeError('%s : unable to detect correct multiRealm config. Please, make sure that you have read INSTALL file and configured Armory right.', __METHOD__);\n return false;\n }\n foreach($this->realmData as $myRealm) {\n $tmpData = $this->aDB->selectRow(\"SELECT `id`, `name` FROM `armory_realm_data` WHERE `name`='%s' LIMIT 1\", $myRealm['name']);\n if((!$tmpData || !is_array($tmpData)) || ($tmpData['id'] != $myRealm['id'] || $tmpData['name'] != $myRealm['name'])) {\n $replace = $this->aDB->query(\"REPLACE INTO `armory_realm_data` (`id`, `name`) VALUES (%d, '%s')\", $myRealm['id'], $myRealm['name']);\n if($replace) {\n $this->Log()->writeLog('%s : realm data for realm \"%s\" was successfully added to `armory_realm_data` table.', __METHOD__, $myRealm['name']);\n }\n else {\n $this->Log()->writeError('%s : realm data for realm \"%s\" was not added to `armory_realm_data` table. Please, execute this query manually: \"REPLACE INTO `armory_realm_data` (`id`, `name`) VALUES (%d, \\'%s\\');\"', __METHOD__, $myRealm['name'], $myRealm['id'], $myRealm['name']);\n }\n }\n }\n return true;\n }", "static function check_image_size ($data, $args) {\n $field = $args[\"field\"];\n $arr_file = $data[$field];\n if ($arr_file[\"tmp_name\"]) {\n\t\t\t\t$image_size = getImageSize($arr_file[\"tmp_name\"]);\n\t \n\t if ($image_size) {\n\t\t\t\t\t$width= $image_size[0];\n\t\t\t\t\t$height= $image_size[1];\n\t\n\t\t\t\t\t$minWidth = $args[\"minWidth\"];\n\t\t\t\t\t$minHeight = $args[\"minHeight\"];\n\t\t\t\t\t$maxWidth = $args[\"maxWidth\"];\n\t\t\t\t\t$maxHeight = $args[\"maxHeight\"];\n\t\t\t\t\t\n\t\t if ($minWidth AND $width < $minWidth) { \t\t\n\t\t \treturn false;\n\t\t }\n\t\t if ($minHeight AND $height < $minHeight) { \t\t\n\t\t \treturn false;\n\t\t } \n\t\t if ($maxWidth AND $width > $maxWidth) { \t\t\n\t\t \treturn false;\n\t\t } \n\t\t if ($maxHeight AND $height > $maxHeight) { \t\t\n\t\t \treturn false;\n\t\t } \n\t } \n } \n \n \treturn true;\t \n }", "public function hasDatas(){\n return $this->_has(9);\n }", "public function existsData() {\n if (count($this->_data) == 0) {\n return false;\n } else {\n return true;\n }\n }", "public function validate_valid_array_size_equal($data, $param, $error='', $success='')\n {\n if(!$this->validate_required($data)){\n $this->_error = $error;\n return false;\n }\n\n if (!is_array($data) || sizeof($data) == (int)$param) {\n $this->_error = $error;\n return false;\n }else{\n $this->_success = $success;\n return true; \n }\n }", "protected function checkRequestHasData() {\r\n $this->nodes == null || count($this->nodes) == 0;\r\n }", "private function checkAndGetImageSizeIfNeeded(){\n\t\tif(!($this->imageWidth && $this->imageHeight)){\n\t\t\t$arr = $this->getimagesize(WEBEDITION_PATH . '../' . $this->imagePath);\n\t\t\tif(count($arr) >= 2){\n\t\t\t\t$this->imageWidth = $arr[0];\n\t\t\t\t$this->imageHeight = $arr[1];\n\t\t\t}\n\t\t}\n\t}", "private static function checkSchema(){\n global $adb;\n $result = $adb->pquery(\"show columns from ms_duplicatecheck like ?\", array('save_blocker_status'));\n if (!($adb->num_rows($result))) {\n $adb->pquery(\"ALTER TABLE `ms_duplicatecheck` ADD `save_blocker_status` TINYINT( 1 ) NOT NULL DEFAULT '0'\", array());\n }\n }", "public function populateWorldData() {\n global $autoprefix;\n\n try {\n // check if we don't already have world data\n $data_exist = $this->query_return(\"SELECT * FROM \" . TB_PREFIX . \"wdata LIMIT 1\");\n if ($data_exist && count($data_exist)) {\n return false;\n }\n\n // load the data generation SQL file\n $str = file_get_contents($autoprefix.\"var/db/datagen-world-data.sql\");\n $str = preg_replace([\"'%PREFIX%'\", \"'%WORLDSIZE%'\"], [TB_PREFIX, WORLD_MAX], $str);\n $result = $this->dblink->multi_query($str);\n \n // fetch results of the multi-query in order to allow subsequent query() and multi_query() calls to work\n while (mysqli_more_results($this->dblink) && mysqli_next_result($this->dblink)) {;}\n \n if (!$result) {\n return -1;\n }\n \n $result = $this->regenerateOasisUnits(-1);\n if (!$result) {\n return -1;\n }\n } catch (\\Exception $e) {\n return -1;\n }\n \n return true;\n }", "private function getMaxDimensions()\r\n {\r\n $this->maxRows = count($this->matrix);\r\n $this->maxCols = count($this->matrix[0]);\r\n }", "public function dimension_insert($data) {\n //Transfering data to Model\n\t\t$this->db->trans_start();\n\t\t$this->db->insert('item_dimension', $data);\n\t\t$insert_id = $this->db->insert_id();\n\t\t$this->db->trans_complete();\n\t\treturn $insert_id;\t\t\n \t}", "function validateVirtualScaledPhotoData($data, &$error_text) {\n\t\t\tif (! is_array($data)) {\n\t\t\t\t$error_text = 'Data must be an array';\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$n = 1;\n\t\t\tforeach ($data as $k=>$v) {\n\t\t\t\tif (!gp_parse_size_spec($v)) {\n\t\t\t\t\t$error_text = \"Column $k: invalid geometry spec '$v'; must be Xx[Y..] or noscale\";\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "public function itemsize_check($src1, $src2) {\n $this -> db -> select('*');\n\t\t$this -> db -> from('item_info');\n\t\t$this -> db -> where('parentid = ' . \"'\" . $src1 . \"'\");\n\t\t$this -> db -> where('size = ' . \"'\" . $src2 . \"'\");\n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n foreach ($query->result() as $row) {\n $data[] = $row;\n }\n return $data;\n }\n return false;\n }", "public function hasSize()\n {\n return $this->size !== null;\n }", "public function size_check($src) {\n $this -> db -> select('*');\n\t\t$this -> db -> from('size_info');\n\t\t$this -> db -> where('id = ' . \"'\" . $src . \"'\");\n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n foreach ($query->result() as $row) {\n $data[] = $row;\n }\n return $data;\n }\n return false;\n }", "private function setImageDimensions()\n {\n global $Core;\n\n if ($this->allowedSizes) {\n if (!isset($this->allowedSizes[$this->sizeType]) || !isset($this->allowedSizes[$this->sizeType][$this->sizeKey])) {\n $Core->doOrDie();\n } else {\n $this->width = $this->allowedSizes[$this->sizeType][$this->sizeKey]['width'];\n $this->height = $this->allowedSizes[$this->sizeType][$this->sizeKey]['height'];\n }\n }\n }", "function hasHeightWidth() {\n\t\tif(!empty($this->width) && !empty($this->height)) {\n\t\t\t// TODO: devlog start\n\t\t\tif(TYPO3_DLOG) {\n\t\t\t\tt3lib_div::devLog($this->mapName.': height: '.$this->height.', width: '.$this->width, 'wec_map_api');\n\t\t\t}\n\t\t\t// devlog end\n\t\t\treturn true;\n\t\t} else {\n\t\t\t// TODO: devlog start\n\t\t\tif(TYPO3_DLOG) {\n\t\t\t\tt3lib_div::devLog($this->mapName.': width or height missing', 'wec_map_api', 3);\n\t\t\t}\n\t\t\t// devlog end\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkEmpty() {\n\t\t\t\tif ($this->rows\t> 0) $this->empty = FALSE;\n\t\t\t\telse $this->empty = TRUE;\n\t\t\t}", "public function hasDatas(){\n return $this->_has(1);\n }", "public function valid()\n {\n $keys = $this->getKeys();\n if (!isset($keys[$this->databag_current_position])) {\n return false;\n }\n return isset($this->dataelement_data[ $keys[$this->databag_current_position] ]);\n }", "protected function assertData(): void\n {\n if (!\\array_key_exists(self::DATA, $this->result)) {\n throw new \\InvalidArgumentException('A primary data should be set.');\n }\n }" ]
[ "0.60379654", "0.59819865", "0.5607801", "0.5572776", "0.5484581", "0.5439459", "0.5430245", "0.54287624", "0.5393698", "0.5381933", "0.5365994", "0.5344969", "0.5342156", "0.5337153", "0.53210163", "0.5309433", "0.5290176", "0.52834773", "0.5278189", "0.527481", "0.5270433", "0.5263465", "0.5251751", "0.5233038", "0.52153444", "0.52121055", "0.5203899", "0.5200264", "0.5198309", "0.5179127" ]
0.60150105
1
Conditional tag usage example VAT usage.
public function testConditionalTagsVAT() { $s = '{vat_applied?}VAT is {$vat}%{/?}' . '{vat_zero?}VAT is zero{/?}' . '{vat_not_applied?}VAT is not applied{/?}'; $f = function ($vat) use ($s) { return (new \atk4\ui\Template($s))->set([ 'vat_applied' => !empty($vat), 'vat_zero' => ($vat === 0), 'vat_not_applied' => ($vat === null), 'vat' => $vat, ])->render(); }; $this->assertEquals('VAT is 21%', $f(21)); $this->assertEquals('VAT is zero', $f(0)); $this->assertEquals('VAT is not applied', $f(null)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function we_tag_ifShopVat(array $attribs){\n\tif(!we_shop_category::isCategoryMode()){\n\t\tif(($foo = attributFehltError($attribs, 'id', __FUNCTION__))){\n\t\t\techo $foo;\n\t\t\treturn false;\n\t\t}\n\t\t$id = weTag_getAttribute('id', $attribs, -1, we_base_request::INT);\n\n\t\t$vatId = (isset($GLOBALS['lv']) && $GLOBALS['lv']->f(WE_SHOP_VAT_FIELD_NAME) ?\n\t\t\t\t\t\t$GLOBALS['lv']->f(WE_SHOP_VAT_FIELD_NAME) :\n\t\t\t\t\t\t$GLOBALS['we_doc']->getElement(WE_SHOP_VAT_FIELD_NAME));\n\n\n\t\tif(!$vatId){\n\t\t\t$shopVat = we_shop_vats::getStandardShopVat();\n\t\t\tif($shopVat){\n\t\t\t\t$vatId = $shopVat->id;\n\t\t\t}\n\t\t}\n\n\t\treturn ($id == $vatId);\n\t} else {\n\t\t$match = intval(weTag_getAttribute('match', $attribs, 0, we_base_request::INT));\n\t\t$field = weTag_getAttribute('field', $attribs, 'id', we_base_request::STRING);\n\t\t$lvOnly = weTag_getAttribute('lvOnly', $attribs, false, we_base_request::BOOL);\n\n\t\tif(isset($GLOBALS['lv'])){\n\t\t\t$catID = $GLOBALS['lv']->f(WE_SHOP_CATEGORY_FIELD_NAME) ? : 0;\n\t\t\t$wedocCategory = $GLOBALS['lv']->f('wedoc_Category') ? : '';\n\t\t} elseif(!$lvOnly) {\n\t\t\t$catID = $GLOBALS['we_doc']->getElement(WE_SHOP_CATEGORY_FIELD_NAME) ? : 0;\n\t\t\t$wedocCategory = $GLOBALS['we_doc']->Category ? : '';\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\t$attribs['shopcategoryid'] = $catID;\n\t\t$attribs['wedoccategories'] = $wedocCategory;\n\t\t$vatField = we_tag('shopVat', $attribs);\n\n\t\tswitch ($field){\n\t\t\tcase 'id':\n\t\t\t\treturn $match === 0 ? boolval($vatField) : $match === intval($vatField);\n\t\t\tdefault:\n\t\t\t\treturn boolval($vatField);\n\t\t}\n\t}\n}", "function vat($voucher, $accountplan, $VAT, $oldVatID, $VatID, $VatPercent, $closed = false) {\n global $_lib;\n $html = '';\n\n if( ($accountplan->EnableVAT == 1) and ($voucher->DisableAutoVat != 1) )\n {\n if($accountplan->EnableVATOverride or $VAT->EnableVatOverride)\n {\n $html .= $VatID . ' ' . '<nobr>' . $_lib['form3']->text(array('name' => 'voucher.Vat', 'value' => $VatPercent, 'class' => 'voucher', 'width' => '4', 'tabindex' => $tabindex++, 'accesskey' => 'M', 'readonly' => $closed)) . '%</nobr>';\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.VatID', 'value' => $VatID));\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.VatOld', 'value' => $VatPercent));\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.VatIDOld', 'value' => $VatID));\n }\n else\n {\n if(isset($VatPercent))\n {\n #Not secure with hidden VAT code if security is very important\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.Vat', 'value' => $VatPercent));\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.VatID', 'value' => $VatID));\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.VatOld', 'value' => $VatPercent));\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.VatIDOld', 'value' => $VatID));\n\n if($oldVatID != $VatID)\n $html .= $VatID . ' ' . '<font color=\"red\">'.$VatPercent.'%</font>';\n else\n $html .= $VatID . ' ' . $VatPercent.\"%\";\n }\n }\n } else {\n if($voucher->Vat > 0) {\n $html .= $voucher->VatID . ' ' . $voucher->Vat . \"%\";\n }\n }\n\n return $html;\n }", "public static function conditional();", "public function validVat()\n {\n $vat = static::randomNumber(8);\n if (!$this->isValid($vat)) {\n return $this->validVat();\n }\n return ((static::randomNumber() >= 4) ? 'RO' : '') . $vat;\n }", "public function testGetProductVats()\n {\n // deleting discounts to ignore bundle problems\n foreach ( $this->aDiscounts as $oDiscount )\n $oDiscount->delete();\n\n // setting custom VAT for variant\n $this->oVariant->oxarticles__oxvat = new oxField(9, oxField::T_RAW);\n $this->oVariant->save();\n\n $oBasket = new oxbasket();\n $oBasket->addToBasket( $this->oArticle->getId(), 10 );\n $oBasket->addToBasket( $this->oVariant->getId(), 10 );\n $oBasket->calculateBasket( false );\n\n $aTestVats = array( 19 => oxLang::getInstance()->formatCurrency( ( 10*19 - 10*19/1.19 ) ),\n 9 => oxLang::getInstance()->formatCurrency( ( 10*19 - 10*19/1.09 ) )\n );\n\n $this->assertEquals( $aTestVats, $oBasket->getProductVats());\n }", "public function conditional_tags_supported_other(){\n\t\t\n\t\t\treturn array(\t\n\t\t\t\t\t\t'get_option'\t\t\t\t\t=> array('status' => true, 'bool_only' => false),\n\t\t\t\t\t\t'is_active_sidebar'\t\t\t\t=> array('status' => true, 'bool_only' => false),\n\t\t\t\t\t\t'wp_attachment_is_image'\t\t=> array('status' => true, 'bool_only' => true),\n\t\t\t\t\t\t'current_user_can'\t\t\t\t=> array('status' => true, 'bool_only' => false), // NOTE: args are NOT supported, just the capability\n\t\t\t\t\t\t\n\t\t\t\t\t\t'is'\t\t\t\t\t\t\t=> array('status' => true, 'bool_only' => true),\n\t\t\t\t\t\t'is_IIS'\t\t\t\t\t\t=> array('status' => true, 'bool_only' => true),\n\t\t\t\t\t\t'is_iis7'\t\t\t\t\t\t=> array('status' => true, 'bool_only' => true),\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t);\n\t\t}", "private function applyVat(){\n $vat =$this->vat * $this->total;\n $this->total+= $vat;\n $this->billDetails .= \"Taxes: \" . $vat .\" \". $this->currencyManager->getSymbol($this->currency) . \"\\n\";\n }", "private function conditional() {\n\t\treturn true;\n\t}", "public function testTheShortEchoTagMayBeUsedInTemplates(): void\n {\n }", "public function safeVat()\n {\n $vat = static::randomNumber(8);\n if ($this->isValid($vat)) {\n return $this->safeVat();\n }\n return ((static::randomNumber() >= 4) ? 'RO' : '') . $vat;\n }", "function we_tag_saferpay($attribs) {\n\tglobal $DB_WE;\n\t$name = we_getTagAttribute(\"name\",$attribs);\n\t$foo = attributFehltError($attribs,\"pricename\",\"saferpay\");\n\tif($foo)\n\t return $foo;\t\n\tif(!$name)\n\t\t$foo = attributFehltError($attribs,\"shopname\",\"saferpay\");\n\tif($foo)\n\t\treturn $foo;\n\t\n\t$shopname = we_getTagAttribute(\"shopname\",$attribs);\n\t$shopname = $shopname ? $shopname : $name;\n\t$pricename = we_getTagAttribute(\"pricename\",$attribs);\n\n\t$onsuccess = we_getTagAttribute(\"onsuccess\",$attribs);\n\t$onfailure = we_getTagAttribute(\"onfailure\",$attribs);\n\t$onabortion = we_getTagAttribute(\"onabortion\",$attribs);\n\t\n\t\n\t$netprices = we_getTagAttribute(\"netprices\",$attribs,'true', true, true);\n\t$useVat = we_getTagAttribute(\"usevat\",$attribs,'true', true);\n\t\n\tif ($useVat) {\n\t\trequire_once(WE_SHOP_MODULE_DIR . 'weShopVatRule.class.php');\n\t\t\n\t\tif (isset($_SESSION['webuser'])) {\n\t\t\t$_customer = $_SESSION['webuser'];\n\t\t} else {\n\t\t\t$_customer = false;\n\t\t}\n\t\t\n\t\t$weShopVatRule = weShopVatRule::getShopVatRule();\n\t\t$calcVat = $weShopVatRule->executeVatRule($_customer);\n\t}\n\n // var_dump($attribs);\n if (isset($GLOBALS[$shopname])) {\n \t\t$basket = $GLOBALS[$shopname];\n\t\t\n\t\t$shoppingItems = $basket->getShoppingItems();\n\t\t$cartFields = $basket->getCartFields();\n\t\t\n\t\tif (sizeof($shoppingItems) == 0) {\n\t\t\treturn; \n\t\t}\n/* ****** get the currency ******* */\n $DB_WE = !isset($DB_WE) ? new DB_WE : $DB_WE;\n\t\t\t$DB_WE->query(\"SELECT strFelder from \".ANZEIGE_PREFS_TABLE.\" where strDateiname = 'shop_pref'\");\n\t\t\t$DB_WE->next_record();\n\t\t\t$feldnamen = explode(\"|\",$DB_WE->f(\"strFelder\"));\n\t\t\tif( isset($feldnamen[0])){ // determine the currency \n\t\t\t\tif($feldnamen[0]==\"$\" || $feldnamen[0]==\"USD\"){\n\t\t \t\t\t$currency = \"USD\";\n\t \t\t}elseif ($feldnamen[0]==\"�\" || $feldnamen[0]==\"GBP\"){\n\t\t \t\t\t$currency = \"GBP\";\n\t\t\t\t}elseif ($feldnamen[0]==\"AUD\"){\n\t\t \t\t\t$currency = \"AUD\";\n\t\t\t\t}elseif ($feldnamen[0]==\"CHF\" || $feldnamen[0]==\"SFR\"){\n\t\t \t\t\t$currency = \"CHF\";\n\t\t\t\t}elseif ($feldnamen[0]==\"CAD\"){\n\t\t \t\t\t$currency = \"CAD\";\n\t \t\t}else{\n\t \t\t\t$currency = \"EUR\";\t\n\t \t\t}\n\t\t\t}else{\n\t\t\t\t\t$currency = \"EUR\";\n\t\t\t}\n/* ****** get the currency ******* */ \n \n/* ***** get the preferences ***** */ \n $DB_WE->query(\"SELECT strFelder from \".ANZEIGE_PREFS_TABLE.\" where strDateiname = 'payment_details'\");\n\t\t$DB_WE->next_record();\n\t\t$formField = explode(\"|\",$DB_WE->f(\"strFelder\"));\n\t\tif( isset($formField[8])){ // determine the language\n\t\t\t$langID = $formField[8];\n\t\t}\n\t\tif( isset($formField[9])){ // determine the Notify-Email \n\t\t\t$accountID = $formField[9];\n\t\t}\n\t\tif( isset($formField[10])){ // determine the Notify-Email \n\t\t\t$notifyAddr = $formField[10];\n\t\t}\n\t\tif( isset($formField[11])){ // determine the notify-Email\n $allowColl = $formField[11];\n\t\t}\n\t\tif( isset($formField[12])){ // determine the delivery if yes or no \n $delivery = $formField[12];\n\t\t}\n\t\tif( isset($formField[13])){ // determine the user notify if yes or no \n $userNotify = $formField[13];\n\t\t}\n\t\tif( isset($formField[14])){ // determine the providerset\n $providerset = $formField[14]; \n\t\t}\n if( isset($formField[15])){ // determine the cmd path\n $execPath = $formField[15]; \n \t}\n if( isset($formField[16])){ // determine the conf path\n $confPath = $formField[16]; \n \t}\n if( isset($formField[17])){ // determine the conf path\n $desc = $formField[17]; \n \t\t} \n/* ***** get the preferences ***** */ \n\n/* ***** get the further links ***** */ \n\t\t\t\t$successprelink= id_to_path($onsuccess);\n $successlink = \"http://\".$_SERVER['SERVER_NAME'].$successprelink;\n //print $successlink;\n \n $failureprelink= id_to_path($onfailure);\n $failurelink = \"http://\".$_SERVER['SERVER_NAME'].$failureprelink;\n //print $failurelink;\n \n $abortionprelink= id_to_path($onabortion);\n $abortionlink = \"http://\".$_SERVER['SERVER_NAME'].$abortionprelink;\n //print $failurelink;\n/* ***** get the further links ***** */ \n\n \t\n\t$summit = 0;\n\tforeach ( $shoppingItems as $key => $item) {\n\t\n $itemTitle = (isset($item['serial']['we_shoptitle']) ? $item['serial']['we_shoptitle'] : $item['serial']['shoptitle']) ;\n $itemPrice = (isset($item['serial'][\"we_\".$pricename]) ? $item['serial'][\"we_\".$pricename] : $item['serial'][$pricename]);\n \n // foreach article we must determine the correct tax-rate\n\t\t\trequire_once(WE_SHOP_MODULE_DIR . 'weShopVats.class.php');\n\t\t\t$vatId = isset($item['serial'][WE_SHOP_VAT_FIELD_NAME]) ? $item['serial'][WE_SHOP_VAT_FIELD_NAME] : 0;\n\t\t\t$shopVat = weShopVats::getVatRateForSite($vatId, true, false);\n\t\t\tif ($shopVat) { // has selected or standard shop rate\n\t\t\t\t$$item['serial'][WE_SHOP_VAT_FIELD_NAME] = $shopVat;\n\t\t\t} else { // could not find any shoprates, remove field if necessary\n\t\t\t\tif (isset($shoppingItem['serial'][WE_SHOP_VAT_FIELD_NAME])) {\n\t\t\t\t\tunset($shoppingItem['serial'][WE_SHOP_VAT_FIELD_NAME]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n \n\t if($netprices){\n\t \t $totalVat = $itemPrice / 100 * $shopVat;\n\t \t $totalVats = number_format($totalVat,2,'.',''); \n\t\t\t // add the polychronic taxes\n // $totalVats;\n\t } \n\t\t\t \n \t\t\t// determine the shipping cost by accumulating the total \n $summit += ($itemPrice*$item['quantity']+$totalVats);\n \n \n }\n \n \n\t //get the shipping costs\n\t require_once(WE_SHOP_MODULE_DIR . 'weShippingControl.class.php');\n\t require_once($_SERVER['DOCUMENT_ROOT'] . '/webEdition/we/include/we_tags/we_tag_ifRegisteredUser.inc.php');\n\t\n\t\t\t$weShippingControl = weShippingControl::getShippingControl();\n\t\t\t\n\t\t\tif (we_tag_ifRegisteredUser(array(), '')) { // check if user is registered\n\t\t\t $customer = $_SESSION['webuser'];\n\t\t } else {\n\t\t\t $customer = false;\n\t\t }\n\t\t\t$cartField[WE_SHOP_SHIPPING] = array(\n\t\t\t\t'costs' => $weShippingControl->getShippingCostByOrderValue($summit, $customer),\n\t\t\t\t'isNet' => $weShippingControl->isNet,\n\t\t\t\t'vatRate' => $weShippingControl->vatRate\n\t\t\t ); \n\t\t\t \n\t\t\t $shippingCosts = $cartField[WE_SHOP_SHIPPING]['costs'];\n\t\t \t$isNet = $cartField[WE_SHOP_SHIPPING]['isNet'];\n\t\t \t$vatRate = $cartField[WE_SHOP_SHIPPING]['vatRate'];\n\t\t \t$shippingCostVat = $shippingCosts / 100 * $vatRate;\n\t\t \t$shippingFee = $shippingCosts + $shippingCostVat;\n\n // sum all costs\n\t\t $totalSum = $summit+$shippingFee; \n\t\t // to be reserved in minor currency unit e.g. EUR 1.35 must be passed as 135 \t\n\t\t $strAmount = str_replace(\"-\",\"\",number_format( $totalSum, 2, '-', ''));\n\t\t \n########################################################################\n########################### submit starts here #########################\n########################################################################\t\t \t\t \n\t\n\t\t\t$attributes = array(\"-a\", \"AMOUNT\", (int) $strAmount,\n\t\t \"-a\", \"CURRENCY\", $currency,\n\t\t \"-a\", \"DESCRIPTION\",$desc ,\n\t\t \"-a\", \"ALLOWCOLLECT\", $allowColl,\n\t\t \"-a\", \"DELIVERY\", $delivery,\n\t\t \"-a\", \"ACCOUNTID\", $accountID,\n\t\t \"-a\", \"BACKLINK\", $abortionlink,\n\t\t \"-a\", \"FAILLINK\", $failurelink,\n\t\t \"-a\", \"SUCCESSLINK\", $successlink,\n\t\t \"-a\", \"ORDERID\", $_SESSION['webuser']['ID'],\n\t\t \"-a\", \"PROVIDERSET\", $providerset,\n\t\t \"-a\", \"LANGID\", $langID,\n\t\t \"-a\", \"NOTIFYADDRESS\", $notifyAddr\n\t\t );\n\t\t \n\t\t\t\n\t\t\t$_SESSION['strAmount'] = $strAmount;\n\t\t\t$strAttributes = join(\" \", $attributes);\n\t\t \n\t\t\t/* *** debugging *** */\n\t\t //print $strAttributes.\"\\n<br/>\";\n\t\t // print \"<br/>\".$execPath;\n\t\t // print \"<br/>\".$confPath;\n\t\t // var_dump($attribs);\n\t\t // print $langID;\n\t\t /* *** debugging *** */\n\t\t \n\t\t switch($langID){\n\t\t \tcase \"de\" :\n\t\t \t $processOK = 'Bitte haben Sie einen Moment Geduld.<br>Falls sich kein Fenster &ouml;ffnet klicken Sie bitte <a href=\"' . $payinit_url . '\" onclick=\"OpenSaferpayTerminal(\\'' . $payinit_url . '\\', this, \\'LINK\\');\">hier</a>'; \n\t\t $processError = 'Leider gab es Probleme mit der Abbuchung. Bitte versuchen Sie es sp&auml;ter erneut.'; \n\t\t \t break;\n\t\t case \"en\" :\n\t\t \t $processOK = 'This will take some seconds.<br>If no window opens please click <a href=\"' . $payinit_url . '\" onclick=\"OpenSaferpayTerminal(\\'' . $payinit_url . '\\', this, \\'LINK\\');\">here</a>';\n\t\t \t $processError = 'A major problem occured. Please try again later.';\n\t\t \t break;\n\t\t \tcase \"fr\" :\n\t\t \t $processOK = 'Soyez patient, cela prendra quelques secondes.<br>Si aucune fen�tre s affiche, cliquez <a href=\"' . $payinit_url . '\" onclick=\"OpenSaferpayTerminal(\\'' . $payinit_url . '\\', this, \\'LINK\\');\">ici</a>';\n\t\t \t $processError = 'Une erreur Une erreur s est produite. S il vous pla�t, essayez de nouveau ult�rieurement..';\n\t\t \t break; \n\t\t \tcase \"it\" :\n\t\t \t $processOK = 'Sia prego paziente.<br>Se nessuna finestra apre, clicca <a href=\"' . $payinit_url . '\" onclick=\"OpenSaferpayTerminal(\\'' . $payinit_url . '\\', this, \\'LINK\\');\">prego qui</a>';\n\t\t \t $processError = 'Un errore grave � occorso. Prego prova ancora successivamente..';\n\t\t \t break;\n\t\t \tdefault:\n $processOK = 'Bitte haben Sie einen Moment Geduld.<br>Falls sich kein Fenster &ouml;ffnet klicken Sie bitte <a href=\"' . $payinit_url . '\" onclick=\"OpenSaferpayTerminal(\\'' . $payinit_url . '\\', this, \\'LINK\\');\">hier</a>'; \n\t\t $processError = 'Leider gab es Probleme mit der Abbuchung. Bitte versuchen Sie es sp&auml;ter erneut.'; \n\t\t } \n\t\t \n\t\n/* command line */\n$command = $execPath.\"saferpay -payinit -p $confPath $strAttributes\";\n\n if (!$execPath || !$confPath ){\n \t print $GLOBALS[\"l_shop\"][\"saferpayError\"];\n \t print $strAttributes;\n exit;\n }else{\n\n/* get the payinit URL */\n$fp = popen($command, \"r\");\n$payinit_url = str_replace(\"\\n\",\"\",fread($fp, 4096));\n$payinit_url = str_replace(\"\\r\",\"\",$payinit_url);\n }\n\nif($payinit_url){\n\tprint $processOK;\n \n \techo '<script LANGUAGE=\"JAVASCRIPT\">\n\t<!--\n\tOpenSaferpayWindowJScript(\\'' . $payinit_url . '\\');\n\t//-->\n\t</script>\n\t';\n}else{\n\tprint $processError;\n} \t\t \n\n//data in DB\n include_once($_SERVER[\"DOCUMENT_ROOT\"].\"/webEdition/we/include/we_tags/we_tag_writeShopData.inc.php\");\n \n we_tag_writeShopData($attribs);\n\n\n \t}\n\treturn;\n}", "function property_status_banner($property_status) {\n\tglobal $post;\n\t\t$property_status = get_post_meta($post->ID, '_property_status', true);\n\tif($property_status==\"under_offer\") {\n\t\techo '<span class=\"propertyUnderOffer\"></span>';\n\t} else if($property_status==\"let\") {\n\t\techo '<span class=\"propertyLet\"></span>';\n\t}\n}", "public function usedVATOnDate($date)\n {\n $period = $this->getPeriod($date);\n\n return !is_null($period) && !empty($period->getStandardRate());\n }", "public function isConditionalParse();", "public function conditionalize(&$context) {\n\t\t\tif (empty($context) || !isset($context['datasource'])\n\t\t\t\t|| !isset($context['datasource']->dsParamConditionalizer)\n\t\t\t\t|| empty($context['datasource']->dsParamConditionalizer)\n\t\t\t) return;\n\n\t\t\tif (!class_exists('Conditionalizer')) {\n\t\t\t\trequire_once(EXTENSIONS . '/conditionalizer/lib/class.conditionalizer.php');\n\t\t\t}\n\n\t\t\t$data = $context['datasource']->__processParametersInString($context['datasource']->dsParamConditionalizer, array('env' => Frontend::Page()->Env(), 'param' => Frontend::Page()->Params()));\n\t\t\t$e = Conditionalizer::parse($data);\n\t\t\tif (!empty($e) && !Conditionalizer::evaluate($e)) {\n\t\t\t\t$context['xml'] = new XMLElement($context['datasource']->dsParamROOTELEMENT, '<error>'.__('Condition not met.').'</error>');\n\t\t\t}\n\t\t}", "function vtsc_show_on( $atts, $content = null ) {\n extract(shortcode_atts(array(\t'device' \t=> 'desktops' // Available options: desktops, tablets, phones\n\t\t\t\t\t\t\t\t\t), $atts));\n\n\treturn '<span class=\"show-on-' . $device . '\">' . do_shortcode($content) . '</span>';\n}", "public function vat_rate()\n\t{\n\t\t// If we are using custom VAT codes module then calculate retail cost based upon this...else use default value from config.\n\t\treturn Caffeine::modules('vat_codes') ? $this->product->vat_code->value : Kohana::config('ecommerce.vat_rate');\n\t}", "function vat( $calcCount=true, $withOptions=true )\r\n {\r\n $vat = $this->correctPrice( $calcCount, $withOptions, true ) -\r\n $this->correctPrice( $calcCount, $withOptions, false );\r\n return $vat;\r\n }", "function getVat();", "private function generateReviewRequestedTag(): string\n {\n $tag = '<tag k=\"review_requested\" v=\"no\"/>';\n if ($this->reviewRequested) {\n $tag = '<tag k=\"review_requested\" v=\"yes\"/>';\n }\n return $tag;\n }", "public function getVat()\n {\n return $this->vat;\n }", "function setVat($vat);", "private function check_conditional_tag( $conditional_tag ) {\n\t\tif ( is_array( $conditional_tag ) ) {\n\t\t\treturn $conditional_tag[0]( $conditional_tag[1] );\n\t\t} else {\n\t\t\treturn $conditional_tag();\n\t\t} // if/else()\n\t}", "function wc_eu_vat_get_vat_from_order( $order ) {\n\tif ( ! $order ) {\n\t\treturn '';\n\t}\n\n\t$vat = $order->get_meta( '_billing_vat_number', true ) ? $order->get_meta( '_billing_vat_number', true ) : '';\n\n\tif ( ! $vat ) {\n\t\t$vat = $order->get_meta( '_vat_number', true ) ? $order->get_meta( '_vat_number', true ) : '';\n\t}\n\n\treturn $vat;\n}", "function display_variant_test( $control_html, $slug ) {\n\t$variants = get_variants();\n\n\t// No variant.\n\tif ( empty( $variants[ $slug ] ) ) {\n\t\techo wp_kses_post( $control_html );\n\t\treturn;\n\t}\n\n\t$active_variant_id = get_active_ab_test( $slug );\n\n\t// No active variant.\n\tif ( empty( $active_variant_id ) ) {\n\t\techo wp_kses_post( $control_html );\n\t\treturn;\n\t}\n\n\t$variant_settings = get_post_meta( $active_variant_id, 'variant-settings', true );\n\n\t// No valid callback.\n\tif ( ! is_callable( $variants[ $slug ]['display_callback'] ) ) {\n\t\techo wp_kses_post( $control_html );\n\t\treturn;\n\t}\n\n\t$variant_html = \\call_user_func( $variants[ $slug ]['display_callback'], $active_variant_id, $variant_settings );\n\n\t// No variant data.\n\tif ( is_null( $variant_html ) ) {\n\t\techo wp_kses_post( $control_html );\n\t\treturn;\n\t}\n\n\techo sprintf(\n\t\t'<variant-test\n\t\t\tdata-type=\"%1$s\"\n\t\t\tcontrol=\"%2$s\"\n\t\t\tvariant=\"%3$s\"\n\t\t\ttraffic-percentage=\"%4$d\"\n\t\t>\n\t\t%5$s\n\t\t</variant-test>',\n\t\tesc_attr( $slug ),\n\t\tesc_attr( wp_json_encode( $control_html, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES ) ),\n\t\tesc_attr( wp_json_encode( $variant_html, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES ) ),\n\t\tesc_attr( min( 100, max( 0, $variant_settings['traffic_percentage'] ?? 50 ) ) ),\n\t\twp_kses_post( $control_html )\n\t);\n}", "public function requiresVoucher(): bool;", "public function testCreateTag()\n {\n }", "function template_attribute( $value, $data ) {\n\n\t\t\t// Extract data\n\t\t\textract( array_merge( array(\n\t\t\t\t'output' => '',\n\t\t\t\t'post' => null,\n\t\t\t\t'data' => '',\n\t\t\t), $data ) );\n\n\t\t\t// Get and extract shortcode attributes\n\t\t\t$atts = array();\n\t\t\tparse_str( $data, $atts );\n\n\t\t\t$atts = vc_map_get_attributes( 'vcex_gitem_post_video', $atts );\n\n\t\t\textract( $atts );\n\n\t\t\t// Get post id\n\t\t\t$post_id = ! empty( $post_id ) ? $post_id : $post->ID;\n\n\t\t\t// Get video\n\t\t\tif ( 'vc_grid_item' == get_post_type( $post->ID ) ) {\n\t\t\t\t$video = 'https://www.youtube.com/watch?v=2JyW4yAyTl0';\n\t\t\t} else {\n\t\t\t\t$video = wpex_get_post_video( $post_id );\n\t\t\t}\n\n\t\t\t// Parse video into HTML format\n\t\t\t$video = $video ? vcex_get_post_video_html( $video ) : '';\n\n\t\t\t// Display video\n\t\t\tif ( $video ) {\n\n\t\t\t\t// Custom CSS\n\t\t\t\tif ( $css ) {\n\t\t\t\t\t$css = ' ' . vc_shortcode_custom_css_class( $css );\n\t\t\t\t}\n\n\t\t\t\t// Generate output\n\t\t\t\t$output .= '<div class=\"vcex-gitem-post-video wpex-clr' . $css . '\">';\n\n\t\t\t\t\t$output .= $video;\n\n\t\t\t\t$output .= '</div>';\n\n\t\t\t\t// Return output\n\t\t\t\treturn $output;\n\n\t\t\t}\n\n\t\t}", "public function getVat();", "public function hasAnyTag();" ]
[ "0.6162099", "0.5672273", "0.54230005", "0.51605225", "0.51223284", "0.5097157", "0.5077511", "0.50350434", "0.49886847", "0.498291", "0.49525508", "0.4952372", "0.49390694", "0.49142894", "0.48940402", "0.48883563", "0.48747557", "0.48570815", "0.48407614", "0.48210075", "0.48122188", "0.48070273", "0.4800634", "0.47941998", "0.47885117", "0.47792065", "0.4778671", "0.4777948", "0.47754014", "0.47729146" ]
0.75729424
0
Non existant template throw exception.
public function testBadTemplate1() { $t = new \atk4\ui\Template(); $t->load('bad_template_file'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testInvalidTemplate() {\n $t = new Template('foo-fail');\n }", "function template_exists($template_name) {\n global $C;\n return php_file_exists($C->TEMPLATES, $class_name);\n }", "private static function checkTemplate()\n\t{\n\t\tif (!file_exists(self::$tmpl_file)) {\n\t\t\tthrow new Exception(\"Cant seem to find \".self::$tmpl_file);\n\t\t}\n\t\t// If template directory not set, assume base on template file\n\t\tif(self::$tmpl_dir === ''){\n\t\t\tself::$tmpl_dir = dirname(self::$tmpl_file);\n\t\t}\n\n\t\tself::$tmpl_html = file_get_contents(self::$tmpl_file);\n\t\t \n\t}", "public function testBadTemplate2()\n {\n $t = new \\atk4\\ui\\Template();\n $this->assertFalse($t->tryLoad('bad_template_file'));\n }", "public function testBadTemplate2()\n {\n $t = new \\atk4\\ui\\Template();\n $this->assertFalse($t->tryLoad('bad_template_file'));\n }", "function get_template( $template_path ) {\r\n\r\n $located = 'templates/' . $template_path . '.php';\r\n\r\n if ( ! file_exists( $located ) ) {\r\n $log = 'Template error: ' . $template_path . ' file does not exist.';\r\n echo $log;\r\n return;\r\n }\r\n\r\n include $located;\r\n}", "public function testBadTemplate1()\n {\n $t = new \\atk4\\ui\\Template();\n $this->expectException(Exception::class);\n $t->load('bad_template_file');\n }", "public function existsTemplate()\n\t{\n\t\t$ext = NameManager::getTemplateExtension();\n\t\t$templateDir = PathManager::getViewTemplateDirectory();\n\t\t$template = $this->_template . '.' . $ext;\n\t\t$templatePath = $templateDir . '/' . $template;\n\t\t$exists = file_exists($templatePath);\n\t\treturn $exists;\n\t}", "public function getForEmptyTemplateFileNameReturnsTemplateInstance() {\n\t\t$this->assertInstanceOf(\n\t\t\t'Tx_Oelib_Template',\n\t\t\tTx_Oelib_TemplateRegistry::get('')\n\t\t);\n\t}", "function include_template($template){\n\t\t\t$template_path = './templates/'.$template.'.template.php';\n\n\t\t\tif (is_readable($template_path) && file_exists($template_path))\n\t\t\t\treturn $template_path;\n\t\t\telse\n\t\t\t\tdie ('Page '.$template_path.' inexistant ou innaccessible <br /> <a href=\"index.php\">retour &agrave; l\\'accueil</a>');\n\n\t}", "function check_template() {\n\t\t\tif ( strpos( $this->options['template']) === false || empty( $this->options['template'] ) )\n\t\t\t\treturn false;\n\n\t\t\treturn true;\n\t\t}", "function templateExists($a_template_name)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$set = $ilDB->query(\"SELECT * FROM style_template WHERE \".\n\t\t\t\"style_id = \".$ilDB->quote($this->getId(), \"integer\").\" AND \".\n\t\t\t\"name = \".$ilDB->quote($a_template_name, \"text\"));\n\t\tif ($rec = $ilDB->fetchAssoc($set))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function templateExists( $template ) {\n return parent::templateExists( \"$template.{$this->templateExtension}\" );\n }", "function st_get_template($file,$data = array()){\n $file = ST_DIR.'/templates/'.$file;\n if(file_exists($file)){\n include($file); return true;\n }\n return false;\n}", "public function testInvalidRenderTemplate() {\n touch(AbstractTemplate::getPath().'foo-fail.tpl.php');\n $t = new Template('foo-fail');\n unlink(AbstractTemplate::getPath().'foo-fail.tpl.php');\n try {\n $t->render();\n $this->fail();\n } catch (\\RuntimeException $e) {\n }\n }", "private function checkTmpDir(){\n\n $_type = strtolower($this->Filetype);\n $_paths = $this->Paths;\n $_template = dirname(__FILE__, 4).$_paths[\"Tmp\"] . $_type;\n\n if( file_exists($_template) ){\n $this->Template = file_get_contents($_template);\n $this->replacement($this->Template);\n }else{\n echo \"Nao existe um template para arquivos do tipo {$_type}.\\n\";\n echo \"Crie um template para ele no diretorio: {$_template}\\n\";\n echo \"Especificamente com o nome: {$_type} e sem extensao. \\n\";\n die;\n }\n }", "public function templateFileExists() {\r\n\t\treturn isset($this->strTemplateFile);\r\n\t}", "public function findTemplatePath() {\r\n \t\tforeach (tx_auxo_loader::getTemplatePathes($this->extension, $this->module) as $path) {\r\n\t\t\t$fullpath = $path . '/' . $this->getTemplate();\r\n\t\t\tif (is_readable($fullpath)) {\r\n\t\t\t\treturn $path;\r\n\t\t\t}\r\n \t\t}\r\n \t\t\r\n \t\tthrow new tx_auxo_presentationException(sprintf('Template %s not found', $this->getTemplate()));\r\n\t}", "static function templateExists(string $name): bool\n {\n return Core::$pluginManager->getPlugins()->hasTemplate($name);\n }", "protected function findTemplate()\n {\n if ($this->_path == false){\n throw new PHPTAL_ConfigurationException('No template file specified');\n }\n\n // template source already defined\n if ($this->_source != null){\n return;\n }\n\n array_push($this->_resolvers, new PHPTAL_FileSourceResolver($this->_repositories));\n foreach ($this->_resolvers as $resolver){\n $source = $resolver->resolve($this->_path);\n if ($source != null){\n $this->_source = $source;\n break;\n }\n }\n array_pop($this->_resolvers);\n\n if ($this->_source == null){\n throw new PHPTAL_IOException('Unable to locate template file '.$this->_path);\n }\n }", "public function testMapContentTemplatesExist()\n {\n // Fetch all the countries in the DB\n $countries = Country::all();\n \n // Iterate the countries and make sure the template files exist\n foreach($countries as $country) {\n $path = \"resources/views/maps/{$country->ref}.blade.php\";\n $this->assertFileExists($path, \"$path does not exist\");\n }\n }", "public function testTemplatesExists(){\n $this->assertFileExists('templates/header.php');\n\n //verifica se o arquivo de template page.php existe\n $this->assertFileExists('templates/page.php');\n\n //verifica se o arquivo de template footer.php existe\n $this->assertFileExists('templates/footer.php');\n }", "public function isTemplate()\n\t{\n\t}", "function getE404Template();", "private function checkTemplateFileExistence($pathToHtmlTemplateFile) {\n\n $pathToHtmlTemplateFile = (string) $pathToHtmlTemplateFile;\n\n if (!file_exists($pathToHtmlTemplateFile)) {\n throw new PaginatorException(\n sprintf(PaginatorException::MSG_TEMPLATE_NOT_FOUND, $pathToHtmlTemplateFile),\n PaginatorException::CODE_TEMPLATE_NOT_FOUND\n );\n }\n }", "public function testLoadNonExistant()\n {\n $src = new ezcTemplateSourceCode( $this->templatePath . \"zhadum_no_such_file.tpl\",\n \"planet:zhadum.ezt\", \"definitely not the source from the file zhadum.ezt\" );\n\n try\n {\n $src->load();\n self::fail( \"No exception thrown for non existant file\" );\n }\n catch ( ezcTemplateFileNotFoundException $e )\n {\n }\n\n self::assertSame( $this->templatePath . \"zhadum_no_such_file.tpl\", $src->stream, 'Property <stream> does not return correct value.' );\n self::assertSame( \"planet:zhadum.ezt\", $src->resource, 'Property <resource> does not return correct value.' );\n self::assertSame( \"definitely not the source from the file zhadum.ezt\", $src->code, 'Property <code> does not return correct value.' );\n// self::assertSame( null, $src->context, 'Property <context> does not return correct value.' );\n }", "function template ($name)\n{\n global $template_name;\n\n $fn = \"./templates/$template_name/$name\";\n $default = \"./templates/default/$name\";\n\n if (file_exists($fn)) {\n return $fn;\n }\n else {\n return $default;\n }\n}", "private function templateExist($templateName)\n {\n if (!is_file($this->getTemplateFile($templateName))) {\n return false;\n }\n\n return true;\n }", "function not_found($app){\n\n $file_path = views_dir() . \"/404.php\";\n\n $PAGE[\"namespace\"] = \"not-found\";\n $PAGE[\"title\"] = \"Not Found\";\n\n /* --- Get Template --- */\n if(file_exists($file_path)){ // Avoid an infinite loop\n require($file_path);\n } else {\n echo \"<h1>404 Not found</h1>\";\n }\n}", "public function testInvalidPath() {\n AbstractTemplate::setPath(DATA_DIR.'no-templates');\n }" ]
[ "0.7001275", "0.69447845", "0.69182646", "0.68949956", "0.68949956", "0.68841094", "0.68675226", "0.67603797", "0.6674406", "0.6587349", "0.6587295", "0.6537828", "0.65090954", "0.65086627", "0.646466", "0.6439487", "0.6436466", "0.64329153", "0.642844", "0.6413241", "0.64078915", "0.6378798", "0.6371009", "0.63495654", "0.6346105", "0.6334451", "0.6307041", "0.6298365", "0.6297962", "0.6275223" ]
0.6966253
1
Test set, append, tryAppend, tryAppendHTML, del, tryDel.
public function testSetAppendDel() { $t = new \atk4\ui\Template('{foo}hello{/} guys'); // del tests $t->set('foo', 'Hello'); $t->del('foo'); $this->assertEquals(' guys', $t->render()); $t->set('foo', 'Hello'); $t->tryDel('qwe'); // non existent tag, ignores $this->assertEquals('Hello guys', $t->render()); // set and append tests $t->set('foo', 'Hello'); $t->set('foo', 'Hi'); // overwrites $t->setHTML('foo', '<b>Hi</b>'); // overwrites $t->trySet('qwe', 'ignore this'); // ignores $t->trySetHTML('qwe', '<b>ignore</b> this'); // ignores $t->append('foo', ' and'); // appends $t->appendHTML('foo', ' <b>welcome</b> my'); // appends $t->tryAppend('foo', ' dear'); // appends $t->tryAppend('qwe', 'ignore this'); // ignores $t->tryAppendHTML('foo', ' and <b>smart</b>'); // appends html $t->tryAppendHTML('qwe', '<b>ignore</b> this'); // ignores $this->assertEquals('<b>Hi</b> and <b>welcome</b> my dear and <b>smart</b> guys', $t->render()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testSetAppendDel()\n {\n $t = new \\atk4\\ui\\Template('{foo}hello{/} guys');\n\n // del tests\n $t->set('foo', 'Hello');\n $t->del('foo');\n $this->assertSame(' guys', $t->render());\n $t->set('foo', 'Hello');\n $t->tryDel('qwe'); // non existent tag, ignores\n $this->assertSame('Hello guys', $t->render());\n\n // set and append tests\n $t->set('foo', 'Hello');\n $t->set('foo', 'Hi'); // overwrites\n $t->setHtml('foo', '<b>Hi</b>'); // overwrites\n $t->trySet('qwe', 'ignore this'); // ignores\n $t->trySetHtml('qwe', '<b>ignore</b> this'); // ignores\n\n $t->append('foo', ' and'); // appends\n $t->appendHtml('foo', ' <b>welcome</b> my'); // appends\n $t->tryAppend('foo', ' dear'); // appends\n $t->tryAppend('qwe', 'ignore this'); // ignores\n $t->tryAppendHtml('foo', ' and <b>smart</b>'); // appends html\n $t->tryAppendHtml('qwe', '<b>ignore</b> this'); // ignores\n\n $this->assertSame('<b>Hi</b> and <b>welcome</b> my dear and <b>smart</b> guys', $t->render());\n }", "public function append(string $html): void ;", "public function test_bug_153()\n\t{\n\t\t$doc = '<p>PHP Simple HTML DOM Parser</p>';\n\n\t\t$this->html->load($doc);\n\t\t$this->html->nodes = null;\n\n\t\t$this->html->clear();\n\t}", "public function isAppend();", "public function append();", "public function test_bug_181()\n\t{\n\t\t$doc = \"<p>&nbsp;</p>\";\n\t\t$this->html->load($doc);\n\t\t$this->assertEquals($doc, $this->html->save());\n\t}", "public function testManyWritesButInAppendMode()\n {\n $testString = 'XXX';\n $testFileName = $this->getTempFileName('FileTesting.txt');\n $testfile = File::create($testFileName)->appendMode();\n $testfile->write($testString)->save();\n $testfile->write('iii')->save();\n $testfile->write('ABCDEFG')->save();\n $this->assertFileExists($testFileName, 'Unable to create or save file');\n $this->assertEquals('XXXiiiABCDEFG', file_get_contents($testFileName), 'Unable to write successfully');\n }", "public function testAppendChild()\n {\n $root = new Node('<b>Test 1</b>');\n $element = new Node('<b>Test 2</b>');\n $root->appendChild($element);\n $this->assertEquals('<b>Test 1</b><b>Test 2</b>', $root->outerHtml());\n }", "public function appendHtml($append) {}", "protected function doClear() {\n\t}", "public function testMultiple()\n {\n $items = array();\n $metadata = array();\n for ($i = 1; $i <= 10; $i++) {\n $elementTexts = array();\n $elementTexts['Dublin Core']['Title'][] = array('text' => 'title ' . $i, 'html' => false);\n $elementTexts['Dublin Core']['Subject'][] = ($i%2 == 1)\n ? array('text' => 'subject odd', 'html' => false)\n : array('text' => 'subject even', 'html' => false);\n $elementTexts['Dublin Core']['Creator'][] = array('text' => 'creator #' . $i, 'html' => false);\n $elementTexts['Dublin Core']['Date'][] = array('text' => 2000 + $i, 'html' => false);\n if ($i >= 8) {\n $elementTexts['Dublin Core']['Creator'][] = array('text' => 'creator bis #' . $i, 'html' => false);\n }\n $items[$i] = insert_item($metadata, $elementTexts);\n }\n\n $this->assertEquals(11, total_records('Item'));\n $this->assertEquals(10, total_records('HistoryLogEntry'));\n $this->assertEquals(43, total_records('HistoryLogChange'));\n\n // Update some of them.\n $items[1]->delete();\n $this->assertEquals(10, total_records('Item'));\n $this->assertEquals(11, total_records('HistoryLogEntry'));\n $this->assertEquals(43, total_records('HistoryLogChange'));\n\n $elementTexts = array();\n $elementTexts['Dublin Core']['Title'][] = array('text' => 'title updated', 'html' => false);\n $elementTexts['Dublin Core']['Subject'][] = array('text' => 'subject updated', 'html' => false);\n $items[2]->addElementTextsByArray($elementTexts);\n $items[2]->save();\n $this->assertEquals(10, total_records('Item'));\n $this->assertEquals(12, total_records('HistoryLogEntry'));\n $this->assertEquals(45, total_records('HistoryLogChange'));\n\n $elementTexts = array();\n $elementTexts['Dublin Core']['Creator'][] = array('text' => 'creator ter #8', 'html' => false);\n $items[8]->addElementTextsByArray($elementTexts);\n $items[8]->save();\n $this->assertEquals(10, total_records('Item'));\n $this->assertEquals(13, total_records('HistoryLogEntry'));\n $this->assertEquals(46, total_records('HistoryLogChange'));\n\n $elementTexts = array();\n $elementTexts['Dublin Core']['Creator'][] = array('text' => 'creator ter #9', 'html' => false);\n $items[9]->addElementTextsByArray($elementTexts);\n $items[9]->save();\n $this->assertEquals(10, total_records('Item'));\n $this->assertEquals(14, total_records('HistoryLogEntry'));\n $this->assertEquals(47, total_records('HistoryLogChange'));\n }", "public function test_bug_195()\n\t{\n\t\t$expected = '<e attribute=\"new value\">';\n\t\t$doc = '<e attribute=value>';\n\t\t$this->html->load($doc);\n\t\t$this->html->find('e', 0)->setAttribute('attribute', 'new value');\n\t\t$this->assertEquals($expected, $this->html->save());\n\t}", "public function test_performing() {\n $this->file->update('Write to file');\n $this->assert_equal($this->file->load(), 'Write to file');\n\n $this->file->append(\"\\nAppend text\");\n $this->assert_equal($this->file->load(), \"Write to file\\nAppend text\");\n }", "public function testManyWritesOverwritesPreviousContent()\n {\n $testString = 'XXX';\n $testFileName = $this->getTempFileName('FileTesting.txt');\n $testfile = File::create($testFileName);\n $testfile->write($testString)->save();\n $testfile->write('iii')->save();\n $testfile->write('ABCDEFG')->save();\n $this->assertFileExists($testFileName, 'Unable to create or save file');\n $this->assertEquals('ABCDEFG', file_get_contents($testFileName), 'Unable to write successfully');\n }", "public function test_add_and_delete() {\n\n\t\t$testee = new Testee();\n\n\t\t$field_name = 'field_name';\n\n\t\t$field = new Field( $field_name );\n\n\t\t$resource = 'resource';\n\n\t\t$fields = iterator_to_array( $testee->add( $resource, $field )->getIterator() );\n\n\t\t$this->assertSame( $field, $fields[ $resource ][ $field_name ] );\n\n\t\t$fields = iterator_to_array( $testee->delete( $resource, $field_name )->getIterator() );\n\n\t\t$this->assertTrue( empty( $fields[ $resource ][ $field_name ] ) );\n\t}", "public function testAppendAddsDataToStorage()\n {\n file_put_contents(self::$temp . DS . 'file.txt', 'foo');\n Storage::append(self::$temp . DS . 'file.txt', 'bar');\n\n $this->assertTrue(is_file(self::$temp . DS . 'file.txt'));\n $this->assertSame('foobar', file_get_contents(self::$temp . DS . 'file.txt'));\n }", "public function append()\n\t{\n\n\t}", "public function setAppend($append);", "public function testMagicCallMethodPersistWhenItShouldnt()\n {\n $this->assertInstanceOf('\\Illuminate\\Support\\Fluent', with(new HtmlBuilder($this->url, $this->view))->foobar());\n }", "protected function Append($string){\n if($this -> handle == false) return false;\n if($this -> document === false) $this -> document = $string;\n else $this -> document .= $string;\n return true;\n }", "public function testHtmlDoc()\n {\n $filename = DATA_PATH.'/doc.html';\n $file = new TextFile($filename);\n $file->load();\n\n $doc = new HtmlDoc();\n $doc->loadFile($file);\n $doc2 = HtmlDoc::createFromFilePath($filename);\n $this->assertInstanceOf('\\Duality\\Structure\\HtmlDoc', $doc2);\n\n $doc->setTitle('Duality dummy doc title');\n $result = (string) $doc;\n $expected = \"<!DOCTYPE html>\\n<html><head><title>Duality dummy doc title</title></head><body></body></html>\\n\";\n $this->assertEquals($expected, $result);\n \n $doc = HtmlDoc::createFromFilePath($filename);\n $doc->setAttribute('body', 'id', 'dummy');\n $result = (string) $doc;\n $expected = \"<!DOCTYPE html>\\n<html><head><title></title></head><body id=\\\"dummy\\\"></body></html>\\n\";\n $this->assertEquals($expected, $result);\n\n $doc = HtmlDoc::createFromFilePath($filename);\n $expected = \"<!DOCTYPE html>\\n<html><head><title></title></head><body><p>Dummy content</p></body></html>\\n\";\n $doc->appendTo('body', '<p>Dummy content</p>');\n $result = (string) $doc;\n $this->assertEquals($expected, $result);\n }", "public function testSetDelete()\n {\n $query = new Query;\n $this->assertFalse($query->delete);\n\n $query->setDelete();\n $this->assertTrue($query->delete);\n\n // Tests that sequential setDelete call doesn't toggle the delete flag\n $query->setDelete();\n $this->assertTrue($query->delete);\n }", "abstract public function remove();", "public function clear(): void {\n $this->_current = $this->_document = new DOMDocument();\n }", "public function testAppendPrepend() {\n\t\t$this->object->write('Content');\n\t\t$this->assertEquals('Content', $this->object->read());\n\n\t\t$this->object->append('Append');\n\t\t$this->assertEquals('ContentAppend', $this->object->read());\n\n\t\t$this->object->prepend('Prepend');\n\t\t$this->assertEquals('PrependContentAppend', $this->object->read());\n\t}", "public function testAppendCustom()\n {\n $report = new Report([]);\n $error = $this->getMockForAbstractClass(ViolationInterface::class);\n $report->append($error, 'unknown');\n\n self::assertFalse($report->hasError());\n self::assertFalse($report->hasWarning());\n self::assertTrue($report->has('unknown'));\n self::assertEquals([], $report->getError());\n self::assertEquals([], $report->getWarning());\n self::assertEquals([$error], $report->get('unknown'));\n }", "public function testSetContent()\n\t{\n\t\t$element = new DomElement('field', 'data', array('id' => 'foo'));\n\n\t\t$element->setContent('bar');\n\n\t\t$this->assertEquals(\n\t\t\tDomHelper::minify('<field id=\"foo\">bar</field>'),\n\t\t\tDomHelper::minify($element)\n\t\t);\n\t}", "public function testErrorArrayImplicitFlushNoHtml()\n {\n $this->notHtml = true;\n $this->arrayTest('error');\n $this->notHtml = false;\n }", "protected function saveHtml()\n {\n $this->fsio->put($this->page->getTarget(), $this->html);\n }", "public function testPut3()\n {\n // put\n $this->assertTrue($this->object->put('/b1/b2', 'wow'));\n\n // overwrite existing dir, failed\n $this->assertFalse($this->object->put('/b1', 'xxx'));\n\n $this->assertTrue($this->object->del('/b1'));\n }" ]
[ "0.72865206", "0.54942864", "0.5230329", "0.51729816", "0.51278144", "0.4983135", "0.4981058", "0.4789173", "0.4756084", "0.47433314", "0.47430626", "0.47378325", "0.46858868", "0.46738875", "0.46365538", "0.46352467", "0.4627153", "0.45855093", "0.45534354", "0.45419142", "0.45293564", "0.45269752", "0.45121396", "0.45063096", "0.44897535", "0.44864893", "0.44662392", "0.44553754", "0.44494018", "0.44410637" ]
0.73350376
0
Try to load template from non existent file exception.
public function testLoadException() { $t = new \atk4\ui\Template(); $t->load('such-file-does-not-exist.txt'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testBadTemplate2()\n {\n $t = new \\atk4\\ui\\Template();\n $this->assertFalse($t->tryLoad('bad_template_file'));\n }", "public function testBadTemplate2()\n {\n $t = new \\atk4\\ui\\Template();\n $this->assertFalse($t->tryLoad('bad_template_file'));\n }", "public function testBadTemplate1()\n {\n $t = new \\atk4\\ui\\Template();\n $this->expectException(Exception::class);\n $t->load('bad_template_file');\n }", "public function testBadTemplate1()\n {\n $t = new \\atk4\\ui\\Template();\n $t->load('bad_template_file');\n }", "private static function checkTemplate()\n\t{\n\t\tif (!file_exists(self::$tmpl_file)) {\n\t\t\tthrow new Exception(\"Cant seem to find \".self::$tmpl_file);\n\t\t}\n\t\t// If template directory not set, assume base on template file\n\t\tif(self::$tmpl_dir === ''){\n\t\t\tself::$tmpl_dir = dirname(self::$tmpl_file);\n\t\t}\n\n\t\tself::$tmpl_html = file_get_contents(self::$tmpl_file);\n\t\t \n\t}", "private function load (): void {\n $file = $this->templatesPath . '/' . $this->file . '.html';\n\n if (file_exists($file)) {\n $content = file_get_contents($file);\n $this->html = $content;\n } else {\n throw new Exception('Template not found.');\n }\n }", "public function testLoadException()\n {\n $t = new \\atk4\\ui\\Template();\n $this->expectException(Exception::class);\n $t->load('such-file-does-not-exist.txt');\n }", "public function testLoadNonExistant()\n {\n $src = new ezcTemplateSourceCode( $this->templatePath . \"zhadum_no_such_file.tpl\",\n \"planet:zhadum.ezt\", \"definitely not the source from the file zhadum.ezt\" );\n\n try\n {\n $src->load();\n self::fail( \"No exception thrown for non existant file\" );\n }\n catch ( ezcTemplateFileNotFoundException $e )\n {\n }\n\n self::assertSame( $this->templatePath . \"zhadum_no_such_file.tpl\", $src->stream, 'Property <stream> does not return correct value.' );\n self::assertSame( \"planet:zhadum.ezt\", $src->resource, 'Property <resource> does not return correct value.' );\n self::assertSame( \"definitely not the source from the file zhadum.ezt\", $src->code, 'Property <code> does not return correct value.' );\n// self::assertSame( null, $src->context, 'Property <context> does not return correct value.' );\n }", "public function loadTemplate()\n\t{\n\t\tif($this->template == \"\")\n\t\t\tthrow new \\Exception(\"Template not set in \".get_class($this));\n\n\t\treturn $this->includeTemplate($this->template);\n\t}", "function get_template( $template_path ) {\r\n\r\n $located = 'templates/' . $template_path . '.php';\r\n\r\n if ( ! file_exists( $located ) ) {\r\n $log = 'Template error: ' . $template_path . ' file does not exist.';\r\n echo $log;\r\n return;\r\n }\r\n\r\n include $located;\r\n}", "private function loadTemplate() {\n\t\t\t$this->template = require ( TEMPLATE_PATH . 'index.php');\n\t\t}", "public function fetchTemplate() {\n\t\tif ($this->template != '' && \n\t\t\t$this->template_data == '' &&\n\t\t\t!$this->checkTemplateExists($this->template)) {\n\t\t\t\t\n\t\t\tthrow new \\Exception(sprintf('Template file %s not found',$this->template));\n\t\t}\n\t\t\n\t\tif ($this->template != '') {\n\t\t\treturn $this->fetchFromFile();\n\t\t} else {\n\t\t\treturn $this->fetchFromString();\n\t\t}\n\t}", "function include_template($template){\n\t\t\t$template_path = './templates/'.$template.'.template.php';\n\n\t\t\tif (is_readable($template_path) && file_exists($template_path))\n\t\t\t\treturn $template_path;\n\t\t\telse\n\t\t\t\tdie ('Page '.$template_path.' inexistant ou innaccessible <br /> <a href=\"index.php\">retour &agrave; l\\'accueil</a>');\n\n\t}", "private function loadTemplate (string $template) {\n $path = $this->getTemplatePath($template);\n if (!file_exists($path)) {\n throw new TemplateNotFoundException();\n }\n\n return simplexml_load_file($path);\n }", "protected function findTemplate()\n {\n if ($this->_path == false){\n throw new PHPTAL_ConfigurationException('No template file specified');\n }\n\n // template source already defined\n if ($this->_source != null){\n return;\n }\n\n array_push($this->_resolvers, new PHPTAL_FileSourceResolver($this->_repositories));\n foreach ($this->_resolvers as $resolver){\n $source = $resolver->resolve($this->_path);\n if ($source != null){\n $this->_source = $source;\n break;\n }\n }\n array_pop($this->_resolvers);\n\n if ($this->_source == null){\n throw new PHPTAL_IOException('Unable to locate template file '.$this->_path);\n }\n }", "function st_get_template($file,$data = array()){\n $file = ST_DIR.'/templates/'.$file;\n if(file_exists($file)){\n include($file); return true;\n }\n return false;\n}", "public function findTemplatePath() {\r\n \t\tforeach (tx_auxo_loader::getTemplatePathes($this->extension, $this->module) as $path) {\r\n\t\t\t$fullpath = $path . '/' . $this->getTemplate();\r\n\t\t\tif (is_readable($fullpath)) {\r\n\t\t\t\treturn $path;\r\n\t\t\t}\r\n \t\t}\r\n \t\t\r\n \t\tthrow new tx_auxo_presentationException(sprintf('Template %s not found', $this->getTemplate()));\r\n\t}", "public function load( $filename )\r\n\t{\r\n\t\t$this->debug->guard( );\r\n\r\n\t\tif ( !file_exists( $filename ) )\r\n\t\t{\r\n\t\t\t$this->debug->write( 'Problem loading the template: could not find the template file: ' . $filename, 'warning' );\r\n\t\t\t$this->messages->setMessage( 'Problem loading the template: could not find the template file: ' . $filename, 'warning' );\r\n\r\n\t\t\t$this->debug->unguard( false );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// try to load the template\r\n\t\t$template = $this->_loadTemplateFromDatabase( $filename );\r\n\t\tif ( $template !== false )\r\n\t\t{\r\n\t\t\t$this->debug->write( 'Template found and successfully loaded: ' . $filename );\r\n\r\n\t\t\t$this->file = $template[ 'file' ];\r\n\t\t\t$this->content = $template[ 'content' ];\r\n\t\t\t$this->blocks = $template[ 'blocks' ];\r\n\t\t\t$this->variables = $template[ 'variables' ];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$filehandle = fopen( $filename, \"r\" );\r\n\t\t\t$this->content = fread( $filehandle, filesize( $filename ) );\r\n\t\t\tfclose( $filehandle );\r\n\r\n\t\t\tif ( !$this->_loadLinks( ) )\r\n\t\t\t{\r\n\t\t\t\t$this->debug->write( 'Problem loading the template: could not rewrite links in : ' . $filename, 'warning' );\r\n\t\t\t\t$this->messages->setMessage( 'Problem loading the template: could not rewrite links in : ' . $filename, 'warning' );\r\n\r\n\t\t\t\t$this->debug->unguard( false );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif ( !$this->_loadBlocks( ) )\r\n\t\t\t{\r\n\t\t\t\t$this->debug->write( 'Problem loading the template: could not load the blocks in: ' . $filename, 'warning' );\r\n\t\t\t\t$this->messages->setMessage( 'Problem loading the template: could not load the blocks in: ' . $filename, 'warning' );\r\n\r\n\t\t\t\t$this->debug->unguard( false );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif ( !$this->_loadVariables( ) )\r\n\t\t\t{\r\n\t\t\t\t$this->debug->write( 'Problem loading the template: could not load the variables in: ' . $filename, 'warning' );\r\n\t\t\t\t$this->messages->setMessage( 'Problem loading the template: could not load the variables in: ' . $filename, 'warning' );\r\n\r\n\t\t\t\t$this->debug->unguard( false );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif ( !$this->_getBlockParents( ) )\r\n\t\t\t{\r\n\t\t\t\t$this->debug->write( 'Problem loading the template: could not resolve the block tree in: ' . $filename, 'warning' );\r\n\t\t\t\t$this->messages->setMessage( 'Problem loading the template: could not resolve the block tree in: ' . $filename, 'warning' );\r\n\r\n\t\t\t\t$this->debug->unguard( false );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif ( !$this->_loadRootVariables( ) )\r\n\t\t\t{\r\n\t\t\t\t$this->debug->write( 'Problem loading the template: could not load the root variables in: ' . $filename, 'warning' );\r\n\t\t\t\t$this->messages->setMessage( 'Problem loading the template: could not load the root variables in: ' . $filename, 'warning' );\r\n\r\n\t\t\t\t$this->debug->unguard( false );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif ( !$this->_saveTemplateToDatabase( $filename ) )\r\n\t\t\t{\r\n\t\t\t\t$this->debug->write( 'Problem loading the template: could not save the template in database', 'warning' );\r\n\t\t\t\t$this->messages->setMessage( 'Problem loading the template: could not save the template in database', 'warning' );\r\n\r\n\t\t\t\t$this->debug->unguard( false );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->debug->unguard( true );\r\n\t\treturn true;\r\n\t}", "public function testLoadNonReadable()\n {\n // If running as root you can always write, so this test should be\n // skipped when running as root.\n if ( !ezcBaseFeatures::hasFunction(\"posix_getuid\") || posix_getuid() == 0 )\n {\n return;\n }\n copy( $this->templatePath . \"zhadum.ezt\",\n $this->templateStorePath . \"zhadum.ezt\" );\n\n // This only works on Linux/Unix, what to do here on other platforms?\n $old = umask( 0 );\n chmod( $this->templateStorePath . \"zhadum.ezt\", 0222 );\n umask( $old );\n $src = new ezcTemplateSourceCode( $this->templateStorePath . \"zhadum.ezt\",\n \"planet:zhadum.ezt\", \"definitely not the source from the file zhadum.ezt\" );\n\n try\n {\n $src->load();\n self::fail( \"No exception thrown for non-readable file\" );\n }\n catch ( ezcTemplateFileNotReadableException $e )\n {\n }\n\n self::assertSame( $this->templateStorePath . \"zhadum.ezt\", $src->stream, 'Property <stream> does not return correct value.' );\n self::assertSame( \"planet:zhadum.ezt\", $src->resource, 'Property <resource> does not return correct value.' );\n self::assertSame( \"definitely not the source from the file zhadum.ezt\", $src->code, 'Property <code> does not return correct value.' );\n// self::assertSame( null, $src->context, 'Property <context> does not return correct value.' );\n }", "public function testInvalidRenderTemplate() {\n touch(AbstractTemplate::getPath().'foo-fail.tpl.php');\n $t = new Template('foo-fail');\n unlink(AbstractTemplate::getPath().'foo-fail.tpl.php');\n try {\n $t->render();\n $this->fail();\n } catch (\\RuntimeException $e) {\n }\n }", "public function __construct($name) {\n\n $this->name = $name;\n\n $file_path = joinPaths(CHRIS_TEMPLATE_FOLDER ,$name);\n\n // look up if we have the requested template in our view folder\n if (!file_exists($file_path)) {\n if(!file_exists($name)){\n throw new Exception('The requested template '.$name.' ('.$file_path.') was not found.');\n }\n else{\n $this->content = file_get_contents($name);\n }\n\n }\n else{\n $this->content = file_get_contents($file_path);\n }\n\n }", "public function testInvalidTemplate() {\n $t = new Template('foo-fail');\n }", "function load_template( $name ) {\r\n $path = locate_template( $name );\r\n\r\n if ( !$path ) {\r\n $path = $this->plugin_dir . \"email-newsletter-files/$name\";\r\n }\r\n\r\n load_template( $path );\r\n die;\r\n }", "public function getForEmptyTemplateFileNameReturnsTemplateInstance() {\n\t\t$this->assertInstanceOf(\n\t\t\t'Tx_Oelib_Template',\n\t\t\tTx_Oelib_TemplateRegistry::get('')\n\t\t);\n\t}", "private function checkTemplateFileExistence($pathToHtmlTemplateFile) {\n\n $pathToHtmlTemplateFile = (string) $pathToHtmlTemplateFile;\n\n if (!file_exists($pathToHtmlTemplateFile)) {\n throw new PaginatorException(\n sprintf(PaginatorException::MSG_TEMPLATE_NOT_FOUND, $pathToHtmlTemplateFile),\n PaginatorException::CODE_TEMPLATE_NOT_FOUND\n );\n }\n }", "private function __loadEmailTemplate(string $_templateName):string\n\t{\n\t\t$path = realpath(__DIR__.'/..');\n\t\t$path= $path.'/views/_email/'.$_templateName.'.php';\n\t\tif (file_exists($path)) {\n\t\t\treturn\t$path;exit;\n\t\t} else {\n\t\t\treturn\t'no';exit;\n\t\t}\n\t\t \n\t}", "public function testNonExistingFileShouldThrowException()\n {\n $this->expectException(FileNotFoundException::class);\n\n $textLoader = new TextLoader();\n\n $textLoader->load('non-existing-file.txt');\n }", "public function load(): void {\n \n $filename = 'html/components/html/' . $this->_templateName . '.html';\n if (file_exists($filename)) {\n $this->_template = file_get_contents($filename);\n }\n }", "private function checkTmpDir(){\n\n $_type = strtolower($this->Filetype);\n $_paths = $this->Paths;\n $_template = dirname(__FILE__, 4).$_paths[\"Tmp\"] . $_type;\n\n if( file_exists($_template) ){\n $this->Template = file_get_contents($_template);\n $this->replacement($this->Template);\n }else{\n echo \"Nao existe um template para arquivos do tipo {$_type}.\\n\";\n echo \"Crie um template para ele no diretorio: {$_template}\\n\";\n echo \"Especificamente com o nome: {$_type} e sem extensao. \\n\";\n die;\n }\n }", "public function handleNotFoundFile();" ]
[ "0.77406883", "0.77406883", "0.76668715", "0.76181257", "0.7561117", "0.75516975", "0.7440078", "0.7352636", "0.7250574", "0.69075304", "0.69033176", "0.6848208", "0.6741994", "0.67331254", "0.67241174", "0.66591626", "0.66018337", "0.6562437", "0.6559361", "0.6549759", "0.65319633", "0.6514411", "0.6456742", "0.6420304", "0.63986367", "0.639231", "0.6370299", "0.6335208", "0.6330917", "0.63138986" ]
0.79510397
0
Test to command admin:create
public function testAdminCreateCommand() { $this->artisan('admin:create') ->expectsQuestion(trans('users.create_admin.name'), 'Admin') ->expectsQuestion(trans('users.create_admin.email'), '[email protected]') ->expectsQuestion(trans('users.create_admin.password'), '1234') ->expectsQuestion(trans('users.create_admin.repeat_pass'), '1234') ->expectsOutput(trans('users.create_admin.ok')) ->assertExitCode(0); $this->assertDatabaseHas('admins', [ 'name' => 'Admin', 'email' => '[email protected]' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_can_create_admin()\n {\n $data =$this->userDataHelper('admin'); \n $response = $this->postJson('v1/users', $data);\n $response\n ->assertStatus(201)\n ->assertJson([\n 'success' => true,\n ]);\n }", "public function adminCreate()\n {\n //\n }", "public function test_create_an_admin_with_superadmin_permission(): void\n {\n $response = $this->withHeaders([\n 'Authorization'=> 'Bearer '.$this->superadmin_token\n ])->postJson('/api/users/', $this->valid_create_user_payload);\n $response->assertCreated();\n\n $this->assertDatabaseHas('users', [\n 'email'=> $this->valid_create_user_payload['email']\n ]);\n }", "public function testAdminWithArguments(): void\n {\n $kernel = static::createKernel();\n $application = new Application($kernel);\n\n $command = $application->find('app:user');\n $commandTester = new CommandTester($command);\n $commandTester->execute([\n 'command' => $command->getName(),\n\n // pass arguments to the helper\n 'label' => 'TestAdmin',\n 'mail' => '[email protected]',\n 'password' => 'test-admin',\n\n // prefix the key with two dashes when passing options,\n '--admin' => true,\n ]);\n\n // the output of the command in the console\n $output = $commandTester->getDisplay();\n $this->assertStringContainsString('[OK] Admin user created.', $output);\n }", "public function testUserCreate()\n {\n $user = $this->createUserAdmin();\n\n $this->actingAs($user)\n ->get(route('backend.users.create'))\n ->assertStatus(200)\n ->assertViewIs('backend.user.new');\n }", "public function testCreatePost()\n {\n $this->post('/api/v1/admin/post/create')->seeStatusCode(200);\n }", "public function testAdminCreateAdminOK()\n {\n $crawler = $this->client->request('GET', '/users');\n\n $link = $crawler->selectLink('Créer un utilisateur')->link();\n $crawler = $this->client->click($link);\n\n $form = $crawler->selectButton('Ajouter')->form();\n $form['user[username]'] = 'NewAdmin';\n $form['user[password][first]'] = 'password';\n $form['user[password][second]'] = 'password';\n $form['user[email]'] = '[email protected]';\n $form['user[roles]'][1]->tick();\n $this->client->submit($form);\n\n $crawler = $this->client->followRedirect();\n\n static::assertEquals(200, $this->client->getResponse()->getStatusCode());\n static::assertEquals(1, $crawler->filter('html:contains(\"Superbe ! L\\'utilisateur a bien été ajouté.\") ')->count());\n static::assertEquals(1, $crawler->filter('html:contains(\"NewAdmin\") ')->count());\n\n $this->client = static::createClient(array(), array(\n 'PHP_AUTH_USER' => 'NewAdmin',\n 'PHP_AUTH_PW' => 'password',\n ));\n\n $crawler=$this->client->request('GET', '/login');\n\n $form = $crawler->selectButton('Se connecter')->form();\n $form['_username'] = 'NewAdmin';\n $form['_password'] = 'password';\n $this->client->submit($form);\n\n $this->client->followRedirect();\n\n $array = $this->client->getContainer()->get('security.token_storage')->getToken()->getUser()->getRoles();\n\n $this->assertContains('ROLE_ADMIN', $array);\n }", "public function makeAdmin()\n\t{\n\t\t$this->is_admin = \"1\";\n\t\t$this->save();\n\t}", "public function testAdminNewUser(): void\n {\n $client = $this->authAsAdmin($this);\n $crawler = $client->request('GET', '/en/admin/user/new');\n\n $form = $crawler->selectButton('Create user')->form([\n 'user[profile][full_name]' => 'test',\n 'user[username]' => 'test',\n 'user[profile][phone]' => 'test',\n 'user[email]' => '[email protected]',\n 'user[email_verified]' => true,\n 'user[password]' => 'test',\n ]);\n $client->submit($form);\n\n $this->assertSame(Response::HTTP_FOUND, $client->getResponse()->getStatusCode());\n $user = $this->getUser($client, 'test');\n\n $this->assertNotNull($user);\n $this->assertSame('test', $user->getProfile()->getFullName());\n $this->assertSame('test', $user->getUsername());\n $this->assertNotNull($user->getEmailVerifiedAt());\n }", "public function test_it_can_show_user_create_form_if_user_is_super_admin()\n {\n $response = $this->actingAs($this->user)->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('user.create');\n }", "public function create(Admin $admin)\n {\n //\n }", "public function actionNewAdmin()\n {\n $email = BaseConsole::input(\"Enter email: \");\n $password = BaseConsole::input(\"Enter password: \");\n try {\n if (empty($password) || empty($email)) {\n throw new \\Exception('Data is empty');\n }\n $user = new User();\n $user->setEmail($email);\n $user->setPassword($password);\n $user->generateAuthKey();\n $user->generatePasswordResetToken();\n $user->generateEmailVerificationToken();\n if ($user->save()) {\n // Set role admin\n $auth = Yii::$app->authManager;\n $role = $auth->getRole('admin');\n $auth->assign($role, $user->id);\n die('Administrator successful created!');\n } else {\n throw new \\Exception('Validation user error!');\n }\n } catch (\\Exception $exception) {\n die($exception->getMessage());\n }\n }", "public function createAdmin()\n {\n $administrator = new Users();\n if ($administrator->existAdmin())\n return FALSE;\n\n if ($_POST['admin'] == \"create\") {\n $admin['uid'] = $_POST['adminid'];\n $admin['email'] = $_POST['adminemail'];\n $admin['pwd'] = $_POST['pwd'];\n $admin['role'] = \"administrator\";\n\n $administrator->insert($admin);\n self::insert_security_key();\n echo '<div class=\"message success\">';\n echo \"Administrator created\";\n echo '</div>';\n return TRUE;\n }\n }", "function testAfterCreate()\n {\n $this->Create(); //creates admin user\n $admin = Administrator::model()->findAll();\n $this->assertEquals($this->dbcount, count($admin)); //make sure that our dbcount and our database have the same amount of entries\n\n //Creates a table from the administrator model\n //then breaks the database queries into an array\n //compares the values on both to ensure theyre the same.\n $administrator = Administrator::model();\n $trips = $administrator->getCommandBuilder()\n ->createFindCommand($administrator->tableSchema, $administrator->dbCriteria)\n ->queryAll();\n $ar = array();\n foreach ($admin as $f) {\n $p = $this->int;\n $this->int++;\n $ar[($p)] = $f->attributes;\n }\n $this->assertEquals($ar, $trips);\n $this->Delete(); //deletes the entry we made to reset the database\n }", "public function testCreationDunEmployeAdmin()\n {\n Employee::firstOrCreate([\n 'nom' => 'John doe',\n 'statut' => 1\n ]);\n\n $this->assertCount(1, Employee::all());\n }", "public function test_admins_create_page_response_without_login()\n {\n $response = $this->get('admin/user/create');\n $response->assertRedirect('/admin-login');\n }", "public function testAdminPage()\n {\n $user = factory(User::class)->create();\n \n $response = $this->actingAs($user)->get('/admin')\n ->assertStatus(200)\n ->assertSuccessful()\n ->assertViewIs('admin')\n ->assertSee('Laravel');\n }", "public function testAdminNewPost()\n {\n $companyName = 'Kiveo AG';\n\n $client = static::createClient([], [\n 'PHP_AUTH_USER' => 'jane_admin',\n 'PHP_AUTH_PW' => 'kitten',\n ]);\n $crawler = $client->request('GET', '/en/admin/company/new');\n $form = $crawler->selectButton('Add Company profile')->form([\n 'company[name]' => $companyName,\n ]);\n $client->submit($form);\n\n $this->assertSame(Response::HTTP_FOUND, $client->getResponse()->getStatusCode());\n\n $company = $client->getContainer()->get('doctrine')->getRepository(Company::class)->findOneBy([\n 'name' => $companyName,\n ]);\n $this->assertNotNull($company);\n $this->assertSame($companyName, $company->getName());\n }", "public function testCreateDocumentAdmin ()\n {\n $faker = Factory::create();\n $admin = User::where('is_admin', 1)->first();\n $group = Group::inRandomOrder()->first();\n\n $response = $this->actingAs($admin, 'api')\n ->json('POST', '/api/documents', [\n 'name' => $faker->company,\n 'content' => $faker->randomHtml(),\n 'group' => $group->id,\n ]);\n\n $response->assertStatus(201);\n }", "public function testAdministratorUserIsCreated()\n\t{\n\t\t$this->restartApplication();\n\n\t\t$user = \\Orchestra\\Model\\User::find(1);\n\t\t$this->assertEquals('Test Administrator', $user->fullname);\n\t\t$this->assertEquals('[email protected]', $user->email);\n\n\t\t// Test login the administrator.\n\t\tif (\\Auth::attempt(array('username' => '[email protected]', 'password' => '123456')))\n\t\t{\n\t\t\t$this->assertTrue(true, 'Able to authenticate');\n\n\t\t\t$acl = \\Orchestra\\Core::acl();\n\n\t\t\t$this->assertInstanceOf('\\Orchestra\\Support\\Acl\\Container', $acl);\n\n\t\t\tif ($acl->can('manage-orchestra'))\n\t\t\t{\n\t\t\t\t$this->assertTrue(true, 'Able to manage orchestra');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->assertTrue(false, 'Unable to manage orchestra');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->assertTrue(false, 'If unable to authenticate');\n\t\t}\n\n\t\t\\Auth::logout();\n\t}", "public function testCreate()\n {\n $admin = User::Role('Administrator')->firstOrFail();\n\n $response = $this->actingAs($admin)->ajax('get', 'admin/languagelines/create');\n $response->assertStatus(200)\n ->assertViewIs('admin.languagelines.create');\n }", "public function testCreateAdmin()\n {\n $user = new User();\n\n $user->email = '[email protected]';\n $user->name = 'Testing admin';\n $user->newPassword = 'testing admin password';\n\n $this->assertInstanceOf(User::className(), $this->userModule->createAdmin($user));\n $this->assertFalse($user->isNewRecord);\n $this->assertNotEmpty($user->id);\n $this->assertContains('admin', $user->getUserRoles());\n\n return $user;\n }", "public function test_it_can_create_user_if_logged_in_user_is_super_admin()\n {\n\n $data = [\n 'fullname' => $this->faker->name,\n 'email' => $this->faker->unique()->safeEmail,\n ];\n\n $response = $this->actingAs($this->user)->post(route('users.store'), $data);\n $response->assertStatus(302);\n $response->assertRedirect(route('users.index'));\n $response->assertSessionHas('message', 'User Successfully created');\n }", "public function test_adminExist()\n {\n $this->assertTrue(Auth::attempt($this->user));\n }", "public function testAdminNewPost(): void\n {\n $postTitle = 'Blog Post Title '.mt_rand();\n $postSummary = $this->generateRandomString(255);\n $postContent = $this->generateRandomString(1024);\n\n $client = static::createClient([], [\n 'PHP_AUTH_USER' => 'léa',\n 'PHP_AUTH_PW' => 'p4ssw0rd',\n ]);\n $client->request('GET', '/admin/post/new');\n $client->submitForm('Créer un article', [\n 'post[title]' => $postTitle,\n 'post[summary]' => $postSummary,\n 'post[content]' => $postContent,\n ]);\n\n $this->assertResponseRedirects('/admin/post/', Response::HTTP_FOUND);\n\n /** @var \\App\\Entity\\Post $post */\n $post = self::$container->get(PostRepository::class)->findOneByTitle($postTitle);\n $this->assertNotNull($post);\n $this->assertSame($postSummary, $post->getSummary());\n $this->assertSame($postContent, $post->getContent());\n }", "public function testAdminCreateAsUserOK()\n {\n $crawler = $this->client->request('GET', '/users');\n\n $link = $crawler->selectLink('Créer un utilisateur')->link();\n $crawler = $this->client->click($link);\n\n $form = $crawler->selectButton('Ajouter')->form();\n $form['user[username]'] = 'NewUser';\n $form['user[password][first]'] = 'password';\n $form['user[password][second]'] = 'password';\n $form['user[email]'] = '[email protected]';\n $this->client->submit($form);\n\n $crawler = $this->client->followRedirect();\n\n static::assertEquals(200, $this->client->getResponse()->getStatusCode());\n static::assertEquals(1, $crawler->filter('html:contains(\"Superbe ! L\\'utilisateur a bien été ajouté.\") ')->count());\n static::assertEquals(1, $crawler->filter('html:contains(\"NewUser\") ')->count());\n\n $this->client = static::createClient(array(), array(\n 'PHP_AUTH_USER' => 'NewUser',\n 'PHP_AUTH_PW' => 'password',\n ));\n\n $crawler=$this->client->request('GET', '/login');\n\n $form = $crawler->selectButton('Se connecter')->form();\n $form['_username'] = 'NewUser';\n $form['_password'] = 'password';\n $this->client->submit($form);\n\n $this->client->followRedirect();\n\n $array = $this->client->getContainer()->get('security.token_storage')->getToken()->getUser()->getRoles();\n\n $this->assertContains('ROLE_USER', $array);\n $this->assertNotContains('ROLE_ADMIN', $array);\n }", "public function run()\n {\n admins::create(['name' => \"Admin\",\n 'email' => \"[email protected]\",\n 'password' => bcrypt(123456789),\n 'image' => \"a.jpg\"\n ]);\n \n }", "public function create(Admin $admin)\n {\n if ($admin->getRole('Admin', 'create')) {\n return true;\n }\n }", "public function testAdministrator_is_able_to_store_users_success()\n {\n $user = factory(\\App\\User::class)->create();\n $this->actingAs($user)\n ->visit('/users/create')\n ->type('Foo', 'name')\n ->type('[email protected]', 'email')\n ->type('secret', 'password')\n ->type('secret', 'password_confirmation')\n ->type('Dilo Malang', 'address')\n ->type('08771623', 'phone')\n ->press('Submit')\n ->seeInDatabase('users', ['name' => 'Foo', 'email' => '[email protected]'])\n ->see('Data has been saved successfully');\n }", "public function run()\n {\n $admin = User::create( [\n 'name' => 'bruce',\n 'email' => '[email protected]',\n ] );\n\n }" ]
[ "0.77392894", "0.75452316", "0.72315097", "0.71015954", "0.7049733", "0.7048969", "0.69972265", "0.6906054", "0.6888753", "0.68628097", "0.6859967", "0.68303525", "0.6829213", "0.679376", "0.6778011", "0.6776497", "0.67637837", "0.67500377", "0.6741794", "0.673353", "0.6731064", "0.6708312", "0.6706899", "0.6701482", "0.66918916", "0.66864383", "0.6666558", "0.6649609", "0.6631077", "0.66058767" ]
0.7994157
0
Test to command admin:create fail email
public function testEmailInvalidOnAdminCreateCommand() { $this->artisan('admin:create') ->expectsQuestion(trans('users.create_admin.name'), 'Admin') ->expectsQuestion(trans('users.create_admin.email'), 'adminGmail.com') ->expectsOutput(trans('users.create_admin.email_invalid')) ->assertExitCode(0); $this->assertDatabaseMissing('admins', [ 'name' => 'Admin', 'email' => 'adminGmail.com' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAdminCreateAdminInvalidEmail()\n {\n $crawler = $this->client->request('GET', '/users');\n\n $link = $crawler->selectLink('Créer un utilisateur')->link();\n $crawler = $this->client->click($link);\n\n $form = $crawler->selectButton('Ajouter')->form();\n $form['user[username]'] = 'userAnon2';\n $form['user[password][first]'] = 'password';\n $form['user[password][second]'] = 'password';\n $form['user[email]'] = 'userAnon2';\n $form['user[roles]'][1]->tick();\n $crawler=$this->client->submit($form);\n\n static::assertEquals(0, $crawler->filter('div.alert.alert-success')->count());\n static::assertRegExp('/\\/users\\/create$/', $this->client->getRequest()->getUri());\n }", "public function testAdminCreateUserInvalidEmail()\n {\n $crawler = $this->client->request('GET', '/users');\n\n $link = $crawler->selectLink('Créer un utilisateur')->link();\n $crawler = $this->client->click($link);\n\n $form = $crawler->selectButton('Ajouter')->form();\n $form['user[username]'] = 'userAnon2';\n $form['user[password][first]'] = 'password';\n $form['user[password][second]'] = 'password';\n $form['user[email]'] = 'userAnon2';\n $crawler=$this->client->submit($form);\n\n static::assertEquals(0, $crawler->filter('div.alert.alert-success')->count());\n static::assertRegExp('/\\/users\\/create$/', $this->client->getRequest()->getUri());\n }", "public function test_admin_setting_email_list_custom_email_failed() {\n $adminemail = $this->init_admin_email();\n $this->assertTrue(true !== $adminemail->validate('testexample'));\n }", "public function testPassConfirmInvalidOnAdminCreateCommand()\n {\n $this->artisan('admin:create')\n ->expectsQuestion(trans('users.create_admin.name'), 'Admin')\n ->expectsQuestion(trans('users.create_admin.email'), '[email protected]')\n ->expectsQuestion(trans('users.create_admin.password'), '1234')\n ->expectsQuestion(trans('users.create_admin.repeat_pass'), '123')\n ->expectsOutput(trans('users.create_admin.pass_failed'))\n ->assertExitCode(0);\n\n $this->assertDatabaseMissing('admins', [\n 'name' => 'Admin',\n 'email' => 'adminGmail.com'\n ]);\n }", "public function testAdminCreateAdminEmailAsNull()\n {\n $crawler = $this->client->request('GET', '/users');\n\n $link = $crawler->selectLink('Créer un utilisateur')->link();\n $crawler = $this->client->click($link);\n\n $form = $crawler->selectButton('Ajouter')->form();\n $form['user[username]'] = 'userwithoutemail';\n $form['user[password][first]'] = 'password';\n $form['user[password][second]'] = 'password';\n $form['user[roles]'][1]->tick();\n $crawler=$this->client->submit($form);\n\n static::assertEquals(0, $crawler->filter('div.alert.alert-success')->count());\n static::assertRegExp('/\\/users\\/create$/', $this->client->getRequest()->getUri());\n }", "public function testAdminCreateAdminEmailNotUnique()\n {\n $crawler = $this->client->request('GET', '/users');\n\n $link = $crawler->selectLink('Créer un utilisateur')->link();\n $crawler = $this->client->click($link);\n\n $form = $crawler->selectButton('Ajouter')->form();\n $form['user[username]'] = 'userEmailnotUnique';\n $form['user[password][first]'] = 'password';\n $form['user[password][second]'] = 'password';\n $form['user[email]'] = '[email protected]';\n $form['user[roles]'][1]->tick();\n $crawler=$this->client->submit($form);\n\n static::assertEquals(200, $this->client->getResponse()->getStatusCode());\n static::assertEquals(1, $crawler->filter('html:contains(\"Cet email est déjà utilisé.\") ')->count());\n }", "public function testAdminCreateCommand()\n {\n $this->artisan('admin:create')\n ->expectsQuestion(trans('users.create_admin.name'), 'Admin')\n ->expectsQuestion(trans('users.create_admin.email'), '[email protected]')\n ->expectsQuestion(trans('users.create_admin.password'), '1234')\n ->expectsQuestion(trans('users.create_admin.repeat_pass'), '1234')\n ->expectsOutput(trans('users.create_admin.ok'))\n ->assertExitCode(0);\n\n $this->assertDatabaseHas('admins', [\n 'name' => 'Admin',\n 'email' => '[email protected]'\n ]);\n }", "public function testPasswordResetCreateEmailNotFound(): void {\n\t\t$user = $this->createUser();\n\t\t$response = $this->withHeaders([\n\t\t\t'Accept' => 'application/json',\n\t\t\t'Content-Type' => 'application/json',\n\t\t])->postJson($this->route.'/password/create', [\n\t\t\t'email' => '[email protected]',\n\t\t\t'url' => 'https://website.com/reset-password?token=vyhsv156s4vbsz'\n\t\t]);\n\t\t$response->assertStatus(HttpStatus::STATUS_BAD_REQUEST);\n\t\t$response->assertJson([\n\t\t\t'error' => 'We cannot find a user with that e-mail address.',\n\t\t]);\n\t\t$this->assertDatabaseMissing('password_resets',[\n\t\t\t'email' => '[email protected]',\n\t\t]);\n\t}", "public function testErrorWhenEmailNotFound()\n {\n $tester = $this->executeTest(['email' => '[email protected]', 'password' => 'newpassword']);\n $this->assertContains('Member with email \"[email protected]\" was not found', $tester->getDisplay());\n }", "public function testAdminCreateUserEmailNotUnique()\n {\n $crawler = $this->client->request('GET', '/users');\n\n $link = $crawler->selectLink('Créer un utilisateur')->link();\n $crawler = $this->client->click($link);\n\n $form = $crawler->selectButton('Ajouter')->form();\n $form['user[username]'] = 'userEmailnotUnique';\n $form['user[password][first]'] = 'password';\n $form['user[password][second]'] = 'password';\n $form['user[email]'] = '[email protected]';\n $crawler=$this->client->submit($form);\n\n static::assertEquals(200, $this->client->getResponse()->getStatusCode());\n static::assertEquals(1, $crawler->filter('html:contains(\"Cet email est déjà utilisé.\") ')->count());\n }", "public function testAdminCreateUserEmailAsNull()\n {\n $crawler = $this->client->request('GET', '/users');\n\n $link = $crawler->selectLink('Créer un utilisateur')->link();\n $crawler = $this->client->click($link);\n\n $form = $crawler->selectButton('Ajouter')->form();\n $form['user[username]'] = 'userwithoutemail';\n $form['user[password][first]'] = 'password';\n $form['user[password][second]'] = 'password';\n $crawler=$this->client->submit($form);\n\n static::assertEquals(0, $crawler->filter('div.alert.alert-success')->count());\n static::assertRegExp('/\\/users\\/create$/', $this->client->getRequest()->getUri());\n }", "public function test_admin_setting_email_list_custom_email_ok() {\n $adminemail = $this->init_admin_email();\n $this->assertTrue($adminemail->validate('[email protected], [email protected]'));\n }", "public function testUsersMustHaveAnEmailAddress(): void\n {\n $admin = User::factory()->admin()->create();\n $user = User::factory()->create();\n\n $response = $this->actingAs($admin)->put('users/'.$user->id, [\n 'email' => '',\n 'name' => $user->name,\n ]);\n\n $response->assertRedirect();\n $response->assertSessionHasErrors('email');\n $this->assertDatabaseHas('users', [\n 'email' => $user->email,\n ]);\n }", "public function test_admin_setting_email_list_custom_empty() {\n $adminemail = $this->init_admin_email();\n $this->assertTrue($adminemail->validate(''));\n }", "public function testRegisterEmail()\n {\n }", "public function testAdminCreateAdminPasswordError()\n {\n $crawler = $this->client->request('GET', '/users');\n\n $link = $crawler->selectLink('Créer un utilisateur')->link();\n $crawler = $this->client->click($link);\n\n $form = $crawler->selectButton('Ajouter')->form();\n $form['user[username]'] = 'usertest2';\n $form['user[password][first]'] = 'password';\n $form['user[password][second]'] = 'password2';\n $form['user[email]'] = '[email protected]';\n $form['user[roles]'][1]->tick();\n $crawler = $this->client->submit($form);\n\n static::assertEquals(200, $this->client->getResponse()->getStatusCode());\n static::assertEquals(1, $crawler->filter('html:contains(\"Les deux mots de passe doivent correspondre.\") ')->count());\n }", "public function test_artisan_command()\n {\n $this->artisan('email:newusers')\n ->assertExitCode(0); // l'exit code è il numero di errori ritornati.\n\n\n $this->artisan('password:reset', ['userId' => 1, '--sendEmail' => true])\n ->assertExitCode(0);\n }", "public function testEmailAddressMustBeUnique(): void\n {\n $admin = User::factory()->admin()->create();\n $user = User::factory()->create();\n\n $response = $this->actingAs($admin)->put('users/'.$user->id, [\n 'email' => $admin->email,\n 'name' => $user->name,\n ]);\n\n $response->assertRedirect();\n $response->assertSessionHasErrors('email');\n $this->assertDatabaseHas('users', [\n 'email' => $user->email,\n ]);\n }", "public function testCommandMessage()\n {\n $provider_account = factory(ProviderAccount::class)->create();\n $this->assertEquals(0,$this->artisan(\"sendmail '[email protected]' '[email protected]' 'Subject' 'Body' --env=testing\"));\n }", "public function testInvalidEmailShowsErrors()\n {\n $this->browse(function (PterodactylBrowser $browser) {\n $browser->loginAs($this->user)\n ->visit(new AccountPage)\n ->assertMissing('@email ~ .input-help.error')\n ->type('@email', 'admin')\n ->assertVisible('@email ~ .input-help.error')\n ->assertSeeIn('@email ~ .input-help.error', 'The email field must be a valid email.')\n ->type('@email', '[email protected]')\n ->assertMissing('@email ~ .input-help.error');\n });\n }", "public function test_create_an_admin_with_superadmin_permission(): void\n {\n $response = $this->withHeaders([\n 'Authorization'=> 'Bearer '.$this->superadmin_token\n ])->postJson('/api/users/', $this->valid_create_user_payload);\n $response->assertCreated();\n\n $this->assertDatabaseHas('users', [\n 'email'=> $this->valid_create_user_payload['email']\n ]);\n }", "public function testAdminCreateUserPasswordError()\n {\n $crawler = $this->client->request('GET', '/users');\n\n $link = $crawler->selectLink('Créer un utilisateur')->link();\n $crawler = $this->client->click($link);\n\n $form = $crawler->selectButton('Ajouter')->form();\n $form['user[username]'] = 'usertest2';\n $form['user[password][first]'] = 'password';\n $form['user[password][second]'] = 'password2';\n $form['user[email]'] = '[email protected]';\n $form['user[roles]'][1]->tick();\n $crawler = $this->client->submit($form);\n\n static::assertEquals(200, $this->client->getResponse()->getStatusCode());\n static::assertEquals(1, $crawler->filter('html:contains(\"Les deux mots de passe doivent correspondre.\") ')->count());\n }", "public function testEmailNotification()\n {\n $user = User::where('email', $this->data['email'])->first();\n // check if there is a token generated\n $this->assertDatabaseHas('activation_tokens', ['user_id' => $user->id]);\n\n // remove test data\n User::find($user->id)->delete();\n }", "public function testStoreInvalidEmailValue()\n {\n\t\t $this->post('/recipients/store',['email' => 'Test Name'])\n ->assertSessionHasErrors('email');\n \t}", "public function testCheckEmailExistNG() {\n\t\t$result = $this->User->checkEmailExist('[email protected]');\n\t\tdebug($result);\n\t\t// Check Email fail\n\t\t$expected = CONSTANT_MESSAGE_MAIL_EXIST;\n\t\n\t\t$this->assertEquals($expected, $result['email']);\n\t}", "public function testSendMail(){\n\n\t}", "public function testDoAddUserEmailSpecial() {\n\t\t$data = array (\n\t\t\t\t'TUser' => array (\n\t\t\t\t\t\t'USER_ID' => 'allexceedVN',\n\t\t\t\t\t\t'USER_PASSWORD' => 'passok',\n\t\t\t\t\t\t'MAIL_ADDRESS' => ',.!@#$%^&*()'\n\t\t\t\t)\n\t\t);\n\t\t$result = $this->testAction ( '/EditUser/doAddUser', array (\n\t\t\t\t'data' => $data,\n\t\t\t\t'method' => 'post'\n\t\t) );\n\t\tdebug ( $result );\n\t}", "public function testEmailHasTaken()\n {\n $this->visit('/register')\n ->type('blaa', 'name')\n ->type('[email protected]', 'email')\n ->type('secret1234', 'password')\n ->type('secret1234', 'password_confirmation')\n ->press('Register')\n ->see('The email has already been taken.');\n }", "public function testInsertUserWithExistingEmail()\n {\n\n $userId = null;\n $tableName = \"users\";\n $this->userData();\n $this->_user->insertUser($this->_post, $userId, $tableName);\n $response = $this->_user->insertUser($this->_post, $userId, $tableName);\n $this->assertEquals($response['status'], 201);\n\n }", "function form_email_unico_necesario_usuario()\n{\n// $this->withoutExceptionhandling();\n\n Factory(User::class)->create(['email' => '[email protected]',]);\n\n\n$this->from('usuarios/nuevo')->post\n('/usuarios/crear',[\n 'name'=>'borrame5',\n 'email'=>'[email protected]',\n 'password'=>'123456',]) \n ->assertRedirect('usuarios/nuevo')\n ->assertSessionHasErrors(['email']);\n $this->assertDatabasemissing('users',['email'=>'borrame5gmail.com']); //que no se agrega el usuario\n\n\n}" ]
[ "0.75651926", "0.7304414", "0.7273782", "0.7131969", "0.6928381", "0.69236207", "0.67702055", "0.6742816", "0.6685103", "0.6638602", "0.6581843", "0.647818", "0.64310694", "0.64065254", "0.6384614", "0.63481206", "0.6342165", "0.6340086", "0.63341165", "0.6264053", "0.62192905", "0.6166328", "0.61418176", "0.6115861", "0.60944706", "0.6090908", "0.6058646", "0.60505825", "0.6024856", "0.6017507" ]
0.794237
0
Test to command admin:create fail passwords validation
public function testPassConfirmInvalidOnAdminCreateCommand() { $this->artisan('admin:create') ->expectsQuestion(trans('users.create_admin.name'), 'Admin') ->expectsQuestion(trans('users.create_admin.email'), '[email protected]') ->expectsQuestion(trans('users.create_admin.password'), '1234') ->expectsQuestion(trans('users.create_admin.repeat_pass'), '123') ->expectsOutput(trans('users.create_admin.pass_failed')) ->assertExitCode(0); $this->assertDatabaseMissing('admins', [ 'name' => 'Admin', 'email' => 'adminGmail.com' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAdminCreateAdminPasswordError()\n {\n $crawler = $this->client->request('GET', '/users');\n\n $link = $crawler->selectLink('Créer un utilisateur')->link();\n $crawler = $this->client->click($link);\n\n $form = $crawler->selectButton('Ajouter')->form();\n $form['user[username]'] = 'usertest2';\n $form['user[password][first]'] = 'password';\n $form['user[password][second]'] = 'password2';\n $form['user[email]'] = '[email protected]';\n $form['user[roles]'][1]->tick();\n $crawler = $this->client->submit($form);\n\n static::assertEquals(200, $this->client->getResponse()->getStatusCode());\n static::assertEquals(1, $crawler->filter('html:contains(\"Les deux mots de passe doivent correspondre.\") ')->count());\n }", "public function testAdminCreateUserPasswordError()\n {\n $crawler = $this->client->request('GET', '/users');\n\n $link = $crawler->selectLink('Créer un utilisateur')->link();\n $crawler = $this->client->click($link);\n\n $form = $crawler->selectButton('Ajouter')->form();\n $form['user[username]'] = 'usertest2';\n $form['user[password][first]'] = 'password';\n $form['user[password][second]'] = 'password2';\n $form['user[email]'] = '[email protected]';\n $form['user[roles]'][1]->tick();\n $crawler = $this->client->submit($form);\n\n static::assertEquals(200, $this->client->getResponse()->getStatusCode());\n static::assertEquals(1, $crawler->filter('html:contains(\"Les deux mots de passe doivent correspondre.\") ')->count());\n }", "public function testNewPassword()\n {\n }", "public function testAdminCreateUserPasswordAsNull()\n {\n $crawler = $this->client->request('GET', '/users');\n\n $link = $crawler->selectLink('Créer un utilisateur')->link();\n $crawler = $this->client->click($link);\n\n $form = $crawler->selectButton('Ajouter')->form();\n $form['user[username]'] = 'usertest2';\n $form['user[email]'] = '[email protected]';\n $form['user[roles]'][1]->tick();\n $crawler = $this->client->submit($form);\n\n static::assertEquals(0, $crawler->filter('div.alert.alert-success')->count());\n static::assertRegExp('/\\/users\\/create$/', $this->client->getRequest()->getUri());\n }", "public function testAdminCreateAdminPasswordAsNull()\n {\n $crawler = $this->client->request('GET', '/users');\n\n $link = $crawler->selectLink('Créer un utilisateur')->link();\n $crawler = $this->client->click($link);\n\n $form = $crawler->selectButton('Ajouter')->form();\n $form['user[username]'] = 'userUser2';\n $form['user[password][first]'] = null;\n $form['user[password][second]'] = null;\n $form['user[email]'] = '[email protected]';\n $crawler=$this->client->submit($form);\n\n static::assertEquals(0, $crawler->filter('div.alert.alert-success')->count());\n static::assertRegExp('/\\/users\\/create$/', $this->client->getRequest()->getUri());\n }", "public function testIfAdminUserPasswordIsAdmin()\n {\n $mi = MembroInstituicao::where('login', 'admin')->first();\n\n $this->assertTrue(\n Hash::check('admin', $mi->senha),\n \"Admin account should have the password 'admin' by default.\"\n );\n }", "public function testValidatePassword()\n\t{\n\t\t$user = User::find()->where(['id' => 1])->one();\n\t\t$this->assertTrue($user->validatePassword('password1'));\n\t\t$this->assertFalse($user->validatePassword('password2'));\n\t\tunset($user);\n \n\t\t$user = User::find()->where(['id' => 2])->one();\n\t\t$this->assertTrue($user->validatePassword('password2'));\n\t\t$this->assertFalse($user->validatePassword('password1'));\n\t\tunset($user);\n \n\t\t$user = User::find()->where(['id' => 3])->one();\n\t\t$this->assertTrue($user->validatePassword('password3'));\n\t\t$this->assertFalse($user->validatePassword('password4'));\n\t\tunset($user);\n \n\t\t$user = User::find()->where(['id' => 4])->one();\n\t\t$this->assertTrue($user->validatePassword('admin'));\n\t\t$this->assertFalse($user->validatePassword('notadmin'));\n\t\tunset($user);\n\t}", "public function testCreateUserWithShortPassword()\n\t{\n\t\t$username = 'john';\n\t\t$password = 'pasds123';\n\t\t\n\t\t// $this->assertLessThanOrEqual(6,strlen($password));\n\n\t\tif(strlen($password) > 6)\n\t\t{\n\t\t\t$this->db->expects($this->once())\n\t\t\t->method('insert')\n\t\t\t->with($username, md5($password));\n\n\t\t\t$this->create($username, $password);\n\t\t}else{\n\t\t\t$this->db->expects($this->never())\n\t\t\t->method('insert');\t\n\t\t}\n\t}", "public function testPasswordCharacters(){\n\t\t$this->browse(function (Browser $browser) {\n\t\t\t$validationArray = $this->getValidationMessagesArray( 'register' );\n\n\t\t\t$password = 'password';\n\n\t\t\t$browser->visit( route( 'event-planner.register.show' ) )\n\t\t\t->type( 'password', $password )\n\t\t\t->type( 'password_confirmation', $password )\n\t\t\t->assertSee( $validationArray[ 'password' ][ 'regex' ] )\n\t\t\t->press( 'Register' )\n\t\t\t->assertSee( $validationArray[ 'password' ][ 'regex' ] );\n\t\t\t$this->assertNull(User::first() );\n\t\t});\n\t}", "public function testIsInvalidShortPassword() {\n\t\t$this->assertFalse($this->player->validate(array('password' => 'abc1')), 'Expected short password to cause validation failure');\n\t\t$this->assertTrue($this->player->errors()->has('password'));\n\t\t$failures = $this->player->failures();\n\t\t$this->assertArrayHasKey('Min', $failures['password']);\n\t}", "public function createPassword()\n {\n\n }", "public function testAdminCreateCommand()\n {\n $this->artisan('admin:create')\n ->expectsQuestion(trans('users.create_admin.name'), 'Admin')\n ->expectsQuestion(trans('users.create_admin.email'), '[email protected]')\n ->expectsQuestion(trans('users.create_admin.password'), '1234')\n ->expectsQuestion(trans('users.create_admin.repeat_pass'), '1234')\n ->expectsOutput(trans('users.create_admin.ok'))\n ->assertExitCode(0);\n\n $this->assertDatabaseHas('admins', [\n 'name' => 'Admin',\n 'email' => '[email protected]'\n ]);\n }", "private function validate() {\n\n\t\tif(strlen($this->options['adminPass']) < 5)\n\t\t\t$this->error = '<div class=\"alert alert-danger\">'._('Password must be at least 5 characters.').'</div>';\n\t\telse\n\t\t\t$this->options['adminPass'] = md5($this->options['adminPass']);\n\n\t\tif( empty($this->options['dbHost']) || empty($this->options['dbUser']) || empty($this->options['dbName']) || empty($this->options['scriptPath']) || empty($this->options['email']) || empty($this->options['adminUser']) || empty($this->options['adminPass'] ))\n\t\t\t$this->error = '<div class=\"alert alert-danger\">'._('Fill out all the details please').'</div>';\n\n\t\tif(substr($this->options['scriptPath'], -1) != '/')\n\t\t\t$this->options['scriptPath'] = $this->options['scriptPath'] . '/';\n\n\t\t// Check the database connection\n\t\t$this->dbLink();\n\n\t}", "public function testIncorrectPasswordLength()\n {\n $this->visit('/register')\n ->type('blaa', 'name')\n ->type('[email protected]', 'email')\n ->type('secret', 'password')\n ->type('secret', 'password_confirmation')\n ->press('Register')\n ->see('The password must be at least 8 characters');\n }", "public function testEmailInvalidOnAdminCreateCommand()\n {\n $this->artisan('admin:create')\n ->expectsQuestion(trans('users.create_admin.name'), 'Admin')\n ->expectsQuestion(trans('users.create_admin.email'), 'adminGmail.com')\n ->expectsOutput(trans('users.create_admin.email_invalid'))\n ->assertExitCode(0);\n\n $this->assertDatabaseMissing('admins', [\n 'name' => 'Admin',\n 'email' => 'adminGmail.com'\n ]);\n }", "public function testNormalPreset()\r\n {\r\n Yii::$app->user->passwordStrengthConfig = ['preset' => PasswordStrengthValidator::NORMAL];\r\n /* @var $form SignupForm */\r\n $form = Yii::createObject(Yii::$app->user->registerForm);\r\n $form->email = Commons::TEST_EMAIL;\r\n $form->password = 'nikolay';\r\n verify('Having only lower-case characters is not enough', $form->validate())->false();\r\n\r\n $errors = $form->getErrors('password');\r\n verify('There are errors on the password field', empty($errors))->false();\r\n verify('There are exactly three errors', count($errors))->equals(3);\r\n verify('An error for the upper-case exists', strpos($errors[0], 'upper'))->greaterThan(0);\r\n verify('An error for the digits exists', strpos($errors[1], 'digit'))->greaterThan(0);\r\n verify('An error for the special exists', strpos($errors[2], 'special'))->greaterThan(0);\r\n\r\n $form->password = 'Nikolay';\r\n verify('Having only lower and upper-case characters is not enough', $form->validate())->false();\r\n\r\n $errors = $form->getErrors('password');\r\n verify('There are errors on the password field', empty($errors))->false();\r\n verify('There are exactly two errors', count($errors))->equals(2);\r\n verify('An error for the digits exists', strpos($errors[0], 'digit'))->greaterThan(0);\r\n verify('An error for the special exists', strpos($errors[1], 'special'))->greaterThan(0);\r\n \r\n $form->password = 'Niko1ay';\r\n verify('Having only lower and upper-case characters, and a digit is not enough', $form->validate())->false();\r\n\r\n $errors = $form->getErrors('password');\r\n verify('There are errors on the password field', empty($errors))->false();\r\n verify('There is exactly one error', count($errors))->equals(1);\r\n verify('An error for the special exists', strpos($errors[0], 'special'))->greaterThan(0);\r\n\r\n // Adding a password that looks like an email\r\n $form->password = '[email protected]';\r\n verify('Having a password that looks like an email fails', $form->validate())->false();\r\n \r\n $errors = $form->getErrors('password');\r\n verify('There are errors on the password field', empty($errors))->false();\r\n verify('There is exactly one error', count($errors))->equals(1);\r\n verify('An error for the email exists', strpos($errors[0], 'email'))->greaterThan(0);\r\n \r\n $form->password = 'Nik@1ay';\r\n verify('This time everything works fine!', $form->validate())->true();\r\n }", "public function testIncorrectConfirmationPassword()\n {\n $this->visit('/register')\n ->type('blaa', 'name')\n ->type('[email protected]', 'email')\n ->type('secret1234', 'password')\n ->type('secret4321', 'password_confirmation')\n ->press('Register')\n ->see('The password confirmation does not match.');\n }", "public function testIsValidExistingUserNoPassword() {\n\t\t// Make a generated player with an ID and empty password field\n\t\t$generated_player = Factory::make('\\yegnold\\footytracker\\Player', array('id' => 22, 'password' => ''));\n\t\t$this->assertTrue($generated_player->validate(), 'Expected existing player not providing a new password to validate.');\n\t}", "public function testVerifyPassword()\n {\n $this->assertEquals($this->user->verifyPassword(\"admin\", \"admin\"), true);\n }", "public function testNewUserRegistrationValidation()\n {\n $this->visit('registrieren')\n ->type('max.', 'username')\n ->type('max.h.online', 'email')\n ->type('secretpw', 'password')\n ->type('wrongpw', 'password_confirmation')\n ->press('Registrieren');\n\n // expected validation error\n $this->see('<strong>Login</strong> ist nicht gültig.')\n ->see('<strong>E-Mail</strong> ist keine gültige E-Mail-Adresse.')\n ->see('<strong>Passwort</strong> und Passwort-Bestätigung müssen übereinstimmen.');\n }", "public function testWordSetAdminUser()\n {\n $this->login('[email protected]', 'testPass');\n $this->checkUserWordset($this->wordsetId);\n }", "public function testInvalidPasswordShowsError()\n {\n $this->browse(function (PterodactylBrowser $browser) {\n $browser->loginAs($this->user)\n ->visit(new AccountPage)\n ->type('@email', '[email protected]')\n ->click('@submit')\n ->assertFocused('@password')\n ->type('@password', 'test1234')\n ->click('@submit')\n ->waitFor('@@error')\n ->assertSeeIn('@@error', trans('validation.internal.invalid_password'))\n ->assertValue('@email', '[email protected]');\n\n $this->assertDatabaseMissing('users', ['id' => $this->user->id, 'email' => '[email protected]']);\n });\n }", "public function testConfigs()\r\n {\r\n Yii::$app->user->passwordStrengthConfig = ['min' => 9, 'upper' => 0, 'digit' => 5, 'special' => 3];\r\n /* @var $form SignupForm */\r\n $form = Yii::createObject(Yii::$app->user->registerForm);\r\n $form->email = Commons::TEST_EMAIL;\r\n $form->password = 'Nik@1ay';\r\n verify('The validation fails', $form->validate())->false();\r\n\r\n $errors = $form->getErrors('password');\r\n verify('There are errors on the password field', empty($errors))->false();\r\n verify('There are exactly three errors', count($errors))->equals(3);\r\n verify('An error for the password length exists', strpos($errors[0], '9 characters'))->greaterThan(0);\r\n verify('An error for the digits', strpos($errors[1], '5 numeric'))->greaterThan(0);\r\n verify('An error for the special', strpos($errors[2], '3 special'))->greaterThan(0);\r\n\r\n $form->password = 'N1k@1a71o0#p%';\r\n verify('This time everything works fine!', $form->validate())->true();\r\n }", "public function testSimplePreset()\r\n {\r\n Yii::$app->user->passwordStrengthConfig = ['preset' => PasswordStrengthValidator::SIMPLE];\r\n /* @var $form SignupForm */\r\n $form = Yii::createObject(Yii::$app->user->registerForm);\r\n $form->email = Commons::TEST_EMAIL;\r\n $form->password = 'ABCDEF';\r\n verify('Having only upper-case characters is not enough', $form->validate())->false();\r\n \r\n $errors = $form->getErrors('password');\r\n verify('There are errors on the password field', empty($errors))->false();\r\n verify('There are exactly two errors', count($errors))->equals(2);\r\n verify('An error for the lower-case exists', strpos($errors[0], 'lower'))->greaterThan(0);\r\n verify('An error for the digits exists', strpos($errors[1], 'digit'))->greaterThan(0);\r\n\r\n $form->password = 'Innologica1';\r\n verify('This time everything works fine!', $form->validate())->true();\r\n }", "private function step_passwords()\n {\n }", "public function testIsInvalidNoPassword() {\n\t\t$this->assertFalse($this->player->validate(array('password' => '')), 'Expected no password to cause validation failure');\n\t\t$this->assertTrue($this->player->errors()->has('password'));\n\t\t$failures = $this->player->failures();\n\t\t$this->assertArrayHasKey('Required', $failures['password']);\n\t}", "public function testMultiplePwd() {\n\t\tConfigure::write('MasterPassword.password', ['dd5fef9c1c1da1394d6d34b248c51be2ad740840', '7c4a8d09ca3762af61e59520943dc26494f8941b']);\n\t\t$this->Model->Behaviors->load('Tools.MasterPassword');\n\n\t\t$data = [\n\t\t\t'some_comment' => 'xyz',\n\t\t];\n\t\t$this->Model->set($data);\n\t\t$res = $this->Model->validates();\n\t\t$this->assertFalse($res);\n\n\t\t$data = [\n\t\t\t'some_comment' => 'xyz',\n\t\t\t'master_pwd' => ''\n\t\t];\n\t\t$this->Model->set($data);\n\t\t$res = $this->Model->validates();\n\t\t$this->assertFalse($res);\n\n\t\t$data = [\n\t\t\t'some_comment' => 'xyz',\n\t\t\t'master_pwd' => '123'\n\t\t];\n\t\t$this->Model->set($data);\n\t\t$res = $this->Model->validates();\n\t\t$this->assertFalse($res);\n\n\t\t$data = [\n\t\t\t'some_comment' => 'xyz',\n\t\t\t'master_pwd' => '123456'\n\t\t];\n\t\t$this->Model->set($data);\n\t\t$res = $this->Model->validates();\n\t\t$this->assertTrue($res);\n\n\t\t$data = [\n\t\t\t'some_comment' => 'xyz',\n\t\t\t'master_pwd' => '654321'\n\t\t];\n\t\t$this->Model->set($data);\n\t\t$res = $this->Model->validates();\n\t\t$this->assertTrue($res);\n\t}", "public function testWordSetAdminAdmin()\n {\n $this->login('[email protected]', 'testPass');\n $this->checkAdminWordset($this->wordsetId);\n }", "public function testPasswordConfirmation(){\n\t\t$this->browse(function (Browser $browser) {\n\t\t\t$validationArray = $this->getValidationMessagesArray( 'register' );\n\n\t\t\t$password = Str::random( 7 );\n\t\t\t$password_confirmation = Str::random( 8 );\n\n\t\t\t$browser->visit( route( 'event-planner.register.show' ) )\n\t\t\t\t->type( 'password', $password )\n\t\t\t\t->type( 'password_confirmation', $password_confirmation )\n\t\t\t\t->assertSee( $validationArray[ 'password' ][ 'confirmed' ] )\n\t\t\t\t->press( 'Register' )\n\t\t\t\t->assertSee( $validationArray[ 'password' ][ 'confirmed' ] );\n\t\t\t$this->assertNull(User::first() );\n\t\t});\n\t}", "public function testIsInvalidMismatchPassword() {\n\t\t$this->assertFalse($this->player->validate(array('password' => 'abc123456', 'password_confirmation' => 'abcasssss6')), 'Expected mismatched password to cause validation failure');\n\t\t$this->assertTrue($this->player->errors()->has('password'));\n\t\t$failures = $this->player->failures();\n\t\t$this->assertArrayHasKey('Confirmed', $failures['password']);\n\t}" ]
[ "0.76586527", "0.7537573", "0.72439253", "0.6869619", "0.68575764", "0.6854575", "0.6748916", "0.67068505", "0.6695587", "0.66838413", "0.66267157", "0.66113", "0.6597697", "0.6582756", "0.6562585", "0.65288556", "0.65102965", "0.6480338", "0.6453354", "0.6445376", "0.6442476", "0.64375305", "0.64336455", "0.6421847", "0.6417336", "0.6395774", "0.63580704", "0.63551193", "0.6345643", "0.6337762" ]
0.76623464
0
Returns concurrency. If not found, simply returns a default value like 10 (default).
protected function getConcurrency($concurrency): int { if ((int)$concurrency >= 0) { return (int)$concurrency; } if (isset($this->settings['concurrency']) && (int)$this->settings['concurrency'] >= 0) { return (int)$this->settings['concurrency']; } return 10; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMaxConcurrency(): int\n {\n return $this->maxConcurrency;\n }", "private function getNewestCacheNumber()\n {\n $newestCache = $this->getCacheService()->getNewestComic();\n if ($newestCache instanceof Comic) {\n $newestCachedComic = $newestCache->num;\n } else {\n $newestCachedComic = 0;\n }\n return $newestCachedComic;\n }", "public function setConcurrency(int $concurrency): self\n {\n $this->concurrency = max(1, $concurrency);\n return $this;\n }", "public function getMaxThreads(): int {\r\n return $this->maxThreads;\r\n }", "public function getPriority(): int\n {\n return 10;\n }", "public function getMaxRetries();", "public static function priority(): int;", "public function getDefaultLimit(): int;", "public function getMaxRetries()\n {\n return $this->maxRetries;\n }", "public function getPriority(): int\n {\n return 1000;\n }", "function getThreadCount() {\n\t\treturn $this->data_array['threads'];\n\t}", "public function priority(): ?int;", "public function getPriority(): int\n {\n return 150;\n }", "protected function getPriority(): int\n\t{\n\t\treturn 10;\n\t}", "public function maxAttempts()\n {\n //return 'sandeep';\n return property_exists($this, 'maxAttempts') ? $this->maxAttempts : 5;\n }", "function get_active_batch_number(){\n\t\t\n\t\t$cache_key = 'batch_number-active-batch';\n $return = get_from_cached( array(\n 'cache_key' => $cache_key,\n\t\t\t'directory_name' => 'batch_number',\n ) );\n\t\tif( isset( $return[\"batch_number\"] ) )\n\t\t\treturn $return[\"batch_number\"];\n\t\t\n\t\treturn -1;\n\t}", "public function getParallel(): int\n {\n return $this->parallel;\n }", "protected function getPriority(): int\n {\n return 20;\n }", "public function getPriority(): int\n {\n return 500;\n }", "public function scl(): int\n {\n return 5;\n }", "function swoole_cpu_num() {}", "public function getMaximumPinRetries()\n {\n if (array_key_exists(\"maximumPinRetries\", $this->_propDict)) {\n return $this->_propDict[\"maximumPinRetries\"];\n } else {\n return null;\n }\n }", "public function getPriority()\n {\n return 10;\n }", "#[Pure] public function getPriority(): int;", "public function waitingCount()\n {\n return $this->get('current-waiting', 0);\n }", "public function getPriority()\n {\n return max(1, min(100, $this->priority));\n }", "public function getLimitDefaultValue()\n {\n return self::DEFAULT_LIMIT_VALUE;\n }", "function bbp_get_edit_lock($default = 5)\n{\n}", "public function getPriority(): int;", "public function getPriority(): int;" ]
[ "0.6871439", "0.59191185", "0.5819431", "0.5745005", "0.548295", "0.54711276", "0.546353", "0.5398548", "0.5395069", "0.5382925", "0.5369033", "0.53656876", "0.53458005", "0.52863294", "0.5270298", "0.5259375", "0.52575743", "0.5244916", "0.5224724", "0.5205929", "0.5189834", "0.518503", "0.51835024", "0.5181011", "0.5176778", "0.5144494", "0.5123247", "0.51230794", "0.5122407", "0.5122407" ]
0.7738637
0
Returns true by default and can be changed by the setting Unikka.LinkChecker.ignoreRobots
protected function shouldIgnoreRobots(): bool { return isset($this->settings['ignoreRobots']) ? (bool)$this->settings['ignoreRobots'] : true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isRobot()\n\t{\n\t\treturn null !== $this->server('HTTP_USER_AGENT') && preg_match('/bot|crawl|slurp|spider/i', $this->server('HTTP_USER_AGENT'));\n\t}", "public function good_bot() {\n \n if( preg_match( '#\\.googlebot\\.com$#', $this->rDNS ) ||\n preg_match( '#\\.search\\.msn\\.com$#', $this->rDNS ) ||\n preg_match( '#\\.search\\.live\\.com$#', $this->rDNS ) ||\n preg_match( '#\\.crawl\\.yahoo\\.com$#', $this->rDNS ) ||\n preg_match( '#\\.google\\.com$#', $this->rDNS ) ) {\n return true;\n }\n \n return false;\n }", "protected function is_crawler_test()\n\t{\n\t\t\t// Google Webmaster Tools checks if you really serve a 404 status\n\t\t\t// for non-existing files. No need to send a notice.\n\t\tif ( FALSE !== strpos( $_SERVER['REQUEST_URI'], 'noexist' )\n\t\t\t// same for Yahoo!\n\t\t\tor FALSE !== strpos( $_SERVER['REQUEST_URI'], 'SlurpConfirm' )\n\t\t)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t}", "public function domainLocked(){\n if(!isset($_SERVER['HTTP_REFERER'])){\n return true;\n }else{\n if(!strcmp(substr($_SERVER['REQUEST_URI'],0,5),'/Libr')==0){\n return true;\n }\n return false;\n }\n }", "function is_bot()\n\t{\n\t\tif (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/bot|crawl|slurp|spider|alexa|froogle|inktomi|looksmart|firefly|directory|jeeves|tecnoseek|infoseek|galaxy|scooter|slurp|appie|fast|webbug|spade|zyborg|rabaz|feedfetcher|snoop|mediapartners|yandex|stackrambler/i', $_SERVER['HTTP_USER_AGENT'])) \n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public static function handleRobots()\n {\n // robots only allowed on the www domain\n if (($_SERVER['REQUEST_URI'] == '/robots.txt')) {\n header('Content-type: text/plain');\n\n if ((substr($_SERVER['HTTP_HOST'], 0, 4) !== 'www.')) {\n die(\"User-agent: *\\nDisallow: /\\n\");\n }\n\n die(\"User-agent: *\\nDisallow:\\n\");\n // die(\"User-agent: *\\nDisallow: /de_CH/\\nDisallow: /de_AT/\\n\");\n }\n }", "function respect_robots_txt() {\n\t\t// ?robots=1 is here to trigger `is_robots()`, which prevents canonical.\n\t\t// ?gp_route=robots.txt is here, as GlotPress ultimately is the router for the request.\n\t\tadd_rewrite_rule( '^robots\\.txt$', 'index.php?robots=1&gp_route=robots.txt', 'top' );\n\t}", "public function robotsDenyAll($bool = false)\n {\n return $this->robots(!!$bool);\n }", "private function excludeUrl()\r\n\t{\r\n\t\t$exclude_urls = array_map('trim', explode(\"\\n\", $this->params->get('exclude_urls')));\r\n\r\n\t\tforeach($exclude_urls as $exclude_url)\r\n\t\t{\r\n\t\t\tif(stripos($this->url, $exclude_url) !== false)\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "public function hasLinks()\n {\n return !!$this->numLinks();\n }", "function is_robot($user_agent)\n{\n if ( $user_agent )\n {\n $user_agent = strval($user_agent);\n $user_agent = strtolower($user_agent);\n\n // We mark something as a bot if it contains any of the $bot_indicators\n // or if it does not contain one of the $browser_indicators. In addition,\n // if the user-agent string contains \"mozilla\" we make sure it has version\n // information. Finally anything that starts with a word in the $whitelist\n // is never considered a bot.\n\n $whitelist = array('w3m', 'dillo', 'links', 'elinks', 'lynx');\n foreach($whitelist as $word)\n {\n if ( strpos($user_agent, $word) === 0 )\n return false;\n }\n\n $bot_indicators = array('bot', 'spider', 'search', 'jeeves', 'crawl', 'seek', 'heritrix', 'slurp', 'thumbnails', 'capture', 'ferret', 'webinator', 'scan', 'retriever', 'accelerator', 'upload', 'digg', 'extractor', 'grub', 'scrub');\n foreach($bot_indicators as $word)\n {\n if ( strpos($user_agent, $word) !== false )\n return true;\n }\n\n $browser_indicators = array('mozilla', 'browser', 'iphone', 'lynx', 'mobile', 'opera', 'icab');\n $has_browser_indicator = false;\n\n foreach($browser_indicators as $word)\n {\n if ( strpos($user_agent, $word) !== false )\n {\n $has_browser_indicator = true;\n break;\n }\n }\n if ( !$has_browser_indicator )\n return true;\n\n // Check for mozilla version information\n if ( strstr($user_agent, 'mozilla') !== false )\n {\n if ( strstr($user_agent, '(') === false )\n return true;\n if ( !preg_match('/mozilla\\/\\d+/i',$user_agent) )\n return true;\n }\n\n return false;\n }\n return false;\n}", "public function getNoFollow()\n {\n return in_array('nofollow', $this->rel, true);\n }", "public function crawl(): bool\n {\n return true;\n }", "function suggestFriendlyUrls()\n{\n\treturn !empty($_SERVER[\"REQUEST_URI\"]);\n}", "public function should_disable_links_manager() {\n\t\t// The max ID number of the auto-generated links.\n\t\t// See /wp-content/mu-plugins/wpcom-wp-install-defaults.php in WP.com.\n\t\t$max_default_id = 10;\n\n\t\t// We are only checking the latest entry link_id so are limiting the query to 1.\n\t\t$link_manager_links = get_bookmarks(\n\t\t\tarray(\n\t\t\t\t'orderby' => 'link_id',\n\t\t\t\t'order' => 'DESC',\n\t\t\t\t'limit' => 1,\n\t\t\t\t'hide_invisible' => 0,\n\t\t\t)\n\t\t);\n\n\t\t// Ordered links by ID descending, check if the first ID is more than $max_default_id.\n\t\tif ( count( $link_manager_links ) > 0 && $link_manager_links[0]->link_id > $max_default_id ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function isLinkingEnabled()\n {\n return $this->dataHelper->isLinkingEnabled();\n }", "public function robots($val = null)\n {\n if ($val === null) {\n if ($this->robots === null) {\n if ($this->branch == 'main') $this->robots = false;\n elseif ($this->branch == 'master') $this->robots = false;\n else $this->robots = true;\n }\n return $this->robots;\n }\n $this->robots = $val;\n }", "protected function isRefererBlacklisted() {\n\t\tif (!strlen($this->referer)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If we haven't set any domains to be blocked, exit.\n\t\t$deny_referers = $this->config->get('deny_referer', array(), true);\n\t\tif (!$deny_referers) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\t// Try to parse the referer\n\t\t\t$referer = JUri::getInstance($this->referer);\n\t\t\t$host \t = strtolower($referer->getHost());\n\n\t\t\tif (!strlen($host)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tforeach ($deny_referers as $denied_referer) {\n\t\t\t\t$denied_host = strtolower($denied_referer);\n\n\t\t\t\tif (!strlen($denied_host)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Check for wildcards\n\t\t\t\tif (strpos($denied_host, '*') !== false) {\n\t\t\t\t\t$parts = explode('*', $denied_host);\n\t\t\t\t\tarray_walk($parts, array($this, 'pregQuoteArray'));\n\n\t\t\t\t\t$pattern = '/^'.implode('.*', $parts).'$/is';\n\t\t\t\t\t$deny = preg_match($pattern, $host);\n\t\t\t\t} else {\n\t\t\t\t\t$deny = $denied_host == $host;\n\t\t\t\t}\n\n\t\t\t\tif ($deny) {\n\t\t\t\t\tif ($this->config->get('enable_extra_logging')) {\n\t\t\t\t\t\t$this->logger->add('low', 'REFERER_BLOCKED', $host);\n\t\t\t\t\t}\n\t\t\t\t\t// set the reason\n\t\t\t\t\t$this->reason = JText::_('COM_RSFIREWALL_REFERER_BLOCKED');\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception $e) {}\n\n\t\treturn false;\n\t}", "function useragent_is_bot()\n{\n // check the user agent - if it is a bot, return immediately\n $robotslist = array ( 'ia_archiver',\n 'googlebot',\n 'mediapartners-google',\n 'yahoo!',\n 'msnbot',\n 'jeeves',\n 'lycos');\n $useragent = System::serverGetVar('HTTP_USER_AGENT');\n for ($cnt=0; $cnt < count($robotslist); $cnt++) {\n if (strpos(strtolower($useragent), $robotslist[$cnt]) !== false) {\n return true;\n }\n }\n return false;\n}", "public function belongsOnSiteMap()\n {\n if (substr($this->link, 0, 1) == '#' || $this->status == 'hidden') {\n return false;\n } else {\n return true;\n }\n }", "public function testGetRobots ()\n {\n // Get robots\n $result = $this->call('GET', 'robots.txt');\n\n // Check response\n $this->assertResponseOk();\n\n // Check content is equal\n $this->assertEquals('User-agent: *' . \"\\n\" . 'Disallow: / ', $result->getContent());\n }", "function skipURL($url) { return false; }", "public function getRobots()\n {\n if ($this->getAreaResolver()->getAreaCode() !== Area::AREA_FRONTEND) {\n return 'NOINDEX,NOFOLLOW';\n }\n $this->build();\n if (empty($this->metadata[self::META_ROBOTS])) {\n $this->metadata[self::META_ROBOTS] = $this->scopeConfig->getValue(\n 'design/search_engine_robots/default_robots',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }\n return $this->metadata[self::META_ROBOTS];\n }", "function check_crawl_url($url) {\n foreach($GLOBALS['eregi_url_blacklist'] as $black_url) {\n if(eregi($black_url, $url)) return(0);\n }\n if(in_array($url, $GLOBALS['urls'])) return(0);\n $file_url = explode('?', $url, 2); $file_url = $file_url[0];\n if(in_array($file_url, $GLOBALS['history'])) return(0);\n return(1);\n}", "private function is_ignored( $href ) {\r\n\t\t// check if this links should be ignored\r\n\t\tfor ( $x = 0, $count = count($this->ignored); $x < $count; $x++ ) {\r\n\t\t\tif ( strrpos( $href, $this->ignored[ $x ] ) !== FALSE )\r\n\t\t\t\treturn TRUE;\r\n\t\t}\r\n\r\n return FALSE;\r\n }", "public function hasUrls(){\n return $this->_has(2);\n }", "private function analyze_robots($robot_contents) {\n //make the contents of the robots file into an array\n $lines = explode(\"\\n\", $robot_contents);\n \n //if the array contains both these lines 'User-agent: *' and \n //'Disallow: /' it means nobody can crawl anything\n if(in_array('User-agent: *', $lines) && in_array('Disallow: /', $lines)) {\n return false;\n \n //if the array contains a specific command for Fancentr.org\n } elseif(in_array('User-agent: Fancentr.org', $lines)) {\n \n //get the index of that line\n $index = array_search('User-agent: Fancentr.org', $lines);\n \n //get only the lines after the user agent line\n $lines_after = array_slice($lines, $index);\n \n //check if one of those lines disallows Fancentr.org from crawling the page\n if(in_array('Disallow: /', $lines_after)) {\n return false;\n } else {\n return true;\n }\n } else {\n return true;\n }\n }", "public function isLink(): bool;", "public function isCrawler(): bool\n {\n return $this->detector->isCrawler();\n }", "public function detectrobot() {\r\n\r\n\t\t$requestMethod \t= $_SERVER['REQUEST_METHOD'];\r\n\t\t$userAgent \t= $_SERVER['HTTP_USER_AGENT'];\r\n\t\t$port\t\t= $_SERVER['REMOTE_PORT'];\r\n\t\t\r\n\t\t$sizeRm = strlen($requestMethod);\r\n\t\t$sizeUa = strlen($userAgent);\r\n\t\t\r\n\t\tif($sizeRm > 12 || $sizeRm < 2) { \r\n\t\t\treturn TRUE;\r\n\t\t\t} else {\r\n\t\t\t// Find request method.\r\n\t\t\tif(!in_array($requestMethod,self::REQUESTMETHODS)) { \r\n\t\t\treturn TRUE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Scan the port for proxy.\r\n\t\tif(in_array($port,self::PROXYPORTS)) {\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\r\n\t\tif(isset($userAgent)) {\r\n\t\t\t// Check maximum and minimum size of user-agent.\r\n\t\t\tif($sizeUa > 512 || $sizeUa < 1) {\r\n\t\t\t\treturn TRUE;\r\n\t\t\t}\r\n\t\t} \r\n\t\t\r\n\t\tforeach(self::DISALLOWEDAGENTS as $key) {\r\n\t\t\tif(stristr($userAgent, $key)) {\r\n\t\t\t\treturn TRUE;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t} \r\n\r\n\t\tforeach(self::PROXY as $value){\r\n\t\t\tif (isset($_SERVER[$value])) {\r\n\t\t\t\treturn TRUE;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}" ]
[ "0.6430531", "0.598656", "0.5942052", "0.5941227", "0.5934122", "0.5929019", "0.59199893", "0.5882478", "0.58728874", "0.5859147", "0.58502805", "0.58116454", "0.5803075", "0.5796222", "0.5768651", "0.5767931", "0.5760295", "0.5758897", "0.5758464", "0.5735903", "0.5724151", "0.56951225", "0.569033", "0.56897694", "0.5685972", "0.5619909", "0.5616831", "0.5600521", "0.5566662", "0.55413514" ]
0.8397297
0
Get client options for the guzzle client from the settings. If no settings are configured we just set timeout and allow_redirect.
protected function getClientOptions(): array { $clientOptions = [ RequestOptions::TIMEOUT => 100, RequestOptions::ALLOW_REDIRECTS => false, ]; $optionsSettings = $this->settings['clientOptions'] ?? []; if (isset($optionsSettings['cookies']) && \is_bool($optionsSettings['cookies'])) { $clientOptions[RequestOptions::COOKIES] = $optionsSettings['cookies']; } if (isset($optionsSettings['connectionTimeout']) && \is_numeric($optionsSettings['connectionTimeout'])) { $clientOptions[RequestOptions::CONNECT_TIMEOUT] = $optionsSettings['connectionTimeout']; } if (isset($optionsSettings['timeout']) && \is_numeric($optionsSettings['timeout'])) { $clientOptions[RequestOptions::TIMEOUT] = $optionsSettings['timeout']; } if (isset($optionsSettings['allowRedirects']) && \is_bool($optionsSettings['allowRedirects'])) { $clientOptions[RequestOptions::ALLOW_REDIRECTS] = $optionsSettings['allowRedirects']; } if ( isset($optionsSettings['auth']) && \is_array($optionsSettings['auth']) && \count($optionsSettings['auth']) > 1 ) { $clientOptions[RequestOptions::AUTH] = $optionsSettings['auth']; } return $clientOptions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHttpClientOptions();", "public function testConfigureGuzzleOptions()\n {\n \n $options = array(\n 'curl' => array(\n CURLOPT_SSL_VERIFYHOST => false,\n CURLOPT_SSL_VERIFYPEER => false,\n ),\n 'timeout' => 30,\n 'connect_timeout' => 30,\n );\n \n $crawler = new Crawler('http://github.com', 2);\n $crawler->setCrawlerOptions($options);\n \n /*@var $guzzleClient \\GuzzleHttp\\Client */\n $guzzleClient = $crawler->getScrapClient()->getClient();\n \n $this->assertEquals(30, $guzzleClient->getConfig('timeout'));\n $this->assertEquals(30, $guzzleClient->getConfig('connect_timeout'));\n $this->assertEquals(false, $guzzleClient->getConfig('curl')[CURLOPT_SSL_VERIFYHOST]);\n \n $crawler2 = new Crawler('http://github.com', 2, array(\n 'auth' => array('username', 'password'),\n ));\n /*@var $guzzleClient \\GuzzleHttp\\Client */\n $guzzleClient2 = $crawler2->getScrapClient()->getClient();\n \n $actualConfigs = $guzzleClient2->getConfig();\n $this->assertArrayHasKey('auth', $actualConfigs);\n }", "public function getOptions(): ClientOptions\n {\n return $this->options;\n }", "private function get_soap_client_options() {\n\t\treturn array(\n\t\t\t'classmap' => $this->get_class_map(),\n\t\t\t'connection_timeout' => 30,\n\t\t\t'trace' => true,\n\t\t\t'compression' => \\SOAP_COMPRESSION_ACCEPT | \\SOAP_COMPRESSION_GZIP,\n\t\t\t// https://github.com/php-twinfield/twinfield/issues/50.\n\t\t\t'cache_wsdl' => \\WSDL_CACHE_MEMORY,\n\t\t\t// Disable HTTP Keep Alive to prevent 'error fetching HTTP headers'.\n\t\t\t'keep_alive' => false,\n\t\t);\n\t}", "public function getGuzzleOptions() {\n\t\treturn $this->guzzleOptions;\n\t}", "protected function httpClientConfiguration(): array {\n return [\n 'connect_timeout' => $this->configFactory->get('apigee_edge.client')->get('http_client_connect_timeout') ?? 30,\n 'timeout' => $this->configFactory->get('apigee_edge.client')->get('http_client_timeout') ?? 30,\n 'proxy' => $this->configFactory->get('apigee_edge.client')->get('http_client_proxy') ?? '',\n ];\n }", "protected static function setRequestOptions(): void\n {\n $auth = Abokifx::getApiToken();\n\n static::$client = new Client(\n [\n 'base_uri' => Abokifx::$apiBaseUrl,\n 'headers' => [\n 'Authorization' => \"Bearer \" . $auth,\n 'Content-Type' => 'application/json',\n 'Accept' => 'application/json',\n ],\n ]\n );\n }", "public function getClient($options = array());", "public static function get_php_client_options() {\n $config = laterpay_get_plugin_config();\n if ( empty( self::$options ) ) {\n if ( get_option( 'laterpay_plugin_is_in_live_mode' ) ) {\n self::$options['cp_key'] = get_option( 'laterpay_live_merchant_id' );\n self::$options['api_key'] = get_option( 'laterpay_live_api_key' );\n self::$options['api_root'] = $config->get( 'api.live_backend_api_url' );\n self::$options['web_root'] = $config->get( 'api.live_dialog_api_url' );\n } else {\n self::$options['cp_key'] = get_option( 'laterpay_sandbox_merchant_id' );\n self::$options['api_key'] = get_option( 'laterpay_sandbox_api_key' );\n self::$options['api_root'] = $config->get( 'api.sandbox_backend_api_url' );\n self::$options['web_root'] = $config->get( 'api.sandbox_dialog_api_url' );\n }\n\n self::$options['token_name'] = $config->get( 'api.token_name' );\n }\n\n return self::$options;\n }", "private function prepareHttpClient()\n {\n $guzzleOption = array(\n 'request.options' => array(\n 'verify' => !$this->options['turn_off_ssl_verification'],\n 'exceptions' => (isset($this->options['enable_guzzle_exceptions']) && $this->options['enable_guzzle_exceptions'] == true)\n )\n );\n\n // Using api key\n if ($this->apiUser === null) {\n $guzzleOption['request.options']['headers'] = array('Authorization' => 'Bearer ' . $this->apiKey);\n }\n\n // Using http proxy\n if (isset($this->options['proxy'])) {\n $guzzleOption['request.options']['proxy'] = $this->options['proxy'];\n }\n\n $client = new \\Guzzle\\Http\\Client($this->url, $guzzleOption);\n $client->setUserAgent('sendgrid/' . $this->version . ';php');\n\n return $client;\n }", "private function setRequestOptions()\n {\n $this->client = new Client([\n 'base_uri' => $this->baseUrl,\n 'headers' => [\n 'Content-Type' => 'application/json',\n 'Accept' => 'application/json',\n 'CLIENTID' => $this->clientId,\n 'Signature' => $this->signature,\n ],\n ]);\n }", "private function getHttpClientConfig()\n {\n $config = [\n 'base_uri' => 'http://ip-api.com/',\n 'headers' => [\n 'User-Agent' => 'Laravel-GeoIP',\n ],\n 'query' => [\n 'fields' => 16895,\n ],\n ];\n\n // Using the Pro service\n if ($this->getOption('key')) {\n $config['base_uri'] = $this->isSecure() ? 'https://pro.ip-api.com/' : 'http://pro.ip-api.com/';\n $config['query']['key'] = $this->getOption('key');\n }\n\n return $config;\n }", "public function setHttpClientOptions(array $options);", "protected function defaultCurlOptions()\n {\n return [\n CURLOPT_USERAGENT => Yii::app()->name . ' OAuth ' . $this->version . ' Client',\n CURLOPT_CONNECTTIMEOUT => 30,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_SSL_VERIFYPEER => false,\n ];\n }", "private function configureHttpClient()\n {\n if (null !== $this->client) {\n return;\n }\n\n $this->client = new Client($this->config->get('transport.config'));\n }", "protected function getRequiredOptions()\n {\n return [\n 'authSite',\n 'clientId',\n 'clientSecret',\n 'redirectUri'\n ];\n }", "protected function getClient() {\n\t\tif(!$this->client) {\n\t\t\t$this->client = new Client([\n\t\t\t\tRequestOptions::VERIFY => self::$VERIFY_SSL,\n\t\t\t\tRequestOptions::TIMEOUT => $this->timeout,\n\t\t\t]);\n\t\t}\n\t\treturn $this->client;\n\t}", "function __construct(){\r\n\t\t$this->default_options['headers'] = array(\r\n\t\t\t'Accept' => '*/*',\r\n\t\t\t'Accept-Encoding' => 'gzip, deflate',\r\n\t\t\t'Connection' => 'Keep-Alive'\r\n\t\t);\r\n\t\t\r\n\t\t// let's put some timeouts in case of slow proxies\r\n\t\t$this->default_options['curl'] = array(\r\n\t\t\tCURLOPT_CONNECTTIMEOUT => 10,\r\n\t\t\tCURLOPT_TIMEOUT => 15,\r\n\t\t\t// sometimes google routes the connection through IPv6 which just makes this more difficult to deal with - force it to always use IPv4\r\n\t\t\tCURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4\r\n\t\t);\r\n\t\t\r\n\t\t// where should we store the cookies for this search client instance? get_current_user()\r\n\t\t$this->setCookieDir(sys_get_temp_dir());\r\n\t\t\r\n\t\t// this will create an empty cookie profile\r\n\t\t$this->setProfileID('default');\r\n\t\t\r\n\t\t// init guzzle client!\r\n\t\t$this->reloadClient();\r\n\t}", "private function getClientFromConfig(array $config)\n {\n // If a client was provided, return it.\n if (isset($config['client'])) {\n return $config['client'];\n }\n\n // Ensure, that a baseUrl was provided.\n if (empty($config['baseUrl'])) {\n throw new \\InvalidArgumentException('A baseUrl must be provided.');\n }\n\n // Ensure, that a access_token_url was provided.\n if (empty($config['access_token_url'])) {\n throw new \\InvalidArgumentException('An access_token_url for retrieving the access token must be provided.');\n }\n\n // Ensure, that a access_token_url was provided.\n if (empty($config['client_id'])) {\n throw new \\InvalidArgumentException('An client_id for retrieving the access token must be provided.');\n }\n\n // Ensure, that a client_secret was provided.\n if (empty($config['client_secret'])) {\n throw new \\InvalidArgumentException('An client_secret for retrieving the access token must be provided.');\n }\n\n // Initialize the client handler stack.\n $stack = $this->initializeClientHandlerStack($config);\n\n // Initialize client config.\n $client_config = [\n 'base_uri' => $config['baseUrl'],\n 'auth' => 'oauth',\n 'handler' => $stack,\n ];\n\n // Apply provided client configuration, if available.\n if (isset($config['client_config'])) {\n // Ensure, the client_config is an array.\n if (!is_array($config['client_config'])) {\n throw new \\InvalidArgumentException('A client_config must be an array.');\n }\n $client_config += $config['client_config'];\n }\n\n // Create a Guzzle client.\n $client = new Client($client_config);\n\n return $client;\n }", "protected function getOptions()\n {\n if (!in_array(Environment::getSslTest(), ['yes', 'client'], true)) {\n $this->markTestSkipped('Skipped because env var SSL_TEST not set to \"yes\" or \"client\"');\n }\n\n // checking CA-file\n $caFile = Environment::getSslCa();\n\n $testsDir = dirname(__DIR__);\n $caFile = $testsDir . '/' . $caFile;\n if (!file_exists($caFile) || !is_file($caFile)) {\n $this->fail('Missing CA file: \"' . $caFile . '\"');\n }\n\n $peerName = Environment::getSslPeerName();\n\n // minimal SSL-options\n $options = [\n 'port' => 5673,\n 'ssl' => [\n // for tests we are using self-signed certificates\n 'allow_self_signed' => true,\n 'cafile' => $caFile,\n 'peer_name' => $peerName,\n ],\n ];\n\n\n $certFile = Environment::getSslClientCert();\n $keyFile = Environment::getSslClientKey();\n\n if (!empty($certFile) && !empty($keyFile)) {\n $certFile = $testsDir . '/' . $certFile;\n $keyFile = $testsDir . '/' . $keyFile;\n if (!file_exists($certFile) || !is_file($certFile)) {\n $this->fail('Missing certificate file: \"' . $certFile . '\"');\n }\n if (!file_exists($keyFile) || !is_file($keyFile)) {\n $this->fail('Missing key file: \"' . $keyFile . '\"');\n }\n $options['ssl']['local_cert'] = $certFile;\n $options['ssl']['local_pk'] = $keyFile;\n }\n\n return $options;\n }", "private function buildClient(): Client {\n $client = new DefaultClient;\n $client->setOption(Client::OP_DEFAULT_HEADERS, [\n 'user-agent' => 'kelunik/acme',\n ]);\n\n return $client;\n }", "protected function setCurlOpts()\n\t{\n\t\tcurl_setopt($this->curlHandle, CURLOPT_TIMEOUT, 10);\n\t\tcurl_setopt($this->curlHandle, CURLOPT_URL, $this->url);\n\t\tcurl_setopt($this->curlHandle, CURLOPT_SSL_VERIFYHOST, false);\n\t\tcurl_setopt($this->curlHandle, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($this->curlHandle, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($this->curlHandle, CURLOPT_RETURNTRANSFER, true);\n\n\t\t$credentials = ClientCred::getCred();\n\n\t\t$headers = [\n\t\t 'Authorization: ' . $credentials\n\t\t];\n\n\t\tcurl_setopt($this->curlHandle, CURLOPT_HTTPHEADER, $headers);\n\t}", "private function getGuzzleClient()\n {\n return new Client(\n self::$URL_BASE,\n array(\n 'request.options' => array(\n 'query' => array(\n 'key' => self::$API_KEY,\n 'format' => 'json'\n )\n )\n )\n );\n }", "private function getDefaultHttpClient($http_options) {\n // Process HTTP options.\n // Handle deprecated 'timeout' argument.\n if (is_int($http_options)) {\n $http_options = [\n 'timeout' => $http_options,\n ];\n }\n\n // Default timeout is 10 seconds.\n $http_options += [\n 'timeout' => 10,\n ];\n\n $client = new ThriveCartGuzzleHttpClient($http_options);\n\n return $client;\n }", "public static function options(array $options): array\n {\n $conf = [\n 'sandbox' => $options['sandbox'] ?? false,\n 'debug' => $options['debug'] ?? false\n ];\n\n if ($conf['debug']) {\n ini_set('display_errors', '1');\n ini_set('display_startup_errors', '1');\n error_reporting(E_ALL);\n }\n\n $conf['clientId'] = $options['client_id'] ?? null;\n $conf['clientSecret'] = $options['client_secret'] ?? null;\n $conf['timeout'] = $options['timeout'] ?? null;\n $conf['cache'] = $options['debug'] ?? false;\n $conf['headers'] = $options['headers'] ?? null;\n $conf['baseUri'] = $options['url'] ?? null;\n $conf['api'] = $options['api'];\n\n if ($conf['api'] !== 'CHARGES') {\n $conf['certificate'] = $options['certificate'] ?? $options['pix_cert'];\n }\n\n return $conf;\n }", "private function getHttpClientFromConfig(array $config)\n {\n if (isset($config['http_client'])) {\n return $config['http_client'];\n }\n\n // Create a Guzzle HttpClient.\n $clientOptions = isset($config['http_client_options'])\n ? $config['http_client_options']\n : [];\n $client = new HttpClient($clientOptions);\n\n // Attach request retry logic.\n $client->getEmitter()->attach(new RetrySubscriber([\n 'max' => $config['max_retries'],\n 'filter' => RetrySubscriber::createChainFilter([\n RetrySubscriber::createStatusFilter(),\n RetrySubscriber::createCurlFilter(),\n ]),\n ]));\n\n /*\n * If mock env, attach MockSubscriber\n */\n if($this->env === self::ENV_MOCK) {\n $client->getEmitter()->attach(new MockSubscriber());\n }\n\n return $client;\n }", "public function getClientSettings ()\n {\n if (!isset($this->clientSettings))\n {\n $clientSettingsService = new ClientSettingsService();\n $this->clientSettings = $clientSettingsService->getClientSettings($this->id, $this->dealerId);\n }\n\n return $this->clientSettings;\n }", "public function getClient() {\n if (!$this->_client instanceof Client) {\n $this->_client = new Client();\n $options = [\n 'maxredirects' => 0,\n 'timeout' => 30\n ];\n $this->_client->setOptions($options);\n $this->_client->setHeaders([\n 'Authorization' => 'Bearer ' . $this->token,\n 'Content-Type' => 'application/json'\n ]);\n }\n\n return $this->_client;\n }", "protected function getClient()\n {\n $this->authenticateClient();\n if (!isset($this->client)) {\n $config = [\n 'headers' => [\n 'Accept' => 'application/json',\n 'Authorization' => 'Bearer '.$this->authenticationToken,\n 'Content-Type' => 'application/json',\n ],\n ];\n\n switch ($this->guzzleVersion) {\n case 5:\n $config = [\n 'base_url' => $this->subscriptionUrl,\n 'defaults' => $config,\n ];\n break;\n case 6:\n $config['base_uri'] = $this->subscriptionUrl;\n break;\n }\n\n $this->client = new Client($config);\n }\n\n return $this->client;\n }", "public static function clientOptions(LoggerInterface $logger): array\n {\n return [\n 'cookies' => true,\n 'connect_timeout' => 10.0,\n 'timeout' => 10.0,\n 'http_errors' => false,\n 'on_stats' => static::statsHandler($logger),\n 'handler' => static::handlerStack($logger),\n ];\n }" ]
[ "0.69639784", "0.67316234", "0.6711718", "0.66995394", "0.65866184", "0.64623755", "0.61154354", "0.6071841", "0.60319227", "0.6011582", "0.60105324", "0.5995368", "0.5941364", "0.58729464", "0.5864701", "0.5857959", "0.5838163", "0.5831602", "0.5798203", "0.5776275", "0.57628596", "0.5759193", "0.5757914", "0.57521564", "0.57235134", "0.5702275", "0.5658896", "0.56380403", "0.5631283", "0.5627093" ]
0.6795612
1
Constructor Creates the wrapper object. Note that the contents of the wrapped i18n container is not copied, the object is just referenced.
public function __construct(sly_I18N_Base $i18nContainer, $prefix) { $this->container = $i18nContainer; $this->prefix = $prefix; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n parent::__construct();\n\n //T2008-02-22\n //lets try to differentiate cache keys for oxI18n and oxBase\n //in order not to load cached structure for the instances of oxbase classe called on same table\n if ($this->_sCacheKey) {\n $this->_sCacheKey .= \"_i18n\";\n }\n }", "public function __construct(TranslationInterface $string_translation) {\n $this->stringTranslation = $string_translation;\n }", "public function __construct(TranslationInterface $string_translation) {\n $this->stringTranslation = $string_translation;\n }", "function __construct() {\r\n\t\t$this->serviceSetting =& new TranslationServiceSetting();\r\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->lang->load('message_lang', 'indonesia');\n }", "public function __construct() {\n\t\t$this->l10n = new L10n ();\n\t}", "public static function getInstance()\n {\n if (self::$instance === null) {\n self::$instance = new Lari18n();\n }\n\n return self::$instance;\n }", "public function __construct(\n Container $container,\n TranslatorInterface $translator\n ) {\n $this->container = $container;\n $this->translator = $translator;\n }", "public function __construct() {\n parent::__construct(self::TRANSLATION_NAME, self::ICON);\n }", "public function __construct() {\n parent::__construct(self::TRANSLATION_NAME, self::ICON);\n }", "public function __construct(Translate $translator)\n {\n parent::__construct();\n $this->translator = $translator;\n }", "protected function initWrapper()\n {\n // override me\n }", "function __construct() {\n $this->EE =& get_instance(); \n $this->EE->lang->loadfile('content');\n $this->EE->lang->loadfile('shorteen');\n $this->EE->lang->loadfile('social_update');\n\t\t\n }", "public static function init($supportLanguages = ['en'], $defaultLang = null, $gct = null, $namespace = \"\")\n {\n self::$translator = new Translation($supportLanguages, $defaultLang, $gct, $namespace);\n return self::$translator;\n }", "public function initialize()\n {\n $this->trans = \\Lcd\\App\\Helpers\\LangHelper::getTranslation();\n }", "function initTranslate()\n {\n if (defined('AM_DEBUG_TRANSLATE') && AM_DEBUG_TRANSLATE)\n {\n require_once __DIR__ . '/../../utils/TranslateTest.php';\n Zend_Registry::set('Zend_Translate', new Am_Translate_Test(['disableNotices' => true,]));\n return;\n }\n\n Am_License::getInstance()->init($this);\n\n// if ($cache = $this->getResource('Cache'))\n// Zend_Translate::setCache($cache);\n\n $locale = Zend_Locale::getDefault();\n $locale = key($locale);\n\n $tr = new Zend_Translate([\n 'adapter' => 'Zend_Translate_Adapter_Array',\n 'locale' => $locale,\n 'content' => ['_'=>'_']\n ]);\n\n $this->loadTranslations($tr, $locale);\n Zend_Registry::set('Zend_Translate', $tr);\n }", "public function creer_entete_localizationManager_this() {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\t$soap_message = new stdClass ();\n\t\t$soap_message->_this = $this->getAuth ()->localizationManager;\n\t\treturn $soap_message;\n\t}", "public function initialize() {\n\t\t$this->addReader(new PhpReader())->addLocation([\n\t\t\tTITON_RESOURCES . 'locales/{bundle}/',\n\t\t\tAPP_RESOURCES . 'locales/{bundle}/'\n\t\t]);\n\n\t\t// Load locale file and load parent if one exists\n\t\t$locale = $this->getLocale();\n\t\t$locale = Locale::parseLocale($locale['id']) + $locale;\n\t\t$locale['key'] = Titon::g11n()->canonicalize($locale['id']);\n\n\t\t// Apply overrides, but do not allow id\n\t\tif ($this->_override) {\n\t\t\tunset($this->_override['id']);\n\n\t\t\t$locale = $this->_override + $locale;\n\t\t}\n\n\t\t// Cache the parent to ease overhead\n\t\tif (!empty($locale['parent'])) {\n\t\t\t$key = 'g11n.bundle.locale.' . $locale['parent'];\n\n\t\t\tif (Titon::registry()->has($key)) {\n\t\t\t\t$parent = Titon::registry()->get($key);\n\t\t\t} else {\n\t\t\t\t$parent = Titon::registry()->set(new LocaleBundle(['bundle' => $locale['parent']]), $key);\n\t\t\t}\n\n\t\t\tif ($parent instanceof LocaleBundle) {\n\t\t\t\t$locale = $locale + $parent->getLocale();\n\n\t\t\t\t$this->_parent = $parent;\n\t\t\t}\n\t\t}\n\n\t\t$this->setCache('titon\\libs\\bundles\\locales\\LocaleBundle::getLocale', $locale);\n\t}", "protected static function createInstance()\n {\n $lang = env('APP_LANG','en');\n if (!empty($user_lang = self::getUserLang()))\n {\n $lang = $user_lang;\n }\n return new Translation($lang);\n }", "public function __construct(TranslatorInterface $translator) {\n\t\t$this->translator = $translator;\n\t}", "public static function getInstance() {\n\t\tstatic $instance = array ();\n\t\tif (! $instance) {\n\t\t\t$instance [0] = new I18n ();\n\t\t}\n\t\treturn $instance [0];\n\t}", "protected function getMonolog_Logger_TranslationService()\n {\n $this->services['monolog.logger.translation'] = $instance = new \\Symfony\\Bridge\\Monolog\\Logger('translation');\n\n $instance->pushProcessor(${($_ = isset($this->services['debug.log_processor']) ? $this->services['debug.log_processor'] : $this->getDebug_LogProcessorService()) && false ?: '_'});\n $instance->pushHandler(${($_ = isset($this->services['monolog.handler.server_log']) ? $this->services['monolog.handler.server_log'] : $this->get('monolog.handler.server_log')) && false ?: '_'});\n $instance->pushHandler(${($_ = isset($this->services['monolog.handler.console']) ? $this->services['monolog.handler.console'] : $this->get('monolog.handler.console')) && false ?: '_'});\n $instance->pushHandler(${($_ = isset($this->services['monolog.handler.main']) ? $this->services['monolog.handler.main'] : $this->get('monolog.handler.main')) && false ?: '_'});\n\n return $instance;\n }", "public function __construct($locale = '')\n {\n $this->locale = empty($locale) ? get_locale() : $locale;\n $this->translator = new Translator($this->locale);\n $this->translator->addLoader('yaml', new YamlFileLoader());\n }", "protected function getTranslation_LoaderService()\n {\n $a = $this->get('translation.loader.xliff');\n\n $this->services['translation.loader'] = $instance = new \\Symfony\\Bundle\\FrameworkBundle\\Translation\\TranslationLoader();\n\n $instance->addLoader('php', $this->get('translation.loader.php'));\n $instance->addLoader('yml', $this->get('translation.loader.yml'));\n $instance->addLoader('xlf', $a);\n $instance->addLoader('xliff', $a);\n $instance->addLoader('po', $this->get('translation.loader.po'));\n $instance->addLoader('mo', $this->get('translation.loader.mo'));\n $instance->addLoader('ts', $this->get('translation.loader.qt'));\n $instance->addLoader('csv', $this->get('translation.loader.csv'));\n $instance->addLoader('res', $this->get('translation.loader.res'));\n $instance->addLoader('dat', $this->get('translation.loader.dat'));\n $instance->addLoader('ini', $this->get('translation.loader.ini'));\n\n return $instance;\n }", "function __construct($sLangCode, $sLabel) {\n $this->sLangCode = $sLangCode;\n $this->sLabel = $sLabel;\n $this->aLabels = new LabelItemsCollection();\n }", "function __construct(){ \t\r\n $this->mod_get_credentials();\r\n //load i18n messages\r\n $this->mod_project_name_msg=load_messege(\"mod_project_name_msg\",$this->mod_ui_language);\r\n $this->mod_ui_language_msg =load_messege(\"mod_ui_language_msg\" ,$this->mod_ui_language);\r\n \r\n }", "public function init()\n {\n $registry = Zend_Registry::getInstance();\n $zfc = Zend_Controller_Front::getInstance();\n\n $router = $zfc->getRouter();\n $router = $this->setRouterPath($router);\n $zfc->setRouter($router);\n\n $translate = new Zend_Translate('gettext', APPLICATION_PATH . '/../languages',null,\n array('scan' => Zend_Translate::LOCALE_FILENAME));\n\n\n $registry->set('Zend_Translate', $translate);\n\n return $translate;\n }", "public function __construct() {\n parent::__construct();\n $template = '<div class=\"'.self::class_prefix.'form-element-wrapper '.self::class_prefix.'form-element-input-wrapper %wrapper_classes%\"><div class=\"'.self::class_prefix.'label-wrapper\"><label for=\"%label_id%\">%label%</label>%required%</div><div class=\"'.self::class_prefix.'input-wrapper\"><input type=\"%type%\" %attr% %value% /></div></div>';\n $this->set_template($template);\n }", "public function __construct($i18n = false)\n\t{\n\t\t$this->title[] = Kohana::config('pages.title');\n\t\t$this->title_sep = Kohana::config('pages.title_seperator');\n\t\t$this->css_url = Kohana::config('pages.css_url');\n\t\t$this->js_url = Kohana::config('pages.js_url');\n\t\t$this->template = Kohana::config('pages.template');\n\t\t$this->cache_lifetime = Kohana::config('pages.cache_lifetime');\t\n\t\t$this->format_output = Kohana::config('pages.format_output');\n\n\n\t\t//echo $this->template; die();\n\t\n\t\t// Make sure that urls have a trailing slash\n\t\t$this->css_url = ((substr($this->css_url, -1) != '/') ? $this->css_url.'/' : $this->css_url);\n\t\t$this->js_url = ((substr($this->js_url, -1) != '/') ? $this->js_url.'/' : $this->js_url);\n\t\t\n\t\t$this->version = (Kohana::config('pages.version') ? '?'.Kohana::config('pages.version') : '');\n\t}", "protected static function translator()\n {\n if (static::$translator === null) {\n static::$translator = new Translator('en');\n static::$translator->addLoader('php', new PhpFileLoader());\n static::setLocale('en');\n }\n\n return static::$translator;\n }" ]
[ "0.5919505", "0.58678967", "0.58678967", "0.58380884", "0.58339214", "0.5763721", "0.56787014", "0.56530344", "0.56164443", "0.56164443", "0.5559618", "0.5558216", "0.55307806", "0.54805374", "0.54505503", "0.54381156", "0.5431358", "0.53995574", "0.53831893", "0.53593135", "0.53507435", "0.53214365", "0.5300306", "0.52976286", "0.52970755", "0.52911246", "0.5264779", "0.5256233", "0.5254176", "0.5240812" ]
0.60982037
0
this function to get pay trip
public function get_pay_trip(Request $request) { $data_json = $this->call_api_by_parameter("webGetPayTripViaID", ['ReasonID' => $request->reason_id, "DestinationID" => $request->destination_id]); if (($data_json == false)) { return response()->json([ 'error' => true, "msg" => "You are losing your connection." ]); } $decode = json_decode($data_json); if ($decode->id) { $id = $decode->data[0]->ID; $pay_trip = $decode->data[0]->PayTrip; return response()->json([ 'id' => $id, 'pay_trip' => $pay_trip, 'error' => false ]); } return response()->json([ 'error' => true, "msg" => "No pay trip" ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEstimatePay() {\n\t\t$pirepid = DB::escape($this->get->pirepid);\n\t\t$sql = 'SELECT * FROM `'.TABLE_PREFIX.'pireps` WHERE `pirepid` = '.$pirepid;\n\t\t$pirep = DB::get_row($sql);\n\t\t\n\t\t$pilot = PilotData::getPilotData($pirep->pilotid);\n\t\t\n\t\t// Explode the flighttimes\n\t\t$flighttime = explode('.', $pirep->flighttime);\n\t\t$flighttime_min = ($flighttime[0] * 60) + ($flighttime[1]);\n\t\t$totalpay = ($pilot->payrate / 60) * $flighttime_min;\n\t\t\n\t\treturn FinanceData::formatMoney($totalpay);\n\t}", "public function getWaypoints(){\n\n if (!is_object($this->_order)) {\n $this->_logger->err('Prompt API: Could not create waypoints, no order object given');\n return array();\n }\n\n $service = $this->_order->getService();\n $customer = $this->_order->getCustomer();\n $location = $this->_order->getLocation();\n\n if (!is_object($service) || !is_object($customer) || !is_object($location)) {\n $this->_logger->err(sprintf('Prompt API: Could not call \"rates\", not all informations are provided. Service:%d, Customer:%d, Location:%d',\n is_object($service),\n is_object($customer),\n is_object($location)\n ));\n return array();\n }\n\n $infos = array();\n if ($this->_order->getId()) {\n $infos[] = \"ID: \" . Yourdelivery_Model_DbTable_Prompt_Nr::getNr($this->_order);\n }\n $card = $this->_order->getCard();\n foreach ($card['bucket'] as $items) {\n foreach ($items as $item) {\n $infos[] = $item['count'] . \" x \" . $item['meal']->getName() . \" \" . $item['meal']->getCurrentSizeName();\n }\n }\n\n // get parent of the location city\n $locationCity = $location->getCity();\n if ($locationCity->getParentCityId()) {\n try {\n $locationCity = new Yourdelivery_Model_City($locationCity->getParentCityId());\n }\n catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n }\n }\n \n return array(\n array(\n \"name\" => $service->getName(),\n \"street\" => $service->getStreet(),\n \"nr\" => $service->getHausnr(),\n \"postcode\" => $service->getPlz(),\n \"city\" => $service->getCity()->getCity(),\n \"country\" => 'DE',\n \"phone\" => $service->getTel(),\n \"contact\" => $service->getName(),\n \"info\" => implode(\", \", $infos)\n ),\n array(\n \"name\" => $customer->getFullname() . ($location->getCompanyName() ? \", \" . $location->getCompanyName() : \"\"),\n \"street\" => $location->getStreet(),\n \"nr\" => $location->getHausnr(),\n \"postcode\" => $location->getPlz(),\n \"city\" => $locationCity->getCity(),\n \"country\" => 'DE',\n \"phone\" => $location->getTel(),\n \"contact\" => $customer->getFullname(),\n \"info\" => $location->getAddition()\n )\n );\n\n }", "public function getPayMethod();", "abstract protected function get_paid_plan_for_api();", "public function getShippingInvoiced();", "function getTripWaitingFee($iTripId) {\n global $generalobj, $obj, $ENABLE_WAITING_CHARGE_RENTAL, $ENABLE_WAITING_CHARGE_FLAT_TRIP, $SERVICE_PROVIDER_FLOW,$tripDetailsArr,$vehicleTypeDataArr;\n if(isset($tripDetailsArr['trips_'.$iTripId])){\n $tripdata= $tripDetailsArr['trips_'.$iTripId];\n }else{\n $tripdata = $obj->MySQLSelect(\"SELECT * FROM trips WHERE iTripId='\" . $iTripId . \"'\");\n $tripDetailsArr['trips_'.$iTripId] = $tripdata;\n }\n $startDate = $tripdata[0]['tStartDate'];\n if ($startDate == \"0000-00-00 00:00:00\") {\n $startDate = @date(\"Y-m-d H:i:s\");\n }\n $eFlatTrip = $tripdata[0]['eFlatTrip'];\n $tDriverArrivedDate = $tripdata[0]['tDriverArrivedDate'];\n $waiting_time_diff = strtotime($startDate) - strtotime($tDriverArrivedDate);\n $waitingTime = ceil($waiting_time_diff / 60);\n $vehicleTypeID = $tripdata[0]['iVehicleTypeId'];\n $eHailTrip = $tripdata[0]['eHailTrip'];\n $eType = $tripdata[0]['eType'];\n $iRentalPackageId = $tripdata[0]['iRentalPackageId'];\n $fWaitingFees = 0;\n if ($eHailTrip == \"Yes\" || ($iRentalPackageId > 0 && $ENABLE_WAITING_CHARGE_RENTAL != \"Yes\") || ($eFlatTrip == \"Yes\" && $ENABLE_WAITING_CHARGE_FLAT_TRIP != \"Yes\")) {\n return 0;\n } else {\n if ($SERVICE_PROVIDER_FLOW == \"Provider\" && $tripdata[0]['tVehicleTypeData'] != \"\") {\n // $tripdata[0]['eFareType'] == \"Fixed\"\n $tVehicleTypeFareData = (array) json_decode($tripdata[0]['tVehicleTypeFareData']);\n $fWaitingFeesCommission = 0;\n\n $fWaitingFees = $tVehicleTypeFareData['ParentWaitingFees'];\n $iWaitingFeeTimeLimit = $tVehicleTypeFareData['ParentWaitingTimeLimit'];\n $parentCommision = $tVehicleTypeFareData['ParentCommision'];\n if ($waitingTime > $iWaitingFeeTimeLimit) {\n $waitingTime = $waitingTime - $iWaitingFeeTimeLimit;\n $fWaitingFees = $fWaitingFees * $waitingTime;\n $fWaitingFees = round($fWaitingFees, 2);\n } else {\n $fWaitingFees = 0;\n }\n $fWaitingFeesCommission = round((($fWaitingFees * $parentCommision) / 100), 2);\n\n $returnWaitingFeeArr['WaitingFee'] = $fWaitingFees;\n $returnWaitingFeeArr['WaitingFeeCommission'] = $fWaitingFeesCommission;\n\n return $returnWaitingFeeArr;\n } else {\n //Added By HJ On 22-06-2020 For Optimize vehicle_type Table Query Start\n if(isset($vehicleTypeDataArr['vehicle_type'])){\n $vehicleTypeData = $vehicleTypeDataArr['vehicle_type'];\n $typeDataArr = array();\n for($h=0;$h<count($vehicleTypeData);$h++){\n $typeDataArr[$vehicleTypeData[$h]['iVehicleTypeId']] = $vehicleTypeData[$h]['fWaitingFees'];\n }\n if(isset($typeDataArr[$vehicleTypeID])){\n $fWaitingFees =$typeDataArr[$vehicleTypeID];\n }else{\n $tripvehicledata = $obj->MySQLSelect(\"SELECT fWaitingFees FROM vehicle_type WHERE iVehicleTypeId='\" . $vehicleTypeID . \"'\");\n $fWaitingFees = $tripvehicledata[0]['fWaitingFees'];\n }\n }else{\n $tripvehicledata = $obj->MySQLSelect(\"SELECT fWaitingFees FROM vehicle_type WHERE iVehicleTypeId='\" . $vehicleTypeID . \"'\");\n $fWaitingFees = $tripvehicledata[0]['fWaitingFees'];\n }\n //Added By HJ On 22-06-2020 For Optimize vehicle_type Table Query End \n $iWaitingFeeTimeLimit = $tripdata[0]['iWaitingFeeTimeLimit'];\n if ($waitingTime > $iWaitingFeeTimeLimit) {\n $waitingTime = $waitingTime - $iWaitingFeeTimeLimit;\n $fWaitingFees = $fWaitingFees * $waitingTime;\n $fWaitingFees = round($fWaitingFees, 2);\n } else {\n $fWaitingFees = 0;\n }\n }\n }\n return $fWaitingFees;\n}", "function buyAirtime($network, $phone, $amount, $transaction_id){\n $request = \"\";\n $param = [];\n $param[\"username\"] = $GLOBALS['username_mobileNig'];\n $param[\"api_key\"] = $GLOBALS['Mobile_api'];\n $param[\"network\"] = $network;\n $param[\"amount\"] = $amount;\n $param[\"phoneNumber\"] = $phone;\n $param[\"trans_id\"] = $transaction_id;\n\n\n\n //return $network.$phone.$amount.$transaction_id;\n //unique id, you can use time()\n foreach($param as $key=>$val) //traverse through each member of the param array\n {\n $request .= $key . \"=\" . urlencode($val); //we have to urlencode the values\n $request .= '&'; //append the ampersand (&) sign after each paramter/value pair\n }\n $len = strlen($request) - 1;\n $request = substr($request, 0, $len); //remove the final ampersand sign from the request\n\n $url = \"https://mobilenig.com/API/airtime?\". $request . \"&return_url=https://mywebsite.com/order_status.asp\"; //The URL given in the documentation without parameters\n //return $url;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"$url$request\");\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); //return as a variable\n $response = json_decode(curl_exec($ch));\n curl_close($ch);\n return $response;\n}", "function AirfarePrice($request) {\n $start = microtime(true);\n try {\n $this->client->uri = 'http://www.sita.aero/PTS/fare/2005/11/PriceRQ';\n $Segments = $FareCurrencySelection = $PriceRequestInformation = '';\n $RPH = 0;\n foreach ($request['segments'] as $leg) {\n $airports = WtDB::Ref()->AirportsRows(new WtFuncArgs(array(\n 'codes' => WtFunc::removeEmptyValues(array($leg['first_departure_airport'], $leg['first_arrival_airport'], $leg['second_arrival_airport'], $leg['third_arrival_airport'])),\n 'fields' => \"a.code, a.country\",\n 'map' => 'code')));\n\n for ($i = 0; $i < $leg['segments']; $i++) {\n switch ($i) {\n case 0:\n $pref = 'first';\n break;\n case 1:\n $pref = 'second';\n break;\n case 2:\n $pref = 'third';\n break;\n }\n $RPH++;\n $Segments .= '<OriginDestinationOption><FlightSegment ArrivalDateTime=\"' . $leg[$pref . '_arrival_date'] . 'T' . $leg[$pref . '_arrival_time']\n . '\" DepartureDateTime=\"' . $leg[$pref . '_departure_date'] . 'T' . $leg[$pref . '_departure_time'] . '\" StopQuantity=\"' . 0\n . '\" FlightNumber=\"' . $leg[$pref . '_flight_number'] . '\" ResBookDesigCode=\"' . $leg[$pref . '_booking_class'] . '\" RPH=\"' . $RPH . '\">'\n . '<DepartureAirport LocationCode=\"' . $leg[$pref . '_departure_airport'] . '\"/>'\n . '<ArrivalAirport LocationCode=\"' . $leg[$pref . '_arrival_airport'] . '\"/>'\n . '<MarketingAirline Code=\"' . $leg[$pref . '_marketing_airline'] . '\"/>'\n . '</FlightSegment></OriginDestinationOption>';\n }\n\n $pref = $leg['stops'] == 2 ? 'third' : ($leg['stops'] == 1 ? 'second' : 'first');\n if (($leg['first_departure_airport'] == 'SIP' && $airports[$leg[$pref . '_arrival_airport']]['country'] == 'RU') ||\n ($leg[$pref . '_arrival_airport'] == 'SIP' && $airports[$leg['first_departure_airport']]['country'] == 'RU') ||\n ($this->CityCode == 'SIP')\n ) {\n $FareCurrencySelection = 'FareCurrencySelection=\"RUB\"';\n// $FareCurrencySelection = 'CurrencyConversionCode=\"RUB\"';\n// if ($this->CityCode == 'SIP') {\n// $PriceRequestInformation = '<PriceRequestInformation CurrencyCode=\"RUB\"/>';\n// }\n }\n }\n\n $AirTravelerAvail = '<PassengerTypeQuantity Code=\"ADT\" Quantity=\"1\" RPH=\"1\"/>';\n $AirTravelerAvail .= $request['child_qty'] > 0 ? '<PassengerTypeQuantity Code=\"CNN\" Quantity=\"1\" RPH=\"1\"/>' : '';\n $AirTravelerAvail .= $request['infant_qty'] > 0 ? '<PassengerTypeQuantity Code=\"INF\" Quantity=\"1\" RPH=\"1\"/>' : '';\n $priceRequestInformation = '';\n $additionalPriceRQData = '<AdditionalPriceRQData ' . $FareCurrencySelection . ' MaxResponses=\"10\" DoNotIncludeFBCInHFC=\"true\" PointOfTicketing=\"' . $this->CityCode . '\"/>';\n\n $faresBasis = array();\n foreach ($request['segments'] as $segment) { // Проверяем есть ли код тарифа за одно отдаем его в ФФ\n if ($segment['first_fare_basis'] != null) {\n $faresBasis[] = $segment['first_fare_basis'];\n }\n if ($segment['second_fare_basis'] != null) {\n $faresBasis[] = $segment['second_fare_basis'];\n }\n if ($segment['third_fare_basis'] != null) {\n $faresBasis[] = $segment['third_fare_basis'];\n }\n }\n\n if (empty($faresBasis)) { // Если нет тарифа, то что-то не так с поиском было.\n $this->longQueryLog($start, 'AirfarePrice no fare');\n return array('status' => 'error', 'message' => FuncLang::value('lbl_gabriel_error_fasebase'));\n }\n\n $faresFF = array('BS', 'FL');\n if (in_array($request['segments']['0']['fare_family'], $faresFF)) { // Если тариф ФФ, то делаем преоценку для ФФ\n $priceRequestInformation = '<PriceRequestInformation PricingSource=\"Both\"/>';\n $additionalSegmentInfo = '';\n $i = 1;\n foreach ($faresBasis as $one) {\n $additionalSegmentInfo = $additionalSegmentInfo .\n '<AdditionalSegmentInfo SegmentRPH=\"'.$i.'\" FareReference=\"'. $one .'\" />';\n $i++;\n }\n\n $additionalPriceRQData = '\n <AdditionalPriceRQData ' . $FareCurrencySelection . ' MaxResponses=\"10\" DoNotIncludeFBCInHFC=\"true\" PointOfTicketing=\"' . $this->CityCode . '\">\n <AdditionalSegmentInfos>'\n . $additionalSegmentInfo .\n '</AdditionalSegmentInfos>\n </AdditionalPriceRQData>';\n }\n\n $reqPayloadString = '<OTA_AirPriceRQ xmlns=\"http://sita.aero/SITA_AirDemandTicketRQ/3/0\">'\n . $this->AirfarePOS .\n '<AirItinerary><OriginDestinationOptions>' . $Segments . '</OriginDestinationOptions></AirItinerary>\n <TravelerInfoSummary>\n '. $priceRequestInformation .'\n <AirTravelerAvail>' . $AirTravelerAvail . '</AirTravelerAvail>'\n . $PriceRequestInformation .\n '</TravelerInfoSummary>\n </OTA_AirPriceRQ>'.\n $additionalPriceRQData;\n\n $this->client->SITA_AirfarePriceRQ(new SoapVar($reqPayloadString, XSD_ANYXML));\n $result = $this->client->__getLastResponse();\n\n $result = str_replace('common:', '', $result);\n\n $result = XML2Array::createArray($result);\n $result = isset($result['SOAP-ENV:Envelope']['SOAP-ENV:Body']) ? $result['SOAP-ENV:Envelope']['SOAP-ENV:Body'] : $result['Envelope']['Body'];\n $this->writeLog('SITA_AirfarePriceRQ', 'AirfarePrice', $result);\n\n $warnings = @$result['sita:SITA_AirfarePriceRS']['ota:OTA_AirPriceRS']['ota:Warnings']['ota:Warning'];\n if (empty($result['sita:SITA_AirfarePriceRS']['ota:OTA_AirPriceRS']['ota:PricedItineraries']) && !empty($warnings)) {\n $message = '';\n $warnings = isset($warnings['@value']) ? array($warnings) : $warnings;\n foreach ($warnings as $warning) {\n $message .= $warning['@value'] . \"<br/>\";\n }\n $this->longQueryLog($start, 'AirfarePrice Warning');\n return array('status' => 'error', 'message' => $message);\n }\n\n $errors = @$result['sita:SITA_AirfarePriceRS']['ota:OTA_AirPriceRS']['ota:Errors']['ota:Error'];\n if (empty($result['sita:SITA_AirfarePriceRS']['ota:OTA_AirPriceRS']['ota:PricedItineraries']) && !empty($errors)) {\n $message = '';\n $errors = isset($errors['@value']) ? array($errors) : $errors;\n foreach ($errors as $error) {\n $message .= $error['@value'] . \"<br/>\";\n }\n $this->longQueryLog($start, 'AirfarePrice error');\n return array('status' => 'error', 'message' => $message);\n }\n\n $PricedItinerary = array();\n $AirfarePrices = array(\n 'AdultBaseFare' => 0,\n 'ChildBaseFare' => 0,\n );\n\n $PricedItineraries = isset($result['sita:SITA_AirfarePriceRS']['ota:OTA_AirPriceRS']['ota:PricedItineraries']['ota:PricedItinerary']['ota:AirItinerary']) ? array($result['sita:SITA_AirfarePriceRS']['ota:OTA_AirPriceRS']['ota:PricedItineraries']['ota:PricedItinerary']) : $result['sita:SITA_AirfarePriceRS']['ota:OTA_AirPriceRS']['ota:PricedItineraries']['ota:PricedItinerary'];\n foreach ($PricedItineraries as $price) {\n $FareBreakdown = $price['ota:AirItineraryPricingInfo']['ota:PTC_FareBreakdowns']['ota:PTC_FareBreakdown'];\n $FareInfo = $price['ota:AirItineraryPricingInfo']['ota:FareInfos']['ota:FareInfo'];\n $References = isset($FareInfo['ota:TPA_Extensions']) ? $FareInfo['ota:TPA_Extensions']['sita:SITA_FareInfoExtension']['sita:References'] : $FareInfo[0]['ota:TPA_Extensions']['sita:SITA_FareInfoExtension']['sita:References'];\n switch ($FareBreakdown['ota:PassengerTypeQuantity']['@attributes']['Code']) {\n case 'ADT':\n $prefix = 'Adult';\n break;\n case 'CNN':\n $prefix = 'Child';\n break;\n case 'INF':\n $prefix = 'Infant';\n break;\n }\n\n if (isset($AirfarePrices[$prefix . 'TotalFare']) && $AirfarePrices[$prefix . 'TotalFare'] < $FareBreakdown['ota:PassengerFare']['ota:TotalFare']['@attributes']['Amount']) {\n continue;\n }\n\n $AirfarePrices['PTC'][$price['@attributes']['SequenceNumber']] = $FareBreakdown['ota:PassengerTypeQuantity']['@attributes']['Code'] == 'CNN' ? 'CHD' : $FareBreakdown['ota:PassengerTypeQuantity']['@attributes']['Code'];\n if ($prefix == 'Adult') {\n $AirfarePrices['Ref1'] = $References['sita:Ref1'];\n $AirfarePrices['FareBasisCode'] = $FareBreakdown['ota:FareBasisCodes']['ota:FareBasisCode'];\n $AirfarePrices['TicketTimeLimit'] = $price['ota:TicketingInfo']['@attributes']['TicketTimeLimit'];\n $AirfarePrices['Currency'] = $FareBreakdown['ota:PassengerFare']['ota:TotalFare']['@attributes']['CurrencyCode'];\n }\n\n $AirfarePrices[$prefix . 'TotalFare'] = $FareBreakdown['ota:PassengerFare']['ota:TotalFare']['@attributes']['Amount'];\n if ($FareBreakdown['ota:PassengerFare']['ota:BaseFare']['@attributes']['CurrencyCode'] == $this->provider['currency']) {\n $AirfarePrices[$prefix . 'BaseFare'] = $FareBreakdown['ota:PassengerFare']['ota:BaseFare']['@attributes']['Amount'];\n } elseif (isset($FareBreakdown['ota:PassengerFare']['ota:EquivFare']) &&\n $FareBreakdown['ota:PassengerFare']['ota:EquivFare']['@attributes']['CurrencyCode'] == $this->provider['currency']\n ) {\n $AirfarePrices[$prefix . 'BaseFare'] = $FareBreakdown['ota:PassengerFare']['ota:EquivFare']['@attributes']['Amount'];\n } else {\n $AirfarePrices[$prefix . 'BaseFare'] = $FareBreakdown['ota:PassengerFare']['ota:BaseFare']['@attributes']['Amount'];\n if (isset($FareBreakdown['ota:PassengerFare']['ota:BaseFare']['@attributes']['Rate'])) {\n $AirfarePrices[$prefix . 'BaseFare'] *= $FareBreakdown['ota:PassengerFare']['ota:BaseFare']['@attributes']['Rate'];\n }\n }\n\n $priceInfo = array();\n $Taxes = array();\n if (isset($FareBreakdown['ota:PassengerFare']['ota:Taxes'])) {\n $AirfarePrices[$prefix . 'TaxAmount'] = 0;\n $PassengerTax = isset($FareBreakdown['ota:PassengerFare']['ota:Taxes']['ota:Tax']['@attributes']) ? array($FareBreakdown['ota:PassengerFare']['ota:Taxes']['ota:Tax']) : $FareBreakdown['ota:PassengerFare']['ota:Taxes']['ota:Tax'];\n foreach ($PassengerTax as $tax) {\n if (!is_array($tax) || isset($Taxes[$tax['@attributes']['TaxCode']])) {\n// continue;\n }\n $Taxes[$tax['@attributes']['TaxCode']] = array(\n 'TaxCode' => $tax['@attributes']['TaxCode'],\n// 'Amount' => $tax['@attributes']['Amount'],\n 'Currency' => $tax['@attributes']['CurrencyCode']\n );\n $Taxes[$tax['@attributes']['TaxCode']]['Amount'] += $tax['@attributes']['Amount'];\n $AirfarePrices[$prefix . 'TaxAmount'] += $tax['@attributes']['Amount'];\n }\n }\n if ($prefix == 'Adult') {\n $AirfarePrices['Taxes'] = $Taxes;\n }\n// $priceInfo['Notes'] = $price['ota:Notes'];\n $priceInfo['Ref2'] = $References['sita:Ref2'];\n\n $AirfarePrices['PassengersRef'][$prefix] = $priceInfo;\n\n $PricedItinerary[$prefix] = $price;\n }\n $AirfarePrices['TotalFare'] = ($AirfarePrices['AdultBaseFare'] * $request['adult_qty']) + ($AirfarePrices['ChildBaseFare'] * $request['child_qty']) + ($AirfarePrices['InfantBaseFare'] * $request['infant_qty']);\n $AirfarePrices['TotalTax'] = ($AirfarePrices['AdultTaxAmount'] * $request['adult_qty']) + ($AirfarePrices['ChildTaxAmount'] * $request['child_qty']) + ($AirfarePrices['InfantTaxAmount'] * $request['infant_qty']);\n\n if (isset($result['sita:SITA_AirfarePriceRS']['sita:AdditionalPriceRSData'])) {\n $Itineraries = isset($result['sita:SITA_AirfarePriceRS']['sita:AdditionalPriceRSData']['sita:AdditionalItinerariesData']['sita:AdditionalItineraryData']['sita:AdditionalSegmentInfos']) ? array($result['sita:SITA_AirfarePriceRS']['sita:AdditionalPriceRSData']['sita:AdditionalItinerariesData']['sita:AdditionalItineraryData']) : $result['sita:SITA_AirfarePriceRS']['sita:AdditionalPriceRSData']['sita:AdditionalItinerariesData']['sita:AdditionalItineraryData'];\n foreach ($Itineraries as $itinerary) {\n $PTC = $AirfarePrices['PTC'][$itinerary['@attributes']['SequenceNumber']];\n $SegmentInfos = isset($itinerary['sita:AdditionalSegmentInfos']['sita:AdditionalSegmentInfo']['sita:RebookResBookDesigCodes']) ? array($itinerary['sita:AdditionalSegmentInfos']['sita:AdditionalSegmentInfo']) : $itinerary['sita:AdditionalSegmentInfos']['sita:AdditionalSegmentInfo'];\n foreach ($SegmentInfos as $segment) {\n $segNum = $segment['@attributes']['SegmentRPH'];\n $AirfarePrices['Baggage'][$PTC][$segNum] = $segment['@attributes']['FreeBaggageAllowance'];\n $AirfarePrices['AdditionalSegmentInfos'][$PTC][$segNum] = $segment['@attributes'];\n }\n }\n }\n\n $AirfarePrices['PricedItinerary'] = serialize(array_merge($PricedItinerary, $AirfarePrices));\n\n//dump_die($AirfarePrices);\n $this->longQueryLog($start, 'AirfarePrice');\n return isset($result['sita:SITA_AirfarePriceRS']['ota:OTA_AirPriceRS']['ota:Success']) ? $AirfarePrices : false;\n } catch (SoapFault $exception) {\n $this->writeException('AirfarePrice', $exception);\n $this->longQueryLog($start, 'AirfarePrice exception');\n return false;\n }\n }", "public function estimatePay() {\n\t\t$pirepid = DB::escape($this->get->pirepid);\n\t\t$sql = 'SELECT * FROM `'.TABLE_PREFIX.'pireps` WHERE `pirepid` = '.$pirepid;\n\t\t$pirep = DB::get_row($sql);\n\t\t\n\t\t$pilot = PilotData::getPilotData($pirep->pilotid);\n\t\t\n\t\t// Explode the flighttimes\n\t\t$flighttime = explode('.', $pirep->flighttime);\n\t\t$flighttime_min = ($flighttime[0] * 60) + ($flighttime[1]);\n\t\t$totalpay = ($pilot->payrate / 60) * $flighttime_min;\n\t\t\n\t\techo '<h3>PIREP - #'.$pirepid.' & Pilot - '.$pilot->firstname.' '.$pilot->lastname.' Estimated Pay</h3>';\n\t\techo $pirep->depicao.' => '.$pirep->arricao;\n\t\techo '<br />';\n\t\techo 'Payrate Per Hour: $'.$pilot->payrate;\n\t\techo '<br />';\n\t\techo '<strong>Estimated Pay for this flight - '.FinanceData::formatMoney($totalpay).'</strong>';\n\t}", "abstract public function getPayout(): int;", "public function get_round_trip(Request $request)\r\n {\r\n $user_id = session(\"ID\");\r\n\r\n $data_json = $this->call_api_by_parameter(\"webGetRoundTripByTicketNumber\", ['TicketID' => $request->id]);\r\n\r\n if (($data_json == false)) {\r\n return response()->json([\r\n 'result' => \"You are losing your connection.\"\r\n ]);\r\n }\r\n\r\n $decode = json_decode($data_json);\r\n\r\n if ($decode->id) {\r\n\r\n\r\n $data['ticket_id'] = $request->id;\r\n $data['ticket_number'] = $request->number;\r\n $data['id_data'] = $decode->id;\r\n $data['list_data'] = $decode->data;\r\n $data['user_id'] = $user_id;\r\n\r\n $result = view(\"pages.backend.ticket.round\", compact('data'))->render();\r\n\r\n return response()->json([\r\n 'result' => $result,\r\n ]);\r\n }\r\n\r\n return response()->json([\r\n 'result' => \"No data.\"\r\n ]);\r\n }", "public function getShippingPricing();", "public function get_account_infO($business_id,$trip_id=0,$date=0)\n {\n $where=\" a.trip_id=d.trip_id and a.business_id=$business_id\";\n if($trip_id)\n {\n $where.=\" and a.trip_id LIKE '%$trip_id%'\";\n }\n\n if($date)\n {\n $date=strtotime($date);\n $date_end=$date+84600;\n $where.=\" AND a.add_time >=$date AND a.add_time<$date_end\";\n\n }\n\n $sql=\"select a.trip_id,a.pay_id,a.user_id_sell,round(sum(a.order_amount),2) as sum_money from wx_order_info a,\n (select b.trip_id from\n (select trip_id,count(trip_id) as count from wx_order_info where order_status=3 and business_id=$business_id and is_show=1 group by trip_id) as b ,\n (select trip_id,count( trip_id) as count from wx_order_info where business_id=$business_id and is_show=1 and order_status in (1,2,3) group by trip_id) as c\n where b.count=c.count and c.trip_id=b.trip_id) as d\n where {$where}\n group by a.trip_id,a.pay_id,a.user_id_sell\";\n\n\n $query = $this->db->query($sql);\n $rs=$query->result_array();\n\n return $rs;\n }", "public function getDirections(Trip $trip)\n {\n }", "public function getnote_paytrip(Request $request)\r\n {\r\n $term = trim($request->value);\r\n $data_json = $this->call_api_by_parameter(\"webGetNotePayHistory\", ['Value' => $term]);\r\n\r\n if (($data_json == false)) {\r\n return response()->json([\r\n 'con' => true\r\n ]);\r\n }\r\n\r\n $decode = json_decode($data_json);\r\n if ($decode->id) {\r\n $output = '<ul class=\"list_note\">';\r\n $text = '';\r\n foreach ($decode->data as $item) {\r\n if ($text != $item->PayTripNote) {\r\n $output .= '<li class=\"text_note_pay_trip\" data-number=\"' . $request->number . '\">' . $item->PayTripNote . '</li>';\r\n $text = $item->PayTripNote;\r\n }\r\n\r\n }\r\n $output .= '</ul>';\r\n\r\n return response()->json([\r\n 'result' => $output,\r\n \"error\" => false\r\n ]);\r\n }\r\n\r\n return response()->json([\r\n 'error' => \"No data.\"\r\n ]);\r\n }", "public function getAllTrips()\n {\n if (count($trips = Trip::getAllTrips()) > 0) {\n return ['error' => false, 'result' => $trips];\n } else {\n return ['error' => true, 'message' => 'No trip found'];\n }\n }", "public function getPayments();", "public function payout_daywise_details() {\n\n\t\t$week_data = request()->week;\n\n\t\t$start_end = explode(',', $week_data);\n\n\t\t$this->view_data['user_id'] = auth()->guard('store')->user()->id;\n\t\t$this->view_data['country'] = Country::all()->pluck('name', 'code');\n\t\t$this->view_data['country_list'] = Country::getPayoutCoutries();\n\t\t$this->view_data['stripe_data'] = site_setting('stripe_publish_key');\n\t\t$this->view_data['currency1'] = Currency::where('status', '1')->pluck('code', 'code');\n\n\t\t$this->view_data['iban_supported_countries'] = Country::getIbanRequiredCountries();\n\t\t$this->view_data['country_currency'] = Country::getCurrency();\n\t\t$this->view_data['mandatory'] = PayoutPreference::getAllMandatory();\n\t\t$this->view_data['branch_code_required'] = Country::getBranchCodeRequiredCountries();\n\n\t\t$daily_payout = Payout::userId([$this->view_data['user_id']])\n\t\t\t->whereBetween('created_at', [$start_end[0], $start_end[1]])\n\t\t\t->get()\n\t\t\t->groupBy(function ($date) {\n\t\t\t\treturn Carbon::parse($date->created_at)->format('D');\n\t\t\t});\n\n\t\t$count = 0;\n\t\t$week = [];\n\t\t//dd($weekly_payout);\n\t\tforeach ($daily_payout as $key => $value) {\n\n\t\t\t$total = 0;\n\t\t\t$tax = 0;\n\t\t\t$subtotal = 0;\n\t\t\t$order_total = 0;\n\t\t\t$gofer_fee = 0;\n\t\t\t$count = count($value);\n\t\t\t$status_text = 'Pending';\n\t\t\t$i = 0;\n\t\t\t$paid_penalty = 0;\n\t\t\t$penalty = 0;\n\t\t\t$order_data = [];\n\t\t\tforeach ($value as $payout) {\n\t\t\t\t$total += (float) $payout->amount;\n\t\t\t\t$amount[$i] = $payout->amount;\n\t\t\t\t$currency_code = $payout->order->currency->symbol;\n\t\t\t\tif ($payout->status == 0) {\n\t\t\t\t\t$status_text = $payout->status_text;\n\t\t\t\t}\n\n\t\t\t\t$tax += (float) $payout->order->tax;\n\t\t\t\t$subtotal += (float) $payout->order->subtotal;\n\t\t\t\t$order_total += (float) $payout->order->store_total;\n\t\t\t\t$gofer_fee += (float) $payout->order->store_commision_fee;\n\t\t\t\t$day_val = date('d M', strtotime($payout->created_at));\n\t\t\t\t$table_date = date('Y-m-d', strtotime($payout->created_at));\n\t\t\t\t$order_data[$i] = $payout;\n\t\t\t\t$paid_penalty += @$payout->order->res_applied_penality;\n\t\t\t\t$penalty += ($payout->order->penality_details) ? ($payout->order->penality_details->store_penality) : 0;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$total_penalty = $penalty - $paid_penalty > 0 ? ($penalty - $paid_penalty) : 0;\n\t\t\t$format_date = $day_val;\n\t\t\n\t\t\t$week[] = ['week' =>\tdate('d', strtotime($format_date)).' '.trans('messages.driver.'.date('M', strtotime($format_date))),\n\t\t\t\t'table_date' => $table_date,\n\t\t\t\t'total_payout' => numberFormat($total),\n\t\t\t\t'day' => $day_val,\n\t\t\t\t'tax' => numberFormat($tax),\n\t\t\t\t'currency_symbol' => $currency_code,\n\t\t\t\t'subtotal' => numberFormat($subtotal),\n\t\t\t\t'status' => trans('messages.store.'.$status_text),\n\t\t\t\t'total_amount' => numberFormat($order_total),\n\t\t\t\t'payout_status' => trans('messages.store.'.$status_text),\n\t\t\t\t'gofer_fee' => numberFormat($gofer_fee),\n\t\t\t\t'paid_penalty' => numberFormat($paid_penalty),\n\t\t\t\t'penalty' => numberFormat($total_penalty),\n\t\t\t\t'count' => $count,\n\t\t\t\t'order_detail' => $order_data];\n\n\t\t}\n\n\t\t$current_week = date('d M', strtotime('last monday')) . ' - ' . date('d M', strtotime('next sunday'));\n\n\t\t$this->view_data['current_week_orders'] = array_sum(array_column($week, 'count'));\n\t\t$this->view_data['current_week_symbol'] = @$currency_code;\n\t\t$this->view_data['current_week_profit'] = numberFormat(array_sum(array_column($week, 'total_payout')));\n\t\t$this->view_data['current_week'] = $current_week;\n\t\t$this->view_data['paginate'] = $daily_payout;\n\t\t$this->view_data['weekly_payouts'] = $week;\n\n\t\t$this->view_data['payout_preference'] = PayoutPreference::where('user_id', $this->view_data['user_id'])->first();\n\n\t\treturn view('store/payout_preference1', $this->view_data);\n\t}", "public function calculatePay()\r\n {\r\n return;\r\n }", "public function getPendingTrip()\n {\n return $this->respondWithSuccess(getUser()->getPendingTrip());\n }", "public function getinvoice(Request $request)\n\t{\n\t\t$user_details = JWTAuth::parseToken()->authenticate();\n\n\t\t$request->merge(['payment_mode' =>strtolower($request->payment_mode)]);\n\t\t$rules = array(\n\t\t\t'user_type' => 'required|in:Rider,rider,Driver,driver',\n\t\t\t'trip_id' => 'required',\n\t\t\t'payment_mode' => 'in:paypal,stripe,cash,braintree,onlinepayment',\n\t\t\t'is_wallet' => 'in:Yes,No',\n\t\t);\n\n\t\t$validator = Validator::make($request->all(), $rules);\n\n\t\tif ($validator->fails()) {\n\t\t\treturn response()->json([\n 'status_code' => '0',\n 'status_message' => $validator->messages()->first(),\n ]);\n\t\t}\n\t\t// set onlinepayment as paypal for temporary\n\t\t$request->payment_mode = ($request->payment_mode=='onlinepayment' || $request->payment_mode=='paypal')?'PayPal':ucfirst($request->payment_mode);\n\n\t\t\n\n\t\t$user = User::where('id', $user_details->id)->first();\n\n\t\t$trips = Trips::where('id', $request->trip_id)->first();\n\n\t\t$save = 0;\n\t\tif ($request->payment_mode && $trips->is_calculation == 0) { //if is_calculation is zero and payment_mode send then update payment mode in table\n\t\t\t$payment_method_store = $request->payment_mode;\n\t\t\tif ($request->is_wallet == 'Yes' && $payment_method_store != 'Wallet') {\n\t\t\t\t$payment_method_store = $request->payment_mode . ' & Wallet';\n\t\t\t}\n\n\t\t\t//If user change payment mode then change payment mode in trips,requests & schedule_rides tables also\n\t\t\tTrips::where('id', $request->trip_id)->update(['payment_mode' => $payment_method_store]);\n\t\t\t$rideRequest = RideRequest::where('id', $trips->request_id)->first();\n\t\t\t$rideRequest->payment_mode = $payment_method_store;\n\t\t\t$rideRequest->save();\n\t\t\tScheduleRide::where('id', $rideRequest->schedule_id)->update(['payment_method' => $rideRequest->payment_mode]);\n\t\t}\n\t\t\n\t\tif ($trips->status == 'Payment') {\n\t\t\t$data = [\n\t\t\t\t'trip_id' \t=> $request->trip_id,\n\t\t\t\t'user_type' => $request->user_type,\n\t\t\t\t'user_id' \t=> $user->id,\n\t\t\t\t'save_to_trip_table' => $save,\n\t\t\t];\n\t\t\t$trips = $this->invoice_helper->calculation($data);\n\t\t\treturn $this->invoice_helper->getInvoice($trips,$data);\n\t\t}\n\n\t\treturn response()->json([\n\t\t\t'status_code' \t => '2',\n\t\t\t'status_message' => __('messages.api.something_went_wrong'),\n\t\t]);\n\t}", "public function getDutyPricing();", "function UpdateTripOutstandingAmount($iTripId, $ePaidByPassenger = \"No\", $ePaidToDriver = \"No\") {\n global $generalobj, $obj, $CREDIT_TO_WALLET_ENABLE;\n\n $sql = \"SELECT iUserId,iDriverId,fCancellationFare,fWalletDebit,vTripPaymentMode,vRideNo,iVehicleTypeId, tVehicleTypeFareData,eCardFailed,iFare FROM trips WHERE iTripId='\" . $iTripId . \"'\"; //added by SP Outstanding calculate if payment failed end on 27-7-2019 add eCardFailed\n $tripdata = $obj->MySQLSelect($sql);\n $iUserId = $tripdata[0]['iUserId'];\n $iDriverId = $tripdata[0]['iDriverId'];\n $fCancellationFare = $tripdata[0]['fCancellationFare'];\n $fWalletDebit = $tripdata[0]['fWalletDebit'];\n $vTripPaymentMode = $tripdata[0]['vTripPaymentMode'];\n $iVehicleTypeId = $tripdata[0]['iVehicleTypeId'];\n $eCardFailed = $tripdata[0]['eCardFailed']; //added by SP Outstanding calculate if payment failed end on 27-7-2019\n $iFare = $tripdata[0]['iFare'];\n $fCommision = $fPendingAmount = 0;\n if ($iVehicleTypeId > 0) {\n $fCommision = get_value('vehicle_type', 'fCommision', 'iVehicleTypeId', $iVehicleTypeId, '', 'true');\n }\n if (!empty($tripdata[0]['tVehicleTypeFareData'])) {\n $tVehicleTypeFareDataArr = (array) json_decode($tripdata[0]['tVehicleTypeFareData']);\n $fCommision = $tVehicleTypeFareDataArr['ParentCommision'];\n }\n /* added by SP Outstanding calculate if payment failed start on 27-7-2019 */\n if ($eCardFailed == 'Yes') {\n $fCancellationFare = $iFare;\n }\n /* added by SP Outstanding calculate if payment failed end on 27-7-2019 */\n if ($fCancellationFare > 0) {\n $fPendingAmount = $fCancellationFare;\n }\n if ($fPendingAmount < 0) {\n $fPendingAmount = 0;\n }\n ## Calculate Driver's Commission and PendingAmount ##\n $DriverTotalAmount = $fWalletDebit + $fCancellationFare;\n $Site_Commision = round((($DriverTotalAmount * $fCommision) / 100), 2);\n $fDriverPendingAmount = $DriverTotalAmount - $Site_Commision;\n $fTripGenerateFare = $fWalletDebit + $fCancellationFare;\n $iFare = $fCancellationFare;\n ## Calculate Driver's Commission and PendingAmount ##\n $Data_trip_OutstandingAmount[\"iTripId\"] = $iTripId;\n $Data_trip_OutstandingAmount[\"iUserId\"] = $iUserId;\n $Data_trip_OutstandingAmount[\"iDriverId\"] = $iDriverId;\n $Data_trip_OutstandingAmount[\"fWalletDebit\"] = $fWalletDebit;\n $Data_trip_OutstandingAmount[\"fCancellationFare\"] = $fCancellationFare;\n $Data_trip_OutstandingAmount[\"vTripPaymentMode\"] = $vTripPaymentMode;\n $Data_trip_OutstandingAmount[\"ePaidByPassenger\"] = $ePaidByPassenger;\n $Data_trip_OutstandingAmount[\"ePaidToDriver\"] = $ePaidToDriver;\n $Data_trip_OutstandingAmount[\"fPendingAmount\"] = $fPendingAmount;\n $Data_trip_OutstandingAmount[\"fCommision\"] = $Site_Commision;\n $Data_trip_OutstandingAmount[\"fDriverPendingAmount\"] = $fDriverPendingAmount;\n if ($ePaidByPassenger == \"Yes\") {\n $Data_trip_OutstandingAmount[\"vTripAdjusmentId\"] = $iTripId;\n }\n $currencyList = get_value('currency', '*', 'eStatus', 'Active');\n for ($i = 0; $i < count($currencyList); $i++) {\n $currencyCode = $currencyList[$i]['vName'];\n $Data_trip_OutstandingAmount['fRatio_' . $currencyCode] = $currencyList[$i]['Ratio'];\n }\n $iTripOutstandId = $obj->MySQLQueryPerform(\"trip_outstanding_amount\", $Data_trip_OutstandingAmount, 'insert');\n if ($iTripOutstandId > 0 && $ePaidByPassenger == \"No\" && $fPendingAmount > 0) {\n $updateQuery = \"UPDATE register_user set fTripsOutStandingAmount = fTripsOutStandingAmount+'\" . $fPendingAmount . \"' WHERE iUserId = \" . $iUserId;\n $obj->sql_query($updateQuery);\n }\n\n ### Debit User Wallet & Credit Driver Wallet ###\n if ($eCardFailed == 'No') { //added by SP because when card failed at that time, it is checked otherwise two times debited from the user account on 30-07-2019\n if ($fWalletDebit > 0) {\n ### Debit User Wallet ###\n $vRideNo = $tripdata[0]['vRideNo'];\n $data_user_wallet['iUserId'] = $iUserId;\n $data_user_wallet['eUserType'] = \"Rider\";\n $data_user_wallet['iBalance'] = $fWalletDebit;\n $data_user_wallet['eType'] = \"Debit\";\n $data_user_wallet['dDate'] = @date(\"Y-m-d H:i:s\");\n $data_user_wallet['iTripId'] = $iTripId;\n $data_user_wallet['eFor'] = \"Booking\";\n $data_user_wallet['ePaymentStatus'] = \"Unsettelled\";\n $data_user_wallet['tDescription'] = \"#LBL_DEBITED_CANCELLED_BOOKING# \" . \" \" . $vRideNo;\n $generalobj->InsertIntoUserWallet($data_user_wallet['iUserId'], $data_user_wallet['eUserType'], $data_user_wallet['iBalance'], $data_user_wallet['eType'], $data_user_wallet['iTripId'], $data_user_wallet['eFor'], $data_user_wallet['tDescription'], $data_user_wallet['ePaymentStatus'], $data_user_wallet['dDate']);\n ### Debit User Wallet ###\n ### Credit Driver Wallet ###\n if ($fCancellationFare == 0) {\n $fWalletDebit = $fWalletDebit - $Site_Commision;\n }\n $data_driver_wallet['iUserId'] = $iDriverId;\n $data_driver_wallet['eUserType'] = \"Driver\";\n $data_driver_wallet['iBalance'] = $fWalletDebit;\n $data_driver_wallet['eType'] = \"Credit\";\n $data_driver_wallet['dDate'] = @date(\"Y-m-d H:i:s\");\n $data_driver_wallet['iTripId'] = $iTripId;\n $data_driver_wallet['eFor'] = \"Deposit\";\n $data_driver_wallet['ePaymentStatus'] = \"Unsettelled\";\n $data_driver_wallet['tDescription'] = \"#LBL_AMOUNT_CANCELTRIP_CREDIT#\" . \" \" . $vRideNo;\n $generalobj->InsertIntoUserWallet($data_driver_wallet['iUserId'], $data_driver_wallet['eUserType'], $data_driver_wallet['iBalance'], $data_driver_wallet['eType'], $data_driver_wallet['iTripId'], $data_driver_wallet['eFor'], $data_driver_wallet['tDescription'], $data_driver_wallet['ePaymentStatus'], $data_driver_wallet['dDate']);\n ### Credit Driver Wallet ###\n }\n }\n ### Debit User Wallet & Credit Driver Wallet ###\n if ($ePaidByPassenger == \"Yes\" && $ePaidToDriver == \"Yes\") {\n $updateQuery = \"UPDATE trips set iFare = '\" . $iFare . \"',fTripGenerateFare = '\" . $fTripGenerateFare . \"',ePaymentCollect = 'Yes',eDriverPaymentStatus = 'Settelled',fCommision = '\" . $Site_Commision . \"' WHERE iTripId = \" . $iTripId;\n $obj->sql_query($updateQuery);\n } else {\n $updateQuery = \"UPDATE trips set iFare = '\" . $iFare . \"',fTripGenerateFare = '\" . $fTripGenerateFare . \"',fCommision = '\" . $Site_Commision . \"' WHERE iTripId = \" . $iTripId;\n $obj->sql_query($updateQuery);\n }\n return $iTripOutstandId;\n}", "function paidCheckout () {\t\t\n\t\t\n\t\t/* PAYPAL API DETAILS */\n\t\t$API_UserName \t= $this->API_UserName;\n\t\t$API_Password \t= $this->API_Password;\n\t\t$API_Signature = $this->API_Signature;\n\t\t$API_Endpoint \t= $this->API_Endpoint;\n\t $version = $this->version;\n\t\t\n\t\t/*SET SUCCESS AND FAIL URL*/\n\t\t$host \t = $_SERVER['SERVER_NAME'];\t\t \n\t\t$root = $this->webroot; \n\t\t$returnURL = \"http://$host$root\".'controller/reviewOrder';\n\t\t$cancelURL = \"http://$host$root\".'controller/signupFailure';\n\t\t\n\t\t/* SET VALUES */\t\n\t\t$environment \t= $this->environment;\t\t\n\t\t$L_BILLINGTYPE0 = 'RecurringPayments';\t\t\n\t\t\n\t\tif ($this->request->is('post')) {\n\t\t\t\n\t $obj\t= new PaypalRecurring;\t\t\n\t\t\t\n\t\t\t/* PAYPAL API DETAILS */\n\t\t\t$obj->API_UserName \t= urlencode($API_UserName);\n\t\t\t$obj->API_Password \t= urlencode($API_Password);\n\t\t\t$obj->API_Signature = urlencode($API_Signature);\n\t\t\t$obj->API_Endpoint \t= $API_Endpoint;\n\t\t\t$obj->version \t\t= urlencode($version);\n\t\t\t\n\t\t\t/*SET SUCCESS AND FAIL URL*/\n\t\t\t$obj->returnURL = urlencode($returnURL);\n\t\t\t$obj->cancelURL = urlencode($cancelURL);\n\t\t\t\n\t\t\t$obj->environment \t\t\t\t\t\t= $environment;\t\n\t\t\t$obj->paymentType \t\t\t\t\t\t= urlencode($paymentType);\t\n\t\t\t$obj->L_BILLINGTYPE0 \t\t\t\t\t= $L_BILLINGTYPE0;\t\t\n\t\t\t$obj->L_BILLINGAGREEMENTDESCRIPTION0\t= urlencode($L_BILLINGAGREEMENTDESCRIPTION0);\t\n\t\t\t$obj->paymentAmount\t\t\t\t\t\t= urlencode($subscription_cost); //Amt\n\t\t\t$obj->taxamount\t\t\t\t\t\t\t= urlencode($service_tax);\t\n\t\t\t$obj->currencyID\t\t\t\t\t\t= urlencode($currency_code);\t\n\t\t\t$obj->L_PAYMENTREQUEST_0_NAME0\t\t\t= urlencode($subscription_name);\n\t\t\t$obj->L_PAYMENTREQUEST_0_AMT0\t\t\t= urlencode($subscription_cost);\n\t\t\t$obj->L_PAYMENTREQUEST_0_DESC0\t\t\t= urlencode($L_BILLINGAGREEMENTDESCRIPTION0);\t\n\t\t\t$obj->PAYMENTREQUEST_0_ITEMAMT\t\t\t= urlencode($subscription_cost);\n\t\t\t$obj->PAYMENTREQUEST_0_TAXAMT\t\t\t= urlencode($service_tax);\n\t\t\t$obj->PAYMENTREQUEST_0_AMT\t\t\t\t= urlencode($bill_amount); // grand total\n\t\t\t$obj->PAYMENTREQUEST_0_CURRENCYCODE\t\t= urlencode($currency_code);\n\t\t\t\t\t\t\t\n\t\t\t$task = \"setExpressCheckout\"; //set initial task as Express Checkout\t\t\t\n\t\t\t$httpParsedResponseAr = $obj->setExpressCheckout();\n\t\t\t$methodError = 'SetExpressCheckout';\t\t\t\n\t\t\t$errorCode \t= urldecode($httpParsedResponseAr[\"L_ERRORCODE0\"]);\n\t\t\t$errorSmallMsg = urldecode($httpParsedResponseAr[\"L_SHORTMESSAGE0\"]);\n\t\t\t$errorLongMsg = urldecode($httpParsedResponseAr[\"L_LONGMESSAGE0\"]);\n\t\t\t$serverCode = urldecode($httpParsedResponseAr[\"L_SEVERITYCODE0\"]);\n\t\t\t\n\t\t\t// store in session for later use\n\t\t\t$this->Session->write('errorCode',$errorCode);\t\t\t\n\t\t\t$this->Session->write('errorSmallMsg',$errorSmallMsg);\n\t\t\t$this->Session->write('errorLongMsg',$errorLongMsg);\t\n\t\t\t$this->Session->write('serverCode',$serverCode);\t\t\t\n\t\t\t$this->redirect(array('controller'=>'controller','action' => 'action/'.$methodError));\n\t\t\t\n\t\t}\n\t}", "public function pay()\n {\n }", "function getLineItemDetails() {\n global $order, $currencies, $order_totals, $order_total_modules;\n $optionsST = array();\n $optionsLI = array();\n $onetimeSum = 0;\n $onetimeTax = 0;\n $creditsApplied = 0;\n $creditsTax_applied = 0;\n $sumOfLineItems = 0;\n $sumOfLineTax = 0;\n $time = date('Y-m-d H:i:s');\n\n // prepare subtotals\n for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {\n if ($order_totals[$i]['code'] == 'ot_subtotal') $optionsST['ITEMAMT'] = round($order_totals[$i]['value'],2);\n if ($order_totals[$i]['code'] == 'ot_tax') $optionsST['TAXAMT'] = round($order_totals[$i]['value'],2);\n if ($order_totals[$i]['code'] == 'ot_shipping') $optionsST['SHIPPINGAMT'] = round($order_totals[$i]['value'],2);\n if ($order_totals[$i]['code'] == 'ot_total') $optionsST['AMT'] = round($order_totals[$i]['value'],2);\n $optionsST['HANDLINGAMT'] = 0;\n global $$order_totals[$i]['code'];\n if (isset($$order_totals[$i]['code']->credit_class) && $$order_totals[$i]['code']->credit_class == true) $creditsApplied += round($order_totals[$i]['value'],2);\n // treat all other OT's as if they're related to handling fees\n ////robbie 增加 ot_big_orderd 不放在HandingAMT中处理,直接在ITEMAMT中扣除\n if (!in_array($order_totals[$i]['code'], array('ot_total','ot_subtotal','ot_tax','ot_shipping', 'ot_big_orderd' ,'ot_cash_account')) \n && !(isset($$order_totals[$i]['code']->credit_class) && $$order_totals[$i]['code']->credit_class == true)) {\n $optionsST['HANDLINGAMT'] += $order_totals[$i]['value'];\n }elseif ($order_totals[$i]['code'] == 'ot_big_orderd'){\n \t$optionsST['ITEMAMT'] -= round($order_totals[$i]['value'],2);\n }elseif ($order_totals[$i]['code'] == 'ot_cash_account'){\n \t$optionsST['ITEMAMT'] -= round($order_totals[$i]['value'],2);\n }\n \n// if (!in_array($order_totals[$i]['code'], array('ot_total','ot_subtotal','ot_tax','ot_shipping')) \n// && !(isset($$order_totals[$i]['code']->credit_class) && $$order_totals[$i]['code']->credit_class == true)) {\n// $optionsST['HANDLINGAMT'] += $order_totals[$i]['value'];\n// }\n }\n\n // Move shipping tax amount from Tax subtotal into Shipping subtotal for submission to PayPal\n $module = substr($_SESSION['shipping']['id'], 0, strpos($_SESSION['shipping']['id'], '_'));\n if (zen_not_null($order->info['shipping_method'])) {\n if ($GLOBALS[$module]->tax_class > 0) {\n $shipping_tax_basis = (!isset($GLOBALS[$module]->tax_basis)) ? STORE_SHIPPING_TAX_BASIS : $GLOBALS[$module]->tax_basis;\n $shippingOnBilling = zen_get_tax_rate($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);\n $shippingOnDelivery = zen_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);\n if ($shipping_tax_basis == 'Billing') {\n $shipping_tax = $shippingOnBilling;\n } elseif ($shipping_tax_basis == 'Shipping') {\n $shipping_tax = $shippingOnDelivery;\n } else {\n if (STORE_ZONE == $order->billing['zone_id']) {\n $shipping_tax = $shippingOnBilling;\n } elseif (STORE_ZONE == $order->delivery['zone_id']) {\n $shipping_tax = $shippingOnDelivery;\n } else {\n $shipping_tax = 0;\n }\n }\n $taxAdjustmentForShipping = zen_calculate_tax($order->info['shipping_cost'], $shipping_tax);\n $optionsST['SHIPPINGAMT'] += $taxAdjustmentForShipping;\n $optionsST['TAXAMT'] -= $taxAdjustmentForShipping;\n }\n }\n\n // loop thru all products to display quantity and price. Appends *** if out-of-stock.\n for ($i=0, $n=sizeof($order->products), $k=0; $i<$n; $i++, $k++) {\n $optionsLI[\"L_NUMBER$k\"] = $order->products[$i]['model'];\n $optionsLI[\"L_QTY$k\"] = (int)$order->products[$i]['qty'];\n $optionsLI[\"L_NAME$k\"] = $order->products[$i]['name'];\n $optionsLI[\"L_NAME$k\"] .= (zen_get_products_stock($order->products[$i]['id']) - $order->products[$i]['qty'] < 0 ? STOCK_MARK_PRODUCT_OUT_OF_STOCK : '');\n\n // if there are attributes, loop thru them and add to description\n if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0 ) {\n for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {\n $optionsLI[\"L_NAME$k\"] .= \"\\n \" . $order->products[$i]['attributes'][$j]['option'] . \n ': ' . $order->products[$i]['attributes'][$j]['value'];\n } // end loop\n } // endif attribute-info\n\n $optionsLI[\"L_AMT$k\"] = $order->products[$i]['final_price'];\n $optionsLI[\"L_TAXAMT$k\"] = zen_calculate_tax($order->products[$i]['final_price'], $order->products[$i]['tax']);\n\n // track one-time charges\n if ($order->products[$i]['onetime_charges'] != 0 ) {\n $onetimeSum += $order->products[$i]['onetime_charges'];\n $onetimeTax += zen_calculate_tax($order->products[$i]['onetime_charges'], $order->products[$i]['tax']);\n }\n\n // Replace & and = with * if found. \n $optionsLI[\"L_NAME$k\"] = str_replace(array('&','='), '*', $optionsLI[\"L_NAME$k\"]);\n $optionsLI[\"L_NAME$k\"] = zen_clean_html($optionsLI[\"L_NAME$k\"], 'strong');\n\n // reformat properly\n $optionsLI[\"L_NUMBER$k\"] = substr($optionsLI[\"L_NUMBER$k\"], 0, 127);\n $optionsLI[\"L_NAME$k\"] = substr($optionsLI[\"L_NAME$k\"], 0, 127);\n $optionsLI[\"L_AMT$k\"] = $optionsLI[\"L_AMT$k\"];\n $optionsLI[\"L_TAXAMT$k\"] = round($optionsLI[\"L_TAXAMT$k\"],2);\n\n } // end for loopthru all products\n\n if ($onetimeSum > 0) {\n $i++; $k++;\n $optionsLI[\"L_NUMBER$k\"] = $k;\n $optionsLI[\"L_NAME$k\"] = 'One-Time Charges';\n $optionsLI[\"L_AMT$k\"] = $onetimeSum;\n $optionsLI[\"L_TAXAMT$k\"] = $onetimeTax;\n $optionsLI[\"L_QTY$k\"] = 1;\n }\n\n // handle discounts such as gift certificates and coupons\n if ($creditsApplied > 0) {\n $optionsST['HANDLINGAMT'] -= $creditsApplied;\n }\n\n // add all one-time charges\n $optionsST['ITEMAMT'] += $onetimeSum;\n\n //ensure things are not negative\n $optionsST['HANDLINGAMT'] = abs(strval($optionsST['HANDLINGAMT']));\n\n // ensure all numbers are non-negative\n if (is_array($optionsST)) foreach ($optionsST as $key=>$value) {\n $optionsST[$key] = abs(strval($value));\n }\n if (is_array($optionsLI)) foreach ($optionsLI as $key=>$value) {\n if (strstr($key, 'AMT')) $optionsLI[$key] = abs(strval($value));\n }\n\n // subtotals have to add up to AMT\n // Thus, if there is a discrepancy, make adjustment to HANDLINGAMT:\n $st = $optionsST['ITEMAMT'] + $optionsST['TAXAMT'] + $optionsST['SHIPPINGAMT'] + $optionsST['HANDLINGAMT'];\n if ($st != $optionsST['AMT']) $optionsST['HANDLINGAMT'] += strval($optionsST['AMT'] - $st);\n\n\n/* //PayPal API spec contradicts itself ... and apparently neither of these \"requirements\" are enforced. \n //Thus skipping this section for now:\n\n // according to API specs, these cannot be set if they contain zero values, so unset if they are zero:\n if ($optionsST['TAXAMT'] == 0) unset($optionsST['TAXAMT']);\n if ($optionsST['SHIPPINGAMT'] == 0) unset($optionsST['SHIPPINGAMT']);\n if ($optionsST['HANDLINGAMT'] == 0) unset($optionsST['HANDLINGAMT']);\n // set missing subtotals if they are zero values, since all must be submitted\n if (!isset($optionsST['TAXAMT'])) $optionsST['TAXAMT'] = 0;\n if (!isset($optionsST['SHIPPINGAMT'])) $optionsST['SHIPPINGAMT'] = 0;\n if (!isset($optionsST['HANDLINGAMT'])) $optionsST['HANDLINGAMT'] = 0;\n*/\n\n // Since the PayPal spec cannot handle mathematically mismatched values caused by one-time charges,\n // must drop line-item details if any one-time charges apply to this order:\n // if there are any discounts in this order, do NOT supply line-item details\n if ($onetimeSum > 0) $optionsLI = array();\n\n // Do sanity check -- if any of the line-item subtotal math doesn't add up properly, skip line-item details,\n // so that the order can go through even though PayPal isn't being flexible to handle Zen Cart's diversity\n for ($j=0; $j<$k; $j++) {\n $itemAMT = $optionsLI[\"L_AMT$j\"];\n $itemTAX = $optionsLI[\"L_TAXAMT$j\"];\n $itemQTY = $optionsLI[\"L_QTY$j\"];\n $sumOfLineItems += ($itemQTY * $itemAMT);\n $sumOfLineTax += round(($itemQTY * $itemTAX),2);\n }\n\n if ((float)$optionsST['ITEMAMT'] != (float)strval($sumOfLineItems)) {\n $optionsLI = array();\n $this->zcLog('getLineItemDetails 1', $time.\"\\t in \". __FILE__ . \" on line \" . __LINE__ . \" \\t\\n\". 'Order Subtotal does not match sum of line-item prices. Line-item-details skipped.' . \"\\n\" . (float)$optionsST['ITEMAMT'] . ' ' . (float)$sumOfLineItems);\n //die('ITEMAMT != $sumOfLineItems ' . $optionsST['ITEMAMT'] . ' ' . $sumOfLineItems);\n }\n if ((float)$optionsST['TAXAMT'] != (float)strval($sumOfLineTax)) {\n $optionsLI = array();\n $this->zcLog('getLineItemDetails 2', $time.\"\\t in \". __FILE__ . \" on line \" . __LINE__ . \" \\t\\n\". 'Tax Subtotal does not match sum of taxes for line-items. Line-item-details skipped.' . \"\\n\" . $optionsST['TAXAMT'] . ' ' . $sumOfLineTax);\n //die('TAXAMT != $sumofLineTax ' . $optionsST['TAXAMT'] . ' ' . $sumOfLineTax);\n }\n\n $this->zcLog('getLineItemDetails 3', $time.\"\\t in \". __FILE__ . \" on line \" . __LINE__ . \" \\t\\n\". 'LineItemDetails: ' . \"\\n\" . ($creditsApplied ? 'Credits apply to this order, so all line-item details are NOT being submitted. Thus, the following data is REDUNDANT' . \"\\n\" : '') . 'Details:' . print_r(array_merge($optionsST, $optionsLI), true) . \"\\n\\n\" . 'DEFAULT_CURRENCY = ' . DEFAULT_CURRENCY . \"\\nSESSION['currency'] = \" . $_SESSION['currency'] . \"\\n\" . \"order->info['currency'] = \" . $order->info['currency'] . \"\\n\\$currencies->currencies[\\$_SESSION['currency']]['value'] = \" . $currencies->currencies[$_SESSION['currency']]['value'] . \"\\n\" . print_r($currencies, true));\n\n // if not default currency, do not send subtotals or line-item details\n if (DEFAULT_CURRENCY != $order->info['currency']) {\n $this->zcLog('getLineItemDetails 4', $time.\"\\t in \". __FILE__ . \" on line \" . __LINE__ . \" \\t\\n\". 'Not using default currency. Thus, no line-item details can be submitted.');\n return array();\n }\n if ($currencies->currencies[$_SESSION['currency']]['value'] != 1) {\n $this->zcLog('getLineItemDetails 5', $time.\"\\t in \". __FILE__ . \" on line \" . __LINE__ . \" \\t\\n\". 'currency val not equal to 1.0000 - cannot proceed without coping with currency conversions. Aborting line-item details.');\n return array();\n }\n\n // if there are any discounts in this order, do not supply subtotals or line-item details\n if (strval($creditsApplied) > 0) return array();\n //$this->zcLog('getLineItemDetails 6', 'no credits - okay');\n\n // if subtotals are not adding up correctly, then skip sending any line-item or subtotal details to PayPal\n $st = round(strval($optionsST['ITEMAMT'] + $optionsST['TAXAMT'] + $optionsST['SHIPPINGAMT'] + $optionsST['HANDLINGAMT']),2);\n $stDiff = strval($optionsST['AMT'] - $st);\n $stDiffRounded = strval(abs($st) - abs(round($optionsST['AMT'],2)));\n\n // by wangyuan for a paypal error\n // tidy up all values so that they comply with proper format (number_format(xxxx,2) for PayPal US use )\n if (!defined('PAYPALWPP_SKIP_LINE_ITEM_DETAIL_FORMATTING') || PAYPALWPP_SKIP_LINE_ITEM_DETAIL_FORMATTING != 'true') {\n if (is_array($optionsST)) foreach ($optionsST as $key=>$value) {\n \t \n $optionsST[$key] = number_format(abs($value), 2, '.', '');\n }\n // by wangyuan for paypal\n\t if($optionsST['HANDLINGAMT'] == $optionsST['SHIPPINGAMT'] && $stDiffRounded == 0){\n\t\t unset($optionsST['HANDLINGAMT'],$optionsST['SHIPPINGAMT']);\n\t\t }\n\t\t // end\n if (is_array($optionsLI)) foreach ($optionsLI as $key=>$value) {\n if (strstr($key, 'AMT')) $optionsLI[$key] = number_format(abs($value), 2, '.', '');\n }\n }\n //end\n\n $this->zcLog('getLineItemDetails 7', $time.\"\\t in \". __FILE__ . \" on line \" . __LINE__ . \" \\t\\n\". 'checking subtotals... '. \"\\nitemamt: \" . $optionsST['ITEMAMT'] . \"\\ntaxamt: \" . $optionsST['TAXAMT'] . \"\\nshippingamt: \" . $optionsST['SHIPPINGAMT'] . \"\\nhandlingamt: \" . $optionsST['HANDLINGAMT'] . \"\\n-------------------\\nsubtotal: \" . number_format($st, 2) . \"\\nAMT: \" . $optionsST['AMT'] . \"\\n-------------------\\ndifference: \" . $stDiff . ' (abs+rounded: ' . $stDiffRounded . ')');\n\n if ( $stDiffRounded != 0) return array(); //die('bad subtotals'); //return array();\n $this->zcLog('getLineItemDetails 8', $time.\"\\t in \". __FILE__ . \" on line \" . __LINE__ . \" \\t\\n\". 'subtotals balance - okay');\n\n if (abs($optionsST['HANDLINGAMT']) == 0) unset($optionsST['HANDLINGAMT']);\n\n // Send Subtotal and LineItem results back to be submitted to PayPal\n return array_merge($optionsST, $optionsLI);\n }", "function mytrades($pair='',$page=1,$page_size=20){\n $tParams = array();\n $tParams['method'] = 'mytrades';\n $tParams['access_key'] = $this->access_key;\n $tParams['created'] = time();\n \n $tParams['pair'] = $pair;\n $tParams['page'] = (int)abs($page);\n $tParams['page_size'] = (int)abs($page_size);\n \n $tParams['sign'] = $this->createSign($tParams);\n $tResult = $this->httpRequest(AUTH_API_URL, $tParams);\n return json_decode($tResult,1);\n }", "public function GetRetailerPO()\n\t{\n\t}", "function create_wallet_deduction($iUserId, $tripId) {\n global $generalobj, $obj;\n /* Check debit wallet For Count Total Fare Start */\n $user_available_balance = $generalobj->get_user_available_balance($iUserId, \"Rider\");\n $user_wallet_debit_amount = 0;\n // $total_fare = get_value('trips', 'fTripGenerateFare', 'iTripId', $tripId, '', 'true');\n $total_fare = get_value('trips', 'iFare', 'iTripId', $tripId, '', 'true');\n if ($total_fare > $user_available_balance) {\n $total_fare = $total_fare - $user_available_balance;\n $user_wallet_debit_amount = $user_available_balance;\n } else {\n $user_wallet_debit_amount = $total_fare;\n $total_fare = 0;\n }\n // Update User Wallet\n if ($user_wallet_debit_amount > 0) {\n $vRideNo = get_value('trips', 'vRideNo', 'iTripId', $tripId, '', 'true');\n $data_wallet['iUserId'] = $iUserId;\n $data_wallet['eUserType'] = \"Rider\";\n $data_wallet['iBalance'] = $user_wallet_debit_amount;\n $data_wallet['eType'] = \"Debit\";\n $data_wallet['dDate'] = date(\"Y-m-d H:i:s\");\n $data_wallet['iTripId'] = $tripId;\n $data_wallet['eFor'] = \"Booking\";\n $data_wallet['ePaymentStatus'] = \"Unsettelled\";\n $data_wallet['tDescription'] = \"#LBL_DEBITED_BOOKING# \" . $vRideNo;\n $generalobj->InsertIntoUserWallet($data_wallet['iUserId'], $data_wallet['eUserType'], $data_wallet['iBalance'], $data_wallet['eType'], $data_wallet['iTripId'], $data_wallet['eFor'], $data_wallet['tDescription'], $data_wallet['ePaymentStatus'], $data_wallet['dDate']);\n //$obj->MySQLQueryPerform(\"user_wallet\",$data_wallet,'insert');\n }\n /* Check debit wallet For Count Total Fare End */\n $returnArr['iFare'] = $total_fare;\n $returnArr['fWalletDebit'] = $user_wallet_debit_amount;\n return $returnArr;\n}", "function tw_twispay_p_recurring_order( $request ) {\n if ( isset( $_GET['order_ad'] ) && sanitize_key( $_GET['order_ad'] ) ) {\n\n $order_ad = (int) sanitize_key( $_GET['order_ad'] );\n\n /* Get configuration from database. */\n global $wpdb;\n $apiKey = '';\n $configuration = $wpdb->get_row( \"SELECT * FROM \" . $wpdb->prefix . \"twispay_tw_configuration\" );\n\n if ( $configuration ) {\n if ( $configuration->live_mode == 1 ) {\n $apiKey = sanitize_text_field( $configuration->live_key );\n $url = 'https://api.twispay.com/order/' . $order_ad;\n } else if ( $configuration->live_mode == 0 ) {\n $apiKey = sanitize_text_field( $configuration->staging_key );\n $url = 'https://api-stage.twispay.com/order/' . $order_ad;\n }\n }\n\n $args = array('method' => 'DELETE', 'headers' => ['accept' => 'application/json', 'Authorization' => $apiKey]);\n $response = wp_remote_request( $url, $args );\n\n if ( $response['response']['message'] == 'OK' ) {\n /* Redirect to the Transaction list Page with success. */\n wp_safe_redirect( admin_url( 'admin.php?page=tw-transaction&notice=success_recurring' ) );\n } else {\n /* Redirect to the Transaction list Page with error. */\n wp_safe_redirect( admin_url( 'admin.php?page=tw-transaction&notice=errorp_refund&emessage=' . rawurlencode($response['body']) ) );\n }\n } else {\n /* Redirect to the Transaction list Page with error. */\n wp_safe_redirect( admin_url( 'admin.php?page=tw-transaction&notice=error_recurring' ) );\n }\n}" ]
[ "0.614659", "0.6033119", "0.59627056", "0.5906555", "0.58863413", "0.5884244", "0.5824298", "0.57961756", "0.57785857", "0.57261723", "0.56160414", "0.56028545", "0.55841047", "0.5571341", "0.5533707", "0.55330336", "0.5523365", "0.55094314", "0.5458239", "0.54467535", "0.54381895", "0.54224354", "0.54099965", "0.5409042", "0.5389421", "0.53889155", "0.53515595", "0.5336402", "0.53360295", "0.53304696" ]
0.66278857
0
this function is for getting data Feet by container number
public function GetFeet(Request $request) { $k = 0; $date = date("Y-m-d H:i:s A"); $destination_id = ""; $call_api_con = $this->call_api_by_parameter("webGetFeetByContainer", ["ContainerID" => $request->container_id]); if (count($request->destination_id) > 0) { foreach ($request->destination_id as $data_destination) { $k++; $coma = ","; if (count($request->destination_id) == $k) { $coma = ""; } $destination_id .= $data_destination . $coma; } } $con_exist = $this->call_api_by_parameter("webGetContainerExist", [ "ContainerID" => $request->container_id, "DestinationID" => $destination_id, 'DateTime' => $date ] ); if ($call_api_con) { $deconde_json = json_decode($call_api_con); $con_decode = json_decode($con_exist); if ($deconde_json->id) { $ticket_id = ''; $ticket_number = ''; if ($con_decode->id) { $ticket_id = $con_decode->data[0]->ID; $ticket_number = $con_decode->data[0]->TicketNumber; } return response()->json([ 'id' => $deconde_json->id, 'data' => $deconde_json->data[0], 'id_con' => $con_decode->id, 'ticket_id' => $ticket_id, 'ticket_number' => $ticket_number ]); } return response()->json([ 'id' => 0 ]); } return response()->json([ 'error' => "You are losing your connection" ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_feet_by_number(Request $request)\r\n {\r\n $date = date(\"Y-m-d H:i:s A\");\r\n $call_api_con = $this->call_api_by_parameter(\"webGetFeetByContainerNumber\", [\"ContainerNumber\" => $request->container_number]);\r\n\r\n if ($call_api_con) {\r\n\r\n $deconde_json = json_decode($call_api_con);\r\n\r\n if ($deconde_json->id) {\r\n\r\n return response()->json([\r\n 'id' => $deconde_json->id,\r\n 'data' => $deconde_json->data[0]\r\n ]);\r\n }\r\n return response()->json([\r\n 'id' => 0\r\n ]);\r\n }\r\n return response()->json([\r\n 'error' => \"You are losing your connection\"\r\n ]);\r\n }", "public static function readIfbaContainerData(){\r\n /* Get entity query object for entity type 'node' */\r\n $query = \\Drupal::entityQuery('node');\r\n\r\n /*Use query object with condition filters to execute query and return node ids array*/\r\n $node_ids = $query->condition('type',IFBATypes::IFBA_ARCHIVE_CONTAINER)\r\n ->condition('status',1)\r\n ->execute();\r\n\r\n /*Pass node ids array into loadMultiple to return all associated data/nodes*/\r\n $nodes_result = Node::loadMultiple($node_ids);\r\n\r\n return $nodes_result;\r\n }", "public static function readIfbaSampleData($container_id){\r\n /* Get entity query object for entity type 'node' */\r\n $query = \\Drupal::entityQuery('node');\r\n\r\n $node_ids = [];\r\n\r\n /* Use query object with condition filters to execute query and return node ids array */\r\n if($container_id===0) {\r\n $node_ids = $query->condition('type',IFBATypes::IRISH_FISHERIES_BIOCHRONOLOGY_ARCHIVE)\r\n ->condition('status', 1)\r\n ->execute();\r\n }else{\r\n $node_ids = $query->condition('type', IFBATypes::IRISH_FISHERIES_BIOCHRONOLOGY_ARCHIVE)\r\n ->condition('field_contained_in',$container_id)\r\n ->condition('status', 1)\r\n ->execute();\r\n }\r\n /* Pass node ids array into loadMultiple to return all associated data/nodes */\r\n $nodes_result = Node::loadMultiple($node_ids);\r\n\r\n return $nodes_result;\r\n }", "function listaFacturas2()\n\t{\n\t\t$lista = $this->AlmacenModel->listaFacturas($_POST);\n\t\t$logo = $this->AlmacenModel->logo();\n\t\t$datos = array(); \n\t\t$cont = 0;\n\t\t$total_final = 0;\n\t\twhile($l = $lista->fetch_assoc())\n\t\t{\n\t\t\t$ok = 1;\n\t\t\tif(intval($l['asig']))\n\t\t\t{\n\t\t\t\t//$ok = $this->AlmacenModel->asig($l['uuid']);\n\t\t\t\t$ok = 0;\n\t\t\t\tif($archivo = glob($this->path().\"xmls/facturas/[1-9]*/*\".$l['uuid'].\".xml\",GLOB_NOSORT))\n\t\t\t\t\t$ok = 1;\n\t\t\t\t\n\t\t\t}\n\t\t\tif(intval($ok))\n\t\t\t{\n\t\t\t\t$cont++;\n\t\t\t\t\n\t\t\t\t$l['json'] = str_replace(\"\\\\\", \"\", $l['json']);\n\t\t\t\t$json = json_decode($l['json']);\n\t\t\t\t$json = $this->object_to_array($json);\n\t\t\t\t$dir = '';\n\t\t\t\t$subtotal = $ivas = 0;\n\t\t\t\t$total_final += $l['importe'];\n\n\t\t\t\tif($l['version'] == '3.2')\n\t\t\t\t{\n\t\t\t\t\t$subtotal = $json['Comprobante']['@subTotal'];\n\t\t\t\t\t$pago = $json['Comprobante']['@metodoDePago'];\n\t\t\t\t\t$metodo = $json['Comprobante']['@formaDePago'];\n\t\t\t\t\t\n\t\t\t\t\tif(strpos($metodo,'exhi') !== FALSE || strpos($metodo,'EXHI') !== FALSE)\n\t\t\t\t\t\t$metodo = \"PAGO EN UNA EXHIBICION\";\n\t\t\t\t\tif(strpos($metodo,'parcial') !== FALSE || strpos($metodo,'PARCIAL') !== FALSE)\n\t\t\t\t\t\t$metodo = \"PAGO EN PARCIALIDADES\";\n\n\t\t\t\t\t$ivas = $json['Comprobante']['cfdi:Impuestos']['@totalImpuestosTrasladados'];\n\t\t\t\t\t//Extraemos el domicilio del emisor\n\t\t\t\t\t$domicilio_emisor = $json['Comprobante']['cfdi:Emisor']['cfdi:DomicilioFiscal'];\n\t\t\t\t\t$dom_emisor = '';\n\t\t\t\t\tforeach ($domicilio_emisor as $campo => $valor) {\n\t\t\t\t\t\t$dom_emisor .= $valor.\" \";\n\t\t\t\t\t}\n\t\t\t\t\t//Extraemos el domicilio del receptor\n\t\t\t\t\t$domicilio_receptor = $json['Comprobante']['cfdi:Receptor']['cfdi:Domicilio'];\n\t\t\t\t\t$dom_receptor = '';\n\t\t\t\t\tforeach ($domicilio_receptor as $campo => $valor) {\n\t\t\t\t\t\t$dom_receptor .= $valor.\" \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$subtotal = $json['Comprobante']['@SubTotal'];\n\t\t\t\t\t$pago = $json['Comprobante']['@FormaPago'];\n\t\t\t\t\t$metodo = $json['Comprobante']['@MetodoPago'];\n\t\t\t\t\t$ivas = $json['Comprobante']['cfdi:Impuestos']['@TotalImpuestosTrasladados'];\n\t\t\t\t}\t\n\n\t\t\t\t$tieneRelacionPagos = \"\";\n\t\t\t\tif(strpos($metodo,'PARCIAL') !== FALSE || strpos($metodo,'PPD') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$tieneRelacionPagos = \"<br /><i style='opacity: 0.01;font-size:11px;'>*Si tiene pagos</i>\";\n\t\t\t\t\tif(!$this->AlmacenModel->tieneRelacionPagos($l['uuid']))\n\t\t\t\t\t\t$tieneRelacionPagos = \"<br /><i style='color:red;font-size:11px;'>*No tiene pagos</i>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$asignadas = '';\n\t\t\t\tif(intval($l['asig']))\n\t\t\t\t{\n\t\t\t\t\t$polizas = $this->AlmacenModel->polizasAsignadas($l['uuid']);\n\t\t\t\t\twhile($pol = $polizas->fetch_object())\n\t\t\t\t\t{\n\t\t\t\t\t\t$asignadas .= \"<a href='index.php?c=CaptPolizas&f=ModificarPoliza&id=$pol->id' target='_blank'>\".$pol->numpol.\" (\".$pol->idperiodo.\"-\".$pol->ejercicio.\")</a> \";\n\t\t\t\t\t\t$dir = \"$pol->id\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$asignadas = 'No Asignada';\n\t\t\t\t\t$dir = \"temporales\";\n\t\t\t\t}\n\n\t\t\t\tif(intval($_POST['asignadas']) == 3)\n\t\t\t\t\t$dir = \"canceladas\";\n\n\t\t\t\t$basename = '';\n\t\t\t\tif (strpos($l['xml'], '/') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$basename = explode(\"/\", $l['xml']);\n\t\t\t\t}\n\n\t\t\t\tif (!empty($basename[3])) {\n\t\t\t\t\t$l['xml'] = $basename[3];\n\t\t\t\t}\n\n\t\t\t\tarray_push($datos,array(\n\t\t 'fecha' => utf8_encode($l['fecha']),\n\t\t 'rfc' => utf8_encode($l['rfc']),\n\t\t 'emisor' => utf8_encode($l['emisor']),\n\t\t 'receptor' => utf8_encode($l['receptor']),\n\t\t 'links' => \"<a href='xmls/facturas/$dir/\".$l['xml'].\"' target='_blank'><i class='material-icons preview' data-toggle='tooltip' data-placement='top' title='Visualizar'>remove_red_eye</i></a><a href='controllers/visorpdf.php?name=\".$l['xml'].\"&logo=$logo&id=$dir' target='_blank'><i class='material-icons preview' data-toggle='tooltip' data-placement='top' title='Ver PDF'>picture_as_pdf</i></a>\",\n\t\t 'tipo' => utf8_encode($l['tipo']),\n\t\t 'pago' => $pago,\n\t\t 'metodo' => $metodo.\" \".$tieneRelacionPagos,\n\t\t 'moneda' => $l['moneda'],\n\t\t 'subtotal' => number_format($subtotal,2),\n\t\t 'ivas' => number_format($ivas,2),\n\t\t 'total' => $l['importe'],\n\t\t 'serie' => $l['serie'],\n\t\t 'folio' => $l['folio'],\n\t\t 'uuid' => $l['uuid'],\n\t\t 'fecha_sub' => utf8_encode($l['fecha_subida']),\n\t\t 'version' => $l['version'],\n\t\t 'estatus' => $asignadas,\n\t\t 'check' => \"<input type='checkbox' idfac='\".$l['id'].\"' xml='\".\"xmls/facturas/\".$dir.\"/\".$l['xml'].\"'>\",\n\t\t 'domicilio_emisor' => $dom_emisor,\n\t\t 'domicilio_receptor' => $dom_receptor,\n\t\t 'basename'=>$basename));\n\t\t\t}\n\t\t}\n\t\tarray_push($datos, array('total_final' => $total_final));\n\t\t//Pinta aqui el json para la vista\n\t\techo json_encode($datos);\n\t}", "private function getBusinessFaxContainer(){\r\n $aVars = array(\r\n 'business_fax' => $this->hasBusinessFaxNumber() ? \r\n _t('_emmetbytes_club_cover_business_fax_caption', $this->clubDatas['businessfax'])\r\n : _t('_emmetbytes_club_cover_business_fax_caption', _t('_emmetbytes_club_cover_not_available_caption')),\r\n );\r\n return $this->_oTemplate->parseHTMLByName('ebytes_club_cover_business_fax_container', $aVars);\r\n }", "private function getClubFoodServiceContainer(){\r\n $aVars = array(\r\n 'club_food_service' => $this->hasClubFoodService() ? \r\n _t('_emmetbytes_club_cover_club_food_service_caption', $this->clubDatas['food_service'])\r\n : _t('_emmetbytes_club_cover_club_food_service_caption', _t('_emmetbytes_club_cover_not_available_caption')),\r\n );\r\n return $this->_oTemplate->parseHTMLByName('ebytes_club_cover_club_food_service_container', $aVars);\r\n }", "public function page_data_fetch(){\n\n $page = new page();\n $pages = $page->get_pages();\n $page_data = array();\n $page_data[\"pages\"] = $pages;\n foreach($pages as $pge) {\n //now we fetch the containers\n $container = new Container();\n $page_data[\"containers\"][$pge->name] = $container->get_containers($pge->name);\n }\n return $page_data;\n }", "public function data_fetch_and_display()\n {\n require './vendor/autoload.php';\n $client = new GuzzleHttp\\Client();\n $data = $client->request('GET',$this->url);\n // echo $data->getStatusCode();\n \n $body = $data->getBody();\n\n $json_data = json_decode($body);\n \n $index = 0; //using for each data indexing in the output\n echo \"<div class='container'>\";\n foreach($json_data->data as $key=>$value){ \n $index +=1;\n echo \"<div class='blocks'>\";\n echo \"<div>\";\n echo \"<div class='heading'>\";\n echo \"<span class='index'>\".($index).\"</span>\";\n echo \"<h3 class='head'> \".$json_data->data[$key]->attributes->title.\"</h3>\";\n echo \"</div>\";\n print_r($json_data->data[$key]->attributes->body->summary);\n if($json_data->data[$key]->attributes->field_services->value != null)\n echo $json_data->data[$key]->attributes->field_services->value;\n echo \"</div>\";\n $url = $json_data->data[$key]->relationships->field_image->links->related->href;\n $data1 = $client->request('GET',$url);\n $body2 = $data1->getBody();\n $json_data2 = json_decode($body2);\n $img_src = \"https://ir-revamp-dev.innoraft-sites.com\".$json_data2->data->attributes->uri->url; \n echo \"<img src= '$img_src'></br>\";\n echo \"</div>\";\n }\n echo \"</div>\";\n }", "private function getContainers($data){\n\t\t\tif(preg_match('/\\x00\\x13controllerStructure\\x00\\x0D/Us', $data)){\n\t\t\t\treturn \"noInventory\";\n\t\t\t}\n\n\t\t\tpreg_match('/(?:\\x00\\x09inventory)(.+)(?:\\x00\\x08shipMan0)/Us', $data, $matches);\n\t\t\t$str = chr(0).chr(9).\"inventory\".chr(3);\n\t\t\t$inventory = explode($str , $matches[1]);\n\t\t\t$return = array();\n\t\t\tfor($i = 0; $i < count($inventory); $i++){\n\t\t\t\t$arr = explode(\"\\x0D\\x00\",$inventory[$i]);\n\t\t\t\t$index1 = explode(\"index\", $arr[0]);\n\t\t\t\t$index1 = str_split($index1[1], 4);\n\t\t\t\t$pos = array(\n\t\t\t\t\t'x' => binInt32($index1[0]),\n\t\t\t\t\t'y' => binInt32($index1[1]),\n\t\t\t\t\t'z' => binInt32($index1[2])\n\t\t\t\t);\n\t\t\t\t$arr[1] = substr($arr[1], 19);\n\t\t\t\t$slotsSplit = explode(\"\\x0C\\x00\\x05types\\x02\\x00\\x00\", $arr[1]);\n\t\t\t\t$slotsList = str_split($slotsSplit[0], 4);\n\t\t\t\t$slotsUsed = count($slotsList) - 1;\n\t\t\t\t$slotsArr = array();\n\t\t\t\t\n\t\t\t\t$blocksList = str_split($slotsSplit[1], 2);\n\t\t\t\t$arr[2] = substr($arr[2],7);\n\t\t\t\t$valueList = explode(chr(253), $arr[2]);\n\t\t\t\t$valueList = array_slice($valueList, 1);\n\t\t\t\tif(count($valueList)){\n\t\t\t\t\t$valueList[$slotsUsed -1] = substr($valueList[$slotsUsed -1], 0, 4);\n\t\t\t\t}\n\t\t\t\tfor($j = 0; $j < $slotsUsed; $j++){\n\t\t\t\t\t$blockId = $blocksList[$j];\n\t\t\t\t\t$slotsArr[binInt32($slotsList[$j])] = array (\n\t\t\t\t\t\t'block' => binInt16($blockId),\n\t\t\t\t\t\t'qty' => binInt32($valueList[$j])\n\t\t\t\t\t);\n\t\t\t\t\tvar_dump($valueList[$j]);\n\t\t\t\t}\n\t\t\t\t$return[$i] = array(\n\t\t\t\t\t'pos' => $pos,\n\t\t\t\t\t'slots' => $slotsArr\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $return;\n\t\t}", "abstract public function get_data();", "public function all_servicecontracts_to_map_view($servicenumber)\n {\n \t\t\t$rss = new DOMDocument(); \n\t\t\t$cust_code= $this->session->userdata('cust_code'); \n\t\t\t$email1=$this->session->userdata('email');\n\t\t\t$urlArray = array(array('name' => 'api', 'url' => 'http://216.234.105.194:8088/Alpha.svc/ServiceContractList/'.$cust_code.'/'.$servicenumber.'/ / /1000/1/End_date/desc/5434548B-9C59-451E-9673-1D462C11953B/E2795374-87A2-45DE-AD46-194D042B6213'),\n\t\t\t\t\t\t\t\t );\n\t\t\t\t\t foreach ($urlArray as $url) \n\t\t\t\t\t\t {\n\t\t\t\t\t\t echo\"<diffgr:diffgram xmlns:diffgr='urn:schemas-microsoft-com:xml-diffgram-v1' xmlns:msdata='urn:schemas-microsoft-com:xml-msdata'><DocumentElement xmlns=''>\";\n\t\t\t\t\t\t\t\t\t \n\t\t\t $rss->load($url['url']);\n\t\t\t\t\t\t\t\t\t foreach ($rss->getElementsByTagName('ServiceContractList') as $node)\n\t\t\t\t\t\t\t\t\t {\t\n\t\t\t\t\t\t\t\t\t \techo \"<contracts diffgr:id='contract1' msdata:rowOrder='0' diffgr:hasChanges='inserted'><description>\".$node->getElementsByTagName('description')->item(0)->nodeValue.\"</description><service_level>\".$node->getElementsByTagName('service_level')->item(0)->nodeValue.\"</service_level><contract_status>\".$node->getElementsByTagName('contract_status')->item(0)->nodeValue.\"</contract_status><location>\".$node->getElementsByTagName('location')->item(0)->nodeValue.\"</location><error>\".$node->getElementsByTagName('Error')->item(0)->nodeValue.\"</error></contracts>\";\t \n }\t\t\t\t\t\t \n\t\t\t\t\t\t\t echo \"</DocumentElement></diffgr:diffgram></DataTable>\";\n\t\t\t \n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\n \n }", "abstract function buildListDataContainers(): void;", "private function aaiFetchFidsData() {\n $db = DB::dbInstance();\n\n // include nusoap library\n $lib_pth = drupal_get_path('module', 'fids') . '/lib/nusoap.php';\n require_once($lib_pth);\n\n // get query batch size\n $batch_size = AAI_QRY_BATCH_SIZE;\n\n // fields for which data is fetched\n $fids_fields = array(\n 'LOCAL_AIRPORT',\n 'ARRIVAL_DEPARTURE_FLAG',\n 'INTERNATIONAL_DOMESTIC_FLAG',\n 'AIRLINE_CODE',\n 'FLIGHT_NUMBER',\n 'SOURCE_DESTINATION',\n 'VIA',\n 'VIA1',\n 'SCHED_DATE',\n 'SCHED_TIME',\n 'EST_DATE',\n 'EST_TIME',\n 'ACT_DATE',\n 'ACT_TIME',\n 'FLIGHT_STATUS',\n 'TERMINAL',\n 'GATES',\n 'COUNTERS',\n 'BELT_NUMBER',\n );\n\n // get table for fids data entry\n $fids_tbl = variable_get('aai_fids_active_table');\n if ($fids_tbl == 'aai_fids_data_1') {\n $blank_fids_tbl = 'aai_fids_data_2';\n } else {\n $blank_fids_tbl = 'aai_fids_data_1';\n }\n // truncate secondary table\n $db->dbTruncateQuery($blank_fids_tbl);\n\n // fields for data entry\n $flds_to_select = $fids_fields;\n $flds_to_select[] = 'DATEVAL';\n\n // get all url to get FIDS data from\n $fids_api_urls = unserialize(variable_get('fids_xml_feeds'));\n\n // set parameters for SOAP call\n $proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';\n $proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';\n $proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';\n $proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';\n\n // loop through all API's to fetch data\n $api_errors_counter = 0;\n foreach($fids_api_urls as $item) {\n $url = $item['feed_url'];\n $operation = $item['callback'];\n $res_type = $item['res_type'];\n\n // variable to check if data received from the API\n $data_not_fetched = 1;\n $data_available = 0;\n // variable to ascertain if secondary link used to get data\n $use_secondary_api_link = 0;\n\n do {\n // if 3 attempts to fetch data fails, try with alternate url if\n // available else send a mail to the admin about the problem\n // & continue with other API in list\n if ($data_not_fetched > 3) {\n if (isset($item['feed_url_sec']) && !$use_secondary_api_link) {\n $use_secondary_api_link = 1;\n $url = $item['feed_url_sec'];\n // reset counter for secondary api, to have 3 attempts\n $data_not_fetched = 1;\n } else {\n $airport = $item['name'];\n $msg = \"FIDS API error, failed to fetch data for '$airport' airport.\";\n if ($use_secondary_api_link) {\n $msg .= \" Both from primary & secondary links.\";\n }\n // send mail to aai-admin\n $this->aaiWatchdog($msg, WATCHDOG_ERROR);\n $data_not_fetched = 0;\n // track the api call failures\n $api_errors_counter++;\n break;\n }\n }\n $client = new nusoap_client($url, 'wsdl', $proxyhost, $proxyport, $proxyusername, $proxypassword);\n // set content encoding\n $client->soap_defencoding = 'UTF-8';\n\n $err = $client->getError();\n if ($err) {\n // iff error occurs, do watchdog entry and skip current iteration\n $this->aaiWatchdog(\"Constructor error, fetching details from $url \" . $err, WATCHDOG_ERROR);\n }\n\n // Doc/lit parameters get wrapped\n $param = array('Symbol' => 'IBM');\n $result = $client->call($operation, array('parameters' => $param), '', '', false, true);\n\n // Check for a fault\n if ($client->fault) {\n $this->aaiWatchdog(\"Constructor error, fetching details from $url \". $result, WATCHDOG_ERROR);\n } else {\n // Check for errors\n $err = $client->getError();\n if ($err) {\n $this->aaiWatchdog(\"Constructor error, fetching details from $url \". $err, WATCHDOG_ERROR);\n } else {\n // Fetch the result \n switch ($res_type) {\n case 1:\n $fids_data = $result['return'];\n $fids_data = (array) simplexml_load_string($fids_data);\n $fids_data = $fids_data['Detail_Movements'];\n break;\n case 2:\n $fids_data = $result['FlightFIDSResult']['NewDataSet']['Detail_Movements'];\n break;\n }\n $data_not_fetched = 0;\n $data_available = 1;\n }\n }\n\n // check if data retrieved from API\n if ($data_not_fetched) {\n $data_not_fetched++;\n }\n } while ($data_not_fetched);\n\n // process only if data is fetched\n if ($data_available) {\n $total_rec = count($fids_data);\n\n $full_batch_cycles = 0;\n $remaining_rec = $total_rec % $batch_size;\n if ($total_rec > $batch_size) {\n $full_batch_cycles = floor($total_rec / $batch_size);\n }\n\n $full_counter = 0;\n $values = array();\n if ($full_batch_cycles) {\n for ($batch_cycle = 1; $batch_cycle <= $full_batch_cycles; $batch_cycle++) {\n for ($i = 0; $i < $batch_size; $i++) {\n $v = $fids_data[$full_counter];\n if (is_array($v)) {\n $v = (object) $v;\n }\n\n foreach ($fids_fields as $fld) {\n if ($fld == 'EST_DATE' || $fld == 'ACT_DATE') {\n $tmp_dt = $v->$fld;\n if ($tmp_dt == '') {\n $val[$fld] = NULL;\n } else {\n $val[$fld] = $tmp_dt;\n }\n } else if ($fld == 'EST_TIME' || $fld == 'ACT_TIME' || $fld == 'FLIGHT_STATUS') {\n $tmp_time = $v->$fld;\n if ($tmp_time == '') {\n $val[$fld] = 0;\n } else {\n $val[$fld] = $tmp_time;\n }\n } else if ($fld == 'FLIGHT_NUMBER') {\n $tmp = $v->$fld;\n if (empty($tmp)) {\n $val[$fld] = 0;\n } else {\n $val[$fld] = $tmp;\n }\n } else {\n $val[$fld] = $v->$fld;\n }\n }\n $val['DATEVAL'] = time();\n $values[] = $val;\n $full_counter++;\n // if we have fetched batch size records then do record entry into log table\n if ($i == ($batch_size - 1)) {\n $db->dbInsertMultiple($blank_fids_tbl, $flds_to_select, $values);\n $values = array();\n }\n }\n }\n // do entry for the remaining records\n for (; $full_counter < $total_rec; ) {\n $v = $fids_data[$full_counter++];\n if (is_array($v)) {\n $v = (object) $v;\n }\n\n foreach ($fids_fields as $fld) {\n if ($fld == 'EST_DATE' || $fld == 'ACT_DATE') {\n $tmp_dt = $v->$fld;\n if ($tmp_dt == '') {\n $val[$fld] = NULL;\n } else {\n $val[$fld] = $tmp_dt;\n }\n } else if ($fld == 'EST_TIME' || $fld == 'ACT_TIME' || $fld == 'FLIGHT_STATUS') {\n $tmp_time = $v->$fld;\n if ($tmp_time == '') {\n $val[$fld] = 0;\n } else {\n $val[$fld] = $tmp_time;\n }\n } else {\n $val[$fld] = $v->$fld;\n }\n }\n $val['DATEVAL'] = time();\n $values[] = $val;\n }\n $db->dbInsertMultiple($blank_fids_tbl, $flds_to_select, $values);\n } else {\n $values = array();\n for (; $full_counter < $total_rec; ) {\n $v = $fids_data[$full_counter++];\n if (is_array($v)) {\n $v = (object) $v;\n }\n\n foreach ($fids_fields as $fld) {\n if ($fld == 'EST_DATE' || $fld == 'ACT_DATE') {\n $tmp_dt = $v->$fld;\n if ($tmp_dt == '') {\n $val[$fld] = NULL;\n } else {\n $val[$fld] = $tmp_dt;\n }\n } else if ($fld == 'EST_TIME' || $fld == 'ACT_TIME' || $fld == 'FLIGHT_STATUS') {\n $tmp_time = $v->$fld;\n if ($tmp_time == '') {\n $val[$fld] = 0;\n } else {\n $val[$fld] = $tmp_time;\n }\n } else {\n $val[$fld] = $v->$fld;\n }\n }\n $val['DATEVAL'] = time();\n $values[] = $val;\n }\n $db->dbInsertMultiple($blank_fids_tbl, $flds_to_select, $values);\n }\n }\n }\n\n return $api_errors_counter;\n }", "public function getConsultasFaq($fechainicio, $fechafin){\n $faq = filterFaq($this->conMongo, $fechainicio, $fechafin);\n $numeroFaq = [];\n $proveedores=0;\n $tarifas=0;\n $hojaDeVida=0;\n $proyectos=0;\n $convenios=0;\n $leyes=0;\n $usuarios=0;\n $alumbrado_Publico=0;\n $normatividad=0; \n $factura = 0;\n\n foreach ($faq as $key => $value) {\n $interaccion = $value->TIPOINTERACCION;\n \n if($interaccion=='proveedores'){\n\n $proveedores += 1;\n\n }else if($interaccion=='tarifas'){\n \n $tarifas += 1;\n\n }else if($interaccion=='hoja de vida'){\n \n $hojaDeVida += 1;\n \n }else if($interaccion=='proyectos'){\n\n $proyectos += 1; \n \n }else if($interaccion=='convenios'){\n\n $convenios += 1; \n \n }else if($interaccion=='leyes'){\n \n $leyes += 1;\n\n }else if($interaccion=='usuarios'){\n\n $usuarios += 1; \n \n }else if($interaccion=='alumbrado publico'){\n\n $alumbrado_Publico += 1; \n \n }else if($interaccion=='normatividad'){\n\n $normatividad += 1; \n \n }else if($interaccion=='factura'){\n\n $factura += 1; \n \n }\n }\n\n $numeroFaq[0] = $proveedores;\n $numeroFaq[1] = $tarifas;\n $numeroFaq[2] = $hojaDeVida;\n $numeroFaq[3] = $proyectos;\n $numeroFaq[4] = $convenios;\n $numeroFaq[5] = $leyes;\n $numeroFaq[6] = $usuarios;\n $numeroFaq[7] = $alumbrado_Publico;\n $numeroFaq[8] = $normatividad;\n $numeroFaq[9] = $factura;\n\n return $numeroFaq;\n\n }", "public function get_container20(): string\n {\n $containeres = $this->container;\n $cont = '';\n foreach ($containeres as $idx => $container) {\n if ($container->dimensao === '20') {\n if ($idx > 0)\n $cont .= \"/\";\n $cont .= $container->codigo;\n }\n }\n return $cont;\n }", "abstract public function getData($offset);", "private function getBusinessTelephoneContainer(){\r\n $aVars = array(\r\n 'business_telephone' => $this->hasBusinessPhoneNumber() ? \r\n _t('_emmetbytes_club_cover_business_telephone_caption', $this->clubDatas['businesstelephone'])\r\n : _t('_emmetbytes_club_cover_business_telephone_caption', _t('_emmetbytes_club_cover_not_available_caption')),\r\n );\r\n return $this->_oTemplate->parseHTMLByName('ebytes_club_cover_business_telephone_container', $aVars);\r\n }", "public function getServiciosFacturados($RUT){\n\n $run = new Method;\n //trae servicios activos del cliente\n $query = \" SELECT\n Id, TipoFactura, Valor AS ValorUF, Codigo, Descripcion, Conexion, FechaUltimoCobro\n FROM\n servicios \n WHERE\n Rut = '\".$RUT.\"' \n AND EstatusFacturacion = 0 \n AND (EstatusServicio = 1 OR EstatusServicio = 5) \";\n $Servicios = $run->select($query);\n $array = array();\n // echo \"<pre>\"; print_r($Servicios); echo \"</pre>\"; exit;\n if($Servicios){\n foreach($Servicios as $servicio){\n $data['IdServicio'] = $servicio['Id'];\n $data['TipoFactura'] = $servicio['TipoFactura'];\n $data['ValorUF'] = $servicio['ValorUF'];\n $data['Codigo'] = $servicio['Codigo'];\n \n if($servicio['Descripcion']){\n if($servicio['Conexion']){\n $data['Descripcion'] = $servicio['Descripcion'] . ' - ' . $servicio['Conexion'];\n }else{\n $data['Descripcion'] = $servicio['Descripcion'];\n }\n }else{\n $data['Descripcion'] = $servicio['Conexion'];\n }\n \n $data['FechaUltimoCobro'] = $servicio['FechaUltimoCobro'];\n array_push($array,$data);\n }\n\n $response_array['array'] = $array;\n\n echo json_encode($response_array);\n }else{\n $response_array['array'] = $array;\n \n echo json_encode($response_array);\n }\n }", "public function run()\n {\n foreach ($this->data as $row) {\n Container::create([\n 'code' => $row[0],\n 'name' => $row[1],\n 'large' => $row[2],\n 'width' => $row[3],\n 'height' => $row[4],\n 'unidad' => $row[5],\n 'large_door' => $row[6],\n 'widht_door' => $row[7],\n 'cube_capacity' => $row[8],\n 'max_weight' => $row[9],\n 'info' => $row[10]\n ]);\n }\n }", "function getData($svc){\n\t\tglobal $db_defaultdb;\n\t\t$items = dbSelect(\"SELECT iddata, data FROM `\".$db_defaultdb.\"`.`infobox_data` where context=?\", array($svc));\n\t\tif (dbIsNotEmpty($items)){\n\t\t\treturn json_decode(dbGetColumnValueFromRow1($items, 'data'), true);\n\t\t} else {\n\t\t\treturn array();\n\t\t}\n\t}", "function get_number_list($iteracion, $cantidad) {\n try {\n \t if ($iteracion==1) {\n \t $get_numberL_list = new SoapClient($this->wsdl_url_DID);\n $get_numberL_list->__setSoapHeaders($this->auth_info);\n $this->get_numberL_list = $get_numberL_list;\n }\n \n // Se extraen como maximo los primeros 100 Nros\n // dado que al intentar sacar mas se obtiene error del SOAP\n $GetNumberLList_info = array('offset' => ($cantidad==0 ? 0 : (100*$cantidad)), \n 'limit' => 100);\n \n if ($GetNumberLList_info) {\n if ($iteracion==1) {\n $GetNumberLList_response = $get_numberL_list->get_number_list($GetNumberLList_info);\n } else {\n $GetNumberLList_response = $this->get_numberL_list->get_number_list($GetNumberLList_info);\n }\n \n if ($GetNumberLList_response->number_list) {\n $this->number_list = $GetNumberLList_response->number_list;\n return $resp = true;\n } else {\n \t $this->number_list = \"\";\n return $resp = false;\n }\n } else {\n return $resp = false;\n }\n } catch (SoapFault $exception) { }\n }", "function home_categoriesthumbdata($pagenum,$dataLimit)\n {\n return $this->get_categoriesthumdata($pagenum,$dataLimit);\n }", "public function getFees(){\n $command = new Command($this->host, self::BLOCKS_GET_FEES,\"GET\", $this->enableCache, $this->cacheLifetime, $this->cacheFolder);\n $command->execute();\n\n // Converting all fees to float\n $data = $command->getData(\"fees\");\n foreach($data as $key => $value){\n $data[$key] = $this->convertAmountToFloat($value);\n }\n\n return $data;\n }", "function _getContainersByTplCfg($idtplcfg)\n\t{\n\t\t$sql = \"\n\t\t\tSELECT\n\t\t\t\tnumber, container\n\t\t\tFROM \".$this->cfg['tab']['container_conf'].\"\n\t\t\t\tWHERE idtplcfg='\".Contenido_Security::toInteger($idtplcfg).\"'\n\t\t\tORDER BY\n\t\t\t\tnumber ASC\";\n\t\t$this->db->query($sql);\n\t\t\n\t\tif ($this->db->nf() == 0)\n\t\t{ //nothing found\n\t\t\treturn false;\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//get all results\n\t\t\twhile ($this->db->next_record())\n\t\t\t{\n\t\t\t\t$this->data[$this->db->f(\"number\")] = $this->db->f(\"container\");\n\t\t\t}\n\t\t\t\n\t\t\t//return data array\n\t\t\treturn $this->data;\n\t\t}\n\t}", "public function addStorageCharges($containers)\n\t{\n\t\t$ctn = [];\n\n\t\t$fees = json_decode($this->feeRepository->getStorageFee(), true);\n\n\t\tforeach($containers as $container){\n\n\t\t\t$storage_charges = 0;\n\n\t\t\tif($container->days_empty > 5) {\n\t\t\t\t$storage_charges = ($container->days_empty - 5) * $fees[$container->size];\n\t\t\t}\n\n\t\t\t$container->storage_charges = $storage_charges;\n\t\t\t$this->totalStorageCharges += $storage_charges;\n\n\t\t\t$ctn[] = $container;\n\t\t}\n\n\t\treturn $ctn;\n\t}", "function data($number,$offset){\n\n\t\treturn $query = $this->db->get('t_produk',$number,$offset)->result_array(); \n\n\t}", "function obtener_CAE($cuit,$tipo_cbte,$pto_vta,$cbte,$imp_total,$imp_tot_conc,$imp_neto,$neto_21,$neto_105,$ImpTrib,$imp_op_ex,$fecha_cbte,$FchVencPago,$impIVA,$impALICUOTA,$FchServDesde,$FchServHasta,$Concepto)\n{\n\n$cmp=array();\n\n$cmp['Concepto']=$Concepto; //1 producto 2 servicios 3 productos y servicios\n$cmp['DocTipo']=80;\n$cmp['DocNro']=$cuit;\n$cmp['CbteDesde']=$cbte;\n$cmp['CbteHasta']=$cbte;\n$cmp['CbteFch']=$fecha_cbte;\n$cmp['ImpTotal']=$imp_total;\n$cmp['ImpTotConc']=$imp_tot_conc;\n$cmp['ImpNeto']=$imp_neto;\n$cmp['ImpOpEx']=$imp_op_ex;\n$cmp['ImpTrib']=$impALICUOTA;\n$cmp['ImpIVA']=($tipo_cbte==11)?0:$impIVA;\n$cmp['FchServDesde']=$FchServDesde; //Fecha de inicio del abono para el servicio a facturar. Dato obligatorio para concepto 2 o 3 (Servicios / Productos y Servicios). Formato yyyymmdd\n$cmp['FchServHasta']=$FchServHasta;\n$cmp['FchVtoPago']=$FchVencPago; //Fecha de vencimiento del pago servicio a facturar. Dato obligatorio para concepto 2 o 3 (Servicios / Productos y Servicios). Formato yyyymmdd. Debe ser igual o posterior a la fecha delcomprobante\n$cmp['FchVtoPago']='';\n$cmp['MonId']='PES';\n$cmp['MonCotiz']=1;\n\n\nif($impIVA>0 && !($tipo_cbte==2 && $tipo_cbte==3 && $tipo_cbte==7 && $tipo_cbte==8 && $tipo_cbte==11 && $tipo_cbte==12 && $tipo_cbte==13 && $tipo_cbte==15)){\n/*Aca entran facturas A y B*/\n$arrAli=array();\n$arrAli['AlicIva']=array();\n$arrTributos['Tributo']=array();\nif($impALICUOTA>0)\n{\n/*<IvaTipo><Id>3</Id><Desc>0%</Desc><FchDesde>20090220</FchDesde><FchHasta>NULL</FchHasta></IvaTipo><IvaTipo><Id>4</Id><Desc>10.5%</Desc><FchDesde>20090220</FchDesde><FchHasta>NULL</FchHasta></IvaTipo><IvaTipo><Id>5</Id><Desc>21%</Desc><FchDesde>20090220</FchDesde><FchHasta>NULL</FchHasta></IvaTipo><IvaTipo><Id>6</Id><Desc>27%</Desc><FchDesde>20090220</FchDesde><FchHasta>NULL</FchHasta></IvaTipo><IvaTipo><Id>8</Id><Desc>5%</Desc><FchDesde>20141020</FchDesde><FchHasta>NULL</FchHasta></IvaTipo><IvaTipo><Id>9</Id><Desc>2.5%</Desc><FchDesde>20141020</FchDesde><FchHasta>NULL</FchHasta></IvaTipo>*/\n\n $tributo=array();\n\n $tributo['Id']=99; //99->otros impuestos\n $tributo['Desc']='Impuesto provincial';\n $tributo['BaseImp']=3000;\n $tributo['Alic']=2;\n $tributo['Importe']=$impALICUOTA;\n $arrTributos['Tributo'][]=$tributo;\n\n $cmp['Tributos']=$arrTributos; \n}\n\n // echo $imp_neto.\" = \".$imp105.\"+\".$imp21;\n\n\n\n if($neto_21>0)\n { \n $arr21=array();\n $arr21['Id']=5; //->21%\n $arr21['BaseImp']=$neto_21;\n $arr21['Importe']=round($neto_21*0.21,2);\n $arrAli['AlicIva'][]=$arr21;\n \n }\n if($neto_105>0)\n { \n $arr105=array();\n $arr105['Id']=4; //->10.5%\n $arr105['BaseImp']=$neto_105;\n $arr105['Importe']=round($neto_105*0.105,2);\n $arrAli['AlicIva'][]=$arr105; \n }\n\nif($tipo_cbte!=6){ $cmp['Iva']=$arrAli; } #Solo Si es Factura A\n\n/*<AlicIva>\n <Id>5</Id> --> 21%\n <BaseImp>100</BaseImp>\n<Importe>21</Importe>\n </AlicIva>\n<AlicIva>\n <Id>4</Id> --> 10.5%\n <BaseImp>50</BaseImp>\n <Importe>5.25</Importe>\n </AlicIva>*/\n \n//$cmp['Iva']=$arrAli;\n\n/*\n if($impALICUOTA>0){\n\n // <Tributos>\n // <Tributo>\n // <Id>99</Id>\n // <Desc>Impuesto Municipal Matanza</Desc>\n // <BaseImp>150</BaseImp>\n // <Alic>5.2</Alic>\n // <Importe>7.8</Importe>\n // </Tributo>\n // </Tributos>\n\n $idALIC='';\n $descALIC='';\n $BaseImpALIC='';\n $alicALIC='';\n $impALIC='';\n \n\n $arrTrib['ImpTrib']=array();\n\n $arrTrib['ImpTrib']['Id']=$idALIC;\n $arrTrib['ImpTrib']['Desc']=$descALIC;\n $arrTrib['ImpTrib']['BaseImp']=$BaseImpALIC;\n $arrTrib['ImpTrib']['Alic']=$alicALIC; \n $arrTrib['ImpTrib']['Importe']=$impALIC;\n\n $cmp['Tributos']['Tributo']=$arrTrib; \n }*/\n\n\n}\n\n//si es factura B no discrimina IVA\n if($tipo_cbte==6 || $tipo_cbte==8)\n {\n $cmp['ImpNeto']=0;\n $cmp['ImpTotConc']=$imp_neto;\n $cmp['ImpIVA']=0;\n }\n //si es factura C o recibo C\n if($tipo_cbte==11 || $tipo_cbte==13 || $tipo_cbte==15)\n {\n if($imp_total<1000){\n $cmp['DocTipo']=99;\n $cmp['DocNro']=0;\n }\n $cmp['ImpOpEx']=0;\n $cmp['ImpTotConc']=0;\n $cmp['ImpIVA']=0;\n }\n \n//$cmp['CbtesAsoc']=array();\n//$cmp['Tributos']='';\n//if($tipo_cbte==6 || $tipo_cbte==8) $cmp['Iva']=''; \n/*\nArray para informar las alícuotas y sus importes asociados a un comprobante <AlicIva>. \nPara comprobantes tipo C y Bienes Usados – Emisor Monotributista no debe informar el array.N \n*/\n//$cmp['Opcionales']=array();\n\n\n //echo \"fecha pago:\".$cmp['FchVtoPago'];\n\n // echo \"ImpTotal\".$cmp['ImpTotal'].\", debe ser igual a la suma de ImpTotConc\".$cmp['ImpTotConc'].\"+ ImpNeto\".$cmp['ImpNeto'].\" + ImpOpEx\".$cmp['ImpOpEx'].\" + ImpTrib\".$cmp['ImpTrib'].\" + ImpIVA.\".$cmp['ImpIVA'];\n // var_dump($cmp);\n // die();\n\n $this->reg_respuesta=array(); \n $this->logPedidoCAERegistro=array();\n $this->logPedidoCAE=array();\n \n\n if(!$this->cargar_TA())\n {\n return false;\n }\n \n if($this->TA_expirado())\n {if(!$this->obtener_TA())\n {\n return false;\n }\n //en caso de que haya traido el TA, q lo vuelva a cargar a las clase para poder tomar sus datos\n if(!$this->cargar_TA())\n {\n return false;\n }\n \n }\n\n $cant_reg=1;\n $results=$this->client_wsfe->FECAESolicitar(\n array('Auth' => array('Token' => $this->token,'Sign' => $this->sign,'Cuit' => $this->cuit),\n 'FeCAEReq' => array('FeCabReq' => array('CantReg' => $cant_reg,'PtoVta' => $pto_vta,'CbteTipo'=>$tipo_cbte),\n 'FeDetReq' => array('FECAEDetRequest' =>$cmp))\n ));\n //print_r($results);\n $this->CheckErrors($results,'FECAESolicitar');\n \n if ( $results->FECAESolicitarResult->Errors->Err->Code != 0 )\n {\n\n $this->descError=\" MENSAJE DEL WEBSERVICE AFIP: Percode: \".$results->FECAESolicitarResult->Errors->Err->Code.\"\\nPerrmsg: \".$results->FECAESolicitarResult->Errors->Err->Msg.\"\\n\";\n return false;\n }\n \n//consulto por la cabecera\n if($results->FECAESolicitarResult->FeCabResp->Resultado ==\"R\")\n {\n $arrComp=array();\n $arrComp['cuit']=$results->FECAESolicitarResult->FeCabResp->Cuit;\n $arrComp['PtoVta']=$results->FECAESolicitarResult->FeCabResp->PtoVta;\n $arrComp['CbteTipo']=$results->FECAESolicitarResult->FeCabResp->CbteTipo;\n $arrComp['FchProceso']=$results->FECAESolicitarResult->FeCabResp->FchProceso;\n $arrComp['CantReg']=$results->FECAESolicitarResult->FeCabResp->CantReg;\n $arrComp['Resultado']=$results->FECAESolicitarResult->FeCabResp->Resultado;\n $arrComp['Reproceso']=$results->FECAESolicitarResult->FeCabResp->Reproceso;\n $this->logPedidoCAE[]=$arrComp;\n\n $comp=$results->FECAESolicitarResult->FeDetResp->FEDetResponse;\n $arrResp=array();\n \n $arrResp['Concepto']=$comp->Concepto;\n $arrResp['FchProceso']=$results->FECAESolicitarResult->FeCabResp->FchProceso;\n $arrResp['DocTipo']=$comp->DocTipo;\n $arrResp['DocNro']=$comp->DocNro;\n $arrResp['CbteDesde']=$comp->CbteDesde;\n $arrResp['CbteHasta']=$comp->CbteHasta;\n $arrResp['Resultado']=$comp->Resultado;\n $arrResp['CAE']=$comp->CAE;\n $arrResp['CbteFch']=$comp->CbteFch;\n $arrResp['CAEFchVto']=$comp->CAEFchVto;\n $arrResp['Obs']=$comp->Obs->Observaciones;\n $this->logPedidoCAERegistro=$arrResp;\n \n \n return false;\n }//fin del if que analiza errores cuando el resultado del envio arrojo R\nelse \n { \n $comp=$results->FECAESolicitarResult->FeDetResp->FECAEDetResponse;\n $arrResp=array();\n $arrResp['Concepto']=$comp->Concepto;\n $arrResp['FchProceso']=$results->FECAESolicitarResult->FeCabResp->FchProceso;\n $arrResp['DocTipo']=$comp->DocTipo;\n $arrResp['DocNro']=$comp->DocNro;\n $arrResp['CbteDesde']=$comp->CbteDesde;\n $arrResp['CbteHasta']=$comp->CbteHasta;\n $arrResp['Resultado']=$comp->Resultado;\n $arrResp['CAE']=$comp->CAE;\n $arrResp['CbteFch']=$comp->CbteFch;\n $arrResp['CAEFchVto']=$comp->CAEFchVto;\n \n $this->reg_respuesta[]=$arrResp;\n \n return true;\n }//fin del if\n \n return false;\n\n\n}", "public function getAllNumberFacturesFournisseurCurrent()\n\t\t{\n\t\t\t$this->Sql = \"SELECT COUNT(fa.idt_factures_achats) AS nb_factures , fa.date_facture, fo.nom_fournisseur\n\t\t\t\t\t\t\tFROM t_fournisseurs AS fo\n\t\t\t\t\t\t\tLEFT JOIN t_factures_achats AS fa ON fa.id_fournisseur = fo.idt_fournisseurs\n\t\t\t\t\t\t\tGROUP BY fo.idt_fournisseurs\";\n\t\t\t$res = $this->FetchAllRows();\n\t\t\treturn $res;\n\t\t}", "function product_getImage($item_number, $key) {\n $result = performApiRequest($key, 0, 'GET', 'bild;WHERE `artikelnummer`=' . $item_number);\n if (sizeof($result) > 0) {\n return $result[0]->bild;\n } else {\n return null;\n }\n}", "public function getBiocStatisTics($application)\n {\n\n\tif( strcmp($application,\"pathview\") == 0)\n {\n\n\t $bioc_vals = DB::select(DB::raw('select concat(concat(month,\\'-\\'),year) as date,number_of_unique_ip as ip_add,number_of_downloads as downloads from biocStatistics'));\n\t\t}\n\t\telse{\n\t\t $bioc_vals = DB::select(DB::raw('select concat(concat(month,\\'-\\'),year) as date,numberof_uniqueip as ip_add,numberof_downloads as downloads from biocGagestatistic'));\n\n\t\t\t}\n $lib_usage = array();\n //fill the array lists with usage objects\n foreach ($bioc_vals as $bioc_val )\n array_push($lib_usage,new Usage(date('Y-m-d',strtotime($bioc_val->date)),$bioc_val->ip_add,$bioc_val->downloads));\n usort($lib_usage , function($a,$b){\n return $a->getDate() > $b->getDate();\n });\n\n //return last 6 records\n\n if(sizeof($lib_usage) > 6)\n return array_slice($lib_usage, -6, 6, true);\n else\n return $lib_usage;\n }" ]
[ "0.6172426", "0.5967732", "0.52689195", "0.51345474", "0.51189333", "0.50517166", "0.50220084", "0.50064176", "0.4990072", "0.4920872", "0.49064317", "0.48988464", "0.48615813", "0.48387605", "0.48199883", "0.48079216", "0.4805638", "0.47491267", "0.47446448", "0.47396636", "0.47204837", "0.47106972", "0.4651365", "0.4649418", "0.46454185", "0.46429333", "0.46350288", "0.4632642", "0.46257982", "0.4622255" ]
0.6509671
0
this function is for getting data Feet by container number
public function get_feet_by_number(Request $request) { $date = date("Y-m-d H:i:s A"); $call_api_con = $this->call_api_by_parameter("webGetFeetByContainerNumber", ["ContainerNumber" => $request->container_number]); if ($call_api_con) { $deconde_json = json_decode($call_api_con); if ($deconde_json->id) { return response()->json([ 'id' => $deconde_json->id, 'data' => $deconde_json->data[0] ]); } return response()->json([ 'id' => 0 ]); } return response()->json([ 'error' => "You are losing your connection" ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GetFeet(Request $request)\r\n {\r\n\r\n $k = 0;\r\n\r\n $date = date(\"Y-m-d H:i:s A\");\r\n $destination_id = \"\";\r\n $call_api_con = $this->call_api_by_parameter(\"webGetFeetByContainer\", [\"ContainerID\" => $request->container_id]);\r\n if (count($request->destination_id) > 0) {\r\n foreach ($request->destination_id as $data_destination) {\r\n $k++;\r\n $coma = \",\";\r\n if (count($request->destination_id) == $k) {\r\n $coma = \"\";\r\n }\r\n\r\n $destination_id .= $data_destination . $coma;\r\n }\r\n }\r\n $con_exist = $this->call_api_by_parameter(\"webGetContainerExist\",\r\n [\r\n \"ContainerID\" => $request->container_id,\r\n \"DestinationID\" => $destination_id,\r\n 'DateTime' => $date\r\n ]\r\n );\r\n\r\n if ($call_api_con) {\r\n\r\n $deconde_json = json_decode($call_api_con);\r\n $con_decode = json_decode($con_exist);\r\n\r\n if ($deconde_json->id) {\r\n\r\n $ticket_id = '';\r\n $ticket_number = '';\r\n\r\n if ($con_decode->id) {\r\n $ticket_id = $con_decode->data[0]->ID;\r\n $ticket_number = $con_decode->data[0]->TicketNumber;\r\n }\r\n\r\n return response()->json([\r\n 'id' => $deconde_json->id,\r\n 'data' => $deconde_json->data[0],\r\n 'id_con' => $con_decode->id,\r\n 'ticket_id' => $ticket_id,\r\n 'ticket_number' => $ticket_number\r\n ]);\r\n }\r\n return response()->json([\r\n 'id' => 0\r\n ]);\r\n }\r\n return response()->json([\r\n 'error' => \"You are losing your connection\"\r\n ]);\r\n }", "public static function readIfbaContainerData(){\r\n /* Get entity query object for entity type 'node' */\r\n $query = \\Drupal::entityQuery('node');\r\n\r\n /*Use query object with condition filters to execute query and return node ids array*/\r\n $node_ids = $query->condition('type',IFBATypes::IFBA_ARCHIVE_CONTAINER)\r\n ->condition('status',1)\r\n ->execute();\r\n\r\n /*Pass node ids array into loadMultiple to return all associated data/nodes*/\r\n $nodes_result = Node::loadMultiple($node_ids);\r\n\r\n return $nodes_result;\r\n }", "public static function readIfbaSampleData($container_id){\r\n /* Get entity query object for entity type 'node' */\r\n $query = \\Drupal::entityQuery('node');\r\n\r\n $node_ids = [];\r\n\r\n /* Use query object with condition filters to execute query and return node ids array */\r\n if($container_id===0) {\r\n $node_ids = $query->condition('type',IFBATypes::IRISH_FISHERIES_BIOCHRONOLOGY_ARCHIVE)\r\n ->condition('status', 1)\r\n ->execute();\r\n }else{\r\n $node_ids = $query->condition('type', IFBATypes::IRISH_FISHERIES_BIOCHRONOLOGY_ARCHIVE)\r\n ->condition('field_contained_in',$container_id)\r\n ->condition('status', 1)\r\n ->execute();\r\n }\r\n /* Pass node ids array into loadMultiple to return all associated data/nodes */\r\n $nodes_result = Node::loadMultiple($node_ids);\r\n\r\n return $nodes_result;\r\n }", "function listaFacturas2()\n\t{\n\t\t$lista = $this->AlmacenModel->listaFacturas($_POST);\n\t\t$logo = $this->AlmacenModel->logo();\n\t\t$datos = array(); \n\t\t$cont = 0;\n\t\t$total_final = 0;\n\t\twhile($l = $lista->fetch_assoc())\n\t\t{\n\t\t\t$ok = 1;\n\t\t\tif(intval($l['asig']))\n\t\t\t{\n\t\t\t\t//$ok = $this->AlmacenModel->asig($l['uuid']);\n\t\t\t\t$ok = 0;\n\t\t\t\tif($archivo = glob($this->path().\"xmls/facturas/[1-9]*/*\".$l['uuid'].\".xml\",GLOB_NOSORT))\n\t\t\t\t\t$ok = 1;\n\t\t\t\t\n\t\t\t}\n\t\t\tif(intval($ok))\n\t\t\t{\n\t\t\t\t$cont++;\n\t\t\t\t\n\t\t\t\t$l['json'] = str_replace(\"\\\\\", \"\", $l['json']);\n\t\t\t\t$json = json_decode($l['json']);\n\t\t\t\t$json = $this->object_to_array($json);\n\t\t\t\t$dir = '';\n\t\t\t\t$subtotal = $ivas = 0;\n\t\t\t\t$total_final += $l['importe'];\n\n\t\t\t\tif($l['version'] == '3.2')\n\t\t\t\t{\n\t\t\t\t\t$subtotal = $json['Comprobante']['@subTotal'];\n\t\t\t\t\t$pago = $json['Comprobante']['@metodoDePago'];\n\t\t\t\t\t$metodo = $json['Comprobante']['@formaDePago'];\n\t\t\t\t\t\n\t\t\t\t\tif(strpos($metodo,'exhi') !== FALSE || strpos($metodo,'EXHI') !== FALSE)\n\t\t\t\t\t\t$metodo = \"PAGO EN UNA EXHIBICION\";\n\t\t\t\t\tif(strpos($metodo,'parcial') !== FALSE || strpos($metodo,'PARCIAL') !== FALSE)\n\t\t\t\t\t\t$metodo = \"PAGO EN PARCIALIDADES\";\n\n\t\t\t\t\t$ivas = $json['Comprobante']['cfdi:Impuestos']['@totalImpuestosTrasladados'];\n\t\t\t\t\t//Extraemos el domicilio del emisor\n\t\t\t\t\t$domicilio_emisor = $json['Comprobante']['cfdi:Emisor']['cfdi:DomicilioFiscal'];\n\t\t\t\t\t$dom_emisor = '';\n\t\t\t\t\tforeach ($domicilio_emisor as $campo => $valor) {\n\t\t\t\t\t\t$dom_emisor .= $valor.\" \";\n\t\t\t\t\t}\n\t\t\t\t\t//Extraemos el domicilio del receptor\n\t\t\t\t\t$domicilio_receptor = $json['Comprobante']['cfdi:Receptor']['cfdi:Domicilio'];\n\t\t\t\t\t$dom_receptor = '';\n\t\t\t\t\tforeach ($domicilio_receptor as $campo => $valor) {\n\t\t\t\t\t\t$dom_receptor .= $valor.\" \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$subtotal = $json['Comprobante']['@SubTotal'];\n\t\t\t\t\t$pago = $json['Comprobante']['@FormaPago'];\n\t\t\t\t\t$metodo = $json['Comprobante']['@MetodoPago'];\n\t\t\t\t\t$ivas = $json['Comprobante']['cfdi:Impuestos']['@TotalImpuestosTrasladados'];\n\t\t\t\t}\t\n\n\t\t\t\t$tieneRelacionPagos = \"\";\n\t\t\t\tif(strpos($metodo,'PARCIAL') !== FALSE || strpos($metodo,'PPD') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$tieneRelacionPagos = \"<br /><i style='opacity: 0.01;font-size:11px;'>*Si tiene pagos</i>\";\n\t\t\t\t\tif(!$this->AlmacenModel->tieneRelacionPagos($l['uuid']))\n\t\t\t\t\t\t$tieneRelacionPagos = \"<br /><i style='color:red;font-size:11px;'>*No tiene pagos</i>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$asignadas = '';\n\t\t\t\tif(intval($l['asig']))\n\t\t\t\t{\n\t\t\t\t\t$polizas = $this->AlmacenModel->polizasAsignadas($l['uuid']);\n\t\t\t\t\twhile($pol = $polizas->fetch_object())\n\t\t\t\t\t{\n\t\t\t\t\t\t$asignadas .= \"<a href='index.php?c=CaptPolizas&f=ModificarPoliza&id=$pol->id' target='_blank'>\".$pol->numpol.\" (\".$pol->idperiodo.\"-\".$pol->ejercicio.\")</a> \";\n\t\t\t\t\t\t$dir = \"$pol->id\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$asignadas = 'No Asignada';\n\t\t\t\t\t$dir = \"temporales\";\n\t\t\t\t}\n\n\t\t\t\tif(intval($_POST['asignadas']) == 3)\n\t\t\t\t\t$dir = \"canceladas\";\n\n\t\t\t\t$basename = '';\n\t\t\t\tif (strpos($l['xml'], '/') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$basename = explode(\"/\", $l['xml']);\n\t\t\t\t}\n\n\t\t\t\tif (!empty($basename[3])) {\n\t\t\t\t\t$l['xml'] = $basename[3];\n\t\t\t\t}\n\n\t\t\t\tarray_push($datos,array(\n\t\t 'fecha' => utf8_encode($l['fecha']),\n\t\t 'rfc' => utf8_encode($l['rfc']),\n\t\t 'emisor' => utf8_encode($l['emisor']),\n\t\t 'receptor' => utf8_encode($l['receptor']),\n\t\t 'links' => \"<a href='xmls/facturas/$dir/\".$l['xml'].\"' target='_blank'><i class='material-icons preview' data-toggle='tooltip' data-placement='top' title='Visualizar'>remove_red_eye</i></a><a href='controllers/visorpdf.php?name=\".$l['xml'].\"&logo=$logo&id=$dir' target='_blank'><i class='material-icons preview' data-toggle='tooltip' data-placement='top' title='Ver PDF'>picture_as_pdf</i></a>\",\n\t\t 'tipo' => utf8_encode($l['tipo']),\n\t\t 'pago' => $pago,\n\t\t 'metodo' => $metodo.\" \".$tieneRelacionPagos,\n\t\t 'moneda' => $l['moneda'],\n\t\t 'subtotal' => number_format($subtotal,2),\n\t\t 'ivas' => number_format($ivas,2),\n\t\t 'total' => $l['importe'],\n\t\t 'serie' => $l['serie'],\n\t\t 'folio' => $l['folio'],\n\t\t 'uuid' => $l['uuid'],\n\t\t 'fecha_sub' => utf8_encode($l['fecha_subida']),\n\t\t 'version' => $l['version'],\n\t\t 'estatus' => $asignadas,\n\t\t 'check' => \"<input type='checkbox' idfac='\".$l['id'].\"' xml='\".\"xmls/facturas/\".$dir.\"/\".$l['xml'].\"'>\",\n\t\t 'domicilio_emisor' => $dom_emisor,\n\t\t 'domicilio_receptor' => $dom_receptor,\n\t\t 'basename'=>$basename));\n\t\t\t}\n\t\t}\n\t\tarray_push($datos, array('total_final' => $total_final));\n\t\t//Pinta aqui el json para la vista\n\t\techo json_encode($datos);\n\t}", "private function getBusinessFaxContainer(){\r\n $aVars = array(\r\n 'business_fax' => $this->hasBusinessFaxNumber() ? \r\n _t('_emmetbytes_club_cover_business_fax_caption', $this->clubDatas['businessfax'])\r\n : _t('_emmetbytes_club_cover_business_fax_caption', _t('_emmetbytes_club_cover_not_available_caption')),\r\n );\r\n return $this->_oTemplate->parseHTMLByName('ebytes_club_cover_business_fax_container', $aVars);\r\n }", "private function getClubFoodServiceContainer(){\r\n $aVars = array(\r\n 'club_food_service' => $this->hasClubFoodService() ? \r\n _t('_emmetbytes_club_cover_club_food_service_caption', $this->clubDatas['food_service'])\r\n : _t('_emmetbytes_club_cover_club_food_service_caption', _t('_emmetbytes_club_cover_not_available_caption')),\r\n );\r\n return $this->_oTemplate->parseHTMLByName('ebytes_club_cover_club_food_service_container', $aVars);\r\n }", "public function page_data_fetch(){\n\n $page = new page();\n $pages = $page->get_pages();\n $page_data = array();\n $page_data[\"pages\"] = $pages;\n foreach($pages as $pge) {\n //now we fetch the containers\n $container = new Container();\n $page_data[\"containers\"][$pge->name] = $container->get_containers($pge->name);\n }\n return $page_data;\n }", "public function data_fetch_and_display()\n {\n require './vendor/autoload.php';\n $client = new GuzzleHttp\\Client();\n $data = $client->request('GET',$this->url);\n // echo $data->getStatusCode();\n \n $body = $data->getBody();\n\n $json_data = json_decode($body);\n \n $index = 0; //using for each data indexing in the output\n echo \"<div class='container'>\";\n foreach($json_data->data as $key=>$value){ \n $index +=1;\n echo \"<div class='blocks'>\";\n echo \"<div>\";\n echo \"<div class='heading'>\";\n echo \"<span class='index'>\".($index).\"</span>\";\n echo \"<h3 class='head'> \".$json_data->data[$key]->attributes->title.\"</h3>\";\n echo \"</div>\";\n print_r($json_data->data[$key]->attributes->body->summary);\n if($json_data->data[$key]->attributes->field_services->value != null)\n echo $json_data->data[$key]->attributes->field_services->value;\n echo \"</div>\";\n $url = $json_data->data[$key]->relationships->field_image->links->related->href;\n $data1 = $client->request('GET',$url);\n $body2 = $data1->getBody();\n $json_data2 = json_decode($body2);\n $img_src = \"https://ir-revamp-dev.innoraft-sites.com\".$json_data2->data->attributes->uri->url; \n echo \"<img src= '$img_src'></br>\";\n echo \"</div>\";\n }\n echo \"</div>\";\n }", "private function getContainers($data){\n\t\t\tif(preg_match('/\\x00\\x13controllerStructure\\x00\\x0D/Us', $data)){\n\t\t\t\treturn \"noInventory\";\n\t\t\t}\n\n\t\t\tpreg_match('/(?:\\x00\\x09inventory)(.+)(?:\\x00\\x08shipMan0)/Us', $data, $matches);\n\t\t\t$str = chr(0).chr(9).\"inventory\".chr(3);\n\t\t\t$inventory = explode($str , $matches[1]);\n\t\t\t$return = array();\n\t\t\tfor($i = 0; $i < count($inventory); $i++){\n\t\t\t\t$arr = explode(\"\\x0D\\x00\",$inventory[$i]);\n\t\t\t\t$index1 = explode(\"index\", $arr[0]);\n\t\t\t\t$index1 = str_split($index1[1], 4);\n\t\t\t\t$pos = array(\n\t\t\t\t\t'x' => binInt32($index1[0]),\n\t\t\t\t\t'y' => binInt32($index1[1]),\n\t\t\t\t\t'z' => binInt32($index1[2])\n\t\t\t\t);\n\t\t\t\t$arr[1] = substr($arr[1], 19);\n\t\t\t\t$slotsSplit = explode(\"\\x0C\\x00\\x05types\\x02\\x00\\x00\", $arr[1]);\n\t\t\t\t$slotsList = str_split($slotsSplit[0], 4);\n\t\t\t\t$slotsUsed = count($slotsList) - 1;\n\t\t\t\t$slotsArr = array();\n\t\t\t\t\n\t\t\t\t$blocksList = str_split($slotsSplit[1], 2);\n\t\t\t\t$arr[2] = substr($arr[2],7);\n\t\t\t\t$valueList = explode(chr(253), $arr[2]);\n\t\t\t\t$valueList = array_slice($valueList, 1);\n\t\t\t\tif(count($valueList)){\n\t\t\t\t\t$valueList[$slotsUsed -1] = substr($valueList[$slotsUsed -1], 0, 4);\n\t\t\t\t}\n\t\t\t\tfor($j = 0; $j < $slotsUsed; $j++){\n\t\t\t\t\t$blockId = $blocksList[$j];\n\t\t\t\t\t$slotsArr[binInt32($slotsList[$j])] = array (\n\t\t\t\t\t\t'block' => binInt16($blockId),\n\t\t\t\t\t\t'qty' => binInt32($valueList[$j])\n\t\t\t\t\t);\n\t\t\t\t\tvar_dump($valueList[$j]);\n\t\t\t\t}\n\t\t\t\t$return[$i] = array(\n\t\t\t\t\t'pos' => $pos,\n\t\t\t\t\t'slots' => $slotsArr\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $return;\n\t\t}", "abstract public function get_data();", "public function all_servicecontracts_to_map_view($servicenumber)\n {\n \t\t\t$rss = new DOMDocument(); \n\t\t\t$cust_code= $this->session->userdata('cust_code'); \n\t\t\t$email1=$this->session->userdata('email');\n\t\t\t$urlArray = array(array('name' => 'api', 'url' => 'http://216.234.105.194:8088/Alpha.svc/ServiceContractList/'.$cust_code.'/'.$servicenumber.'/ / /1000/1/End_date/desc/5434548B-9C59-451E-9673-1D462C11953B/E2795374-87A2-45DE-AD46-194D042B6213'),\n\t\t\t\t\t\t\t\t );\n\t\t\t\t\t foreach ($urlArray as $url) \n\t\t\t\t\t\t {\n\t\t\t\t\t\t echo\"<diffgr:diffgram xmlns:diffgr='urn:schemas-microsoft-com:xml-diffgram-v1' xmlns:msdata='urn:schemas-microsoft-com:xml-msdata'><DocumentElement xmlns=''>\";\n\t\t\t\t\t\t\t\t\t \n\t\t\t $rss->load($url['url']);\n\t\t\t\t\t\t\t\t\t foreach ($rss->getElementsByTagName('ServiceContractList') as $node)\n\t\t\t\t\t\t\t\t\t {\t\n\t\t\t\t\t\t\t\t\t \techo \"<contracts diffgr:id='contract1' msdata:rowOrder='0' diffgr:hasChanges='inserted'><description>\".$node->getElementsByTagName('description')->item(0)->nodeValue.\"</description><service_level>\".$node->getElementsByTagName('service_level')->item(0)->nodeValue.\"</service_level><contract_status>\".$node->getElementsByTagName('contract_status')->item(0)->nodeValue.\"</contract_status><location>\".$node->getElementsByTagName('location')->item(0)->nodeValue.\"</location><error>\".$node->getElementsByTagName('Error')->item(0)->nodeValue.\"</error></contracts>\";\t \n }\t\t\t\t\t\t \n\t\t\t\t\t\t\t echo \"</DocumentElement></diffgr:diffgram></DataTable>\";\n\t\t\t \n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\n \n }", "abstract function buildListDataContainers(): void;", "private function aaiFetchFidsData() {\n $db = DB::dbInstance();\n\n // include nusoap library\n $lib_pth = drupal_get_path('module', 'fids') . '/lib/nusoap.php';\n require_once($lib_pth);\n\n // get query batch size\n $batch_size = AAI_QRY_BATCH_SIZE;\n\n // fields for which data is fetched\n $fids_fields = array(\n 'LOCAL_AIRPORT',\n 'ARRIVAL_DEPARTURE_FLAG',\n 'INTERNATIONAL_DOMESTIC_FLAG',\n 'AIRLINE_CODE',\n 'FLIGHT_NUMBER',\n 'SOURCE_DESTINATION',\n 'VIA',\n 'VIA1',\n 'SCHED_DATE',\n 'SCHED_TIME',\n 'EST_DATE',\n 'EST_TIME',\n 'ACT_DATE',\n 'ACT_TIME',\n 'FLIGHT_STATUS',\n 'TERMINAL',\n 'GATES',\n 'COUNTERS',\n 'BELT_NUMBER',\n );\n\n // get table for fids data entry\n $fids_tbl = variable_get('aai_fids_active_table');\n if ($fids_tbl == 'aai_fids_data_1') {\n $blank_fids_tbl = 'aai_fids_data_2';\n } else {\n $blank_fids_tbl = 'aai_fids_data_1';\n }\n // truncate secondary table\n $db->dbTruncateQuery($blank_fids_tbl);\n\n // fields for data entry\n $flds_to_select = $fids_fields;\n $flds_to_select[] = 'DATEVAL';\n\n // get all url to get FIDS data from\n $fids_api_urls = unserialize(variable_get('fids_xml_feeds'));\n\n // set parameters for SOAP call\n $proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';\n $proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';\n $proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';\n $proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';\n\n // loop through all API's to fetch data\n $api_errors_counter = 0;\n foreach($fids_api_urls as $item) {\n $url = $item['feed_url'];\n $operation = $item['callback'];\n $res_type = $item['res_type'];\n\n // variable to check if data received from the API\n $data_not_fetched = 1;\n $data_available = 0;\n // variable to ascertain if secondary link used to get data\n $use_secondary_api_link = 0;\n\n do {\n // if 3 attempts to fetch data fails, try with alternate url if\n // available else send a mail to the admin about the problem\n // & continue with other API in list\n if ($data_not_fetched > 3) {\n if (isset($item['feed_url_sec']) && !$use_secondary_api_link) {\n $use_secondary_api_link = 1;\n $url = $item['feed_url_sec'];\n // reset counter for secondary api, to have 3 attempts\n $data_not_fetched = 1;\n } else {\n $airport = $item['name'];\n $msg = \"FIDS API error, failed to fetch data for '$airport' airport.\";\n if ($use_secondary_api_link) {\n $msg .= \" Both from primary & secondary links.\";\n }\n // send mail to aai-admin\n $this->aaiWatchdog($msg, WATCHDOG_ERROR);\n $data_not_fetched = 0;\n // track the api call failures\n $api_errors_counter++;\n break;\n }\n }\n $client = new nusoap_client($url, 'wsdl', $proxyhost, $proxyport, $proxyusername, $proxypassword);\n // set content encoding\n $client->soap_defencoding = 'UTF-8';\n\n $err = $client->getError();\n if ($err) {\n // iff error occurs, do watchdog entry and skip current iteration\n $this->aaiWatchdog(\"Constructor error, fetching details from $url \" . $err, WATCHDOG_ERROR);\n }\n\n // Doc/lit parameters get wrapped\n $param = array('Symbol' => 'IBM');\n $result = $client->call($operation, array('parameters' => $param), '', '', false, true);\n\n // Check for a fault\n if ($client->fault) {\n $this->aaiWatchdog(\"Constructor error, fetching details from $url \". $result, WATCHDOG_ERROR);\n } else {\n // Check for errors\n $err = $client->getError();\n if ($err) {\n $this->aaiWatchdog(\"Constructor error, fetching details from $url \". $err, WATCHDOG_ERROR);\n } else {\n // Fetch the result \n switch ($res_type) {\n case 1:\n $fids_data = $result['return'];\n $fids_data = (array) simplexml_load_string($fids_data);\n $fids_data = $fids_data['Detail_Movements'];\n break;\n case 2:\n $fids_data = $result['FlightFIDSResult']['NewDataSet']['Detail_Movements'];\n break;\n }\n $data_not_fetched = 0;\n $data_available = 1;\n }\n }\n\n // check if data retrieved from API\n if ($data_not_fetched) {\n $data_not_fetched++;\n }\n } while ($data_not_fetched);\n\n // process only if data is fetched\n if ($data_available) {\n $total_rec = count($fids_data);\n\n $full_batch_cycles = 0;\n $remaining_rec = $total_rec % $batch_size;\n if ($total_rec > $batch_size) {\n $full_batch_cycles = floor($total_rec / $batch_size);\n }\n\n $full_counter = 0;\n $values = array();\n if ($full_batch_cycles) {\n for ($batch_cycle = 1; $batch_cycle <= $full_batch_cycles; $batch_cycle++) {\n for ($i = 0; $i < $batch_size; $i++) {\n $v = $fids_data[$full_counter];\n if (is_array($v)) {\n $v = (object) $v;\n }\n\n foreach ($fids_fields as $fld) {\n if ($fld == 'EST_DATE' || $fld == 'ACT_DATE') {\n $tmp_dt = $v->$fld;\n if ($tmp_dt == '') {\n $val[$fld] = NULL;\n } else {\n $val[$fld] = $tmp_dt;\n }\n } else if ($fld == 'EST_TIME' || $fld == 'ACT_TIME' || $fld == 'FLIGHT_STATUS') {\n $tmp_time = $v->$fld;\n if ($tmp_time == '') {\n $val[$fld] = 0;\n } else {\n $val[$fld] = $tmp_time;\n }\n } else if ($fld == 'FLIGHT_NUMBER') {\n $tmp = $v->$fld;\n if (empty($tmp)) {\n $val[$fld] = 0;\n } else {\n $val[$fld] = $tmp;\n }\n } else {\n $val[$fld] = $v->$fld;\n }\n }\n $val['DATEVAL'] = time();\n $values[] = $val;\n $full_counter++;\n // if we have fetched batch size records then do record entry into log table\n if ($i == ($batch_size - 1)) {\n $db->dbInsertMultiple($blank_fids_tbl, $flds_to_select, $values);\n $values = array();\n }\n }\n }\n // do entry for the remaining records\n for (; $full_counter < $total_rec; ) {\n $v = $fids_data[$full_counter++];\n if (is_array($v)) {\n $v = (object) $v;\n }\n\n foreach ($fids_fields as $fld) {\n if ($fld == 'EST_DATE' || $fld == 'ACT_DATE') {\n $tmp_dt = $v->$fld;\n if ($tmp_dt == '') {\n $val[$fld] = NULL;\n } else {\n $val[$fld] = $tmp_dt;\n }\n } else if ($fld == 'EST_TIME' || $fld == 'ACT_TIME' || $fld == 'FLIGHT_STATUS') {\n $tmp_time = $v->$fld;\n if ($tmp_time == '') {\n $val[$fld] = 0;\n } else {\n $val[$fld] = $tmp_time;\n }\n } else {\n $val[$fld] = $v->$fld;\n }\n }\n $val['DATEVAL'] = time();\n $values[] = $val;\n }\n $db->dbInsertMultiple($blank_fids_tbl, $flds_to_select, $values);\n } else {\n $values = array();\n for (; $full_counter < $total_rec; ) {\n $v = $fids_data[$full_counter++];\n if (is_array($v)) {\n $v = (object) $v;\n }\n\n foreach ($fids_fields as $fld) {\n if ($fld == 'EST_DATE' || $fld == 'ACT_DATE') {\n $tmp_dt = $v->$fld;\n if ($tmp_dt == '') {\n $val[$fld] = NULL;\n } else {\n $val[$fld] = $tmp_dt;\n }\n } else if ($fld == 'EST_TIME' || $fld == 'ACT_TIME' || $fld == 'FLIGHT_STATUS') {\n $tmp_time = $v->$fld;\n if ($tmp_time == '') {\n $val[$fld] = 0;\n } else {\n $val[$fld] = $tmp_time;\n }\n } else {\n $val[$fld] = $v->$fld;\n }\n }\n $val['DATEVAL'] = time();\n $values[] = $val;\n }\n $db->dbInsertMultiple($blank_fids_tbl, $flds_to_select, $values);\n }\n }\n }\n\n return $api_errors_counter;\n }", "public function getConsultasFaq($fechainicio, $fechafin){\n $faq = filterFaq($this->conMongo, $fechainicio, $fechafin);\n $numeroFaq = [];\n $proveedores=0;\n $tarifas=0;\n $hojaDeVida=0;\n $proyectos=0;\n $convenios=0;\n $leyes=0;\n $usuarios=0;\n $alumbrado_Publico=0;\n $normatividad=0; \n $factura = 0;\n\n foreach ($faq as $key => $value) {\n $interaccion = $value->TIPOINTERACCION;\n \n if($interaccion=='proveedores'){\n\n $proveedores += 1;\n\n }else if($interaccion=='tarifas'){\n \n $tarifas += 1;\n\n }else if($interaccion=='hoja de vida'){\n \n $hojaDeVida += 1;\n \n }else if($interaccion=='proyectos'){\n\n $proyectos += 1; \n \n }else if($interaccion=='convenios'){\n\n $convenios += 1; \n \n }else if($interaccion=='leyes'){\n \n $leyes += 1;\n\n }else if($interaccion=='usuarios'){\n\n $usuarios += 1; \n \n }else if($interaccion=='alumbrado publico'){\n\n $alumbrado_Publico += 1; \n \n }else if($interaccion=='normatividad'){\n\n $normatividad += 1; \n \n }else if($interaccion=='factura'){\n\n $factura += 1; \n \n }\n }\n\n $numeroFaq[0] = $proveedores;\n $numeroFaq[1] = $tarifas;\n $numeroFaq[2] = $hojaDeVida;\n $numeroFaq[3] = $proyectos;\n $numeroFaq[4] = $convenios;\n $numeroFaq[5] = $leyes;\n $numeroFaq[6] = $usuarios;\n $numeroFaq[7] = $alumbrado_Publico;\n $numeroFaq[8] = $normatividad;\n $numeroFaq[9] = $factura;\n\n return $numeroFaq;\n\n }", "public function get_container20(): string\n {\n $containeres = $this->container;\n $cont = '';\n foreach ($containeres as $idx => $container) {\n if ($container->dimensao === '20') {\n if ($idx > 0)\n $cont .= \"/\";\n $cont .= $container->codigo;\n }\n }\n return $cont;\n }", "abstract public function getData($offset);", "private function getBusinessTelephoneContainer(){\r\n $aVars = array(\r\n 'business_telephone' => $this->hasBusinessPhoneNumber() ? \r\n _t('_emmetbytes_club_cover_business_telephone_caption', $this->clubDatas['businesstelephone'])\r\n : _t('_emmetbytes_club_cover_business_telephone_caption', _t('_emmetbytes_club_cover_not_available_caption')),\r\n );\r\n return $this->_oTemplate->parseHTMLByName('ebytes_club_cover_business_telephone_container', $aVars);\r\n }", "public function getServiciosFacturados($RUT){\n\n $run = new Method;\n //trae servicios activos del cliente\n $query = \" SELECT\n Id, TipoFactura, Valor AS ValorUF, Codigo, Descripcion, Conexion, FechaUltimoCobro\n FROM\n servicios \n WHERE\n Rut = '\".$RUT.\"' \n AND EstatusFacturacion = 0 \n AND (EstatusServicio = 1 OR EstatusServicio = 5) \";\n $Servicios = $run->select($query);\n $array = array();\n // echo \"<pre>\"; print_r($Servicios); echo \"</pre>\"; exit;\n if($Servicios){\n foreach($Servicios as $servicio){\n $data['IdServicio'] = $servicio['Id'];\n $data['TipoFactura'] = $servicio['TipoFactura'];\n $data['ValorUF'] = $servicio['ValorUF'];\n $data['Codigo'] = $servicio['Codigo'];\n \n if($servicio['Descripcion']){\n if($servicio['Conexion']){\n $data['Descripcion'] = $servicio['Descripcion'] . ' - ' . $servicio['Conexion'];\n }else{\n $data['Descripcion'] = $servicio['Descripcion'];\n }\n }else{\n $data['Descripcion'] = $servicio['Conexion'];\n }\n \n $data['FechaUltimoCobro'] = $servicio['FechaUltimoCobro'];\n array_push($array,$data);\n }\n\n $response_array['array'] = $array;\n\n echo json_encode($response_array);\n }else{\n $response_array['array'] = $array;\n \n echo json_encode($response_array);\n }\n }", "public function run()\n {\n foreach ($this->data as $row) {\n Container::create([\n 'code' => $row[0],\n 'name' => $row[1],\n 'large' => $row[2],\n 'width' => $row[3],\n 'height' => $row[4],\n 'unidad' => $row[5],\n 'large_door' => $row[6],\n 'widht_door' => $row[7],\n 'cube_capacity' => $row[8],\n 'max_weight' => $row[9],\n 'info' => $row[10]\n ]);\n }\n }", "function getData($svc){\n\t\tglobal $db_defaultdb;\n\t\t$items = dbSelect(\"SELECT iddata, data FROM `\".$db_defaultdb.\"`.`infobox_data` where context=?\", array($svc));\n\t\tif (dbIsNotEmpty($items)){\n\t\t\treturn json_decode(dbGetColumnValueFromRow1($items, 'data'), true);\n\t\t} else {\n\t\t\treturn array();\n\t\t}\n\t}", "function get_number_list($iteracion, $cantidad) {\n try {\n \t if ($iteracion==1) {\n \t $get_numberL_list = new SoapClient($this->wsdl_url_DID);\n $get_numberL_list->__setSoapHeaders($this->auth_info);\n $this->get_numberL_list = $get_numberL_list;\n }\n \n // Se extraen como maximo los primeros 100 Nros\n // dado que al intentar sacar mas se obtiene error del SOAP\n $GetNumberLList_info = array('offset' => ($cantidad==0 ? 0 : (100*$cantidad)), \n 'limit' => 100);\n \n if ($GetNumberLList_info) {\n if ($iteracion==1) {\n $GetNumberLList_response = $get_numberL_list->get_number_list($GetNumberLList_info);\n } else {\n $GetNumberLList_response = $this->get_numberL_list->get_number_list($GetNumberLList_info);\n }\n \n if ($GetNumberLList_response->number_list) {\n $this->number_list = $GetNumberLList_response->number_list;\n return $resp = true;\n } else {\n \t $this->number_list = \"\";\n return $resp = false;\n }\n } else {\n return $resp = false;\n }\n } catch (SoapFault $exception) { }\n }", "function home_categoriesthumbdata($pagenum,$dataLimit)\n {\n return $this->get_categoriesthumdata($pagenum,$dataLimit);\n }", "public function getFees(){\n $command = new Command($this->host, self::BLOCKS_GET_FEES,\"GET\", $this->enableCache, $this->cacheLifetime, $this->cacheFolder);\n $command->execute();\n\n // Converting all fees to float\n $data = $command->getData(\"fees\");\n foreach($data as $key => $value){\n $data[$key] = $this->convertAmountToFloat($value);\n }\n\n return $data;\n }", "function _getContainersByTplCfg($idtplcfg)\n\t{\n\t\t$sql = \"\n\t\t\tSELECT\n\t\t\t\tnumber, container\n\t\t\tFROM \".$this->cfg['tab']['container_conf'].\"\n\t\t\t\tWHERE idtplcfg='\".Contenido_Security::toInteger($idtplcfg).\"'\n\t\t\tORDER BY\n\t\t\t\tnumber ASC\";\n\t\t$this->db->query($sql);\n\t\t\n\t\tif ($this->db->nf() == 0)\n\t\t{ //nothing found\n\t\t\treturn false;\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//get all results\n\t\t\twhile ($this->db->next_record())\n\t\t\t{\n\t\t\t\t$this->data[$this->db->f(\"number\")] = $this->db->f(\"container\");\n\t\t\t}\n\t\t\t\n\t\t\t//return data array\n\t\t\treturn $this->data;\n\t\t}\n\t}", "public function addStorageCharges($containers)\n\t{\n\t\t$ctn = [];\n\n\t\t$fees = json_decode($this->feeRepository->getStorageFee(), true);\n\n\t\tforeach($containers as $container){\n\n\t\t\t$storage_charges = 0;\n\n\t\t\tif($container->days_empty > 5) {\n\t\t\t\t$storage_charges = ($container->days_empty - 5) * $fees[$container->size];\n\t\t\t}\n\n\t\t\t$container->storage_charges = $storage_charges;\n\t\t\t$this->totalStorageCharges += $storage_charges;\n\n\t\t\t$ctn[] = $container;\n\t\t}\n\n\t\treturn $ctn;\n\t}", "function data($number,$offset){\n\n\t\treturn $query = $this->db->get('t_produk',$number,$offset)->result_array(); \n\n\t}", "function obtener_CAE($cuit,$tipo_cbte,$pto_vta,$cbte,$imp_total,$imp_tot_conc,$imp_neto,$neto_21,$neto_105,$ImpTrib,$imp_op_ex,$fecha_cbte,$FchVencPago,$impIVA,$impALICUOTA,$FchServDesde,$FchServHasta,$Concepto)\n{\n\n$cmp=array();\n\n$cmp['Concepto']=$Concepto; //1 producto 2 servicios 3 productos y servicios\n$cmp['DocTipo']=80;\n$cmp['DocNro']=$cuit;\n$cmp['CbteDesde']=$cbte;\n$cmp['CbteHasta']=$cbte;\n$cmp['CbteFch']=$fecha_cbte;\n$cmp['ImpTotal']=$imp_total;\n$cmp['ImpTotConc']=$imp_tot_conc;\n$cmp['ImpNeto']=$imp_neto;\n$cmp['ImpOpEx']=$imp_op_ex;\n$cmp['ImpTrib']=$impALICUOTA;\n$cmp['ImpIVA']=($tipo_cbte==11)?0:$impIVA;\n$cmp['FchServDesde']=$FchServDesde; //Fecha de inicio del abono para el servicio a facturar. Dato obligatorio para concepto 2 o 3 (Servicios / Productos y Servicios). Formato yyyymmdd\n$cmp['FchServHasta']=$FchServHasta;\n$cmp['FchVtoPago']=$FchVencPago; //Fecha de vencimiento del pago servicio a facturar. Dato obligatorio para concepto 2 o 3 (Servicios / Productos y Servicios). Formato yyyymmdd. Debe ser igual o posterior a la fecha delcomprobante\n$cmp['FchVtoPago']='';\n$cmp['MonId']='PES';\n$cmp['MonCotiz']=1;\n\n\nif($impIVA>0 && !($tipo_cbte==2 && $tipo_cbte==3 && $tipo_cbte==7 && $tipo_cbte==8 && $tipo_cbte==11 && $tipo_cbte==12 && $tipo_cbte==13 && $tipo_cbte==15)){\n/*Aca entran facturas A y B*/\n$arrAli=array();\n$arrAli['AlicIva']=array();\n$arrTributos['Tributo']=array();\nif($impALICUOTA>0)\n{\n/*<IvaTipo><Id>3</Id><Desc>0%</Desc><FchDesde>20090220</FchDesde><FchHasta>NULL</FchHasta></IvaTipo><IvaTipo><Id>4</Id><Desc>10.5%</Desc><FchDesde>20090220</FchDesde><FchHasta>NULL</FchHasta></IvaTipo><IvaTipo><Id>5</Id><Desc>21%</Desc><FchDesde>20090220</FchDesde><FchHasta>NULL</FchHasta></IvaTipo><IvaTipo><Id>6</Id><Desc>27%</Desc><FchDesde>20090220</FchDesde><FchHasta>NULL</FchHasta></IvaTipo><IvaTipo><Id>8</Id><Desc>5%</Desc><FchDesde>20141020</FchDesde><FchHasta>NULL</FchHasta></IvaTipo><IvaTipo><Id>9</Id><Desc>2.5%</Desc><FchDesde>20141020</FchDesde><FchHasta>NULL</FchHasta></IvaTipo>*/\n\n $tributo=array();\n\n $tributo['Id']=99; //99->otros impuestos\n $tributo['Desc']='Impuesto provincial';\n $tributo['BaseImp']=3000;\n $tributo['Alic']=2;\n $tributo['Importe']=$impALICUOTA;\n $arrTributos['Tributo'][]=$tributo;\n\n $cmp['Tributos']=$arrTributos; \n}\n\n // echo $imp_neto.\" = \".$imp105.\"+\".$imp21;\n\n\n\n if($neto_21>0)\n { \n $arr21=array();\n $arr21['Id']=5; //->21%\n $arr21['BaseImp']=$neto_21;\n $arr21['Importe']=round($neto_21*0.21,2);\n $arrAli['AlicIva'][]=$arr21;\n \n }\n if($neto_105>0)\n { \n $arr105=array();\n $arr105['Id']=4; //->10.5%\n $arr105['BaseImp']=$neto_105;\n $arr105['Importe']=round($neto_105*0.105,2);\n $arrAli['AlicIva'][]=$arr105; \n }\n\nif($tipo_cbte!=6){ $cmp['Iva']=$arrAli; } #Solo Si es Factura A\n\n/*<AlicIva>\n <Id>5</Id> --> 21%\n <BaseImp>100</BaseImp>\n<Importe>21</Importe>\n </AlicIva>\n<AlicIva>\n <Id>4</Id> --> 10.5%\n <BaseImp>50</BaseImp>\n <Importe>5.25</Importe>\n </AlicIva>*/\n \n//$cmp['Iva']=$arrAli;\n\n/*\n if($impALICUOTA>0){\n\n // <Tributos>\n // <Tributo>\n // <Id>99</Id>\n // <Desc>Impuesto Municipal Matanza</Desc>\n // <BaseImp>150</BaseImp>\n // <Alic>5.2</Alic>\n // <Importe>7.8</Importe>\n // </Tributo>\n // </Tributos>\n\n $idALIC='';\n $descALIC='';\n $BaseImpALIC='';\n $alicALIC='';\n $impALIC='';\n \n\n $arrTrib['ImpTrib']=array();\n\n $arrTrib['ImpTrib']['Id']=$idALIC;\n $arrTrib['ImpTrib']['Desc']=$descALIC;\n $arrTrib['ImpTrib']['BaseImp']=$BaseImpALIC;\n $arrTrib['ImpTrib']['Alic']=$alicALIC; \n $arrTrib['ImpTrib']['Importe']=$impALIC;\n\n $cmp['Tributos']['Tributo']=$arrTrib; \n }*/\n\n\n}\n\n//si es factura B no discrimina IVA\n if($tipo_cbte==6 || $tipo_cbte==8)\n {\n $cmp['ImpNeto']=0;\n $cmp['ImpTotConc']=$imp_neto;\n $cmp['ImpIVA']=0;\n }\n //si es factura C o recibo C\n if($tipo_cbte==11 || $tipo_cbte==13 || $tipo_cbte==15)\n {\n if($imp_total<1000){\n $cmp['DocTipo']=99;\n $cmp['DocNro']=0;\n }\n $cmp['ImpOpEx']=0;\n $cmp['ImpTotConc']=0;\n $cmp['ImpIVA']=0;\n }\n \n//$cmp['CbtesAsoc']=array();\n//$cmp['Tributos']='';\n//if($tipo_cbte==6 || $tipo_cbte==8) $cmp['Iva']=''; \n/*\nArray para informar las alícuotas y sus importes asociados a un comprobante <AlicIva>. \nPara comprobantes tipo C y Bienes Usados – Emisor Monotributista no debe informar el array.N \n*/\n//$cmp['Opcionales']=array();\n\n\n //echo \"fecha pago:\".$cmp['FchVtoPago'];\n\n // echo \"ImpTotal\".$cmp['ImpTotal'].\", debe ser igual a la suma de ImpTotConc\".$cmp['ImpTotConc'].\"+ ImpNeto\".$cmp['ImpNeto'].\" + ImpOpEx\".$cmp['ImpOpEx'].\" + ImpTrib\".$cmp['ImpTrib'].\" + ImpIVA.\".$cmp['ImpIVA'];\n // var_dump($cmp);\n // die();\n\n $this->reg_respuesta=array(); \n $this->logPedidoCAERegistro=array();\n $this->logPedidoCAE=array();\n \n\n if(!$this->cargar_TA())\n {\n return false;\n }\n \n if($this->TA_expirado())\n {if(!$this->obtener_TA())\n {\n return false;\n }\n //en caso de que haya traido el TA, q lo vuelva a cargar a las clase para poder tomar sus datos\n if(!$this->cargar_TA())\n {\n return false;\n }\n \n }\n\n $cant_reg=1;\n $results=$this->client_wsfe->FECAESolicitar(\n array('Auth' => array('Token' => $this->token,'Sign' => $this->sign,'Cuit' => $this->cuit),\n 'FeCAEReq' => array('FeCabReq' => array('CantReg' => $cant_reg,'PtoVta' => $pto_vta,'CbteTipo'=>$tipo_cbte),\n 'FeDetReq' => array('FECAEDetRequest' =>$cmp))\n ));\n //print_r($results);\n $this->CheckErrors($results,'FECAESolicitar');\n \n if ( $results->FECAESolicitarResult->Errors->Err->Code != 0 )\n {\n\n $this->descError=\" MENSAJE DEL WEBSERVICE AFIP: Percode: \".$results->FECAESolicitarResult->Errors->Err->Code.\"\\nPerrmsg: \".$results->FECAESolicitarResult->Errors->Err->Msg.\"\\n\";\n return false;\n }\n \n//consulto por la cabecera\n if($results->FECAESolicitarResult->FeCabResp->Resultado ==\"R\")\n {\n $arrComp=array();\n $arrComp['cuit']=$results->FECAESolicitarResult->FeCabResp->Cuit;\n $arrComp['PtoVta']=$results->FECAESolicitarResult->FeCabResp->PtoVta;\n $arrComp['CbteTipo']=$results->FECAESolicitarResult->FeCabResp->CbteTipo;\n $arrComp['FchProceso']=$results->FECAESolicitarResult->FeCabResp->FchProceso;\n $arrComp['CantReg']=$results->FECAESolicitarResult->FeCabResp->CantReg;\n $arrComp['Resultado']=$results->FECAESolicitarResult->FeCabResp->Resultado;\n $arrComp['Reproceso']=$results->FECAESolicitarResult->FeCabResp->Reproceso;\n $this->logPedidoCAE[]=$arrComp;\n\n $comp=$results->FECAESolicitarResult->FeDetResp->FEDetResponse;\n $arrResp=array();\n \n $arrResp['Concepto']=$comp->Concepto;\n $arrResp['FchProceso']=$results->FECAESolicitarResult->FeCabResp->FchProceso;\n $arrResp['DocTipo']=$comp->DocTipo;\n $arrResp['DocNro']=$comp->DocNro;\n $arrResp['CbteDesde']=$comp->CbteDesde;\n $arrResp['CbteHasta']=$comp->CbteHasta;\n $arrResp['Resultado']=$comp->Resultado;\n $arrResp['CAE']=$comp->CAE;\n $arrResp['CbteFch']=$comp->CbteFch;\n $arrResp['CAEFchVto']=$comp->CAEFchVto;\n $arrResp['Obs']=$comp->Obs->Observaciones;\n $this->logPedidoCAERegistro=$arrResp;\n \n \n return false;\n }//fin del if que analiza errores cuando el resultado del envio arrojo R\nelse \n { \n $comp=$results->FECAESolicitarResult->FeDetResp->FECAEDetResponse;\n $arrResp=array();\n $arrResp['Concepto']=$comp->Concepto;\n $arrResp['FchProceso']=$results->FECAESolicitarResult->FeCabResp->FchProceso;\n $arrResp['DocTipo']=$comp->DocTipo;\n $arrResp['DocNro']=$comp->DocNro;\n $arrResp['CbteDesde']=$comp->CbteDesde;\n $arrResp['CbteHasta']=$comp->CbteHasta;\n $arrResp['Resultado']=$comp->Resultado;\n $arrResp['CAE']=$comp->CAE;\n $arrResp['CbteFch']=$comp->CbteFch;\n $arrResp['CAEFchVto']=$comp->CAEFchVto;\n \n $this->reg_respuesta[]=$arrResp;\n \n return true;\n }//fin del if\n \n return false;\n\n\n}", "public function getAllNumberFacturesFournisseurCurrent()\n\t\t{\n\t\t\t$this->Sql = \"SELECT COUNT(fa.idt_factures_achats) AS nb_factures , fa.date_facture, fo.nom_fournisseur\n\t\t\t\t\t\t\tFROM t_fournisseurs AS fo\n\t\t\t\t\t\t\tLEFT JOIN t_factures_achats AS fa ON fa.id_fournisseur = fo.idt_fournisseurs\n\t\t\t\t\t\t\tGROUP BY fo.idt_fournisseurs\";\n\t\t\t$res = $this->FetchAllRows();\n\t\t\treturn $res;\n\t\t}", "function product_getImage($item_number, $key) {\n $result = performApiRequest($key, 0, 'GET', 'bild;WHERE `artikelnummer`=' . $item_number);\n if (sizeof($result) > 0) {\n return $result[0]->bild;\n } else {\n return null;\n }\n}", "public function getBiocStatisTics($application)\n {\n\n\tif( strcmp($application,\"pathview\") == 0)\n {\n\n\t $bioc_vals = DB::select(DB::raw('select concat(concat(month,\\'-\\'),year) as date,number_of_unique_ip as ip_add,number_of_downloads as downloads from biocStatistics'));\n\t\t}\n\t\telse{\n\t\t $bioc_vals = DB::select(DB::raw('select concat(concat(month,\\'-\\'),year) as date,numberof_uniqueip as ip_add,numberof_downloads as downloads from biocGagestatistic'));\n\n\t\t\t}\n $lib_usage = array();\n //fill the array lists with usage objects\n foreach ($bioc_vals as $bioc_val )\n array_push($lib_usage,new Usage(date('Y-m-d',strtotime($bioc_val->date)),$bioc_val->ip_add,$bioc_val->downloads));\n usort($lib_usage , function($a,$b){\n return $a->getDate() > $b->getDate();\n });\n\n //return last 6 records\n\n if(sizeof($lib_usage) > 6)\n return array_slice($lib_usage, -6, 6, true);\n else\n return $lib_usage;\n }" ]
[ "0.6509671", "0.5967732", "0.52689195", "0.51345474", "0.51189333", "0.50517166", "0.50220084", "0.50064176", "0.4990072", "0.4920872", "0.49064317", "0.48988464", "0.48615813", "0.48387605", "0.48199883", "0.48079216", "0.4805638", "0.47491267", "0.47446448", "0.47396636", "0.47204837", "0.47106972", "0.4651365", "0.4649418", "0.46454185", "0.46429333", "0.46350288", "0.4632642", "0.46257982", "0.4622255" ]
0.6172426
1
this function to get trailer exist
public function exist_trailer($driver_id) { $date = date("Y-m-d H:i:s A"); $trailer_exist = $this->call_api_by_parameter("webGetTrailerExist", ["TrailerID" => $driver_id, "DateTime" => $date]); if ($trailer_exist) { $trailer_list = json_decode($trailer_exist); $ticket_id = ''; $ticket_number = ''; if ($trailer_list->id) { $ticket_id = $trailer_list->data[0]->ID; $ticket_number = $trailer_list->data[0]->TicketNumber; } return response()->json([ 'trailer_id' => $trailer_list->id, 'ticket_id' => $ticket_id, 'ticket_number' => $ticket_number ]); } return response()->json([ 'error' => "You are losing your connection" ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function haveTrailer(){\n \t$streams = $this->vodStreams;\n \tforeach ($streams as $stream){\n \t\tif($stream->stream_type == 2){\n \t\t\treturn true;\n \t\t}\n \t}\n \treturn false;\n }", "public function getTrailerAsUrl() {\n if ($this->isReady) {\n if ($strReturn = $this->matchRegex($this->_strSource, IMDB::IMDB_TRAILER, 1)) {\n return 'http://www.imdb.com/video/' . $strReturn . '/player';\n }\n return $this->strNotFound;\n }\n return $this->strNotFound;\n }", "public function trailer()\n { \n return $this->hasOne('App\\Trailer','id', 'trailer_id');\n }", "function parseTrailer($trailer, $enc_string) {\n $pos1 = 0;\n $pos2 = 0;\n $pos3 = 0;\n\n $has_profile = false;\n $real_trailer = \"\";\n\n if (($this->flags & $this->FLAG_WINDOW) == $this->FLAG_WINDOW) {\n $pos1 = strpos($trailer,'-');\n $pos2 = strpos($trailer,'-', $pos1 + 1);\n $this->tokenTime = $this->from64( substr($trailer, 0, $pos1) );\n if ($pos2 > 0) {\n $this->window = $this->from64(substr($trailer,$pos1 + 1, $pos2-$pos1-1));\n $trailer = substr($trailer, $pos2);\n } else {\n $this->window = from64( substr($trailer, $pos1 + 1));\n $trailer = \"\";\n }\n }\n\n if (($this->flags & $this->FLAG_DURATION) == $this->FLAG_DURATION) {\n $pos1 = strpos($trailer,'-');\n $pos2 = strpos($trailer,'-', $pos1 + 1);\n $this->duration = from64(substr($trailer,$pos1 + 1, $pos2-$pos1-1));\n $trailer = substr($trailer, $pos2);\n }\n\n if ($this->tokenType.equals(\"a\"))\n {\n $real_trailer = $this->deobfuscate($trailer, $enc_string, 13);\n } else {\n $real_trailer = $this->deobfuscate($trailer, $enc_string, 32);\n }\n\n $pos1 = strpos($trailer,'-');\n $pos2 = strpos($trailer,'-', $pos1 + 1);\n\n if ($pos2 < 0) {\n $pos2 = strlen($real_trailer);\n }\n $pos3 = strlen($real_trailer);\n\n if (($this->flags & $this->FLAG_PROFILE) == $this->FLAG_PROFILE) {\n $this->profile = substr( $real_trailer, $pos1+1, $pos2-$pos1-1);\n $has_profile = true;\n }\n\n if (($this->flags & $this->FLAG_PAYLOAD) == $this->FLAG_PAYLOAD) {\n $end = 0;\n if( $has_profile) {\n $end = $pos3 - $pos2;\n $this->payload = substr($real_trailer, $pos2+1, $end);\n } else {\n $this->payload = \"\";\n }\n }\n\n if ($this->payload != NULL && (($this->tokenType == \"c\") || ($this->tokenType == \"d\") || ($this->tokenType == \"e\")))\n {\n $decoded = \"\";\n for ($i = 0,$j = 0; $i < strlen($this->payload); $i+= 2, $j++)\n {\n $index = $this->from64( substr($this->payload, $i, 2));\n $ch = chr($index & 0xff);\n $decoded .= $ch;\n }\n $this->payload = $decoded;\n }\n\n }", "public function checkTrailerUnitExist( $trailerNo = null, $id = null ) {\n\t\t\n\t\t$this->db->select('id');\n\t\tif ( $id != null && $id != '' ){\n\t\t\t$this->db->where(array('unit_id' => $trailerNo,'id !=' => $id));\n\t\t}else{\n\t\t\t$this->db->where('unit_id',$trailerNo);\n\t\t}\n\t\t\n\t\t$this->db->where(['organisation_id' => $this->selectedOrgId]);\n\t\t$result = $this->db->get('trailers');\n\t\tif ( $result->num_rows() > 0 ) {\n\t\t\treturn $result->row_array();\n\t\t} else {\n\t\t\treturn array();\n\t\t}\n\t}", "public function get_trailer(Request $request)\r\n {\r\n $term = trim($request->q);\r\n $user_id = session(\"ID\");\r\n\r\n $data_json = $this->call_api_by_parameter(\"webGetTrailerByFilter\", ['TrailerNumber' => $term, \"UserID\" => $user_id]);\r\n $json = [];\r\n if ($data_json) {\r\n $decode = json_decode($data_json);\r\n if ($decode->id) {\r\n return response()->json($decode->data);\r\n } else {\r\n return response()->json($json);\r\n }\r\n }\r\n\r\n return response()->json([\r\n 'error' => \"You are losing your connection\"\r\n ]);\r\n }", "public function getTrailers()\n {\n $s3 = new S3Client([\n 'version' => 'latest',\n 'region' => 'eu-west-3',\n 'credentials' => [\n 'key' => getenv('KEY'),\n 'secret' => getenv('SECRET'),\n 'token' => null,\n 'expires' => null,\n ],\n ]);\n\n // El numero de trailers que tiene cada juego en AmazonS3\n switch ($this->id) {\n case 1:\n case 2:\n $numeroTrailers = 2;\n break;\n case 3:\n $numeroTrailers = 3;\n break;\n default:\n $numeroTrailers = 0;\n }\n\n $carpeta = str_replace(' ', '_', $this->titulo) . '/Trailers';\n\n $urlTrailers = [];\n\n if (getenv('MEDIA')) {\n for ($i = 1; $i <= $numeroTrailers; $i++) {\n $cmd = $s3->getCommand('GetObject', [\n 'Bucket' => 'gamesandfriends',\n 'Key' => 'Juegos/' . $carpeta . '/trailer' . $i . '.mp4',\n ]);\n\n $urlTrailers[] = (string) $s3->createPresignedRequest($cmd, '+20 minutes')->getUri();\n }\n }\n\n return $urlTrailers;\n }", "public function getTrailerInfo( $trailerId = null ) {\n\t\t$this->db->select('trailers.*,concat(\"Truck-\",vehicles.label) as truckName');\n\t\t$this->db->join('vehicles','vehicles.id = trailers.truck_id','LEFT');\n\t\treturn $this->db->where('trailers.id',$trailerId)->get('trailers')->row_array();\n\t}", "public function checkChangeTrailer( $truckId = null, $trailerId = null ) {\n\t\t$finalArray = array();\n\t\t$this->db->select('id,unit_id');\n\t\t$condition = array('truck_id' => $truckId, 'id !=' => $trailerId);\n\t\t$this->db->where($condition);\n\t\t$result = $this->db->get('trailers');\n\t\tif ( $result->num_rows() > 0 ) {\n\t\t\t$finalArray = $result->row_array();\n\t\t\treturn $finalArray;\n\t\t} else {\n\t\t\treturn $finalArray;\n\t\t}\n\t}", "public function isCertificateOfRoadworthinessTrailer(): bool\n {\n return $this->id === self::IRHP_PERMIT_TYPE_ID_CERT_ROADWORTHINESS_TRAILER;\n }", "public function getTrailerProviderAttribute($value)\n {\n if (str_contains($this->trailer_url, \"youtube\"))\n return \"youtube\";\n else if (str_contains($this->trailer_url, \"vimeo\"))\n return \"vimeo\";\n else if ($this->trailer_url == \"\" || $this->trailer->url == \"\")\n return null;\n }", "function findvideo( &$chctx, $channel, $busname )\r\n{\r\n\tglobal $conn ;\r\n\r\n $ret = false ;\r\n\t$searchtime = $chctx['ve'];\r\n\t@$st = new DateTime($searchtime);\r\n\tif( empty($st) ) {\r\n\t\t$st=new DateTime(\"2000-01-01\");\r\n\t}\r\n\r\n\t// find video ending after $chctx['ve']\r\n\t$sql = \"SELECT time_start, time_end, TIMESTAMPDIFF(SECOND, time_start, time_end ) AS length, path FROM videoclip WHERE vehicle_name = '$busname' AND channel = $channel AND time_end > '$searchtime' ORDER BY time_start\" ;\r\n\r\n\theader(\"X-log-findvideo: \".$sql);\r\n\t\r\n\tif( $result = $conn->query($sql, MYSQLI_USE_RESULT) ) {\r\n\t\twhile( $row=$result->fetch_array() ) {\r\n\t\t\tif( vfile_exists ( $row['path'] ) ) {\r\n\t\t\t\r\n\t\t\t\t$chctx['v'] = $row['path'] ;\t\t\t// video file\r\n\t\t\t\t$chctx['vt'] = $row['time_start'] ;\t\t// video file time\r\n\t\t\t\t$chctx['ve'] = $row['time_end'] ;\t\t// video file end time\r\n\t\t\t\t$chctx['vl'] = $row['length'] ;\t\t\t// video file time length\r\n\t\t\t\t$chctx['vs'] = vfile_size($chctx['v']) ;\t// video file size\r\n\t\t\t\t\r\n\t\t\t\tif( $chctx['vs']<1000 ) {\r\n\t\t\t\t\t// file size too small ?\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$chctx['no'] = $chctx['hs'] ;\t\t\t// next frame offset\r\n\t\t\t\t$chctx['nt'] = 0 ;\t\t\t\t\t\t// next frame time (ms diff from file time)\r\n\r\n\t\t\t\t$chctx['nh'] = 1 ;\t\t\t\t\t\t// indicate new header should be output\r\n\t\t\t\t\r\n\t\t\t\t$chctx['k'] = substr_replace( $chctx['v'], \"k\", -3 ) ;\t\t// key file\r\n\t\t\t\t$chctx['ko'] = 0 ;\t\t\t\t\t\t\t\t\t\t\t// key file offset\r\n\t\t\t\t\r\n\t\t\t\tif( ($kfile = vfile_open($chctx['k'])) ) {\r\n\t\t\t\t\t$line = vfile_gets( $kfile ) ;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$off = 0 ;\r\n\t\t\t\t\t$dms = 0 ; \r\n\t\t\t\t\tif( sscanf( $line, \"%d,%d\", $dms, $off )==2 ) {\r\n\t\t\t\t\t\t$chctx['hs'] = $off ;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// detect offset\r\n\t\t\t\t\tvfile_seek($kfile,0);\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\twhile( $lines = vfile_readlines( $kfile, 1000 ) ) {\r\n\t\t\t\t\t\tfor( $i=0; $i<count($lines); $i++ ) {\r\n\t\t\t\t\t\t\tif( sscanf( $lines[$i]['text'], \"%d,%d\", $dms, $off )==2 ) {\r\n\t\t\t\t\t\t\t\t$chctx['no'] = $off ;\r\n\t\t\t\t\t\t\t\t$chctx['nt'] = $dms ;\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$ft = new DateTime( $chctx['vt'] );\t\t\r\n\t\t\t\t\t\t\t\t$di = new DateInterval( 'PT'.((integer)($dms/1000)).'S') ;\r\n\t\t\t\t\t\t\t\t$ft->add( $di );\r\n\t\t\t\t\t\t\t\tif( $ft >= $st ) {\r\n\t\t\t\t\t\t\t\t\t// detect offset\r\n\t\t\t\t\t\t\t\t\t$chctx['ko'] = $lines[$i]['npos'] ;\r\n\t\t\t\t\t\t\t\t\t$ret = true ;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( $ret ) break;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvfile_close( $kfile );\r\n\t\t\t\t\tif( $ret ) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\t\t// no usable key file\r\n\t\t\t\t\t// do something\r\n\t\t\t\t\t$ft = new DateTime( $chctx['vt'] );\r\n\t\t\t\t\tif( $st <= $ft ) {\r\n\t\t\t\t\t\t$chctx['no'] = $chctx['hs'] ;\t\t\t// next frame offset\r\n\t\t\t\t\t\t$chctx['nt'] = 0 ;\t\t\t\t\t\t// next frame time (ms diff from file time)\r\n\t\t\t\t\t\t$ret = true ;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$diffs = $st->getTimestamp() - $ft->getTimestamp();\r\n\t\t\t\t\t\tif( $diffs < $chctx['vl'] ) {\r\n\t\t\t\t\t\t\t$chctx['no'] = (integer)( $diffs * $chctx['vs'] / $chctx['vl'] ) + $chctx['hs'] ;\r\n\t\t\t\t\t\t\t$chctx['no'] &= ~3 ;\r\n\t\t\t\t\t\t\t$chctx['nt'] = 0 ;\t\t\t\t\t\t// next frame time (ms diff from file time)\r\n\t\t\t\t\t\t\t$ret = true ;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$result->free();\r\n\t}\r\n\r\n\treturn $ret ;\r\n}", "function downloadfilterCV()\r\n\t {\t \r\n\t \t$file = $_GET['fileName'];//print_r($file);die;\r\n\t $filePath= 'uploads/candidateResume/'.$file;\r\n\t header(\"Content-Disposition: attachment;filename=$file\");\r\n\t readfile($filePath);\r\n\t //die;//$filename = 'UPLOAD_RESUME/f3e0eAGRA';\r\n\t }", "function videoDetailUrl($url)\r\n {\r\n $curlInit = curl_init($url);\r\n curl_setopt($curlInit, CURLOPT_CONNECTTIMEOUT, 10);\r\n curl_setopt($curlInit, CURLOPT_HEADER, true);\r\n curl_setopt($curlInit, CURLOPT_NOBODY, true);\r\n curl_setopt($curlInit, CURLOPT_RETURNTRANSFER, true);\r\n $response = curl_exec($curlInit);\r\n curl_close($curlInit);\r\n if ($response) return true; return false;\r\n }", "function videofile_user_outline($course, $user, $mod, $videofile) {\n global $DB;\n $para = ['userid' => $user->id, 'module' => 'videofile', 'action' => 'view', 'info' => $videofile->id];\n if ($logs = $DB->get_records('log', $para, 'time ASC')) {\n $lastlog = array_pop($logs);\n $result = new stdClass();\n $result->time = $lastlog->time;\n $result->info = get_string('numviews', '', count($logs));\n return $result;\n }\n return null;\n}", "private function get_expiration() {\n if(empty($this->error)){\n // si no esta en memoria abrirlo\n if(empty($this->TA)) { \n if(empty($this->error)){\n if(file_exists($this->Archivos['ta'])){\n $TA_file = file($this->Archivos['ta'], FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); \n }else{\n $TA_file = false;\n }\n if($TA_file) {\n $TA_xml = '';\n for($i=0; $i < sizeof($TA_file); $i++)\n $TA_xml.= $TA_file[$i]; \n if(empty($this->error)){\n $this->TA = $this->xml2Array($TA_xml);\n }else{\n $r = false; \n }\n if(empty($this->error)){\n $r = $this->TA['header']['expirationTime']; \n }else{\n $r = false; \n }\n } else {\n $r = false;\n } \n }else{\n $r=false; \n }\n } else {\n $r = $this->TA['header']['expirationTime'];\n } \n }else{\n $r=false;\n }\n return $r; \n }", "public static function hasArchive() \n\t{ \n\t\treturn (bool)(self::Archive() != null && strlen(self::Archive()) > 0); \n\t}", "function download_video ($id, $fileName){\n\t if (file_exists($fileName . '.flv')) {\n @unlink($fileName . '.flv');\n\t }\n $data = $this->download_get_html($id);\n if($flv = $this->download_get_flv($data)) {\n return $this->download_get_file($flv, $fileName . '.flv');\n } else {\n \treturn false;\n }\n }", "function get_subtitles_from_amara($amara_id) {\n\tglobal $amara_headers, $amara_base_url;\n \n\t$amara_api_url = $amara_base_url.'/api/videos/'.$amara_id.'/'; // the URL to get the video subtitle info\n\n\t// we'll use curl to get the video entry's info from amara\n\t$amara_entry_info_curl = curl_init();\n\tcurl_setopt($amara_entry_info_curl, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($amara_entry_info_curl, CURLOPT_URL, $amara_api_url);\n\tcurl_setopt($amara_entry_info_curl, CURLOPT_PORT , 443);\n\tcurl_setopt($amara_entry_info_curl, CURLOPT_SSL_VERIFYPEER, 0);\n\tcurl_setopt($amara_entry_info_curl, CURLOPT_HEADER, 0);\n\tcurl_setopt($amara_entry_info_curl, CURLOPT_FOLLOWLOCATION, true);\n\tcurl_setopt($amara_entry_info_curl, CURLOPT_HTTPHEADER, $amara_headers);\n\n\t// this should be JSON...\n\t$amara_entry_info = curl_exec($amara_entry_info_curl);\n\n\t// check for curl errors\n\tif (curl_errno($amara_entry_info_curl) > 0) {\n\t return array('ok' => false, 'error' => 'ERROR 107: Error fetching entry info from Amara: ' . curl_error($amara_entry_info_curl));\n\t}\n\n\t// decode it...\n\t$amara_entry_data = json_decode($amara_entry_info, true);\n\tif (!$amara_entry_data) {\n\t\treturn array('ok' => false, 'error' => 'ERROR 102: There was an error fetching the subtitle info from Amara.');\n\t}\n\n\tcurl_close($amara_entry_info_curl);\n\n\t//echo '<pre>'.print_r($amara_entry_data, true).'</pre>';\n\n\t// make sure there are actually subtitles made\n\tif (!isset($amara_entry_data['languages']) || count($amara_entry_data['languages']) == 0) {\n\t\treturn array('ok' => false, 'error' => 'ERROR 103: It seems there are no subtitles at all for this entry in Amara.');\n\t}\n\n\t$amara_subtitles_api_url = ''; // temporary\n\n\t// go through the languages and try to find an english subtitle\n\tforeach ($amara_entry_data['languages'] as $subtitle_language) {\n\t if ($subtitle_language['code'] == 'en') {\n\t // found it!\n\t $amara_subtitles_api_url = $subtitle_language['subtitles_uri'];\n\t }\n\t}\n\n\t// make sure we found those english subtitles\n\tif (trim($amara_subtitles_api_url) == '') {\n\t\treturn array('ok' => false, 'error' => 'ERROR 104: It seems there are no English subtitles for this entry in Amara.');\n\t}\n\n\t// ok -- now this should be the URL for where the subtitles actually live\n\t// it may change because of amara's API change cycle, so we rely on this\n\tif (substr($amara_subtitles_api_url, 0, 4) != 'http') {\n\t $amara_subtitles_api_url = $amara_base_url.$amara_subtitles_api_url.'?format=vtt';\n\t} else {\n\t $amara_subtitles_api_url = $amara_subtitles_api_url.'?format=vtt';\n\t}\n\n\t// use curl to get the subtitles from amara\n\t$amara_curl = curl_init();\n\tcurl_setopt($amara_curl, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($amara_curl, CURLOPT_URL, $amara_subtitles_api_url);\n\tcurl_setopt($amara_curl, CURLOPT_PORT , 443);\n\tcurl_setopt($amara_curl, CURLOPT_SSL_VERIFYPEER, 0);\n\tcurl_setopt($amara_curl, CURLOPT_HEADER, 0);\n\tcurl_setopt($amara_curl, CURLOPT_FOLLOWLOCATION, true);\n\tcurl_setopt($amara_curl, CURLOPT_HTTPHEADER, $amara_headers);\n\n\t$amara_data = curl_exec($amara_curl);\n\t\n\t// check for curl errors\n\tif (curl_errno($amara_curl) > 0) {\n\t return array('ok' => false, 'error' => 'ERROR 108: Error fetching entry data from Amara: ' . curl_error($amara_curl));\n\t}\n\t\n\tif (trim($amara_data) == '') {\n\t\treturn array('ok' => false, 'error' => 'ERROR 109: No Amara data was returned!');\n\t}\n\t\n\treturn array('ok' => true, 'data' => $amara_data); // should be the captions!\n}", "function makeTrailer($token, $profile, $payload) {\n $trailer = \"\";\n\n if( $profile == NULL && $payload == NULL ) {\n return $trailer;\n }\n\n if( $profile != NULL ) {\n $trailer .= '-';\n $trailer .= $profile;\n }\n\n if( $this->tokenType == \"a\" ) {\n if( $payload != NULL ) {\n $trailer .= '-';\n $trailer .= $payload;\n }\n $obsBuf = $this->obfuscate($token, $trailer, 2, 13);\n } else {\n if( $payload != NULL ) {\n $trailer .= '-';\n for($i=0;$i<strlen($payload);$i++) {\n $ch = ord( $payload[$i] ) & 0xff;\n $trailer .= $this->to64($ch,2);\n }\n }\n $obsBuf = $this->obfuscate($token,$trailer,3,32);\n }\n $obsBuf = $this->fixSlash($obsBuf);\n return $obsBuf;\n }", "public function getMovie($id) {\n $sql = 'SELECT * FROM VMovie WHERE id = ?';\n $res = $this->db->ExecuteSelectQueryAndFetchAll($sql, array($id));\n\n if (!isset($res[0])) {\n return \"Det finns ingen film med detta id ({$id}).\";\n }\n else {\n $r = $res[0];\n \n $img = \"<img src='img.php?src=movie/{$r->image}&amp;width=240&amp;height=360&amp;quality=90&amp;crop-to-fit' title='{$r->title}'/>\";\n \n $back = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : \"movies.php\";\n $action = \"<a href='{$back}'>[ Tillbaka ]</a>\";\n $action .= isset($_SESSION['user']) ? \"\n &nbsp;&nbsp;&nbsp;\n <a href='?edit&id={$r->id}'>[ Redigera ]</a>\n &nbsp;&nbsp;&nbsp;\n <a href='?delete&id={$r->id}'>[ Radera ]</a>\n \" : null;\n $year = \"(<a href='?year1={$r->year}&year2={$r->year}'>{$r->year}</a>)\";\n $genres = null;\n foreach(explode(', ', $r->genres) as $key=>$genre) {\n if ($key) $genres .= \", \";\n $genres .= \"<a href='?genre={$genre}'>{$genre}</a>\";\n }\n \n $directors = null;\n foreach(explode(', ', $r->directors) as $key=>$director) {\n if ($key) $directors .= \", \";\n $directors .= \"<a href='?search={$director}'>{$director}</a>\";\n }\n \n $actors = null;\n foreach(explode(', ', $r->actors) as $key=>$actor) {\n if ($key) $actors .= \", \";\n $actors .= \"<a href='?search={$actor}'>{$actor}</a>\";\n }\n \n $trailer = $r->urlTrailer ? \"<span class='trailer'><a href='{$r->urlTrailer}' title='Se trailer' target='_blank'><img src='img.php?src=youtube.png'></a></span>\" : null;\n \n return <<<EOD\n <div class='movieDetails'>\n <div class='image'>{$img}</div>\n <div class='metadata'>\n <span class='title'>{$r->title}</span>\n <span class='year'>{$year}</span>\n <span class='orgTitle'>{$r->orgTitle} <em>(originaltitel)</em></span>\n <span class='length'>{$this->minutes2HoursAndMinutes($r->length)}</span>\n <span class='spacer'>|</span>\n <span class='genre'>{$genres}</span>\n <span class='imdb'>{$this->urlIMDb($r->imdb, $r->title, $r->year)}</span>\n {$trailer}\n <span class='plot'>{$r->plot}</span>\n <span class='directors'><strong>Regissör:</strong> {$directors}</span>\n <span class='actors'><strong>Skådespelare:</strong> {$actors}</span>\n </div>\n <div class='action'>\n {$action}\n </div>\n </div>\nEOD;\n }\n }", "function TarInfo($headers = true)\n {\n if($headers)\n {\n ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html>\n\n<head>\n <title>MaxgComp TAR</title>\n <style type=\"text/css\">\n body{margin: 20px;}\n body,td{font-size:10pt;font-family: arial;}\n </style>\n <meta name=\"Author\" content=\"The Maxg Network, http://maxg.info\" />\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n</head>\n\n<body bgcolor=\"#EFEFEF\">\n<?php\n }\n?>\n<table border=\"0\" align=\"center\" width=\"500\" cellspacing=\"4\" cellpadding=\"5\" style=\"border:1px dotted black;\">\n<tr>\n <td align=\"center\" bgcolor=\"#DFDFEF\" colspan=\"3\" style=\"font-size:15pt;font-color:#330000;border:1px solid black;\">MaxgComp TAR</td>\n</tr>\n<tr>\n <td colspan=\"2\" bgcolor=\"#EFEFFE\" style=\"border:1px solid black;\">This software was created by the Maxg Network, <a href=\"http://maxg.info\" target=\"_blank\" style=\"text-decoration:none;color:#333366;\">http://maxg.info</a>\n <br />It is distributed under the GNU <a href=\"http://www.gnu.org/copyleft/lesser.html\" target=\"_blank\" style=\"text-decoration:none;color:#333366;\">Lesser General Public License</a>\n <br />You can find the documentation of this class <a href=\"http://docs.maxg.info\" target=\"_blank\" style=\"text-decoration:none;color:#333366;\">here</a></td>\n <td width=\"60\" bgcolor=\"#EFEFFE\" style=\"border:1px solid black;\" align=\"center\"><img src=\"http://img.maxg.info/menu/tar.gif\" border=\"0\" alt=\"MaxgComp TAR\" /></td>\n</tr>\n<tr>\n <td width=\"50%\" align=\"center\" style=\"border:1px solid black;\" bgcolor=\"#DFDFEF\">MaxgComp TAR version</td>\n <td colspan=\"2\" align=\"center\" bgcolor=\"#EFEFFE\" style=\"border:1px solid black;\"><?=TARLIB_VERSION?></td>\n</tr>\n<tr>\n <td width=\"50%\" align=\"center\" style=\"border:1px solid black;\" bgcolor=\"#DFDFEF\">ZLIB extensions</td>\n <td colspan=\"2\" align=\"center\" bgcolor=\"#EFEFFE\" style=\"border:1px solid black;\"><?=(extension_loaded('zlib') ? '<b>Yes</b>' : '<i>No</i>')?></td>\n</tr>\n<tr>\n <td width=\"50%\" align=\"center\" style=\"border:1px solid black;\" bgcolor=\"#DFDFEF\">BZ2 extensions</td>\n <td colspan=\"2\" align=\"center\" bgcolor=\"#EFEFFE\" style=\"border:1px solid black;\"><?=(extension_loaded('bz2') ? '<b>Yes</b>' : '<i>No</i>')?></td>\n</tr>\n<tr>\n <td width=\"50%\" align=\"center\" style=\"border:1px solid black;\" bgcolor=\"#DFDFEF\">Allow URL fopen</td>\n <td colspan=\"2\" align=\"center\" bgcolor=\"#EFEFFE\" style=\"border:1px solid black;\"><?=(ini_get('allow_url_fopen') ? '<b>Yes</b>' : '<i>No</i>')?></td>\n</tr>\n<tr>\n <td width=\"50%\" align=\"center\" style=\"border:1px solid black;\" bgcolor=\"#DFDFEF\">Time limit</td>\n <td colspan=\"2\" align=\"center\" bgcolor=\"#EFEFFE\" style=\"border:1px solid black;\"><?=ini_get('max_execution_time')?></td>\n</tr>\n<tr>\n <td width=\"50%\" align=\"center\" style=\"border:1px solid black;\" bgcolor=\"#DFDFEF\">PHP Version</td>\n <td colspan=\"2\" align=\"center\" bgcolor=\"#EFEFFE\" style=\"border:1px solid black;\"><?=phpversion()?></td>\n</tr>\n<tr>\n <td colspan=\"3\" align=\"center\" bgcolor=\"#EFEFFE\" style=\"border:1px solid black;\">\n <i>Special thanks to &laquo; Vincent Blavet &raquo; for his PEAR::Archive_Tar class</i>\n </td>\n</tr>\n</table>\n<?php\n if($headers) echo '</body></html>';\n }", "function GetExtractedAudio($videofile){ \n $audiofile = VIDEODIR . basename($videofile,'.mp4' ). \".mp3\";\n if (file_exists($audiofile)) return $audiofile;\n \t$FFmpeg = new FFmpeg(FFMPEG);\n \t$FFmpeg->input( $videofile )->output( $audiofile )->ready();\n if (file_exists($audiofile)) return $audiofile;\n return false;\n}", "public function haveArchiveArtefacts();", "function file_exists_server($file_url)\n{\n $AgetHeaders = @get_headers($file_url);\n if (preg_match(\"|200|\", $AgetHeaders[0])) \n return true;\n else\n return false;\n}", "public function getVideo($id)\n\t{\n\t\t$video['info'] = $this->find($id)->current();\n\t\t\n\t\t// ... Country\n\t\t$country_info = $video['info']->findManyToManyRowset('Application_Model_DbTable_Country',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Application_Model_DbTable_CountryOfFilm',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Item','Country');\n\t\t\n\t\t// ... Genre\n\t\t$genre_info = $video['info']->findManyToManyRowset('Application_Model_DbTable_Genre',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Application_Model_DbTable_GenreOfFilm',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Item','Genre');\n\t\t\n\t\t// ... Actor\n\t\t$actor_info = $video['info']->findManyToManyRowset('Application_Model_DbTable_Actor',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Application_Model_DbTable_ActorInFilm',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Item','Actor');\n\t\t\n\t\t// ... Director\n\t\t$director_info = $video['info']->findManyToManyRowset('Application_Model_DbTable_Director',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Application_Model_DbTable_DirectorOfFilm',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Item','Director');\n\t\t\n\t\t$video['country_info']\t= $country_info->toArray();\n\t\t$video['genre_info']\t= $genre_info->toArray();\n\t\t$video['actor_info']\t= $actor_info->toArray();\n\t\t$video['director_info']\t= $director_info->toArray();\n\t\t\n\t\tif($video['info']['serial'] == 'yes'){\n\t\t\t// ... Serial\n\t\t\t$more_info = $video['info']->findDependentRowset('Application_Model_DbTable_Serial','Item');\n\t\t\t$more_info = $more_info[0];\n\t\t\t// ... Season\n\t\t\t$season_info = $more_info->findDependentRowset('Application_Model_DbTable_Season','SerSeas');\n\t\t\t\n\t\t\tforeach($season_info as $skey => $svalue){\n\t\t\t\t// ... Episode\n\t\t\t\t$episode_info[$skey] = $svalue->findDependentRowset('Application_Model_DbTable_Episode','SeasEp');\n\t\t\t\t\n\t\t\t\tforeach($episode_info[$skey] as $ekey => $evalue){\n\t\t\t\t\t// ... File\n\t\t\t\t\t$file_info[$skey][$ekey] = $evalue->findParentRow('Application_Model_DbTable_File','File');\n\t\t\t\t\t$file_info[$skey][$ekey] = $file_info[$skey][$ekey]->toArray();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$episode_info[$skey] = $episode_info[$skey]->toArray();\n\t\t\t}\n\n\t\t\tif(!(count($season_info)>0)){\n\t\t\t\t$episode_info = null;\n\t\t\t\t$file_info = null;\n\t\t\t}\n\t\t\t\n\t\t\t$video['more_info']\t\t= $more_info->toArray();\n\t\t\t$video['season_info']\t= $season_info->toArray();\n\t\t\t$video['episode_info']\t= $episode_info;\n\t\t\t$video['file_info']\t\t= $file_info;\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\t// ... Movie\n\t\t\t$more_info = $video['info']->findDependentRowset('Application_Model_DbTable_Movie','Item');\n\t\t\t$more_info = $more_info[0];\n\t\t\t// ... File\n\t\t\t$file_info = $more_info->findParentRow('Application_Model_DbTable_File','File');\n\t\t\t$video['more_info'] = $more_info->toArray();\n\t\t\t$video['file_info'] = $file_info->toArray();\n\t\t}\n\t\t\n\t\t// ... Comment and User\n\t\t$comment_info['comment'] = $video['info']->findDependentRowset('Application_Model_DbTable_Comment','Item');\n\t\tforeach($comment_info['comment'] as $ckey => $cvalue){\n\t\t\t$comment_info['user'][$ckey] = $cvalue->findParentRow('Application_Model_DbTable_User','User');\n\t\t\t$comment_info['user'][$ckey] = $comment_info['user'][$ckey]->toArray();\n\t\t}\n\t\t$comment_info['comment'] = $comment_info['comment']->toArray();\n\t\t$video['comment_info']\t= $comment_info;\n\n\t\t/*echo var_dump($video);\n\t\tdie;*/\n\t\treturn $video;\n\t}", "function ceksoal($origin,$des){\n\t// $des = direktori tempat membandingkan\n\t$extdata = pathinfo($origin['name'], PATHINFO_EXTENSION);\n\tif (file_exists($des.$origin['name']) == true) {\n\t\treturn $origin['name'].\" sudah ada, ganti nama file secara unik\";\n\t}elseif ($extdata != 'csv') {\n\t\treturn \"format \".$origin['name'].\" tidak support, pastikan file soal menggunakan format .csv\";\n\t}else{\n\t\treturn 1;\n\t}\n\n\n}", "public function downloadSample($id, $type){\n\n $book = Book::find($id); // get the book title for the naming\n $fileFullPath = '';\n $filePath = $book->sampleRoot();\n $files = array_diff(scandir($filePath), array('..', '.')); // get file names\n\n\n if($type == 0 || $type == 3) // if generic or pdf, download pdf\n {\n $name = 'pdf';\n }\n else if($type == 1) // if txt\n {\n $name = 'txt';\n }\n else if($type == 2) // if epub (in a zip file)\n {\n $name = 'epub';\n }\n else if($type == 4) // if mp3\n {\n $name = 'mp3';\n }\n\n foreach($files as $file) // get the full files paths\n {\n if(stripos($file, $name) !== FALSE)\n {\n $fileFullPath = $filePath.$file;\n }\n }\n\n $ext = pathinfo($fileFullPath, PATHINFO_EXTENSION);\n\n //If the file exists\n if(File::exists($fileFullPath))\n {\n return Response::download($fileFullPath, $book->title.'(sample).'.$ext);\n }\n else // doesnt exist\n {\n return Redirect::back()->with('errorMessage', 'Sorry, we were unable to retrieve \"'.$book->title.'\" in the '.$name.' format.');\n }\n\n}", "public function get_all_log_video_download(){\n\t\t$result = $this->db->query(\"SELECT a.id_video, a.tanggal, a.id_siswa, a.status, a.timestamp, b.nama, b.kelas, c.file, c.materi, c.nama_pelajaran FROM download_video a LEFT JOIN akun b ON a.id_siswa = b.id_admin_sekolah LEFT JOIN video c ON a.id_video = c.id_video WHERE a.tanggal = '\".date('d/m/Y').\"'\");\n return $result;\n }", "public function by_toc ( $rg_resloc, $rg_showerr ) {\n if ( $this->unprepared() ) { return; }\n \n if ( !(file_exists($rg_resloc)) )\n {\n if ( $rg_showerr )\n {\n echo \"\\n<h1>ERROR: no such file</h1>\\n\";\n echo \"<h3>\" . htmlspecialchars($rg_resloc) . \"</h3>\";\n }\n return false;\n }\n $hasdone = false;\n \n $conta = file_get_contents($rg_resloc);\n $contb = explode(\"\\n\",$conta);\n foreach ( $contb as $contc )\n {\n list($base,$allrg) = explode(\":\",$contc,2);\n if ( $base == \"page\" )\n {\n list($whatpage,$where) = explode(\":\",$allrg,2);\n if ( $whatpage == $this->vr_vars[\"main\"][\"lectpage\"] )\n {\n $thatpage = $this->rob_string->relativ($rg_resloc,$where);\n $isdone = $this->by_lectpage($thatpage,$rg_showerr);\n if ( $isdone ) { $hasdone = true; }\n }\n }\n }\n if ( $hasdone ) { return true; }\n \n if ( $rg_showerr )\n {\n echo \"\\n<h1>ERROR: no such lectionary page: \" . $this->vr_vars[\"main\"][\"lectpage\"] . \"</h1>\\n\";\n echo \"<h3>\" . htmlspecialchars($rg_resloc) . \"</h3>\";\n }\n \n return false;\n}" ]
[ "0.71735054", "0.6090382", "0.6018693", "0.57041204", "0.56545365", "0.54985327", "0.52981263", "0.51718915", "0.49750787", "0.49364614", "0.4913685", "0.48507535", "0.48332885", "0.48295823", "0.4787334", "0.47326544", "0.47175622", "0.46815643", "0.4675602", "0.46583897", "0.4653044", "0.46450755", "0.46315646", "0.45815513", "0.4573585", "0.45584816", "0.45535478", "0.45419842", "0.4536479", "0.45177928" ]
0.63316983
1
this function to get trailer data by filter
public function get_trailer(Request $request) { $term = trim($request->q); $user_id = session("ID"); $data_json = $this->call_api_by_parameter("webGetTrailerByFilter", ['TrailerNumber' => $term, "UserID" => $user_id]); $json = []; if ($data_json) { $decode = json_decode($data_json); if ($decode->id) { return response()->json($decode->data); } else { return response()->json($json); } } return response()->json([ 'error' => "You are losing your connection" ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTweetsByFilter() {\n\n // for each filter, get tweets, write them to a JSON file\n \n // hardcode for all filter\n\n // hardcode for main filter\n getTweetsByUsername(\"jay_raiii\");\n\n // hardcode for employee filter\n\n // hardcode for customer filter\n }", "public function get_retur_filter($filter) {\r\n $sql = \"SELECT KDKPPN, KDSATKER, NMSATKER, RECEIPT_NUMBER, SP2D_NUMBER, \r\n\t\t\t\tSTATEMENT_DATE, AMOUNT, VENDOR_EXT_BANK_ACCOUNT_NUM,\r\n\t\t\t\tVENDOR_NAME, BANK_ACCOUNT_NAME, BANK_NAME,\r\n\t\t\t\tINVOICE_DESCRIPTION, TGL_RETUR, KETERANGAN_RETUR, NOSP2D_PENGGANTI,\r\n\t\t\t\tTGSP2D_PENGGANTI, TGL_PROSES_SP2D_PENGGANTI, NILAI_SP2D_PENGGANTI,\r\n\t\t\t\tBANK_NAME_PENGGANTI, VENDOR_NAME_PENGGANTI, VENDOR_ACCOUNT_NUM_PENGGANTI,\t\t\t\r\n\t\t\t\tSTATUS_RETUR\r\n\t\t\t\tFROM \" . $this->_table . \"\r\n\t\t\t\tWHERE 1=1 \r\n \";\r\n //SP2D = 140181301002823\r\n //xml = 520002000990_SP2D_O_20140408_101509_367.xml\r\n $no = 0;\r\n //var_dump($filter);\r\n foreach ($filter as $filter) {\r\n $sql .= \" AND \" . $filter;\r\n }\r\n $sql .= \" ORDER BY STATEMENT_DATE DESC\";\r\n //var_dump ($sql);\r\n $result = $this->db->select($sql);\r\n $data = array();\r\n foreach ($result as $val) {\r\n $d_data = new $this($this->registry);\r\n $d_data->set_kdkppn($val['KDKPPN']);\r\n $d_data->set_kdsatker($val['KDSATKER']);\r\n $d_data->set_nmsatker($val['NMSATKER']);\r\n $d_data->set_receipt_number($val['RECEIPT_NUMBER']);\r\n $d_data->set_sp2d_number($val['SP2D_NUMBER']);\r\n $d_data->set_statement_date(date(\"d-m-Y\", strtotime($val['STATEMENT_DATE'])));\r\n $d_data->set_amount(($val['AMOUNT']));\r\n $d_data->set_vendor_ext_bank_account_num($val['VENDOR_EXT_BANK_ACCOUNT_NUM']);\r\n $d_data->set_vendor_name($val['VENDOR_NAME']);\r\n $d_data->set_bank_account_name($val['BANK_ACCOUNT_NAME']);\r\n $d_data->set_bank_name($val['BANK_NAME']);\r\n $d_data->set_invoice_description($val['INVOICE_DESCRIPTION']);\r\n $d_data->set_tgl_retur($val['TGL_RETUR']);\r\n $d_data->set_keterangan_retur($val['KETERANGAN_RETUR']);\r\n $d_data->set_nosp2d_pengganti($val['NOSP2D_PENGGANTI']);\r\n if ($val['TGSP2D_PENGGANTI'] != '') {\r\n $d_data->set_tgsp2d_pengganti(date(\"d-m-Y\", strtotime($val['TGSP2D_PENGGANTI'])));\r\n } else {\r\n $d_data->set_tgsp2d_pengganti('');\r\n }\r\n if ($val['TGL_PROSES_SP2D_PENGGANTI'] != '') {\r\n $d_data->set_tgl_proses_sp2d_pengganti(date(\"d-m-Y\", strtotime($val['TGL_PROSES_SP2D_PENGGANTI'])));\r\n } else {\r\n $d_data->set_tgl_proses_sp2d_pengganti('');\r\n }\r\n $d_data->set_nilai_sp2d_pengganti(($val['NILAI_SP2D_PENGGANTI']));\r\n $d_data->set_bank_name_pengganti($val['BANK_NAME_PENGGANTI']);\r\n $d_data->set_vendor_name_pengganti($val['VENDOR_NAME_PENGGANTI']);\r\n $d_data->set_vendor_account_num_pengganti($val['VENDOR_ACCOUNT_NUM_PENGGANTI']);\r\n $d_data->set_status_retur($val['STATUS_RETUR']);\r\n $data[] = $d_data;\r\n }\r\n return $data;\r\n }", "public function filters();", "public function trelloDataIsFiltered()\n {\n //print_r( $this->trelloRawData() );\n }", "public function getFilter();", "function contents_resource_filters($parameter , $url){\n $type = array();\n $category = array();\n $topic = array();\n\n /*\n * find the taxonomies for filters\n */\n $query = db_select(\"taxonomy_term_data\" , \"term_data\");\n $query->fields(\"term_data\" , array(\"tid\" , \"vid\" , \"name\"));\n $query->condition(\"term_data.vid\" , array(30 , 34 , 35) ,\"IN\");\n $query->condition(\"term_data.tid\" , 4058 ,\"<>\");\n $results = $query->execute()->fetchAll();\n\n /*categorize each filter*/\n foreach($results as $result){\n if($result->vid == 30) array_push($type , array(\"tid\" => $result->tid , \"name\" => $result->name));\n if($result->vid == 34) array_push($category , array(\"tid\" => $result->tid , \"name\" => $result->name));\n if($result->vid == 35) array_push($topic , array(\"tid\" => $result->tid , \"name\" => $result->name));\n }\n\n return array(\n array(\"name\" => \"type\", \"children\" => $type),\n array(\"name\" => \"category\", \"children\" => $category),\n array(\"name\" => \"topic\", \"children\" => $topic)\n );\n}", "abstract public function read($filter);", "public function getFilteredResponse()\n {\n $tempCollection = $this->json->features;\n\n if ($this->hits > 0) {\n foreach ($tempCollection as $key => $feature) {\n $filteredPits = [];\n if (property_exists($feature->properties, 'pits')) {\n foreach ($feature->properties->pits as $pit) {\n // filter on both conditions\n if ($this->filters['source'] && $this->filters['type']) {\n if (in_array($pit->dataset, $this->filters['source']) &&\n in_array($pit->type, $this->filters['type'])\n ) {\n // special tgn filter to disregard \"/tgn/term\"\n if (in_array('tgn', $this->filters['source'])) {\n if (strpos($pit->uri, \"/tgn/term/\")) {\n continue;\n }\n }\n $filteredPits[] = $pit;\n }\n }\n // or just one\n elseif ($this->filters['source'] && !$this->filters['type']) {\n if (in_array($pit->dataset, $this->filters['source'])) {\n\n // special tgn filter to disregard \"/tgn/term\"\n if (in_array('tgn', $this->filters['source'])) {\n if (strpos($pit->uri, \"/tgn/term/\")) {\n continue;\n }\n }\n $filteredPits[] = $pit;\n }\n }\n // or the other\n elseif (!$this->filters['source'] && $this->filters['type']) {\n if (in_array($pit->type, $this->filters['type'])) {\n $filteredPits[] = $pit;\n }\n }\n }\n $feature->properties->pits = $filteredPits;\n }\n }\n\n // clean up if there were any features found that have no pits with the required type or source\n foreach ($tempCollection as $key => $col) {\n if (count($col->properties->pits) === 0) {\n unset ($tempCollection[$key]);\n }\n }\n\n return $tempCollection;\n }\n\n return null;\n }", "function stream_get_filters () {}", "function getData() {\n $keys = array('text');\n $this->prepareFilterData($keys);\n return parent::getData();\n }", "function getAllDownload($filter = array(), $limit = '10', $start = '0')\r\n\t{\r\n //SELECT apps.vendor, downloads.* FROM apps JOIN downloads ON apps.app_id=downloads.app_id WHERE `vendor`='Nguyễn Ngọc Ngạn' LIMIT 30\r\n\t\t$sql = \"SELECT * FROM downloads as a\";\r\n\t\t$where = array();\r\n if($filter['vendor'] && $filter['vendor'] != '0') {\r\n $sql .= \" JOIN apps ON a.app_id=apps.app_id\";\r\n $where[] = \"apps.vendor='\" . $filter['vendor'] . \"'\";\r\n }\r\n if(isset($filter['user_id']) && $filter['user_id'] != '0') {\r\n\t\t\t$where[] = \"a.user_id=\" . $filter['user_id'];\r\n\t\t} \r\n\t\tif(isset($filter['app_id']) && $filter['app_id'] != '0') {\r\n\t\t\t$where[] = \"a.app_id=\" . $filter['app_id'];\r\n\t\t}\r\n\t\tif(isset($filter['tym_type']) && $filter['tym_type'] != '0') {\r\n\t\t\t$where[] = \"a.tym_type='\" . $filter['tym_type'] . \"'\";\r\n\t\t}\r\n if(isset($filter['price']) && $filter['price'] != '0') {\r\n\t\t\t$prices = explode('-', $filter['price']);\r\n\t\t\tif($prices[0] != '' && isset($prices[1])) $where[] = \"a.tym_price >= \" . $prices[0];\r\n\t\t\tif($prices[0] != '' && !isset($prices[1])) $where[] = \"a.tym_price = \" . $prices[0];\r\n\t\t\tif(isset($prices[1]) && $prices[1] != '') $where[] = \"a.tym_price <= \" . $prices[1];\r\n\t\t} \r\n\t\tif($filter['starttime'] != '0') {\r\n\t\t\t$start = $filter['starttime'];\r\n\t\t\t$end = $filter['endtime'];\r\n\t\t\t$where[] = \"time >= \" . $start . \" AND time <= \" . $end;\r\n\t\t}\r\n\t\t\r\n\t\tif($where) {\r\n\t\t\t$sql .= ' WHERE ' . implode(' AND ', $where);\r\n\t\t}\r\n\r\n $sort_array = array(\r\n\t\t\t'id',\r\n 'app_id',\r\n\t\t\t'time',\r\n\t\t\t'tym_price',\r\n\t\t\t'tym_type'\r\n \t);\r\n \tif(isset($filter['sort']) && in_array($filter['sort'], $sort_array)) {\r\n \t\t$sql .= \" ORDER BY a.\" . $filter['sort'];\r\n \t} else {\r\n \t\t$sql .= \" ORDER BY a.id\";\r\n \t}\r\n \r\n \t\r\n \tif(isset($filter['order']) && $filter['order'] == 'ASC') {\r\n \t\t$sql .= \" ASC\";\r\n \t} else {\r\n \t\t$sql .= \" DESC\";\r\n \t}\r\n \t\r\n \tif(isset($filter['start']) || isset($filter['limit'])) {\r\n \t\tif($filter['start'] < 0) {\r\n \t\t\t$filter['start'] = 0;\r\n \t\t}\r\n \t\tif($filter['limit'] < 1) {\r\n \t\t\t$filter['limit'] = 20;\r\n \t\t}\r\n \t\t$sql .= \" LIMIT \" . (int)$filter['start'] . \",\" . (int)$filter['limit'];\r\n \t}\r\n \r\n\t\t$query = $this->db->query($sql);\r\n\t\treturn $query->result();\r\n\t}", "public function getCatalogFiltersAction()\r\n {\r\n $attrs = Mage::getModel('emapi/filters')->filterCombinations($this);\r\n\r\n if (Mage::getStoreConfig('api/emapi/filterscompression')) {\r\n $attrs = gzcompress($attrs, 9);\r\n header(\"Content-Type: gzip\");\r\n echo $attrs;\r\n die;\r\n }\r\n else{\r\n header(\"Content-Type: application/json\");\r\n echo $attrs;\r\n die;\r\n }\r\n\r\n }", "abstract public function getFilters();", "public function getTrailerInfo( $trailerId = null ) {\n\t\t$this->db->select('trailers.*,concat(\"Truck-\",vehicles.label) as truckName');\n\t\t$this->db->join('vehicles','vehicles.id = trailers.truck_id','LEFT');\n\t\treturn $this->db->where('trailers.id',$trailerId)->get('trailers')->row_array();\n\t}", "public function getFilteredData() {\r\n $userID = $_SESSION[\"userID\"];\r\n $time = filter_input(INPUT_GET, 'time', FILTER_SANITIZE_STRING); // sollte 1W für 1 Woche sein oder 1M für 1 Monat und 3M für 3 Monate, muss immer angegeben werden\r\n $filter = \"\";\r\n if (filter_input(INPUT_GET, 'categoryid', FILTER_SANITIZE_STRING) == \"all\"){ // solle nur der einzelne string \"all\" sein. bedeutet das alle datas ausgegeben werden sollen\r\n $filter = \"all\";\r\n } else {\r\n $filter = filter_input(INPUT_GET, 'categoryid', FILTER_SANITIZE_STRING); // immer nur eine category id übergeben, alles mit GET\r\n }\r\n\r\n // Hier alles mit GET\r\n $filterdData = $this->dataModel->getTheFilteredData($userID, $time, $filter);\r\n echo json_encode($filterdData);\r\n }", "public function getDescriptions($filter = StreamWrapperInterface::ALL);", "public function getFilters () {\n $filters = array(\n 'appointments' => array(),\n 'dx' => array(),\n 'doctors' => array(),\n\t\t\t'machines' => array(),\n\t\t\t'patients'\t\t => array(),\n 'appointmentStatuses' => array()\n );\n $databaseObj = new Database();\n\n try {\n\n // ***********************************\n // ARIA \n // ***********************************\n $sourceDBSer = 1;\n $source_db_link = $databaseObj->connectToSourceDatabase($sourceDBSer);\n if ($source_db_link) {\n\n $sql = \"\n SELECT DISTINCT\n Doctor.ResourceSer,\n Doctor.LastName\n FROM\n variansystem.dbo.Doctor Doctor,\n variansystem.dbo.PatientDoctor PatientDoctor\n WHERE \n PatientDoctor.PrimaryFlag = 1\n AND PatientDoctor.OncologistFlag = 1\n AND Doctor.OncologistFlag = 1\n AND PatientDoctor.ResourceSer = Doctor.ResourceSer\n\n ORDER BY\n Doctor.LastName\n \";\n $query = $source_db_link->prepare( $sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL) );\n $query->execute();\n \n while ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n $doctorArray = array(\n 'name' => $data[1],\n 'id' => $data[0],\n 'type' => 'Doctor',\n 'added' => 0\n );\n array_push($filters['doctors'], $doctorArray);\n }\n\n $sql = \"\n SELECT DISTINCT\n vr.ResourceSer,\n vr.ResourceName\n FROM \n variansystem.dbo.vv_ResourceName vr\n WHERE\n vr.ResourceName LIKE 'STX%'\n OR vr.ResourceName LIKE 'TB%'\n\n ORDER BY \n vr.ResourceName\n \";\n $query = $source_db_link->prepare( $sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL) );\n $query->execute();\n \n while ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n $machineArray = array(\n 'name' => $data[1],\n 'id' => $data[0],\n 'type' => 'Machine',\n 'added' => 0\n );\n array_push($filters['machines'], $machineArray);\n }\n\n }\n\n // ***********************************\n // WaitRoomManagement \n // ***********************************\n $sourceDBSer = 2;\n $source_db_link = $databaseObj->connectToSourceDatabase($sourceDBSer);\n if ($source_db_link) {\n\n $sql = \"SELECT 'DOCTOR_QUERY_HERE'\";\n // $query = $source_db_link->prepare( $sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL) );\n // $query->execute();\n // while ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n // $doctorArray = array(\n // 'name' => $data[0],\n // 'id' => $data[0],\n // 'type' => 'Doctor',\n // 'added' => 0\n // );\n // array_push($filters['doctors'], $doctorArray);\n // }\n\n $sql = \"SELECT 'MACHINE_QUERY_HERE'\";\n // $query = $source_db_link->prepare( $sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL) );\n // $query->execute();\n // while ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n // $machineArray = array(\n // 'name' => $data[0],\n // 'id' => $data[0],\n // 'type' => 'Machine',\n // 'added' => 0\n // );\n // array_push($filters['machines'], $machineArray);\n // }\n }\n\n // ***********************************\n // Mosaiq \n // ***********************************\n $sourceDBSer = 3;\n $source_db_link = $databaseObj->connectToSourceDatabase($sourceDBSer);\n if ($source_db_link) {\n\n $sql = \"SELECT 'DOCTOR_QUERY_HERE'\";\n // $query = $source_db_link->prepare( $sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL) );\n // $query->execute();\n // while ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n // $doctorArray = array(\n // 'name' => $data[1],\n // 'id' => $data[0],\n // 'type' => 'Doctor',\n // 'added' => 0\n // );\n // array_push($filters['doctors'], $doctorArray);\n // }\n\n $sql = \"SELECT 'MACHINE_QUERY_HERE'\";\n // $query = $source_db_link->prepare( $sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL) );\n // $query->execute();\n // while ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n // $machineArray = array(\n // 'name' => $data[1],\n // 'id' => $data[0],\n // 'type' => 'Machine',\n // 'added' => 0\n // );\n // array_push($filters['machines'], $machineArray);\n // }\n\t\t\t}\n\t\t\t\n\t\t\t// ***********************************\n // OpalDB \n // ***********************************\n\t\t\t$host_db_link = new PDO( OPAL_DB_DSN, OPAL_DB_USERNAME, OPAL_DB_PASSWORD );\n\t\t\t$host_db_link->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n\t\t\tif ($host_db_link) {\n\n\t\t\t\t// Patient Filters\n\t\t\t\t$sql = \"\n\t\t\t\t\tSELECT DISTINCT\n\t\t\t\t\t\tpt.PatientSerNum,\n\t\t\t\t\t\tpt.PatientId,\n\t\t\t\t\t\tpt.FirstName,\n\t\t\t\t\t\tpt.LastName\n\t\t\t\t\tFROM\n\t\t\t\t\t\tPatient pt\n\t\t\t\t\tORDER BY\n\t\t\t\t\t\tpt.PatientSerNum\n\t\t\t\t\";\n\n\t\t\t\t$query = $host_db_link->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));\n\t\t\t\t$query->execute();\n\t\n\t\t\t\twhile ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n\n\t\t\t\t\t$serial \t= $data[0];\n\t\t\t\t\t$patientId \t= $data[1];\n\t\t\t\t\t$firstName \t= $data[2];\n\t\t\t\t\t$lastName \t= $data[3];\n\t\t\t\t\t$patientName = \"$lastName, $firstName ($patientId)\";\n\t\t\t\t\t$patientArray = array(\n\t\t\t\t\t\t'name'\t=> $patientName,\n\t\t\t\t\t\t'id'\t=> $patientId,\n\t\t\t\t\t\t'type' \t=> 'Patient',\n\t\t\t\t\t\t'added'\t=> 0\n\t\t\t\t\t);\n\t\t\t\t\tarray_push($filters['patients'], $patientArray);\n\t\t\t\t}\n\n\t\t\t\t// Diagnosis Filters\n\t\t\t\t$sql = \"\n\t\t\t\t\tSELECT DISTINCT\n\t\t\t\t\t\tdt.Name_EN,\n dt.DiagnosisTranslationSerNum\n\t\t\t\t\tFROM\n\t\t\t\t\t\tDiagnosisTranslation dt\n WHERE\n dt.Name_EN != ''\n\t\t\t\t\";\n\t\t\t\t$query = $host_db_link->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));\n\t\t\t\t$query->execute();\n\n\t\t\t\twhile ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n\t\t\t\t\t$dxArray = array(\n\t\t\t\t\t\t'name' => $data[0],\n\t\t\t\t\t\t'id' => $data[1],\n\t\t\t\t\t\t'type' => 'Diagnosis',\n\t\t\t\t\t\t'added' => 0\n\t\t\t\t\t);\n\n\t\t\t\t\tarray_push($filters['dx'], $dxArray);\n\t\t\t\t}\n\t\n\t\t\t\t// Appointment Filters\n $sql = \"\n SELECT DISTINCT\n\t\t\t\t\t\tAlias.AliasName_EN,\n\t\t\t\t\t\tAlias.AliasSerNum\n FROM \n\t\t\t\t\t\tAlias\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tAlias.AliasType = 'Appointment'\n ORDER BY\n Alias.AliasName_EN\n \";\n\n $query = $host_db_link->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));\n\t\t\t\t$query->execute();\n\n while ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n \n $appointmentDetails = array(\n 'name' => $data[0],\n 'id' => $data[1],\n 'type' => 'Appointment',\n 'added' => 0\n );\n\t\t\t\t\tarray_push($filters['appointments'], $appointmentDetails);\n\t\t\t\t}\n\n // Appointment Status Filters\n $sql = \"\n SELECT DISTINCT\n sa.Name \n FROM\n StatusAlias sa\n \";\n $query = $host_db_link->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));\n $query->execute();\n\n while ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n\n $statusDetails = array(\n 'name' => $data[0],\n 'id' => $data[0],\n 'type' => 'AppointmentStatus',\n 'added' => 0\n );\n array_push($filters['appointmentStatuses'], $statusDetails);\n }\n\n // Manually add checked in flag\n $statusDetails = array(\n 'name' => 'Checked In',\n 'id' => 1,\n 'type' => 'CheckedInFlag',\n 'added' => 0\n );\n array_push($filters['appointmentStatuses'], $statusDetails);\n\t\t\t}\n\n return $filters;\n\n } catch (PDOException $e) {\n\t\t\techo $e->getMessage();\n\t\t\treturn $filters;\n\t\t}\n }", "function getGSFiles_filteredBy_TEST($fn,$filters) {\n\n $filter = array_merge(array('user_id' => $_SESSION['User']['id']),$filters);\n\n $fileDMP = DMP_http(\"get\",\"file\",$filter);\n\n // convert DMP file to VRE file\n list($fileData,$fileMeta) = getVREfile_fromFile($fileDMP);\n\n // return VRE file according filter\n\n\tif (empty($fileData))\n\t\treturn 0;\n\n\telseif (empty($fileMeta))\n\t\treturn $fileData;\n\telse\n\t\treturn array_merge($fileData,$fileMeta);\t\n}", "public function getFilter(): array;", "public function getTrailers()\n {\n $s3 = new S3Client([\n 'version' => 'latest',\n 'region' => 'eu-west-3',\n 'credentials' => [\n 'key' => getenv('KEY'),\n 'secret' => getenv('SECRET'),\n 'token' => null,\n 'expires' => null,\n ],\n ]);\n\n // El numero de trailers que tiene cada juego en AmazonS3\n switch ($this->id) {\n case 1:\n case 2:\n $numeroTrailers = 2;\n break;\n case 3:\n $numeroTrailers = 3;\n break;\n default:\n $numeroTrailers = 0;\n }\n\n $carpeta = str_replace(' ', '_', $this->titulo) . '/Trailers';\n\n $urlTrailers = [];\n\n if (getenv('MEDIA')) {\n for ($i = 1; $i <= $numeroTrailers; $i++) {\n $cmd = $s3->getCommand('GetObject', [\n 'Bucket' => 'gamesandfriends',\n 'Key' => 'Juegos/' . $carpeta . '/trailer' . $i . '.mp4',\n ]);\n\n $urlTrailers[] = (string) $s3->createPresignedRequest($cmd, '+20 minutes')->getUri();\n }\n }\n\n return $urlTrailers;\n }", "function walkSNMPcsv($filter=array())\n\t \t{\n\t \treturn $this->lastwalk_csv;\n\t \t}", "function print_filters($filtertype = '', $id = 0)\n {\n global $ilance, $ilconfig, $phrase, $iltemplate, $area_title, $page_title, $parts, $official_time, $phrase, $ilpage;\n if ($filtertype == 'service')\n {\n $result_bidtop = $ilance->db->query(\"\n SELECT filter_rating, filtered_rating, filter_country, filtered_country, filter_state, filtered_state, filter_city, filtered_city, filter_zip, filtered_zip, filter_underage, filter_businessnumber, UNIX_TIMESTAMP(date_end) - UNIX_TIMESTAMP('\" . DATETIME24H . \"') AS mytime, UNIX_TIMESTAMP(date_starts) - UNIX_TIMESTAMP('\" . DATETIME24H . \"') AS starttime\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . intval($id) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($result_bidtop) > 0)\n {\n $filter_permissions = '';\n while ($row = $ilance->db->fetch_array($result_bidtop, DB_ASSOC))\n {\n ($apihook = $ilance->api('construct_bidfilter_permissions_service_start')) ? eval($apihook) : false;\n \n if (!empty($_SESSION['ilancedata']['user']['userid']))\n {\n if ($row['filter_rating'])\n {\n $memberinfo = array();\n $memberinfo = $ilance->feedback->datastore($_SESSION['ilancedata']['user']['userid']);\n if ($memberinfo['rating'] >= intval($row['filtered_rating']))\n {\n $filter_permissions .= '<div>{_overall_rating_of_at_least} <strong>' . $row['filtered_rating'] . ' {_stars}</strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/checkmark.gif\" border=\"0\" alt=\"{_you_meet_this_requirement}\" /></div>';\n }\n else\n {\n $filter_permissions .= '<div>{_overall_rating_of_at_least} <strong>' . $row['filtered_rating'] . ' {_stars}</strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/delete.gif\" border=\"0\" alt=\"{_you_do_not_meet_this_requirement}\" /></div>';\n }\n }\n if ($row['filter_country'] AND !empty($row['filtered_country']))\n {\n $cfiltered = mb_strtolower(stripslashes($row['filtered_country']));\n $countryname = mb_strtolower($ilance->common_location->print_user_country($_SESSION['ilancedata']['user']['userid'], $_SESSION['ilancedata']['user']['slng']));\n if ($cfiltered == $countryname)\n {\n $filter_permissions .= '<div>{_bidders_country_must_be_located_in} <strong>' . ucwords($cfiltered) . ' </strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/checkmark.gif\" border=\"0\" alt=\"{_you_meet_this_requirement}\" /></div>';\n }\n else\n {\n $filter_permissions .= '<div>{_bidders_country_must_be_located_in} <strong>' . ucwords($cfiltered) . ' </strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/delete.gif\" border=\"0\" alt=\"{_you_do_not_meet_this_requirement}\" /></div>';\n }\n }\n if ($row['filter_state'] AND !empty($row['filtered_state']))\n {\n $sfiltered = mb_strtolower($row['filtered_state']);\n $cstate = mb_strtolower($_SESSION['ilancedata']['user']['state']);\n if ($cstate == $sfiltered)\n {\n $filter_permissions .= '<div>{_bidders_state_province_must_be_located_in} <strong>' . ucwords($sfiltered) . ' </strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/checkmark.gif\" border=\"0\" alt=\"{_you_meet_this_requirement}\" /></div>';\n }\n else\n {\n $filter_permissions .= '<div>{_bidders_state_province_must_be_located_in} <strong>' . ucwords($sfiltered) . ' </strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/delete.gif\" border=\"0\" alt=\"{_you_do_not_meet_this_requirement}\" /></div>';\n }\n }\n if ($row['filter_city'] AND !empty($row['filtered_city']))\n {\n $cityfiltered = mb_strtolower($row['filtered_city']);\n $ccity = mb_strtolower($_SESSION['ilancedata']['user']['city']);\n if ($ccity == $cityfiltered)\n {\n $filter_permissions .= '<div>{_bidders_city_must_be_located_in} <strong>' . ucwords($cityfiltered) . ' </strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/checkmark.gif\" border=\"0\" alt=\"{_you_meet_this_requirement}\" /></div>';\n }\n else\n {\n $filter_permissions .= '<div>{_bidders_city_must_be_located_in} <strong>' . ucwords($cityfiltered) . ' </strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/delete.gif\" border=\"0\" alt=\"{_you_do_not_meet_this_requirement}\" /></div>';\n }\n }\n if ($row['filter_zip'] AND !empty($row['filtered_zip']))\n {\n $zipfiltered = mb_strtolower($row['filtered_zip']);\n $czip = mb_strtolower($_SESSION['ilancedata']['user']['postalzip']);\n if ($czip == $zipfiltered)\n {\n $filter_permissions .= '<div>{_bidders_zip_postal_code_must_be_located_in} <strong>' . mb_strtoupper($zipfiltered) . ' </strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/checkmark.gif\" border=\"0\" alt=\"{_you_meet_this_requirement}\" /></div>';\n }\n else\n {\n $filter_permissions .= '<div>{_bidders_zip_postal_code_must_be_located_in} <strong>' . mb_strtoupper($zipfiltered) . ' </strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/delete.gif\" border=\"0\" alt=\"\" /></div>';\n }\n }\n if ($row['filter_underage'])\n {\n \n }\n if ($row['filter_businessnumber'])\n {\n \n }\n }\n }\n }\n }\n else if ($filtertype == 'product')\n {\n $result_bidtop = $ilance->db->query(\"\n SELECT filter_rating, filtered_rating, filter_country, filtered_country, filter_state, filtered_state, filter_city, filtered_city, filter_zip, filtered_zip, filter_underage, filter_businessnumber, UNIX_TIMESTAMP(date_end) - UNIX_TIMESTAMP('\" . DATETIME24H . \"') AS mytime, UNIX_TIMESTAMP(date_starts) - UNIX_TIMESTAMP('\" . DATETIME24H . \"') AS starttime\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . intval($id) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($result_bidtop) > 0)\n {\n $filter_permissions = '';\n while ($row = $ilance->db->fetch_array($result_bidtop, DB_ASSOC))\n {\n ($apihook = $ilance->api('construct_bidfilter_permissions_product_start')) ? eval($apihook) : false;\n \n if (!empty($_SESSION['ilancedata']['user']['userid']))\n {\n if ($row['filter_rating'])\n {\n $memberinfo = array();\n $memberinfo = $ilance->feedback->datastore($_SESSION['ilancedata']['user']['userid']);\n if ($memberinfo['rating'] >= intval($row['filtered_rating']))\n {\n $filter_permissions .= '<div>{_overall_rating_of_at_least} <strong>' . $row['filtered_rating'] . ' {_stars}</strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/checkmark.gif\" border=\"0\" alt=\"{_you_meet_this_requirement}\" /></div>';\n }\n else\n {\n $filter_permissions .= '<div>{_overall_rating_of_at_least} <strong>' . $row['filtered_rating'] . ' {_stars}</strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/delete.gif\" border=\"0\" alt=\"{_you_do_not_meet_this_requirement}\" /></div>';\n }\n }\n if ($row['filter_country'] AND !empty($row['filtered_country']))\n {\n $cfiltered = mb_strtolower(stripslashes($row['filtered_country']));\n $countryname = mb_strtolower($ilance->common_location->print_user_country($_SESSION['ilancedata']['user']['userid'], $_SESSION['ilancedata']['user']['slng']));\n if ($cfiltered == $countryname)\n {\n $filter_permissions .= '<div>{_bidders_country_must_be_located_in} <strong>' . ucwords($cfiltered) . ' </strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/checkmark.gif\" border=\"0\" alt=\"{_you_meet_this_requirement}\" /></div>';\n }\n else\n {\n $filter_permissions .= '<div>{_bidders_country_must_be_located_in} <strong>' . ucwords($cfiltered) . ' </strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/delete.gif\" border=\"0\" alt=\"{_you_do_not_meet_this_requirement}\" /></div>';\n }\n }\n if ($row['filter_state'] AND !empty($row['filtered_state']))\n {\n $sfiltered = mb_strtolower($row['filtered_state']);\n $cstate = mb_strtolower($_SESSION['ilancedata']['user']['state']);\n if ($cstate == $sfiltered)\n {\n $filter_permissions .= '<div>{_bidders_state_province_must_be_located_in} <strong>' . ucwords($sfiltered) . ' </strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/checkmark.gif\" border=\"0\" alt=\"{_you_meet_this_requirement}\" /></div>';\n }\n else\n {\n $filter_permissions .= '<div>{_bidders_state_province_must_be_located_in} <strong>' . ucwords($sfiltered) . ' </strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/delete.gif\" border=\"0\" alt=\"{_you_do_not_meet_this_requirement}\" /></div>';\n }\n }\n if ($row['filter_city'] AND !empty($row['filtered_city']))\n {\n $cityfiltered = mb_strtolower($row['filtered_city']);\n $ccity = mb_strtolower($_SESSION['ilancedata']['user']['city']);\n if ($ccity == $cityfiltered)\n {\n $filter_permissions .= '<div>{_bidders_city_must_be_located_in} <strong>' . ucwords($cityfiltered) . ' </strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/checkmark.gif\" border=\"0\" alt=\"{_you_meet_this_requirement}\" /></div>';\n }\n else\n {\n $filter_permissions .= '<div>{_bidders_city_must_be_located_in} <strong>' . ucwords($cityfiltered) . ' </strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/delete.gif\" border=\"0\" alt=\"{_you_do_not_meet_this_requirement}\" /></div>';\n }\n }\n if ($row['filter_zip'] AND !empty($row['filtered_zip']))\n {\n $zipfiltered = mb_strtolower($row['filtered_zip']);\n $czip = mb_strtolower($_SESSION['ilancedata']['user']['postalzip']);\n if ($czip == $zipfiltered)\n {\n $filter_permissions .= '<div>{_bidders_zip_postal_code_must_be_located_in} <strong>' . mb_strtoupper($zipfiltered) . ' </strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/checkmark.gif\" border=\"0\" alt=\"{_you_meet_this_requirement}\" /></div>';\n }\n else\n {\n $filter_permissions .= '<div>{_bidders_zip_postal_code_must_be_located_in} <strong>' . mb_strtoupper($zipfiltered) . ' </strong> <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/delete.gif\" border=\"0\" alt=\"\" /></div>';\n }\n }\n if ($row['filter_underage'])\n {\n }\n if ($row['filter_businessnumber'])\n {\n }\n }\n }\n }\n }\n if (!empty($filter_permissions))\n {\n return $filter_permissions;\n }\n }", "public function Filter($filter=null){\n $results = $this->where(function($query) use ($filter){\n if($filter){\n $query->where('cliente','LIKE',\"%{$filter}%\" or 'vendedor','LIKE',\"%{$filter}%\" or 'data','LIKE',\"%{$filter}%\")->orderBy(\"%{$filter}%\", 'desc')->get() ;\n }\n });\n return $results;\n }", "function exportCSV($filter = array())\r\n\t{\r\n\t\t$this->load->dbutil();\r\n\t\t\r\n\t\tif($filter['start'] != '0') {\r\n\t\t\t$where = \"time <= \" . $filter['end'] . \" AND time >= \" . $filter['start'];\r\n\t\t\t$this->db->where($where);\r\n\t\t}\r\n\t\t\r\n\t\t$query = $this->db->get('downloads');\r\n\t\techo $this->dbutil->csv_from_result($query);\t\t\r\n\t}", "public function toFilter();", "public function videoTrendingWiseFilter(Request $request) {\n\n $video_status = $request->category_id;\n $click = $request->click;\n if($video_status == 'trending') {\n $end = Carbon::now();\n $start = $end->subDays(7); \n $lastSevenDaysMostViewsRecord = Video::whereBetween('created_at',[$start,Carbon::now()])->orderBy('view','DESC')->limit(5)->get();\n $data['getRelatedVideos'] = $lastSevenDaysMostViewsRecord;\n $data['getVideoInfo'] = $getVideoInfo = Video::whereBetween('created_at',[$start,Carbon::now()])->orderBy('view','DESC')->first();\n $current_url = url('video/watch/'.base64_encode( $getVideoInfo->id));\n $updateViewCount = Video::where('id',$getVideoInfo->id)\n ->update(['view'=>(++$getVideoInfo->view)]);\n if(!empty($getVideoInfo->lyrics_file)) {\n try {\n if($getVideoInfo->category_id == 2 || $getVideoInfo->category_id == 4 ) {\n $data['lyrics_data'] = $lyrics_data = (new FastExcel)->import(public_path(\"download\".'/'.$getVideoInfo->getCategoryName->name.'/'.$getVideoInfo->lyrics_file));\n // $lyrics_file_data = explode('/', $getVideoInfo->lyrics_file);\n $lyricsFileName = preg_replace('/\\s+/', '_',$getVideoInfo->mp3_file);\n $getLyricsFileName = explode('.', $lyricsFileName);\n $filename = $getLyricsFileName[0];\n if($file_name = $getVideoInfo->lyrics_file) {\n $data['file_name'] = $file_name.\".txt\";\n $fileExistsCheck = public_path().\"/download/lyrics_file/\".$file_name.\".txt\";\n $myfile = file_exists($fileExistsCheck);\n }if($myfile==false) {\n $file_data ='' ;\n $file = $getLyricsFileName[0];\n $destinationPath=public_path().\"/download/lyrics_file/\";\n if (!is_dir($destinationPath)) { mkdir($destinationPath,0777,true); }\n $data['file_name'] = $file.\".txt\";\n $file_path = $destinationPath.$file.\".txt\";\n File::put( $file_path,$file_data);\n if(!empty($file_path)) {\n $myfile = fopen($file_path, \"a\") or die(\"Unable to open file!\");\n foreach ($lyrics_data as $key => $value) {\n $txt = $value['text'];\n fwrite($myfile, \"\\r\\n\". $txt);\n }\n fclose($myfile);\n }\n }\n }else {\n $data['file_name']= $file_name = $getVideoInfo->lyrics_file;\n }\n }\n catch(\\Exception $e) {\n return $e;\n }\n }\n \n $data['getCount'] = $getCount = LikeDislike::where('video_id',$getVideoInfo->id)->select(DB::raw('SUM(likes) as likes'),DB::raw('SUM(dislikes) as dislikes'))->get();\n $content = \\View::make('vdopedia.render.trending_videos')->with($data);\n $content = $content->render();\n return response()->json([\n 'html'=> $content,\n 'status'=>true,\n 'video_count'=>count($lastSevenDaysMostViewsRecord),\n 'id' => 'video_id'.$click,\n 'first_video_play_id'=>$getVideoInfo->id,\n 'category_id' =>$getVideoInfo->category_id,\n 'current_url'=>$current_url,\n\n ],200);\n }\n }", "function getEntryList($filter = array(), $sorting = \"Ascending\") {\n\t\t//ngay tao = new: ngay tao cach khoang vai ngay so voi ngay hien tai\n\t\t//filter array: (\"Filter\"=>\"Criteria\",\"Filter\"=>\"Criteria\")\n\t\t//For example: (\"A\"=>\"ABC\") or (\"Action\"=>\"Category\")\n\t\t//Sorting (\"Ascending\"/\"Descending\"=>\"Criteria\"), for ex: (\"Ascending\"=>\"ABC\")\n\t\t// readfile(\"././views/list_novel.php\");\n\t\t$model = new NovelModel;\n\t\t$res = $model->getEntryList($filter);\n\t\treadfile(\"././views/part1.php\");\n\t\tforeach ($res as $row) {\n\t\t\t$name = $row['ten'];\n\t\t\t$link = $this->makeLink($row['id']);\n\t\t\techo '<tr><td><a class=\"alink\" href=\"/enovel/novel/'.$link.'\">'.$name.'</a></td>';\n\t\t\techo '<td>Chapter 1</td>';\n\t\t\techo \"<td>31/12/2017</td>\";\n\t\t\t$res = $model->getViewCount($row[\"id\"]);\n\t\t\techo '<td class=\"text-center\">'.$res.'</td></tr>';\n\t\t}\n\t\treadfile(\"././views/part2.php\");\n\t\t// if($filter[\"filter\"]=\"yes\"){\n\t\t// \t//Vi filter chua lam xong nen controller tu get data.\n\t\t// }\n\t}", "public function get_sppm_filter($filter) {\r\n $sql = \"SELECT PAYMENT_DATE , INVOICE_NUM, CHECK_DATE, to_char(CREATION_DATE,'dd-mm-yyyy hh24:mi:ss') CREATION_DATE, \r\n\t\t\t\tCHECK_NUMBER, CHECK_NUMBER_LINE_NUM, CHECK_AMOUNT, BANK_ACCOUNT_NAME ,\r\n\t\t\t\tBANK_NAME, VENDOR_EXT_BANK_ACCOUNT_NUM, VENDOR_NAME, \r\n\t\t\t\tINVOICE_DESCRIPTION, FTP_FILE_NAME, RETURN_DESC, RETURN_CODE, KDKPPN, PAYMENT_METHOD, SORBOR_NUMBER, SORBOR_DATE\r\n\t\t\t\tFROM \" . $this->_table . \"\r\n\t\t\t\tWHERE FL_VOID <> 1 \r\n AND PAYMENT_DATE BETWEEN TO_DATE ('\".Session::get('ta').\"0101','YYYYMMDD') AND TO_DATE ('\".Session::get('ta').\"1231','YYYYMMDD') \";\r\n //SP2D = 140181301002823\r\n //xml = 520002000990_SP2D_O_20140408_101509_367.xml\r\n $no = 0;\r\n //var_dump($filter);\r\n foreach ($filter as $filter) {\r\n $sql .= \" AND \" . $filter;\r\n }\r\n $sql .= \" ORDER BY PAYMENT_DATE DESC, CREATION_DATE DESC\";\r\n //var_dump ($sql);\r\n $result = $this->db->select($sql);\r\n $data = array();\r\n foreach ($result as $val) {\r\n $d_data = new $this($this->registry);\r\n $d_data->set_payment_date(date(\"d-m-Y\", strtotime($val['PAYMENT_DATE'])));\r\n $d_data->set_invoice_num($val['INVOICE_NUM']);\r\n $d_data->set_check_date(date(\"d-m-Y\", strtotime($val['CHECK_DATE'])));\r\n $d_data->set_creation_date($val['CREATION_DATE']);\r\n $d_data->set_check_number($val['CHECK_NUMBER']);\r\n $d_data->set_check_number_line_num($val['CHECK_NUMBER_LINE_NUM']);\r\n\t\t\t$d_data->set_check_amount(($val['CHECK_AMOUNT']));\r\n $d_data->set_bank_account_name($val['BANK_ACCOUNT_NAME']);\r\n $d_data->set_bank_name($val['BANK_NAME']);\r\n $d_data->set_vendor_ext_bank_account_num($val['VENDOR_EXT_BANK_ACCOUNT_NUM']);\r\n $d_data->set_vendor_name($val['VENDOR_NAME']);\r\n $d_data->set_invoice_description($val['INVOICE_DESCRIPTION']);\r\n $d_data->set_ftp_file_name($val['FTP_FILE_NAME']);\r\n $d_data->set_return_code($val['RETURN_CODE']);\r\n $d_data->set_return_desc($val['RETURN_DESC']);\r\n $d_data->set_payment_method($val['PAYMENT_METHOD']);\r\n $d_data->set_kdkppn($val['KDKPPN']);\r\n if (is_null($val['SORBOR_NUMBER'])) {\r\n $d_data->set_sorbor_number('-');\r\n } else {\r\n $d_data->set_sorbor_number($val['SORBOR_NUMBER']);\r\n }\r\n if (is_null($val['SORBOR_DATE'])) {\r\n $d_data->set_sorbor_date('-');\r\n } else {\r\n $d_data->set_sorbor_date(date(\"d-m-Y\", strtotime($val['SORBOR_DATE'])));\r\n }\r\n $data[] = $d_data;\r\n\t\t\t//var_dump($d_data);\r\n }\r\n return $data;\r\n }", "function filter_data($data, $filter) {\n\treturn CMContent::Filter($data, $filter);\n}", "function allFilterLog($filter) {\n\t\t$sql = \"SELECT * FROM exchange_log as a\";\n\n\t\t$where = array();\n\t\t\n\t\tif($filter['startdate'] != '0') {\n\t\t\t$startdate = $filter['startdate'];\n\t\t\t$enddate = $filter['enddate'];\n\t\t\t$where[] = 'time >= ' . $startdate . ' AND time <= ' . $enddate;\n\t\t}\n\t\t\n\t\tif(isset($filter['user_id']) && $filter['user_id'] != '-1') {\n\t\t\t$where[] = \"a.user_id=\" . $filter['user_id'];\n\t\t}\n\t\tif(isset($filter['username']) && $filter['username'] != '-1') {\n\t\t\t$where[] = \"a.username LIKE '%\" . $filter['username'] . \"%'\";\n\t\t}\n if(isset($filter['tx_type']) && $filter['tx_type'] != '-1') {\n\t\t\t$where[] = \"a.tx_type LIKE '%\" . $filter['tx_type'] . \"%'\";\n\t\t}\n\t\t\n\t\tif($where) {\n\t\t\t$sql .= \" WHERE \" . implode(\" AND \", $where);\n\t\t}\n\n\t\t$sort_array = array(\n\t\t\t'id',\n\t\t\t'user_id',\n \t\t'username',\n \t\t'tx_type'\n \t);\n \tif(isset($filter['sortby']) && in_array($filter['sortby'], $sort_array)) {\n \t\t$sql .= \" ORDER BY a.\" . $filter['sortby'];\n \t} else {\n \t\t$sql .= \" ORDER BY a.id\";\n \t}\n \tif(isset($filter['order']) && $filter['order'] == 'ASC') {\n \t\t$sql .= \" ASC\";\n \t} else {\n \t\t$sql .= \" DESC\";\n \t}\n \tif(isset($filter['page']) || isset($filter['limit'])) {\n \t\tif($filter['start'] < 0) {\n \t\t\t$filter['start'] = 0;\n \t\t}\n \t\tif($filter['limit'] < 1) {\n \t\t\t$filter['limit'] = 50;\n \t\t}\n \t\t$sql .= \" LIMIT \" . (int)$filter['start'] . \",\" . (int)$filter['limit'];\n \t}\n \t$query = $this->dbuser->query($sql);\n \treturn $query->result();\t\t\n\t}" ]
[ "0.5857689", "0.56560796", "0.5492198", "0.54868627", "0.5431479", "0.54039323", "0.5398325", "0.5335638", "0.5332673", "0.5293957", "0.5290967", "0.52741873", "0.5212503", "0.5191473", "0.5183173", "0.51714796", "0.5162156", "0.5135631", "0.51247185", "0.51063716", "0.5090248", "0.5087697", "0.50847507", "0.5083952", "0.5082813", "0.5060355", "0.5054238", "0.50337666", "0.5033419", "0.5022969" ]
0.57367283
1
this function to get get_team_leader data by filter
public function get_team_leader(Request $request) { $term = trim($request->q); $user_id = session("ID"); $data_json = $this->call_api_by_parameter("webGetTeamLeaderFilterGroup", ['Name' => $term, "UserID" => $user_id]); $json = []; if ($data_json) { $decode = json_decode($data_json); if ($decode->id) { return response()->json($decode->data); } else { return response()->json($json); } } return response()->json([ 'error' => "You are losing your connection" ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_team_leaders() {\n return get_users(\"super\");\n}", "function get_all_team_names(){\r\n\t$cond[] = array(\"col\" => \"active\", \"value\" => 0);\r\n\r\n\t$fields = array('ID', 'teamname');\r\n\t$result = uli_get_results('teams', $cond, $fields);\r\n\tif ($result){\r\n\t\tforeach ($result as $name){\r\n\t\t\t$teamname[$name['ID']] = $name['teamname'];\r\n\t\t}}\r\n\t\tif ($teamname){return $teamname;}\r\n\t\telse {return FALSE;}\r\n}", "function getLeaderData($currentleader){\n \n $sql = \" SELECT name,email FROM d_user WHERE user_id IN ($currentleader) \";\n return $this->db->get_results($sql,array($currentleader));\n }", "function teams_get_leader($groupid) {\n global $DB;\n\n return $DB->get_field('block_teams', 'leaderid', array('groupid' => $groupid));\n}", "function get_team_leader($user_id=NULL) {\n if (!$user_id)\n $user_id = $_SESSION['user_id'];\n\n //Check to make sure that you're not a tl\n if (check_supervisor($user_id))\n return $user_id;\n\n //Also, if you're an admin...\n if (check_app_admin($user_id))\n return $user_id;\n \n else {\n $sql = \"SELECT tl_id FROM teams WHERE user_id=\".$user_id;\n $result = $_SESSION['dbconn']->query($sql) or die(\"Error checking team membership\");\n\n if ($result->num_rows!=0) {\n $out = $result->fetch_array();\n return $out[0];\n }\n else\n return false;\n }\n}", "function teams_get_teams($userid = 0) {\n global $DB, $COURSE, $USER;\n\n if (!$userid) {\n $userid = $USER->id;\n }\n\n if (!groups_get_all_groups($COURSE->id, $userid)) {\n return false;\n }\n\n $sql = \"\n SELECT DISTINCT\n g.*,\n t.leaderid,\n t.openteam\n FROM\n {groups} g,\n {groups_members} gm,\n {block_teams} t\n WHERE\n g.id = gm.groupid AND\n g.id = t.groupid AND\n (gm.userid = ? OR\n t.openteam = 1) AND\n t.courseid = ?\n \";\n return $DB->get_records_sql($sql, array($userid, $COURSE->id));\n}", "function teams() {\n\t\tglobal $db;\n\n\t\t$sql = \"\n\t\tSELECT\n\t\t\tuser.username as username,\n\t\t\tuser.id as user_id,\n\t\t\tstl_players.team_id as team_id,\n\t\t\tstl_positions.*\n\t\tFROM stl_players\n\t\t\tLEFT JOIN user\n\t\t\t\tON\n\t\t\t\tuser.id = stl_players.user_id\n\t\t\tINNER JOIN stl_positions\n\t\t\t\tON\n\t\t\t\tstl_players.user_id = stl_positions.ship_user_id\n\t\tWHERE\n\t\t\tstl_players.game_id = '$_GET[game_id]'\n\t\t\tAND\n\t\t\tstl_positions.game_id = '$_GET[game_id]'\n\n\n\t\t\";\n\t\t$result = $db->query($sql,__FILE__,__LINE__);\n\t\t$add1 = \"<b>\";\n\t\twhile($rs = $db->fetch($result)) {\n\t\t\t$add1 = ($rs['hit_user_id']) ? \"<b style='text-decoration: line-through'>\" : \"<b>\";\n\t\t\tif($rs['team_id'] == 0) {\n\t\t\t\t$this->data['team_gelb'] .= $add1.$rs['username'].\"</b><br>\";\n\t\t\t} else {\n\t\t\t\t$this->data['team_gruen'] .= $add1.$rs['username'].\"</b><br>\";\n\t\t\t}\n\t\t}\n\n\t}", "public function getTeams($filter)\n {\n // need work\n return $this->sendRequest('GET', 'teams', $filter);\n }", "public static function display_team_finder() {\n global $post;\n $arg = array(\n 'post_type' => 'teams',\n 'post_status' => 'any',\n 'numberposts' => -1,\n 'orderby' => 'date',\n\t 'order' => 'DESC',\n );\n $teams = get_posts($arg);\n\n $all_team_type = get_terms(array(\n 'taxonomy' => 'teams-type',\n 'hide_empty' => false\n ));\n\n $all_region = get_terms(array(\n 'taxonomy' => 'valorant-server',\n 'hide_empty' => false\n ));\n\n $all_ranks = get_terms(array(\n 'taxonomy' => 'rank-requirement',\n 'hide_empty' => false\n ));\n \n $ages = WP_STREAMERS_TEAMS::$age_requirement_list;\n $agents = WP_STREAMERS_TEAMS::$streamer_preferred_agent;\n $current_team = self::get_current_streamer_team();\n $is_draft = get_post_meta('is_draft', $post->ID, true);\n ob_start();\n require_once plugin_dir_path(__DIR__).'templates/team-finder.php';\n wp_reset_postdata();\n return ob_get_clean();\n }", "public function get_teams_from_leagues()\n {\n global $wpdb;\n return $wpdb->get_results($wpdb->prepare(\"SELECT c.name as club_name, t.id as team_id, l.year as league_year, l.name as league_name\n FROM $wpdb->team t, $wpdb->club c, $wpdb->league l\n WHERE t.id_league = l.id\n AND t.id_club = c.id\n ORDER BY l.year DESC, l.name ASC, l.id ASC\", array())\n );\n }", "public function fetch_team( $admin_id ) {\r\n $statement = $this->db->query(\"SELECT * FROM `team_members`\r\n LEFT JOIN member_designation ON member_designation.member_deg_id = team_members.`member_deg_id`\r\n WHERE `admin_user_id` = $admin_id\");\r\n \r\n \r\n $statement->setFetchMode(PDO::FETCH_ASSOC); \r\n $results = array(); \r\n while( $row = $statement->fetch() ) { \r\n $results[] = $row; \r\n }\r\n return $results; \r\n }", "public function getLeaderBoard() {\n\t\t$query = \"SELECT game_id, person.person_id, person.person_name, sum(points + bonus_points) AS score \" .\n\t\t\t\"FROM person_table JOIN person ON person_table.person_id = person.person_id \" .\n\t\t\t\"JOIN (SELECT answer.team_id, round.round_id, sum(answer_is_correct - 1) AS points FROM answer JOIN question ON question.question_id = answer.question_id JOIN round ON question.round_id = round.round_id WHERE round.game_id =:game_id1 AND answer_is_correct > 0 GROUP BY team_id, round_id) AS normalpts ON normalpts.team_id = person_table.team_id AND normalpts.round_id = person_table.round_id \" .\n\t\t\t\"JOIN team_round ON team_round.team_team_id = person_table.team_id AND team_round.round_round_id = person_table.round_id \" .\n\t\t\t\"WHERE person.game_id =:game_id2 \" .\n\t\t\t\"GROUP BY game_id, person_id ORDER BY score DESC\";\n\t\t$data = array('game_id1' => $this -> get_game_id(), 'game_id2' => $this -> get_game_id());\n\t\t$sth = database::$dbh -> prepare($query);\n\t\t$sth -> execute($data);\r\n\t\t$rows = $sth -> fetchAll(PDO::FETCH_ASSOC);\n\t\treturn $rows;\n\t}", "function get_players(){\r\n\t$cond[] = array(\"col\" => \"team\", \"value\" => \"999\", \"func\" => \"!=\");\r\n\t$players = uli_get_results('player', $cond);\r\n\tif ($players){return $players;}\r\n\telse {return FALSE;}\r\n}", "function get_team() {\n if($_SERVER['REQUEST_METHOD'] == 'GET') { \n global $wpdb;\n\n //ARRAY_A outputs numerically indexed array of associative arrays with column names as keys\n $lw_result_array = $wpdb->get_results( \"SELECT lw.name, lw.nhlId, lw.number, lw.teamAbbr FROM rma_all_players AS lw WHERE position = 'Left Wing' AND active = 1 ORDER BY rand() LIMIT 4\", ARRAY_A );\n $c_result_array = $wpdb->get_results( \"SELECT c.name, c.nhlId, c.number, c.teamAbbr FROM rma_all_players AS c WHERE position = 'Center' AND active = 1 ORDER BY rand() LIMIT 4\", ARRAY_A );\n $rw_result_array = $wpdb->get_results( \"SELECT rw.name, rw.nhlId, rw.number, rw.teamAbbr FROM rma_all_players AS rw WHERE position = 'Right Wing' AND active = 1 ORDER BY rand() LIMIT 4\", ARRAY_A );\n $d_result_array = $wpdb->get_results( \"SELECT d.name, d.nhlId, d.number, d.teamAbbr FROM rma_all_players AS d WHERE position = 'Defenseman' AND active = 1 ORDER BY rand() LIMIT 6\", ARRAY_A );\n $g_result_array = $wpdb->get_results( \"SELECT g.name, g.nhlId, g.number, g.teamAbbr FROM rma_all_players AS g WHERE position = 'Goalie' AND active = 1 ORDER BY rand() LIMIT 2\", ARRAY_A );\n\n //Save arrays to session to hold data if user wants to post a team and isn't logged in\n $_SESSION['lw_array'] = $lw_result_array;\n $_SESSION['c_array'] = $c_result_array;\n $_SESSION['rw_array'] = $rw_result_array;\n $_SESSION['d_array'] = $d_result_array;\n $_SESSION['g_array'] = $g_result_array;\n\n //If the data is missing, show an error message. Otherwise, output the team \n if(!$lw_result_array || !$c_result_array || !$rw_result_array || !$d_result_array || !$g_result_array) {\n echo \"<h2>Oops! Something went wrong ...</h2>\";\n } else {\n\n echo \"<div class='team'>\n \n <h2>Forwards</h2>\n\n <div class='flex-container row'>\n\n <div class='player forward col-4'>\" . $lw_result_array[0][name][0] . \". \" . strstr(($lw_result_array[0][name]), ' ') . \"<p>#\" . $lw_result_array[0][number] . \" \" . $lw_result_array[0][teamAbbr] . \" \" . \"</div>\n <div class='player forward col-4'>\" . $c_result_array[0][name][0] . \". \" . strstr(($c_result_array[0][name]), ' ') . \"<p>#\" . $c_result_array[0][number] . \" \" . $c_result_array[0][teamAbbr] . \" \" . \"</div>\n <div class='player forward col-4'>\". $rw_result_array[0][name][0] . \". \" . strstr(($rw_result_array[0][name]), ' ') . \"<p>#\" . $rw_result_array[0][number] . \" \" . $rw_result_array[0][teamAbbr] . \"</div>\n \n </div>\n\n <div class='flex-container row'>\n\n <div class='player forward col-4'>\" . $lw_result_array[1][name][0] . \". \" . strstr(($lw_result_array[1][name]), ' ') . \"<p>#\" . $lw_result_array[1][number] . \" \" . $lw_result_array[1][teamAbbr] . \" \" . \"</div>\n <div class='player forward col-4'>\" . $c_result_array[1][name][0] . \". \" . strstr(($c_result_array[1][name]), ' ') . \"<p>#\" . $c_result_array[1][number] . \" \" . $c_result_array[1][teamAbbr] . \" \" . \"</div>\n <div class='player forward col-4'>\". $rw_result_array[1][name][0] . \". \" . strstr(($rw_result_array[1][name]), ' ') . \"<p>#\" . $rw_result_array[1][number] . \" \" . $rw_result_array[1][teamAbbr] . \"</div>\n\n </div>\n\n <div class='flex-container row'>\n\n <div class='player forward col-4'>\" . $lw_result_array[2][name][0] . \". \" . strstr(($lw_result_array[2][name]), ' ') . \"<p>#\" . $lw_result_array[2][number] . \" \" . $lw_result_array[2][teamAbbr] . \" \" . \"</div>\n <div class='player forward col-4'>\" . $c_result_array[2][name][0] . \". \" . strstr(($c_result_array[2][name]), ' ') . \"<p>#\" . $c_result_array[2][number] . \" \" . $c_result_array[2][teamAbbr] . \" \" . \"</div>\n <div class='player forward col-4'>\". $rw_result_array[2][name][0] . \". \" . strstr(($rw_result_array[2][name]), ' ') . \"<p>#\" . $rw_result_array[2][number] . \" \" . $rw_result_array[2][teamAbbr] . \"</div>\n\n </div>\n\n <div class='flex-container row'>\n\n <div class='player forward col-4'>\" . $lw_result_array[3][name][0] . \". \" . strstr(($lw_result_array[3][name]), ' ') . \"<p>#\" . $lw_result_array[3][number] . \" \" . $lw_result_array[3][teamAbbr] . \" \" . \"</div>\n <div class='player forward col-4'>\" . $c_result_array[3][name][0] . \". \" . strstr(($c_result_array[3][name]), ' ') . \"<p>#\" . $c_result_array[3][number] . \" \" . $c_result_array[3][teamAbbr] . \" \" . \"</div>\n <div class='player forward col-4'>\". $rw_result_array[3][name][0] . \". \" . strstr(($rw_result_array[3][name]), ' ') . \"<p>#\" . $rw_result_array[3][number] . \" \" . $rw_result_array[3][teamAbbr] . \"</div>\n \n </div>\n\n <h2>Defensemen</h2>\n\n <div class='flex-container row'>\n\n <div class='player dman col-6'>\" . $d_result_array[0][name][0] . \". \" . strstr(($d_result_array[0][name]), ' ') . \"<p>#\" . $d_result_array[0][number] . \" \" . $d_result_array[0][teamAbbr] . \" \". \"</div>\n <div class='player dman col-6'>\" . $d_result_array[1][name][0] . \". \" . strstr(($d_result_array[1][name]), ' ') . \"<p>#\" . $d_result_array[1][number] . \" \" . $d_result_array[1][teamAbbr] . \"</div>\n\n </div>\n\n <div class='flex-container row'>\n\n <div class='player dman col-6'>\" . $d_result_array[2][name][0] . \". \" . strstr(($d_result_array[2][name]), ' ') . \"<p>#\" . $d_result_array[2][number] . \" \" . $d_result_array[2][teamAbbr] . \" \". \"</div>\n <div class='player dman col-6'>\" . $d_result_array[3][name][0] . \". \" . strstr(($d_result_array[3][name]), ' ') . \"<p>#\" . $d_result_array[3][number] . \" \" . $d_result_array[3][teamAbbr] . \"</div>\n\n </div>\n\n <div class='flex-container row'>\n\n <div class='player dman col-6'>\" . $d_result_array[4][name][0] . \". \" . strstr(($d_result_array[4][name]), ' ') . \"<p>#\" . $d_result_array[4][number] . \" \" . $d_result_array[4][teamAbbr] . \" \". \"</div>\n <div class='player dman col-6'>\" . $d_result_array[5][name][0] . \". \" . strstr(($d_result_array[5][name]), ' ') . \"<p>#\" . $d_result_array[5][number] . \" \" . $d_result_array[5][teamAbbr] . \"</div>\n\n </div>\n\n <h2>Goalies</h2>\n\n <div class='flex-container row'>\n\n <div class='player goalie col-6'>\" . $g_result_array[0][name][0] . \". \" . strstr(($g_result_array[0][name]), ' ') . \"<p>#\" . $g_result_array[0][number] . \" \" . $g_result_array[0][teamAbbr] . \" \" . \"</div>\n <div class='player goalie col-6'>\" . $g_result_array[1][name][0] . \". \" . strstr(($g_result_array[1][name]), ' ') . \"<p>#\" . $g_result_array[1][number] . \" \" . $g_result_array[1][teamAbbr] . \" \" . \"</div>\n\n </div>\n <p class='link-address'>http://rubyarbogast.com/oneforone</p>\n </div>\";\n\n echo \"<div class='flex-container' id='optionButtons'>\";\n\n //Form to submit team\n echo \"<form action='' id='postTeam' method='post'>\";\n\n //First line\n echo \"\n <input id='lw1Id' type='hidden' value='\" . $lw_result_array[0][nhlId] . \"' >\n <input id='c1Id' type='hidden' value='\" . $c_result_array[0][nhlId] . \"' >\n <input id='rw1Id' type='hidden' value='\" . $rw_result_array[0][nhlId] . \"' >\n \";\n\n //Second line\n echo \"\n <input id='lw2Id' type='hidden' value='\" . $lw_result_array[1][nhlId] . \"' >\n <input id='c2Id' type='hidden' value='\" . $c_result_array[1][nhlId] . \"' >\n <input id='rw2Id' type='hidden' value='\" . $rw_result_array[1][nhlId] . \"' >\n \";\n\n //Third line\n echo \"\n <input id='lw3Id' type='hidden' value='\" . $lw_result_array[2][nhlId] . \"' >\n <input id='c3Id' type='hidden' value='\" . $c_result_array[2][nhlId] . \"' >\n <input id='rw3Id' type='hidden' value='\" . $rw_result_array[2][nhlId] . \"' >\n \";\n\n //Fourth line\n echo \"\n <input id='lw4Id' type='hidden' value='\" . $lw_result_array[3][nhlId] . \"' >\n <input id='c4Id' type='hidden' value='\" . $c_result_array[3][nhlId] . \"' >\n <input id='rw4Id' type='hidden' value='\" . $rw_result_array[3][nhlId] . \"' >\n \";\n \n //First pair\n echo \"\n <input id='d1Id' type='hidden' value='\" . $d_result_array[0][nhlId] . \"' >\n <input id='d2Id' type='hidden' value='\" . $d_result_array[1][nhlId] . \"' >\n \";\n\n //Second pair\n echo \"\n <input id='d3Id' type='hidden' value='\" . $d_result_array[2][nhlId] . \"' >\n <input id='d4Id' type='hidden' value='\" . $d_result_array[3][nhlId] . \"' >\n \";\n\n //Third pair\n echo \"\n <input id='d5Id' type='hidden' value='\" . $d_result_array[4][nhlId] . \"' >\n <input id='d6Id' type='hidden' value='\" . $d_result_array[5][nhlId] . \"' >\n \";\n\n //Tandem\n echo \"\n <input id='g1Id' type='hidden' value='\" . $g_result_array[0][nhlId] . \"' >\n <input id='g2Id' type='hidden' value='\" . $g_result_array[1][nhlId] . \"' >\n \";\n\n echo \"<button id='showHideSubmitButton' class='secondary-button' onclick='loggedInOptions(event)'>Post to Blog</button>\n <button class='get-team-button secondary-button' id='newTeam'>New Team</button>\";\n\n //Use WP function to see if the user is already logged in\n if(is_user_logged_in()){\n echo \"<input id='loggedIn' type='hidden' value='true'>\";\n } else {\n echo \"<input id='loggedIn' type='hidden' value='false'>\";\n };\n\n echo \"<button id='submitTeamButton' class='submit-team secondary-button' type='submit'>Post!</button>\n <button id='cancelPostButton' class='secondary-button' onclick='cancelPostLoggedIn(event)'>Cancel</button>\";\n\n echo \"</form>\";\n\n //If the user is not logged in, show either the login or register form (depending on what button they cick; handled in ajax-team)\n echo \"\n <div id='loginFromTeamView'>\n <a href='./login' id='logIn'>Log In</a>\n |\n <a href='\" . wp_registration_url() . \"' id='register'>Register</a>\n |\n <a href='#' id='cancel' onclick='cancelLogin();return false;'>Cancel</a>\n </div>\n \";\n\n echo \"</div>\";\n }\n }\n wp_die(); \n}", "public function get_league_table_data($type, $id_league, $nb_teams)\n {\n global $wpdb;\n\n // Not good for performance to have \"*\" in the select...\n switch ($type)\n {\n case 'general':\n default :\n $query = \"SELECT * FROM $wpdb->table_cache c LEFT JOIN $wpdb->team t ON t.id = c.id_team LEFT JOIN $wpdb->club a ON a.id = t.id_club WHERE c.id_league = $id_league ORDER BY c.points DESC, c.diff DESC, c.goal_for DESC, c.goal_against ASC, c.club_name ASC LIMIT $nb_teams\";\n break;\n case 'home':\n $query = \"SELECT * FROM $wpdb->table_cache c LEFT JOIN $wpdb->team t ON t.id = c.id_team LEFT JOIN $wpdb->club a ON a.id = t.id_club WHERE c.id_league = $id_league ORDER BY c.home_points DESC, c.home_diff DESC LIMIT $nb_teams\";\n break;\n case 'away':\n $query = \"SELECT * FROM $wpdb->table_cache c LEFT JOIN $wpdb->team t ON t.id = c.id_team LEFT JOIN $wpdb->club a ON a.id = t.id_club WHERE c.id_league = $id_league ORDER BY c.away_points DESC, c.away_diff DESC LIMIT $nb_teams\";\n break;\n }\n \n return $wpdb->get_results($wpdb->prepare($query, NULL));\n }", "public function getTeam($name)\n {\n return $team_details= Team::where('team_name','=',$name)\n ->leftJoin('players', 'teams.id', '=', 'players.team_id')\n ->get();\n \n }", "public function allLeader($group_id)\n\t{\n\t\t//$db = $this->getAdapter();\n\t\t/* @var $db Zend_Db_Adapter_Pdo_Mysql */\n\t\t//$where = $db->quoteInto(\"users_login like ?\", $match_login.\"%\");\n\t\t//$where .= $db->quoteInto(\" and users_login != ?\", $match_login); where users_id groups_id is_leader\n\t\t//return $this->fetchAll($where, \"users_login\");\n\n\n\t\t// selection tool\n\t\t$select = $this->_db->select();\n\n\t\t// the FROM clause\n\t\t$select->from($this->_name, $this->_getCols());\n\n\t\t// the JOIN clause\n\t\t$users = self::$prefix . \"users\";\n\t\t$users_to_groups = self::$prefix . \"users_to_groups\";\n\t\t$select->joinLeft($users_to_groups, \"$users_to_groups.users_id = $users.users_id\", array());\n\t\t//$select->joinLeft($users, \"$users.users_id = $users_to_groups.users_id\");\n\n\t\t$select->where(\"$users_to_groups.is_leader = 1 and $users_to_groups.groups_id = ?\", $group_id);\n\n\t\t//usvn_users_to_groups.is_leader\n // return the results\n $stmt = $this->_db->query($select);\n $data = $stmt->fetchAll(Zend_Db::FETCH_ASSOC);\n\n\t\t$data = array(\n\t\t\t'table' => $this,\n\t\t\t'data' => $data,\n\t\t\t'rowClass' => $this->_rowClass,\n\t\t\t'stored' => true\n\t\t);\n\n\t\tZend_Loader::loadClass($this->_rowsetClass);\n\t\treturn new $this->_rowsetClass($data);\n\t}", "function league()\n {\n $sort = $this->session->userdata(\"team_ordering\");\n $sort2= $this->session->userdata(\"team_point\");\n $this -> db -> order_by($sort, \"asc\");\n $query = $this -> db -> get('league');\n return $query -> result_array();\n }", "function get_mfl_league() {\n log_info(\"get_mfl_league() function called\");\n \n # Definitions\n $year = MFL_YEAR;\n $league_id = MFL_LEAGUE_ID;\n\n $url = \"http://football.myfantasyleague.com/$year/export?TYPE=league&L=$league_id&JSON=1&DETAILS=1\";\n\n # Grab League details from MFL\n $json = file_get_contents($url);\n $json_data = json_decode($json, true);\n\n # ----------------\n # ---- LEAGUE ----\n # ----------------\n \n # Create new league object\n $league = new League();\n \n # Check if data is valid\n if(!array_key_exists('league',$json_data)) {\n log_error(\"League not found in JSON data\");\n return $league;\n }\n \n # Get League Details\n $league_data = $json_data['league'];\n\n # Build league object with data\n \n $league->Id = (int)$league_data['id'];\n $league->Name = $league_data['name'];\n $league->RosterSize = (int)$league_data['rosterSize'];\n $league->InjuredReserve = (int)$league_data['injuredReserve'];\n $league->TaxiSquad = (int)$league_data['taxiSquad'];\n $league->RostersPerPlayer = (int)$league_data['rostersPerPlayer'];\n $league->PlayerLimitUnit = $league_data['playerLimitUnit'];\n $league->StartWeek = (int)$league_data['startWeek'];\n $league->EndWeek = (int)$league_data['endWeek'];\n $league->LastRegularSeasonWeek = (int)$league_data['lastRegularSeasonWeek'];\n $league->BaseURL = $league_data['baseURL'];\n $league->MaxKeepers = (int)$league_data['maxKeepers'];\n $league->Precision = (int)$league_data['precision'];\n $league->H2H = $league_data['h2h'];\n $league->CurrentWaiverType = $league_data['currentWaiverType'];\n $league->Lockout = $league_data['lockout'];\n $league->Tiebreaker = $league_data['tiebreaker'];\n $league->TiebreakerCount = (int)$league_data['tiebreakerCount'];\n $league->TieBreakerPosition = $league_data['tiebreakerPosition'];\n $league->StandingsSort = $league_data['standingsSort'];\n $league->SurviverPool = $league_data['survivorPool'];\n $league->SurvivorPoolStartWeek = (int)$league_data['survivorPoolStartWeek'];\n $league->SurvivorPoolEndWeek = (int)$league_data['survivorPoolEndWeek'];\n $league->NflPoolType = $league_data['nflPoolType'];\n $league->NflPoolStartWeek = (int)$league_data['nflPoolStartWeek'];\n $league->NflPoolEndWeek = (int)$league_data['nflPoolEndWeek'];\n $league->FantasyPoolType = $league_data['fantasyPoolType'];\n $league->FantasyPoolStartWeek = (int)$league_data['fantasyPoolStartWeek'];\n $league->FantasyPoolEndWeek = (int)$league_data['fantasyPoolEndWeek'];\n $league->LoadRosters = $league_data['loadRosters'];\n $league->DraftLimitHours = $league_data['draftLimitHours'];\n \n # -------------------\n # ---- DIVISIONS ----\n # -------------------\n \n # Create division object array\n $divisions = array();\n \n # Check if data is valid\n if(!array_key_exists('divisions',$league_data)) {\n log_error(\"Divisions not found in JSON data\");\n }else if(!array_key_exists('division',$league_data['divisions'])) {\n log_error(\"Divisions->division not found in JSON data\");\n } else { \n # Get division data from league data\n $divisions_data = $league_data['divisions']['division'];\n\n foreach($divisions_data as $division_data):\n # Create new division object\n $division = new Division();\n\n #Build division object\n $division->Id = $division_data['id'];\n $division->Name = $division_data['name']; \n\n # Add division to array\n $divisions[] = $division;\n endforeach; \n\n $league->Divisions = $divisions; \n }\n \n # ---------------------------\n # ---- FRANCHISES UPDATE ----\n # ---------------------------\n\n # Create franchise object array\n $franchises = array();\n \n # Check if data is valid\n if(!array_key_exists('franchises',$league_data)) {\n log_error(\"Franchises not found in JSON data\");\n }else if(!array_key_exists('franchise',$league_data['franchises'])) {\n log_error(\"Franchises->franchise not found in JSON data\");\n } else {\n # Get franchise data from league data\n $franchises_data = $league_data['franchises']['franchise'];\n foreach($franchises_data as $franchise_data):\n \n \n # Make a new franchise object\n $franchise = new Franchise();\n\n # Place franchise data into franchise array\n $franchise->Id = $franchise_data['id'];\n $franchise->Name = $franchise_data['name'];\n $franchise->Abbreviation = $franchise_data['abbrev'];\n $franchise->DivisionId = $franchise_data['division'];\n $franchise->IconrUrl = $franchise_data['icon'];\n $franchise->LogoUrl= $franchise_data['logo'];\n $franchise->WaiverSortOrder = $franchise_data['waiverSortOrder'];\n $franchise->IsCommish = $franchise_data['iscommish'];\n\n # Add franchise object to array\n $franchises[] = $franchise;\n endforeach;\n\n $league->Franchises = $franchises;\n }\n \n log_info(\"get_mfl_league() function complete\");\n \n return $league;\n }", "function getLeaderboard()\n{\n global $wpdb;\n\n $rows = getLeaderBoardData();\n $sortedProjectArray = getMonkeys();\n\n // Process Teams\n $teams_table = $wpdb->prefix . LEADERBOARD_TEAMS_TABLE;\n $teamsSql = \"SELECT * FROM \" . $teams_table . \" WHERE id != 999\";\n $teamsArray = $wpdb->get_results($teamsSql, ARRAY_A);\n\n // Calculate total amount and amount for each team\n $total_donation = 0;\n $team_donations = array();\n\n // We do this so ALL teams come through even if they don't have a donation.\n foreach ($teamsArray as $teamArray) {\n $team_donations[$teamArray['id']] = array(\n 'teamId' => $teamArray['id'],\n 'teamName' => $teamArray['name'],\n 'donationAmount' => 0,\n 'individualDonors' => array()\n );\n }\n\n // Now we process through each individual donation.\n foreach ($rows as $row) {\n $amount = $row['donation_amount'];\n $team = $row['ry_team_id'];\n\n if (!array_key_exists($team, $team_donations)) {\n $team_donations[$team] = array(\n 'teamId' => $team,\n 'teamName' => $row['ry_team_name'],\n 'donationAmount' => 0,\n 'individualDonors' => array()\n );\n }\n\n $total_donation = $total_donation + $amount;\n $team_donations[$team]['donationAmount'] = $team_donations[$team]['donationAmount'] + $amount;\n\n $monkeyProjectId = getMonkeyProjectId($row['meta_value']);\n $monkeyName = 'The Monkeys';\n if ($monkeyProjectId) {\n $monkeyName = $sortedProjectArray[$monkeyProjectId];\n }\n\n\n array_push($team_donations[$team]['individualDonors'],\n array(\n 'id' => $row['donor_hash'],\n 'name' => nameFromDisplayName($row['donor_display_name']),\n 'donationAmount' => $amount,\n 'message' => 'donated a ' . $row['donated_item'] . ' to ' . $monkeyName . '.',\n 'referral' => array('id' => $row['ry_hash'], 'name' => nameFromEmail($row['ry_email']))\n )\n );\n }\n\n $options = get_option( 'caraya_leaderboard_settings' );\n\n $leaderboard = array(\n 'fundraisingTarget' => $options['caraya_leaderboard_text_target_amount'],\n 'endDate' => $options['caraya_leaderboard_date_end_date'],\n 'totalRaised' => $total_donation,\n 'leaderboard' => array_values($team_donations)\n );\n\n if (empty($leaderboard)) {\n\n return new WP_Error( 'empty_leaderboard', 'there is data for the leaderboard to render', array( 'status' => 404 ) );\n }\n return new WP_REST_Response($leaderboard, 200);\n}", "function get_team_name($ID) {\r\n\t$cond[] = array(\"col\" => \"ID\", \"value\" => $ID);\r\n\t$result = uli_get_var('teams', $cond, 'teamname');\r\n\tif ($result){return $result;}\r\n\telse {return FALSE;}\r\n}", "function GetMatchesByLadder( $participant_type, $ladder_id, $limit_start=0, $limit_cnt=0 )\n\t{\n\t\t$limit='';\n\t\tif( $limit_start&&$limit_cnt ) $limit = \" LIMIT $limit_start,$limit_cnt \";\n\t\tif( !$limit_start&&$limit_cnt ) $limit = \" LIMIT 0,$limit_cnt \";\n\t\t\n\t\tif( $participant_type == PARTTYPE_MEMBER )\n\t\t{\n\t\t\t$sql_query = \" SELECT matches.*, ladder_encounts.match_id, ladder_encounts.id AS encount_id, \".\n\t\t\t\t\t\t \" challenger.nick_name AS challenger_participant_name, challenger.id AS challenger_participant_id, \".\n\t\t\t\t\t\t \" opponent.nick_name AS opponent_participant_name, opponent.id AS opponent_participant_id \".\n\t\t\t\t\t\t \n\t\t\t\t\t\t \" FROM `{$GLOBALS['g_egltb_ladder_encounts']}` AS ladder_encounts \".\n\t\t\t\t\t\t\t \" LEFT JOIN `{$GLOBALS['g_egltb_matches']}` AS matches \".\n\t\t\t\t\t\t\t\t \" ON matches.id=ladder_encounts.match_id \".\n\t\t\t\t\t\t\t \" LEFT JOIN `{$GLOBALS['g_egltb_members']}` AS challenger \".\n\t\t\t\t\t\t\t\t \" ON challenger.id=matches.challenger_id \".\n\t\t\t\t\t\t\t \" LEFT JOIN `{$GLOBALS['g_egltb_members']}` AS opponent \".\n\t\t\t\t\t\t\t\t \" ON opponent.id=matches.opponent_id \".\n\t\t\t\t\t\t \" WHERE ladder_encounts.ladder_id={$ladder_id} \".\n\t\t\t\t\t\t \" ORDER BY matches.evaluate_time DESC \".\n\t\t\t\t\t\t \" $limit\";\n\t\t\t\t\t\t \n\t\t\treturn $this->pDBInterfaceCon->FetchArrayObject( $this->pDBInterfaceCon->Query( $sql_query ) );\n\t\t}\n\t\telseif( $participant_type == PARTTYPE_TEAM )\n\t\t{\n\t\t\t/**??*/\n\t\t\t$sql_query = \" SELECT matches.*, ladder_encounts.match_id, ladder_encounts.id AS encount_id, \".\n\t\t\t\t\t\t\t\" \t\t challenger.name AS challenger_participant_name, challenger.id AS challenger_participant_id, \".\n\t\t\t\t\t\t\t\"\t\t challenger_cl.name AS challenger_participant_clan_name, challenger_cl.id AS challenger_participant_clan_id, challenger_cl.tag AS challenger_participant_clan_tag, \".\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\" \t\t opponent.name AS opponent_participant_name, opponent.id AS opponent_participant_id, \".\n\t\t\t\t\t\t\t\"\t\t opponent_cl.name AS opponent_participant_clan_name, opponent_cl.id AS opponent_participant_clan_id, opponent_cl.tag AS opponent_participant_clan_tag \".\n\t\t\t\n\t\t\t\t\t\t \" FROM `{$GLOBALS['g_egltb_ladder_encounts']}` AS ladder_encounts \".\n\t\t\t\t\t\t\t \" LEFT JOIN `{$GLOBALS['g_egltb_matches']}` AS matches \".\n\t\t\t\t\t\t\t\t \" ON matches.id=ladder_encounts.match_id \".\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\" LEFT JOIN `{$GLOBALS['g_egltb_teams']}` AS challenger \".\n\t\t\t\t\t\t\t\t\t\" ON challenger.id=matches.challenger_id \".\n\t\t\t\t\t\t\t\t\" LEFT JOIN `{$GLOBALS['g_egltb_clan_accounts']}` AS challenger_cl \".\n\t\t\t\t\t\t\t\t\t\" ON challenger_cl.id=challenger.clan_id \".\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\" LEFT JOIN `{$GLOBALS['g_egltb_teams']}` AS opponent \".\n\t\t\t\t\t\t\t\t\t\" ON opponent.id=matches.opponent_id \".\n\t\t\t\t\t\t\t\t\" LEFT JOIN `{$GLOBALS['g_egltb_clan_accounts']}` AS opponent_cl \".\n\t\t\t\t\t\t\t\t\t\" ON opponent_cl.id=opponent.clan_id \".\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t \" WHERE ladder_encounts.ladder_id={$ladder_id} \".\n\t\t\t\t\t\t \" ORDER BY matches.evaluate_time ASC \".\n\t\t\t\t\t\t \" $limit\";\n\t\t\treturn $this->pDBInterfaceCon->FetchArrayObject( $this->pDBInterfaceCon->Query( $sql_query ) );\n\t\t}//if\n\t}", "function team_get($team_id = null, $position = null){\n\n if($position == null){ # Return everyone if position is blank\n $res = $this->model->getPlayersByTeamId($team_id);\n }else{\n $res = $this->model->getPlayersByTeamIdAndPosition($team_id, $position);\n }\n\n if($res || $res !== []){ # Respond with 404 when the resource is not found\n $this->response($res, 200);\n }else{\n $this->response(['message' => 'Not found'], 404);\n }\n }", "private function _getSummaryStat($team)\n {\n $level = $team['category'];\n $region = $team['region_id'];\n $city = $team['city_id'];\n $district = $team['id'];\n\n if (!($level > 1)) {\n return [\n 'members' => db::get_scalar('SELECT COUNT(*) FROM team_members WHERE group_id = :id', ['id' => $team['id']]),\n 'voters' => db::get_scalar('SELECT voters_count FROM team WHERE id = :id', ['id' => $team['id']]),\n ];\n }\n\n $sql = ['teams' => 'SELECT %s FROM team WHERE active = 1'];\n $sql['members'] = sprintf('SELECT COUNT(*) FROM team_members WHERE group_id IN (%s)', sprintf($sql['teams'], 'id').'%s');\n $sql['voters'] = sprintf($sql['teams'], 'SUM(voters_count)').'%s';\n $sqlBind = [];\n $sqlInject = [\n 'teams' => [],\n 'people' => [],\n ];\n $sqlExpr = [\n 'region' => ' AND region_id = :region',\n 'city' => ' AND city_id = :city',\n 'district' => ' AND district_id = :district',\n ];\n\n if ($level > 4) {\n $sqlInject['teams'][] = 'COUNT(NULLIF(category = 4, FALSE)) AS l4th';\n $sqlInject['people'][] = 'category = 4';\n $sqlExpr['region'] = null;\n }\n\n if ($level > 3) {\n $sqlCond = sprintf('category = 3%s', $sqlExpr['region']);\n $sqlInject['teams'][] = sprintf('COUNT(NULLIF(%s, FALSE)) AS l3rd', $sqlCond);\n $sqlInject['people'][] = $sqlCond;\n $sqlExpr['city'] = null;\n }\n\n if ($level > 2) {\n $sqlCond = sprintf('category = 2%s%s', $sqlExpr['region'], $sqlExpr['city']);\n $sqlInject['teams'][] = sprintf('COUNT(NULLIF(%s, FALSE)) AS l2nd', $sqlCond);\n $sqlInject['people'][] = $sqlCond;\n $sqlExpr['district'] = null;\n }\n\n if ($level > 1) {\n $sqlCond = sprintf('category = 1%s%s%s', $sqlExpr['region'], $sqlExpr['city'], $sqlExpr['district']);\n $sqlInject['teams'][] = sprintf('COUNT(NULLIF(%s, FALSE)) AS l1st', $sqlCond);\n $sqlInject['people'][] = $sqlCond;\n }\n\n foreach (['region' => $region, 'city' => $city, 'district' => $district] as $key => $val) {\n if (empty($sqlExpr[$key])) {\n continue;\n }\n\n $sqlBind[$key] = $val;\n }\n\n $members = 0;\n $voters = 0;\n foreach ($sqlInject['people'] as $inject) {\n $members += db::get_scalar(sprintf($sql['members'], ' AND '.$inject), $sqlBind);\n $voters += db::get_scalar(sprintf($sql['voters'], ' AND '.$inject), $sqlBind);\n }\n\n return [\n 'teams' => db::get_row(sprintf($sql['teams'], implode(', ', $sqlInject['teams'])), $sqlBind),\n 'members' => $members,\n 'voters' => $voters,\n ];\n }", "function retrieve_manager_team($users_oauth_uid){\n\t\t\n\t\t$sql = \"SELECT\n\t\t\t\t\t\n\t\t\t\t\tmt.id \t\t\t\tas mt_id,\n\t\t\t\t\tmt.user_oauth_uid\tas mt_user_oauth_uid,\n\t\t\t\t\tt.name \t\t\t\tas team_name,\n\t\t\t\t\tt.fan_page_id \t\tas team_fan_page_id,\n\t\t\t\t\tt.description\t\tas team_description,\n\t\t\t\t\tt.piwik_id_site\t\tas team_piwik_id_site,\n\t\t\t\t\tt.completed_setup\tas team_completed_setup,\n\t\t\t\t\tc.id \t\t\t\tas c_id,\n\t\t\t\t\tc.name \t\t\t\tas c_name,\n\t\t\t\t\tc.state \t\t\tas c_state\n\t\t\t\t\t\n\t\t\t\tFROM \tmanagers_teams mt\n\t\t\t\t\n\t\t\t\tJOIN\tteams t\n\t\t\t\tON\t\tmt.fan_page_id = t.fan_page_id\n\t\t\t\t\n\t\t\t\tJOIN \tcities c\n\t\t\t\tON \t\tc.id = t.city_id\n\t\t\t\t\n\t\t\t\tWHERE mt.user_oauth_uid = ?\n\t\t\t\t\t\tAND mt.banned = 0\n\t\t\t\tLIMIT 1\";\n\t\t\t\t\n\t\t$query = $this->db->query($sql, array($users_oauth_uid));\n\t\treturn $query->row();\n\t\t\n\t}", "public static function getParticipantTable()\n {\n global $wpdb;\n $_data = [];\n\n $chal_id = filter_input(INPUT_POST, 'chal-id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE);\n $chal = $wpdb->get_row($wpdb->prepare(\"SELECT * FROM {$wpdb->prefix}pt_challenges WHERE id = %d\", $chal_id));\n\n if (! $chal) {\n print json_encode([\n 'error' => 'Unable to find the selected challenge'\n ]);\n wp_die();\n }\n\n $query = $wpdb->prepare(\"CREATE TEMPORARY TABLE tmp_log\nSELECT IF(ca.type = 'number',(ca.points * al.value),ca.points) AS 'total_points',cp.*\nFROM {$wpdb->prefix}pt_participants cp\nLEFT JOIN {$wpdb->prefix}pt_log al ON al.user_id = cp.user_id\nLEFT JOIN {$wpdb->prefix}pt_activities ca on ca.id = al.activity_id AND ca.challenge_id = cp.challenge_id\nWHERE cp.challenge_id = %d\nGROUP BY cp.user_id, al.activity_id, al.log_date\", $chal_id);\n $wpdb->query($query);\n\n $query = \"SELECT SUM(al.total_points) AS 'total',al.*\nFROM tmp_log al\nGROUP BY al.user_id\";\n $participants = $wpdb->get_results($query);\n\n $winner_idx = null;\n foreach ($participants as $x => $part) {\n $_data[] = [\n 'approved' => \"<input type='checkbox' \" . (! $chal->approval ? \"disabled\" : \"\") . \" class='approve' \" . ((boolean) $part->approved ? \" checked\" : \"\") . \" data-user-id='{$part->user_id}' />\",\n 'memberid' => $part->member_id,\n 'name' => html_entity_decode($part->name, ENT_QUOTES | ENT_HTML5),\n 'email' => sanitize_email($part->email),\n 'totalPoints' => $part->total,\n 'action' => \"<i class='far fa-trash-alt' title='Remove this participant from the activity' data-user-id='{$part->user_id}'></i>\" .\n \"&nbsp;&nbsp;\" .\n \"<i class='fas fa-trophy' title='Mark participant as winner' data-user-id='{$part->user_id}'></i>\",\n 'winner' => ($chal->winner == $part->user_id ? true : false)\n ];\n\n if ($chal->winner == $part->user_id) {\n $winner_idx = $x;\n }\n }\n\n $columns = [\n [\n 'title' => 'Approved',\n 'defaultContent' => \"\",\n 'data' => 'approved'\n ],\n [\n 'title' => 'Member ID',\n 'defaultContent' => '',\n 'data' => 'memberid'\n ],\n [\n 'title' => 'Name',\n 'defaultContent' => '',\n 'data' => 'name'\n ],\n [\n 'title' => 'Email',\n 'defaultContent' => '',\n 'data' => 'email'\n ],\n [\n 'title' => 'Total Points',\n 'defaultContent' => 0,\n 'data' => 'totalPoints'\n ],\n [\n 'title' => 'Action',\n 'defaultContent' => '',\n 'data' => 'action'\n ]\n ];\n\n print json_encode([\n 'columns' => $columns,\n 'data' => $_data,\n 'winner' => $winner_idx\n ]);\n wp_die();\n }", "function get_nfl_players($limit = 100000, $start = 0, $nfl_pos = 0, $order_by = array('last_name','asc'),$search='',\r\n $show_owned = true, $show_inactive = false, $hide_non_lea = true)\r\n {\r\n\r\n if ($hide_non_lea)\r\n $pos_list = $this->common_model->league_nfl_position_id_array();\r\n if (count($pos_list) < 1)\r\n $pos_list = array(-1);\r\n if ($show_owned == false)\r\n {\r\n $owned = array();\r\n $data = $this->db->select('player_id')->from('roster')->where('league_id',$this->leagueid)->get()->result();\r\n foreach($data as $row)\r\n $owned[] = $row->player_id;\r\n }\r\n $this->db->select('SQL_CALC_FOUND_ROWS null as rows',FALSE);\r\n $this->db->select('player.id as player_id, player.id, player.first_name, player.last_name, player.nfl_position_id, player.nfl_team_id')\r\n ->select('IFNULL(sum(fs_w.points),0) as points',false)\r\n ->select('nfl_position.short_text as position,')\r\n ->select('IFNULL(nfl_team.club_id,\"NONE\") as club_id')\r\n ->select('team.team_name')\r\n ->select('TRUNCATE(IFNULL(draft_player_rank.rank,999),2) as draft_rank')\r\n ->from('player')\r\n ->join('fantasy_statistic_week as fs_w','fs_w.player_id = player.id and fs_w.year = '.\r\n $this->session->userdata('current_year').' and fs_w.league_id = '.$this->leagueid.\r\n ' and fs_w.nfl_week_type_id = (select id from nfl_week_type where text_id=\"'.$this->session->userdata['week_type'].'\")','left')\r\n ->join('nfl_team', 'nfl_team.id = player.nfl_team_id','left')\r\n ->join('nfl_position', 'nfl_position.id = player.nfl_position_id')\r\n ->join('roster','roster.player_id = player.id and roster.league_id='.$this->leagueid,'left')\r\n ->join('team','team.id = roster.team_id','left')\r\n ->join('draft_player_rank','draft_player_rank.player_id = player.id','left');\r\n // ->where('fantasy_statistic.year',$this->current_year,'left');\r\n if ($search != '')\r\n $this->db->where('(`last_name` like \"%'.$search.'%\" or `first_name` like \"%'.$search.'%\")',NULL,FALSE);\r\n if (($nfl_pos != 0) && (is_numeric($nfl_pos)))\r\n $this->db->where('nfl_position.id', $nfl_pos);\r\n if ($hide_non_lea && count($pos_list) > 0)\r\n $this->db->where_in('nfl_position_id', $pos_list);\r\n if (!$show_owned)\r\n $this->db->where_not_in('player.id',$owned);\r\n $this->db->group_by('player.id')\r\n ->order_by($order_by[0],$order_by[1])\r\n ->order_by('last_name','asc')\r\n ->order_by('first_name','asc')\r\n ->order_by('player.id','asc');\r\n\r\n if (!$show_inactive)\r\n $this->db->where('player.active', true);\r\n $this->db->limit($limit, $start);\r\n $data = $this->db->get();\r\n $returndata['count'] = $this->db->query('SELECT FOUND_ROWS() count;')->row()->count;\r\n $returndata['result'] = $data->result();\r\n\r\n return $returndata;\r\n }", "function getLeaders() {\n return parent::getAuthorsFromFields($this->leaders, $this->_leadersArray);\n }", "public function getTeams()\n\t\t{\n\t\t\t$app =& JFactory::getApplication();\n\t\t\t$jinput = $app->input;\n\t\t\t\n\t\t\t$show=$jinput->get('show','0','int');\n\t\t\tif ($show==-1) $show=JFactory::getUser()->id;\n\t\t\t$order = $jinput->get('order','name','str');\n\t\t\t$race = $jinput->get('races','all','str');\n\t\t\t$tvbund = $jinput->get('tvbund','0','int');\n\t\t\t$tvtop = $jinput->get('tvtop','0','int');\n\t\t\t$start = 30*$jinput->get('start','0','int');\n\t\t\tif ($start > $this->getNumberOfTeams() ) $start=0;\n\t\t\t\n\t\t\tif (!isset($this->teams))\n\t\t\t{\n\t\t\t\t$table = $this->getTable('Teams','BloodBowlTable');\n\t\t\t\t\n\t\t\t\t$this->teams = $table->getTeams($show, $order, $race, $tvbund, $tvtop, $start);\n\t\t\t}\n\t\t\treturn $this->teams;\n\t\t}", "function get_mostplayedmatch() {\n\n\t\tif (empty($this->request->params['requested'])) {\n throw new ForbiddenException();\n }\n\t\t\n\t\t$dataInfosArray = $mostplayedData = $data = $dataInfos = array();\t\t\n\t $events = $this->Event->mostplayedMatch();\t\n\n\t\tif(!empty($events)){\n\t\t\n\t\t\tforeach ($events as $eventKey => $event) {\n\n\t\t\t\t$data[$event['l']['sport_id']][$event['e']['event_id']]['totalbets'] = $event['0']['totalbets'];\n\t\t\t\t$data[$event['l']['sport_id']][$event['e']['event_id']]['bet_id'] = $event['b']['bet_id'];\n\t\t\t\t$data[$event['l']['sport_id']][$event['e']['event_id']]['league_id'] = $event['e']['league_id'];\n\t\t\t\t$data[$event['l']['sport_id']][$event['e']['event_id']]['league_name'] = $event['l']['league_name'];\n\t\t\t\t$data[$event['l']['sport_id']][$event['e']['event_id']]['sport_name'] = $event['s']['sport_name']; \n\t\t\t\t$data[$event['l']['sport_id']][$event['e']['event_id']]['event_id'] = $event['e']['event_id']; \n\t\t\t\t$data[$event['l']['sport_id']][$event['e']['event_id']]['event_name'] = $event['e']['event_name']; \n\t\t\t\t$data[$event['l']['sport_id']][$event['e']['event_id']]['event_date'] = $event['e']['event_date'];\n\t\t\t\t$data[$event['l']['sport_id']][$event['e']['event_id']]['event_date'] = $event['e']['event_date'];\n\t\t\t\t$betArray = $this->Event->query(\"select id from bets where event_id='\".$event['e']['event_id'].\"'\");\n\t\t\t\tif(!empty($betArray)){\t\t\n\t\t\t\t\tforeach ($betArray as $betKey => $bets) {\n\t\t\t\t\t\t$betPartsArray = $this->Event->query(\"select * from bet_parts where bet_id='\".$bets['bets']['id'].\"' order by odd \");\t\t\t\n\t\t\t\t\t\tforeach ($betPartsArray as $betPartsKey => $betParts) {\t\t\t\t\t\t\n\t\t\t\t\t\t\t$data[$event['l']['sport_id']][$event['e']['event_id']]['bet_part_odd_most'][$betParts['bet_parts']['id']] = $betParts['bet_parts']['odd'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$data[$event['l']['sport_id']][$event['e']['event_id']]['bet_part_odd_most'][] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!empty($data)){\t\t\t\t\t\n\t\t $dataEventsOut = array_slice($data, 0 ,4,true);\t\n\t\t\tforeach($dataEventsOut as $dataEventsOutkey =>$dataEventsOutkeyAll){\n\t\t\t\t$dataEventsOutAll[$dataEventsOutkey] = array_slice($dataEventsOutkeyAll, 0 ,5);\t\t\n\t\t\t}\n\t\t\tforeach($dataEventsOutAll as $dataEventsOutAllkey =>$dataEventsOutallVal){\t\t\t\t\t\t\n\t\t\t\t$mostplayedData['navigation'][$dataEventsOutAllkey] = $dataEventsOutallVal[0]['sport_name'];\t\n\t\t\t\t$mostplayedData['mostplayedbet'][$dataEventsOutAllkey] = $dataEventsOutallVal;\n\t\t\t}\n\t\t\t$this->set('mostplayedData',$mostplayedData);\n\t\t}\n }" ]
[ "0.647103", "0.6297219", "0.6283338", "0.6227549", "0.6199867", "0.61940026", "0.6159225", "0.6148033", "0.61411583", "0.60691", "0.6055415", "0.60400945", "0.5965485", "0.5931968", "0.5812077", "0.5791492", "0.5759352", "0.56856376", "0.5665358", "0.566347", "0.5655842", "0.5655377", "0.5639182", "0.5630559", "0.5629292", "0.5614649", "0.5603121", "0.55922395", "0.5587491", "0.55652934" ]
0.65732986
0
/ Get option_answer by id
function get_option_answer($id) { return $this->db->get_where('option_answer',array('id'=>$id))->row_array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAnswer($id){\n $answer = Answer::findOrFail($id);\n return $answer;\n }", "static function getAnswer($id)\r\n\t{\r\n\t\tglobal $wpdb;\r\n\t\t$id = (digirisk_tools::IsValid_Variable($id));\r\n\t\t$id = (int) $id;\r\n\t\t\r\n\t\t$resultat = $wpdb->get_row( \"SELECT * FROM \" . TABLE_REPONSE . \" WHERE id = \" . $id);\r\n\t\treturn $resultat;\r\n\t}", "function get_answer($id){\n\t$query = mysql_query(\"SELECT `answer_name` FROM `mock_exam_answers` WHERE `question_id` = '$id'\");\n\treturn mysql_fetch_row($query);\n}", "public function getAnswerById($id)\n {\n $answer = $this->em->getRepository(Answer::class)\n ->findOneBy(['id' => $id], []);\n\n return $answer;\n }", "public function get_optin( $id ) {\n\n\t\treturn get_post( $id );\n\n\t}", "function get_answer_by_id($connection_string, $answer_id)\n{\n $get_info = array();\n $answer_info_query = \"SELECT `question_answer` FROM `question_answer`Where question_id='$answer_id'\";\n $answer_info_query_result = mysqli_query($connection_string, $answer_info_query);\n if (mysqli_num_rows($answer_info_query_result) == 0) {\n return array('status' => \"0\", 'get_info' => $get_info);\n } else {\n $answer_result = mysqli_fetch_object($answer_info_query_result);\n }\n return array('status' => \"1\", 'get_info' => $answer_result);\n}", "public function show($id)\n\t{\n\t\t$answers = Answer::find($id);\n\t}", "function delete_option_answer($id)\n {\n return $this->db->delete('option_answer',array('id'=>$id));\n }", "public function fetchAnswer($id)\n\t{\n\t\t$this->db->select()\n\t\t\t\t ->from($this->getSource())\n\t\t\t\t ->where(\"id = ?\");\n\t \n\t\t$this->db->execute([$id]);\n\t\t$this->db->setFetchModeClass(__CLASS__);\n\t\treturn $this->db->fetchAll();\n\t}", "public function getOption($id)\n\t{\n\t\treturn $this->options->getItem($id);\n\t}", "public function getChoices($id) {\n $answer = new Answer;\n $answers = $answer::where('question_number', '=', $id)->get();\n return $answers;\n }", "public function get($id, $opt=0);", "public function fetchAnswer($id)\n {\n $form = TempForm::withTrashed()->findOrFail($id);\n\n\n /* Fetch rendered answers */\n $answers = $form->renderAnswers();\n\n return response()->json([\n 'answers' => $answers,\n ]);\n }", "public function fetchQuestionById($id);", "function option_field($id) {\n return $this->option_fields[$id];\n }", "public function showAnswer($id) {\n \n $this->_activeAnswer = (integer)$id;\n return $this;\n }", "public function getAnswer()\n {\n return $this->hasOne(Answer::className(), ['id' => 'id_answer']);\n }", "public function getFeedbackFormQuestion($id){\n $sql = \"SELECT * from feedback_questions where feedback_form = \".$id;\n $result = $this->conn->query($sql);\n return $result;\n }", "public function getAnswer($questionId){\n $user = Auth::user();\n $games = $user->games()->wherePivot('user_id', '=', $user->id)->get();\n foreach ($games as $game) {\n if($game->questions()->find($questionId) !== null ) {\n $answer = Question::where('id',$questionId)->first()->questionAnswers()->where('correct',1)->first('id');\n return $answer->toJson();\n }\n }\n abort(403);\n }", "public function getQuestion($id){\n\t\tforeach ($this->questions as $key => $question) {\n\t\t\tif($question->id == $id){\n\t\t\t\treturn $question;\n\t\t\t}\n\t\t}\n\t}", "function get($id) {\r\n\t\treturn SurveyQuestionQuery::create()->findPk($id);\r\n\t}", "public function show($id) {\n $find = Choice::find($id);\n\n if ($find) {\n return _json('success', $find);\n } else {\n return _json('success', 'error');\n }\n }", "public function getProductOptionsByID($id){\n $select = $this->select();\n $select->where('productOptionsID = ?', $id );\n $row = $this->fetchRow($select);\n if (count($row) > 0) {\n $prodOpt = new Model_Core_Product_ProductOptions();\n $prodOpt->populate($row->toArray());\n $ret = $prodOpt;\n } else {\n $ret = false;\n }\n return $ret; \n }", "function ivan_get_post_option( $id ) {\r\n\r\n\tglobal $post;\r\n\tif(!isset($post->ID))\r\n\t\treturn null;\r\n\r\n\t//$options = get_post_meta( get_the_ID(), IVAN_FW_THEME_OPTS, true ); dropped because Redux Metabox update...\r\n\t$options = redux_post_meta(IVAN_FW_THEME_OPTS, get_the_ID());\r\n\r\n\tif( isset( $options[$id] ) )\r\n\t\treturn apply_filters('ivan_get_post_option_filter', $options[$id], $id);\r\n\telse\r\n\t\treturn null;\r\n}", "public function getProductOption($product_id, $option_id = 0){\n\t\t$product_option = $this->db->query(\n\t\t\t\t\"SELECT *\n\t\t\tFROM \" . $this->db->table(\"product_options\") . \" \n\t\t\tWHERE product_id = '\" . (int)$product_id . \"'\n\t\t\t\tAND product_option_id = '\" . (int)$option_id . \"'\n\t\t\tORDER BY sort_order\");\n\n\t\t$product_option_description = $this->db->query(\n\t\t\t\t\"SELECT *\n\t\t\tFROM \" . $this->db->table(\"product_option_descriptions\") . \" \n\t\t\tWHERE product_option_id = '\" . (int)$option_id . \"'\");\n\t\t$product_option_description_data = array();\n\t\tforeach($product_option_description->rows as $result){\n\t\t\t$product_option_description_data[$result['language_id']] = array(\n\t\t\t\t\t'name' => $result['name'],\n\t\t\t\t\t'option_placeholder' => $result['option_placeholder'],\n\t\t\t\t\t'error_text' => $result['error_text']);\n\t\t}\n\n\t\tif($product_option->num_rows){\n\t\t\t$row = $product_option->row;\n\t\t\t$row['language'] = $product_option_description_data;\n\t\t\treturn $row;\n\t\t} else{\n\t\t\treturn null;\n\t\t}\n\t}", "public function getAnswerId(){\n\t\treturn($this->answerId);\n\t}", "abstract protected function getResponse($id, $options = array());", "public function getQuestion($variableId);", "function update_answer_by_id($connection_string, $answer_id)\n{\n $get_info = array();\n $questions_info_query = \"SELECT `answered` FROM `questions`Where id=$answer_id\";\n $questions_info_query_result = mysqli_query($connection_string, $questions_info_query);\n if (mysqli_num_rows($questions_info_query_result) == 0) {\n return array('status' => \"0\", 'get_info' => $get_info);\n } else {\n $questions_result = mysqli_fetch_object($questions_info_query_result);\n }\n return array('status' => \"1\", 'get_info' => $questions_result);\n}", "public function get_option( $id, $multikey = null ) {\n\t\t$form = $this->get_form_db_data( $id );\n\n\t\tif ( empty( $form ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( is_null( $multikey ) ) {\n\t\t\treturn $form;\n\t\t}\n\n\t\treturn fw_akg( $multikey, $form );\n\t}" ]
[ "0.75969887", "0.7460969", "0.69076884", "0.67188996", "0.6635194", "0.6583617", "0.65506834", "0.6523967", "0.65157217", "0.64979315", "0.64553726", "0.6362822", "0.63478076", "0.62990826", "0.6292827", "0.6283242", "0.62550807", "0.6184338", "0.61828095", "0.61488754", "0.61447626", "0.61082816", "0.61027926", "0.6100393", "0.6062706", "0.6061041", "0.60327774", "0.6024888", "0.6015101", "0.60107577" ]
0.8263589
0
/ Get all option_answer count
function get_all_option_answer_count() { $this->db->from('option_answer'); return $this->db->count_all_results(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAnswerCounts(){\n $answers = Question::find($this->id)->answers;\n $answer_counts = [];\n foreach ($answers as $answer) {\n $answer_string = $answer->answer;\n if (array_key_exists($answer_string, $answer_counts)) {\n $answer_counts[$answer_string]++;\n } else{\n $answer_counts[$answer_string] = 1;\n }\n }\n return json_encode($answer_counts);\n }", "public function count()\n {\n return count($this->answers);\n }", "public function get_count_for_options()\n {\n // Import software:\n $l_software_dao = new isys_jdisc_dao_software($this->m_db, $this->m_dao->get_connection());\n $l_return['software_counter'] = $l_software_dao->count_software();\n\n // Import layer 3 nets:\n $l_network_dao = new isys_jdisc_dao_network($this->m_db, $this->m_dao->get_connection());\n $l_return['network_counter'] = $l_network_dao->count_networks();\n\n // Import cluster:\n $l_cluster_dao = new isys_jdisc_dao_cluster($this->m_db, $this->m_dao->get_connection());\n $l_return['cluster_counter'] = $l_cluster_dao->count_cluster();\n\n // Import blade chassis:\n $l_device_dao = new isys_jdisc_dao_devices($this->m_db, $this->m_dao->get_connection());\n $l_return['blade_connections_counter'] = $l_device_dao->count_chassis_connections();\n\n return $l_return;\n }", "public function count($options) {\n // return count($this->db->fetchAll($sql));\n return count($this->findAll($options));\n }", "public function getCount($option = []) {\n if(count($option) > 0) {\n $build = true;\n foreach($option as $key) {\n if(gettype($key) != 'array') {\n $build = false;\n }\n }\n if($build) {\n $this->build($option);\n }\n else {\n $this->db->where($option);\n }\n }\n return $this->db->count_all_results($this->table);\n }", "private function getNumberOfCorrectAnswers($question){\n\n try{\n\n $sql = \"SELECT COUNT(is_correct)\n FROM OptionTypeMultiple\n WHERE is_correct = 1\n AND question_type_fk = ?\";\n \n $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $stmnt = $this->conn->prepare($sql);\n $stmnt->execute([$question]);\n\n return $stmnt->fetchColumn();\n }\n catch(PDOException $e){\n echo \"<div class='alert alert-danger' role='alert'>\n Sorry, there was an error. \" . $e->getMessage().\"\n </div>\";\n }\n\n }", "public function ajax_get_overridden_options_count() { \r\n if ( isset( $_POST[ \"field_id\" ] , $_POST[ \"option_id\" ] ) ) {\r\n $field_id = sanitize_text_field( $_POST[ \"field_id\" ] );\r\n $option_id = sanitize_text_field( $_POST[ \"option_id\" ] );\r\n $count = WPF_Field_Product_Option_DS::instance()\r\n ->get_overridden_options_count( $field_id, \r\n $option_id );\r\n wp_send_json( array( 'status' => true, 'count' => $count ) );\r\n wp_die();\r\n }\r\n wp_send_json( array( 'status' => false ) );\r\n wp_die();\r\n }", "public function totalAnswer(){\n $postsAnswer = Answer::count();\n return response()->json($postsAnswer);\n }", "function count_returned_questions($the_QsAs) {\n\treturn count($the_QsAs);\n}", "public function getIdeaListCount()\n\t{\n\t\t$query = $this->db_con->query(\"SELECT COUNT(*) as 'total_rows' FROM `ideas`\");\n \t\t$result=$query->fetch_array();\n\n \t\treturn $result;\n\t}", "function get_all_dialog_count()\n {\n $this->db->from('dialog');\n return $this->db->count_all_results();\n }", "private function getOptionCount($value, array $optionsFacetedData): int\n {\n return isset($optionsFacetedData[$value]['count'])\n ? (int)$optionsFacetedData[$value]['count']\n : 0;\n }", "function quiz_count () {\n\treturn mysql_result(mysql_query(\"SELECT COUNT(`quiz_id`) FROM `mock_exam_quiz` WHERE `quiz_status` = 1\"), 0);\n}", "public function getVotesCount()\r\n {\r\n $votes = 0;\r\n foreach ($this->answers as $answer) {\r\n $votes += $answer->votes;\r\n }\r\n return $votes;\r\n }", "public static function count(array $options = array())\n\t{\n\t\t$query = static::query($options);\n\t\t\n\t\treturn $query->count();\n\t}", "public function get_survey_count()\n {\n $result=$this->db->count_all($this->table_name);\n return $result;\n }", "public function count()\n\t{\n\t\t$condition = $this->get_condition();\n\t\t$info = $this->mode->count($condition);\n\t\techo json_encode($info);\n\t}", "public function countofexercisesets()\n {\n $count = $this->exercisesetsfilter()->count();\n return $count;\n }", "public function count_question(){\n\n $conn = $this->OpenDB(); \n $sql = (\"SELECT * FROM `questions`\");\n\t\t$result = mysql_query($sql, $conn);\n $result = mysql_num_rows($result);\n $this->EndDB(); \n\n return $result;\n }", "public function countResults()\n\t{\n\t\t$q1_grade = array(\n\t\t\t\t'Extremely Well',\n\t\t\t\t'Very Well',\n\t\t\t\t'Somewhat Well',\n\t\t\t\t'Not So Well',\n\t\t\t\t'Poor'\n\t\t\t);\n\n\t\t\n\t\tforeach ($q1_grade as $j) {\n\t\t\t\n\t\t\t//\tMake Several Queries with changing WHERE clause from $q1_grade array\n\t\t\t$survey_results = $this->db->query(\"SELECT id, question1 FROM js_survey_results WHERE question1 = '\" . $j . \"' \"); \n\t\t\t\n\t\t\t//\tCount the number of each grade result (Poor, Very Well, etc) and store in an indexed array\n\t\t\t$q1_votes[]\t=\t$survey_results->num_rows();\n\t\t}\n\n\t\t//\tReturn array to calling function\n\t\treturn $q1_votes;\n\n\n\t}", "public static function Count($options = '')\n\t{\n\t\t$sql = \"SELECT * FROM \" . static::$tableName . ' ' . $options;\n\t\t$stmt = self::$db->prepare($sql);\n\t\t$stmt->execute();\n\t\t$count = $stmt->rowCount();\n\t\treturn $count;\n\t}", "public function getResultCounts()\n {\n return $this->result_counts;\n }", "public function CountFormQuestions() {\n\t\t\tif ((is_null($this->intId)))\n\t\t\t\treturn 0;\n\n\t\t\treturn FormQuestion::CountBySignupFormId($this->intId);\n\t\t}", "public function count_all()\n {\n return $this->_count(TRUE);\n }", "public function countAllAnswers($id)\n {\n $this->db->select()\n ->from($this->getSource())\n ->where('question_id = ?');\n $this->db->execute([$id]);\n $questions = $this->db->fetchAll();\n $nrOfQuestions = count($questions);\n return $nrOfQuestions;\n }", "public function getQuestionCount()\n {\n return $this->questionCount;\n }", "public function getTotalQuestions()\n {\n return count($_SESSION['questions']);\n }", "public function get_count() {\n if (!empty($_POST['votable_id'])) {\n return $this->get_votable_count($_POST['votable_id']);\n }\n elseif (!empty($_POST['group_name'])) {\n return $this->get_group_count($_POST['group_name']);\n }\n return 0;\n }", "public function count(){\n $obj=Options::all();\n return response()->json(['registros'=>$obj->count()]);\n }", "public function count( $options = [] )\n {\n $builder = new MiqroBuilder( $this->miqro, 'SELECT COUNT(*) FROM $table' );\n $builder->set( 'table', $this->tablename );\n \n if( !empty( $options[ 'where' ] ) )\n {\n if( !is_array( $options[ 'where' ] ) )\n $builder->set( 'whereData', $options[ 'where' ] );\n else\n $builder->set( 'whereData', implode( ' AND ', $options[ 'where' ] ) );\n \n $builder->add( ' WHERE $whereData' );\n }\n \n $query = $builder->execute();\n $array = $query->fetch_array();\n return $array[0];\n }" ]
[ "0.76340306", "0.6954478", "0.69418037", "0.66432995", "0.66103673", "0.655758", "0.64706486", "0.640689", "0.62757313", "0.6275132", "0.6213221", "0.6184753", "0.6159442", "0.61253685", "0.6089674", "0.6089299", "0.6085399", "0.6071529", "0.6068333", "0.6035201", "0.6023591", "0.59922564", "0.58778924", "0.5853983", "0.5834921", "0.5833687", "0.58293366", "0.58277893", "0.58228654", "0.5798983" ]
0.8760346
0
/ Get all option_answer
function get_all_option_answer($params = array()) { if(isset($params) && !empty($params)) { $this->db->limit($params['limit'], $params['offset']); } $this->db->select('*, option_answer.id as oaId, dialog.title as dTitle, dialog.id as dId, option.id as oId, option.title as oTitle,script.title as sTitle'); //Active query bugs. Overwrite same fields name $this->db->from('option_answer'); $this->db->join('option', 'option.id = option_answer.optionId','left outer'); $this->db->join('dialog', 'dialog.id = option_answer.dialogId'); $this->db->join('script', 'script.id = option_answer.scriptAnswerId'); $this->db->order_by('option_answer.cdrId', 'ASC'); $this->db->order_by('option_answer.id', 'ASC'); $this->db->order_by('dialog.id', 'ASC'); if(isset($params) && !empty($params) && isset($params['cdrId']) && !empty($params['cdrId'])) { $this->db->where('cdrId',$params['cdrId']); } return $this->db->get()->result_array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_option_answer($id)\n {\n return $this->db->get_where('option_answer',array('id'=>$id))->row_array();\n }", "public static function getAll() {\n return get_option(self::$config['optionName']);\n }", "public function option_choices() {\n\t\treturn array();\n\t}", "public static function getChoiceAll()\n {\n echo json_encode( \\Models\\Choice::getChoice() );\n }", "function get_all_option_answer_count()\n {\n $this->db->from('option_answer');\n return $this->db->count_all_results();\n }", "public function getAllOptions()\n {\n $result = [];\n\n foreach (self::getOptionArray() as $index => $value) {\n $result[] = ['value' => $index, 'label' => $value];\n }\n\n return $result;\n }", "public function getOptionsList(): array;", "public function getAllOptions()\n {\n $this->_options = [\n ['label' => __('No'), 'value' => self::VALUE_NO],\n ['label' => __('Yes'), 'value' => self::VALUE_YES],\n ];\n return $this->_options;\n }", "function GetAllQuestions()\n {\n return $this->GetResult(\"\",__FUNCTION__); \n }", "public function getAnswer()\n {\n return $this->option()->get()->description;\n }", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function options($who){\n $questions = DB::table(\"survey_questions\")\n ->join('survey_qfor_question', 'survey_questions.id', '=', 'survey_qfor_question.question_id')\n ->select('*')\n ->where('qfor_id','=',$who)\n ->get();\n\n $options = [];\n foreach ($questions as $q) {\n $opts = Option::join('survey_questions', 'survey_questions.id', 'survey_options.question_id')->with('suboption')->where('survey_options.question_id', $q->question_id)\n ->select('survey_options.id AS id', 'survey_options.name', 'survey_options.question_id', 'survey_options.feedback', 'survey_options.value_not_checked', 'survey_options.feedback_not_checked', 'survey_options.value', 'survey_questions.qtype_id', 'survey_questions.rateTo')\n ->orderBy('survey_options.created_at')\n ->get();\n $options[$q->question_id] = $opts;\n }\n return $options;\n }", "private function get_values($questionId)\n\t{\n\t\t$this->Option->recursive = -1;\n\t\t$result = $this->Option->find('all', array('conditions' => array('Option.question_id' => $questionId), 'fields' => array('Option.id', 'Option.label')));\n\t\treturn $result;\n\t}", "public function getAllAnswers()\n {\n $this->getDbProxy()->setOrderBy('sorting');\n return $this->select();\n }", "public function get_default_option_values();", "public function getOptions(): array {}", "public function getAvailableAnswerOptions($index = null)\n\t{\n\t\t// TODO: Implement getAvailableAnswerOptions() method.\n\t}", "public function getAlternativesList(){\n return $this->_get(1);\n }", "public function getAlternativesList(){\n return $this->_get(1);\n }", "public function run()\n {\n $dataAnswer = [\n [\n 'option' => null,\n 'question_id' => 1\n ],\n [\n 'option' => null,\n 'question_id' => 2\n ],\n [ \n 'option' => 'Homme',\n 'question_id' => 3\n ],\n [\n 'option' => 'Femme',\n 'question_id' => 3\n ],\n [ \n 'option'=>'Préfère ne pas répondre',\n 'question_id' => 3\n ],\n [\n 'option' => null,\n 'question_id' => 4\n ],\n [\n 'option' => null,\n 'question_id' => 5\n ],\n [\n 'option' => 'Occulus Rift/s',\n 'question_id' => 6\n ],\n [\n 'option' => 'HTC Vive',\n 'question_id' => 6\n ],\n [\n 'option' => 'Windows Mixed Reality',\n 'question_id' => 6\n ],\n [\n 'option' => 'PSVR',\n 'question_id' => 6\n ],\n [\n 'option' => 'SteamVR',\n 'question_id' => 7\n ],\n [\n 'option' => 'Occulus store',\n 'question_id' => 7\n ],\n [\n 'option' => 'Viveport',\n 'question_id' => 7\n ],\n [\n 'option' => 'Playstation VR',\n 'question_id' => 7\n ],\n [\n 'option' => 'Google Play',\n 'question_id' => 7\n ],\n [\n 'option' => 'Windows store',\n 'question_id' => 7\n ],\n [\n 'option' => 'Occulus Quest',\n 'question_id' => 8\n ],\n [\n 'option' => 'Occulus Go',\n 'question_id' => 8\n ],\n [\n 'option' => 'HTC Vive Pro',\n 'question_id' => 8\n ],\n [\n 'option' => 'Autre',\n 'question_id' => 8\n ],\n [\n 'option' => 'Aucun',\n 'question_id' => 8\n ],\n [\n 'option' => null,\n 'question_id' => 9\n ],\n [\n 'option' => 'Regarder des émissions TV en direct',\n 'question_id' => 10\n ],\n [\n 'option' => 'Regarder des films',\n 'question_id' => 10\n ],\n [\n 'option' => 'Jouer en solo',\n 'question_id' => 10\n ],\n [\n 'option' => 'Jouer en team',\n 'question_id' => 10\n ],\n [\n 'option' => null,\n 'question_id' => 11\n ],\n [\n 'option' => null,\n 'question_id' => 12\n ],\n [\n 'option' => null,\n 'question_id' => 13\n ],\n [\n 'option' => null,\n 'question_id' => 14\n ],\n [\n 'option' => null,\n 'question_id' => 15\n ],\n [\n 'option' => 'Oui',\n 'question_id' => 16\n ],\n [\n 'option' => 'Non',\n 'question_id' => 16\n ],\n [\n 'option' => 'Oui',\n 'question_id' => 17\n ],\n [\n 'option' => 'Non',\n 'question_id' => 17\n ],\n [\n 'option' => 'Oui',\n 'question_id' => 18\n ],\n [\n 'option' => 'Non',\n 'question_id' => 18\n ],\n [\n 'option' => 'Oui',\n 'question_id' => 19\n ],\n [\n 'option' => 'Non',\n 'question_id' => 19\n ],\n [\n 'option' => null,\n 'question_id' => 20\n ]\n ];\n\n foreach($dataAnswer as $dt){\n $insertData = Answer::create(array(\n 'option'=>$dt['option']\n ));\n\n $insertData->question()->associate($dt['question_id']);\n $insertData->save();\n }\n }", "public function getAllOptions()\n {\n $result = [];\n /**\n * @var $wizard \\Forix\\ProductWizard\\Model\\Wizard\n * @var $wizard \\Forix\\ProductWizard\\Model\\Wizard\n */\n foreach (self::getAllOptionArray() as $value) {\n if(isset($value['wizard'])) {\n $wizard = $value['wizard'];\n $groupItems = $value['group'];\n $values = [];\n foreach ($groupItems as $_index => $_value) {\n $values[] = ['value' => $_index, 'label' => $_value];\n }\n $result[] = ['value' => $values, 'index' => $wizard->getId(), 'label' => $wizard->getTitle()];\n }\n }\n return $result;\n }", "public function getOptions(): array;", "public function getOptions(): array;" ]
[ "0.70395654", "0.6670907", "0.6660799", "0.66411537", "0.6552559", "0.64261043", "0.6354722", "0.6282989", "0.62492454", "0.6241519", "0.62125134", "0.62125134", "0.62125134", "0.62125134", "0.62125134", "0.62125134", "0.62125134", "0.62125134", "0.6204663", "0.6194098", "0.6191705", "0.61598825", "0.61424786", "0.61346054", "0.6129543", "0.6129543", "0.61255926", "0.6120491", "0.60984683", "0.60984683" ]
0.7313124
0
/ function to add new option_answer
function add_option_answer($params) { $this->db->insert('option_answer',$params); return $this->db->insert_id(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addQuestionOption($question, $prompt)\n {\n $newPrompt = new DropdownAnswer();\n $newPrompt->question_id = $question['id'];\n $newPrompt->answer_text = $prompt['answer_text'];\n $newPrompt->prompt_or_answer = 'prompt';\n $newPrompt->dropdown_answer_text = $prompt['dropdown_answer_text'];\n $newPrompt->answer_order = $prompt['answer_order'];\n $newPrompt->save();\n\n //...and save the matching answer\n $newAnswer = new DropdownAnswer();\n $newAnswer->question_id = $question['id'];\n $newAnswer->answer_text = $prompt['dropdown_answer_text']; //taken from the prompt's answer field\n $newAnswer->prompt_or_answer = 'answer';\n $newAnswer->save();\n }", "public function add_options()\n {\n $number_of_options = intval($_SESSION['mq_number_of_options']);\n $matches = array();\n $match_label = 'A';\n\n for ($match_number = 0; $match_number < $_SESSION['mq_number_of_matches']; $match_number ++)\n {\n if (! in_array($match_number, $_SESSION['mq_skip_matches']))\n {\n $matches[$match_number] = $match_label ++;\n }\n }\n\n $this->addElement('category', Translation::get('Options'));\n\n if ($_SESSION['mq_matrix_type'] == AssessmentMatrixQuestion::MATRIX_TYPE_RADIO)\n {\n $switch_label = Translation::get('SwitchToMultipleMatches');\n $multiple = false;\n }\n elseif ($_SESSION['mq_matrix_type'] == AssessmentMatrixQuestion::MATRIX_TYPE_CHECKBOX)\n {\n $switch_label = Translation::get('SwitchToSingleMatch');\n $multiple = true;\n }\n\n $buttons = array();\n $buttons[] = $this->createElement(\n 'style_button',\n 'change_matrix_type[]',\n $switch_label,\n array('class' => 'change_matrix_type'),\n null,\n 'retweet');\n $buttons[] = $this->createElement(\n 'style_button',\n 'add_option[]',\n Translation::get('AddMatrixQuestionOption'),\n array('id' => 'add_option'),\n null,\n 'plus');\n $this->addGroup($buttons, 'question_buttons', null, '', false);\n\n $renderer = $this->defaultRenderer();\n\n $table_header = array();\n $table_header[] = '<table class=\"table table-striped table-bordered table-hover table-data options\">';\n $table_header[] = '<thead>';\n $table_header[] = '<tr>';\n $table_header[] = '<th class=\"list\"></th>';\n $table_header[] = '<th>' . Translation::get('Answer') . '</th>';\n $table_header[] = '<th class=\"code\">' . Translation::get('Matches') . '</th>';\n $table_header[] = '<th>' . Translation::get('Feedback') . '</th>';\n $table_header[] = '<th class=\"numeric\">' . Translation::get('Score') . '</th>';\n $table_header[] = '<th class=\"action\"></th>';\n $table_header[] = '</tr>';\n $table_header[] = '</thead>';\n $table_header[] = '<tbody>';\n $this->addElement('html', implode(PHP_EOL, $table_header));\n\n $html_editor_options = array();\n $html_editor_options['width'] = '100%';\n $html_editor_options['height'] = '65';\n $html_editor_options['collapse_toolbar'] = true;\n $html_editor_options['show_tags'] = false;\n\n $visual_number = 0;\n\n for ($option_number = 0; $option_number < $number_of_options; $option_number ++)\n {\n $group = array();\n if (! in_array($option_number, $_SESSION['mq_skip_options']))\n {\n $visual_number ++;\n $group[] = $this->createElement('static', null, null, $visual_number);\n $group[] = $this->create_html_editor(\n AssessmentMatrixQuestionOption::PROPERTY_VALUE . '[' . $option_number . ']',\n Translation::get('Answer'),\n $html_editor_options);\n\n $group[] = $this->createElement(\n 'select',\n 'matches_to[' . $option_number . ']',\n Translation::get('Matches'),\n $matches,\n array('class' => 'option_matches'));\n $group[2]->setMultiple($multiple);\n $group[] = $this->create_html_editor(\n AssessmentMatrixQuestionOption::PROPERTY_FEEDBACK . '[' . $option_number . ']',\n Translation::get('Feedback'),\n $html_editor_options);\n $group[] = $this->createElement(\n 'text',\n AssessmentMatrixQuestionOption::PROPERTY_SCORE . '[' . $option_number . ']',\n Translation::get('Score'),\n 'size=\"2\" class=\"input_numeric\"');\n\n if ($number_of_options - count($_SESSION['mq_skip_options']) > 2)\n {\n $group[] = $this->createElement(\n 'image',\n 'remove_option[' . $option_number . ']',\n Theme::getInstance()->getCommonImagePath('Action/Delete'),\n array('class' => 'remove_option', 'id' => 'remove_option_' . $option_number));\n }\n else\n {\n $group[] = & $this->createElement(\n 'static',\n null,\n null,\n '<img class=\"remove_option\" src=\"' .\n Theme::getInstance()->getCommonImagePath('Action/DeleteNa') . '\" class=\"remove_option\" />');\n }\n\n $this->addGroup(\n $group,\n AssessmentMatrixQuestionOption::PROPERTY_VALUE . '_' . $option_number,\n null,\n '',\n false);\n\n $this->addGroupRule(\n AssessmentMatrixQuestionOption::PROPERTY_VALUE . '_' . $option_number,\n array(\n AssessmentMatrixQuestionOption::PROPERTY_SCORE . '[' . $option_number . ']' => array(\n array(\n Translation::get('ThisFieldShouldBeNumeric', null, Utilities::COMMON_LIBRARIES),\n 'numeric'))));\n\n $renderer->setElementTemplate(\n '<tr id=\"option_' . $option_number . '\" class=\"' . ($visual_number % 2 == 0 ? 'row_odd' : 'row_even') .\n '\">{element}</tr>',\n AssessmentMatrixQuestionOption::PROPERTY_VALUE . '_' . $option_number);\n $renderer->setGroupElementTemplate(\n '<td>{element}</td>',\n AssessmentMatrixQuestionOption::PROPERTY_VALUE . '_' . $option_number);\n }\n }\n $table_footer[] = '</tbody>';\n $table_footer[] = '</table>';\n $this->addElement('html', implode(PHP_EOL, $table_footer));\n\n $this->addGroup($buttons, 'question_buttons', null, '', false);\n\n $renderer->setElementTemplate(\n '<div style=\"margin: 10px 0px 10px 0px;\">{element}<div class=\"clear\"></div></div>',\n 'question_buttons');\n $renderer->setGroupElementTemplate(\n '<div style=\"float:left; text-align: center; margin-right: 10px;\">{element}</div>',\n 'question_buttons');\n\n $this->addElement('category');\n }", "function save_question_options($question) {\n // for numerical questions. This is not currently used by the editing\n // interface, but the GIFT format supports it. The multianswer qtype,\n // for example can make use of this feature.\n // Get old versions of the objects\n if (!$oldanswers = get_records(\"quiz_answers\", \"question\", $question->id)) {\n $oldanswers = array();\n }\n\n if (!$oldoptions = get_records(\"quiz_numerical\", \"question\", $question->id)) {\n $oldoptions = array();\n }\n\n $result = $this->save_numerical_units($question);\n if (isset($result->error)) {\n return $result;\n } else {\n $units = &$result->units;\n }\n\n // Insert all the new answers\n foreach ($question->answer as $key => $dataanswer) {\n if ($dataanswer != \"\") {\n $answer = new stdClass;\n $answer->question = $question->id;\n $answer->answer = trim($dataanswer);\n $answer->fraction = $question->fraction[$key];\n $answer->feedback = trim($question->feedback[$key]);\n\n if ($oldanswer = array_shift($oldanswers)) { // Existing answer, so reuse it\n $answer->id = $oldanswer->id;\n if (! update_record(\"quiz_answers\", $answer)) {\n $result->error = \"Could not update quiz answer! (id=$answer->id)\";\n return $result;\n }\n } else { // This is a completely new answer\n if (! $answer->id = insert_record(\"quiz_answers\", $answer)) {\n $result->error = \"Could not insert quiz answer!\";\n return $result;\n }\n }\n\n // Set up the options object\n if (!$options = array_shift($oldoptions)) {\n $options = new stdClass;\n }\n $options->question = $question->id;\n $options->answer = $answer->id;\n $options->tolerance = $this->apply_unit($question->tolerance, $units);\n\n // Save options\n if (isset($options->id)) { // reusing existing record\n if (! update_record('quiz_numerical', $options)) {\n $result->error = \"Could not update quiz numerical options! (id=$options->id)\";\n return $result;\n }\n } else { // new options\n if (! insert_record('quiz_numerical', $options)) {\n $result->error = \"Could not insert quiz numerical options!\";\n return $result;\n }\n }\n }\n }\n }", "public function add() {\n $mysqli = Database::getMYSQLI();\n \n $stmt = $mysqli->prepare(\"\n INSERT INTO responses (questions_id, attempts_id, options_id)\n VALUES (?,?,?)\");\n \n $stmt->bind_param('iii', $this->questionsID, $this->attemptsID, $this->optionsID);\n \n $stmt->execute();\n $stmt->close();\n $mysqli->close();\n }", "public function add_answers()\n {\n $object = $this->get_content_object();\n $values = $this->exportValues();\n $options = array();\n $matches = array();\n\n foreach ($values[AssessmentMatrixQuestionOption::PROPERTY_VALUE] as $option_id => $value)\n {\n // Create the option with it corresponding match\n $options[] = new AssessmentMatrixQuestionOption(\n $value,\n serialize($_POST['matches_to'][$option_id]),\n $values[AssessmentMatrixQuestionOption::PROPERTY_SCORE][$option_id],\n $values[AssessmentMatrixQuestionOption::PROPERTY_FEEDBACK][$option_id]);\n }\n\n foreach ($values['match'] as $match)\n {\n $matches[] = $match;\n }\n $object->set_options($options);\n $object->set_matches($matches);\n $object->set_matrix_type($_SESSION['mq_matrix_type']);\n }", "public function add_option( $request ) {\n\t\t$_REQUEST = array_merge( $_POST, $request->get_params() );\n\t\t$editor = new LP_Admin_Editor_Question();\n\t\t$result = $editor->dispatch();\n\n\t\tif ( is_array( $result ) ) {\n\t\t\t$result = end( $result );\n\t\t}\n\n\t\t$response = array(\n\t\t\t'success' => $result !== false,\n\t\t\t'result' => $result,\n\t\t);\n\n\t\treturn rest_ensure_response( $response );\n\t}", "public function add_answer($answer) {\n\t\t$answers = $this->get(\"answerMappings\");\n\t\tif (count($answers)>0) {\n\t\t\t$this->set(\"multipleAnswers\", TRUE);\n\t\t\t//remove the A1 answers from the parent - no longer relevant\n\t\t\t$this->set(\"BullhornFieldType\", NULL);\n\t\t\t$this->set(\"QAId\", NULL);\n\t\t\t$this->set(\"Value\", NULL);\n\t\t} else {\n\t\t\t//so far, single answer, so let's push the A1 answers to the parent\n\t\t\t$this->set(\"type\", $answer->get(\"type\"));\n\t\t\t$this->set(\"QAId\", $answer->get(\"QAId\"));\n\t\t\t$this->set(\"BullhornFieldType\", $answer->get(\"BullhornFieldType\"));\n\t\t\t$this->set(\"BullhornField\", $answer->get(\"BullhornField\"));\n\t\t\t$this->set(\"WorldAppAnswerName\", $answer->get(\"WorldAppAnswerName\"));\n\t\t\t$this->set(\"Value\", $answer->get(\"Value\"));\n\t\t}\n\t\t$answers[] = $answer;\n\t\t$this->set(\"answerMappings\", $answers);\n\t}", "public function addOption(): OptionerContract;", "public function addnewAnswer(){\t\n\t \n\t $message_alert='';\n\t \n\t $id_lang=(int)Context::getContext()->language->id; \n\t $question_id=(int)Tools::getValue('question_id');\n\t $answer_point=(int)Tools::getValue('answer_point');\n if(Tools::isSubmit('submitAddnewAnswer') && !empty($question_id)){ \t \n\t\t\n $FilterAnswers=FilterAnswers::loadByIdQuestion($question_id); \n\t\t\n\t\t$FilterAnswers->answer_name=Tools::getValue('answer_name');\n\t\t$Quiz_name=$FilterAnswers->answer_name;\n\t\t$FilterAnswers->question_id=$question_id;\t\t\n\t\t$FilterAnswers->answer_point=$answer_point;\n\t\t\n\t\t\n\t\tif(FilterAnswers::verifyByName($Quiz_name)!=''){\n $message_alert='Please remember duplicated answers are not allowed.';\n\t\t }\t\t\t\n\t\t\n\t\t if(!$FilterAnswers->add()){ \n\t\t\t$message_alert=\"Error can not add answer.\";\n } else {\t\t\t\n\t\t\t$message_alert=\"Your answer has been successfully added.\";\n }\t\t\n\t\t\n\t\t\n }\n\t \n\t \n\t return $message_alert;\n\t \n\t \n }", "function add_answer($qid, $a_name, $is_true){\n\tmysql_query(\"INSERT INTO `mock_exam_answers` (`question_id`, `answer_name`, `is_true`) VALUES ('$qid', '$a_name', '$is_true')\");\n}", "public function save_question_options($question) {\n global $DB;\n $context = $question->context;\n $result = new stdClass();\n\n $oldanswers = $DB->get_records('question_answers',\n array('question' => $question->id), 'id ASC');\n\n // Following hack to check at least two answers exist.\n $answercount = 0;\n foreach ($question->answer as $key => $answer) {\n if ($answer != '') {\n $answercount++;\n }\n }\n if ($answercount < 2) { // Check there are at lest 2 answers for multiple choice.\n $result->notice = get_string('notenoughanswers', 'qtype_multichoice', '2');\n return $result;\n }\n\n // Insert all the new answers.\n $totalfraction = 0;\n $maxfraction = -1;\n foreach ($question->answer as $key => $answerdata) {\n if (trim($answerdata['text']) == '') {\n continue;\n }\n\n // Update an existing answer if possible.\n $answer = array_shift($oldanswers);\n if (!$answer) {\n $answer = new stdClass();\n $answer->question = $question->id;\n $answer->answer = '';\n $answer->feedback = '';\n $answer->id = $DB->insert_record('question_answers', $answer);\n }\n\n if (is_array($answerdata)) {\n // Doing an import.\n $answer->answer = $this->import_or_save_files($answerdata,\n $context, 'question', 'answer', $answer->id);\n $answer->answerformat = $answerdata['format'];\n } else {\n // Saving the form.\n $answer->answer = $answerdata;\n $answer->answerformat = FORMAT_HTML;\n }\n $answer->fraction = !empty($question->correctanswer[$key]);\n $answer->feedback = $this->import_or_save_files($question->feedback[$key],\n $context, 'question', 'answerfeedback', $answer->id);\n $answer->feedbackformat = $question->feedback[$key]['format'];\n\n $DB->update_record('question_answers', $answer);\n }\n\n // Delete any left over old answer records.\n $fs = get_file_storage();\n foreach ($oldanswers as $oldanswer) {\n $fs->delete_area_files($context->id, 'question', 'answerfeedback', $oldanswer->id);\n $DB->delete_records('question_answers', array('id' => $oldanswer->id));\n }\n\n $options = $DB->get_record('qtype_multichoiceset_options', array('questionid' => $question->id));\n if (!$options) {\n $options = new stdClass();\n $options->questionid = $question->id;\n $options->correctfeedback = '';\n $options->incorrectfeedback = '';\n $options->showstandardinstruction = 0;\n $options->id = $DB->insert_record('qtype_multichoiceset_options', $options);\n }\n\n if (isset($question->layout)) {\n $options->layout = $question->layout;\n }\n $options->answernumbering = $question->answernumbering;\n $options->shuffleanswers = $question->shuffleanswers;\n $options->showstandardinstruction = !empty($question->showstandardinstruction);\n $options->correctfeedback = $this->import_or_save_files($question->correctfeedback,\n $context, 'question', 'correctfeedback', $question->id);\n $options->correctfeedbackformat = $question->correctfeedback['format'];\n $options->incorrectfeedback = $this->import_or_save_files($question->incorrectfeedback,\n $context, 'question', 'incorrectfeedback', $question->id);\n $options->incorrectfeedbackformat = $question->incorrectfeedback['format'];\n $options->shownumcorrect = !empty($question->shownumcorrect);\n\n $DB->update_record('qtype_multichoiceset_options', $options);\n $this->save_hints($question, true);\n }", "public function createQuestionWithAnswer(): void\n {\n $question = $this->ask('What is your question?');\n $answer = $this->ask('Answer the following question, '.$question);\n\n\n Question::create([\n 'question'=>$question,\n 'answer'=>$answer\n ]);\n\n $this->info(\"Question has been created successfully!\");\n\n $this->mainMenu();\n\n }", "public function updateQuestionOption($prompt)\n {\n //update the prompts\n $existingOption = $this->find($prompt['id']);\n $existingOption->answer_text = $prompt['answer_text'];\n $existingOption->dropdown_answer_text = $prompt['dropdown_answer_text'];\n $existingOption->save();\n\n //update the answers in the dropdowns\n $existingAnswer = $this->find($prompt['dropdown_answer_id']);\n $existingAnswer->answer_text = $prompt['dropdown_answer_text'];\n $existingAnswer->save();\n }", "public function testAddingOptionsToPoll()\n\t{\n\t\t// Values to create it first\n\t\t$question = 'Who is the next best contender for Grudge award?';\n\t\t$id_member = 0;\n\t\t$poster_name = 'test';\n\n\t\t// Create the poll.\n\t\t$id_poll = createPoll($question, $id_member, $poster_name);\n\n\t\t// Link the poll to the topic.\n\t\tassociatedPoll($this->id_topic, $id_poll);\n\t\t$this->assertTrue($this->id_topic > 2); // extra-test just to double-check\n\n\t\t$id_poll = associatedPoll($this->id_topic);\n\t\t$this->assertTrue(!empty($id_poll)); // extra-test, just in case.\n\n\t\t$options = array(\n\t\t\t'Ema, is that even a question?',\n\t\t\t'Ant. He broke error log. (no, he didn\\'t, but we\\'ll say he did.)',\n\t\t\t'No one this year',\n\t\t);\n\t\taddPollOptions($id_poll, $options);\n\n\t\t// Ok, what do we have now.\n\t\t$pollOptions = pollOptions($id_poll);\n\t\t$this->assertEquals($pollOptions[0]['label'], $options[0]);\n\t\t$this->assertEquals($pollOptions[1]['label'], $options[1]);\n\t\t$this->assertEquals(0, $pollOptions[0]['id_choice']);\n\t\t$this->assertEquals(1, $pollOptions[1]['id_choice']);\n\t\t$this->assertEquals(0, $pollOptions[0]['votes']);\n\t\t$this->assertEquals(0, $pollOptions[1]['votes']);\n\n\t}", "protected function setupOtherOptions()\n\t{\n\t\tglobal $Language, $Security;\n\t\t$option = $this->OtherOptions[\"addedit\"];\n\t\t$option->UseDropDownButton = FALSE;\n\t\t$option->DropDownButtonPhrase = $Language->phrase(\"ButtonAddEdit\");\n\t\t$option->UseButtonGroup = TRUE;\n\n\t\t//$option->ButtonClass = \"\"; // Class for button group\n\t\t$item = &$option->add($option->GroupOptionName);\n\t\t$item->Body = \"\";\n\t\t$item->Visible = FALSE;\n\n\t\t// Add\n\t\tif ($this->CurrentMode == \"view\") { // Check view mode\n\t\t\t$item = &$option->add(\"add\");\n\t\t\t$addcaption = HtmlTitle($Language->phrase(\"AddLink\"));\n\t\t\t$this->AddUrl = $this->getAddUrl();\n\t\t\tif (IsMobile())\n\t\t\t\t$item->Body = \"<a class=\\\"ew-add-edit ew-add\\\" title=\\\"\" . $addcaption . \"\\\" data-caption=\\\"\" . $addcaption . \"\\\" href=\\\"\" . HtmlEncode($this->AddUrl) . \"\\\">\" . $Language->phrase(\"AddLink\") . \"</a>\";\n\t\t\telse\n\t\t\t\t$item->Body = \"<a class=\\\"ew-add-edit ew-add\\\" title=\\\"\" . $addcaption . \"\\\" data-table=\\\"ipc_tracking\\\" data-caption=\\\"\" . $addcaption . \"\\\" href=\\\"#\\\" onclick=\\\"return ew.modalDialogShow({lnk:this,btn:'AddBtn',url:'\" . HtmlEncode($this->AddUrl) . \"'});\\\">\" . $Language->phrase(\"AddLink\") . \"</a>\";\n\t\t\t$item->Visible = $this->AddUrl != \"\" && $Security->canAdd();\n\t\t}\n\t}", "function bbp_add_options()\n{\n}", "function admin_form(&$qa_content){\n\t\t$ok = null;\n\t\tif (qa_clicked('q2a-stepmail-answer-save')) {\n\t\t\tqa_opt('q2a-stepmail-answer-1', qa_post_text('q2a-stepmail-answer-1'));\n\t\t\tqa_opt('q2a-stepmail-answer-title-1', qa_post_text('q2a-stepmail-answer-title-1'));\n\t\t\tqa_opt('q2a-stepmail-answer-round-1', (int)qa_post_text('q2a-stepmail-answer-round-1'));\n\t\t\tqa_opt('q2a-stepmail-answer-2', qa_post_text('q2a-stepmail-answer-2'));\n\t\t\tqa_opt('q2a-stepmail-answer-title-2', qa_post_text('q2a-stepmail-answer-title-2'));\n\t\t\tqa_opt('q2a-stepmail-answer-round-2', (int)qa_post_text('q2a-stepmail-answer-round-2'));\n\t\t\tqa_opt('q2a-stepmail-answer-3', qa_post_text('q2a-stepmail-answer-3'));\n\t\t\tqa_opt('q2a-stepmail-answer-title-3', qa_post_text('q2a-stepmail-answer-title-3'));\n\t\t\tqa_opt('q2a-stepmail-answer-round-3', (int)qa_post_text('q2a-stepmail-answer-round-3'));\n\t\t\tqa_opt('q2a-stepmail-answer-4', qa_post_text('q2a-stepmail-answer-4'));\n\t\t\tqa_opt('q2a-stepmail-answer-title-4', qa_post_text('q2a-stepmail-answer-title-4'));\n\t\t\tqa_opt('q2a-stepmail-answer-round-4', (int)qa_post_text('q2a-stepmail-answer-round-4'));\n\n\t\t\t$ok = qa_lang('admin/options_saved');\n\t\t}\n\t\t\n\t\t// form fields to display frontend for admin\n\t\t$fields = array();\n\t\t\n\t\t$fields[] = array(\n\t\t\t'type' => 'text',\n\t\t\t'label' => 'mail 1 title',\n\t\t\t'tags' => 'name=\"q2a-stepmail-answer-title-1\"',\n\t\t\t'value' => qa_opt('q2a-stepmail-answer-title-1'),\n\t\t);\n\n\n\t\t$fields[] = array(\n\t\t\t'type' => 'textarea',\n\t\t\t'label' => 'mail 1',\n\t\t\t'tags' => 'name=\"q2a-stepmail-answer-1\"',\n\t\t\t'value' => qa_opt('q2a-stepmail-answer-1'),\n\t\t);\n\t\t\n\t\t$fields[] = array(\n\t\t\t'type' => 'number',\n\t\t\t'label' => 'mail 1 round',\n\t\t\t'tags' => 'name=\"q2a-stepmail-answer-round-1\"',\n\t\t\t'value' => qa_opt('q2a-stepmail-answer-round-1'),\n\t\t);\n\n\n\t\t$fields[] = array(\n\t\t\t'type' => 'text',\n\t\t\t'label' => 'mail 2 title',\n\t\t\t'tags' => 'name=\"q2a-stepmail-answer-title-2\"',\n\t\t\t'value' => qa_opt('q2a-stepmail-answer-title-2'),\n\t\t);\n\n\t\t$fields[] = array(\n\t\t\t'type' => 'textarea',\n\t\t\t'label' => 'mail 2',\n\t\t\t'tags' => 'name=\"q2a-stepmail-answer-2\"',\n\t\t\t'value' => qa_opt('q2a-stepmail-answer-2'),\n\t\t);\n\n\t\t$fields[] = array(\n\t\t\t'type' => 'number',\n\t\t\t'label' => 'mail 2 round',\n\t\t\t'tags' => 'name=\"q2a-stepmail-answer-round-2\"',\n\t\t\t'value' => qa_opt('q2a-stepmail-answer-round-2'),\n\t\t);\n\n\t\t$fields[] = array(\n\t\t\t'type' => 'text',\n\t\t\t'label' => 'mail 3 title',\n\t\t\t'tags' => 'name=\"q2a-stepmail-answer-title-3\"',\n\t\t\t'value' => qa_opt('q2a-stepmail-answer-title-3'),\n\t\t);\n\n\t\t$fields[] = array(\n\t\t\t'type' => 'textarea',\n\t\t\t'label' => 'mail 3',\n\t\t\t'tags' => 'name=\"q2a-stepmail-answer-3\"',\n\t\t\t'value' => qa_opt('q2a-stepmail-answer-3'),\n\t\t);\n\n\t\t$fields[] = array(\n\t\t\t'type' => 'number',\n\t\t\t'label' => 'mail 3 round',\n\t\t\t'tags' => 'name=\"q2a-stepmail-answer-round-3\"',\n\t\t\t'value' => qa_opt('q2a-stepmail-answer-round-3'),\n\t\t);\n\n\t\t$fields[] = array(\n\t\t\t'type' => 'text',\n\t\t\t'label' => 'mail 4 title',\n\t\t\t'tags' => 'name=\"q2a-stepmail-answer-title-4\"',\n\t\t\t'value' => qa_opt('q2a-stepmail-answer-title-4'),\n\t\t);\n\n\t\t$fields[] = array(\n\t\t\t'type' => 'textarea',\n\t\t\t'label' => 'mail 4',\n\t\t\t'tags' => 'name=\"q2a-stepmail-answer-4\"',\n\t\t\t'value' => qa_opt('q2a-stepmail-answer-4'),\n\t\t);\n\n\t\t$fields[] = array(\n\t\t\t'type' => 'number',\n\t\t\t'label' => 'mail 4 round',\n\t\t\t'tags' => 'name=\"q2a-stepmail-answer-round-4\"',\n\t\t\t'value' => qa_opt('q2a-stepmail-answer-round-4'),\n\t\t);\n\n\t\treturn array( \n\t\t\t'ok' => ($ok && !isset($error)) ? $ok : null,\n\t\t\t'fields' => $fields,\n\t\t\t'buttons' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'label' => qa_lang_html('main/save_button'),\n\t\t\t\t\t'tags' => 'name=\"q2a-stepmail-answer-save\"',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t}", "function add_option($label, $value, $is_selected=HAW_NOTSELECTED)\r\n {\r\n if (!is_string($label) || !is_string($value))\r\n die(\"invalid argument in add_option()\");\r\n\r\n $this->options[$this->number_of_options][\"label\"] = $label;\r\n $this->options[$this->number_of_options][\"value\"] = $value;\r\n $this->options[$this->number_of_options][\"is_selected\"] = $is_selected;\r\n\r\n if ((strlen($this->value) == 0) || ($is_selected == HAW_SELECTED))\r\n $this->value = $value;\r\n\r\n $this->number_of_options++;\r\n }", "protected function setupOtherOptions()\n\t{\n\t\tglobal $Language, $Security;\n\t\t$option = $this->OtherOptions[\"addedit\"];\n\t\t$option->UseDropDownButton = FALSE;\n\t\t$option->DropDownButtonPhrase = $Language->phrase(\"ButtonAddEdit\");\n\t\t$option->UseButtonGroup = TRUE;\n\n\t\t//$option->ButtonClass = \"\"; // Class for button group\n\t\t$item = &$option->add($option->GroupOptionName);\n\t\t$item->Body = \"\";\n\t\t$item->Visible = FALSE;\n\n\t\t// Add\n\t\tif ($this->CurrentMode == \"view\") { // Check view mode\n\t\t\t$item = &$option->add(\"add\");\n\t\t\t$addcaption = HtmlTitle($Language->phrase(\"AddLink\"));\n\t\t\t$this->AddUrl = $this->getAddUrl();\n\t\t\t$item->Body = \"<a class=\\\"ew-add-edit ew-add\\\" title=\\\"\" . $addcaption . \"\\\" data-caption=\\\"\" . $addcaption . \"\\\" href=\\\"\" . HtmlEncode($this->AddUrl) . \"\\\">\" . $Language->phrase(\"AddLink\") . \"</a>\";\n\t\t\t$item->Visible = $this->AddUrl != \"\" && $Security->canAdd();\n\t\t}\n\t}", "public function add_choice() {\n\t\t\techo prince_choices_view( esc_attr( $_REQUEST['name'] ), esc_attr( $_REQUEST['count'] ) );\n\t\t\tdie();\n\t\t}", "public function addAnswerAction()\n {\n $product_id = $this->route_params['product_id'];\n $query_id = $this->route_params['query_id'];\n\n if(empty($_POST)){\n $this->redirect(\"/products/$product_id/\");\n }\n\n $product = Product::getProductObjectById($product_id);\n\n $data = [];\n\n $answer = $_POST['answer'];\n $user_id = Auth::getUserId();\n\n if($product->shop()->TRADER_ID != $user_id){\n $data['error'] = \"You are not authorized to answer the query.\";\n }\n\n if(strlen($answer) < 10){\n $data['error'] = \"Your answer must contain at least 10 characters.\";\n } else {\n $query = Models\\Query::getQueryById($query_id);\n \n $query = $query->answer($answer);\n if($query){\n $data['data'] = $query;\n \n $data['data']->AGO_QUESTION = $query->agoQuestion();\n $data['data']->AGO_ANSWER = $query->agoAnswer();\n $data['data']->QUESTION_BY = $query->questionBy();\n\n $stripped_ans = substr($query->ANSWER, 0, 50) . (strlen($query->ANSWER) > 50 ? \"...\" : \"\");\n\n $fullname = Auth::getUser()->fullname;\n $notification = new Notification([\n 'title' => \"Answer about product\",\n 'body' => \"Your query about a product is answerd: \\\"$stripped_ans\\\"'\",\n 'image_link' => \"/public/images/notif-answer.png\",\n 'sender_text' => \"From {$fullname}\",\n 'main_link' => \"/products/{$product_id}/?is_notif=true&query_id={$query->QUERY_ID}\",\n 'user_id' => $query->USER_ID,\n 'is_seen' => Notification::IS_NOT_SEEN\n ]);\n $notification->save();\n } else {\n $data['error'] = \"Unable to answer the query. Try reloading the page.\";\n }\n }\n echo json_encode($data);\n }", "function cqt_AddToOptions($options, $hook) {\n\t$options[] = array(\n\t\t'name' => t('���� ��������������'),\n\t\t'url' => 'plugin=cqt',\n\t\t'category' => 'templates'\n\t);\n\t// return the customized options\n\treturn $options;\n}", "function todo_list_options(){\n\n add_option('todo_task_list', [\n ['name' => 'Example Task 1',\n 'done' => 0],\n ['name' => 'Example Task 2',\n 'done' => 0],\n ['name' => 'Example Task 3',\n 'done' => 1]\n\n ]);\n\n\n\n\n}", "public function testAddAnswerGuest()\n {\n for ($i = 0; $i < 4; $i++)\n \t\t$this->addAnswerGuest(($i % 3) + 1);\n \t\t\n \t$this->addAnswerGuest(12);\n }", "abstract protected function doSaveAnswer(Answer $answer);", "private function SetAnswerInfo()\n\t{\n\t\tif( $this->id != null )\n\t\t{\n\t\t\t$this->sql->Query( \"SELECT questionid, answer FROM $this->table_name WHERE $this->id_col = $this->id\" );\n\t\t\tif( $this->sql->NumRows() )\n\t\t\t{\n\t\t\t\t$row = $this->sql->FetchRow();\n\t\t\t\t\n\t\t\t\t$this->questionid = $row[ 0 ];\n\t\t\t\t$this->answer = $row[ 1 ];\n\t\t\t}\n\t\t\t$this->sql->FreeResult();\n\t\t}\n\t}", "function fg_add_option( $name, $value ){\r\n\t\t\t$name = strtoupper( $name );\r\n\t\t\t\r\n\t\t\tadd_option( $name, $value );\r\n\t\t\t\r\n\t\t\t$opt = get_option( $name );\r\n\t\t\t\r\n\t\t\tif( !empty( $opt ) )\r\n\t\t\t\tprint '<p style=\"color:#080;\"><strong>' . $name . '</strong> = ' . $opt . '</p>';\r\n\t\t\telse\r\n\t\t\t\tprint '<p style=\"color:#f00;\"><strong>' . $name . '</strong> does not exist in database.</p>';\r\n\t\t}", "function warquest_db_player_poll_vote_add($pid, $poll_id, $answer_id) {\r\n\r\n\t$query = 'insert into player_poll (pid, poll_id, answer_id ) values ('.$pid.','.$poll_id.','.$answer_id.')';\t\t\r\n\t\r\n\treturn warquest_db_query($query);\r\n}", "private function addQuestionToExport($selectedAnswers, &$response) {\n $optionId = $selectedAnswers[0][$this->ANSWER_ID];\n $this->answerDictionary->addQuestionToResponse($response, $optionId, $this->QUESTION_TYPE);\n }", "function echo_options_add_value_init($field){\r\n\t?>\r\n\t<script type=\"text/javascript\" charset=\"utf8\" >\t\r\n\r\n\t\tvar options_values = new Array();//An array to store new options added (ex: new themes)\r\n\t\t//a choice: start storing new options from the index 1, so the index 0 is empty\r\n\t\toptions_values['theme'] = new Array('');\r\n\t\toptions_values['location'] = new Array('');\r\n\t\toptions_values['person'] = new Array('');\r\n\t\toptions_values['genre'] = new Array('');\r\n\t\toptions_values['misc'] = new Array('');\r\n\t\toptions_values['system'] = new Array('');\r\n\t\t\r\n\t\t//For any option, his value is his Id in the DB, So when we'll add an option, his value must be higher then all previous options Id; and different.\r\n\t\tvar max_value = <?php echo mysql_result(mysql_query(\"SELECT MAX(id) FROM inb_keywords\"),0); ?> ;\r\n\t\t\r\n\t\t//this array store the current higher id; according to the added options\r\n\t\tvar current_value = max_value;\r\n\t\r\n\t</script>\r\n\t<script type=\"text/javascript\" charset=\"utf8\" src=\"js/thematics.min.js\" > </script>\r\n\t<script type=\"text/javascript\" charset=\"utf8\" src=\"js/<?php echo $field; ?>_add.js\" > </script>\r\n\t<?php\r\n}" ]
[ "0.6920276", "0.6742674", "0.67144763", "0.66818917", "0.6674042", "0.666871", "0.6605675", "0.65534246", "0.6376135", "0.6209154", "0.61631113", "0.6119245", "0.6075735", "0.6023201", "0.5991693", "0.59648883", "0.5861237", "0.58557236", "0.58254725", "0.58021855", "0.5779259", "0.57631665", "0.5711", "0.56862956", "0.5677953", "0.56626546", "0.5660725", "0.56483585", "0.56475306", "0.56256676" ]
0.67817605
1
/ function to delete option_answer
function delete_option_answer($id) { return $this->db->delete('option_answer',array('id'=>$id)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hrecipe_delete_options() {\r\n \r\n //delete_option('hrecipe_options');\r\n //hrecipe_delete_old_options();\r\n}", "function bbp_delete_options()\n{\n}", "public function destroy(answer_selected $answer_selected)\n {\n //\n }", "public function removeAnswer()\n {\n if($this->isCorrect)\n {\n $this->removed = false;\n }\n else\n {\n $this->removed = true;\n }\n }", "function eas_remove() {\r\ndelete_option('eas_data');\r\n}", "public function delete( $option = '' );", "function deleteAnswers($question_id)\n\t{\n\t}", "function myplugin_delete_option() {\n\n\t/*\n\t\tdelete_option(\n\t\t\tstring $option\n\t\t)\n\t*/\n\n\tdelete_option( 'myplugin-option-name' );\n\n}", "protected function delete_options() {\n\t\tdelete_option( self::OPTION_NAME_VERSION );\n\t\tdelete_option( TennisEvents::OPTION_NAME_SEEDED );\n\t}", "public function destroy(Answer $answer)\n {\n //\n }", "function del() {\n\t\t\n\t\t//delete answer\n\t\tif(!sql_query(\"\n\t\tDELETE FROM \".$GLOBALS['prefix_lms'].\"_polltrack_answer \n\t\tWHERE id_quest = '\".$this->id.\"'\")) return false;\n\t\t\n\t\tif(!sql_query(\"\n\t\tDELETE FROM \".$GLOBALS['prefix_lms'].\"_pollquest_extra \n\t\tWHERE id_quest = '\".$this->id.\"'\")) return false;\n\t\t\n\t\tif(!sql_query(\"\n\t\tDELETE FROM \".$GLOBALS['prefix_lms'].\"_pollquestanswer \n\t\tWHERE id_quest = '\".$this->id.\"'\")) return false;\n\t\t\n\t\treturn sql_query(\"\n\t\tDELETE FROM \".$GLOBALS['prefix_lms'].\"_pollquest \n\t\tWHERE id_quest = '\".$this->id.\"'\");\n\t}", "function hello_world_remove() {\ndelete_option('hello_world_data');\n}", "function clear_answers($qid){\n\t$id = (int)$qid;\n\t// Delete the question to update\n\t$r = mysql_query(\"DELETE FROM `mock_exam_answers` WHERE `question_id` = '$id'\");\n}", "public function deleteOption($id){\n $this->db->query(\"DELETE FROM \".OPN_TBL.\" WHERE qid =? \");\n $this->db->bind(1,$id);\n return $this->db->execute() ? true : false;\n }", "function epub_remove_options()\n\t{\t\tdelete_option('epub_order');\n\t\tdelete_option('epub_general');\n\t\tdelete_option('epub_cover');\n\t\tdelete_option('epub_toc');\n\t\tdelete_option('epub_csun');\n\t\tdelete_option('epub_undergrad');\n\t\tdelete_option('epub_student-services');\n\t\tdelete_option('epub_special-programs');\n\t\tdelete_option('epub_gened');\n\t\tdelete_option('epub_grad');\n\t\tdelete_option('epub_credential');\n\t\tdelete_option('epub_courses');\n\t\tdelete_option('epub_policies');\n\t\tdelete_option('epub_faculty');\n\t\tdelete_option('epub_emeriti');\n\t}", "function apsa_delete_campaign_option($campaign_id, $option_name) {\n global $wpdb;\n $campaign_options_table = $wpdb->prefix . 'apsa_campaign_options';\n $delete_option = $wpdb->delete($campaign_options_table, array('campaign_id' => $campaign_id, 'option_name' => $option_name));\n}", "function magazine_issue_remove() {\n delete_option('mic_current_issue');\n}", "public function destroy(Option $option)\n {\n //\n }", "public function destroy(Option $option)\n {\n //\n }", "public function deleteOption()\n {\n if (!isset($_POST['id'])) {\n Response::badRequest();\n }\n\n // Load the option\n if (!$option = PackageBuilderOption::select($_POST['id'])) {\n Response::notFound();\n }\n\n // Delete the team member\n $option->delete();\n\n // Set image folder\n $folder = STORAGE_PATH . 'packagebuilder/photos/' . $option->id . '/';\n\n // Delete all images\n foreach (array('small_small.jpg', 'small_large.jpg', 'medium_small.jpg', 'medium_large.jpg', 'large_small.jpg', 'large_large.jpg') as $filename) {\n if (is_file($folder . $filename)) {\n unlink($folder . $filename);\n }\n }\n\n // Delete the folder\n if (is_dir($folder)) {\n rmdir($folder);\n }\n\n // Success\n return true;\n }", "function adp_delete_plugin_options() {\r\n\tdelete_option('adp_options');\r\n}", "function delete_option( $name ) {\n \n // Get codeigniter object instance\n $CI = get_instance();\n \n // Load Options Model\n $CI->load->model('options');\n \n // Return option's value\n return $CI->options->delete_option( $name );\n \n }", "function uninstall(){\r\n\t\tif ($this->option_name)\r\n\t\t\tdelete_option($this->option_name);\r\n\t}", "public function removeAnswer($answer)\n {\n $this->em->remove($answer);\n $this->em->flush();\n }", "function delete_option($id)\n\t{\n\t\t$this->db->where('id', $id);\n\t\t$this->db->delete('options');\n\t\t\n\t\t$this->delete_option_values($id);\n\t}", "public function remove_option( $request ) {\n\t\t$_REQUEST = array_merge( $_POST, $request->get_params() );\n\t\t$editor = new LP_Admin_Editor_Question();\n\t\t$result = $editor->dispatch();\n\n\t\tif ( is_array( $result ) ) {\n\t\t\t$result = end( $result );\n\t\t}\n\n\t\t$response = array(\n\t\t\t'success' => $result !== false,\n\t\t\t'result' => $result,\n\t\t);\n\n\t\treturn rest_ensure_response( $response );\n\t}", "function our_doctors_data_remove() {\ndelete_option('our_doctors_data');\ndelete_option('API_key_data');\ndelete_option('image_data');\ndelete_option('ourdoctors_single_pg_data');\ndelete_option('physician_single_pg_data');\ndelete_option('search_single_pg_data');\ndelete_option('location_single_pg_data');\n}", "function deleteAnswer( $id_track ) {\n\t\t\n\t\treturn true;\n\t}", "public function unsetOption(string $option);", "public function destroy(RightAnswer $rightAnswer)\n {\n //\n }" ]
[ "0.76423573", "0.73378754", "0.719417", "0.7048854", "0.70383674", "0.6974999", "0.697286", "0.69489795", "0.6914834", "0.68201214", "0.6799652", "0.6596399", "0.65516007", "0.64579624", "0.645631", "0.6386043", "0.63711303", "0.6366986", "0.6366986", "0.6360328", "0.63556975", "0.63158613", "0.62975943", "0.62952125", "0.6282786", "0.62701666", "0.62254804", "0.6219402", "0.6197507", "0.61845" ]
0.76638234
0
This method converts the specified value to a char.
public static function toChar($value) : string { $type = gettype($value); switch ($type) { case 'boolean': throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to a char.', array(':type' => $type)); case 'double': throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to a char.', array(':type' => $type)); case 'integer': return chr($value); case 'NULL': throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to a char.', array(':type' => $type)); case 'object': if (method_exists($value, 'toChar')) { return $value->toChar(); } else if ($value instanceof Common\StringRef) { return static::toChar($value->__toString()); } else { throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to a char.', array(':type' => get_class($value))); } case 'string': if (mb_strlen($value) != 1) { throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to a char.', array(':type' => $type)); } return $value; default: throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to a char.', array(':type' => $type)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _getChar() {\n return chr($this->_getByte());\n }", "public static function toChars($value)\r\n\t\t{\r\n\t\t\tif (is_string($value))\r\n\t\t\t{\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\t$chars = array();\r\n\t\t\t\t\tfor ($x = 0, $y = strlen($value); $x < $y; $x++)\r\n\t\t\t\t\t\t$chars[] = array(\"ord\" => ord($value[$x]), \"chr\" => $value[$x]);\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn $chars;\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception $e)\r\n\t\t\t\t{\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn NULL;\r\n\t\t}", "function bin_to_char($bin){\n return chr(bindec($bin)); #bindec merubah hasil geser xor kedalam ASCII - chr merubah ASCII ke dalam character\n }", "public function getChar(){return $this->Char;}", "public function addCharacter( $value){\n return $this->_add(5, $value);\n }", "function chr ($ascii) {}", "function _getchar() {\r\n\treturn sprintf(\"%c\", $this->_getbyte());\r\n}", "public static function encodeCharacters( $value ){\n\n\t\tif( CDT_UI_UTF8_ENCODE )\n\t\t\t$value = utf8_encode( $value );\n\t\t\t\n\t\treturn $value;\n\t}", "function GetRandomChar() {\n\t\t\n\t\tmt_srand((double)microtime()*1000000);\n\t\t$randval = mt_rand(1,2); // do not use lower case characters.\n\n\t\t\n\t\tswitch ($randval) {\n\t case 1:\n\t \t // 48 to 57 are the ASCII codes for the \n\t \t // numbers from 0->48 to 9->57.\n\t $randval = mt_rand(48, 57);\n\t break;\n\t case 2:\n\t \t // 65 to 90 are the ASCII codes for upper-\n\t \t // case characters from A to Z except O.\n\t \t \tdo {\n $randval = mt_rand(65, 90);\n } while ($randval == 'O');\n\t break;\n\t case 3:\n\t \t // 97 to 122 are the ASCII codes for lower-\n\t \t // case characters from a to z except o.\n\t \t \tdo {\n $randval = mt_rand(97, 122);\n } while ($randval == 'o');\n\t break;\n\t\t}\n\t\t\n\t// Now we return the character, generated from the ASCII code\n\t\treturn chr($randval);\n\t}", "public static function baseConvertChar($value, $outBase)\r\n\t{\r\n\t\t//\t$len = strlen($value);\r\n\t\t$back = '';\r\n\t\twhile ($value != '0')\r\n\t\t{\r\n\t\t\t$outNumber = bcmod($value, \"$outBase\");\r\n\t\t\t$back = self::decToDigit($outNumber, self::$outCharset).$back;\r\n\t\t\t$value = bcdiv($value, \"$outBase\");\r\n\t\t}\r\n\t\t\r\n\t\treturn $back;\r\n\t}", "public function toCIELCh(){\n return $this->toCIELab()->toCIELCh();\n }", "public static function ascii($value)\n {\n return \\Patchwork\\Utf8::toAscii($value);\n }", "private function getChar() {\n\t\t//-- check to see if we had anything in the look ahead buffer and use that.\n\t\tif(isset($this->c)) {\n\t\t\t//--\n\t\t\t$char = $this->c;\n\t\t\tunset($this->c);\n\t\t\t//--\n\t\t} else { // otherwise we start pulling from the input\n\t\t\t//--\n\t\t\t$char = substr($this->input, $this->index, 1);\n\t\t\t//-- if the next character doesn't exist return false.\n\t\t\tif(isset($char) && $char === false) {\n\t\t\t\treturn false;\n\t\t\t} //end if\n\t\t\t//-- otherwise increment the pointer and use this char.\n\t\t\t$this->index++;\n\t\t\t//--\n\t\t} //end if else\n\t\t//-- normalize all whitespace except for the newline character into a standard space.\n\t\tif($char !== \"\\n\" && ord($char) < 32) {\n\t\t\treturn ' ';\n\t\t} //end if\n\t\t//--\n\t\treturn $char;\n\t\t//--\n\t}", "public static function Char(): string {\n switch(\\random_int(0, 1)) {\n case 0:\n return \\chr(\\random_int(65, 90));\n case 1:\n return \\chr(\\random_int(97, 122));\n }\n }", "public static function CardTypeChar($iNum) {\n\tthrow new exception('2016-07-31 The Table version of this function is deprecated; call Records::CalcCardTypeChar() instead.');\n\t$chDigit = substr($iNum,0,1);\n\t$arDigits = array(\n\t '3' => 'A',\n\t '4' => 'V',\n\t '5' => 'M',\n\t '6' => 'D'\n\t );\n\tif (isset($arDigits[$chDigit])) {\n\t $chOut = $arDigits[$chDigit];\n\t} else {\n\t $chOut = '?'.$chDigit;\n\t}\n\treturn $chOut;\n }", "function fromCharCode($code)\n{\n\treturn chr($code);\n}", "private function char() {\n if ($this->look() === '&') {\n return $this->entity();\n } else {\n return htmlspecialchars($this->matchAny());\n }\n }", "private static function unescapeCharacter($value)\r\n\t{\r\n\t\tswitch ($value[1]) {\r\n\t\t\tcase '0':\r\n\t\t\t\treturn \"\\x0\";\r\n\t\t\tcase 'a':\r\n\t\t\t\treturn \"\\x7\";\r\n\t\t\tcase 'b':\r\n\t\t\t\treturn \"\\x8\";\r\n\t\t\tcase 't':\r\n\t\t\t\treturn \"\\t\";\r\n\t\t\tcase \"\\t\":\r\n\t\t\t\treturn \"\\t\";\r\n\t\t\tcase 'n':\r\n\t\t\t\treturn \"\\n\";\r\n\t\t\tcase 'v':\r\n\t\t\t\treturn \"\\xB\";\r\n\t\t\tcase 'f':\r\n\t\t\t\treturn \"\\xC\";\r\n\t\t\tcase 'r':\r\n\t\t\t\treturn \"\\r\";\r\n\t\t\tcase 'e':\r\n\t\t\t\treturn \"\\x1B\";\r\n\t\t\tcase ' ':\r\n\t\t\t\treturn ' ';\r\n\t\t\tcase '\"':\r\n\t\t\t\treturn '\"';\r\n\t\t\tcase '/':\r\n\t\t\t\treturn '/';\r\n\t\t\tcase '\\\\':\r\n\t\t\t\treturn '\\\\';\r\n\t\t\tcase 'N':\r\n\t\t\t\t// U+0085 NEXT LINE\r\n\t\t\t\treturn \"\\xC2\\x85\";\r\n\t\t\tcase '_':\r\n\t\t\t\t// U+00A0 NO-BREAK SPACE\r\n\t\t\t\treturn \"\\xC2\\xA0\";\r\n\t\t\tcase 'L':\r\n\t\t\t\t// U+2028 LINE SEPARATOR\r\n\t\t\t\treturn \"\\xE2\\x80\\xA8\";\r\n\t\t\tcase 'P':\r\n\t\t\t\t// U+2029 PARAGRAPH SEPARATOR\r\n\t\t\t\treturn \"\\xE2\\x80\\xA9\";\r\n\t\t\tcase 'x':\r\n\t\t\t\treturn Strings::chr(hexdec(substr($value, 2, 2)));\r\n\t\t\tcase 'u':\r\n\t\t\t\treturn Strings::chr(hexdec(substr($value, 2, 4)));\r\n\t\t\tcase 'U':\r\n\t\t\t\treturn Strings::chr(hexdec(substr($value, 2, 8)));\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new ParseException(sprintf('Found unknown escape character \"%s\".', $value));\r\n\t\t}\r\n\t}", "function charAt($index) {\n return $this->substr($index, 1);\n }", "public function charAt(int $index) : Character\n {\n if ($index < 0 || $index > $this->length() - 1) {\n throw new OutOfBoundsException('Negative values and values greater or equal object length are not allowed!');\n }\n\n return new Character(mb_substr($this->data, $index, 1, $this->encoding));\n }", "private function convertFromJSCharCode(string $value): string\n {\n $matches = [];\n\n // check if value matches typical charCode pattern\n if (preg_match_all('/(?:[\\d+-=\\/\\* ]+(?:\\s?,\\s?[\\d+-=\\/\\* ]+)){4,}/ms', $value, $matches)) {\n $converted = '';\n $string = implode(',', $matches[0]);\n $string = preg_replace('/\\s/', '', $string);\n $string = preg_replace('/\\w+=/', '', $string);\n $charcode = explode(',', $string);\n\n foreach ($charcode as $char) {\n $char = preg_replace('/\\W0/s', '', $char);\n\n if (preg_match_all('/\\d*[+-\\/\\* ]\\d+/', $char, $matches)) {\n $match = preg_split('/(\\W?\\d+)/', implode('', $matches[0]), -1, PREG_SPLIT_DELIM_CAPTURE);\n\n if (array_sum($match) >= 20 && array_sum($match) <= 127) {\n $converted .= chr(array_sum($match));\n }\n } elseif (!empty($char) && $char >= 20 && $char <= 127) {\n $converted .= chr($char);\n }\n }\n\n $value .= \"\\n\" . $converted;\n }\n\n // check for octal charcode pattern\n if (preg_match_all('/(?:(?:[\\\\\\]+\\d+[ \\t]*){8,})/ims', $value, $matches)) {\n $converted = '';\n $charcode = explode('\\\\', preg_replace('/\\s/', '', implode(',', $matches[0])));\n\n foreach (array_map('octdec', array_filter($charcode)) as $char) {\n if (20 <= $char && $char <= 127) {\n $converted .= chr($char);\n }\n }\n $value .= \"\\n\" . $converted;\n }\n\n // check for hexadecimal charcode pattern\n if (preg_match_all('/(?:(?:[\\\\\\]+\\w+\\s*){8,})/ims', $value, $matches)) {\n $converted = '';\n $charcode = explode('\\\\', preg_replace('/[ux]/', '', implode(',', $matches[0])));\n\n foreach (array_map('hexdec', array_filter($charcode)) as $char) {\n if (20 <= $char && $char <= 127) {\n $converted .= chr($char);\n }\n }\n $value .= \"\\n\" . $converted;\n }\n\n return $value;\n }", "protected function _setChar($c) {\n return $this->_setByte(ord($c[0]));\n }", "protected function encodeForReturn($value) {\n\t\t\tif ($this->returnCharset !== 'UTF-8')\n\t\t\t\treturn mb_convert_encoding((string)$value, $this->returnCharset, 'UTF-8');\n\t\t\telse\n\t\t\t\treturn (string)$value;\n\t\t}", "function ascii($value)\n {\n foreach (charsArray() as $key => $val) {\n $value = str_replace($val, $key, $value);\n }\n\n return preg_replace('/[^\\x20-\\x7E]/u', '', $value);\n }", "function ascii($value)\n {\n foreach (charsArray() as $key => $val) {\n $value = str_replace($val, $key, $value);\n }\n\n return preg_replace('/[^\\x20-\\x7E]/u', '', $value);\n }", "public function char($name, $length = 10)\n\t{\n\t\treturn $this->addColumn($name, TableColumn::TYPE_CHAR, TableColumn::SIZE_NORMAL, false, false, $length);\n\t}", "public function charCommand(): int\n {\n $this->output->aList(Char::getConstants(), 'some special char', [\n 'ucFirst' => false,\n ]);\n\n return 0;\n }", "public function char($numbers = true, $upperCase = false, $specialChars = false) {\r\n $chars = array(97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122);\r\n\r\n if ($numbers)\r\n $chars = array_merge($chars, array(48, 49, 50, 51, 52, 53, 54, 55, 56, 57));\r\n\r\n if ($upperCase)\r\n $chars = array_merge($chars, array(65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90));\r\n\r\n if ($specialChars)\r\n $chars = array_merge($chars, array(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 64, 91, 92, 93, 94, 95, 96, 123, 124, 125, 126));\r\n\r\n return chr($this->choose($chars));\r\n }", "public function char($column, $length = 255)\n {\n return $this->addColumnNew('char', $column, compact('length'));\n }", "public function toCodePoint($char);" ]
[ "0.6642396", "0.6516059", "0.6396948", "0.6305468", "0.61943495", "0.60506743", "0.60034454", "0.59974647", "0.5909873", "0.5902906", "0.58923006", "0.5863901", "0.5797249", "0.57056916", "0.56878495", "0.56666833", "0.56657344", "0.56577414", "0.56159234", "0.5607818", "0.55978113", "0.5577364", "0.5572823", "0.5561804", "0.5561804", "0.55574495", "0.54827076", "0.5479762", "0.5454804", "0.540606" ]
0.8402723
0
This method converts the specified value to a dictionary.
public static function toDictionary($value) : array { $type = gettype($value); switch ($type) { case 'array': return $value; case 'object': if (method_exists($value, 'toDictionary')) { return $value->toDictionary(); } if (method_exists($value, 'toMap')) { return Core\Convert::toDictionary($value->toMap()); } return get_object_vars($value); default: throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to a dictionary.', array(':type' => $type)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function toMap($value) : Common\\IMap {\n\t\t\t$type = gettype($value);\n\t\t\tswitch ($type) {\n\t\t\t\tcase 'array':\n\t\t\t\t\treturn new Common\\Mutable\\HashMap($value);\n\t\t\t\tcase 'object':\n\t\t\t\t\tif (method_exists($value, 'toMap')) {\n\t\t\t\t\t\treturn $value->toMap();\n\t\t\t\t\t}\n\t\t\t\t\tif (method_exists($value, 'toDictionary')) {\n\t\t\t\t\t\treturn new Common\\Mutable\\HashMap($value->toDictionary());\n\t\t\t\t\t}\n\t\t\t\t\tif (method_exists($value, 'toList')) {\n\t\t\t\t\t\treturn $value->toList()->toMap();\n\t\t\t\t\t}\n\t\t\t\t\tif (method_exists($value, 'toArray')) {\n\t\t\t\t\t\treturn new Common\\Mutable\\HashMap($value->toArray());\n\t\t\t\t\t}\n\t\t\t\t\treturn new Common\\Mutable\\HashMap(get_object_vars($value));\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Throwable\\Parse\\Exception('Invalid cast. Could not convert value of type \":type\" to a map.', array(':type' => $type));\n\t\t\t}\n\t\t}", "public static function toObject($value) {\n\t\t\t$type = gettype($value);\n\t\t\tswitch ($type) {\n\t\t\t\tcase 'array':\n\t\t\t\t\t$keys = array_keys($value);\n\t\t\t\t\tif (array_keys($keys) !== $keys) { // is_dictionary\n\t\t\t\t\t\treturn (object) $value;\n\t\t\t\t\t}\n\t\t\t\t\tthrow new Throwable\\Parse\\Exception('Invalid cast. Could not convert value of type \":type\" to an object.', array(':type' => $type));\n\t\t\t\tcase 'object':\n\t\t\t\t\treturn $value;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Throwable\\Parse\\Exception('Invalid cast. Could not convert value of type \":type\" to an object.', array(':type' => $type));\n\t\t\t}\n\t\t}", "public function toDictionary(): Dictionary\n {\n $data = [];\n $value = ltrim($this->toNative(), '?');\n parse_str($value, $data);\n\n return Dictionary::fromNative($data);\n }", "private function _from_cookie_val($value) {\n\t\treturn(unserialize($value));\n\t\t//return json_decode($value, true);\n\t}", "public function get_value_hash( $value ) {\n\t\tif( is_array( $value ) ) {\n\t\t\t$old = $value;\n\t\t\tforeach( $old as $key => $_value ) {\n\t\t\t\t$ids = explode( '.', $key );\n\t\t\t\tif( count( $ids ) > 1 ) {\n\t\t\t\t\t$ids[0] = 'x';\n\t\t\t\t}\n\t\t\t\tunset( $value[ $key ] );\n\t\t\t\t$value[ implode( '.', $ids ) ] = $_value;\n\t\t\t}\n\t\t}\n\n\t\treturn json_encode( $value );\n\t}", "protected function setStructuredValueAttribute($value)\n {\n return $this->transformRegistryToJson($value);\n }", "public function getSettingsAttribute($value)\n {\n return json_decode($value, true);\n }", "private static function _parseObject($key,$value)\n\t{\n\t\t\n\t}", "public function convertValue($value) {\n return $value;\n }", "public function deserialize($value) {\n\t\treturn $value;\n\t}", "protected function PrepareData( $value ) \n\t{\n\t\treturn ObjectUtils::ArrayToJSON( $value );\t\n\t}", "public function processValue($value)\n {\n return $this->doProcess($value, $this->buildMap());\n }", "private function getValue($value)\n {\n if (is_array($value))\n {\n return json_encode($value);\n }\n else\n {\n return $value;\n }\n }", "public static function to_object( $value ) {\n\t\treturn ( object ) $value;\n\t}", "protected function _toType($value)\n {\n // Check for PHP specials\n self::_unserialize($value);\n if (!is_scalar($value)) {\n return $value;\n }\n\n // Used in a lot of cases.\n $lower_value = strtolower($value);\n\n if (preg_match('/^(\"(.*)\"|\\'(.*)\\')/', $value, $matches)) {\n $value = (string)str_replace(array('\\'\\'', '\\\\\\''), \"'\", end($matches));\n $value = str_replace('\\\\\"', '\"', $value);\n } elseif (preg_match('/^\\\\[(\\s*)\\\\]$/', $value)) {\n // empty inline mapping\n $value = array();\n } elseif (preg_match('/^\\\\[(.+)\\\\]$/', $value, $matches)) {\n // Inline Sequence\n\n // Take out strings sequences and mappings\n $explode = $this->_inlineEscape($matches[1]);\n\n // Propogate value array\n $value = array();\n foreach ($explode as $v) {\n $value[] = $this->_toType($v);\n }\n } elseif (preg_match('/^\\\\{(\\s*)\\\\}$/', $value)) {\n // empty inline mapping\n $value = array();\n } elseif (strpos($value, ': ') !== false && !preg_match('/^{(.+)/', $value)) {\n // inline mapping\n $array = explode(': ', $value);\n $key = trim($array[0]);\n array_shift($array);\n $value = trim(implode(': ', $array));\n $value = $this->_toType($value);\n $value = array($key => $value);\n } elseif (preg_match(\"/{(.+)}$/\", $value, $matches)) {\n // Inline Mapping\n\n // Take out strings sequences and mappings\n $explode = $this->_inlineEscape($matches[1]);\n\n // Propogate value array\n $array = array();\n foreach ($explode as $v) {\n $array = $array + $this->_toType($v);\n }\n $value = $array;\n } elseif ($lower_value == 'null' || $value == '' || $value == '~') {\n $value = null;\n } elseif ($lower_value == '.nan') {\n $value = NAN;\n } elseif ($lower_value == '.inf') {\n $value = INF;\n } elseif ($lower_value == '-.inf') {\n $value = -INF;\n } elseif (ctype_digit($value)) {\n $value = (int)$value;\n } elseif (in_array($lower_value,\n array('true', 'on', '+', 'yes', 'y'))) {\n $value = true;\n } elseif (in_array($lower_value,\n array('false', 'off', '-', 'no', 'n'))) {\n $value = false;\n } elseif (is_numeric($value)) {\n $value = (float)$value;\n } else {\n // Just a normal string, right?\n if (($pos = strpos($value, '#')) !== false) {\n $value = substr($value, 0, $pos);\n }\n $value = trim($value);\n }\n\n return $value;\n }", "protected function _toType($value)\n {\n // Check for PHP specials\n self::_unserialize($value);\n if (!is_scalar($value)) {\n return $value;\n }\n\n // Used in a lot of cases.\n $lower_value = strtolower($value);\n\n if (preg_match('/^(\"(.*)\"|\\'(.*)\\')/', $value, $matches)) {\n $value = (string)str_replace(array('\\'\\'', '\\\\\\''), \"'\", end($matches));\n $value = str_replace('\\\\\"', '\"', $value);\n } elseif (preg_match('/^\\\\[(\\s*)\\\\]$/', $value)) {\n // empty inline mapping\n $value = array();\n } elseif (preg_match('/^\\\\[(.+)\\\\]$/', $value, $matches)) {\n // Inline Sequence\n\n // Take out strings sequences and mappings\n $explode = $this->_inlineEscape($matches[1]);\n\n // Propogate value array\n $value = array();\n foreach ($explode as $v) {\n $value[] = $this->_toType($v);\n }\n } elseif (preg_match('/^\\\\{(\\s*)\\\\}$/', $value)) {\n // empty inline mapping\n $value = array();\n } elseif (strpos($value, ': ') !== false &&\n !preg_match('/^{(.+)/', $value)) {\n // inline mapping\n $array = explode(': ', $value);\n $key = trim($array[0]);\n array_shift($array);\n $value = trim(implode(': ', $array));\n $value = $this->_toType($value);\n $value = array($key => $value);\n } elseif (preg_match(\"/{(.+)}$/\", $value, $matches)) {\n // Inline Mapping\n\n // Take out strings sequences and mappings\n $explode = $this->_inlineEscape($matches[1]);\n\n // Propogate value array\n $array = array();\n foreach ($explode as $v) {\n $array = $array + $this->_toType($v);\n }\n $value = $array;\n } elseif ($lower_value == 'null' || $value == '' || $value == '~') {\n $value = null;\n } elseif ($lower_value == '.nan') {\n $value = NAN;\n } elseif ($lower_value == '.inf') {\n $value = INF;\n } elseif ($lower_value == '-.inf') {\n $value = -INF;\n } elseif (ctype_digit($value)) {\n $value = (int)$value;\n } elseif (in_array($lower_value,\n array('true', 'on', '+', 'yes', 'y'))) {\n $value = true;\n } elseif (in_array($lower_value,\n array('false', 'off', '-', 'no', 'n'))) {\n $value = false;\n } elseif (is_numeric($value)) {\n $value = (float)$value;\n } else {\n // Just a normal string, right?\n if (($pos = strpos($value, '#')) !== false) {\n $value = substr($value, 0, $pos);\n }\n $value = trim($value);\n }\n\n return $value;\n }", "public function getValueAttribute($value)\n {\n // Decode retrieved value\n return json_decode($value, true);\n }", "public function fromPersistentValue($value, $targetType)\n {\n return $this->converters[$targetType]->fromHash($value);\n }", "public function decodeValue($value)\n\t{\n\t\tif($this->type == 'object')\n\t\t{\n\t\t\treturn unserialize($value);\n\t\t}\n\t\telseif($this->type == 'boolean')\n\t\t{\n\t\t\treturn !empty($value);\n\t\t}\n\t\treturn $value;\n\t}", "protected function asJson($value)\n {\n return json_encode($value, JSON_UNESCAPED_UNICODE);\n }", "protected function asJson($value)\n {\n return json_encode($value, JSON_UNESCAPED_UNICODE);\n }", "protected function asJson($value)\n {\n return json_encode($value, JSON_UNESCAPED_UNICODE);\n }", "protected function decode($value)\n {\n return @unserialize($value);\n }", "public function load_value( $value, $slug, $post_id ) {\n\t\t$value = maybe_unserialize( $value );\n\n\t\treturn papi_maybe_json_decode( $value, $this->convert_type === 'array' );\n\t}", "private static function mapToJson($value) {\n if (is_object($value)){\n if($value instanceof ClientValueObject) {\n $properties = array_filter(get_object_vars($value), function($var){\n return !is_null($var);\n });\n return array_map(function ($p) {\n return self::mapToJson($p);\n }, $properties);\n }\n elseif ($value instanceOf ClientObject){\n return array_map(function ($value) {\n return self::mapToJson($value);\n }, $value->getChangedProperties());\n }\n }\n elseif (is_array($value)) {\n return array_map(function ($value) {\n return self::mapToJson($value);\n }, $value);\n }\n else {\n return $value;\n }\n }", "public function toMap();", "public static function jsonDecode($value, bool $assoc=true)\n {\n return json_decode($value, $assoc);\n\n }", "protected function transformValue($value)\n {\n // Override this method to transform values\n\n return $value;\n }", "protected function _prepareValue($key, $value)\n {\n return $value;\n }", "public static function settings($value)\n {\n if (static::isAssociativeArray($value)) {\n return new static($value);\n }\n\n return $value;\n }" ]
[ "0.6536725", "0.5760304", "0.5733857", "0.5562619", "0.5403295", "0.5365203", "0.53403413", "0.53330046", "0.52982724", "0.5280235", "0.52781105", "0.5274048", "0.51841986", "0.51758426", "0.5167033", "0.51645654", "0.5142453", "0.5110092", "0.5066342", "0.50363207", "0.50363207", "0.50363207", "0.50133175", "0.49677762", "0.49526066", "0.49372274", "0.49051166", "0.48775795", "0.48766062", "0.48752278" ]
0.7722055
0
This method converts the specified value to a double.
public static function toDouble($value) : float { $type = gettype($value); switch ($type) { case 'boolean': return doubleval($value); case 'double': return $value; case 'integer': return doubleval($value); case 'NULL': return 0.0; case 'object': if (method_exists($value, 'toDouble')) { return $value->toDouble(); } else if ($value instanceof Common\StringRef) { return static::toDouble($value->__toString()); } else if ($value instanceof Core\Data\Undefined) { return 0.0; } else { throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to a double.', array(':type' => get_class($value))); } case 'string': $value = trim($value); if (empty($value)) { return 0.0; } if (isset($value[0]) && ($value[0] == '.')) { $value = '0' . $value; } if (preg_match('/^[+-]?([0-9]+)((\.[0-9]+)|([eE][+-]?(0|[1-9][0-9]*)))?$/', $value)) { return doubleval($value); } else if (preg_match('/^[+-]?([0-9]+)(,[0-9]{3})*(\.[0-9]+)?$/', $value)) { return doubleval(preg_replace('/[^-+\d.]/', '', $value)); } else { throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to a double.', array(':type' => $type)); } default: throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to a double.', array(':type' => $type)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function doubleValue() { return (double)$this->num; }", "public function double($valueToDouble) {\n return $valueToDouble * 2;\n }", "public function getDoubleValue() {}", "public function getDoubleValue() {}", "public static function doubleValue()\n {\n return Hamcrest_Type_IsDouble::doubleValue();\n }", "public function setVDouble($value)\n {\n return $this->set(self::V_DOUBLE, $value);\n }", "public function setDoubleValue($var)\n {\n GPBUtil::checkDouble($var);\n $this->writeOneof(8, $var);\n\n return $this;\n }", "public function setDoubleValue($var)\n {\n GPBUtil::checkDouble($var);\n $this->writeOneof(2, $var);\n\n return $this;\n }", "public function getXsiTypeName() {\n return \"DoubleValue\";\n }", "public function getDoubleValue()\n {\n return $this->readOneof(8);\n }", "public function setDoubleValue($var) {}", "public function getDoubleValue()\n {\n return $this->readOneof(2);\n }", "public function setAsDouble($var)\n {\n GPBUtil::checkDouble($var);\n $this->writeOneof(3, $var);\n\n return $this;\n }", "public function getDouble()\n {\n fscanf(STDIN, '%f', $num);\n if (filter_var($num, FILTER_VALIDATE_FLOAT)) {\n return $num;\n } else {\n echo \"enter valid double value \\n\";\n return $this->getDouble();\n }\n }", "public function getAsDouble()\n {\n return $this->readOneof(3);\n }", "public function doubleValue($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function isDouble($value)\n {\n /*if (filter_var($value, FILTER_VALIDATE_INT)) {\n return false;\n } else {\n if (filter_var($value, FILTER_VALIDATE_FLOAT)) {\n return true;\n } else {\n if (in_array($value, [0, 0.0, '0', '0.0'], true)) {\n return true;\n } else {\n return false;\n }\n }\n }*/\n return NumberValidator::isReal($value);\n }", "protected static function _isDouble($value)\r\n\t{\r\n\t\t$isDouble = false;\r\n\t\tif (is_double($value))\r\n\t\t{\r\n\t\t\t$isDouble = true;\r\n\t\t}\r\n\t\telse if (is_numeric($value))\r\n\t\t{\r\n\t\t\tif (strval(doubleval($value)) == $value)\r\n\t\t\t\t$isDouble = true;\r\n\t\t\telse if ( preg_match('/^\\s*\\d*(\\.\\d*)?\\s*$/', $value)===1 )\r\n\t\t\t\t$isDouble = true;\r\n\t\t}\r\n\t\treturn $isDouble;\r\n\t}", "public function getAmountAttribute($value)\n {\n return doubleval($value);\n }", "public function getVDouble()\n {\n return $this->get(self::V_DOUBLE);\n }", "public static function isDouble($pValue)\n {\n return is_float($pValue);\n }", "public static function floatValue()\n {\n return Hamcrest_Type_IsDouble::doubleValue();\n }", "public static function fromDouble($doubleValue) {\n return self::fromFloat($doubleValue);\n }", "function doubleval ($var) {}", "function is_double ($var) {}", "public function double(string $name, array $params = [])\n {\n $this->validateField(\"numeric\", $name, $params);\n\n $this->mapping[$name] = $params;\n $this->mapping[$name][\"type\"] = \"double\";\n\n return $this;\n }", "public function __construct($value)\n {\n $this->_type = self::XMLRPC_TYPE_DOUBLE;\n $this->_value = sprintf('%f',(float)$value); // Make sure this value is float (double) and without the scientific notation\n }", "protected function sanitizeDouble(string $value, array $flags = []): string\r\n {\r\n return filter_var(\r\n $value,\r\n FILTER_SANITIZE_NUMBER_FLOAT,\r\n $this->joinFlags($flags)\r\n );\r\n }", "public function readDouble () {\n\t\t$i1 = $this->readInt32();\n\t\t$i2 = $this->readInt32();\n\t\tif ($this->bigEndian) {\n\t\t\treturn \\unpack(\"d\", \\pack(\"ii\", (FPHelper::$isLittleEndian ? $i2 : $i1), (FPHelper::$isLittleEndian ? $i1 : $i2)))[1];\n\t\t} else {\n\t\t\treturn \\unpack(\"d\", \\pack(\"ii\", (FPHelper::$isLittleEndian ? $i1 : $i2), (FPHelper::$isLittleEndian ? $i2 : $i1)))[1];\n\t\t}\n\t}", "public function testCreateValueDoubleWithInt()\n {\n $value = $this->node->setProperty('propDoubleNum', 10, PropertyType::DOUBLE);\n $this->assertInstanceOf(PropertyInterface::class, $value);\n $this->assertSame('10', $value->getString());\n $this->assertSame(10.0, $value->getDouble());\n $this->assertSame(10, $value->getLong());\n $this->assertEquals(PropertyType::DOUBLE, $value->getType());\n\n $this->saveAndRenewSession();\n $value = $this->session->getProperty('/tests_general_base/numberPropertyNode/jcr:content/propDoubleNum');\n $this->assertSame('10', $value->getString());\n $this->assertSame(10.0, $value->getDouble());\n $this->assertSame(10, $value->getLong());\n $this->assertEquals(PropertyType::DOUBLE, $value->getType());\n }" ]
[ "0.73619944", "0.7287257", "0.72581005", "0.72581005", "0.7145819", "0.6951316", "0.6867054", "0.68595856", "0.6744991", "0.67019415", "0.66880125", "0.6668657", "0.6573213", "0.64425635", "0.6328694", "0.60985017", "0.6075752", "0.6060548", "0.60180753", "0.6002092", "0.5970389", "0.5861356", "0.5797956", "0.56808096", "0.5666135", "0.56561685", "0.56398326", "0.5599081", "0.55640393", "0.54510695" ]
0.73403597
1
This method converts the specified value to a list.
public static function toList($value) : Common\IList { $type = gettype($value); switch ($type) { case 'array': return new Common\Mutable\ArrayList($value); case 'object': if (method_exists($value, 'toList')) { return $value->toList(); } if (method_exists($value, 'toArray')) { return new Common\Mutable\ArrayList($value->toArray()); } if (method_exists($value, 'toMap')) { return $value->toMap()->toList(); } if (method_exists($value, 'toDictionary')) { return new Common\Mutable\ArrayList($value->toDictionary()); } return new Common\Mutable\ArrayList(get_object_vars($value)); default: throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to a list.', array(':type' => $type)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reverseTransform($value): array\n {\n $tagNames = explode(',', $value);\n\n $listTags = [];\n\n foreach ($tagNames as $tagName) {\n if ('' !== trim($tagName)) {\n $listTag = $this->repository->findOneByName(strtolower($tagName));\n if (null == $listTag) {\n $listTag = new ListTag();\n $listTag->setName($tagName);\n $this->repository->save($listTag);\n }\n $listTags[] = $listTag;\n }\n }\n\n return $listTags;\n }", "function toList();", "public static function to_array( $value ) {\n\t\treturn ( array ) $value;\n\t}", "public static function castToArray($value): array\n {\n return is_array($value) ? $value : [];\n }", "private function asArray(mixed $value): array {\n if (is_array($value)) {\n return $value;\n }\n\n return [$value];\n }", "protected function convertToArray($value)\n {\n if (\\is_string($value)) {\n $value = [$value];\n } elseif (null === $value) {\n $value = [];\n }\n\n return $value;\n }", "public function convertToArray($Value)\n {\n return [$Value];\n }", "public function setListType($value)\n {\n return $this->set(self::list_type, $value);\n }", "public function asList(): self;", "public static function asList($value = NULL, $models = FALSE){\n\t\tif(!is_array($models)){\n\t\t\t$self = get_called_class();\n\t\t\t$models = $self::all();\n\t\t}\n\n\t\t$return = array();\n\t\tforeach($models as $model){\n\t\t\tif(is_int($model) || $model instanceof WP_Post){\n\t\t\t\t$model = Self::find($model->ID);\n\t\t\t}\n\n\t\t\tif(is_null($value)){\n\t\t\t\t$return[$model->ID] = $model;\n\t\t\t}else{\n\t\t\t\t$return[$model->ID] = $model->$value;\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "public function lists($value, $key = null)\n {\n return static::array_pluck($this->items, $value, $key);\n }", "public function getListValue() {}", "private function castArray($value): array\n {\n return is_array($value) ? $value : (array) json_decode($value, true);\n }", "public function lists($value, $key = null)\n\t{\n\t\t$list = [];\n\n\t\tif ( $key ) {\n\t\t\tforeach($this->items as $entity) {\n\t\t\t\t$list[$entity->$key] = $entity->$value;\n\t\t\t}\n\n\t\t\treturn $list;\n\t\t}\n\n\t\tforeach($this->items as $entity) {\n\t\t\t$list[] = $entity->$value;\n\t\t}\n\n\t\treturn $list;\n\t}", "public function getFolioAttribute($value)\n {\n return collect(explode(\",\", str_replace([\"[\", \"]\"], \"\", $value)));\n }", "function pimd_get_list_values($arr) {\n\t$vals = array();\n\tforeach ($arr as $a) {\n\t\t$vals[] = $a['value'];\n\t}\n\treturn $vals;\n}", "public function string_to_array( $value ) {\n\t\t\tif ( !$value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Return if already an array\n\t\t\tif ( is_array( $value ) ) {\n\t\t\t\treturn $value;\n\t\t\t}\n\n\t\t\t// Define output array\n\t\t\t$array = array();\n\n\t\t\t// Clean up value\n\t\t\t$items = preg_split( '/\\,[\\s]*/', $value );\n\n\t\t\t// Create array\n\t\t\tforeach ( $items as $item ) {\n\t\t\t\tif ( strlen( $item ) > 0 ) {\n\t\t\t\t\t$array[] = $item;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Return array\n\t\t\treturn $array;\n\t\t}", "public function ToList()\n {\n }", "protected function morphToArray($value)\n {\n return $value instanceof Arrayable ? $value->toArray() : $value;\n }", "public static function wrap($value)\n {\n if (is_null($value)) {\n return [];\n }\n\n return is_array($value) ? $value : [$value];\n }", "public static function wrap($value)\n {\n if (is_null($value)) {\n return [];\n }\n\n return is_array($value) ? $value : [$value];\n }", "public function asArray($value)\n {\n return is_object($value) ? get_object_vars($value) : (array)$value;\n }", "public static function wrap(mixed $value): array\n {\n if (is_null($value)) {\n return [];\n }\n\n return is_array($value) ? $value : [$value];\n }", "public function bindArrayOfIds($value)\n {\n if (!is_array($value)) {\n $value = explode(',', $value);\n }\n\n $value = array_map('trim', $value);\n $value = array_filter($value, 'is_numeric');\n\n return $value;\n }", "private function wrap($value): array\n {\n if (! is_array($value)) {\n $value = empty($value) ? [] : [$value];\n }\n\n return $value;\n }", "public function getValueList()\n {\n return $this->valueList;\n }", "protected function getArrayValue($value)\n {\n if (is_array($value)) {\n return $value;\n }\n if (false !== strpos($value, \"\\n\")) {\n $value = array_filter(explode(\"\\n\", $value));\n }\n return !is_array($value) ? [$value] : $value;\n }", "protected function getValuesHelper($value) : array {\n if(is_string($value)) {\n return [trim($value)];\n }\n if(is_array($value)) {\n return array_map(function($value) {\n return trim(StringUtil::stringify($value));\n }, $value);\n }\n return [trim(StringUtil::stringify($value))];\n }", "private static function propertyToArrayValue($value)\n {\n if (is_subclass_of($value, '\\DTS\\eBaySDK\\Types\\BaseType', false)) {\n return $value->toArray();\n } elseif ($value instanceof \\DateTime) {\n return $value->format('Y-m-d\\TH:i:s.000\\Z');\n } else {\n return $value;\n }\n }", "public function getResultAttribute($value)\n {\n if ($value) {\n return explode('|', $value);\n } else {\n return [];\n }\n }" ]
[ "0.7003417", "0.65181863", "0.64585996", "0.6454278", "0.64037395", "0.6373444", "0.6346298", "0.6308718", "0.6300318", "0.61953115", "0.615159", "0.61157435", "0.610742", "0.60979944", "0.6085784", "0.60826933", "0.6069062", "0.6064299", "0.5994058", "0.5950668", "0.5950668", "0.59432834", "0.59303856", "0.5913752", "0.5877628", "0.584445", "0.5828204", "0.5818097", "0.5816693", "0.58029515" ]
0.7553344
0
This method converts the specified value to a map.
public static function toMap($value) : Common\IMap { $type = gettype($value); switch ($type) { case 'array': return new Common\Mutable\HashMap($value); case 'object': if (method_exists($value, 'toMap')) { return $value->toMap(); } if (method_exists($value, 'toDictionary')) { return new Common\Mutable\HashMap($value->toDictionary()); } if (method_exists($value, 'toList')) { return $value->toList()->toMap(); } if (method_exists($value, 'toArray')) { return new Common\Mutable\HashMap($value->toArray()); } return new Common\Mutable\HashMap(get_object_vars($value)); default: throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to a map.', array(':type' => $type)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function map($value = null): Map\n {\n return new Map($value);\n }", "public function toMap();", "public static function toDictionary($value) : array {\n\t\t\t$type = gettype($value);\n\t\t\tswitch ($type) {\n\t\t\t\tcase 'array':\n\t\t\t\t\treturn $value;\n\t\t\t\tcase 'object':\n\t\t\t\t\tif (method_exists($value, 'toDictionary')) {\n\t\t\t\t\t\treturn $value->toDictionary();\n\t\t\t\t\t}\n\t\t\t\t\tif (method_exists($value, 'toMap')) {\n\t\t\t\t\t\treturn Core\\Convert::toDictionary($value->toMap());\n\t\t\t\t\t}\n\t\t\t\t\treturn get_object_vars($value);\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Throwable\\Parse\\Exception('Invalid cast. Could not convert value of type \":type\" to a dictionary.', array(':type' => $type));\n\t\t\t}\n\t\t}", "public function to_map_values( $value, $map, $default ) {\n\t\tif ( in_array( $value, $map ) ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\treturn $default;\n\t}", "function _publication_xml_process_map($value, $type = 'latitude'){\n if(isset($value[LANGUAGE_NONE][0])){\n $map = (array)($value[LANGUAGE_NONE][0]);\n }else{\n $map = (array)$value;\n }\n return $map[$type];\n}", "public function map($value);", "public function setMap($value)\n {\n $this->options['map'] = new JsExpression($value);\n }", "abstract public function mapFieldValue($value);", "public function setIsmap(string $value):static {\n return $this->setAttribute('ismap', $value);\n }", "public function processValue($value)\n {\n return $this->doProcess($value, $this->buildMap());\n }", "public static function setMAP($value) {self::$b_MAP = $value;}", "function map($value);", "public static function toMap(Iterator|array|stdClass $collection): Map {\n\t\tif ($collection instanceof stdClass) {\n\t\t\t/** @var array $collection */\n\t\t\t$collection = json_decode(json_encode($collection), true);\n\t\t}\n\n\t\t$map = new Map();\n\t\t/**\n\t\t * @var string $k\n\t\t * @var string $v\n\t\t */\n\t\tforeach ($collection as $k => $v) {\n\t\t\t$map->set($k, self::toCollection($v));\n\t\t}\n\n\t\treturn $map;\n\t}", "public function internalTransform($value)\n {\n $this->model->saveLastQuery = true;\n $result = $this->doQuery($value);\n\n if($result && (count($result) === 1)) {\n return $result[0][$this->config['map']]; // return a specific key's value\n } else {\n\n /*\n echo(\"<pre>\");\n print_r([\n 'result' => $result,\n 'config' => $this->config,\n 'value' => $value\n ]);\n echo(\"</pre>\");\n die(\"no or multiple results!\");\n */\n if(isset($this->config['required']) && $this->config['required']) {\n /*\n self::$counter++;\n\n echo(\"<pre>\");\n print_r([\n 'config' => $this->config,\n 'value' => $value\n ]);\n echo(\"</pre>\");\n\n if(self::$counter == 10) {\n die();\n }\n */\n\n $this->errorstack->addError($this->config['map'], 'MAP_ERROR', [\n 'config' => $this->config,\n 'value' => $value\n ]);\n }\n }\n return null;\n }", "public function asMap(): Map\n {\n return new Map($this->history->toArray());\n }", "public function addMapids( $value){\n return $this->_add(1, $value);\n }", "public static function toMap(string|\\Stringable $json): Map {\n\t\treturn CollectionUtils::toMap(json_decode((string) $json, true));\n\t}", "protected function _toType($value)\n {\n // Check for PHP specials\n self::_unserialize($value);\n if (!is_scalar($value)) {\n return $value;\n }\n\n // Used in a lot of cases.\n $lower_value = strtolower($value);\n\n if (preg_match('/^(\"(.*)\"|\\'(.*)\\')/', $value, $matches)) {\n $value = (string)str_replace(array('\\'\\'', '\\\\\\''), \"'\", end($matches));\n $value = str_replace('\\\\\"', '\"', $value);\n } elseif (preg_match('/^\\\\[(\\s*)\\\\]$/', $value)) {\n // empty inline mapping\n $value = array();\n } elseif (preg_match('/^\\\\[(.+)\\\\]$/', $value, $matches)) {\n // Inline Sequence\n\n // Take out strings sequences and mappings\n $explode = $this->_inlineEscape($matches[1]);\n\n // Propogate value array\n $value = array();\n foreach ($explode as $v) {\n $value[] = $this->_toType($v);\n }\n } elseif (preg_match('/^\\\\{(\\s*)\\\\}$/', $value)) {\n // empty inline mapping\n $value = array();\n } elseif (strpos($value, ': ') !== false && !preg_match('/^{(.+)/', $value)) {\n // inline mapping\n $array = explode(': ', $value);\n $key = trim($array[0]);\n array_shift($array);\n $value = trim(implode(': ', $array));\n $value = $this->_toType($value);\n $value = array($key => $value);\n } elseif (preg_match(\"/{(.+)}$/\", $value, $matches)) {\n // Inline Mapping\n\n // Take out strings sequences and mappings\n $explode = $this->_inlineEscape($matches[1]);\n\n // Propogate value array\n $array = array();\n foreach ($explode as $v) {\n $array = $array + $this->_toType($v);\n }\n $value = $array;\n } elseif ($lower_value == 'null' || $value == '' || $value == '~') {\n $value = null;\n } elseif ($lower_value == '.nan') {\n $value = NAN;\n } elseif ($lower_value == '.inf') {\n $value = INF;\n } elseif ($lower_value == '-.inf') {\n $value = -INF;\n } elseif (ctype_digit($value)) {\n $value = (int)$value;\n } elseif (in_array($lower_value,\n array('true', 'on', '+', 'yes', 'y'))) {\n $value = true;\n } elseif (in_array($lower_value,\n array('false', 'off', '-', 'no', 'n'))) {\n $value = false;\n } elseif (is_numeric($value)) {\n $value = (float)$value;\n } else {\n // Just a normal string, right?\n if (($pos = strpos($value, '#')) !== false) {\n $value = substr($value, 0, $pos);\n }\n $value = trim($value);\n }\n\n return $value;\n }", "protected function _toType($value)\n {\n // Check for PHP specials\n self::_unserialize($value);\n if (!is_scalar($value)) {\n return $value;\n }\n\n // Used in a lot of cases.\n $lower_value = strtolower($value);\n\n if (preg_match('/^(\"(.*)\"|\\'(.*)\\')/', $value, $matches)) {\n $value = (string)str_replace(array('\\'\\'', '\\\\\\''), \"'\", end($matches));\n $value = str_replace('\\\\\"', '\"', $value);\n } elseif (preg_match('/^\\\\[(\\s*)\\\\]$/', $value)) {\n // empty inline mapping\n $value = array();\n } elseif (preg_match('/^\\\\[(.+)\\\\]$/', $value, $matches)) {\n // Inline Sequence\n\n // Take out strings sequences and mappings\n $explode = $this->_inlineEscape($matches[1]);\n\n // Propogate value array\n $value = array();\n foreach ($explode as $v) {\n $value[] = $this->_toType($v);\n }\n } elseif (preg_match('/^\\\\{(\\s*)\\\\}$/', $value)) {\n // empty inline mapping\n $value = array();\n } elseif (strpos($value, ': ') !== false &&\n !preg_match('/^{(.+)/', $value)) {\n // inline mapping\n $array = explode(': ', $value);\n $key = trim($array[0]);\n array_shift($array);\n $value = trim(implode(': ', $array));\n $value = $this->_toType($value);\n $value = array($key => $value);\n } elseif (preg_match(\"/{(.+)}$/\", $value, $matches)) {\n // Inline Mapping\n\n // Take out strings sequences and mappings\n $explode = $this->_inlineEscape($matches[1]);\n\n // Propogate value array\n $array = array();\n foreach ($explode as $v) {\n $array = $array + $this->_toType($v);\n }\n $value = $array;\n } elseif ($lower_value == 'null' || $value == '' || $value == '~') {\n $value = null;\n } elseif ($lower_value == '.nan') {\n $value = NAN;\n } elseif ($lower_value == '.inf') {\n $value = INF;\n } elseif ($lower_value == '-.inf') {\n $value = -INF;\n } elseif (ctype_digit($value)) {\n $value = (int)$value;\n } elseif (in_array($lower_value,\n array('true', 'on', '+', 'yes', 'y'))) {\n $value = true;\n } elseif (in_array($lower_value,\n array('false', 'off', '-', 'no', 'n'))) {\n $value = false;\n } elseif (is_numeric($value)) {\n $value = (float)$value;\n } else {\n // Just a normal string, right?\n if (($pos = strpos($value, '#')) !== false) {\n $value = substr($value, 0, $pos);\n }\n $value = trim($value);\n }\n\n return $value;\n }", "public function convertValue($value) {\n return $value;\n }", "function setUseMap($value)\n {\n $this->setAttribute(\"usemap\", $value);\n return $this;\n }", "private static function mapToJson($value) {\n if (is_object($value)){\n if($value instanceof ClientValueObject) {\n $properties = array_filter(get_object_vars($value), function($var){\n return !is_null($var);\n });\n return array_map(function ($p) {\n return self::mapToJson($p);\n }, $properties);\n }\n elseif ($value instanceOf ClientObject){\n return array_map(function ($value) {\n return self::mapToJson($value);\n }, $value->getChangedProperties());\n }\n }\n elseif (is_array($value)) {\n return array_map(function ($value) {\n return self::mapToJson($value);\n }, $value);\n }\n else {\n return $value;\n }\n }", "protected function transformValue($value)\n {\n // Override this method to transform values\n\n return $value;\n }", "private function _from_cookie_val($value) {\n\t\treturn(unserialize($value));\n\t\t//return json_decode($value, true);\n\t}", "protected function toResultType($key, $value)\n\t{\n\t if(isset($this->_columnsMap[$key]) && !is_callable($this->_columnsMap[$key]) && isset($this->_columnsMap[$key]['origin']))\n\t $key = $this->_columnsMap[$key]['origin'];\n\n\t if(isset($this->_schema[$key]))\n\t\t{\n\t\t\tif($this->_schema[$key] == 'int') return (int)0;\n\t\t\telseif (substr($this->_schema[$key],0,3)== 'map')\n\t\t\t{\n\t\t\t\t$types = explode(',',str_replace(['map','<','>',' ',],'',$this->_schema[$key]));\n\n\t\t\t\treturn (new Map($value, $types[0], $types[1], $this->_convertMapToJson))->toObject();\n\t\t\t}\n\t\t\telseif (substr($this->_schema[$key],0,3)== 'set')\n\t\t\t{\n\t\t\t\t$types = explode(',',str_replace(['set','<','>',' ',],'',$this->_schema[$key]));\n\n\t\t\t\treturn (new Set($value, $types[0]))->toArray();\n\t\t\t}\n\t\t\telseif($this->_schema[$key] == 'double') \t\t\treturn (float)$value;\n\t\t\telseif($this->_schema[$key] == 'boolean') \t\treturn $value;\n\t\t\telseif($this->_schema[$key] == 'text') \t\t\t\treturn '';\n\t\t\telseif($this->_schema[$key] == 'uuid') \t\t\t\treturn (string)$value;\n\t\t\telseif($this->_schema[$key] == 'timestamp') \treturn $value === null ? (new Timestamp($value))->setDefault()->toInt() : (new Timestamp($value))->toInt();\n\t\t\telseif($this->_schema[$key] == 'decimal') \t\treturn (float)$value;\n\t\t\telseif($this->_schema[$key] == 'float') \t\t\treturn (float)$value;\n\t\t\telseif($this->_schema[$key] == 'bigint') \t\t\treturn (string)($value);\n\t\t\telseif($this->_schema[$key] == 'tinyint') \t\treturn (int)($value);\n\t\t\telseif($this->_schema[$key] == 'counter') \t\treturn (int)($value);\n\t\t\telseif($this->_schema[$key] == 'date') \t\t\t\treturn $value === null ? (new Date($value))->setDefault()->toInt() : (new Date($value))->toInt();\n\t\t\telseif($this->_schema[$key] == 'timeuuid') \t\treturn (string)($value);\n\t\t\telseif($this->_schema[$key] == 'blob') \t\t\t\treturn (new Blob($value))->getContent();\n elseif($this->_schema[$key] == 'inet') \t\t\t\treturn (string)$value;\n\t\t\telse\n\t\t\t\tthrow new \\Exception(\"Your key($key) using unsupported data type\");\n\t\t}\n\t\telse\n\t\t\tthrow new \\Exception(\"Your key($key) is missing in table schema\");\n\n\t}", "static function string_to_map(){\n\t\t$lines = array_filter(preg_split('@[\\s\\n]+@', $map_string));\n\t\t$array = [];\n\t\t$lines = array_filter($lines);\n\t\tforeach($lines as $line){\n\t\t\t$parts = explode(':', $line);\n\t\t\tif($parts[0] === ''){\n\t\t\t\t$parts[0] = $parts[1];\n\t\t\t}elseif($parts[1] === ''){\n\t\t\t\t$parts[1] = $parts[0];\n\t\t\t}\n\t\t\t$array[$parts[0]] = $parts[1];\n\t\t}\n\t\treturn $array;\n\t}", "public static function toObject($value) {\n\t\t\t$type = gettype($value);\n\t\t\tswitch ($type) {\n\t\t\t\tcase 'array':\n\t\t\t\t\t$keys = array_keys($value);\n\t\t\t\t\tif (array_keys($keys) !== $keys) { // is_dictionary\n\t\t\t\t\t\treturn (object) $value;\n\t\t\t\t\t}\n\t\t\t\t\tthrow new Throwable\\Parse\\Exception('Invalid cast. Could not convert value of type \":type\" to an object.', array(':type' => $type));\n\t\t\t\tcase 'object':\n\t\t\t\t\treturn $value;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Throwable\\Parse\\Exception('Invalid cast. Could not convert value of type \":type\" to an object.', array(':type' => $type));\n\t\t\t}\n\t\t}", "public function transform($value)\n {\n if (!empty($value)) {\n if (is_string($value)) {\n $obj = $this->repository->find($value);\n if (!$obj) {\n return;\n }\n $label = null === $this->callback ? (string) $obj : $obj->{$this->callback}();\n\n return ['id' => $value, 'label' => $label];\n }\n }\n\n return $value;\n }", "abstract public function mapType(): MapType;", "public function fromPersistentValue($value, $targetType)\n {\n return $this->converters[$targetType]->fromHash($value);\n }" ]
[ "0.6832471", "0.6639881", "0.66154677", "0.65886754", "0.61818856", "0.6169644", "0.5993226", "0.5876581", "0.571797", "0.5661937", "0.56601804", "0.55801255", "0.5563962", "0.5520425", "0.540351", "0.53459764", "0.5329856", "0.5318661", "0.5314322", "0.5265487", "0.52077943", "0.51480603", "0.5102323", "0.5072414", "0.50520676", "0.50177896", "0.4961607", "0.49443844", "0.49115416", "0.49078932" ]
0.81594193
0
This method converts the specified value to an object.
public static function toObject($value) { $type = gettype($value); switch ($type) { case 'array': $keys = array_keys($value); if (array_keys($keys) !== $keys) { // is_dictionary return (object) $value; } throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to an object.', array(':type' => $type)); case 'object': return $value; default: throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to an object.', array(':type' => $type)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function to_object( $value ) {\n\t\treturn ( object ) $value;\n\t}", "public function toObject($value)\n {\n $this->instantiateProperty($this, $value);\n }", "public static function ensureObject($value)\n\t{\n\t\treturn (object)$value;\n\t}", "public static function of( $value )\n {\n return new self(is_object($value) ? get_class($value) : gettype($value));\n }", "public static function from_value( $value ) {\n\t\treturn $value instanceof static ? $value : new static( $value );\n\t}", "public abstract function coerce($value);", "public static function convertFromBean($value);", "public function convertValue($value) {\n return $value;\n }", "public static function convertToBean($value);", "public function cast($value);", "public function set_value($value) {\n if (is_object($value)) {\n $this->set_object($value);\n }\n else {\n $this->value = $value;\n $this->object = NULL;\n }\n return $this;\n }", "public function hydrate($value)\n {\n return $value;\n }", "public function __construct($value)\n {\n if ($this->isSatisfiedBy($value)) {\n $this->value = $value;\n }\n else {\n $class = get_class($this);\n throw(new ValueObjectException('Invalid value ' . $value . ' for object ' . $class));\n }\n }", "public static function object_load($value) { \n return user_load($value);\n }", "public function setObject($value)\n {\n return $this->setParameter('object', $value);\n }", "public function unserialize(string $value, string $class): object;", "function to_obj(&$data) : void\n {\n if (is_array($data)) {\n $data = Jasny\\objectify($data);\n } elseif ($data instanceof \\Illuminate\\Database\\Eloquent\\Collection) {\n $data = $data->toArray();\n to_obj($data);\n } elseif (is_object($data) && method_exists($data, 'toArray')) {\n $data = $data->toArray();\n to_obj($data);\n } elseif (!$data instanceof \\stdClass) {\n $value = $data;\n $data = new \\stdClass();\n $data->value = $value;\n }\n }", "public function cast($value)\n {\n $model = $this->getTargetModel();\n\n $name = $this->getTarget(\\get_class($value))->getAttribute()->getName();\n\n if (\\is_null($value) || $value instanceof $model || \\is_array($value) || $value instanceof LaramoreCollection) {\n return $value;\n }\n\n $model = new $model;\n $model->setAttributeValue($name, $value);\n\n return $model;\n }", "abstract protected function cast($value);", "public abstract static function object_load($value);", "public function setUserObject($value)\n {\n return $this->set('UserObject', $value);\n }", "public function setUserObject($value)\n {\n return $this->set('UserObject', $value);\n }", "public static function valueOf($value) : self\n {\n $strVal = null;\n\n switch (\\gettype($value)) {\n case 'object':\n if ($value instanceof StdObject || (\\is_object($value) && method_exists($value, '__toString'))) {\n $strVal = (string) $value;\n }\n break;\n case 'boolean':\n $strVal = $value ? 'true' : 'false';\n break;\n case 'double':\n case 'integer':\n case 'string':\n $strVal = (string) $value;\n break;\n }\n\n if ($strVal === null) {\n throw new InvalidArgumentException('Unsupported value type!');\n }\n\n return new self($strVal);\n }", "public function toObject();", "private function _from_cookie_val($value) {\n\t\treturn(unserialize($value));\n\t\t//return json_decode($value, true);\n\t}", "public static function getObject($value)\n {\n switch ($value) {\n case \"event\":\n return self::$EVENT;\n case \"contactfilter\":\n return self::$CONTACTFILTER;\n case \"rss\":\n return self::$RSS;\n \n default:\n return null;\n }\n }", "public static function object_load($value) {\n return NULL;\n }", "protected function _deserializeResponse($value)\n {\n if ($value === null) {\n return;\n }\n list($className, $deserializeFunc) = $this->deserialize;\n $obj = new $className();\n $obj->mergeFromString($value);\n return $obj;\n }", "public static function get($value)\r\n {\r\n $className = get_called_class();\r\n return new $className($value . '');\r\n }", "private static function actualValue(array $info, $value)\n {\n /**\n * Shortcut. Objects can be assigned as is.\n */\n if (is_object($value)) {\n return $value;\n }\n\n $types = explode('|', $info['type']);\n\n foreach ($types as $type) {\n switch ($type) {\n case 'integer':\n case 'string':\n case 'double':\n case 'boolean':\n case 'any':\n return $value;\n case 'DateTime':\n return new \\DateTime($value, new \\DateTimeZone('UTC'));\n }\n }\n\n return new $info['type']($value);\n }" ]
[ "0.83656114", "0.7736967", "0.73438627", "0.69290733", "0.6651384", "0.6640474", "0.65986377", "0.6453522", "0.64351374", "0.6351796", "0.6351747", "0.6342252", "0.6253921", "0.62518317", "0.6224611", "0.6199845", "0.6194297", "0.61819756", "0.61751807", "0.6156396", "0.611049", "0.611049", "0.60799646", "0.6071074", "0.60671747", "0.605533", "0.60520965", "0.6006094", "0.6005801", "0.5992693" ]
0.81103086
1
This method converts the specified value to an ordinal.
public static function toOrdinal($value) : int { $type = gettype($value); switch ($type) { case 'boolean': throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to an ordinal.', array(':type' => $type)); case 'double': throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to an ordinal.', array(':type' => $type)); case 'integer': return $value; case 'NULL': throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to an ordinal.', array(':type' => $type)); case 'object': if (method_exists($value, 'toOrdinal')) { return $value->toOrdinal(); } else if ($value instanceof Common\StringRef) { return static::toOrdinal($value->__toString()); } else { throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to an ordinal.', array(':type' => get_class($value))); } case 'string': if (mb_strlen($value) != 1) { throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to an ordinal.', array(':type' => $type)); } return ord($value); default: throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to an ordinal.', array(':type' => $type)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function asOrdinal($value)\n {\n return $value;\n }", "public static function getOrdinalString($value)\n\t{\n\t\tstatic $ords = array('th', 'st', 'nd', 'rd');\n\t\tif ((($value %= 100) > 9 && $value < 20) || ($value %= 10) > 3) \t\t\n\t\t\t$value = 0;\t\t\n\t\treturn $ords[$value];\n\t}", "public function toOrdinal()\n {\n $cardinal = (int) $this->value;\n $digit = substr($cardinal, -1, 1);\n\n if ($cardinal < 100) {\n $tens = round($cardinal / 10);\n } else {\n $tens = substr($cardinal, -2, 1);\n }\n\n if ($tens == 1) {\n return new GACString(\"{$cardinal}th\");\n }\n\n switch ($digit) {\n case 1:\n return new GACString(\"{$cardinal}st\");\n case 2:\n return new GACString(\"{$cardinal}nd\");\n case 3:\n return new GACString(\"{$cardinal}rd\");\n default:\n return new GACString(\"{$cardinal}th\");\n }\n }", "function ordinal($number) {\r\n $ends = array('th','st','nd','rd','th','th','th','th','th','th');\r\n if ((($number % 100) >= 11) && (($number%100) <= 13))\r\n return $number. 'th';\r\n else\r\n return $number. $ends[$number % 10];\r\n }", "final public function ordinal()\n {\n return $this->ordinal;\n }", "function ordinal($number) {\n $ends = array('th','st','nd','rd','th','th','th','th','th','th');\n if ((($number % 100) >= 11) && (($number%100) <= 13))\n return $number. 'th';\n else\n return $number. $ends[$number % 10];\n}", "static public function ordinal($int)\n {\n $s = [\"th\",\"st\",\"nd\",\"rd\"];\n $v = $int%100;\n $keys = [($v-20)%10, $v, 0];\n foreach($keys as $k){\n if (array_key_exists($k, $s)) {\n return $v . $s[$k];\n }\n }\n\n return $v;\n }", "final public function getOrdinal()\n {\n if ($this->ordinal === null) {\n $ordinal = 0;\n $value = $this->value;\n $constants = self::$constants[static::class] ?? static::getConstants();\n foreach ($constants as $constValue) {\n if ($value === $constValue) {\n break;\n }\n ++$ordinal;\n }\n\n $this->ordinal = $ordinal;\n }\n\n return $this->ordinal;\n }", "public static function ordinal($number)\n {\n if (in_array($number % 100, range(11,13))) {\n return $number.'th';\n }\n\n switch ($number % 10) {\n case 1:\n return $number.'st';\n case 2:\n return $number.'nd';\n case 3:\n return $number.'rd';\n default:\n return $number.'th';\n }\n }", "function getOrdinalNumber( $number ) {\n$ends = array('th','st','nd','rd','th','th','th','th','th','th');\n\tif (($number %100) >= 11 && ($number%100) <= 13)\n\t $abbreviation = $number. 'th';\n\telse\n\t $abbreviation = $number. $ends[$number % 10];\n\n\treturn $abbreviation;\n}", "public static function ordinal(int $number): string {\n $r = $number % 100;\n if (11 <= $r && $r <= 13) return 'th';\n\n return match ($number % 10) {\n 1 => 'st',\n 2 => 'nd',\n 3 => 'rd',\n default => 'th'\n };\n }", "public function getOrdinalAsInteger(string $ordinal): int\n {\n switch ($ordinal) {\n case static::$first:\n return 1;\n case static::$second:\n return 2;\n case static::$third:\n return 3;\n case static::$fourth:\n return 4;\n case static::$fifth:\n return 5;\n case static::$last:\n return -1;\n default:\n throw new InvalidArgumentException(sprintf('Invalid enumerator provided: %s', $ordinal));\n }\n }", "public function getOrdinal($num){\n $num = abs($num);\n $lastChar = substr($num, -1, 1);\n \n if(isset($this->_locales[$this->_locale]['ordinals'])){\n $ordinals = $this->_locales[$this->_locale]['ordinals'];\n }\n \n foreach($ordinals as $k => $ordinal){\n if($num == $k){\n $suffix = $ordinal;\n break;\n }\n }\n \n if(!isset($suffix)){\n foreach($ordinals as $k => $ordinal){\n if($lastChar == $k){\n $suffix = $ordinal;\n break;\n }\n }\n }\n \n return (isset($suffix)) ? $num.$suffix : $num.$ordinals['default'];\n }", "function ordinal($a)\n{\n return $a.substr(date('jS', mktime(0,0,0,1,($a%10==0?9:($a%100>20?$a%10:$a%100)),2000)),-2);\n}", "public function getOrdinal($nth)\n {\n if ($nth < 0) {\n throw new InvalidArgumentException('$nth must be a positive number');\n }\n\n return $nth > 9 && $nth < 20 ? self::ORDINAL_TH : self::$ordinals[substr($nth, -1)];\n }", "public static function ordinalise(int $number): string {\n return $number . static::ordinal($number);\n }", "public static function ordinal($number, string $template = '%number<sup>%ordinal</sup>') : string\n {\n return Num::ordinal((float) $number, $template);\n }", "public function getOrdinal(): ?int\n {\n return $this->ordinal;\n }", "public static function addOrdinalNumberSuffix($num) \n {\n if (!in_array(($num % 100),array(11,12,13))){\n switch ($num % 10) {\n // Handle 1st, 2nd, 3rd\n case 1: return $num . 'st';\n case 2: return $num . 'nd';\n case 3: return $num . 'rd';\n }\n }\n return $num.'th';\n }", "function showOrdinal($num) {\n\t\t$the_num = (string) $num;\n\t\t// now we grab the last digit of the number\n\t\t$last_digit = substr($the_num, -1, 1);\n\t\t// if the string is more than 2 chars long, we get\n\t\t// the second to last character to evaluate\n\t\tif (strlen($the_num)>1) {\n\t\t\t$next_to_last = substr($the_num, -2, 1);\n\t\t} else {\n\t\t\t$next_to_last = \"\";\n\t\t}\n\t\t// now iterate through possibilities in a switch\n\t\tswitch($last_digit) {\n\t\t\tcase \"1\":\n\t\t\t\t// testing the second from last digit here\n\t\t\t\tswitch($next_to_last) {\n\t\t\t\t\tcase \"1\":\n\t\t\t\t\t\t$the_num.=\"th\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$the_num.=\"st\";\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"2\":\n\t\t\t\t// testing the second from last digit here\n\t\t\t\tswitch($next_to_last) {\n\t\t\t\t\tcase \"1\":\n\t\t\t\t\t\t$the_num.=\"th\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$the_num.=\"nd\";\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t// if last digit is a 3\n\t\t\tcase \"3\":\n\t\t\t\t// testing the second from last digit here\n\t\t\t\tswitch($next_to_last) {\n\t\t\t\t\tcase \"1\":\n\t\t\t\t\t\t$the_num.=\"th\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$the_num.=\"rd\";\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t// for all the other numbers we use \"th\"\n\t\t\tdefault:\n\t\t\t\t$the_num.=\"th\";\n\t\t}\n\t\n\t\t// finally, return our string with it's new suffix\n\t\treturn $the_num;\n\t}", "private static function ordinalFrom($name)\n {\n if (!is_string($name)) {\n\n throw new InvalidArgumentException(sprintf('Enum can only be identified by strings, %s given',\n gettype($name)));\n }\n\n $ordinals = array_keys(static::names(), $name, true);\n $ordinal = array_pop($ordinals);\n\n /*\n * List of ordinal values must to be empty after we removed the ordinal value from it. If not, there is more\n * than one enum associated with name $name and thus we throw an exception.\n */\n if (!empty($ordinals)) {\n\n throw new OutOfRangeException(sprintf('Enum type %s is not unique and thus can not be added', $name));\n }\n\n return $ordinal;\n }", "public function getIndexDayAttribute($value)\n {\n return (int)$value;\n }", "public function ordinalSuffix(): \\Closure\n {\n /**\n * @param int $number\n * @return string\n */\n return static function($number): string {\n $int = abs((int) $number);\n $suffixes = ['th', 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th'];\n if ((($int % 100) >= 11) && (($int % 100) <= 13)) {\n return 'th';\n }\n\n return $suffixes[$int % 10];\n };\n }", "public function setOrdinal(?int $ordinal): void\n {\n $this->ordinal = $ordinal;\n }", "final public static function ordinals()\n {\n return array_flip(static::names());\n }", "function ordinal_day($ord, $day, $month, $year)\r\n {\r\n\r\n $firstOfMonth = get_timestamp(\"$year-$month-01\");\r\n $lastOfMonth = $firstOfMonth + date(\"t\", $firstOfMonth) * 86400;\r\n $dayOccurs = 0;\r\n\r\n for ($i = $firstOfMonth; $i < $lastOfMonth ; $i += 86400){\r\n if (date(\"D\", $i) == $day){\r\n $dayOccurs++;\r\n if ($dayOccurs == $ord){\r\n $ordDay = $i;\r\n }\r\n }\r\n }\r\n return $ordDay;\r\n }", "public function getOrdinalString(string $ordinal): string\n {\n switch ($ordinal) {\n case '1':\n return static::$first;\n case '2':\n return static::$second;\n case '3':\n return static::$third;\n case '4':\n return static::$fourth;\n case '5':\n return static::$fifth;\n case '-1':\n return static::$last;\n default:\n throw new InvalidArgumentException(\n sprintf('Invalid ordinal string representation provided: %s', $ordinal)\n );\n }\n }", "public static function ToEnum($value){\n\t\tswitch (strtolower($value)) {\n\t\t\tcase 'song': return self::Song;\n\t\t \tcase 'reindex': return self::Reindex;\n\t\t \tcase 'source': return self::Source;\n\t\t \tcase 'edit': return self::Edit;\n\t\t \tcase 'login': return self::Login;\n\t\t \tcase 'logout': return self::Logout;\n\t\t \tcase 'ajaxnewsong': return self::AjaxNewSong;\n\t\t \tcase 'ajaxupdatesong': return self::AjaxUpdateSong;\n\t\t }\n\t\t return self::Songbook;\n\t}", "public static function add_ordinal_suffix( $number ) {\n if ( ! is_numeric( $number ) ) {\n return $number;\n }\n $ends = [ 'th', 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th' ];\n if ( ( ( $number % 100 ) >= 11 ) && ( ( $number % 100 ) <= 13 ) ) {\n return $number . 'th';\n }\n return $number . $ends[ $number % 10 ];\n }", "protected static function convertValueToSingleEnumValue(int $value)\n\t{\n\t\treturn $value;\n\t}" ]
[ "0.83248574", "0.74574995", "0.72854763", "0.6951372", "0.6872123", "0.67345816", "0.6667689", "0.66408974", "0.6464404", "0.6390042", "0.6364605", "0.6290418", "0.62113106", "0.6113895", "0.6105615", "0.60788476", "0.6047289", "0.60427874", "0.60228336", "0.5980318", "0.5869839", "0.5821278", "0.58212", "0.5766629", "0.55316484", "0.5530797", "0.547429", "0.5449927", "0.5436701", "0.5341016" ]
0.7953881
1
This method converts the specified value to a set.
public static function toSet($value) : Common\ISet { $type = gettype($value); switch ($type) { case 'array': return new Common\Mutable\HashSet($value); case 'object': if (method_exists($value, 'toArray')) { return new Common\Mutable\HashSet($value->toArray()); } if (method_exists($value, 'toList')) { return new Common\Mutable\HashSet($value->toList()); } if (method_exists($value, 'toDictionary')) { return new Common\Mutable\HashSet($value->toDictionary()); } if (method_exists($value, 'toMap')) { return new Common\Mutable\HashSet($value->toMap()); } return new Common\Mutable\HashSet(get_object_vars($value)); default: throw new Throwable\Parse\Exception('Invalid cast. Could not convert value of type ":type" to a set.', array(':type' => $type)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function makeSet($value)\n {\n $this->set[$value[\"ID\"]] = $value;\n $this->rank[$value[\"ID\"]] = 0;\n }", "function set($value = null): Set\n {\n return new Set($value);\n }", "function toSet($equalityComparer = null);", "public function getSet($key, $value) {\n $value = $this->serialize ( $value );\n $return = parent::getSet ( $key, $value );\n if (false === $return)\n return false;\n return $this->deserialize ( $return );\n }", "public function toSet($use = self::USE_VALUES)\n {\n return new Set(($use === self::USE_KEYS) ? array_keys($this->array) : array_values($this->array));\n }", "public function getSet($key, $value) {}", "public function set();", "public static function from_value( $value ) {\n\t\tif ( $value instanceof Events_Result_Set ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\tif ( is_array( $value ) ) {\n\t\t\treturn self::from_array( $value );\n\t\t}\n\n\t\tif ( self::is_serialized( $value ) ) {\n\t\t\treturn self::from_serialized( $value );\n\t\t}\n\n\t\treturn new Events_Result_Set( [] );\n\t}", "public function &getValueToSet();", "protected static function from_serialized( $value ) {\n\t\ttry {\n\t\t\t$set = unserialize( $value );\n\t\t\tif ( false === $set || ! $set instanceof static ) {\n\t\t\t\treturn new Events_Result_Set( [] );\n\t\t\t}\n\n\t\t\treturn $set;\n\t\t} catch ( \\Exception $e ) {\n\t\t\treturn new Events_Result_Set( [] );\n\t\t}\n\t}", "public function set(): Set\n {\n return new Set($this->_provider);\n }", "public function set($key, $value)\n {\n if ($key == 'sets') {\n throw new InstagramException('You are not allowed to write to the special \"sets\" key.', ErrorCode::INTERNAL_INVALID_ARGUMENT);\n }\n\n // Cast the value to a string to ensure we don't try writing objects.\n $value = (string) $value;\n\n // Remove all trailing newline characters and spaces.\n $value = rtrim($value, \"\\r\\n \");\n\n // Check if the value differs from our cached on-disk value.\n // NOTE: This optimizes disk writes by only writing when values change!\n if (!array_key_exists($key, $this->sets) || $this->sets[$key] !== $value) {\n // The value differs, so save to memory cache and write to disk.\n $this->sets[$key] = $value;\n $this->Save();\n }\n }", "public function set($value): self;", "public function set_existing( $value ): void {\n\t\t// If this input has a single value.\n\t\tif ( Utils::class_uses_trait( $this, Single_Value::class ) ) {\n\t\t\t$this->value( $value );\n\t\t}\n\t}", "public function test_set_many_values($value) {\n $this->assertEquals(1, $this->store->set_many(array(\n 'test' => $value,\n )));\n\n $this->assertEquals($value, $this->store->get('test'));\n }", "public function hMset($key, $value) {\n foreach ( $value as $k => $v ) {\n $value [$k] = $this->serialize ( $v );\n }\n return parent::hMset ( $key, $value );\n }", "public function createSetFromList(array $list): SetInterface;", "public function setValue($value)\n {\n // reset\n foreach ($this->elements as $element) {\n $element->setValue(null);\n }\n\n // ignore other data types\n if (is_array($value)) {\n $count = 1;\n foreach ($value as $entry) {\n $this->getInput($count)->setValue($entry);\n\n ++$count;\n\n // ignore additional entries\n if ($count >= $this->inputCount) {\n break;\n }\n }\n }\n\n return $this;\n }", "public function set($value)\n\t{\n\t\t$this->value = $value;\n\t\treturn $this->get();\n\t}", "public function getSet()\n {\n return $this->set;\n }", "public function &setValue(&$value){\n\t\tif(null === $value){\n\t\t$this->_value =& $this;\n\t\t}\n\t\telse $this->_value = $value;\n\t\t$this->_realValued = false;\n\t\t$this->_resStr = null;\n\t\treturn $this;\n\t}", "public function getSet()\n {\n return $this->tree->getSet();\n }", "protected function validateSet($id, $value): void\n {\n $this->validateName($id);\n\n $definition = $this->getDefinition($id);\n if (!is_object($value) || ($definition && !$definition->validate($value))) {\n throw new WrongTypeException(sprintf(\n 'Value for entry \"%s\" must be either a factory or an object%s.',\n $id, ($definition ? ' of class '.$definition->getType() : '')\n ));\n }\n }", "public function setSet($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Value::class);\n $this->set = $var;\n\n return $this;\n }", "function setAll($to_set){\n\t global $db;\n\n\t if(!is_array($to_set)){\n\t\traiseError(\"array is expected in setAll\");\n\t }\n\t $this->data = $to_set;\n\t if($this->data[$this->idKey]) {\n\t\t$this->id = $this->data[$this->idKey];\n\t }\n\t if(count($this->binaryFields) > 0 ) {\n\t\t// translate binary fields\n\t\treset($this->binaryFields);\n\t\twhile(list(,$bf) = each($this->binaryFields)) {\n\t\t $this->data[$bf] = $db->escape_bytea($this->data[$bf]);\n\t\t}\n\t }\n\t $this->changed = TRUE;\n\t return true;\n }", "public function set($value) {\n\t\tif ($value === null || ($this->null && empty($value))) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ($return = @json_decode($value, $this->array)) {\n\t\t\treturn $return;\n\t\t}\n\n\t\treturn $value;\n\t}", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);" ]
[ "0.67850506", "0.66015714", "0.65705276", "0.6262015", "0.6043022", "0.6012843", "0.59708446", "0.5965455", "0.5924712", "0.58708346", "0.57593805", "0.5747114", "0.56010437", "0.55202025", "0.5466042", "0.5435493", "0.54023856", "0.5398511", "0.53969723", "0.5356182", "0.5336309", "0.5313537", "0.5302885", "0.52721405", "0.5262446", "0.52545035", "0.52241254", "0.52241254", "0.52241254", "0.52241254" ]
0.82662034
0
Get SellerProductId value An additional test has been added (isset) before returning the property value as this property may have been unset before, due to the fact that this property is removable from the request (nillable=true+minOccurs=0)
public function getSellerProductId(): ?string { return isset($this->SellerProductId) ? $this->SellerProductId : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProductId()\n {\n if (array_key_exists(\"productId\", $this->_propDict)) {\n return $this->_propDict[\"productId\"];\n } else {\n return null;\n }\n }", "public function getProductId()\r\n {\r\n return $this->productId;\r\n }", "public function getProductId()\n {\n return $this->productId;\n }", "public function getProductId()\n {\n return $this->productId;\n }", "public function getProductId()\n {\n return $this->productId;\n }", "public function getProductId()\n {\n return $this->productId;\n }", "public function getProductId()\n {\n return $this->productId;\n }", "public function getProductId()\n {\n return $this->productId;\n }", "public function getProductId()\n {\n return $this->productId;\n }", "public function getProductId()\n\t{\n\t\treturn $this->_productId;\n\t}", "public function getProductId();", "public function getSellerId()\n {\n return $this->seller_id;\n }", "public function getProductId()\n {\n return $this->product_id;\n }", "public function setSellerProductId(?string $sellerProductId = null): self\n {\n // validation for constraint: string\n if (!is_null($sellerProductId) && !is_string($sellerProductId)) {\n throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($sellerProductId, true), gettype($sellerProductId)), __LINE__);\n }\n if (is_null($sellerProductId) || (is_array($sellerProductId) && empty($sellerProductId))) {\n unset($this->SellerProductId);\n } else {\n $this->SellerProductId = $sellerProductId;\n }\n \n return $this;\n }", "public function getProductId(): int {\n\t\treturn $this->ProductId;\n\t}", "public function getSeller_id()\n {\n return $this->seller_id;\n }", "public function getProductSellerName() {\n //return the value product seller name\n return $this->ProductSellerName;\n }", "public function getProductId()\n\t{\n\t\treturn $this->product_id;\n\t}", "public function getProductId()\n\t{\n\t\treturn $this->product_id;\n\t}", "public function getProductId(): int {\n\t\treturn ($this->productId);\n\t}", "public function getSellerId(): int {\n\t\treturn ($this->sellerId);\n\t}", "public function getUserSubscriptionProductId(): string\n {\n return $this->userSubscriptionProductId;\n }", "public function getProductId()\r\n {\r\n $product = $this->_coreRegistry->registry('product');\r\n return $product ? $product->getId() : null;\r\n }", "public function getSellerId();", "public function getSeller()\n {\n return $this->seller;\n }", "public function getProductId()\n {\n return $this->affirmPaymentHelper->getProduct()->getId();\n }", "public function _get__productId() {\n return $this->productId;\n }", "public function getProductId(){\n #use \"self\" when you want to access CONSTANTS\n #echo self::DEAFULT_product id;\n #use this (*current object) when you want to acces variables\n return $this->product_id;\n }", "public function getSellerPrice() {\n return $this->seller_price;\n }", "public function getSellerUserID()\n {\n return $this->sellerUserID;\n }" ]
[ "0.6672744", "0.64936155", "0.64100647", "0.64100647", "0.64100647", "0.64100647", "0.64100647", "0.64100647", "0.64100647", "0.6278726", "0.61478835", "0.61280733", "0.6091715", "0.60910773", "0.6071599", "0.6057834", "0.6048264", "0.595743", "0.595743", "0.59383106", "0.59216064", "0.58393633", "0.58303034", "0.58076334", "0.5772479", "0.5771665", "0.57705194", "0.57648987", "0.57593834", "0.57542163" ]
0.7346949
0
Set SellerProductId value This property is removable from request (nillable=true+minOccurs=0), therefore if the value assigned to this property is null, it is removed from this object
public function setSellerProductId(?string $sellerProductId = null): self { // validation for constraint: string if (!is_null($sellerProductId) && !is_string($sellerProductId)) { throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($sellerProductId, true), gettype($sellerProductId)), __LINE__); } if (is_null($sellerProductId) || (is_array($sellerProductId) && empty($sellerProductId))) { unset($this->SellerProductId); } else { $this->SellerProductId = $sellerProductId; } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setProductId($value){\n\t\t$this->productId = $value;\n\t}", "public function setProductId($val)\n {\n $this->_propDict[\"productId\"] = $val;\n return $this;\n }", "public function getSellerProductId(): ?string\n {\n return isset($this->SellerProductId) ? $this->SellerProductId : null;\n }", "public function setProductId($mageProductId)\n {\n if ($this->getProductId() != $mageProductId) {\n // reset magento product object too, make sure to set product id\n // through this method not using #setData()\n $this->unsetData('magento_product');\n }\n $this->setData('product_id', intval($mageProductId));\n return $this;\n }", "public function setProductId($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->product_id !== $v) {\n\t\t\t$this->product_id = $v;\n\t\t\t$this->modifiedColumns[] = ItemPeer::PRODUCT_ID;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setProductId($productId);", "public function setSellerId($seller_id);", "public function setProductId(?string $value): void {\n $this->getBackingStore()->set('productId', $value);\n }", "public function getProductId()\r\n {\r\n return $this->productId;\r\n }", "public function setProductId($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->product_id !== $v) {\n\t\t\t$this->product_id = $v;\n\t\t\t$this->modifiedColumns[] = SubmissionHistoryPeer::PRODUCT_ID;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function getProductId()\n\t{\n\t\treturn $this->_productId;\n\t}", "public function getProductId()\n {\n return $this->productId;\n }", "public function getProductId()\n {\n return $this->productId;\n }", "public function getProductId()\n {\n return $this->productId;\n }", "public function getProductId()\n {\n return $this->productId;\n }", "public function getProductId()\n {\n return $this->productId;\n }", "public function getProductId()\n {\n return $this->productId;\n }", "public function getProductId()\n {\n return $this->productId;\n }", "public function setProductID($productId) {\n $this->productId = $productId;\n }", "public function getSellerId()\n {\n return $this->seller_id;\n }", "public function getProductId()\n {\n return $this->product_id;\n }", "public function setSellerOrderId($sellerOrderId)\n {\n return $this->set('seller_order_id', $sellerOrderId);\n }", "public function getProductId()\n\t{\n\t\treturn $this->product_id;\n\t}", "public function getProductId()\n\t{\n\t\treturn $this->product_id;\n\t}", "public function setProductId($newProductId)\n {\n #check if it not empty\n if(strlen($newProductId) == 0){\n return \"The Product ID connot be empty!\";\n }\n else{\n \n $this->product_id = $newProductId;\n return\"\";\n \n }\n }", "public function setRelatedProductId($id)\n {\n return $this->setData(self::RELATED_PRODUCT_ID, $id);\n }", "public function getProductId()\n {\n if (array_key_exists(\"productId\", $this->_propDict)) {\n return $this->_propDict[\"productId\"];\n } else {\n return null;\n }\n }", "public function getProductId()\n {\n return $this->affirmPaymentHelper->getProduct()->getId();\n }", "public function getSeller_id()\n {\n return $this->seller_id;\n }", "public function getOfferSellerId()\n {\n return $this->offer_seller_id;\n }" ]
[ "0.6840266", "0.6405748", "0.62545836", "0.60640275", "0.60376877", "0.5953623", "0.5917567", "0.58303016", "0.5737742", "0.56576097", "0.5652007", "0.56269515", "0.56269515", "0.56269515", "0.56269515", "0.56269515", "0.56269515", "0.56269515", "0.5526452", "0.5394674", "0.53762007", "0.5375529", "0.5370217", "0.5370217", "0.5349709", "0.53387713", "0.5305665", "0.52667296", "0.52664256", "0.5257973" ]
0.7309475
0
Get TypeOfReturn value An additional test has been added (isset) before returning the property value as this property may have been unset before, due to the fact that this property is removable from the request (nillable=true+minOccurs=0)
public function getTypeOfReturn(): ?string { return isset($this->TypeOfReturn) ? $this->TypeOfReturn : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getReturnType(): Type\n {\n switch ($this->getMethodNamePrefix()) {\n case 'set':\n case 'uns':\n $returnType = new ObjectType($this->classReflection->getName());\n break;\n case 'has':\n $returnType = new BooleanType();\n break;\n default:\n $returnType = new MixedType();\n break;\n }\n\n return $returnType;\n }", "function get_value_type()\n {\n return $this->get_default_property(self :: PROPERTY_VALUE_TYPE);\n }", "public function getPropertyType() {\n return isset($this->container['PropertyType']) ? $this->container['PropertyType'] : null;\n\t}", "public function getType_value()\n {\n return $this->type_value;\n }", "public function getValueType();", "public function getValueType();", "public function getReturnValue(): ReflectionValue\n {\n return ReflectionValue::fromValueEntry($this->pointer->return_value);\n }", "public function getValue(): mixed;", "public function getValue(): mixed;", "function get_type()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_TYPE);\r\n }", "public function getValue(): mixed\n {\n return $this->isEmpty() && $this->nullable ? null : $this->value;\n }", "public function getValue()\n\t{\n\t\treturn (null !== $this->_value) ? $this->_value : false;\n\t}", "public function getValue() : int|float|string|bool|null\n {\n return $this->value;\n }", "public function get_type()\n {\n return $this->get_default_property(self::PROPERTY_TYPE);\n }", "public function get_type()\n {\n return $this->get_default_property(self::PROPERTY_TYPE);\n }", "function get_value()\n {\n return $this->get_default_property(self :: PROPERTY_VALUE);\n }", "public function getValue(): mixed\n {\n //Retrieve from cache for better performance\n if (null !== $this->value) {\n return $this->value;\n }\n\n //Determine if the value should be created with the glue or format value\n if (null !== $this->proxy->getGlue()) {\n $this->value = $this->getValueFromGlue();\n } else {\n $this->value = $this->getValueFromFormat();\n }\n\n if (null !== $this->defaultValue && true === $this->isEmpty($this->value)) {\n $this->value = $this->defaultValue->getValue();\n }\n\n return $this->value;\n }", "public function getReturnType()\n {\n return $this->return_type;\n }", "function get_value()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_VALUE);\r\n }", "public function testGetTypeWithoutValue()\n {\n $annotation = new Result(array());\n $this->assertNull($annotation->getType());\n }", "public function getTypeValue(): string;", "public function isReturningVal(): bool\n {\n return (bool) $this->isAReturningVal;\n }", "protected function getReturnType(){\n $type = false;\n if ($this->temporaryReturnRecordType == 'array') {\n $type = 'array';\n }\n return $type;\n }", "protected function returnType()\n {\n return ReturnDto::class;\n }", "public function publicMethodWithNullableMixedReturn()\n {\n return $this->publicNullableMixed;\n }", "public function getRequired(): ?bool {\n $val = $this->getBackingStore()->get('required');\n if (is_null($val) || is_bool($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'required'\");\n }", "public function getType() {\n\t\tif ($this->getData() === FALSE)\n\t\t\treturn FALSE;\n\t\treturn $this->type;\n\t}", "public function getTaxLiable(): ?bool {\n $val = $this->getBackingStore()->get('taxLiable');\n if (is_null($val) || is_bool($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'taxLiable'\");\n }", "public function getFinalValue(): mixed;", "public function get_value(): mixed {\n\t\treturn $this->value;\n\t}" ]
[ "0.6513616", "0.6245974", "0.6104362", "0.60838133", "0.60272765", "0.60272765", "0.59920716", "0.5913481", "0.5913481", "0.58246094", "0.5736923", "0.56538844", "0.5651531", "0.5643476", "0.5643476", "0.56382036", "0.5606574", "0.5579289", "0.5555808", "0.5531581", "0.5525229", "0.5501274", "0.5500903", "0.5490879", "0.5487023", "0.54825634", "0.5465266", "0.54502296", "0.54397804", "0.54352146" ]
0.628875
1
Set TypeOfReturn value This property is removable from request (nillable=true+minOccurs=0), therefore if the value assigned to this property is null, it is removed from this object
public function setTypeOfReturn(?string $typeOfReturn = null): self { // validation for constraint: enumeration if (!\SengentoBV\CdiscountMarketplaceSdk\Enums\CdiscountAskingForReturnType::valueIsValid($typeOfReturn)) { throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \SengentoBV\CdiscountMarketplaceSdk\Enums\CdiscountAskingForReturnType', is_array($typeOfReturn) ? implode(', ', $typeOfReturn) : var_export($typeOfReturn, true), implode(', ', \SengentoBV\CdiscountMarketplaceSdk\Enums\CdiscountAskingForReturnType::getValidValues())), __LINE__); } if (is_null($typeOfReturn) || (is_array($typeOfReturn) && empty($typeOfReturn))) { unset($this->TypeOfReturn); } else { $this->TypeOfReturn = $typeOfReturn; } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setReturnType($type);", "private function getReturnType(): Type\n {\n switch ($this->getMethodNamePrefix()) {\n case 'set':\n case 'uns':\n $returnType = new ObjectType($this->classReflection->getName());\n break;\n case 'has':\n $returnType = new BooleanType();\n break;\n default:\n $returnType = new MixedType();\n break;\n }\n\n return $returnType;\n }", "public function getTypeOfReturn(): ?string\n {\n return isset($this->TypeOfReturn) ? $this->TypeOfReturn : null;\n }", "public function setReturn($v);", "public function setReturnType($type){\n // typecheck\n if( !is_int($type) ){\n throw new Exception('The \"type\" argument must be an integer. \"'.gettype($type).'\" given.');\n }else if( ($type !== Vci_Dom_Table_Row::RETURN_DOM)\n && ($type !== Vci_Dom_Table_Row::RETURN_TEXT) ){\n throw new Exception('The \"type\" argument must match either Vci_Dom_Table_Row::RETURN_TEXT or Vci_Dom_Table_Row::RETURN_DOM. \"'.print_r($type, true).'\" given.');\n }\n\n // save the original value\n $returnType = $this->returnType;\n\n // set the return type\n $this->returnType = $type;\n\n // return the original return type\n return $returnType;\n }", "public function setReturnValue($value);", "public function setReturnType($var)\n {\n GPBUtil::checkString($var, True);\n $this->return_type = $var;\n\n return $this;\n }", "public function returnType(int $type) : void\n {\n $this->return_type = $type;\n }", "protected function returnType()\n {\n return ReturnDto::class;\n }", "public function setReturn(\\bunge\\StructType\\RespPlateAuth $return = null)\n {\n if (is_null($return) || (is_array($return) && empty($return))) {\n unset($this->return);\n } else {\n $this->return = $return;\n }\n return $this;\n }", "public static function delete_returns()\n {\n return new external_value(PARAM_RAW, 'JSON Response');\n }", "public function setReturned($returned) {\n\t\t$this->returned = $returned;\n\t}", "public function setReturnValue($value)\n\t{\n\t\t$this->value = $value;\n\t}", "function setReturnProperty($prop) {\n\t\t$this->returnProperty = $prop;\n\t}", "protected function & setReturn( $a_return )\r\n\t{\r\n\t\t$this->return = $a_return;\r\n\t\treturn $this;\r\n\t}", "function serialize_return() {\n\t\t$this->debug(\"Entering serialize_return\");\n\t\t// if we got nothing back. this might be ok (echoVoid)\n\t\tif(isset($this->methodreturn) && ($this->methodreturn != '' || is_bool($this->methodreturn))) {\n\t\t\t// if fault\n\t\t\tif(get_class($this->methodreturn) == 'soap_fault'){\n\t\t\t\t$this->debug('got a fault object from method');\n\t\t\t\t$this->fault = $this->methodreturn;\n\t\t\t\treturn;\n\t\t\t} elseif ($this->methodreturnisliteralxml) {\n\t\t\t\t$return_val = $this->methodreturn;\n\t\t\t// returned value(s)\n\t\t\t} else {\n\t\t\t\t$this->debug('got a(n) '.gettype($this->methodreturn).' from method');\n\t\t\t\t$this->debug('serializing return value');\n\t\t\t\tif($this->wsdl){\n\t\t\t\t\t// weak attempt at supporting multiple output params\n\t\t\t\t\tif(sizeof($this->opData['output']['parts']) > 1){\n\t\t\t\t \t$opParams = $this->methodreturn;\n\t\t\t\t } else {\n\t\t\t\t \t// TODO: is this really necessary?\n\t\t\t\t \t$opParams = array($this->methodreturn);\n\t\t\t\t }\n\t\t\t\t $return_val = $this->wsdl->serializeRPCParameters($this->methodname,'output',$opParams);\n\t\t\t\t\tif($errstr = $this->wsdl->getError()){\n\t\t\t\t\t\t$this->debug('got wsdl error: '.$errstr);\n\t\t\t\t\t\t$this->fault('Server', 'got wsdl error: '.$errstr);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t $return_val = $this->serialize_val($this->methodreturn, 'return');\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->debug('return val: '.$this->varDump($return_val));\n\t\t} else {\n\t\t\t$return_val = '';\n\t\t\t$this->debug('got no response from method');\n\t\t}\n\t\t$this->debug('serializing response');\n\t\tif ($this->wsdl) {\n\t\t\tif ($this->opData['style'] == 'rpc') {\n\t\t\t\t$payload = '<ns1:'.$this->methodname.'Response xmlns:ns1=\"'.$this->methodURI.'\">'.$return_val.'</ns1:'.$this->methodname.\"Response>\";\n\t\t\t} else {\n\t\t\t\t$payload = $return_val;\n\t\t\t}\n\t\t} else {\n\t\t\t$payload = '<ns1:'.$this->methodname.'Response xmlns:ns1=\"'.$this->methodURI.'\">'.$return_val.'</ns1:'.$this->methodname.\"Response>\";\n\t\t}\n\t\t$this->result = 'successful';\n\t\tif($this->wsdl){\n\t\t\t//if($this->debug_flag){\n \t$this->debug(\"WSDL debug data:\\n\".$this->wsdl->debug_str);\n //\t}\n\t\t\t// Added: In case we use a WSDL, return a serialized env. WITH the usedNamespaces.\n\t\t\t$this->responseSOAP = $this->serializeEnvelope($payload,$this->responseHeaders,$this->wsdl->usedNamespaces,$this->opData['style']);\n\t\t} else {\n\t\t\t$this->responseSOAP = $this->serializeEnvelope($payload,$this->responseHeaders);\n\t\t}\n\t\t$this->debug(\"Leaving serialize_return\");\n\t}", "public function returnType($type = null)\n {\n if (null === $type)\n {\n return $this->responseConfig['returnType'];\n }\n\n $this->responseConfig['returnType'] = $type;\n\n return $this;\n }", "public function setReturnNull($returnNull) {\r\n\t\t$this->returnNull = (boolean) $returnNull;\r\n\t}", "public function getReturnClass()\n {\n if ($this->_returnClassReference === null) {\n return null;\n }\n return $this->_returnClassReference->getType();\n }", "public function getReturnType()\n {\n return $this->return_type;\n }", "public static function recordType(FunctionInterface $function, UnionType $return_type): void\n {\n $fqsen = $function->getFQSEN();\n if (self::$method_blacklist->offsetExists($fqsen)) {\n return;\n }\n if ($return_type->isEmpty()) {\n self::$method_blacklist->attach($fqsen);\n self::$method_return_types->offsetUnset($fqsen);\n return;\n }\n if (self::$method_return_types->offsetExists($fqsen)) {\n self::$method_return_types->offsetGet($fqsen)->types->attach($return_type);\n } else {\n self::$method_return_types->offsetSet($fqsen, new ElementTypeInfo($function, [$return_type]));\n }\n }", "function setResReturn ($resReturn=true) {\t\t// default auf true gesetzt - Franz\r\n\t\t$this->resReturn = $resReturn;\r\n\t}", "public function getReturnValue(): ReflectionValue\n {\n return ReflectionValue::fromValueEntry($this->pointer->return_value);\n }", "public function getReturnType() : Type\n {\n return new UnknownType();\n }", "public function getReturnType()\n {\n return $this->returnType;\n }", "public function setReturnOrder( string $returnOrder )\n {\n $this->returnOrder = $returnOrder;\n\n return $this;\n }", "public function on_empty_return($return) : Database_model\n\t{\n\t\t$this->default_return_on_single\t= $return;\n\t\t$this->default_return_on_many\t= $return;\n\n\t\treturn $this;\n\t}", "public function __construct(\\Ovh\\StructType\\TelephonyPlugAndPhoneInfoReturn $return = null)\n {\n $this\n ->setReturn($return);\n }", "public function getReturnType()\n {\n if (!$this->annotations->exists(Returns::NAME)) {\n return null;\n }\n\n /** @var Returns $returnAnnotation */\n $returnAnnotation = $this->annotations->get(Returns::NAME);\n\n return $returnAnnotation->getReturn();\n }", "public function setReturnPolicy(\\Nogrod\\eBaySDK\\MerchantData\\ReturnPolicyType $returnPolicy)\n {\n $this->returnPolicy = $returnPolicy;\n return $this;\n }" ]
[ "0.63572305", "0.59290856", "0.5858962", "0.58329016", "0.57513297", "0.5565218", "0.55420935", "0.54854673", "0.5426381", "0.54211503", "0.5344738", "0.5295564", "0.5286477", "0.5247069", "0.5187846", "0.51535696", "0.51435256", "0.51124054", "0.5099067", "0.5063462", "0.5058773", "0.5004903", "0.49854487", "0.49530703", "0.4934508", "0.48513815", "0.4842751", "0.48007417", "0.47716203", "0.4748228" ]
0.7016126
0
Returns the socialite provider, in this case it's 'google'
protected function loginType(): string { return User::SOCIAL_GOOGLE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function redirectToProvidergoogle()\n {\n return Socialite::driver('google')->redirect();\n }", "public function google_redirectToProvider()\n {\n return Socialite::driver('google')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('google')->redirect();\n\n }", "public function redirectToProvider()\n {\n return Socialite::driver('google')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('google')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('google')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('google')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('google')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('google')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('google')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('google')->redirect();\n }", "public function getProvider() : string\n {\n return $this->provider;\n }", "protected function getProvider() {\n if (!isset($this->provider)) {\n $this->provider = $this->theme->getCdnProvider();\n }\n return $this->provider;\n }", "public function redirectToGoogleProvider()\n {\n return Socialite::driver('google')->redirect();\n }", "public function redirectToGoogleProvider() {\n return Socialite::driver('google')->redirect();\n }", "public function googleRedirectToProvider()\n {\n return Socialite::driver('google')->scopes(['https://www.googleapis.com/auth/plus.me', 'https://www.googleapis.com/auth/plus.stream.write'])->redirect();\n }", "public function handleProviderCallback() {\n $user = Socialite::driver('google')->stateless()->user();\n\n return $user->getName();\n }", "public function getProvider()\n {\n return (isset($this->data['provider'])) ? $this->data['provider'] : null;\n }", "public function getProviderUrl()\n {\n foreach (static::getProviders() as $providerBaseUrl => $providerAPI) {\n if (strpos($this->url, $providerBaseUrl) !== false) {\n return str_replace(\"%url%\", urlencode($this->url), $providerAPI);\n }\n }\n return null;\n }", "public function get_provider() {\n\t\treturn $this->_PROVIDER;\n\t}", "public function get_base_provider_name() {\n\t\treturn $this->_BASE_PROVIDER;\n\t}", "public function get_provider_slug() {\n\t\treturn $this->_PROVIDER_SLUG;\n\t}", "public function getProvider(){\n\t\treturn $this->provider;\n\t}", "public function getProvider()\n {\n return $this->provider;\n }", "public function getProvider()\n {\n return $this->provider;\n }", "public function getProvider()\n {\n return $this->provider;\n }", "public function getProvider()\n {\n return $this->provider;\n }", "public function getProvider()\n {\n return $this->provider;\n }", "public function getProvider()\n {\n return $this->provider;\n }", "public function getProvider()\n {\n return $this->provider;\n }" ]
[ "0.72451097", "0.71491593", "0.7136631", "0.7117906", "0.7117906", "0.7117906", "0.7117906", "0.7117906", "0.7117906", "0.7117906", "0.7117906", "0.70640415", "0.70253634", "0.6968884", "0.6920642", "0.69127655", "0.6902794", "0.6896311", "0.6834228", "0.6787046", "0.66796464", "0.6671185", "0.6668229", "0.6659944", "0.6659944", "0.6659944", "0.6659944", "0.6659944", "0.6659944", "0.6659944" ]
0.72678137
0
/ Getting HTML form
public function getHTML() { return $this->form['form']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getForm();", "public function getForm();", "public function getForm();", "public function getForm();", "public function getForm();", "function get_html(){\n\t\t// Adding id to the form\n\t\t$id = ' id=\"' . $this->id . '\"';\n\t\t\n\t\t// Adding method to the form\n\t\t$method = ' method=\"' . $this->method . '\"';\n\t\t\n\t\t$html = '<form' . $id . $method . ' action=\"' . $this->action . '\" name=' . $this->name . '>';\n\t\t\n\t\t$html = apply_filters( 'tk_form_start_' . $this->id, $html );\n\t\t\n\t\t// Adding elements to form\n\t\tforeach( $this->elements AS $element ){\n\t\t\t$tkdb = new TK_Display();\n\t\t\t$html.= $tkdb->get_html( $element );\n\t\t\tunset( $tkdb );\n\t\t}\n\t\t\n\t\t$html = apply_filters( 'tk_form_end_' . $id, $html );\n\t\t\t\t\n\t\t$html.='</form>';\n\t\t\n\t\treturn $html;\n\t}", "public function getHTML(){\n return $this->form->getHTML();\n }", "public function getHtml(): string\n\t{\n\t\tBasic::$template->formContainsFile = false;\n\t\tforeach ($this as $value)\n\t\t\tif ('file' == $value->inputType)\n\t\t\t\tBasic::$template->formContainsFile = true;\n\n\t\tBasic::$template->formAction = Basic::$action::getRoute();\n\t\tBasic::$template->hasBeenSubmitted = ('POST' == $_SERVER['REQUEST_METHOD']);\n\n\t\t$classParts = array_slice(explode('_', get_class(Basic::$action)), 2);\n\t\t$paths = [];\n\n\t\tdo\n\t\t\tarray_push($paths, 'Userinput'. (empty($classParts) ? '' : '/'. implode('/', $classParts)) .'/Form');\n\t\twhile (null !== array_pop($classParts));\n\n\t\tarray_push($paths, FRAMEWORK_PATH .'/templates/Userinput/Form');\n\n\t\treturn Basic::$template->showFirstFound($paths, Basic_Template::RETURN_STRING);\n\t}", "private function getValidFormHtml()\n {\n return '\n <!DOCTYPE HTML>\n <html>\n <head>\n <meta charset=\"utf-8\">\n <title>Title</title>\n </head>\n <body>\n\n <form action=\"some\">\n <p><input type=\"radio\" name=\"parameter1\" value=\"val1\">val1<Br>\n <input type=\"radio\" name=\"parameter2\" value=\"val2\">val2<Br>\n <input type=\"radio\" name=\"parameter3\" value=\"val3\">val3</p>\n <p><input type=\"submit\"></p>\n </form>\n\n </body>\n </html>\n ';\n }", "public function getForm()\n {\n return $this->beginForm() . $this->setText() . $this->setText() . $this->setSubmit() . $this->endForm();\n }", "public abstract function getForm();", "public function getSystemHtmlForms();", "private function _get()\n\t{\t\n\t\t$form = $this->_make_opentag().\"\\n\";\n\t\t$form.= $this->_elements_to_string();\n\t\t$form.= $this->_close.\"\\n\";\n\t\t\n\t\treturn $form;\n\t}", "public function getHtml()\n\t{\n\t\t$result = \"<form id='{$this->FormName}_modify' action='' method='{$this->FormType}' enctype='multipart/form-data'>\\n\";\n\n\t\t$result .= '<dl>';\n\t\tforeach( $this->fields as $fieldName => $fieldAttributes ) {\n\t\t\t$value = static::getParam( $fieldName, $this->record->$fieldName );\n\t\t\t$label = $fieldAttributes['label'];\n\n\t\t\t$fieldText = \"<dt><label for='$fieldName'>$label</label></dt>\";\n\t\t\tswitch( $fieldAttributes['type'] ) {\n\t\t\t\tdefault:\n\t\t\t\tcase 'textarea':\n\t\t\t\t\t$fieldText .= \"<dd><textarea id='$fieldName' name='$fieldName' rows='10' cols='40'>$value</textarea></dd>\\n\";\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'text':\n\t\t\t\t\t$fieldText .= \"<dd><input id='$fieldName' type='text' name='$fieldName' value='$value' /></dd>\\n\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'image':\n\t\t\t\t\t$fieldText .= \"<dd><input id='$fieldName' type='file' name='$fieldName' value='$value' />\";\n\t\t\t\t\t$fieldText .= \"<p><img src='$value' alt='$label' height='50px' /></p>\";\n\t\t\t\t\t$fieldText .= \"</dd>\\n\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'password':\n\t\t\t\t\t$fieldText .= \"<dd><input id='$fieldName' type='password' name='$fieldName' value='$value' /></dd>\\n\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'select':\n\t\t\t\t\t$list = new SelectFormElement( $fieldName, $fieldAttributes['recordType'], $fieldAttributes['displayField'], $value );\n\t\t\t\t\t$fieldText .= \"<dd>\\n\" . $list->getHtml( ) . \"</dd>\\n\";\n\t\t\t\t\tbreak;\t\t\t\n\n\t\t\t\tcase 'radio':\n\t\t\t\t\t$fieldText .= \"<dd><fieldset id='$fieldName'>\\n\";\n\t\t\t\t\t$fieldText .= \"<legend>$label</legend>\\n\";\n\n\t\t\t\t\t$list = new RadioFormElement( $fieldName, $fieldAttributes['recordType'], $fieldAttributes['displayField'], $value );\n\t\t\t\t\t$fieldText .= $list->getHtml( );\n\n\t\t\t\t\t$fieldText .= \"</fieldset><dd>\\n\";\n\t\t\t\t\tbreak;\t\t\t\n\t\t\t}\n\t\t\t$result .= $fieldText;\t\t\t\t\t\n\t\t}\n\t\t$result .= \"</dl>\\n\";\n\n\t\t$result .= \"<div>\";\n\n\t\t$result .= \"<input type='hidden' name='{$this->paramIDName}' value='{$this->record->getID()}' />\\n\";\n\t\t$action = $this->record->isRecord()?'update':'add';\n\t\t$result .= \"<input type='hidden' name='__action' value='{$action}' />\\n\";\n\t\t// show positive messages\n\t\tif( $this->messages ) {\n\t\t\tforeach( $this->messages as $message ) {\n\t\t\t\t$result .= '<p class=\"message\">' . $message . '</p>';\n\t\t\t}\n\t\t}\t\t\n\t\t// show positive messages\n\t\tif( $this->errors ) {\n\t\t\tforeach( $this->errors as $message ) {\n\t\t\t\t$result .= '<p class=\"error\">' . $message . '</p>';\n\t\t\t}\n\t\t}\t\t\n\t\t$buttonName = $this->getID( )==0 ? 'Speichern' : 'Speichern';\n\t\t$result .= \"<input type='submit' value='$buttonName' />\\n\";\n\n\t\t$result .= \"</div>\";\n\t\t$result .= \"</form>\";\n\t\t\t\t\n\t\t$result .= \"\n\t\t\t<form style='float:left' id='{$this->FormName}_new' action='{$_SERVER['SCRIPT_NAME']}' method='{$this->FormType}'>\n\t\t\t<div>\n\t\t\t\t<input type='submit' value='Leeren' />\n\t\t\t</div> \n\t\t\t</form>\n\t\t\t\";\n\t\t\n\t\treturn $result;\n\t}", "private function startFormTag(): string\n {\n $html = \"<form name='{$this->id}' method='{$this->method}' action='\"\n . $this->url->makeUrl($this->actionPage) . \"' \";\n\n $html .= $this->getGlobalAttributes();\n\n if ($this->autocomplete) {\n $html .= 'autocomplete=\"on\" ';\n } else {\n $html .= 'autocomplete=\"off\" ';\n }\n\n if ($this->openInNewPage) {\n $html .= 'target=\"_blank\" ';\n }\n if ($this->enctype != '') {\n $html .= \"enctype='{$this->enctype}' \";\n }\n\n $html .= $this->getGlobalEventAttributesHtml();\n\n $html .= '>';\n\n return $html;\n }", "protected function _displayForm() {\n $html = '';\n $html .= $this->_getFormHtml($_SERVER['REQUEST_URI'], 'post', $this->_initFormFields());\n return $html;\n }", "function getSubscriptionFormHTMLCode()\r\n\t\t{\r\n\t\t\t/* Setup POST parameters - Begin */\r\n\t\t\t$ArrayPostParameters = array();\r\n\t\t\t$ArrayPostParameters[] = \"Command=ListIntegration.GenerateSubscriptionFormHTMLCode\";\r\n\t\t\t$ArrayPostParameters[] = \"ResponseFormat=JSON\";\r\n\t\t\t$ArrayPostParameters[] = \"SessionID=\".$_POST['SessionID'];\r\n\t\t\t$ArrayPostParameters[] = \"SubscriberListID=\".$_POST['SubscriberListID'];\r\n\t\t\t$ArrayPostParameters[] = \"CustomFields=\".$_POST['CustomFields'];\r\n\t\t\t/* Setup POST parameters - End */\r\n\t\t\t\r\n\t\t\t$response = $this->_postToRemoteURL($_POST['ar1_url'].\"/api.php?\", $ArrayPostParameters);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\techo $response[1];\r\n\t\t\texit;\r\n\t\t}", "public function getHtml()\n\t{\n\t\treturn $this->buildInput();\n\t}", "public function ContentForm()\n {\n return new HtmlCodeForm();\n }", "public function getFormHTML()\n {\n return view('structure.view_generate', [\n 'form_guid' => $this->form_guid,\n 'list_id' => $this->list_id\n ])->render();\n }", "public function getHtml()\n {\n $input = form_input('email', $this);\n return $input;\n }", "public function get_form() {\n\n\t\t$plugin = $this;\n\t\t$template = pkppgInit()->get_template_path( 'plugin-form.php' );\n\t\tif ( !empty( $template ) ) {\n\t\t\tob_start();\n\t\t\tinclude( $template );\n\t\t\treturn ob_get_clean();\n\t\t}\n\n\t\treturn '';\n\t}", "public function getHtmlInput()\n\t{\n\t\treturn $this->getInput();\n\t}", "public function html()\n {\n $this->load_field_classes();\n\n if (isset($_GET['mrka_val'])) {\n $this->filter_raw_input_data($_GET['mrka_val']);\n }\n\n $fields = '';\n\n foreach ($this->mapped_fields as $mapped_field) {\n // Load the taxonomy data when available.\n if (isset($mapped_field['taxonomy_id'])) {\n $mapped_field['class']->load_data_from_taxonomy($mapped_field['taxonomy_id']);\n }\n\n // Load data from an array\n if (isset($mapped_field['filter_data'])) {\n $mapped_field['class']->load_data_from_array($mapped_field['filter_data']);\n }\n\n if (isset($this->input_data[$mapped_field['field_name']])) {\n $mapped_field['class']->set_input_data($this->input_data[$mapped_field['field_name']]);\n }\n\n $fields .= $mapped_field['class']->generate_html();\n }\n\n $parameters = [\n 'form_id' => $this->config['form_id'],\n 'site_url' => $this->WP_wrapper->get_site_url().'/wp-admin/admin-ajax.php',\n 'fields' => $fields,\n ];\n\n return $this->stub->parse_stub('form', $parameters);\n }", "public function openForm()\n\t{\n\t\t// Create resource form route\n\t\t$method = $this->item ? 'put' : 'post';\n\n\t\t// Generate the tag\n\t\t$html = Form::open(array('class' => 'form-vertical entry-form', 'url' => $this->url, 'method' => $method));\n\n\t\treturn $html;\n\t}", "public function get_optin_form_structure();", "function form() { return $this->get('form'); }", "public function getHtml(){\n\t\t# Check for PayPal ID or an email address associated with PayPal account\n\t\tif(!$this->get('business')){\n\t\t\techo 'Need to set PayPal ID to the variable \"business\".<br>';\n\t\t}\n\t\t# Prepare for form opening\n\t\tif($this->sandbox == true) $url = PAYPAL_SANDBOX_SUBMIT_URL;\n\t\telse $url = PAYPAL_SUBMIT_URL;\n\t\t\n\t\t$this->html .= \"<form name=\\\"{$this->name}\\\" action=\\\"{$url}\\\" method=\\\"post\\\"\";\n\t\tif($this->openInNewWindow) $this->html .= \" target=\\\"_blank\\\"\";\n\t\t$this->html .= \">\\n\";\n\t\t\t\t\n\t\tforeach( $this->variables as $key => $value ){\n\t\t\tif( $value !== \"\" ){\n\t\t\t\t$id = 'pp-'.str_replace('_', '-', $key);\n\t\t\t\t$this->html .= \"<input type=\\\"hidden\\\" id=\\\"$id\\\" name=\\\"{$key}\\\" value=\\\"{$value}\\\" />\\n\";\n\t\t\t}\n\t\t}\n\t\t$this->html .= $this->getCartItemsHtml();\n\t\treturn $this->html;\n\t}", "protected function fetchAdminFormElement() {\n $hp = Codendi_HTMLPurifier::instance();\n $html = '';\n $value = '';\n if ($this->hasDefaultValue()) {\n $value = $this->getDefaultValue();\n }\n $html .= '<input type=\"text\"\n value=\"'. $hp->purify($value, CODENDI_PURIFIER_CONVERT_HTML) .'\" autocomplete=\"off\" />';\n $html .= '<br />';\n $html .= '<a href=\"#\">bug #123</a><br />';\n $html .= '<a href=\"#\">bug #321</a><br />';\n $html .= '<a href=\"#\">story #10234</a>';\n return $html;\n }", "function getForm()\n {\n return $this->getAttribute(\"form\");\n }" ]
[ "0.7547471", "0.7547471", "0.7547471", "0.7547471", "0.7547471", "0.73759305", "0.73082066", "0.70435363", "0.7029069", "0.7026437", "0.6976665", "0.6952702", "0.68953097", "0.6819733", "0.68140984", "0.67979056", "0.6755843", "0.6747011", "0.67423975", "0.6709802", "0.66832703", "0.66624457", "0.6601858", "0.6578681", "0.6573601", "0.6570178", "0.6512612", "0.6483452", "0.64565384", "0.64479357" ]
0.775685
0
/ Getting form rules
public function getRules() { return $this->form['rules']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getValidationRules();", "public function rules()\n {\n $form = $this->get('form');\n\n\n if ($form == 'page') {\n $rules['page.email'] = \"required|email\";\n $rules['page.password'] = 'required';\n\n } elseif ($form == 'sidbar') {\n $rules['user.email'] = \"required|email\";\n $rules['user.password'] = 'required';\n }\n\n\n\n\n\n return $rules;\n }", "public function getFieldValidationRules();", "abstract public function getFilterValidationRules();", "public function getFilterValidationRules();", "abstract public function getValidationRules(): array;", "public function getRules() {\n return array(\n 'titulo' => array(\n array( 'maxlength',200, 'El titulo no puede contener mas de 200 caracteres' ),\n array( 'notempty', 'El titulo no puede estar vacio' ),\n array( 'notnull' ),\n ),\n\n 'detalles' => array(\n array( 'notempty', 'Detalles no puede estar vacio' ),\n array( 'notnull' ),\n ),\n\n 'fecha_inicio' => array(\n array( 'notempty', 'La fecha de inicio no puede estar vacio' ),\n array( 'notnull'),\n ),\n\n\n 'fecha_termino' => array(\n array( 'fecha_termino'),\n array( 'optional' ),\n ),\n );\n }", "private function getRules()\n {\n return array(\n 'department' => 'required|regex:/^[\\w -=@]+$/',\n 'class' => 'required|regex:/^[\\w -=@]+$/',\n 'code' => 'required|regex:/^[\\w -=@]+$/',\n 'year level' => 'required|numeric|min:3|max:12',\n 'number of students' => 'required|numeric',\n 'teacher' => 'required',\n 'role' => 'required|regex:/^[a-z\\d\\-_\\s]+$/i|in:Teacher,Department Head,Department head',\n 'email' => 'required|email'\n );\n }", "public static function getRules()\n {\n return [\n 'select_file' => 'sometimes|required|image|mimes:jpg,jpeg,png,gif|max:2048',\n 'name' => 'required|min:5|max:50',\n 'description' => 'required|min:5|max:500',\n 'price' => 'required|numeric|max:10000',\n ];\n }", "public function getRules()\n\t{\n\t\treturn [\n\t\t\t'plan_id' \t=> ['required', 'string'],\n\t\t\t'app_id' \t=> ['required', 'in:' . implode(',', SELF::APP_ID)],\n\t\t\t'max_tenant' \t=> ['required', 'number'],\n\t\t\t'max_user' \t\t=> ['required', 'number'],\n\t\t];\n\t}", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'description' => 'required'\n ];\n\n if ($this->request->has('hrefs')) {\n foreach ($this->request->get('hrefs') as $key => $val) {\n $rules['hrefs.' . $key] = 'required|url';\n $rules['titles.' . $key] = 'required';\n }\n }\n\n if ($this->request->has('titles')) {\n foreach ($this->request->get('titles') as $key => $val) {\n $rules['titles.' . $key] = 'required';\n $rules['hrefs.' . $key] = 'required|url';\n }\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = $this->rules;\n if(!Request::isMethod('post')){\n\n }\n return $rules;\n }", "public function rules()\n {\n $rules = [];\n\n foreach ($this->request->get('firstName') as $key => $val) {\n $rules['firstName.' . $key] = 'required|min:2';\n $rules['lastName.' . $key] = 'required|min:2';\n $rules['email.0'] = 'required|email';\n $rules['phone_number.0'] = 'required|min:10';\n\n }\n $rules['g-recaptcha-response'] = 'recaptcha';\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'title' => ['required', new SpamFree],\n 'body' => ['required', new SpamFree],\n ];\n\n if ($this->method() === 'POST') {\n $rules['channel_id'] = ['required', 'exists:channels,id'];\n $rules['g-recaptcha-response'] = ['required', $this->recaptcha];\n }\n\n return $rules;\n }", "public function validationRules(): array;", "public static function getRules()\n {\n $rules = [\n 'relason' => 'required',\n 'lift_date' => 'required'\n ];\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'url' => 'required|string',\n 'frame_id' => 'required|check_frame',\n 'dynamic_id' => 'required|check_dynamic',\n 'category_id' => 'check_category',\n 'author_id' => 'check_author',\n 'crawl_resources' => 'mixed'\n \n ];\n return $rules;\n // return $this->parseRules($rules);\n }", "function forms_get_validation_rules(): array {\n\t$rules = elgg_get_plugin_setting('validation_rules', 'forms');\n\treturn empty($rules) ? [] : json_decode($rules, true);\n}", "public function rules()\n {\n if(Request::isMethod('post')){\n $rules = $this->rules;\n }\n return $rules;\n }", "public function rules()\n {\n $main_rules [\n 'username' => 'required|min:3', \n 'name' => 'required|min:3',\n ];\n if ($this->isMethod('post')) {\n return $main_rules + [\n 'password' => 'required|min:6',\n 'repassword' => 'same:password|min:6'\n ];\n }\n return $main_rules;\n }", "public function rules()\n {\n $rules = $this->rules;\n\n $rules['title'] = 'required|max:80';\n $rules['gender'] = 'required';\n $rules['region'] = 'required|different:reg';\n $rules['reward'] = 'required|max:50';\n $rules['content'] = 'required|max:255';\n\n return $rules;\n }", "public function getRules() {\n\n $kode_kelas = array(\n 'field' => 'kode_kelas-input', 'label' => 'Kode kelas',\n 'rules' => 'trim|required|max_length[20]'\n );\n\n $nama_kelas = array(\n 'field' => 'nama_kelas-input', 'label' => 'Nama kelas',\n 'rules' => 'trim|required|max_length[200]'\n );\n\n return array($kode_kelas, $nama_kelas);\n }", "public function getRules(): array\n\t{\n\t\treturn [\n\t\t\t'rules' => [\n\t\t\t\t'model-form',\n\t\t\t],\n\t\t\t'controllers' => [\n\t\t\t\t'ModelForm',\n\t\t\t],\n\t\t];\n\t}", "public function rules()\n {\n return [\n 'form_name' => 'required',\n 'method' => 'required',\n 'action' => 'required',\n 'fields.*.type' => 'required',\n 'fields.*.name' => 'required',\n 'fields.*.options.*.title' => 'sometimes|required',\n 'fields.*.options.*.value' => 'sometimes|required',\n ];\n }", "public function rules()\n {\n $rules = [\n 'title' => 'required',\n 'content' => 'required',\n ];\n\n $isJsonApi = $this->isJsonApiRequest();\n\n if (config('app.comment_google_recaptcha') && ! $isJsonApi) {\n $rules['g-recaptcha-response'] = 'required|recaptcha';\n }\n\n return $rules;\n }", "public function getValidationRules()\n {\n return [\n 'name' => 'required',\n 'type' => 'required',\n ];\n }", "public function rules()\n {\n return validation_value('pet_form');\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function getRules();", "public function getRules();" ]
[ "0.7989122", "0.78235626", "0.7791647", "0.7470457", "0.7422505", "0.73882455", "0.7347386", "0.7341255", "0.7336505", "0.73244274", "0.7301457", "0.72926277", "0.72874445", "0.72651875", "0.725508", "0.72547656", "0.724734", "0.7242026", "0.7237099", "0.72246885", "0.720778", "0.71837217", "0.7177894", "0.71704125", "0.71609277", "0.71556824", "0.71493006", "0.7137046", "0.7125572", "0.7125572" ]
0.8134515
0
/ Getting form files
public function getFiles() { return $this->form['files']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function submitted_form_files() {\n\t\t$files = array();\n\n\t\t// Checks the form method\n\t\tif ( 0 < count( $_FILES ) ) {\n\t\t\t$files = $_FILES;\n\t\t}\n\n\t\treturn $files;\n\t}", "public function files(){\n return $_FILES;\n }", "public function getForm();", "public function getForm();", "public function getForm();", "public function getForm();", "public function getForm();", "public function getFile() {\n \n $files = array();\n \n if(isset($_FILES)) {\n $files = $_FILES;\n }//end if\n \n return $files;\n \n }", "public function action_index()\n\t{\n\t\t$type = 'file';\n\n\t\t$settings = array\n\t\t(\n\t\t\t'_label' => 'File 1',\n\t\t\t'_namespace' => 'mmi',\n\t\t\t'accept' => 'application/pdf',\n\t\t\t'class' => 'file',\n\t\t\t'id' => 'file1',\n\t\t\t'required' => 'required',\n\t\t);\n\t\t$field = MMI_Form_Field::factory($type, $settings);\n\t\t$this->_form->add_field($field);\n\t\tif ($this->debug)\n\t\t{\n\t\t\tMMI_Debug::dump($field->render(), $type);\n\t\t}\n\n\t\t$settings = array_merge($settings, array\n\t\t(\n\t\t\t'_label' => 'File 2',\n\t\t\t'accept' => 'pdf',\n\t\t\t'id' => 'file2',\n\t\t\t'required' => '',\n\t\t));\n\t\t$field = MMI_Form_Field::factory($type, $settings);\n\t\t$this->_form->add_field($field);\n\t\tif ($this->debug)\n\t\t{\n\t\t\tMMI_Debug::dump($field->render(), $type);\n\t\t}\n\t}", "function MyMod_Handle_Files_Form()\n {\n $path=$this->GetPOST(\"Path\");\n if (empty($path)) { $path=\"Uploads\"; }\n\n $path=$this->MyMod_Data_Upload_Path();\n\n $buttons=$this->MakeButtons\n (\n array\n (\n array\n (\n \"Type\" => \"submit\",\n \"Title\" => \"Pesquisar\",\n ),\n array\n (\n \"Type\" => \"submit\",\n \"Title\" => \"DELETAR\",\n ),\n )\n );\n \n echo\n $this->StartForm().\n $this->H(1,\"Files in Path: \".$path).\n $buttons.\n $this->Html_Table\n (\n \"\",\n $this->PadTable\n (\n $this->MyMod_Handle_Files_Table($path)\n ),\n array(),\n array(),\n array(),\n TRUE,TRUE\n ).\n $buttons.\n $this->MakeHidden(\"GO\",1).\n $this->EndForm().\n \"\";\n \n return 1;\n }", "public function getForms();", "public function & getFiles() {\n\t\treturn $_FILES;\n\t}", "public abstract function getForm();", "protected function _populate_form() \n\t{\n\t\tif ($this->method() == 'get' AND (bool) count($this->get_files(FALSE)) === TRUE)\n\t\t{\n\t\t\tthrow new Bform_Exception('You cannot send files in GET method!');\n\t\t}\n\n\t\t$data = Arr::merge($this->submitted_data(), $_FILES);\n\t\t\n\t\t$this->set_values($data, $this);\n\t}", "function acf_file_input( $attrs = array() ) {\n\techo acf_get_file_input( $attrs );\n}", "function i_html_field_file(&$params){\n \n // http://www.mysite.com/upload.php\n \n // = '<form action=\"' . $action . '\" method=\"post\" enctype=\"multipart/form-data\">\n $id = ( isset($params['id']) ) ? ' id=\"' . $params['id'] . '\"' : '';\n $name = ( isset($params['name']) ) ? ' name=\"' . $params['name'] . '\"' : '';\n $multi = ( isset($params['multiple']) && $params['multiple'] ) ? ' multiple=\"multiple\"' : '';\n $class = ( isset($params['class']) ) ? ' class=\"' . $params['class'] . '\"' : '';\n $style = empty($params['style']) ? '' : ' style=\"' . $params['style'] . '\"';\n \n $buf = '<input type=\"file\"' . $id . $name . $multi . $class . $style . '>';\n \n if( isset($params['obj_js_file']) && $params['obj_js_file'] ) $buf .= '<div id=\"res\"></div>';\n \n return $buf;\n\n}", "private function InputForm()\n\t{\tob_start();\n\t\t$form = new Form($_SERVER['SCRIPT_NAME']);\n\t\t$form->AddHiddenInput('files_saved', '1');\n\t\tforeach ($this->flagfiles as $ffid=>$flagfile)\n\t\t{\t$form->AddCheckBox($this->InputSafeString($flagfile['ffdesc']), 'flagfiles[' . $ffid . ']', 1, $this->FlagFileSet($flagfile['ffname']));\n\t\t}\n\t\t$form->AddSubmitButton('&nbsp;', 'Save Changes', 'submit');\n\t\t$form->Output();\n\t\treturn ob_get_clean();\n\t}", "function file($attributes = array()){\r\n $col = \"6\"; //default col\r\n $label=\"\";\r\n extract($attributes);\r\n $html = $this->divbegin($col) . $this->label($field,$label);\r\n $html .='<input type=\"file\" name=\"'.$field.'\"/>';\r\n $html .= $this->inputend($field);\r\n return $html;\r\n }", "public function testFormFile()\n\t{\n\t\t$form1 = Form::input('file', 'foo');\n\t\t$form2 = Form::file('foo');\n\t\t$form3 = Form::file('foo', array('class' => 'span2'));\n\n\t\t$this->assertEquals('<input type=\"file\" name=\"foo\" id=\"foo\">', $form1);\n\t\t$this->assertEquals($form1, $form2);\n\t\t$this->assertEquals('<input class=\"span2\" type=\"file\" name=\"foo\" id=\"foo\">', $form3);\n\t}", "function form_file($title, $name, $size, $description = NULL, $required = FALSE) {\n return theme('form_element', $title, '<input type=\"file\" class=\"'. _form_get_class('form-file', $required, _form_get_error($name)) .'\" name=\"edit['. $name .']\" id=\"edit-'. form_clean_id($name) .'\" size=\"'. $size .\"\\\" />\\n\", $description, 'edit-'. $name, $required, _form_get_error($name));\n}", "public function testOpeningFormForFile()\n\t{\n\t\t$form1 = Form::open_for_files('foobar', 'GET');\n\t\t$form2 = Form::open_for_files('foobar', 'POST');\n\t\t$form3 = Form::open_for_files('foobar', 'PUT', array('accept-charset' => 'UTF-16', 'class' => 'form'));\n\t\t$form4 = Form::open_for_files('foobar', 'DELETE', array('class' => 'form'));\n\n\t\t$this->assertEquals('<form enctype=\"multipart/form-data\" method=\"GET\" action=\"http://localhost/index.php/foobar\" accept-charset=\"UTF-8\">', $form1);\n\t\t$this->assertEquals('<form enctype=\"multipart/form-data\" method=\"POST\" action=\"http://localhost/index.php/foobar\" accept-charset=\"UTF-8\">', $form2);\n\t\t$this->assertEquals('<form accept-charset=\"UTF-16\" class=\"form\" enctype=\"multipart/form-data\" method=\"POST\" action=\"http://localhost/index.php/foobar\"><input type=\"hidden\" name=\"_method\" value=\"PUT\">', $form3);\n\t\t$this->assertEquals('<form class=\"form\" enctype=\"multipart/form-data\" method=\"POST\" action=\"http://localhost/index.php/foobar\" accept-charset=\"UTF-8\"><input type=\"hidden\" name=\"_method\" value=\"DELETE\">', $form4);\n\t}", "public function getFileInfo()\n\t\t{\n\t\t\tif( isset( $_FILES[$this->getHTMLControlId()] ))\n\t\t\t{\n\t\t\t\treturn $_FILES[$this->getHTMLControlId()];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new \\System\\Base\\InvalidOperationException(\"FileBrowser::getFileInfo() called on null file\");\n\t\t\t}\n\t\t}", "public function action_form_attachment(){\n\n $param = \\Input::param();\n if(isset($param['p'])){\n parse_str(base64_decode($param['p']), $param);\n }\n if(isset($param['attachment_id']) && !empty($param['attachment_id'])){\n $attachment_id = $param['attachment_id'];\n $filepath = $filename = $storage_path = null;\n switch ($param['attachment_type']) {\n case 'form_attachment':\n $files = \\Model_TFormAttachment::find($attachment_id);\n $filepath = $files->filepath;\n $filename = $files->filename;\n\n switch ($files->petition_type) {\n case 1:\n $storage_path = FTPPROPOSALPATH;\n break;\n case 2:\n $storage_path = FTPPAYMENTPATH;\n break;\n }\n break;\n case 'form_input':\n $files = \\Model_TProposalInput::find($attachment_id); \n if(!empty($files->value)){\n $files = json_decode($files->value);\n $filepath = $files->filepath;\n $filename = $files->filename;\n $storage_path = FTPPROPOSALPATH;\n }\n break;\n \n }\n\n if($filepath && $filename){\n $direct_view = isset($param['direct_view'])?$param['direct_view']:false; \n //get link connect to ftp\n $ftp_config = \\Config::load('ftp');\n $ftp = array_shift($ftp_config);\n $link = 'ftp://'.$ftp['username'].':'.$ftp['password'].'@'.$ftp['hostname'].'/';\n \n //================== Init Class Download ===============\n $args = [\n 'download_path' => $link.$storage_path,\n 'file' => $filepath, \n 'origin_file_name' => $filename, \n 'direct_view' => $direct_view,\n ];\n \n $download = new \\Vision_Download($args);\n $download_hook = $download->get_download_hook();\n \n $download->get_download();\n if( $download_hook['download'] == TRUE ) {\n\n }else{\n // \\Response::redirect('system/default/response');\n }\n }\n }\n exit;\n }", "public function getUploadedFile();", "private function getFileTypeField(){\n\t\t$this->setInsertForm();\n\t\t$final_fields = $this->form_input_list;\n\t\t$file_field = [];\n\t\tforeach ($final_fields as $key => $value) {\n\t\t\tif($value['field_type'] == 'file'){\n\t\t\t\t$file_field[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $file_field;\n\t}", "public function files();", "function ft_file_api_process_form_hook($params)\n{\n global $LANG, $g_query_str_multi_val_separator;\n\n $file_fields = $params[\"file_fields\"];\n if (empty($file_fields))\n return;\n\n $form_id = $params[\"form_id\"];\n $submission_id = $params[\"submission_id\"];\n $namespace = $params[\"namespace\"];\n\n $module_field_type_id = ft_get_field_type_id_by_identifier(\"file\");\n $problem_files = array();\n\n $return_info = array(\n \"success\" => true,\n \"message\" => \"\"\n );\n\n foreach ($file_fields as $file_field_info)\n {\n $field_type_id = $file_field_info[\"field_info\"][\"field_type_id\"];\n if ($module_field_type_id != $field_type_id)\n continue;\n\n $field_id = $file_field_info[\"field_info\"][\"field_id\"];\n $field_name = $file_field_info[\"field_info\"][\"field_name\"];\n $include_on_redirect = $file_field_info[\"field_info\"][\"include_on_redirect\"];\n $field_settings = ft_get_field_settings($field_id);\n $file_field_info[\"settings\"] = $field_settings;\n\n // nothing was included in this field, just ignore it\n if (empty($_FILES[$field_name][\"name\"]))\n continue;\n\n list($success, $message, $filename) = ft_file_upload_submission_file($form_id, $submission_id, $file_field_info);\n if (!$success)\n $problem_files[] = array($_FILES[$field_name][\"name\"], $message);\n else\n {\n $return_info[\"message\"] = $message;\n $curr_file_info = array(\n \"filename\" => $filename,\n \"file_upload_dir\" => $file_field_info[\"settings\"][\"folder_path\"],\n \"file_upload_url\" => $file_field_info[\"settings\"][\"folder_url\"]\n );\n $_SESSION[$namespace][$field_name] = $curr_file_info;\n }\n }\n\n if (!empty($problem_files))\n {\n $message = $LANG[\"notify_submission_updated_file_problems\"] . \"<br /><br />\";\n foreach ($problem_files as $problem)\n $message .= \"&bull; <b>{$problem[0]}</b>: $problem[1]<br />\\n\";\n\n $return_info = array(\n \"success\" => false,\n \"message\" => $message\n );\n }\n\n return $return_info;\n}", "protected function get_file_data()\n {\n $data = $_FILES[ $this->get_attribute('name') ];\n $data['error'] = $this->file_upload_error($data['error']);\n return $data;\n }", "public function pageFile()\n\t{\n\t\t$body = new Body();\n\n\t\t$form = $body->addForm('frmFiles', TTRANSFERT_CONTROL_FILE, 'targetDlg');\n\t\t$form->getForm()->setAttribute('enctype', 'multipart/form-data');\n\n\t\t$div = $form->addDiv('divFiles');\n\n\t\t$div->addP('', LOC_P_FILES, 'bn-p-info');\n\t\t$msg = Bn::getValue('msg');\n\t\tif (!empty($msg) ) $div->addP('', $msg, 'bn-error');\n\t\t$edt = $div->addEditFile('file', LOC_LABEL_FILE);\n\n\t\t// Boutons de commande\n\t\t$d = $div->addDiv('', 'bn-div-btn');\n\t\t$btn = $d->addButtonCancel('btnCancel', LOC_BTN_CANCEL);\n\t\t$d->addButtonValid('btnImport', LOC_BTN_VALID);\n\t\t$body->display();\n\t\treturn false;\n\t}", "function form_data() {\n return array_merge($_POST, $_FILES);\n}" ]
[ "0.7420731", "0.6791803", "0.6736898", "0.6736898", "0.6736898", "0.6736898", "0.6736898", "0.67176783", "0.66659755", "0.6612971", "0.65365946", "0.6452585", "0.644278", "0.64137554", "0.6391656", "0.63458973", "0.634482", "0.6337766", "0.6334413", "0.62932914", "0.6236448", "0.62356895", "0.6231479", "0.6206186", "0.6185701", "0.61737376", "0.61658764", "0.6145463", "0.6144295", "0.6132336" ]
0.7787574
0
modified settings output to wrap sections in divs on settings page callback
function eazy_site_settings_sections( $page ) { global $wp_settings_sections, $wp_settings_fields; if ( ! isset( $wp_settings_sections[$page] ) ) return; foreach ( (array) $wp_settings_sections[$page] as $section ) { $current_title = strtolower($section['title']); $cleaned_title = preg_replace("/[\s_]/", "-", $current_title); echo "<div id='".$cleaned_title."' class='eazy-site-settings-section'>"; if ( $section['title'] ) echo "<h2 class='eazy-site-settings-section-title'>{$section['title']}</h2>\n"; if ( $section['callback'] ) call_user_func( $section['callback'], $section ); if ( ! isset( $wp_settings_fields ) || !isset( $wp_settings_fields[$page] ) || !isset( $wp_settings_fields[$page][$section['id']] ) ) continue; echo '<table class="form-table">'; do_settings_fields( $page, $section['id'] ); echo '</table>'; echo "</div>"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function _output_settings_wrap() {\n\n\t\t\\add_action(\n\t\t\t$this->seo_settings_page_hook . '_settings_page_boxes',\n\t\t\tBridges\\SeoSettings::class . '::_output_columns'\n\t\t);\n\n\t\tBridges\\SeoSettings::_output_wrap();\n\t}", "public function render_settings() {\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\twp_die( __( 'You do not have sufficient permissions to access this page.', 'themify-flow' ) );\n\t\t}\n\t\t?>\n\t\t<div class=\"wrap themify-flow-settings\">\n\t\t\t<h2>\n\t\t\t\t<?php _e( 'Themify Flow Settings', 'themify-flow' ); ?> \n\t\t\t</h2>\n\t\t\t<h2 class=\"nav-tab-wrapper\">\n\t\t\t\t<?php foreach( $this->sections_and_settings as $key => $section ) : ?>\n\t\t\t\t\t<a href=\"#section-<?php echo $key; ?>\" class=\"nav-tab <?php if( $key == 'general' ) echo 'nav-tab-active';?>\"><?php echo $section['title']; ?></a>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</h2>\n\t\t\t<form action=\"options.php\" method=\"post\">\n\t\t\t\t<?php settings_fields( $this->slug ); ?>\n\n\t\t\t\t<?php foreach( $this->sections_and_settings as $key => $section ) : ?>\n\n\t\t\t\t\t<div id=\"section-<?php echo esc_attr( $key );?>\" class=\"setting-<?php echo esc_attr( $key ); ?>-wrap setting-tab-wrap\">\n\t\t\t\t\t\t<?php do_settings_sections( $this->slug . $key ); ?>\n\t\t\t\t\t</div>\n\n\t\t\t\t<?php endforeach; ?>\n\n\t\t\t\t<?php submit_button(); ?>\n\t\t\t</form>\n\t\t</div>\n\t\t<?php\n\n\t\tdo_action( 'tf_after_settings' );\n\t}", "private function process_settings() {\n\t\t\tif ( ! empty( $this->settings ) ) {\n\t\t\t\tusort( $this->settings, array( $this, 'sort_array' ) );\n\n\t\t\t\tforeach ( $this->settings as $section ) {\n\t\t\t\t\tif ( isset( $section['section_id'] ) && $section['section_id'] && isset( $section['section_title'] ) ) {\n\t\t\t\t\t\t$page_name = ( $this->has_tabs() ) ? sprintf( '%s_%s', $this->option_group, $section['tab_id'] ) : $this->option_group;\n\n\t\t\t\t\t\tadd_settings_section( $section['section_id'], $section['section_title'], array(\n\t\t\t\t\t\t\t$this,\n\t\t\t\t\t\t\t'section_intro'\n\t\t\t\t\t\t), $page_name );\n\n\t\t\t\t\t\tif ( isset( $section['fields'] ) && is_array( $section['fields'] ) && ! empty( $section['fields'] ) ) {\n\t\t\t\t\t\t\tforeach ( $section['fields'] as $field ) {\n\t\t\t\t\t\t\t\tif ( isset( $field['id'] ) && $field['id'] && isset( $field['title'] ) ) {\n\t\t\t\t\t\t\t\t\t$title = ! empty( $field['subtitle'] ) ? sprintf( '%s <span class=\"wpsf-subtitle\">%s</span>', $field['title'], $field['subtitle'] ) : $field['title'];\n\n\t\t\t\t\t\t\t\t\tadd_settings_field( $field['id'], $title, array(\n\t\t\t\t\t\t\t\t\t\t$this,\n\t\t\t\t\t\t\t\t\t\t'generate_setting'\n\t\t\t\t\t\t\t\t\t), $page_name, $section['section_id'], array(\n\t\t\t\t\t\t\t\t\t\t'section' => $section,\n\t\t\t\t\t\t\t\t\t\t'field' => $field\n\t\t\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function render_settings_content() {\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'fields/class-fields-factory.php';\n\t?>\n\t\t<div class=\"wrap\">\n\t\t\t<h2>\n\t\t\t\t<span id=\"ftoc-title-icon\" class=\"dashicons dashicons-editor-ol\"></span>\n\t\t\t\t<?php _e( 'Fixed TOC Settings', 'fixedtoc' ); ?>\n\t\t\t</h2>\n\t\t\t<form method=\"post\" action=\"options.php\">\n\t\t\t\t<?php \n\t\t\t\t\tsettings_fields( $this->option_group );\n\t\t\t\t\tdo_settings_sections( $this->menu_slug );\n\t\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\t<?php\n\t}", "function settingsPageContent() {\n\n\t\techo '<div class=\"wrap\">';\n\t\techo '<h2>REST Routes Settings</h2>';\n\t\techo '<form class=\"welcome-panel\" method=\"post\" action=\"\">';\n\t\tsettings_fields( $this->slug );\n\t\tdo_settings_sections( $this->slug );\n\t\tsubmit_button();\n\t\techo '</form>';\n\t\techo '</div>';\n\t}", "public function cb_build_settings_page() {\n\n $htm = '';\n //$htm .= $this->postListDebug();\n\n ?>\n <div class=\"wrap yfp-plugin-admin\">\n <h2><?php echo self::STR_PLUGIN_TITLE; ?> Settings</h2>\n <p>All setting for the plugin are on this page.</p>\n <?php echo $htm; ?>\n <form method=\"post\" class=\"yfp-plugin-admin-form\" action=\"options.php\">\n <?php\n echo '<!-- settings_fields of \"' . $this->pluginSettingsGroup . '\" -->' . \"\\n\";\n settings_fields($this->pluginSettingsGroup); // Demo says otherwise\n echo \"\\n\\n\" . '<!-- do_settings_sections of \"' . self::ADMIN_MENU_SLUG . '\" -->' . \"\\n\";\n do_settings_sections(self::ADMIN_MENU_SLUG);\n submit_button();\n ?>\n </form>\n </div>\n <?php\n }", "function settings_page() {\n\t\techo '<div class=\"wrap\">';\n\t\techo sprintf(\"<h2>%s</h2>\", __('Menu List Settings', 'themeplate'));\n\t\t$this->settings_api->show_settings();\n\t\techo '</div>';\n\n\t}", "public function settings_section_callback() {\n\t\t$view = new View( AS_BROKEN_SETTINGS_2_DIR . 'views/section-description.php' );\n\t\techo $view->render();\n\t}", "public function render_settings_page() {\n\t\t?>\n\t\t<div class=\"wrap\">\n\t\t\t<h2><?php esc_html_e( 'Talk Settings', 'coral-project-talk' ) ?></h2>\n\t\t\t<form method=\"post\" action=\"options.php\">\n\t\t\t\t<?php\n\t\t\t\tsettings_fields( 'talk-settings' );\n\t\t\t\tdo_settings_sections( 'talk-settings' );\n\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\t\t<?php\n\t}", "public static function output_sections() {\n global $current_section;\n $aktivace_xml = get_option( 'wc_ceske_sluzby_heureka_xml_feed-aktivace' );\n $aktivace_certifikatu = get_option( 'wc_ceske_sluzby_heureka_certifikat_spokojenosti-aktivace' );\n $aktivace_dodaci_doby = get_option( 'wc_ceske_sluzby_dalsi_nastaveni_dodaci_doba-aktivace' );\n $aktivace_eet = get_option( 'wc_ceske_sluzby_dalsi_nastaveni_eet-aktivace' );\n $sections = array(\n '' => 'Základní nastavení'\n );\n if ( $aktivace_xml == \"yes\" ) {\n $sections['xml-feed'] = 'XML feed';\n }\n if ( $aktivace_certifikatu == \"yes\" ) {\n $sections['certifikat-spokojenosti'] = 'Certifikát spokojenosti';\n }\n if ( $aktivace_dodaci_doby == \"yes\" ) {\n $sections['dodaci-doba'] = 'Dodací doba';\n }\n if ( $aktivace_eet == \"yes\" ) {\n $sections['eet'] = 'EET';\n }\n if ( empty( $sections ) ) {\n return;\n }\n echo '<ul class=\"subsubsub\">';\n $array_keys = array_keys( $sections );\n foreach ( $sections as $id => $label ) {\n echo '<li><a href=\"' . admin_url( 'admin.php?page=wc-settings&tab=ceske-sluzby&section=' . sanitize_title( $id ) ) . '\" class=\"' . ( $current_section == $id ? 'current' : '' ) . '\">' . $label . '</a> ' . ( end( $array_keys ) == $id ? '' : '|' ) . ' </li>';\n }\n echo '</ul><br class=\"clear\" />';\n }", "public function wp_rest_api_controller_setting_section_callback_function() {\n\t\t?>\n\t\t<div class=\"rest-controller-tabs\">\n\t\t\t<ul id=\"rest-controller-tabs-list\">\n\t\t\t\t\t<li class=\"active rest-controller-tabs-list-item active\"><a data-tab=\"post-types\">Post Types</a></li>\n\t\t\t\t\t<li class=\"rest-controller-tabs-list-item\"><a data-tab=\"taxonomies\">Taxonomies</a></li>\n\t\t\t</ul>\n\t\t</div>\n\n\t\t<p id=\"rest-api-controller-post-types\" class=\"rest-api-controller-post-types rest-api-controller-section\"> <?php esc_html_e( 'Toggle visibility of post types and select meta data to the REST API.', 'wp-rest-api-controller' ); ?> </p>\n\t\t<p id=\"rest-api-controller-taxonomies\" class=\"rest-api-controller-taxonomies rest-api-controller-section\"> <?php esc_html_e( 'Toggle visibility of taxonomies and select meta data to the REST API.', 'wp-rest-api-controller' ); ?> </p>\n\t\t<input type=\"hidden\" id=\"rest-controller-active-tab\" name=\"wp-rest-api-controller-active-tab\" value=\"<?php echo esc_attr( get_option( 'wp-rest-api-controller-active-tab', 'post-types' ) ); ?>\"/>\n\t\t<?php\n\t}", "public static function output_sections() {\n global $current_section;\n $aktivace_xml = get_option( 'wc_ceske_sluzby_heureka_xml_feed-aktivace' );\n $aktivace_certifikatu = get_option( 'wc_ceske_sluzby_heureka_certifikat_spokojenosti-aktivace' );\n $aktivace_dodaci_doby = get_option( 'wc_ceske_sluzby_dalsi_nastaveni_dodaci_doba-aktivace' );\n $sections = array(\n '' => 'Základní nastavení'\n );\n if ( $aktivace_xml == \"yes\" ) {\n $sections['xml-feed'] = 'XML feed';\n }\n if ( $aktivace_certifikatu == \"yes\" ) {\n $sections['certifikat-spokojenosti'] = 'Certifikát spokojenosti';\n }\n if ( $aktivace_dodaci_doby == \"yes\" ) {\n $sections['dodaci-doba'] = 'Dodací doba';\n }\n if ( empty( $sections ) ) {\n return;\n }\n echo '<ul class=\"subsubsub\">';\n $array_keys = array_keys( $sections );\n foreach ( $sections as $id => $label ) {\n echo '<li><a href=\"' . admin_url( 'admin.php?page=wc-settings&tab=ceske-sluzby&section=' . sanitize_title( $id ) ) . '\" class=\"' . ( $current_section == $id ? 'current' : '' ) . '\">' . $label . '</a> ' . ( end( $array_keys ) == $id ? '' : '|' ) . ' </li>';\n }\n echo '</ul><br class=\"clear\" />';\n }", "function renderAdminSettings()\n\t{\n\t\t//JHTML::stylesheet('fabrikadmin.css', 'administrator/components/com_fabrik/views/');\n\t\t$this->getRow();\n\t\t$pluginParams =& $this->getParams();\n\n\t\t$document =& JFactory::getDocument();\n\t\t?>\n\t\t<div id=\"page-<?php echo $this->_name;?>\" class=\"pluginSettings\" style=\"display:none\">\n\t\t<?php\n\t\t\techo $pluginParams->render('params');\n\t\t\techo $pluginParams->render('params', 'fields');\n\t\t\t?> </div> <?php\n\t\treturn;\n\t}", "function bbp_admin_get_settings_sections()\n{\n}", "function homepage_display_setting_section_callback_function() {\n \techo '';\n }", "function section_optionator( $settings ){\n\t\t$settings = wp_parse_args( $settings, $this->optionator_default );\n\t\t\n\t\t\t$array = array(); \n\t\t\t\n\t\t\t$array['quick_slides'] = array(\n\t\t\t\t'type' \t\t\t=> 'count_select',\n\t\t\t\t'count_start'\t=> 1, \n\t\t\t\t'count_end'\t\t=> 10,\n\t\t\t\t'default'\t\t=> '3',\n\t\t\t\t'inputlabel' \t=> __( 'Number of Slides to Configure', 'pagelines' ),\n\t\t\t\t'title' \t\t=> __( 'Number of Slides', 'pagelines' ),\n\t\t\t\t'shortexp' \t\t=> __( 'Enter the number of QuickSlider slides. <strong>Default is 3</strong>', 'pagelines' ),\n\t\t\t\t'exp' \t\t\t=> __( \"This number will be used to generate slides and option setup.\", 'pagelines' ),\n\t\t\n\t\t\t);\n\t\t\t\n\t\t\t$array['quick_transition'] = array(\n\t\t\t\t'type' \t\t\t=> 'select',\n\t\t\t\t'selectvalues' => array(\n\t\t\t\t\t'fade' \t\t\t=> array('name' => __( 'Use Fading Transition', 'pagelines' ) ),\n\t\t\t\t\t'slide_h' \t\t=> array('name' => __( 'Use Slide/Horizontal Transition', 'pagelines' ) ),\t\t\t\t\t\t\n\t\t\t\t),\n\t\t\t\t'inputlabel' \t=> __( 'Select Transition Type', 'pagelines' ),\n\t\t\t\t'title' \t\t=> __( 'Slider Transition Type', 'pagelines' ),\n\t\t\t\t'shortexp' \t\t=> __( 'Configure the way slides transfer to one another.', 'pagelines' ),\n\t\t\t\t'exp' \t\t\t=> __( \"\", 'pagelines' ),\n\t\t\n\t\t\t);\n\t\t\t\n\t\t\t$array['quick_nav'] = array(\n\t\t\t\t'type' \t\t\t=> 'select',\n\t\t\t\t'selectvalues' => array(\n\t\t\t\t\t'both' \t\t\t=> array('name' => __( 'Use Both Arrow and Slide Control Navigation', 'pagelines' ) ),\n\t\t\t\t\t'none'\t\t\t=> array('name' => __( 'No Navigation', 'pagelines' ) ),\t\n\t\t\t\t\t'control_only'\t=> array('name' => __( 'Slide Controls Only', 'pagelines' ) ),\t\n\t\t\t\t\t'arrow_only'\t=> array('name' => __( 'Arrow Navigation Only', 'pagelines' ) ),\t\t\t\t\t\t\n\t\t\t\t),\n\t\t\t\t'inputlabel' \t=> __( 'Slider Navigation', 'pagelines' ),\n\t\t\t\t'title' \t\t=> __( 'Slider Navigation mode', 'pagelines' ),\n\t\t\t\t'shortexp' \t\t=> __( 'Configure the navigation for this slider.', 'pagelines' ),\n\t\t\t\t'exp' \t\t\t=> __( \"\", 'pagelines' ),\n\t\t\n\t\t\t);\n\t\t\t\n\t\t\t$array['quick_slideshow'] = array(\n\t\t\t\t'type' \t\t\t=> 'check',\n\t\t\t\t\n\t\t\t\t'inputlabel' \t=> __( 'Animate Slideshow Automatically?', 'pagelines' ),\n\t\t\t\t'title' \t\t=> __( 'Automatic Slideshow?', 'pagelines' ),\n\t\t\t\t'shortexp' \t\t=> __( 'Autoplay the slides, transitioning every 7 seconds.', 'pagelines' ),\n\t\t\t\t'exp' \t\t\t=> __( \"\", 'pagelines' ),\n\t\t\n\t\t\t);\n\t\t\t\n\t\t\tglobal $post_ID;\n\t\t\t\n\t\t\t$oset = array('post_id' => $post_ID, 'clone_id' => $settings['clone_id'], 'type' => $settings['type']);\n\t\t\t\n\t\t\t$slides = (ploption('quick_slides', $oset)) ? ploption('quick_slides', $oset) : $this->default_limit;\n\t\t\t\n\t\t\tfor($i = 1; $i <= $slides; $i++){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$array['quick_slide_'.$i] = array(\n\t\t\t\t\t'type' \t\t\t=> 'multi_option',\n\t\t\t\t\t'selectvalues' => array(\n\t\t\t\t\t\t'quick_image_'.$i \t=> array(\n\t\t\t\t\t\t\t'inputlabel' \t=> __( 'Slide Image', 'pagelines' ), \n\t\t\t\t\t\t\t'type'\t\t\t=> 'image_upload'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'quick_text_'.$i \t=> array(\n\t\t\t\t\t\t\t'inputlabel'\t=> __( 'Slide Text', 'pagelines' ), \n\t\t\t\t\t\t\t'type'\t\t\t=> 'textarea'\n\t\t\t\t\t\t),\t\n\t\t\t\t\t\t'quick_link_'.$i \t=> array(\n\t\t\t\t\t\t\t'inputlabel'\t=> __( 'Slide Link URL', 'pagelines' ), \n\t\t\t\t\t\t\t'type'\t\t\t=> 'text'\n\t\t\t\t\t\t),\t\n\t\t\t\t\t\t'quick_text_location_'.$i \t=> array(\n\t\t\t\t\t\t\t'inputlabel'\t=> __( 'Slide Text Location', 'pagelines' ), \n\t\t\t\t\t\t\t'type'\t\t\t=> 'select', \n\t\t\t\t\t\t\t'selectvalues'\t=> array(\n\t\t\t\t\t\t\t\t'right_bottom'\t=> array('name'=> 'Right/Bottom'),\n\t\t\t\t\t\t\t\t'right_top'\t\t=> array('name'=> 'Right/Top'),\n\t\t\t\t\t\t\t\t'left_bottom'\t=> array('name'=> 'Left/Bottom'),\n\t\t\t\t\t\t\t\t'left_top'\t\t=> array('name'=> 'Left/Top')\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'title' \t\t=> __( 'QuickSlider Slide ', 'pagelines' ) . $i,\n\t\t\t\t\t'shortexp' \t\t=> __( 'Setup options for slide number ', 'pagelines' ) . $i,\n\t\t\t\t\t'exp'\t\t\t=> __( 'For best results all images in the slider should have the same dimensions.', 'pagelines')\n\t\t\t\t);\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\n\t\t\t$metatab_settings = array(\n\t\t\t\t\t'id' \t\t=> 'quickslider_options',\n\t\t\t\t\t'name' \t\t=> __( 'QuickSlider', 'pagelines' ),\n\t\t\t\t\t'icon' \t\t=> $this->icon, \n\t\t\t\t\t'clone_id'\t=> $settings['clone_id'], \n\t\t\t\t\t'active'\t=> $settings['active']\n\t\t\t\t);\n\n\t\t\tregister_metatab( $metatab_settings, $array );\n\n\t}", "function render_MainSettings() {\n print '<p>'.\n __('Use these settings to filter out the plugins that are returned on the Add New plugin page.','csa-plugintel').\n '</p>';\n }", "public function settings_page(){\n\t\t_e('<div class=\"wrap\">\n\t\t\t<img class=\"alignleft\" style=\"margin:0 10px 10px 0\" alt=\"\" src=\"'.Salesforce_API_Connector::$plugin_dir_url.'assets/images/sf.png\" />\n\t\t\t<h2>Saleforce API Connector</h2>\n\t\t</div>');\n\t}", "function ra_spotlight_settings_general_section_callback() {\n\t//echo '<p>General settings section.</p>';\n}", "function slice_settings_page() {\r\n\r\n\techo \"<style type='text/css'>.slice-input {font-family:Courier, Courier New;}</style>\r\n\t\t<div id='icon-options-general' class='icon32'><br></div><h2>Include Content Slice Settings</h2>\r\n\t\t<form action='options.php' method='post' style='margin-top:24px;'>\";\r\n\r\n\tsettings_fields('include-content-slice-options');\r\n\r\n\techo \"<h3>Default begin and end tags</h3>\";\r\n\techo_default_tags();\r\n\techo \"<table class='form-table'>\";\r\n\r\n\tdo_settings_fields('include-content-slice', 'default-tags-section');\r\n\r\n\techo \"<tr><td colspan='2'>\";\r\n\techo \"<p>This behavior is overridden by setting your own tags using the begin_tag and end_tag shortcode options like so:<br>\r\n\t\t<pre>&#91;slice src='http://example.com/file.txt' begin_tag='&#60;!--custom begin--&#62;' end_tag='&#60;!--custom end--&#62;'&#93;</pre>\r\n\t\tYou can also ignore tags altogether and include the entire source content:\r\n\t\t<pre>&#91;slice src='http://example.com/file.txt' tagless='true'&#93;</pre>\r\n\t\tSee the <a href='\" . plugins_url('readme.txt', __FILE__) . \"'>readme.txt</a> file for other usage examples.\r\n\t\t</p></td></tr></table>\";\r\n\r\n\techo \"<h3>Auto wrap</h3>\";\r\n\techo_auto_wrap();\r\n\techo \"<table class='form-table'>\";\r\n\tdo_settings_fields('include-content-slice', 'auto-wrap-section');\r\n\techo \"</table>\";\r\n\r\n\techo\t\"<p><input type='submit' name='submit' class='button-primary' value='\";\r\n\tesc_attr_e('Save Changes');\r\n\techo \"'></p></form>\";\r\n\r\n\t}", "public function faq_general_settings_section_info() {\n print __( 'Enter your settings below:', 'page-utils' );\n }", "function render_SettingsPage() {\n print\n '<div class=\"wrap\">' .\n screen_icon() .\n '<h2>PlugIntel '.__('Settings','csa-plugintel').'</h2>'.\n '<form method=\"post\" action=\"options.php\">'\n ;\n settings_fields('plugintel_options');\n do_settings_sections('plugintel');\n submit_button();\n print\n '</form>'.\n '</div>'\n ;\n }", "public function setup_settings_page() {\n\t\tadd_settings_section(\n\t\t\t'about-talk',\n\t\t\t__( 'About Talk', 'coral-project-talk' ),\n\t\t\tfunction() {\n\t\t\t\trequire_once( CORAL_PROJECT_TALK_DIR . '/inc/talk-settings-static-content.php' );\n\t\t\t},\n\t\t\t'talk-settings'\n\t\t);\n\n\t\tadd_settings_field(\n\t\t\t'coral_talk_base_url',\n\t\t\t__( 'Talk Server Base URL', 'coral-project-talk' ),\n\t\t\tarray( $this, 'render_base_url_field' ),\n\t\t\t'talk-settings',\n\t\t\t'about-talk'\n\t\t);\n\t\tregister_setting( 'talk-settings', 'coral_talk_base_url' );\n\n\t\tadd_settings_field(\n\t\t\t'coral_talk_container_classes',\n\t\t\t__( 'Talk Embed Container CSS Classes', 'coral-project-talk' ),\n\t\t\tarray( $this, 'render_container_classes_field' ),\n\t\t\t'talk-settings',\n\t\t\t'about-talk'\n\t\t);\n\t\tregister_setting( 'talk-settings', 'coral_talk_container_classes' );\n\t}", "function rp_layout_settings() {\n $this->options = get_option('rp_results_parser_einstellungen');\n $this->pageTypes = array(''=>__('Posts'), 'page' => __('Pages'), __('Theme Templates') => array_flip(get_page_templates()));\n ?>\n <div class=\"wrap\">\n <h2><?php echo esc_html($this->title); ?></h2>\n <form action=\"options.php\" method=\"post\">\n <?php\n settings_fields('rp_results_parser_einstellungen');\n do_settings_sections('results_parser-admin');\n submit_button();\n ?>\n </form>\n <form action=\"\" method=\"post\">\n <?php\n do_settings_sections('results_parser_import-admin');\n ?>\n </form>\n </div >\n <?php\n }", "function generate_page()\n {\n\n if (array_key_exists( 'option_name', $this->data )) {\n register_setting(\n Plugin::PREFIX, //option_group\n $this->data[ 'option_name' ],\n array(\n 'description' => $this->data[ 'description' ],\n 'sanitize_callback' => array( $this, 'sanitize_input' ),\n 'show_in_rest' => $this->data[ 'show_in_rest' ]\n )\n );\n }\n\n foreach ($this->data[ 'sections' ] as &$section) {\n $this->load_section( $section );\n }\n }", "public function options_page(){\n\t\t\t// NEEDS: setting_content()\n\n\t\t\tif( ! current_user_can( 'manage_options' ) ) return;\n\t\t\t\n\t\t\techo '<div class=\"wrap\"><h2>' . __('Dropbox Sideload Settings', 'dropbox-sideload') . '</h2>';\n\n\t\t\t// Do the content\n\t\t\t$this -> setting_content();\n\t\t\t\t\n\t\t\techo '</div>';\n\t\t}", "function slice_admin_init() {\r\n\t// but the labeling and functions are manually called in slice_settings_page(). The WP Plugin Settings API is pretty sweet but has near zero flexibility for display formatting, so we had to break it up\r\n\tadd_settings_section('default-tags-section', 'Default begin and end tags', 'echo_default_tags', 'include-content-slice' );\r\n\tadd_settings_field('default-begin-tag', 'Default begin tag:', 'echo_begin_tag_input', 'include-content-slice', 'default-tags-section');\r\n\tadd_settings_field('default-end-tag', 'Default end tag:', 'echo_end_tag_input', 'include-content-slice', 'default-tags-section');\r\n\r\n\tadd_settings_section('auto-wrap-section', 'Auto wrap', 'echo_auto_wrap', 'include-content-slice');\r\n\tadd_settings_field('auto-wrap', 'Auto wrap:', 'echo_auto_wrap_cb', 'include-content-slice', 'auto-wrap-section');\r\n\r\n\tregister_setting('include-content-slice-options', 'slice-plugin-settings');\r\n\t}", "function create_settings_page()\n\t{\n $this->options = get_option( 'marketo_credentials_option' );\n\t\t?>\n\t\t<div>\n\t\t\t<?php screen_icon(); ?>\n\t\t\t<h2>Marketo Subscribe Settings</h2>\n\t\t\t<form action=\"options.php\" method=\"post\">\n\t\t\t<?php\n // This prints out all hidden setting fields\n settings_fields( 'marketo_credentials_group' ); \n do_settings_sections( 'marketo-subscribe-settings' );\n submit_button(); \n ?>\n\t\t\t</form>\n\t\t</div>\n\n\t\t<?php\n\t}", "function pmep_settings_section_callback( ) { \n\n}", "public function rabe_section_info() {\n\t\techo '<h3>' . __( 'Site Settings', 'rabe' ) . '</h3>';\n\t}" ]
[ "0.77378947", "0.75629", "0.7366821", "0.72818404", "0.7218284", "0.7068303", "0.70455885", "0.7024661", "0.6997925", "0.6994079", "0.6973933", "0.6951897", "0.68428606", "0.682272", "0.6805402", "0.680078", "0.67934096", "0.67693263", "0.6768334", "0.67423344", "0.6738269", "0.67349297", "0.67341775", "0.6728512", "0.6724849", "0.670515", "0.66991246", "0.66531956", "0.66403675", "0.6622223" ]
0.76425534
1
Adds as discount This container indicates the discount type and amount applied to an account entry. Note: The discount type will be shown for any account entry where a discount applies, but the discount amount will only be shown if the corresponding fee was deducted from a seller payout.
public function addToDiscount(\Nogrod\eBaySDK\Trading\DiscountType $discount) { $this->discount[] = $discount; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDiscount($discount)\n {\n $this->discount = $discount;\n return $this;\n }", "public function setDiscount($discount)\n {\n $this->discount = $discount;\n\n return $this;\n }", "public function setDiscountType($discountType)\n {\n $this->discountType = $discountType;\n return $this;\n }", "private function ProcessDiscount() {\n\t\t$csvilog = JRequest::getVar('csvilog');\n\t\tif ($this->amount) {\n\t\t\t/* Bind the data */\n\t\t\t$this->_vm_product_discount->bind($this);\n\t\t\t\n\t\t\t/* Add the discount fields */\n\t\t\t$this->_vm_product_discount->setValue('start_date', $this->product_discount_date_start);\n\t\t\t$this->_vm_product_discount->setValue('end_date', $this->product_discount_date_end);\n\t\t\t\n\t\t\t/* Check if a discount already exists */\n\t\t\t$this->_vm_product_discount->check();\n\t\t\tif (!$this->_vm_product_discount->store()) {\n\t\t\t\t$csvilog->AddMessage('debug', JText::_('DEBUG_ADD_DISCOUNT'), true);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t/* Fill the product information with the discount ID */\n\t\t\t$this->product_discount_id = $this->_vm_product_discount->getValue('discount_id');\n\t\t}\t\n\t\telse {\n\t\t\t$csvilog->AddMessage('debug', JText::_('DEBUG_NO_DISCOUNT'));\n\t\t}\n\t}", "private function calcDiscount(){\n $discountManager=new DiscountManager($this->currencyManager,$this->currency);\n // Execute the discounts \n $discountManager->calcDiscounts($this->cartItems);\n // update the total\n $this->total -=$discountManager->getTotalDiscount();\n // If at least one discount happened, append the details to the bill\n if($discountManager->getTotalDiscount()>0){\n // a discount actually was applied\n $this->billDetails .= \"Discounts: \" .\"\\n\";\n $this->appendToBillDetails($discountManager->getDiscountsDetails());\n }\n }", "public function apply_discount() {\n\t\t// bail if the discount has already been applied\n\t\tif ( ! WC()->cart || 'no' === get_option( 'account_funds_give_discount' ) || WC()->cart->has_discount( self::get_discount_code() ) || ( ! self::can_apply_funds() && ! self::account_funds_gateway_chosen() ) ) {\n\t\t\treturn;\n\t\t}\n\t\tWC()->cart->add_discount( self::generate_discount_code() );\n\t}", "public function show(Discount $discount)\n {\n //\n }", "public function show(Discount $discount)\n {\n //\n }", "public function setCODFeeDiscount($value)\n {\n $this->_fields['CODFeeDiscount']['FieldValue'] = $value;\n return $this;\n }", "public function setDiscount(?float $discount): self\n {\n $this->initialized['discount'] = true;\n $this->discount = $discount;\n\n return $this;\n }", "public function setDiscount(?float $discount): self\n {\n $this->initialized['discount'] = true;\n $this->discount = $discount;\n\n return $this;\n }", "public function setDiscountType($discountType)\n {\n $this->discountType = $discountType;\n\n return $this;\n }", "public function getDiscountAmount();", "public function getDiscountType()\n {\n return $this->discountType;\n }", "public function getDiscountType()\n {\n return $this->discountType;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "private function _newCustomerDiscount() {\n\n\t\t$this->loadModel('User');\n\n\t\t// the user is a customer if he as made at least one order\n\t\tif ($this->User->giveFirstOrderDiscount($this->Auth->user('id')) && $this->Session->read('Order.Order.method_of_payment') === 'creditcard') {\n\t\t\t$this->set('firstOrder', TRUE);\n\t\t\t$this->Session->write('Order.Order.coupon_code', '1399499398');\n\t\t} else {\n\t\t\t$this->set('firstOrder', FALSE);\n\t\t}\n\t}", "public function withCODFeeDiscount($value)\n {\n $this->setCODFeeDiscount($value);\n return $this;\n }", "public function testFormatDiscount()\n {\n modConfig::getInstance()->setConfigParam( 'blEnterNetPrice', true );\n $aTestVals = array( 'aDiscounts' );\n\n // deleting discounts to ignore bundle problems\n foreach ( $this->aDiscounts as $oDiscount ) {\n $oDiscount->oxdiscount__oxaddsumtype = new oxField('%', oxField::T_RAW);\n $oDiscount->save();\n }\n\n $oBasket = new oxbasket();\n $oBasket->setPayment( 'oxidcashondel' );\n $oBasket->setCardId( $this->oCard->getId() );\n $oBasket->setCardMessage( 'message' );\n\n $oItem = $oBasket->addToBasket( $this->oArticle->getId(), 10 );\n $oItem->setWrapping( $this->oWrap->getId() );\n\n\n $oBasket->addToBasket( $this->oVariant->getId(), 10 );\n $oBasket->calculateBasket( false );\n\n foreach ( $aTestVals as $sName ) {\n $this->assertTrue( isset( $oBasket->{$sName} ), \" $sName is not set \");\n }\n }", "public function discount()\n {\n return number($this->deals->sum('discount'));\n }", "public function addEditDiscount($sellerId,$discountId,$title,$percent,$status,$productids);", "public function set_discount($discount)\n\t{\n\t\t$this->discount = $discount;\n\t\t\n\t\t$this->cache('discount', NULL);\n\t\t\n\t\treturn $this;\n\t}", "public function discountLedgerEntry($amount)\n {\n $financeLedger = new Core_Model_Finance_Ledger;\n $discountLedgerRecord = $financeLedger->fetchByName('Discount allowed');\n $notes = 'Invoice with Invoice Id = '.$this->_invoiceId.\n ' '.$this->_invoiceTo;\n $dataToInsert = array(\n 'debit' => $amount,\n 'credit' => \"0\",\n 'notes' => $notes,\n 'transaction_timestamp' => $this->_transactionTime,\n 'fa_ledger_id' => $discountLedgerRecord['fa_ledger_id']\n );\n $ledgerEntryModel = new Core_Model_Finance_Ledger_Entry;\n $ledgerEntryId = $ledgerEntryModel->create($dataToInsert);\n return $ledgerEntryId;\n }", "public function create(Discount &$discount)\n {\n $data = $discount->exportData();\n $endpoint = '/admin/discounts.json';\n $request = $this->createRequest($endpoint, static::REQUEST_METHOD_POST);\n $response = $this->send(\n $request, array(\n 'discount' => $data\n )\n );\n $discount->setData($response->discount);\n }", "public function setDiscountType(?string $discountType): void\n {\n $this->discountType = $discountType;\n }", "public function setDiscount(array $discount)\n {\n $this->discount = $discount;\n return $this;\n }", "public function setDiscountFlag($var)\n {\n GPBUtil::checkBool($var);\n $this->discount_flag = $var;\n }", "private function toolsDiscount(&$order, &$discount)\n {\n if (isset($order['items']) && !empty($order['items'])) {\n $productIds = array();\n foreach ($order['items'] as $item) {\n array_push($productIds, $item['product-id']);\n }\n $tools = Product::whereIn('id', $productIds)->where(\"category\", \"=\", 1)->get();\n if($tools->count() >= 2){\n $product = $tools->where('price', '>', 0)->sortByDesc('price')->first();\n $index = array_search($this->arraySearch($order['items'], 'product-id', $product->id), $order['items']);\n if($index > -1){\n $order['items'][$index]['discounted_price'] = $order['items'][$index]['total'] - (20 * $order['items'][$index]['total']) / 100;\n array_push($discount['discounted_items'], $order['items'][$index]);\n $discount['applied_discounts'] = $this->addAppliedDiscount($discount['applied_discounts'], 3);\n }\n }\n }\n }" ]
[ "0.601655", "0.5915387", "0.5904031", "0.58839273", "0.5882417", "0.58709615", "0.5847485", "0.5847485", "0.5836985", "0.582355", "0.582355", "0.57814085", "0.5713521", "0.5658597", "0.5658597", "0.5642182", "0.5642182", "0.5642182", "0.5597695", "0.55577606", "0.55270964", "0.55231506", "0.55230296", "0.55014914", "0.5445867", "0.5433876", "0.54289466", "0.5403428", "0.5364292", "0.5356708" ]
0.64355457
0
/ Gets the Facebook SDK for PHP whuch is a library that easily integrates Facebook login and makes requests to Facebook's Graph API.
function getFacebook(){ require_once __DIR__ . '/src/Facebook/autoload.php'; $facebook = new Facebook\Facebook(array( 'app_id' => 'APP_ID', 'app_secret' => 'APP_SECRET', 'default_graph_version' => 'v2.5' ) ); return $facebook; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function connect() {\n\t\treturn $this->FacebookApi->connect();\n\t}", "public function getFacebook()\n {\n if (! $this->_facebook) {\n\n $options = $this->getOptions();\n\n // if a custom facebook base SDK was specified, include this first\n if (isset($options['sdkPath'])) {\n require_once $options['sdkPath'];\n unset($options['sdkPath']);\n }\n\n $this->_facebook = new Bear_Facebook($options);\n }\n\n return $this->_facebook;\n }", "public static function getFacebook() {\n\t\t\tif (null === self::$facebook) {\n\t\t\t\tself::$facebook = new Facebook(array(\n\t\t\t\t\t'appId' => '232000500251089',\n\t\t\t\t\t'secret' => 'c2b3756172017ab8052d364b70e5babc'\n\t\t\t\t\t));\n\t\t\t}\n\t\t\treturn self::$facebook;\n\t}", "public function getFacebook() {\n\t\t$class = __CLASS__;\n\t\treturn new $class('facebook', $this);\n\t}", "public static function getFacebook()\n\t{\n\t\tif (!self::$facebook) {\n\t\t\tjimport('jugrs.facebook.load');\n\n\t\t\tself::$facebook = LoadFacebook::getInstance();\n\t\t}\n\t\treturn self::$facebook;\n\t}", "private function fbInit()\n {\n session_start();\n return new Facebook([\n 'app_id' => env('FB_API_ID'),\n 'app_secret' => env('FB_API_SECRET'),\n 'default_graph_version' => 'v2.4',\n ]);\n\n }", "static function GetFb()\n\t{\n\t\tFb::Init();\n\t\treturn Fb::$API;\n\t}", "public function facebookInit() {\n\n $this->fb = new Facebook\\Facebook([\n 'app_id' => $this->ci->config->item('api_id','facebook'),\n 'app_secret' => $this->ci->config->item('app_secret','facebook'),\n 'default_graph_version' => 'v2.5',\n ]); \n return $this->fb ; \n }", "function itg_social_media_fb_connection() {\n $fb = new Facebook\\Facebook([\n 'app_id' => variable_get('facebook_app_key'),\n 'app_secret' => variable_get('facebook_app_secret'),\n 'default_graph_version' => 'v2.5',\n ]);\n \n return $fb;\n}", "public function getFacebook()\n\t{\n\t\treturn $this->facebook;\n\t}", "public function getFacebook(){\n\t\t\treturn $this->facebook;\n\t\t}", "public static function facebookSendApi() {\n return self::container()->get('facebook_send_api');\n }", "public function getFacebook()\n\t{\n\t\treturn $this->_facebook;\n\t}", "public function facebook()\n {\n return Settings::get('facebook_appid');\n }", "private function fbInit(){\n\t\t\t\t\n\t\t$this->_facebook = new Facebook(array('appId' => $this->_AP_KEY, \n\t\t\t\t\t\t\t\t\t\t\t 'secret' => $this->_AP_SECRET, \n\t\t\t\t\t\t\t\t\t\t\t 'cookie' => true));\n\t\t$this->_fb_session = $this->_facebook->getSession();\n\t\t\n\t\tif(!empty($this->_fb_session)){\t\t\t\n\t\t\ttry{\n\t\t\t\t\t\n\t\t\t\t$this->_fb_uid \t= $this->_facebook->getUser();\n\t\t\t\t$this->_fb_user = $this->_facebook->api(\"/me\");\n\t\t\t\t\n\t\t\t\tif(!empty($this->_fb_user)){\t\t\t\t\n\t\t\t\t\tif(isset($_GET['installed'])&&$_GET['installed']==1){\t\t\t\t\t\n\t\t\t\t\t\t$this->redirect(\"http://apps.facebook.com/shutkizator/\");\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->set(\"fb_user\",$this->_fb_user);\n\t\t\t\t\n\t\t\t}catch(Exception $ex){\n\t\t\t\n\t\t\t\t$this->Session->setFlash('Facebook Api Error: '.$ex);\n\t\t\t}\t\t\t\n\t\t}else {\t\n\t\t\techo \"<script type='text/javascript'>top.location.href = '\".$this->_facebook->getLoginUrl(array('req_perms' => 'email,read_stream,publish_stream')).\"';</script>\";\t\t\n\t\t}\n\t\n\t}", "protected function getOpenGraphFacebookAppId()\n {\n return \\XLite\\Core\\Config::getInstance()->CDev->GoSocial->fb_app_id;\n }", "public function accessTokenFromFacebook()\n {\n $config = $this->application->config('oauth');\n $request = $this->application->request();\n\n // pass verification to the API so we can log in\n $clientId = $config['client_id'];\n $clientSecret = $config['client_secret'];\n\n // handle incoming vars\n $code = $request->get('code');\n\n $authApi = $this->application->container->get(AuthApi::class);\n $result = $authApi->verifyFacebook($clientId, $clientSecret, $code);\n\n $this->handleLogin($result);\n }", "public function getFacebookAccessToken()\n {\n return $this->facebookAccessToken;\n }", "public function facebook()\n\t{\n\n\t\t$fb = new \\Facebook\\Facebook([\n\t\t\t'app_id' => $this->config->item('facebook_app_id'),\n\t\t\t'app_secret' => $this->config->item('facebook_app_secret'),\n\t\t\t'default_graph_version' => $this->config->item('facebook_graph_version'),\n\t\t\t'persistent_data_handler' => 'session'\n\t\t]);\n\t\t$this->session->set_userdata('social_signup', 'register');\n\n\t\t$helper = $fb->getRedirectLoginHelper();\n\n\t\t$permissions = ['public_profile', 'email'];\n\t\t// For more permissions like user location etc you need to send your application for review\n\t\t$loginUrl = $helper->getLoginUrl(base_url() . '/socialLogin/facebookCallback', $permissions);\n\t\theader(\"location: \" . $loginUrl);\n\t}", "function rzr_facebook_login(){\n\t\t\tsession_start();\n\t\t require 'facebook/vendor/autoload.php';\n\t\t $fb = new Facebook\\Facebook([\n\t\t 'app_id' => get_option('rzr_social_facebook_app_id'), // Replace {app-id} with your app id\n\t\t 'app_secret' => get_option('rzr_social_facebook_app_secret'),\n\t\t 'default_graph_version' => 'v2.2',\n\t\t 'default_access_token' => '1450462385263252'\n\t\t ]);\n\n\t\t $helper = $fb->getRedirectLoginHelper();\n\t\t \n\t\t if($_GET['page']=='redirect')\n\t\t {\n\t\t try {\n\t\t $accessToken = $helper->getAccessToken();\n\t\t } catch(Facebook\\Exceptions\\FacebookResponseException $e) {\n\t\t // When Graph returns an error\n\t\t echo 'Graph returned an error: ' . $e->getMessage();\n\t\t exit;\n\t\t } catch(Facebook\\Exceptions\\FacebookSDKException $e) {\n\t\t // When validation fails or other local issues\n\t\t echo 'Facebook SDK returned an error: ' . $e->getMessage();\n\t\t exit;\n\t\t }\n\n\t\t try {\n\t\t // Get the Facebook\\GraphNodes\\GraphUser object for the current user.\n\t\t // If you provided a 'default_access_token', the '{access-token}' is optional.\n\t\t $response = $fb->get('/me?fields=id,name,email,first_name,last_name,location,locale,hometown', $accessToken);\n\n\t\t } catch(Facebook\\Exceptions\\FacebookResponseException $e) {\n\t\t // When Graph returns an error\n\t\t echo 'Graph returned an error: ' . $e->getMessage();\n\t\t exit;\n\t\t } catch(Facebook\\Exceptions\\FacebookSDKException $e) {\n\t\t // When validation fails or other local issues\n\t\t echo 'Facebook SDK returned an error: ' . $e->getMessage();\n\t\t exit;\n\t\t }\n\n\t\t $user = $response->getGraphUser();\n\t\t $user_fb_email = $user->getEmail();\n\t\t $user_fb_id = $user->getId();\n\t\t $user_fb_name = $user['name'];\n\t\t $user_fb_fn = $user['first_name'];\n\t\t $user_fb_ln = $user['last_name'];\n\n\t\t if($user_fb_email != '')\n\t\t {\n\t\t $user_name = $user_fb_email;\n\t\t $user_email = $user_fb_email;\n\t\t $user_id = username_exists( $user_name );\n\t\t if(!$user_id)\n\t\t {\n\t\t $userdata = array( 'user_login' => $user_email, 'user_email' => $user_email, 'user_pass' => wp_generate_password() );\n\t\t $user_id = wp_insert_user( $userdata );\n\t\t }\n\n\t\t if($user_id){\n\n\t\t (get_user_meta($user_id, 'first_name', true)!=''?update_user_meta($user_id, 'first_name', $user_fb_fn):add_user_meta($user_id, 'first_name', $user_fb_fn));\n\t\t \n\t\t (get_user_meta($user_id, 'last_name', true)!=''?update_user_meta($user_id, 'last_name', $user_fb_ln):add_user_meta($user_id, 'last_name', $user_fb_ln));\n\n\t\t wp_set_auth_cookie( $user_id );\n\t\t\t\t $dashboard_url = $this->get_template_url(\"customer-dashboard\");\n\t\t wp_redirect($dashboard_url);\n\t\t exit();\n\t\t }\n\n\n\t\t // Create a new user\n\t\t }\n\t\t\t}\n\t\t\treturn $helper;\n\t\t}", "function ht_bongda_01_facebook_js_sdk() {\n\tif ( ! is_singular( 'post' ) ) {\n\t\treturn;\n\t}\n\n\tif ( ot_get_option( 'fb_app_id' ) ) {\n\t\t?>\n\t\t<div id=\"fb-root\"></div>\n\t\t<script>(function(d, s, id) {\n\t\t var js, fjs = d.getElementsByTagName(s)[0];\n\t\t if (d.getElementById(id)) return;\n\t\t js = d.createElement(s); js.id = id;\n\t\t js.src = \"//connect.facebook.net/vi_VN/sdk.js#xfbml=1&version=v2.5&appId=<?php echo esc_js( ot_get_option( 'fb_app_id' ) ); ?>\";\n\t\t fjs.parentNode.insertBefore(js, fjs);\n\t\t}(document, 'script', 'facebook-jssdk'));</script>\n\t\t<?php\n\t}\n}", "public function loginWithFacebook() {\n\n\t\t// get data from input\n\t\t$code = Request::get( 'code' );\n\n\t\t// get fb service\n\t\t$fb = \\OAuth::consumer( 'Facebook' );\n\n\t\t$input = Request::all();\n\n\t\t$arr = $this->iplookup();\n\t\tif (isset($input)) {\n\t\t\tif (!Session::has('signup_params')) {\n\t\t\t\tSession::put('signup_params', $input);\n\t\t\t}\n\t\t\tif (!Cache::has(env('ENVIRONMENT') .'_'.'signup_params_'.$arr['ip'])) {\n\t\t\t\tCache::put(env('ENVIRONMENT') .'_'.'signup_params_'.$arr['ip'], $input, 5);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// check if code is valid\n\t\t// if code is provided get user data and sign in\n\t\tif ( !empty( $code ) ) {\n\n\t\t\t// This was a callback request from facebook, get the token\n\t\t\t$token = $fb->requestAccessToken( $code );\n\n\t\t\t// Send a request with it\n\t\t\t$result = json_decode( $fb->request( '/me?fields=id,name,email,first_name,last_name' ), true );\n\n\t\t\t$id = $result['id'];\n\t\t\tif ( isset($result['email'] )) {\n\t\t\t\t$email = $result['email'];\n\t\t\t} else {\n\t\t\t\t$email = 'none';\n\t\t\t}\n\t\t\t$first_name = $result['first_name'];\n\t\t\t$last_name = $result['last_name'];\n\t\t\t$rnd = str_random( 20 );\n\t\t\t$password = $rnd;\n\n\t\t\t//Check if id is in the database.\n\t\t\t$user = User::on('rds1')->where( 'fb_id', '=', $result['id'] );\n\n\t\t\tif ($email !== 'none') {\n\t\t\t\t$user = $user->orWhere('email', $email);\n\t\t\t}\n\n\t\t\t$user = $user->first();\n\n\t\t\tif ( $user ) {\n\t\t\t\t//Auth::login( $user );\n\t\t\t\tAuth::loginUsingId( $user->id, true );\n\t\t\t\t$this->setAjaxToken( Auth::user()->id );\n\t\t\t\tSession::put('userinfo.session_reset', 1);\n\n\t\t\t\t$data = $this->setSignedInUserData();\n\n\t\t\t\tif(Session::has('redirect')){\n\t\t\t\t\t$redirect = Session::get('redirect');\n\n\t\t\t\t\treturn redirect($redirect);\n\t\t\t\t}\n\n if( Session::has('redirect_from_signin') ){\n \t$redirect = Session::get('redirect_from_signin');\n \tif (substr($redirect, 0, 1) == '/') {\n \t\t$path = $redirect;\n \t}else{\n \t\t$path = '/'. $redirect;\n \t}\n Session::forget('redirect_from_signin');\n\n // Don't redirect here!!!! this was a bug.\n if ($path !== 'ajax/profile/getnotifications' && $path !== '/ajax/profile/getnotifications') {\n \treturn redirect($path);\n }\n }\n\n\t\t\t\tif (isset($data['is_organization']) && $data['is_organization'] == 1) {\n\t\t\t\t\treturn redirect()->intended( '/admin' );\n\t\t\t\t}\n\n\t\t\t\tif (isset($data['agency_collection'])) {\n\t\t\t\t\treturn redirect()->intended( '/agency' );\n\t\t\t\t}\n\n\t\t\t\tif( (isset($user->profile_percent) && $user->profile_percent < 30) ||\n\t\t\t\t\t(!isset($user->email) || empty($user->email) || $user->email == 'none') ){\n\t\t\t\t\t// return redirect()->intended('/social/one-app');\n\t\t\t\t\treturn redirect()->intended('/get_started');\n\t\t\t\t}\n\n\t\t\t\treturn redirect( '/home' );\n\t\t\t} else {\n\t\t\t\t$user = new User;\n\t\t\t\t$user->fb_id = $result['id'];\n\t\t\t\t$user->fname = $result['first_name'];\n\t\t\t\t$user->lname = $result['last_name'];\n\t\t\t\t$user->email = $email;\n\t\t\t\t$user->password = Hash::make( $password );\n\t\t\t\t$user->email_confirmed = 1;\n \n $ip_lookup = $this->iplookup();\n\n\t\t\t\tif (Session::has('signup_params')) {\n\t\t\t\t\t$signup_params = Session::get('signup_params');\n\t\t\t\t\t\n\t\t\t\t\t$user->utm_source = isset($signup_params['utm_source']) ? $signup_params['utm_source'] : '';\n\t\t\t\t\t$user->utm_medium = isset($signup_params['utm_medium']) ? $signup_params['utm_medium'] : '';\n\t\t\t\t\t$user->utm_content = isset($signup_params['utm_content']) ? $signup_params['utm_content'] : '';\n\t\t\t\t\t$user->utm_campaign = isset($signup_params['utm_campaign']) ? $signup_params['utm_campaign'] : '';\n\t\t\t\t\t$user->utm_term = isset($signup_params['utm_term']) ? $signup_params['utm_term'] : '';\n\t\t\t\t\n\t\t\t\t}elseif(Cache::has(env('ENVIRONMENT') .'_'.'signup_params_'.$arr['ip'])){\n\t\t\t\t\t$signup_params = Cache::get(env('ENVIRONMENT') .'_'.'signup_params_'.$arr['ip']);\n\t\t\t\t\t\n\t\t\t\t\t$user->utm_source = isset($signup_params['utm_source']) ? $signup_params['utm_source'] : '';\n\t\t\t\t\t$user->utm_medium = isset($signup_params['utm_medium']) ? $signup_params['utm_medium'] : '';\n\t\t\t\t\t$user->utm_content = isset($signup_params['utm_content']) ? $signup_params['utm_content'] : '';\n\t\t\t\t\t$user->utm_campaign = isset($signup_params['utm_campaign']) ? $signup_params['utm_campaign'] : '';\n\t\t\t\t\t$user->utm_term = isset($signup_params['utm_term']) ? $signup_params['utm_term'] : '';\n\n\t\t\t\t\tCache::forget(env('ENVIRONMENT') .'_'.'signup_params_'.$arr['ip']);\n\t\t\t\t}\t\t\n\n\t\t\t\t$arr = $this->iplookup();\n\n\t\t\t\tif (isset($arr['countryName'])) {\n\t\t\t\t\t$countries = Country::where('country_name', $arr['countryName'])->first();\n\t\t\t\t\tif (isset($countries)) {\n\t\t\t\t\t \t$user->country_id = $countries->id;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$user->save();\n\t\t\t\t$confirmation = str_random( 20 );\n\t\t\t\t$token = new ConfirmToken( array( 'token' => $confirmation ) );\n\t\t\t\t$user->confirmtoken()->save( $token );\n\n\t\t\t\t\n\t\t\t\t/************MAILCHIMP WELCOME EMAIL ***********/\n\n\t\t\t\t// if (isset($result['email'])) {\n\n\t\t\t\t// \t$dt = array();\n\t\t\t\t// \t$dt['email'] = $result['email'];\n\t\t\t\t// \t$dt['fname'] = $result['first_name'];\n\t\t\t\t// \t$dt['lname'] = $result['last_name'];\n\n\t\t\t\t// \t$this->integrateMailChimp($dt);\n\t\t\t\t// }\n\t\t\t\t/************END OF MAILCHIMP WELCOME EMAIL*****/\n\n\t\t\t\tAuth::loginUsingId( $user->id, true );\n\t\t\t\t$this->setAjaxToken( Auth::user()->id );\n\t\t\t\tSession::put('userinfo.session_reset', 1);\n\t\t\t\t\n\t\t\t\t$data = $this->setSignedInUserData();\n\n\t\t\t\tif(Session::has('redirect') || Cache::has('AuthController_redirect_'. $arr['ip'])){\n\t\t\t\t\t\n\t\t\t\t\tif (Cache::has('AuthController_redirect_'. $arr['ip'])) {\n\t\t\t\t\t\t$redirect = Cache::get('AuthController_redirect_'. $arr['ip']);\n\t\t\t\t\t\tCache::forget('AuthController_redirect_'. $arr['ip']);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$redirect = Session::get('redirect');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn redirect($redirect);\n\t\t\t\t}\n\n if( Session::has('redirect_from_signin') ){\n $path = '/'.Session::get('redirect_from_signin');\n Session::forget('redirect_from_signin');\n return redirect($path);\n }\n\n\t\t\t\tif (isset($data['is_organization']) && $data['is_organization'] == 1) {\n\t\t\t\t\treturn redirect()->intended( '/admin' );\n\t\t\t\t}\n\n\t\t\t\tif (isset($data['agency_collection'])) {\n\t\t\t\t\treturn redirect()->intended( '/agency' );\n\t\t\t\t}\n\n // if (isset($ip_lookup) && $ip_lookup['countryName'] == 'United States') {\n // return redirect()->intended( '/get_started' );\n // } else {\n // // return redirect()->intended( '/social/one-app' );\n // return redirect()->intended('/get_started');\n // }\n \n return redirect()->intended('/get_started');\n\t\t\t\t// $ucq = UsersCustomQuestion::on('rds1')->where('user_id', Auth::user()->id)->first();\n\n\t\t\t\t// if (isset($ucq)) {\n\t\t\t\t// \t$step = $ucq->application_state;\n\n\t\t\t\t// \tif (isset($step) && !empty($step) && $step == 'submit') {\n\t\t\t\t// \t\treturn redirect()->intended( '/portal/collegesrecruityou' );\n\t\t\t\t// \t}else if (isset($step) && !empty($step)) {\n\t\t\t\t// \t\treturn redirect()->intended( '/social/one-app/'.$step);\n\t\t\t\t// \t}else{\n\t\t\t\t// \t\treturn redirect()->intended( '/social/one-app/');\n\t\t\t\t// \t}\n\t\t\t\t// }\n\n\t\t\t\t// if( isset($user->profile_percent) && $user->profile_percent < 30 ||\n\t\t\t\t// \t(!isset($user->email) || empty($user->email) || $user->email == 'none') ){\n\t\t\t\t// \t// return redirect()->intended('/social/one-app');\n\t\t\t\t// \treturn redirect()->intended('/get_started');\n\t\t\t\t// }\n\t\t\t\t// if (isset($arr['countryAbbr']) && $arr['countryAbbr'] != 'US') {\n\t\t\t\t// \treturn redirect( '/international-students' );\n\t\t\t\t// }\n\t\t\t\t// return redirect( '/home' );\n\t\t\t}\n\t\t}\n\t\t// if not ask for permission first\n\t\telse {\n\t\t\t// get fb authorization\n\t\t\t$url = $fb->getAuthorizationUri();\n\n\t\t\t// return to facebook login url\n\t\t\treturn redirect( (string)$url );\n\t\t}\n\t}", "function log_In_Facebook_member(){\n\t\t\n\t\ttry {\n\t\t $accessToken = $this->helper->getAccessToken();\n\t\t} catch(Facebook\\Exceptions\\FacebookResponseException $e) {\n\t\t // When Graph returns an error\t\t \n\t\t throw new \\Exception('Graph returned an error: ' . $e->getMessage());\n\t\t exit;\n\t\t} catch(Facebook\\Exceptions\\FacebookSDKException $e) {\n\t\t // When validation fails or other local issues\t\t \n\t\t throw new \\Exception('Facebook SDK returned an error: ' . $e->getMessage());\n\t\t exit;\n\t\t}\n\t\t\n\t\t// If we were denied access by user, or fail to get access token, log error and return to\n\t\t// public base url\n\t\tif ( !isset($accessToken)) {\n\t\t \n\t\t\tif ($this->helper->getError()) {\n\t\t\t\theader('HTTP/1.0 401 Unauthorized');\n\t\t\t\terror_log(\"Error: \" . $this->helper->getError());\n\t\t\t\terror_log(\"Error Code: \" . $this->helper->getErrorCode());\n\t\t\t\terror_log(\"Error Reason: \" . $this->helper->getErrorReason());\n\t\t\t\terror_log(\"Error Description: \" . $this->helper->getErrorDescription());\n\t\t\t\theader('location: '. PUBLIC_LOGIN_URL);\t\t\t\n\t\t\t\texit;\n\t\t\t\n\t\t \t}else {\n\t\t\t\theader('HTTP/1.0 400 Bad Request');\n\t\t\t\terror_log(\"Facebook SDK returned HTTP/1.0 400 Bad Request.\\n\");\n\t\t\t\theader('location: '. PUBLIC_LOGIN_URL);\t\t\t\n\t\t\t\texit;\n\t\t \t}\n\t\t \t\t \n\t\t header('location: '. PUBLIC_LOGIN_URL);\n\t\t exit;\n\t\t}\t\t\t\t\t\t\t\n\t\t\n\t\t// The OAuth 2.0 client handler helps us manage access tokens\n\t\t$oAuth2Client = $this->fb->getOAuth2Client();\n\t\t\n\t\t// Get the access token metadata from /debug_token\n\t\t$tokenMetadata = $oAuth2Client->debugToken($accessToken);\t\t\t\n\t\t\n\t\ttry {\n\t\t// Validation (these will throw FacebookSDKException's when they fail)\n\t\t$tokenMetadata->validateAppId(FB_APP_ID);\t\t\t\t\t\t\n\t\t\n\t\t} catch(Facebook\\Exceptions\\FacebookSDKException $e) {\n\t\t\t// When validation fails or other local issues\n\t\t\terror_log('Facebook SDK returned an error: ' . $e->getMessage());\n\t\t\tthrow new \\Exception('Facebook SDK returned an error: ' . $e->getMessage());\n\t\t\texit;\n\t\t}\n\t\t\n\t\t// Lets validate that this user is a registered memebr\t\t\n\t\t$this->verify_User_By_Facebook_ID($accessToken);\n\t\t\t\n\t\t$tokenMetadata->validateExpiration();\n\t\t\n\t\tif (! $accessToken->isLongLived()) {\n\t\t // Exchanges a short-lived access token for a long-lived one\n\t\t try {\n\t\t\t\t$accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);\n\t\t } catch (Facebook\\Exceptions\\FacebookSDKException $e) {\n\t\t\t\terror_log('Error getting long-lived access token: ' . $this->helper->getMessage());\n\t\t\t\tthrow new \\Exception('Error getting long-lived access token: ' . $this->helper->getMessage());\n\t\t\t\texit;\n\t\t }\t\t\t\t \n\t\t}\n\t\t\n\t\t$_SESSION[FB_ACCESS_TOKEN] = (string) $accessToken;\n\t\t\n\t\t// User is logged in with a long-lived access token.\n\t\t// We can redirect them to a members-only page.\n\t\theader('location: '. MEMBERS_BASE_URL);\n\t\t\t\t\n\t}", "public function facebookCallback()\n\t{\n\t\ttry {\n\t\t\t$app_id = $this->config->item('facebook_app_id');\n\t\t\t$app_secret = $this->config->item('facebook_app_secret');\n\t\t\t$fb = new Facebook\\Facebook([\n\t\t\t\t'app_id' => $this->config->item('facebook_app_id'),\n\t\t\t\t'app_secret' => $this->config->item('facebook_app_secret'),\n\t\t\t\t'default_graph_version' => $this->config->item('facebook_graph_version'),\n\t\t\t\t'persistent_data_handler' => 'session'\n\t\t\t\t//'default_access_token' => $app_id.'|'.$app_secret\n\t\t\t]);\n\n\t\t\t$helper = $fb->getRedirectLoginHelper();\n\t\t\tif (isset($_GET['state'])) {\n\t\t\t\t$helper->getPersistentDataHandler()->set('state', $_GET['state']);\n\t\t\t}\n\t\t\t$accessToken = $helper->getAccessToken();\n\n\t\t\t$res = $this->curl_file_get_contents('https://graph.facebook.com/v2.6/oauth/access_token?grant_type=fb_exchange_token&client_id=' . $app_id . '&client_secret=' . $app_secret . '&fb_exchange_token=' . $accessToken . '');\n\t\t\t$res = json_decode($res);\n\t\t\t$long_live_access_token = $res->access_token;\n\t\t\t$response = $fb->get('/me?fields=id,name,email', $long_live_access_token);\n\n\t\t\t// User Information Retrival begins................................................\n\t\t\t$me = $response->getGraphUser();\n\n\t\t\t$insert['name'] = $me->getProperty('name');\n\t\t\t$insert['email'] = $me->getProperty('email');\n\t\t\t$insert['social_login_id'] = $me->getProperty('id');\n\t\t\t$insert['registration_type'] = 3;\n\t\t\t$insert['image'] = 'https://graph.facebook.com/' . $me->getProperty('id') . '/picture?type=large';\n\t\t\t$insert['long_live_token'] = $long_live_access_token;\n\t\t\t$this->save_user_info($insert);\n\t\t} catch (\\Exception $e) {\n\t\t\tredirect(base_url('login'));\n\t\t}\n\t}", "public function getFacebookApi() {\r\n\r\n // Create a new query object.\r\n $db = $this->getDbo();\r\n $query = $db->getQuery(true);\r\n\r\n // Select the required fields from the table.\r\n $query->select(\r\n $this->getState(\r\n 'list.select',\r\n 'a.*'\r\n )\r\n );\r\n $query->from('#__fb_settings AS a'); \r\n $db->setQuery($query);\r\n\r\n $result = $db->loadObjectList();\r\n\r\n return $result;\r\n }", "public function facebook(){\n }", "function getAccessToken();", "public function loginWithFacebook() {\n\n\t // get data from input\n\t $code = Input::get( 'code' );\n\n\t // get fb service\n\t $fb = OAuth::consumer( 'Facebook');\n\n\t // check if code is valid\n\n\t // if code is provided get user data and sign in\n\t if ( !empty( $code ) ) {\n\t // This was a callback request from facebook, get the token\n\t $token = $fb->requestAccessToken( $code );\n\n\t // Send a request with it\n\t $result = json_decode( $fb->request( '/me' ), true );\n\t Session::put('userDetails',$result);\n\t //Var_dump\n\t //display whole array().\n\t return Redirect::to(\"/\");\n\n\t }\n\t // if not ask for permission first\n\t else {\n\t // get fb authorization\n\t $url = $fb->getAuthorizationUri();\n\n\t // return to facebook login url\n\t return Redirect::to( (string)$url );\n\t }\n\n\t}", "function loginFacebook($facebookToken) {\n\t$fb = new Facebook\\Facebook([\n\t\t'app_id' => FACEBOOK_APP_ID,\n\t\t'app_secret' => FACEBOOK_APP_SECRET,\n\t\t'default_graph_version' => FACEBOOK_DEFAULT_GRAPH_VERSION,\n\t\t]);\n\n\ttry {\n\t\t// Returns a `Facebook\\FacebookResponse` object\n\t\t$response = $fb->get('/me?fields=id,name', $facebookToken);\n\t} catch(Facebook\\Exceptions\\FacebookResponseException $e) {\n\t\texit($e->getMessage());\n\t\theader(\"HTTP/1.1 403 Forbidden\");\n \t\texit;\n\t} catch(Facebook\\Exceptions\\FacebookSDKException $e) {\n\t\texit($e->getMessage());\n\t\theader(\"HTTP/1.1 403 Forbidden\");\n \t\texit;\n\t}\n\n\t$user = $response->getGraphUser();\n\n\t$username = \"FacebookUser\".$user[\"id\"];\n\n\t$results = getUser($username);\n\n\tif ($results == null) {\n\t\theader(\"HTTP/1.1 404 Not Found\");\n \t\texit;\n\t}\n\n\t$authID = password_hash(\"cookie-\".$username.AUTH_SALT, PASSWORD_DEFAULT);\n\n\tsetcookie('collegepartyauth[user]', $username, 0, '/');\n\tsetcookie('collegepartyauth[authID]', $authID, 0, '/');\n\n\treturn $results;\n}", "public function fbCallBack()\n\t{\n\t\t$data = [];\n\t\t$success = false;\n\n\t\t$fb = new \\Facebook\\Facebook([\n\t 'app_id' => '602369446588975', // Votre id est sur l'app fb dév\n\t 'app_secret' => 'dd68c176483e918625b46de16c01419e', // Votre secret est sur l'app fb dév\n\t 'default_graph_version' => 'v2.2',\n\t ]);\n\n\t $helper = $fb->getRedirectLoginHelper();\n\n\t try {\n\t $accessToken = $helper->getAccessToken();\n\t }\n\t catch(\\Facebook\\Exceptions\\FacebookResponseException $e) {\n\t // When Graph returns an error\n\t echo 'Graph returned an error: ' . $e->getMessage();\n\t exit;\n\t }\n\t catch(\\Facebook\\Exceptions\\FacebookSDKException $e) {\n\t // When validation fails or other local issues\n\t echo 'Facebook SDK returned an error: ' . $e->getMessage();\n\t exit;\n\t }\n\t if (!isset($accessToken)) {\n\t if ($helper->getError()) {\n\t header('HTTP/1.0 401 Unauthorized');\n\t echo \"Error: \" . $helper->getError() . \"\\n\";\n\t echo \"Error Code: \" . $helper->getErrorCode() . \"\\n\";\n\t echo \"Error Reason: \" . $helper->getErrorReason() . \"\\n\";\n\t echo \"Error Description: \" . $helper->getErrorDescription() . \"\\n\";\n\t }\n\t else {\n\t header('HTTP/1.0 400 Bad Request');\n\t echo 'Bad request';\n\t }\n\t exit;\n\t }\n\n\t // Logged in\n\t echo '<h3>Access Token</h3>';\n\t $accessToken->getValue();\n\n\n\t // The OAuth 2.0 client handler helps us manage access tokens\n\t $oAuth2Client = $fb->getOAuth2Client();\n\n\t // Get the access token metadata from /debug_token\n\t $tokenMetadata = $oAuth2Client->debugToken($accessToken);\n\t echo '<h3>Metadata</h3>';\n\n\t // Validation (these will throw FacebookSDKException's when they fail)\n\t $tokenMetadata->validateAppId('602369446588975'); // Replace {app-id} with your app id\n\t // If you know the user ID this access token belongs to, you can validate it here\n\t //$tokenMetadata->validateUserId('123');\n\t $tokenMetadata->validateExpiration();\n\n\t if(!$accessToken->isLongLived()) {\n\t\t\t// Exchanges a short-lived access token for a long-lived one\n\t\t\ttry {\n\t\t\t$accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);\n\t\t\t} catch (Facebook\\Exceptions\\FacebookSDKException $e) {\n\t\t\techo \"<p>Error getting long-lived access token: \" . $helper->getMessage() . \"</p>\\n\\n\";\n\t\t\texit;\n\t\t\t}\n\n\t\t\techo '<h3>Long-lived</h3>';\n\t\t\t$accessToken->getValue();\n\t\t\t}\n\n\t\t\t$_SESSION['fb_access_token'] = (string) $accessToken;\n\n\t\t// Pour récuperer l'user, l'accessToken est obligatoire\n\t\t$response = $fb->get('/me?fields=id,name,first_name,last_name,email,picture', $accessToken->getValue());\n\t\t$user = $response->getGraphUser();\n\t\t$usersModel = new UsersModel();\n\n\n\t if(isset($user['picture']) && !empty($user['picture'])){\n\n\t \t$userPic = json_decode($user['picture']);\n\t \t$picture = $userPic->url;\n\t }\n\t else {\n\t \t$picture = ''; // Avatar par défaut\n\t }\n\n\t $stringUtils = new StringUtils();\n\t $authModel = new AuthModel();\n\t $passwordPlain = $stringUtils->randomString(10);\n\t $passwordHash = $authModel->hashPassword($passwordPlain);\n\n\t if(!empty($user)){\n\t \t$data = [\n\t \t\t'username' \t\t=> $user['name'],\n\t \t\t'firstname' \t=> $user['first_name'],\n\t \t\t'lastname' \t\t=> $user['last_name'],\n\t \t\t'email' \t\t=> $user['email'],\n\t \t\t'password'\t\t=> $passwordHash,\n\t \t\t'avatar'\t\t=> $picture,\n\t \t\t'id_facebook'\t=> $user['id'],\n\t \t\t'activation' \t=> 'true',\n\t \t];\n\t\t}\n\n\t\t$newUser = $usersModel->insert($data);\n\t\tif($newUser){\n\t \t\t$success = true;\n\t \t\t// Ici on envoi l'email avec le mot de passe $passwordPlain\n\n\t\t\t$mail = new PHPMailer;\n\t\t\t//$mail->SMTPDebug = 3; // Enable verbose debug output\n\t\t\t$mail->isSMTP(); // Set mailer to use SMTP\n\t\t\t$mail->Host = 'mailtrap.io';\t\t\t\t\t // Specify main and backup SMTP servers\n\t\t\t$mail->SMTPAuth = true; // Enable SMTP authentication\n\t\t\t$mail->Username = 'f12564c2d967d2'; // SMTP username\n\t\t\t$mail->Password = 'f693c45ea37fa0'; // SMTP password\n\t\t\t$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted\n\t\t\t$mail->Port = 465; // TCP port to connect to\n\n\t\t\t$mail->setFrom('[email protected]');\n\t\t\t$mail->addAddress($data['email'], $data['username']); // Name is optional\n\t\t\t//$mail->addReplyTo('[email protected]', 'Information');\n\n\t\t\t$mail->isHTML(true); // Set email format to HTML\n\n\t\t\t$mail->Subject = 'Valider votre compte lemonade';\n\t\t\t$mail->Body = 'Bonjour' .$data['username'].' voici votre mot de passe de connexion '.$passwordPlain;\n\t\t\t$mail->AltBody = 'Bonjour' .$data['username'].' voici votre mot de passe de connexion '.$passwordPlain;\n\n\t\t\tif(!$mail->send()) {\n\t\t\t\t\techo 'Message could not be sent.';\n\t\t\t\t\techo 'Mailer Error: ' . $mail->ErrorInfo;\n\t\t\t} else {\n\t\t\t\t\t//echo 'Message has been sent';\n\t\t\t}\n\n\n\t \t\t// Ici on connecte l'utilisateur puis on redirige\n\t \t\t$authModel->logUserIn($newUser); // Connecte l'utilisateur\n\t \t\t$this->redirectToRoute('default_home'); // Le redirige\n\t \t}\n\t \telse {\n\t \t\techo $errors[] = 'erreur lors de la création du profil';\n\t \t}\n\n\t // User is logged in with a long-lived access token.\n\t // You can redirect them to a members-only page.\n\t //header('Location: https://example.com/members.php');\n\t}" ]
[ "0.660897", "0.65814966", "0.6500188", "0.6488511", "0.64817065", "0.64335096", "0.63490075", "0.624863", "0.6231932", "0.5980684", "0.5954723", "0.5954609", "0.59538287", "0.5928662", "0.5852683", "0.5845283", "0.5838004", "0.5816454", "0.58066165", "0.57933176", "0.57805336", "0.5766438", "0.56840086", "0.5663171", "0.5659646", "0.5627733", "0.5612632", "0.5607666", "0.56055737", "0.5562592" ]
0.71580285
0
/ Creates the Facebook notification array and the content in the notification Input: String for the facebook notification message, String for link to the notification app link Output: Notification array that will be put in the facebook POST api call
function createNotification($notificationMessage, $notificationAppLink){ $notificationArray = array( 'href' => $notificationAppLink, 'template' => $notificationMessage ); return $notificationArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendNotification($recipientFbid, $text, $url, $app_id, $app_secret) {\n $href = urlencode($url);\n $post_data = \"access_token=\". $app_id . \"|\" . $app_secret .\"&template={$text}&href={$href}\";\necho $post_data;\n $curl = curl_init(); \necho \"https://graph.facebook.com/v2.5/\". $recipientFbid .\"/notifications\";\n curl_setopt($curl, CURLOPT_URL, \"https://graph.facebook.com/v2.5/\". $recipientFbid .\"/notifications\"); \n curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data); \n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); \n $data = curl_exec($curl); \n curl_close($curl); \n\n return $data;\n}", "function doNotification($fb_id, $token, $template, $hrf = '')\n{\n $attachment = array(\n 'access_token' => $token,\n 'href' => $hrf,\n 'template' => $template,\n );\n//\t$fb_id = \"me\";\n//\tpre($attachment, $fb_id) ;\n $ch = curl_init();\n \n curl_setopt($ch, CURLOPT_URL, 'https://graph.facebook.com/'. $fb_id .'/notifications');\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); //to suppress the curl output\n\tob_start();\n $data = curl_exec($ch);\n//\techo $data;\n\t$str = ob_get_clean();\n curl_close($ch);\n return $str;\n}", "public static function sendNotificationFb($title, $data, $tokenFB = null) {\n\n $notification = [\n 'title' => $title, // works fine here\n 'body' => $data['descriptionNotification'],\n 'sound' => 'default',\n 'vibrate' => 'default',\n ];\n\n if ($tokenFB != null) {\n $param = [\n \"to\" => $tokenFB,\n \"notification\" => $notification,\n \"data\" => $data,\n ];\n } else {\n $param = [\n \"to\" => \"/topics/all\",\n \"notification\" => $notification,\n \"data\" => $data,\n ];\n }\n\n\n\n\n $headers = [\n 'Authorization: key='.env('API_ACCESS_KEY', ''),\n 'Content-Type: application/json',\n ];\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send');\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($param));\n $result = curl_exec($ch);\n\n\n curl_close($ch);\n\n }", "public function push_notification($input_params = array())\n {\n\n $this->block_result = array();\n try\n {\n\n $device_id = $input_params[\"u_device_token\"];\n $code = \"USER\";\n $sound = \"\";\n $badge = \"\";\n $title = \"\";\n $send_vars = array(\n array(\n \"key\" => \"type\",\n \"value\" =>\"favorite\",\n \"send\" => \"Yes\",\n ),\n array(\n \"key\" => \"user_id\",\n \"value\" => $input_params[\"user_id\"],\n \"send\" => \"Yes\",\n )\n );\n $push_msg = \"\".$input_params[\"user_name\"].\" favorite your business.\";\n $push_msg = $this->general->getReplacedInputParams($push_msg, $input_params);\n $send_mode = \"runtime\";\n\n $send_arr = array();\n $send_arr['device_id'] = $device_id;\n $send_arr['code'] = $code;\n $send_arr['sound'] = $sound;\n $send_arr['badge'] = intval($badge);\n $send_arr['title'] = $title;\n $send_arr['message'] = $push_msg;\n $send_arr['variables'] = json_encode($send_vars);\n $send_arr['send_mode'] = $send_mode;\n $uni_id = $this->general->insertPushNotification($send_arr);\n if (!$uni_id)\n {\n throw new Exception('Failure in insertion of push notification batch entry.');\n }\n\n $success = 1;\n $message = \"Push notification send succesfully.\";\n }\n catch(Exception $e)\n {\n $success = 0;\n $message = $e->getMessage();\n }\n $this->block_result[\"success\"] = $success;\n $this->block_result[\"message\"] = $message;\n $input_params[\"push_notification\"] = $this->block_result[\"success\"];\n\n return $input_params;\n }", "public function personalEventNotification($eventArr, $post_data) {\n $CI = & get_instance();\n $CI->load->model('Common_model');\n try {\n $promises = array();\n $insert_data = array();\n $i = 0;\n foreach ($eventArr as $row => $val) {\n $insert_data['title'] = isset($val['title']) ? $val['title'] : \"\";\n $insert_data['sender_id'] = isset($post_data['sender']) ? $post_data['sender'] : \"\";\n $insert_data['message'] = \"You have an event \" . ucfirst($val[\"title\"]) . \" at \" . date(\"H:i A\", strtotime($val[\"event_time\"])) . \" today\";\n $insert_data['receive_id'] = isset($val['id']) ? $val['id'] : \"\";\n $insert_data['device_type'] = isset($val['device_type']) ? $val['device_type'] : \"\";\n $insert_data['type'] = isset($post_data['type']) ? $post_data['type'] : \"\";\n $insert_data['type_id'] = isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\";\n $insert_data['category'] = isset($val[\"type\"]) ? $val[\"type\"] : \"\";\n $insert_data['created_date'] = date('Y-m-d H:i:s');\n $id = $CI->Common_model->insert_single('budfie_notifications', $insert_data);\n \n $notificationCount = $this->getBadgeCount($val['id']);\n $message = [\n \"default\" => isset($val[\"title\"]) ? $val[\"title\"] : \"\",\n \"APNS\" => json_encode([\n \"aps\" => [\n \"alert\" => array(\n \"title\" => \"\",\n \"body\" => \"You have an event \" . ucfirst($val[\"title\"]) . \" at \" . date(\"H:i A\", strtotime($val[\"event_time\"])) . \" today\",\n \"subtitle\" => \"\"\n ),\n \"sound\" => \"default\",\n \"mutable-content\" => 1,\n \"category\" => \"budfieIcon\",\n \"badge\" => (int) $notificationCount,\n \"data\" => array(\n \"attachment_url\" => isset($val[\"rest_image\"]) ? $val[\"rest_image\"] : \"\",\n \"ext_link\" => $post_data[\"ext_link\"],\n \"url_title\" => $post_data[\"url_title\"],\n \"content_type\" => \"image\",\n \"type\" => $post_data[\"type\"],\n \"type_id\" => isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\",\n \"category\" => isset($val[\"type\"]) ? $val[\"type\"] : \"\"\n )\n ]\n ]),\n \"GCM\" => json_encode([\n \"data\" => [\"body\" => array(\n \"title\" => isset($val[\"title\"]) ? $val[\"title\"] : \"\",\n \"message\" => \"You have an event \" . ucfirst($val[\"title\"]) . \" at \" . date(\"H:i A\", strtotime($val[\"event_time\"])) . \" today\",\n \"type\" => $post_data[\"type\"],\n \"type_id\" => isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\",\n \"image\" => isset($val[\"rest_image\"]) ? $val[\"rest_image\"] : \"\",\n \"ext_link\" => $post_data[\"ext_link\"],\n \"url_title\" => $post_data[\"url_title\"],\n \"category\" => isset($val[\"type\"]) ? $val[\"type\"] : \"\"\n )]\n ])\n ];\n $promises[] = $this->sns->publishAsync([\n 'Message' => json_encode($message),\n 'MessageStructure' => 'json',\n 'TargetArn' => $val['device_arn']\n ]);\n// $insert_data[$i]['title'] = isset($val['title']) ? $val['title'] : \"\";\n// $insert_data[$i]['sender_id'] = isset($post_data['sender']) ? $post_data['sender'] : \"\";\n// $insert_data[$i]['message'] = \"You have an event \" . ucfirst($val[\"title\"]) . \" at \" . date(\"H:i A\", strtotime($val[\"event_time\"])) . \" today\";\n// $insert_data[$i]['receive_id'] = isset($val['id']) ? $val['id'] : \"\";\n// $insert_data[$i]['device_type'] = isset($val['device_type']) ? $val['device_type'] : \"\";\n// $insert_data[$i]['type'] = isset($post_data['type']) ? $post_data['type'] : \"\";\n// $insert_data[$i]['type_id'] = isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\";\n// $insert_data[$i]['category'] = isset($val[\"type\"]) ? $val[\"type\"] : \"\";\n// $insert_data[$i]['created_date'] = date('Y-m-d H:i:s');\n// $i++;\n }\n// $CI->Common_model->insert_batch('budfie_notifications', array(), $insert_data);\n $allPromise = \\GuzzleHttp\\Promise\\all($promises);\n $data_promise = $allPromise->wait();\n return [\n \"success\" => true,\n \"message\" => \"OK\",\n \"result\" => $data_promise\n ];\n } catch (\\Exception $error) {\n // file_put_contents(getcwd() . \"/application/sns_log/error.txt\", $error);\n return [\n \"success\" => false,\n \"message\" => \"error\"\n ];\n }\n }", "public function notification($token, $body)\n {\n $fcmUrl = 'https://fcm.googleapis.com/fcm/send';\n $headers = [\n 'Authorization: key=AIzaSyCN7c7kBuH5sDAyaVVPKONAVGnkKx273jw',\n 'Content-Type: application/json'\n ];\n\n $notification = [\n 'title' => $body['title'],\n 'body' => $body['body'],\n 'color' => '#009cff',\n 'priority' => 'high',\n 'icon' => 'ic_launcher',\n 'show_in_foreground' => true,\n 'show_in_background' => true,\n ];\n\n // array_push($notification, ['notification' => $notification]);\n $fcmNotification = [\n 'registration_ids' => $token,\n // 'data' => $notification,\n 'notification' => $notification\n ];\n // array_push($fcmNotification, $notification);\n\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,$fcmUrl);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fcmNotification));\n $result = curl_exec($ch);\n curl_close($ch);\n\n return true;\n }", "function sendNotification($tokensArray, $msg, $notificationUrl, $key, $id) {\n define('API_ACCESS_KEY', 'AIzaSyB7lbQ6Wc8FqEg4MVM12uPK15DuavsA27o');\n\n // notification fields\n $fields = json_encode(\n array(\n 'registration_ids' => $tokensArray,\n 'priority' => 10,\n 'data' => array(\n 'url' => $notificationUrl,\n 'body' => $msg,\n )\n )\n );\n\n $headers = array(\n 'Authorization: key=' . API_ACCESS_KEY,\n 'Content-Type: application/json'\n );\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send');\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);\n $result = curl_exec($ch);\n curl_close($ch);\n\n // Insert to the db\n $date = date('d/m/y h:i:s');\n\n $queryRes=mysqli_query(\"INSERT INTO `notification` (`msg`, `key`, `rideID`, `date`)\n VALUES ('\".$msg.\"', '\".$key.\"', '\".$id.\"', '\".$date.\"')\");\n}", "public function birthdayNotification($user_data, $post_data) {\n $CI = & get_instance();\n $CI->load->model('Common_model');\n try {\n $promises = array();\n $insert_data = array();\n // $i = 0;\n foreach ($user_data as $row => $val) {\n \n $insert_data['title'] = isset($post_data['title']) ? $post_data['title'] : \"\";\n $insert_data['sender_id'] = isset($post_data['sender']) ? $post_data['sender'] : \"\";\n $insert_data['message'] = $val['first_name'] . \" has their birthday today. Please click to share a special wish with them\";\n $insert_data['receive_id'] = isset($val['id']) ? $val['id'] : \"\";\n $insert_data['device_type'] = isset($val['device_type']) ? $val['device_type'] : \"\";\n $insert_data['type'] = isset($post_data['type']) ? $post_data['type'] : \"\";\n $insert_data['type_id'] = isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\";\n $insert_data['category'] = isset($val[\"type\"]) ? $val[\"type\"] : \"\";\n $insert_data['created_date'] = date('Y-m-d H:i:s');\n $id = $CI->Common_model->insert_single('budfie_notifications', $insert_data);\n \n $notificationCount = $this->getBadgeCount($val['id']);\n $message = [\n \"default\" => isset($post_data[\"title\"]) ? $post_data[\"title\"] : \"\",\n \"APNS\" => json_encode([\n \"aps\" => [\n \"alert\" => array(\n \"title\" => \"\",\n \"body\" => $val['first_name'] . \" has their birthday today. Please click to share a special wish with them\",\n \"subtitle\" => \"\"\n ),\n \"sound\" => \"default\",\n \"mutable-content\" => 1,\n \"category\" => \"budfieIcon\",\n \"badge\" => (int) $notificationCount,\n \"data\" => array(\n \"attachment_url\" => isset($val[\"rest_image\"]) ? $val[\"rest_image\"] : \"\",\n \"ext_link\" => $post_data[\"ext_link\"],\n \"url_title\" => $post_data[\"url_title\"],\n \"content_type\" => \"image\",\n \"type\" => $post_data[\"type\"],\n \"type_id\" => isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\",\n \"category\" => isset($val[\"type\"]) ? $val[\"type\"] : \"\"\n )\n ]\n ]),\n \"GCM\" => json_encode([\n \"data\" => [\"body\" => array(\n \"title\" => isset($post_data[\"title\"]) ? $post_data[\"title\"] : \"\",\n \"message\" => $val['first_name'] . \" has their birthday today. Please click to share a special wish with them\",\n \"type\" => $post_data[\"type\"],\n \"type_id\" => isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\",\n \"image\" => isset($val[\"rest_image\"]) ? $val[\"rest_image\"] : \"\",\n \"ext_link\" => $post_data[\"ext_link\"],\n \"url_title\" => $post_data[\"url_title\"],\n \"category\" => isset($val[\"type\"]) ? $val[\"type\"] : \"\"\n )]\n ])\n ];\n $promises[] = $this->sns->publishAsync([\n 'Message' => json_encode($message),\n 'MessageStructure' => 'json',\n 'TargetArn' => $val['device_arn']\n ]);\n// $insert_data[$i]['title'] = isset($post_data['title']) ? $post_data['title'] : \"\";\n// $insert_data[$i]['sender_id'] = isset($post_data['sender']) ? $post_data['sender'] : \"\";\n// $insert_data[$i]['message'] = $val['first_name'] . \" has their birthday today. Please click to share a special wish with them\";\n// $insert_data[$i]['receive_id'] = isset($val['id']) ? $val['id'] : \"\";\n// $insert_data[$i]['device_type'] = isset($val['device_type']) ? $val['device_type'] : \"\";\n// $insert_data[$i]['type'] = isset($post_data['type']) ? $post_data['type'] : \"\";\n// $insert_data[$i]['type_id'] = isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\";\n// $insert_data[$i]['category'] = isset($val[\"type\"]) ? $val[\"type\"] : \"\";\n// $insert_data[$i]['created_date'] = date('Y-m-d H:i:s');\n// $i++;\n }\n// $CI->Common_model->insert_batch('budfie_notifications', array(), $insert_data);\n $allPromise = \\GuzzleHttp\\Promise\\all($promises);\n $data_promise = $allPromise->wait();\n return [\n \"success\" => true,\n \"message\" => \"OK\",\n \"result\" => $data_promise\n ];\n } catch (\\Exception $error) {\n // file_put_contents(getcwd() . \"/application/sns_log/error.txt\", $error);\n return [\n \"success\" => false,\n \"message\" => \"error\"\n ];\n }\n }", "public function eventNotification($eventArr, $post_data) {\n $CI = & get_instance();\n $CI->load->model('Common_model');\n try {\n $promises = array();\n $insert_data = array();\n $i = 0;\n foreach ($eventArr as $row => $val) {\n \n $insert_data['title'] = isset($val['title']) ? $val['title'] : \"\";\n $insert_data['sender_id'] = isset($post_data['sender']) ? $post_data['sender'] : \"\";\n $insert_data['message'] = isset($post_data['message']) ? $post_data['message'] : \"\";\n $insert_data['receive_id'] = isset($val['id']) ? $val['id'] : \"\";\n $insert_data['device_type'] = isset($val['device_type']) ? $val['device_type'] : \"\";\n $insert_data['type'] = isset($post_data['type']) ? $post_data['type'] : \"\";\n $insert_data['type_id'] = isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\";\n $insert_data['category'] = isset($val[\"type\"]) ? $val[\"type\"] : \"\";\n $insert_data['created_date'] = date('Y-m-d H:i:s');\n $id = $CI->Common_model->insert_single('budfie_notifications', $insert_data);\n \n $notificationCount = $this->getBadgeCount($val['id']);\n $message = [\n \"default\" => isset($val[\"title\"]) ? $val[\"title\"] : \"\",\n \"APNS\" => json_encode([\n \"aps\" => [\n \"alert\" => array(\n \"title\" => \"\",\n \"body\" => $post_data[\"message\"],\n \"subtitle\" => \"\"\n ),\n \"sound\" => \"default\",\n \"mutable-content\" => 1,\n \"category\" => \"budfieIcon\",\n \"badge\" => (int) $notificationCount,\n \"data\" => array(\n \"attachment_url\" => isset($val[\"rest_image\"]) ? $val[\"rest_image\"] : \"\",\n \"ext_link\" => $post_data[\"ext_link\"],\n \"url_title\" => $post_data[\"url_title\"],\n \"content_type\" => \"image\",\n \"type\" => $post_data[\"type\"],\n \"type_id\" => isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\",\n \"category\" => isset($val[\"type\"]) ? $val[\"type\"] : \"\"\n )\n ]\n ]),\n \"GCM\" => json_encode([\n \"data\" => [\"body\" => array(\n \"title\" => isset($val[\"title\"]) ? $val[\"title\"] : \"\",\n \"message\" => $post_data[\"message\"],\n \"type\" => $post_data[\"type\"],\n \"type_id\" => isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\",\n \"image\" => isset($val[\"rest_image\"]) ? $val[\"rest_image\"] : \"\",\n \"ext_link\" => $post_data[\"ext_link\"],\n \"url_title\" => $post_data[\"url_title\"],\n \"category\" => isset($val[\"type\"]) ? $val[\"type\"] : \"\"\n )]\n ])\n ];\n $promises[] = $this->sns->publishAsync([\n 'Message' => json_encode($message),\n 'MessageStructure' => 'json',\n 'TargetArn' => $val['device_arn']\n ]);\n// $insert_data[$i]['title'] = isset($val['title']) ? $val['title'] : \"\";\n// $insert_data[$i]['sender_id'] = isset($post_data['sender']) ? $post_data['sender'] : \"\";\n// $insert_data[$i]['message'] = isset($post_data['message']) ? $post_data['message'] : \"\";\n// $insert_data[$i]['receive_id'] = isset($val['id']) ? $val['id'] : \"\";\n// $insert_data[$i]['device_type'] = isset($val['device_type']) ? $val['device_type'] : \"\";\n// $insert_data[$i]['type'] = isset($post_data['type']) ? $post_data['type'] : \"\";\n// $insert_data[$i]['type_id'] = isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\";\n// $insert_data[$i]['category'] = isset($val[\"type\"]) ? $val[\"type\"] : \"\";\n// $insert_data[$i]['created_date'] = date('Y-m-d H:i:s');\n// $i++;\n }\n// $CI->Common_model->insert_batch('budfie_notifications', array(), $insert_data);\n $allPromise = \\GuzzleHttp\\Promise\\all($promises);\n $data_promise = $allPromise->wait();\n return [\n \"success\" => true,\n \"message\" => \"OK\",\n \"result\" => $data_promise\n ];\n } catch (\\Exception $error) {\n // file_put_contents(getcwd() . \"/application/sns_log/error.txt\", $error);\n return [\n \"success\" => false,\n \"message\" => \"error\"\n ];\n }\n }", "function appleapn($deviceToken,$msg,$surl,$studentId,$imType,$type){\n \n $ch = curl_init(\"https://fcm.googleapis.com/fcm/send\");\n\n //The device token.\n $token = $deviceToken; //token here \n\n //Title of the Notification.\n $title = $type;\n\n //Body of the Notification.\n $body = $msg;\n\n //Creating the notification array.\n $notification= array(\n 'badge' => +1,\n 'text' => $body,\n 'sound' => 'default',\n 'url' => $surl,\n 'sid' => $studentId,\n 'imType'=>$imType,\n 'type' =>$type\n );\n \n //This array contains, the token and the notification. The 'to' attribute stores the token.\n $arrayToSend = array('to' => $token, 'notification' => $notification,'priority'=>'high');\n\n //Generating JSON encoded string form the above array.\n $json = json_encode($arrayToSend);\n //Setup headers:\n $headers = array();\n $headers[] = 'Content-Type: application/json';\n $headers[] = 'Authorization: key=AAAAgLhClbE:APA91bHV9pJhXyAm6pOYwMj1cKPyePYDJA6fai07RTcUYs9FvKFYpRm12DnuLkWedHH5KjSwUY6XbHUIu1335o5E2Tsqa9BcHxATQ2JHXT8wJGBpLrMObbBK4rfYcxKob78VUq-j4ltIUc9hrbxFEmxe0HPi0qQZMg'; // key here\n\n //Setup curl, add headers and post parameters.\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n curl_setopt($ch, CURLOPT_POSTFIELDS, $json);\n curl_setopt($ch, CURLOPT_HTTPHEADER,$headers); \n\n //Send the request\n $response = curl_exec($ch);\n\n //Close request\n curl_close($ch);\n \n \n $message=$msg;\n $value['errorCode']=0;\n $value['msg']=\"Success\";\n \n\n if (!$response){\n $value['errorCode']=1;\n $value['msg']='Message not delivered'; \n } \n else{\n $value['errorCode']=0;\n $value['msg']='Message successfully delivered';\n }\n \n\n return $value;\n exit();\n }", "function SendMessageNotificationsV4($job, &$log){\n\t$dbHandle = DbHandler::getConnection();\n\t$user_collection = $dbHandle->users;\n $user_args= json_decode ($job->workload(), true);\n $log[] = \"Received job: \" . $job->handle() . \"\\n\";\n\t$friendResource = new Friends();\n\t$notification = new Notifications();\n\t$users = new CreateUser();\n\t$search = new SearchUser();\n\t$poke_friends = array();\n\t$friends_uids = array();\n\t$name = $user_args['name'];\n\t$pFbids = $user_args['fbids'];\n\tforeach ($pFbids as $friend){\n\t\t$details = $search->getUserDetailsFromFBID($friend);\n \tarray_push ($poke_friends, \"\".$details['uid'].\"\");\n array_push ($friends_uids, intval ($details['uid']));\n }\n\t$device_tokens = $users->getDeviceTokens($friends_uids);\n\t$type = 5; //only push for insert message\n\t$message = $user_args['message'];\n\t$thread_id = $user_args['thread_id'];\n\t$log[] = \"passing thread id = \".$thread_id.\"\\n\";\n\t$args = array ('from_id' => $uid, 'message' => $message, 'type' => $type, 'is_read' => 0, 'created_on' => $created_on, 'thread_id' => $thread_id);\n\t$message = $name. \" left a new comment\";\n\t$result = $notification->insertNotification($args, $poke_friends, $device_tokens, $message, true);\n \tif ($result) {\n \t$log[] = \"Notifications successfully posted\";\n } else {\n \t$log[] = \"Error in posting notifications\";\n }\n\treturn;\n}", "function sendnotification($data){\n\tdefine( 'API_ACCESS_KEY', 'AIzaSyCIy28OWe_GZC13ZyXr-xGALTVEpE9EqTA' );\n\t\t///define( 'API_ACCESS_KEY', 'AIzaSyDgr1TrhnodAUEZ8ulrPrSE4QeCIsqFUyE' );\n\t\t///\tdefine( 'API_ACCESS_KEY', 'AIzaSyAiN4JsylIUOmrX_GzsXh_HQcXefaQTg9w' );\n\t\t\n\t\t\n\t\t$registrationIds = array( $data['push_notification_id'] );\n\t\t/// $data['msg_id'];\n\t\tswitch($data['msg_id'])\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t$mess=$this->generateTyp1Msg($data['event_id']);\n\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t $mess=$this->generateTyp2Msg($data['event_id']);\n\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t $mess= $this->generateTyp3Msg($data['event_id']);\n\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t $mess=$this->generateTyp4Msg($data['event_id']);\n\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t $mess=$this->generateTyp5Msg($event_id,$player_id_from,$player_id_to);\n\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t $mess=$this->generateTyp6Msg($event_id);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\n\t\techo $mess;\n\t\t\n\t\t// prep the bundle\n\t\t$msg = array\n\t\t(\n\t\t\t'alert' \t=> \"test test msg\",\t\t\t\n\t\t\t'vibrate'\t=> 1,\n\t\t\t'sound'\t\t=> 1,\n\t\t\t'largeIcon'\t=> 'large_icon',\n\t\t\t'smallIcon'\t=> 'small_icon'\n\t\t);\n\t\t\n\t\t$fields = array\n\t\t(\n\t\t\t'registration_ids' \t=> $registrationIds,\n\t\t\t'data'\t\t\t=> $msg\n\t\t);\n\t\t if(is_array($data)){\n\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t$fields['data'][$key] = $value;\n\t\t\t}\n\t\t}\n\t\t$headers = array\n\t\t(\n\t\t\t'Authorization: key=' . API_ACCESS_KEY,\n\t\t\t'Content-Type: application/json'\n\t\t);\n\t\t \n\t\t$ch = curl_init();\n\t\tcurl_setopt( $ch,CURLOPT_URL, 'https://android.googleapis.com/gcm/send' );\n\t\tcurl_setopt( $ch,CURLOPT_POST, true );\n\t\tcurl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );\n\t\tcurl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );\n\t\tcurl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );\n\t\tcurl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );\n\t\t$result = curl_exec($ch );\n\t\tcurl_close( $ch );\n\t\t\n\t\techo $result;\n\t\t$message = \"The message to send\";\n\t\t}", "public function notification_app_post() {\n $apikey = $this->input->post('apikey');\n $id = $this->input->post('id');\n\n if (isPostBack()) {\n $this->form_validation->set_rules('id', 'ID', 'trim|required|numeric');\n if ($this->form_validation->run()) {\n if ($apikey == APIKEY) {\n $notification_app = $this->Webapi_model->notification_app_list($id);\n pr($notification_app);\n\n $success = array('ErrorCode' => 0, \"message\" => \"Notification List\", 'data' => $notification_app);\n $this->response($success, 200);\n } else {\n $error = array('ErrorCode' => 1, 'message' => 'Api Key does not exist');\n $this->response($error, 200);\n }\n } else {\n $error = array('ErrorCode' => 1, 'message' => validation_errors());\n $this->response($error, 200);\n }\n } else {\n $error = array('ErrorCode' => 1, 'message' => 'Use Post Method Only');\n $this->response($error, 200);\n }\n }", "protected function create_notifications() {\n\t\t$u1_mentionname = bp_activity_get_user_mentionname( $this->u1 );\n\t\t$this->a1 = $this->factory->activity->create( array(\n\t\t\t'user_id' => $this->u2,\n\t\t\t'component' => buddypress()->activity->id,\n\t\t\t'type' => 'activity_update',\n\t\t\t'content' => sprintf( 'Hello! @%s', $u1_mentionname ),\n\t\t) );\n\t\t$u2_mentionname = bp_activity_get_user_mentionname( $this->u2 );\n\t\t$this->a2 = $this->factory->activity->create( array(\n\t\t\t'user_id' => $this->u1,\n\t\t\t'component' => buddypress()->activity->id,\n\t\t\t'type' => 'activity_update',\n\t\t\t'content' => sprintf( 'Hello! @%s', $u2_mentionname ),\n\t\t) );\n\t}", "public function create(array $notificationData)\n {\n $notificationData = array_merge($notificationData, [\n 'app_id' => $this->appIDKey,\n ]);\n $notificationData = $this->validateNotificationData(\n $notificationData,\n $this->getNotificationDataRules()\n );\n\n return $this->oneSignal->execute('notifications', 'POST', array_merge([\n 'headers' => [\n 'Content-Type' => 'application/json',\n ],\n 'json' => $notificationData,\n ], $this->extraOptions));\n }", "public function singleChatPush($arns, $post_data) {\n\n $CI = & get_instance();\n $CI->load->model('Common_model');\n try {\n $promises = array();\n $insert_data = array();\n if (isset($post_data['sender']) && !empty($post_data['sender'])) {\n $insert_data['title'] = $post_data['title'];\n $insert_data['sender_id'] = $post_data['sender'];\n $insert_data['message'] = isset($post_data['message']) ? $post_data['message'] : \"\";\n $insert_data['receive_id'] = $arns['id'];\n $insert_data['device_type'] = $arns['device_type'];\n $insert_data['type'] = $post_data['type'];\n $insert_data['type_id'] = $post_data['type_id'];\n $insert_data['category'] = isset($post_data[\"category\"]) ? $post_data[\"category\"] : \"\";\n $insert_data['created_date'] = date('Y-m-d H:i:s');\n\n $id = $CI->Common_model->insert_single('budfie_notifications', $insert_data);\n }\n $notificationCount = $this->getBadgeCount($arns['id']);\n $message = [\n \"default\" => $post_data[\"title\"],\n \"APNS\" => json_encode([\n \"aps\" => [\n \"alert\" => array(\n \"title\" => $post_data[\"title\"],\n \"body\" => $post_data[\"message\"],\n \"subtitle\" => \"\"\n ),\n \"sound\" => \"default\",\n \"mutable-content\" => 1,\n \"category\" => \"budfieIcon\",\n \"badge\" => (int) $notificationCount,\n \"data\" => array(\n \"attachment_url\" => $post_data[\"rest_image\"],\n \"message\" => $post_data[\"message\"],\n \"ext_link\" => $post_data[\"ext_link\"],\n \"url_title\" => $post_data[\"url_title\"],\n \"content_type\" => \"image\",\n \"type\" => $post_data[\"type\"],\n \"type_id\" => $post_data[\"type_id\"],\n \"category\" => isset($post_data[\"category\"]) ? $post_data[\"category\"] : \"\"\n )\n ]\n ]),\n \"GCM\" => json_encode([\n \"data\" => [\"body\" => array(\n \"title\" => $post_data[\"title\"],\n \"message\" => $post_data[\"message\"],\n \"type\" => $post_data[\"type\"],\n \"type_id\" => $post_data[\"type_id\"],\n \"image\" => $post_data[\"rest_image\"],\n \"ext_link\" => $post_data[\"ext_link\"],\n \"url_title\" => $post_data[\"url_title\"],\n \"category\" => isset($post_data[\"category\"]) ? $post_data[\"category\"] : \"\"\n )]\n ])\n ];\n $promises = $this->sns->publishAsync([\n 'Message' => json_encode($message),\n 'MessageStructure' => 'json',\n 'TargetArn' => $arns['device_arn']\n ]);\n// if (isset($post_data['sender']) && !empty($post_data['sender'])) {\n// $insert_data['title'] = $post_data['title'];\n// $insert_data['sender_id'] = $post_data['sender'];\n// $insert_data['message'] = isset($post_data['message']) ? $post_data['message'] : \"\";\n// $insert_data['receive_id'] = $arns['id'];\n// $insert_data['device_type'] = $arns['device_type'];\n// $insert_data['type'] = $post_data['type'];\n// $insert_data['type_id'] = $post_data['type_id'];\n// $insert_data['category'] = isset($post_data[\"category\"]) ? $post_data[\"category\"] : \"\";\n// $insert_data['created_date'] = date('Y-m-d H:i:s');\n//\n// $id = $CI->Common_model->insert_single('budfie_notifications', $insert_data);\n// }\n $allPromise = \\GuzzleHttp\\Promise\\all($promises);\n $data_promise = $allPromise->wait();\n return [\n \"success\" => true,\n \"message\" => \"OK\",\n \"result\" => $data_promise\n ];\n } catch (\\Exception $error) {\n\n return [\n \"success\" => false,\n \"message\" => \"error\"\n ];\n }\n }", "public function addNotification() {\n $insert = array(\n 'notification_to' => $this->input->get('notification_to'),\n 'notification_description' =>$this->input->get('notification_description'),\n 'notification_date' => $this->input->get('notification_date')\n );\n $this->model_db->create('manager_notifications', $insert);\n redirect('notifications', 'refresh'); \n }", "public function notification_entry($input_params = array())\n {\n\n $this->block_result = array();\n try\n {\n\n $params_arr = array();\n $params_arr[\"_vmessage\"] = \"'\".$input_params[\"user_name\"].\" favorite your Business'\";\n if (isset($input_params[\"b_user_id\"]))\n {\n $params_arr[\"b_user_id\"] = $input_params[\"b_user_id\"];\n }\n $params_arr[\"_enotificationtype\"] = 'favorite';\n $params_arr[\"_dtaddedat\"] = \"NOW()\";\n $params_arr[\"_estatus\"] = \"active\";\n if (isset($input_params[\"user_id\"]))\n {\n $params_arr[\"user_id\"] = $input_params[\"user_id\"];\n }\n $this->block_result = $this->Favorites_business_model->notification_entry($params_arr);\n }\n catch(Exception $e)\n {\n $success = 0;\n $this->block_result[\"data\"] = array();\n }\n $input_params[\"notification_entry\"] = $this->block_result[\"data\"];\n $input_params = $this->wsresponse->assignSingleRecord($input_params, $this->block_result[\"data\"]);\n\n return $input_params;\n }", "public function sportNotification($eventArr, $post_data) {\n $CI = & get_instance();\n $CI->load->model('Common_model');\n try {\n $promises = array();\n $insert_data = array();\n $i = 0;\n foreach ($eventArr as $row => $val) {\n $insert_data['title'] = isset($val['title']) ? $val['title'] : \"\";\n $insert_data['sender_id'] = isset($post_data['sender']) ? $post_data['sender'] : \"\";\n $insert_data['message'] = \"Let Nothing come between you and your match. \" . $val[\"title\"] . \" starting at \" . date(\"H:i A\", strtotime($val[\"match_time\"])) . \" today\";\n $insert_data['receive_id'] = isset($val['id']) ? $val['id'] : \"\";\n $insert_data['device_type'] = isset($val['device_type']) ? $val['device_type'] : \"\";\n $insert_data['type'] = isset($post_data['type']) ? $post_data['type'] : \"\";\n $insert_data['type_id'] = isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\";\n $insert_data['category'] = isset($val[\"type\"]) ? $val[\"type\"] : \"\";\n $insert_data['created_date'] = date('Y-m-d H:i:s');\n $id = $CI->Common_model->insert_single('budfie_notifications', $insert_data);\n \n $notificationCount = $this->getBadgeCount($val['id']);\n $message = [\n \"default\" => isset($val[\"title\"]) ? $val[\"title\"] : \"\",\n \"APNS\" => json_encode([\n \"aps\" => [\n \"alert\" => array(\n \"title\" => \"\",\n \"body\" => \"Let Nothing come between you and your match. \" . $val[\"title\"] . \" starting at \" . date(\"H:i A\", strtotime($val[\"match_time\"])) . \" today\",\n \"subtitle\" => \"\"\n ),\n \"sound\" => \"default\",\n \"mutable-content\" => 1,\n \"category\" => \"budfieIcon\",\n \"badge\" => (int) $notificationCount,\n \"data\" => array(\n \"attachment_url\" => isset($val[\"rest_image\"]) ? $val[\"rest_image\"] : \"\",\n \"ext_link\" => $post_data[\"ext_link\"],\n \"url_title\" => $post_data[\"url_title\"],\n \"content_type\" => \"image\",\n \"type\" => $post_data[\"type\"],\n \"type_id\" => isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\",\n \"category\" => isset($val[\"type\"]) ? $val[\"type\"] : \"\"\n )\n ]\n ]),\n \"GCM\" => json_encode([\n \"data\" => [\"body\" => array(\n \"title\" => isset($val[\"title\"]) ? $val[\"title\"] : \"\",\n \"message\" => \"Let Nothing come between you and your match. \" . $val[\"title\"] . \" starting at \" . date(\"H:i A\", strtotime($val[\"match_time\"])) . \" today\",\n \"type\" => $post_data[\"type\"],\n \"type_id\" => isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\",\n \"image\" => isset($val[\"rest_image\"]) ? $val[\"rest_image\"] : \"\",\n \"ext_link\" => $post_data[\"ext_link\"],\n \"url_title\" => $post_data[\"url_title\"],\n \"category\" => isset($val[\"type\"]) ? $val[\"type\"] : \"\"\n )]\n ])\n ];\n $promises[] = $this->sns->publishAsync([\n 'Message' => json_encode($message),\n 'MessageStructure' => 'json',\n 'TargetArn' => $val['device_arn']\n ]);\n// $insert_data[$i]['title'] = isset($val['title']) ? $val['title'] : \"\";\n// $insert_data[$i]['sender_id'] = isset($post_data['sender']) ? $post_data['sender'] : \"\";\n// $insert_data[$i]['message'] = \"Let Nothing come between you and your match. \" . $val[\"title\"] . \" starting at \" . date(\"H:i A\", strtotime($val[\"match_time\"])) . \" today\";\n// $insert_data[$i]['receive_id'] = isset($val['id']) ? $val['id'] : \"\";\n// $insert_data[$i]['device_type'] = isset($val['device_type']) ? $val['device_type'] : \"\";\n// $insert_data[$i]['type'] = isset($post_data['type']) ? $post_data['type'] : \"\";\n// $insert_data[$i]['type_id'] = isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\";\n// $insert_data[$i]['category'] = isset($val[\"type\"]) ? $val[\"type\"] : \"\";\n// $insert_data[$i]['created_date'] = date('Y-m-d H:i:s');\n// $i++;\n }\n// $CI->Common_model->insert_batch('budfie_notifications', array(), $insert_data);\n $allPromise = \\GuzzleHttp\\Promise\\all($promises);\n $data_promise = $allPromise->wait();\n return [\n \"success\" => true,\n \"message\" => \"OK\",\n \"result\" => $data_promise\n ];\n } catch (\\Exception $error) {\n // file_put_contents(getcwd() . \"/application/sns_log/error.txt\", $error);\n return [\n \"success\" => false,\n \"message\" => \"error\"\n ];\n }\n }", "function sendMessage($jsonData) {\n //API Url\n $url = 'https://graph.facebook.com/v2.6/me/messages?access_token=' . $GLOBALS['access_token'] ;\n\n//Initiate cURL.\n $ch = curl_init($url);\n //Encode the array into JSON.\n $jsonDataEncoded = json_encode($jsonData);\n// $jsonDataEncoded = $jsonData;\n//Tell cURL that we want to send a POST request.\n curl_setopt($ch, CURLOPT_POST, 1);\n\n//Attach our encoded JSON string to the POST fields.\n curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);\n\n//Set the content type to application/json\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n//Execute the request\n $result = curl_exec($ch);\n}", "function add_notification($users, $category, $message, $link){\n //$users=-1 for admin\n $data = array();\n if(!is_array($users)){\n $users = explode(',', $users);\n }\n foreach($users as $u){\n $data[] = array(\n 'time' => time(),\n 'user_id' => $u,\n 'category' => $category,\n 'message' => $message,\n 'link' => $link\n );\n }\n $this->db->insert_batch('finance_notifications', $data);\n }", "public function sendTextMessage(Request $request)\n {\n\n\n \n\n\n $messageText= $request->get('message');\n $Cid=$request->get('Cid');\n $id=$request->get('id');\n $debut=$request->get('debut'); \n $type=$request->get('type');\n $username=$request->get('username');\n\n $fin=date(\"Y-m-d H:i:s\", (strtotime(date($debut)) + $type*60));\n $fin=date(\"H:i\", strtotime(date($fin)));\n $debut=date(\"H:i\", strtotime(date($debut)));\n\n\n$jour=$request->get('jour');\n\n\n\n$addApp=new Appointment();\n$addApp->facebook=$username;\n$addApp->type_id=\"1\";\n$addApp->ActiveType=\"1\";\n$addApp->fb_id=$id;\n$addApp->jour=$jour;\n$addApp->debut=$debut;\n$addApp->fin=$fin;\n$addApp->client_id=$Cid;\n\n$addApp->save();\n$client=Client::find($Cid);\n\n\n\n\n$config=Config::get('app.url');\n\n\n\n $messageData = [\n \"recipient\" => [\n \"id\" => $id,\n ],\n \"message\"=>[\n \"attachment\"=>[\n \n \"type\"=>\"template\",\n \"payload\"=>[\n \"template_type\"=>\"button\",\n \"text\"=>$messageText,\n \"buttons\"=>[\n [\n \"type\"=>\"web_url\",\n \"url\"=>\"$config/client/$client->slug\",\n \"title\"=>\"تصفح مواعيدي\"\n ],\n \n \n ]\n ]\n ]\n ],\n ];\n $ch = curl_init('https://graph.facebook.com/v2.6/me/messages?access_token=' . env(\"FACEBOOK_TOKEN\"));\n // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n // curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($messageData));\n curl_exec($ch);\n curl_close($ch);\n\n }", "public function pushNotificationToAndroid()\n {\n // API access key from Google API's Console\n define( 'API_ACCESS_KEY', 'AIzaSyD1Y-YDMpsd2MQiBIdAUb5oZwrPJRLzqgQ' );\n $registrationIds = array('d_x2FYw-EhY:APA91bGKCP0yDS7wwfs_h5lFCBsjK6erjJfKYc7ignQXe3eSTQRqcKr9R_GC-FAcmFNs_3yU2ynILLUQbZR7izBO1SeoFkqioBE0OS9DE2pAMUG1s4RJDXVGl2oky0m6am5lYQ-7-6FZ');\n // prep the bundle\n $msg = array\n (\n 'message' => 'here is a message. message',\n 'title' => 'This is a title. title',\n 'subtitle' => 'This is a subtitle. subtitle',\n 'tickerText' => 'Ticker text here...Ticker text here...Ticker text here',\n 'vibrate' => 1,\n 'sound' => 1\n );\n $fields = array\n (\n 'registration_ids' => $registrationIds,\n 'data' => $msg\n );\n \n $headers = array\n (\n 'Authorization: key=' . API_ACCESS_KEY,\n 'Content-Type: application/json'\n );\n \n $ch = curl_init();\n curl_setopt( $ch,CURLOPT_URL, 'https://android.googleapis.com/gcm/send' );\n curl_setopt( $ch,CURLOPT_POST, true );\n curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );\n curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );\n curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );\n curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );\n $result = curl_exec($ch );\n curl_close( $ch );\n echo $result;\n }", "static function generateNotification($params)\n{\n $con =$params['dbconnection'];\t\n\t\n\t$query = \"INSERT INTO `notifications` SET \n\t`title`='{$params['title']}',\n\t`message`='{$params['message']}',\n\t`send_to`='{$params['send_to']}',\n\t`type`='8'\" ;\n\tmysqli_query($con,$query) ;\n\tif (mysqli_error($con) != '')\n\treturn \"mysql_Error:-\".mysqli_error($con);\n\t$id=mysqli_insert_id($con);\n\t$params['id']=$id;\n\tDbMethods::sendNotification($params);\n\treturn array(\"id\"=>(int)$id) ;\n}", "public function sportEndNotification($eventArr, $post_data) {\n $CI = & get_instance();\n $CI->load->model('Common_model');\n try {\n $promises = array();\n $insert_data = array();\n $i = 0;\n foreach ($eventArr as $row => $val) {\n $insert_data['title'] = isset($val['title']) ? $val['title'] : \"\";\n $insert_data['sender_id'] = isset($post_data['sender']) ? $post_data['sender'] : \"\";\n $insert_data['message'] = \"What a match it was. \" . $val[\"title\"];\n $insert_data['receive_id'] = isset($val['id']) ? $val['id'] : \"\";\n $insert_data['device_type'] = isset($val['device_type']) ? $val['device_type'] : \"\";\n $insert_data['type'] = isset($post_data['type']) ? $post_data['type'] : \"\";\n $insert_data['type_id'] = isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\";\n $insert_data['category'] = isset($val[\"type\"]) ? $val[\"type\"] : \"\";\n $insert_data['created_date'] = date('Y-m-d H:i:s');\n $id = $CI->Common_model->insert_single('budfie_notifications', $insert_data);\n \n $notificationCount = $this->getBadgeCount($val['id']);\n $message = [\n \"default\" => isset($val[\"title\"]) ? $val[\"title\"] : \"\",\n \"APNS\" => json_encode([\n \"aps\" => [\n \"alert\" => array(\n \"title\" => \"\",\n \"body\" => \"What a match it was. \" . $val[\"title\"],\n \"subtitle\" => \"\"\n ),\n \"sound\" => \"default\",\n \"mutable-content\" => 1,\n \"category\" => \"budfieIcon\",\n \"badge\" => (int) $notificationCount,\n \"data\" => array(\n \"attachment_url\" => isset($val[\"rest_image\"]) ? $val[\"rest_image\"] : \"\",\n \"ext_link\" => $post_data[\"ext_link\"],\n \"url_title\" => $post_data[\"url_title\"],\n \"content_type\" => \"image\",\n \"type\" => $post_data[\"type\"],\n \"type_id\" => isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\",\n \"category\" => isset($val[\"type\"]) ? $val[\"type\"] : \"\"\n )\n ]\n ]),\n \"GCM\" => json_encode([\n \"data\" => [\"body\" => array(\n \"title\" => isset($val[\"title\"]) ? $val[\"title\"] : \"\",\n \"message\" => \"What a match it was. \" . $val[\"title\"],\n \"type\" => $post_data[\"type\"],\n \"type_id\" => isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\",\n \"image\" => isset($val[\"rest_image\"]) ? $val[\"rest_image\"] : \"\",\n \"ext_link\" => $post_data[\"ext_link\"],\n \"url_title\" => $post_data[\"url_title\"],\n \"category\" => isset($val[\"type\"]) ? $val[\"type\"] : \"\"\n )]\n ])\n ];\n $promises[] = $this->sns->publishAsync([\n 'Message' => json_encode($message),\n 'MessageStructure' => 'json',\n 'TargetArn' => $val['device_arn']\n ]);\n// $insert_data[$i]['title'] = isset($val['title']) ? $val['title'] : \"\";\n// $insert_data[$i]['sender_id'] = isset($post_data['sender']) ? $post_data['sender'] : \"\";\n// $insert_data[$i]['message'] = \"What a match it was. \" . $val[\"title\"];\n// $insert_data[$i]['receive_id'] = isset($val['id']) ? $val['id'] : \"\";\n// $insert_data[$i]['device_type'] = isset($val['device_type']) ? $val['device_type'] : \"\";\n// $insert_data[$i]['type'] = isset($post_data['type']) ? $post_data['type'] : \"\";\n// $insert_data[$i]['type_id'] = isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\";\n// $insert_data[$i]['category'] = isset($val[\"type\"]) ? $val[\"type\"] : \"\";\n// $insert_data[$i]['created_date'] = date('Y-m-d H:i:s');\n// $i++;\n }\n// $CI->Common_model->insert_batch('budfie_notifications', array(), $insert_data);\n $allPromise = \\GuzzleHttp\\Promise\\all($promises);\n $data_promise = $allPromise->wait();\n return [\n \"success\" => true,\n \"message\" => \"OK\",\n \"result\" => $data_promise\n ];\n } catch (\\Exception $error) {\n // file_put_contents(getcwd() . \"/application/sns_log/error.txt\", $error);\n return [\n \"success\" => false,\n \"message\" => \"error\"\n ];\n }\n }", "function sendPushNotification($userId, $accessToken, $notificationArray){\n\t\t$facebook = $this->getFacebook();\n\t\t$sent = false;\n\t\ttry {\n\t\t\t$sendNotification = $facebook->post('/' . $userId . '/notifications', $notificationArray, $accessToken);\n\t\t\t$sent = true;\n\t\t}catch(Facebook\\Exceptions\\FacebookAuthenticationException $e) {\n\t\t\tprint 'FacebookAuthenticationException' . $e->getMessage();\n\t\t}\n\t\treturn $sent;\n\t}", "function send_notifications($device_token, $message, $userData = null)\n\t\t\t{\n\t\t\t\t$this->load->library('Apn');\n\t\t\t\t$this->apn->payloadMethod = 'enhance';\n\t\t\t\t// you can turn on this method for debuggin purpose\n\t\t\t\t$this->apn->connectToPush();\n\t\t\t\t// adding custom variables to the notification\n\t\t\t\t$this->apn->setData(array(\n\t\t\t\t\t'someKey' => true\n\t\t\t\t));\n\t\t\t\t// $send_result = $this->apn->sendMessage($device_token, $message, 2, 'default');\n\t\t\t\t$send_result = $this->apn->sendMessage($device_token, $message, 2, 'default', $ids = array(\n\t\t\t\t\t'message' \t\t\t=> $userData['message'],\n\t\t\t\t\t'title' \t\t\t=> $userData['title'],\n\t\t\t\t\t'appointmentTime' \t=> $userData['appointmentTime'],\n\t\t\t\t\t'appointmentDate' \t=> $userData['appointmentDate'],\n\t\t\t\t\t'vibrate' \t\t\t=> $userData['vibrate'],\n\t\t\t\t\t'sound' \t\t\t=> $userData['sound']\n\t\t\t\t));\n\t\t\t\tif ($send_result)\n\t\t\t\t\t{\n\t\t\t\t\t\tlog_message('debug', 'Sending successful');\n\t\t\t\t\t}\n\t\t\t\t else\n\t\t\t\t\t{\n\t\t\t\t\t\tprint_r('error' . $this->apn->error);\n\t\t\t\t\t\t$this->apn->disconnectPush();\n\t\t\t\t\t\tprint_r($send_result);\n\t\t\t\t\t}\n\t\t\t}", "public function groupChatPush($arns, $post_data) {\n $CI = & get_instance();\n $CI->load->model('Common_model');\n try {\n $promises = array();\n $insert_data = array();\n $i = 0;\n foreach ($arns as $row => $val) {\n $insert_data['title'] = $post_data['title'];\n $insert_data['sender_id'] = $post_data['sender'];\n $insert_data['message'] = isset($post_data['message']) ? $post_data['message'] : \"\";\n $insert_data['receive_id'] = $val['id'];\n $insert_data['device_type'] = $val['device_type'];\n $insert_data['type'] = $post_data['type'];\n $insert_data['type_id'] = $post_data['type_id'];\n $insert_data['category'] = isset($post_data[\"category\"]) ? $post_data[\"category\"] : \"\";\n $insert_data['created_date'] = date('Y-m-d H:i:s');\n $id = $CI->Common_model->insert_single('budfie_notifications', $insert_data);\n \n $notificationCount = $this->getBadgeCount($val['id']);\n $message = [\n \"default\" => $post_data[\"title\"],\n \"APNS\" => json_encode([\n \"aps\" => [\n \"alert\" => array(\n \"title\" => $post_data[\"title\"],\n \"body\" => $post_data[\"message\"],\n \"subtitle\" => \"\"\n ),\n \"sound\" => \"default\",\n \"mutable-content\" => 1,\n \"category\" => \"budfieIcon\",\n \"badge\" => (int) $notificationCount,\n \"data\" => array(\n \"attachment_url\" => $post_data[\"rest_image\"],\n \"message\" => $post_data[\"message\"],\n \"ext_link\" => $post_data[\"ext_link\"],\n \"url_title\" => $post_data[\"url_title\"],\n \"content_type\" => \"image\",\n \"type\" => $post_data[\"type\"],\n \"type_id\" => $post_data[\"type_id\"],\n \"category\" => isset($post_data[\"category\"]) ? $post_data[\"category\"] : \"\"\n )\n ]\n ]),\n \"GCM\" => json_encode([\n \"data\" => [\"body\" => array(\n \"title\" => $post_data[\"title\"],\n \"message\" => $post_data[\"message\"],\n \"type\" => $post_data[\"type\"],\n \"type_id\" => $post_data[\"type_id\"],\n \"image\" => $post_data[\"rest_image\"],\n \"ext_link\" => $post_data[\"ext_link\"],\n \"url_title\" => $post_data[\"url_title\"],\n \"category\" => isset($post_data[\"category\"]) ? $post_data[\"category\"] : \"\"\n )]\n ])\n ];\n $promises[] = $this->sns->publishAsync([\n 'Message' => json_encode($message),\n 'MessageStructure' => 'json',\n 'TargetArn' => $val['device_arn']\n ]);\n// $insert_data[$i]['title'] = $post_data['title'];\n// $insert_data[$i]['sender_id'] = $post_data['sender'];\n// $insert_data[$i]['message'] = isset($post_data['message']) ? $post_data['message'] : \"\";\n// $insert_data[$i]['receive_id'] = $val['id'];\n// $insert_data[$i]['device_type'] = $val['device_type'];\n// $insert_data[$i]['type'] = $post_data['type'];\n// $insert_data[$i]['type_id'] = $post_data['type_id'];\n// $insert_data[$i]['category'] = isset($post_data[\"category\"]) ? $post_data[\"category\"] : \"\";\n// $insert_data[$i]['created_date'] = date('Y-m-d H:i:s');\n// $i++;\n }\n// $CI->Common_model->insert_batch('budfie_notifications', array(), $insert_data);\n $allPromise = \\GuzzleHttp\\Promise\\all($promises);\n $data_promise = $allPromise->wait();\n return [\n \"success\" => true,\n \"message\" => \"OK\",\n \"result\" => $data_promise\n ];\n } catch (\\Exception $error) {\n // file_put_contents(getcwd() . \"/application/sns_log/error.txt\", $error);\n return [\n \"success\" => false,\n \"message\" => \"error\"\n ];\n }\n }", "public function createNotification()\n {\n //validations\n if ($this->notificationValidator()->fails()) {\n return redirect()->back()\n ->withErrors($this->notificationValidator())\n ->withInput();\n }\n\n $message = $this->request->input(\"message\");\n if (is_array($message)) {\n $message = implode(\" \", $message);\n }\n\n $insertArray = [\n \"message\" => $message,\n \"created_by\" => $this->request->session()->get('user_id'),\n \"status\" => \"active\"\n ];\n\n $this->notificationModel->setInsertDataWithDates($insertArray);\n $notificationId = $this->notificationModel->insertData();\n\n //send nofitifcations\n $this->getDeviceTokens($notificationId);\n return $notificationId;\n }", "public function reminderNotification($reminderArr, $post_data) {\n\n $CI = & get_instance();\n $CI->load->model('Common_model');\n try {\n $promises = array();\n $insert_data = array();\n $i = 0;\n foreach ($reminderArr as $row => $val) {\n $insert_data['title'] = isset($val['title']) ? $val['title'] : \"\";\n $insert_data['sender_id'] = isset($post_data['sender']) ? $post_data['sender'] : \"\";\n $insert_data['message'] = \"Reminder Alert: \" . $val[\"title\"] . ' set by ' . $val['owner'];\n $insert_data['receive_id'] = isset($val['id']) ? $val['id'] : \"\";\n $insert_data['device_type'] = isset($val['device_type']) ? $val['device_type'] : \"\";\n $insert_data['type'] = isset($post_data['type']) ? $post_data['type'] : \"\";\n $insert_data['type_id'] = isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\";\n $insert_data['category'] = isset($val[\"type\"]) ? $val[\"type\"] : \"\";\n $insert_data['created_date'] = date('Y-m-d H:i:s');\n $id = $CI->Common_model->insert_single('budfie_notifications', $insert_data);\n \n $notificationCount = $this->getBadgeCount($val['id']);\n $message = [\n \"default\" => isset($val[\"title\"]) ? $val[\"title\"] : \"\",\n \"APNS\" => json_encode([\n \"aps\" => [\n \"alert\" => array(\n \"title\" => \"\",\n \"body\" => \"Reminder Alert: \" . $val[\"title\"] . ' set by ' . $val['owner'],\n \"subtitle\" => \"\"\n ),\n \"sound\" => \"default\",\n \"mutable-content\" => 1,\n \"category\" => \"budfieIcon\",\n \"badge\" => (int) $notificationCount,\n \"data\" => array(\n \"attachment_url\" => isset($val[\"rest_image\"]) ? $val[\"rest_image\"] : \"\",\n \"ext_link\" => $post_data[\"ext_link\"],\n \"url_title\" => $post_data[\"url_title\"],\n \"content_type\" => \"image\",\n \"type\" => $post_data[\"type\"],\n \"type_id\" => isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\",\n \"category\" => isset($val[\"type\"]) ? $val[\"type\"] : \"\"\n )\n ]\n ]),\n \"GCM\" => json_encode([\n \"data\" => [\"body\" => array(\n \"title\" => isset($val[\"title\"]) ? $val[\"title\"] : \"\",\n \"message\" => \"Reminder Alert: \" . $val[\"title\"] . ' set by ' . $val['owner'],\n \"type\" => $post_data[\"type\"],\n \"type_id\" => isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\",\n \"image\" => isset($val[\"rest_image\"]) ? $val[\"rest_image\"] : \"\",\n \"ext_link\" => $post_data[\"ext_link\"],\n \"url_title\" => $post_data[\"url_title\"],\n \"category\" => isset($val[\"type\"]) ? $val[\"type\"] : \"\"\n )]\n ])\n ];\n $promises[] = $this->sns->publishAsync([\n 'Message' => json_encode($message),\n 'MessageStructure' => 'json',\n 'TargetArn' => $val['device_arn']\n ]);\n// $insert_data[$i]['title'] = isset($val['title']) ? $val['title'] : \"\";\n// $insert_data[$i]['sender_id'] = isset($post_data['sender']) ? $post_data['sender'] : \"\";\n// $insert_data[$i]['message'] = \"Reminder Alert: \" . $val[\"title\"] . ' set by ' . $val['owner'];\n// $insert_data[$i]['receive_id'] = isset($val['id']) ? $val['id'] : \"\";\n// $insert_data[$i]['device_type'] = isset($val['device_type']) ? $val['device_type'] : \"\";\n// $insert_data[$i]['type'] = isset($post_data['type']) ? $post_data['type'] : \"\";\n// $insert_data[$i]['type_id'] = isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\";\n// $insert_data[$i]['category'] = isset($val[\"type\"]) ? $val[\"type\"] : \"\";\n// $insert_data[$i]['created_date'] = date('Y-m-d H:i:s');\n// $i++;\n }\n// $CI->Common_model->insert_batch('budfie_notifications', array(), $insert_data);\n $allPromise = \\GuzzleHttp\\Promise\\all($promises);\n $data_promise = $allPromise->wait();\n return [\n \"success\" => true,\n \"message\" => \"OK\",\n \"result\" => $data_promise\n ];\n } catch (\\Exception $error) {\n // file_put_contents(getcwd() . \"/application/sns_log/error.txt\", $error);\n return [\n \"success\" => false,\n \"message\" => \"error\"\n ];\n }\n }" ]
[ "0.6949075", "0.6529119", "0.6432717", "0.609975", "0.60653514", "0.6063698", "0.5983977", "0.5961632", "0.59420836", "0.59202945", "0.58500344", "0.5837815", "0.5835064", "0.5787012", "0.57837856", "0.578356", "0.5767752", "0.57647955", "0.57570434", "0.5753581", "0.57314366", "0.57120687", "0.57050925", "0.5676668", "0.5669218", "0.56366694", "0.5620386", "0.5620035", "0.55915606", "0.5586392" ]
0.6940662
1
/ Sends the notification through Facebook Graph api through its post method. Catches an error and prints it out if there is a facebook authentication exception. 'ex: needing a valid accesstoken, user not signed up to your app etc...' Input: UserId (id you are sending to. The id must have your app installed to send to him/her), accessToken (combination of your app's id and secret), notification array that you created with the createNotification method Output: returns true if the post goes through or false otherwise
function sendPushNotification($userId, $accessToken, $notificationArray){ $facebook = $this->getFacebook(); $sent = false; try { $sendNotification = $facebook->post('/' . $userId . '/notifications', $notificationArray, $accessToken); $sent = true; }catch(Facebook\Exceptions\FacebookAuthenticationException $e) { print 'FacebookAuthenticationException' . $e->getMessage(); } return $sent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendNotification($recipientFbid, $text, $url, $app_id, $app_secret) {\n $href = urlencode($url);\n $post_data = \"access_token=\". $app_id . \"|\" . $app_secret .\"&template={$text}&href={$href}\";\necho $post_data;\n $curl = curl_init(); \necho \"https://graph.facebook.com/v2.5/\". $recipientFbid .\"/notifications\";\n curl_setopt($curl, CURLOPT_URL, \"https://graph.facebook.com/v2.5/\". $recipientFbid .\"/notifications\"); \n curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data); \n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); \n $data = curl_exec($curl); \n curl_close($curl); \n\n return $data;\n}", "function sendNotification($tokensArray, $msg, $notificationUrl, $key, $id) {\n define('API_ACCESS_KEY', 'AIzaSyB7lbQ6Wc8FqEg4MVM12uPK15DuavsA27o');\n\n // notification fields\n $fields = json_encode(\n array(\n 'registration_ids' => $tokensArray,\n 'priority' => 10,\n 'data' => array(\n 'url' => $notificationUrl,\n 'body' => $msg,\n )\n )\n );\n\n $headers = array(\n 'Authorization: key=' . API_ACCESS_KEY,\n 'Content-Type: application/json'\n );\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send');\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);\n $result = curl_exec($ch);\n curl_close($ch);\n\n // Insert to the db\n $date = date('d/m/y h:i:s');\n\n $queryRes=mysqli_query(\"INSERT INTO `notification` (`msg`, `key`, `rideID`, `date`)\n VALUES ('\".$msg.\"', '\".$key.\"', '\".$id.\"', '\".$date.\"')\");\n}", "function send_notifications($device_token, $message, $userData = null)\n\t\t\t{\n\t\t\t\t$this->load->library('Apn');\n\t\t\t\t$this->apn->payloadMethod = 'enhance';\n\t\t\t\t// you can turn on this method for debuggin purpose\n\t\t\t\t$this->apn->connectToPush();\n\t\t\t\t// adding custom variables to the notification\n\t\t\t\t$this->apn->setData(array(\n\t\t\t\t\t'someKey' => true\n\t\t\t\t));\n\t\t\t\t// $send_result = $this->apn->sendMessage($device_token, $message, 2, 'default');\n\t\t\t\t$send_result = $this->apn->sendMessage($device_token, $message, 2, 'default', $ids = array(\n\t\t\t\t\t'message' \t\t\t=> $userData['message'],\n\t\t\t\t\t'title' \t\t\t=> $userData['title'],\n\t\t\t\t\t'appointmentTime' \t=> $userData['appointmentTime'],\n\t\t\t\t\t'appointmentDate' \t=> $userData['appointmentDate'],\n\t\t\t\t\t'vibrate' \t\t\t=> $userData['vibrate'],\n\t\t\t\t\t'sound' \t\t\t=> $userData['sound']\n\t\t\t\t));\n\t\t\t\tif ($send_result)\n\t\t\t\t\t{\n\t\t\t\t\t\tlog_message('debug', 'Sending successful');\n\t\t\t\t\t}\n\t\t\t\t else\n\t\t\t\t\t{\n\t\t\t\t\t\tprint_r('error' . $this->apn->error);\n\t\t\t\t\t\t$this->apn->disconnectPush();\n\t\t\t\t\t\tprint_r($send_result);\n\t\t\t\t\t}\n\t\t\t}", "function sendNotification() {\n\t $apiKey = \"AAAA3M9QohA:APA91bGEddlanmDMowNhEcKJnkCgSYxvpqNXwHAsAol7pTv4qd2S-O-_eePDG52nQHAupiKdl3MDjeH8s0gU0QJz9ObKgLKlP9INgkEk5lWrs9F2dpXF9jXwOHmhUULei5lbh0MAkevY\";\t \n\n\t // Replace with the real client registration IDs\n\t //$registrationIDs = array(\"id1\", \"id2\");\n\t $registrationIDs = array(\"c3hKbtIlrjM:APA91bGJQvJn3M_99uxzO5br52OPsar8xcbsjxWlMpQGMC6WBXVY2HefJBEm1BMjbG-cNS_0nZNYsrvIbfHRgxCcR8bk7TK1scJOfRRNSmYIC7hfvmusq9AtU4QoQXEH18XzO2fbjlDy\");\n\n\t //$registrationIDs = $fcmIds;\n\n\t // Message to be sent\n\t $message = \"This is matter of notification\";\n\t $title = \"This is title of notification\";\n\n\t // Set POST variables\n\t $url = 'https://android.googleapis.com/gcm/send';\n\n\t $fields = array(\n\t 'registration_ids' => $registrationIDs,\n\t 'data' => array(\"post_id\" => \"1\", \"message\" => $message, \"body\" => $message, \"title\" => $title ),\n\t );\n\t $headers = array(\n\t 'Authorization: key=' . $apiKey,\n\t 'Content-Type: application/json'\n\t );\n\n\t // Open connection\n\t $ch = curl_init();\n\n\t // Set the URL, number of POST vars, POST data\n\t curl_setopt( $ch, CURLOPT_URL, $url);\n\t curl_setopt( $ch, CURLOPT_POST, true);\n\t curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);\n\t curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);\n\t //curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $fields));\n\n\t curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t // curl_setopt($ch, CURLOPT_POST, true);\n\t // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode( $fields));\n\t $result = curl_exec($ch);\n\t curl_close($ch);\n\n\t echo \"Result : \".$result;\n\t \n\t}", "function doNotification($fb_id, $token, $template, $hrf = '')\n{\n $attachment = array(\n 'access_token' => $token,\n 'href' => $hrf,\n 'template' => $template,\n );\n//\t$fb_id = \"me\";\n//\tpre($attachment, $fb_id) ;\n $ch = curl_init();\n \n curl_setopt($ch, CURLOPT_URL, 'https://graph.facebook.com/'. $fb_id .'/notifications');\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); //to suppress the curl output\n\tob_start();\n $data = curl_exec($ch);\n//\techo $data;\n\t$str = ob_get_clean();\n curl_close($ch);\n return $str;\n}", "public function notify_user($user_id, $notification_id, $message)\n {\n $user_detail = $this->user_m->get($user_id);\n $pay_load_data = set_payload('pledge', $notification_id, $message ); // helper\n if ($user_detail->device_type == '0')\n {\n send_push_notification($user_detail->device_token, false, $pay_load_data);//helper \n }\n }", "public function pushApple($tokens, $message, $grpId, $userId, $firstName)\r\n\t{\r\n\t\tif ($tokens == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//Sending Push Notification\r\n\t\t//error_log(\"yafra server push - sending message: \" + $message + \" to tokens \" + $tokens);\r\n\r\n\t\t// Set POST variables\r\n\t\t//$url = 'ssl://gateway.sandbox.push.apple.com:2195';\r\n\t\t//$cert = dirname(__FILE__) . '/yafrapush-dev2015.pem';\r\n\t\t$url = 'ssl://gateway.push.apple.com:2195';\r\n\t\t$cert = dirname(__FILE__) . '/yafrapush-prod2015.pem';\r\n\t\t$passphrase = 'yafraphrase';\r\n\r\n\t\t// Create the payload body\r\n\t\tif (strlen($message) > 50)\r\n\t\t\t$limitedMessage = substr($message, 0, 46) . '...';\r\n\t\telse\r\n\t\t\t$limitedMessage = $message;\r\n\t\t$composedMessage = sprintf('%s: %s', $firstName, $limitedMessage);\r\n\t\t$body['aps'] = array(\r\n\t\t\t//'alert' => array(\r\n\t\t\t//\t'body' => $composedMessage\r\n\t\t\t//),\r\n\t\t\t'alert' => $composedMessage,\r\n\t\t\t'badge' => 1,\r\n\t\t\t'group' => $grpId,\r\n\t\t\t'user' => $userId,\r\n\t\t\t'username' => $firstName\r\n\t\t);\r\n\r\n\t\t// Create tcp stream\r\n\t\t$ctx = stream_context_create();\r\n\t\tstream_context_set_option($ctx, 'ssl', 'local_cert', $cert);\r\n\t\tstream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);\r\n\t\t// Open a connection to the APNS server\r\n\t\t$fp = stream_socket_client($url, $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);\r\n\t\tif (!$fp) {\r\n\t\t\terror_log(\"yafra server push - google error curl: \" + curl_error($ch));\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t// Encode the payload as JSON\r\n\t\t$payload = json_encode($body);\r\n\t\t// Build the binary notification\r\n\t\tforeach ($tokens as $oneToken) {\r\n\t\t\t$msg = chr(0) . pack('n', 32) . pack('H*', $oneToken) . pack('n', strlen($payload)) . $payload;\r\n\t\t\t// Send it to the server\r\n\t\t\t$result = fwrite($fp, $msg, strlen($msg));\r\n\t\t\t//if (!$result)\r\n\t\t\t//\treturn false;\r\n\t\t}\r\n\t\t// Close the connection to the server\r\n\t\tfclose($fp);\r\n\t\treturn true;\r\n\t}", "public function create(array $notificationData)\n {\n $notificationData = array_merge($notificationData, [\n 'app_id' => $this->appIDKey,\n ]);\n $notificationData = $this->validateNotificationData(\n $notificationData,\n $this->getNotificationDataRules()\n );\n\n return $this->oneSignal->execute('notifications', 'POST', array_merge([\n 'headers' => [\n 'Content-Type' => 'application/json',\n ],\n 'json' => $notificationData,\n ], $this->extraOptions));\n }", "public function sendNotifications()\n {\n $token = $this->getConfigValue('token');\n $client = new Client($token);\n\n foreach ($this->notifications as $notification) {\n $options = [\n 'as_user' => true,\n 'channel' => $notification['channel'],\n 'text' => $notification['message'],\n ];\n\n $client->postMessage($options);\n }\n }", "public function notification_app_post() {\n $apikey = $this->input->post('apikey');\n $id = $this->input->post('id');\n\n if (isPostBack()) {\n $this->form_validation->set_rules('id', 'ID', 'trim|required|numeric');\n if ($this->form_validation->run()) {\n if ($apikey == APIKEY) {\n $notification_app = $this->Webapi_model->notification_app_list($id);\n pr($notification_app);\n\n $success = array('ErrorCode' => 0, \"message\" => \"Notification List\", 'data' => $notification_app);\n $this->response($success, 200);\n } else {\n $error = array('ErrorCode' => 1, 'message' => 'Api Key does not exist');\n $this->response($error, 200);\n }\n } else {\n $error = array('ErrorCode' => 1, 'message' => validation_errors());\n $this->response($error, 200);\n }\n } else {\n $error = array('ErrorCode' => 1, 'message' => 'Use Post Method Only');\n $this->response($error, 200);\n }\n }", "static function sendNotification($title, $message, $id = 0) {\n define( 'API_ACCESS_KEY', 'AAAA3h7MrFc:APA91bE8cay1XJkaHfJgvY4_O-xupadoZPZOAIRLIVqGzvL_ZUOtBUYFa24dDqfwLZXbyBpQjbXU4LBEOeMVJt7vubdO_AsYkzHmb4omYGgA5iDwjVFgq2zUBUjSum5eKRL-BicJ05TO');\n //$id = ['dUy90D_3Lpg:APA91bE_2_cFFyB1oIQE46R6YKGGNZz12Pbl6mrPKWzuaDsZbaZe9ffBMm72SwmxIMth2r2DOQtL0EUw7_v1HRvl4YXIQVn_9t5Vdqij5brN_BZDoQCbC_r_mhc9egYj4cT2FaIBRZaS'];\n $registrationIds = [$id];\n $topic = $id;\n $url = 'https://fcm.googleapis.com/fcm/send';\n \n #prep the bundle\n $msg = [\n 'body' \t=> $message,\n 'title' => $title,\n ];\n\n $fields = [\n 'to' => '/topics/user-' . $topic,\n 'notification' => $msg\n ];\n \n $headers = [\n 'Authorization: key=' . API_ACCESS_KEY,\n 'Content-Type: application/json'\n ];\n\n #Send Reponse To FireBase Server\t\n $ch = curl_init();\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch,CURLOPT_POST, true);\n curl_setopt($ch,CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch,CURLOPT_POSTFIELDS, json_encode($fields));\n\n $result = curl_exec($ch);\n\n curl_close($ch);\n\n if($result === false){\n echo 'Curl error: ' . curl_error($ch);\n }else{\n echo 'Notificacao enviada! - user:' . $topic;\n //echo \"RESULTADO<br>\";\n //echo $result;\n }\n }", "public function send($id, $logged_in_user)\n {\n $notification = Notification::find($id);\n if($notification)\n {\n $recipients_list = [];\n $data = $this->data->find($notification->data_id);\n $recipients = $this->data->getApiUsersAllowed($data->code);\n\n foreach($recipients as $recipient)\n {\n if(!empty($recipient->callback_url) &&\n $recipient->active == 1)\n {\n $params = strstr($recipient->callback_url, '?') ? '&' : '?';\n $params .= \"code=\" . $data->code;\n $callback_url = $recipient->callback_url . $params;\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $callback_url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_exec($ch);\n $status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n\n $recipients_list[] = ['apiuser_id' => $recipient->apiuser_id,\n 'callback_url' => $callback_url,\n 'send' => $status_code\n ];\n }\n }\n\n $this->save($id, 1, json_encode($recipients_list), $logged_in_user);\n }\n }", "public static function sendNotificationFb($title, $data, $tokenFB = null) {\n\n $notification = [\n 'title' => $title, // works fine here\n 'body' => $data['descriptionNotification'],\n 'sound' => 'default',\n 'vibrate' => 'default',\n ];\n\n if ($tokenFB != null) {\n $param = [\n \"to\" => $tokenFB,\n \"notification\" => $notification,\n \"data\" => $data,\n ];\n } else {\n $param = [\n \"to\" => \"/topics/all\",\n \"notification\" => $notification,\n \"data\" => $data,\n ];\n }\n\n\n\n\n $headers = [\n 'Authorization: key='.env('API_ACCESS_KEY', ''),\n 'Content-Type: application/json',\n ];\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send');\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($param));\n $result = curl_exec($ch);\n\n\n curl_close($ch);\n\n }", "private function InsertDefaultNotifications($appUserID){\n\t\t\t$userNotificationBO = new UserNotificationBO($this->_UserInfo);\n\t\t\t$userNotification = new UserNotification();\n\t\t\t\n\t\t\t$userNotification->setAppUserID($appUserID);\n\t\t\t$userNotification->setNotificationType(\"Email\");\n\t\t\t$userNotification->setDisplayName(\"Email me\");\n\t\t\t$userNotification->setNotify(TRUE);\n\t\t\t$userNotificationBO->InsertUserNotification($userNotification);\n\t\t\t\n\t\t\t$userNotification->setNotificationType(\"Follows\");\n\t\t\t$userNotification->setDisplayName(\"Someone follows me\");\n\t\t\t$userNotificationBO->InsertUserNotification($userNotification);\n\t\t\t\n\t\t\t$userNotification->setNotificationType(\"ReClips\");\n\t\t\t$userNotification->setDisplayName(\"Some re-clips a product I clipped\");\n\t\t\t$userNotificationBO->InsertUserNotification($userNotification);\n\t\t\t\n\t\t\t$userNotification->setNotificationType(\"Tags\");\n\t\t\t$userNotification->setDisplayName(\"Someone mentions (tags) me\");\n\t\t\t$userNotificationBO->InsertUserNotification($userNotification);\n\t\t\t\n\t\t\t$userNotification->setNotificationType(\"Deals\");\n\t\t\t$userNotification->setDisplayName(\"Deals from my favorite brands\");\n\t\t\t$userNotificationBO->InsertUserNotification($userNotification);\n\t\t\t\n\t\t\t$userNotification->setNotificationType(\"NewFeature\");\n\t\t\t$userNotification->setDisplayName(\"New feature announcements\");\n\t\t\t$userNotificationBO->InsertUserNotification($userNotification);\n\t\t\t\n\t\t\t$userNotification->setNotificationType(\"Hearts\");\n\t\t\t$userNotification->setDisplayName(\"Someone hearts my clip\");\n\t\t\t$userNotificationBO->InsertUserNotification($userNotification);\n\t\t\t\n\t\t\t$userNotification->setNotificationType(\"PriceChange\");\n\t\t\t$userNotification->setDisplayName(\"Price change for your clips\");\n\t\t\t$userNotificationBO->InsertUserNotification($userNotification);\n\t\t\t\n\t\t\t$userNotification->setNotificationType(\"Weekly\");\n\t\t\t$userNotification->setDisplayName(\"Weekly Inspiration\");\n\t\t\t$userNotificationBO->InsertUserNotification($userNotification);\n\t\t\t\n\t\t\t$userNotification->setNotificationType(\"Feedback\");\n\t\t\t$userNotification->setDisplayName(\"Ropazi invites you for feedback on the product\");\n\t\t\t$userNotificationBO->InsertUserNotification($userNotification);\n\t\t\t\n\t\t\t$userNotification->setNotificationType(\"Facebook\");\n\t\t\t$userNotification->setDisplayName(\"Post activity to your timeline\");\n\t\t\t$userNotificationBO->InsertUserNotification($userNotification);\n\t\t}", "public function notification($token, $body)\n {\n $fcmUrl = 'https://fcm.googleapis.com/fcm/send';\n $headers = [\n 'Authorization: key=AIzaSyCN7c7kBuH5sDAyaVVPKONAVGnkKx273jw',\n 'Content-Type: application/json'\n ];\n\n $notification = [\n 'title' => $body['title'],\n 'body' => $body['body'],\n 'color' => '#009cff',\n 'priority' => 'high',\n 'icon' => 'ic_launcher',\n 'show_in_foreground' => true,\n 'show_in_background' => true,\n ];\n\n // array_push($notification, ['notification' => $notification]);\n $fcmNotification = [\n 'registration_ids' => $token,\n // 'data' => $notification,\n 'notification' => $notification\n ];\n // array_push($fcmNotification, $notification);\n\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,$fcmUrl);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fcmNotification));\n $result = curl_exec($ch);\n curl_close($ch);\n\n return true;\n }", "public function push_notification($post_id, $post_data = array(), $response = NULL)\n\t\t{\n\t\t\t// TODO: check license\nSyncDebug::log(__METHOD__.'():' . __LINE__ . ' received push notification from SyncApiController; post id=' . $post_id);\n\t\t\tif (1 === SyncOptions::get_int('auth', 0)) {\n\t\t\t\t// only synchronize content if there's a valid Target\n\t\t\t\t$the_post = get_post($post_id);\n\t\t\t\tif (NULL !== $the_post)\t\t\t\t\t\t\t\t// double check that the post was created\n\t\t\t\t\t$this->synchronize_content($the_post, TRUE);\t// synchronize the content\n\t\t\t} else {\nSyncDebug::log(__METHOD__.'():' . __LINE__ . ' Target site not authenticated; not processing Push notification');\n\t\t\t}\n\t\t}", "public function user_referral_submit() {\n\n\t\t$data = json_decode(file_get_contents(\"php://input\"),true);\n\n\t\tif(!empty($data)) {\n\n\t\t\t// Check login session\n\t\t\t$unique_id_data['users_id'] = $data['users_id'];\n\t\t\t$unique_id_data['unique_id'] = $data['unique_id'];\n\t\t\t$unique_id_check = $this->referral_model->unique_id_verification($unique_id_data);\n\t\t\tif($unique_id_check == 0) {\n\t\t\t\t$response = array(\"status\"=>\"false\",\"status_code\"=>\"301\",\"message\"=>\"Session Expired\");\n\t\t\t\techo json_encode($response);\n\t\t\t\texit;\n \t\t}\n\n \t\t$user_name = (!empty($data['loggedin_user_name']) ? $data['loggedin_user_name'] : 'user');\n\n\t\t\t$check_user_referral = $this->referral_model->check_device_user($data['users_id'],$data['login_device_id'],$data['referral_code']);\n\n\t\t\tif($check_user_referral) {\n\n\t\t\t\t$user_referral = $this->referral_model->user_referral($data);\n\n\t\t\t\tif($user_referral['status'] == \"true\") {\n\n \t\t\t\t\t//\tpush notification\n \t\t\t\t\t$user_id = $user_referral['referred_user'];\n \t\t\t\t\t$user_device_details = $this->referral_model->get_users_device_details($user_id);\n\n \t\t\t\t\t// Save notifications\n \t\t\t\t\t$notification_data = array('notifications_from_id'=> $data['users_id'],'notifications_to_id'=> $user_id,'notifications_msg'=> \"has joined in razzle with your referral code.\",'notifications_type'=> \"user_referral\" ,'notifications_status'=> 1);\n \t\t\t\t\t$save_notifications = $this->referral_model->save_notifications($notification_data);\n\n \t\t\t\t\tif(!empty($user_device_details)) {\n\n \t\t\t\t\t\t$user_device_type = ($user_device_details['logs_device_type'] == 1) ? \"android\" : \"ios\";\n \t\t\t\t\t\t$user_device_token = array($user_device_details['logs_device_token']);\n\n\t\t \t\t\t\tif(!empty($user_device_token)) {\n\t\t\t \t\t\t\t$msg = array (\n\t\t\t\t\t\t\t\t\t\t'title' => \"You have a new notification.\",\n\t\t\t\t\t\t\t\t\t\t'message' => ucfirst($user_name).\" has joined in razzle with your referral code.\",\n\t\t\t\t\t\t\t\t\t\t'notifications_type' => \"user_referral\",\n\t\t\t\t\t\t\t\t\t\t'notifications_id' => $save_notifications['insert_id'],\n\t\t\t\t\t\t\t\t\t\t'notifications_from_id' => $data['users_id']\n\t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\t\t$send_notification = $this->common->single_push_notification_service($user_device_type,$user_device_token,$msg,$user_id);\n\t \t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$response = array(\"status\"=>\"true\",\"status_code\"=>\"200\",\"message\"=>\"Added successfully\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$response = array(\"status\"=>\"false\",\"status_code\"=>\"400\",\"message\"=>\"Invalid Referral Code\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$response = array(\"status\"=>\"false\",\"status_code\"=>\"400\",\"message\"=>\"Not applicable\");\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$response = array(\"status\"=>\"false\",\"status_code\"=>\"404\",\"message\"=>\"Fields must not be Empty\");\n\t\t}\n\n\t\techo json_encode($response);\n\t}", "public function notify($application_id, $user = null, $description = null, $revision = null)\n {\n $payload = [\n 'application_id' => $application_id\n ];\n\n if ($revision !== null) {\n $payload['revision'] = $revision;\n }\n\n if ($user !== null) {\n $payload['user'] = $user;\n }\n\n if ($description !== null) {\n $payload['description'] = $description;\n }\n\n $headers = [\n 'x-api-key' => $this->apiKey\n ];\n\n $request = new Request('POST', self::API_URL, $headers);\n $response = $this->httpClient->send($request, ['form_params' => $payload]);\n\n if ($response->getStatusCode() != '201') {\n throw new \\Exception(\"Received status code of \".$response->getStatusCode().\" with message: \".$response->getReasonPhrase());\n }\n\n return true;\n }", "public function sendToUser($notification, $context, $user, $data) {\n\t\t$cls = new stdClass();\n\t\t$cls->notification = $notification;\n\t\t$cls->text = $notification->format($notification->NotificationText, $context, $user, $data);\n\t\t$cls->context = $context;\n\t\t$cls->user = $user;\n\t\t$cls->data = $data;\n\t\t\n\t\t$this->notifications[] = $cls;\n\t}", "function sendNotification($serverurl, $apikey, $contextarray){\r\n\tif(empty($serverurl) || empty($apikey) || empty($apikey)) {\r\n\t\treturn false; \r\n\t}\r\n\r\n\t$data = $this->json_string($contextarray);\r\n\r\n $url = $serverurl.\"?action=notify&apikey=\".$apikey;\r\n\t$result = $this->do_curl($url, null, \"POST\", $data, null);\r\n\t\r\n\t$result = $result[\"response\"];\r\n\t$result = json_decode($result);\r\n if(($result==null) ||($result->request->status !== \"SUCCESS\")){\r\n \t$this->logHelper->log(ERROR, $result->request->message);\r\n \t$this->logHelper->log (ERROR,\"Not able to send notification to cloudmunch\");\r\n \treturn false;\r\n }else{\r\n \treturn true;\r\n }\r\n}", "public function rest_post_apple_push_token() {\n\t\tif(!isset($_POST)) $this->status = 'ERROR_POST_NOT_SET';\n\t\tif(!strlen($_POST['token']) > 0) $this->status = 'ERROR_TOKEN_NOT_SET';\n\t\tif(substr($this->status,0,5) == 'ERROR') return;\n\n\t\t$this->set_response(\n\t\trUsers::post_apple_push_token($this->getLoggedUserId(), $_POST['token'])\n\t\t);\n\t\tif(strlen(trim($_POST['message'])) > 0) {\n\t\t\trequire('ca/ca_apple_push.php');\n\t\t\tca_apple_push(\n\t\t\t$_POST['token'],\n\t\t\t\t'mmatcher.com',\n\t\t\t$_POST['message']\n\t\t\t);\n\t\t}\n\t}", "function send_message($titulo,$mensaje){\r\r\n\t\t\t\t\t$message = $mensaje;\r\r\n\t\t\t\t\t$headings=array(\r\r\n\t \"en\" => \"$titulo\");\r\r\n\t $user_id = \"1\";\r\r\n\t $content = array(\r\r\n\t \"en\" => \"$message\"\r\r\n\t );\r\r\n\r\r\n\t $fields = array(\r\r\n\t 'app_id' => \"bdc5c0a8-4e12-4ed8-ba32-ca4263a610e3\",\r\r\n\t\t\t\t\t\t\t'filters' => array(array(\"field\" => \"tag\", \"key\" => \"user_email\", \"relation\" => \"=\", \"value\" => \"[email protected]\")),\r\r\n\t\t\t\t\t\t\t'headings' => $headings,\r\r\n\t 'contents' => $content,\r\r\n\t\t\t\t\t\t\t'url' => 'https://arduinointerfaz.000webhostapp.com/app/main'\r\r\n\t );\r\r\n\r\r\n\t $fields = json_encode($fields);\r\r\n\t print(\"\\nJSON sent:\\n\");\r\r\n\t print($fields);\r\r\n\r\r\n\t $ch = curl_init();\r\r\n\t curl_setopt($ch, CURLOPT_URL, \"https://onesignal.com/api/v1/notifications\");\r\r\n\t curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8',\r\r\n\t 'Authorization: Basic ZGNmZTBlOGQtNWNjMi00NTA2LWJmZWQtM2Y0M2NlNzU2MmQ3'));\r\r\n\t curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\r\r\n\t curl_setopt($ch, CURLOPT_HEADER, FALSE);\r\r\n\t curl_setopt($ch, CURLOPT_POST, TRUE);\r\r\n\t curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);\r\r\n\t curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\r\r\n\r\r\n\t $response = curl_exec($ch);\r\r\n\t curl_close($ch);\r\r\n}", "public function onFacebookAuth()\n {\n $data = post();\n\n if(UserUtil::getLoggedInUser() != null)\n return Redirect::to('update');\n\n if($user = IntegrationManager::getUser($data['id']))\n {\n // If user already exists\n UserManager::loginUserObj($user);\n\n return Redirect::to('update');\n }\n\n $password = openssl_random_pseudo_bytes(16);\n\n $registration = [\n 'email' => $data['email'],\n 'username' => $data['email'],\n 'first_name' => $data['first_name'],\n 'last_name' => $data['last_name'],\n 'password' => $password,\n 'password_confirmation' => $password\n ];\n\n if(!($user = UserManager::registerUser($registration)))\n return false;\n\n $reflection = new \\ReflectionClass($user);\n\n if($reflection->getShortName() == 'Validator')\n {\n throw new ValidationException($user);\n }\n\n $integration = IntegrationManager::createUser($data['id'], $user->id, IntegrationManager::UE_INTEGRATIONS_FACEBOOK);\n\n UserManager::loginUserObj($user);\n\n return Redirect::to('update');\n }", "public function pushNotification($data)\n \n\t{\n\t\tself::getConnection();\n\t\t$qry=\"SELECT user_id FROM `watchlist` where flag='1' AND bidder_item_id='\".$data['item_id'].\"' \";\n\t\tself::$dbo->doQuery($qry);\n\t\t$result = self::$dbo->getResultSet();\n\t\t\n\t\t//echo count($result); exit;\n\t\tif ($result !=\"No result.\")\n\t\t {\n\t\t for ($i=0;$i< count($result);$i++)\n\t\t {\n\t\t$query=\"select regd_id,app_type from mobile_users where id=\".$result[$i]['user_id'].\"\";//print_r($query);exit;\n\t\tself::$dbo->doQuery($query);//print_r($query);exit;\n\t\t$results = self::$dbo->getResultRow();\n\t\t//echo \tcount($results);exit;\n\t if($results['app_type'] == 'Android')\n\t {\n\t $chk=$this->sendNotificationsAndroid($results['regd_id']);\n\t \n\t }\n\t else\n\t {\n\t\t$chk=$this->sendNotificationsIOS($results['regd_id']);\n\t\t}\n\t\tif($i==(count($result)-1))\n\t\t{\n\t\treturn \"Push Notification Sent\";\n\t\t}\n\t\t\n\t\t//\techo $chk; exit();\n\t\t}\n\t\treturn \"Push Notifications Not sent\";\n \n\t\t }\n\t}", "static function sendNotification($params){\n $con = $params['dbconnection'];\n $tokens_ios = [];\n $tokens_android = [];\n $tokens_all = [];\n $created_at = \"\";\n $specificUsers = \"\";\n $platform = \"\";\n $operator = \"\";\n //print_r($params);\n if($params['audience'] == 'userCreatedDate'){\n if($params['dates'] == \"Both\"){\n $created_at = \" AND (u.`created_at` > '{$params['greater_than']}' AND u.`created_at` < '{$params['less_than']}')\";\n }\n else if($params['dates'] == \"Greater\"){\n $created_at = \" AND u.`created_at` > '{$params['greater_than']}'\";\n }\n else if($params['dates'] == \"Greater\"){\n $created_at = \" AND u.`created_at` < '{$params['greater_than']}'\";\n }\n }\n else if($params['audience'] == 'specificUsers' || $params['audience'] == 'specificusers'){\n $specificUsers = \" AND FIND_IN_SET(u.`email`, '{$params['specificUsers2']}')\";\n }\n if($params['platform'] == \"android\"){\n $platform = \" AND `deviceType`='android'\";\n }\n else if($params['platform'] == \"ios\"){\n $platform = \" AND `deviceType`='ios'\";\n }\n if($params['operator'] == \"ooredoo\"){\n $operator = \" AND u.`network`='ooredoo'\";\n }\n else if($params['operator'] == \"vodafone\"){\n $operator = \" AND u.`network`='vodafone'\";\n }\n $language = \"\";\n $date = \"\";\n $query = \"SELECT\n\tDISTINCT(au.`token`) as token,\n au.`deviceType`,\n\tNOW() as created_at\n\tFROM `users` as u INNER JOIN `authkeys` as au ON(u.`id`=au.`user_id`)\n\tWHERE au.`token` !='' \".$specificUsers.\" \".$created_at.\" \".$created_at.\" \".$platform.\" \".$operator.\"\n\tORDER BY au.`id` DESC \";\n $result = mysqli_query($con, $query);\n if(mysqli_error($con) != ''){\n return \"mysql_Error:-\".mysqli_error($con);\n }\n if(mysqli_num_rows($result) > 0){\n while($row = mysqli_fetch_assoc($result)){\n $date = $row['created_at'];\n if($row['deviceType'] == 'ios'){\n $tokens_ios[] = $row['token'];\n }\n else if($row['deviceType'] == 'android'){\n $tokens_android[] = $row['token'];\n }\n }\n }\n $dir = str_replace(\"api/v1/cms/\", \"common/\", $params['apiBasePath'].\"pushNotification.php\");\n $params['Authorization'] = \"push!UP!Qatar>m\";\n /*print_r($tokens_ios);\n\techo \"========\";\n\tprint_r($tokens_android);\n\texit;*/\n if(!empty($tokens_ios) && count($tokens_ios) > 0){\n $tokens_ios = array_chunk($tokens_ios, 1000);\n foreach($tokens_ios as $iostokens){\n $params['token'] = $iostokens;\n $params['deviceType'] = 'ios';\n DbMethods:: post_async($dir, [\n 'token' => $params['token'],\n 'title' => $params['title'],\n 'message' => $params['message'],\n 'id' => $params['id'],\n 'deviceType' => $params['deviceType'],\n 'date' => $date,\n 'Authorization' => $params['Authorization']\n ]);\n }\n }\n if(!empty($tokens_android) && count($tokens_android) > 0){\n $tokens_android = array_chunk($tokens_android, 1000);\n foreach($tokens_android as $androidtokens){\n $params['token'] = $androidtokens;\n $params['deviceType'] = 'android';\n DbMethods:: post_async($dir, [\n 'token' => $params['token'],\n 'title' => $params['title'],\n 'message' => $params['message'],\n 'id' => $params['id'],\n 'deviceType' => $params['deviceType'],\n 'date' => $date,\n 'Authorization' => $params['Authorization']\n ]);\n }\n }\n return \"sended\";\n }", "public function UpcomingEventsNotification(){\n\n\t \t\t$_POST = jsonRequestPara();\n\t \t$this->form_validation->set_rules('user_id', 'User_id', 'trim|required');\n\t \t$this->form_validation->set_rules('device_token', 'Device_token', 'trim|required');\n\t \t$this->form_validation->set_rules('event_id', 'Event_id', 'trim|required');\n\t \t$this->form_validation->set_rules('notify_user_id', 'Notify_user_id', 'trim|required');\n\n\n\t \tif ($this->form_validation->run() === FALSE) {\n\t $response['status'] = 0;\n\t $response['message'] = 'Please enter all required fields';\n\t } else {\n\t \t$requestParams = $this->input->post();\n\t \t\t\n\t \t\t$user_id = $requestParams['user_id'];\n\t \t$device_token = $requestParams['device_token'];\n\t \t$event_id = $requestParams['event_id'];\n\t \t$notify_user_id = $requestParams['notify_user_id'];\n\n\n\t \n\t \t$IsUser = CheckTokenAndUSerID($user_id, $device_token);\n\n\t \tif(!empty($IsUser)){\n\t \t\t\n\t \t\tif($IsUser[0]->status == 1 && $IsUser[0]->deleted == 0){\n\n\t \t\t\t/*Check the EVENT is exists or not*/\n\n\t \t\t\t$WhereEvent = array(\n\t \t\t\t\t\"id\" => $event_id\n\t \t\t\t);\n\n\t \t\t\t$EventsData = $this->EventsData_model->getAnyData($WhereEvent, \"id, eventname, venue, eventdate\");\n\n\t \t\t\tif(!empty($EventsData)){\n\t \t\t\t\t/*Send the notification to user*/\n\t \t\t\t\t$notify_user_idData = explode(',', $notify_user_id);\n\t \t\t\t\t#pr($notify_user_idData);die;\n\t \t\t\t\tif(!empty($notify_user_idData)){\n\n\t \t\t\t\t\t/*Send the notification to listed user*/\n\t \t\t\t\t\tforeach ($notify_user_idData as $key => $value) {\n\t \t\t\t\t\t\t\n\t \t\t\t\t\t\t$WhereLastDevice = array(\n\t\t\t\t\t\t\t\t\t\t\"user_id\" => $value\n\t\t\t\t\t\t\t\t\t);\t\t\n\n\t\t\t\t\t\t\t\t\t$orderBy = \"user_logs.id DESC\";\n\n\n\t\t\t\t\t\t\t\t\t$join_arr[] = array(\n\t\t\t\t\t\t \"table_name\" => \"user\",\n\t\t\t\t\t\t \"cond\" => \"user.id = user_logs.user_id\",\n\t\t\t\t\t\t \"type\" => \"inner\"\n\t\t\t\t\t \t);\n\n\t\t\t\t\t\t\t\t\t//$selectData = \"id, eventname, eventdate, venue\";\n\n\t\t\t\t\t\t\t\t\t$OponentNotifyData = $this->UserLogs_model->getAnyData($WhereLastDevice, \"\", $orderBy, \"1\", $join_arr, \"\");\n\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\tif(!empty($OponentNotifyData)){\n\t\t\t\t\t\t\t\t\t\t$sendUsername = $IsUser[0]->firstname;\n\t\t\t\t\t\t\t\t\t\t$firstname = $OponentNotifyData[0]->firstname;\n\t\t\t\t\t\t\t\t\t\t$eventname = $EventsData[0]->eventname;\n\t\t\t\t\t\t\t\t\t\t$eventdate = !empty($EventsData[0]->eventdate)?date(\"M d Y , h:i a\", strtotime($EventsData[0]->eventdate)):\"-\";\n\t\t\t\t\t\t\t\t\t\t$venue = $EventsData[0]->venue;\n\n\t\t\t\t\t\t\t\t\t\t$message = $sendUsername.\" shared upcoming event \".$eventname.\" at \".$venue.\" on \".$eventdate;\n\t\t\t\t\t\t\t\t\t\t//echo $message;die;\n\t\t\t\t\t\t\t\t\t\t$notify = array(\n\t\t\t\t\t\t\t\t\t\t\t\"message\" => $message,\n\t\t\t\t\t\t\t\t\t\t\t\"token\" => $OponentNotifyData[0]->device_id,\n\t\t\t\t\t\t\t\t\t\t\t\"priority\" => \"high\",\n\t\t\t\t\t\t\t\t\t\t\t\"event_id\" => $event_id,\n\t\t\t\t\t\t\t\t\t\t\t\"type\" => \"event\"\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif($OponentNotifyData[0]->device_type == 1){\n\t\t\t\t\t\t\t\t\t\t\t/*Android*/\n\t\t\t\t\t\t\t\t\t\t\tsend_android_notification($OponentNotifyData[0]->device_id, $message, \"\", $notify);\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t/*Ios*/\n\t\t\t\t\t\t\t\t\t\t\tsend_ios_notification($OponentNotifyData[0]->device_id, $message, \"\", $notify);\n\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t\t$join_arr = array();\n\t \t\t\t\t\t}\n\n\t\t \t\t\t\t$response['status'] = 1;\n\t\t\t\t \t \t$response['message'] = 'Event invitation shared successfully!';\n\t\t\t\t \t \t$response['data'] = array();\n\n\t \t\t\t\t}else{\n\n\t\t \t\t\t\t$response['status'] = 0;\n\t\t\t\t \t \t$response['message'] = 'No user selected, please try again!';\n\t\t\t\t \t \t$response['data'] = array();\t\n\t \t\t\t\t}\n\n\n\t \t\t\t}else{\n\t\t \t\t\t$response['status'] = 0;\n\t\t\t \t \t$response['message'] = 'Event may be expired, please try again!';\n\t\t\t \t \t$response['data'] = array();\n\t \t\t\t}\n\t \t\t\t\t\n\t \t\t}else{\n\n\t \t\t\t$response['status'] = 0;\n\t\t \t \t$response['message'] = 'User is inactive or deleted, please try again';\n\t\t \t \t$response['data'] = array();\n\t \t\t}\n\t \t}else{\n\n\t \t\t$response['status'] = 999;\n\t\t $response['message'] = 'Token mismatch, please try again';\n\t\t \t$response['data'] = array();\n\t \t}\n\t }\n\n\t $JSONresponse=J_endecode($response,\"jencode\");\n\t echo $JSONresponse;\n\t \t}", "public function sendNotification($tokens, $title, $body)\n {\n $SERVER_API_KEY = 'YOUR_API_KEY';\n\n $data = [\n\n \"registration_ids\" => $tokens,\n\n \"notification\" => [\n\n \"title\" => $title,\n\n \"body\" => $body,\n\n \"sound\"=> \"default\" // required for sound on ios\n\n ],\n\n ];\n\n $dataString = json_encode($data);\n\n $headers = [\n\n 'Authorization: key=' . $SERVER_API_KEY,\n\n 'Content-Type: application/json',\n\n ];\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send');\n\n curl_setopt($ch, CURLOPT_POST, true);\n\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);\n\n return $response = curl_exec($ch);\n }", "public function send_user_notification( ) {\n\t\t\t\t return true;\n\t\t\t}", "function sendNotifications($fcmIds) {\n\t $apiKey = \"AAAA3M9QohA:APA91bGEddlanmDMowNhEcKJnkCgSYxvpqNXwHAsAol7pTv4qd2S-O-_eePDG52nQHAupiKdl3MDjeH8s0gU0QJz9ObKgLKlP9INgkEk5lWrs9F2dpXF9jXwOHmhUULei5lbh0MAkevY\";\t \n\n\t // Replace with the real client registration IDs\n\t //$registrationIDs = array(\"id1\", \"id2\");\n\t //$registrationIDs = array(\"c3hKbtIlrjM:APA91bGJQvJn3M_99uxzO5br52OPsar8xcbsjxWlMpQGMC6WBXVY2HefJBEm1BMjbG-cNS_0nZNYsrvIbfHRgxCcR8bk7TK1scJOfRRNSmYIC7hfvmusq9AtU4QoQXEH18XzO2fbjlDy\");\n\n\t $registrationIDs = $fcmIds;\n\n\t // Message to be sent\n\t $message = \"This is matter of notification\";\n\t $title = \"This is title of notification\";\n\n\t // Set POST variables\n\t $url = 'https://android.googleapis.com/gcm/send';\n\n\t $fields = array(\n\t 'registration_ids' => $registrationIDs,\n\t 'data' => array(\"post_id\" => \"1\", \"message\" => $message, \"body\" => $message, \"title\" => $title ),\n\t );\n\t $headers = array(\n\t 'Authorization: key=' . $apiKey,\n\t 'Content-Type: application/json'\n\t );\n\n\t // Open connection\n\t $ch = curl_init();\n\n\t // Set the URL, number of POST vars, POST data\n\t curl_setopt( $ch, CURLOPT_URL, $url);\n\t curl_setopt( $ch, CURLOPT_POST, true);\n\t curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);\n\t curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);\n\t //curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $fields));\n\n\t curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t // curl_setopt($ch, CURLOPT_POST, true);\n\t // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode( $fields));\n\n\t // Execute post\n\t $result = curl_exec($ch);\n\n\t // Close connection\n\t curl_close($ch);\n\t // print the result if you really need to print else neglate thi\n\t //echo $result;\n\t //print_r($result);\n\t //var_dump($result);\n\t}", "public function birthdayNotification($user_data, $post_data) {\n $CI = & get_instance();\n $CI->load->model('Common_model');\n try {\n $promises = array();\n $insert_data = array();\n // $i = 0;\n foreach ($user_data as $row => $val) {\n \n $insert_data['title'] = isset($post_data['title']) ? $post_data['title'] : \"\";\n $insert_data['sender_id'] = isset($post_data['sender']) ? $post_data['sender'] : \"\";\n $insert_data['message'] = $val['first_name'] . \" has their birthday today. Please click to share a special wish with them\";\n $insert_data['receive_id'] = isset($val['id']) ? $val['id'] : \"\";\n $insert_data['device_type'] = isset($val['device_type']) ? $val['device_type'] : \"\";\n $insert_data['type'] = isset($post_data['type']) ? $post_data['type'] : \"\";\n $insert_data['type_id'] = isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\";\n $insert_data['category'] = isset($val[\"type\"]) ? $val[\"type\"] : \"\";\n $insert_data['created_date'] = date('Y-m-d H:i:s');\n $id = $CI->Common_model->insert_single('budfie_notifications', $insert_data);\n \n $notificationCount = $this->getBadgeCount($val['id']);\n $message = [\n \"default\" => isset($post_data[\"title\"]) ? $post_data[\"title\"] : \"\",\n \"APNS\" => json_encode([\n \"aps\" => [\n \"alert\" => array(\n \"title\" => \"\",\n \"body\" => $val['first_name'] . \" has their birthday today. Please click to share a special wish with them\",\n \"subtitle\" => \"\"\n ),\n \"sound\" => \"default\",\n \"mutable-content\" => 1,\n \"category\" => \"budfieIcon\",\n \"badge\" => (int) $notificationCount,\n \"data\" => array(\n \"attachment_url\" => isset($val[\"rest_image\"]) ? $val[\"rest_image\"] : \"\",\n \"ext_link\" => $post_data[\"ext_link\"],\n \"url_title\" => $post_data[\"url_title\"],\n \"content_type\" => \"image\",\n \"type\" => $post_data[\"type\"],\n \"type_id\" => isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\",\n \"category\" => isset($val[\"type\"]) ? $val[\"type\"] : \"\"\n )\n ]\n ]),\n \"GCM\" => json_encode([\n \"data\" => [\"body\" => array(\n \"title\" => isset($post_data[\"title\"]) ? $post_data[\"title\"] : \"\",\n \"message\" => $val['first_name'] . \" has their birthday today. Please click to share a special wish with them\",\n \"type\" => $post_data[\"type\"],\n \"type_id\" => isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\",\n \"image\" => isset($val[\"rest_image\"]) ? $val[\"rest_image\"] : \"\",\n \"ext_link\" => $post_data[\"ext_link\"],\n \"url_title\" => $post_data[\"url_title\"],\n \"category\" => isset($val[\"type\"]) ? $val[\"type\"] : \"\"\n )]\n ])\n ];\n $promises[] = $this->sns->publishAsync([\n 'Message' => json_encode($message),\n 'MessageStructure' => 'json',\n 'TargetArn' => $val['device_arn']\n ]);\n// $insert_data[$i]['title'] = isset($post_data['title']) ? $post_data['title'] : \"\";\n// $insert_data[$i]['sender_id'] = isset($post_data['sender']) ? $post_data['sender'] : \"\";\n// $insert_data[$i]['message'] = $val['first_name'] . \" has their birthday today. Please click to share a special wish with them\";\n// $insert_data[$i]['receive_id'] = isset($val['id']) ? $val['id'] : \"\";\n// $insert_data[$i]['device_type'] = isset($val['device_type']) ? $val['device_type'] : \"\";\n// $insert_data[$i]['type'] = isset($post_data['type']) ? $post_data['type'] : \"\";\n// $insert_data[$i]['type_id'] = isset($val[\"type_id\"]) ? $val[\"type_id\"] : \"\";\n// $insert_data[$i]['category'] = isset($val[\"type\"]) ? $val[\"type\"] : \"\";\n// $insert_data[$i]['created_date'] = date('Y-m-d H:i:s');\n// $i++;\n }\n// $CI->Common_model->insert_batch('budfie_notifications', array(), $insert_data);\n $allPromise = \\GuzzleHttp\\Promise\\all($promises);\n $data_promise = $allPromise->wait();\n return [\n \"success\" => true,\n \"message\" => \"OK\",\n \"result\" => $data_promise\n ];\n } catch (\\Exception $error) {\n // file_put_contents(getcwd() . \"/application/sns_log/error.txt\", $error);\n return [\n \"success\" => false,\n \"message\" => \"error\"\n ];\n }\n }" ]
[ "0.62260795", "0.5874336", "0.5837464", "0.5736898", "0.57336634", "0.5710673", "0.5616766", "0.5607938", "0.5573254", "0.5520856", "0.54999804", "0.5481144", "0.545447", "0.54484874", "0.5429953", "0.54282135", "0.5409841", "0.53807515", "0.5347185", "0.53313774", "0.5328078", "0.53249407", "0.53203523", "0.530438", "0.5295171", "0.52878195", "0.52821165", "0.527951", "0.5253987", "0.52418876" ]
0.7711353
0
To print the JSON output, we use WordPress templates, which are used only in the frontend. When in the admin, we must manually load the template, and then exit
public function includeJSONOutputTemplateAndExit(): void { // Make sure the user has access to the editor if ($this->getUserAuthorization()->canAccessSchemaEditor()) { include $this->getTemplateHelpers()->getGenerateDataAndPrepareAndSendResponseTemplateFile(); die; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function actGettemplate() {\n $lName = $this -> getVal('name');\n \n $lPhraseTypes = CCor_Res::extract('code', 'eve_phrase', 'crpmaster');\n $lJobTyp = $lPhraseTypes[$this -> mSrc];\n \n echo Zend_Json::encode( CCms_Mod::getTemplate($lName, $this -> mJobId, $lJobTyp) );\n }", "public function json_response() {\n\t\theader( 'Content-Type: application/json' );\n\t\tdie( wp_json_encode( $this->get_response() ) );\n\t}", "function handler() {\n\n $obj = create_obj();\n print( $obj->get_template('home_ng','home'));\n\n\n }", "public function print_js_templates() {\n\n\t\t$templates = apply_filters(\n\t\t\t'crocoblock-wizard/dashboard/js-page-templates',\n\t\t\tarray(\n\t\t\t\t'main' => 'common/main',\n\t\t\t\t'header' => 'common/header',\n\t\t\t\t'logger' => 'common/logger',\n\t\t\t\t'video' => 'common/video',\n\t\t\t\t'choices' => 'common/choices',\n\t\t\t\t'progress' => 'common/progress',\n\t\t\t\t'progress_alt' => 'common/progress-alt',\n\t\t\t),\n\t\t\t$this->get_subpage()\n\t\t);\n\n\t\tforeach ( $templates as $name => $path ) {\n\n\t\t\tob_start();\n\t\t\tinclude Plugin::instance()->get_view( $path );\n\t\t\t$content = ob_get_clean();\n\n\t\t\tprintf(\n\t\t\t\t'<script type=\"text/x-template\" id=\"cbw_%1$s\">%2$s</script>',\n\t\t\t\t$name,\n\t\t\t\t$content\n\t\t\t);\n\t\t}\n\n\t}", "public function printTemplate($data){\n $template = new template(\"src/views/template.html\",$data);\n echo $template;\n }", "public function debug_templates(){\n $return = '<div style=\"border: 1px dotted red;\"><h3>Template Information</h3><p>Template Directory: <strong>'.print_r( $this->wpg3_options['templateDirectory'], true ).\"</strong></p>\";\n $return .= \"<pre>\".print_r( $this->templates, true ).\"</pre></div>\";\n return $return;\n }", "function template_rawdata()\n{\n\ttheme()->template_rawdata();\n}", "public function get_template_content() {\n \n $template = $_GET['templateID'];\n \n if( ! isset( $template ) ) {\n return;\n }\n \n $template_content = $this->templateInstance->get_template_content( $template );\n \n if ( empty ( $template_content ) || ! isset( $template_content ) ) {\n wp_send_json_error();\n }\n \n $data = array(\n 'template_content' => $template_content\n );\n \n wp_send_json_success( $data );\n \n }", "public function generate()\n {\n if (!$this->configurationHandler->isTheme() || $this->theme->getName() != $this->configurationHandler->handledTheme()) {\n return;\n }\n\n $templates = array_keys($this->templates[\"template\"]);\n $homepage = json_decode(file_get_contents($this->configurationHandler->pagesDir() . '/' .$this->configurationHandler->homepage() . '/page.json'), true);\n $homepageTemplate = $homepage[\"template\"];\n if (!in_array($homepageTemplate, $templates)) {\n $homepageTemplate = $templates[0];\n }\n\n $themeDefinition = array(\n \"home_template\" => $homepageTemplate,\n \"templates\" => $templates,\n );\n\n $this->synchronizeThemeSlots();\n FilesystemTools::writeFile($this->themeDir . '/theme.json', json_encode($themeDefinition));\n }", "public function get(){\r\n\t\t$file_name = _module_path.'app/'.$this->parent->_config('json_html_template');\r\n\t\t$this->parent->config->set('template',$file_name);\r\n\t\tif(!empty($this->parent->output['error']))\r\n\t\t\t$error = $this->parent->output['error'];\r\n\t\telse\r\n\t\t\t$error = NULL;\r\n\t\t//unset($this->parent->output['include'], $this->parent->output['error']);\r\n\t\t$output = new output_xsl($this->parent);\r\n\t\t$this->parent->output['html'] = $output->get();\r\n\t\tif($error)\r\n\t\t\t$this->parent->output['error'] = $error;\r\n\t\tunset(\r\n\t\t\t$this->parent->output['module'],\r\n\t\t\t$this->parent->output['language'],\r\n\t\t\t$this->parent->output['meta'],\r\n\t\t\t$this->parent->output['include'],\r\n\t\t\t$this->parent->output['session']\r\n\t\t);\r\n\t\t//var_dump($this->parent->output); die;\r\n\t\treturn json_encode($this->parent->output);\r\n\t}", "public static function render_template() {\n if ( ! current_user_can( 'manage_options' ) ) {\n wp_die( __( 'You do not have sufficient permissions to access this page.', 'wp-coach' ) );\n }\n\n // require_once WP_COACH_PATH . 'lib/admin/controllers/base.php';\n\n // May want to add actions instead of doing this big switch eg:\n //add_action('load-wp-coach-edit-galleries_page_vimeography-upload', array( $this, 'vimeography_upload_on_upload_pageload') );\n\n switch( current_filter() ) {\n\n case 'toplevel_page_wp-coach':\n\n require_once WP_COACH_PATH . 'lib/admin/controllers/courses.php';\n $controller = new WP_Coach_Courses;\n $template = $this->mustache->loadTemplate('courses/index');\n\n break;\n default:\n wp_die( sprintf( __('The admin template for \"%s\" cannot be found.', 'wp-coach'), current_filter() ) );\n break;\n }\n\n self::process_actions();\n echo $template->render($controller);\n }", "public function json_start_building () {\n\t\t// Check user prerequisites\n\t\tif (!current_user_can('manage_options')) wp_send_json_error(__('No way.', UpfrontThemeExporter::DOMAIN));\n\n\t\t// Can we even do this?\n\t\tif (!$this->_has_upfront()) wp_send_json_error(__('Core not available.', UpfrontThemeExporter::DOMAIN));\n\n\t\t// We can. Yay.\n\t\tswitch_theme('upfront');\n\n\t\twp_send_json_success(admin_url('admin.php?page=jwpb-builder'));\n\t}", "function vslider_theme_page() { ?>\n\t<div class=\"wrap\"><div id=\"icon-themes\" class=\"icon32\"><br /></div><h2>vSlider Themes Page</h2>\n <?php $url = 'http://www.vibethemes.com/vslidersetup/vslider-themes.php'; $request = new WP_Http; $result = $request->request( $url ); $json = $result['body']; echo $json; ?>\n\t</div>\n<?php }", "static function print_templates() {\n\t\t$names = array('map-controls', 'map-popup', 'map-loop', 'map-item');\n\t\tif (Mappress::$pro)\n\t\t\t$names = array_merge($names, array('mashup-popup', 'mashup-loop', 'mashup-item'));\n\n\t\tforeach($names as $name) {\n\t\t\t$template = self::get_template($name);\n\t\t\tprintf(\"<script type='text/html' id='mapp-tmpl-$name'>%s</script>\", $template);\n\t\t}\n\t}", "function theme_template()\n{\n\tglobal $wp_query;\n\tstatus_header( 200 );\n\t$wp_query->is_404 = false;\n\n\tglobal $template;\n\n\tif (get_query_var('q') != '' || get_query_var('qunicode') != '')\n\t{\n\t\t$template = get_query_template('tpl-search');\n\t\tinclude ($template);\n\t\texit();\n\t}\n\telse if (get_query_var('yid') != '')\n\t{\n\t\t$template = get_query_template('tpl-select');\n\t\tinclude ($template);\n\t\texit();\n\t}\n\telse if (get_query_var('did') != '')\n\t{\n\t\t$template = get_query_template('tpl-download');\n\t\tinclude ($template);\n\t\texit();\n\t}\n\telse if (get_query_var('letter1') != '')\n\t{\n\t\t$template = get_query_template('tpl-artist');\n\t\tinclude ($template);\n\t\texit();\n\t}\n\telse if (get_query_var('letter2') != '')\n\t{\n\t\t$template = get_query_template('tpl-album');\n\t\tinclude ($template);\n\t\texit();\n\t}\n\n}", "public function templates() {\n\t\trequire_once FUSION_BUILDER_PLUGIN_DIR . 'inc/admin-screens/templates.php';\n\t}", "function getTemplateList() {\n\t$jasonStr = file_get_contents('templates/tpls/tpl-list.json');\n\treturn $jasonStr;\n}", "function tco_under_construction_custom_output( $original_template ) {\n\n require( TCO_UNDER_CONSTRUCTION_PATH . '/functions/options.php' );\n\n $custom_post = get_post( (int) $tco_under_construction_custom );\n\n if ( ! is_a( $custom_post, 'WP_Post' ) ) {\n return $original_template;\n }\n\n GLOBAL $wp_query;\n GLOBAL $post;\n\n $post = $custom_post;\n\n $wp_query->posts = array( $post );\n $wp_query->queried_object_id = $post->ID;\n $wp_query->queried_object = $post;\n $wp_query->post_count = 1;\n $wp_query->found_posts = 1;\n $wp_query->max_num_pages = 0;\n $wp_query->is_404 = false;\n $wp_query->is_page = true;\n $wp_query->is_singular\t = true;\n\n if ( isset( $tco_under_construction_bypass_password ) && !empty ( $tco_under_construction_bypass_password ) ) {\n add_action( 'wp_footer', 'tco_under_construction_bypass_output' );\n }\n\n return get_page_template();\n}", "function print_direct_scripts() {\n\t\tif ((is_admin() && !isset($_GET['page'])) || (is_admin() && isset($_GET['page']) && $_GET['page'] != 'uncode-font-stacks')) {\n\t\t\treturn;\n\t\t}\n\n\t\tglobal $uncodefont_typekit_text, $uncodefont_typekit_error;\n\n\t\tif (isset($this->options['typekit_kit_ID']) && $this->options['typekit_kit_ID'] !== '') {\n\t\t\tif (isset($this->options['typekit_api_key'])) {\n\t\t\t\t$api_key = $this->options['typekit_api_key'];\n\t\t\t\t$url = \"https://typekit.com/api/v1/json/kits/\" . $this->options['typekit_kit_ID'];\n\t\t\t\t$curl_args = array(\n\t\t\t\t\t'sslverify' => false,\n\t\t\t\t\t'timeout' => 20000,\n\t\t\t\t);\n\t\t\t\t$script = '';\n\t\t\t\t$response = wp_remote_request($url.\"?token=$api_key\", $curl_args);\n\n\t\t\t\t$uncodefont_typekit_text = $uncodefont_typekit_error = '';\n\t\t\t\tif (!is_wp_error($response)) {\n\t\t\t\t\t$response = wp_remote_retrieve_body($response);\n\t\t\t\t\t$response = json_decode($response);\n\n\t\t\t\t\tif (isset($response->kit)) {\n\t\t\t\t\t\t$uncodefont_typekit_text .= \"<div>\";\n\t\t\t\t\t\t$uncodefont_typekit_text .= \"<strong>\".esc_html__('Your kits:', 'uncode').\" </strong>\";\n\t\t\t\t\t\t$kit_string = \"\";\n\t\t\t\t\t\t$family_string = \"\";\n\t\t\t\t\t\t$kit_position = 0;\n\n\t\t\t\t\t\t$kit = $response->kit;\n\n\t\t\t\t\t\tif (isset($kit->id)) {\n\t\t\t\t\t\t\t$script .= \"<script type='text/javascript' src='//use.typekit.com/{$kit->id}.js'></script>\\n\";\n\n\t\t\t\t\t\t\tif (is_admin()) {\n\t\t\t\t\t\t\t\t$kit_position++;\n\t\t\t\t\t\t\t\t$kit_url = $url.\"?token=$api_key\";\n\t\t\t\t\t\t\t\t$kit_response = wp_remote_request($kit_url, $curl_args);\n\t\t\t\t\t\t\t\tif (!is_wp_error($kit_response)) {\n\t\t\t\t\t\t\t\t\t$kit_response = wp_remote_retrieve_body($kit_response);\n\t\t\t\t\t\t\t\t\t$kit_response = json_decode($kit_response);\n\n\t\t\t\t\t\t\t\t\tif (isset($kit_response->kit->name)) {\n\t\t\t\t\t\t\t\t\t\t$families = $kit_response->kit->families;\n\t\t\t\t\t\t\t\t\t\t$kit_string .= \"<a id='uf-tk-{$kit_response->kit->id}' class='uf-group-key uf-group-key-{$kit_response->kit->id} uf-group-key-tk' href='#'>{$kit_response->kit->name} (\".count($families).\")</a> | \";\n\t\t\t\t\t\t\t\t\t\tif (count($families) > 0) {\n\t\t\t\t\t\t\t\t\t\t\t$family_string .= \"<div id='uf-tk-{$kit_response->kit->id}-fonts' class='uf-fonts-for uf-fonts-for-{$kit_response->kit->id} uf-group-key-position-$kit_position uf-group-key-for-tk'><ul>\";\n\t\t\t\t\t\t\t\t\t\t\tforeach ($families as $family) {\n\t\t\t\t\t\t\t\t\t\t\t\t$family_string .= $this->create_font_line_item(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Adobe Fonts',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'tk',\n\t\t\t\t\t\t\t\t\t\t\t\t\t$family,\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'family' => 'name',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'generic' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'stub' => 'css_stack',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'variants' => 'variations',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'subsets' => 'subset',\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$family_string .= \"</ul></div>\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($kit_string != '') {\n\t\t\t\t\t\t\t$kit_string = substr($kit_string, 0, -2);\n\t\t\t\t\t\t\t$uncodefont_typekit_text .= $kit_string;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$uncodefont_typekit_text .= \"</div>\";\n\t\t\t\t\t\t$uncodefont_typekit_text .= $family_string;\n\t\t\t\t\t\t$script .= \"<script type='text/javascript'>try{Typekit.load();}catch(e){}</script>\\n\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$uncodefont_typekit_text .= esc_html__('No kits found for the API key you provided.', 'uncode');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$uncodefont_typekit_error .= $this->connection_failed('Adobe Fonts', false);\n\t\t\t\t}\n\t\t\t\tif (!is_admin()) {\n\t\t\t\t\t$echo_script = false;\n\t\t\t\t\tforeach ($this->font_stack as $key => $font) {\n\t\t\t\t\t\tif ($font['source'] === 'Adobe Fonts' || $font['source'] === 'Typekit') $echo_script = true;\n\t\t\t\t\t}\n\t\t\t\t\tif ($echo_script) {\n\t\t\t\t\t\techo do_shortcode($script);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo do_shortcode($script);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$uncodefont_typekit_text .= esc_html__('No kits ID inserted.', 'uncode');\n\t\t}\n\t}", "public function index()\n {\n //\n $templates = Templates::get();\n return $templates->toJson(JSON_PRETTY_PRINT);\n\n }", "public function render() {\n parent::render();\n header(\"Content-type: application/json; charset=utf-8\");\n print json_encode($this->data);\n }", "public function print_data() {\n\t\t$menu_data = sprintf(\n\t\t\t'var InitialMenu = %s;'.PHP_EOL.'var SitePaths = %s;',\n\t\t\t$this->add_json_data(),\n $this->add_json_paths()\n\t\t);\n\t\twp_add_inline_script( WPGURUS_APP, $menu_data, 'before' );\n\t}", "public function sael_template_data_loads() {\n $template_id = $_POST['template_id'];\n $with_page = $_POST['with_page'];\n\n $template = SAEL_Temp_Remote::sael_get_instance()->get_template_content($template_id);\n\n if (is_wp_error($template)) {\n return $template;\n }\n\n // Finally create the page.\n $page_id = $this->create_page($template, $with_page);\n echo ((int) $page_id ? $page_id : 'problem');\n exit;\n }", "public function hook() {\r\n\t\tif ( is_admin() ) {\r\n\t\t\tadd_action( 'admin_footer', array( $this, 'render_json' ) );\r\n\t\t\tadd_action( 'customize_controls_print_footer_scripts', array( $this, 'render_json' ) );\r\n\t\t} else {\r\n\t\t\tadd_action( 'wp_footer', array( $this, 'render_json' ) );\r\n\t\t}\r\n\t}", "protected function content_template() {}", "public function postlistr_js_template() {\n\t\tinclude_once( 'postlistr-tmpl.php' );\n\t}", "public function print_page()\n {\n $data = [ 'result' => $this->response->get_return_code() ] + $this->response->get_response_data();\n\n if ($this->request->sapi == 'cli')\n {\n echo json_encode($data, JSON_PRETTY_PRINT) . \"\\n\";\n }\n else\n {\n echo json_encode($data);\n }\n }", "function print_template($__template, $vars=array(), $__layout='store') {\r\n\textract($vars);\r\n\r\n\tob_start();\r\n\trequire 'templates/' . $__template . '.php';\r\n\t$page_content = ob_get_contents();\r\n\tob_end_clean();\r\n\r\n\tif ( $__layout ) {\r\n\t\trequire 'templates/layouts/' . $__layout . '.php';\r\n\t}\r\n\telse {\r\n\t\techo $page_content;\r\n\t}\r\n}", "function wc_ref_render_template($template, $data = []) {\n extract($data, EXTR_SKIP);\n ob_start();\n include sprintf(__DIR__ . '/templates/%s.php', $template);\n return ob_get_clean();\n}", "function vslider_tutorials_page() { ?>\n\t<div class=\"wrap\"><div id=\"icon-users\" class=\"icon32\"><br /></div><h2>vSlider Tutorials</h2>\n <?php $url = 'http://www.vibethemes.com/vslidersetup/vslider-tutorials.php'; $request = new WP_Http; $result = $request->request( $url ); $json = $result['body']; echo $json; ?>\n\t</div>\n<?php }" ]
[ "0.62540805", "0.62229115", "0.61544913", "0.6104428", "0.60757667", "0.5971808", "0.5949781", "0.59437627", "0.59243923", "0.59035665", "0.58681506", "0.58479446", "0.58469665", "0.58322996", "0.58268243", "0.58231086", "0.5820813", "0.5802925", "0.5758462", "0.5741861", "0.57404524", "0.5721608", "0.57211685", "0.5710203", "0.5706137", "0.56987906", "0.56690115", "0.5659153", "0.5658751", "0.5645538" ]
0.71764445
0
Email formating, to display only one product, set up $pnOppDetailPk
private function _displayEmailOpportunity($paOpp, $pnOppDetailPk = 0) { if(!assert('is_numeric($pnOppDetailPk)')) return ''; if(!assert('is_array($paOpp) && !empty($paOpp)')) return ''; $oHTML = CDependency::getCpHtml(); $oLogin = CDependency::getCpLogin(); $oPage = CDependency::getCpPage(); $asUserData = $oLogin->getUserList(0, false, true); $sURL = $oPage->getUrl($paOpp['cp_uid'], $paOpp['cp_action'], $paOpp['cp_type'], (int)$paOpp['cp_pk']); $sPic = $oHTML->getPicture('/common/pictures/items/'.$paOpp['cp_type'].'_16.png'); $oCompItem = CDependency::getComponentByUid($paOpp['cp_uid']); $sItemName = ($oCompItem) ? $oCompItem->getItemName($paOpp['cp_type'], (int)$paOpp['cp_pk']) : 'Related Item'; $sItemLabel = $oHTML->getLink($sPic.' '.$sItemName, $sURL); $sHTML = ''; $sBr = $oHTML->getCR(1); $sHTML.= $oHTML->getBlocStart('', array('style' => 'padding:0 10px 0 10px; margin-bottom:10px; border-left:1px solid #e5eaec;')); $sHTML.= $oHTML->getBloc('', $paOpp['title'], array('style' => 'font-size:18px;')).$sBr; $sHTML.= $oHTML->getBloc('', $sItemLabel).$sBr; $sHTML.= $oHTML->getBloc('', 'By : <strong>'.$oLogin->getUserNameFromData($asUserData[$paOpp['loginfk']], true).'</strong>').$sBr; foreach($paOpp['details'] as $aDetail) { if(($pnOppDetailPk==0) || ($pnOppDetailPk==(int)$aDetail['opportunity_detailpk'])) $sHTML.= $oHTML->getBloc('', date('M-Y', strtotime($aDetail['month'])).': '.$aDetail['product'].', '.formatNumber((int)$aDetail['amount'], '', ',', '¥')).$sBr; } $sHTML.= $oHTML->getBlocEnd(); return $sHTML; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewMyPendingDelivery($orderproductID,$p){\n $product = new productModel();\n $product->orderproductID = $orderproductID;\n $product->p = $p;\n return $product->viewMyPendingDelivery();\n }", "function viewMyCompleteDelivery($orderproductID,$p){\n $product = new productModel();\n $product->orderproductID = $orderproductID;\n $product->p = $p;\n return $product->viewMyCompleteDelivery();\n }", "function showProductDetail(){\r\n\t\t$rLanguage = CheckLanguageChange();\r\n\t\t/*$q_product_desc=getResultSet(\"SELECT product_id, model, image, price FROM \".DB_PREFIX.\"product WHERE product_id=\".$product_id);*/\r\n\t\techo '<meta name=\"title\" content=\"'.$this->getProductName().'\" />';\r\n\t\techo '<meta name=\"description\" content=\"'.$this->getShopName().' $'.$this->getProductPrice().': '.strip_tags($this->getProductDescription()).'\" />';\r\n\t\techo '<link rel=\"image_src\" href=\"'.$this->getProductImage().'\" />';\r\n\t\techo '<table border=\"0\" width=\"100%\"><tr>';\r\n\t\t\techo '<td><div class=\"photo_view\">';\r\n\t\t\t\techo '<ul id=\"gallery\" class=\"gallery clearfix\">';\r\n\t\t\t\t\techo '<li><a href=\"'.$this->getProductImage().'\" rel=\"prettyPhoto[gallery2]\" title=\"\"><img src=\"'.$this->getProductImage().'\" /></a></li> ';\r\n\t\t\t\t\techo $this->getProductAllImage();\r\n\t\t\t\techo '</ul>';\t\r\n\t\t\techo '</div></td>';\r\n\t\t\techo '<td valign=\"top\">';\r\n\t\t\t\techo '<div class=\"product_desc\">';\r\n\t\t\t\t\techo '<div class=\"product_name\">'.$this->getProductName().'</div>';\t\r\n\t\t\t\t\t//href=\"#\" link to store profile\r\n\t\t\t\t\t//echo '<div class=\"shop_name\"><span class=\"label\">Store:</span> <a href=\"'.$this->getShopUrl().'\"><span style=\"border: 1px #F00 solid;\">'.$this->getShopName().'</span></a></div>';\r\n\t\t\t\t\techo '<div class=\"shop_name\"><a href=\"'.$this->getShopUrl().'\"><span class=\"bg_icon\" style=\"background-image: url('.HTTP_DOMAIN.'store/image/icon/store_icon.png);\">'.$this->getShopName().'</span></a></div>';\r\n\t\t\t\t\t//echo ' <div class=\"price\"><span class=\"label\">Price:</span><span class=\"cost\"> $'.$this->getProductPrice().'</span></div>';\r\n\t\t\t\t\techo ' <div class=\"price\"><span class=\"cost\" style=\"background-image: url('.HTTP_DOMAIN.'store/image/icon/price_tag.png);\"> $'.$this->getProductPrice().'</span></div>';\r\n\t\t\t\t\t//href=\"#\" link to add to cart page of shop\r\n\t\t\t\t\techo '<div class=\"row\" style=\"text-align: right;height: 37px;\"><a href=\"'.$this->getShopUrl().'index.php?route=product/product&product_id='.$this->product_id.'\" style=\"text-decoration:none;\"><img src=\"'.HTTP_DOMAIN.'store/image/icon/btn_gotobuy.png\" style=\"border: none;\"></img></a></div>';//'.$rLanguage->text(\"Go to buy\").'\r\n\t\t\t\t\techo '<div class=\"row\" style=\"height: 33px;\">';\r\n\t\t\t\t\t\techo '<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">';\r\n\t\t\t\t\t\t\techo '<tr>';\r\n\t\t\t\t\t\t\t\techo '<td>';\r\n \techo '<div class=\"fb-like\" data-href=\"'.HTTP_DOMAIN.'?page=productdetail&product='.$this->product_id.'\" data-send=\"false\" data-layout=\"button_count\" data-width=\"30\" data-show-faces=\"false\" data-font=\"tahoma\" style=\"width: 80px;margin-bottom: 8px;\"></div>';\r\n\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\techo '<td>';\r\n\t\t\t\t\t\techo '<div style=\"margin-bottom: 10px;\"><a class=\"facebook fb-share-button\" href=\"http://www.facebook.com/share.php?u='.HTTP_DOMAIN.'\" onclick=\"return fbs_click()\" target=\"_blank\"><span>Share</span></a></div>';\r\n\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\techo '<td>';\r\n\t\t\t\t\t\techo '<div style=\"padding-left: 10px;margin:0px;\"><g:plusone size=\"medium\" annotation=\"bubble\" href=\"'.HTTP_DOMAIN.'?page=productdetail&product='.$this->product_id.'\"></g:plusone></div>';\r\n\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\techo '</tr>';\r\n\t\t\t\t\t\techo '</table>';\r\n echo '</div>';\r\n\t\t\t\t\techo '<div class=\"row shop_name\" style=\"font-size: 12px;\"><a href=\"?page=store&id='.$this->getShopId().'&product='.$this->product_id.'\"><span style=\"background-image: url('.HTTP_DOMAIN.'store/image/icon/info.png);background-position: 0px center; background-repeat: no-repeat; padding: 2px 2px 2px 20px; border:0px #F00 solid; font-size: 12px;\">'.$rLanguage->text(\"About Store\").'</span></a></div>';\r\n\t\t\t\techo '</div>';\r\n\t\t\techo '</td>';\r\n\t\techo '</tr></table>';\r\n\t}", "public function renderDetail($id = 0)\r\n\t{\r\n $instance = new Produkt;\r\n\t\t$item = $instance->find($id)->fetch();\r\n\t\t$vazby = $instance->countProdVazby($id);\r\n\t\tif(!$item){$this->redirect('default');}\r\n\t\t$this->setIntoMySet(4, $id);\r\n\t\t$stavy = $instance->getStavProduct($id)->fetchAssoc('id');\r\n\r\n\t\t// Kurzy\r\n//\t\t$rater = $this['rater'];\r\n//\t\t$this->template->is_rates = TRUE;\r\n\t\t\r\n\t\t\r\n//\t\t$eur = $instance->getGoogleExchange(\"EUR\");\r\n//\t\t$usd = $instance->getGoogleExchange(\"USD\");\r\n//\t\t$eurusd = $instance->getGoogleExchange(\"EUR\",\"USD\", 3);\r\n//\t\tdd($usd,\"Google USD\");\r\n//\t\tdd($eurusd,\"Google USD/EUR\");\r\n//\t\t$this->template->eur = $eur;\r\n//\t\t$this->template->usd = $usd;\r\n//\t\t$this->template->eurusd = $eurusd;\r\n\t\t\r\n\t\t$this->template->stav = $stavy;\r\n\t\t$this->template->countBOM = $vazby->bom;\r\n\t\t$this->template->countTPV = $vazby->tpv;\t\t\r\n\t\t\r\n\t\t$this->template->item = $item;\r\n\t \t$this->template->titul = $item->nazev;\r\n\t\t$this->template->idp = $item->id;\r\n\t\t$this->idp = $item->id;\t\r\n\t\t$this->idn = $item->idn;\r\n\t\t$this->template->inabidka = $this->idn;\r\n\t\t\r\n\t\t$sazo = new SazbaO;\t\r\n $sazbo = $sazo->show($item->idsso)->fetchAll();\r\n $this->template->sazbyop = $sazbo;\t\t\r\n\t\t\r\n\t\t\r\n\t\t$idss = $item->idss;\r\n\t\t$sazb = new Sazba;\t\r\n\t\t$rate = $sazb->show(0, $id);\r\n\t\t$rates = $sazb->dataIntoAssoc($rate,'idss');\r\n\t\t//dd($rates, 'RATES');\r\n\t\t$this->template->sazby = $rates[$idss];\r\n\t\t$this->template->rates = $rates;\r\n\t\t\r\n\t\t$costs = $instance->costs($id);\r\n\t\t$isnaklady = count($costs)>0;\r\n $this->template->isnaklady = $isnaklady;\r\n\t\t$this->template->costs = $costs;\r\n\r\n\t\t$oper = new Operace;\r\n\t\t$capac = $oper->sumKapacitaDruh($id, $this->getIdFromMySet(3));\r\n $this->template->capac = $capac;\r\n\t\t$this->template->mypar = $this->mpars;\r\n\t\t$this->template->typycen = $oper->getTypyCen();\r\n\t\t//dd($capac,'CAPACITY');\r\n\t\t$prices = $instance->prices($id, $this->idn, false);\r\n\t\t$isceny = count($prices)>0;\r\n\t\t//dd($prices,'PRICES');\r\n $this->template->isceny = $isceny;\r\n $this->template->prices = $prices;\r\n\t\t$kalk = new Kalkul;\r\n\t\t//$aval = $kalk->calcAddedValue($id, $this->idn);\r\n\t\t$ava = new CalcClass($id, $this->idn);\r\n\t\t$aval = $ava->getAval();\r\n\t\t$descr = $ava->descrAval();\r\n\t\tdd($aval, 'AVAL');\r\n\t\tdd($descr, 'AVAL popis');\r\n\t\t$this->template->aval = $aval;\r\n\t\t$this->template->descr = $descr;\r\n\t\t$hist = $instance->getProductHistory($id);\r\n\t\t$this->template->history = $hist;\r\n\t\t$poc = new Pocet;\r\n $pocet = $poc->show($id)->fetchAll();\r\n $this->template->pocet = $pocet;\r\n\t\t$ida = $kalk->getActiveAvalId($aval);\r\n\t\t$data_bar = $instance->getProdPrice4BarGraph($id);\r\n\t\tif($ida>0){\r\n\t\t\t$this->template->data_bar = $aval[$ida]['databar'];\r\n\t\t\t$this->template->factor = $aval[$ida]['factor'];\r\n\t\t} else {\r\n\t\t\t$this->template->data_bar = $data_bar;\r\n\t\t\t$this->template->factor = 0;\r\n\t\t}\r\n\t\t$mat = new Material;\r\n\t\t$currdata = $mat->groupByCurrency($id);\r\n\t\t$cnt_curr = count($currdata);\r\n\t\t$vol_curr = $mat->dataPairsForGraph($currdata, 0, 3, 1, 1, $slice = 'EUR', $colors = array(11,1,8,2,4,5,6,7));\r\n\t\tif($cnt_curr==1){\r\n\t\t\tif($currdata[0]['value']<0.1){$currdata=FALSE;}\r\n\t\t}\r\n\t\t$this->template->currdata = $currdata;\r\n\t\t$this->template->vol_curr = $vol_curr;\r\n\t\t$this->template->cnt_curr = $cnt_curr;\r\n\t\t//dd($currdata,\"CurrData\");\r\n\t\t\t\t\r\n\t}", "public function detail($product_id=\"\")\n\t{\n\t\n\t\tif(empty($product_id)){redirect(site_url(''),'refresh');}\n\t\t\n\t\t//$this->breadcrumbs->push('Live Auction', '/'); //second parameter is link\n\t\t\n\t\t//store current date in local variable.\n\t\t$this->current_date = $this->general->get_local_time('time');\n\t\t$this->data['current_date'] = $this->current_date;\n\t\t$this->data['page_for'] = 'bid';\n\t\t$this->data['user_id'] = $this->session->userdata(SESSION.'user_id');\n\n\t\t//var_dump($this->data['paypal_verified']); exit;\n\t\t\n\t\t$this->data['product'] = $this->home_module->get_auction_product_details($host_id);\n\t\t//echo \"<pre>\"; print_r($this->data['product']); echo \"</pre>\";\n\t\t\n\t\t//redirect to home page if no data found\n\t\tif(!$this->data['product'])\t{ redirect(site_url(''),'refresh');\t}\n\t\t\n\t\t//now get additional fields in product \n\t\t$this->data['custom_fields'] = $this->home_module->get_custom_fields_values_by_product_id($this->data['product']->product_id);\n\t\t\n\t \t$this->page_title = WEBSITE_NAME;\n\t\t$this->data['meta_keys'] = WEBSITE_NAME;\n\t\t$this->data['meta_desc'] = WEBSITE_NAME;\n\t\t\n\t\t$this->template\n\t\t\t->set_layout('general')\n\t\t\t->enable_parser(FALSE)\n\t\t\t->title($this->page_title)\t\n\t\t\t->build('v_auction_detail', $this->data);\t\n\t}", "function misha_editable_order_meta_general( $order ){ \n$order_id = $order->id;\n?>\n\n<div id=\"custom_paypal_email_id\" class=\"custom-wpc-loader\">\n</div>\n\n<?php\n}", "public function publishSaveAction() {\n /**\n * Get the entity_id\n */\n Mage::getSingleton ( 'customer/session' )->setBeforeAuthUrl ( Mage::helper ( 'airhotels' )->getformUrl () );\n /**\n * Get customer id from session\n * \n * @var unknown\n */\n $customerId = Mage::getSingleton ( 'customer/session' )->getCustomer ()->getId ();\n if ($customerId) {\n if (Mage::getSingleton ( 'customer/session' )->getCurrentExperienceId ()) {\n /**\n * Get experience id\n * \n * @var $currentExperienceId\n */\n $currentExperienceId = Mage::getSingleton ( 'customer/session' )->getCurrentExperienceId (); \n /**\n * Get the property Approval Value\n */\n $product = Mage::getModel ( 'catalog/product' )->load ( $currentExperienceId );\n $propertyApproval = Mage::getStoreConfig ( 'airhotels/custom_email/property_approval' ); \n if ($propertyApproval && $product['propertyapproved'] != 1) {\n /**\n * Set notice message for admin approval.\n */\n Mage::getModel ( 'airhotels/property' )->adminApproval ( $currentExperienceId );\n Mage::getSingleton ( 'core/session' )->addNotice ( $this->__ ( \"Property details hosted is awaiting admin's approval\" ) );\n /**\n * Redirect to list url action.\n */\n return $this->_redirectUrl ( Mage::helper ( 'airhotels/product' )->getshowlisturl () );\n } else {\n /**\n * Add new proerty.\n */\n Mage::getModel ( 'airhotels/property' )->newProperty ( $currentExperienceId );\n } \n /**\n * setPropertyapproved(0) - Experience approve status is no,setBookingapproved(1) - Experience approve status is yes.\n */\n $product->setPropertyapproved ( 1 );\n Mage::app ()->setCurrentStore ( Mage_Core_Model_App::ADMIN_STORE_ID );\n $product->save ();\n /**\n * setPropertyapproved(0) - Experience approve status is no,setBookingapproved(1) - Experience approve status is yes.\n */\n Mage::app ()->setCurrentStore ( 0 );\n Mage::getSingleton ( 'customer/session' )->unsCurrentExperienceId ();\n /**\n * Set property added success message.\n * Redirect to list url action.\n */\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( 'Experience has been published' ) );\n return $this->_redirectUrl ( Mage::helper ( 'airhotels/product' )->getshowlisturl () );\n }\n } else {\n /**\n * Set login error messages.\n * Redirect to login url.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You are not currently logged in' ) );\n $this->_redirectUrl ( Mage::helper ( 'customer' )->getLoginUrl () );\n }\n }", "function getProductDetail()\r\n{\r\n\tglobal $DB, $objComm;\r\n\t$SQL = $SQL=\"SELECT \r\n\t\tproduct_type.product_type,\r\n\t\tproduct_type.id\tAS ptID,\t\r\n\t\tproduct.id AS pID,\r\n\t\tproduct.product_type_id,\r\n\t\tproduct.product_name,\r\n\t\tproduct.product_image,\r\n\t\tproduct.product_price,\r\n\t\tproduct.product_variations,\r\n\t\tproduct.product_size,\r\n\t\tproduct.product_color,\r\n\t\tSUBSTRING(product.product_desc,1,50) AS product_desc,\r\n\t\tDATE(product.product_date) AS product_date,\r\n\t\tproduct.product_status,\r\n\t\tproduct.product_total_products,\r\n\t\tproduct.product_remain_total_products\r\n\t\tFROM product_type \r\n\t\tJOIN product ON product_type.id=product.product_type_id\r\n\t\tWHERE product_status='Active' AND product.id='\".$_REQUEST[\"id\"].\"' AND product.product_remain_total_products > 0 ORDER BY product_type.id ASC\";\r\n\r\n\t\t$DATAproduct=$DB->fetchOne($SQL,\"\");\r\n\t\t$DATAproduct->status=\"OK\";$DATAproduct->msg=\"WELL DONE\";\r\n\techo json_encode($DATAproduct);\r\n}", "function getProductDetail($pdId, $lang)\n\n{\n\t$_SESSION['shoppingReturnUrl'] = $_SERVER['REQUEST_URI'];\n\n\t// get the product information from database\n\n\t$sql = \"SELECT (SELECT text\n FROM language_items\n WHERE (lang='_en' or lang='$lang')\n AND item= ( select concat('product_',pd_reference,'_name') from tbl_product where pd_id = $pdId)\n AND text <> ''\n ORDER by lang asc limit 1) as pd_name, \n\t\t\t(SELECT text \n\t\t\t FROM language_items \n\t\t\t WHERE (lang='_en' or lang='$lang') \n\t\t\t \tAND item= ( select concat('product_',pd_reference,'_desc') from tbl_product where pd_id = $pdId)\n\t\t\t \tAND text <> '' \n\t\t\t ORDER by lang asc limit 1) as pd_description, \n\t\t\t(SELECT text \n\t\t\t FROM language_items \n\t\t\t WHERE (lang='_en' or lang='$lang') \n\t\t\t\tAND item=(select concat('product_',pd_reference,'_desc2') from tbl_product where pd_id = $pdId) \n\t\t\t\tAND text <> ''\n\t\t \t ORDER by lang asc limit 1) as pd_description2,\n\t\t\tta_price, pd_image, pd_image_large, sum(pi_stock_qty) as pd_qty, count(pi_flavor) as nof_stock, pi_weight, pi_shipping_weight, pd_default_order_qty, pd_active, pd_vo_group\n\t\t\tFROM tbl_product, tbl_product_item, tbl_tariff \n\t\t\tWHERE pd_id = $pdId\n\t\t\tAND pd_id = ta_pd_id\n\t\t\tAND ta_category = 0\n\t\t\tAND pi_pd_id = pd_id\n\t\t\tAND pd_active = 1\n\t\t\tGROUP BY pd_id\";\n\n\t$result = dbQuery($sql);\n\n\t$row = dbFetchAssoc($result);\n\n\textract($row);\n\n\t$row['pd_description'] = nl2br($row['pd_description']);\n\t$row['pd_description2'] = nl2br($row['pd_description2']);\n\n\tif ($row['pd_image']) {\n\t\t$row['pd_image'] = PRODUCT_IMAGE_DIR . $row['pd_image'];\n\t} else {\n\t\t$row['pd_image'] = PRODUCT_IMAGE_DIR . 'no-image-large.png';\n\t}\n\n\tif ($row['pd_image_large']) {\n\t\t$row['pd_image_large'] = PRODUCT_IMAGE_LARGE_DIR . $row['pd_image_large'];\n\t} else {\n\t\t$row['pd_image_large'] = PRODUCT_IMAGE_LARGE_DIR . 'no-image-large.png';\n\t}\n\n\t$row['cart_url'] = \"miniCart.php?action=add&p=$pdId\";\n\n\treturn $row;\n\n}", "public function modelDetailComment($product_id,$recordPerPage){\n\t\t\t$p = isset($_GET[\"p\"]) && is_numeric($_GET[\"p\"]) && $_GET[\"p\"] > 0 ? ($_GET[\"p\"]-1) : 0;\t\t\t\n\t\t\t//lay tu ban ghi nao\n\t\t\t$from = $p * $recordPerPage;\n\t\t\t//---\n\t\t\t//lay bien ket noi csdl\n\t\t\t$conn = Connection::getInstance();\n //\n\t\t\t//thuc hien truy van\n\t\t\t$query = $conn->query(\"SELECT r.customer_email, r.product_id as id, r.star as star, c.danhgia as danggia, c.name as name FROM rating AS r, comments as c WHERE r.customer_email=c.customer_email and r.product=$product_id limit $from,$recordPerPage\");\n\t\t\t//lay toan bo ket qua tra ve\n\t\t\treturn $query->fetchAll();\t\t\t\n\t\n\t\t\t\n\t\t}", "public function actionProductDetail($product) {\r\n\r\n if (isset(Yii::$app->user->identity->id)) {\r\n $user_id = Yii::$app->user->identity->id;\r\n } else {\r\n $user_id = '';\r\n }\r\n $shipping_limit = Settings::findOne('1')->value;\r\n $product_details = Product::find()->where(['canonical_name' => $product, 'status' => '1'])->one();\r\n if (!empty($product_details)) {\r\n $related_poduct = Product::find()->where(['brand' => $product_details->brand, 'gender_type' => $product_details->gender_type])->andwhere(['<>', 'id', $product_details->id])->all();\r\n $this->RecentlyViewed($product_details);\r\n $product_reveiws = \\common\\models\\CustomerReviews::find()->where(['product_id' => $product_details->id, 'status' => '1'])->all();\r\n \\Yii::$app->view->title = $product_details->meta_title;\r\n \\Yii::$app->view->registerMetaTag(['name' => 'keywords', 'content' => $product_details->meta_keywords]);\r\n \\Yii::$app->view->registerMetaTag(['name' => 'description', 'content' => $product_details->meta_description]);\r\n return $this->render('product_detail', [\r\n 'product_details' => $product_details,\r\n 'product_reveiws' => $product_reveiws,\r\n 'user_id' => $user_id,\r\n 'shipping_limit' => $shipping_limit,\r\n 'related_poduct' => $related_poduct,\r\n ]);\r\n } else {\r\n return $this->redirect(['site/error']);\r\n }\r\n }", "function productDetail($id) {\n $item = $this->model->get($id);\n if($item) {\n $this->view->showItem($item);}\n else {\n $this->view->showError('Product out of stock');\n }\n }", "public function get_productdetails($editpdata){\n\t\t$editpdata = $_REQUEST[ 'editpdata' ];\n\t\t$this -> db -> select('\n\t\t\tsum(si.currentstock) as currentstock,\n\t\t\tip.id as pid, ip.itemcode, ip.itemimage, ip.itemname, ip.sellprice, ip.remark, ii.createdby, ii.created_at, sti.storename, sta.statustitle, group_concat(siz.sizeshortcode) AS sizecode, group_concat(si.currentstock) AS stock, ip.store\n\t\t');\n//\t\t, ii.id as iid,ii.size, ii.color,, ii.updatedby, ii.updated_at, ii.itemid, ii.parentid, ii.store, ii.status\n\t\t$this -> db -> from('item_parent as ip');\n\t\t$this -> db -> join('item_info as ii', 'ip.id = ii.parentid', 'left');\n\t\t$this -> db -> join('stock_info as si', 'ii.id = si.itemid', 'left');\n\t\t$this -> db -> join('store_info as sti', 'ii.store = sti.id', 'left');\n\t\t$this -> db -> join('size_info as siz', 'siz.id = ii.size', 'left');\n\t\t$this -> db -> join('status_info as sta', 'ip.status = sta.id');\n\t\t$this -> db -> where('itemcode = ' . \"'\" . $editpdata . \"'\");\n\t\t$this -> db -> group_by('pid');\n\t\t$query = $this->db->get();\n//\t\t$this -> db -> select('*');\n//\t\t$this -> db -> from('item_info');\n//\t\t$this -> db -> where('itemcode = ' . \"'\" . $editpdata . \"'\");\n//\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n return $query->row();\n }else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function viewProductDetailsAction() {\n $adminModel = Admin_Model_Users::getInstance();\n $result = $adminModel->getAdminDetails(); // showing image\n if ($result) {\n $this->view->admindetails = $result;\n }\n $productsModel = Admin_Model_Products::getInstance();\n $productId = $this->getRequest()->getParam(\"productId\");\n $result = $productsModel->getAllProductdetails($productId);\n if ($result) {\n $this->view->allproductdetails = $result;\n } else {\n echo 'controller error occured';\n }\n }", "public function createrep($id = null) {\n $this->loadModel('OrdersLine');\n $options = array('conditions' => array('Order.id' => $id), 'contain' => array('User', 'OrdersLine', 'Address', 'OrdersLine.Product' => array('fields' => array('id','name')), 'OrdersLine.Product.Productsupplier.Product'));\n $order = $this->Order->find('first', $options);\n $repOrder = $this->Order->find('first', array('conditions' => array('Order.external_orderid' => $order['Order']['external_orderid'], 'Order.ordertype_id' => 2)));\n if(empty($repOrder)) {\n // Check Access\n if($this->Access->hasOrderAccess($id)) {\n //echo 'Has access';\n #pr($order['OrdersLine']);\n #exit;\n $suppl = array(); \n $products = array(); \n if(!empty($order['OrdersLine'])) {\n foreach ($order['OrdersLine'] as $key => $suppliers) {\n if(empty($suppliers['Product']['Productsupplier'])) {\n $products[$key] = $suppliers['Product']['name'];\n }\n foreach ($suppliers['Product']['Productsupplier'] as $key => $supplier) {\n if($supplier['status'] != 'no') {\n $suppl[$supplier['supplier_id']][] = $supplier; \n }\n } \n }\n \n if(!empty($suppl)) {\n foreach ($suppl as $key => $listsuppl) {\n $data = array(\n 'Order' => array(\n 'ordertype_id' => 2,\n 'external_orderid' => $order['Order']['external_orderid'],\n 'user_id' => $order['User']['id'],\n 'ship_to_customerid' => $order['Order']['ship_to_customerid'],\n 'dcop_user_id' => $this->Auth->user('id'),\n 'supplier_id' => $key,\n 'shipping_costs' => $order['Order']['ordertype_id'],\n 'status_id' => $order['Order']['status_id'],\n 'ship_to_street' => $order['User']['street'],\n 'ship_to_city' => $order['User']['city'],\n 'ship_to_zip' => $order['User']['zip'],\n 'state_id' => $order['User']['state_id'],\n 'ship_to_stateprovince' => $order['User']['stateprovince'],\n 'country_id' => $order['User']['country_id'],\n 'created' => $order['Order']['created'],\n )\n );\n \n $data['Address']['street'] = (!empty($order['Address']['street'])?$order['Address']['street']:$order['Order']['ship_to_street']);\n $data['Address']['city'] = (!empty($order['Address']['city'])?$order['Address']['city']:$order['Order']['ship_to_city']);\n $data['Address']['zip'] = (!empty($order['Address']['zip'])?$order['Address']['zip']:$order['Order']['ship_to_zip']);\n $data['Address']['state_id'] = (!empty($order['Address']['state_id'])?$order['Address']['state_id']:$order['Order']['state_id']);\n $data['Address']['country_id'] = (!empty($order['Address']['country_id'])?$order['Address']['country_id']:$order['Order']['country_id']);\n $data['Address']['stateprovince'] = (!empty($order['Address']['stateprovince'])?$order['Address']['stateprovince']:$order['Order']['ship_to_stateprovince']);\n $data['Address']['phone'] = (!empty($order['Address']['phone'])?$order['Address']['phone']:$order['Order']['ship_to_phone']);\n\n $this->Order->create();\n unset($this->Order->validate['external_orderid']);\n if($this->Order->saveAll($data)) {\n foreach ($listsuppl as $key => $orderline) {\n $orderlines = $this->OrdersLine->find('first', array('conditions' => array('order_id' => $id, 'product_id' => $orderline['product_id']), 'recursive' => -1));\n $orderline = array(\n 'order_id' => $this->Order->id,\n 'line_number' => $orderlines['OrdersLine']['line_number'],\n 'type' => 2, //$orderlines['OrdersLine']['type'],\n 'product_id' => $orderline['product_id'],\n 'warehouse_id' => $orderlines['OrdersLine']['warehouse_id'],\n 'quantity' => $orderlines['OrdersLine']['quantity'],\n 'receivedqty' => 0,\n 'damagedqty' => 0,\n 'sentqty' => 0,\n 'unit_price' => $orderlines['OrdersLine']['unit_price'],\n 'total_line' => $orderlines['OrdersLine']['total_line'],\n 'sku' => $orderlines['OrdersLine']['sku'],\n 'user_id' => $order['User']['id'],\n 'status_id' => $orderlines['OrdersLine']['status_id'],\n 'comments' => $orderlines['OrdersLine']['comments'],\n );\n $this->OrdersLine->create();\n $this->OrdersLine->save($orderline);\n }\n \n } else{\n $this->Session->setFlash(__('The replenishment order could not be create related to this order # %s', $id), 'admin/danger', array());\n return $this->redirect(array('action' => 'index'));\n } \n }\n if(!empty($products)) {\n $prefix = $productName = '';\n foreach($products as $prdt) {\n $productName .= $prefix . $prdt;\n $prefix = ', ';\n }\n $message = 'P.O. line was not created, because there is no active product-supplier assignment for product ' . $productName;\n $this->Session->setFlash(__($message), 'admin/warning', array());\n } else {\n $this->Session->setFlash(__('Create replenishment order related to this order #%s', $id), 'admin/success', array()); \n }\n return $this->redirect(array('action' => 'index'));\n } else { \n $this->Session->setFlash(__(\"You did not assign any product to any supplier\"), 'admin/warning', array());\n return $this->redirect(array('action' => 'index')); \n }\n } else { \n $this->Session->setFlash(__('This Salesorder #%s has no order lines', $id), 'admin/danger', array());\n return $this->redirect(array('action' => 'index'));\n }\n\n } else {\n $this->Session->setFlash(__('This Salesorder #%s has no order lines', $id), 'admin/danger', array());\n return $this->redirect(array('action' => 'index'));\n }\n } else {\n $this->Session->setFlash(__('Already exist replenishment order related to this sales order # %s', $id), 'admin/danger');\n return $this->redirect(array('action' => 'index')); \n }\n }", "function detailAction()\r\n {\t\tif(!$this->registry->me->isGroup('administrator') && !$this->registry->me->isGroup('developer'))\r\n\t\t{\r\n\t\t\t$roleusers = Core_RoleUser::getRoleUsers(array('ftype' => Core_RoleUser::TYPE_VIEWORDER , 'fuid' => $this->registry->me->id), 'id', 'ASC' , '' , true);\r\n\t\t\tif($roleusers == 0)\r\n\t\t\t{\r\n\t\t\t\theader('location: ' . $this->registry['conf']['rooturl'] . 'a'.$this->registry->me->id.'/home');\r\n\t\t\t\texit();\r\n\t\t\t}\r\n\t\t}\r\n\r\n $id = (int)$this->registry->router->getArg('id');\r\n if($id <= 0)\r\n {\r\n header('Location: '.$this->registry->conf['rooturl'].$this->registry->controllerGroup . '/'.$this->registry->controller);\r\n }\r\n $orderInstallment = new Core_Installment($id);\r\n if($orderInstallment->id <= 0)\r\n {\r\n header('Location: '.$this->registry->conf['rooturl'].$this->registry->controllerGroup . '/'.$this->registry->controller);\r\n }\r\n $orderInstallment->product = new Core_Installment($orderInstallment->pid);\r\n $getprepaid = Core_Installment::calcInstallment($orderInstallment->pricesell, $orderInstallment->segmentpercent/100, $orderInstallment->installmentmonth, $orderInstallment->product->pcid);\r\n $this->registry->smarty->assign(array(\r\n 'oneOrder' => $orderInstallment,\r\n 'getprepaid' => $getprepaid\r\n ));\r\n $this->registry->smarty->display($this->registry->smartyControllerContainer.'detail.tpl');\r\n }", "private function _notifyTwTeam($pnOppDetailPk)\n {\n if(!assert('is_key($pnOppDetailPk)'))\n return false;\n\n $oMail = CDependency::getComponentByName('mail');\n $oHTML = CDependency::getCpHtml();\n $oPage = CDependency::getCpPage();\n\n $aOpps = $this->_getModel()->getOpportunityByDetailPk($pnOppDetailPk);\n $aOpp = current($aOpps);\n\n //fetch item description\n $oComponent = CDependency::getComponentByUid($aOpp['cp_uid']);\n if(!$oComponent)\n return false;\n\n $aOpp['cp_pk'] = (int)$aOpp['cp_pk'];\n $asItemDesc = $oComponent->getItemDescription($aOpp['cp_pk'], $aOpp['cp_action'], $aOpp['cp_type']);\n if(empty($asItemDesc))\n return false;\n\n $sHTML = '';\n $sHTML .= 'Hi!<br/>The following product has been booked.<br/><br/>';\n $sHTML .= $this->_displayEmailOpportunity($aOpp, $pnOppDetailPk);\n $sURL = $oPage->getUrl($this->csUid, CONST_ACTION_LIST, CONST_OPPORTUNITY, 0, array('display' => 'bbook'));\n $sHTML .= '<br/><br/>Please consult '.$oHTML->getLink('Tokyo Weekender Magazine', $sURL);\n $sHTML .= '<br/><br/>Thank you for using BCM.';\n\n $sEmail = ((bool)CONST_DEV_SERVER) ? CONST_DEV_EMAIL : '[email protected]; [email protected]';\n\n return $oMail->sendRawEmail(CONST_PHPMAILER_EMAIL, $sEmail, 'BCM (OPP/Booked) - '.$asItemDesc[$aOpp['cp_pk']]['label'], $sHTML);\n }", "function temPlateOrderNotification($user_email){\n \t\t\tinclude_once 'dbclass.php';\n \t\t\tinclude_once 'class.login.php';\n\n\t\t\t$log = new logmein();\n \t\t\t//var_dump($albumid);\n\t\t\t$shDB =new sh_DB();\n\n\t\t\t$settingsid = array('id' => 1);\t\t\t\t\t\t\t\t\t\n\t\t\t$settings = $shDB->selectOnMultipleCondition($settingsid,'settings');\n\t\t\t$settings = $settings[0];\n\t\t\t$from = $settings['admin_email'];\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//process products bof\n\t\t\t$selectProductDatainTemp = array('sessionid' => $_SESSION['sessionid']);\t\t\t\t\t\t\t\t\t\n\t\t\t$dataInTempProduct = $shDB->selectOnMultipleCondition($selectProductDatainTemp,'temp_product');\n\t\t\t\n\t\t\t$products ='<table cellpadding=\"3\" cellspacing=\"0\" style=\"table-layout:fixed; width:100%;\">';\n\t\t\t$products .='<tr>\n\t\t\t\t\t\t\t<td align=\"left\" style=\"border-bottom:solid 1px #EAF0F0;width:30%\"><strong>Product Name (Price)</strong></td>\n\t\t\t\t\t\t\t<td align=\"center\" style=\"border-bottom:solid 1px #EAF0F0;width:20%\"><strong>Base Price</strong></td>\n\t\t\t\t\t\t\t<td align=\"left\" style=\"border-bottom:solid 1px #EAF0F0;width:40%\"><strong>Product Option</strong></td>\n\t\t\t\t\t\t\t<td align=\"right\" style=\"border-bottom:solid 1px #EAF0F0;width:10%;padding-right:15px;\"><strong>Amount</strong></td>\n\t\t\t\t\t\t</tr>';\n\t\t\t\t\t\t$subTotal = 0;\n\t\t\t\t\t\tforeach ($dataInTempProduct as $tempProduct){\n\t\t\t\t\t\t\t$itemName = $tempProduct['name'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t $data = array('id' => $tempProduct['productid']);\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$product = $shDB->selectOnMultipleCondition($data,'prod_item');\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$product = $product[0];\n\t\t\t\t\t\t\t$dataforProduct = array('id' => $product['prod_id']);\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$productname = $shDB->selectOnMultipleCondition($dataforProduct,'product');\n\t\t\t\t\t\t\t$productname = $productname[0]['name'];\t\n\t\t\t\t\t\t\t$tempOptiondata = array('temp_product_id' => $tempProduct['id']);\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$tempOptiondata = $shDB->selectOnMultipleCondition($tempOptiondata,'temp_item_option');\n\t\t\t\t\t\t\t$optionCost = 0;\n\t\t\t\t\t\t\t$optionString = '';\n\t\t\t\t\t\t\t$additionalLeafCost = '';\n\t\t\t\t\t\t\tif($tempOptiondata){\n\t\t\t\t\t\t\t\tforeach($tempOptiondata as $optionValue){\n\t\t\t\t\t\t\t\t\t$itemOptiondata = array(\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t'id' => $optionValue['prod_item_option_id']\n\t\t\t\t\t\t\t\t\t\t\t\t);\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$itemOptiondata = $shDB->selectOnMultipleCondition($itemOptiondata,'prod_item_option');\n\t\t\t\t\t\t\t\t\t$itemOptiondata = $itemOptiondata[0];\n\t\t\t\t\t\t\t\t\t$optionCost = $optionCost + $itemOptiondata['cost'];\n\t\t\t\t\t\t\t\t\t$itemOptiondataNameandValue = array(\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t'id' => $itemOptiondata['optionid']\n\t\t\t\t\t\t\t\t\t\t\t\t);\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$itemOptiondataNameandValue = $shDB->selectOnMultipleCondition($itemOptiondataNameandValue,'itemoption');\n\t\t\t\t\t\t\t\t\t$itemOptiondataNameandValue = $itemOptiondataNameandValue[0];\n\t\t\t\t\t\t\t\t\t$optionString .= $itemOptiondataNameandValue['name'].' : '.$itemOptiondataNameandValue['value'].' ('.$settings['currency'].' '.$itemOptiondata['cost'].')<br />';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t$optionDescription = '';\n\t\t\t\t\t\t\tif($tempProduct['additionalleaf']>0){\n\t\t\t\t\t\t\t\t$additionalLeafCost = $tempProduct['additionalleaf']*$tempProduct['addsidecost'];\n\t\t\t\t\t\t\t\t$optionDescription .= 'Additional Sides : '.$tempProduct['additionalleaf'].'&times'.$tempProduct['addsidecost'].' = '.$settings['currency'].$additionalLeafCost.'<br />';\n\t\t\t\t\t\t\t\t$optionDescription .= $optionString;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$itemTotal = $product[\"basicprice\"] + $additionalLeafCost + $optionCost;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$subTotal =$subTotal + $itemTotal;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t$products .='<tr>\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<td align=\"left\" class=\"botBorder3\">'.$productname.'<br /><small>'.$itemName.'</small></td>\n\t\t\t\t\t\t\t<td align=\"center\" class=\"botBorder3\">'.$settings['currency'].' '.$product[\"basicprice\"].'</font></td>\n\t\t\t\t\t\t\t<td align=\"left\" class=\"botBorder3\">'.$optionDescription.'</font></td>\n\t\t\t\t\t\t\t<td align=\"right\" class=\"botBorder3\" style=\"padding-right:15px;\"><font class=\"currency1\">'.$settings['currency'].' '.$itemTotal.'</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t';\n\t\t\t\t\t}\n\t\t\t\t\t$grand_total=$subTotal;\n\t\t\t$products .='<tr>\n\t\t\t\t\t\t\t<td align=\"right\" colspan=\"4\" style=\"padding-right:15px; font-size:16px; font-weight:bold;\">Total - '.$settings['currency'].' '.$grand_total.'</td>\n\t\t\t\t\t\t</tr>';\n\t\t\t$products .='</table>';\n\t\t\t\n\t\t\t\n\t\t\t//process products eof\n\t\t\t\n\t\t\t$subject = 'New order has been placed';\n\t\t\t\t\n\t\t\t//get customer name bof\t\n\t\t\t/* $selectBillingAddress = $shDB->selectOnMultipleCondition($selectBillingAddress,'bill_address');\n\t\t\t$selectBillingAddress = $selectBillingAddres s[0];\n\t\t\t$custName=$selectBillingAddress['name'];*/\n\t\t\t//get customer name eof\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t$message = '<html><body style=\"background: #6E9091;font-size:8pt;font-family:tahoma,arial;padding:20px;\">';\n\t\t\t$message .= '<img src=\"'.$log->baseurl.'images/modpix_logo.png\" width=\"180\" alt=\"Modpix\" />';\n\t\t\t$message .= '<table width=\"80%\" rules=\"\" cellpadding=\"0\" cellspacing=\"0\">';\n\t\t\t$message .= '<tr>';\n\t\t\t$message .= '<td style=\"background-image: url('.$log->baseurl.'images/email_round.png);background-position:top left;background-repeat:no-repeat;width:14px;height:14px\"></td>';\n\t\t\t$message .= '<td style=\"background: #fff;border-top:1px solid #6E9091\"></td>';\n\t\t\t$message .= '<td style=\"background-image: url('.$log->baseurl.'images/email_round.png);background-position:top right;background-repeat:no-repeat;width:14px;height:14px\"></td>';\n\t\t\t$message .= '</tr>';\n\t\t\t\n\t\t\t$message .= '<tr>';\n\t\t\t$message .= '<td style=\"background: #fff;\"></td>';\n\t\t\t$message .= '<td style=\"background: #fff;font-size:11px;line-height:2.1em;\">';\n\t\t\t\t$message .= '<table rules=\"\" style=\"border-color: #666;\" width=\"100%\" cellpadding=\"10\">';\n\t\t\t\t\t$message .= '<tr><td style=\"width:100px;font-size:11px;\">Hi </td></tr>';\n\t\t\t\t\t$message .= '<tr ><td style=\"font-size:11px;\">Your order have been successfully placed. Thank You! We Appreciate your Business! </td></tr>';\n\t\t\t\t\t$message .= '<tr ><td style=\"font-size:11px;\">Your order details are given below: </td></tr>';\n\t\t\t\t$message .= '</table>';\n\t\t\t$message .= '</td>';\n\t\t\t$message .= '<td style=\\'background: #fff;\\'></td>';\n\t\t\t$message .= '</tr>';\n\t\t\t\n\t\t\t$message .= '<tr>';\n\t\t\t$message .= '<td style=\"background: #fff;\"></td>';\n\t\t\t$message .= '<td style=\"background: #fff;font-size:11px;line-height:2.1em;\">';\n\t\t\t\t$message .= $products;\n\t\t\t$message .= '</td>';\n\t\t\t$message .= '<td style=\\'background: #fff;\\'></td>';\n\t\t\t$message .= '</tr>';\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$message .= '<tr>';\n\t\t\t$message .= '<td style=\"background-image: url('.$log->baseurl.'images/email_round.png);background-repeat:no-repeat;background-position:bottom left;width:14px;height:14px\"></td>';\n\t\t\t$message .= '<td style=\\'background: #fff;\\'></td>';\n\t\t\t$message .= '<td style=\"background-image: url('.$log->baseurl.'images/email_round.png);background-repeat:no-repeat;background-position:bottom right;width:14px;height:14px\"></td>';\n\t\t\t$message .= '</tr>';\n\t\t\t$message .= '</table><br />';\n\t\t\t$message .= '<p style=\"color:#fff;\">';\n\t\t\t$message .= '<a style=\"color:#fff;text-decoration:none;font-weight:bold\" href=\"'.$log->baseurl.'index.php?pg=whoweare\">Who we are?</a>&nbsp;&nbsp;|&nbsp;&nbsp;';\n\t\t\t$message .= '<a style=\"color:#fff;text-decoration:none;font-weight:bold\" href=\"'.$log->baseurl.'index.php?pg=products\">Products</a>&nbsp;&nbsp;|&nbsp;&nbsp;';\n\t\t\t$message .= '<a style=\"color:#fff;text-decoration:none;font-weight:bold\" href=\"'.$log->baseurl.'index.php?pg=inquiry\">Inquiry</a>&nbsp;&nbsp;|&nbsp;&nbsp;';\n\t\t\t$message .= '<a style=\"color:#fff;text-decoration:none;font-weight:bold\" href=\"'.$log->baseurl.'index.php?pg=contactus\">Contact Us</a></p>';\n\t\t\t$message .= '<p style=\"color:black;font-size:10px;\">Copyright 2011 &copy; Modpix. All rights reserved. </p>';\n\t\t\t$message .= '</body>';\n\t\t\t\n\t\t\t\n\t\t\t$headers = \"From: \" . $from . \"\\r\\n\";\n\t\t\t$headers .= \"Reply-To: \". $from . \"\\r\\n\";\n\t\t\t$headers .= \"MIME-Version: 1.0\\r\\n\";\n\t\t\t$headers .= \"Content-Type: text/html; charset=ISO-8859-1\\r\\n\";\n\t\t\t\t\n if (mail($user_email, $subject, $message, $headers)) {\n return true;\n } else {\n return false;\n }\n \n // DON'T BOTHER CONTINUING TO THE HTML...\n die();\n }", "function DisplayProductDetails($implicit=0)\r\n\t{\r\n\t\tglobal $_POST;\r\n\t\tglobal $_REQUEST;\r\n\t\tglobal $_SETTINGS;\r\n\t\t\r\n\t\t$display = 0;\r\n\t\t\r\n\t\t$flag = $_SETTINGS['product_detail_page_clean_url'];\r\n\t\tif($flag == $_REQUEST['page']){\t\t\r\n\t\t\t$display = 1;\r\n\t\t}\r\n\t\t\r\n\t\t// CHECK IF IMPLICIT\r\n\t\tif($implicit == 1){\r\n\t\t\t$display = 1;\r\n\t\t}\r\n\t\t\r\n\t\tif($display == 1){\r\n\t\t\r\n\t\t\t$productArray = explode(\":\",$_REQUEST['FORM1']);\r\n\t\t\t$product = $productArray[0];\r\n\t\t\tif($productArray[1] == 'edit'){\r\n\t\t\t\t$cartitem_id = $productArray[2];\r\n\t\t\t\t$edit = 1;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// GET PRODUCT\r\n\t\t\t$selproduct = \"SELECT * FROM ecommerce_products WHERE name='\".$product.\"' AND active='1' AND status='Published' LIMIT 1\";\r\n\t\t\t$resproduct = doQuery($selproduct);\r\n\t\t\t$rowproduct = mysql_fetch_array($resproduct);\r\n\t\t\t\r\n\t\t\t// CHECK IF A FREE PROMO PRODUCT\r\n\t\t\tif($rowproduct['hidden_promo'] == '1'){\r\n\t\t\t\t// GET THE PROMO CODE\r\n\t\t\t\t$selcode = \"SELECT * FROM ecommerce_coupon_codes WHERE free_promo_product_id='\".$rowproduct['product_id'].\"' AND coupon_id='\".$_SESSION['promo_code_id'].\"' LIMIT 1\";\r\n\t\t\t\t$rescode = doQuery($selcode);\r\n\t\t\t\t$numcode = mysql_num_rows($rescode);\r\n\t\t\t\tif($numcode > 0){\r\n\t\t\t\t\ttrue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$report = \"You do not have permission to see this page_\";\r\n\t\t\t\t\t$success = \"1\";\r\n\t\t\t\t\theader(\"Location: \".$_SETTINGS['website'].\"\".$_SETTINGS['products_page_clean_url'].\"\");\r\n\t\t\t\t\texit();\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// CHECK IF THE ITEM IS ALREADY IN THE CART\r\n\t\t\t\tif($edit != 1){\r\n\t\t\t\t\t$cartid = $this->getCartId();\r\n\t\t\t\t\t// GET THE ITEMS IN THE CART\r\n\t\t\t\t\t$prodselect = \t\"SELECT a.product_id,c.name FROM ecommerce_product_cart_relational a \".\r\n\t\t\t\t\t\t\t\t\t\"LEFT JOIN ecommerce_products c ON a.product_id=c.product_id \".\r\n\t\t\t\t\t\t\t\t\t\"WHERE a.shopping_cart_id='\".$cartid.\"'\";\r\n\t\t\t\t\t$prodresult = doQuery($prodselect);\r\n\t\t\t\t\t$prodnum \t= mysql_num_rows($prodresult);\r\n\t\t\t\t\t$p = 0;\r\n\t\t\t\t\twhile($p<$prodnum){\r\n\t\t\t\t\t\t$prodrow = mysql_fetch_array($prodresult);\r\n\t\t\t\t\t\tif($prodrow['product_id'] == $rowproduct['product_id']){\r\n\t\t\t\t\t\t\t$report = \"This item is already in your cart_ Click edit in your cart to update this item's options_\";\r\n\t\t\t\t\t\t\t$success = \"1\";\r\n\t\t\t\t\t\t\theader(\"Location: \".$_SETTINGS['website'].\"\".$_SETTINGS['shopping_cart_page_clean_url'].\"/0/\".$report.\"/\".$success.\"/0\");\r\n\t\t\t\t\t\t\texit();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$p++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$catdescription = \"\";\r\n\t\t\t$ammendcatdescription = \"\";\r\n\t\t\t\r\n\t\t\t// GET PRODUCT CATEGORY\r\n\t\t\t$selcat = \"SELECT * FROM ecommerce_product_category_relational WHERE product_id='\".$rowproduct['product_id'].\"'\";\r\n\t\t\t$rescat = doQuery($selcat);\r\n\t\t\twhile($rowcat = mysql_fetch_array($rescat)){\t\t\t\r\n\t\t\t\t$ammendcatdescription = lookupDbValue('ecommerce_product_categories','description',$rowcat['category_id'],'category_id');\r\n\t\t\t\tif($ammendcatdescription != \"\"){ \r\n\t\t\t\t\t$catdescription .= \"<li>\".$ammendcatdescription.\"</li>\";\r\n\t\t\t\t}\r\n\t\t\t\t$catname = lookupDbValue('ecommerce_product_categories','name',$rowcat['category_id'],'category_id');\r\n\t\t\t\t$catid = $rowcat['category_id'];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//$selcat = \"SELECT * FROM ecommerce_product_categories WHERE category_id='\".$rowcat['category_id'].\"' LIMIT 1\";\r\n\t\t\t//$rescat = doQuery($selcat);\r\n\t\t\t//$rowcat = mysql_fetch_array($rescat);\r\n\t\t\t\r\n\t\t\t//$catdescription = $rowcat['description'];\r\n\t\t\t\r\n\t\t\t// ZOOM SETTING\r\n\t\t\t$zoom = '0';\r\n\t\t\tif($_SETTINGS['product_zoom'] == '1' || $rowproduct['zoom'] == '1'){\r\n\t\t\t\t$zoom = '1';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$description\t= $rowproduct['description'];\r\n\t\t\t//if($description != \"\"){ $description .= \"<br>\"; }\r\n\t\t\t//$description \t.= $catdescription;\r\n\t\t\t\r\n\t\t\t$name\t\t\t= $rowproduct['name'];\r\n\t\t\t\r\n\t\t\t//\r\n\t\t\t// FORMAT PRICE\r\n\t\t\t//\r\n\t\t\t$discount = '0.00';\r\n\t\t\tif($rowproduct['flat_discount'] != '0.00' || $rowproduct['rate_discount'] != '0.00'){\r\n\t\t\t\t\r\n\t\t\t\t// IF FLAT DISCOUNT\r\n\t\t\t\tif($rowproduct['flat_discount'] != '0.00'){\r\n\t\t\t\t\t$discount = $rowproduct['flat_discount'];\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t// IF RATE DISCOUNT\r\n\t\t\t\telseif($rowproduct['rate_discount'] != '0.00'){\r\n\t\t\t\t\t$discount = $rowproduct['price'] * $rowproduct['rate_discount'];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$list_price\t= $this->currency.money_format('%i',$rowproduct['price']);\r\n\t\t\t$new_price = $rowproduct['price'] - $discount;\r\n\t\t\t$new_price = $this->currency.money_format('%i',$new_price);\t\r\n\r\n\t\t\t// PAGE TITLE / PRDUCT NAME\r\n\t\t\techo \t\"<h1>\".$_REQUEST['FORM1'].\"</h1> \";\r\n\t\t\t\t\t\t\r\n\t\t\techo \t\"<p class='breadcrumbs'> \";\r\n\t\t\techo \t\"<a href='\".$_SETTINGS['website'].$_SETTINGS['products_page_clean_url'].\"' >Items</a> >> \";\r\n\t\t\techo \t\"<a href='\".$_SETTINGS['website'].$_SETTINGS['products_page_clean_url'].\"/\".$catname.\"-\".$catid.\"'>\".$catname.\"</a> >> \";\r\n\t\t\techo\t\"\".$name.\"\".\r\n\t\t\t\t\t\"</p>\";\r\n\t\t\t\r\n\t\t\t// BEGIN PRODUCT BOX\r\n\t\t\techo \t\"<div class='productbox'>\";\t\r\n\t\t\t\r\n\t\t\tif($list_price != $new_price){\r\n\t\t\t\techo \"<div class='salebubble'>This item is on sale. Save \".$this->currency.money_format('%i',$discount).\"!</div>\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//if($rowproduct['description']){\r\n\t\t\t\techo \"<div class='salebubble' style='display:none;'></div>\";\r\n\t\t\t//}\r\n\t\t\t\r\n\t\t\t// MAIN IMAGE\r\n\t\t\techo\t\"\t<div class='productimagegallery'>\";\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif($rowproduct['droppable'] == \"1\"){ $droppable = \"droppable\"; }\r\n\t\t\techo \t\"\t\t<div class='mainimage \".$droppable.\" product'>\";\t\r\n\t\t\t\r\n\t\t\t// GET IMAGE NAME\r\n\t\t\tif($rowproduct['naming_convention'] == '1'){\r\n\t\t\t\t$imagenameFormated = strtolower(str_replace(\" \",\"_\",$name).\".jpg\");\t\r\n\t\t\t} else {\r\n\t\t\t\t$imagenameFormated = $rowproduct['image'];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$thumbnailpath = $this->formatThumbnail($imagenameFormated);\r\n\t\t\t\r\n\t\t\t// If HI RES THEN GET THE LARGEST SIZE IMAGE\r\n\t\t\tif($_SETTINGS['hi_res_images'] == '1'){ \r\n\t\t\t\t$mainImage = $this->formatLargest($imagenameFormated);\r\n\t\t\t}\r\n\t\t\t// IF NORMAL THEN GET THE MAIN IMAGE SIZE FROM SETTING\r\n\t\t\telse {\r\n\t\t\t\t$mainImage = $this->formatMain($imagenameFormated);\r\n\t\t\t}\r\n\t\t\t$size = lookupDbValue('ecommerce_thumbnail_sizes', 'name', $_SETTINGS['detail_page_main_image_size'], 'size_id');\r\n\t\t\tif($zoom == '1'){\r\n\t\t\t\techo\t\"\t\t<a id='main-image-zoom-a' href='\".$this->formatLargest($imagenameFormated).\"' class='jqzoom productlightbox' style='' title=''>\";\r\n\t\t\t\techo\t\"\t\t\t<img style='width:\".$size.\"px;' id='main-detail-image' class='main-detail-image' src='\".$mainImage.\"'>\";\r\n\t\t\t\techo\t\"\t\t</a>\";\t\t\t\t\t\r\n\t\t\t} else {\t\t\t\t\t\r\n\t\t\t\techo\t\"\t\t<img style='width:\".$size.\"px;' id='main-detail-image' class='main-detail-image' src='\".$mainImage.\"'>\";\t\t\t\t\r\n\t\t\t}\t\t\t\t\r\n\t\t\techo\t\t\t\"</div>\"; // END MAIN IMAGE\r\n\t\t\t\r\n\t\t\t// LOOP GALLERY IMAGES\r\n\t\t\t$selimage1 = \t\"SELECT * FROM ecommerce_product_images WHERE \".\r\n\t\t\t\t\t\t\t\"(active='1' AND product_id='\".$rowproduct['product_id'].\"') \".\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\"ORDER BY sort_level ASC\";\r\n\t\t\t$resimage1 =\tdoQuery($selimage1);\r\n\t\t\t$numimage1 = \tmysql_num_rows($resimage1);\r\n\t\t\t$iimage1 =\t\t0;\t\t\r\n\t\t\tif($numimage1 > 0){\r\n\t\t\t\techo\t\"\t<div class='gallerythumbnails'>\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\twhile($iimage1<$numimage1){\r\n\t\t\t\t\t\t$rowimage1 = mysql_fetch_array($resimage1);\r\n\t\t\t\t\t\tif($masterimage != $rowimage1['image']){\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo \t\"<div class='gallerythumbnail draggable product'>\".\r\n\t\t\t\t\t\t\t\t\t\"\t<a id='image\".$iimage1.\"' class='image\".$iimage1.\"' href='#' rel='\".$rowimage1['description'].\"' title='\".$rowimage1['description'].\"'>\".\r\n\t\t\t\t\t\t\t\t\t\"\t\t<img src='\".$_SETTINGS['website'].\"uploads-products/\".$this->getSmallImage($rowimage1['image']).\"' rel='\".$rowimage1['description'].\"' title='\".$rowimage1['description'].\"'>\".\r\n\t\t\t\t\t\t\t\t\t\"\t</a>\";\r\n\t\t\t\t\t\t\techo \t\"\r\n\t\t\t\t\t\t\t\t\t\t<script type='text/javascript'>\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$('#image\".$iimage1.\"').click(function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t// SET THE MAIN IMAGE AS THIS IMAGE\r\n\t\t\t\t\t\t\t\t\t\t\t$('#main-detail-image').attr('src','\".$_SETTINGS['website'].\"uploads-products/\".$this->getMainImage($rowimage1['image']).\"');\r\n\t\t\t\t\t\t\t\t\t\t\t// SET THE MAIN IMAGE ZOOMER AS THE ORIGINAL \r\n\t\t\t\t\t\t\t\t\t\t\t$('#main-image-zoom-a').attr('href','\".$_SETTINGS['website'].\"uploads-products/\".$rowimage1['image'].\"');\r\n\t\t\t\t\t\t\t\t\t\t\t// SET THE IMAGE DESCRIPTION\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\";\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\tif($rowimage1['description'] != \"\"){\r\n\t\t\t\t\t\t\t\t\t\t\t\techo \"\t$('.salebubble').css('display','block');\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$('.salebubble').html('\".$rowimage1['description'].\"');\";\r\n\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\techo \" \t$('.salebubble').css('display','none');\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$('.salebubble').html('');\";\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo \"\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t</script>\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\";\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo \t\"</div>\"; // end gallery ITEM\r\n\t\t\t\t\t\t} // end if the first item\r\n\t\t\t\t\t\t$iimage1++;\r\n\t\t\t\t\t}\t\r\n\r\n\t\t\t\t\techo \"<div class='gallerythumbnail draggable product'><a id='image00' class='image00' href='#'><img src='\".$_SETTINGS['website'].\"uploads-products/\".$this->getSmallImage($imagenameFormated).\"' style-'width:94px;'></a></div>\";\r\n\t\t\t\t\techo \"<script>\";\r\n\t\t\t\t\techo \"$('#image00').click(function() {\";\r\n\t\t\t\t\techo \"$('#main-detail-image').attr('src','\".$_SETTINGS['website'].\"uploads-products/\".$this->getMainImage($imagenameFormated).\"');\";\r\n\t\t\t\t\techo \"$('#main-image-zoom-a').attr('href','\".$_SETTINGS['website'].\"uploads-products/\".$imagenameFormated.\"');\";\r\n\t\t\t\t\tif($rowproduct['description'] != \"\"){\r\n\t\t\t\t\t\techo \"\t$('.salebubble').css('display','block');\r\n\t\t\t\t\t\t\t$('.salebubble').html('\".$rowproduct['description'].\"');\";\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\techo \" \t$('.salebubble').css('display','none');\r\n\t\t\t\t\t\t\t$('.salebubble').html('');\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\techo \"});\";\r\n\t\t\t\t\techo \"</script>\";\r\n\t\t\t\t\t\r\n\t\t\t\techo\t\"\t\t<br clear='all'>\".\r\n\t\t\t\t\t\t\"\t</div>\"; // end GALLERY\r\n\t\t\t} // end if numimage1\r\n\t\t\t// END THE IMAGE GALLERY\r\n\t\t\t\r\n\t\t\t// SCRIPT FOR ZOOM\r\n\t\t\tif($zoom == '1'){\r\n\t\t\t\techo \t\"\t<script>\".\r\n\t\t\t\t\t\t\"\t\tvar options = { \".\r\n\t\t\t\t\t\t\"\t\tposition: 'left', \".\r\n\t\t\t\t\t\t\"\t\tzoomWidth: 300, \".\r\n\t\t\t\t\t\t\"\t\tzoomHeight: 250 \".\r\n\t\t\t\t\t\t\"\t\t}; \".\r\n\t\t\t\t\t\t\"\t\t$(function() { \".\r\n\t\t\t\t\t\t\"\t\t\t$('.jqzoom').jqzoom(options); \".\r\n\t\t\t\t\t\t\"\t\t}); \".\r\n\t\t\t\t\t\t\"\t</script>\";\r\n\t\t\t}\r\n\t\t\techo\t\"\t</div>\";// END IMAGE GALLERY\r\n\t\t\t\r\n\t\t\t// START FORM\r\n\t\t\techo \t\"\t<form class='product-form' method='post'>\";\r\n\t\t\techo \t\"\t<div class='productinfobox'>\".\r\n\t\t\t\t\t\"\t\t<div class='productdescription'>\";\r\n\t\t\t\r\n\t\t\t// TOP ADD TO CART BUTTON\r\n\t\t\t$displaybutton = 0;\r\n\t\t\tif($rowproduct['take_inventory'] == '1'){\r\n\t\t\t\tif($rowproduct['inventory'] < 0){ $rowproduct['inventory'] = 0; }\r\n\t\t\t\tif($rowproduct['inventory'] > 0){\r\n\t\t\t\t\t$displaybutton = 1;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$displaybutton = 1;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($displaybutton == 1){\r\n\t\t\t\tif($edit == 1){\r\n\t\t\t\t\techo \t\"\t<p class='p-add-to-cart'><input type='hidden' name='cartitem_id' value='\".$cartitem_id.\"'><input class='add-to-cart-button button' type='submit' name='UPDATEITEM' value='Update Item'></p>\";\r\n\t\t\t\t} else {\t\r\n\t\t\t\t\techo \t\"\t<p class='p-add-to-cart'><input class='add-to-cart-button button' type='submit' name='ADDTOCART' value='Add To Cart'></p>\";\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// PRODUCT DESCRIPTION\r\n\t\t\tif($description != \"\"){\r\n\t\t\t\tif(strstr($description,\"Intention:\" ) AND strstr($description,\"Affirmation:\") AND $_SESSION['filter_heshe'] == \"intention\"){\r\n\t\t\t\t\t$description = str_replace(\"Intention:\",\"\",$description);\r\n\t\t\t\t\t$descriptionArray = explode(\"Affirmation:\",$description);\r\n\t\t\t\t\t@$intentionString = $descriptionArray[0];\r\n\t\t\t\t\t@$affirmationString = $descriptionArray[1];\r\n\t\t\t\t\techo\t\"\t\t<span class='productdescription-heading'>Intention:</span>\";\r\n\t\t\t\t\techo \t\"\t\t\".$intentionString.\"\";\r\n\t\t\t\t\techo\t\"\t\t<span class='productdescription-heading'>Affirmation:</span>\";\r\n\t\t\t\t\techo\t\"\t\t\".$affirmationString.\"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\techo\t\"\t\t\t<span class='productdescription-heading'>Details:</span>\";\r\n\t\t\t\t\techo\t\"\t\t\t\".$description.\"\";\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\techo\t\"\t\t\t<span class='productdescription-heading'>Details:</span>\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// CAT DESCRIPTION\r\n\t\t\tif($_SESSION['filter_heshe']!= 'intention'){\r\n\t\t\t\tif($catdescription != \"\")\r\n\t\t\t\t{\r\n\t\t\t\t\techo \"<ul class='prod-details'>\";\r\n\t\t\t\t\tif(strstr($catdescription,\"--\")){\r\n\t\t\t\t\t\techo \"\".str_replace(\"--\",\"</li><li>\",$catdescription).\"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\techo $catdescription;\r\n\t\t\t\t\t}\r\n\t\t\t\t\techo \"</ul>\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// PRODUCT PRICE\t\r\n\t\t\tif($list_price != $new_price){\r\n\t\t\t\techo \"<span class='productdescription-heading'>Price:</span> List Price: <del>\".$list_price.\"</del><Br>\";\r\n\t\t\t\techo \"Your Price: <strong>\".$new_price.\"</strong>\";\r\n\t\t\t} else {\r\n\t\t\t\techo \"<span class='productdescription-heading'>Price:</span> \".$list_price.\"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t// PRODUCT QUANTITY\t\r\n\t\t\t$_POST['quantity'] == $_POST['QTY'];\r\n\t\t\tif($edit == 1){\r\n\t\t\t\t// GET THE QUANTITY FROM THE CART\r\n\t\t\t\t$sel = \"SELECT * FROM ecommerce_product_cart_relational WHERE item_id='\".$cartitem_id.\"' LIMIT 1\";\r\n\t\t\t\t$res = doQuery($sel);\r\n\t\t\t\t$item = mysql_fetch_array($res);\r\n\t\t\t\t$_POST['quantity'] = $item['qty'];\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif($_POST['quantity'] == \"\"){ $_POST['quantity'] = \"1\"; }\r\n\t\t\techo \t\"\t\t\t<span class='productdescription-heading'>Quantity:</span>\";\r\n\t\t\t\r\n\t\t\t$display = 1;\t\t\t\r\n\t\t\t// IF INVENTORY THEN DISPLAY IT\r\n\t\t\tif($rowproduct['take_inventory'] == '1'){\r\n\t\t\t\tif($rowproduct['inventory'] < 0){ $rowproduct['inventory'] = 0; }\r\n\t\t\t\tif($rowproduct['inventory'] > 0){\r\n\t\t\t\t\techo \"<input type='text' class='product-qty' style='width:30px;' name='QTY' value='\".$_POST['quantity'].\"'> \";\r\n\t\t\t\t\techo \"<small> Available Inventory: \".$rowproduct['inventory'].\"</small>\";\t\t\t\r\n\t\t\t\t} elseif($rowporduct['inventory'] == 0) {\r\n\t\t\t\t\techo \"<small> Available Inventory: \".$rowproduct['inventory'].\" left. </small>\";\r\n\t\t\t\t\t$display = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// NOT TAKING INVENTORY\r\n\t\t\telse {\r\n\t\t\t\tif($rowproduct['hidden_promo'] == '1'){\r\n\t\t\t\t\techo \t\"1 <input type='hidden' class='' style='' name='QTY' value='\".$_POST['quantity'].\"'>\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\techo \t\"<input type='text' class='product-qty' style='width:30px;' name='QTY' value='\".$_POST['quantity'].\"'>\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($display == 1){\r\n\t\t\t\t// ATTRIBUTES\t\t\r\n\t\t\t\t$sele = \"SELECT * FROM ecommerce_product_attributes WHERE active='1' ORDER BY sort_level ASC\";\r\n\t\t\t\t$rese = doQuery($sele);\r\n\t\t\t\t$nume = mysql_num_rows($rese);\r\n\t\t\t\t$ie\t = 0;\r\n\t\t\t\twhile($ie<$nume)\r\n\t\t\t\t{\r\n\t\t\t\t\t$numa = 0;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// CHECK IF ATTRIBUTE MATCHES PRODUCT\r\n\t\t\t\t\t$row = mysql_fetch_array($rese);\r\n\t\t\t\t\t$selcheck = \"SELECT * FROM ecommerce_product_attribute_relational WHERE product_id='\".$rowproduct['product_id'].\"' AND attribute_id='\".$row['attribute_id'].\"' LIMIT 1\";\r\n\t\t\t\t\t$rescheck = doQuery($selcheck);\r\n\t\t\t\t\t//echo \"<br>$selcheck<br>\";\r\n\t\t\t\t\t$numa = mysql_num_rows($rescheck);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// CHECK IF ATTRIBUTE MACHES CATEGORY\r\n\t\t\t\t\t$selcheck = \"SELECT * FROM ecommerce_product_category_relational WHERE product_id='\".$rowproduct['product_id'].\"' AND category_id != '0'\";\r\n\t\t\t\t\t$rowcheck = doQuery($selcheck);\r\n\t\t\t\t\twhile($rowc = mysql_fetch_array($rowcheck)){\r\n\t\t\t\t\t\t// CHECK IF ATTRIBUTE MATCHES\r\n\t\t\t\t\t\t// echo \"<br>\".$rowc['category_id'].\" --- \".$row['category_id'].\"<br>\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($rowc['category_id'] == $row['category_id']){\r\n\t\t\t\t\t\t\t$numa = 1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($numa == 1){\r\n\t\t\t\t\t\t//$rowa = mysql_fetch_array($rescheck);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//echo \"<Br>ATTRIBUTE: \".$row['name'].\"<br>\";\r\n\t\t\t\t\t\t//echo \"TEXT VALUE: \".$_POST['value'].\"<Br>\";\r\n\t\t\t\t\t\t//echo \"CARTITEM ID: \".$cartitem_id.\"<br>\";\r\n\t\t\t\t\t\t//echo \"ATTRIBUTE ID:\".$row['attribute_id'].\"<br>\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($edit == 1){\r\n\t\t\t\t\t\t\t// GET THE ATTRIBUTE VALUE FROM THE CART RELATIONAL ITEM\r\n\t\t\t\t\t\t\t$sel = \"SELECT * FROM ecommerce_product_attribute_cart_relational WHERE relational_item_id='\".$cartitem_id.\"' AND attribute_id='\".$row['attribute_id'].\"'\";\r\n\t\t\t\t\t\t\t$res = doQuery($sel);\r\n\t\t\t\t\t\t\t$item = mysql_fetch_array($res);\r\n\t\t\t\t\t\t\t$_POST['value'] = $item['value'];\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//echo \"ATTRIBUTE VALUE: \".$_POST['value'].\"\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// ATTRIBUTE NAME\r\n\t\t\t\t\t\techo\t\"\t\t<span class='productdescription-heading'>\".$row['label'].\":</span>\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// DESCRIPTION\r\n\t\t\t\t\t\tif($row['description'] != \"\"){\r\n\t\t\t\t\t\t\techo\t\"\t<p class='product-description'>\".$row['description'].\"</p>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// TEXTBOX ATTRIBUTE\r\n\t\t\t\t\t\tif($row['type'] == 'Textbox'){\r\n\t\t\t\t\t\t\techo\t\"\t<input name='attribute[]' type='text' value='\".$_POST['value'].\"'>\";\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// TEXTAREA ATTRIBUTE\r\n\t\t\t\t\t\tif($row['type'] == 'Textarea'){\r\n\t\t\t\t\t\t\techo\t\"\t<textarea name='attribute[]'>\".$_POST['value'].\"</textarea>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($edit == 1){\r\n\t\t\t\t\t\t\t// GET THE ATTRIBUTE VALUE FROM THE CART RELATIONAL ITEM\r\n\t\t\t\t\t\t\t//$sel = \"SELECT * FROM ecommerce_product_attribute_cart_relational WHERE item_id='\".$cartitem_id.\"' AND attribute_id='\".$row['attribute_id'].\"'\";\r\n\t\t\t\t\t\t\t//$res = doQuery($sel);\r\n\t\t\t\t\t\t\t//$item = mysql_fetch_array($res);\r\n\t\t\t\t\t\t\t$_POST['value'] = $item['attribute_value_id'];\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// CHECK DEFAULT GET DEFAULT ATTRIBUTE VALUE\r\n\t\t\t\t\t\t\t$sel1 = \"SELECT * FROM ecommerce_product_attribute_values WHERE `default`='1' AND attribute_id='\".$row['attribute_id'].\"' LIMIT 1\";\r\n\t\t\t\t\t\t\t$res1 = doQuery($sel1);\r\n\t\t\t\t\t\t\t$row1 = mysql_fetch_array($res1);\r\n\t\t\t\t\t\t\t$_POST['value'] = $row1['attribute_value_id'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//echo \"<Br>ATTRIBUTE ID VALUE: \".$_POST['value'].\"<Br>\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// SELECT ATTRIBUTE\r\n\t\t\t\t\t\tif($row['type'] == 'Select'){\r\n\t\t\t\t\t\t\techo\t\"\t<select name='attribute[]'>\";\r\n\t\t\t\t\t\t\t\t//$table = \"ecommerce_product_attribute_values\";\r\n\t\t\t\t\t\t\t\t//$options = getSqlSelectArray($table);\r\n\t\t\t\t\t\t\t\t$sel = \"SELECT * FROM ecommerce_product_attribute_values WHERE attribute_id='\".$row['attribute_id'].\"' AND active='1'\";\r\n\t\t\t\t\t\t\t\t$options = doQuery($sel);\r\n\t\t\t\t\t\t\t\twhile($row1 = mysql_fetch_array($options)){\r\n\t\t\t\t\t\t\t\t\t$selected = \"\";\r\n\t\t\t\t\t\t\t\t\tif($row1['attribute_value_id'] == $_POST['value']){ $selected = \" SELECTED \"; }\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\techo\t\"\t<option value='\".$row1['attribute_value_id'].\"' \".$selected.\">\".$row1['name'].\"</option>\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\techo \t\"\t</select>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// CHECKBOX GROUP\r\n\t\t\t\t\t\tif($row['type'] == 'Checkbox Group'){\r\n\t\t\t\t\t\t\techo \t\"\t<ul class='attribute-list attribute-ul-\".$row['attribute_id'].\"'>\"; // BEGIN ATTRIBUTE LOOPED LIST\r\n\t\t\t\t\t\t\t//$table = \"ecommerce_product_attribute_values\";\r\n\t\t\t\t\t\t\t//$options = getSqlSelectArray($table);\r\n\t\t\t\t\t\t\t$sel = \"SELECT * FROM ecommerce_product_attribute_values WHERE attribute_id='\".$row['attribute_id'].\"' AND active='1'\";\r\n\t\t\t\t\t\t\t$options = doQuery($sel);\r\n\t\t\t\t\t\t\twhile($row1 = mysql_fetch_array($options)){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif($edit == 1){\r\n\t\t\t\t\t\t\t\t\t// GET THE RELATIONAL ATTRIBUTE ITEMS FOR THIS ATTRIBUTE IN THE CART FOR THIS CART ITEM\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$sel = \"SELECT * FROM ecommerce_product_attribute_cart_relational WHERE relational_item_id='\".$cartitem_id.\"' AND attribute_id='\".$row['attribute_id'].\"' AND attribute_value_id='\".$row1['attribute_value_id'].\"'\";\r\n\t\t\t\t\t\t\t\t\t$res = doQuery($sel);\r\n\t\t\t\t\t\t\t\t\t$item = mysql_fetch_array($res);\r\n\t\t\t\t\t\t\t\t\t$_POST['value'] = $item['attribute_value_id'];\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//echo \"<Br>ATTRIBUTE ID VALUE: \".$_POST['value'].\"<Br>\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$selected = \"\";\r\n\t\t\t\t\t\t\t\tif($row1['attribute_value_id'] == $_POST['value']){ $selected = \" CHECKED \"; }\r\n\t\t\t\t\t\t\t\techo\t\"\t\t<li class='attribute-li-\".$row1['attribute_value_id'].\"' style='background-image:url(\".$_SETTINGS['website'].\"uploads/\".$row1['image'].\"); background-repeat:no-repeat;'>\";\r\n\t\t\t\t\t\t\t\techo \t\"\t\t\t<input type='checkbox' \".$selected.\" name='attribute[]' value='\".$row1['attribute_value_id'].\"'> \";\r\n\t\t\t\t\t\t\t\techo \t\"\t\t\t<label>\".$row1['name'].\"</label>\";\r\n\t\t\t\t\t\t\t\techo\t\"\t\t</li>\";\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo\t\"\t</ul><br clear='all'\"; // END ATTRIBUTE LOOPED LIST\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// RADIO GROUP\r\n\t\t\t\t\t\tif($row['type'] == 'Radio Group'){\r\n\t\t\t\t\t\t\techo \t\"\t<ul class='attribute-list attribute-ul-\".$row['attribute_id'].\"'>\"; // BEGIN ATTRIBUTE LOOPED LIST\r\n\t\t\t\t\t\t\t//$table = \"ecommerce_product_attribute_values\";\r\n\t\t\t\t\t\t\t//$options = getSqlSelectArray($table);\r\n\t\t\t\t\t\t\t$sel = \"SELECT * FROM ecommerce_product_attribute_values WHERE attribute_id='\".$row['attribute_id'].\"' AND active='1'\";\r\n\t\t\t\t\t\t\t$options = doQuery($sel);\r\n\t\t\t\t\t\t\twhile($row1 = mysql_fetch_array($options)){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif($edit == 1){\r\n\t\t\t\t\t\t\t\t\t// GET THE RELATIONAL ATTRIBUTE ITEMS FOR THIS ATTRIBUTE IN THE CART FOR THIS CART ITEM\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$sel = \"SELECT * FROM ecommerce_product_attribute_cart_relational WHERE relational_item_id='\".$cartitem_id.\"' AND attribute_id='\".$row['attribute_id'].\"' AND attribute_value_id='\".$row1['attribute_value_id'].\"'\";\r\n\t\t\t\t\t\t\t\t\t$res = doQuery($sel);\r\n\t\t\t\t\t\t\t\t\t$item = mysql_fetch_array($res);\r\n\t\t\t\t\t\t\t\t\t$_POST['value'] = $item['attribute_value_id'];\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//echo \"<Br>ATTRIBUTE ID VALUE: \".$_POST['value'].\"<Br>\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$selected = \"\";\r\n\t\t\t\t\t\t\t\tif($row1['attribute_value_id'] == $_POST['value']){ $selected = \" CHECKED \"; }\r\n\t\t\t\t\t\t\t\techo\t\"\t\t<li class='attribute-li-\".$row1['attribute_value_id'].\"' style='background-image:url(\".$_SETTINGS['website'].\"uploads/\".$row1['image'].\"); background-repeat:no-repeat;'>\";\r\n\t\t\t\t\t\t\t\techo \t\"\t\t\t<input type='radio' \".$selected.\" name='attribute[]' value='\".$row1['attribute_value_id'].\"'> \";\r\n\t\t\t\t\t\t\t\techo \t\"\t\t\t<label>\".$row1['name'].\"</label>\";\r\n\t\t\t\t\t\t\t\techo\t\"\t\t</li>\";\r\n\t\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo\t\"\t\t<li class='attribute-li-\".$row1['attribute_value_id'].\"' style=''>\";\r\n\t\t\t\t\t\t\techo \t\"\t\t\t<input type='radio' \".$selected.\" name='attribute[]' value=''> \";\r\n\t\t\t\t\t\t\techo \t\"\t\t\t<label>None</label>\";\r\n\t\t\t\t\t\t\techo\t\"\t\t</li>\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo\t\"\t</ul><br clear='all'><br>\"; // END ATTRIBUTE LOOPED LIST\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$ie++;\t\t\t\t\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// PRODUCT NOTE \r\n\t\t\t\tif($edit == 1){\r\n\t\t\t\t\t// GET THE NOTE FROM THE CART\r\n\t\t\t\t\t$sel = \"SELECT * FROM ecommerce_product_cart_relational WHERE item_id='\".$cartitem_id.\"' LIMIT 1\";\r\n\t\t\t\t\t$res = doQuery($sel);\r\n\t\t\t\t\t$item = mysql_fetch_array($res);\r\n\t\t\t\t\t$_POST['NOTE'] = $item['note'];\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\techo \t\"\t\t\t<span class='productdescription-heading'>Note:</span>\".\r\n\t\t\t\t\t\t\"\t\t\t<textarea class='product-note' name='NOTE' >\".$_POST['NOTE'].\"</textarea>\";\r\n\t\t\t\t\r\n\t\t\t\techo\t\"\t\t\t<input type='hidden' class='addtocart-hidden' name='PRODUCTID' value='\".$rowproduct['product_id'].\"'\";\r\n\t\t\t\t//echo\t\"\t\t\t<input type='hidden' class='addtocart-hidden' name='QTY' value='1'\";\r\n\t\t\t\tif($edit == 1){\r\n\t\t\t\t\techo \t\"\t\t\t<p class='p-add-to-cart'><input type='hidden' name='cartitem_id' value='\".$cartitem_id.\"'><input class='add-to-cart-button button' type='submit' name='UPDATEITEM' value='Update Item'></p>\";\r\n\t\t\t\t} else {\t\r\n\t\t\t\t\t//if($rowproduct['take_inventory'] == '1' ){\r\n\t\t\t\t\t//\tif($rowproduct['inventory'] > 0){\r\n\t\t\t\t\techo \t\"\t\t<p class='p-add-to-cart'><input class='add-to-cart-button button' type='submit' name='ADDTOCART' value='Add To Cart'></p>\";\r\n\t\t\t\t\t//\t}\r\n\t\t\t\t\t//}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo \t\"\t\t</div>\"; // END PRODUCT DESCRIPTION\r\n\t\t\techo \t\"\t</div>\"; // END PRODUCT INFO BOX\t\t\r\n\t\t\t//echo \t\"\t<br clear='all'>\";\r\n\t\t\techo \t\"\t</form>\"; // END FORM\r\n\t\t\t\r\n\t\t\t// IF THERE ARE REVIEW FOR THIS PRODUCT\r\n\t\t\t// SHOW THE VIEW TAB\r\n\t\t\t$seltestimonial = \"SELECT comment_id FROM ecommerce_product_comments WHERE product_id='\".$rowproduct['product_id'].\"' AND active='1' AND status='Published'\";\r\n\t\t\t$restestimonial = doQuery($seltestimonial);\r\n\t\t\t$numtestimonial = mysql_num_rows($restestimonial);\r\n\t\t\t\r\n\t\t\techo \"<div id='tabs'>\r\n\t\t\t\t\t<ul>\";\r\n\t\t\t\r\n\t\t\tif($numtestimonial){\t\t\r\n\t\t\t\techo \"\t<li><a href='#tabs-reviews'>Product Reviews</a></li>\";\r\n\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\techo \"\t\t<li><a href='#tabs-write'>Write a Review</a></li>\";\r\n\t\t\techo \"\t\t<li><a href='#tabs-related'>You'll also like...</a></li>\";\r\n\t\t\techo \"\t\t<li><a href='#tabs-packaging'>Packaging</a></li>\";\r\n\t\t\t\r\n\t\t\tif($_SESSION['filter_heshe'] == 'intention')\r\n\t\t\t{\r\n\t\t\t\techo \"\t<li><a href='#tabs-manifestation'>Manifestation Card</a></li>\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo \"\t</ul>\";\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\tif($numtestimonial){\t\t\r\n\t\t\t\techo \"\t<div id='tabs-reviews'>\";\r\n\t\t\t\t\t\t$this->DisplayComments($rowproduct['product_id']);\t\t\t\t\t\t\t\r\n\t\t\t\techo \"\t</div>\";\r\n\t\t\t}\t\t\t\r\n\t\t\techo \"\t<div id='tabs-write'>\";\r\n\t\t\t\t\t\t$this->DisplayCommentForm($rowproduct['product_id']);\t\t\t\t\t\t\t\r\n\t\t\techo \"\t</div>\r\n\t\t\t\t\t<div id='tabs-related'>\";\t\t\t\t\t\t\r\n\t\t\t\t\t\t$this->SBDisplayRelatedProducts();\t\t\t\t\t\t\t\r\n\t\t\techo \"\t</div>\";\r\n\t\t\t\r\n\t\t\techo \"<div id='tabs-packaging' style='text-align:center;'>\";\r\n\t\t\techo \"\t<img src='\".$_SETTINGS['website'].\"uploads/packaging.jpg' style='margin:25px 0;'>\";\r\n\t\t\techo \"</div>\";\r\n\t\t\t\r\n\t\t\tif($_SESSION['filter_heshe'] == 'intention')\r\n\t\t\t{\r\n\t\t\t\techo \"\t<div id='tabs-manifestation' style='text-align:center;'><a class='productlightbox' href='\".$_SETTINGS['website'].\"uploads/manifestation.jpg'><img src='\".$_SETTINGS['website'].\"uploads/manifestation.jpg' style='margin:25px 0; width:550px;'></a></div>\";\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo \"</div>\";\r\n\r\n\t\t\techo \"\r\n\t\t\t<script>\r\n\t\t\t\t$( '#tabs' ).tabs();\r\n\t\t\t</script>\t\t\t\r\n\t\t\t\";\r\n\t\t\t\r\n\t\t\techo \"<br clear='all'>\";\r\n\t\t\t\r\n\t\t\techo\t\"</div>\"; // END PRODUCT BOX\r\n\t\t} // display\r\n\t}", "public function purchasecommitteedetails(){\n $data['result'] = $this->PICO_model->get_list('purchase_com_form_rule');\n $this->logger->write_logmessage(\"view\",\" View Purchase Committee Formation Rules\", \"Purchase Committee Formation Rules...\");\n $this->logger->write_dblogmessage(\"view\",\" Purchase Committee Formation Rules\", \"Purchase Committee Formation Rules...\");\n $this->load->view('setup/displaypurchasecommitteedetails',$data);\n }", "public function noaprobar($productoid)\n\t{\n\t\t$data['cuadernos'] = $this->libros_modelo->noaprobar_libro($productoid);\n\t\t$email = $data['cuadernos']['email'];\n\t\t$titulo = $data['cuadernos']['titulo'];\n\t\t$titulo2 = $data['cuadernos']['titulo2'];\n\t\t//email de quien aprueba el intercambio\n\t\t$correo = $this->session->userdata('email');\n\t\t$nombre = $this->session->userdata('nombre');\n\n\t\t#mandar email de aprobacion de intercambio\n\t\t$this->load->library('email');\n\t\t#Email a la persona a que tiene el libro\n\t\t$this->email->from('[email protected]','comovaelmio.com/index.php/libros');\n\t\t$this->email->to($correo);\n\t\t$this->email->subject('Has desistido del intercambio');\n\t\t$this->email->message('Has decidido no hacer el intercambio de'.\"\\t\".$titulo.\"\\t\".'por'.\"\\t\".$titulo2.', agradecemos tu participacion.');\n\t\t$this->email->send();\n\t\t$this->email->clear();\n\t\t#email a la persona que inicia el intercambio\n\t\t$this->email->from('[email protected]','comovaelmio.com/index.php/libros');\n\t\t$this->email->to($email);\n\t\t$this->email->subject('El intercambio de libros se ha anulado');\n\t\t$this->email->message($nombre.\"\\t\".'no ha aprobado el intercambio de' .\"\\t\".$titulo.\"\\t\".'por'.\"\\t\".$titulo2.', por favor intenta un nuevo intercambio, agradecemos tu participacion');\n\t\t$this->email->send();\n\n\t\t$this->load->view('templates/header');\n\t\t$this->load->view('templates/navegacion');\n\t\t$this->load->view('libros/noaprobar');\n\t\t$this->load->view('templates/footer');\n\t}", "public function product_report_details(){\n\t\t$id = $_REQUEST[ 'id' ];\n\t\t$this -> db -> select('sum(si.currentstock) as currentstock,\n\t\t\tip.id as pid, ip.itemcode, ip.itemimage, ip.itemname, ip.sellprice, ii.createdby, ii.created_at, sti.storename, sta.statustitle '); \n\t\t$this -> db -> from('item_parent as ip');\n\t\t$this -> db -> join('item_info as ii', 'ip.id = ii.parentid', 'left');\n\t\t$this -> db -> join('stock_info as si', 'ii.id = si.itemid', 'left');\n\t\t$this -> db -> join('store_info as sti', 'ii.store = sti.id', 'left');\n\t\t$this -> db -> join('status_info as sta', 'ip.status = sta.id');\n\t\t$this -> db -> where('itemcode = \"'.$id.'\"');\n\t\t\n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n foreach ($query->result() as $row) {\n\t\t\t\t$this -> db -> select('sizeshortcode, currentstock');\n\t\t\t\t$this -> db -> from('item_info as ii');\n\t\t\t\t$this -> db -> join('size_info as siz', 'siz.id = ii.size');\n\t\t\t\t$this -> db -> join('stock_info as si', 'ii.id = si.itemid');\n\t\t\t\t$this -> db -> where('ii.parentid', $row->pid);\n\t\t\t\t$query1 = $this->db->get();\n\t\t\t\t$data1 = array(\n\t\t\t\t'currentstock' \t=> $row->currentstock,\n\t\t\t\t'itemcode' \t\t=> $row->itemcode,\n\t\t\t\t'itemimage' \t=> $row->itemimage,\n\t\t\t\t'itemname' \t\t=> $row->itemname,\n\t\t\t\t'sellprice' \t=> $row->sellprice,\n\t\t\t\t'createdby' \t=> $row->createdby,\n\t\t\t\t'created_at' \t=> $row->created_at,\n\t\t\t\t'storename' \t=> $row->storename,\n\t\t\t\t'statustitle' \t=> $row->statustitle,\n\t\t\t\t'stock_info' \t=> $query1->result()\n\t\t\t\t);\n\t\t\t\t$data[] = $data1;\n }\n return $data;\n }\n return false;\n }", "public function toString()\n {\n return 'Bundle Product Detail is correctly.';\n }", "public function singleproduct() {\n $id = $_GET['id'];\n $data = array();\n $all = $this->db->query(\"SELECT * from product where id = $id\");\n $data['result'] = $all->result();\n $result = $this->db->query(\"SELECT * from product_journal where product_id = $id\");\n $data['journal'] = $result->result();\n $data['header'] = $this->load->view('print/header', $data, true);\n $data['footer'] = $this->load->view('print/footer', $data, true);\n $this->load->view('print/singleproduct', $data);\n }", "function buildProductsDetails($productInfo) {\n $pd = '<h1>'.$productInfo['invName'].'</h1>'; \n $pd .= '<section id=\"prod-details\">';\n $pd .= '<div>';\n $pd .= '<img src=\\''.$productInfo['invImage'].\"' alt='Image of \".$productInfo['invName'].\" on Acme.com'>\";\n $pd .= \"<ul>\";\n $pd .= \"<li>Available Stock: $productInfo[invStock]</li>\";\n $pd .= \"<li>Weight: $productInfo[invWeight]</li>\";\n $pd .= \"<li>Location: $productInfo[invLocation]</li>\";\n $pd .= \"<li>Vendor: $productInfo[invVendor]</li>\";\n $pd .= \"<li>Style: $productInfo[invStyle]</li>\";\n $pd .= \"</ul>\";\n $pd .= \"<p>$productInfo[invDescription]</p><br>\";\n $pd .= \"<p class='result2'>See Product Reviews Below</p>\";\n $pd .= \"<span>$$productInfo[invPrice]</span>\";\n $pd .= '</div>';\n $pd .= '</section>';\n return $pd;\n}", "public function actionDetail()\r\n {\n #Region Init Param\r\n $arr_errorEnt = array();\r\n $s_errorMsg = null;\r\n $o_product = null;\n $arr_category = null;\n $s_urlCategory = null;\n $s_urlCateParent = null;\n #EndRegion Init Param\n\n #Region Check Request Param\n $b_result = self::checkDetailParam();\n if( ErrorEntity::isErrorEntity($b_result) )\r\n {\r\n array_push($arr_errorEnt, $b_result);\r\n $o_product = null;\r\n }\n #EndRegion Check Request Param\n\n #Region Set Category Entity to array\n $arr_category = self::getCategoryProduct();\n if( ErrorEntity::isErrorEntity($arr_category) )\n {\n array_push($arr_errorEnt, $arr_category);\n $arr_category = null;\n }\n #EndRegion\n\n #Region Set detail of product\n if ( count($arr_errorEnt) == 0 )\n {\n $i_key = $_REQUEST[\"key\"];\n $o_product = Product::model()->findByPk($i_key);\n }\n\n if ( is_null($o_product) )\r\n {\r\n $o_product = null;\r\n $o_error = new ErrorEntity();\r\n $o_error->errCode = \"ERR_5\";\r\n $o_error->param = null;\r\n array_push($arr_errorEnt, $o_error);\r\n }\n else \n {\n $s_urlCategory = Yii::app()->createAbsoluteUrl( \"product/search\",\r\n array ( \"urlMapping\" => $o_product->category0->url_mapping,\r\n \"category\" => $o_product->category0->identification,\r\n \"page\" => 1\r\n )\r\n );\r\n\r\n if ($o_product->category0->parent > 0) \n {\n $o_categoryParent = Category::model()->findByPk($o_product->category0->parent);\n\n if ( $o_categoryParent instanceof Category )\n {\n $o_product->category0->parent_name = $o_categoryParent->name;\r\n $s_urlCateParent = Yii::app()->createAbsoluteUrl( \"product/search\",\r\n array ( \"urlMapping\" => $o_categoryParent->url_mapping,\r\n \"category\" => $o_categoryParent->identification,\r\n \"page\" => 1\r\n )\r\n );\n }\n }//End if\n }//End else\n #EndRegion\n\n //Set error Message if exist\r\n if ( count($arr_errorEnt) > 0 )\r\n {\r\n $s_errorMsg = self::getErrorMessage($arr_errorEnt);\r\n }\n\n //Set render to template\n $this->render(\r\n \"detail\",\r\n array(\n \"s_urlCategory\" => $s_urlCategory,\n \"s_urlCateParent\" => $s_urlCateParent,\n \"arr_category\" => $arr_category,\r\n \"o_product\" => $o_product,\r\n \"s_errorMsg\" => $s_errorMsg\r\n )\r\n );//End render\n }", "public function showProductDetails(int $productId) {\n \n }", "public function toString()\n {\n return \"Items Ordered section on Create Order page on backend contains correct products.\";\n }", "public function view_order()\n {\n if ($this->checkLogin('A') == '') {\n redirect('admin_ror');\n } else {\n $this->data['heading'] = 'View Order';\n $user_id = $this->uri->segment(4, 0);\n $deal_id = $this->uri->segment(5, 0);\n //$this->data['ViewList'] = $this->order_model->view_orders($user_id,$deal_id);\n $condition = array('id' => $this->uri->segment(4, 0));\n $this->data['productList'] = $this->order_model->get_all_details(RESERVED_INFO, $condition);\n $propAddress = $this->order_model->get_all_details(PRODUCT_ADDRESS, array('property_id' => $this->data['productList']->row()->property_id));\n\n //print_r($this->data['productList']->result());die;\n $PropertyList = $this->data['productList'];\n $this->data['ViewList'] = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<title>Gain Turnkey Property</title>\n</head>\n<body style=\"background:#FFFFFF; width:100%; margin:0; padding:0;\">\n<div style=\"width:50%; margin:0px; padding:0px;\">\n\t<table border=\"0\" width=\"550\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"max-width: 550px;\">\n\t\t\n <tr style=\"background:#c4c4c4; height:85px; width:50%;\">\n \t<td width=\"10%;\"><img style=\"float:left;\" src=\"' . $_SERVER['DOCUMENT_ROOT'] . '/images/logo/' . $this->config->item('logo_image') . '\" alt=\"' . $this->config->item('meta_title') . '\" />\n\t\t\t</td>\n\t\t\t<td width=\"13%;\" style=\"vertical-align:top; text-align:right;\">\n\t\t\t<span style=\"float:right; margin:0px 0 0 0px !important; font-family:Arial, Helvetica, sans-serif; font-size:16px; font-weight:bold; width:100%!important; vertical-align:top; text-align:right;\">' . $propAddress->row()->address . ', ' . ucwords($propAddress->row()->city) . ', ' . ucwords(str_replace('-', ' ', $propAddress->row()->state)) . ' ' . $propAddress->row()->post_code . '</span>\n\t\t\t</td>\n </tr>\n </table>\t\t\n <table border=\"0\" width=\"550\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"max-width:550px; margin:0 0 0 0;\">\n \t<tr>\n \t<td height=\"30\" align=\"center\" style=\"float:left; text-align:center; color:#008904; width:100%; font-family:Arial, Helvetica, sans-serif; font-size:23px; font-weight:bold\">Property Reservation Confirmation</td>\n </tr>\n <tr>\n \t<td height=\"50\" style=\" text-align:left; color:#333; width:100%; margin:10px 0 15px 15px; font-size:16px; font-weight:normal; font-family:Arial, Helvetica, sans-serif; overflow:hidden;\">Congratulations! You have successfully placed this property under reserve for purchase. Our staff is working diligently on your closing documents and transfer packet. Please bring this hotsheet with you to your closing at the event.</td>\n </tr>\n </table>\n <table border=\"0\" width=\"500\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" >\n \n \t<tr style=\"margin:20px 0 20px;\">\n \n \t<td width=\"200\">\n \t<img src=\"' . $_SERVER['DOCUMENT_ROOT'] . '/images/product/' . $PropertyList->row()->image . '\" style=\"width:250px !important; height:190px; border-radius:6px !important;\" />\n </td>\n \n <td width=\"300\">\n \n \t<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" align=\"left\">\n \n \t<tr style=\"margin:5px 0 15px 0px; line-height:26px;\" >\n \t<td colspan=\"2\" style=\" font-size:14px; margin:10px 0 15px 0px; color:#000000; font-family:Arial, Helvetica, sans-serif;\" valign=\"top\"><b>Property ID: ' . $PropertyList->row()->rental_id . '</b></td>\n </tr>\n \n \n <tr style=\"margin:5px 0 15px 0px; line-height:26px;\">\n \t<td colspan=\"2\" style=\" font-size:14px; margin:10px 0 15px 0px; color:#000000; font-family:Arial, Helvetica, sans-serif;\" valign=\"top\"><b>Property Address: ' . $propAddress->row()->address . '<br>' . ucwords($propAddress->row()->city) . ', ' . ucwords(str_replace('-', ' ', $propAddress->row()->state)) . ' ' . $propAddress->row()->post_code . '</b></td>\n </tr>\n \n \n <tr style=\"margin:5px 0 15px 0px; line-height:26px;\">\n \t<td width=\"60%\" style=\" font-size:14px; margin:10px 0 15px 0px; color:#000000; font-family:Arial, Helvetica, sans-serif;\" valign=\"top\"><b>Beds : ' . $PropertyList->row()->bedrooms . '</b></td>\n\t\t\t\t\t\t<td width=\"35%\" align=\"right\" style=\"margin:0 0 0 0px;color:#000000; font-family:Arial, Helvetica, sans-serif; font-size:12px; text-align:left;\" valign=\"top\">\n\t\t\t\t\t\t<b style=\"margin:0 0 0 0px\" height=\"30px\">Baths : ' . $PropertyList->row()->baths . '</b></td>\n </tr>\n \n \n <tr style=\"margin:5px 0 15px 0px; line-height:26px;\">\n \t<td style=\" font-size:14px; margin:10px 0 15px 0px; color:#000000; font-family:Arial, Helvetica, sans-serif;\" valign=\"top\">\n\t\t\t\t\t\t<b>Sq.Ft : ' . $PropertyList->row()->sq_feet . '</b></td>\n \n\t\t\t\t\t\t<td align=\"right\" valign=\"top\" width=\"30%\" style=\"margin:0 0 0 0px;color:#000000; font-family:Arial, Helvetica, sans-serif; font-size:14px; text-align:left;\" >\n \n\t\t\t\t\t\t<b style=\"margin:0 0 0 0px;color:#000000; font-family:Arial, Helvetica, sans-serif; font-size:12px;\" >Lot Size : ' . $PropertyList->row()->lot_size . '</b> </td>\n \n </tr>\n \n \n <tr style=\"margin:5px 0 15px 0px; line-height:28px;\">\n \n \t<td colspan=\"2\" valign=\"top\" style=\" font-size:14px; margin:0 0 15px 0px; color:#000000; font-family:Arial, Helvetica, sans-serif;\"> <b>Monthly Rental Amount : $' . number_format($PropertyList->row()->monthly_rent, 0) . '</b></br> </td>\n <br />\n\n\t\t\t\t\t\t\n </tr>\n \n \n\t\t\t\t\t<tr style=\"margin:5px 0 15px 0px; line-height:28px;\">\n \n\t\t\t\t\t<td colspan=\"2\" valign=\"top\" style=\" font-size:14px; width=100% !important; margin:0 0 15px 0px; color:#000000; font-family:Arial, Helvetica, sans-serif;\"> <b>Estimated Annual Tax: $' . number_format($PropertyList->row()->property_tax, 0) . ' </b> </td>\n\t\t\t\t\t</tr>\n \n </table>\n \n </td>\n \n </tr>\n </table>\n\n\n <table border=\"0\" width=\"550\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"max-width:550px;\">\n \n \t<tr>\n \n \t<td colspan=\"3\"><h2 style=\"color:#008904; font-size:23px; font-family:Arial, Helvetica, sans-serif; margin:15px 0 15px 0px;\">Reservation Information</h2></td>\n \n </tr>\n \n \t<tr>\n \n <td colspan=\"3\"><span style=\"width:40%; display:inline-block; margin:0 0 15px; font-weight:bold; font-size:14px; font-family:Arial, Helvetica, sans-serif\">Purchaser Name: '.ucfirst($PropertyList->row()->first_name).' '.ucfirst($PropertyList->row()->last_name).' </span></td>\n \n \n </tr>\n \n <tr>\n \n \t<td><span style=\"display:inline-block; font-weight:bold; margin:0 0 15px; font-size:14px; font-family:Arial, Helvetica, sans-serif\">Entity Name: ' . $PropertyList->row()->entity_name . '</span></td>\n \n <td colspan=\"2\"><span style=\" display:inline-block; font-weight:bold; margin:0 0 15px; font-size:14px; font-family:Arial, Helvetica, sans-serif\">Entity Type: '.$PropertyList->row()->resrv_type.'</span></td>\n \n </tr>\n \n <tr>\n \n \t<td colspan=\"3\"><span style=\" display:inline-block; font-weight:bold; margin:0 0 15px; font-size:14px; font-family:Arial, Helvetica, sans-serif\">Address: ' . $PropertyList->row()->address . '</span></td>\n \n </tr>\n \n \n <tr>\n \n \t<td><span style=\" display:inline-block; font-weight:bold; margin:0 0 15px; font-size:14px; font-family:Arial, Helvetica, sans-serif\">City: ' . $PropertyList->row()->city . '</span></td>\n \n <td><span style=\" display:inline-block; float:left; font-weight:bold; margin:0 0 15px; font-size:14px; font-family:Arial, Helvetica, sans-serif\">State: '.str_replace('-',' ',$PropertyList->row()->state).'</span></td>\n \n <td><span style=\" display:inline-block; float:left; font-weight:bold; margin:0 0 15px; font-size:14px; font-family:Arial, Helvetica, sans-serif\">Zip: '.$PropertyList->row()->postal_code.'</span></td>\n \n </tr>\n \n \n <tr>\n \n \t<td><span style=\" display:inline-block; font-weight:bold; margin:0 0 15px; font-size:14px; font-family:Arial, Helvetica, sans-serif\">Phone: ' . $PropertyList->row()->phone_no . '</span></td>\n \n <td colspan=\"2\"><span style=\" display:inline-block; font-weight:bold; margin:0px 0 15px; font-size:14px; font-family:Arial, Helvetica, sans-serif\">Phone 2: '.$PropertyList->row()->phone_no1.'</span></td>\n \n </tr>\n \n \n <tr>\n \n \t<td><span style=\" display:inline-block; font-weight:bold; margin:0 0 15px; font-size:14px; font-family:Arial, Helvetica, sans-serif\">Email1: ' . $PropertyList->row()->email . '</span></td>\n \n <td colspan=\"2\"><span style=\" display:inline-block; font-weight:bold; margin:0 0 15px; font-size:14px; font-family:Arial, Helvetica, sans-serif\">Email2: '.$PropertyList->row()->email1.'</span></td>\n \n </tr>\n \n \n <tr>\n \n \t<td><span style=\" display:inline-block; font-weight:bold; margin:0 0 15px; font-size:14px; font-family:Arial, Helvetica, sans-serif\">Sales Price: $' . number_format($PropertyList->row()->sales_price, 0) . '</span></td>\n \n \n \n ';\n if ($PropertyList->row()->adjustment != '') {\n $this->data['ViewList'] .= '\n \n \t<td><span style=\" display:inline-block; font-weight:bold; margin:0 0 15px; font-size:14px; font-family:Arial, Helvetica, sans-serif\">Adjustment: $' . number_format($PropertyList->row()->adjustment, 0) . '</span></td>\n \n \n \n ';\n } else {\n $this->data['ViewList'] .= '<td colspan=\"2\">&nbsp;</td>';\n }\n $this->data['ViewList'] .= ' </tr>\n \n \n <tr>\n \n \t<td><span style=\" display:inline-block; font-weight:bold; margin:0 0 15px; font-size:14px; font-family:Arial, Helvetica, sans-serif\">Reservation Fee: $' . number_format($PropertyList->row()->reserv_price, 0) . '</span></td>\n \n <td colspan=\"2\"><span style=\" display:inline-block; font-weight:bold; margin:0 0 15px; font-size:14px; font-family:Arial, Helvetica, sans-serif\">In form Of: '.$PropertyList->row()->sales_cash.' '.$PropertyList->row()->sales_cf.' '.$PropertyList->row()->sales_cs.' '.$PropertyList->row()->sales_fs.' '.$PropertyList->row()->sales_sdira.' '.$PropertyList->row()->sales_sl.'</span></td>\n \n </tr>\n \n \n <tr>\n \n \t<td><span style=\"display:inline-block; font-weight:bold; margin:0 0 15px; font-size:14px; font-family:Arial, Helvetica, sans-serif\">Sale Type: ' . $PropertyList->row()->cash_payment . ' ' . $PropertyList->row()->check_payment . ' ' . $PropertyList->row()->credit_payment . ' ' . $PropertyList->row()->dot_payment . '</span></td>\n \n <td colspan=\"2\"><span style=\" display:inline-block; font-weight:bold; margin:0 0 15px; font-size:14px; font-family:Arial, Helvetica, sans-serif\">Custodian name: '.$PropertyList->row()->cust_name.'</span></td>\n \n </tr>\n \n \n <tr>\n \n \t<td><span style=\" display:inline-block; font-weight:bold; margin:0 0 15px; font-size:14px; font-family:Arial, Helvetica, sans-serif\">Note: ' . $PropertyList->row()->note . '</span></td>\n \n <td colspan=\"2\"><span style=\" display:inline-block; font-weight:bold; margin:0 0 15px; font-size:14px; font-family:Arial, Helvetica, sans-serif\">Account number: '.$PropertyList->row()->account_no.'</span></td>\n \n </tr>\n \n </table> \n \n <table border=\"0\" width=\"550\" cellpadding=\"0\" cellspacing=\"0\" style=\"max-width:550px;\">\n \t<tr>\n \t<td colspan=\"3\" style=\" font-size:14px; line-height:19px; margin-bottom:5px; text-align:left; font-family:Arial, Helvetica, sans-serif\" width=\"550\" >\n \tThis Property reservation Confirmation is your receipt of your commitment to purchase the above referenced property. Due to the nature of the investors summit, and the overwhelming intrest the students have in purchasing the properties brought to the event by our preferred vendors, your possession of this document is evidence that the property has been removed from our active database and is no longer available for sale to other students. Our staff will contact you during the final two days of the event to arrange the production and execution of the final document for closing. Please keep this information for reference prior to closing.\n </td>\n </tr>\n \n \n <tr style=\"background:#bebebe; height:27px; margin:35px 10px 10px 10px; width:100%;\" >\n \t<td width=\"35%\" style=\"text-align:left; color:#000; font-size:11px; margin:6px 0 0px; font-family:Arial, Helvetica, sans-serif; padding:3px 0px 3px 10px;\">' . $this->config->item('footer_content') . '</td>\n <td width=\"25%\" style=\"text-align:left; color:#000; font-size:11px; margin:6px 0 0px; font-family:Arial, Helvetica, sans-serif; padding:3px 0px 3px 50px;\">All Rights Reserved</td>\n <td width=\"35%\" style=\"text-align:left; color:#000; font-size:11px; margin:6px 0 0px; font-family:Arial, Helvetica, sans-serif; padding:3px 10px 3px 3px;\">Unauthorized Use or Duplication is Prohibited</td>\n </tr>\n </table> \n \n </div>\n \n \n<div style=\"width:50%; margin:0px; padding:0px;\">\n\t<table border=\"0\" width=\"550\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"max-width: 550px;\">\n\t\t\n <tr style=\"background:#c4c4c4; height:85px; width:50%;\">\n \t<td width=\"10%;\"><img style=\"float:left;\" src=\"' . $_SERVER['DOCUMENT_ROOT'] . '/images/logo/' . $this->config->item('logo_image') . '\" alt=\"' . $this->config->item('meta_title') . '\" />\n\t\t\t</td>\n\t\t\t<td width=\"13%;\" style=\"vertical-align:top; text-align:right;\">\n\t\t\t<span style=\"float:right; margin:0px 0 0 0px !important; font-family:Arial, Helvetica, sans-serif; font-size:16px; font-weight:bold; width:100% !important; vertical-align:top; text-align:right;\">INTENT to PURCHASE AGREEMENT</span>\n\t\t\t</td>\n </tr>\n </table>\t\t\n <table border=\"0\" width=\"550\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"max-width:550px; margin:15px 0 10px 0;\">\n <tr>\n \t<td height=\"50\" style=\" text-align:left; color:#333; width:100%; margin:10px 0 15px 15px; font-size:16px; font-weight:normal; font-family:Arial, Helvetica, sans-serif; overflow:hidden;\">This letter sets forth some of the basic terms under which Seller and Purchaser would be interested in entering into a Real Estate Purchase Agreement. It serves as a letter of intent (“Letter”) from ' . $PropertyList->row()->entity_name . ' (\"Purchaser\") through and dated ' . date('m-d-Y', strtotime($PropertyList->row()->dateAdded)) . ', in which Purchaser has set forth its interest in acquiring the subject Property. Nevertheless, please be advised that this letter is not contractually binding on the parties and is only an expression of the basic terms and conditions to be incorporated in a formal written agreement. </td>\n </tr>\n </table>\n \n <table border=\"0\" width=\"500\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" >\n \n \t<tr style=\"margin:20px 0 20px;\">\n \n \t<td cellpadding=\"0\" cellspacing=\"0\" width=\"250\" align=\"left\">\n \n \t<table>\n \n \t<tr>\n \n \t<td valign=\"top\"><span style=\"font-weight:bold; font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#000000;\">PROPERTY: </span></td>\n \n <td valign=\"middle\">'.$propAddress->row()->address.'<br>'.ucwords($propAddress->row()->city).', '.ucwords(str_replace('-',' ',$propAddress->row()->state)).' '.$propAddress->row()->post_code.'</td>\n \n </tr>\n \n <tr>\n \n \t<td>&nbsp;</td>\n \n <td><small style=\"font-size:11px; font-family:Arial, Helvetica, sans-serif; color:#333;\">(herinafter, the “Property”)</small></td>\n \n </tr>\n <tr>\n \n \t<td>&nbsp;</td>\n \n <td><small style=\"font-size:11px; font-family:Arial, Helvetica, sans-serif; color:#333;\">&nbsp;</small></td>\n \n </tr>\n \n \t\n \n </table>\n \n </td>\n \n <td cellpadding=\"0\" cellspacing=\"0\" width=\"250\" align=\"left\">\n \n \t<table>\n \n \t<tr>\n \n \t<td><span style=\"font-weight:bold; font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#000000;\">PURCHASER: </span></td>\n \n <td>'.ucwords($PropertyList->row()->entity_name).'</td>\n \n </tr>\n \n \t<tr>\n \n \t<td>&nbsp;</td>\n \n <td>'.ucwords($PropertyList->row()->first_name).' '.ucwords($PropertyList->row()->last_name).'</td>\n \n </tr>\n \n <tr>\n \n \t<td>&nbsp;</td>\n \n <td>'.$PropertyList->row()->address.'</td>\n \n </tr>\n \n \n <tr>\n \n \t<td>&nbsp;</td>\n \n <td>'.$PropertyList->row()->city.', '.str_replace('-',' ',$PropertyList->row()->state).' '.$PropertyList->row()->postal_code.'</td>\n \n </tr>\n \n \n </table>\n \n </td>\n \n </tr>\n </table>\n\n\n <table border=\"0\" width=\"550\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"max-width:550px;\">\n \n \t<tr>\n \n \t<td style=\"line-height:30px;\"><strong style=\"font-weight:bold; font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#000000;\">PAYMENT METHOD: </strong>' . $PropertyList->row()->cash_payment . ' ' . $PropertyList->row()->check_payment . ' ' . $PropertyList->row()->credit_payment . ' ' . $PropertyList->row()->dot_payment . '</td>\n \n </tr>\n \n\n \n \n <tr>\n \n \t<td style=\"line-height:30px;\"><strong style=\"font-weight:bold; font-family:Arial, Helvetica, sans-serif; font-size:16px; color:#000000;\">PURCHASE PRICE: </strong>$' . number_format($PropertyList->row()->sales_price, 0) . '</td>\n \n </tr>';\n if ($PropertyList->row()->adjustment != '') {\n $this->data['ViewList'] .= '<tr>\n \n <td style=\"line-height:30px;\"><strong style=\"font-weight:bold; font-family:Arial, Helvetica, sans-serif; font-size:16px; color:#000000;\">ADJUSTMENT: </strong>$'.number_format($PropertyList->row()->adjustment,0).'</td>\n \n </tr>';\n }\n $this->data['ViewList'] .= '\n \n <tr>\n \n \t<td style=\"line-height:35px;\"><strong style=\"font-weight:bold; font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#000000;\">RESERVATION FEE DEPOSIT: </strong>' . number_format($PropertyList->row()->reserv_price, 0) . ' dollars ($)</td>\n \n </tr>\n \n \n <tr>\n \n \t<td><p style=\"font-weight:normal; margin:0px; padding:0px; font-family:Arial, Helvetica, sans-serif; font-size:10px; color:#000000;\">(”Reservation Fee”) shall be placed in escrow with the Real Estate Brokerage upon the execution of the Purchase Agreement (defined below), the Reservation Fee shall then become non-refundable.</p></td>\n \n </tr>\n \n <tr>\n \n \t<td><strong style=\"font-weight:bold; font-family:Arial, Helvetica, sans-serif; font-size:10px; color:#000000;\">CONTRACT:</strong><span style=\"font-size:10px; color:#000; font-family:Arial, Helvetica, sans-serif; font-weight:normal;\">Upon the mutual execution of this Letter, Seller will promptly prepare a Purchase and Sale Agreement and Seller shall make a good faith effort to deliver said Purchase and Sale Agreement to Purchaser within seven (7) days from the effective date of the LOI. </span></td>\n \n </tr>\n \n <tr>\n \n \t<td><strong style=\"font-weight:bold; font-family:Arial, Helvetica, sans-serif; font-size:10px; color:#000000;\">CLOSING: </strong><span style=\"font-size:10px; color:#000; font-family:Arial, Helvetica, sans-serif; font-weight:normal;\">Closing shall occur on a date mutually acceptable to purchaser and to be outlined in the Purchase Agreement. </span></td>\n \n </tr>\n \n \n <tr>\n \n \t<td><strong style=\"font-weight:bold; font-family:Arial, Helvetica, sans-serif; font-size:10px; color:#000000;\">CONFIDENTIALITY:</strong><span style=\"font-size:10px; color:#000; font-family:Arial, Helvetica, sans-serif; font-weight:normal;\">Seller, Purchaser, and their agents shall maintain the confidentiality of the parties, terms, and conditions of this letter and the negotiations that may follow, if any, from this date forth. The above items are the general business terms and conditions to be covered in the Purchase and Sale Agreement, which would be submitted to the Seller. Additional remaining terms of the Purchase and Sale Agreement will be negotiated and must be acceptable to both Purchaser and Seller.</span></td>\n \n </tr>\n \n <tr>\n \n \t<td style=\"text-align:center;\"><span style=\"font-size:10px; width:100%; color:#000; font-family:Arial, Helvetica, sans-serif; font-weight:bold; text-align:center; line-height:20px;\">This letter is not intended to be a binding contract.</span></td>\n \n </tr>\n \n \n \n <tr>\n \n \t<td><span style=\"font-size:11px; color:#000; font-family:Arial, Helvetica, sans-serif; font-weight:normal; line-height:20px;\">Buyer hereby agrees to the terms and conditions of the letter.</span></td>\n \n </tr>\n \n \n <tr>\n \n \t\t<td>\n \n \t<table width=\"100%\">\n \n \t<tr>\n \n \t<td width=\"45%\" style=\"line-height:20px;\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000;\">Name: </strong>' . $PropertyList->row()->first_name . ' ' . $PropertyList->row()->last_name . '</td>\n \n \n <td width=\"45%\" style=\"line-height:20px;\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000;\">Name: </strong></td>\n \n </tr>\n \n <tr>\n \n \t<td valign=\"bottom\" style=\"vertical-align:bottom; line-height:20px; \"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000;\">Signature:</strong><span style=\"font-size:13px; color:#F00; width:71%; display:inline-block; border-bottom:1px solid #000; vertical-align:bottom; margin-left:10px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; position:relative; top:15px;\">&nbsp;</span></td>\n \n \n <td style=\"line-height:20px;\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000;\">Signature:</strong><span style=\"font-size:13px; color:#F00; width:71%; display:inline-block; border-bottom:1px solid #000; vertical-align:bottom; margin-left:10px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; position:relative; top:15px;\">&nbsp;</span></td>\n \n </tr>\n \n <tr>\n \n \t<td style=\"line-height:20px;\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000;\">Date:</strong><span style=\"font-size:13px; color:#F00; width:71%; display:inline-block; border-bottom:1px solid #000; vertical-align:bottom; margin-left:38px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; position:relative; top:15px;\">&nbsp;</span></td>\n \n \n <td style=\"line-height:20px;\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000;\">Date:</strong><span style=\"font-size:13px; color:#F00; width:71%; display:inline-block; border-bottom:1px solid #000; vertical-align:bottom; margin-left:38px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; position:relative; top:15px;\">&nbsp;</span></td>\n \n </tr>\n \n \n </table>\n \n \n </td>\n \n </tr>\n \n \n <tr>\n \n \t\t<td style=\"line-height:25px;\"><strong style=\"font-weight:bold; font-family:Arial, Helvetica, sans-serif; font-size:16px; color:#000000;\">PURCHASER INFORMATION</strong></td>\n \n \t</tr>\n \n \n \n <tr>\n \n \t\t<td>\n \n \t<table width=\"100%\">\n \n \t<tr>\n \n \t<td width=\"25%\" style=\"line-height:20px;\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000;\">Address: </strong>' . $PropertyList->row()->address . '</td>\n \n <td width=\"20%\" style=\"line-height:20px;\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000;\">City: </strong>'.$PropertyList->row()->city.'</td>\n \n <td width=\"20%\" style=\"line-height:20px;\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000;\">State: </strong>'.str_replace('-',' ',$PropertyList->row()->state).'</td>\n \n <td width=\"20%\" style=\"line-height:20px;\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000;\">Zip Code: </strong>'.$PropertyList->row()->postal_code.'</td>\n \n \n </tr>\n \n \n <tr>\n \n \t<td colspan=\"2\" style=\"line-height:20px;\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000;\">Phone Number: </strong>' . $PropertyList->row()->phone_no . '</td>\n \n <td colspan=\"2\" style=\"line-height:20px;\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000;\">Phone Number: </strong>'.$PropertyList->row()->phone_no1.'</td>\n \n </tr>\n \n <tr>\n \n \t<td colspan=\"2\" style=\"line-height:20px;\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000;\">Email: </strong>' . $PropertyList->row()->email . '</td>\n \n <td colspan=\"2\" style=\"line-height:20px;\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000;\">Email: </strong>'.$PropertyList->row()->email1.'</td>\n \n </tr>\n </table>\n \n </td>\n \n \t</tr>\n\n \n <tr>\n \n \t\t<td>\n \n \t<table width=\"100%\">\n \n \t<tr>\n \n \t<td style=\"line-height:30px;\"><strong style=\"font-weight:bold; font-family:Arial, Helvetica, sans-serif; font-size:16px; color:#000000;\">PURCHASER INFORMATION</strong></td>\n \n <td><span style=\"border:1px solid #000; display:inline-block; width:15px; height:15px;\">&nbsp;</span><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#000000; padding:0px 8px;\">Cash</strong></td>\n \n <td><span style=\"border:1px solid #000; display:inline-block; width:15px; height:15px;\">&nbsp;</span><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#000000; padding:0px 8px;\">Check</strong></td>\n \n <td><span style=\"border:1px solid #000; display:inline-block; width:15px; height:15px;\">&nbsp;</span><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#000000; padding:0px 8px;\">Credit Card</strong></td>\n \n \n </tr>\n \n \n </table>\n \n \n </td>\n \n \t</tr>\n \n \n \t <tr>\n \n \t\t<td style=\"line-height:30px;\"><strong style=\"font-weight:bold; font-family:Arial, Helvetica, sans-serif; font-size:16px; color:#000000;\">CREDIT CARD AUTHORIZATION</strong></td>\n \n \t</tr>\n \n \n <tr>\n \n \t<td>\n \n \t<table width=\"100%\">\n \n \t<tr>\n \n \t<td width=\"40%\" style=\"line-height:20px;\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000; width:40%\">Name on Card:</strong><span style=\"font-size:13px; color:#F00; width:52%; display:inline-block; border-bottom:1px solid #000; vertical-align:bottom; margin-left:65px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; position:relative; top:15px;\">&nbsp;</span></td>\n \n <td width=\"27%\" style=\"line-height:20px;\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000;\">Card Type:</strong><span style=\"font-size:13px; color:#F00; width:58%; display:inline-block; border-bottom:1px solid #000; vertical-align:bottom; margin-left:10px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; position:relative; top:15px;\">&nbsp;</span></td>\n \n <td width=\"33%\" style=\"line-height:20px;\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000;\">Amount: $</strong><span style=\"font-size:13px; color:#F00; width:58%; display:inline-block; border-bottom:1px solid #000; vertical-align:bottom; margin-left:10px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; position:relative; top:15px;\">&nbsp;</span></td>\n \n </tr>\n \n \n <tr>\n \n \t<td width=\"48%\" style=\"line-height:20px;\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000; width:40%\">Card Number:</strong><span style=\"font-size:13px; color:#F00; width:53%; display:inline-block; border-bottom:1px solid #000; vertical-align:bottom; margin-left:70px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; position:relative; top:15px;\">&nbsp;</span></td>\n \n <td width=\"27%\" style=\"line-height:20px;\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000;\">Exp. Date:</strong><span style=\"font-size:13px; color:#F00; width:60%; display:inline-block; border-bottom:1px solid #000; vertical-align:bottom; margin-left:10px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; position:relative; top:15px;\">&nbsp;</span></td>\n \n <td width=\"21%\" style=\"line-height:20px;\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000000;\">Verification Code:</strong><span style=\"font-size:13px; color:#F00; width:39%; display:inline-block; border-bottom:1px solid #000; vertical-align:bottom; margin-left:10px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; position:relative; top:15px;\">&nbsp;</span></td>\n \n </tr>\n \n \n </table>\n \n </td>\n \n \n </tr>\n \n \n <tr>\n \n \t<td>\n \n \t<table width=\"100%\">\n \n \t<tr>\n \n \t <td width=\"50%\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:15px; color:#000000;\">Authorized Signature:</strong><span style=\"font-size:13px; color:#F00; width:170px; display:inline-block; border-bottom:1px solid #000; vertical-align:bottom; margin-left:10px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; position:relative; top:15px;\">&nbsp;</span></td>\n \n <td width=\"60%\">\n \n \t<table width=\"100%\">\n \n \t<tr>\n \n \t<td width=\"26%\"><strong style=\"font-weight:normal; font-family:Arial, Helvetica, sans-serif; font-size:15px; color:#000000;\">Today’s Date: </strong></td>\n \n <td width=\"17%\"><span style=\"font-size:13px; color:#F00; width:62px; display:inline-block; border-bottom:1px solid #000; vertical-align:bottom; margin-left:0px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; position:relative; top:15px;\">&nbsp;</span><span style=\"font-size:13px; display:inline-block; font-family:Arial, Helvetica, sans-serif; font-weight:normal; position:relative; top:15px;\">/</span></td>\n \n <td width=\"20%\"><span style=\"font-size:13px; color:#F00; width:75px; display:inline-block; border-bottom:1px solid #000; vertical-align:bottom; margin-left:0px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; position:relative; top:15px;\">&nbsp;</span><span style=\"font-size:13px; display:inline-block; font-family:Arial, Helvetica, sans-serif; font-weight:normal; position:relative; top:15px;\">/</span></td>\n \n <td width=\"34%\"><span style=\"font-size:13px; color:#F00; width:110px; display:inline-block; border-bottom:1px solid #000; vertical-align:bottom; margin-left:0px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; position:relative; top:15px;\">&nbsp;</span></td>\n \n \n </tr>\n \n </table>\n \n \n </td>\n \n </tr>\n \n \n \n </table>\n \n \n </td>\n \n </tr>\n \n </table> \n \n </div>\n \n</body>\n</html>';\n\n $this->data['propertyAddres'] = url_title($PropertyList->row()->prop_address, '-', TRUE);\n // echo $this->data['ViewList'];exit;\n $this->load->view('admin/order/view_orders', $this->data);\n }\n }", "public function viewStoreProductDetailsAction() {\n $adminModel = Admin_Model_Users::getInstance();\n $result = $adminModel->getAdminDetails(); // showing image\n if ($result) {\n $this->view->admindetails = $result;\n }\n $productsModel = Admin_Model_Products::getInstance();\n $productId = $this->getRequest()->getParam(\"productId\");\n $result = $productsModel->getAllStoreProductdetails($productId);\n if ($result) {\n $this->view->allproductdetails = $result;\n } else {\n echo 'controller error occured';\n }\n }" ]
[ "0.60387766", "0.5921106", "0.5725642", "0.57108146", "0.5632909", "0.56040114", "0.557058", "0.55596054", "0.5557991", "0.55507183", "0.553539", "0.5523871", "0.5485867", "0.54540575", "0.544968", "0.5435152", "0.5430853", "0.541082", "0.5409104", "0.5402937", "0.54016054", "0.5394856", "0.5390646", "0.5389441", "0.5370003", "0.5367204", "0.5358024", "0.5352867", "0.5345962", "0.5345538" ]
0.7023059
0
Czech helper translate to morse code.
public static function morse($text, $number = TRUE) { //prepare text for translation $morseText = \Nette\Utils\Strings::normalize($text); $morseText = \Nette\Utils\Strings::toAscii($morseText); $morseText = \Nette\Utils\Strings::lower($morseText); if($number){ foreach(self::$NUMBERS as $original => $translation){ //translate numbers to text $morseText = str_replace($original, $translation, $morseText); } //remove double spaces $morseText = \Nette\Utils\Strings::replace($morseText, '/ {2,}/', ' '); $morseText = \Nette\Utils\Strings::normalize($morseText); } foreach(self::$TRANSLATOR as $original => $translation){ //translate text to morse code $morseText = str_replace($original, $translation, $morseText); } $morseText = '///' . $morseText . '//'; //start & end of text return $morseText; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function morse_encode($string)\r\n{\r\n $strlength = strlen($string);\r\n $string = strtoupper($string);\r\n $i = 0;\r\n $search = array(\r\n ' ','A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',\r\n 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',\r\n 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3',\r\n '4', '5', '6', '7', '8', '9', '.', ',', '?', '\\'',\r\n '!', '/', '(', ')', '&', ':', ';', '=', '-', '_',\r\n '\"', '$', '@'\r\n );\r\n\r\n $replace = array(\r\n ' ','íP* ', '*íPíPíP ', '*íP*íP ', '*íPíP ', 'íP ', 'íPíP*íP ', '**íP ', 'íPíPíPíP ', 'íPíP ', 'íP*** ',\r\n '*íP* ', 'íP*íPíP ', '** ', '*íP ', '*** ', 'íP**íP ', '**íP* ', 'íP*íP ', 'íPíPíP ', '* ',\r\n 'íPíP* ', 'íPíPíP* ', 'íP** ', '*íPíP* ', '*íP** ', '**íPíP ', '***** ', 'íP**** ', 'íPíP*** ', 'íPíPíP** ',\r\n 'íPíPíPíP* ', 'íPíPíPíPíP ', '*íPíPíPíP ', '**íPíPíP ', '***íPíP ', '****íP ', 'íP*íP*íP* ', '**íPíP** ', 'íPíP**íPíP ', 'íP****íP ',\r\n '*íP*íP** ', '*íPíP*íP ', '*íP**íP ', '*íP**íP* ', 'íP*íPíPíP* ', '***íPíPíP ', '*íP*íP*íP ', '*íPíPíP* ', '*íPíPíPíP* ', 'íPíP** íP* ', 'íP*íPíP*íP ', 'íPíPíP*íPíP* ', 'íP**íP*íP '\r\n );\r\n\r\n $string = str_replace($search, $replace, $string);\r\n $string = str_replace('*', '-', $string);\r\n $string = str_replace('íP', '.', $string);\r\n\r\n return $string;\r\n}", "function mese($mm)\n {\n $char;\n switch ($mm) {\n case 1:\n $char = \"A\";\n break;\n case 2:\n $char = \"B\";\n break;\n case 3:\n $char = \"C\";\n break;\n case 4:\n $char = \"D\";\n break;\n case 5:\n $char = \"E\";\n break;\n case 6:\n $char = \"H\";\n break;\n case 7:\n $char = \"L\";\n break;\n case 8:\n $char = \"M\";\n break;\n case 9:\n $char = \"P\";\n break;\n case 10:\n $char = \"R\";\n break;\n case 11:\n $char = \"S\";\n break;\n case 12:\n $char = \"T\";\n break;\n }\n\n return $char;\n }", "function conversion_majuscule($caractere){\n if($caractere>='A' && $caractere<='Z'){\n return $caractere;\n }\n else {\n $alphabet =[\n 'A' => 'a', 'B' => 'b', 'C' => 'c', 'D' => 'd', 'E' => 'e', 'F' => 'f',\n 'G' => 'g', 'H' => 'h', 'I' => 'i', 'J' => 'j', 'K' => 'k', 'L' => 'l',\n 'M' => 'm', 'N' => 'n', 'O' => 'o', 'P' => 'p', 'Q' => 'q', 'R' => 'r',\n 'S' => 's', 'T' => 't', 'U' => 'u', 'V' => 'v', 'W' => 'w', 'X' => 'x',\n 'Y' => 'y', 'Z' => 'z'\n ];\n foreach ($alphabet as $key => $value) {\n if ($caractere==$value) {\n $caractere=$alphabet[$key];\n }\n }\n return $caractere;\n }\n }", "function nc_search_stem_word_ru($word) {\n \n $VOWEL = 'аеиоуыэюя';\n $PERFECTIVEGROUND = '((ив|ивши|ившись|ыв|ывши|ывшись)|((?<=[ая])(в|вши|вшись)))$';\n $REFLEXIVE = '(с[яь])$';\n $ADJECTIVE = '(ее|ие|ые|ое|ими|ыми|ей|ий|ый|ой|ем|им|ым|ом|его|ого|ему|ому|их|ых|ую|юю|ая|яя|ою|ею)$';\n $PARTICIPLE = '((ивш|ывш|ующ)|((?<=[ая])(ем|нн|вш|ющ|щ)))$';\n $VERB = '((ила|ыла|ена|ейте|уйте|ите|или|ыли|ей|уй|ил|ыл|им|ым|ен|ило|ыло|ено|ят|ует|уют|ит|ыт|ены|ить|ыть|ишь|ую|ю)|((?<=[ая])(ла|на|ете|йте|ли|й|л|ем|н|ло|но|ет|ют|ны|ть|ешь|нно)))$';\n $NOUN = '(а|ев|ов|ие|ье|е|иями|ями|ами|еи|ии|и|ией|ей|ой|ий|й|иям|ям|ием|ем|ам|ом|о|у|ах|иях|ях|ы|ь|ию|ью|ю|ия|ья|я)$';\n $RVRE = '^(.*?['.$VOWEL.'])(.*)$';\n $DERIVATIONAL = '[^'.$VOWEL.']['.$VOWEL.']+[^'.$VOWEL.']+['.$VOWEL.'].*(?<=о)сть?$';\n \n $matches = array();\n if (nc_preg_match_all('/'.$RVRE.'/', $word, $matches)) {\n $start = $matches[1][0];\n $RV = $matches[2][0];\n }\n if (empty($RV)) {\n return $word;\n }\n \n //Step 1\n if (nc_preg_match('/'.$PERFECTIVEGROUND.'/', $RV)) {\n $RV = nc_preg_replace('/'.$PERFECTIVEGROUND.'/', '', $RV);\n }\n else {\n $RV = nc_preg_replace('/'.$REFLEXIVE.'/', '', $RV);\n if (nc_preg_match('/'.$ADJECTIVE.'/', $RV)) {\n $RV = nc_preg_replace('/'.$ADJECTIVE.'/', '', $RV);\n $RV = nc_preg_replace('/'.$PARTICIPLE.'/', '', $RV);\n }\n else {\n if (!nc_preg_match('/'.$VERB.'/', $RV)) {\n $RV = nc_preg_replace('/'.$NOUN.'/', '', $RV);\n }\n else {\n $RV = nc_preg_replace('/'.$VERB.'/', '', $RV);\n }\n }\n }\n \n //Step 2\n $RV = nc_preg_replace('/и$/', '', $RV);\n \n //Step 3\n if (preg_match('/'.$DERIVATIONAL.'/', $RV)) {\n $RV = nc_preg_replace('/ость?$/', '', $RV);\n }\n \n //Step 4\n if (preg_match('/ь$/', $RV)) {\n $RV = nc_preg_replace('/ь$/', '', $RV);\n }\n else {\n $RV = nc_preg_replace('/ейше?/', '', $RV);\n $RV = nc_preg_replace('/нн$/', 'н', $RV);\n }\n \n return $start . $RV;\n}", "function trans($t){\n$str = explode('!',$t);\n$a = array('_','YA','Ya','ya','yee','YO','yo','Yo','ZH','zh','Zh','Z','z','CH','ch','Ch','SH','sh','Sh','YE','ye','Ye','YU','yu','Yu','JA','ja','Ja','A','a','B','b','V','v','G','g','D','d','E','e','I','i','J','j','K','k','L','l','M','m','N','n','O','o','P','p','R','r','S','s','T','t','U','u','F','f','H','h','W','w','x','q','Y','y','C','c','!');\n$b = array(' ','Я','Я','я','ые','Ё','ё','Ё','Ж','ж','Ж','З','з','Ч','ч','Ch','Ш','ш','Ш','Э','э','Э','Ю','ю','Ю','Я','я','Я','А','а','Б','б','В','в','Г','г','Д','д','Е','е','И','и','Й','й','К','к','Л','л','М','м','Н','н','О','о','П','п','Р','р','С','с','Т','т','У','у','Ф','ф','Х','х','Щ','щ','ъ','ь','Ы','ы','Ц','ц','');\nreturn $str[0].str_replace($a,$b,$str[1]);\n}", "private function normalize(string $s) {\n if ($this->CI->db_config->dbinfo->charSet==='greek') {\n if (extension_loaded('intl'))\n $s = Normalizer::normalize($s, Normalizer::FORM_C);\n\n // Implementation note: The conversion TONOS => OXIA happens here rather when the quiz\n // is created (in TypeScript), because this isolates the modifications to a single place\n // (namely here). Otherwise the modification should be made in each value input field\n // and in the MQL input field.\n\n return str_replace(\n // Conversion to accented charcters used in db\n array(//\"\\x3b\", // \\u003b - SEMICOLON\n //\"\\xc2\\xb7\", // \\u00b7 - MIDDLE DOT\n \"\\xce\\xac\", // \\u03ac - GREEK SMALL LETTER ALPHA WITH TONOS\n \"\\xce\\xad\", // \\u03ad - GREEK SMALL LETTER EPSILON WITH TONOS\n \"\\xce\\xae\", // \\u03ae - GREEK SMALL LETTER ETA WITH TONOS\n \"\\xce\\xaf\", // \\u03af - GREEK SMALL LETTER IOTA WITH TONOS\n \"\\xcf\\x8c\", // \\u03cc - GREEK SMALL LETTER OMICRON WITH TONOS\n \"\\xcf\\x8d\", // \\u03cd - GREEK SMALL LETTER UPSILON WITH TONOS\n \"\\xcf\\x8e\", // \\u03ce - GREEK SMALL LETTER OMEGA WITH TONOS\n \"\\xce\\x90\", // \\u0390 - GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS\n \"\\xce\\xb0\", // \\u03b0 - GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS\n ),\n array(//\"\\xcd\\xbe\", // \\u037e - GREEK QUESTION MARK\n //\"\\xce\\x87\", // \\u0387 - GREEK ANO TELEIA\n \"\\xe1\\xbd\\xb1\", // \\u1f71 - GREEK SMALL LETTER ALPHA WITH OXIA\n\t\t\t\t\t \"\\xe1\\xbd\\xb3\",\t// \\u1f73 - GREEK SMALL LETTER EPSILON WITH OXIA\n\t\t\t\t\t \"\\xe1\\xbd\\xb5\",\t// \\u1f75 - GREEK SMALL LETTER ETA WITH OXIA\n\t\t\t\t\t \"\\xe1\\xbd\\xb7\",\t// \\u1f77 - GREEK SMALL LETTER IOTA WITH OXIA\n\t\t\t\t\t \"\\xe1\\xbd\\xb9\",\t// \\u1f79 - GREEK SMALL LETTER OMICRON WITH OXIA\n\t\t\t\t\t \"\\xe1\\xbd\\xbb\",\t// \\u1f7b - GREEK SMALL LETTER UPSILON WITH OXIA\n\t\t\t\t\t \"\\xe1\\xbd\\xbd\",\t// \\u1f7d - GREEK SMALL LETTER OMEGA WITH OXIA\n\t\t\t\t\t \"\\xe1\\xbf\\x93\",\t// \\u1fd3 - GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA\n\t\t\t\t\t \"\\xe1\\xbf\\xa3\",\t// \\u1fe3 - GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA\n ),\n $s);\n }\n else\n return $s;\n }", "function maiusculasPalavras($string, $delimiters = array(\" \", \"-\", \".\", \"'\", \"O'\", \"Mc\"), $exceptions = array(\"de\", \"da\", \"dos\", \"das\", \"do\", \"I\", \"II\", \"III\", \"IV\", \"V\", \"VI\")) {\r\r\n $string = mb_convert_case($string, MB_CASE_TITLE, \"UTF-8\");\r\r\n foreach ($delimiters as $dlnr => $delimiter) {\r\r\n $words = explode($delimiter, $string);\r\r\n $newwords = array();\r\r\n foreach ($words as $wordnr => $word) {\r\r\n if (in_array(mb_strtoupper($word, \"UTF-8\"), $exceptions)) {\r\r\n // check exceptions list for any words that should be in upper case\r\r\n $word = mb_strtoupper($word, \"UTF-8\");\r\r\n } elseif (in_array(mb_strtolower($word, \"UTF-8\"), $exceptions)) {\r\r\n // check exceptions list for any words that should be in upper case\r\r\n $word = mb_strtolower($word, \"UTF-8\");\r\r\n } elseif (!in_array($word, $exceptions)) {\r\r\n // convert to uppercase (non-utf8 only)\r\r\n $word = ucfirst($word);\r\r\n }\r\r\n array_push($newwords, $word);\r\r\n }\r\r\n $string = join($delimiter, $newwords);\r\r\n }//foreach\r\r\n return $string;\r\r\n }", "function encode ($msg = \"\") {\r\n\t\t// Punctutation and numbers can be encoded or skipped (if in alphabet they are encoded)\r\n\t\t// Print in 3 rows, encode each column with the fractionated morse table above\r\n\t\t\r\n\t\t$s = \"\";\r\n\t\t$notwhitespace = FALSE;\r\n\t\tfor ($i = 0; $i < strlen($msg); $i++) {\r\n\t\t\tif (stripos($this->alphabet, $msg[$i]) !== FALSE) {\r\n\t\t\t\t$notwhitespace = TRUE;\r\n\t\t\t\t$s .= $this->morsecode[strtolower($msg[$i])];\r\n\t\t\t\t$s .= 'x';\r\n\t\t\t} else {\r\n\t\t\t\t// Treat non characters in the alphabet as word dividers but only once\r\n\t\t\t\tif (($msg[$i] == \" \") && ($notwhitespace)) { \r\n\t\t\t\t\t$s .= 'x';\r\n\t\t\t\t\t$notwhitespace = FALSE;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$s = substr($s, 0, -1);\r\n\t\t\r\n\t\t// Create pollux string\r\n\t\t$s2 = \"\";\r\n\t\tfor ($i = 0; $i < strlen($s); $i++)\r\n\t\t\t$s2 .= $this->codes[$s[$i]][rand(0, strlen($this->codes[$s[$i]])-1)];\r\n\t\treturn $s2;\r\n\t}", "function tukar_besar_kecil($string){\n\t$split = str_split($string);\n\t$new_string = \"\";\n\tfor ($i=0; $i < count($split); $i++) { \n\t\t$ascii = ord($split[$i]);\n\t\tif ($ascii >= 65 && $ascii <= 90) {\n\t\t\t$new_string .= strtolower(chr($ascii));\n\t\t} else {\n\t\t\t$new_string .= strtoupper(chr($ascii));\n\t\t}\n\t}\n\n\techo \"$new_string\";\n\techo \"<br>\";\n}", "public function voice(): string\n {\n return \"Мяу Мяу!!!\";\n }", "function enleverCaracteresSpeciaux($text) {\n $utf8 = array(\n '/[áàâãªä]/u' => 'a',\n '/[ÁÀÂÃÄ]/u' => 'A',\n '/[ÍÌÎÏ]/u' => 'I',\n '/[íìîï]/u' => 'i',\n '/[éèêë]/u' => 'e',\n '/[ÉÈÊË]/u' => 'E',\n '/[óòôõºö]/u' => 'o',\n '/[ÓÒÔÕÖ]/u' => 'O',\n '/[úùûü]/u' => 'u',\n '/[ÚÙÛÜ]/u' => 'U',\n '/ç/' => 'c',\n '/Ç/' => 'C',\n '/ñ/' => 'n',\n '/Ñ/' => 'N',\n\n );\n return preg_replace(array_keys($utf8), array_values($utf8), $text);\n }", "function conversion_minuscule($caractere){\n if($caractere>='a' && $caractere<='z'){\n return $caractere;\n }\n else {\n $alphabet =[\n 'A' => 'a', 'B' => 'b', 'C' => 'c', 'D' => 'd', 'E' => 'e', 'F' => 'f',\n 'G' => 'g', 'H' => 'h', 'I' => 'i', 'J' => 'j', 'K' => 'k', 'L' => 'l',\n 'M' => 'm', 'N' => 'n', 'O' => 'o', 'P' => 'p', 'Q' => 'q', 'R' => 'r',\n 'S' => 's', 'T' => 't', 'U' => 'u', 'V' => 'v', 'W' => 'w', 'X' => 'x',\n 'Y' => 'y', 'Z' => 'z'\n ];\n foreach ($alphabet as $key => $value) {\n if ($caractere==$alphabet[$key]) {\n $caractere=$value;\n }\n }\n return $caractere;\n }\n }", "static function ProcessHindiPhonetic($word)\n\t\t{\n\t\t\t$word=strtolower($word);\n\t\t\t$k=1;\n\t\t\t$word1=\"D\";\t\n\t\t\t$n=strlen($word);\n\t\t\t$word1[0]=$word[0];\n\t\t\tfor($i=1;$i<=($n-1);$i++)\n\t\t\t{\n\t\t\t\tif($word[$i]!='e' && $word[$i]!='o')\n\t\t\t\t{\n\t\t\t\t\tif($word[$i]==$word[$i-1]);\n\t\t\t\t\telse $word1[$k++]=$word[$i];\n\t\t\t\t}\n\t\t\t\telse $word1[$k++]=$word[$i];\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t/* Process the word */\n\t\t\t\n\t\t\t$word=$word1;\n\t\t\t$n=strlen($word);\n\t\t\t$result=\"S\";\n\t\t\t$k=0;\n\t\t\t//if($word[0]=='e') $word[0]='i';\n\t\t\tif($word==\"mein\" || $word==\"main\")\n\t\t\t{\n\t\t\t\t$result=\"me\";\n\t\t\t}\n\t\t\telse if($word==\"hain\" || $word==\"hai\")\n\t\t\t{\n\t\t\t\t$result=\"he\";\n\t\t\t}\n\t\t\telse if ($word==\"hun\" || $word==\"hoon\")\n\t\t\t{\n\t\t\t\t$result=\"hu\";\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\tfor($i=0;$i<(strlen($word)+1);$i++)\n\t\t\t{\n switch($word[$i])\n {\n case 'a' :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($i==0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//$result[$k++]='a';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($word[$i+1]=='e')\n {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//echo Hello;\n $result[$k++]='e';\n $i++;\n }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if($word[$i+1]=='i')\n {\n if($i+2==$n)\n {\n $result[$k++]='a';\n $result[$k++]='i';\n $i++;\n }\n else \n {\n $result[$k++]='e';\n $i++;\n }\n }\n else if($word[$i+1]=='y' && $i+2==$n)\n {\n $result[$k++]='a';\n $result[$k++]='i';\n $i++;\n }\n \n else if($word[$i+1]=='u')\n {\n $result[$k++]='o';\n $i++;\n }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if($i+1==$n)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='a';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $result[$k++]='a';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($word[$i+1]=='e')\n {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//echo Hello;\n $result[$k++]='e';\n $i++;\n }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if($word[$i+1]=='i')\n {\n if($i+2==$n)\n {\n $result[$k++]='a';\n $result[$k++]='i';\n $i++;\n }\n else \n {\n $result[$k++]='e';\n $i++;\n }\n }\n else if($word[$i+1]=='y' && $i+2==$n)\n {\n $result[$k++]='a';\n $result[$k++]='i';\n $i++;\n }\n \n else if($word[$i+1]=='u')\n {\n $result[$k++]='o';\n $i++;\n }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if($i+1==$n)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='a';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n break;\n \n case 'b' : $result[$k++]='b'; break;\n case 'c' : $result[$k++]='c'; break;\n case 'd' : $result[$k++]='d'; break;\n case 'e' : if($i==0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='i';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n else if($word[$i+1]=='e')\n {\n if($word[$i+2]=='y');\n else $result[$k++]='i';\n $i++;\n }\n else if($word[$i+1]=='i' && $word[$i+2]=='n')\n {\n $result[$k++]='e';\n $i=$i+2;\n }\n else if($word[$i+1]=='i')\n {\n $result[$k++]='i';\n $i++;\n }\n else $result[$k++]='e'; \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n break;\n \n case 'f' : $result[$k++]='f'; break;\n case 'g' : if($word[$i+1]=='h')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='g';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $result[$k++]='g'; break;\n case 'h' : \n \n if($i+1==$n && ($word[$i-1]=='a' || $word[$i-1]=='e' || $word[$i-1]=='g' || $word[$i-1]=='j' || $word[$i-1]=='u'));\n else $result[$k++]='h';\n break;\n \n case 'i' : if($word[$i+1]=='y') ;\n \n else $result[$k++]='i'; break;\n case 'j' : if($word[$i+1]=='h')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='j';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $result[$k++]='j'; break;\n case 'k' : $result[$k++]='k'; break;\n case 'l' : $result[$k++]= 'l'; break;\n case 'm' : $result[$k++]='m'; break;\n case 'n' : $result[$k++]='n'; break;\n case 'o' : \n if($word[$i+1]=='n' && $i==$n-2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='o';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n else if($word[$i+1]=='w' || $word[$i+1]=='v' || $word[$i+1]=='u')\n {\n \n $result[$k++]='o';\n $i++;\n }\n else if($word[$i+1]=='o')\n {\n if($word[$i-1]=='r' && ($word[$i-2]=='m' || $word[$i-2]=='n' || $word[$i-2]=='v' || $word[$i-2]=='b' || $word[$i-2]=='g' || $word[$i-2]=='k'))\n {\n $result[$k++]='i';\n }\n else $result[$k++]='u';\n $i++;\n } \n else $result[$k++]='o'; break;\n case 'p' : \n if ($word[$i+1]=='h')\n {\n $result[$k++]='f';\n $i++;\n }\n else $result[$k++]='p';\n break;\n \n case 'q' : $result[$k++]='k'; break;\n case 'r' : $result[$k++]='r'; break;\n case 's' : if($word[$i+1]=='h')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='s';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $result[$k++]='s'; break;\n case 't' : if($word[$i+1]=='h')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='t';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $result[$k++]='t'; break;\n case 'u' : \n if($word[$i-1]=='r' && ($word[$i-2]=='m' || $word[$i-2]=='n' || $word[$i-2]=='v' || $word[$i-2]=='b' || $word[$i-2]=='g' || $word[$i-2]=='k'))\n {\n $result[$k++]='i';\n }\n else $result[$k++]='u'; break; \n case 'v' : $result[$k++]='v'; break;\n case 'w' : $result[$k++]='v'; break;\n case 'x' : \n $result[$k++]='k';\n $result[$k++]='s';\n break;\n \n case 'y' : \n if($i==strlen($word)-1)\n $result[$k++]='i';\n else $result[$k++]='y';\n break;\n case 'z' : if($word[$i+1]=='h')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='g';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $result[$k++]='j'; break;\n case '1' : $result[$k++]='1'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '2' : $result[$k++]='2'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '3' : $result[$k++]='3'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '4' : $result[$k++]='4'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '5' : $result[$k++]='5'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '6' : $result[$k++]='6'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '7' : $result[$k++]='7'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '8' : $result[$k++]='8'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '9' : $result[$k++]='9'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '0' : $result[$k++]='0'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t default : ;\n }\n }\n\t\t\t}\n return $result;\n\t\t}", "protected function _code($txt,$way){\n switch($way){\n case 'UTF8-SQL_ASCII': return utf8_decode($txt);\n case 'UTF8-LATIN1': return utf8_decode($txt);\n case 'LATIN1-UTF8': return utf8_encode($txt);\n case 'LATIN1-SQL_ASCII': return $txt;\n case 'SQL_ASCII-UTF8': return utf8_encode($txt);\n case 'SQL_ASCII-LATIN1': return $txt;\n }\n return $txt;\n }", "function toAscii($str, $options = array(), $delimiter = ' ')\n{\n $str = mb_convert_encoding((string) $str, 'UTF-8', mb_list_encodings());\n\n $defaults = array(\n 'delimiter' => $delimiter,\n 'limit' => null,\n 'lowercase' => false,\n 'replacements' => array(),\n 'transliterate'=> false,\n );\n\n if (!isset($options) && $options == '') {\n $options = array();\n }\n // Merge options\n $options = array();\n $options = array_merge($defaults, $options);\n\n $char_map= array(\n // Latin\n 'À'=> 'A','Á'=> 'A','Â'=> 'A','Ã'=> 'A','Ä'=> 'A','Å'=> 'A','Æ'=> 'AE','Ç'=> 'C',\n 'È'=> 'E','É'=> 'E','Ê'=> 'E','Ë'=> 'E','Ì'=> 'I','Í'=> 'I','Î'=> 'I','Ï'=> 'I',\n 'Ð'=> 'D','Ñ'=> 'N','Ò'=> 'O','Ó'=> 'O','Ô'=> 'O','Õ'=> 'O','Ö'=> 'O','Ő'=> 'O',\n 'Ø'=> 'O','Ù'=> 'U','Ú'=> 'U','Û'=> 'U','Ü'=> 'U','Ű'=> 'U','Ý'=> 'Y','Þ'=> 'TH',\n 'ß'=> 'ss',\n 'à'=> 'a','á'=> 'a','â'=> 'a','ã'=> 'a','ä'=> 'a','å'=> 'a','æ'=> 'ae','ç'=> 'c',\n 'è'=> 'e','é'=> 'e','ê'=> 'e','ë'=> 'e','ì'=> 'i','í'=> 'i','î'=> 'i','ï'=> 'i',\n 'ð'=> 'd','ñ'=> 'n','ò'=> 'o','ó'=> 'o','ô'=> 'o','õ'=> 'o','ö'=> 'o','ő'=> 'o',\n 'ø'=> 'o','ù'=> 'u','ú'=> 'u','û'=> 'u','ü'=> 'u','ű'=> 'u','ý'=> 'y','þ'=> 'th',\n 'ÿ'=> 'y',\n // Latin symbols\n '©'=> '(c)',\n // Greek\n 'Α'=> 'A','Β'=> 'B','Γ'=> 'G','Δ'=> 'D','Ε'=> 'E','Ζ'=> 'Z','Η'=> 'H','Θ'=> '8',\n 'Ι'=> 'I','Κ'=> 'K','Λ'=> 'L','Μ'=> 'M','Ν'=> 'N','Ξ'=> '3','Ο'=> 'O','Π'=> 'P',\n 'Ρ'=> 'R','Σ'=> 'S','Τ'=> 'T','Υ'=> 'Y','Φ'=> 'F','Χ'=> 'X','Ψ'=> 'PS','Ω'=> 'W',\n 'Ά'=> 'A','Έ'=> 'E','Ί'=> 'I','Ό'=> 'O','Ύ'=> 'Y','Ή'=> 'H','Ώ'=> 'W','Ϊ'=> 'I',\n 'Ϋ'=> 'Y',\n 'α'=> 'a','β'=> 'b','γ'=> 'g','δ'=> 'd','ε'=> 'e','ζ'=> 'z','η'=> 'h','θ'=> '8',\n 'ι'=> 'i','κ'=> 'k','λ'=> 'l','μ'=> 'm','ν'=> 'n','ξ'=> '3','ο'=> 'o','π'=> 'p',\n 'ρ'=> 'r','σ'=> 's','τ'=> 't','υ'=> 'y','φ'=> 'f','χ'=> 'x','ψ'=> 'ps','ω'=> 'w',\n 'ά'=> 'a','έ'=> 'e','ί'=> 'i','ό'=> 'o','ύ'=> 'y','ή'=> 'h','ώ'=> 'w','ς'=> 's',\n 'ϊ'=> 'i','ΰ'=> 'y','ϋ'=> 'y','ΐ'=> 'i',\n // Turkish\n 'Ş'=> 'S','İ'=> 'I','Ç'=> 'C','Ü'=> 'U','Ö'=> 'O','Ğ'=> 'G',\n 'ş'=> 's','ı'=> 'i','ç'=> 'c','ü'=> 'u','ö'=> 'o','ğ'=> 'g',\n // Russian\n 'А'=> 'A','Б'=> 'B','В'=> 'V','Г'=> 'G','Д'=> 'D','Е'=> 'E','Ё'=> 'Yo','Ж'=> 'Zh',\n 'З'=> 'Z','И'=> 'I','Й'=> 'J','К'=> 'K','Л'=> 'L','М'=> 'M','Н'=> 'N','О'=> 'O',\n 'П'=> 'P','Р'=> 'R','С'=> 'S','Т'=> 'T','У'=> 'U','Ф'=> 'F','Х'=> 'H','Ц'=> 'C',\n 'Ч'=> 'Ch','Ш'=> 'Sh','Щ'=> 'Sh','Ъ'=> '','Ы'=> 'Y','Ь'=> '','Э'=> 'E','Ю'=> 'Yu',\n 'Я'=> 'Ya',\n 'а'=> 'a','б'=> 'b','в'=> 'v','г'=> 'g','д'=> 'd','е'=> 'e','ё'=> 'yo','ж'=> 'zh',\n 'з'=> 'z','и'=> 'i','й'=> 'j','к'=> 'k','л'=> 'l','м'=> 'm','н'=> 'n','о'=> 'o',\n 'п'=> 'p','р'=> 'r','с'=> 's','т'=> 't','у'=> 'u','ф'=> 'f','х'=> 'h','ц'=> 'c',\n 'ч'=> 'ch','ш'=> 'sh','щ'=> 'sh','ъ'=> '','ы'=> 'y','ь'=> '','э'=> 'e','ю'=> 'yu',\n 'я'=> 'ya',\n // Ukrainian\n 'Є'=> 'Ye','І'=> 'I','Ї'=> 'Yi','Ґ'=> 'G',\n 'є'=> 'ye','і'=> 'i','ї'=> 'yi','ґ'=> 'g',\n // Czech\n 'Č'=> 'C','Ď'=> 'D','Ě'=> 'E','Ň'=> 'N','Ř'=> 'R','Š'=> 'S','Ť'=> 'T','Ů'=> 'U',\n 'Ž'=> 'Z',\n 'č'=> 'c','ď'=> 'd','ě'=> 'e','ň'=> 'n','ř'=> 'r','š'=> 's','ť'=> 't','ů'=> 'u',\n 'ž'=> 'z',\n // Polish\n 'Ą'=> 'A','Ć'=> 'C','Ę'=> 'e','Ł'=> 'L','Ń'=> 'N','Ó'=> 'o','Ś'=> 'S','Ź'=> 'Z',\n 'Ż'=> 'Z',\n 'ą'=> 'a','ć'=> 'c','ę'=> 'e','ł'=> 'l','ń'=> 'n','ó'=> 'o','ś'=> 's','ź'=> 'z',\n 'ż'=> 'z',\n // Latvian\n 'Ā'=> 'A','Č'=> 'C','Ē'=> 'E','Ģ'=> 'G','Ī'=> 'i','Ķ'=> 'k','Ļ'=> 'L','Ņ'=> 'N',\n 'Š'=> 'S','Ū'=> 'u','Ž'=> 'Z',\n 'ā'=> 'a','č'=> 'c','ē'=> 'e','ģ'=> 'g','ī'=> 'i','ķ'=> 'k','ļ'=> 'l','ņ'=> 'n',\n 'š'=> 's','ū'=> 'u','ž'=> 'z',\n );\n\n // Make custom replacements\n $str = preg_replace(array_keys($options['replacements']), $options['replacements'], $str);\n\n // Transliterate characters to ASCII\n if ($options['transliterate']) {\n $str = str_replace(array_keys($char_map), $char_map, $str);\n }\n\n // Replace non - alphanumeric characters with our delimiter\n $str = preg_replace('/[^\\p{L}\\p{Nd}]+/u', $options['delimiter'], $str);\n\n // Remove duplicate delimiters\n $str = preg_replace('/(' . preg_quote($options['delimiter'], '/') . '){2,}/', '$1', $str);\n\n // Truncate slug to max. characters\n $str = mb_substr($str, 0, ($options['limit'] ? $options['limit'] : mb_strlen($str, 'UTF-8')), 'UTF-8');\n\n // Remove delimiter from ends\n $str = trim($str, $options['delimiter']);\n\n return $options['lowercase'] ? $str : $str;\n}", "function slugify($str, $options = array())\n{\n $str = mb_convert_encoding((string)$str, 'UTF-8', mb_list_encodings());\n\n $defaults = array(\n 'delimiter' => '-',\n 'limit' => null,\n 'lowercase' => true,\n 'replacements' => array(),\n 'transliterate' => true,\n );\n\n // Merge options\n $options = array_merge($defaults, $options);\n\n $char_map = array(\n // Latin\n 'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'A', 'Å' => 'A', 'Æ' => 'AE', 'Ç' => 'C',\n 'È' => 'E', 'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'Ì' => 'I', 'Í' => 'I', 'Î' => 'I', 'Ï' => 'I',\n 'Ð' => 'D', 'Ñ' => 'N', 'Ò' => 'O', 'Ó' => 'O', 'Ô' => 'O', 'Õ' => 'O', 'Ö' => 'O', 'Ő' => 'O',\n 'Ø' => 'O', 'Ù' => 'U', 'Ú' => 'U', 'Û' => 'U', 'Ü' => 'U', 'Ű' => 'U', 'Ý' => 'Y', 'Þ' => 'TH',\n 'ß' => 'ss',\n 'à' => 'a', 'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ä' => 'a', 'å' => 'a', 'æ' => 'ae', 'ç' => 'c',\n 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e', 'ì' => 'i', 'í' => 'i', 'î' => 'i', 'ï' => 'i',\n 'ð' => 'd', 'ñ' => 'n', 'ò' => 'o', 'ó' => 'o', 'ô' => 'o', 'õ' => 'o', 'ö' => 'o', 'ő' => 'o',\n 'ø' => 'o', 'ù' => 'u', 'ú' => 'u', 'û' => 'u', 'ü' => 'u', 'ű' => 'u', 'ý' => 'y', 'þ' => 'th',\n 'ÿ' => 'y',\n\n // Latin symbols\n '©' => '(c)',\n\n // Greek\n 'Α' => 'A', 'Β' => 'B', 'Γ' => 'G', 'Δ' => 'D', 'Ε' => 'E', 'Ζ' => 'Z', 'Η' => 'H', 'Θ' => '8',\n 'Ι' => 'I', 'Κ' => 'K', 'Λ' => 'L', 'Μ' => 'M', 'Ν' => 'N', 'Ξ' => '3', 'Ο' => 'O', 'Π' => 'P',\n 'Ρ' => 'R', 'Σ' => 'S', 'Τ' => 'T', 'Υ' => 'Y', 'Φ' => 'F', 'Χ' => 'X', 'Ψ' => 'PS', 'Ω' => 'W',\n 'Ά' => 'A', 'Έ' => 'E', 'Ί' => 'I', 'Ό' => 'O', 'Ύ' => 'Y', 'Ή' => 'H', 'Ώ' => 'W', 'Ϊ' => 'I',\n 'Ϋ' => 'Y',\n 'α' => 'a', 'β' => 'b', 'γ' => 'g', 'δ' => 'd', 'ε' => 'e', 'ζ' => 'z', 'η' => 'h', 'θ' => '8',\n 'ι' => 'i', 'κ' => 'k', 'λ' => 'l', 'μ' => 'm', 'ν' => 'n', 'ξ' => '3', 'ο' => 'o', 'π' => 'p',\n 'ρ' => 'r', 'σ' => 's', 'τ' => 't', 'υ' => 'y', 'φ' => 'f', 'χ' => 'x', 'ψ' => 'ps', 'ω' => 'w',\n 'ά' => 'a', 'έ' => 'e', 'ί' => 'i', 'ό' => 'o', 'ύ' => 'y', 'ή' => 'h', 'ώ' => 'w', 'ς' => 's',\n 'ϊ' => 'i', 'ΰ' => 'y', 'ϋ' => 'y', 'ΐ' => 'i',\n\n // Turkish\n 'Ş' => 'S', 'İ' => 'I', 'Ç' => 'C', 'Ü' => 'U', 'Ö' => 'O', 'Ğ' => 'G',\n 'ş' => 's', 'ı' => 'i', 'ç' => 'c', 'ü' => 'u', 'ö' => 'o', 'ğ' => 'g',\n\n // Russian\n 'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Д' => 'D', 'Е' => 'E', 'Ё' => 'Yo', 'Ж' => 'Zh',\n 'З' => 'Z', 'И' => 'I', 'Й' => 'J', 'К' => 'K', 'Л' => 'L', 'М' => 'M', 'Н' => 'N', 'О' => 'O',\n 'П' => 'P', 'Р' => 'R', 'С' => 'S', 'Т' => 'T', 'У' => 'U', 'Ф' => 'F', 'Х' => 'H', 'Ц' => 'C',\n 'Ч' => 'Ch', 'Ш' => 'Sh', 'Щ' => 'Sh', 'Ъ' => '', 'Ы' => 'Y', 'Ь' => '', 'Э' => 'E', 'Ю' => 'Yu',\n 'Я' => 'Ya',\n 'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', 'е' => 'e', 'ё' => 'yo', 'ж' => 'zh',\n 'з' => 'z', 'и' => 'i', 'й' => 'j', 'к' => 'k', 'л' => 'l', 'м' => 'm', 'н' => 'n', 'о' => 'o',\n 'п' => 'p', 'р' => 'r', 'с' => 's', 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ц' => 'c',\n 'ч' => 'ch', 'ш' => 'sh', 'щ' => 'sh', 'ъ' => '', 'ы' => 'y', 'ь' => '', 'э' => 'e', 'ю' => 'yu',\n 'я' => 'ya',\n\n // Ukrainian\n 'Є' => 'Ye', 'І' => 'I', 'Ї' => 'Yi', 'Ґ' => 'G',\n 'є' => 'ye', 'і' => 'i', 'ї' => 'yi', 'ґ' => 'g',\n\n // Czech\n 'Č' => 'C', 'Ď' => 'D', 'Ě' => 'E', 'Ň' => 'N', 'Ř' => 'R', 'Š' => 'S', 'Ť' => 'T', 'Ů' => 'U',\n 'Ž' => 'Z',\n 'č' => 'c', 'ď' => 'd', 'ě' => 'e', 'ň' => 'n', 'ř' => 'r', 'š' => 's', 'ť' => 't', 'ů' => 'u',\n 'ž' => 'z',\n\n // Polish\n 'Ą' => 'A', 'Ć' => 'C', 'Ę' => 'e', 'Ł' => 'L', 'Ń' => 'N', 'Ó' => 'o', 'Ś' => 'S', 'Ź' => 'Z',\n 'Ż' => 'Z',\n 'ą' => 'a', 'ć' => 'c', 'ę' => 'e', 'ł' => 'l', 'ń' => 'n', 'ó' => 'o', 'ś' => 's', 'ź' => 'z',\n 'ż' => 'z',\n\n // Latvian\n 'Ā' => 'A', 'Č' => 'C', 'Ē' => 'E', 'Ģ' => 'G', 'Ī' => 'i', 'Ķ' => 'k', 'Ļ' => 'L', 'Ņ' => 'N',\n 'Š' => 'S', 'Ū' => 'u', 'Ž' => 'Z',\n 'ā' => 'a', 'č' => 'c', 'ē' => 'e', 'ģ' => 'g', 'ī' => 'i', 'ķ' => 'k', 'ļ' => 'l', 'ņ' => 'n',\n 'š' => 's', 'ū' => 'u', 'ž' => 'z'\n );\n\n // Make custom replacements\n $str = preg_replace(array_keys($options['replacements']), $options['replacements'], $str);\n\n // Transliterate characters to ASCII\n if ($options['transliterate']) {\n $str = str_replace(array_keys($char_map), $char_map, $str);\n }\n\n // Replace non-alphanumeric characters with our delimiter\n $str = preg_replace('/[^\\p{L}\\p{Nd}]+/u', $options['delimiter'], $str);\n\n // Remove duplicate delimiters\n $str = preg_replace('/(' . preg_quote($options['delimiter'], '/') . '){2,}/', '$1', $str);\n\n // Truncate slug to max. characters\n $str = mb_substr($str, 0, ($options['limit'] ? $options['limit'] : mb_strlen($str, 'UTF-8')), 'UTF-8');\n\n // Remove delimiter from ends\n $str = trim($str, $options['delimiter']);\n\n return $options['lowercase'] ? mb_strtolower($str, 'UTF-8') : $str;\n}", "public static function codau2khongdau($string = '', $alphabetOnly = false, $tolower = true)\r\n\t{\r\n\t\t\r\n\t\t$output = $string;\r\n\t\tif($output != '')\r\n\t\t{\r\n\t\t\t//Tien hanh xu ly bo dau o day\r\n\t\t\t$search = array('&#225;', '&#224;', '&#7843;', '&#227;', '&#7841;', \t\t\t\t// a' a` a? a~ a.\r\n\t\t\t\t\t\t\t'&#259;', '&#7855;', '&#7857;', '&#7859;', '&#7861;', '&#7863;',\t// a( a('\r\n\t\t\t\t\t\t\t'&#226;', '&#7845;', '&#7847;', '&#7849;', '&#7851;', '&#7853;', \t// a^ a^'..\r\n\t\t\t\t\t\t\t'&#273;',\t\t\t\t\t\t\t\t\t\t\t \t\t\t// d-\r\n\t\t\t\t\t\t\t'&#233;', '&#232;', '&#7867;', '&#7869;', '&#7865;',\t\t\t\t// e' e`..\r\n\t\t\t\t\t\t\t'&#234;', '&#7871;', '&#7873;', '&#7875;', '&#7877;', '&#7879;',\t// e^ e^'\r\n\t\t\t\t\t\t\t'&#237;', '&#236;', '&#7881;', '&#297;', '&#7883;',\t\t\t\t\t// i' i`..\r\n\t\t\t\t\t\t\t'&#243;', '&#242;', '&#7887;', '&#245;', '&#7885;',\t\t\t\t\t// o' o`..\r\n\t\t\t\t\t\t\t'&#244;', '&#7889;', '&#7891;', '&#7893;', '&#7895;', '&#7897;',\t// o^ o^'..\r\n\t\t\t\t\t\t\t'&#417;', '&#7899;', '&#7901;', '&#7903;', '&#7905;', '&#7907;',\t// o* o*'..\r\n\t\t\t\t\t\t\t'&#250;', '&#249;', '&#7911;', '&#361;', '&#7909;',\t\t\t\t\t// u'..\r\n\t\t\t\t\t\t\t'&#432;', '&#7913;', '&#7915;', '&#7917;', '&#7919;', '&#7921;',\t// u* u*'..\r\n\t\t\t\t\t\t\t'&#253;', '&#7923;', '&#7927;', '&#7929;', '&#7925;',\t\t\t\t// y' y`..\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t'&#193;', '&#192;', '&#7842;', '&#195;', '&#7840;',\t\t\t\t\t// A' A` A? A~ A.\r\n\t\t\t\t\t\t\t'&#258;', '&#7854;', '&#7856;', '&#7858;', '&#7860;', '&#7862;',\t// A( A('..\r\n\t\t\t\t\t\t\t'&#194;', '&#7844;', '&#7846;', '&#7848;', '&#7850;', '&#7852;',\t// A^ A^'..\r\n\t\t\t\t\t\t\t'&#272;',\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// D-\r\n\t\t\t\t\t\t\t'&#201;', '&#200;', '&#7866;', '&#7868;', '&#7864;',\t\t\t\t// E' E`..\r\n\t\t\t\t\t\t\t'&#202;', '&#7870;', '&#7872;', '&#7874;', '&#7876;', '&#7878;',\t// E^ E^'..\r\n\t\t\t\t\t\t\t'&#205;', '&#204;', '&#7880;', '&#296;', '&#7882;',\t\t\t\t\t// I' I`..\r\n\t\t\t\t\t\t\t'&#211;', '&#210;', '&#7886;', '&#213;', '&#7884;',\t\t\t\t\t// O' O`..\r\n\t\t\t\t\t\t\t'&#212;', '&#7888;', '&#7890;', '&#7892;', '&#7894;', '&#7896;',\t// O^ O^'..\r\n\t\t\t\t\t\t\t'&#416;', '&#7898;', '&#7900;', '&#7902;', '&#7904;', '&#7906;',\t// O* O*'..\r\n\t\t\t\t\t\t\t'&#218;', '&#217;', '&#7910;', '&#360;', '&#7908;',\t\t\t\t\t// U' U`..\r\n\t\t\t\t\t\t\t'&#431;', '&#7912;', '&#7914;', '&#7916;', '&#7918;', '&#7920;',\t// U* U*'..\r\n\t\t\t\t\t\t\t'&#221;', '&#7922;', '&#7926;', '&#7928;', '&#7924;'\t\t\t\t// Y' Y`..\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\r\n\t\t\t$search2 = array('á', 'à', 'ả', 'ã', 'ạ', \t\t\t\t// a' a` a? a~ a.\r\n\t\t\t\t\t\t\t'ă', 'ắ', 'ằ', 'ẳ', 'ẵ', 'ặ',\t// a( a('\r\n\t\t\t\t\t\t\t'â', 'ấ', 'ầ', 'ẩ', 'ẫ', 'ậ', \t// a^ a^'..\r\n\t\t\t\t\t\t\t'đ',\t\t\t\t\t\t\t\t\t\t\t \t\t\t// d-\r\n\t\t\t\t\t\t\t'é', 'è', 'ẻ', 'ẽ', 'ẹ',\t\t\t\t// e' e`..\r\n\t\t\t\t\t\t\t'ê', 'ế', 'ề', 'ể', 'ễ', 'ệ',\t// e^ e^'\r\n\t\t\t\t\t\t\t'í', 'ì', 'ỉ', 'ĩ', 'ị',\t\t\t\t\t// i' i`..\r\n\t\t\t\t\t\t\t'ó', 'ò', 'ỏ', 'õ', 'ọ',\t\t\t\t\t// o' o`..\r\n\t\t\t\t\t\t\t'ô', 'ố', 'ồ', 'ổ', 'ỗ', 'ộ',\t// o^ o^'..\r\n\t\t\t\t\t\t\t'ơ', 'ớ', 'ờ', 'ở', 'ỡ', 'ợ',\t// o* o*'..\r\n\t\t\t\t\t\t\t'ú', 'ù', 'ủ', 'ũ', 'ụ',\t\t\t\t\t// u'..\r\n\t\t\t\t\t\t\t'ư', 'ứ', 'ừ', 'ử', 'ữ', 'ự',\t// u* u*'..\r\n\t\t\t\t\t\t\t'ý', 'ỳ', 'ỷ', 'ỹ', 'ỵ',\t\t\t\t// y' y`..\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t'Á', 'À', 'Ả', 'Ã', 'Ạ',\t\t\t\t\t// A' A` A? A~ A.\r\n\t\t\t\t\t\t\t'Ă', 'Ắ', 'Ằ', 'Ẳ', 'Ẵ', 'Ặ',\t// A( A('..\r\n\t\t\t\t\t\t\t'Â', 'Ấ', 'Ầ', 'Ẩ', 'Ẫ', 'Ậ',\t// A^ A^'..\r\n\t\t\t\t\t\t\t'Đ',\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// D-\r\n\t\t\t\t\t\t\t'É', 'È', 'Ẻ', 'Ẽ', 'Ẹ',\t\t\t\t// E' E`..\r\n\t\t\t\t\t\t\t'Ê', 'Ế', 'Ề', 'Ể', 'Ễ', 'Ệ',\t// E^ E^'..\r\n\t\t\t\t\t\t\t'Í', 'Ì', 'Ỉ', 'Ĩ', 'Ị',\t\t\t\t\t// I' I`..\r\n\t\t\t\t\t\t\t'Ó', 'Ò', 'Ỏ', 'Õ', 'Ọ',\t\t\t\t\t// O' O`..\r\n\t\t\t\t\t\t\t'Ô', 'Ố', 'Ồ', 'Ổ', 'Ỗ', 'Ộ',\t// O^ O^'..\r\n\t\t\t\t\t\t\t'Ơ', 'Ớ', 'Ờ', 'Ở', 'Ỡ', 'Ợ',\t// O* O*'..\r\n\t\t\t\t\t\t\t'Ú', 'Ù', 'Ủ', 'Ũ', 'Ụ',\t\t\t\t\t// U' U`..\r\n\t\t\t\t\t\t\t'Ư', 'Ứ', 'Ừ', 'Ử', 'Ữ', 'Ự',\t// U* U*'..\r\n\t\t\t\t\t\t\t'Ý', 'Ỳ', 'Ỷ', 'Ỹ', 'Ỵ'\t\t\t\t// Y' Y`..\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\r\n\t\t\t$replace = array('a', 'a', 'a', 'a', 'a',\r\n\t\t\t\t\t\t\t 'a', 'a', 'a', 'a', 'a', 'a',\r\n\t\t\t\t\t\t\t 'a', 'a', 'a', 'a', 'a', 'a',\r\n\t\t\t\t\t\t\t 'd',\r\n\t\t\t\t\t\t\t 'e', 'e', 'e', 'e', 'e',\r\n\t\t\t\t\t\t\t 'e', 'e', 'e', 'e', 'e', 'e',\r\n\t\t\t\t\t\t\t 'i', 'i', 'i', 'i', 'i',\r\n\t\t\t\t\t\t\t 'o', 'o', 'o', 'o', 'o',\r\n\t\t\t\t\t\t\t 'o', 'o', 'o', 'o', 'o', 'o',\r\n\t\t\t\t\t\t\t 'o', 'o', 'o', 'o', 'o', 'o',\r\n\t\t\t\t\t\t\t 'u', 'u', 'u', 'u', 'u',\r\n\t\t\t\t\t\t\t 'u', 'u', 'u', 'u', 'u', 'u',\r\n\t\t\t\t\t\t\t 'y', 'y', 'y', 'y', 'y',\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t 'A', 'A', 'A', 'A', 'A',\r\n\t\t\t\t\t\t\t 'A', 'A', 'A', 'A', 'A', 'A',\r\n\t\t\t\t\t\t\t 'A', 'A', 'A', 'A', 'A', 'A',\r\n\t\t\t\t\t\t\t 'D',\r\n\t\t\t\t\t\t\t 'E', 'E', 'E', 'E', 'E', \r\n\t\t\t\t\t\t\t 'E', 'E', 'E', 'E', 'E', 'E',\r\n\t\t\t\t\t\t\t 'I', 'I', 'I', 'I', 'I',\r\n\t\t\t\t\t\t\t 'O', 'O', 'O', 'O', 'O', \r\n\t\t\t\t\t\t\t 'O', 'O', 'O', 'O', 'O', 'O',\r\n\t\t\t\t\t\t\t 'O', 'O', 'O', 'O', 'O', 'O',\r\n\t\t\t\t\t\t\t 'U', 'U', 'U', 'U', 'U', \r\n\t\t\t\t\t\t\t 'U', 'U', 'U', 'U', 'U', 'U',\r\n\t\t\t\t\t\t\t 'Y', 'Y', 'Y', 'Y', 'Y'\r\n\t\t\t\t\t\t\t);\r\n\t\t\t//print_r($search);\r\n\t\t\t$output = str_replace($search, $replace, $output);\r\n\t\t\t$output = str_replace($search2, $replace, $output);\r\n\t\t\t\r\n\t\t\tif($alphabetOnly)\r\n\t\t\t{\r\n\t\t\t\t$output = self::alphabetonly($output);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($tolower)\r\n\t\t\t{\r\n\t\t\t\t$output = strtolower($output);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $output;\r\n\t}", "function etranslate($m){\n\t return translate($m,TRUE);\n\t}", "function capitalizar($nombre) {\n // aunque lo puedes definir afuera y declararlo global aca \n $articulos = array(\n '0' => 'a',\n '1' => 'de',\n '2' => 'del',\n '3' => 'la',\n '4' => 'los',\n '5' => 'las',\n '6' => 'con',\n '7' => 'en',\n );\n\n // explotamos el nombre \n $palabras = explode(' ', $nombre);\n\n // creamos la variable que contendra el nombre \n // formateado \n $nuevoNombre = '';\n\n // parseamos cada palabra \n foreach ($palabras as $elemento) {\n // si la palabra es un articulo \n if (in_array(trim(strtolower($elemento)), $articulos)) {\n // concatenamos seguido de un espacio \n $nuevoNombre .= strtolower($elemento) . \" \";\n } else {\n // sino, es un nombre propio, por lo tanto aplicamos \n // las funciones y concatenamos seguido de un espacio \n $nuevoNombre .= ucfirst(strtolower($elemento)) . \" \";\n }\n }\n\n return trim($nuevoNombre);\n}", "function capitalizar2($nombre) {\n // aunque lo puedes definir afuera y declararlo global aca \n $articulos = array(\n '0' => 'a',\n '1' => 'de',\n '2' => 'del',\n '3' => 'la',\n '4' => 'los',\n '5' => 'las',\n '6' => 'con',\n '7' => 'en',\n '8' => 'desde',\n '9' => 'una',\n '10' => 'y',\n );\n\n // explotamos el nombre \n $palabras = explode(' ', $nombre);\n\n // creamos la variable que contendra el nombre \n // formateado \n $nuevoNombre = '';\n\n // parseamos cada palabra \n foreach ($palabras as $elemento) {\n // si la palabra es un articulo \n if (in_array(trim(($elemento)), $articulos)) {\n // concatenamos seguido de un espacio \n $nuevoNombre .= $elemento . \" \";\n } else {\n // sino, es un nombre propio, por lo tanto aplicamos \n // las funciones y concatenamos seguido de un espacio \n $nuevoNombre .= ucfirst($elemento) . \" \";\n }\n }\n\n return trim($nuevoNombre);\n}", "function ekezet_nelkuli($fajlnev) {\n\n $specialis_karekterek = array('Š'=>'S', 'š'=>'s', 'Ð'=>'Dj','Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ő'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ű'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'ss','à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ő'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ü'=>'u', 'ű'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y', 'ƒ'=>'f');\n $fajlnev = strtolower(strtr($fajlnev, $specialis_karekterek));\n $fajlnev = preg_replace(\"/[^a-z0-9-_\\.]/i\", '_', trim($fajlnev));\n if (strlen($fajlnev) == 0 || $fajlnev == '.' || $fajlnev == '..') {\n \t$fajlnev = 'ervenytelen_nev';\n }\n return $fajlnev;\n}", "function charConv($string, $in, $out) {\r\n\t$str = NULL;\r\n\t// make them both lowercase\r\n\t$in = strtolower($in);\r\n\t$out = strtolower($out);\r\n\t// sanity checking\r\n\tif (!$in || !$out) return $string;\r\n\tif ($in == $out) return $string;\r\n\t// return string if we don't have this function\r\n\tif (!function_exists(\"iconv\")) return $string;\r\n\t// this tells php to ignore characters it doesn't know\r\n\t$out .= \"//IGNORE\";\r\n\treturn iconv($in, $out, $string);\r\n}", "function kababcase($string)\n{\n $sentence = strtolower(preg_replace('/([a-z0-9])([A-Z])/', '$1 $2', $string));\n return preg_replace('/[\\W\\_]+/', '-', $sentence);\n}", "function hebrevc ($hebrew_text, $max_chars_per_line = 0) {}", "function rus2translit($string) {\n $converter = array(\n 'а' => 'a', 'б' => 'b', 'в' => 'v',\n 'г' => 'g', 'д' => 'd', 'е' => 'e',\n 'ё' => 'e', 'ж' => 'zh', 'з' => 'z',\n 'и' => 'i', 'й' => 'y', 'к' => 'k',\n 'л' => 'l', 'м' => 'm', 'н' => 'n',\n 'о' => 'o', 'п' => 'p', 'р' => 'r',\n 'с' => 'c', 'т' => 't', 'у' => 'u',\n 'ф' => 'f', 'х' => 'h', 'ц' => 'c',\n 'ч' => 'ch', 'ш' => 'sh', 'щ' => 'sch',\n 'ь' => '\\'', 'ы' => 'y', 'ъ' => '\\'',\n 'э' => 'e', 'ю' => 'yu', 'я' => 'ya',\n\n 'А' => 'A', 'Б' => 'B', 'В' => 'V',\n 'Г' => 'G', 'Д' => 'D', 'Е' => 'E',\n 'Ё' => 'E', 'Ж' => 'Zh', 'З' => 'Z',\n 'И' => 'I', 'Й' => 'Y', 'К' => 'K',\n 'Л' => 'L', 'М' => 'M', 'Н' => 'N',\n 'О' => 'O', 'П' => 'P', 'Р' => 'R',\n 'С' => 'C', 'Т' => 'T', 'У' => 'U',\n 'Ф' => 'F', 'Х' => 'H', 'Ц' => 'C',\n 'Ч' => 'Ch', 'Ш' => 'Sh', 'Щ' => 'Sch',\n 'Ь' => '_', 'Ы' => 'Y', 'Ъ' => '_',\n 'Э' => 'E', 'Ю' => 'Yu', 'Я' => 'Ya',\n );\n return strtr($string, $converter);\n}", "function frase_mayus($frases, $conversion=true){\n $frases=strtolower($frases);\n if ($conversion==true){\n $resul=ucwords($frases); // capatiliza el texto\n }else{\n $resul=strtoupper($frases);\n }\n return $resul;\n }", "function wpseo_strtolower_utf8($string){ \r\n\t$convert_to = array( \r\n\t \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \r\n\t \"v\", \"w\", \"x\", \"y\", \"z\", \"à\", \"á\", \"â\", \"ã\", \"ä\", \"å\", \"æ\", \"ç\", \"è\", \"é\", \"ê\", \"ë\", \"ì\", \"í\", \"î\", \"ï\", \r\n\t \"ð\", \"ñ\", \"ò\", \"ó\", \"ô\", \"õ\", \"ö\", \"ø\", \"ù\", \"ú\", \"û\", \"ü\", \"ý\", \"а\", \"б\", \"в\", \"г\", \"д\", \"е\", \"ё\", \"ж\", \r\n\t \"з\", \"и\", \"й\", \"к\", \"л\", \"м\", \"н\", \"о\", \"п\", \"р\", \"с\", \"т\", \"у\", \"ф\", \"х\", \"ц\", \"ч\", \"ш\", \"щ\", \"ъ\", \"ы\", \r\n\t \"ь\", \"э\", \"ю\", \"я\", \"ą\", \"ć\", \"ę\", \"ł\", \"ń\", \"ó\", \"ś\", \"ź\", \"ż\" \r\n\t); \r\n\t$convert_from = array( \r\n\t \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \r\n\t \"V\", \"W\", \"X\", \"Y\", \"Z\", \"À\", \"Á\", \"Â\", \"Ã\", \"Ä\", \"Å\", \"Æ\", \"Ç\", \"È\", \"É\", \"Ê\", \"Ë\", \"Ì\", \"Í\", \"Î\", \"Ï\", \r\n\t \"Ð\", \"Ñ\", \"Ò\", \"Ó\", \"Ô\", \"Õ\", \"Ö\", \"Ø\", \"Ù\", \"Ú\", \"Û\", \"Ü\", \"Ý\", \"А\", \"Б\", \"В\", \"Г\", \"Д\", \"Е\", \"Ё\", \"Ж\", \r\n\t \"З\", \"И\", \"Й\", \"К\", \"Л\", \"М\", \"Н\", \"О\", \"П\", \"Р\", \"С\", \"Т\", \"У\", \"Ф\", \"Х\", \"Ц\", \"Ч\", \"Ш\", \"Щ\", \"Ъ\", \"Ъ\", \r\n\t \"Ь\", \"Э\", \"Ю\", \"Я\", \"Ą\", \"Ć\", \"Ę\", \"Ł\", \"Ń\", \"Ó\", \"Ś\", \"Ź\", \"Ż\"\r\n\t); \r\n\r\n\treturn str_replace($convert_from, $convert_to, $string);\r\n}", "function strtolower_utf8($string){\n $convert_to = array(\n \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\",\n \"v\", \"w\", \"x\", \"y\", \"z\", \"à\", \"á\", \"â\", \"ã\", \"ä\", \"å\", \"æ\", \"ç\", \"è\", \"é\", \"ê\", \"ë\", \"ì\", \"í\", \"î\", \"ï\",\n \"ð\", \"ñ\", \"ò\", \"ó\", \"ô\", \"õ\", \"ö\", \"ø\", \"ù\", \"ú\", \"û\", \"ü\", \"ý\", \"а\", \"б\", \"в\", \"г\", \"д\", \"е\", \"ё\", \"ж\",\n \"з\", \"и\", \"й\", \"к\", \"л\", \"м\", \"н\", \"о\", \"п\", \"р\", \"с\", \"т\", \"у\", \"ф\", \"х\", \"ц\", \"ч\", \"ш\", \"щ\", \"ъ\", \"ы\",\n \"ь\", \"э\", \"ю\", \"я\"\n );\n $convert_from = array(\n \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\",\n \"V\", \"W\", \"X\", \"Y\", \"Z\", \"À\", \"Á\", \"Â\", \"Ã\", \"Ä\", \"Å\", \"Æ\", \"Ç\", \"È\", \"É\", \"Ê\", \"Ë\", \"Ì\", \"Í\", \"Î\", \"Ï\",\n \"Ð\", \"Ñ\", \"Ò\", \"Ó\", \"Ô\", \"Õ\", \"Ö\", \"Ø\", \"Ù\", \"Ú\", \"Û\", \"Ü\", \"Ý\", \"А\", \"Б\", \"В\", \"Г\", \"Д\", \"Е\", \"Ё\", \"Ж\",\n \"З\", \"И\", \"Й\", \"К\", \"Л\", \"М\", \"Н\", \"О\", \"П\", \"Р\", \"С\", \"Т\", \"У\", \"Ф\", \"Х\", \"Ц\", \"Ч\", \"Ш\", \"Щ\", \"Ъ\", \"Ъ\",\n \"Ь\", \"Э\", \"Ю\", \"Я\"\n );\n return str_replace($convert_from, $convert_to, $string);\n}", "function solution(string $s): string\n{\n $result = '';\n\n $capitals = range(ord('A'), ord('Z'));\n\n foreach (str_split($s) as $c) {\n if (in_array(ord($c), $capitals)) {\n $result .= ' ';\n }\n $result .= $c;\n }\n\n return $result;\n}", "function zkrat_text($text, $pocet_znaku) {\n return strlen($text) <= $pocet_znaku ? $text : mb_substr(mb_substr($text, 0, $pocet_znaku, \"UTF-8\"), 0, strrpos(mb_substr($text, 0, $pocet_znaku, \"UTF-8\"), \" \")).\" ...\";\n}" ]
[ "0.71561533", "0.58767956", "0.5638672", "0.5597476", "0.5565432", "0.5474066", "0.5440311", "0.53745645", "0.5359091", "0.5304762", "0.5298343", "0.52952015", "0.52883977", "0.5285353", "0.52732736", "0.5271292", "0.5251487", "0.5239941", "0.5230086", "0.522902", "0.5222886", "0.52115643", "0.52085286", "0.52083874", "0.5204618", "0.51888424", "0.5186324", "0.5184352", "0.51590824", "0.5148881" ]
0.61194235
1
Gets a mock socket
protected function getMockSocket() { return $this->getMock('Wrench\Socket\ClientSocket', array(), array('wss://localhost:8000')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSocket();", "public function getSocket()\n {\n }", "private function getSocket(): SocketInterface\n {\n if (!isset($this->socket)) {\n $this->socket = $this->factory->create();\n }\n\n return $this->socket;\n }", "protected function _getSocket() {\n\t\t$f3 = \\Base::instance();\n\t\t$host = $f3->get(\"pushconfig.host\");\n\t\t$port = $f3->get(\"pushconfig.port\");\n\t\tif (!$this->_socket) {\n\t\t\t$this->_socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n\t\t\tif($f3->get(\"pushconfig.enabled\")) {\n\t\t\t\t$result = @socket_connect($this->_socket, $host, $port);\n\t\t\t\t$f3->set(\"push_socket_status\", $result);\n\t\t\t\tif(!$result) {\n\t\t\t\t\t$err = socket_last_error();\n\t\t\t\t\t$str = socket_strerror($err);\n\t\t\t\t\t$log = new \\Log(\"push.log\");\n\t\t\t\t\t$log->write(\"Failed to create socket connection: [$err] $str\");\n\t\t\t\t\t$f3->set(\"error\", \"An error occurred connecting to the push server.\");\n\t\t\t\t}\n\t\t\t\tsocket_write($this->_socket, \"TEST MESSAGE\");\n\t\t\t}\n\t\t}\n\t\treturn $this->_socket;\n\t}", "public function getSocket()\n {\n return $this->socket;\n }", "public function getSocket()\n {\n return $this->_socket;\n }", "public function getSocket()\n {\n return $this->_socket;\n }", "public function connect(): SocketStream\n {\n return $this->mockHandle(function () {\n $mock_stream = fopen('php://temp', 'rw');\n return new SocketStream($mock_stream);\n });\n }", "private function createSocket()\n {\n if ($this->socket_failed) {\n return false;\n }\n\n $protocol = $this->options['tls'] ? 'tls' : 'ssl';\n $host = $this->options['host'];\n $port = 443;\n $timeout = $this->options['timeout'];\n\n // Open our socket to the API Server.\n $socket = @pfsockopen(\n $protocol . '://' . $host,\n $port,\n $errno,\n $errstr,\n $timeout\n );\n\n // If we couldn't open the socket, handle the error.\n if ($socket === false) {\n $this->handleError($errno, $errstr);\n $this->socket_failed = true;\n }\n\n return $socket;\n }", "public function testGetSocketType()\n {\n $this->assertSame(\n $value = '\\AppserverIo\\Server\\Sockets\\StreamSocket',\n $this->getServerNodeWithMockedConfiguration($value, null, 'getSocket')->getSocketType()\n );\n }", "static function getsock($addr, $port)\n\t\t{\n\t\t\t$socket = null;\n\t\t\t$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n\t\t\tif ($socket === false || $socket === null)\n\t\t\t{\n\t\t\t\t$error = socket_strerror(socket_last_error());\n\t\t\t\t$msg = \"socket create(TCP) failed {$error}\";\n\t\t\t\tsyslog(LOG_ALERT, $msg );\n\t\t\t\treturn null;\n\t\t}\n\t\t\n\t\t$res = socket_connect($socket, $addr, $port);\n\t\tif ($res === false)\n\t\t{\n\t\t\t$error = socket_strerror(socket_last_error());\n\t\t\t$msg = \"socket connect($addr,$port) failed\";\n\t\t\tsyslog(LOG_ALERT, $msg . ' returning null');\n\t\t\tsocket_close($socket);\n\t\t\treturn null;\n\t\t}\n\t\treturn $socket;\n\t\t}", "public function CreateSocket()\n {\n return parent::CreateSocket();\n }", "protected function makeSocket($timeout = 1)\n {\n return fsockopen(\n 'tcp://' . $this->host,\n $this->port,\n $errno,\n $errstr,\n $timeout\n );\n }", "public function BindSocket()\n {\n return parent::BindSocket();\n }", "public function getSocket($type, $persistent_id = NULL, $on_new_socket = NULL)\n {\n }", "function MUD_Connect($socket_path)\n\t{\n\t\t// Connect\n\t\t$socket = socket_create(AF_UNIX, SOCK_STREAM, 0);\n\t\tsocket_connect($socket, $socket_path);\n\t\treturn $socket;\n\t}", "public static function setupBeforeClass()\n {\n self::$socket = stream_socket_server('tcp://127.0.0.1:16816');\n }", "function socket_create_master()\n {\n \n # No timeouts, flush content immediatly\n set_time_limit(0);\n ob_implicit_flush();\n\n # Create socket\n if(($socket = socket_create(AF_INET,SOCK_STREAM,0))===false )\n {\n $this->mlog ('Could not create socket');\n $this->mlog ('End of script');\n die();\n } \n\n # Bind to socket\n if(socket_bind($socket,$this->acs_ip,$this->acs_port)===false)\n {\n $this->mlog ('Could not bind to socket');\n $this->mlog ('End of script');\n die();\n }\n\n # Start listening\n if(socket_listen($socket)===false)\n {\n $this->mlog ('Could not set up socket listener');\n $this->mlog ('End of script');\n die();\n }\n \n return $socket;\n \n }", "public function getChildSocket(): Socket\n {\n return $this->child;\n }", "private function _connect() {\n\t\t$errno = 0;\n\t\t$errstr = '';\n\t\t$resource = fsockopen($this->_host, $this->_port, $errno, $errstr, $this->_timeout / 1000);\n\n\t\tif (!$resource) {\n\t\t\tthrow new RuntimeException(\"Failed to connect to gearman server at {$this->_host}:{$this->_port}. Error number [$errno], message: $errstr\");\n\t\t} else {\n\t\t\tstream_set_timeout($resource, 0, $this->_timeout * 1000);\n\t\t\treturn $resource;\n\t\t}\n\t}", "function stream_socket_client ($remote_socket, &$errno = null, &$errstr = null, $timeout = 'ini_get(\"default_socket_timeout\")', $flags = 'STREAM_CLIENT_CONNECT', $context = null) {}", "public function getSocketFile()\n {\n return $this->_socketFile;\n }", "function ngx_connect($fd, $addr, $port)\n{\n return socket_connect($fd,$addr,$port);\n}", "private function getBaseMockStream()\n {\n return $this->getMock('Psr\\Http\\Message\\StreamInterface');\n }", "function _connectsocket($ip, $port, $proto='udp') {\r\n\tif ($this->DEBUG) print \"DEBUG: Opening socket to $ip:$port >>>\\n\";\r\n\t$this->sock = @fsockopen(\"$proto://$ip\", $port, $this->errno, $this->errstr);\r\n\t$this->_set_timeout($this->conf['timeout']);\r\n\treturn $this->sock;\r\n}", "protected function _getConnection($force = null)\n {\n // NOTE TO SELF: Re-write this to be able to disable NAGLE (TCP_NODELAY)\n if ($force || !is_resource($this->_socket)) {\n $errno = null;\n $errstr = null;\n $this->_socket = stream_socket_client('tcp://' . $this->_host . ':' . $this->_port, $errno, $errstr, 30);\n stream_set_timeout($this->_socket, 86400);\n if (!is_resource($this->_socket)) {\n throw new Riak_Transport_Exception('Error creating socket. Error number :' . $errno . ' error string: '. $errstr);\n }\n }\n return $this->_socket;\n }", "public function setUp()\r\n {\r\n $port = rand(10000, 12000);\r\n $this->port = $port;\r\n $this->server = stream_socket_server(\"tcp://localhost:$port\");\r\n \r\n $this->socket = new Socket('localhost', $port);\r\n $this->conn = stream_socket_accept($this->server);\r\n }", "function fsockopen(\n string $hostname,\n #[PhpStormStubsElementAvailable(from: '5.3', to: '7.0')] int $port,\n #[PhpStormStubsElementAvailable(from: '7.1')] int $port = -1,\n &$error_code,\n &$error_message,\n ?float $timeout\n) {}", "protected function createSocket()\n {\n $now = $this->getCurrentTime();\n if ($this->retryTime === null) {\n $attempt = true;\n } else {\n $attempt = ($now >= $this->retryTime);\n }\n\n if (!$attempt) {\n return;\n }\n\n $this->socket = $this->makeSocket();\n if ($this->socket !== false) {\n $this->retryTime = null;\n return;\n }\n\n if ($this->retryTime === null) {\n $this->retryPeriod = $this->retryStart;\n } else {\n $this->retryPeriod *= $this->retryFactor;\n if ($this->retryPeriod > $this->retryMax) {\n $this->retryPeriod = $this->retryMax;\n }\n }\n $this->retryTime = $now + $this->retryPeriod;\n }", "function stream_socket_server ($local_socket, &$errno = null, &$errstr = null, $flags = 'STREAM_SERVER_BIND | STREAM_SERVER_LISTEN', $context = null) {}" ]
[ "0.76288897", "0.7469513", "0.7329179", "0.727519", "0.7272819", "0.7239691", "0.7239691", "0.71529984", "0.62284666", "0.6186465", "0.6180742", "0.6172345", "0.61072457", "0.60075694", "0.59511614", "0.59472466", "0.5912211", "0.58672285", "0.5863525", "0.583284", "0.5795873", "0.57758886", "0.5771417", "0.5733346", "0.57208276", "0.56782085", "0.5670111", "0.56656194", "0.5603569", "0.5595905" ]
0.82154185
0
calculate scl basedon this.
public function scl(): int { return 5; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSC(){\n\t\treturn $this->sc;\n\t}", "public function getCofinsCst()\n {\n return $this->cofins_cst;\n }", "function cs() : CS {\n\treturn CS::get();\n}", "abstract public function calculateCost();", "public function getCst()\n {\n return $this->cst;\n }", "public function getCstCofins()\n {\n return $this->cstCofins;\n }", "public function sdo_cto_bonus()\n {\n $sdo_members = ActiveSdo::all();\n\n $qualified_members = array();\n\n $sales = 100000; //set default to 100k for testing\n\n $cto_pool = (5/100)*$sales; //5% sdo cto bonus\n\n $total_shares = 0;\n $shares = 0;\n\n foreach($sdo_members as $member)\n {\n $members_5k = 0;\n $root = Referral::where('user_id', $member->user_id)->first();\n\n $children = $root->getImmediateDescendants();\n\n if(count($children) >= 5)\n {\n foreach ($children as $child)\n {\n $wallet = Wallet::where('user_id', $child->user_id)->first();\n if($wallet && $wallet->pv >= 5000)\n {\n $members_5k++;\n $qualified_members[] = $child;\n } \n }\n\n if($members_5k/5 > 0)\n {\n $shares = floor($members_5k/5);\n\n $qualified_members[] = $root;\n // 'user_id' => $member->user_id,\n // 'shares' => $shares\n // ];\n\n // $active_sdo = ActiveSdo::where('user_id', $member->user_id)->first();\n // $active_sdo->cto_unit_share = $shares;\n // $active_sdo->save();\n }\n }\n\n $total_shares = $total_shares + $shares;\n }\n\n if($total_shares > 0) $cto_value_per_unit = number_format(($cto_pool/$total_shares), 2, '.', '');\n else $cto_value_per_unit = 0;\n\n if(count($qualified_members) > 0)\n {\n $i = 0;\n foreach ($qualified_members as $qmember)\n {\n // $qualified_sdo = ActiveSdo::where('user_id', $qmember[$i++]['user_id'])->first();\n // $qualified_sdo->cto_unit_share = $qmember[$i++]['shares'];\n // $qualified_sdo->cto_value_share= $qmember[$i++]['shares'] * $cto_value_per_unit;\n // $qualified_sdo->save();\n // echo '<br>';\n // echo '<pre>';\n // print_r($qmember);\n // echo '</pre>';\n echo $qmember[$i++]['user_id'];\n }\n }\n \n }", "public function collectCommission()\n {\n if ($this->getData('vendor_id') && $this->getData('base_to_global_rate') && $this->getData('order_total')) {\n $order = $this->getCurrentOrder();\n\n $helper = $this->marketplaceAclHelper->setStoreId($order->getStoreId())\n ->setOrder($order)\n ->setVendorId($this->getData('vendor_id'));\n\n $commissionSetting = $helper->getCommissionSettings($this->getData('vendor_id'));\n $commissionSetting['item_commission'] = $this->getData('item_commission');\n\n $commission =\n $helper->calculateCommission($this->getData('order_total'), $this->getData('base_order_total'),\n $this->getData('base_to_global_rate'), $commissionSetting);\n\n $this->setShopCommissionTypeId($commissionSetting['type']);\n $this->setShopCommissionRate($commissionSetting['rate']);\n $this->setShopCommissionBaseFee($commission['base_fee']);\n $this->setShopCommissionFee($commission['fee']);\n $this->setCreatedAt($this->dateTime->gmtDate());\n $this->setPaymentState(self::STATE_OPEN);\n if (isset($commission['item_commission'])) {\n $this->setItemsCommission($commission['item_commission']);\n }\n $this->setOrderPaymentState(Invoice::STATE_OPEN);\n }\n\n return $this;\n }", "public function getCumBaseSs(): ?float {\n return $this->cumBaseSs;\n }", "public function getCoste()\n {\n return $this->coste;\n }", "function costs(){\n\t\t\tforeach ($this->_companies as $company){\n\t\t\t\t$company->setInterestTotal();\t\t\t\t\n\t\t\t\t$this->_costs[$company->getId()]['pr_fixed_cost']=$company->getPrFixedCost();\n\t\t\t\t$this->_costs[$company->getId()]['hr_hiring_costs']=$company->getHrHiringCost();\n\t\t\t\t$this->_costs[$company->getId()]['hr_training_costs']=$company->getHrTrainingCost();\n\t\t\t\t$this->_costs[$company->getId()]['hr_wages_costs']=$company->getHrWagesCost();\t\n\t\t\t\t// Los de distribución sacados de abajo porque se calculan completos (excepto los de distribución de stock) en la rutina $company->getPrDistribCost()\n\t\t\t\tif (! isset($this->_costs[$company->getId()]['pr_distrib_costs'])){\n\t\t\t\t\t$this->_costs[$company->getId()]['pr_distrib_costs']=0;\n\t\t\t\t}\n\t\t\t\t$this->_costs[$company->getId()]['pr_distrib_costs']=$company->getPrDistribCost();\n\t\t\t\t//todo lo incluido en este foreach funciona debidamente\n\t\t\t\tforeach ($this->_channels as $channel){\n\t\t\t\t\tforeach ($this->_regions as $region){\n\t\t\t\t\t\tforeach ($this->_products as $product){ \n\t\t\t\t\t\t\t$availability=$this->_games->getProductAvailibility($this->_game['id'], $this->_round['round_number'],$company->getId(), $product->getProductNumber());\n\t\t\t\t\t\t\tif($availability==1){\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['pr_var_costs'])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['pr_var_costs']=0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['pr_var_costs']+=$company->getPrVarCost($channel->getChannelNumber(), \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $region->getRegionNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $product->getProductNumber());\n\t\t\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['pr_rawMaterials_costs'][$channel->getChannelNumber()])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['pr_rawMaterials_costs'][$channel->getChannelNumber()]=0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['pr_rawMaterials_costs'][$channel->getChannelNumber()]+=$company->getPrRawMaterialsCost($channel->getChannelNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$region->getRegionNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$product->getProductNumber());\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['pr_distrib_costs'])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['pr_distrib_costs']=0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// Sacado el cálculo fuera porque la rutina ya calcula el total.\n\t\t\t\t\t\t\t\t// $this->_costs[$company->getId()]['pr_distrib_costs']+=(($company->getPrDistribCost($channel->getChannelNumber(), $region->getRegionNumber(), $product->getProductNumber())));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//test\n\t\t\t\t\t\t\t\t// if ($company->getId()==168) {\n\t\t\t\t\t\t\t\t\t\t// echo(\"Costes distribución Test. Empresa: \" . $company->getId() . \", Canal: \" . $channel->getChannelNumber() . \", Región : \" . $region->getRegionNumber() . \", Producto: \" . $product->getProductNumber() . \", COSTE = \" . ($company->getPrDistribCost($channel->getChannelNumber(), $region->getRegionNumber(), $product->getProductNumber())) . \"<br/>\");\n\t\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\t\t//VERO: Costes de distribución de stocks\n\t\t\t\t\t\t\t\tforeach($this->_channels as $channelD){\n\t\t\t\t\t\t\t\t\tforeach ($this->_regions as $regionD){\n\t\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['pr_distrib_costs']+=$company->getStDistribCost($channel->getChannelNumber(), $channelD->getChannelNumber(), $region->getRegionNumber(), $regionD->getRegionNumber(), $product->getProductNumber());\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//VERO\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['mk_sales_costs'][$channel->getChannelNumber()])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_sales_costs'][$channel->getChannelNumber()]=0;\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_sales_costs'][$channel->getChannelNumber()]+=$company->getMkSalesCost($channel->getChannelNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$region->getRegionNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$product->getProductNumber());\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['mk_fixed_costs'][$channel->getChannelNumber()])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_fixed_costs'][$channel->getChannelNumber()]=0;\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_fixed_costs'][$channel->getChannelNumber()]+=$company->getMkFixedCost2($channel->getChannelNumber(), $region->getRegionNumber(), $product->getProductNumber()); // getMkFixedCost does not have $product as argument!\n\t\t\t\t\t\t\t\t// AHG 20171122 Mode change can be done by providing or not $product as argument\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//Costes funcionan por canal, para todos los productos y todas las regiones\n\t\t\t\t\n\t\t\t\tforeach ($this->_medias as $media){\n\t\t\t\t\tforeach ($this->_regions as $region){\n\t\t\t\t\t\tforeach ($this->_products as $product){\n\t\t\t\t\t\t\t$availability=$this->_games->getProductAvailibility($this->_game['id'], $this->_round['round_number'],$company->getId(), $product->getProductNumber());\n\t\t\t\t\t\t\tif($availability==1){\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['mk_advert_costs'][$media->getMediaNumber()])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_advert_costs'][$media->getMediaNumber()]=0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_advert_costs'][$media->getMediaNumber()]+=$company->getMkAdvertCost($media->getMediaNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$region->getRegionNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$product->getProductNumber());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tforeach ($this->_trademedias as $trademedia){\n\t\t\t\t\tforeach ($this->_channels as $channel){\n\t\t\t\t\t\tforeach ($this->_products as $product){\n\t\t\t\t\t\t\t$availability=$this->_games->getProductAvailibility($this->_game['id'], $this->_round['round_number'],$company->getId(), $product->getProductNumber());\n\t\t\t\t\t\t\tif($availability==1){\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['mk_trade_costs'][$trademedia['trademedia_number']])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_trade_costs'][$trademedia['trademedia_number']]=0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_trade_costs'][$trademedia['trademedia_number']]+=$company->getMkTradeCost($trademedia['trademedia_number'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$channel->getChannelNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$product->getProductNumber());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Medias y TradeMedias funcionan para todos los productos y todas las regiones\n\t\t\t\t\n\t\t\t\t//costes de las iniciativas selecionadas funcionando OK.\n\t\t\t\t$this->_costs[$company->getId()]['initiatives_pr_costs']=$company->getInitiativesProductionCost();\n\t\t\t\t$this->_costs[$company->getId()]['initiatives_mk_costs']=$company->getInitiativesMarketingCost();\n\t\t\t\t$this->_costs[$company->getId()]['initiatives_hr_costs']=$company->getInitiativesHumanResourcesCost();\n\t\t\t\t\n\t\t\t\t//costes de los estudios de mercado solicitados funcionando OK\n\t\t\t\t$this->_costs[$company->getId()]['market_researches_costs']=$company->getMarketResearchesCosts();\n\t\t\t\t//costes de cambios de I+D+i funcionando OK\n\t\t\t\t$this->_costs[$company->getId()]['idi_changes_costs']=$company->getIdiChangesCosts();\n\t\t\t\t//costes de I+D+i en lanzamiento de nuevos productos funcionando OK\n\t\t\t\t$this->_costs[$company->getId()]['idi_new_costs']=$company->getIdiNewCosts();\n\t\t\t\t\n\t\t\t\t$this->_costs[$company->getId()]['fi_debt_costs_st']=$company->getFiDebtCostsSt();\n\t\t\t\t$this->_costs[$company->getId()]['fi_debt_costs_lt']=$company->getFiDebtCostsLt();\n\t\t\t\techo(\"<br>CORE (1) FIDEBTCOSTS: \".$company->getFiDebtCostsLt().\"<br>\");\n\t\t\t\t\n\t\t\t\t//Para que no haya ningun coste a NULL\n\t\t\t\tforeach ($this->_costs[$company->getId()] as $name=>$cost){\n\t\t\t\t\tif(!isset($cost)){\n\t\t\t\t\t\t$this->_costs[$company->getId()][$name]=0;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t$this->save_costs();\n\t\t}", "public abstract function cln ();", "public static function getCBConsineSimilarity(&$item1Info, &$item2Info)\n {\n //$item2Info2 = \"james love peter\";\n self::tokenise($item1Info, $item2Info);\n $xToken = self::$item1Tokens;\n $yToken = self::$item2Tokens;\n $a = $b = $c = 0;\n $uniqueMergedTokens = array_merge($yToken,$xToken);\n $item1Product= array();\n $item2Product= array();\n \t$xArray=array();\n \t$yArray=array();\n \t$key=0;\n \tforeach ($uniqueMergedTokens as $token=>$val){\n if(array_key_exists($token,$xToken)){\n $xArray[$key]= $val;\n }else{\n $xArray[$key] = 0;\n }\n if(array_key_exists($token,$yToken)){\n $yArray[$key]= $val;\n }else{\n $yArray[$key] = 0;\n }\n $item1Product[] = pow($xArray[$key],2);\n $item2Product[] = pow($yArray[$key],2);\n \t\t$key++;\n \t}\n \t$item1RootSumProduct=sqrt(array_sum($item1Product));\n \t$item2RootSumProduct=sqrt(array_sum($item2Product));\n \tfor($k=0;$k<$key;$k++){\n \t\t$xArray[$k]/=$item1RootSumProduct;\n \t\t$yArray[$k]/=$item2RootSumProduct;\n\n $a+=$xArray[$k]*$yArray[$k];\n \t$b+=$xArray[$k]*$xArray[$k];\n \t\t$c+=$yArray[$k]*$yArray[$k];\n \t}\n if($b == 0){\n return 0;\n }\n $cs = $a / sqrt($b * $c);\n // var_dump($cs);\n \t//return $a / sqrt($b * $c);\n return $cs;\n }", "public function getCSOSN()\n {\n return $this->CSOSN;\n }", "private function doInitialCalcs($srchSpoolWidth, $srchSpoolMethod, $srchStyle, $frameSize, $swOpt, $cable, $drumSize, $pretensionTurns, $ccf, $travelInFt, $deadWraps, $calcTorqueParams, $collector, $srchSpring, $srchGear, $modelIndex, $specificInput, $cableOrHose, $srchMotor, $application, $srchColl, $uReelWidth, $uReelWidthInp) {\n $cableThick = $cable['thickness'];\n $cableType = $cable['type'];\n //Sanning: honeWgtBoth, used in multiple places\n $hoseWgtboth = 0;\n\n //$magnetCalcs = fopen(\"C:\\\\Users\\\\nwachukwuc1\\\\Desktop\\\\initialCalsForMagnet.txt\", \"a\");\n\n //fwrite($magnetCalcs, $srchStyle. $frameSize . $srchSpring . \"-\". $srchColl. \"-\" . $drumSize . \"-\" . $pretensionTurns . PHP_EOL);\n\n //Sanning: Variable Initialization block, catches all variables used in scope of function initialized to 0\n $wrapperWidthR = 0;\n $compartmentHeight = 0;\n $cableClearanceFactor = 0;\n $compartmentMaximumCableLength = 0;\n $cableCapacityLostFirstClearanceWrap = 0;\n $cableCapacityLostSecondClearanceWrap = 0;\n $cableCapacityLostThirdClearanceWrap = 0;\n $compartmentCableCapacity = 0;\n $cableClearanceInInchesLess1Layers = 0;\n $cableClearanceInInchesLess2Layers = 0;\n $cableClearanceInInchesLess3Layers = 0;\n $cableClearanceInInches = 0;\n $firstLayerMomentArm = 0;\n $reelInertia = 0;\n $torqueToOvercomeCollectorFriction = 0;\n $adjustedTorque = 0;\n $deadWrapLength = 0;\n $maxWrapsPerLayerRStored = 0;\n $maxWrapsPerLayerR = 0;\n $maxWrapsPerLayerI = 0;\n $springTurnsAvailAfterPretensionR = 0;\n $maxUsableWrapsR = 0;\n $compartmentActiveCableLength = 0;\n $maxUsableLayersR = 0;\n $maxUsableLayersI = 0;\n $maxCableLayersR = 0;\n $AdjSlopeFirstPartOfCurve = 0;\n $AdjyInterceptFirstPartOfCurve = 0;\n $AdjMaxTurnsForFirstPartOfCurve = 0;\n $torqueSafetyFactor = 0;\n $AdjSlopeSecondPartOfCurve = 0;\n $AdjyInterceptSecondPartOfCurve = 0;\n $AdjMaxTurnsForSecondPartOfCurve = 0;\n $turnsActiveCableLength = 0;\n $maxFullLayersFromTurnsR = 0;\n $extraWrapsAfterFullLayersTurnsR = 0;\n $extraWrapsAfterFullLayersTurnsI = 0;\n\n $validTurns = 0;\n $validCompartment = 0;\n $AdjMaxTurnsForThirdPartOfCurve = 0;\n $AdjyInterceptThirdPartOfCurve = 0;\n $AdjSlopeThirdPartOfCurve = 0;\n\n $spoolWidthCode = 0;\n $springFamilyIndex = 0;\n $reelInertiaCalcs = 0; $wrapperWidthI = 0; $reelWidthInp = \"\";\n\n switch ($srchStyle) {\n case 'S':\n case 'SM':\n case 'MMD':\n case 'P':\n switch ($frameSize) {\n case 14:\n $wrapperWidthI = 4;\n break;\n case 16:\n $wrapperWidthI = 5;\n break;\n case 18:\n $wrapperWidthI = 5;\n break;\n case 21:\n $wrapperWidthI = 5;\n break;\n case 24:\n $wrapperWidthI = 5;\n break;\n case 28:\n $wrapperWidthI = 7;\n break;\n case 32:\n $wrapperWidthI = 7;\n break;\n }\n //fwrite($magnetCalcs, \"wrapperWidthI: \" . $wrapperWidthI . PHP_EOL);\n\n if ($srchStyle == 'S' && $frameSize > 15 && $frameSize < 25 && $swOpt) {\n $wrapperWidthI = 7;\n }\n\n $wrapperWidthR = $wrapperWidthI;\n //fwrite($magnetCalcs, \"wrapperWidthR: \" . $wrapperWidthR . PHP_EOL);\n\n $spoolWidthCode = 0;\n break;\n case 'SHO':\n case 'TMR':\n if ($srchSpoolMethod == \"M\") {\n switch ($srchSpoolWidth) {\n case 'ma':\n $spoolWidth = .75;\n break;\n case 'mb':\n $spoolWidth = 1;\n break;\n case 'mc':\n $spoolWidth = 1.25;\n break;\n case 'md':\n $spoolWidth = 1.5;\n break;\n case 'me':\n $spoolWidth = 1.75;\n break;\n case 'mf':\n $spoolWidth = 2;\n break;\n case 'mx':\n $spoolWidth = 1.1 * $cableThick;\n break;\n //Sanning: Default case needed as spoolWidth needs to be initialized\n default:\n $spoolWidth = 0;\n break;\n }\n $wrapperWidthR = $spoolWidth;\n $wrapperWidthR = 1.1 * $cableThick;\n $spoolWidthCode = $srchSpoolWidth;\n //fwrite($magnetCalcs, \"srchSpoolMethod: \" . $srchSpoolMethod . PHP_EOL);\n //fwrite($magnetCalcs, \"spoolWidth: \" . $spoolWidth . PHP_EOL);\n //fwrite($magnetCalcs, \"wrapperWidthR: \" . $wrapperWidthR . PHP_EOL);\n //fwrite($magnetCalcs, \"spoolWidthCode: \" . $spoolWidthCode . PHP_EOL);\n\n } else {\n $spoolWidthCode = 0;\n $wrapperWidthR = $srchSpoolWidth;\n //fwrite($magnetCalcs, \"wrapperWidthR: \" . $wrapperWidthR . PHP_EOL);\n //fwrite($magnetCalcs, \"srchSpoolWidth: \" . $srchSpoolWidth . PHP_EOL);\n }\n\n break;\n case \"K\":\n\n switch ($cable['hoseIDCode']) {\n case \"4\":\n $wrapperWidthR = 1.25;\n $hoseWgtboth = 2 * ($cable[\"weight\"] + 0.02);\n break;\n case \"6\":\n $wrapperWidthR = 1.75;\n $hoseWgtboth = 2 * ($cable[\"weight\"] + 0.05);\n break;\n case \"8\":\n $wrapperWidthR = 2.125;\n $hoseWgtboth = 2 * ($cable[\"weight\"] + 0.09);\n break;\n case \"12\":\n $wrapperWidthR = 2.75;\n $hoseWgtboth = 2 * ($cable[\"weight\"] + 0.19);\n break;\n }\n if($cableType == \"Air\"){\n $hoseWgtboth = 2 * $cable[\"weight\"];\n }\n break;\n case \"U\":\n $wrapperWidthR = $uReelWidth;\n $reelWidthInp = $uReelWidthInp;\n break;\n }\n\n\n $grndchkQty = $cable['grndchck'];\n //fwrite($magnetCalcs, \"grndchkQty: \" . $grndchkQty . PHP_EOL);\n\n\n if ($srchStyle == 'K') {\n $maxWrapsPerLayerR = 1;\n } else {\n $maxWrapsPerLayerR = $wrapperWidthR / $cableThick;\n //fwrite($magnetCalcs, \"maxWrapsPerLayerR: \" . $maxWrapsPerLayerR . PHP_EOL);\n //fwrite($magnetCalcs, \"wrapperWidthR: \" . $wrapperWidthR . PHP_EOL);\n //fwrite($magnetCalcs, \"cableThick: \" . $cableThick . PHP_EOL);\n }\n\n $maxWrapsPerLayerRStored = $maxWrapsPerLayerR;\n $maxWrapsPerLayerR = floor($maxWrapsPerLayerR); //Dropping fractional part for testing ---\n $maxWrapsPerLayerRStored = round($maxWrapsPerLayerRStored, 6);\n\n //fwrite($magnetCalcs, \"maxWrapsPerLayerR: \" . $maxWrapsPerLayerR . PHP_EOL);\n //fwrite($magnetCalcs, \"maxWrapsPerLayerRStored: \" . $maxWrapsPerLayerRStored . PHP_EOL);\n\n $maxWrapsPerLayerI = intval($maxWrapsPerLayerR);\n //fwrite($magnetCalcs, \"maxWrapsPerLayerI: \" . $maxWrapsPerLayerI . PHP_EOL);\n\n $maxWrapsPerLayerR = $maxWrapsPerLayerI;\n //fwrite($magnetCalcs, \"maxWrapsPerLayerR: \" . $maxWrapsPerLayerR . PHP_EOL);\n\n $maxCableLayersR = ($frameSize - $drumSize) / (2.0 * $cableThick);\n $maxCableLayersR = round($maxCableLayersR, 6);\n //fwrite($magnetCalcs, \"maxCableLayersR: \" . $maxCableLayersR . PHP_EOL);\n //fwrite($magnetCalcs, \"frameSize: \" . $frameSize . PHP_EOL);\n //fwrite($magnetCalcs, \"drumSize: \" . $drumSize . PHP_EOL);\n //fwrite($magnetCalcs, \"cableThick: \" . $cableThick . PHP_EOL);\n\n\n $maxCableLayersI = intval($maxCableLayersR);\n //fwrite($magnetCalcs, \"maxCableLayersI: \" . $maxCableLayersI . PHP_EOL);\n //fwrite($magnetCalcs, \"maxCableLayersR: \" . $maxCableLayersR . PHP_EOL);\n\n $maxCableWrapsI = $maxWrapsPerLayerI * $maxCableLayersI;\n //fwrite($magnetCalcs, \"maxCableWrapsI: \" . $maxCableWrapsI . PHP_EOL);\n //fwrite($magnetCalcs, \"maxWrapsPerLayerI: \" . $maxWrapsPerLayerI . PHP_EOL);\n //fwrite($magnetCalcs, \"maxCableLayersI: \" . $maxCableLayersI . PHP_EOL);\n\n if ($ccf == 0) {//called CableCF in ReelMod.bas\n $this->cableClearanceFactor = $this->assignCCF($srchStyle, $maxCableWrapsI);\n //fwrite($magnetCalcs, \"cableClearanceFactor: \" . $this->cableClearanceFactor . PHP_EOL);\n } else {\n $this->cableClearanceFactor = $ccf;\n //fwrite($magnetCalcs, \"cableClearanceFactor: \" . $this->cableClearanceFactor . PHP_EOL);\n }\n //fwrite($magnetCalcs, \"maxCableLayersR: \" . $maxCableLayersR . PHP_EOL);\n\n\n $maxUsableLayersR = $maxCableLayersR - $this->cableClearanceFactor;\n //fwrite($magnetCalcs, \"maxUsableLayersR: \" . $maxUsableLayersR . PHP_EOL);\n //fwrite($magnetCalcs, \"maxCableLayersR: \" . $maxCableLayersR . PHP_EOL);\n //fwrite($magnetCalcs, \"cableClearanceFactor: \" . $this->cableClearanceFactor . PHP_EOL);\n\n\n $maxUsableLayersI = (int) ($maxUsableLayersR);\n $maxUsableLayersR = $maxUsableLayersI;\n //fwrite($magnetCalcs, \"maxUsableLayersI: \" . $maxUsableLayersI . PHP_EOL);\n //fwrite($magnetCalcs, \"maxUsableLayersR: \" . $maxUsableLayersR . PHP_EOL);\n\n $maxUsableWrapsR = $maxWrapsPerLayerR * $maxUsableLayersR;\n //fwrite($magnetCalcs, \"maxUsableWrapsR: \" . $maxUsableWrapsR . PHP_EOL);\n\n $compartmentHeight = ($frameSize - $drumSize) / 2.0;\n //fwrite($magnetCalcs, \"compartmentHeight: \" . $compartmentHeight . PHP_EOL);\n //fwrite($magnetCalcs, \"frameSize: \" . $frameSize . PHP_EOL);\n //fwrite($magnetCalcs, \"drumSize: \" . $drumSize . PHP_EOL);\n\n\n $fileStr = '';\n\n //todo: Need to add cases for SHO TMR P and K see line 2760 in ReelMod.bas\n switch ($srchStyle) {\n case 'S':\n case 'SM':\n case 'MMD':\n case 'U':\n $fileStr = $srchStyle . $frameSize . $srchSpring . '-' . $srchGear;\n break;\n case 'SHO':\n //$fileStr = $srchStyle . \"-\" .\n break;\n }\n\n $fileStr .= $fileStr . '-' . $pretensionTurns;\n // this is the part that doesn't make sense. The string is built and then reset and never used.\n\n\n $pi = 3.14159;//pi(); // figure out what value of pi the original program uses\n\n $deadWrapLength = $deadWraps * ($drumSize + $cableThick) * $pi / 12.0; // pi needs to replaced with actual value in program\n $deadWrapLength = round($deadWrapLength, 6);\n //fwrite($magnetCalcs, \"deadWrapLength: \" . $deadWrapLength . PHP_EOL);\n //fwrite($magnetCalcs, \"deadWraps: \" . $deadWraps . PHP_EOL);\n\n $cableLayerIndexR = 0;\n $compartmentCableCapacity = 0;\n while (true) {\n $cableLayerIndexR = $cableLayerIndexR + 1.0;\n\n if ($cableLayerIndexR > $maxUsableLayersR) {\n\n break;\n }\n //fwrite($magnetCalcs, \"cableLayerIndexR: \" . $cableLayerIndexR . PHP_EOL);\n\n switch ($srchStyle) {\n case 'SHO':\n case 'TMR':\n\n switch ($srchSpoolMethod) {\n case 'R':\n if ($cableLayerIndexR / 2 == (int)($cableLayerIndexR / 2)) {\n $layerCableCapacity = ($maxWrapsPerLayerR - 1) * ($drumSize + (2.0 * $cableLayerIndexR - 1.0) * $cableThick) * $pi / 12.0;\n //fwrite($magnetCalcs, \"layerCableCapacity: \" . $layerCableCapacity . PHP_EOL);\n } else {\n $layerCableCapacity = $maxWrapsPerLayerR * ($drumSize + (2.0 * $cableLayerIndexR - 1.0) * $cableThick) * $pi / 12.0;\n //fwrite($magnetCalcs, \"layerCableCapacity: \" . $layerCableCapacity . PHP_EOL);\n }\n break;\n default:\n $layerCableCapacity = $maxWrapsPerLayerR * ($drumSize + (2.0 * $cableLayerIndexR - 1.0) * $cableThick) * $pi / 12.0;\n //fwrite($magnetCalcs, \"layerCableCapacity: \" . $layerCableCapacity . PHP_EOL);\n break;\n }\n break;\n case \"U\":\n if ($cableLayerIndexR / 2 == intval($cableLayerIndexR / 2)) {\n $layerCableCapacity = ($maxWrapsPerLayerR - 1) * ($drumSize + (2.0 * $cableLayerIndexR - 1.0) * $cableThick) * $pi / 12.0;\n //fwrite($magnetCalcs, \"layerCableCapacity: \" . $layerCableCapacity . PHP_EOL);\n } else {\n $layerCableCapacity = ($maxWrapsPerLayerR) * ($drumSize + (2.0 * $cableLayerIndexR - 1) * $cableThick) * $pi / 12.0;\n //fwrite($magnetCalcs, \"layerCableCapacity: \" . $layerCableCapacity . PHP_EOL);\n }\n break;\n default:\n $layerCableCapacity = $maxWrapsPerLayerR * ($drumSize + (2.0 * $cableLayerIndexR - 1) * $cableThick) * $pi / 12.0;\n $layerCableCapacity = round($layerCableCapacity, 5);\n\n //fwrite($magnetCalcs, \"layerCableCapacity In Switch: \" . $layerCableCapacity . PHP_EOL);\n break;\n }\n //fwrite($magnetCalcs, \"layerCableCapacity Outside Switch: \" . $layerCableCapacity . PHP_EOL);\n\n $compartmentCableCapacity = $compartmentCableCapacity + $layerCableCapacity;\n //fwrite($magnetCalcs, \"compartmentCableCapacity: \" . $compartmentCableCapacity . PHP_EOL);\n }//End of Loop\n\n $compartmentActiveCableLength = $compartmentCableCapacity - $deadWrapLength;\n $compartmentActiveCableLength = round($compartmentActiveCableLength, 5);\n //fwrite($magnetCalcs, \"compartmentActiveCableLength: \" . $compartmentActiveCableLength . PHP_EOL);\n\n if ($compartmentActiveCableLength < $travelInFt) {\n\n switch ($specificInput) {\n case false:\n $initialCalcs = array(\n \"validTurns\" => false,\n \"validCompartment\" => false,\n \"SWC\" => $spoolWidthCode,\n \"invalidReason\" => 1\n );\n //fclose($magnetCalcs);\n return $initialCalcs;\n break;\n case true:\n $invalidWarning = true;\n break;\n }\n\n }\n $validCompartment = true;\n switch ($srchStyle) {\n case 'S':\n case 'SM':\n case 'MMD':\n case 'SHO':\n case 'U':\n case 'K':\n //debugbar::info(\"CalcTorque - Params\");\n //debugbar::info($calcTorqueParams);\n //fwrite($magnetCalcs, PHP_EOL);\n //fwrite($magnetCalcs, \"pretensionTurns: \" . $pretensionTurns . PHP_EOL);\n //fwrite($magnetCalcs, \"springSize: \" . $calcTorqueParams['springSize'] . PHP_EOL);\n //fwrite($magnetCalcs, \"turnsUsedPercent: \" . $calcTorqueParams['turnsUsedPercent'] . PHP_EOL);\n //fwrite($magnetCalcs, \"gearRatio: \" . $calcTorqueParams['gearRatio'] . PHP_EOL);\n //fwrite($magnetCalcs, \"maxWrapsPerLayerR: \" . $maxWrapsPerLayerR . PHP_EOL);\n //fwrite($magnetCalcs, \"drumSize: \" . $drumSize . PHP_EOL);\n //fwrite($magnetCalcs, \"deadWrapLength: \" . $deadWrapLength . PHP_EOL);\n //fwrite($magnetCalcs, \"compartmentActiveCableLength: \" . $compartmentActiveCableLength . PHP_EOL);\n //fwrite($magnetCalcs, \"maxUsableWrapsR: \" . $maxUsableWrapsR . PHP_EOL);\n //fwrite($magnetCalcs, PHP_EOL);\n\n $torqueCalcs = $this->calcTorque($calcTorqueParams['springSize'], $calcTorqueParams['springData'], $calcTorqueParams['turnsUsedPercent'], $calcTorqueParams['gearRatio'], $pretensionTurns, $maxWrapsPerLayerR, $cableThick, $drumSize, $deadWrapLength, $compartmentActiveCableLength, $maxUsableWrapsR);\n $turnsActiveCableLength = $torqueCalcs['turnsActiveCableLength'];\n $turnsActiveCableLength = round($turnsActiveCableLength, 5);\n //fwrite($magnetCalcs, \"torqueCalcs: \" . $torqueCalcs . PHP_EOL);\n //fwrite($magnetCalcs, \"turnsActiveCableLength: \" . $turnsActiveCableLength . PHP_EOL);\n\n if ($turnsActiveCableLength < $travelInFt) {\n switch ($specificInput) {\n case false:\n $initialCalcs = array(\n \"validTurns\" => false,\n \"validCompartment\" => false,\n \"SWC\" => $spoolWidthCode,\n \"reason\" => 2\n );\n //fclose($magnetCalcs);\n return $initialCalcs;\n break;\n case true:\n $invalidWarning = true;\n break;\n }\n }\n break;\n case 'TMR': // see line 2841 in ReelMod.bas\n switch ($srchMotor) {\n case \"2\":\n $this->tqsiz = 2.4;\n $this->rmoti = 0.093;\n break;\n case \"3\":\n $this->tqsiz = 3.7;\n $this->rmoti = 0.164;\n break;\n case \"5\":\n $this->tqsiz = 5.1;\n $this->rmoti = 0.29;\n break;\n case \"7\":\n $this->tqsiz = 7.8;\n $this->rmoti = 0.486;\n break;\n case \"9\":\n $this->tqsiz = 9.8;\n $this->rmoti = 0.923;\n break;\n case \"14\":\n $this->tqsiz = 14;\n $this->rmoti = 1.478;\n break;\n }\n break;\n case 'P':\n switch ($srchMotor) {\n case \"25\":\n $this->torqueFromMotor = 21.9;\n break;\n case \"50\":\n $this->torqueFromMotor = 43.8;\n break;\n case \"75\":\n $this->torqueFromMotor = 65.7;\n break;\n case \"150\":\n $this->torqueFromMotor = 131.4;\n break;\n }\n break;\n }\n //fwrite($magnetCalcs, \"this->tqsiz: \" . $this->tqsiz . PHP_EOL);\n //fwrite($magnetCalcs, \"this->rmoti: \" . $this->rmoti . PHP_EOL);\n //fwrite($magnetCalcs, \"this->torqueFromMotor: \" . $this->torqueFromMotor . PHP_EOL);\n\n if(isset($torqueCalcs)) {\n $AdjSlopeFirstPartOfCurve = $torqueCalcs['adjSlopeFirstPartOfCurve'];\n $AdjyInterceptFirstPartOfCurve = $torqueCalcs['AdjyInterceptFirstPartOfCurve'];\n $AdjMaxTurnsForFirstPartOfCurve = $torqueCalcs['AdjMaxTurnsForFirstPartOfCurve'];\n //fwrite($magnetCalcs, \"AdjSlopeFirstPartOfCurve: \" . $AdjSlopeFirstPartOfCurve . PHP_EOL);\n //fwrite($magnetCalcs, \"AdjyInterceptFirstPartOfCurve: \" . $AdjyInterceptFirstPartOfCurve . PHP_EOL);\n //fwrite($magnetCalcs, \"AdjMaxTurnsForFirstPartOfCurve: \" . $AdjMaxTurnsForFirstPartOfCurve . PHP_EOL);\n\n $AdjSlopeSecondPartOfCurve = $torqueCalcs['AdjSlopeSecondPartOfCurve'];\n $AdjyInterceptSecondPartOfCurve = $torqueCalcs['AdjyInterceptSecondPartOfCurve'];\n $AdjMaxTurnsForSecondPartOfCurve = $torqueCalcs['AdjMaxTurnsForSecondPartOfCurve'];\n //fwrite($magnetCalcs, \"AdjSlopeSecondPartOfCurve: \" . $AdjSlopeSecondPartOfCurve . PHP_EOL);\n //fwrite($magnetCalcs, \"AdjyInterceptSecondPartOfCurve: \" . $AdjyInterceptSecondPartOfCurve . PHP_EOL);\n //fwrite($magnetCalcs, \"AdjMaxTurnsForSecondPartOfCurve: \" . $AdjMaxTurnsForSecondPartOfCurve . PHP_EOL);\n\n $AdjMaxTurnsForThirdPartOfCurve = $torqueCalcs['AdjMaxTurnsForThirdPartOfCurve'];\n $AdjyInterceptThirdPartOfCurve = $torqueCalcs['AdjyInterceptThirdPartOfCurve'];\n $AdjSlopeThirdPartOfCurve = $torqueCalcs['AdjSlopeThirdPartOfCurve'];\n //fwrite($magnetCalcs, \"AdjMaxTurnsForThirdPartOfCurve: \" . $AdjMaxTurnsForThirdPartOfCurve . PHP_EOL);\n //fwrite($magnetCalcs, \"AdjyInterceptThirdPartOfCurve: \" . $AdjyInterceptThirdPartOfCurve . PHP_EOL);\n //fwrite($magnetCalcs, \"AdjSlopeThirdPartOfCurve: \" . $AdjSlopeThirdPartOfCurve . PHP_EOL);\n\n\n $maxFullLayersFromTurnsR = $torqueCalcs['maxFullLayersFromTurnsR'];\n $extraWrapsAfterFullLayersTurnsI = $torqueCalcs['extraWrapsAfterFullLayersTurnsI'];\n $extraWrapsAfterFullLayersTurnsR = $torqueCalcs['extraWrapsAfterFullLayersTurnsR'];\n //fwrite($magnetCalcs, \"maxFullLayersFromTurnsR: \" . $maxFullLayersFromTurnsR . PHP_EOL);\n //fwrite($magnetCalcs, \"extraWrapsAfterFullLayersTurnsI: \" . $extraWrapsAfterFullLayersTurnsI . PHP_EOL);\n //fwrite($magnetCalcs, \"extraWrapsAfterFullLayersTurnsR: \" . $extraWrapsAfterFullLayersTurnsR . PHP_EOL);\n\n\n $springFamilyIndex = $torqueCalcs[\"springFamilyIndex\"];\n $adjustedTorque = $torqueCalcs[\"adjustedTorque\"];\n $springTurnsAvailAfterPretensionR = $torqueCalcs[\"springTurnsAvailAfterPretensionR\"];\n //fwrite($magnetCalcs, \"springFamilyIndex: \" . $springFamilyIndex . PHP_EOL);\n //fwrite($magnetCalcs, \"adjustedTorque: \" . $adjustedTorque . PHP_EOL);\n //fwrite($magnetCalcs, \"springTurnsAvailAfterPretensionR: \" . $springTurnsAvailAfterPretensionR . PHP_EOL);\n }\n else{\n //Sanning: These are specific segments of torqueCalcs that need to be set to 0 so that they are initialized\n $torqueCalcs= array(\n 'availSpringTurns' => 0,\n 'turnsMaximumCableLength' => 0,\n );\n }\n\n $cableClearanceInInchesLess1Layers = 0;\n $cableClearanceInInchesLess2Layers = 0;\n $cableClearanceInInchesLess3Layers = 0;\n $cableCapacityLostSecondClearanceWrap = 0.0;\n $cableCapacityLostFirstClearanceWrap = 0.0;\n $cableCapacityLostThirdClearanceWrap = 0.0;\n\n $cableClearanceInInches = (($frameSize - $drumSize) / 2.0) - ($maxUsableLayersR * $cableThick);\n //fwrite($magnetCalcs, \"cableClearanceInInches: \" . $cableClearanceInInches . PHP_EOL);\n\n $cableLayerIndexI = intval($cableLayerIndexR);\n //fwrite($magnetCalcs, \"cableLayerIndexI: \" . $cableLayerIndexI . PHP_EOL);\n\n if ($cableLayerIndexI > $maxCableLayersI) {\n goto LINE417;\n }\n\n $cableCapacityLostFirstClearanceWrap = $maxWrapsPerLayerR * ($drumSize + (2.0 * $cableLayerIndexR - 1) * $cableThick) * $pi / 12.0;\n $cableCapacityLostFirstClearanceWrap = round($cableCapacityLostFirstClearanceWrap, 5);\n\n $cableClearanceInInchesLess1Layers = (($frameSize - $drumSize) / 2.0) - (($maxUsableLayersR + 1) * $cableThick);\n $cableClearanceInInchesLess1Layers = round($cableClearanceInInchesLess1Layers, 5);\n\n //fwrite($magnetCalcs, \"cableCapacityLostFirstClearanceWrap: \" . $cableCapacityLostFirstClearanceWrap . PHP_EOL);\n //fwrite($magnetCalcs, \"cableClearanceInInchesLess1Layers: \" . $cableClearanceInInchesLess1Layers . PHP_EOL);\n\n $cableLayerIndexR = $cableLayerIndexR + 1.0;\n $cableLayerIndexI = intval($cableLayerIndexR);\n //fwrite($magnetCalcs, \"cableLayerIndexR: \" . $cableLayerIndexR . PHP_EOL);\n //fwrite($magnetCalcs, \"cableLayerIndexI: \" . $cableLayerIndexI . PHP_EOL);\n\n if ($cableLayerIndexI > $maxCableLayersI) {\n goto LINE417;\n }\n\n $cableCapacityLostSecondClearanceWrap = $maxWrapsPerLayerR * ($drumSize + (2.0 * $cableLayerIndexR - 1.0) * $cableThick) * $pi / 12.0;\n //fwrite($magnetCalcs, \"cableCapacityLostSecondClearanceWrap: \" . $cableCapacityLostSecondClearanceWrap . PHP_EOL);\n\n $cableClearanceInInchesLess2Layers = (($frameSize - $drumSize) / 2.0) - (($maxUsableLayersR + 2) * $cableThick);\n //fwrite($magnetCalcs, \"cableClearanceInInchesLess2Layers: \" . $cableClearanceInInchesLess2Layers . PHP_EOL);\n\n $cableLayerIndexR = $cableLayerIndexR + 1.0;\n $cableLayerIndexI = intval($cableLayerIndexR);\n //fwrite($magnetCalcs, \"cableLayerIndexR: \" . $cableLayerIndexR . PHP_EOL);\n //fwrite($magnetCalcs, \"cableLayerIndexI: \" . $cableLayerIndexI . PHP_EOL);\n\n if ($cableLayerIndexI > $maxCableLayersI) {\n goto LINE417;\n }\n\n $cableCapacityLostThirdClearanceWrap = $maxWrapsPerLayerR * ($drumSize + (2.0 * $cableLayerIndexR - 1.0) * $cableThick) * $pi / 12.0;\n //fwrite($magnetCalcs, \"cableCapacityLostThirdClearanceWrap: \" . $cableCapacityLostThirdClearanceWrap . PHP_EOL);\n\n $cableClearanceInInchesLess3Layers = (($frameSize - $drumSize) / 2.0) - (($maxUsableLayersR + 3) * $cableThick);\n //fwrite($magnetCalcs, \"cableClearanceInInchesLess3Layers: \" . $cableClearanceInInchesLess3Layers . PHP_EOL);\n\n LINE417:\n $compartmentMaximumCableLength = $compartmentCableCapacity + $cableCapacityLostFirstClearanceWrap + $cableCapacityLostSecondClearanceWrap + $cableCapacityLostThirdClearanceWrap;\n $compartmentMaximumCableLength = round($compartmentMaximumCableLength, 5);\n //fwrite($magnetCalcs, \"compartmentMaximumCableLength: \" . $compartmentMaximumCableLength . PHP_EOL);\n\n\n $collectorAmp = $collector['collectorAmp'];\n //fwrite($magnetCalcs, \"collectorAmp: \" . $collectorAmp . PHP_EOL);\n\n $numCollectorConductors = $collector['numCollectorConductors'];\n //fwrite($magnetCalcs, \"numCollectorConductors: \" . $numCollectorConductors . PHP_EOL);\n\n if ($srchStyle != 'P') {\n\n switch ($cableOrHose) {\n case \"HD\":\n case \"HS\":\n switch ($srchStyle) {\n case \"K\":\n $torqueToOvercomeCollectorFriction = 1;\n break;\n case \"U\":\n case \"HM\":\n switch ($cable[\"hoseIDCode\"]) {\n case \"4\":\n $torqueToOvercomeCollectorFriction = 2.5 / 12;\n break;\n case \"6\":\n $torqueToOvercomeCollectorFriction = 5 / 12;\n break;\n case \"8\":\n $torqueToOvercomeCollectorFriction = 7.5 / 12;\n break;\n case \"12\":\n $torqueToOvercomeCollectorFriction = 12.5 / 12;\n break;\n case \"16\":\n $torqueToOvercomeCollectorFriction = 20 / 12;\n break;\n case \"20\":\n $torqueToOvercomeCollectorFriction = 50 / 12;\n break;\n case \"24\":\n $torqueToOvercomeCollectorFriction = 56 / 12;\n break;\n }\n //fwrite($magnetCalcs, \"torqueToOvercomeCollectorFriction: \" . $torqueToOvercomeCollectorFriction . PHP_EOL);\n break;\n }\n break;\n default:\n switch ($collectorAmp) {\n case 35:\n $torqueToOvercomeCollectorFriction = 0.5 + 0.2 * $numCollectorConductors + $grndchkQty;\n break;\n case 75:\n $torqueToOvercomeCollectorFriction = 0.5 + 0.4 * $numCollectorConductors + ($grndchkQty * 0.7);\n break;\n case 125:\n switch ($srchStyle) {\n case \"U\":\n $torqueToOvercomeCollectorFriction = 0.5 + 1.2 * $numCollectorConductors + ($grndchkQty * 0.7);\n break;\n default:\n $torqueToOvercomeCollectorFriction = 0.5 + 1.2 * $numCollectorConductors + ($grndchkQty * 0.7);\n\n break;\n }\n //fwrite($magnetCalcs, \"torqueToOvercomeCollectorFriction: \" . $torqueToOvercomeCollectorFriction . PHP_EOL);\n break;\n case 200:\n $torqueToOvercomeCollectorFriction = 0.5 + 1.2 * $numCollectorConductors + ($grndchkQty * 0.7);\n //fwrite($magnetCalcs, \"torqueToOvercomeCollectorFriction: \" . $torqueToOvercomeCollectorFriction . PHP_EOL);\n break;\n case 400:\n $torqueToOvercomeCollectorFriction = 0.5 + 2.0 * $numCollectorConductors + ($grndchkQty * 0.7);\n //fwrite($magnetCalcs, \"torqueToOvercomeCollectorFriction: \" . $torqueToOvercomeCollectorFriction . PHP_EOL);\n break;\n }\n }\n\n //Sanning: These only run correctly in case 'K' so far, as otherwise adjustedTorque, springFamilyIndex, and wrapperWidhR are all 0\n $reelInertiaCalcs = $this->calcInertia($srchStyle, $frameSize, $drumSize, $adjustedTorque, $springFamilyIndex, $wrapperWidthR, $srchSpoolMethod, $cable);\n $reelInertia = $reelInertiaCalcs['reelInertia'];\n //fwrite($magnetCalcs, \"reelInertiaCalcs: \" . $reelInertiaCalcs . PHP_EOL);\n //fwrite($magnetCalcs, \"reelInertia: \" . $reelInertia . PHP_EOL);\n\n // switch ($srchStyle) { //todo:figure out why this is here... it shouldnt matter. see line 2930 of ReelMod.bas\n // }\n //line 2930 ReelMod.Bas\n //Adjusted torque is never used in the calcInertia function, so I will set it to a default value for TMR searches for now\n\n switch ($srchStyle) {\n case \"S\":\n case \"MMD\":\n case \"SM\":\n case 'SHO':\n case 'U':\n case 'K':\n //$spoolWidthCode = 0;\n if ($cableThick <= 0.5) {\n $torqueSafetyFactor = 1.2;\n } else {\n if ($cableThick <= 0.75) {\n if ($drumSize <= 9.0) {\n $torqueSafetyFactor = 1.3;\n }\n if ($drumSize > 9.0) {\n $torqueSafetyFactor = 1.2;\n }\n\n } else {\n if ($cableThick <= 1.0) {\n if ($drumSize <= 12.0) {\n $torqueSafetyFactor = 1.4;\n }\n if ($drumSize > 12.0) {\n $torqueSafetyFactor = 1.3;\n }\n\n } else {\n if ($cableThick <= 1.25) {\n if ($drumSize <= 15.0) {\n $torqueSafetyFactor = 1.5;\n }\n if ($drumSize > 15.0) {\n $torqueSafetyFactor = 1.4;\n }\n\n } else {\n if ($cableThick <= 1.5) {\n if ($drumSize <= 18.0) {\n $torqueSafetyFactor = 1.6;\n }\n if ($drumSize > 18.0) {\n $torqueSafetyFactor = 1.5;\n }\n\n } else {\n if ($drumSize <= 21.0) {\n $torqueSafetyFactor = 1.7;\n }\n if ($drumSize > 21.0) {\n $torqueSafetyFactor = 1.6;\n }\n\n }\n }\n }\n }\n }\n break;\n\n case \"TMR\":\n $torqueSafetyFactor = 1.25;\n break;\n }\n //fwrite($magnetCalcs, \"torqueSafetyFactor: \" . $torqueSafetyFactor . PHP_EOL);\n }\n $this->firstLayerMomentArm = ($drumSize + $cableThick) / (2.0 * 12.0);\n //fwrite($magnetCalcs, \"this->firstLayerMomentArm: \" . $this->firstLayerMomentArm . PHP_EOL);\n //fwrite($magnetCalcs, \"=============================================================================================\" . PHP_EOL);\n\n $validTurns = true;\n //fclose($magnetCalcs);\n //initialCalcs Assigned here CAI\n\n $initialCalcs = array(\n \"wrapperWidthR\" => $wrapperWidthR,\n \"compartmentHeight\" => $compartmentHeight,\n \"cableClearanceFactor\" => $this->cableClearanceFactor,\n \"compartmentMaximumCableLength\" => $compartmentMaximumCableLength,\n \"cableCapacityLostFirstClearanceWrap\" => $cableCapacityLostFirstClearanceWrap,\n \"cableCapacityLostSecondClearanceWrap\" => $cableCapacityLostSecondClearanceWrap,\n \"cableCapacityLostThirdClearanceWrap\" => $cableCapacityLostThirdClearanceWrap,\n \"compartmentCableCapacity\" => $compartmentCableCapacity,\n \"cableClearanceInInchesLess1Layers\" => $cableClearanceInInchesLess1Layers,\n \"cableClearanceInInchesLess2Layers\" => $cableClearanceInInchesLess2Layers,\n \"cableClearanceInInchesLess3Layers\" => $cableClearanceInInchesLess3Layers,\n \"cableClearanceInInches\" => $cableClearanceInInches,\n \"firstLayerMomentArm\" => $this->firstLayerMomentArm,\n \"reelInertia\" => $reelInertia,\n \"torqueToOvercomeCollectorFriction\" => $torqueToOvercomeCollectorFriction,\n \"adjustedTorque\" => $adjustedTorque,\n \"deadWrapLength\" => $deadWrapLength,\n \"maxWrapsPerLayerRStored\" => $maxWrapsPerLayerRStored,\n \"maxWrapsPerLayerR\" => $maxWrapsPerLayerR,\n \"maxWrapsPerLayerI\" => $maxWrapsPerLayerI,\n \"springTurnsAvailAfterPretensionR\" => $springTurnsAvailAfterPretensionR,\n \"maxUsableWrapsR\" => $maxUsableWrapsR,\n \"compartmentActiveCableLength\" => $compartmentActiveCableLength,\n \"maxUsableLayersR\" => $maxUsableLayersR,\n \"maxUsableLayersI\" => $maxUsableLayersI,\n \"maxCableLayersR\" => $maxCableLayersR,\n \"AdjSlopeFirstPartOfCurve\" => $AdjSlopeFirstPartOfCurve,\n \"AdjyInterceptFirstPartOfCurve\" => $AdjyInterceptFirstPartOfCurve,\n \"AdjMaxTurnsForFirstPartOfCurve\" => $AdjMaxTurnsForFirstPartOfCurve,\n \"torqueSafetyFactor\" => $torqueSafetyFactor,\n \"AdjSlopeSecondPartOfCurve\" => $AdjSlopeSecondPartOfCurve,\n \"AdjyInterceptSecondPartOfCurve\" => $AdjyInterceptSecondPartOfCurve,\n \"AdjMaxTurnsForSecondPartOfCurve\" => $AdjMaxTurnsForSecondPartOfCurve,\n \"turnsActiveCableLength\" => $turnsActiveCableLength,\n \"maxFullLayersFromTurnsR\" => $maxFullLayersFromTurnsR,\n \"extraWrapsAfterFullLayersTurnsR\" => $extraWrapsAfterFullLayersTurnsR,\n \"extraWrapsAfterFullLayersTurnsI\" => $extraWrapsAfterFullLayersTurnsI,\n \"availSpringTurns\" => $torqueCalcs['availSpringTurns'],\n \"turnsMaximumCableLength\" => $torqueCalcs['turnsMaximumCableLength'],\n \"validTurns\" => $validTurns,\n \"validCompartment\" => $validCompartment,\n \"AdjMaxTurnsForThirdPartOfCurve\" => $AdjMaxTurnsForThirdPartOfCurve,\n \"AdjyInterceptThirdPartOfCurve\" => $AdjyInterceptThirdPartOfCurve,\n \"AdjSlopeThirdPartOfCurve\" => $AdjSlopeThirdPartOfCurve,\n \"TWLC\" => $reelInertiaCalcs['totalWeightLessCable'],\n \"SWC\" => $spoolWidthCode,\n \"invalidReason\" => 0,\n \"hosewgtboth\" => $hoseWgtboth,\n \"rmoti\" => $this->rmoti,\n \"tqsiz\" => $this->tqsiz,\n \"torqueFromMotor\" => $this->torqueFromMotor,\n \"reelWidthInp\" => $reelWidthInp\n );\n //dump($initialCalcs);\n //Debugbar::info(\"Ran through initialCalcs\");\n return $initialCalcs;\n }", "public function afferentCoupling()\n {\n return $this->ca;\n }", "public function getCost() {\n\t\t$cost = $this->drink->getCost();\n\t\t/** @var $addition Addition */\n\t\tforeach ($this->additions as $addition) {\n\t\t\t$cost += $addition->getCost();\n\t\t}\n\t\treturn $cost;\n\t}", "public function organicCost() {\n\t\treturn $this->get(Constants::OC);\n\t}", "public function getCost();", "function lcs()\n\t{\n\t\t$lcs = 0;\n\n\t\tfor ($i = 0, $size = count($this->_edits); $i < $size; $i++)\n\t\t{\n\t\t\t$edit = $this->_edits[$i];\n\n\t\t\tif (is_a($edit, 'diff_op_copy'))\n\t\t\t{\n\t\t\t\t$lcs += count($edit->orig);\n\t\t\t}\n\t\t}\n\t\treturn $lcs;\n\t}", "public function getCostTracker(){\r\n\t\t\r\n\t}", "public function getBaseCalculoICMSST()\n {\n return $this->baseCalculoICMS_ST;\n }", "public function collectRates(Mage_Shipping_Model_Rate_Request $request)\n\t{\n\t\tif(!Mage::getStoreConfig('carriers/'.$this->_code.'/active'))\n\t\t\treturn false;\n$config = Mage::getStoreConfig('carriers/'.$this->_code);\n\n$session = Mage::getSingleton('checkout/session');\n$sum = 0;\n\nforeach ($session->getQuote()->getAllVisibleItems() as $item) {\n $sum += $item->getQty()*$item->getWeight();\n}\nif(($sum>20)&&($sum<25)) {\n $session = Mage::getSingleton('core/session');\n $session_geo_ip = $session->getGeoIp();\n if(isset($session_geo_ip['code'])) { \n $ship_data = Mage::getModel('freaks_quotes/quote')->loadByName($session_geo_ip['code']);\n if(!isset($ship_data['name'])||($ship_data['dscr']=='')) {return false;} else { \n if($ship_data['name']=='2137') {\n $cost = $config['moscow_ship'];\n } else {\n if($ship_data['name']=='2344') {\n $cost = $config['piter_ship'];\n } else {\n $km = $ship_data['dscr'];\n if($km<5) {\n $cost = $config['mkad_shipdo5'];\n } else {\n if(($km>=5)&&($km<10)) {\n $cost = $config['mkad_shipdo10'];\n } else {\n $cost = $ship_data['dscr']*$config['mkad_shipb10'];\n }\n }\n }\n }\n \n \n\n\n\n\n\n \t/*$diap = array('20','15','10','5','3','1');\n \t$costs = explode(';', $ship_data['costs']);\n \t$costs = array_reverse($costs);\n \t$count = 0; \n \tforeach($diap as $value) {\n \t if($sum<(int)$value) {\n \t $cost_cour = $ship_data['km'.$value]; //Курьерская стоимость\n \t $cost_sam = $costs[$count]; //Стоимость самовывоза\n \t\t }\n \t $count++;\n }\n $diap_km=array('50'=>'500','45'=>'450','40'=>'400','35'=>'350','30'=>'300','25'=>'250','20'=>'200','15'=>'150','10'=>'100','5'=>'50');\n if($ship_data['dscr']!='') {\n foreach($diap_km as $km=>$cost) {\n if($ship_data['dscr']<=$km) $cost_dop_km = $cost;\n }\n } else {\n $cost_dop_km = 0;\n }*/\n\t\t $result = Mage::getModel('shipping/rate_result');\n\t\t $method = Mage::getModel('shipping/rate_result_method');\n//Стоимость курьера\n\t\t $method->setCarrier($this->_code);\n\t\t $method->setCarrierTitle('Доставка службой Курьер.ру');\n\t\t $method->setMethod('pickup1');\n\t\t $method->setMethodTitle('Курьер');\n $method->setCost($cost);\n\t\t $method->setPrice($cost); \t\n\t\t $result->append($method);\n//Стоимость самовывоза\n $method = Mage::getModel('shipping/rate_result_method');\n\t\t $method->setCarrier($this->_code);\n\t\t $method->setCarrierTitle('Самовывоз в пункте Курьер.ру г.Москва');\n\t\t $method->setMethod('pickup2');\n\t\t $method->setMethodTitle('Самовывоз в пункте Курьер.ру г.Москва');\n $method->setCost($config['ship_sam']);\n\t\t $method->setPrice($config['ship_sam']); \t\n\t\t $result->append($method);\n\n $addresses = explode(';', $ship_data['addressess']);\n $count = 1;\n /* foreach($addresses as $address) {\n\t\t $method = Mage::getModel('shipping/rate_result_method');\n $method->setCarrier($this->_code);\n\t\t $method->setCarrierTitle('Курьер Доставка');\n\t\t $method->setMethod('pickup'.$count);\n\t\t $method->setMethodTitle($address);\n $method->setCost($cost_sam);\n\t\t $method->setPrice($cost_sam); \t\n\t\t $result->append($method);\n $count++;\n }*/\n }} else {\n return false;\n }\n return $result; \n} else {\nreturn false;\n}\n\t }", "private static function stcMethod() {\n }", "protected function giveCost()\n\t{\n\t\t$solarSavings=2;\n\t\t$this->valueNow=210.54/$solarSavings;\n\t\t\n\t\treturn $this->valueNow;\n\t}", "public function &getCircuit();", "protected function getBestDiscount() {\n\t\tif($this->bestDiscountCached)\n\t\t{\n\t\t\t// Return the cached discount\n\t\t\treturn $this->bestDiscount;\n\t\t}\n\t\t\n\t\t// No cached discount, so let's search for one\n\t\t$fieldName = $this->owner->ClassName.\"ID\";\n\t\t$singleton = DataObject::get_one(\"ComplexPriceObject\");\n\t\tif($singleton) {\n\t\t\tif(!$singleton->hasField($fieldName)) {\n\t\t\t\t$ancestorArray = ClassInfo::ancestry($this->owner, true );\n\t\t\t\tforeach($ancestorArray as $ancestor) {\n\t\t\t\t\t$fieldName = $ancestor.\"ID\";\n\t\t\t\t\tif($singleton->hasField($fieldName)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$prices = DataObject::get(\"ComplexPriceObject\", \"\\\"$fieldName\\\" = '\".$this->owner->ID.\"' AND \\\"NoLongerValid\\\" = 0\", \"\\\"NewPrice\\\" DESC\");\n\t\t\t$memberGroupsArray = array();\n\t\t\tif($prices) {\n\t\t\t\tif($member = Member::currentMember()) {\n\t\t\t\t\tif($memberGroupComponents = $member->getManyManyComponents('Groups')) {\n\t\t\t\t\t\tif($memberGroupComponents && $memberGroupComponents->count()) {\n\t\t\t\t\t\t\t$memberGroupsArray = $memberGroupComponents->column(\"ID\");\n\t\t\t\t\t\t\tif(!is_array($memberGroupsArray)) {\n\t\t\t\t\t\t\t\t$memberGroupsArray = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$countryID = EcommerceCountry::get_country_id();\n\t\t\t\tforeach($prices as $price) {\n\t\t\t\t\t$priceCanBeUsed = true;\n\t\t\t\t\t$priceGroupComponents = $price->getManyManyComponents('Groups');\n\t\t\t\t\tif($priceGroupComponents && $priceGroupComponents->count()) {\n\t\t\t\t\t\t$priceCanBeUsed = false;\n\t\t\t\t\t\t//print_r($price->Groups());\n\t\t\t\t\t\t$priceGroupArray = $priceGroupComponents->column(\"ID\");\n\t\t\t\t\t\tif(!is_array($priceGroupArray)) {$priceGroupArray = array();}\n\t\t\t\t\t\t$interSectionArray = array_intersect($priceGroupArray, $memberGroupsArray);\n\t\t\t\t\t\tif(is_array($interSectionArray) && count($interSectionArray)) {\n\t\t\t\t\t\t\t$priceCanBeUsed = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($priceCanBeUsed) {\n\t\t\t\t\t\tif($priceCountryComponents = $price->getManyManyComponents('EcommerceCountries')) {\n\t\t\t\t\t\t\tif($priceCountryComponents && $priceCountryComponents->count()) {\n\t\t\t\t\t\t\t\t$priceCanBeUsed = false;\n\t\t\t\t\t\t\t\t$priceCountryArray = $priceCountryComponents->column(\"ID\");\n\t\t\t\t\t\t\t\tif(!is_array($priceCountryArray)) {$priceCountryArray = array();}\n\t\t\t\t\t\t\t\tif($countryID && in_array($countryID, $priceCountryArray)) {\n\t\t\t\t\t\t\t\t\t$priceCanBeUsed = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($priceCanBeUsed) {\n\t\t\t\t\t\t$nowTS = strtotime(\"now\");\n\t\t\t\t\t\tif($price->From) {\n\t\t\t\t\t\t\t$priceCanBeUsed = false;\n\t\t\t\t\t\t\t$fromTS = strtotime($price->From);\n\t\t\t\t\t\t\tif($fromTS && $fromTS < $nowTS) {\n\t\t\t\t\t\t\t\t$priceCanBeUsed = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($priceCanBeUsed) {\n\t\t\t\t\t\tif($price->Until) {\n\t\t\t\t\t\t\t$priceCanBeUsed = false;\n\t\t\t\t\t\t\t$untilTS = strtotime($price->Until);\n\t\t\t\t\t\t\tif($untilTS && $untilTS > $nowTS) {\n\t\t\t\t\t\t\t\t$priceCanBeUsed = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($priceCanBeUsed) {\n\t\t\t\t\t\t$this->bestDiscount = $price;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->bestDiscountCached = true;\n\t\t\n\t\treturn $this->bestDiscount;\n\t}", "public function getCostOfGoodsSold(){\n $costOfGoodsSold = 0;\n foreach($this->jobLines as $line){\n $costOfGoodsSold += $line->product->COST * $line->garmentCount;\n }\n return $costOfGoodsSold; \n \t}", "public function lcs($key1, $key2, $options = null) {}", "private function cca($parents1, $parents2)\n {\n /**\n * To reduce computation time the reversed check of common ancestry\n */\n if (count($parents1) > count($parents2)) {\n $temp = $parents2;\n $parents2 = $parents1;\n\n $parents1 = $temp;\n }\n\n // in case of none of the nodes had any common ancestor\n $cca = \"no lca\";\n\n /**\n * checking from the last indexes\n * to reduce computational steps\n */\n for ($i = (count($parents1) - 1), $j = count($parents2) - 1; $i <= $j; $i--, $j--) {\n /**\n * if the smallest string of ancestry\n * finds itself as closest common ancestor\n */\n if ($i == 0 && $parents1[$i] == $parents2[$j]) return $parents1[$i];\n\n //find the node breaking the line of ancestry\n if ($parents1[$i] != $parents2[$j]) break;\n\n\n $cca = $parents1[$i];\n }\n\n return $cca;\n }" ]
[ "0.53735703", "0.5239012", "0.5117799", "0.50315714", "0.49595115", "0.4898863", "0.4862141", "0.48170143", "0.4802701", "0.47910735", "0.47897077", "0.478513", "0.47632796", "0.47294033", "0.47195634", "0.46899298", "0.46828035", "0.46787614", "0.46699107", "0.4668044", "0.46599403", "0.46398488", "0.46197253", "0.46012324", "0.45907393", "0.45855924", "0.4585159", "0.45839077", "0.456882", "0.45662993" ]
0.58284724
0
Returns ID (teamId) of side
public function getId() { return self::TEAM_SIDE_BLUE_ID; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getId()\n {\n return self::TEAM_SIDE_PURPLE_ID;\n }", "public function get_team_id()\n {\n return $this->team_id;\n }", "public function getTeamId()\n {\n return $this->team_id;\n }", "public function getTeamId()\n {\n return $this->teamId;\n }", "public function getTeamID()\n {\n return $this->teamID;\n }", "public function getId()\n {\n return TeamId::fromString($this->id);\n }", "public function getTeam() {\n return $this->teamId;\n }", "public function getGameId() {\n }", "function getId() {\r\n return $this->playerId;\r\n }", "public function getPlayerStatisticTeamId() {\n\t\treturn ($this->playerStatisticTeamId);\n\t}", "public function getLeagueId()\n {\n return $this->league_id;\n }", "public function getLeagueId()\n {\n $value = $this->get(self::LEAGUE_ID);\n return $value === null ? (integer)$value : $value;\n }", "public function getTournamentId()\n {\n return $this->tournamentId;\n }", "public function getIdTeamAway()\n {\n return $this->id_team_away;\n }", "public function getId()\n {\n return $this->member_id;\n }", "public function getGameid()\n {\n return $this->gameid;\n }", "public static function getBotId();", "public function getIdTurno()\n\t{\n\t\treturn $this->id_turno;\n\t}", "public function getSteamId(){\n return $this->SteamID;\n }", "public function getIdTeamHome()\n {\n return $this->id_team_home;\n }", "function id()\n {\n if ( $this->IsCoherent == 0 )\n $this->get();\n return $this->id();\n }", "public function getTournamentId() {\n if (is_null($this->tournamentId)) {\n if ( !$cache = cache_get('getTournamentId_' . $this->getMatchId(), 'cache_tourney')) {\n $query = tourney_relation_query('tourney_match', $this->getMatchId());\n $query->entityCondition('bundle', 'has_match');\n $results = $query->execute();\n\n if (!empty($results)) {\n $relation = array_pop($results);\n $r = relation_load($relation->rid);\n $this->tournamentId = $r->endpoints[LANGUAGE_NONE][0]['entity_id'];\n }\n\n if (isset($this->tournamentId)) {\n cache_set('getTournamentId_' . $this->getMatchId(), $this->tournamentId, 'cache_tourney');\n }\n }\n else {\n $this->tournamentId = $cache->data;\n }\n }\n return $this->tournamentId;\n }", "public function get_id(){ return intval($this->get_info('robot_id')); }", "public function getMealTeamId() {\n return $this->meal_team_id;\n }", "function aux_teamIDfromTeamName ($teamName) {\n return pathinfo(aux_searchAmongTeams(\"teamName\", $teamName), PATHINFO_FILENAME);\n}", "public function getMatchId() {\n if (!property_exists($this, 'id') || is_null($this->id)) {\n return NULL;\n }\n if (is_null($this->matchId)) {\n if ( !$cache = cache_get('getMatchId_' . $this->id, 'cache_tourney')) {\n $query = tourney_relation_query('tourney_game', $this->id);\n $query->entityCondition('bundle', 'has_game');\n $results = $query->execute();\n\n if (!empty($results)) {\n $relation = array_pop($results);\n $r = relation_load($relation->rid);\n $this->matchId = $r->endpoints[LANGUAGE_NONE][0]['entity_id'];\n }\n\n if (isset($this->matchId)) {\n cache_set('getMatchId_' . $this->id, $this->matchId, 'cache_tourney');\n }\n }\n else {\n $this->matchId = $cache->data;\n }\n }\n return $this->matchId;\n }", "public function getPlayerStatisticGameId() {\n\t\treturn ($this->playerStatisticGameId);\n\t}", "public function getMemberId()\n {\n return Hash::get($this->data, 'web_id');\n }", "public function getTeam()\n {\n return $this->team;\n }", "public function getID();" ]
[ "0.7355382", "0.73120064", "0.7228656", "0.7150023", "0.7139801", "0.6935692", "0.6693822", "0.653501", "0.6428786", "0.63494384", "0.63083565", "0.619754", "0.612544", "0.60868603", "0.6064399", "0.6033342", "0.59988236", "0.5942623", "0.58825785", "0.587592", "0.5866111", "0.5855524", "0.58442664", "0.5826737", "0.58214873", "0.5770642", "0.5732735", "0.57021964", "0.5683378", "0.56759214" ]
0.75520074
0
Override constructor to make rule skippable
public function __construct() { parent::__construct(); $this->setSkippable(TRUE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct(){\r\n\t\t\t\r\n\t\t\tforeach (func_get_args() as $oRule){\r\n\t\t\t\t\r\n\t\t\t\t$this->addRule($oRule);\r\n\t\t\t\t\r\n\t\t\t} // foreach\r\n\t\t\t\r\n\t\t}", "public function __construct()\n\t{\n\t\tparent::__construct('must_not_be_null');\n\t}", "public function __construct($ignore = null)\n {\n $this->ignore = $ignore;\n }", "public function __construct($rules = array()) {\n\t\tparent::__construct($rules);\n\t}", "private function __construct() { \n\t\t\t// Do nothing here\n\t\t}", "protected function _construct()\n {\n parent::_construct();\n $this->_init('hipay/rule');\n $this->setIdFieldName('rule_id');\n }", "protected function _construct()\n {\n $this->_init('onsale/rule', 'rule_id');\n }", "protected function _construct()\n {\n parent::_construct();\n $this->_init('Temando\\Temando\\Model\\ResourceModel\\Rule');\n $this->setIdFieldName('rule_id');\n }", "public function __construct()\n\t{\n\t\t$namechars = '[- \\\\w]+';\n\t\t$double = '\"' . $namechars . '\"';\n\t\t$single = \"'\" . $namechars . \"'\";\n\t\t$name = '(?:' . $single . '|' . $double . '|' . $namechars . ')';\n\t\t$regexp = '/^' . $name . '(?:, *' . $name . ')*$/';\n\n\t\tparent::__construct($regexp);\n\t\t$this->markAsSafeInCSS();\n\t}", "public function init()\n {\n $this->skipOnEmpty = false;\n parent::init();\n }", "protected abstract function __construct();", "public function __construct()\n {\n parent::__construct();\n\n $this->ignoreValidationErrors();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->ignoreValidationErrors();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->ignoreValidationErrors();\n }", "abstract protected function __construct();", "abstract protected function __construct();", "function __construct() {\n\n\t\t\t/* do nothing */\n\n\t\t}", "public function skip_validation()\n {\n $this->_skip_validation = TRUE;\n\n return $this;\n }", "public function __construct()\n {\n if (1 == func_num_args()) {\n $this->trips = func_get_arg(0);\n }\n }", "public function skip_validation()\n {\n $this->skip_validation = TRUE;\n return $this;\n }", "public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.security.detectionRule');\n }", "public function __construct(protected CartRule $cartRuleHepler)\n {\n }", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}" ]
[ "0.6545969", "0.64013636", "0.62239915", "0.6180613", "0.6167869", "0.61553776", "0.61167705", "0.60766786", "0.60682166", "0.6035449", "0.60316813", "0.6019212", "0.6019212", "0.6019212", "0.6002997", "0.6002997", "0.59785575", "0.59713924", "0.5942314", "0.59281015", "0.59062773", "0.586379", "0.58616716", "0.58616716", "0.58616716", "0.58616716", "0.58616716", "0.58616716", "0.58616716", "0.58616716" ]
0.74549335
0
Determine if the current data comprises a duplicate lead based on the provided data.
protected function isDuplicateLead(Blackbox_Data $data, $property_short) { $duplicate = FALSE; // The items to check are saved in the rule value foreach ($this->getDataKeys() as $check) { $value = $data->{$check}; // If the check element exists in blackbox data, check memcache if (!empty($value)) { $key = $this->getMemcacheKey($property_short, $check, $value); if ($this->getMemcache()->get($key) !== FALSE) { $duplicate = TRUE; break; } } } return $duplicate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkDupliatedCondition($data) {\r\n\t\treturn true;\r\n\t}", "public function isDuplicate() {\r\n\t\treturn (1046 === $this->errorNumber);\r\n\t}", "public function prevent_duplicate( $data ) {\r\n\t\tif ( ! empty( $data['post_meta']['va_id'] ) ) {\r\n\t\t\tif ( va_get_listing_by_ref( $data['post_meta']['va_id'] ) ) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $data;\r\n\t}", "function is_duplicate($event1, $event2) {\n return ($event1['StartTime'] == $event2['StartTime']\n and $event1['EndTime'] == $event2['EndTime']);\n }", "public function isDuplicate(): bool\n {\n return ($this->packetFlags & 8) === 8;\n }", "public function isDuplicateEntry() {\n return $this->getCode() == self::MYSQL_ERROR_DUP_ENTRY;\n }", "public function CheckDuplicate(){\n $pass = true;\n foreach($this->projects as $project=>$data){\n if($data['name']==$this->name || $data['path']==$this->path){\n $pass = false;\n }\n }\n return $pass;\n }", "function is_duplicate($link_url){\r\n\t\t\t\t\r\n\t\t\t\t$query = \"SELECT post_id from {$this->wp_prefix}postmeta where meta_value='$link_url' \";\r\n\t\t\t\t$pres = $this->db->get_results ( $query );\r\n\t\t\t\t\r\n\t\t\t\t//double check again\r\n\t\t\t\tif(count ( $pres ) == 0 ){\r\n\t\t\t\t\t$pres = $this->db->get_results ( $query );\r\n\t\t\t\t}\r\n\t\t\t\t \r\n\t\t\r\n\t\t\t\t$duplicate=false;\r\n\t\t\t\tif(count ( $pres ) == 0 ){\r\n\t\t\t\t\t$duplicate = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t\r\n\t\t\t\t\t$duplicate = true;\r\n\t\t\t\t\t\r\n\t\t \r\n\t\t\t\t\tforeach($pres as $prow){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$ppid=$prow->post_id;\r\n\t\t\t\t\t\t$this->duplicate_id = $ppid;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$pstatus = get_post_status($ppid);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($pstatus != 'trash') {\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} \r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\treturn $duplicate;\r\n\t\t\t\t\r\n\t\t\t}", "protected function validateDuplicates() {\n return (\n !$this->duplicatesExistForColumn($this->node->getQualifiedLeftColumnName()) &&\n !$this->duplicatesExistForColumn($this->node->getQualifiedRightColumnName())\n );\n }", "public static function IsDuplicateCheckList($caller, $dataPost) {\n $checklistDAO = new \\Applications\\PMTool\\Models\\Dao\\Task_check_list();\n $checklistDAO->setTask_check_list_detail($dataPost['checklist_detail']);\n $dal = $caller->managers()->getManagerOf(\"TaskChecklist\");\n $checklist_data = $dal->selectMany($checklistDAO, \"task_check_list_detail\");\n return (count($checklist_data) > 0)? true : false ; \n }", "private function areEquals($data)\n {\n for ($i = 1; $i < count($data); $i++) {\n if ($data[$i] == 0 || $data[$i] != $data[$i - 1]) {\n return false;\n }\n }\n\n return true;\n }", "public function isDuplicate() {\r\n\r\n $Sphinx = $this->getSphinx();\r\n\r\n /**\r\n * Look through our approved news articles for a possible duplication\r\n */\r\n\r\n $olddate = clone ( $this->date );\r\n\r\n $query = $Sphinx->select(\"*\")\r\n ->from(\"idx_news_article\")\r\n ->orderBy(\"story_time_unix\", \"DESC\")\r\n ->where(\"story_time_unix\", \">=\", $olddate->sub(new DateInterval(\"P7D\"))->getTimestamp())\r\n ->match(\"story_title\", $this->title);\r\n\r\n $matches = $query->execute();\r\n\r\n /**\r\n * Look through our rejected titles to see if we've already rejected this\r\n */\r\n\r\n $query = $Sphinx->select(\"*\")\r\n ->from(\"idx_news_articles_rejected\")\r\n ->match(\"title\", $this->title);\r\n\r\n $rejected = $query->execute();\r\n\r\n /**\r\n * If no matches are found we'll add in the article\r\n */\r\n\r\n if (count($matches) || count($rejected)) {\r\n //return true;\r\n }\r\n\r\n /**\r\n * Fall back to a database query\r\n */\r\n\r\n $olddate = clone ( $this->date );\r\n\r\n $where = array(\r\n strtolower($this->title),\r\n md5(strtolower($this->title)),\r\n $this->unique_id\r\n );\r\n\r\n $query = \"SELECT sid FROM nuke_stories WHERE (LOWER(title) = ? OR MD5(LOWER(title)) = ? OR unique_id = ?)\";\r\n\r\n /**\r\n * @blame PBR for not providing dates on their stories\r\n */\r\n\r\n if ($olddate->format(\"Y-m-d\") != (new DateTime)->format(\"Y-m-d\")) {\r\n $query .= \" AND time >= ?\";\r\n $where[] = $olddate->sub(new DateInterval(\"P90D\"))->format(\"Y-m-d H:i:s\");\r\n }\r\n\r\n if (filter_var($this->id, FILTER_VALIDATE_INT)) {\r\n $query .= \" AND sid != ?\";\r\n $where[] = $this->id;\r\n }\r\n\r\n $result = $this->db->fetchAll($query, $where);\r\n\r\n if (count($result)) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "function bbp_check_for_duplicate($post_data = array())\n{\n}", "protected function checkUnique($data) {\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select('id')\n\t\t\t->from('#__wbty_users_organizations')\n\t\t\t->where('name='.$db->quote($data['name']))\n\t\t\t->where('base_id=0')\n\t\t\t->where('id != '.(int)$data['id']);\n\n\t\t$id = $db->setQuery($query)->loadResult();\n\n\t\treturn $id ? false : true;\n\t}", "function is_duplicate(){\n\t\t$session_uuid = Session::instance()->get(\"uuid\");\n\t\t$post_uuid = Arr::get($_POST, \"uuid\");\n\t\tif ( ! isset($session_uuid))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\tif ( ! isset($post_uuid))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t//multiple submission detected!!\n\t\tif ($post_uuid !== $session_uuid)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isduplicatemore($tbname,$data) {\n $this->db2->flush_cache();\n $this->db2->from($tbname);\n $this->db2->where($data);\n $query = $this->db2->get();\n if ($query->num_rows() > 0) {\n return true;\n } else {\n return false;\n }\n }", "function checkResolvedElsewhere($base_record, $dup_record)\r\n\t{\r\n\t\t$res = 0;\r\n\t\t$base_pid = $base_record->pid;\r\n\t\t$dup_pid = $dup_record->pid;\r\n\r\n\r\n\t\t$report_dom = $this->getXML_DOM();\r\n\t\t$xpath = new DOMXPath($report_dom);\r\n\t\t$items = $xpath->query('/DuplicatesReport/duplicatesReportItem[@pid=\\''.$base_pid.'\\']'\r\n\t\t. '/duplicateItem[@pid=\\''.$dup_pid.'\\']');\r\n\t\t$item = $items->item(0);\r\n\t\t$duplicate = $item->getAttribute('duplicate');\r\n\t\t// if the item has been resolved in this report then no need to check whether it's been\r\n\t\t// resolved eleswhere.\r\n\t\tif (!empty($duplicate)) {\r\n\t\t\treturn $res;\r\n\t\t}\r\n\r\n\t\t// look for marked as non duplicate\r\n\t\t$history_res = History::searchOnPid($dup_pid, array('pre_detail' => '% Marked not duplicate of '\r\n\t\t. $base_pid));\r\n\t\tif (empty($history_res)) {\r\n\t\t\t$history_res = History::searchOnPid($dup_pid, array('pre_detail' => '% Resolved non-duplicate '\r\n\t\t\t. $base_pid));\r\n\t\t}\r\n\t\tif (!empty($history_res)) {\r\n\t\t\t$res = $this->setDuplicateXML($base_pid, $dup_pid, false);\r\n\t\t\tif ($res == 1) {\r\n\t\t\t\t$this->saveReport($this->xml_dom->saveXML());\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// look for marked as dupe\r\n\t\t\t$history_res = History::searchOnPid($dup_pid, array('pre_detail' => '% Marked Duplicate of '\r\n\t\t\t. $base_pid));\r\n\t\t\tif (empty($history_res)) {\r\n\t\t\t\t$history_res = History::searchOnPid($dup_pid, array('pre_detail' => '% Resolved duplicate '\r\n\t\t\t\t. $base_pid));\r\n\t\t\t}\r\n\t\t\tif (!empty($history_res)) {\r\n\t\t\t\t$res = $this->setDuplicateXML($base_pid, $dup_pid, true);\r\n\t\t\t\tif ($res == 1) {\r\n\t\t\t\t\t$this->saveReport($this->xml_dom->saveXML());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $res;\r\n\t}", "public function array_has_dupes($array) {\n return count($array) !== count(array_unique($array));\n }", "protected function isDuplicate($subject)\n {\n return $this->consecutive ? $subject === $this->control : in_array($subject, $this->hashTable);\n }", "private function _trackDuplicates()\n {\n foreach( $this->csvParser->data as $index => $userData )\n {\n $userName = array_key_exists( 'username' , $userData )\n ? $userData[ 'username' ]\n : self::username( $userData[ 'prenom' ] , $userData[ 'nom' ] );\n \n if( $this->database->query( \"\n SELECT\n user_id\n FROM\n `{$this->userTbl}`\n WHERE\n nom = \" . $this->database->quote( $userData[ 'nom' ] ) . \"\n AND\n prenom = \" . $this->database->quote( $userData[ 'prenom' ] )\n )->numRows() )\n {\n $this->conflict[ $index ][ 'nom' ] = $userData[ 'nom' ];\n $this->conflict[ $index ][ 'prenom' ] = $userData[ 'prenom' ];\n }\n \n if( $this->database->query( \"\n SELECT\n user_id\n FROM\n `{$this->userTbl}`\n WHERE\n username = \" . $this->database->quote( $userName )\n )->numRows() )\n {\n $this->conflict[ $index ][ 'username' ] = $userName;\n }\n \n if( $this->database->query( \"\n SELECT\n user_id\n FROM\n `{$this->userTbl}`\n WHERE\n email = \" . $this->database->quote( $userData[ 'email' ] )\n )->numRows() )\n {\n $this->conflict[ $index ][ 'email' ] = $userData[ 'email' ];\n }\n \n if( ! empty( $this->conflict[ $index ] ) )\n {\n $reportLine = $userData[ 'prenom' ] . ' ' . $userData[ 'nom' ];\n $reportLine .= ' (' . implode( ', ' , array_keys( $this->conflict[ $index ] ) ) . ')';\n $this->output[ 'conflict_found' ][] = $reportLine;\n }\n }\n }", "public function check_duplicate_time_signup($sheet, $task, $signup_date, $firstname, $lastname) {\r\n\r\n\t if( '' === $task->time_start || '' === $task->time_end ) {\r\n\t\t // don't check if the task doesn't have both start and end time\r\n\t\t return false;\r\n\t }\r\n\t // Only the time matters, so use any date to create timestamp to compare times\r\n\t $task_start = strtotime('01-01-2015 '. $task->time_start);\r\n\t $task_end = strtotime('01-01-2015 '. $task->time_end);\r\n if($task_end < $task_start) {\r\n\t $task_end = strtotime('01-02-2015 '. $task->time_end);\r\n }\r\n\r\n\t // Gets all signup data by user name for sheet and signup date\r\n $signups = $this->get_sheet_signups_by_user_name($firstname, $lastname, $sheet->id, $signup_date);\r\n\t $duplicate = false;\r\n\r\n\t foreach($signups as $signup) {\r\n\t\t if( '' === $signup->time_start || '' === $signup->time_end ) {\r\n\t\t\t // don't check if the signup doesn't have both start and end time\r\n\t\t\t continue;\r\n\t\t }\r\n\t\t if($signup->task_id == $task->id) {\r\n\t\t\t // don't check if it's the same task - we already have another allow duplicates for that\r\n\t\t\t continue;\r\n\t\t }\r\n\t\t $signup_start = strtotime('01-01-2015 '. $signup->time_start);\r\n\t\t $signup_end = strtotime('01-01-2015 '. $signup->time_end);\r\n\t\t if($signup_end < $signup_start) {\r\n\t\t\t $signup_end = strtotime('01-02-2015 '. $signup->time_end);\r\n\t\t }\r\n\t\t // check if time range overlaps\r\n\t\t if( ($task_start < $signup_end) && ($task_end > $signup_start) ) {\r\n\t\t\t // Overlap\r\n\t\t\t $duplicate = true;\r\n\t\t\t break;\r\n\t\t }\r\n\t }\r\n\r\n\t return $duplicate;\r\n }", "function CheckDuplicateWayPoints($oDB)\n{\n $startTime = microtime(true);\n $rs = $oDB->query(\"SELECT DISTINCT RideLogID FROM ride_log_map\");\n while(($record = $rs->fetch_array())!=false)\n {\n $rideLogID = $record['RideLogID'];\n $before = $oDB->DBCount(\"ride_log_map\", \"RideLogID=$rideLogID\");\n RemoveDuplicateWayPoints($oDB, $rideLogID);\n $after = $oDB->DBCount(\"ride_log_map\", \"RideLogID=$rideLogID\");\n $reduce = 100*($before-$after)/$after;\n if($reduce > 0)\n {\n trigger_error(\"NIGHTLY: Removed duplicate way points ID:$rideLogID $before->$after (\" . number_format($reduce,0) . \"%)\", E_USER_NOTICE);\n }\n }\n // reclaim unused space and defragment ride_log_map table\n $oDB->query(\"OPTIMIZE TABLE ride_log_map\");\n $elapsedTime = microtime(true) - $startTime;\n trigger_error(\"NIGHTLY: Checked for duplicate way points (\" . number_format($elapsedTime,2) . \" sec)\", E_USER_NOTICE);\n}", "private function isRecordExists($data)\n {\n $row = DB::table('holidays')\n ->where('country_code', $data['country_code'])\n ->where('name', $data['name'])\n ->where('rule', $data['rule'])\n ->get()\n ->toArray();\n return (count($row) > 0);\n }", "private function isDuplicate($property_flip_id, $contact_id)\n\t{\n\t\t$bank_contacts = DB::table('bank_property_flip')\n\t\t\t->where('contact_id', '=', $contact_id)\n\t\t\t->where('property_flip_id', '=', $property_flip_id)\n\t\t\t->select('bank_property_flip.contact_id')\n\t\t\t->get();\n\t\tif (count($bank_contacts) >= 1)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isAlreadyExist()\n {\n $currencyPair = $this->findByPairsLetters();\n\n if ($currencyPair) {\n return true;\n }\n\n return false;\n }", "function isDuplicateBooking($date, $email) {\n $query = $this->db->prepare('select count(id) from booking where schedule = ? and email = ?');\n $query->execute(array($date, $email));\n $numOfBooking = intval($query->fetchColumn());\n \n return $numOfBooking != 0;\n }", "public function diff() \n\t{\n\t\treturn ($this->data === $this->data_original) ? TRUE : FALSE;\n\t}", "function checkDuplicateFuneralHomes($funeralName, $funeralId)\r\n {\r\n $duplicates = $this->_funeralHomeDB->countDuplicateFuneralNames($funeralName, $funeralId);\r\n $hasDuplicates = $duplicates > 0;\r\n return $hasDuplicates;\r\n }", "public function uniqueMemberFieldCanBeUsed(array $data)\n {\n if ($this->loggedInMember && $this->anotherExistingMemberWithSameUniqueFieldValue($data)) {\n //there is an exception for shop admins\n //who can place an order on behalve of a customer.\n if ($this->loggedInMember->IsShopAdmin()) {\n //REMOVED PART:\n //but NOT when the member placing the Order is the ShopAdmin\n //AND there is another member with the same credentials.\n //because in that case the ShopAdmin is not placing an order\n //on behalf of someone else.\n //that is,\n //if($this->orderMember->ID == $this->loggedInMember->ID) {\n //\treturn false;\n //}\n } else {\n return false;\n }\n }\n\n return true;\n }", "public static function isDuplicate(ResourceIdentifier $a, ResourceIdentifier $b) {\n return static::compare($a, $b) === 0;\n }" ]
[ "0.685576", "0.66526353", "0.62706447", "0.6184966", "0.617442", "0.61290103", "0.60222596", "0.59370655", "0.5921628", "0.59134847", "0.59066826", "0.5897485", "0.58564633", "0.57899225", "0.57287645", "0.57236296", "0.5610543", "0.55933374", "0.55090153", "0.549818", "0.5485187", "0.5451481", "0.54467255", "0.54464203", "0.5396071", "0.5388647", "0.53775644", "0.5332589", "0.53175974", "0.5309937" ]
0.6738742
1
Get the data keys to process from the rule data
protected function getDataKeys() { $rule_value = $this->getRuleValue(); if (isset($rule_value['data_keys']) && is_array($rule_value['data_keys'])) { $keys = $rule_value['data_keys']; } else { $keys = array(); } return $keys; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getKeys(){\n\t return array_keys($this->data);\n }", "protected function fetchKeys()\n {\n return array_keys($this->_data_keys);\n }", "function GetRecordKeys() {\n\t\tglobal $EW_COMPOSITE_KEY_SEPARATOR;\n\t\t$arKeys = array();\n\t\t$arKey = array();\n\t\tif (isset($_POST[\"key_m\"])) {\n\t\t\t$arKeys = ew_StripSlashes($_POST[\"key_m\"]);\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (isset($_GET[\"key_m\"])) {\n\t\t\t$arKeys = ew_StripSlashes($_GET[\"key_m\"]);\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (isset($_GET)) {\n\t\t\t$arKeys[] = @$_GET[\"dept_id\"]; // dept_id\n\n\t\t\t//return $arKeys; // do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// check keys\n\t\t$ar = array();\n\t\tforeach ($arKeys as $key) {\n\t\t\tif (!is_numeric($key))\n\t\t\t\tcontinue;\n\t\t\t$ar[] = $key;\n\t\t}\n\t\treturn $ar;\n\t}", "public function getKeys()\n {\n return array_keys($this->data);\n }", "public function getKeys(): array\r\n {\r\n return array_keys($this->data);\r\n }", "public function getKeys()\n {\n return array_keys($this->_data);\n }", "public function getRecordKeys()\n\t{\n\t\tglobal $COMPOSITE_KEY_SEPARATOR;\n\t\t$arKeys = array();\n\t\t$arKey = array();\n\t\tif (Param(\"key_m\") !== NULL) {\n\t\t\t$arKeys = Param(\"key_m\");\n\t\t\t$cnt = count($arKeys);\n\t\t} else {\n\t\t\tif (Param(\"RTLindex\") !== NULL)\n\t\t\t\t$arKeys[] = Param(\"RTLindex\");\n\t\t\telseif (IsApi() && Key(0) !== NULL)\n\t\t\t\t$arKeys[] = Key(0);\n\t\t\telseif (IsApi() && Route(2) !== NULL)\n\t\t\t\t$arKeys[] = Route(2);\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = array();\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\tif (!is_numeric($key))\n\t\t\t\t\tcontinue;\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}", "public function getRecordKeys()\n\t{\n\t\tglobal $COMPOSITE_KEY_SEPARATOR;\n\t\t$arKeys = array();\n\t\t$arKey = array();\n\t\tif (Param(\"key_m\") !== NULL) {\n\t\t\t$arKeys = Param(\"key_m\");\n\t\t\t$cnt = count($arKeys);\n\t\t} else {\n\t\t\tif (Param(\"HOST_INDEX\") !== NULL)\n\t\t\t\t$arKeys[] = Param(\"HOST_INDEX\");\n\t\t\telseif (IsApi() && Key(0) !== NULL)\n\t\t\t\t$arKeys[] = Key(0);\n\t\t\telseif (IsApi() && Route(2) !== NULL)\n\t\t\t\t$arKeys[] = Route(2);\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = array();\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\tif (!is_numeric($key))\n\t\t\t\t\tcontinue;\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}", "public function getRecordKeys()\n\t{\n\t\t$arKeys = [];\n\t\t$arKey = [];\n\t\tif (Param(\"key_m\") !== NULL) {\n\t\t\t$arKeys = Param(\"key_m\");\n\t\t\t$cnt = count($arKeys);\n\t\t} else {\n\t\t\tif (Param(\"ValuationNo\") !== NULL)\n\t\t\t\t$arKeys[] = Param(\"ValuationNo\");\n\t\t\telseif (IsApi() && Key(0) !== NULL)\n\t\t\t\t$arKeys[] = Key(0);\n\t\t\telseif (IsApi() && Route(2) !== NULL)\n\t\t\t\t$arKeys[] = Route(2);\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = [];\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\tif (!is_numeric($key))\n\t\t\t\t\tcontinue;\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}", "function get_the_rule_keys($path) {\n\t$file = file_get_contents($path);\n\t$file = preg_replace('/\\/\\*(.*?)\\*\\//', \"\", $file);\n\t$file = str_replace(',}', \">}\", $file);\n\t$lines = explode(\",\", $file);\n\t$keys = array();\n\tfor($i = 0; $i < count($lines); $i++) {\n\t\t$val = str_replace('>}', \",}\", $lines[$i]);\n\t\t$val = trim($val);\n\t\t$val = str_replace(\"\\\"\", \"\", $val);\n\t\t$keys[$i] = $val;\n\t\t}\n\treturn $keys;\n\t}", "protected function fetchKeys()\n\t{\n\t\tif($this->keyField===false)\n\t\t\treturn array_keys($this->rawData);\n\t\t$keys=array();\n\t\tforeach($this->getData() as $i=>$data)\n\t\t\t$keys[$i]=is_object($data) ? $data->{$this->keyField} : $data[$this->keyField];\n\t\treturn $keys;\n\t}", "public function getRecordKeys()\n {\n $arKeys = [];\n $arKey = [];\n if (Param(\"key_m\") !== null) {\n $arKeys = Param(\"key_m\");\n $cnt = count($arKeys);\n } else {\n if (($keyValue = Param(\"id\") ?? Route(\"id\")) !== null) {\n $arKeys[] = $keyValue;\n } elseif (IsApi() && (($keyValue = Key(0) ?? Route(2)) !== null)) {\n $arKeys[] = $keyValue;\n } else {\n $arKeys = null; // Do not setup\n }\n\n //return $arKeys; // Do not return yet, so the values will also be checked by the following code\n }\n // Check keys\n $ar = [];\n if (is_array($arKeys)) {\n foreach ($arKeys as $key) {\n if (!is_numeric($key)) {\n continue;\n }\n $ar[] = $key;\n }\n }\n return $ar;\n }", "protected function fetchKeys()\n\t{\n\t\t$keys=array();\n\t\tforeach($this->getData() as $i=>$data)\n\t\t{\n\t\t\t$key = array_keys($data);\n\t\t\t$keys[$i]=is_array($key) ? implode(',',$key) : $key;\n\t\t}\n\t\treturn $keys;\n\t}", "public function getRecordKeys()\n\t{\n\t\t$arKeys = [];\n\t\t$arKey = [];\n\t\tif (Param(\"key_m\") !== NULL) {\n\t\t\t$arKeys = Param(\"key_m\");\n\t\t\t$cnt = count($arKeys);\n\t\t\tfor ($i = 0; $i < $cnt; $i++)\n\t\t\t\t$arKeys[$i] = explode(Config(\"COMPOSITE_KEY_SEPARATOR\"), $arKeys[$i]);\n\t\t} else {\n\t\t\tif (Param(\"id\") !== NULL)\n\t\t\t\t$arKey[] = Param(\"id\");\n\t\t\telseif (IsApi() && Key(0) !== NULL)\n\t\t\t\t$arKey[] = Key(0);\n\t\t\telseif (IsApi() && Route(2) !== NULL)\n\t\t\t\t$arKey[] = Route(2);\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\t\t\tif (Param(\"disposaldetail_id\") !== NULL)\n\t\t\t\t$arKey[] = Param(\"disposaldetail_id\");\n\t\t\telseif (IsApi() && Key(1) !== NULL)\n\t\t\t\t$arKey[] = Key(1);\n\t\t\telseif (IsApi() && Route(3) !== NULL)\n\t\t\t\t$arKey[] = Route(3);\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\t\t\tif (is_array($arKeys)) $arKeys[] = $arKey;\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = [];\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\tif (!is_array($key) || count($key) != 2)\n\t\t\t\t\tcontinue; // Just skip so other keys will still work\n\t\t\t\tif (!is_numeric($key[0])) // id\n\t\t\t\t\tcontinue;\n\t\t\t\tif (!is_numeric($key[1])) // disposaldetail_id\n\t\t\t\t\tcontinue;\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}", "public function getSourceKeys();", "public function keys(): array\n {\n return array_keys($this->data);\n }", "public function getRulesWithKey(): array\n {\n return collect($this->getFieldInstances())\n // Validation for keys of objects is done with keys that are dot\n // notated. \"parent[child]\" should be transformed to \"parent.child\"\n // in order for Laravel to be able to validate.\n ->mapWithKeys(function ($field) {\n $explodedKey = str_replace(\n ']',\n '',\n explode('[', $field->getKey()),\n );\n\n return [implode('.', $explodedKey) => $field->getRules()];\n })\n ->all();\n }", "public function getKeys();", "public function getKeys();", "public function getKeys();", "function GetRecordKeys() {\n\t\tglobal $EW_COMPOSITE_KEY_SEPARATOR;\n\t\t$arKeys = array();\n\t\t$arKey = array();\n\t\tif (isset($_POST[\"key_m\"])) {\n\t\t\t$arKeys = ew_StripSlashes($_POST[\"key_m\"]);\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (isset($_GET[\"key_m\"])) {\n\t\t\t$arKeys = ew_StripSlashes($_GET[\"key_m\"]);\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (!empty($_GET) || !empty($_POST)) {\n\t\t\t$isPost = ew_IsHttpPost();\n\t\t\tif ($isPost && isset($_POST[\"nomor\"]))\n\t\t\t\t$arKeys[] = ew_StripSlashes($_POST[\"nomor\"]);\n\t\t\telseif (isset($_GET[\"nomor\"]))\n\t\t\t\t$arKeys[] = ew_StripSlashes($_GET[\"nomor\"]);\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = array();\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\tif (!is_numeric($key))\n\t\t\t\t\tcontinue;\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}", "public function getRecordKeys()\n\t{\n\t\t$arKeys = [];\n\t\t$arKey = [];\n\t\tif (Param(\"key_m\") !== NULL) {\n\t\t\t$arKeys = Param(\"key_m\");\n\t\t\t$cnt = count($arKeys);\n\t\t} else {\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = [];\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}", "protected function underscorizeKeys($data)\n {\n $result = [];\n foreach ($data as $key => $value) {\n $result[Inflector::tableize($key)] = $value;\n }\n\n return $result;\n }", "public function getKeyData() : array\n {\n return [\n 'champion_id' => $this->championId,\n 'passive_name' => $this->passiveName,\n 'version' => $this->version,\n 'region' => $this->region\n ];\n }", "public function getData( )\n\t{\n\t\tif( $this->getTestMode( ) )\n\t\t{\n\t\t\t$this->validate( 'testKey' );\n\t\t} \n\t\telse\n\t\t{\n\t\t\t$this->validate( 'signKey' );\n\t\t}\n\n\t\t$result = [];\n\t\t$vars = array_merge( $this->httpRequest->query->all( ), $this->httpRequest->request->all( ) );\n\t\tforeach( $vars as $key => $parameter )\n\t\t{\n\t\t\tif( strpos( $key, 'ik_' ) === 0 )\n\t\t\t{\n\t\t\t\t$result[ $key ] = $parameter;\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "protected function getInputFieldNames()\n {\n return $this->rules->keys();\n }", "protected function extract_rules() {\n\t\t$rules_arr = explode(\"|\", $this->rules);\n\t\t$rules = [];\n\n\t\tforeach( $rules_arr as $rule_str ) {\n\t\t\tif( strpos( $rule_str, \":\" ) !== false ) {\n\t\t\t\t$rule_arr = explode( \":\", $rule_str );\n\t\t\t\t$rules[$rule_arr[0]] = $rule_arr[1];\n\t\t\t} else {\n\t\t\t\t$rules[$rule_str] = true;\n\t\t\t}\n\t\t}\n\t\treturn $rules;\n\t}", "protected function _getDataKey()\n {\n return $this->dataKey;\n }", "public function getKeyData() : array\n {\n return [\n 'champion_id' => $this->championId,\n 'version' => $this->version,\n 'region' => $this->region\n ];\n }", "protected function process($data) {\n $key = null;\n $result = [];\n\n foreach ($data as $row) {\n if (empty($row) || preg_match(\"/^\\s*$/u\", $row))\n continue;\n\n // alergens\n if (preg_match(\"/^\\s*(\\d+,?)+\\s*\\$/u\", $row))\n continue;\n\n // some fake character\n if (preg_match(\"/^\\s*¨+\\s*\\$/u\", $row))\n continue;\n\n // remove meal numbers\n $row = preg_replace(\"/^\\s*P\\d+(.*)/ui\", '$1', $row);\n $row = preg_replace(\"/^\\s*M\\d+(.*)/ui\", '$1', $row);\n // remove grams\n $row = preg_replace(\"/^\\s*\\d+g/ui\", '', $row);\n\n if (preg_match('/POLÉVKY/ui', $row)) {\n $key = static::KEY_SOUPS;\n continue;\n } else if (preg_match('/HLAVNÍ JÍDLA/ui', $row)) {\n $key = static::KEY_MAIN;\n continue;\n } else if (preg_match('/Salátky/ui', $row)) {\n $key = static::KEY_SALADS;\n continue;\n } else if (preg_match('/MOUČNÍK/ui', $row)) {\n $key = static::KEY_DESERTS;\n continue;\n }\n\n\n if ($key !== null) {\n $exploded = explode(\" \", trim($row));\n $result[$key][] = [\n trim(preg_replace(\"/\\d+(,-|\\s*Kč).*/ui\", '', trim($row))),\n (count($exploded) > 0 ? intval($exploded[count($exploded) - 1]) : '-')\n ];\n }\n }\n\n return $result;\n }" ]
[ "0.62630826", "0.6137296", "0.60352", "0.6026693", "0.60206187", "0.5981676", "0.5952155", "0.59436625", "0.5932553", "0.59228015", "0.5909234", "0.58620703", "0.5849701", "0.5834791", "0.5741598", "0.57243794", "0.572271", "0.57201314", "0.57201314", "0.57201314", "0.5702201", "0.5661842", "0.5659341", "0.56580055", "0.56573826", "0.56207126", "0.5594765", "0.5586243", "0.55829614", "0.55362535" ]
0.7605093
0
Get the property short from the state data. We want the property short of the level the rule is being run at so we need to check for the objects that can run rules in order of precedence to not return incorrect values
protected function getPropertyShort(Blackbox_IStateData $state_data) { if (isset($state_data->campaign_name)) { $property_short = $state_data->campaign_name; } elseif (isset($state_data->target_name)) { $property_short = $state_data->target_name; } elseif (isset($state_data->target_collection_name)) { $property_short = $state_data->target_collection_name; } else { // If we can't determine a property_short, this is exceptional behavior throw new Blackbox_Exception("Unable to determine property_short for rule"); } return $property_short; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getShortString()\n {\n $values = $this->getParsedValues();\n\n if (empty($values[0])) {\n return null;\n }\n\n $attribute = app($this->attribute);\n\n return $attribute->formatRuleString(app($this->operator), $values);\n }", "function _getshort() {\r\n\tif (empty($this->raw)) return '';\r\n\t$lo = $this->_getbyte();\r\n\t$hi = $this->_getbyte();\r\n\t$short = ($hi << 8) | $lo;\r\n\treturn $short;\r\n}", "public function getShortName()\n {\n return $this->short;\n }", "public function getShort(): string;", "public function getShortName() {\n return $this->shortName;\n }", "public function getShortCode() { return $this->shortCode; }", "public function getShortName()\n {\n return $this->shortName;\n }", "public function getShortName()\n {\n return $this->shortName;\n }", "public function getShortName()\n {\n return $this->short_name;\n }", "public function getShortName()\n {\n return $this->short_name;\n }", "public function getShort() {\n $data = unpack('v', $this->get(2));\n\n return $data[1];\n }", "public function get_post_type_short()\n {\n return self::$post_type_short;\n }", "public function getShortName()\n {\n return $this->shortName;\n }", "public function getShortInfo()\n {\n return $this->shortInfo;\n }", "protected function prepareShort()\n\t{\n\t\tif ( count( $this->shortData ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$ptr = array();\n\t\tforeach ( $this->getData() as $code => $item )\n\t\t{\n\t\t\t$short = substr( $code, 0, 2 );\n\t\t\t$arr = explode( '(', $item['name'], 2 );\n\t\t\t$item['short'] = $short;\n\t\t\t$item['name'] = trim( $arr[0] );\n\t\t\t\n\t\t\t$ptr[ $item['name'] ] = $item;\n\t\t}\n\t\tksort( $ptr );\n\t\tforeach ( $ptr as $item )\n\t\t{\n\t\t\tif ( !isset( $this->shortData[ $item['short'] ] ) )\n\t\t\t{\n\t\t\t\t$this->shortData[ $item['short'] ] = $item['name'];\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function getShortCode()\n\t{\n\t\treturn $this->getValue() . $this->getSuit();\n\t}", "public function getShortData()\n\t{\n\t\treturn $this->shortData;\n\t}", "public function getLhsProperty() {\n\t\treturn $this->lhsProperty;\n\t}", "public function getShortName()\n {\n $this->scan();\n return $this->shortName;\n }", "public function sniffProperty()\n\t{\n // Results are then used to reference keys in _properties k/v array for output\n $CI =& get_instance();\n\t\t$CI->load->helper('url');\n $vars = explode('.',base_url());\n return $vars[1];\n }", "public function getShortCode()\n {\n return $this->shortCode;\n }", "public function getTitleShort()\n {\n return $this->titleShort;\n }", "public function getShortName() {\n return isset($this->container['ShortName']) ? $this->container['ShortName'] : null;\n\t}", "public function __get($prop)\n\t{\n\t\t// echo '<pre>'.__METHOD__.'() $this->'.$prop.': '.print_r($this->$prop, true).\"</pre>\\n\";\n\t\tif(array_key_exists($prop, $this->props) && (($this->props[$prop] & 1) == 1))\n\t\t\treturn $this->$prop;\n\t}", "public function getTaShortName()\n {\n return $this->taShortName;\n }", "public function __get($prop)\n\t{\n\t\t// echo '<pre>'.__METHOD__.'() $this->'.$prop.': '.print_r($this->$prop, true).\"</pre>\\n\";\n\t\tif(array_key_exists($prop, $this->props) && (($this->props[$prop] & 1) == 1))\n\t\t\treturn $this->$prop;\n\t\telse if(parent::__get($prop));\n\t}", "public function getProperty()\n {\n return $this->readOneof(2);\n }", "function get_property()\n\t{\n\t\treturn $this->_sProperty;\n\t}", "public function getShortName(): string;", "function upfront_get_property_value ($prop, $data) {\n\t$properties = !empty($data['properties']) ? $data['properties'] : array();\n\tif (empty($properties)) return false;\n\n\t$value = false;\n\tforeach ($properties as $property) {\n\t\tif ($prop !== $property['name']) continue;\n\t\t$value = isset($property['value']) ? $property['value'] : false;\n\t\tbreak;\n\t}\n\treturn $value;\n}" ]
[ "0.5812025", "0.5645081", "0.5609071", "0.5456364", "0.5312905", "0.52439064", "0.5224939", "0.5224939", "0.5221752", "0.5221752", "0.517119", "0.5164693", "0.5145149", "0.5063687", "0.5017898", "0.49995834", "0.4989793", "0.49550843", "0.49427488", "0.49345174", "0.49154815", "0.49014717", "0.48733672", "0.48721054", "0.48599806", "0.48191613", "0.48122278", "0.48048145", "0.4797263", "0.4787425" ]
0.78481233
0
Get a Cache_Memcache object
protected function getMemcache() { return Cache_Memcache::getInstance(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function urs_data_memcache_object () {\n global $urs_content_memcache;\n\n if ( !$urs_content_memcache ) {\n $urs_content_memcache = new Memcache;\n $urs_content_memcache->connect( 'localhost', 11211 );\n }\n\n return $urs_content_memcache;\n}", "private static function getMemcachedInstance()\n {\n if (null === static::$memcached) {\n if (class_exists('Memcached')) {\n static::$memcached = new \\Memcached();\n static::$memcached->addServer(self::$host,self::$port);\n } else {\n exit(json_encode(\n array(\n 'error'=>1,\n 'errortext' => 'Missing Class Memcached, verify that package is installed on your server')\n )\n );\n }\n }\n \n return static::$memcached;\n }", "protected static function cache()\r\n\t{\r\n\t\tif (!self::$cache) {\r\n\t\t\tif (isset($GLOBALS['_CONFIG']['cache_driver'])) {\r\n\t\t\t\t$class = $GLOBALS['_CONFIG']['cache_driver'];\r\n\t\t\t\tself::$cache = $class::instance();\r\n\t\t\t} else {\r\n\t\t\t\tself::$cache = \\jmvc\\classes\\Memcache_Stub::instance();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn self::$cache;\r\n\t}", "public function instance() {\r\n\t\t\tif(self::$_instance === NULL):\r\n\t\t\t\tself::$_instance = new \\PHY\\Extended\\Memcache;\r\n\t\t\t\t$hosts = explode(';',\\PHY\\Core::config('memcache'));\r\n\t\t\t\tforeach($hosts as $host):\r\n\t\t\t\t\tif(strpos($host,':') !== false):\r\n\t\t\t\t\t\t$host = explode(':',$host);\r\n\t\t\t\t\t\tself::$_instance->connect($host[0],$host[1]);\r\n\t\t\t\t\telse:\r\n\t\t\t\t\t\tself::$_instance->connect($host,11211);\r\n\t\t\t\t\tendif;\r\n\t\t\t\tendforeach;\r\n\t\t\tendif;\r\n\t\t\treturn self::$_instance;\r\n\t\t}", "private function getMemcached()\n {\n // storage is in invalid state.\n if ($this->memcached === null) {\n $this->invalidateMemcache();\n }\n return $this->memcached;\n }", "public static function cache()\r\n {\r\n return \\Cache::getInstance();\r\n }", "public static function getInstance(){\n\t\tif(self::$cacheObj == null){\n\t\t\tself::$cacheObj = new MetaCache();\n\t\t}\n\t\treturn self::$cacheObj;\n\t}", "static function getInstance(){\n # Get all the servers list from Kohana config\n $serversList = Kohana::config('mmemcached.memcached_servers');\n \n self::$objectInstance || self::$objectInstance = new MMemcached_Core($serversList);\n return self::$objectInstance;\n }", "public function getCache()\n {\n if (null == $this->cache) {\n $this->setCache(Cache::get(Cache::CACHE_MEMORY));\n }\n return $this->cache;\n }", "private function getCacheInstance()\n {\n $cacheInterface = 'yii\\caching\\CacheInterface';\n return Instance::ensure($this->cache, $cacheInterface);\n }", "public function getMemcachedInstance()\n {\n if (!$this->memcachedInstance) {\n if (!$this->isAvailable()) {\n throw new Exception('Memcached is not available');\n }\n $this->memcachedInstance = $this->createMemcached();\n }\n return $this->memcachedInstance;\n }", "private static function cache()\n {\n if (is_null(self::$memcached) && class_exists('Memcached')) {\n $servers = [['host' => '127.0.0.1', 'port' => 11211, 'weight' => 100]];\n\n self::$memcached = new Memcached();\n\n foreach ($servers as $server) {\n self::$memcached->addServer(\n $server['host'], $server['port'], $server['weight']\n );\n }\n\n if (self::$memcached->getVersion() === false) {\n throw new \\RuntimeException(\"Could not establish Memcached connection.\");\n }\n }\n\n return self::$memcached;\n }", "public function connection()\n {\n if (isset($this->memcache)) {\n return $this->memcache;\n }\n\n // no servers is not an error - just no servers, thus no caching in this bucket\n if (!count($this->servers)){\n return null;\n }\n\n // Memcached php extension not supported - slower, rare, extra features not needed\n $this->memcache = new \\Memcache;\n\n /** @var MemcacheServer $server */\n foreach ($this->servers as $server) {\n if (!$this->memcache->addServer($server->host, $server->port)){\n throw new \\Exception('Connect failed');\n }\n $this->memcache->setCompressThreshold(5000, 0.2);\n }\n\n return $this->memcache;\n }", "public function getCache();", "public function getCache();", "public function getCache();", "public function testMemcacheKey()\n {\n $mem = \\Mcache::getSingleton();\n \n $mem->set('key1', 'abc');\n \n $this->assertEquals('abc', $mem->get('key1'));\n }", "static public function getCache()\n {\n if (self::$__instance == null) {\n $classname = __CLASS__;\n self::$allowed = true;\n self::$__instance = new $classname();\n self::$allowed = false;\n }\n return self::$__instance;\n }", "private function getCache() {\n if (! $this->cache) {\n $this->cache = new \\Broker\\Cache ( SITE_CACHE_DATABASE_DIR, $this->configuration );\n }\n return $this->cache;\n }", "protected function getCache()\n {\n return function_exists('apc_fetch')\n ? new ApcCache()\n : new FilesystemCache('../app/cache/filecache')\n ;\n }", "protected function getMemoryCache() {\n\t\treturn $this->getCacheManager()->getCache('cache_runtime');\n\t}", "private static function getCacheInstance()\n {\n if (self::$cacheInstance == null){\n $cacheServer = CACHE_SERVER;\n if ($cacheServer == 'redis')\n self::$cacheInstance = new RedisClient;\n }\n\n return self::$cacheInstance;\n }", "private function __construct(array $options = array())\n {\n if(!class_exists('Memcache')) {\n throw new Exception('Memcache module is not available.');\n }\n \n // Memcache instance\n $this->cache = new Memcache();\n \n // a guide of the version of Memcache module\n $version = method_exists($this->cache, 'addServer') ? 2 : 1;\n \n $this->lifetime = isset($options['lifetime']) ? $options['lifetime'] : self::$defaultLifetime;\n $this->namespace = isset($options['namespace']) ? $options['namespace'] : md5(dirname(__FILE__));\n \n $this->valueKeyPrefix = $this->namespace . self::SEPARATOR . self::KEY_INDICATOR_VALUE . self::SEPARATOR;\n $this->metaKeyPrefix = $this->namespace . self::SEPARATOR . self::KEY_INDICATOR_META . self::SEPARATOR;\n $this->tagKeyPrefix = $this->namespace . self::SEPARATOR . self::KEY_INDICATOR_TAG . self::SEPARATOR;\n \n // register memcached servers\n $servers = isset($options['servers'])\n ? $options['servers']\n : array(\n array(\n 'host' => 'localhost',\n 'port' => 11211,\n 'persistent' => true\n )\n );\n \n if(($version < 2) && (count($servers) > 1)) {\n throw new Exception('The version of Memcache module is required to be lather than 2.0.0 for multi servers.');\n }\n \n foreach($servers as $server)\n {\n $host = isset($server['host']) ? $server['host'] : 'localhost';\n $port = isset($server['port']) ? $server['port'] : 11211;\n $persistent = isset($server['persistent']) ? $server['persistent'] : true;\n $weight = isset($server['weight']) ? $server['weight'] : 1;\n \n if($version >= 2) {\n if(!$this->cache->addServer($host, $port, $persistent, $weight)) {\n throw new Exception(sprintf(\"Can't connect to Memcache Server (%s:%s)\", $host, $port));\n }\n } else {\n $method = $persistent ? 'pconnect' : 'connect';\n if(!$this->cache->$method($host, $port)) {\n throw new Exception(sprintf(\"Can't connect to Memcache Server (%s:%s)\", $host, $port));\n }\n }\n }\n }", "function dol_getcache($memoryid)\n{\n\tglobal $conf;\n\n\t// Using a memcached server\n\tif (! empty($conf->memcached->enabled) && class_exists('Memcached'))\n\t{\n\t\tglobal $m;\n\t\tif (empty($m) || ! is_object($m))\n \t{\n $m=new Memcached();\n \t\t$tmparray=explode(':',$conf->global->MEMCACHED_SERVER);\n \t\t$result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211);\n \t\tif (! $result) return -1;\n \t}\n\t \n\t\t$memoryid=session_name().'_'.$memoryid;\n\t\t//$m->setOption(Memcached::OPT_COMPRESSION, false);\n\t\t//print \"Get memoryid=\".$memoryid;\n\t\t$data=$m->get($memoryid);\n\t\t$rescode=$m->getResultCode();\n\t\t//print \"memoryid=\".$memoryid.\" - rescode=\".$rescode.\" - data=\".count($data).\"\\n<br>\";\n\t\t//var_dump($data);\n\t\tif ($rescode == 0)\n\t\t{\n\t\t\treturn $data;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn -$rescode;\n\t\t}\n\t}\n\telse if (! empty($conf->memcached->enabled) && class_exists('Memcache'))\n\t{\n\t\tglobal $m;\n\t\tif (empty($m) || ! is_object($m))\n \t{\n \t $m=new Memcache();\n \t\t$tmparray=explode(':',$conf->global->MEMCACHED_SERVER);\n \t\t$result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211);\n \t\tif (! $result) return -1;\n \t}\n\t \n \t$memoryid=session_name().'_'.$memoryid;\n\t\t//$m->setOption(Memcached::OPT_COMPRESSION, false);\n\t\t$data=$m->get($memoryid);\n\t\t//print \"memoryid=\".$memoryid.\" - rescode=\".$rescode.\" - data=\".count($data).\"\\n<br>\";\n\t\t//var_dump($data);\n\t\tif ($data)\n\t\t{\n\t\t\treturn $data;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t}\n\t// Using shmop\n\telse if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02))\n\t{\n\t\t$data=dol_getshmop($memoryid);\n\t\treturn $data;\n\t}\n\n\treturn 0;\n}", "function mc_get($key)\n{\n\t$mc = new Memcache;\n\t$ret = $mc->connect(MC_HOST, MC_PORT);\n\tif ($ret == FALSE) {\n\t\treturn $ret;\n\t}\n\t$val = $mc->get($key);\n\t$mc->close();\n\n\treturn $val;\n}", "function cache()\n{\n return Cache::getConnection();\n}", "public function getEngine()\n\t{\n\t\treturn new \\Memcached;\n\t}", "private function getCache() {\n if($this->cache){\n return $this->cache;\n } else {\n return $this->buildCache();\n }\n }", "function get_memche($key){\n global $memcache;\n $get_result = $memcache->get(md5($key));\t\nreturn $get_result;\n}", "public function Get_Cache()\n {\n if ( !is_object($this->_Cache) )\n $this->_Cache = new Zero_Cache($this);\n return $this->_Cache;\n }" ]
[ "0.8133108", "0.7748119", "0.7610835", "0.7445539", "0.73918587", "0.71910876", "0.70298135", "0.70256627", "0.70184535", "0.7003462", "0.6994516", "0.6957668", "0.6945004", "0.6940571", "0.6940571", "0.6940571", "0.6928167", "0.6893995", "0.68923753", "0.6871743", "0.68384176", "0.6837638", "0.68216664", "0.67709136", "0.676785", "0.67576283", "0.6749962", "0.67430156", "0.6700208", "0.6692941" ]
0.8622814
0
Get the memcache expire value
protected function getMemcacheExpire() { return self::MEMCACHE_KEY_EXPIRE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getExpire()\n {\n return $this->expire;\n }", "public function getExpire()\n {\n return $this->expire;\n }", "public function getExpiresTime()\n {\n return $this->expire;\n }", "public function getExpiresTime()\n {\n return $this->expire;\n }", "public function getExpires()\n {\n return $this->get('Expires');\n }", "public function getExpires()\n {\n return $this->get('Expires');\n }", "public function getExpires()\n {\n return $this->get('Expires');\n }", "public function getExpires()\n {\n return $this->get('Expires');\n }", "public function getExpireTime()\n {\n return $this->expire_time;\n }", "static public function get_cache_expiration() {\n\t\treturn self::$cache_length;\n\t}", "public function getExpires()\n {\n return $this->_expires;\n }", "public function getExpires() {\n return @$this->attributes['expires'];\n }", "public function getExpires()\n {\n return $this->expires;\n }", "public function getExpires()\n {\n return $this->expires;\n }", "protected function getCachedTokenExpiry() {\n return $this->session->getTokenExpiry();\n }", "public function getExpires() {\n return $this->_expires;\n }", "public function getExpires()\n {\n $this->expires = time() + 86400;\n\n return $this->expires;\n }", "public function getExpiration();", "public function expires($key) {\n // get the Value object\n $value = $this->retrieve($key);\n\n // check for a valid Value object\n if(!is_a($value, 'Cache\\\\Value')) return false;\n\n // return the expires timestamp\n return $value->expires();\n }", "public function getExpiresIn(): ?int;", "public function getExpiration()\n\t{\n\t\treturn $this->expiration;\n\t}", "public function getExpire()\n\t{\n\t\t$column = self::COL_EXPIRE;\n\t\t$v = $this->$column;\n\n\t\tif ($v !== null) {\n\t\t\t$v = (string)$v;\n\t\t}\n\n\t\treturn $v;\n\t}", "public function getExpiration()\n {\n return $this->expiration;\n }", "public function getExpiration()\n {\n return $this->expiration;\n }", "public function getExpiresIn()\n {\n return $this->getProperty('expires_in');\n }", "public function getExpiresAt();", "public function getExpiresAt();", "public function getExpiresAt();", "public function getExpiresAt();", "public function getExpiresIn()\n {\n return $this->expires_in;\n }" ]
[ "0.7844511", "0.77981085", "0.7511806", "0.7511806", "0.7327153", "0.7327153", "0.7327153", "0.7327153", "0.7256435", "0.7254684", "0.725061", "0.7216559", "0.72076684", "0.72076684", "0.7201334", "0.71996814", "0.71632344", "0.7138705", "0.7126099", "0.7040839", "0.70404637", "0.7038781", "0.69922787", "0.69922787", "0.6983779", "0.6968077", "0.6968077", "0.6968077", "0.6968077", "0.6962133" ]
0.848541
0
to generate a unique id, call genId from the controller eg. $this>IdCreator>genId() be sure to add 'IdCreator' to the $uses array at the top of your controller
function genId(){ $id_arr['IdCreator']=array('id'=>NULL); $this->create(); $this->save($id_arr); return $this->id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function generateId();", "public function generateId();", "function _generateId(){\n static $idx = 1;\n\n if (!$this->getAttribute('id')) {\n $this->updateAttributes(array('id' => 'id_'. substr(md5(microtime() . $idx++), 0, 6)));\n }\n }", "protected function generateId()\n {\n return $this->stringToId( $this->getViewName() );\n }", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "protected function id()\n {\n return Str::random(32);\n }", "protected function generateId()\n {\n return md5($this->name . $this->description . $this->discountType . $this->combinable);\n }", "public function getNewId();", "public function regenerateID(): self;", "public function GetId ();", "public function regenerateId(): void;", "public function generateId() {\n return uniqid(); //for only one server \n }", "private function makeId()\n {\n $random = mt_rand();\n $random = md5($random);\n $random = substr($random,0,12);\n $name = $this->config['name'];\n $length = strlen($name);\n \n if($length > 22){\n $name = substr($name,0,22);\n }\n\n return $name.\"-\".$random;\n }", "public function get_id();", "public function ID();", "public function ID();", "private static function generateId( ){\n $id = \"\";\n $i = ceil( CommentDatabase::getNb() / IdGenerator::perChar()) + 1;\n do {\n $id = IdGenerator::create(3, 3+$i);\n $i++;\n } while (CommentDatabase::idExists( $id));\n return $id;\n }", "public function regenerate_id()\n {\n $this->regenerate_id = true;\n }", "public function getUniqueId();", "public function getUniqueId();" ]
[ "0.741048", "0.737507", "0.7256017", "0.7059774", "0.7027861", "0.7027861", "0.7027861", "0.7027861", "0.7027861", "0.7027861", "0.7027861", "0.7027861", "0.7027861", "0.7027861", "0.7027861", "0.6961811", "0.6918379", "0.68088", "0.67990506", "0.67781717", "0.67759925", "0.6747365", "0.6687803", "0.66708416", "0.66684", "0.66684", "0.66563857", "0.6647638", "0.6623999", "0.6623999" ]
0.7873226
0
Show the form for creating a new PrinterType.
public function create() { //Valida se usuário possui permissão para acessar esta opção if(App\Models\User::getPermission('printer_types_add',Auth::user()->user_type_code)){ return view('print.printer_types.create'); }else{ //Sem permissão Flash::error(Lang::get('validation.permission')); return redirect(route('printerTypes.index')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return view('AdminPanel.ProductType.form');\n }", "public function create()\n\t{\n\t\treturn View::make('typeForm');\n\t}", "public function create()\n {\n return view('admin.product_section.type.create');\n }", "public function create()\n {\n // Return create page\n return view('checklistmanagerforms.create-checklist-type');\n }", "public function create()\n {\n Languages::setBackLang();\n return view('backend.price_type.create');\n }", "public function create()\n {\n return view('admin.product_types.create');\n }", "public function create()\n {\n return view('manage.price-type.create');\n }", "public function create()\n {\n return view('ticketing.settings.type.create');\n }", "public function create()\n {\n return view('admin.type.create');\n }", "public function create()\n {\n return view('admin.type.create');\n }", "public function create()\n {\n return view('admin.types.create');\n }", "public function create()\n {\n return view('carrier-types.create');\n }", "public function initCreateForm($a_new_type)\n\t{\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$form = new ilPropertyFormGUI();\n\t\t$form->setTarget(\"_top\");\n\t\t$form->setFormAction($this->ctrl->getFormAction($this, \"save\"));\n\t\t$form->setTitle($this->txt($a_new_type.\"_new\"));\n\n\t\t// title\n\t\t$ti = new ilTextInputGUI($this->lng->txt(\"title\"), \"title\");\n\t\t$ti->setSize(min(40, ilObject::TITLE_LENGTH));\n\t\t$ti->setMaxLength(ilObject::TITLE_LENGTH);\n\t\t$ti->setRequired(true);\n\t\t$form->addItem($ti);\n\n\t\t// description\n\t\t$ta = new ilTextAreaInputGUI($this->lng->txt(\"description\"), \"desc\");\n\t\t$ta->setCols(40);\n\t\t$ta->setRows(2);\n\t\t$form->addItem($ta);\n\n\t\t$form->addCommandButton(\"save\", $this->txt($a_new_type.\"_add\"));\n\t\t$form->addCommandButton(\"cancel\", $this->lng->txt(\"cancel\"));\n\n\t\treturn $form;\t\t\n\t}", "public function create()\n {\n return view('modules.battery_type.add');\n }", "public function create()\n {\n return view('hospital.operations.types.create');\n }", "public function create()\n {\n $type = new Type();\n\n return view('types.create', compact('type'));\n }", "public function create()\n {\n return view('product-types/create');\n }", "public function create()\n {\n //\n return view('admin.type.add');\n }", "public function create()\n {\n return view('backend.car_types.create');\n }", "public function create()\n {\n return view('types.create');\n }", "public function create()\n {\n return view('steel_types.create');\n }", "public function create()\n {\n return view('type.create');\n }", "public function create()\n {\n return view('admin.planType.create');\n }", "public function create()\n {\n return view('dashboard.printers.create');\n }", "public function create()\n {\n return view('admin.property-types.create');\n }", "public function create()\n {\n return view('admin.logistics.types.create');\n }", "public function create()\n {\n return view('Types/create');\n }", "public function create()\n {\n return view('forms.typesaleCreateForm');\n }", "public function create()\n {\n return view('devicetype.create');\n }", "public function create()\n {\n return view('admin.sensors.addType');\n }" ]
[ "0.6972107", "0.68364555", "0.66081893", "0.6599757", "0.65689164", "0.65629286", "0.65134394", "0.64939576", "0.6488634", "0.6488634", "0.6475075", "0.6469709", "0.6449099", "0.6448909", "0.64449245", "0.64396155", "0.6433046", "0.6414786", "0.6393934", "0.63905203", "0.6386563", "0.6372227", "0.6363262", "0.6360177", "0.6358446", "0.63392675", "0.633757", "0.6329185", "0.6327973", "0.6326862" ]
0.7084051
0
Store a newly created PrinterType in storage.
public function store(CreatePrinterTypeRequest $request) { $input = $request->all(); $printerType = $this->printerTypeRepository->create($input); Flash::success(Lang::get('validation.save_success')); return redirect(route('printerTypes.index')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n PrinterType::create(['name' => 'Red']);\n PrinterType::create(['name' => 'Usb']);\n }", "public function store(StoreTypeRequest $request)\n {\n $exceptList = ['_token'];\n if ( $request->leader_id =='null' ) array_push($exceptList, 'leader_id');\n if ( $request->resource_id=='null' ) array_push($exceptList, 'resource_id');\n if ( $request->weekday =='null' ) array_push($exceptList, 'weekday');\n if ( $request->repeat =='null' ) array_push($exceptList, 'repeat');\n\n // make sure we only have one 'catch-all' type!\n if ( $request->generic && Type::where('generic', true)->count() ) {\n flash('It doesn\\'t make sense to have more than one event type named \"Generic\"!');\n }\n\n // now create the new TYPE item\n Type::create( $request->except($exceptList) );\n\n $status = 'New Type added.';\n return \\Redirect::route('types.index')\n ->with(['status' => $status]);\n }", "public function store(TypeRequest $request)\n {\n $type = new Type;\n $type->fill($request->all())->save();\n $notification = array(\n 'title' => 'Type',\n 'message'=>\"Type Added Successfully\",\n 'alert-type' => 'success',\n );\n return redirect()->back()->with($notification);\n }", "public function store(CreatePrinterRequest $request)\n {\n $input = $request->all();\n\n $printer = $this->printerRepository->create($input);\n\n Flash::success('Printer saved successfully.');\n\n return redirect(route('dashboard.printers.index'));\n }", "public function store(TypeRequest $request)\n {\n Type::create($request->all());\n\n return redirect()->back()->with('message', 'Pomyślnie dodano gatunek filmowy.');\n }", "public function add_type()\n {\n\t\t// get the post\n\t\t\t$post=$this->get_input_vals();\n\n\t\t// save\n\t\t\t$message=$this->variation_model->save_var_type($post);\n\n\t\t// log, reload\n\t\t\t$this->_log_action($message['text'],$message['text'],$message['pass']);\n\t\t\t$this->_reload('variation-types-definition',$message['text'],$message['pass']);\n }", "public function store(&$types)\n {\n foreach ($this->schema->fields as $name => $type_definition)\n {\n if (!isset($types->$name))\n {\n if ($type_definition['required'] == true)\n {\n throw new midcom_helper_datamanager_exception_storage\n (\n \"Failed to process the type array for the schema {$this->schema->name}: \" . \n \"The type for the required field {$name} was not found.\"\n );\n // This will exit.\n }\n else\n {\n continue;\n }\n }\n $type =& $types->$name;\n\n // Convert_to_storage is called always, the event handler can be used to manage\n // non-storage-backend driven storage operations as well (mainly for the blob type)\n $data = $type->convert_to_storage();\n \n if ($type_definition['storage']['location'] !== null)\n {\n if ($type->serialized_storage)\n {\n $data = serialize($data);\n }\n $this->on_store_data($name, $data);\n }\n \n }\n \n // FIXME: Better way to determine if object has been saved?\n /*if($this->object->id == 0)\n {\n $this->object->create();\n }*/\n\n // Update the storage object last\n if (! $this->on_update_object())\n { \n return false;\n }\n\n return true;\n }", "public function store()\n {\n $this->storage->set($this);\n\n }", "public function store(Request $request) /* STORE MEMBERSHIP TYPE */\n {\n $this->validate($request, [\n 'type' => 'required',\n ]);\n\n $type = new MembershipType;\n\n $type->type = $request->type;\n $type->created_by = Auth::user()->username;\n $type->save();\n\n // Created type id\n $type_id = $type->id;\n\n AuditLog::insert([\n 'description' => 'created membership type: ' . $type_id,\n 'user_id' => Auth::user()->id,\n 'subject_type' => getenv('USERDOMAIN'),\n 'module_id' => 10,\n 'properties' => json_encode($request->post()),\n 'created_at' => date('Y-m-d H:i:s'),\n ]);\n\n return redirect('/settings')->with('message', 'Membership Type has been added.');\n\n }", "public function store(PriceTypeRequest $request)\n {\n $data = PriceType::create($request->all());\n\n return redirect()->route('price-type.index');\n }", "public function store()\n\t{\n\n\n\t\t//type in database te tek aynı değeri olmadığından emin oluyor\n\t\t$rules = array(\n\t\t\t'type' => 'unique:types'\n\t\t\t);\n\n\t\t$data = Input::all();\n\n\t\t$validator = Validator::make($data, $rules);\n\n\t\tif ($validator->passes())\n\t\t{\n\t\t\t$type = new Type;\n\t\t\t$type->type = Input::get('type');\n\n\t\t\t$type->save();\n\t\t} else {\n\t\t\t$messages = $validator->messages();\n\t\t}\n\n\n\t\treturn 'Tip adı: ' . e(Input::get('type')) . ' ' . @$messages;\n\t}", "public function store(TypeCreateRequest $request)\n {\n $type = $this->typeRepository->store($request->all());\n\n flash(\"Le type \" . $request->input('name') . \" a été créé avec succès\");\n\n return redirect('type');\n }", "public function store()\n {\n $this->authorize('seed', AddressType::class);\n\n Artisan::call('db:seed', ['--class' => \\AddressTypesTableSeeder::class]);\n\n flasher()->alert('Address Types seeded successfully', Notifier::SUCCESS);\n\n return redirect()->route('admin.addresses.types.index');\n }", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store(Request $request)\n {\n \n $requestData = $request->all();\n \n Type::create($requestData);\n\n Session::flash('flash_message', 'Type added!');\n\n return redirect('admin/types');\n }", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.58342874", "0.5812769", "0.57790846", "0.5773269", "0.5758971", "0.5680608", "0.56595314", "0.56188774", "0.5584448", "0.557704", "0.55736244", "0.5528059", "0.5504953", "0.54346424", "0.540359", "0.5402144", "0.5402144", "0.5402144", "0.5402144", "0.5402144", "0.5402144", "0.5402144", "0.5402144", "0.5402144", "0.5402144", "0.5402144", "0.5402144", "0.5402144", "0.5402144", "0.5402144" ]
0.7028504
0
Show the form for editing the specified PrinterType.
public function edit($id) { //Valida se usuário possui permissão para acessar esta opção if(App\Models\User::getPermission('printer_types_edit',Auth::user()->user_type_code)){ $printerType = $this->printerTypeRepository->findWithoutFail($id); if (empty($printerType)) { Flash::error(Lang::get('validation.not_found')); return redirect(route('printerTypes.index')); } return view('print.printer_types.edit')->with('printerType', $printerType); }else{ //Sem permissão Flash::error(Lang::get('validation.permission')); return redirect(route('printerTypes.index')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Type $type)\n {\n return view('types.edit', compact('type'));\n }", "public function editShipping($type)\n {\n\n if ($type === 'free') {\n $shippingMethod = Setting::where('key', 'free_shipping_label')->first();\n\n } elseif ($type === 'inner') {\n $shippingMethod = Setting::where('key', 'local_label')->first();\n\n } elseif ($type === 'outer') {\n $shippingMethod = Setting::where('key', 'outer_label')->first();\n } else {\n $shippingMethod = Setting::where('key', 'free_shipping_label')->first();\n }\n\n return view('admin.settings.shippings.edit',compact('shippingMethod'));\n\n }", "public function edit(PostType $post_type)\n\t{\n return view('post_type.edit',compact('post_type'));\n\t}", "public function edit(BarcodePrinting $barcodePrinting)\n {\n //\n }", "public function edit(ProductType $ProductType)\n {\n\n return view('AdminPanel.ProductType.form', compact('ProductType'));\n }", "function showChooseType()\n {\n $this->showHeader('Choose Type');\n\n echo '<form><label>Mbox file</label><input name=\"param\" value=\"mbox/INBOX\"/>\n <input type=\"hidden\" name=\"type\" value=\"mbox\"/><input type=\"submit\"/></form>\n\n <form><label>Mbox folder</label><input name=\"param\" value=\"mbox\"/>\n <input type=\"hidden\" name=\"type\" value=\"mbox-folder\"/><input type=\"submit\"/></form>\n\n <form><label>Maildir file</label><input name=\"param\" value=\"maildir\"/>\n <input type=\"hidden\" name=\"type\" value=\"maildir\"/><input type=\"submit\"/></form>\n\n <form><label>Maildir folder</label><input name=\"param\" value=\"maildir\"/>\n <input type=\"hidden\" name=\"type\" value=\"maildir-folder\"/><input type=\"submit\"/></form>\n\n <form><label>Pop3 Host</label><input name=\"param\" value=\"localhost\"/>\n <input type=\"hidden\" name=\"type\" value=\"pop3\"/><input type=\"submit\"/></form>\n\n <form><label>IMAP Host</label><input name=\"param\" value=\"localhost\"/>\n <input type=\"hidden\" name=\"type\" value=\"imap\"/><input type=\"submit\"/></form>';\n\n $this->showFooter();\n }", "public function showEditForm($id) {\n $recTypeDat = RecordType::find($id);\n $type = $recTypeDat->type;\n $icon = $recTypeDat->fa_icon;\n\n return view('pages.edit-record-type', compact(\n 'id', 'type', 'icon'\n ));\n }", "function homedelivery_page_edit($homedelivery) {\n $types = homedelivery_types();\n drupal_set_title(t('Edit <em>@type</em> Order made in @title', array('@type' => $types[$homedelivery->type]->name, '@title' => $homedelivery->title)), PASS_THROUGH);\n\n return drupal_get_form($homedelivery->type . '_homedelivery_form', $homedelivery);\n}", "public function edit(Ticket_type $tickettype)\n {\n return view('ticketing.settings.type.edit', compact('tickettype'));\n }", "function gp_project_type_edit_form( $project_type ) {\n\n $options = new gpProjectTypeOptions( $project_type->term_id );\n\n ?>\n <tr class=\"form-field\">\n <th scope=\"row\" valign=\"top\">\n <label for=\"project-type-layout\"><?php _e( 'Layout', 'gp' ); ?></label>\n </th>\n <td>\n <select name=\"project-type-layout\" id=\"project-type-layout\">\n <?php echo it_array_to_select_options( gp_portfolio_layouts(), $options->layout ); ?>\n </select>\n <br />\n <span class=\"description\"><?php _e( 'Portfolio layout that will be used to display the project type.', 'gp' ); ?></span>\n </td>\n </tr>\n <tr id=\"project-type-layout-option\" class=\"form-field\"<?php if ( $options->layout != 'grid' ) { echo ' style=\"display: none\"'; } ?>>\n <th scope=\"row\" valign=\"top\">\n <label for=\"project-type-grid-size\"><?php _e( 'Grid Size', 'gp' ); ?></label>\n </th>\n <td>\n <select name=\"project-type-grid-size\" id=\"project-type-grid-size\">\n <?php echo it_array_to_select_options( GridPortfolioAdmin::get_grid_size_options(), $options->grid_size ? $options->grid_size : GridPortfolio::DEFAULT_GRID_SIZE ); ?>\n </select>\n </td>\n </tr>\n <?php\n}", "public static function onFormPrinterSetup ( $formPrinter ) {\n\t\t// register new input button for pageForms templates\n\t\t//$formPrinter->setInputTypeHook('saveDraft', 'DraftHooks::pageFormInputSaveDraft', array());\n\t}", "public function edit(TypeNovelty $typeNovelty)\n {\n //\n }", "public function print_form() {\n\t\techo $this->get_form();\n\t}", "public function printForm() {\r\n\t\techo $this->getForm();\r\n\t}", "function edit()\n\t{\n\t\terror_log(\"show the vacation EDIT form\\n\", 3, JPATH_ROOT.DS.\"logs\".DS.\"salonbook.log\");\n\t\t\n\t\tJRequest::setVar('view','vacation');\n\t\tJRequest::setVar('layout','edit');\n\t\tJRequest::setVar('hidemanmenu',true);\n\t\t\n\t\tparent::display();\n\t}", "public function formEditProcesarPlanilla(){\r\n Obj::run()->View->render();\r\n }", "public function showForm()\n {\n \t$products = ProductType::orderBy(\"prd_type_name\", \"ASC\")->get();\n \treturn view(\"merch.setup.product_type\", compact(\"products\"));\n }", "public function edit($id_type)\n {\n //\n }", "public function exportForm()\n {\n $postTypes = get_post_types(array('public' => true));\n unset($postTypes['attachment']);\n\n $data = array();\n $data['postTypes'] = $postTypes;\n\n echo $this->blade('form', $data);\n }", "public function edit($type_id)\n {\n if(auth()->user()->hasPermissionTo('Edit Vehicle Type') OR\n (Gate::allows('Administrator', auth()->user()))){\n $type= $this->model->show($type_id);\n $typo= $this->model->all();\n return view('administrator.vehicle_types.edit')->with([\n 'type' => $type,\n 'typo' => $typo,\n ]);\n } else{\n return redirect()->back()->with([\n 'error' => \"You Dont have Access To Edit A Vehicle Type\",\n ]);\n }\n }", "public function edit(TicketType $ticketType)\n {\n\n return view('backend.ticketType.edit',compact('ticketType'));\n }", "public function edit(ChecklistType $checklisttype)\n {\n // Return page for editing checklist type\n return view('checklistmanagerforms.edit-checklist-type', [\n 'checklisttype' => $checklisttype\n ]);\n }", "public function edit(ProductType $productType)\n {\n return view('pages.product-types.createOrUpdate', compact('productType'));\n }", "public function testPrintFormWorks() {\n $this->drupalLogin($this->user);\n $this->drupalGet('admin/config/user-interface/printable/print');\n $this->assertResponse(200);\n\n $config = $this->config('printable.settings');\n $this->assertFieldByName('print_html_sendtoprinter', $config->get('printable.send_to_printer'), 'The field was found with the correct value.');\n\n $this->drupalPostForm(NULL, array(\n 'print_html_sendtoprinter' => 1,\n ), t('Submit'));\n $this->drupalGet('admin/config/user-interface/printable/print');\n $this->assertResponse(200);\n $this->assertFieldByName('print_html_sendtoprinter', 1, 'The field was found with the correct value.');\n }", "public function form( $instance ) {\n\t\t// outputs the options form on admin\n\t}", "public function form( $instance ) {\n\t\t// outputs the options form on admin\n\t}", "public function edit()\n {\n //It cannot retrieve an id for the location so it wants to create a new one. (is_new) {SOLVED}\n if ($this->access->hasWriteAccess()) {\n $xlcdLocationFormGUI = new xlcdLocationFormGUI($this, xlcdLocation::find($_GET[self::IDENTIFIER]));\n $xlcdLocationFormGUI->fillForm();\n $this->tpl->setContent($xlcdLocationFormGUI->getHTML());\n } else {\n $this->ctrl->redirect(ilMyTableGUI::class);\n }\n }", "public function printFormTag() {\r\n\t\techo '<form action=\"options.php\" method=\"post\">';\r\n\t}", "public function print_widget_form( $options )\n\t{\n\t\tglobal $wp_customize;\n\t\t\n\t\t$options = $this->merge_options( $options );\n\t\textract( $options );\n\n\t\tif( !isset($wp_customize) || !isset($options['contact_entry']) )\n\t\t{\n\t\t\t$csm_options = $this->model->get_options();\n\t\t\textract( $csm_options );\n\t\t}\n\t\t?>\n\n\t\t<p>\n\t\t<label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e( 'Title:' ); ?></label> \n\t\t<br/>\n\t\t<input id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title ); ?>\" class=\"widefat\">\n\t\t<br/>\n\t\t</p>\n\t\t\n\t\t<p>\n\t\t<label for=\"<?php echo $this->get_field_id( 'contact_entry' ); ?>\"><?php _e( 'Contact Info:' ); ?></label> \n\t\t<br/>\n\t\t<textarea name=\"<?php echo $this->get_field_name( 'contact_entry' ); ?>\"><?php echo $contact_entry; ?></textarea>\n\t\t<input type=\"hidden\" name=\"<?php echo $this->get_field_name( 'contact_entry_filter' ); ?>\" value=\"no\" />\n\t\t<input type=\"checkbox\" name=\"<?php echo $this->get_field_name( 'contact_entry_filter' ); ?>\" value=\"yes\" <?php checked($contact_entry_filter, 'yes'); ?> />\n\t\tAutomatically add paragraphs\n\t\t</p>\n\t\t\n\t\t<?php\n\t}", "public function edit($type)\n\t{\n\t\t$data = ConfigModel::where('collection', '=', 'question_type')\n\t\t\t->where('name', '=', 'question_type.config.'.$type)\n\t\t\t->firstOrFail();\n return View::make('admin.lession.question_type_edit', array('data'=>$data));\n\t}" ]
[ "0.6135594", "0.60697675", "0.59481514", "0.5930139", "0.5923449", "0.58348703", "0.5822918", "0.5812977", "0.58082074", "0.58028203", "0.57880694", "0.57762396", "0.5751981", "0.56763685", "0.56647766", "0.5663697", "0.5642055", "0.5636493", "0.56268895", "0.5617999", "0.5587544", "0.5583043", "0.5544018", "0.55382764", "0.5534165", "0.5534165", "0.55266565", "0.5505013", "0.5478676", "0.54764396" ]
0.6092468
1
Update the specified PrinterType in storage.
public function update($id, UpdatePrinterTypeRequest $request) { $printerType = $this->printerTypeRepository->findWithoutFail($id); if (empty($printerType)) { Flash::error(Lang::get('validation.not_found')); return redirect(route('printerTypes.index')); } //Grava log $requestF = $request->all(); $descricao = 'Alterou PrinterType ID: '.$id.' - '.$requestF['code']; $log = App\Models\Log::wlog('printer_types_edit', $descricao); $printerType = $this->printerTypeRepository->update($request->all(), $id); Flash::success(Lang::get('validation.update_success')); return redirect(route('printerTypes.index')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateStorageType($type)\n {\n $this->processStorageOptionsOrType($type);\n }", "public function updateTypeData() {\n\t\t// Compare type data with what was previously stored\n\t\t$repo = new TypesRepo();\n\t\t$old_type_data = $repo->getObjectData( $this->zid );\n\t\tif ( $this->type_data != $old_type_data ) {\n\t\t\t$repo->updateObjectData($this->zid, $this->type_data);\n\t\t}\n\t}", "public function update(TypeRequest $request, Type $type)\n {\n $type->update($request->all());\n\n return redirect()->back()->with('message', 'Pomyślnie zaktualizowano gatunek filmowy.');\n\n }", "public function update(Request $request, PrinterCounter $printerCounter)\n {\n //\n }", "public function update(ProductTypeRequest $request, ProductType $productType)\n {\n\n $productType->update($request->all());\n return redirect()->route('producttype.index');\n }", "public function update()\n {\n $this->validate();\n\n $this->productType->save();\n\n $this->productType->mappedAttributes()->sync(\n array_merge(\n $this->selectedProductAttributes->pluck('id')->toArray(),\n $this->selectedVariantAttributes->pluck('id')->toArray()\n )\n );\n\n $this->notify(\n __('adminhub::catalogue.product-types.show.updated_message'),\n 'hub.product-types.index'\n );\n }", "public function setType($type) {\n if ($type instanceof PaperTypeApi) {\n $type = $type->getId();\n }\n\n $this->paperType = NULL;\n $this->type_id = $type;\n $this->toSave['type.id'] = $type;\n }", "public function update(Request $request, ProductType $productType)\n {\n //\n }", "public function setProvisioningType(?CloudPcProvisioningType $value): void {\n $this->getBackingStore()->set('provisioningType', $value);\n }", "public function update(Request $request, TicketType $ticketType)\n {\n $attributes = request()->validate(TicketType::$rules);\n\n $ticketType->fill($attributes)->save();\n\n return redirect()->route('ticketType.index');\n }", "public function update(StoreNotificationtypePost $request, Notificationtype $notificationtype)\n {\n $notificationtype->name = $request['name'];\n $notificationtype->save();\n\n return redirect()->action('NotificationtypesController@index')->with('correct', 'Notification Type Updated');\n }", "public function update(PostType $post_type,Requests\\postTypeRequest $request)\n\t{\n $post_type->update($request->all());\n Session()->flash('flash_message','Post has been Updated !');\n return redirect('post_type');\n\t}", "public function update(Request $request, ProductType $productType)\n {\n $productType->update($request->all());\n\n return redirect()->intended(route('product-type.index'))\n ->with('toast_success', \"Create Product Type <b>'{$request->name}'</b>, Successfully!\");\n }", "public function update(TableTypeRequest $request, TableType $tableType)\n {\n $this->tableTypeRepository->update($request->all(), $tableType);\n\n return redirect()->to('/table_types')->with('success', '席タイプ「' . $request->table_type_name . '」を更新しました' );\n }", "public function update(TypeRequest $request, $id)\n {\n $type_update= Type::find($id);\n $type_update->fill($request->all())->save();\n $notification = array(\n 'title' => 'Type',\n 'message' => 'Successfully ! Type Updated',\n 'alert-type' => 'success',\n );\n return redirect()->back()->with($notification);\n }", "public function setPricingType(?string $pricingType): void\n {\n $this->pricingType = $pricingType;\n }", "public static function updateType($id, $type )\n {\n if( !$id )\n return false;\n\n $listing = Listing::find($id);\n\n if( $listing->update([ 'type' => $type ]) )\n return true;\n else\n return false;\n }", "public function update(PriceTypeRequest $request, $id)\n {\n $data = PriceType::findOrFail($id);\n $data->update($request->all());\n\n return redirect()->route('price-type.index');\n }", "public function update(Request $request, Ticket_type $tickettype)\n {\n $request->validate([\n 'name' => 'required|unique:ticket_types|max:35',\n ]);\n\n $tickettype->update([\n 'name' => $request->name,\n ]);\n\n return redirect(route('tickettype.index'))->with('success', 'type updated successfully');\n }", "public function store(CreatePrinterTypeRequest $request)\n {\n $input = $request->all();\n\n $printerType = $this->printerTypeRepository->create($input);\n\n Flash::success(Lang::get('validation.save_success'));\n\n return redirect(route('printerTypes.index'));\n }", "public function setType ($newType) {\r\n\t\t$this->type = $newType;\r\n\t}", "private function updateFile($text, OutputInterface $output, string $type)\n {\n $en = $this->convertFromDB($text);\n\n $this->writeFile($en, $type, 'en');\n $output->writeln(\"<info>en messages translation updated</info>\");\n\n // now update the other languages\n $this->updateOtherLanguages($output, $en, $type);\n }", "public function update(Request $request, $id_type)\n {\n \n $type_product = TypeProduct::find($id_type);\n $type_product->name_type = $request->get('name_type');\n $type_product->status_type = $request->get('status_type');\n $type_product->save();\n\n \n \n\n\n return response()->json('Users Updated Successfully.');\n }", "public function update(Request $request, Type $type)\n {\n // check if field and value are provided\n if ($request->has('field') && $request->has('value')) {\n $type[$request->field] = $request->value;\n $type->save();\n return response(Type::all()->jsonSerialize(), Response::HTTP_OK); \n }\n return 'invalid request';\n }", "public function onUpdate(int $type) {\n }", "public function update(Request $request, $type_id)\n {\n if(auth()->user()->hasPermissionTo('Update Vehicle Type') OR\n (Gate::allows('Administrator', auth()->user()))){\n $this->validate($request, [\n 'type_name' =>'required|min:1|max:255|',\n ]);\n\n $data = ([\n \"type\" => $this->model->show($type_id),\n \"type_name\" => $request->input(\"type_name\"),\n ]);\n\n if($this->model->update($data, $type_id)){\n return redirect()->route(\"vehicle.type.create\")->with(\"success\", \"You Have Changed The Vehicle Type Name From \". \" \".\n $request->input('prev_name') .\" \". \" To \" .$request->input(\"type_name\"). \" \". \"Successfully\");\n }\n } else{\n return redirect()->back()->with([\n 'error' => \"You Dont have Access To Update A Vehicle Type\",\n ]);\n }\n }", "function updateOrder( $type = \"subscription\" ) {\n $pp = new PaypalWppOrders( $this );\n $pp -> updateOrder( $type );\n }", "public function update(ProducttypeRequest $request, $id)\n {\n $product = Producttype::find($id);\n $product->update($request->all());\n\n\n flash(trans('product_types.messages.updated'));\n\n return redirect()->route('dashboard.producttypes.index', $product);\n\n }", "public function update(StoreTypeRequest $request, $id)\n {\n // find a single resource by ID\n $output = Type::find($id);\n if ($output) {\n\n // set default leader to NULL if value was not set\n $output->update(['leader_id' => $request->leader_id=='null' ? null : $request->leader_id]);\n\n // set default resource to NULL if value was not set\n $output->update(['resource_id' => $request->resource_id=='null' ? null : $request->resource_id]);\n\n // set value to NULL if value was not set\n $output->update(['weekday' => $request->weekday=='null' ? null : $request->weekday]);\n\n // set value to NULL if value was not set\n $output->update(['repeat' => $request->repeat=='null' ? null : $request->repeat]);\n\n // update the other fields\n $output->update( $request->except([ '_method', '_token', 'leader_id', 'resource_id', 'weekday', 'repeat' ]) );\n\n // make sure we only have one 'catch-all' type!\n $genericEvent = Type::where('generic', true)->first();\n if ( $request->generic \n && isset($genericEvent->id) \n && $genericEvent->id != $id ) {\n flash('It doesn\\'t make sense to have more than one event type named \"Generic\"!');\n }\n\n // feedback to user and return view with list of types\n $message = 'Type \"' . $output->name . '\" updated';\n return \\Redirect::route('types.index')\n ->with(['status' => $message]);\n }\n\n $message = 'Error! Type with id \"' . $id . '\" not found';\n return \\Redirect::route('types.index')\n ->with(['status' => $message]);\n }", "public function update(TypeUpdateRequest $request, $id)\n {\n $this->typeRepository->update($id, $request->all());\n\n flash(\"Le type \" . $request->input('name') . \" a été modifié avec succès\");\n\n \n return redirect('type');\n }" ]
[ "0.6142472", "0.5698208", "0.5665125", "0.5504614", "0.5416542", "0.5336222", "0.53038913", "0.529944", "0.5283969", "0.52811706", "0.52402496", "0.5217322", "0.5214932", "0.51842797", "0.5166075", "0.5145923", "0.51193684", "0.5112939", "0.51108646", "0.50981313", "0.50437677", "0.50100535", "0.49891242", "0.49863955", "0.49858457", "0.49527055", "0.49506614", "0.4948852", "0.49408686", "0.4914749" ]
0.60596776
1
Try to delete a product, make sure it is unpublished but that versions remain the same
function testDeleteProduct() { $this->loginAs('admin'); $productA = $this->objFromFixture('Product', 'productA'); $productID = $productA->ID; //Publish $productA->doPublish(); $this->assertTrue($productA->isPublished()); $versions = DB::query('SELECT * FROM "Product_versions" WHERE "RecordID" = ' . $productID); $versionsAfterPublished = array(); foreach ($versions as $versionRow) $versionsAfterPublished[] = $versionRow; //Delete $productA->delete(); $this->assertTrue(!$productA->isPublished()); $versions = DB::query('SELECT * FROM "Product_versions" WHERE "RecordID" = ' . $productID); $versionsAfterDelete = array(); foreach ($versions as $versionRow) $versionsAfterDelete[] = $versionRow; $this->assertTrue($versionsAfterPublished == $versionsAfterDelete); //$versions = DB::query('SELECT * FROM "SiteTree_Live" WHERE "ID" = ' . $productID); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testProductCanBeDeleted()\n {\n \t$product = Product::where('slug', 'product')->first();\n\n \t$product->delete();\n\n \t$this->assertDatabaseMissing('products',[\n \t\t'title' => 'An updated product',\n \t\t'slug' => 'product'\n \t]);\n }", "public function forceDeleted(Product $product)\n {\n\n }", "public function test_deleteProduct()\n {\n $products = Product::factory()->count(5)->create();\n\n $this->assertEquals(count($products), 5);\n\n $product = $products->first();\n\n $product->delete();\n\n $this->assertDeleted($product);\n }", "public function forceDeleted(Product $product)\n {\n //\n }", "public function testProductSoftDelete()\n {\n $product = $this->createNewProduct();\n $repository = $this->entityManager\n ->getRepository(Product::class);\n $this->entityManager->persist($product);\n\n $this->entityManager->flush();\n\n $product->setIsDeleted(true);\n $this->entityManager->merge($product);\n $this->entityManager->flush();\n $notDeleted = $repository->findNotDeleted();\n $found = false;\n foreach($notDeleted as $existingProduct) {\n if ($existingProduct->getId() == $product->getId()) {\n $found = true;\n }\n\n }\n $this->assertEquals($found, false);\n // clearup\n $this->entityManager->remove($product);\n $this->entityManager->flush();\n }", "public function testDeleteUnknownProduct()\n {\n $client = $this->createAuthenticatedClient('[email protected]', 'password');\n $client->request(\n 'DELETE',\n '/api/products/300'\n );\n $this->assertSame(Response::HTTP_NO_CONTENT, $client->getResponse()->getStatusCode());\n }", "public function deleted(Product $product)\n {\n //\n }", "public function testDeleteProduct()\n {\n $product = factory(Product::class)->create();\n $images = $product->images;\n\n $this->deleteProduct($product->id)\n ->assertRedirect();\n\n foreach ($images as $image) {\n Storage::assertMissing($image->path);\n }\n }", "public function deleteProduct() {\r\n if (Mage::getStoreConfig('megamenu/general/cache_auto_flush')) {\r\n Mage::helper('megamenu')->saveCacheHtml();\r\n return;\r\n }\r\n\r\n $products = Mage::app()->getRequest()->getParams('product');\r\n if ($products) {\r\n Mage::getModel('core/config')->saveConfig('megamenu/general/reindex',1);\r\n } else {\r\n $product_id = Mage::app()->getRequest()->getParams('id');\r\n if ($product_id) {\r\n Mage::getModel('core/config')->saveConfig('megamenu/general/reindex',1);\r\n }\r\n }\r\n Mage::app()->getCacheInstance()->cleanType('config');\r\n return;\r\n }", "public function deleted(Product $product)\n {\n\n }", "public function\n\t\tdelete()\n\t{\n\t\t\n\t\t$product_id = $this->get_product_id();\n\t\t\n\t\t#echo \"\\$product_id: $product_id\\n\";\n\t\t\n\t\t$affected_rows = Database_ModifyingStatementHelper\n\t\t\t::apply_statement(\n\t\t\t\tnew Database_SQLUpdateStatement(\n<<<SQL\nUPDATE\n\thpi_trackit_stock_management_products\nSET\n\tdeleted = 'Yes'\nWHERE\n\tproduct_id = '$product_id'\nSQL\n\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t#echo \"\\$affected_rows: $affected_rows\\n\";\n\t}", "public function testDeleteProductByNonAdmin()\n {\n $client = $this->createAuthenticatedClient();\n $client->request(\n 'DELETE',\n '/api/products/1'\n );\n $this->assertSame(Response::HTTP_FORBIDDEN, $client->getResponse()->getStatusCode());\n }", "public function testDeleteProductByAdmin()\n {\n $client = $this->createAuthenticatedClient('[email protected]', 'password');\n $client->request(\n 'DELETE',\n '/api/products/1'\n );\n $this->assertSame(Response::HTTP_NO_CONTENT, $client->getResponse()->getStatusCode());\n }", "public function testDeletingAProduct()\n {\n $product = Product::factory()->create();\n\n $response = $this->delete(route('products.destroy', $product->id));\n\n $response->assertNoContent();\n }", "public function productDelete($product_id)\n {\n $date=date(\"Y-m-d\");\n\n $sql = \"UPDATE `product` SET `product_deleted_date` = '$date' WHERE product_id = $product_id\";\n $this->db->query($sql);\n\n return true;\n }", "public function delete(Product $product)\n {\n\n }", "function removeOldPromotedProduct(){\n $this->_getWriteAdapter()->delete($this->getTable('promotionhasproduct'), \"(update_time!='0000-00-00 00:00:00' and update_time <= ('\".date(\"Y-m-d H:i:s\",strtotime(\" -2 hour\")).\"') )\");\n return ;\n }", "public function destroy(Product $product)\n {\n\n $deleted=[];\n //if product has extra images catch them in deleted array\n if ($images=$product->extra_images){\n $images=explode(',',$images);\n foreach ($images as $image){\n list($name,$ext)= explode('.',$image);\n $deleted= array_merge($deleted,\n [\n 'public/extra_images/'.$image,\n 'public/extra_images/'.$name . '@' . 400 .'.' .$ext\n\n ]);\n }\n }\n //if product has images catch them in deleted array\n foreach ($product->images->toArray() as $image){\n// list($name,$ext)= explode('.',$image['image_url']);\n $deleted=array_merge($deleted,\n [\n 'public/product/'.$image['image_url'],\n// 'public/product/'.$name . '@'. 400 .'.'.$ext,\n// 'public/product/'.$name . '@'. 550 .'.'.$ext,\n// 'public/product/'.$name . '@'. 750 .'.'.$ext,\n// 'public/product/'.$name . '@'. 1024 .'.'.$ext,\n ]);\n }\n\n // catch product cover in deleted array\n/* list($name,$ext)= explode('.',$product->cover);*/\n\n $deleted=array_merge($deleted,\n [\n 'public/product/'.$product->cover,\n /* 'public/product/'.$name . '@'. 400 .'.'.$ext,\n 'public/product/'.$name . '@'. 550 .'.'.$ext,\n 'public/product/'.$name . '@'. 750 .'.'.$ext,\n 'public/product/'.$name . '@'. 1024 .'.'.$ext,*/\n ]);\n //delete all images in deleted array\n Storage::delete($deleted);\n\n return ($product->delete())? redirect()->back()->with(['success'=>'product deleted successfully'])\n : redirect()->back()->with(['failed'=>'Try again, the process failed']);\n }", "function deleteProduct($id) {\n $this->authHelper->checkAdmin(); \n $itsDone = $this->model->removeProduct($id);\n if ($itsDone){\n header(\"Location: \" . BASE_URL . crudProducts); \n }else{\n $this->view->showError('Existen comentarios asociados a este producto. Eliminelos antes de proceder');\n }\n }", "public function deleteProduct()\n {\n $productDB = new ProductModel();\n $productId = filter_input(INPUT_POST, 'id');\n $productDB->delete($productId);\n Route::redirect('admin', 'product');\n }", "public function testRemoveProduct()\n\t{\n\t\t$client = static::createClient();\n\t\t$client->request('DELETE', '/orders/2');\n\n\t\t$this->assertSame(204, $client->getResponse()->getStatusCode(),'Unexpected status code response ');\n\t}", "public function onProductBeforeDelete($args)\n {\n $product = $args['model'];\n $this->Sellvana_IndexTank_Cron->setProductsStatus(0, $product);\n }", "function deleteProducts($id){\n $product = Product::find($id);\n if($product){\n $result = $product->delete();\n\n if($result){\n return [\"result\"=>\"Data is Deleted!\"];\n }else{\n return [\"result\"=>\"Operation failed. Please re-check the fields.\"];\n }\n }else{\n return [\"result\"=>\"Product not found.\"];\n }\n }", "public function testDelete()\n {\n $id = Product::where('deleted','=','0')->first()->id;\n $productObj = new ProductsController;\n $productObj->delete($id);\n $this->assertEquals(Product::find($id)->deleted,1);\n Product::where('id',$id)->update(['deleted' => 0]);\n }", "public function deleteProductFromShoppingCart(){\n $id = $this->request->GET('id');\n $delete = $this->request->GET('delete');\n\n if($this->shoppingCart != \"\"){\n if($this->shoppingCart->checkProductInShoppingCart($id) && $delete == \"n\"){\n $this->shoppingCart->decreaseAmountOfProduct($id);\n $this->request->setSESSION(\"shoppingCart\", serialize($this->shoppingCart));\n }\n elseif ($this->shoppingCart->checkProductInShoppingCart($id) && $delete == \"y\"){\n $this->shoppingCart->deleteProduct($id);\n $this->request->setSESSION(\"shoppingCart\", serialize($this->shoppingCart));\n }\n }\n\n header(\"Location: http://Localhost/WebundMultimedia/shoppingcart\");\n die();\n }", "function deleteProduct($id): bool\n {\n }", "public function deleteProduct() {\n\t \t$id = decrypt(get('id'));\n\t \tif ($this->model('product')->deleteProduct($id)>0) {\n \t\t\t$this->setSession('success','ลบสินค้าเรียบร้อยแล้ว');\n\t \t} else {\n \t\t\t$this->setSession('error','เกิดข้อผิดพลาดในการลบสินค้า');\n\t \t}\n\n \t\tredirect('product/listProduct');\n\t }", "public function actionDeleteProduct()\n\t{\n\t\t$post = Yii::$app->request->post();\n\n\t\t$product = Product::findOne(['id' => $post['id']]);\n\t\t$product->deleteProduct();\n\n\t\treturn $product;\n\t}", "public function hookActionProductDelete($params)\n {\n\n $sets = $this->getSets($params['id_product']);\n\n foreach ($sets as $set) {\n Ajaxzoom::deleteSet($set['id_360set']);\n }\n\n $id_product = (int)$params['id_product'];\n\n Ajaxzoom::clearProductImagesAXCache($params['id_product']);\n\n Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'ajaxzoomproducts`\n WHERE id_product = '.$id_product);\n\n Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'ajaxzoomproductsimages`\n WHERE id_product = '.$id_product);\n\n Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'ajaxzoomvideo`\n WHERE id_product = '.$id_product);\n\n Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'ajaxzoomimagehotspots`\n WHERE id_product = '.$id_product);\n }", "public function delete() {\n\n\t\t// if request method is blocked\n\t\tif (!RESTClient::setRequestMethod(HTTPRequestMethod::DELETE)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tRESTClient::send(self::RESTPATH . \"/\" . $this->productID);\n\n\t\treturn true;\n\t}" ]
[ "0.7366924", "0.6961675", "0.68605065", "0.68467367", "0.68348026", "0.6661998", "0.6641942", "0.6640614", "0.66376114", "0.6636198", "0.65814483", "0.6519374", "0.65181047", "0.64931315", "0.6493009", "0.64364064", "0.63518643", "0.63513374", "0.634778", "0.63277453", "0.6307807", "0.6280978", "0.6280509", "0.6264323", "0.6254124", "0.62390226", "0.6236045", "0.6214159", "0.62064177", "0.6196395" ]
0.77673733
0
Try to publish a product with amount changed
function testChangeProductAmount() { $this->loginAs('admin'); $productA = $this->objFromFixture('Product', 'productA'); $productID = $productA->ID; //Publish $productA->doPublish(); $this->assertTrue($productA->isPublished()); $versions = DB::query('SELECT * FROM "Product_versions" WHERE "RecordID" = ' . $productID); $versionsAfterPublished = array(); foreach ($versions as $versionRow) $versionsAfterPublished[] = $versionRow; $originalAmount = $productA->Amount; $newAmount = new Money(); $newAmount->setAmount($originalAmount->getAmount() + 50); $newAmount->setCurrency($originalAmount->getCurrency()); $this->assertTrue($newAmount->Amount != $originalAmount->Amount); //Update price and publish $productA->Amount = $newAmount; $productA->doPublish(); $versions = DB::query('SELECT * FROM "Product_versions" WHERE "RecordID" = ' . $productID); $versionsAfterPriceChange = array(); foreach ($versions as $versionRow) $versionsAfterPriceChange[] = $versionRow; $this->assertTrue(count($versionsAfterPublished) + 1 == count($versionsAfterPriceChange)); $this->assertEquals($versionsAfterPriceChange[2]['AmountAmount'], $newAmount->getAmount()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function publish()\n {\n $product = dispatch_now(new GetProductTask($this->data['slug']));\n if(!$product) return false;\n\n if($product->status != Product::STATUS['approve']){\n $product->status = Product::STATUS['publish'];\n $product->save();\n }\n return true;\n }", "public function publish() {\n if (!$this->active) {\n $this->apply(\n new ProductPublishedEvent($this->productId)\n );\n }\n }", "protected function updateProductInfo($pr_id)\r\n {\r\n\r\n global $wpdb;\r\n\r\n $sql = \"SELECT * FROM {$wpdb->posts} WHERE ID = %s \";\r\n $sql = sprintf($sql, $pr_id);\r\n $res = $wpdb->get_results($sql, ARRAY_A);\r\n if (!$res) return false;\r\n\r\n # меняем колличество товара\r\n if ((int)$_REQUEST['quantity']) {\r\n\r\n $sql = \"SELECT COUNT(*) as count FROM {$wpdb->postmeta} WHERE post_id = %s and meta_key = \\\"%s\\\"\";\r\n $sql = sprintf($sql, $pr_id, \"_stock\");\r\n $counter = $wpdb->get_row($sql, ARRAY_A)['count'];\r\n if (!$counter) {\r\n $sql = \"INSERT INTO {$wpdb->postmeta} (meta_value, post_id, meta_key)\r\n VALUES (%s, %s, %s)\";\r\n } else {\r\n $sql = \"UPDATE {$wpdb->postmeta} SET meta_value = %s WHERE post_id = %s and meta_key = \\\"%s\\\"\";\r\n }\r\n $wpdb->query($wpdb->prepare(\r\n $sql, $_REQUEST['quantity'], $pr_id, \"_stock\"\r\n ));\r\n }\r\n\r\n # меняем название товара\r\n if ($_REQUEST['name']) {\r\n\r\n $sql = \"UPDATE {$wpdb->posts} SET post_title = %s WHERE ID = %s \";\r\n $wpdb->query($wpdb->prepare(\r\n $sql, $_REQUEST['name'], $pr_id\r\n ));\r\n\r\n }\r\n\t\t# меняем цену\r\n if ($_REQUEST['price']) {\r\n $sql = \"SELECT COUNT(*) as count FROM {$wpdb->postmeta} WHERE post_id = %s and meta_key = \\\"%s\\\"\";\r\n $sql = sprintf($sql, $pr_id, \"_regular_price\");\r\n $counter = $wpdb->get_row($sql, ARRAY_A)['count'];\r\n\r\n if (!$counter) {\r\n $sql = \"INSERT INTO {$wpdb->postmeta} (meta_value, post_id, meta_key)\r\n VALUES (%s, %s, %s)\";\r\n } else {\r\n $sql = \"UPDATE {$wpdb->postmeta} SET meta_value = %s WHERE post_id = %s and meta_key =\\\"%s\\\"\";\r\n }\r\n $wpdb->query($wpdb->prepare(\r\n $sql, $_REQUEST['price'], $pr_id, \"_regular_price\"\r\n ));\r\n\r\n delete_post_meta($pr_id, '_price');\r\n\r\n $sql = \"SELECT COUNT(*) as count FROM {$wpdb->postmeta} WHERE post_id = %s and meta_key = \\\"%s\\\"\";\r\n $sql = sprintf($sql, $pr_id, \"_price\");\r\n $counter = $wpdb->get_row($sql, ARRAY_A)['count'];\r\n if (!$counter) {\r\n $sql = \"INSERT INTO {$wpdb->postmeta} (meta_value, post_id, meta_key)\r\n VALUES (%s, %s, %s)\";\r\n } else {\r\n $sql = \"UPDATE {$wpdb->postmeta} SET meta_value = %s WHERE post_id = %s and meta_key =\\\"%s\\\"\";\r\n }\r\n $wpdb->query($wpdb->prepare(\r\n $sql, $_REQUEST['price'], $pr_id, \"_price\"\r\n ));\r\n\r\n }\r\n # меняем полное описание товара\r\n if ($_REQUEST['description']) {\r\n\r\n $sql = \"UPDATE {$wpdb->posts} SET post_content = %s WHERE ID = %s \";\r\n $wpdb->query($wpdb->prepare(\r\n $sql, $_REQUEST['description'], $pr_id\r\n ));\r\n $text = $_REQUEST['description'];\r\n $shortDescr = preg_replace(\"#[^\\.]*\\.#s\", '', $text, 1);\r\n\r\n # меняем краткое описание товара\r\n\r\n $sql = \"UPDATE {$wpdb->posts} SET post_excerpt = %s WHERE ID = %s \";\r\n $wpdb->query($wpdb->prepare(\r\n $sql, $shortDescr, $pr_id\r\n ));\r\n }\r\n # меняем артикул\r\n if ($_REQUEST['sku']) {\r\n\r\n $sql = \"SELECT COUNT(*) as count FROM {$wpdb->postmeta} WHERE post_id = %s and meta_key = \\\"%s\\\"\";\r\n $sql = sprintf($sql, $pr_id, \"_sku\");\r\n $counter = $wpdb->get_row($sql, ARRAY_A)['count'];\r\n if (!$counter) {\r\n $sql = \"INSERT INTO {$wpdb->postmeta} (meta_value, post_id, meta_key)\r\n VALUES (%s, %s, %s)\";\r\n } else {\r\n $sql = \"UPDATE {$wpdb->postmeta} SET meta_value = %s WHERE post_id = %s and meta_key = \\\"%s\\\"\";\r\n }\r\n $wpdb->query($wpdb->prepare(\r\n $sql, $_REQUEST['sku'], $pr_id, \"_sku\"\r\n ));\r\n }\r\n # меняем статус остатка\r\n if ($_REQUEST['substatus'] && in_array($_REQUEST['substatus'], ['outofstock', 'instock'])) {\r\n\r\n $sql = \"SELECT COUNT(*) as count FROM {$wpdb->postmeta} WHERE post_id = %s and meta_key = \\\"%s\\\"\";\r\n $sql = sprintf($sql, $pr_id, \"_stock_status\");\r\n $counter = $wpdb->get_row($sql, ARRAY_A)['count'];\r\n if (!$counter) {\r\n $sql = \"INSERT INTO {$wpdb->postmeta} (meta_value, post_id, meta_key)\r\n VALUES (%s, %s, %s)\";\r\n } else {\r\n $sql = \"UPDATE {$wpdb->postmeta} SET meta_value = %s WHERE post_id = %s and meta_key = \\\"%s\\\"\";\r\n }\r\n $wpdb->query($wpdb->prepare(\r\n $sql, $_REQUEST['substatus'], $pr_id, \"_stock_status\"\r\n ));\r\n }\r\n # меняем статус продукта\r\n if ($_REQUEST['status'] && array_key_exists($_REQUEST['status'], get_post_statuses())) {\r\n\r\n $sql = \"UPDATE {$wpdb->posts} SET post_status = %s WHERE ID = %s \";\r\n $wpdb->query($wpdb->prepare(\r\n $sql, $_REQUEST['status'], $pr_id\r\n ));\r\n }\r\n # меняем категорию\r\n if ($_REQUEST['categories'] && (is_array($_REQUEST['categories']))) {\r\n\r\n $query = $wpdb->prepare(\r\n \"DELETE FROM {$wpdb->term_relationships} WHERE object_id = %s \", $pr_id\r\n );\r\n\r\n $wpdb->query($query);\r\n\r\n $cat_ids = $_REQUEST['categories'];\r\n foreach ($cat_ids as $key => $value) {\r\n $sql = \"INSERT INTO {$wpdb->term_relationships} (object_id, term_taxonomy_id)\r\n VALUES (%s, %s)\";\r\n\r\n $wpdb->query($wpdb->prepare(\r\n $sql, $pr_id, (int)$value\r\n ));\r\n }\r\n }\r\n\r\n # загружаем в галерею картинки\r\n $this->loadImages($pr_id, false);\r\n\r\n\r\n $img_arr = $this->getProductImages($pr_id);\r\n\r\n return [\r\n 'product_id' => $pr_id,\r\n 'images' => $img_arr,\r\n ];\r\n }", "function updateProduct() {\n\n $params = [\n 'name' => $this->product\n ];\n \n $response = getResponse(getConfigVar(\"api_url\"), \"products\", $params, [],'body');\n \n $this->qty = $response[\"results\"][0][\"qty\"];\n $this->price = $response[\"results\"][0][\"price\"];\n \n $product = get_page_by_title( $this->product, OBJECT, 'product' );\n \n $productID = $product->ID;\n \n update_post_meta( $productID, \"_stock\", $this->qty );\n update_post_meta( $productID, \"_price\", $this->price );\n }", "function product_sale_price()\n{\n\tglobal $site;\n\t\n\t$sale_start = $site['timestamp'];\n\t$sale_expire = $site['timestamp'] + 90*24*60*60;\n\t\n\tupdate('products')\n\t\t->values(array($_POST['field']=>$_POST['value'],\n\t\t\t\t\t 'sale_start'=>$sale_start,\n\t\t\t\t\t 'sale_expire'=>$sale_expire))\n\t\t->where('product_id = '.$_POST['id']);\n\t\n\treturn true;\n}", "function adext_payment_completed_publish( WP_Post $payment ) {\r\n \r\n $type = get_post_meta( $payment->ID, \"_adverts_payment_type\", true );\r\n \r\n if( $type && $type != \"adverts-pricing\" ) {\r\n return;\r\n }\r\n \r\n $object_id = get_post_meta( $payment->ID, \"_adverts_object_id\", true );\r\n \r\n $publish = current_time('mysql');\r\n $publish_gmt = current_time('mysql', 1);\r\n \r\n $meta = maybe_unserialize( get_post_meta( $payment->ID, \"_adverts_payment_meta\", true ) );\r\n \r\n if(isset($meta[\"pricing\"][\"visible\"])) {\r\n $visible = $meta[\"pricing\"][\"visible\"];\r\n } else {\r\n $visible = 0;\r\n }\r\n \r\n\r\n wp_update_post( array(\r\n \"ID\" => $object_id,\r\n \"post_status\" => \"publish\",\r\n \"post_date\" => $publish,\r\n \"post_date_gmt\" => $publish_gmt\r\n ));\r\n \r\n \r\n if( $visible > 0) {\r\n $expiry = strtotime( $publish . \" +$visible DAYS\" );\r\n update_post_meta( $object_id, \"_expiration_date\", $expiry );\r\n } else {\r\n delete_post_meta( $object_id, \"_expiration_date\" );\r\n }\r\n}", "function _buy_post() {\r\n\t\tglobal $wpdb;\r\n\t\t\r\n\t\t//skip updates from IPN: {PPP will be an immediate update} \r\n\t\tif(isset($_POST['ipn_track_id'])) {\r\n\t\t\texit;\r\n\t\t}\r\n\t\t// system\r\n\t\t$system_obj = mgm_get_class('system');\r\n\t\t$dge = bool_from_yn($system_obj->get_setting('disable_gateway_emails'));\r\n\t\t$dpne = bool_from_yn($system_obj->get_setting('disable_payment_notify_emails'));\r\n\r\n\t\t// get passthrough, stop further process if fails to parse\r\n\t\t$custom = $this->_get_transaction_passthrough($_POST['custom']);\r\n\t\t// local var\r\n\t\textract($custom);\r\n\t\t\t\r\n\t\t// set user\r\n\t\t$user = null;\r\n\t\t// check\r\n\t\tif(isset($user_id) && (int)$user_id > 0) $user = get_userdata($user_id);\t\r\n\t\t\r\n\t\t$blogname = get_option('blogname');\r\n\t\t$tran_success = false;\r\n\t\t\r\n\t\t//getting purchase post title and & price - issue #981\t\t\t\t\r\n\t\t$post_obj = mgm_get_post($post_id);\r\n\t\t$purchase_cost = mgm_convert_to_currency($post_obj->purchase_cost);\r\n\t\t$post = get_post($post_id);\r\n\t\t$post_title = $post->post_title;\t\t\r\n\r\n\t\t// errors\r\n\t\t$errors = array();\r\n\t\t// purchase status\r\n\t\t$purchase_status = 'Error';\r\n\t\t// status\r\n\t\t$payment_status = (isset($this->response['PAYMENTINFO_0_PAYMENTSTATUS'])) ? $this->response['PAYMENTINFO_0_PAYMENTSTATUS'] : $this->response['PAYMENTSTATUS'] ;\t\t\r\n\t\t// status\r\n\t\tif($this->status == 'test' && strtoupper($payment_status) == 'PENDING') $payment_status = 'Completed';\r\n\r\n\t\t// process on response code\r\n\t\tswitch ($payment_status) {\r\n\t\t\tcase 'Completed':\t\t\r\n\t\t\tcase 'Processed':\r\n\t\t\t\t// status\r\n\t\t\t\t$status_str = __('Last payment was successful','mgm');\r\n\t\t\t\t// purchase status\r\n\t\t\t\t$purchase_status = 'Success';\r\n\t\t\t\t\r\n\t\t\t\t// transaction id\r\n\t\t\t\t$transaction_id = $this->_get_transaction_id();\r\n\t\t\t\t// hook args\r\n\t\t\t\t$args = array('post_id'=>$post_id, 'transaction_id'=>$transaction_id);\r\n\t\t\t\t// user purchase\r\n\t\t\t\tif(isset($user_id) && (int)$user_id > 0){\r\n\t\t\t\t\t$args['user_id'] = $user_id;\r\n\t\t\t\t}else{\r\n\t\t\t\t// guest purchase\t\r\n\t\t\t\t\t$args['guest_token'] = $guest_token;\r\n\t\t\t\t}\r\n\t\t\t\t// after succesful payment hook\r\n\t\t\t\tdo_action('mgm_buy_post_transaction_success', $args);// backward compatibility\r\n\t\t\t\tdo_action('mgm_post_purchase_payment_success', $args);// new organized name\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'Failed':\t\t\t\r\n\t\t\tcase 'Refunded':\t\t\t\r\n\t\t\tcase 'Denied':\t\t\t\r\n\t\t\tcase 'In-Progress':\t\t\t\r\n\t\t\t\t// status\r\n\t\t\t\t$status_str = __('Last payment was refunded or denied','mgm');\r\n\t\t\t\t// purchase status\r\n\t\t\t\t$purchase_status = 'Failure';\r\n\t\t\t\t\r\n \t\t\t\t// error\r\n\t\t\t\t$errors[] = $status_str;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'Pending':\r\n\t\t\t\t// reason\t\t\t\t\r\n\t\t\t\tif(isset($this->response['PAYMENTINFO_0_PENDINGREASON'])) {\r\n\t\t\t\t\t$reason = $this->response['PAYMENTINFO_0_PENDINGREASON'];\r\n\t\t\t\t}else {\r\n\t\t\t\t\t$reason = $payment_status;\r\n\t\t\t\t}\t\r\n\t\t\t\t// status\t\r\n\t\t\t\t$status_str = sprintf(__('Last payment is pending. Reason: %s','mgm'), $reason);\r\n\t\t\t\t// purchase status\r\n\t\t\t\t$purchase_status = 'Pending';\t\r\n\t\t\t\t\r\n \t\t\t\t// error\r\n\t\t\t\t$errors[] = $status_str;\t\r\n\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\t// status\r\n\t\t\t\t$status_str = sprintf(__('Last payment status: %s','mgm'), (isset($payment_status) ? $payment_status : 'Unknown'));\r\n\t\t\t\t// purchase status\r\n\t\t\t\t$purchase_status = 'Unknown';\t\r\n\t\t\t\t\r\n \t\t\t\t// error\r\n\t\t\t\t$errors[] = $status_str;\t\r\n\t\t}\r\n\t\t\r\n\t\t// do action\r\n\t\tdo_action('mgm_return_post_purchase_payment_'.$this->module, array('post_id' => $post_id));// new, individual\r\n\t\tdo_action('mgm_return_post_purchase_payment', array('post_id' => $post_id));// new, global \r\n\t\t\r\n\t\t// set as purchase\r\n\t\t$status = __('Failed join', 'mgm'); //overridden on a successful payment\r\n\t\t// check status\r\n\t\tif ( $purchase_status == 'Success' ) {\r\n\t\t\t// mark as purchased\r\n\t\t\tif( isset($user->ID) ){\t// purchased by user\t\r\n\t\t\t\t// call coupon action\r\n\t\t\t\tdo_action('mgm_update_coupon_usage', array('user_id' => $user_id));\t\t\r\n\t\t\t\t// set as purchased\t\r\n\t\t\t\t$this->_set_purchased($user_id, $post_id, NULL, $_POST['custom']);\r\n\t\t\t}else{\r\n\t\t\t\t// purchased by guest\r\n\t\t\t\tif( isset($guest_token) ){\r\n\t\t\t\t\t// issue #1421, used coupon\r\n\t\t\t\t\tif(isset($coupon_id) && isset($coupon_code)) {\r\n\t\t\t\t\t\t// call coupon action\r\n\t\t\t\t\t\tdo_action('mgm_update_coupon_usage', array('guest_token' => $guest_token,'coupon_id' => $coupon_id));\r\n\t\t\t\t\t\t// set as purchased\r\n\t\t\t\t\t\t$this->_set_purchased(NULL, $post_id, $guest_token, $_POST['custom'], $coupon_code);\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\t$this->_set_purchased(NULL, $post_id, $guest_token, $_POST['custom']);\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t// status\r\n\t\t\t$status = __('The post was purchased successfully', 'mgm');\r\n\t\t}\t\t\r\n\t\t\r\n\t\t// transaction status\r\n\t\tmgm_update_transaction_status($_POST['custom'], $status, $status_str);\r\n\t\t\r\n\t\t// blog\r\n\t\t$blogname = get_option('blogname');\t\t\t\r\n\t\t// post being purchased\t\t\t\r\n\t\t$post = get_post($post_id);\r\n\r\n\t\t// notify user, only if gateway emails on\t\r\n\t\tif( ! $dpne ) {\t\t\t\r\n\t\t\t// notify user\r\n\t\t\tif( isset($user->ID) ){\r\n\t\t\t\t// mgm post setup object\r\n\t\t\t\t$post_obj = mgm_get_post($post_id);\r\n\t\t\t\t// check\r\n\t\t\t\tif( $this->send_payment_email($_POST['custom']) ) {\t\r\n\t\t\t\t// check\r\n\t\t\t\t\tif( mgm_notify_user_post_purchase($blogname, $user, $post, $purchase_status, $system_obj, $post_obj, $status_str) ){\r\n\t\t\t\t\t// update as email sent \r\n\t\t\t\t\t\t$this->update_paymentemail_sent($_POST['custom']);\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\t\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// notify admin, only if gateway emails on\r\n\t\tif ( ! $dge ) {\r\n\t\t\t// notify admin, \r\n\t\t\tmgm_notify_admin_post_purchase($blogname, $user, $post, $status);\r\n\t\t}\r\n\r\n\t\t// if failure:\r\n\t\tif( $purchase_status != 'Success' ) {\r\n\t\t\t$errors = (isset($this->response['L_ERRORCODE0']) && !empty($this->response['L_ERRORCODE0'])) ? \r\n\t\t\t\t\t(urlencode($this->response['L_ERRORCODE0'] . ': ' . $this->response['L_SHORTMESSAGE0'] . ' - ' . $this->response['L_LONGMESSAGE0'])) :\r\n\t\t\t\t\t(__('An error occured while porcessing payment.', 'mgm').': ' . $status_str);\r\n\t\t\t\t\t\r\n\t\t\tmgm_redirect(add_query_arg(array('status'=>'error','errors'=>$errors), $this->_get_thankyou_url())); exit;\r\n\t\t}\r\n\r\n\t\t// default error condition redirect\r\n\t\tif(count($errors)>0){\r\n\t\t\tmgm_redirect(add_query_arg(array('status'=>'error', 'errors'=>implode('|', $errors)), $this->_get_thankyou_url()));\r\n\t\t}\r\n\t}", "function upgradeQuantityProduct(){\n\t\t\tif(isset($_POST[\"id_detalle\"]) && isset($_POST[\"id_producto\"])){\n\t\t\t\t$carro=Session::get('carro');\n\t\t\t\t$nuevoDetalle=new detalle_carro(null,$_POST[\"id_producto\"],$_POST[\"nombre_producto\"],$_POST[\"imagen\"],1,$_POST[\"precio_unitario\"]);\n\t\t\t\t$posicion=$this->buscarActiculoCarro($carro, $_POST[\"id_detalle\"]);\n\t\t\t\t//Si que esta el articulo en el carro\n\t\t\t\t$carro->detalle[$posicion]->cantidad++;\n\t\t\t\t$res=$this->model->upgradeQuantityProductShoppingCart($carro->detalle[$posicion]);\n\t\t\t\tif($res==false){\n\t\t\t\t\t$carro->detalle[$posicion]->cantidad--;\n\t\t\t\t\t$output=[\"NO_STOCK\"];\n\t\t\t\t\t$this->json_out($output);\n\t\t\t\t}else{\n\t\t\t\t\t//Guardamos los cambios en el carro de session\n\t\t\t\t\tSession::set('carro',$carro);\n\t\t\t\t\t$output=[\"OK\",$carro->detalle[$posicion]->id_detalle_carro];\n\t\t\t\t\t$this->json_out($output);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n \t}", "public function UpdateProductWithNewStock()\n {\n $products = $this->allDataOnBasket;\n foreach ($products as $product)\n {\n $productsFromDb= Product::find($product->product_id);\n $newStock = ($productsFromDb->stock - $product->counter);\n $arr []= $productsFromDb->update(['stock'=>$newStock]);\n }\n\n }", "public function ComputeStockAction()\n\t{\n\t\t$ProductId = $this->getRequest()->getParam('product_id');\n\t\t$product = mage::getModel('catalog/product')->load($ProductId);\n \t \t\n \t//met a jour les qte\n \tmage::getModel('Purchase/StockMovement')->ComputeProductStock($ProductId);\n \t$model = mage::getModel('Purchase/Productstock');\n \t$model->UpdateOrderedQty($product);\n\n \t//check and repair reserved qty\n \tmage::helper('purchase/ProductReservation')->UpdateReservedQty($product);\n\n \t\n\t\t$this->_getSession()->addSuccess('Product stocks updated');\n\t\t$this->_redirect('Purchase/Misc/IdentifyErrors');\n\t}", "public function testSuccessTransaction()\n {\n $product = $this->getAvailableProduct();\n $response = $this->post('/api/product/transaction',[\n 'name' => 'Rifki',\n 'products' => [\n [\n 'slug' => $product->slug,\n 'quantity' => 1\n ]\n ]\n ]);\n\n $response->assertStatus(200);\n\n $this->stockRecover([\n ['id' => $product->id, 'stock' => 1]\n ]);\n }", "function updateStock ( $order ) {\n\t\t\n\t\tif ($order->get_id_statut() >= OR_PAY_OK) {\n\t\t\t$content = unserialize($order->get_structure());\n\t\t\tforeach ($content as $product) {\n\t\t\t\tif (!isset($product['name'])) {\n\t\t\t\t\t$oPdt = new shp_produit ($product['id']);\n\t\t\t\t\t$oPdt->set_quantite_stock( $oPdt->get_quantite_stock() - $product['quantity'] );\n\t\t\t\t\t\n\t\t\t\t\t// add extra low stock security alert routine\n\t\t\t\t\tif( WEBSHOP_STOCK_ALERT && ($oPdt->get_alerte_stock() > ($oPdt->get_quantite_stock() - $product['quantity'])) ){\n\t\t\t\t\t\t// translation engine\n\t\t\t\t\t\t$translator =& TslManager::getInstance();\n\t\t\t\t\t\tif (isset($product['props']['id'])) {\n\t\t\t\t\t\t\t$p_ident = 'ID '.$product['props']['id'].' - '.$translator->getByID($properties[$product['props']['id']]['shp_pdt_titre_court']).' - '.$properties[$product['props']['id']]['shp_pdt_dimensions'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// service confirmation email\n\t\t\t\t\t\t\t$message = \"Stock restant pour le produit {$p_ident} : \".$properties[$product['props']['id']]['shp_pdt_quantite_stock'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$p_ident = 'ID '.$product['id'].' - '.$product['ref'].''; \n\t\t\t\t\t\t\t$message = \"Stock restant pour le produit {$p_ident} : \".$oPdt->get_quantite_stock();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\tmultiPartMail(SHP_ADMIN_ORDER_EMAIL , 'Alerte stock sur webshop' , $message , '', SHP_AUTO_EMAIL);\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tdbUpdate($oPdt);\n\t\t\t\t}\t\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t}", "public function syncInventoryPriority()\n {\n \n // get the items simply by time stamp of today\n $daysback_options = explode (',',$this->option('sync_inventory_warhsname'))[3] ;\n $daysback = intval(!empty($daysback_options) ? $daysback_options : 10); // change days back to get inventory of prev days\n $stamp = mktime(1 - ($daysback*24), 0, 0);\n $bod = date(DATE_ATOM,$stamp);\n $url_addition = '(WARHSTRANSDATE ge '.$bod. ' or PURTRANSDATE ge '.$bod .' or SALETRANSDATE ge '.$bod.')';\n if($this->option('variation_field')) {\n // $url_addition .= ' and ' . $this->option( 'variation_field' ) . ' eq \\'\\' ';\n }\n $response = $this->makeRequest('GET', 'LOGPART?$select=PARTNAME&$filter= '.urlencode($url_addition).' &$expand=LOGCOUNTERS_SUBFORM,PARTBALANCE_SUBFORM', [], $this->option('log_inventory_priority', false));\n\n // check response status\n if ($response['status']) {\n\n $data = json_decode($response['body_raw'], true);\n\n foreach($data['value'] as $item) {\n\n // if product exsits, update\n\n $option_filed = explode (',',$this->option('sync_inventory_warhsname'))[2] ;\n $field = (!empty($option_filed) ? $option_filed : 'PARTNAME');\n $args = array(\n 'post_type' => array('product', 'product_variation'),\n 'meta_query'\t=>\tarray(\n array(\n 'key' => '_sku',\n 'value'\t=> $item[$field]\n )\n )\n );\n $my_query = new \\WP_Query( $args );\n if ( $my_query->have_posts() ) {\n while ( $my_query->have_posts() ) {\n $my_query->the_post();\n $product_id = get_the_ID();\n\n\n }\n }else{\n $product_id = 0;\n }\n\n //if ($id = wc_get_product_id_by_sku($item['PARTNAME'])) {\n if(!$product_id == 0){\n // update_post_meta($product_id, '_sku', $item['PARTNAME']);\n // get the stock by part availability\n $stock = $item['LOGCOUNTERS_SUBFORM'][0]['DIFF'];\n\n // get the stock by specific warehouse\n $wh_name = explode (',',$this->option('sync_inventory_warhsname'))[0];\n $foo =$this->option('sync_inventory_warhsname');\n $foo2 = explode (',',$this->option('sync_inventory_warhsname'))[1];\n $is_deduct_order = explode (',',$this->option('sync_inventory_warhsname'))[1] == 'ORDER';\n $orders = $item['LOGCOUNTERS_SUBFORM'][0]['ORDERS'];\n foreach($item['PARTBALANCE_SUBFORM'] as $wh_stock){\n if($wh_stock['WARHSNAME'] == $wh_name) {\n $stock = $wh_stock['TBALANCE'] > 0 ? $wh_stock['TBALANCE'] : 0; // stock\n if ($is_deduct_order) {\n $stock = $wh_stock['TBALANCE'] - $orders > 0 ? $wh_stock['TBALANCE'] - $orders : 0; // stock - orders\n }\n }\n }\n $statuses = explode (',',$this->option('sync_inventory_warhsname'))[4];\n if(!empty($statuses)){\n $stock -= $this->get_items_total_by_status($product_id);\n $item['order_status_qty'] = $this->get_items_total_by_status($product_id);\n }\n $item['stock'] = $stock;\n $item = apply_filters('simply_sync_inventory_priority',$item);\n $stock = $item['stock'];\n update_post_meta($product_id, '_stock', $stock);\n // set stock status\n if (intval($stock) > 0) {\n // update_post_meta($product_id, '_stock_status', 'instock');\n $stock_status = 'instock';\n } else {\n // update_post_meta($product_id, '_stock_status', 'outofstock');\n $stock_status = 'outofstock';\n }\n $variation = wc_get_product($product_id);\n // $variation->set_stock_status($stock_status);\n $variation->save();\n }\n }\n // add timestamp\n $this->updateOption('inventory_priority_update', time());\n } else {\n /**\n * t149\n */\n $this->sendEmailError(\n $this->option('email_error_sync_inventory_priority'),\n 'Error Sync Inventory Priority',\n $response['body']\n );\n }\n }", "public function reasonForBuying();", "function update_prod_quantity($soldprod_id,$soldprod_name,$soldprod_left,$soldprod_numsold_total) {\r\n // input: prodid, prodname, prod's new quantity, prod's total sold number\r\n // output: the alert message\r\n if($soldprod_left <= 0) {\r\n\t\t$soldprod_left = 0;\r\n\t\t// update itself to 0\r\n\t\tmysql_query(\"update productstb set numsold='$soldprod_numsold_total',quantity='0' where prodid='$soldprod_id' and site='\".$GLOBALS['site'].\"'\") or die(\"Invalid query for updating prod info 30: \".mysql_error());\r\n\t\t$mailstr = $mailstr.$soldprod_id.\" - \".$soldprod_name.\"\\n\";\r\n\t\t// update affected bundles to 0\r\n\t\t// XXX: can add active=1?\r\n\t\t$get_bundleinfo = mysql_query(\"SELECT bundleid,bundlename from prodbundlesTB where prod1='$soldprod_id' or prod2='$soldprod_id' or prod3='$soldprod_id' or prod4='$soldprod_id' or prod5='$soldprod_id'\") or die(\"Invalid query for bundle info:\".mysql_error());\r\n\t\twhile($found_in_bundle = mysql_fetch_assoc($get_bundleinfo)) {\r\n\t\t mysql_query(\"update productstb set quantity='0' where prodid=\".$found_in_bundle['bundleid'].\" and quantity>'0'\") or die(\"Invalid query for updating prod info:\".mysql_error());\r\n\t\t $mailstr = $mailstr.\"Also found in bundle: \".$found_in_bundle['bundleid'].\" - \".$found_in_bundle['bundlename'].\"\\n\";\r\n\t\t}\r\n\t\t\r\n\t\t$insertwebqtyoossql = \"INSERT INTO trackqtyoostb (prodid,site) VALUES ('$soldprod_id','SE')\";\r\n\t\t$insertwebqtyoosresult = mysql_query($insertwebqtyoossql) or die(mysql_error());\r\n\t\t\r\n } else {\r\n\t\t// update itself in productstb\r\n\t\tmysql_query(\"update productstb set numsold='$soldprod_numsold_total',quantity='$soldprod_left' where prodid='$soldprod_id' and site='SE'\") or die(\"Invalid query for updating prod info:\".mysql_error());\r\n\t\t// update affected bundles\r\n\t\t// XXX: can add active=1?\r\n\t\t$get_bundleinfo = mysql_query(\"SELECT bundleid,bundlename from prodbundlesTB where prod1='$soldprod_id' or prod2='$soldprod_id' or prod3='$soldprod_id' or prod4='$soldprod_id' or prod5='$soldprod_id'\") or die(\"Invalid query for bundle info:\".mysql_error());\r\n\t\twhile($found_in_bundle = mysql_fetch_assoc($get_bundleinfo)) {\r\n\t\t mysql_query(\"update productstb set quantity='$soldprod_left' where prodid=\".$found_in_bundle['bundleid'].\" and quantity>'$soldprod_left'\") or die(\"Invalid query for updating prod info:\".mysql_error());\r\n\t\t}\r\n\t\t$mailstr=\"\";\r\n }\r\n return $mailstr;\r\n}", "function restock($orders_id, $orders_products_id, $products_id, $products_quantity){\n global $osC_Database;\n\n if (STOCK_LIMITED == '1') {\n $error = false;\n\n $osC_Database->startTransaction();\n\n $Qupdate = $osC_Database->query('update :table_products set products_quantity = products_quantity + :products_quantity, products_ordered = products_ordered - :products_ordered where products_id = :products_id');\n $Qupdate->bindTable(':table_products', TABLE_PRODUCTS);\n $Qupdate->bindInt(':products_quantity', $products_quantity);\n $Qupdate->bindInt(':products_ordered', $products_quantity);\n $Qupdate->bindInt(':products_id', $products_id);\n $Qupdate->setLogging($_SESSION['module'], $orders_id);\n $Qupdate->execute();\n\n if (!$osC_Database->isError()) {\n $Qcheck = $osC_Database->query('select products_quantity from :table_products where products_id = :products_id and products_status = 0');\n $Qcheck->bindTable(':table_products', TABLE_PRODUCTS);\n $Qcheck->bindInt(':products_id', $products_id);\n $Qcheck->execute();\n\n if (($Qcheck->numberOfRows() === 1) && ($products_quantity > 0)) {\n $Qstatus = $osC_Database->query('update :table_products set products_status = 1 where products_id = :products_id');\n $Qstatus->bindTable(':table_products', TABLE_PRODUCTS);\n $Qstatus->bindInt(':products_id', $products_id);\n $Qstatus->setLogging($_SESSION['module'], $orders_id);\n $Qstatus->execute();\n\n if ($osC_Database->isError() === true) {\n $error = true;\n }\n }\n }\n\n//restock products variant details\n if ($error === false) {\n $Qvariants = $osC_Database->query('select products_variants_groups_id, products_variants_values_id from :table_orders_products_variants where orders_id = :orders_id and orders_products_id = :orders_products_id order by products_variants_groups_id');\n $Qvariants->bindTable(':table_orders_products_variants', TABLE_ORDERS_PRODUCTS_VARIANTS);\n $Qvariants->bindInt(':orders_id', $orders_id);\n $Qvariants->bindInt(':orders_products_id', $orders_products_id);\n $Qvariants->execute();\n\n if($Qvariants->numberOfRows() > 0){\n $variants = array();\n while ($Qvariants->next()){\n $variants[$Qvariants->value('products_variants_groups_id')] = $Qvariants->value('products_variants_values_id');\n }\n $Qvariants->freeResult();\n\n $osC_Product = new osC_Product($products_id);\n $products_variants_id = $osC_Product->getProductVariantsId($variants);\n\n $QstockUpdate = $osC_Database->query('update :table_products_variants set products_quantity = products_quantity + :products_quantity where products_variants_id = :products_variants_id');\n $QstockUpdate->bindTable(':table_products_variants', TABLE_PRODUCTS_VARIANTS);\n $QstockUpdate->bindInt(':products_quantity', $products_quantity);\n $QstockUpdate->bindInt(':products_variants_id', $products_variants_id);\n $QstockUpdate->setLogging($_SESSION['module'], $orders_id);\n $QstockUpdate->execute();\n\n if ($osC_Database->isError() === true) {\n $error = true;\n }\n\n $Qcheck = $osC_Database->query('select products_quantity from :table_products_variants where products_variants_id = :products_variants_id and products_status = 0');\n $Qcheck->bindTable(':table_products_variants', TABLE_PRODUCTS_VARIANTS);\n $Qcheck->bindInt(':products_variants_id', $products_variants_id);\n $Qcheck->execute();\n\n if ($error === false) {\n if ( ($Qcheck->numberOfRows() === 1) && ($Qcheck->valueInt('products_quantity') > 0) ) {\n $QattribStatus = $osC_Database->query('update :table_products_variants set products_status = 1 where products_variants_id = :products_variants_id');\n $QattribStatus->bindTable(':table_products_variants', TABLE_PRODUCTS_VARIANTS);\n $QattribStatus->bindInt(':products_variants_id', $products_variants_id);\n $QattribStatus->setLogging($_SESSION['module'], $orders_id);\n $QattribStatus->execute();\n\n if ($osC_Database->isError() === true) {\n $error = true;\n }\n }\n }\n }\n }\n\n if ($error === false) {\n $osC_Database->commitTransaction();\n\n return true;\n }\n\n $osC_Database->rollbackTransaction();\n\n return false;\n }else{\n return true;\n }\n }", "static public function feps_pay_now() {\n $amount = 0;\n $property_id = 0;\n $subscription_plan = '';\n //** Extract args */\n $defaults = array(\n 'amount' => 0,\n 'property_id' => 0,\n 'subscription_plan' => ''\n );\n extract( wp_parse_args( $_REQUEST, $defaults ) );\n \n $response = array(\n 'success' => 0,\n 'message' => '',\n 'property_id' => $property_id,\n );\n\n //** Check nonce */\n if ( wp_verify_nonce($_REQUEST['_wpnonce'], 'wpp_feps_pay_now') ) {\n\n //** User should be logged in */\n if ( is_user_logged_in() ) {\n\n //** Load user */\n $user = new WP_User( get_current_user_id() );\n $credits = (float)$user->get( FEPS_USER_CREDITS );\n\n if ( !$property_id ) {\n $response[ 'message' ] = __('Something went wrong. Please, try again later. [Error 001]', ud_get_wpp_feps()->domain);\n die( json_encode( $response ) );\n }\n\n $form_id = get_post_meta( $property_id, FEPS_META_FORM, 1 );\n if ( !$form_id ) {\n $response[ 'message' ] = __('Something went wrong. Please, try again later. [Error 002]', ud_get_wpp_feps()->domain);\n die( json_encode( $response ) );\n }\n \n if( !self::set_subscription_plan( $property_id, $subscription_plan ) ) {\n $response[ 'message' ] = __('Something went wrong. Please, try again later. [Error 003]', ud_get_wpp_feps()->domain);\n die( json_encode( $response ) );\n }\n\n //** If really enough credits */\n if ( $credits >= $amount ) {\n\n //** Try to update post */\n if ( wp_update_post( array( 'ID' => $property_id, 'post_status' => 'publish' ) ) ) {\n $credits -= $amount;\n\n //** Try to decrease balance */\n if ( update_user_meta($user->ID, FEPS_USER_CREDITS, $credits) ) {\n //** Success */\n $response[ 'success' ] = 1;\n $response[ 'message' ] = __( 'Thank you! Your payment has been successfully made.', ud_get_wpp_feps()->domain );\n if( is_user_logged_in() ) {\n $response[ 'message' ] .= ' ' . sprintf( __( '<a href=\"%s\">View %s</a>', ud_get_wpp_feps()->domain ), WPP_F::base_url( FEPS_VIEW_PAGE ), WPP_F::property_label( 'plural' ) );\n }\n die( json_encode( $response ) );\n }\n }\n //** Error */\n $response[ 'message' ] = __('Something went wrong. Please, try again later. [Error 005]', ud_get_wpp_feps()->domain);\n die( json_encode( $response ) );\n }\n //** Error */\n $response[ 'message' ] = __('Not enough credits.', ud_get_wpp_feps()->domain);\n die( json_encode( $response ) );\n\n }\n //** Error */\n $response[ 'message' ] = __('You must be logged in to be able to do this action.', ud_get_wpp_feps()->domain);\n die( json_encode( $response ) );\n }\n //** Error */\n $response[ 'message' ] = __('Something went wrong. Please, try again. [Error 006]', ud_get_wpp_feps()->domain);\n die( json_encode( $response ) );\n }", "public function testSyncProductPrice() {\n $loader = new EcwidRealLoader();\n\n /** @var DummyConnector $connector */\n $connector = $loader->getConnector();\n\n $connector->loadResponseFixture($this->_fixtures['rest_response_syncProductPriceById_success']);\n\n $this->_loadFixture('products');\n /** @var \\PHPUnit\\Framework\\TestCase|DbTestCase|EcwidRestApiTest $this */\n $result = $loader->syncProductPrice(new EcwidProductType((object) ['id' => '1234', 'price' => 0]));\n $this->assertTrue($result);\n\n $connector->loadResponseFixture($this->_fixtures['rest_response_syncProductPriceById_fault']);\n $result = $loader->syncProductPrice(new EcwidProductType((object) ['id' => '1234', 'price' => 0]));\n $this->assertFalse($result);\n\n try {\n $loader->syncProductPrice(new EcwidProductType((object)['id' => '1234']));\n $this->fail();\n } catch (Exception $e) {\n // success\n }\n }", "function aumentarStockEn($idProducto, $cantidad) {\n\trequire_once('conexion.php');\n\t$conexion = new Conexion();\n\t$conexion->conectarBD();\n\t$query = $conexion -> getConexion() -> prepare(\"UPDATE producto SET stock= (stock + ?) WHERE idProducto=?\");\n\t$query->execute(array($cantidad,$idProducto));\n\t$ok = false;\n\tif ($row = $query->fetch(PDO::FETCH_ASSOC)) {\n\t\t$ok = true;\n\t}\n\t$conexion->desconectarBD();\n\treturn $ok;\n}", "public function buy(Request $request)\n {\n // total = total de puntos gastados en la compra\n // id = id del producto\n $datos = $request->only(array_keys($request->all()));\n $rules = [\n 'cantidad' => 'required',\n 'total' => 'required',\n 'id' => 'required'\n ];\n $validator = Validator::make($datos, $rules);\n if($validator->fails()) {\n return response()->json(['meta'=>['code'=>400],'data'=>$validator->messages()],200);\n }\n\n $beneficio = Products::find($request->id);\n if ($request->total > auth()->user()->points) {\n return response()->json(['meta'=>['code'=>202],'data'=>0],200);\n }\n try {\n /*\n * en la tabla exchange_product:\n * amount es el total en pts\n * cost costo unitario del producto en $\n * */\n $Producto = new exchange_product;\n $Producto->product_id = $beneficio->id;\n $Producto->user_id = auth()->user()->id;\n $Producto->amount = $request->total;\n $Producto->cost = $beneficio->cost;\n $Producto->status = \"Aprobado\";\n $Producto->save();\n\n $beneficio->amount = $beneficio->amount - $request->cantidad;\n $beneficio->save();\n\n $user = User::find(auth()->user()->id);\n $user->points = $user->points - $request->total;\n $user->save();\n\n if ($beneficio->bidder_id != 0) {\n $bidder = Bidder::find($beneficio->bidder_id);\n $bidder->pendding_points = $bidder->pendding_points + $request->total;\n $bidder->save();\n }\n return response()->json(['meta'=>['code'=>200],'data'=>1],200);\n } catch (Exception $e) {\n return response()->json(['meta'=>['code'=>500],'data'=>'Ha ocurrido un error: '.$e->getMessage()],200);\n }\n }", "public function syncPacksPriority()\n {\n $stamp = mktime(0, 0, 0);\n $bod = date(DATE_ATOM,$stamp);\n $url_addition = 'LOGPART?$select=PARTNAME&$filter=ITAI_INKATALOG eq \\'Y\\'&$expand=PARTPACK_SUBFORM';\n $response = $this->makeRequest('GET', $url_addition, [], true);\n // check response status\n if ($response['status']) {\n $data = json_decode($response['body_raw'], true);\n foreach($data['value'] as $item) {\n // if product exsits, update\n $args = array(\n 'post_type'\t\t=>\t'product',\n 'meta_query'\t=>\tarray(\n array(\n 'key' => '_sku',\n 'value'\t=>\t$item['PARTNAME']\n )\n )\n );\n $my_query = new \\WP_Query( $args );\n if ( $my_query->have_posts() ) {\n while ( $my_query->have_posts() ) {\n $my_query->the_post();\n $product_id = get_the_ID();\n }\n }else{\n $product_id = 0;\n }\n\n //if ($id = wc_get_product_id_by_sku($item['PARTNAME'])) {\n if(!$product_id == 0){\n update_post_meta($product_id, 'pri_packs', $item['PARTPACK_SUBFORM']);\n }\n }\n }\n }", "function updateTotalBuy($bill){\r\n\t$Table = new Groupbuy_Model_DbTable_Deals;\r\n\t$deal = $Table->find($bill->item_id)->current();\r\n\t\r\n\tif(!is_object($deal)){\r\n\t\tthrow new Exception (\"the deal does not found!\");\r\n\t}\r\n\t\r\n\t$deal->current_sold = $deal->current_sold + $bill->number;\r\n\t\r\n\tif( $deal->current_sold >= $deal->max_sold ){\r\n\t\t$deal->status = 40;\r\n\t\t$deal->end_time = date('Y-m-d H:i:s');\r\n\t}\r\n\t$deal->save();\r\n\treturn $deal;\r\n}", "public function publish(Request $request, $id)\n {\n $item = Item::find($id);\n $published_num = Item::where('is_posted',1)\n ->where('shop_id', $item->shop_id)\n ->count();\n if (!$item) {\n return response()->json(['ret' => 1001, 'errMsg' => '不存在该商品'], 404);\n }elseif($published_num >= $item->shop->max_items_num){\n return response()->json(['ret' => 1002, 'errMsg' => '您已经无法发布更多商品了,请联系客服人员。']);\n } else {\n $item->is_posted = $request->input('type') == 'on' ? 1 : 0;\n $item->save();\n return response()->json(['ret' => 0]);\n }\n }", "public static function inventory_movement($place, $product, $type, $quantity, $name, $transaction, $item, $transaction_code = NULL) {\r\n $product_movement = new \\Solunes\\Store\\App\\InventoryMovement;\r\n $product_movement->place_id = $place->id;\r\n $product_movement->product_id = $product->id;\r\n $product_movement->type = $type;\r\n $product_movement->quantity = $quantity;\r\n $product_movement->name = $name;\r\n $product_movement->save();\r\n\r\n // Stock Product\r\n $real_quantity = $quantity;\r\n if($type=='move_out'){\r\n $real_quantity = -$quantity;\r\n }\r\n if($product_stock = \\Solunes\\Store\\App\\ProductStock::where('parent_id', $product->id)->where('place_id', $place->id)->first()){\r\n $product_stock->quantity = $product_stock->quantity + $real_quantity;\r\n } else {\r\n $product_stock = new \\Solunes\\Store\\App\\ProductStock;\r\n $product_stock->parent_id = $product->id;\r\n $product_stock->place_id = $place->id;\r\n $product_stock->initial_quantity = $quantity;\r\n $product_stock->quantity = $quantity;\r\n }\r\n $product_stock->save();\r\n\r\n // Purchase Product para Capital de Socios\r\n if($transaction!='register_product_purchase'&&$transaction!='register_product_movement'){\r\n $amount = 0;\r\n $purchase_products = $product->purchase_products()->where('status', 'holding')->orderBy('created_at','DESC');\r\n $purchase_products = $purchase_products->get();\r\n $remaining_quantity = $quantity;\r\n foreach($purchase_products as $purchase_product){\r\n // Ajuste de Inventario de Socio y Ganancia\r\n if($remaining_quantity>0){\r\n if($type=='move_out'){\r\n $remaining_quantity = $purchase_product->quantity - $remaining_quantity;\r\n if($remaining_quantity<0){\r\n $remaining_quantity = 0;\r\n $quantity_purchase = $purchase_product->quantity;\r\n } else {\r\n $quantity_purchase = $remaining_quantity;\r\n }\r\n $purchase_product->quantity = $remaining_quantity;\r\n if($transaction=='register_sale_item'){\r\n $paid_amount = $item->total;\r\n $paid_amount -= $item->pending;\r\n if($item->parent->invoice){\r\n $taxes = $paid_amount * 0.16;\r\n $paid_amount -= $taxes;\r\n }\r\n $difference = $purchase_product->transport_investment - $purchase_product->transport_return;\r\n if($paid_amount>0&&$difference > 0){\r\n $paid_amount -= $difference;\r\n if($paid_amount<0){\r\n $difference += $paid_amount;\r\n }\r\n $purchase_product->transport_return = $purchase_product->transport_return + $difference; \r\n } \r\n $difference = $purchase_product->investment - $purchase_product->return;\r\n if($paid_amount>0&&$difference > 0){\r\n $paid_amount -= $difference;\r\n if($paid_amount<0){\r\n $difference += $paid_amount;\r\n }\r\n $purchase_product->return = $purchase_product->return + $difference; \r\n } \r\n if($paid_amount>0){\r\n $purchase_product->profit = $purchase_product->profit + $paid_amount; \r\n } \r\n $max_profit = $purchase_product->investment * ($purchase_product->partner->return_percentage/100);\r\n if($purchase_product->profit>$max_profit){\r\n $purchase_product->profit = $max_profit;\r\n }\r\n } \r\n } else if($type=='move_in'){\r\n $real_quantity = $purchase_product->initial_quantity - $purchase_product->quantity;\r\n $remaining_quantity = $real_quantity - $remaining_quantity;\r\n if($remaining_quantity<0){\r\n $remaining_quantity = 0;\r\n $quantity_purchase = $real_quantity;\r\n } else {\r\n $quantity_purchase = $remaining_quantity;\r\n }\r\n $purchase_product->quantity = $purchase_product->quantity + $quantity_purchase;\r\n if($transaction=='register_refund_item') {\r\n $paid_amount = $item->refund_amount;\r\n if($paid_amount>0&&$purchase_product->profit > 0){\r\n $paid_amount -= $purchase_product->profit;\r\n if($paid_amount<0){\r\n $difference += $paid_amount;\r\n }\r\n $purchase_product->profit = $purchase_product->profit - $difference; \r\n } \r\n $difference = $purchase_product->transport_return - $purchase_product->transport_investment;\r\n if($paid_amount>0&&$difference > 0){\r\n $paid_amount -= $difference;\r\n if($paid_amount<0){\r\n $difference += $paid_amount;\r\n }\r\n $purchase_product->transport_return = $purchase_product->transport_return - $difference; \r\n } \r\n $difference = $purchase_product->transport_return - $purchase_product->transport_investment;\r\n if($paid_amount>0&&$difference > 0){\r\n $paid_amount -= $difference;\r\n if($paid_amount<0){\r\n $difference += $paid_amount;\r\n }\r\n $purchase_product->transport_return = $purchase_product->transport_return - $difference; \r\n } \r\n }\r\n }\r\n $purchase_product->save();\r\n }\r\n }\r\n }\r\n\r\n /* Crear cuentas de inventario */\r\n if($transaction!='register_product_purchase'){\r\n $currency_id = $product->currency_id;\r\n $amount = $product->cost * $quantity;\r\n $asset_stock = \\Solunes\\Store\\App\\Account::getCode('asset_stock')->id;\r\n if($transaction=='register_product_drop'){\r\n $expense_sale = \\Solunes\\Store\\App\\Account::getCode('expense_inventory_loss')->id;\r\n } else {\r\n $expense_sale = \\Solunes\\Store\\App\\Account::getCode('expense_sale')->id;\r\n }\r\n if($type=='move_out'){\r\n $stock_type = 'credit';\r\n $expense_type = 'debit';\r\n } else {\r\n $stock_type = 'debit';\r\n $expense_type = 'credit';\r\n }\r\n $arr[] = \\Store::register_account($place->id, $stock_type, $asset_stock, $currency_id, $amount, $name);\r\n $arr[] = \\Store::register_account($place->id, $expense_type, $expense_sale, $currency_id, $amount, $name);\r\n \\Store::register_account_array($arr, $item->created_at, $transaction_code);\r\n }\r\n }", "public function record_damage($product, array $values){\n $columns = array(\n 'product',\n 'quantity',\n 'details',\n 'img_src'\n );\n\n $record = $this->put($this->damage_tbl, $columns, $values);\n if($record){\n //reduce the stock\n //Stock reduced already by trigger set\n return true;\n }\n\n }", "public static function triggerReffreshment() \n\t{\n\t\t$now = date('Y-m-d H:i:s');\n\t\t$query = 'SELECT id_product FROM `'._DB_PREFIX_.self::TABLE_SPECIFIC_PRICES.'` WHERE date_from<=\\''.pSQL($now).'\\' OR date_to<\\''.pSQL($now).'\\';';\n\t\t$rows = Db::getInstance()->executeS($query);\n\t\tif (self::isIterable($rows)) {\n\t\t\tforeach ($rows as $row) {\n\t\t\t\t// Clear product cache and linkning pages because price has changed\n\t\t\t\tself::clearCacheOfObject('product', $row['id_product'], true);\n\t\t\t}\n\t\t\tif (count($rows) > 0) {\n\t\t\t\t$query = 'UPDATE `'._DB_PREFIX_.self::TABLE_SPECIFIC_PRICES.'` SET date_from=\\'6666-01-01 00:00:00\\' WHERE date_from<=\\''.pSQL($now).'\\';';\n\t\t\t\tDb::getInstance()->execute($query);\n\t\t\t\t$query = 'UPDATE `'._DB_PREFIX_.self::TABLE_SPECIFIC_PRICES.'` SET date_to=\\'6666-01-01 00:00:00\\' WHERE date_to<\\''.pSQL($now).'\\';';\n\t\t\t\tDb::getInstance()->execute($query);\n\t\t\t\t// Clean useless rows\n\t\t\t\t$query = 'DELETE FROM `'._DB_PREFIX_.self::TABLE_SPECIFIC_PRICES.'` WHERE date_from=\\'6666-01-01 00:00:00\\' AND date_to=\\'6666-01-01 00:00:00\\';';\n\t\t\t\tDb::getInstance()->execute($query);\n\t\t\t}\n\t\t}\n\t}", "public function test_handleCartActions_changeAmount(){\r\n $db = new TestCrud();\r\n $productId = '1';\r\n $_POST['product_id'] = $productId;\r\n $_POST['action'] = 'change_amount';\r\n $_POST['amount'] = 3;\r\n $_SESSION['products'] = array($productId=>2);\r\n $_SESSION['userId'] = '1';\r\n $productQuantity = $_SESSION['products'][$productId];\r\n $pageModel = new PageModel(null, new TestRequest(), 'test.txt');\r\n $productModel = new ProductModel($pageModel, $db);\r\n \r\n $productModel->handleCartActions();\r\n \r\n $this->assertNotEquals($productQuantity, $_SESSION['products'][$productId], 'is the amount of a product changed?');\r\n }", "public function disStock($id,$cant){\n $product = Product:: findOrFail($id);\n\n $product->unity = $product->unity - $cant;\n\n $product->save();\n\n return $product;\n }", "public function testUpdateSmartTransaction()\n {\n $receivedTransaction = self::$SmartTransactionsProductModel;\n\n $transactionDTO = new SmartTransactionsDTO();\n\n $transactionDTO->setMerchant($receivedTransaction->getMerchant());\n $transactionDTO->setContract(new ProductInstanceID(['id' => self::$SmartTransactionsProductModel->getContract()->getId()]));\n\n $price = rand(10, 1000);\n\n $basketInfo = new SmartTransactionsBasketInfo();\n $basketInfo->setSum($price);\n $basketInfo->setCurrency('EUR');\n\n\n $basket = new SmartTransactionsBasket();\n $product1 = new SmartTransactionsBasketProduct();\n $product1->setId(1);\n $product1->setDesc('Roggenbärchen');\n $product1->setArticleNumber('433');\n $product1->setQuantity(1);\n $product1->setPriceOne($price);\n $product1->setTax(700);\n $basket->setProducts([$product1]);\n\n $transactionDTO->setBasket($basket);\n $transactionDTO->setBasketInfo($basketInfo);\n\n try {\n $updatedTransaction = self::$api->updateTransaction($receivedTransaction->getId(), $transactionDTO);\n } catch (ApiException $e) {\n print_r($e->getResponseBody());\n throw $e;\n }\n\n $this->assertNotEmpty($updatedTransaction);\n $this->assertInstanceOf(SmartTransactionsProductModel::class, $updatedTransaction);\n $this->assertEquals(self::SMART_TRANSACTIONS, $updatedTransaction->getObject());\n $this->assertNotEmpty($updatedTransaction->getId());\n\n $this->assertEquals($basketInfo, $updatedTransaction->getBasketInfo());\n\n $this->assertCount(1, $updatedTransaction->getBasket()->getProducts());\n $expected_basket = $basket->getProducts()[0];\n $current_basket = $updatedTransaction->getBasket()->getProducts()[0];\n\n $this->assertEquals($expected_basket->getId(), $current_basket->getId());\n $this->assertEquals($expected_basket->getParent(), $current_basket->getParent());\n $this->assertEquals($expected_basket->getDesc(), $current_basket->getDesc());\n $this->assertEquals($expected_basket->getArticleNumber(), $current_basket->getArticleNumber());\n $this->assertEquals($expected_basket->getSerialNumber(), $current_basket->getSerialNumber());\n $this->assertEquals($expected_basket->getQuantity(), $current_basket->getQuantity());\n $this->assertEquals($expected_basket->getPriceOne(), $current_basket->getPriceOne());\n $this->assertEquals($expected_basket->getSum(), $current_basket->getSum());\n $this->assertEquals($expected_basket->getTax(), $current_basket->getTax());\n $this->assertEquals($expected_basket->getReferenceId(), $current_basket->getReferenceId());\n $this->assertEquals($expected_basket->getContractId(), $current_basket->getContractId());\n $this->assertEquals($expected_basket->getSubBasket(), $current_basket->getSubBasket());\n $this->assertEquals('article', $current_basket->getItemType());\n $this->assertEmpty($current_basket->getEan());\n $this->assertEmpty($current_basket->getGroup());\n }", "function aumentarStock($idProducto) {\n\trequire_once('conexion.php');\n\t$conexion = new Conexion();\n\t$conexion->conectarBD();\n\t$query = $conexion -> getConexion() -> prepare(\"UPDATE producto SET stock= (stock + 1) WHERE idProducto=?\");\n\t$query->execute(array($idProducto));\n\t$ok = false;\n\tif ($row = $query->fetch(PDO::FETCH_ASSOC)) {\n\t\t$ok = true;\n\t}\n\t$conexion->desconectarBD();\n\treturn $ok;\n}" ]
[ "0.61765885", "0.6134069", "0.61333364", "0.6093462", "0.59413713", "0.592558", "0.5822742", "0.5790031", "0.5778419", "0.57766587", "0.57511204", "0.5740384", "0.5732991", "0.57262635", "0.568578", "0.566866", "0.5646289", "0.564577", "0.56334037", "0.5630919", "0.5611126", "0.5606145", "0.55738175", "0.55505383", "0.5532707", "0.5528592", "0.55209976", "0.5518981", "0.5509768", "0.5498796" ]
0.74323744
0
Try adding a new attribute to a product, existing variations that do not have an option set for the new attribute should be disabled
function testVariationsDisabledAfterAttributeAdded() { $this->loginAs('admin'); $teeshirtA = $this->objFromFixture('Product', 'teeshirtA'); $variations = $teeshirtA->Variations(); $this->assertTrue($variations->exists()); foreach ($variations as $variation) { $this->assertTrue($variation->isEnabled()); } //Add an attribute $cutAttribute = $this->objFromFixture('Attribute', 'attrCut'); $existingAttributes = $teeshirtA->getManyManyComponents('Attributes'); $existingAttributes->add($cutAttribute); $teeshirtA->writeComponents(); //Add the default options for the new attribute $existingOptions = $teeshirtA->getComponents('Options'); $defaultOptions = DataObject::get('Option', "ProductID = 0 AND AttributeID = 4"); foreach ($defaultOptions as $option) { $existingOptions->add($option); } $teeshirtA->writeComponents(); $teeshirtA->write(); foreach ($teeshirtA->Variations() as $variation) { $this->assertTrue(!$variation->isEnabled()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCreateProductAttribute()\n {\n $this->executeScenario();\n }", "private function ProcessAttributes() {\n\t\t$csvilog = JRequest::getVar('csvilog');\n\t\t/* Check if the attributes is to be added */\n\t\tif ($this->attributes) {\n\t\t\t$csvfields = JRequest::getVar('csv_fields');\n\t\t\t$csvilog->AddMessage('debug', JText::_('DEBUG_ADDING_ATTRIBUTES'));\n\t\t\t$attributes = explode( \"|\", $this->attributes );\n\t\t\t$i = 0;\n\t\t\twhile(list(,$val) = each($attributes)) {\n\t\t\t\t$values = explode( \"::\", $val );\n\t\t\t\tif (count($values) == 2) {\n\t\t\t\t\t/* Fix the array to show the correct names to bind the data */\n\t\t\t\t\t$this->_vm_product_attribute_sku->bind(array('product_id' => $this->product_id, 'attribute_name' => $values[0], 'attribute_list' => $values[1]));\n\t\t\t\t\t/* Store the data */\n\t\t\t\t\t$this->_vm_product_attribute_sku->store();\n\t\t\t\t\t$csvilog->AddMessage('debug', JText::_('DEBUG_STORE_ATTRIBUTE'), true);\n\t\t\t\t\t/* Clean for new insert */\n\t\t\t\t\t$this->_vm_product_attribute_sku->reset();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$csvilog->AddMessage('debug', JText::_('DEBUG_ATTRIBUTE_INCORRECT'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function updateOptions()\n {\n $scrappageCollection = Mage::getModel('scrappagescheme/scrap')->getCollection()\n ->addFieldToFilter('scrap_status', 0)\n ->addFieldToFilter('percentage', array('gt' => 0))\n ->setOrder('scrap_id', 'asc');\n\n Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);\n $successCount = $failedCount = $errorCount = 1;\n\n if (count($scrappageCollection)) {\n foreach ($scrappageCollection as $data) {\n $product = Mage::getModel('catalog/product')->getCollection()\n ->addAttributeToSelect('*')\n ->addAttributeToFilter('price', array('gt' => 0))\n ->addAttributeToFilter('sku', array('eq' => $data['sku']))->getFirstItem();\n\n if ($product->getName()) {\n\n $optionInstance = $product->getOptionInstance()->unsetOptions();\n $product->setHasOptions(1);\n\n $option = $this->getProductOption($data['percentage']);\n\n if (isset($option['is_require']) && ($option['is_require'] == 1)) {\n $product->setRequiredOptions(1);\n }\n $product->setPay4leterEnable(360);\n $product->setPay4leterPlans(407);\n\n $optionInstance->addOption($option);\n $optionInstance->setProduct($product);\n try {\n\n $product->save();\n\n Mage::getModel('scrappagescheme/scrap')->load($data['scrap_id'])->setStatus(1)->save();\n\n // Success\n Mage::log('Name :' . $product->getName(), null, 'MarchScrappageSuccessProducts.log', true);\n Mage::log('Sku :' . $product->getSku(), null, 'MarchScrappageSuccessProducts.log', true);\n Mage::log('Price :' . $product->getPrice(), null, 'MarchScrappageSuccessProducts.log', true);\n Mage::log('Count :' . $successCount++, null, 'MarchScrappageSuccessProducts.log', true);\n Mage::log('-----------------------------', null, 'MarchScrappageSuccessProducts.log', true);\n\n } catch (Exception $e) {\n\n // Error\n Mage::log($product->getId(), null, 'MarchScrappageErrorProducts.log', true);\n Mage::log($data['sku'] . ' ::' . $data['sku'], null, 'MarchScrappageErrorProducts.log', true);\n Mage::log($errorCount++, null, 'MarchScrappageSuccessProducts.log', true);\n Mage::log('-----------------------------', null, 'MarchScrappageErrorProducts.log', true);\n\n }\n\n } else {\n // Failed\n Mage::log('Name :' . $data['name'], null, 'MarchScrappageFailedProducts.log', true);\n Mage::log('Sku :' . $data['sku'], null, 'MarchScrappageFailedProducts.log', true);\n Mage::log('Count :' . $failedCount++, null, 'MarchScrappageFailedProducts.log', true);\n Mage::log('-----------------------------', null, 'MarchScrappageFailedProducts.log', true);\n }\n\n Mage::log('Name :' . $data['name'], null, 'MarchScrappageRunProductList.log', true);\n Mage::log('Sku :' . $data['sku'], null, 'MarchScrappageRunProductList.log', true);\n Mage::log('-----------------------------', null, 'MarchScrappageRunProductList.log', true);\n }\n } else {\n Mage::log('=============END===============', null, 'MarchScrappageCompleted.log', true);\n }\n }", "function wvs_variable_item( $type, $options, $args, $saved_attribute = array() ) {\n\n // $this->debug($type);\n // $this->debug($options);\n\n // $this->debug($args['product']);\n\n // echo 'CustomYes';\n // $productObject = wc_get_product( '4788' );\n // $this->debug( $productObject );\n\n // $this->debug($saved_attribute);\n\n $product = $args['product'];\n $attribute = $args['attribute'];\n $data = '';\n $is_archive = ( isset( $args['is_archive'] ) && $args['is_archive'] );\n $show_archive_tooltip = (bool) woo_variation_swatches()->get_option( 'show_tooltip_on_archive' );\n $linkable_attribute = ( (bool) woo_variation_swatches()->get_option( 'linkable_attribute' ) && ( woo_variation_swatches()->get_option( 'trigger_catalog_mode' ) == 'hover' ) );\n\n $product_url = $product->get_permalink();\n $attribute_name = wc_variation_attribute_name( $attribute );\n\n if ( ! empty( $options ) ) {\n $name = uniqid( wc_variation_attribute_name( $attribute ) );\n $display_count = 0;\n\n // $this->debug($product);\n // $this->debug($attribute);\n // $this->debugDump(taxonomy_exists( $attribute ));\n\n if ( $product && taxonomy_exists( $attribute ) ) {\n\n $terms = wc_get_product_terms( $product->get_id(), $attribute, array( 'fields' => 'all' ) );\n $total_terms = count( $terms );\n foreach ( $terms as $term ) {\n if ( in_array( $term->slug, $options, true ) ) {\n\n $term_id = $term->term_id;\n\n $type = isset( $saved_attribute['terms'][ $term_id ]['type'] ) ? $saved_attribute['terms'][ $term_id ]['type'] : $type;\n\n $is_selected = ( sanitize_title( $args['selected'] ) == $term->slug );\n $selected_class = $is_selected ? 'selected' : '';\n $screen_reader_html_attr = $is_selected ? ' aria-checked=\"true\"' : ' aria-checked=\"false\"';\n $data_url = '';\n if ( $linkable_attribute && $is_archive ) {\n $url = esc_url( add_query_arg( $attribute_name, $term->slug, $product_url ) );\n $data_url = sprintf( ' data-url=\"%s\"', $url );\n }\n\n // Tooltip\n // from attributes\n $default_tooltip_type = get_term_meta( $term_id, 'show_tooltip', true );\n $default_tooltip_type = empty( $default_tooltip_type ) ? 'text' : $default_tooltip_type;\n\n // from product attribute\n $default_tooltip_type = ( isset( $saved_attribute['show_tooltip'] ) && ! empty( $saved_attribute['show_tooltip'] ) ) ? $saved_attribute['show_tooltip'] : $default_tooltip_type;\n\n // from attribute\n $default_tooltip_text = trim( get_term_meta( $term_id, 'tooltip_text', true ) );\n // from attribute fallback\n $default_tooltip_text = empty( $default_tooltip_text ) ? trim( apply_filters( 'wvs_variable_item_tooltip', $term->name, $term, $args ) ) : $default_tooltip_text;\n\n // from attribute\n $default_tooltip_image = trim( get_term_meta( $term_id, 'tooltip_image', true ) );\n\n\n // from product attribute item\n $tooltip_type = ( isset( $saved_attribute['terms'][ $term_id ] ) && ! empty( $saved_attribute['terms'][ $term_id ]['tooltip_type'] ) ) ? trim( $saved_attribute['terms'][ $term_id ]['tooltip_type'] ) : $default_tooltip_type;\n $tooltip_text = ( isset( $saved_attribute['terms'][ $term_id ] ) && ! empty( $saved_attribute['terms'][ $term_id ]['tooltip_text'] ) ) ? trim( $saved_attribute['terms'][ $term_id ]['tooltip_text'] ) : $default_tooltip_text;\n $tooltip_image = ( isset( $saved_attribute['terms'][ $term_id ] ) && ! empty( $saved_attribute['terms'][ $term_id ]['tooltip_image'] ) ) ? trim( $saved_attribute['terms'][ $term_id ]['tooltip_image'] ) : $default_tooltip_image;\n\n // from product attribute item\n\n if ( isset( $saved_attribute['terms'][ $term_id ] ) && empty( $saved_attribute['terms'][ $term_id ]['tooltip_type'] ) ) {\n $tooltip_type = $default_tooltip_type;\n $tooltip_text = $default_tooltip_text;\n }\n\n $show_tooltip = ! empty( $tooltip_type ) || $tooltip_type !== 'no';\n\n if ( $is_archive ) {\n $show_tooltip = $show_archive_tooltip;\n }\n\n $tooltip_html_attr = '';\n $tooltip_html_attr .= ( $show_tooltip && $tooltip_text && $tooltip_type == 'text' ) ? sprintf( ' data-wvstooltip=\"%s\"', esc_attr( $tooltip_text ) ) : '';\n\n $tooltip_image_width = absint( woo_variation_swatches()->get_option( 'tooltip_image_width' ) );\n\n $tooltip_image_size = apply_filters( 'wvs_tooltip_image_size', array(\n $tooltip_image_width,\n $tooltip_image_width\n ) );\n // $tooltip_image_width = apply_filters( 'wvs_tooltip_image_width', sprintf( '%dpx', $tooltip_image_width ) );\n\n $tooltip_html_image = ( $show_tooltip && $tooltip_type == 'image' && $tooltip_image ) ? wp_get_attachment_image_src( $tooltip_image, $tooltip_image_size ) : false;\n\n if ( wp_is_mobile() ) {\n $tooltip_html_attr .= ( $show_tooltip ) ? ' tabindex=\"2\"' : '';\n }\n\n // More...\n if ( $is_archive && wvs_archive_swatches_has_more( $display_count ) ) {\n $data .= wvs_archive_swatches_more( $product->get_id(), $total_terms );\n break;\n }\n\n if ( ! empty( $tooltip_html_image ) ):\n // $tooltip_html_attr .= sprintf( ' style=\"--tooltip-background: url(\\'%s\\'); --tooltip-width: %spx; --tooltip-height: %spx;\"', $tooltip_html_image[ 0 ], $tooltip_html_image[ 1 ], $tooltip_html_image[ 2 ] );\n $tooltip_html_attr .= sprintf( ' style=\"--tooltip-background: url(\\'%s\\'); --tooltip-width: %spx; --tooltip-height: %spx;\"', $tooltip_html_image[0], $tooltip_image_width, $tooltip_image_width );\n $selected_class .= ' wvs-has-image-tooltip';\n endif;\n\n\n $data .= sprintf( '<li %1$s class=\" %2$s-variable-item-%3$s %4$s\" data-title=\"%5$s\" title=\"%5$s\" data-value=\"%3$s\" role=\"radio\" tabindex=\"0\">\n <div class=\"variable-item %2$s-variable-item\">\n <div class=\"variable-item-contents\">', $data_url . $screen_reader_html_attr . $tooltip_html_attr, esc_attr( $type ), esc_attr( $term->slug ), esc_attr( $selected_class ), esc_html( $term->name ) );\n\n /*if ( ! empty( $tooltip_html_image ) ):\n $data .= '<span style=\"width: ' . $tooltip_image_width . '\" class=\"image-tooltip-wrapper\"><img alt=\"' . $term->name . '\" src=\"' . $tooltip_html_image[ 0 ] . '\" width=\"' . $tooltip_html_image[ 1 ] . '\" height=\"' . $tooltip_html_image[ 2 ] . '\" /></span>';\n // $data .= '<span style=\"width: ' . $tooltip_image_width . '\" class=\"image-tooltip-wrapper\">' . $tooltip_html_image . '</span>';\n endif;*/\n\n switch ( $type ):\n case 'color':\n $global_color = sanitize_hex_color( get_term_meta( $term->term_id, 'product_attribute_color', true ) );\n $global_is_dual = (bool) ( get_term_meta( $term->term_id, 'is_dual_color', true ) === 'yes' );\n $global_secondary_color = sanitize_hex_color( get_term_meta( $term->term_id, 'secondary_color', true ) );\n\n $color = ( isset( $saved_attribute['terms'][ $term_id ] ) && ! empty( $saved_attribute['terms'][ $term_id ]['color'] ) ) ? $saved_attribute['terms'][ $term_id ]['color'] : $global_color;\n $is_dual = ( isset( $saved_attribute['terms'][ $term_id ] ) && isset( $saved_attribute['terms'][ $term_id ]['is_dual_color'] ) && ( $saved_attribute['terms'][ $term_id ]['is_dual_color'] ) === 'yes' ) ? $saved_attribute['terms'][ $term_id ]['is_dual_color'] : $global_is_dual;\n $secondary_color = ( isset( $saved_attribute['terms'][ $term_id ] ) && ! empty( $saved_attribute['terms'][ $term_id ]['secondary_color'] ) ) ? $saved_attribute['terms'][ $term_id ]['secondary_color'] : $global_secondary_color;\n\n if ( $is_dual ) {\n $data .= sprintf( '<span class=\"variable-item-span variable-item-span-%1$s variable-item-span-dual-color\" style=\"background: linear-gradient(-45deg, %2$s 0%%, %2$s 50%%, %3$s 50%%, %3$s 100%%);\"></span>', esc_attr( $type ), esc_attr( $secondary_color ), esc_attr( $color ) );\n } else {\n $data .= sprintf( '<span class=\"variable-item-span variable-item-span-%s\" style=\"background-color:%s;\"></span>', esc_attr( $type ), esc_attr( $color ) );\n }\n\n break;\n\n case 'image':\n\n $global_attachment_id = apply_filters( 'wvs_product_global_attribute_image_id', absint( get_term_meta( $term->term_id, 'product_attribute_image', true ) ), $term, $args );\n\n $attachment_id = ( isset( $saved_attribute['terms'][ $term_id ] ) && ! empty( $saved_attribute['terms'][ $term_id ]['image_id'] ) ) ? $saved_attribute['terms'][ $term_id ]['image_id'] : $global_attachment_id;\n\n $global_image_size = woo_variation_swatches()->get_option( 'attribute_image_size' );\n\n $image_size = ( isset( $saved_attribute['image_size'] ) && ! empty( $saved_attribute['image_size'] ) ) ? $saved_attribute['image_size'] : $global_image_size;\n\n $image_html = wp_get_attachment_image_src( $attachment_id, apply_filters( 'wvs_product_attribute_image_size', $image_size, $attribute, $product ) );\n\n $data .= sprintf( '<img aria-hidden=\"true\" alt=\"%s\" src=\"%s\" width=\"%d\" height=\"%d\" />', esc_attr( $term->name ), esc_url( $image_html[0] ), $image_html[1], $image_html[2] );\n\n break;\n\n case 'button':\n $data .= sprintf( '<span class=\"variable-item-span variable-item-span-%s\">%s</span>', esc_attr( $type ), esc_html( $term->name ) );\n break;\n\n case 'radio':\n $id = uniqid( $term->slug );\n $data .= sprintf( '<input name=\"%1$s\" id=\"%2$s\" class=\"wvs-radio-variable-item\" %3$s type=\"radio\" value=\"%4$s\" data-value=\"%4$s\" /><label for=\"%2$s\">%5$s</label>', $name, $id, checked( sanitize_title( $args['selected'] ), $term->slug, false ), esc_attr( $term->slug ), esc_html( $term->name ) );\n break;\n\n default:\n $data .= apply_filters( 'wvs_variable_default_item_content', '', $term, $args );\n break;\n endswitch;\n\n if ( (bool) woo_variation_swatches()->get_option( 'show_variation_stock_info' ) ) {\n $data .= '<span class=\"wvs-stock-left-info\" data-wvs-stock-info=\"\"></span>';\n }\n\n $data .= '</div>';\n $data .= '</div>';\n\n $data .= $this->outputSingleProductVariationInfo($data);\n\n $data .= '</li>';\n\n $display_count ++;\n }\n }\n } else {\n // Custom Attributes\n\n $terms = ! empty( $saved_attribute['terms'] ) ? (array) $saved_attribute['terms'] : array();\n // $total_terms = count( $terms );\n $total_terms = count( $options );\n // foreach ( $terms as $term_id => $term )\n\n foreach ( $options as $option ) {\n\n $term_id = trim( $option );\n $term = $terms[ $option ];\n\n $type = isset( $term['type'] ) ? $term['type'] : $saved_attribute['type'];\n\n $is_selected = ( sanitize_title( $args['selected'] ) == $term_id );\n $selected_class = $is_selected ? 'selected' : '';\n $screen_reader_html_attr = $is_selected ? ' aria-checked=\"true\"' : ' aria-checked=\"false\"';\n $data_url = '';\n if ( $linkable_attribute && $is_archive ) {\n $url = esc_url( add_query_arg( $attribute_name, $term_id, $product_url ) );\n $data_url = sprintf( ' data-url=\"%s\"', $url );\n }\n // Tooltip\n\n $default_tooltip_type = ( isset( $saved_attribute['show_tooltip'] ) && ! empty( $saved_attribute['show_tooltip'] ) ) ? $saved_attribute['show_tooltip'] : 'text';\n $default_tooltip_text = trim( apply_filters( 'wvs_color_variable_item_tooltip', $term_id, $term, $args ) );\n\n // from product attribute item\n $tooltip_type = ( isset( $term['tooltip_type'] ) && ! empty( $term['tooltip_type'] ) ) ? trim( $term['tooltip_type'] ) : $default_tooltip_type;\n $tooltip_text = ( isset( $term['tooltip_text'] ) && ! empty( $term['tooltip_text'] ) ) ? trim( $term['tooltip_text'] ) : $default_tooltip_text;\n\n if ( isset( $term['tooltip_type'] ) && empty( $term['tooltip_type'] ) ) {\n $tooltip_type = $default_tooltip_type;\n $tooltip_text = $default_tooltip_text;\n }\n\n $tooltip_image = ( isset( $term['tooltip_image'] ) && ! empty( $term['tooltip_image'] ) ) ? trim( $term['tooltip_image'] ) : false;\n\n $show_tooltip = ! empty( $tooltip_type ) || $tooltip_type !== 'no';\n\n if ( $is_archive ) {\n $show_tooltip = $show_archive_tooltip;\n }\n\n $tooltip_html_attr = '';\n $tooltip_html_attr .= ( $show_tooltip && $tooltip_text && $tooltip_type == 'text' ) ? sprintf( ' data-wvstooltip=\"%s\"', esc_attr( $tooltip_text ) ) : '';\n\n $tooltip_image_width = absint( woo_variation_swatches()->get_option( 'tooltip_image_width' ) );\n\n $tooltip_image_size = apply_filters( 'wvs_tooltip_image_size', array(\n $tooltip_image_width,\n $tooltip_image_width\n ) );\n // $tooltip_image_width = apply_filters( 'wvs_tooltip_image_width', sprintf( '%dpx', $tooltip_image_width ) );\n\n //$tooltip_html_image = ( $show_tooltip && $tooltip_type == 'image' && $tooltip_image ) ? wp_get_attachment_image_url( $tooltip_image, $tooltip_image_size ) : false;\n $tooltip_html_image = ( $show_tooltip && $tooltip_type == 'image' && $tooltip_image ) ? wp_get_attachment_image_src( $tooltip_image, $tooltip_image_size ) : false;\n\n if ( wp_is_mobile() ) {\n $tooltip_html_attr .= ( $show_tooltip ) ? ' tabindex=\"2\"' : '';\n }\n\n\n // More...\n if ( $is_archive && wvs_archive_swatches_has_more( $display_count ) ) {\n $data .= wvs_archive_swatches_more( $product->get_id(), $total_terms );\n break;\n }\n\n if ( ! empty( $tooltip_html_image ) ):\n // $tooltip_html_attr .= sprintf( ' style=\"--tooltip-background: url(\\'%s\\'); --tooltip-width: %spx; --tooltip-height: %spx;\"', $tooltip_html_image[ 0 ], $tooltip_html_image[ 1 ], $tooltip_html_image[ 2 ] );\n $tooltip_html_attr .= sprintf( ' style=\"--tooltip-background: url(\\'%s\\'); --tooltip-width: %spx; --tooltip-height: %spx;\"', $tooltip_html_image[0], $tooltip_image_width, $tooltip_image_width );\n $selected_class .= ' wvs-has-image-tooltip';\n endif;\n\n $data .= sprintf( '<li %1$s class=\"%2$s-variable-item-%3$s %4$s\" data-title=\"%5$s\" title=\"%5$s\" data-value=\"%5$s\" role=\"radio\" tabindex=\"0\">\n <div class=\"variable-item %2$s-variable-item\">\n <div class=\"variable-item-contents\">', $data_url . $screen_reader_html_attr . $tooltip_html_attr, esc_attr( $type ), sanitize_title( $term_id ), esc_attr( $selected_class ), esc_html( $term_id ) );\n\n /*if ( ! empty( $tooltip_html_image ) ):\n $data .= '<span style=\"width: ' . $tooltip_image_width . '\" class=\"image-tooltip-wrapper\"><img alt=\"' . $term_id . '\" src=\"' . $tooltip_html_image[ 0 ] . '\" width=\"' . $tooltip_html_image[ 1 ] . '\" height=\"' . $tooltip_html_image[ 2 ] . '\" /></span>';\n // $data .= '<span style=\"width: ' . $tooltip_image_width . '\" class=\"image-tooltip-wrapper\">' . $tooltip_html_image . '</span>';\n endif;*/\n\n switch ( $type ):\n case 'color':\n\n $color = $term['color'];\n $is_dual = $term['is_dual_color'];\n $secondary_color = $term['secondary_color'];\n\n if ( $is_dual ) {\n $data .= sprintf( '<span class=\"variable-item-span variable-item-span-color variable-item-span-dual-color\" style=\"background: linear-gradient(-45deg, %1$s 0%%, %1$s 50%%, %2$s 50%%, %2$s 100%%);\"></span>', esc_attr( $secondary_color ), esc_attr( $color ) );\n } else {\n $data .= sprintf( '<span class=\"variable-item-span variable-item-span-color\" style=\"background-color:%s;\"></span>', esc_attr( $color ) );\n }\n break;\n\n case 'image':\n\n $attachment_id = $term['image_id'];\n\n $global_image_size = woo_variation_swatches()->get_option( 'attribute_image_size' );\n\n $image_size = ( isset( $saved_attribute['image_size'] ) && ! empty( $saved_attribute['image_size'] ) ) ? $saved_attribute['image_size'] : $global_image_size;\n\n $image_html = wp_get_attachment_image_src( $attachment_id, apply_filters( 'wvs_product_attribute_image_size', $image_size, $attribute, $product ) );\n\n $data .= sprintf( '<img aria-hidden=\"true\" alt=\"%s\" src=\"%s\" width=\"%d\" height=\"%d\" />', esc_attr( $term_id ), esc_url( $image_html[0] ), $image_html[1], $image_html[2] );\n\n break;\n\n case 'button':\n $data .= sprintf( '<span class=\"variable-item-span variable-item-span-button\">%s</span>', esc_html( $term_id ) );\n break;\n\n case 'radio':\n $id = uniqid( sanitize_title( $term_id ) );\n $data .= sprintf( '<input name=\"%1$s\" id=\"%2$s\" class=\"wvs-radio-variable-item\" %3$s type=\"radio\" value=\"%4$s\" data-value=\"%4$s\" /><label for=\"%2$s\">%5$s</label>', $name, $id, checked( sanitize_title( $args['selected'] ), $term_id, true ), esc_attr( $term_id ), esc_html( $term_id ) );\n break;\n\n default:\n $data .= apply_filters( 'wvs_variable_default_item_content', '', $term_id, $args );\n break;\n endswitch;\n\n if ( (bool) woo_variation_swatches()->get_option( 'show_variation_stock_info' ) ) {\n $data .= '<span class=\"wvs-stock-left-info\" data-wvs-stock-info=\"\"></span>';\n }\n\n \n $data .= '</div>';\n $data .= '</div>';\n\n $data .= $this->outputSingleProductVariationInfo($data);\n\n $data .= '</li>';\n\n\n $display_count ++;\n }\n\n \n if($this->isDebug()){\n $this->debug($options);\n $this->debug($attribute);\n $this->debug($product);\n $variations = $product->get_available_variations();\n $this->debug($variations);\n }\n }\n }\n\n if($this->isDebug()){\n\n $loop = 0;\n // $product_id = absint( $_POST['product_id'] );\n // $post = get_post( $product_id ); // phpcs:ignore\n $product_object = $product;\n $productID = $product->get_id();\n\n $variations = wc_get_products(\n array(\n 'status' => array( 'private', 'publish' ),\n 'type' => 'variation',\n 'parent' => $productID,\n 'limit' => -1,\n 'orderby' => array(\n 'menu_order' => 'ASC',\n 'ID' => 'DESC',\n ),\n 'return' => 'objects',\n )\n );\n\n echo '<pre>';\n print_r($variations);\n echo '</pre>';\n \n }\n\n // if ( $variations ) {\n // wc_render_invalid_variation_notice( $product_object );\n\n // foreach ( $variations as $variation_object ) {\n // $variation_id = $variation_object->get_id();\n // $variation = get_post( $variation_id );\n // $variation_data = array_merge( get_post_custom( $variation_id ), wc_get_product_variation_attributes( $variation_id ) ); // kept for BW compatibility.\n // include __DIR__ . '/admin/meta-boxes/views/html-variation-admin.php';\n // $loop++;\n // }\n // }\n\n // $this->debug($variations);\n\n\n return apply_filters( 'wvs_variable_item', $data, $type, $options, $args, $saved_attribute );\n }", "public function getAttributeOptions(\\Magento\\Eav\\Model\\Entity\\Attribute\\AbstractAttribute $attribute, $productId);", "public function addUserProductAttributesToNewGroup()\n {\n //Data\n $groupName = $this->generate('string', 5, ':lower:') . '_test_group';\n $attrData = $this->loadData('product_attributes', null, array('attribute_code', 'admin_title'));\n $setData = $this->loadData('attribute_set', null, 'set_name');\n $attrCodes = array();\n foreach ($attrData as $key => $value) {\n if (is_array($value) && array_key_exists('attribute_code', $value)) {\n $attrCodes[] = $value['attribute_code'];\n }\n }\n $setData['associated_attributes'][$groupName] = $attrCodes;\n //Steps\n $this->navigate('manage_attributes');\n foreach ($attrData as $value) {\n $this->productAttributeHelper()->createAttribute($value);\n //Verifying\n $this->assertMessagePresent('success', 'success_saved_attribute');\n }\n //Steps\n $this->assertPreConditions();\n $this->attributeSetHelper()->createAttributeSet($setData);\n //Verifying\n $this->assertMessagePresent('success', 'success_attribute_set_saved');\n\n return $setData;\n }", "public function testProductVariantAddAttributes(string $name, array $options, array $values)\n {\n /** @var MageProduct $model */\n $model = MageHelper::getModel(MageProduct::class);\n //====================================================================//\n // Debug => Delete Attribute\n if (!in_array($name, array(\"VariantA\", \"VariantB\"), true)) {\n $initAttribute = $model->getAttribute($name);\n if ($initAttribute) {\n $initAttribute->delete();\n }\n }\n //====================================================================//\n // Load Product Attribute\n $attribute = $model->getAttribute($name);\n //====================================================================//\n // Create Configurable Attribute\n if (!$attribute) {\n AttributesHelper::addConfigurableAttribute($name, array(\"option\" => $options));\n $attribute = $model->getAttribute($name);\n }\n $this->assertInstanceOf(Attribute::class, $attribute);\n AttributesHelper::addAttributeToSet($attribute, 4, \"Product Details\");\n //====================================================================//\n // Verify Attribute\n $this->assertTrue($attribute->isScopeGlobal());\n $this->assertEquals(1, $attribute->getIsUserDefined());\n $this->assertEquals(\"select\", $attribute->getFrontendInput());\n $this->assertNotEmpty($attribute->getOptions());\n //====================================================================//\n // Add Attribute Options\n foreach ($values as $value => $label) {\n //====================================================================//\n // Check if Option Exists\n if (AttributesHelper::getValueFromLabel($attribute, $label)) {\n continue;\n }\n $this->assertTrue(\n AttributesHelper::addAttributeOption($attribute, $value, $label)\n );\n }\n //====================================================================//\n // Verify Attribute\n $this->assertInstanceOf(Attribute::class, $attribute);\n $this->assertEquals(count($values) + 1, count((array) $attribute->getOptions()));\n }", "public function prepareAttributeSet(\\Magento\\Catalog\\Model\\Product $product)\n {\n $attributes = $this->configurableProduct->getUsedProductAttributes($product);\n $attributeSetId = $product->getNewVariationsAttributeSetId();\n /** @var $attributeSet \\Magento\\Eav\\Model\\Entity\\Attribute\\Set */\n $attributeSet = $this->attributeSetFactory->create()->load($attributeSetId);\n $attributeSet->addSetInfo(\n $this->entityFactory->create()->setType(\\Magento\\Catalog\\Model\\Product::ENTITY)->getTypeId(),\n $attributes\n );\n foreach ($attributes as $attribute) {\n /* @var $attribute \\Magento\\Catalog\\Model\\Entity\\Attribute */\n if (!$attribute->isInSet($attributeSetId)) {\n $attribute->setAttributeSetId(\n $attributeSetId\n )->setAttributeGroupId(\n $attributeSet->getDefaultGroupId($attributeSetId)\n )->save();\n }\n }\n }", "public function _updateProductAttributes(&$combination){\n $sql = 'SELECT pac.`id_attribute` AS id,\n a.id_attribute_group AS id_group,\n al.`name` AS value,\n agl.`name` AS group_name\n FROM `'._DB_PREFIX_.'product_attribute_combination` pac\n LEFT JOIN `'._DB_PREFIX_.'attribute` a ON a.`id_attribute` = pac.`id_attribute`\n LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON al.`id_attribute` = pac.`id_attribute`\n LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON agl.`id_attribute_group` = a.`id_attribute_group`\n WHERE pac.`id_product_attribute` = '.(int)$combination['id_product_attribute'].'\n ';\n $combination['attributes'] = Db::getInstance()->executeS($sql);\n //set Promo\n $combination['isPromo'] = Product::isCombinationPromo($combination);\n $combination['promo_name'] = Product::getCombinationPromoName($combination);\n //Promo lcdb is considered \"None\" in Cumul product BonDeCommande\n if ($combination['promo_name'] == 'lcdb'){\n $combination['isPromo'] == 0;\n $combination['promo_name'] == '';\n }\n //set Pro value\n $combination['isPro'] = Product::isCombinationPro($combination);\n //get Labels name Array\n $combination['label_name'] = Product::getCombinationLabelName($combination);\n //get Colis name (used for Colis surprise Only)\n $combination['colis_name'] = Product::getCombinationColisName($combination);\n }", "public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)\n {\n $installer = $setup;\n $installer->startSetup();\n\n /** @var EavSetup $eavSetup */\n $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);\n\n try {\n $eavSetup->addAttribute(\n Product::ENTITY,\n 'unilab_dc',\n [\n 'type' => 'int',/* Data type in which formate your value save in database*/\n 'backend' => '',\n 'frontend' => '',\n 'label' => 'Digital Couponing', /* lablel of your attribute*/\n 'input' => 'select',\n 'class' => '',\n 'source' => 'Magento\\Eav\\Model\\Entity\\Attribute\\Source\\Boolean',\n /* Source of your select type custom attribute options*/\n 'global' => \\Magento\\Eav\\Model\\Entity\\Attribute\\ScopedAttributeInterface::SCOPE_GLOBAL,\n /*Scope of your attribute */\n 'visible' => true,\n 'required' => false,\n 'user_defined' => true,\n 'default' => 0,\n 'searchable' => false,\n 'filterable' => false,\n 'comparable' => false,\n 'visible_on_front' => true,\n 'used_in_product_listing' => true,\n 'unique' => false\n ]\n );\n } catch (Exception $e) {\n throw new CouldNotSaveException(__('Could create product attribute: \"%1\"', $e->getMessage()), $e);\n }\n\n $installer->endSetup();\n }", "public function updateItemVariationAttribute($insert_arr)\n\t{\n\t\tDB::table('product')->whereRaw('id = ?', array($insert_arr['product_id']))->update(array('variation_group_id' => $insert_arr['variation_group_id']));\n\t\t$new_var_id_arr = $new_attr_arr = $var_attrib_details1 = array();\n\t\t$attr_id_arr = $insert_arr['attr_id_arr'];\n\t\t//instead of getting variations directly from the checked variation boxes,\n\t\t//get it from the checked attributes\n\t\tforeach($attr_id_arr AS $attr_index => $attr_id)\n\t\t{\n\t\t\t$data_arr = array();\n\t\t\t$data_arr = explode(\"_\", $attr_id);\n\t\t\t//$attr_id is of the form variation id_attrib id\n\t\t\t//store the variation id for the attrib id\n\t\t\t$var_attrib_details1[$data_arr[2]] =$data_arr[1];\n\t\t\t$new_attr_arr[] = $data_arr[2];\n\t\t\t$new_var_id_arr[] = $data_arr[1];\n\t\t}\n\t\t$old_var_id_arr =$this->fetchAssignedVariaionIds($insert_arr['product_id']);\n\t\t$del_var_arr = array_diff($old_var_id_arr, $new_var_id_arr);\n\t\t//If a variation itself is removed or added, we can delete and reform the matrix, need to check invoice too?\n\t\t$re_form = false;\n\t\t$can_delete = !$this->isCartOrInvoiceExists($insert_arr['product_id']);\n\t\tif(!empty($del_var_arr))\n\t\t{\n\t\t\t//If a variation itself is removed , we can delete and reform the matrix\n\t\t\t$re_form = $can_delete;\n\t\t\t$details_arr = array();\n\t\t\t$details_arr['item_id'] = $insert_arr['product_id'];\n\t\t\t$details_arr['product_id'] = $insert_arr['product_id'];\n\t\t\t$details_arr['id_arr'] = $del_var_arr;\n\t\t\tif($can_delete)\n\t\t\t\t$this->removeAssignedVar($details_arr);\t# Remove the existing variation record and the corresponding attributes\n\t\t\telse\n\t\t\t\t$this->deactivateAssignedVar($details_arr);\t# Deactivate the existing variation record and the attributes\n\n\t\t}\n\t\t$add_var_arr = array_diff($new_var_id_arr, $old_var_id_arr);\n\t\tif($add_var_arr)\n\t\t{\n\t\t\t//If a variation itself is added , we can delete and reform the matrix\n\t\t\t$re_form = $can_delete;\n\t\t\tforeach($add_var_arr as $id)\n\t\t\t{\n\t\t\t\t// insert variations entry\n\t\t\t\t$details_arr = array();\n\t\t\t\t$details_arr['item_id'] = $insert_arr['product_id'];\n\t\t\t\t$details_arr['variation_id'] = $id;\n\t\t\t\t$this->addItemVariationEntry($details_arr);\n\t\t\t}\n\t\t}\n\t\t$attr_id_arr = $insert_arr['attr_id_arr'];\n\t\t$assigned_attrib_details = $this->fetchAssignedAttrbIds($insert_arr['product_id']);\n\t\t//$assigned_attrib_details of the form\t\t$return_arr['attrib_ids_arr'] = $attribs_arr;\n\t\t//$return_arr['attrib_ids_variations'] = $attribs_variation;\n\t\t$old_attr = $assigned_attrib_details['attrib_ids_arr'];\n\t\t$var_attrib_details2 = $assigned_attrib_details['attrib_ids_variations'];\n\t\t$del_attr_arr = array_diff($old_attr, $new_attr_arr);\n\t\t$add_attr_arr = array_diff($new_attr_arr, $old_attr);\n\t\t$var_attrib_details = array();\n\t\t$var_attrib_details = $var_attrib_details1+$var_attrib_details2;\n\t\t//code to activate assigned attrib arr\n\t\tforeach($new_attr_arr as $act_id)\n\t\t{\n\t\t\t$details_arr = array();\n\t\t\t$details_arr['product_id'] = $insert_arr['product_id'];\n\t\t\t$details_arr['variation_id'] = $var_attrib_details[$act_id];\n\t\t\t$details_arr['attribute_id'] = $act_id;\n\t\t\t$this->activateAssignedAttr($details_arr); // deactivate alone\n\t\t}\n\t\tif(!empty($del_attr_arr))\n\t\t{\n\t\t\tforeach($del_attr_arr as $del_id)\n\t\t\t{\n\t\t\t\t//if the variation is in the deleted array, has been handled already , skip\n\t\t\t\tif(isset($var_attib_details[$del_id]))\n\t\t\t\t{\n\t\t\t\t\tif(in_array($var_attib_details[$del_id], $del_var_arr))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$details_arr = array();\n\t\t\t\t$details_arr['product_id'] = $insert_arr['product_id'];\n\t\t\t\t$details_arr['variation_id'] = $var_attrib_details[$del_id];\n\t\t\t\t$details_arr['attribute_id'] = $del_id;\n\t\t\t\t$this->deactivateAssignedAttr($details_arr); // deactivate alone\n\t\t\t}\n\t\t}\n\t\tif($add_attr_arr)\n\t\t{\n\t\t\tforeach($add_attr_arr as $add_id)\n\t\t\t{\n\t\t\t\t$details_arr = array();\n\t\t\t\t$details_arr['product_id'] = $insert_arr['product_id'];\n\t\t\t\t$details_arr['variation_id'] = $var_attrib_details[$add_id];\n\t\t\t\t$details_arr['attribute_id'] = $add_id;\n\t\t\t\t$this->addItemVariationAttributeEntry($details_arr);\n\t\t\t}\n\t\t}\n\t\t$this->updateItemVariationMatrix($insert_arr['product_id'], $re_form);\n\t}", "public function createConfigurable ($set, $sku, $configurableAttributes, $configuredProducts, $productData) {\n\t\t\t\t\n\t\t\t\t\n\t\tfor ($i = 0; $i<count($configurableAttributes); $i++) {\n\t\t\t$configurableAttributes[$i]['attribute_code'] = $configurableAttributes[$i]['code'];\n\t\t}\n\t\t\t\t\n\t\tif (!$set || !$sku) {\n $this->_fault('data_invalid');\n }\n\n $product = Mage::getModel('catalog/product');\n /* @var $product Mage_Catalog_Model_Product */\n\t\t\n $product->setStoreId($this->_getStoreId($store))\n ->setAttributeSetId($set)\n ->setTypeId('configurable')\n ->setSku($sku);\n\t\t\t\t\t\t\n\t\t$product->getTypeInstance()->getProduct()->setConfigurableAttributesData( $configurableAttributes );\n\t\t$product->getTypeInstance()->getProduct()->setConfigurableProductsData( $configuredProducts );\n\n\t\t\n foreach ($product->getTypeInstance()->getEditableAttributes() as $attribute) {\n if ($this->_isAllowedAttribute($attribute)\n && isset($productData[$attribute->getAttributeCode()])) {\n $product->setData(\n $attribute->getAttributeCode(),\n $productData[$attribute->getAttributeCode()]\n );\n }\n }\n\n $this->_prepareDataForSave($product, $productData);\n\n if (is_array($errors = $product->validate())) {\n $this->_fault('data_invalid', implode(\"\\n\", $errors));\n }\n\n\n try {\n $product->save();\n } catch (Mage_Core_Exception $e) {\n $this->_fault('data_invalid', $e->getMessage());\n }\n\n\t\t// inizio traduzione attributi\n\n\t\t$storeModel = Mage::getModel('adminhtml/system_store');\n\t\t$stores = $storeModel->getStoreCollection();\n\t\t$resModel = Mage::getResourceModel('catalog/product_type_configurable_attribute_collection')->setProductFilter($product->getTypeInstance()->getProduct());\n\t\t$__configurableAttributes = $resModel->orderByPosition()->load();\n\t\t$values = array();\n\t\t\n\t\tforeach ($__configurableAttributes as $attr) {\n\t\t\t$attribute = Mage::getModel('catalog/entity_attribute');\n \t$attribute->setStoreId($this->_getStoreId($store))->load($attr->getProductAttribute()->getId());\n\t\t\t\n\t $frontendLabel = $attribute->getFrontend()->getLabel();\n\t if (is_array($frontendLabel)) {\n\t $frontendLabel = array_shift($frontendLabel);\n\t }\n\t\t\t$translations = Mage::getModel('core/translate_string')\n \t\t->load(Mage_Catalog_Model_Entity_Attribute::MODULE_NAME.Mage_Core_Model_Translate::SCOPE_SEPARATOR.$frontendLabel)\n \t\t->getStoreTranslations();\n\t\t \n\t\t\t$attributeData = array(\n 'id' => $attr->getId(),\n 'label' => '',\n 'position' => $attr->getPosition(),\n 'values' => array(),\n 'attribute_id' => $attr->getProductAttribute()->getId(),\n 'attribute_code'=> $attr->getProductAttribute()->getAttributeCode(),\n 'frontend_label'=> $attr->getProductAttribute()->getFrontend()->getLabel(),\n\t\t\t);\t \n\t\t\t\n\t\t\tforeach ($stores as $tmpStore) {\n\t if ($tmpStore->getId() != 0) {\n\t $values[$tmpStore->getId()] = isset($translations[$tmpStore->getId()]) ? $translations[$tmpStore->getId()] : $frontendLabel;\n\t\t\t\t\t$attributeData['label'] = $values[$tmpStore->getId()];\n\t\t\t\t\t$translatedAttribute = Mage::getModel('catalog/product_type_configurable_attribute')\n\t\t ->setData($attributeData)\n\t\t ->setId($attr->getId())\n\t\t ->setStoreId($tmpStore->getId())\n\t\t ->setProductId($product->getId())\n\t\t ->save();\t\n\t }\n\t }\n\t\t\t\n\t\t}\n\t\t// fine traduzione attributi\n\n return $product->getId();\n//\t\treturn 1;\n\t}", "function createAttributeValue($attributeId,$attributeName,$attributeValue,$obj)\n{\n $return = false;\n $attributeValue = trim(ucwords(strtolower($attributeValue)));\n\n //attributeId 155 for size , 93 for color \n $newOptions = [\n 'values' => [\n '0' => $attributeValue,\n ],\n 'attribute_id' => $attributeId,\n ];\n\n $eavAttribute = $obj->create('Magento\\Eav\\Model\\Config');\n /** @var \\Magento\\Eav\\Model\\Config $attribute */\n $attribute = $eavAttribute->getAttribute('catalog_product', $attributeName);\n $options = $attribute->getSource()->getAllOptions();\n $columns = array_column($options, 'label');\n $search = array_search($attributeValue,$columns);\n\n //For deleting color oprions\n // foreach ($options as $option) {\n // $options['delete'][$option['value']] = true; \n // $options['value'][$option['value']] = true;\n // }\n\n if(!$search)\n {\n $setupObject = $obj->create('Magento\\Eav\\Setup\\EavSetup');\n $addAttributeOption = $setupObject->addAttributeOption($newOptions); \n // $addAttributeOption = $setupObject->addAttributeOption($options); //for deleting options\n $return = true;\n }\n\n return $return;\n}", "function testFunctionalDenyAdd() {\n\t\t$product = $this->objFromFixture('Product', 'p1a');\n\t\t$this->assertFalse($product->AllowPurchase(), 'The flag for allow purchase is set to FALSE.');\n\t\t$response = $this->get($product->URLSegment . '/add');\n\t\t$this->assertTrue($response->getBody() == '', 'Because we can\\'t purchase the product, we get a blank page with no content.');\n\t}", "function initNonActiveStoreProduct($product, $data)\n {\n global $websiteId;\n global $storeId;\n global $taxClassIds;\n global $myEditionTypes;\n\t\t\n //SET IW STORE - wipeout association with Main Website\n $storeIds[0] = $storeId;\n $websiteIds[0] = $websiteId;\n \n $product->setWebsiteIDs($websiteIds);\n $product->setStoreIDs($storeIds);\n\n //Attribute Set Id\n $editionCode = \"\";\n foreach ($myEditionTypes as $editionType)\n {\n if($editionType['value'] == $product->getVistaEditionType())\n {\n $editionCode = $editionType['label'];\n }\t\t\t\t\t\n }\n $attrSetName = \"\";\n switch(strtoupper($editionCode))\n {\n case \"A\":\n case \"R\":\n case \"1\":\n case \"2\":\n case \"4\":\n $attrSetName = \"Default\";\n break;\n case \"B\":\n case \"D\":\n case \"E\":\n case \"F\":\n case \"H\":\n case \"I\":\n case \"J\":\n case \"K\":\n case \"L\":\n case \"M\":\n case \"N\":\n case \"P\":\n case \"Q\":\n case \"S\":\n case \"U\":\n case \"X\":\n $attrSetName = \"Book\";\n break;\n case \"C\":\n $attrSetName = \"CD\";\n break;\n case \"G\":\n case \"Y\":\n $attrSetName = \"DVD\";\n break;\n case \"O\":\n $attrSetName = \"Subscription\";\n break;\n case \"T\":\n $attrSetName = \"Streaming\";\n break; \n case \"V\":\n $attrSetName = \"VHS\";\n break; \n case \"W\":\n $attrSetName = \"Download\";\n break;\n case \"Z\":\n $attrSetName = \"Magazine\";\n break; \n default:\n $attrSetName = \"Default\";\n break;\t \t\t\t\t\n }\n\t\t\n //Load Attribute Set Id\n $entityTypeId = Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId();\n $attributeSetId = Mage::getModel('eav/entity_attribute_set')\n ->getCollection()\n ->setEntityTypeFilter($entityTypeId)\n ->addFieldToFilter('attribute_set_name', $attrSetName)\n ->getFirstItem()->getAttributeSetId();\n\n $product->setAttributeSetId($attributeSetId);\n\n //SKU\n $product->setSku($data[1]);\n \n //Name\n $product->setName($data[2]);\n\n //Description\n $product->setDescription($data[21]);\n\n //Short Description\n if($data[6] != \"\")\n {\n $shortDesc = $data[6];\n }\n else \n {\n $shortDesc = strip_tags(substr($data[21], 0, 100)); \t\n }\n $product->setShortDescription($shortDesc);\n $product->setShoppingFeedDescription($shortDesc);\n \n //Url Key\n if($data[103] != \"\")\n {\n $tmpUrlKey = str_replace(\".html\" , \"\", (strtolower(substr($data[103], strrpos($data[103], '/') + 1))));\n $product->setUrlKey($tmpUrlKey);\n }\n\n if(strtoupper($data[100]) == 'TRUE')\n {\n $product->setStatus(2);\n echo \"got a hider\\n\";\n }\n else\n {\n $product->setStatus(1);\n }\n \n //Special Pricing\n $advancedPricingArray = explode('|', $data[12]);\n $specialPrice = -1;\n $specialPriceStart = \"-1\";\n $specialPriceEnd = \"-1\";\n\n foreach($advancedPricingArray as $specialPriceBlock)\n {\n $potentialSpecialPriceBlock = explode('~', $specialPriceBlock);\n //5 position = Price\n //6 position = Start Date\n //7 position End date\n\n //CHECK FOR CURRENT ACTIVE 1st\n\n $todaysDate = strtotime(date(\"m/d/Y\"));\n $startDate = strtotime($potentialSpecialPriceBlock[6]);\n $endDate = strtotime($potentialSpecialPriceBlock[7]);\n\n if($endDate > $todaysDate && $todaysDate > $startDate)\n {\n $specialPrice = $potentialSpecialPriceBlock[5];\n $specialPriceStart = $potentialSpecialPriceBlock[6];\n $specialPriceEnd = $potentialSpecialPriceBlock[7];\n }\n\n }\n\n //CHECK FOR FUTURE if no current actives found\n if($specialPrice == -1)\n {\n $currentStartDate = \"\";\n $foundAFutureSpecial = false;\n $i = 0;\n foreach($advancedPricingArray as $specialPriceBlock)\n {\n $potentialSpecialPriceBlock = explode('~', $specialPriceBlock);\n //5 position = Price\n //6 position = Start Date\n //7 position End date\n\n //CHECK FOR future special prices\n $todaysDate = strtotime(date(\"m/d/Y\"));\n $startDate = strtotime($potentialSpecialPriceBlock[6]);\n $endDate = strtotime($potentialSpecialPriceBlock[7]);\n\n if($foundAFutureSpecial == false)\n {\n $currentFutureStartDate = strtotime($potentialSpecialPriceBlock[6]);\n }\n\n if($endDate > $todaysDate && $todaysDate < $startDate && $startDate <= $currentFutureStartDate)\n {\n $specialPrice = $potentialSpecialPriceBlock[5];\n $specialPriceStart = $potentialSpecialPriceBlock[6];\n $specialPriceEnd = $potentialSpecialPriceBlock[7];\n $currentStartDate = $startDate;\n $foundAFutureSpecial = true;\n }\n $i++;\n }\n }\n \n if($specialPrice != -1)\n {\n $product->setSpecialPrice($specialPrice);\n $product->setSpecialPriceFromDate($specialPriceStart);\n $product->setSpecialPriceToDate($specialPriceEnd); \n }\n \n $attributeListBlock = explode(\"|\", $data[101]);\n foreach ($attributeListBlock as $attribute)\n {\n $attributeArray = explode(\"~\", $attribute);\n //Format\n if(strtoupper($attributeArray[0]) == \"PRODUCT TYPE\" || strtoupper($attributeArray[0]) == \"PROJECT TYPE\")\n {\n $format_val = attributeValueExists('format', $attributeArray[1]);\n\n if($format_val == \"\")\n {\n addAttributeValue('format', $attributeArray[1]);\n $format_val = attributeValueExists('format', $attributeArray[1]);\n\n if($format_val == \"\")\n {\n throw new Exception(' --- FORMAT VALUE NOT CREATED ---');\n }\n }\n\n $product->setFormat($format_val);\n }\n\n //Author Speaker Editor\n if(strtoupper($attributeArray[0]) == \"AUTHOR\")\n {\n $product->setAuthorSpeakerEditor($attributeArray[1]);\n }\n }\n \t\n\t//Brand\n $product->setBrand($data[10]);\t\n \n //Can be discountable\n if(strtoupper($data[123]) == \"TRUE\")\n {\n $product->setCanBeDiscountable(0);\n }\n else\n {\n $product->setCanBeDiscountable(1); \n }\n \n //Meta Title\n $product->setMetaTitle($data[2]);\n\n //Meta Keywords\n if($data[51] != \"\")\n {\n $product->setMetaKeyword($data[51]);\n \n }\n \n //Meta Deescription\n if($data[52] != \"\")\n {\n $product->setMetaDescription($data[52]);\n }\n \n $product->setTaxClassId($taxClassIds[\"Taxable Goods\"]);\n \t\n \tif($product->getTypeId() == \"downloadable\")\n \t{\n $product->setTaxClassId($taxClassIds[\"Downloads\"]);\n \t}\n \t\n \tif($product->getTypeId() == \"virtual\")\n \t{\n $product->setTaxClassId(0);\n \t}\n \n addIWAttributes($product,$data);\n \n //Related Products\n if($data[104] != \"\")\n {\n $param = array();\n unset($param);\n $position = 1;\n $upSellItems = explode(\"|\", $data[104]);\n foreach($upSellItems as $upSellString)\n {\n $upSellPieces = explode(\"~\",$upSellString);\n $upSellSku = $upSellPieces[0];\n\n $upSellProduct = Mage::getModel('catalog/product')->loadByAttribute('sku',$upSellSku);\n if($upSellProduct)\n {\n $param[$upSellProduct->getId()] = array('position'=>$position);\n $position++;\n }\n \n $product->setUpSellLinkData($param);\n }\n }\n \n return \t$product;\t\t\n }", "private function installProductAttributeTable()\n {\n $this->getDatabase()->execute('DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'layered_product_attribute`');\n $this->getDatabase()->execute(\n 'CREATE TABLE `' . _DB_PREFIX_ . 'layered_product_attribute` (\n `id_attribute` int(10) unsigned NOT NULL,\n `id_product` int(10) unsigned NOT NULL,\n `id_attribute_group` int(10) unsigned NOT NULL DEFAULT \"0\",\n `id_shop` int(10) unsigned NOT NULL DEFAULT \"1\",\n PRIMARY KEY (`id_attribute`, `id_product`, `id_shop`),\n UNIQUE KEY `id_attribute_group` (`id_attribute_group`,`id_attribute`,`id_product`, `id_shop`)\n ) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8;'\n );\n }", "function addAttrib($data){\r\n\t\t$source = str_replace(' ', '',element('attribute', $data) );\r\n\t\tif(count($prepare_sort = explode(';',$source)) > 1):\r\n\t\t\tforeach ($prepare_sort as $pre){\r\n\t\t\t\tlist($key, $value) = explode(':', $pre);\r\n\t\t\t\t$attribute[$key] = $value;\r\n\t\t\t}\r\n\t\t\t$final_attribute = '';\r\n\t\t\r\n\t\t\tksort($attribute);\r\n\t\t\tforeach($attribute as $key=>$value){\r\n\t\t\t\t$final_attribute .= $key.':'.$value.';';\r\n\t\t\t}\r\n\t\t\t$data['attribute'] = substr($final_attribute, 0 , -1);\r\n\t\tendif;\r\n\t\t\r\n\t\t\r\n\t\t$q = $this->db->insert('store_product_attrb', $data);\r\n\t\tif($q){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\t\r\n\t}", "protected function _createAttributes()\r\n\t{\r\n\t\t$attributeData = array(\r\n\t\t\t'is_global' => '1',\r\n\t\t\t'frontend_input' => 'select',\r\n\t\t\t'is_visible_on_front' => '1',\r\n\t\t\t'is_configurable' => '1',\r\n\t\t\t'backend_type' => 'int',\r\n\t\t\t'is_user_defined' => '1',\r\n\t\t);\r\n\r\n\t\t$entityTypeID = Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId();\r\n\t\t$attributeSet = Mage::getModel('eav/entity_attribute_set')\r\n\t\t\t->getCollection()\r\n\t\t\t->addFieldToFilter('entity_type_id', $entityTypeID)\r\n\t\t\t->getFirstItem();\r\n\r\n\t\t$attributes = array();\r\n\r\n\t\tfor ($i = 1; $i <= 3; $i++)\r\n\t\t{\r\n\t\t\t$attribute = Mage::getModel('catalog/resource_eav_attribute');\r\n\t\t\t$attribute->addData($attributeData);\r\n\t\t\t$attribute->setFrontendLabel('Test Attribute #' . $i);\r\n\t\t\t$attribute->setAttributeCode('test_attr_' . $i);\r\n\t\t\t$attribute->setEntityTypeId($entityTypeID);\r\n\t\t\t$attribute->setAttributeSetId($attributeSet->getId());\r\n\t\t\t$attribute->save();\r\n\r\n\t\t\t$this->save('product/configurable_attribute_' . $i, $attribute->getId());\r\n\r\n\t\t\t$setup = new Mage_Eav_Model_Entity_Setup('core_setup');\r\n\t\t\t$setup->addAttributeOption(array(\r\n\t\t\t\t'attribute_id' => $attribute->getId(),\r\n\t\t\t\t'value' => array(\r\n\t\t\t\t\t'test_value_1' => array('Test Option #1'),\r\n\t\t\t\t),\r\n\t\t\t));\r\n\r\n\t\t\t// Assign attribute to set group\r\n\t\t\t$setup->addAttributeToGroup(\r\n\t\t\t\t$entityTypeID,\r\n\t\t\t\t$attributeSet->getId(),\r\n\t\t\t\t'General',\r\n\t\t\t\t$attribute->getId()\r\n\t\t\t);\r\n\r\n\t\t\t$attributes[] = $attribute;\r\n\t\t}\r\n\r\n\t\treturn $attributes;\r\n\t}", "private function ProcessAttributeValues() {\n\t\t$csvilog = JRequest::getVar('csvilog');\n\t\t/* Check if the attributes is to be added */\n\t\tif ($this->attribute_values) {\n\t\t\t$csvfields = JRequest::getVar('csv_fields');\n\t\t\t$csvilog->AddMessage('debug', JText::_('DEBUG_ADD_ATTRIBUTES'));\n\t\t\t$attribute_values = explode( \"|\", $this->attribute_values );\n\t\t\t$i = 0;\n\t\t\twhile(list(,$val) = each($attribute_values)) {\n\t\t\t\t$values = explode( \"::\", $val );\n\t\t\t\tif (count($values) == 2) {\n\t\t\t\t\t/* Fix the array to show the correct names to bind the data */\n\t\t\t\t\t$this->_vm_product_attribute->bind(array('product_id' => $this->product_id, 'attribute_name' => $values[0], 'attribute_value' => $values[1]));\n\t\t\t\t\t/* Store the data */\n\t\t\t\t\t$this->_vm_product_attribute->store();\n\t\t\t\t\t$csvilog->AddMessage('debug', JText::_('DEBUG_ADD_ATTRIBUTES'), true);\n\t\t\t\t\t/* Clean for new insert */\n\t\t\t\t\t$this->_vm_product_attribute->reset();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$csvilog->AddMessage('debug', JText::_('DEBUG_NO_VALID_ATTRIBUTE').' '.$val);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function execute() {\n /**\n * Get Attribute set id and current product id\n */\n $attributeSetId = $this->getRequest ()->getParam ( 'attribute_set_id' );\n $currentProductId = $this->getRequest ()->getParam ( 'current_product_id' );\n \n /**\n * Create instance for object manager\n */\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ();\n \n /**\n * Prepare current product attributes\n */\n $selectedAttributes = array ();\n if ($currentProductId) {\n $product = $objectManager->get ( 'Magento\\Catalog\\Model\\Product' )->load ( $currentProductId );\n if ($product->getTypeId () == 'configurable') {\n $configurableAttributes = $product->getTypeInstance ( true )->getConfigurableAttributesAsArray ( $product );\n foreach ( $configurableAttributes as $configurableAttribute ) {\n $selectedAttributes [] = $configurableAttribute ['attribute_id'];\n }\n }\n }\n \n /**\n * Product Types\n */\n $types = [ \n \\Magento\\Catalog\\Model\\Product\\Type::TYPE_SIMPLE,\n \\Magento\\Catalog\\Model\\Product\\Type::TYPE_VIRTUAL,\n \\Magento\\ConfigurableProduct\\Model\\Product\\Type\\Configurable::TYPE_CODE \n ];\n \n $attributes = $objectManager->get ( 'Magento\\ConfigurableProduct\\Model\\ConfigurableAttributeHandler' )->getApplicableAttributes ();\n $attributes->addFieldToFilter ( 'entity_type_id', $attributeSetId );\n \n /**\n * Prepare select attribute content\n */\n echo '<ul>';\n foreach ( $attributes as $attribute ) {\n /**\n * Checking for configurable attribute or not\n */\n if (! $attribute->getApplyTo () || count ( array_diff ( $types, $attribute->getApplyTo () ) ) === 0) {\n $checked = '';\n if (count ( $selectedAttributes ) > 0 && in_array ( $attribute->getAttributeId (), $selectedAttributes )) {\n $checked = 'checked onclick=\"return false;\" onkeydown=\"return false;\"';\n }\n echo '<li><input id=\"' . $attribute->getAttributeCode () . '\" ' . $checked . ' name=\"attributes[' . $attribute->getAttributeCode () . ']\" value=\"' . $attribute->getFrontendLabel () . '\"\n title=\"' . $attribute->getFrontendLabel () . '\" \n class=\"attribute-checkbox validate-one-required-by-name\" type=\"checkbox\">';\n echo '<input type=\"hidden\" name=\"attribute_ids[' . $attribute->getAttributeCode () . ']\" value=\"' . $attribute->getAttributeId () . '\" />';\n \n echo '<label for=\"' . $attribute->getAttributeCode () . '\">' . $attribute->getFrontendLabel () . '</label></li>';\n }\n }\n echo '</ul>';\n }", "public function onBeforeWrite()\n {\n parent::onBeforeWrite();\n if (isset($_POST['ProductAttributes']) && is_array($_POST['ProductAttributes'])) {\n $this->AttributeValues()->setByIDList(array_values($_POST['ProductAttributes']));\n }\n }", "public function save() \r\n\t{\r\n\t\tif (count($this->newOptions) > 0) {\r\n\t\t\r\n\t\t\tforeach ($this->newOptions as $option) {\r\n\t\t\t\t\r\n\t\t\t\t$label = array(\r\n\t\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t\t\"store_id\" => array(\"0\"),\r\n\t\t\t\t\t\t\t\t\"value\" => $option->label\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\t$data = array(\r\n\t\t\t\t\t\t\"label\" => $label,\r\n\t\t\t\t\t\t\"order\" => \"0\",\r\n\t\t\t\t\t\t\"is_default\" => \"0\"\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\t$result = $this->client->catalogProductAttributeAddOption($this->sessionid, $this->attribute, $data);\r\n\t\t\t\t\r\n\t\t\t\t$this->log->addInfo('enviado', array(\"label\" => $option->label, \"result\" => $result));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// e agora apagar as opcoes que nao existem\r\n\t\tif (count($this->delOptions) > 0) {\r\n\t\t\t\t\r\n\t\t\tforeach ($this->delOptions as $option) {\r\n\t\t\r\n\t\t\t\t$result = $this->client->catalogProductAttributeRemoveOption($this->sessionid, $this->attribute, $option->value);\r\n\t\t\r\n\t\t\t\t$this->log->addInfo('apagado', array(\"label\" => $option->label, \"result\" => $result));\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\t// se houve modificacoes no magento, destruimos a cache\r\n\t\tif (count($this->delOptions) > 0 || count($this->newOptions) > 0) { $this->destroyCache(); }\r\n\t}", "function addAttributeValue($arg_attribute, $arg_value)\n {\n \tglobal $logFile;\n \tglobal $storeViewName;\n \t\n $attribute_model = Mage::getModel('eav/entity_attribute');\n $attribute_options_model= Mage::getModel('eav/entity_attribute_source_table') ;\n\n $attribute_code = $attribute_model->getIdByCode('catalog_product', $arg_attribute);\n $attribute = $attribute_model->load($attribute_code);\n \n $attribute_table = $attribute_options_model->setAttribute($attribute);\n $options = $attribute_options_model->getAllOptions(false);\n \n if(!attributeValueExists($arg_attribute, $arg_value))\n {\n $value['option'] = array($arg_value,$arg_value);\n $result = array('value' => $value);\n $attribute->setData('option',$result);\n\n try \n {\n $attribute->save();\n \tMage::log($storeViewName.\"::Adding Option value: \".$arg_value,null, $logFile);\n } \n catch (Exception $e) \n {\n Mage::log($storeViewName.\"::addAttributeValue Error: \".$e->getMessage(),null, $logFile);\n }\n }\n \n foreach($options as $option)\n {\n if ($option['label'] == $arg_value)\n {\n return $option['value'];\n }\n }\n return true;\n }", "protected function prepareAttributeSetToBeBaseForNewVariations(\\Magento\\Catalog\\Model\\Product $product)\n {\n $this->prepareAttributeSet($product);\n }", "public function createAttributes()\n {\n try {\n \n $metaDataCache = Shopware()->Models()->getConfiguration()->getMetadataCacheImpl();\n $metaDataCache->deleteAll();\n\n Shopware()->Models()->addAttribute('s_user_attributes', 'stetic', 'allowidentify', 'int(1)'); \n\n $metaDataCache = Shopware()->Models()->getConfiguration()->getMetadataCacheImpl();\n $metaDataCache->deleteAll();\n\n Shopware()->Models()->generateAttributeModels(array('s_user_attributes'));\n\n } catch (Exception $exception) {\n\n Shopware()->Log()->Err(\"Stetic: Can't add attribites to shopware models. \" . $exception->getMessage());\n throw new Exception(\"Stetic: Can't add attribites to shopware models. \" . $exception->getMessage());\n\n }\n }", "protected function installCatalogProductSkyHubRequiredAttributes()\n {\n $attributes = (array)$this->skyhubConfigData->getEntityAttributes(\\Magento\\Catalog\\Model\\Product::ENTITY);\n $table = (string) $this->getTable('bittools_skyhub_product_attributes_mapping');\n \n /** @var array $attribute */\n foreach ($attributes as $identifier => $data) {\n $skyhubCode = $this->arrayExtract($data, 'code');\n $label = $this->arrayExtract($data, 'label');\n $castType = $this->arrayExtract($data, 'cast_type', Mapping::DATA_TYPE_STRING);\n $description = $this->arrayExtract($data, 'description');\n $validation = $this->arrayExtract($data, 'validation');\n $enabled = (bool) $this->arrayExtract($data, 'required', true);\n $required = (bool) $this->arrayExtract($data, 'required', true);\n $editable = (bool) $this->arrayExtract($data, 'editable', true);\n $createdAt = $this->now();\n \n if (empty($skyhubCode) || empty($castType)) {\n continue;\n }\n \n $attributeData = [\n 'skyhub_code' => $skyhubCode,\n 'skyhub_label' => $label,\n 'skyhub_description' => $description,\n 'enabled' => $enabled,\n 'cast_type' => $castType,\n 'validation' => $validation,\n 'required' => $required,\n 'editable' => $editable,\n 'created_at' => $createdAt,\n ];\n \n $installConfig = (array) $this->arrayExtract($data, 'attribute_install_config', []);\n $magentoCode = $this->arrayExtract($installConfig, 'attribute_code');\n \n /** @var int $attributeId */\n if ($attributeId = (int) $this->getAttributeIdByCode($magentoCode)) {\n $attributeData['attribute_id'] = $attributeId;\n }\n \n $this->getConnection()->beginTransaction();\n \n try {\n /** @var \\Magento\\Framework\\DB\\Select $select */\n $select = $this->getConnection()\n ->select()\n ->from($table, 'id')\n ->where('skyhub_code = :skyhub_code')\n ->limit(1);\n \n $id = $this->getConnection()->fetchOne($select, [':skyhub_code' => $skyhubCode]);\n \n if ($id) {\n $this->getConnection()->update($table, $attributeData, \"id = {$id}\");\n $this->getConnection()->commit();\n continue;\n }\n \n $this->getConnection()->insert($table, $attributeData);\n $this->getConnection()->commit();\n } catch (\\Exception $e) {\n $this->getConnection()->rollBack();\n }\n }\n \n return $this;\n }", "public function addAttributes(Request $request, $id)\n {\n if(Session::get('admin_info')['products_access'] == 0)\n {\n return redirect('admin/dashboard')->with('flash_message_error','You have no access for this module');\n }\n\n if($request->isMethod('post'))\n {\n\n $data = $request->all();\n foreach($data['sku'] as $key=> $val)\n {\n if(!empty($val)){\n\n //prevent duplicate sku\n $attrCountSku = ProductAttribute::where('sku', $val)->count();\n if($attrCountSku > 0){\n return redirect('/admin/add-attributes/'.$id)->with('flash_message_error', 'SKU already exist. Please add other SKU');\n }\n\n //prevent duplicate size for same product\n $attrCountSize = ProductAttribute::where('product_id', $id)->where('size',$data['size'][$key])->count();\n if($attrCountSize > 0){\n return redirect('/admin/add-attributes/'.$id)->with('flash_message_error', $data['size'][$key].' size already exists for this product. Please add other size.');\n }\n\n\n $attribute = new ProductAttribute;\n $attribute->product_id = $data['product_id'];\n $attribute->sku = $val;\n $attribute->size = $data['size'][$key];\n $attribute->price = $data['price'][$key];\n $attribute->stock = $data['stock'][$key];\n $attribute->save();\n }\n }\n return redirect('/admin/add-attributes/'.$id)->with('flash_message_success', 'Product Attributes Added.');\n }\n\n\n $productDetails = Product::with('attributes')->where('id', $id)->get();\n return view('admin.products.add_attributes', compact('productDetails'));\n }", "public function update(Request $request, ProductAttribute $productAttribute)\n {\n $request->validate([\n 'name' => 'required',\n 'attribute_values.*.value' => 'required'\n ]);\n\n $productAttribute = $productAttribute->fill([\n 'name' => $request->name,\n 'type' => $request->type,\n 'allow_multiple' => $request->has('allow_multiple')?'1':'0',\n 'updated_by' => auth()->guard('admin')->id(),\n ]);\n $productAttribute->save();\n\n\n $keepIds = collect($request->attribute_values)\n ->reject(function($data) {\n return empty($data['id']);\n })\n ->pluck('id')\n ->toArray();\n\n $productAttribute->productAttributeOptions()->whereNotIn('id', $keepIds)->delete();\n foreach ($request->attribute_values as $data) {\n $productAttribute->productAttributeOptions()->updateOrCreate(['id'=>$data['id']], [\n 'value' => $data['value'],\n 'note' => $data['note']\n ]);\n }\n\n return redirect()->route('admin.product-attributes.edit', $productAttribute->id)\n ->with('success', 'Cập nhật thuộc tính mới thành công');\n }", "public function prepareDependencies(Mage_Catalog_Model_Resource_Eav_Attribute $attribute,\n Mage_Eav_Model_Entity_Attribute_Set $attributeSet,\n Mage_Eav_Model_Entity_Attribute_Group $attributeGroup)\n {\n $entity_type_product = Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId();\n\n \n // ---------------------- CREATE ATTRIBUTE SET ---------------------- //\n $attribute_set_name = 'Shirts T';\n \n // check if an attribute set with given name already exists\n $attributeSet->load($attribute_set_name, 'attribute_set_name');\n if (!$attributeSet->getId() || ($attributeSet->getEntityType() != $entity_type_product)) {\n // does not exist yet: create attribute set\n $attributeSet->setEntityTypeId($entity_type_product);\n $attributeSet->setAttributeSetName($attribute_set_name);\n $attributeSet->save();\n // TODO: depict DEFAULT attribute set id\n $attributeSet->initFromSkeleton(4)->save();\n print(\"Attribute set '$attribute_set_name' created (ID: \" . $attributeSet->getId() . \").\\n\");\n }\n $this->_attributeSetId = $attributeSet->getId();\n \n \n // --------------------- CREATE ATTRIBUTE GROUP --------------------- //\n $attribute_group_name = 'T-shirts Attributes';\n \n // check if an attribute group with given name already exists\n $attributeGroup->load($attribute_group_name, 'attribute_group_name');\n if (!$attributeGroup->getId()) {\n // does not exist yet: create group\n $attributeGroup->setAttributeGroupName($attribute_group_name);\n $attributeGroup->setAttributeSetId($this->_attributeSetId);\n $attributeGroup->save();\n print(\"Attribute group '$attribute_group_name' created (ID: \" . $attributeGroup->getId() . \").\\n\");\n }\n $this->_attributeGroupId = $attributeGroup->getId();\n \n \n // ----------------- CREATE ATTRIBUTE 'shirt_size' ------------------ //\n $attribute_code = 'shirt_size';\n \n // check if an attribute with given code already exists\n $attribute->loadByCode($entity_type_product, $attribute_code);\n if (!$attribute->getId()) {\n // does not exist yet: create attribute\n $attribute->setData(array(\n 'apply_to' => array('simple', 'grouped', 'configurable'),\n 'attribute_code' => $attribute_code,\n 'default_value_yesno' => 0,\n 'frontend_input' => 'select',\n 'frontend_label' => array('Shirt Size'),\n \t'is_comparable' => 0,\n 'is_configurable' => 1,\n 'is_filterable' => 0,\n 'is_filterable_in_search' => 0,\n 'is_global' => 1,\n 'is_html_allowed_on_front' => 0,\n 'is_required' => 1,\n 'is_searchable' => 1,\n 'is_unique' => 0,\n 'is_used_for_promo_rules' => 1,\n 'is_visible_in_advanced_search' => 0,\n 'is_visible_on_front' => 0,\n 'option' => array(\n 'order' => array(\n 'option_2' => 1,\n 'option_1' => 2,\n 'option_0' => 3\n ),\n 'value' => array(\n 'option_2' => array('Small'),\n 'option_1' => array('Medium'),\n 'option_0' => array('Large')\n )\n ),\n 'used_for_sort_by' => 0,\n 'used_in_product_listing' => 0\n ));\n $attribute->setAttributeGroupId($this->_attributeGroupId);\n $attribute->setAttributeSetId($this->_attributeSetId);\n $attribute->setEntityTypeId($entity_type_product);\n $attribute->setIsUserDefined(1);\n $attribute->setBackendType('int');\n \n $attribute->save();\n print(\"Attribute '$attribute_code' created (ID: \" . $attribute->getId() . \").\\n\");\n }\n $this->_attributeId = $attribute->getId();\n \n // store option value IDs (Small, Medium, Large)\n $optionCollection = Mage::getResourceModel('eav/entity_attribute_option_collection')\n ->setAttributeFilter($this->_attributeId)\n ->setPositionOrder('desc', true)\n ->load();\n\n foreach ($optionCollection as $item) {\n $this->_attributeValueIds[$item->getValue()] = $item->getId();\n }\n \n \n // -------------------- CREATE ATTRIBUTE 'model' -------------------- //\n $attribute = Mage::getModel('catalog/resource_eav_attribute');\n $attribute_code = 'model';\n \n // check if an attribute with given code already exists\n $attribute->loadByCode($entity_type_product, $attribute_code);\n if (!$attribute->getId()) {\n // does not exist yet: create attribute\n $attribute->setData(array(\n \t'apply_to' => array('simple', 'grouped', 'configurable'),\n 'attribute_code' => $attribute_code,\n 'default_value_yesno' => 0,\n 'frontend_input' => 'text',\n 'frontend_label' => array('Model'),\n \t'is_comparable' => 1,\n 'is_configurable' => 0,\n 'is_global' => 1,\n 'is_html_allowed_on_front' => 0,\n 'is_required' => 1,\n 'is_searchable' => 1,\n 'is_unique' => 0,\n 'is_used_for_promo_rules' => 1,\n 'is_visible_in_advanced_search' => 0,\n 'is_visible_on_front' => 1,\n 'used_for_sort_by' => 0,\n 'used_in_product_listing' => 0\n ));\n $attribute->setAttributeGroupId($this->_attributeGroupId);\n $attribute->setAttributeSetId($this->_attributeSetId);\n $attribute->setEntityTypeId($entity_type_product);\n $attribute->setIsUserDefined(1);\n $attribute->setBackendType('varchar');\n \n $attribute->save();\n print(\"Attribute '$attribute_code' created (ID: \" . $attribute->getId() . \").\\n\");\n }\n }", "function wc_dropdown_variation_attribute_options($args = array())\n {\n $args = wp_parse_args(\n apply_filters('woocommerce_dropdown_variation_attribute_options_args', $args),\n array(\n 'options' => false,\n 'attribute' => false,\n 'product' => false,\n 'selected' => false,\n 'name' => '',\n 'id' => '',\n 'class' => '',\n 'show_option_none' => __('Choose an option', 'woocommerce'),\n )\n );\n\n // Get selected value.\n if (false === $args['selected'] && $args['attribute'] && $args['product'] instanceof WC_Product) {\n $selected_key = 'attribute_' . sanitize_title($args['attribute']);\n // phpcs:disable WordPress.Security.NonceVerification.Recommended\n $args['selected'] = isset($_REQUEST[ $selected_key ]) ? wc_clean(wp_unslash($_REQUEST[ $selected_key ])) : $args['product']->get_variation_default_attribute($args['attribute']);\n // phpcs:enable WordPress.Security.NonceVerification.Recommended\n }\n $options = $args['options'];\n $product = $args['product'];\n $attribute = $args['attribute'];\n $name = $args['name'] ? $args['name'] : 'attribute_' . sanitize_title($attribute);\n $id = $args['id'] ? $args['id'] : sanitize_title($attribute);\n $class = $args['class'];\n $show_option_none = (bool) $args['show_option_none'];\n $show_option_none_text = $args['show_option_none'] ? $args['show_option_none'] : __('Choose an option', 'woocommerce'); // We'll do our best to hide the placeholder, but we'll need to show something when resetting options.\n\n if (empty($options) && ! empty($product) && ! empty($attribute)) {\n $attributes = $product->get_variation_attributes();\n $options = $attributes[ $attribute ];\n }\n\n if ($args['attribute'] == \"pa_gift\") {\n $html = '<select id=\"' . esc_attr($id) . '\" class=\"d-none ' . esc_attr($class) . '\" name=\"' . esc_attr($name) . '\" data-attribute_name=\"attribute_' . esc_attr(sanitize_title($attribute)) . '\" data-show_option_none=\"' . ($show_option_none ? 'yes' : 'no') . '\">';\n } else {\n $html = '<select id=\"' . esc_attr($id) . '\" class=\"' . esc_attr($class) . '\" name=\"' . esc_attr($name) . '\" data-attribute_name=\"attribute_' . esc_attr(sanitize_title($attribute)) . '\" data-show_option_none=\"' . ($show_option_none ? 'yes' : 'no') . '\">';\n }\n $html .= '<option value=\"\">' . esc_html($show_option_none_text) . '</option>';\n\n if (! empty($options)) {\n if ($product && taxonomy_exists($attribute)) {\n // Get terms if this is a taxonomy - ordered. We need the names too.\n $terms = wc_get_product_terms(\n $product->get_id(),\n $attribute,\n array(\n 'fields' => 'all',\n )\n );\n\n foreach ($terms as $term) {\n if (in_array($term->slug, $options, true)) {\n $html .= '<option value=\"' . esc_attr($term->slug) . '\" ' . selected(sanitize_title($args['selected']), $term->slug, false) . '>' . esc_html(apply_filters('woocommerce_variation_option_name', $term->name, $term, $attribute, $product)) . '</option>';\n }\n }\n } else {\n foreach ($options as $option) {\n // This handles < 2.4.0 bw compatibility where text attributes were not sanitized.\n $selected = sanitize_title($args['selected']) === $args['selected'] ? selected($args['selected'], sanitize_title($option), false) : selected($args['selected'], $option, false);\n $html .= '<option value=\"' . esc_attr($option) . '\" ' . $selected . '>' . esc_html(apply_filters('woocommerce_variation_option_name', $option, null, $attribute, $product)) . '</option>';\n }\n }\n }\n\n $html .= '</select>';\n\n\n if ($args['attribute'] == \"pa_gift\") {\n if (! empty($options)) {\n $html .= '<div class=\"switch-text\"><i class=\"fa fa-gift\"></i> Regálalo';\n $html .= '<label id=\"product-combinations\" class=\"switch\">';\n if ($product && taxonomy_exists($attribute)) {\n // Get terms if this is a taxonomy - ordered. We need the names too.\n $terms = wc_get_product_terms(\n $product->get_id(),\n $attribute,\n array(\n 'fields' => 'all',\n )\n );\n \n if (count($terms) == 2) {\n $html .= '<input type=\"checkbox\" id=\"gift-switch\" data-target=\"false\">';\n $html .= '<div class=\"slider round\"></div>';\n $html .= '</label></div>';\n\n $html .= '<div id=\"hidden-block\">';\n foreach ($terms as $term) {\n if (in_array($term->slug, $options, true)) {\n $html .= '<input id=\"'.esc_attr($term->slug).'\" data-target=\"#'.esc_attr($id).'\" data-value=\"'. esc_attr($term->slug) .'\" type=\"hidden\" value=\"' . esc_attr($term->slug) . '\" ' . selected(sanitize_title($args['selected']), $term->slug, false) . '>';\n }\n }\n $html .= '</div>';\n } else {\n echo '<div class=\"alert alert-warning\"><p>ERROR: This module just works with two options</p></div>';\n }\n }\n }\n }\n\n // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n echo apply_filters('woocommerce_dropdown_variation_attribute_options_html', $html, $args);\n }" ]
[ "0.66375357", "0.63443387", "0.619761", "0.6166236", "0.61566615", "0.6108635", "0.6094798", "0.6007558", "0.59698045", "0.5941952", "0.59296936", "0.5923077", "0.5901163", "0.5895589", "0.58765864", "0.5873382", "0.58575785", "0.5855617", "0.5833853", "0.5811258", "0.57908374", "0.5772633", "0.57417715", "0.5735142", "0.5719386", "0.57101494", "0.5686635", "0.5684842", "0.568191", "0.56744075" ]
0.8427441
0
Load the project page and test the first select for correct product options Teeshirt Variations Small, Red, Cotton Small, Red, Polyester Small, Purple, Cotton Small, Purple, Polyester Medium, Purple, Cotton Medium, Purple, Silk Extra Large, Red, Cotton Extra Large, Red, Polyester Extra Large, Purple, Cotton
function testProductOptionsFirstSet() { $teeshirtA = $this->objFromFixture('Product', 'teeshirtA'); $attributes = $teeshirtA->Attributes(); $options = $teeshirtA->Options(); $variations = $teeshirtA->Variations(); $this->loginAs('admin'); $teeshirtA->doPublish(); $this->logOut(); $this->loginAs($this->objFromFixture('Customer', 'buyer')); $this->get(Director::makeRelative($teeshirtA->Link())); //Check that options fields exist for each attribute $attributeOptionsMap = array(); $firstAttributeID = null; foreach ($attributes as $attribute) { if (!$firstAttributeID) $firstAttributeID = $attribute->ID; //$this->assertPartialMatchBySelector('#Options['.$attribute->ID.']', '1'); $options = $teeshirtA->getOptionsForAttribute($attribute->ID); $attributeOptionsMap[$attribute->ID] = $options->map(); } //Check that first option select has valid options in it $tempAttributeOptionsMap = $attributeOptionsMap; $firstAttributeOptions = array_shift($tempAttributeOptionsMap); $productPage = new DOMDocument(); $productPage->loadHTML($this->mainSession->lastContent()); //echo $productPage->saveHTML(); //Find the options for the first attribute select $selectFinder = new DomXPath($productPage); $firstAttributeSelectID = 'AddToCartForm_AddToCartForm_Options-'.$firstAttributeID; $firstSelect = $selectFinder->query("//select[@id='$firstAttributeSelectID']"); foreach ($firstSelect as $node) { $tmp_doc = new DOMDocument(); $tmp_doc->appendChild($tmp_doc->importNode($node, true)); $innerHTML = $tmp_doc->saveHTML(); $optionFinder = new DomXPath($tmp_doc); if ($firstAttributeOptions) foreach ($firstAttributeOptions as $optionID => $optionTitle) { $options = $optionFinder->query("//option[@value='$optionID']"); $this->assertEquals(1, $options->length); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testProductOptionsThirdSet() {\n \n $teeshirtA = $this->objFromFixture('Product', 'teeshirtA');\n\t $attributes = $teeshirtA->Attributes();\n\t $options = $teeshirtA->Options();\n\t $variations = $teeshirtA->Variations();\n\t \n\t $this->loginAs('admin');\n $teeshirtA->doPublish();\t \n\t $this->logOut();\n\t \n\t $this->loginAs($this->objFromFixture('Customer', 'buyer'));\n\t $this->get(Director::makeRelative($teeshirtA->Link()));\n\n\t $sizeAttr = $this->objFromFixture('Attribute', 'attrSize');\n\t $colorAttr = $this->objFromFixture('Attribute', 'attrColor');\n\t $materialAttr = $this->objFromFixture('Attribute', 'attrMaterial');\n\t \n\t $teeshirtASmallOpt = $this->objFromFixture('Option', 'optSmallTeeshirt');\n\t $teeshirtARedOpt = $this->objFromFixture('Option', 'optRedTeeshirt');\n\t $teeshirtACottonOpt = $this->objFromFixture('Option', 'optCottonTeeshirt');\n\t $teeshirtAPolyesterOpt = $this->objFromFixture('Option', 'optPolyesterTeeshirt');\n\t $teeshirtAExtraLargeOpt = $this->objFromFixture('Option', 'optExtraLargeTeeshirt');\n\t \n $data = $this->getFormData('AddToCartForm_AddToCartForm');\n\t unset($data[\"Options[{$colorAttr->ID}]\"]);\n unset($data[\"Options[{$materialAttr->ID}]\"]);\n unset($data[\"Options[{$sizeAttr->ID}]\"]);\n\t \n $data['Options'][$colorAttr->ID] = $teeshirtARedOpt->ID;\n $data['Options'][$materialAttr->ID] = $teeshirtACottonOpt->ID;\n $data['NextAttributeID'] = $sizeAttr->ID;\n\n\t $this->post(\n\t Director::absoluteURL($teeshirtA->Link() . '/options/'),\n\t $data\n\t );\n\t \n\t $decoded = json_decode($this->mainSession->lastContent());\n\t \n\t $expected = array(\n\t $teeshirtASmallOpt->ID => $teeshirtASmallOpt->Title,\n\t $teeshirtAExtraLargeOpt->ID => $teeshirtAExtraLargeOpt->Title\n\t );\n\t $actual = array();\n\t foreach ($decoded->options as $optionID => $optionName) {\n\t $actual[$optionID] = $optionName;\n\t }\n\t $this->assertEquals($expected, $actual);\n }", "function webinarjam_select_webinar_product_tab_content() {\n\tglobal $post, $thepostid;\n\n\t// lets get webinarlist and select one in dropdown! // simplest) .\n\t$webinarjam_api_key = get_option( 'webinarjam_api_key', '' );\n\t$webinarlist = webinarjam_list_webinars( $webinarjam_api_key );\n\t$webinars = array();\n\tif ( is_array( $webinarlist ) && ! is_wp_error( $webinarlist ) ) {\n\t\tforeach ( $webinarlist as $webinar ) {\n\t\t\t$webinars[ $webinar->webinar_id ] = $webinar->name;\n\t\t}\n\t}\n\n\t?>\n\t<div id='webinarjam_options' class='panel woocommerce_options_panel'>\n\t<div class='options_group show_if_webinarjam'>\n\t<?php\n\tif ( empty( $webinarjam_api_key ) ) {\n\t\t?>\n\t\t\t<h2>You need to specify Webinar Jam API key first</h2>\n\t\t\t\t<p><a href=\"/wp-admin/options-general.php?page=webinarjam-admin-settings\">click here to set API key</a> then go to webinarjam and create Webinars to sell</p>\n\t\t\t\t<p>then select here in dropdown list needed webinar to sell.</p>\n\t\t<?php\n\t} elseif ( is_wp_error( $webinarlist ) ) {\n\t\t?>\n\t\t\t\t<h2>Error loading webinars</h2>\n\t\t\t\t<p>Possible wrong API key</p>\n\t\t\t\t<p><p><a href=\"/wp-admin/options-general.php?page=webinarjam-admin-settings\">click here to set API key</a></p>\n\t\t\t<?php\n\t} elseif ( count( $webinars ) < 1 ) {\n\t\t?>\n\t\t\t\t\t<h2>No webinars loaded from Webinar Jam</h2>\n\t\t\t\t\t<p>Create new webinar on webinarjam admin panel and try again.</p>\n\t\t\t\t<?php\n\t} else {\n\t\twoocommerce_wp_select(\n\t\t\tarray(\n\t\t\t\t'id' => 'webinarjam_id',\n\t\t\t\t'name' => 'webinarjam_id',\n\t\t\t\t'label' => __( 'Webinar to sell' ),\n\t\t\t\t'desc_tip' => 'true',\n\t\t\t\t'description' => __( 'Select Webinar to sell, they are sorted by creation date, latest first', 'woocommerce' ),\n\t\t\t\t'options' => $webinars,\n\t\t\t)\n\t\t);\n\t}\n\n\t?>\n\t</div>\n\t</div>\n\t<?php\n\n}", "function testProductOptionsSecondSet() {\n \n $teeshirtA = $this->objFromFixture('Product', 'teeshirtA');\n $attributes = $teeshirtA->Attributes();\n $options = $teeshirtA->Options();\n $variations = $teeshirtA->Variations();\n \n $this->loginAs('admin');\n $teeshirtA->doPublish();\t \n $this->logOut();\n \n $this->loginAs($this->objFromFixture('Customer', 'buyer'));\n $this->get(Director::makeRelative($teeshirtA->Link())); \n \n\t $sizeAttr = $this->objFromFixture('Attribute', 'attrSize');\n\t $colorAttr = $this->objFromFixture('Attribute', 'attrColor');\n\t $materialAttr = $this->objFromFixture('Attribute', 'attrMaterial');\n\t \n\t $teeshirtASmallOpt = $this->objFromFixture('Option', 'optSmallTeeshirt');\n\t $teeshirtARedOpt = $this->objFromFixture('Option', 'optRedTeeshirt');\n\t $teeshirtACottonOpt = $this->objFromFixture('Option', 'optCottonTeeshirt');\n\t $teeshirtAPolyesterOpt = $this->objFromFixture('Option', 'optPolyesterTeeshirt');\n \n $data = $this->getFormData('AddToCartForm_AddToCartForm');\n unset($data[\"Options[{$colorAttr->ID}]\"]);\n unset($data[\"Options[{$materialAttr->ID}]\"]);\n unset($data[\"Options[{$sizeAttr->ID}]\"]);\n \n $data['Options'][$colorAttr->ID] = $teeshirtARedOpt->ID;\n $data['NextAttributeID'] = $materialAttr->ID;\n \n $this->post(\n Director::absoluteURL($teeshirtA->Link() . '/options/'),\n $data\n );\n \n $decoded = json_decode($this->mainSession->lastContent());\n \n $expected = array(\n $teeshirtACottonOpt->ID => $teeshirtACottonOpt->Title,\n $teeshirtAPolyesterOpt->ID => $teeshirtAPolyesterOpt->Title\n );\n $actual = array();\n foreach ($decoded->options as $optionID => $optionName) {\n $actual[$optionID] = $optionName;\n }\n $this->assertEquals($expected, $actual);\n }", "public function pc_select_tabs_show() {\n\n if ('product' != get_post_type()):\n return;\n \n endif; ?>\n\n <script type='text/javascript'>\n jQuery( document ).ready( function() {\n jQuery('.inventory_options').addClass('show_if_price_calculator').show();\n jQuery('#inventory_product_data ._manage_stock_field').addClass('show_if_price_calculator').show();\n jQuery('#inventory_product_data ._sold_individually_field').parent().addClass('show_if_price_calculator').show();\n jQuery('#inventory_product_data ._sold_individually_field').addClass('show_if_price_calculator').show();\n jQuery('.price_calculatorminmax_options').addClass('hide_if_variable').hide();\n jQuery('.price_calculatorminmax_options').addClass('show_if_price_calculator').show();\n });\n </script>\n\n <?php }", "function webinarjam_product_type_selector_js() {\n\tif ( 'product' !== get_post_type() ) :\n\t\treturn;\n\tendif;\n\t?>\n\t<script type='text/javascript' id=\"webinarjam-product-pricing-tab-enabler\">\n\t\tjQuery( '.options_group.pricing' ).addClass( 'show_if_webinarjam' );\n\t</script>\n\t<?php\n}", "function optionsframework_options() {\t\n\t\n\t// Home Project Type\n\t$home_project_type = array(\"all\" => \"All projects\", \"featured\" => \"Featured\");\t\n\n\t$page_head_size = array(\"tera\" => \"Tera\", \"giga\" => \"Giga\", \"mega\" => \"Mega\", \"alpha\" => \"Alpha\", \"beta\" => \"Beta\", \"gamma\" => \"Gamma\", \"delta\" => \"Delta\", \"epsilon\" => \"Epsilon\", \"zeta\" => \"Zeta\");\t\n\t$background_size = array(\"cover\" => \"Cover\", \"contain\" => \"Contain\", \"repeat\" => \"Repeat\", \"repeat-x\" => \"Repeat X\", \"repeat-y\" => \"Repeat Y\");\n\t$background_position = array(\"center\" => \"Center\", \"top\" => \"Top\", \"right\" => \"Right\", \"bottom\" => \"Bottom\", \"left\" => \"Left\");\t\n\t$background_repeat = array(\"repeat\" => \"Repeat\", \"repeat-x\" => \"Repeat X\", \"repeat-y\" => \"Repeat Y\");\n\n\t$menu_type = array(\"block\" => \"Block\", \"parallax\" => \"Parallax\");\n\n\n\t$header_position = array(\n\t\t\"fixed-top\" => \"Fixed Top\", \n\t\t\"fixed-bottom\" => \"Fixed Bottom\", \n\t\t\"absolute-top\" => \"Absolute Top\"\n\t);\n\n\n\n\t$home_slideshows = array(\n\t\t\"flexslider-full-screen\" => \"Flexslider Full Screen\", \n\t\t\"flexslider\" => \"Flexslider Basic\", \n\t\t\"royal\" => \"Royal Basic\"\n\t\t);\n\n\n\n\t// Thumb Ratios\n\t$home_page_thumbs_per_row = array(\"one_half\" => \"Two\", \"one_third\" => \"Three\", \"one_fourth\" => \"Four\", \"one_fifth\" => \"Five\", \"one_sixth\" => \"Six\");\n\t\n\t// Post Featured Image Size\n\t$post_featured_image_size = array(\"large\" => \"Large\", \"small\" => \"Small\");\n\t\n\t// Slideshow Transition Effect\n\t$slideshow_effect = array(\"slide\" => \"Slide\", \"fade\" => \"Fade\");\n\t\n\t// Pull all the pages into an array\n\t$options_pages = array(); \n\t$options_pages_obj = get_pages('sort_column=post_parent,menu_order');\n\t$options_pages[''] = 'Select a page:';\n\tforeach ($options_pages_obj as $page) {\n \t$options_pages[$page->ID] = $page->post_title;\n\t}\n\t\t\n\t// If using image radio buttons, define a directory path\n\t$imagepath = get_bloginfo('stylesheet_directory') . '/images/';\n\t\t\n\t$options = array();\n\n\n\n\n\t///////////////////////////////////////\n\t// GENERAL\n\t//////////////////////////////////////\t\n\t\n\t$options[] = array( \"name\" => __('General','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\t\n\n\t$options[] = array( \"name\" => __('Nav Type','poxy'),\n\t\t\t\t\"desc\" => __(' ','poxy'),\n\t\t\t\t\"id\" => \"poxy_menu_type\",\n\t\t\t\t\"std\" => \"block\",\n\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\"options\" => $menu_type);\n\n\n\t$options[] = array( \"name\" => __('Header Position','poxy'),\n\t\t\t\t\t\"desc\" => __(' ','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_header_position\",\n\t\t\t\t\t\"std\" => \"Absolute Top\",\n\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\"options\" => $header_position);\n\n\n\n\t$options[] = array( \"name\" => __('Accent Color','poxy'),\n\t\t\t\t\t\"desc\" => __('Select an accent color for your site.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_color_accent\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"color\");\n\n\t$options[] = array( \"name\" => __('Link Color','poxy'),\n\t\t\t\"desc\" => __('Select main link color. (#meat a)','poxy'),\n\t\t\t\"id\" => \"poxy_color_link\",\n\t\t\t\"std\" => \"\",\n\t\t\t\"type\" => \"color\");\n\n\t$options[] = array( \"name\" => __('Link Color Hover','poxy'),\n\t\t\t\"desc\" => __('Select main link hover color. (#meat a:hover)','poxy'),\n\t\t\t\"id\" => \"poxy_color_link_hover\",\n\t\t\t\"std\" => \"\",\n\t\t\t\"type\" => \"color\");\n\n\t$options[] = array( \"name\" => __('Logo','poxy'),\n\t\t\t\t\"desc\" => __('Upload a custom logo.','poxy'),\n\t\t\t\t\"id\" => \"logo\",\n\t\t\t\t\"type\" => \"upload\");\n\n\t$options[] = array( \"name\" => __('Mobile Logo','poxy'),\n\t\t\t\t\"desc\" => __('Upload a custom mobile logo. (1:1)','poxy'),\n\t\t\t\t\"id\" => \"mobile_logo\",\n\t\t\t\t\"type\" => \"upload\");\n\n\t$options[] = array( \"name\" => __('Favicon','poxy'),\n\t\t\t\t\t\"desc\" => __('Upload a custom favicon.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_favicon\",\n\t\t\t\t\t\"type\" => \"upload\");\n\n\n\n\t$options[] = array( \"name\" => __('Analytics/Tracking Code','poxy'),\n\t\t\t\t\t\"desc\" => __('Enter your custom analytics code. (e.g. Google Analytics).','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_analytics\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"textarea\",\n\t\t\t\t\t\"validate\" => \"none\");\t\t\t\t\t\t\t\t\t\t\n\t\t\n\t\n\t$options[] = array( \"name\" => __('Custom CSS','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter custom CSS here.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_custom_css\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"textarea\");\t\n\n\t$options[] = array( \"name\" => __('Overlay Background Image','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter custom SVG code here.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_section_overlay\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"textarea\");\t\n\n\n\t$options[] = array( \"name\" => __('Line Spacer Background Image','poxy'),\n\t\t\t\t\t\"desc\" => __('Upload a custom header background image.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_line_spacer_background_image\",\n\t\t\t\t\t\"type\" => \"upload\");\n\t\n\n\t// $options[] = array( \"name\" => __('Font for Home Slideshow Title','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the name of the <a href=\"http://www.google.com/webfonts\" target=\"_blank\">Google Web Font</a> you want to use for home slideshow titles.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_slideshow_heading_font\",\n\t// \t\t\t\t\t\"std\" => \"\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Font for Home Slideshow Description','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the name of the <a href=\"http://www.google.com/webfonts\" target=\"_blank\">Google Web Font</a> you want to use for home slideshow descriptions.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_slideshow_description_font\",\n\t// \t\t\t\t\t\"std\" => \"\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\n\n\n\t///////////////////////////////////////\n\t// HOME PAGE\t\n\t//////////////////////////////////////\t\n\t$options[] = array( \"name\" => __('Home','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\n\n\n\t$options[] = array( \"name\" => __('Home Layout','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter Layout Number.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_home_layout\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t//Main Banner\n\t$options['poxy_slideshow_enabled'] = array( \"name\" => __('Enable Slideshow','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to enable the home page slideshow.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_slideshow_enabled\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Choose Slideshow','poxy'),\n\t\t\t\t\t\t\"desc\" => __(' ','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_home_slideshow_type\",\n\t\t\t\t\t\t\"std\" => \"flexslider\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"options\" => $home_slideshows);\n\n\t$options[] = array( \"name\" => __('Slideshow Delay','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter the delay in seconds between slides. Enter 0 to disable auto-playing.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_slideshow_delay\",\n\t\t\t\t\t\t\"std\" => \"6\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Slideshow Height','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter the Height of the slideshow.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_slideshow_height\",\n\t\t\t\t\t\t\"std\" => \"1900\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Slideshow Effect','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Select the type of transition effect for the slideshow.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_slideshow_effect\",\n\t\t\t\t\t\t\"std\" => \"fade\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"options\" => $slideshow_effect);\n\n\t// $options[] = array( \"name\" => __('Slideshow right arrow','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Upload right arrow for slideshow.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_slideshow_right_arrow\",\n\t// \t\t\t\t\t\"type\" => \"upload\");\n\n\t// $options[] = array( \"name\" => __('Slideshow left arrow','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Upload left arrow for slideshow.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_slideshow_left_arrow\",\n\t// \t\t\t\t\t\"type\" => \"upload\");\n\n\t$options[] = array( \"name\" => __('Featured Products Title','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter the title that will appear above the featured pages section on the home page.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_featured_pages_title\",\n\t\t\t\t\t\t\"std\" => \"New & Featured Products\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Featured Products sub-heading','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter the description that will appear above the featured pages section on the home page.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_featured_pages_description\",\n\t\t\t\t\t\t\"std\" => \"Featured Products Description.\",\n\t\t\t\t\t\t\"type\" => \"textarea\");\n\n\t$options[] = array( \"name\" => __('Featured Pages Title','poxy'),\n\t\t\t\t\t\"desc\" => __('Enter the title that will appear above the featured pages section on the home page.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_featured_pages_title\",\n\t\t\t\t\t\"std\" => \"Our Services\",\n\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Featured Pages Description','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter the description that will appear above the featured pages section on the home page.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_featured_pages_description\",\n\t\t\t\t\t\t\"std\" => \"A little about what we do.\",\n\t\t\t\t\t\t\"type\" => \"textarea\");\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Number of Featured Pages to Show','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter the number of featured pages to show on the home page.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_featured_pages_count\",\n\t\t\t\t\t\t\"std\" => \"6\",\n\t\t\t\t\t\t\"type\" => \"text\");\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Enable Featured Pages Links','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to have the featured pages link to their corresponding single page when clicked.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_featured_pages_links_enabled\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Featured Pages Background','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Upload an image for the featured pages section.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_featured_pages_bkg\",\n\t\t\t\t\t\t\"type\" => \"upload\");\n\n\n\n\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t// Header\n\t///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t$options[] = array( \"name\" => __('Header','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\t\n\n\t$options[] = array( \"name\" => __('Enable Odd/Even BG Colors','poxy'),\n\t\t\t\"desc\" => __('Enables alterntating odd even color sections.','poxy'),\n\t\t\t\"id\" => \"poxy_enable_header_odd_even_background_colors\",\n\t\t\t\"std\" => \"\",\n\t\t\t\"type\" => \"checkbox\");\n\n\n\t$options[] = array( \"name\" => __('Is The Header Dark?','poxy'),\n\t\t\t\t\t\"desc\" => __('Check this the header is dark.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_dark_header\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Header Background Color','poxy'),\n\t\t\t\t\t\"desc\" => __('Select a header background color for your site.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_color_header\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"color\");\n\n\n\t$options[] = array( \"name\" => __('Enable Full Width Header','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to enable full width top header.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_full_width_header\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\n\n\n\t$options[] = array( \"name\" => __('Enable small Header Navigation','poxy'),\n\t\t\t\t\t\"desc\" => __('Check this box to enable small Header Navigation Bar.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_enable_top_header_menu\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Enable Small Main Navigation','poxy'),\n\t\t\t\t\t\"desc\" => __('Check this box to enable small Header Navigation Bar.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_enable_small_main_menu\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"checkbox\");\n\n\n\n\t$options[] = array( \"name\" => __('Main Menu Text Color','poxy'),\n\t\t\"desc\" => __('Select main nav text color. (#main-nav a)','poxy'),\n\t\t\"id\" => \"poxy_main_nav_color\",\n\t\t\"std\" => \"\",\n\t\t\"type\" => \"color\");\n\n\t$options[] = array( \"name\" => __('Main Menu Background Color Hover','poxy'),\n\t\t\t\t\t\"desc\" => __('Select a header background color for your site.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_header_menu_background_hover\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"color\");\n\n\t\n\n\t$options[] = array( \"name\" => __('Header Sub Menu Background Color','poxy'),\n\t\t\t\t\t\"desc\" => __('Select a header sub menu background color for your site.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_header_sub_menu_background_color\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"color\");\n\n\t$options[] = array( \"name\" => __('Header Sub Nav Color','poxy'),\n\t\t\t\t\"desc\" => __('Select a sub nav font color.','poxy'),\n\t\t\t\t\"id\" => \"poxy_header_sub_menu_color\",\n\t\t\t\t\"std\" => \"\",\n\t\t\t\t\"type\" => \"color\");\n\n\t$options[] = array( \"name\" => __('Line Spacer Header Border Color','poxy'),\n\t\t\t\t\"desc\" => __('','poxy'),\n\t\t\t\t\"id\" => \"poxy_line_spacer_header_border_color\",\n\t\t\t\t\"std\" => \"\",\n\t\t\t\t\"type\" => \"color\");\n\n\t$options[] = array( \"name\" => __('Tagline Image','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Upload a custom favicon.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_tagline_image\",\n\t\t\t\t\t\t\"type\" => \"upload\");\n\n\n\t$options[] = array( \"name\" => __('Header Background Image','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Upload a custom header background image.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_header_background_image\",\n\t\t\t\t\t\t\"type\" => \"upload\");\n\n\t\n\t// $options[] = array( \"name\" => __('Background Size','poxy'),\n\t// \t\t\t\t\"desc\" => __(' ','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_header_background_size\",\n\t// \t\t\t\t\"std\" => \"repeat\",\n\t// \t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\"options\" => $background_size);\t\n\n\t// \t$options[] = array( \"name\" => __('Background Size','poxy'),\n\t// \t\t\t\t\"desc\" => __(' ','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_header_background_repeat\",\n\t// \t\t\t\t\"std\" => \"repeat\",\n\t// \t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\"options\" => $background_repeat);\t\n\n\t// \t$options[] = array( \"name\" => __('Background X Position','poxy'),\n\t// \t\t\t\t\"desc\" => __(' ','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_header_background_x_position\",\n\t// \t\t\t\t\"std\" => \"center\",\n\t// \t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\"options\" => $background_position);\t\n\n\t// \t$options[] = array( \"name\" => __('Background Y Position','poxy'),\n\t// \t\t\t\t\"desc\" => __(' ','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_header_background_y_position\",\n\t// \t\t\t\t\"std\" => \"center\",\n\t// \t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\"options\" => $background_position);\t\n\n\n\n\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t// Page Head\n\t///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t$options[] = array( \"name\" => __('Page Head','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\n\n\t$options[] = array( \"name\" => __('Enable Header Banners','poxy'),\n\t\t\t\"desc\" => __('Enables image banner section headers.','poxy'),\n\t\t\t\"id\" => \"poxy_enable_page_head_banners\",\n\t\t\t\"std\" => \"\",\n\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Enable breadcrumbs','poxy'),\n\t\t\t\t\"desc\" => __('Check this box to enable breadcrumbs.','poxy'),\n\t\t\t\t\"id\" => \"poxy_enable_breadcrumbs\",\n\t\t\t\t\"std\" => \"\",\n\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Page Head Size','poxy'),\n\t\t\t\t\t\"desc\" => __('Select font size of page heads.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_page_head_size\",\n\t\t\t\t\t\"std\" => \"beta\",\n\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\"options\" => $page_head_size);\t\n\n\t$options[] = array( \"name\" => __('Page Head Text Color','poxy'),\n\t\t\t\t\t\"desc\" => __('Select Page Head text color. (#page-head)','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_color_pagehead\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"color\");\n\n\t\n\n\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t// SECTION SETTINGS (Content)\n\t///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\t\n\t$options[] = array( \"name\" => __('MEAT','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\n\t\n\t$options[] = array( \"name\" => __('Enable Odd/Even BG Colors','poxy'),\n\t\t\t\t\"desc\" => __('Enables alterntating odd even color sections.','poxy'),\n\t\t\t\t\"id\" => \"poxy_enable_meat_odd_even_background_colors\",\n\t\t\t\t\"std\" => \"\",\n\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Divider Height','poxy'),\n\t\t\t\t\t\t\"desc\" => __('include unit(em or px)','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_meat_divider_height\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Is The Meat Dark?','poxy'),\n\t\t\t\t\"desc\" => __('Check this the meat/main content area is dark.','poxy'),\n\t\t\t\t\"id\" => \"poxy_dark_meat\",\n\t\t\t\t\"std\" => \"\",\n\t\t\t\t\"type\" => \"checkbox\");\n\n\t// $options[] = array( \"name\" => __('Meat Background Color','poxy'),\n\t// \t\t\t\"desc\" => __('Select a background color for the main content area of the site.','poxy'),\n\t// \t\t\t\"id\" => \"poxy_background_meat\",\n\t// \t\t\t\"std\" => \"\",\n\t// \t\t\t\"type\" => \"color\");\n\n\t// $options[] = array( \"name\" => __('Even Section Background Color','poxy'),\n\t// \t\t\t\"desc\" => __('','poxy'),\n\t// \t\t\t\"id\" => \"poxy_even_section_background_color\",\n\t// \t\t\t\"std\" => \"\",\n\t// \t\t\t\"type\" => \"color\");\n\n\t// $options[] = array( \"name\" => __('Odd Section Background Color','poxy'),\n\t// \t\t\"desc\" => __('','poxy'),\n\t// \t\t\"id\" => \"poxy_odd_section_background_color\",\n\t// \t\t\"std\" => \"\",\n\t// \t\t\"type\" => \"color\");\n\n\t//Main Banner\n\t$options['poxy_full_width_spacers_enabled'] = array( \"name\" => __('Enable Full Width Spacers','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to enable full width spacers.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_full_width_spacers_enabled\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\n\n\t$options[] = array( \"name\" => __('Line Spacer Bottom Border Color','poxy'),\n\t\t\t\t\t\"desc\" => __('','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_line_spacer_bottom_border_color\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"color\");\n\t\t\t\n\n\n\t\t$options[] = array( \"name\" => __('Line Spacer Top Border Color','poxy'),\n\t\t\t\t\t\t\"desc\" => __('','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_line_spacer_top_border_color\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"color\");\n\n\n\t\t$options[] = array( \"name\" => __('Meat Background Image','poxy'),\n\t\t\t\t\t\"desc\" => __('Upload a custom meat background image.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_meat_background_image\",\n\t\t\t\t\t\"type\" => \"upload\");\n\n\t\t// $options[] = array( \"name\" => __('Background Size','poxy'),\n\t\t// \t\t\t\"desc\" => __(' ','poxy'),\n\t\t// \t\t\t\"id\" => \"poxy_meat_background_size\",\n\t\t// \t\t\t\"std\" => \"repeat\",\n\t\t// \t\t\t\"type\" => \"select\",\n\t\t// \t\t\t\"options\" => $background_size);\t\n\n\t\t// $options[] = array( \"name\" => __('Background Size','poxy'),\n\t\t// \t\t\t\"desc\" => __(' ','poxy'),\n\t\t// \t\t\t\"id\" => \"poxy_meat_background_repeat\",\n\t\t// \t\t\t\"std\" => \"repeat\",\n\t\t// \t\t\t\"type\" => \"select\",\n\t\t// \t\t\t\"options\" => $background_repeat);\t\n\n\t\t// $options[] = array( \"name\" => __('Background X Position','poxy'),\n\t\t// \t\t\t\"desc\" => __(' ','poxy'),\n\t\t// \t\t\t\"id\" => \"poxy_meat_background_x_position\",\n\t\t// \t\t\t\"std\" => \"center\",\n\t\t// \t\t\t\"type\" => \"select\",\n\t\t// \t\t\t\"options\" => $background_position);\t\n\n\t\t// $options[] = array( \"name\" => __('Background Y Position','poxy'),\n\t\t// \t\t\t\"desc\" => __(' ','poxy'),\n\t\t// \t\t\t\"id\" => \"poxy_meat_background_y_position\",\n\t\t// \t\t\t\"std\" => \"center\",\n\t\t// \t\t\t\"type\" => \"select\",\n\t\t// \t\t\t\"options\" => $background_position);\t\n\n\n\n\n\n\n\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t// Footer\n\t///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Footer','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\n\n\t$options[] = array( \"name\" => __('Home Layout','poxy'),\n\t\t\t\t\t\"desc\" => __('Enter Layout Number.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_footer_widget_layout\",\n\t\t\t\t\t\"std\" => \"4\",\n\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Enable Odd/Even BG Colors','poxy'),\n\t\t\t\"desc\" => __('Enables alterntating odd even color sections.','poxy'),\n\t\t\t\"id\" => \"poxy_enable_footer_odd_even_background_colors\",\n\t\t\t\"std\" => \"\",\n\t\t\t\"type\" => \"checkbox\");\n\n\n\n\t$options[] = array( \"name\" => __('Is The Footer Dark?','poxy'),\n\t\t\t\t\t\"desc\" => __('Check this the footer is dark.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_dark_footer\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Footer Background Color','poxy'),\n\t\t\t\t\"desc\" => __('Select a body/footer background color for your site.','poxy'),\n\t\t\t\t\"id\" => \"poxy_background_body\",\n\t\t\t\t\"std\" => \"\",\n\t\t\t\t\"type\" => \"color\");\n\n\n\n\t$options[] = array( \"name\" => __('Footer Logo','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Upload a custom Footer logo.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_footer_logo\",\n\t\t\t\t\t\t\"type\" => \"upload\");\n\n\n\t$options[] = array( \"name\" => __('Line Spacer Footer Border Color','poxy'),\n\t\t\t\t\"desc\" => __('','poxy'),\n\t\t\t\t\"id\" => \"poxy_line_spacer_footer_border_color\",\n\t\t\t\t\"std\" => \"\",\n\t\t\t\t\"type\" => \"color\");\n\n\n\t$options[] = array( \"name\" => __('Copywrite Background Color','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Select the copywrite background color for your site.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_background_copywrite\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"color\");\n\n\n\n\n\t$options[] = array( \"name\" => __('Footer Background Image','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Upload a custom footer background image.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_footer_background_image\",\n\t\t\t\t\t\t\"type\" => \"upload\");\n\t\n\t// $options[] = array( \"name\" => __('Background Size','poxy'),\n\t// \t\t\t\t\"desc\" => __(' ','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_footer_background_size\",\n\t// \t\t\t\t\"std\" => \"repeat\",\n\t// \t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\"options\" => $background_size);\t\n\n\t// \t$options[] = array( \"name\" => __('Background Size','poxy'),\n\t// \t\t\t\t\"desc\" => __(' ','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_footer_background_repeat\",\n\t// \t\t\t\t\"std\" => \"repeat\",\n\t// \t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\"options\" => $background_repeat);\t\n\n\t// \t$options[] = array( \"name\" => __('Background X Position','poxy'),\n\t// \t\t\t\t\"desc\" => __(' ','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_footer_background_x_position\",\n\t// \t\t\t\t\"std\" => \"center\",\n\t// \t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\"options\" => $background_position);\t\n\n\t// \t$options[] = array( \"name\" => __('Background Y Position','poxy'),\n\t// \t\t\t\t\"desc\" => __(' ','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_footer_background_y_position\",\n\t// \t\t\t\t\"std\" => \"center\",\n\t// \t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\"options\" => $background_position);\t\n\n\n\t\n\n\t// $options[] = array( \"name\" => __('Background Size','poxy'),\n\t// \t\t\t\"desc\" => __(' ','poxy'),\n\t// \t\t\t\"id\" => \"poxy_footer_background_size\",\n\t// \t\t\t\"std\" => \"repeat\",\n\t// \t\t\t\"type\" => \"select\",\n\t// \t\t\t\"options\" => $background_size;\t\n\n\t// $options[] = array( \"name\" => __('Background X Position','poxy'),\n\t// \t\t\"desc\" => __('','poxy'),\n\t// \t\t\"id\" => \"poxy_footer_background_x_position\",\n\t// \t\t\"std\" => \"repeat\",\n\t// \t\t\"type\" => \"select\",\n\t// \t\t\"options\" => $background_x_position;\t\n\n\t// $options[] = array( \"name\" => __('Background Y Position','poxy'),\n\t// \t\t\"desc\" => __('','poxy'),\n\t// \t\t\"id\" => \"poxy_footer_background_y_position\",\n\t// \t\t\"std\" => \"repeat\",\n\t// \t\t\"type\" => \"select\",\n\t// \t\t\"options\" => $background_y_position;\n\n\n\t\n\n\n\n\n\n\t\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Appearance','poxy'),\n\t// \t\t\t\t\t\"type\" => \"heading\");\n\t\n\t// $options[] = array( \"name\" => __('Header Color','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select a header color for your theme.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_color_header\",\n\t// \t\t\t\t\t\"std\" => \"#74c9b4\",\n\t// \t\t\t\t\t\"type\" => \"color\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Accent Color','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select an accent color for your theme.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_color_accent\",\n\t// \t\t\t\t\t\"std\" => \"#74c9b4\",\n\t// \t\t\t\t\t\"type\" => \"color\");\t\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Menu Color','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select a color for your menu links.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_color_menu\",\n\t// \t\t\t\t\t\"std\" => \"#8f8f8f\",\n\t// \t\t\t\t\t\"type\" => \"color\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Menu Hover Color','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select a hover color for your menu links.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_color_menu_hover\",\n\t// \t\t\t\t\t\"std\" => \"#2e2e2e\",\n\t// \t\t\t\t\t\"type\" => \"color\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Button Color','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select a color for your buttons.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_color_btn\",\n\t// \t\t\t\t\t\"std\" => \"#757575\",\n\t// \t\t\t\t\t\"type\" => \"color\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Button Hover Color','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select a hover color for your buttons.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_color_btn_hover\",\n\t// \t\t\t\t\t\"std\" => \"#595959\",\n\t// \t\t\t\t\t\"type\" => \"color\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Link Color','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select a color for your links.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_color_link\",\n\t// \t\t\t\t\t\"std\" => \"#4da7ca\",\n\t// \t\t\t\t\t\"type\" => \"color\");\n\n\t// $options[] = array( \"name\" => __('Link Hover Color','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select a hover color for your links.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_color_link_hover\",\n\t// \t\t\t\t\t\"std\" => \"#4290ae\",\n\t// \t\t\t\t\t\"type\" => \"color\");\n\n\n\t\t\n\n\n\n\t\n\n\n\n\t\n\t\n\n\n\t///////////////////////////////////////\n\t// Info Bar\n\t//////////////////////////////////////\t\n\t// $options[] = array( \"name\" => __('Info Bar','poxy'),\n\t// \t\t\t\t\t\"type\" => \"heading\");\n\n\t// $options[] = array( \"name\" => __('Info Bar Main Title','poxy'),\n\t// \t\t\t\t\"desc\" => __('Main Title.','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_info_box_34_title\",\n\t// \t\t\t\t\"std\" => \"Info Box Title\",\n\t// \t\t\t\t\"type\" => \"text\");\n\n\t// $options[] = array( \"name\" => __('Main Section Copy','poxy'),\n\t// \t\t\t\t\"desc\" => __('Enter the copy for the large block.','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_info_box_34_content\",\n\t// \t\t\t\t\"std\" => \"3/4 Section Content\",\n\t// \t\t\t\t\"type\" => \"textarea\");\n\n\t// $options[] = array( \"name\" => __('Main Section Image','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Upload Main Info Box Image.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_info_box_34_image\",\n\t// \t\t\t\t\t\"type\" => \"upload\");\n\n\t// $options[] = array( \"name\" => __('Secondary Section Copy','poxy'),\n\t// \t\t\t\t\"desc\" => __('Enter the copy for the small block.','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_info_box_14_content\",\n\t// \t\t\t\t\"std\" => \"1/4 Section Content\",\n\t// \t\t\t\t\"type\" => \"textarea\");\n\n\t// $options[] = array( \"name\" => __('Secondary Section Button Title','poxy'),\n\t// \t\t\t\"desc\" => __('Button Title.','poxy'),\n\t// \t\t\t\"id\" => \"poxy_info_box_14_button_title\",\n\t// \t\t\t\"std\" => \"Shop Now!\",\n\t// \t\t\t\"type\" => \"text\");\n\n\t// $options[] = array( \"name\" => __('Secondary Section Button URL','poxy'),\n\t// \t\t\t\"desc\" => __('Secondary Section Button URL.','poxy'),\n\t// \t\t\t\"id\" => \"poxy_info_box_14_button_url\",\n\t// \t\t\t\"std\" => \"\",\n\t// \t\t\t\"type\" => \"text\");\n\n\n\n\n\n\n\n\n\t// Client Logos\n\t// $options['poxy_client_logos_enabled'] = array( \"name\" => __('Enable Client Logos','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Check this box to enable the home Client Logos.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_client_logos_enabled\",\n\t// \t\t\t\t\t\"std\" => \"1\",\n\t// \t\t\t\t\t\"type\" => \"checkbox\");\n\n\t// $options[] = array( \"name\" => __('Enable Client Logos','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Check this box to have the client logos link to their corresponding single page when clicked.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_client_logos_links_enabled\",\n\t// \t\t\t\t\t\"std\" => \"1\",\n\t// \t\t\t\t\t\"type\" => \"checkbox\");\n\n\t// $options[] = array( \"name\" => __('Number of Featured Pages to Show','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the number of featured pages to show on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_client_logos_count\",\n\t// \t\t\t\t\t\"std\" => \"6\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\n\t// $options[] = array( \"name\" => __('Client logos Per Row','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select the number of thumbs to display per row.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_client_thumbs_per_row\",\n\t// \t\t\t\t\t\"std\" => \"one_fourth\",\n\t// \t\t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\t\"options\" => $home_page_thumbs_per_row);\n\n\n\t// $options[] = array( \"name\" => __('Client Logos Title','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the title that will appear above the featured pages section on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_client_logos_title\",\n\t// \t\t\t\t\t\"std\" => \"Featured Clients\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\n\n\t// $options[] = array( \"name\" => __('Client Logos Description','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the description that will appear above the featured pages section on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_client_logos_description\",\n\t// \t\t\t\t\t\"std\" => \"Client Logos Description.\",\n\t// \t\t\t\t\t\"type\" => \"textarea\");\t\t\t\t\n\t\n\n\t\n\n\n\n\t//Twitter Feed\n\t// $options['poxy_twitter_feed_enabled'] = array( \"name\" => __('Enable Twitter Feed','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Check this box to enable the home twitter feed.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_twitter_feed_enabled\",\n\t// \t\t\t\t\t\"std\" => \"1\",\n\t// \t\t\t\t\t\"type\" => \"checkbox\");\n\n\t// $options[] = array( \"name\" => __('Twitter API','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the twitter API.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_twitter_api\",\n\t// \t\t\t\t\t\"std\" => \"\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\n\t// $options[] = array( \"name\" => __('Twitter Feed Title','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the title that will appear above the twitter feed on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_twitter_feed_title\",\n\t// \t\t\t\t\t\"std\" => \"Twitter Feed\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\n\t// $options[] = array( \"name\" => __('Twitter Feed Description','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the description that will appear above the twitter feed on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_twitter_feed_description\",\n\t// \t\t\t\t\t\"std\" => \"Twitter Feed Description.\",\n\t// \t\t\t\t\t\"type\" => \"textarea\");\n\n\n\n\t\n\t\t\t\t\t\t\n\t\n\t//Featued Projects\t\t\t\n\t// $options[] = array( \"name\" => __('Recent Projects Title','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the title that will appear above the recent themes section on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_recent_projects_title\",\n\t// \t\t\t\t\t\"std\" => \"Our Latest Work\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Recent Projects Description','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the description that will appear above the recent projects section on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_recent_projects_description\",\n\t// \t\t\t\t\t\"std\" => \"Take a look at some of our recent projects.\",\n\t// \t\t\t\t\t\"type\" => \"textarea\");\n\t\t\t\t\t\t\n\t\n\t// $options[] = array( \"name\" => __('Number of Projects to Show','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the number of project to show on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_home_project_count\",\n\t// \t\t\t\t\t\"std\" => \"6\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Type of Projects to Show','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select the type of projects to show on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_home_project_type\",\n\t// \t\t\t\t\t\"std\" => \"latest\",\n\t// \t\t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\t\"options\" => $home_project_type);\n\n\n\t//Testimonials\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Testimonials Title','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the title that will appear above the testimonials section on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_testimonials_title\",\n\t// \t\t\t\t\t\"std\" => \"Testimonials\",\n\t// \t\t\t\t\t\"type\" => \"text\");\t\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Testimonials Description','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the description that will appear above the testimonials section on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_testimonials_description\",\n\t// \t\t\t\t\t\"std\" => \"What our customers are saying.\",\n\t// \t\t\t\t\t\"type\" => \"textarea\");\n\t\n\t\n\t// $options[] = array( \"name\" => __('Number of Testimonials to Show','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the number of Testimonials to show on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_home_testimonial_count\",\n\t// \t\t\t\t\t\"std\" => \"3\",\n\t// \t\t\t\t\t\"type\" => \"text\");\t\n\t\t\t\t\t\t\n\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\n\t//Home Posts\t\n\t// $options[] = array( \"name\" => __('Recent Posts Title','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the title that will appear above the posts section on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_recent_posts_title\",\n\t// \t\t\t\t\t\"std\" => \"From the Bog\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Recent Posts Description','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the description that will appear above the posts section on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_recent_posts_description\",\n\t// \t\t\t\t\t\"std\" => \"\",\n\t// \t\t\t\t\t\"type\" => \"textarea\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Number of Recent Posts to Show','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the number of recent posts to show on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_recent_posts_count\",\n\t// \t\t\t\t\t\"std\" => \"3\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\t\n\t\t\t\t\n\n\t\t\n\n\n\n\n\n\n\t///////////////////////////////////////\n\t// Posts\n\t//////////////////////////////////////\t\n\t$options[] = array( \"name\" => __('Blog','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\n\n\t$options[] = array( \"name\" => __('Blog Layout','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter Layout Number.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_blog_layout\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Blog Single Post Layout','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter Layout Number.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_blog_single_layout\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Blog Banner Image','poxy'),\n\t\t\t\t\t\"desc\" => __('Upload a blog page banner image.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_blog_banner\",\n\t\t\t\t\t\"type\" => \"upload\");\n\t\n\t$options[] = array( \"name\" => \"Select a Page\",\n\t\t\t\t\t\t\"desc\" => \"Select the page you're using as your blog page. This is used to show the blog title at the top of your posts.\",\n\t\t\t\t\t\t\"id\" => \"poxy_blog_page\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"options\" => $options_pages);\n\n\t$options[] = array( \"name\" => __('Post Heading Size','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Select font size of post titles.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_head_size\",\n\t\t\t\t\t\t\"std\" => \"beta\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"options\" => $page_head_size);\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Show Author','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to show the author.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_show_author\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Show Date','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to show the publish date.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_show_date\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Show Category','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to show the category.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_show_category\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Show Comment Count','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to show the comment count.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_show_comments\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Featured Image Size','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Select the size of the post featured image.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_featured_img_size\",\n\t\t\t\t\t\t\"std\" => \"large\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"options\" => $post_featured_image_size);\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Show Featured Image on Single Posts','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to show the featured image on single post pages.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_show_featured_image\",\n\t\t\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Show Featured Image on Home Page','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to show the featured image on the home page template.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_show_featured_image_on_home\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Enable Full Width Blog','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to make your posts span the width of the page.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_full_width\",\n\t\t\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Show Full Posts','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to show full posts instead of excerpts on index and archive pages.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_show_full\",\n\t\t\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Read More Link Title','poxy'),\n\t\t\t\t\"desc\" => __('Main Title.','poxy'),\n\t\t\t\t\"id\" => \"poxy_read_more_title\",\n\t\t\t\t\"std\" => \"Read More\",\n\t\t\t\t\"type\" => \"text\");\n\n\n\t$options[] = array( \"name\" => __('Disqus Shortname','poxy'),\n\t\t\t\t\t\"desc\" => __('Enter your disqus shortname.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_disqus_shortname\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t\n\t\t\t\t\t\t\n\t\n\t\n\t///////////////////////////////////////\n\t// Footer \n\t//////////////////////////////////////\t\n\t// $options[] = array( \"name\" => __('Footer','poxy'),\n\t// \t\t\t\t\t\"type\" => \"heading\");\n\n\t// $options[] = array( \"name\" => __('Left Footer Text','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('This will appear on the left side of the footer.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_footer_left\",\n\t// \t\t\t\t\t\"std\" => \"\",\n\t// \t\t\t\t\t\"type\" => \"textarea\");\n\n\t// $options[] = array( \"name\" => __('Right Footer Text','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('This will appear on the right side of the footer.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_footer_right\",\n\t// \t\t\t\t\t\"std\" => \"\",\n\t// \t\t\t\t\t\"type\" => \"textarea\");\n\n\t// $options[] = array( \"name\" => __('Facebook Likes','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Check this box to display an Facebook likes.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_show_facebook_likes\",\n\t// \t\t\t\t\t\"std\" => \"0\",\n\t// \t\t\t\t\t\"type\" => \"checkbox\");\n\n\n\n\t\n\t// $options[] = array( \"name\" => __('Google Map Address','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the address to display on your Google Map.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_google_map_address\",\n\t// \t\t\t\t\t\"std\" => \"\",\n\t// \t\t\t\t\t\"type\" => \"textarea\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Google Map Height','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter a height in pixels for your Google Map.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_google_map_height\",\n\t// \t\t\t\t\t\"std\" => \"350\",\n\t// \t\t\t\t\t\"type\" => \"text\");\t\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Google Map Tint Color','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select a tint color for your Google Map.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_google_map_tint\",\n\t// \t\t\t\t\t\"std\" => \"#79d1bb\",\n\t// \t\t\t\t\t\"type\" => \"color\");\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\n\t///////////////////////////////////////\n\t// Social Networks\n\t//////////////////////////////////////\t\n\t\n\t$options[] = array( \"name\" => __('Social','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\t\n\n\t$options[] = array( \"name\" => __('Facebook Likes (Facebook ID)','poxy'),\n\t\t\t\t\t\"desc\" => __('Enter the facebook page ID. Example (https://www.facebook.com/<stong>FACEBOOK_ID</strong>)','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_facebook_page_id\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Social Network Icons','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to show footer widgets.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_social_icons\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Facebook','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Facebook URL.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_facebook_url\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Twitter','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Twitter URL.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_twitter_url\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Tumblr','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Tumblr URL.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_tumblr_url\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Google','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Google URL.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_google_url\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Linkedin','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Linkedin URL.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_linkedin_url\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Pinterest','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Pinterest URL.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_pinterest_url\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t$options[] = array( \"name\" => __('Vimeo','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Vimeo URL.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_vimeo_url\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('YouTube','poxy'),\n\t\t\t\t\t\t\"desc\" => __('YouTube URL.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_youtube_url\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Instagram','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Instagram URL.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_instagram_url\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t///////////////////////////////////////\n\t// Typography\n\t//////////////////////////////////////\t\n\t\n\t$options[] = array( \"name\" => __('Typography','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\t\n\n\n\t$options[] = array( \"name\" => __('Paragraph Color','poxy'),\n\t\t\t\t\t\"desc\" => __('Select body text color.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_color_body\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"color\");\n\n\t$options[] = array( \"name\" => __('Paragraph Font','poxy'),\n\t\t\t\t\t\"desc\" => __('Enter the name of the <a href=\"http://www.google.com/webfonts\" target=\"_blank\">Google Web Font</a> you want to use for the body text.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_body_font\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Paragraph Line Height','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Paragraph Line Height (ems)','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_paragraph_line_height\",\n\t\t\t\t\t\t\"std\" => \"1.725\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Paragraph Letter Spacing','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Paragraph letter spacing (ems)','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_paragraph_letter_spacing\",\n\t\t\t\t\t\t\"std\" => \"0.03\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Heading Text Color','poxy'),\n\t\t\t\"desc\" => __('Select heading text color. (h1, h2, h3, h4, h5, h6)','poxy'),\n\t\t\t\"id\" => \"poxy_color_heading\",\n\t\t\t\"std\" => \"\",\n\t\t\t\"type\" => \"color\");\n\n\n\t$options[] = array( \"name\" => __('Heading Font','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter the name of the <a href=\"http://www.google.com/webfonts\" target=\"_blank\">Google Web Font</a> you want to use for headings.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_heading_font\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\n\t$options[] = array( \"name\" => __('Heading Line Height','poxy'),\n\t\t\t\t\t\"desc\" => __('Heading Line Height (ems)','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_heading_line_height\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Heading Letter Spacing','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Heading letter spacing (ems)','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_heading_letter_spacing\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\n\n\n\t$options[] = array( \"name\" => __('Heading Weight','poxy'),\n\t\t\t\t\t\"desc\" => __('Heading Font Weight (300, 500, 800, bold, light, normal)','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_heading_weight\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Font for Sub Headings','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter the name of the <a href=\"http://www.google.com/webfonts\" target=\"_blank\">Google Web Font</a> you want to use for sub headings.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_sub_heading_font\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\n\n\t$options[] = array( \"name\" => __('Font for Main Menu','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter the name of the <a href=\"http://www.google.com/webfonts\" target=\"_blank\">Google Web Font</a> you want to use for the main menu.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_menu_font\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\t\n\t\n\n\n\t///////////////////////////////////////\n\t// Development\n\t//////////////////////////////////////\t\n\t$options[] = array( \"name\" => __('Post Types','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\t\n\n\t$options[] = array( \"name\" => __('Events','poxy'),\n\t\t\t\t\t\"desc\" => __('Check to enable events.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_event_post_type\",\n\t\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('FAQs','poxy'),\n\t\t\t\t\t\"desc\" => __('Check to enable events.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_faq_post_type\",\n\t\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Testimonials','poxy'),\n\t\t\t\t\t\"desc\" => __('Check to enable testimonials.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_testimonial_post_type\",\n\t\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Staff','poxy'),\n\t\t\t\t\"desc\" => __('Check to enable staff/team.','poxy'),\n\t\t\t\t\"id\" => \"poxy_staff_post_type\",\n\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Locations','poxy'),\n\t\t\t\t\"desc\" => __('Check to enable Locations.','poxy'),\n\t\t\t\t\"id\" => \"poxy_locations_post_type\",\n\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\"type\" => \"checkbox\");\n\n\n\t///////////////////////////////////////\n\t// Development\n\t//////////////////////////////////////\t\n\t$options[] = array( \"name\" => __('DEV','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\t\n\n\t$options[] = array( \"name\" => __('Wordpress Admin Bar.','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Hide admin bar.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_hide_admin_bar\",\n\t\t\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('DEV Styles.','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Show DEV Styles.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_dev_styles\",\n\t\t\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Option Styles.','poxy'),\n\t\t\t\t\t\"desc\" => __('Hide Options Styles.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_option_styles\",\n\t\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Placeholder Text Color','poxy'),\n\t\t\t\"desc\" => __('','poxy'),\n\t\t\t\"id\" => \"poxy_placeholder_text_color\",\n\t\t\t\"std\" => \"#666\",\n\t\t\t\"type\" => \"color\");\n\n\t$options[] = array( \"name\" => __('Placeholder Background Color','poxy'),\n\t\t\t\"desc\" => __('','poxy'),\n\t\t\t\"id\" => \"poxy_placeholder_background_color\",\n\t\t\t\"std\" => \"#ccc\",\n\t\t\t\"type\" => \"color\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Placeholder Text','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter Placeholder Text.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_placeholder_text\",\n\t\t\t\t\t\t\"std\" => \"\n\t\t\t\t\t\tLorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vitae mi gravida, imperdiet nisi non, egestas elit. Vivamus quis dapibus lectus. Aliquam in ornare urna. Donec aliquam eu neque eu facilisis. Fusce venenatis, ipsum at sagittis tincidunt, tellus arcu elementum ipsum, non tincidunt lorem velit ut nisl. Curabitur vulputate metus tortor. Fusce volutpat rutrum nunc, vel luctus lorem egestas eu. Etiam viverra quam in sapien mollis, quis egestas quam gravida. Morbi nec orci vulputate, volutpat magna in, placerat nisl. Vivamus luctus dui id gravida fermentum. Etiam aliquam urna dolor, eget ornare turpis tempus in. Nam id eros eget mi suscipit rutrum.\n\nUt rutrum posuere mauris. Nulla auctor ac leo at rutrum. Ut ultrices, mauris vitae faucibus lacinia, magna magna condimentum felis, non aliquet lorem purus eget leo. Nam id augue quis tortor tristique porttitor in ac turpis. Aliquam ullamcorper nulla id volutpat accumsan. Fusce interdum at magna at condimentum. Etiam vitae dolor faucibus, venenatis dui vitae, vulputate ipsum. Ut at tincidunt felis, at consectetur diam. Nulla consequat sodales fringilla.\n\nPhasellus tristique enim lorem, id vehicula risus egestas id. Quisque suscipit non nunc vitae vestibulum. Morbi porttitor turpis vehicula sollicitudin suscipit. Duis feugiat dapibus risus vel posuere. In placerat mi vel dapibus dictum. Nulla vitae sem lacinia, volutpat orci eget, dapibus dui. Cras sed rhoncus odio. Fusce luctus rutrum est sit amet tristique. Pellentesque tincidunt quam eget condimentum ornare. Vivamus odio sapien, lacinia vitae fermentum vitae, dictum et felis. Morbi vitae urna ultrices, imperdiet quam et, imperdiet augue. Quisque imperdiet elementum diam, a vestibulum nulla rhoncus eget. Ut et interdum turpis, vel euismod justo.\n\nMaecenas molestie sapien at ipsum blandit ultrices nec in dui. Morbi pellentesque pretium felis, at blandit justo lacinia nec. Suspendisse ultrices bibendum tristique. Curabitur adipiscing laoreet risus. Fusce convallis tempor mi quis consequat. In rutrum ligula at augue dictum, nec ultricies massa pretium. Donec molestie condimentum sagittis. Proin auctor laoreet nisi, eu cursus lorem vestibulum eu. Fusce vestibulum arcu a nibh cursus, nec congue mi convallis.\n\t\t\t\t\t\t\",\n\t\t\t\t\t\t\"type\" => \"textarea\",\n\t\t\t\t\t\t\"validate\" => \"none\");\n\n\t\n\t\t// $options[] = array( \"name\" => __('Analytics','poxy'),\n\t\t// \t\t\t\t\"desc\" => __('Enter your custom analytics code. (e.g. Google Analytics).','poxy'),\n\t\t// \t\t\t\t\"id\" => \"poxy_analytics\",\n\t\t// \t\t\t\t\"std\" => \"\",\n\t\t// \t\t\t\t\"type\" => \"textarea\",\n\t\t// \t\t\t\t\"validate\" => \"none\");\t\t\t\n\t\n\t\n\t\t\t\t\t\t\n\t\n\treturn $options;\n}", "function gp_project_type_create_form() {\n ?>\n <div class=\"form-field\">\n <label for=\"project-type-layout\"><?php _e( 'Layout', 'gp' ); ?></label>\n <select name=\"project-type-layout\" id=\"project-type-layout\" class=\"postform\">\n <?php echo it_array_to_select_options( gp_portfolio_layouts() ); ?>\n </select>\n <br>\n <span class=\"description\"><?php _e( 'Portfolio layout that will be used to display the project type.', 'gp' ); ?></span>\n </div>\n <div id=\"project-type-layout-option\" class=\"form-field\" style=\"display: none\">\n <label for=\"project-type-grid-size\"><?php _e( 'Grid Size', 'gp' ); ?></label>\n <select name=\"project-type-grid-size\" id=\"project-type-grid-size\">\n <?php echo it_array_to_select_options( GridPortfolioAdmin::get_grid_size_options(), GridPortfolio::DEFAULT_GRID_SIZE ); ?>\n </select>\n </div>\n <?php\n}", "public function productPane(){\n \t// allow for filtering\n \t// this is available on all pages\n }", "function gp_project_type_edit_form( $project_type ) {\n\n $options = new gpProjectTypeOptions( $project_type->term_id );\n\n ?>\n <tr class=\"form-field\">\n <th scope=\"row\" valign=\"top\">\n <label for=\"project-type-layout\"><?php _e( 'Layout', 'gp' ); ?></label>\n </th>\n <td>\n <select name=\"project-type-layout\" id=\"project-type-layout\">\n <?php echo it_array_to_select_options( gp_portfolio_layouts(), $options->layout ); ?>\n </select>\n <br />\n <span class=\"description\"><?php _e( 'Portfolio layout that will be used to display the project type.', 'gp' ); ?></span>\n </td>\n </tr>\n <tr id=\"project-type-layout-option\" class=\"form-field\"<?php if ( $options->layout != 'grid' ) { echo ' style=\"display: none\"'; } ?>>\n <th scope=\"row\" valign=\"top\">\n <label for=\"project-type-grid-size\"><?php _e( 'Grid Size', 'gp' ); ?></label>\n </th>\n <td>\n <select name=\"project-type-grid-size\" id=\"project-type-grid-size\">\n <?php echo it_array_to_select_options( GridPortfolioAdmin::get_grid_size_options(), $options->grid_size ? $options->grid_size : GridPortfolio::DEFAULT_GRID_SIZE ); ?>\n </select>\n </td>\n </tr>\n <?php\n}", "protected function render()\n {\n $settings = $this->get_settings_for_display();\n $countProduct = 4;\n /**\n * Best sellers data, first tab\n */\n for ($pbs = 1; $pbs <= $countProduct; $pbs++) {\n ${\"idProduct_$pbs\"} = (!empty($settings['id_product_' . $pbs]) && $settings['id_product_' . $pbs] != 'Empty') ? $settings['id_product_' . $pbs] : $settings['id_variant_' . $pbs];\n\n if (!empty(${\"idProduct_$pbs\"}) && ${\"idProduct_$pbs\"} != 'Empty') {\n ${\"product$pbs\"} = wc_get_product(${\"idProduct_$pbs\"});\n ${\"productUrl$pbs\"} = ${\"product$pbs\"}->get_permalink();\n ${\"productName$pbs\"} = (!empty($settings['id_product_title_' . $pbs])) ? $settings['id_product_title_' . $pbs] : ${\"product$pbs\"}->name;\n ${\"imageUrl$pbs\"} = (!empty($settings['id_product_image_' . $pbs]['url'])) ? $settings['id_product_image_' . $pbs]['url'] : wp_get_attachment_url(${\"product$pbs\"}->image_id);\n ${\"priceProduct$pbs\"} = (!empty(${\"product$pbs\"}->regular_price)) ? ${\"product$pbs\"}->regular_price : ${\"product$pbs\"}->price;\n\n /**\n * update sale if exist over sale in module\n */\n if ((${\"product$pbs\"}->sale_price != $settings['id_product_sale_' . $pbs]) &&\n !empty($settings['id_product_sale_' . $pbs]) &&\n $settings['id_product_sale_' . $pbs] != 0\n ) {\n ${\"product$pbs\"}->set_sale_price($settings['id_product_sale_' . $pbs]);\n ${\"product$pbs\"}->save();\n }\n\n ${\"priceSaleProduct$pbs\"} = (!empty(${\"product$pbs\"}->sale_price)) ? ${\"product$pbs\"}->sale_price : null;\n ${\"percent$pbs\"} = (!empty(${\"product$pbs\"}->sale_price)) ? (${\"priceProduct$pbs\"} != 0) ? (100 - ceil(${\"product$pbs\"}->sale_price * 100 / ${\"priceProduct$pbs\"})) : null : null;\n }\n\n }\n\n /**\n * New Arrivals data\n */\n for ($pna = 1; $pna <= $countProduct; $pna++) {\n ${\"idProductNewArrivals_$pna\"} = (!empty($settings['id_product_new_arrivals_' . $pna]) && $settings['id_product_new_arrivals_' . $pna] != 'Empty') ? $settings['id_product_new_arrivals_' . $pna] : $settings['id_variant_new_arrivals_' . $pna];\n\n if (!empty(${\"idProductNewArrivals_$pna\"}) && ${\"idProductNewArrivals_$pna\"} != 'Empty') {\n ${\"productNewArrivals$pna\"} = wc_get_product(${\"idProductNewArrivals_$pna\"});\n ${\"productUrlNewArrivals$pna\"} = ${\"productNewArrivals$pna\"}->get_permalink();\n ${\"productNameNewArrivals$pna\"} = (!empty($settings['id_product_title_new_arrivals_' . $pna])) ? $settings['id_product_title_new_arrivals_' . $pna] : ${\"productNewArrivals$pna\"}->name;\n ${\"imageUrlNewArrivals$pna\"} = (!empty($settings['id_product_image_new_arrivals_' . $pna]['url'])) ? $settings['id_product_image_new_arrivals_' . $pna]['url'] : wp_get_attachment_url(${\"productNewArrivals$pna\"}->image_id);\n ${\"priceProductNewArrivals$pna\"} = (!empty(${\"productNewArrivals$pna\"}->regular_price)) ? ${\"productNewArrivals$pna\"}->regular_price : ${\"productNewArrivals$pna\"}->price;\n\n /**\n * update sale if exist over sale in module\n */\n if ((${\"productNewArrivals$pna\"}->sale_price != $settings['id_product_sale_new_arrivals_' . $pna]) &&\n !empty($settings['id_product_sale_new_arrivals_' . $pna]) &&\n $settings['id_product_sale_new_arrivals_' . $pna] != 0\n ) {\n ${\"productNewArrivals$pna\"}->set_sale_price($settings['id_product_sale_new_arrivals_' . $pna]);\n ${\"productNewArrivals$pna\"}->save();\n }\n\n ${\"priceSaleProductNewArrivals$pna\"} = (!empty(${\"productNewArrivals$pna\"}->sale_price)) ? ${\"productNewArrivals$pna\"}->sale_price : null;\n ${\"percentNewArrivals$pna\"} = (!empty(${\"productNewArrivals$pna\"}->sale_price)) ? (${\"priceProductNewArrivals$pna\"} != 0) ? (100 - ceil(${\"productNewArrivals$pna\"}->sale_price * 100 / ${\"priceProductNewArrivals$pna\"})) : null : null;\n }\n\n }\n\n /**\n * Clearance data\n */\n for ($pc = 1; $pc <= $countProduct; $pc++) {\n ${\"idProductClearance_$pc\"} = (!empty($settings['id_product_clearance_' . $pc]) && $settings['id_product_clearance_' . $pc] != 'Empty') ? $settings['id_product_clearance_' . $pc] : $settings['id_variant_clearance_' . $pc];\n\n if (!empty(${\"idProductClearance_$pc\"}) && ${\"idProductClearance_$pc\"} != 'Empty') {\n ${\"productClearance$pc\"} = wc_get_product(${\"idProductClearance_$pc\"});\n ${\"productUrlClearance$pc\"} = ${\"productClearance$pc\"}->get_permalink();\n ${\"productNameClearance$pc\"} = (!empty($settings['id_product_title_clearance_' . $pc])) ? $settings['id_product_title_clearance_' . $pc] : ${\"productClearance$pc\"}->name;\n ${\"imageUrlClearance$pc\"} = (!empty($settings['id_product_image_clearance_' . $pc]['url'])) ? $settings['id_product_image_clearance_' . $pc]['url'] : wp_get_attachment_url(${\"productClearance$pc\"}->image_id);\n ${\"priceProductClearance$pc\"} = (!empty(${\"productClearance$pc\"}->regular_price)) ? ${\"productClearance$pc\"}->regular_price : ${\"productClearance$pc\"}->price;\n\n /**\n * update sale if exist over sale in module\n */\n if ((${\"productClearance$pc\"}->sale_price != $settings['id_product_sale_clearance_' . $pc]) &&\n !empty($settings['id_product_sale_clearance_' . $pc]) &&\n $settings['id_product_sale_clearance_' . $pc] != 0\n ) {\n ${\"productClearance$pc\"}->set_sale_price($settings['id_product_sale_clearance_' . $pc]);\n ${\"productClearance$pc\"}->save();\n }\n\n ${\"priceSaleProductClearance$pc\"} = (!empty(${\"productClearance$pc\"}->sale_price)) ? ${\"productClearance$pc\"}->sale_price : null;\n ${\"percentClearance$pc\"} = (!empty(${\"productClearance$pc\"}->sale_price)) ? (${\"priceProductClearance$pc\"} != 0) ? (100 - ceil(${\"productClearance$pc\"}->sale_price * 100 / ${\"priceProductClearance$pc\"})) : null : null;\n }\n\n }\n\n echo '\n<style type=\"text/css\">\n a.best-sellers{\n color:' . $settings['title_1_color'] . ';\n } \n a.best-sellers.selected{\n color:' . $settings['title_1_color_selected'] . ';\n }\n a.new-arrivals{\n color:' . $settings['title_2_color'] . ';\n }\n a.new-arrivals.selected{\n color:' . $settings['title_2_color_selected'] . ';\n }\n a.clearance{\n color:' . $settings['title_3_color'] . ';\n }\n a.clearance.selected{\n color:' . $settings['title_3_color_selected'] . ';\n }\n</style>\n<div id=\"wps-bestsellers\">\n <h2>\n <a class=\"best-sellers selected\">' . $settings['title_1'] . '</a>\n <a class=\"new-arrivals\">' . $settings['title_2'] . '</a>\n <a class=\"clearance\"\">' . $settings['title_3'] . '</a>\n </h2>\n <section class=\"best-sellers\" style=\"\">\n <header>\n <h3><a href=\"/wps-bestsellers\">' . $settings['title_1'] . '</a></h3>\n </header>\n <div class=\"offers\">\n <div class=\"offer dark right\" style=\"background-color:' . $settings['id_product_color_background_1'] . ';\">\n <div class=\"photo\">\n <a href=\"' . $productUrl1 . '\">\n <img data-src=\"' . $imageUrl1 . '\"\n height=\"181\" width=\"181\"\n src=\"' . $imageUrl1 . '\">\n </a>\n </div>\n <div class=\"content\">\n <h2>\n <a href=\"' . $productUrl1 . '\">\n ' . $productName1 . '\n </a>\n </h2>\n <h3 style=\"background-color:#' . $settings['id_product_color_button_1'] . ';\">\n <a href=\"' . $productUrl1 . '\">\n <span class=\"list-price\">\n ' . $priceProduct1 . '\n </span>\n <span class=\"sale-price\">' . $priceSaleProduct1 . '</span>\n <span class=\"discount\">save ' . $percent1 . '%</span>\n </a>\n </h3>\n </div>\n </div>\n\n <div class=\"offer dark\" style=\"background-color:' . $settings['id_product_color_background_2'] . ';\">\n <div class=\"photo\">\n <a href=\"' . $productUrl2 . '\">\n <img data-src=\"' . $imageUrl2 . '\"\n height=\"181\" width=\"181\"\n src=\"' . $imageUrl2 . '\">\n </a>\n </div>\n <div class=\"content\">\n <h2>\n <a href=\"' . $productUrl2 . '\">\n ' . $productName2 . '\n </a>\n </h2>\n <h3 style=\"background-color:#' . $settings['id_product_color_button_2'] . ';\">\n <a href=\"' . $productUrl2 . '\">\n <span class=\"list-price\">\n ' . $priceProduct2 . '\n </span>\n <span class=\"sale-price\">' . $priceSaleProduct2 . '</span>\n <span class=\"discount\">save ' . $percent2 . '%</span>\n </a>\n </h3>\n </div>\n </div>\n\n\n <div class=\"offer dark\" style=\"background-color:' . $settings['id_product_color_background_3'] . ';\">\n <div class=\"photo\">\n <a href=\"' . $productUrl3 . '\">\n <img data-src=\"' . $imageUrl3 . '\"\n height=\"181\" width=\"181\"\n src=\"' . $imageUrl3 . '\">\n </a>\n </div>\n <div class=\"content\">\n <h2>\n <a href=\"' . $product_3->slug . '\">\n ' . $productName3 . '\n </a>\n </h2>\n <h3 style=\"background-color:#' . $settings['id_product_color_button_3'] . ';\">\n <a href=\"' . $productUrl3 . '\">\n <span class=\"list-price\">\n ' . $priceProduct3 . '\n </span>\n <span class=\"sale-price\">' . $priceSaleProduct3 . '</span>\n <span class=\"discount\">save ' . $percent3 . '%</span>\n </a>\n </h3>\n </div>\n </div>\n\n <div class=\"offer dark right\" style=\"background-color:' . $settings['id_product_color_background_4'] . ';\">\n <div class=\"photo\">\n <a href=\"' . $productUrl4 . '\">\n <img data-src=\"' . $imageUrl4 . '\"\n height=\"181\" width=\"181\"\n src=\"' . $imageUrl4 . '\">\n </a>\n </div>\n <div class=\"content\">\n <h2>\n <a href=\"' . $productUrl4 . '\">\n ' . $productName4 . '\n </a>\n </h2>\n <h3 style=\"background-color:#' . $settings['id_product_color_button_4'] . ';\">\n <a href=\"' . $productUrl4 . '\">\n <span class=\"list-price\">\n ' . $priceProduct4 . '\n </span>\n <span class=\"sale-price\">' . $priceSaleProduct4 . '</span>\n <span class=\"discount\">save ' . $percent4 . '%</span>\n </a>\n </h3>\n </div>\n </div>\n </div>\n </section>\n \n <section class=\"new-arrivals\" style=\"display: none;\">\n <header>\n <h3><a href=\"/wps-bestsellers\">' . $settings['title_1'] . '</a></h3>\n </header>\n <div class=\"offers\">\n <div class=\"offer dark\" style=\"background-color:' . $settings['id_product_color_background_new_arrivals_1'] . ';\">\n <div class=\"photo\">\n <a href=\"' . $productUrlNewArrivals1 . '\">\n <img data-src=\"' . $imageUrlNewArrivals1 . '\"\n height=\"181\" width=\"181\"\n src=\"' . $imageUrlNewArrivals1 . '\">\n </a>\n </div>\n <div class=\"content\">\n <h2>\n <a href=\"' . $productUrlNewArrivals1 . '\">\n ' . $productNameNewArrivals1 . '\n </a>\n </h2>\n <h3 style=\"background-color:#' . $settings['id_product_color_button_new_arrivals_1'] . ';\">\n <a href=\"' . $productUrlNewArrivals1 . '\">\n <span class=\"list-price\">\n ' . $priceProductNewArrivals1 . '\n </span>\n <span class=\"sale-price\">' . $priceSaleProductNewArrivals1 . '</span>\n <span class=\"discount\">save ' . $percentNewArrivals1 . '%</span>\n </a>\n </h3>\n </div>\n </div>\n\n <div class=\"offer dark \" style=\"background-color:' . $settings['id_product_color_background_new_arrivals_2'] . ';\">\n <div class=\"photo\">\n <a href=\"' . $productUrlNewArrivals2 . '\">\n <img data-src=\"' . $imageUrlNewArrivals2 . '\"\n height=\"181\" width=\"181\"\n src=\"' . $imageUrlNewArrivals2 . '\">\n </a>\n </div>\n <div class=\"content\">\n <h2>\n <a href=\"' . $productUrlNewArrivals2 . '\">\n ' . $productNameNewArrivals2 . '\n </a>\n </h2>\n <h3 style=\"background-color:#' . $settings['id_product_color_button_new_arrivals_2'] . ';\">\n <a href=\"' . $productUrlNewArrivals2 . '\">\n <span class=\"list-price\">\n ' . $priceProductNewArrivals2 . '\n </span>\n <span class=\"sale-price\">' . $priceSaleProductNewArrivals2 . '</span>\n <span class=\"discount\">save ' . $percentNewArrivals2 . '%</span>\n </a>\n </h3>\n </div>\n </div>\n\n\n <div class=\"offer dark right\" style=\"background-color:' . $settings['id_product_color_background_new_arrivals_3'] . ';\">\n <div class=\"photo\">\n <a href=\"' . $productUrlNewArrivals3 . '\">\n <img data-src=\"' . $imageUrlNewArrivals3 . '\"\n height=\"181\" width=\"181\"\n src=\"' . $imageUrlNewArrivals3 . '\">\n </a>\n </div>\n <div class=\"content\">\n <h2>\n <a href=\"' . $productUrlNewArrivals3 . '\">\n ' . $productNameNewArrivals3 . '\n </a>\n </h2>\n <h3 style=\"background-color:#' . $settings['id_product_color_button_new_arrivals_3'] . ';\">\n <a href=\"' . $productUrlNewArrivals3 . '\">\n <span class=\"list-price\">\n ' . $priceProductNewArrivals3 . '\n </span>\n <span class=\"sale-price\">' . $priceSaleProductNewArrivals3 . '</span>\n <span class=\"discount\">save ' . $percentNewArrivals3 . '%</span>\n </a>\n </h3>\n </div>\n </div>\n\n <div class=\"offer dark right\" style=\"background-color:' . $settings['id_product_color_background_new_arrivals_4'] . ';\">\n <div class=\"photo\">\n <a href=\"/' . $productUrlNewArrivals4 . '\">\n <img data-src=\"' . $imageUrlNewArrivals4 . '\"\n height=\"181\" width=\"181\"\n src=\"' . $imageUrlNewArrivals4 . '\">\n </a>\n </div>\n <div class=\"content\">\n <h2>\n <a href=\"' . $productUrlNewArrivals4 . '\">\n ' . $productNameNewArrivals4 . '\n </a>\n </h2>\n <h3 style=\"background-color:#' . $settings['id_product_color_button_new_arrivals_4'] . ';\">\n <a href=\"' . $productUrlNewArrivals4 . '\">\n <span class=\"list-price\">\n ' . $priceProductNewArrivals4 . '\n </span>\n <span class=\"sale-price\">' . $priceSaleProductNewArrivals4 . '</span>\n <span class=\"discount\">save ' . $percentNewArrivals4 . '%</span>\n </a>\n </h3>\n </div>\n </div>\n </div>\n </section>\n \n <section class=\"clearance\" style=\"display: none;\">\n <header>\n <h3><a href=\"/wps-bestsellers\">' . $settings['title_1'] . '</a></h3>\n </header>\n <div class=\"offers\">\n <div class=\"offer dark\" style=\"background-color:' . $settings['id_product_color_background_clearance_1'] . ';\">\n <div class=\"photo\">\n <a href=\"' . $productUrlClearance1 . '\">\n <img data-src=\"' . $imageUrlClearance1 . '\"\n height=\"181\" width=\"181\"\n src=\"' . $imageUrlClearance1 . '\">\n </a>\n </div>\n <div class=\"content\">\n <h2>\n <a href=\"' . $productUrlClearance1 . '\">\n ' . $productNameClearance1 . '\n </a>\n </h2>\n <h3 style=\"background-color:#' . $settings['id_product_color_button_clearance_1'] . ';\">\n <a href=\"' . $productUrlClearance1 . '\">\n <span class=\"list-price\">\n ' . $priceProductClearance1 . '\n </span>\n <span class=\"sale-price\">' . $priceSaleProductClearance1 . '</span>\n <span class=\"discount\">save ' . $percentClearance1 . '%</span>\n </a>\n </h3>\n </div>\n </div>\n\n <div class=\"offer dark right\" style=\"background-color:' . $settings['id_product_color_background_clearance_2'] . ';\">\n <div class=\"photo\">\n <a href=\"' . $productUrlClearance2 . '\">\n <img data-src=\"' . $imageUrlClearance2 . '\"\n height=\"181\" width=\"181\"\n src=\"' . $imageUrlClearance2 . '\">\n </a>\n </div>\n <div class=\"content\">\n <h2>\n <a href=\"' . $productUrlClearance2 . '\">\n ' . $productNameClearance2 . '\n </a>\n </h2>\n <h3 style=\"background-color:#' . $settings['id_product_color_button_clearance_2'] . ';\">\n <a href=\"' . $productUrlClearance2 . '\">\n <span class=\"list-price\">\n ' . $priceProductClearance2 . '\n </span>\n <span class=\"sale-price\">' . $priceSaleProductClearance2 . '</span>\n <span class=\"discount\">save ' . $percentClearance2 . '%</span>\n </a>\n </h3>\n </div>\n </div>\n\n\n <div class=\"offer dark\" style=\"background-color:' . $settings['id_product_color_background_clearance_3'] . ';\">\n <div class=\"photo\">\n <a href=\"' . $productUrlClearance3 . '\">\n <img data-src=\"' . $imageUrlClearance3 . '\"\n height=\"181\" width=\"181\"\n src=\"' . $imageUrlClearance3 . '\">\n </a>\n </div>\n <div class=\"content\">\n <h2>\n <a href=\"' . $productUrlClearance3 . '\">\n ' . $productNameClearance3 . '\n </a>\n </h2>\n <h3 style=\"background-color:#' . $settings['id_product_color_button_clearance_3'] . ';\">\n <a href=\"' . $productUrlClearance3 . '\">\n <span class=\"list-price\">\n ' . $priceProductClearance3 . '\n </span>\n <span class=\"sale-price\">' . $priceSaleProductClearance3 . '</span>\n <span class=\"discount\">save ' . $percentClearance3 . '%</span>\n </a>\n </h3>\n </div>\n </div>\n\n <div class=\"offer dark right\" style=\"background-color:' . $settings['id_product_color_background_clearance_4'] . ';\">\n <div class=\"photo\">\n <a href=\"' . $productUrlClearance4 . '\">\n <img data-src=\"' . $imageUrlClearance4 . '\"\n height=\"181\" width=\"181\"\n src=\"' . $imageUrlClearance4 . '\">\n </a>\n </div>\n <div class=\"content\">\n <h2>\n <a href=\"' . $productUrlClearance4 . '\">\n ' . $productNameClearance4 . '\n </a>\n </h2>\n <h3 style=\"background-color:#' . $settings['id_product_color_button_clearance_4'] . ';\">\n <a href=\"' . $productUrlClearance4 . '\">\n <span class=\"list-price\">\n ' . $priceProductClearance4 . '\n </span>\n <span class=\"sale-price\">' . $priceSaleProductClearance4 . '</span>\n <span class=\"discount\">save ' . $percentClearance4 . '%</span>\n </a>\n </h3>\n </div>\n </div>\n </div>\n </section>\n</div>';\n\n }", "function Show_Pricepromise($prod_name,$product_id)\n\t\t{\n\t\t\t global $Captions_arr,$ecom_siteid,$db,$ecom_hostname,$vImage,$Settings_arr,$alert,$current_currency_details;\n\t\t\t $sql \t\t\t\t\t\t\t= \"SELECT pricepromise_topcontent,pricepromise_bottomcontent FROM general_settings_sites_common WHERE sites_site_id=\".$ecom_siteid;\n\t\t $res_admin \t\t\t\t= $db->query($sql);\n\t\t $fetch_arr_admin \t= $db->fetch_array($res_admin);\n\t\t\t $session_id = session_id();\t\n\t\t\t $HTML_img = $HTML_alert = $HTML_treemenu='';\t\t\t\n\t\t\t\t\n\t\t\t\t$HTML_treemenu = '\n\t\t\t\t\n\t\t\t\t<div class=\"row breadcrumbs\">\n\t\t\t\t<div class=\"container\">\n <div class=\"container-tree\">\n <ul>\n \t\t\t\t<li><a href=\"'.url_product($product_id,$prod_name,1).'\">'.$prod_name.'</a></li>';\n\t\t\t\t\tif($product_id!=0)\n\t\t\t\t\t{\n\t\t\t\t\t $HTML_treemenu .='<li><a href=\"'.url_product($product_id,$prod_name,1).'\">'.$prod_name.'</a></li>';\n\t\t\t\t\t}\n\t\t\t\t$HTML_treemenu .='<li><a href=\"'.url_link('',1).'\" title=\"'.stripslash_normal($Captions_arr['COMMON']['TREE_MENU_HOME_LINK']).'\">'.stripslash_normal($Captions_arr['COMMON']['TREE_MENU_HOME_LINK']).'</a></li>\n\t\t\t </ul>\n </div>\n </div></div>';\t\n echo $HTML_treemenu;\n\t\t\t\t\n\t\t \t\t$varN = 'var_';\n\t\t\t\t$varM = 'varmsg_';\n\t\t\t\t$submit_promisefields = '';\n\t\t\t\tforeach ($_REQUEST as $k=>$v)\n\t\t\t\t{\n\t\t\t\t\t$var_nameLimit = strlen($varN);\n\t\t\t\t\t$var_messageLimit = strlen($varM);\n\t\t\t\t\tif (substr($k,0,$var_nameLimit) == $varN)\n\t\t\t\t\t{\n\t\t\t\t\t\t$curid \t\t\t\t\t= explode(\"_\",$k);\t// explode the name of variable to get the variable id\n\t\t\t\t\t\t$var_arr[$curid[1]] \t= trim($v);\n\t\t\t\t\t\t$submit_promisefields .= '<input type=\"hidden\" name=\"'.$k.'\" value=\"'.$v.'\"/>';\n\t\t\t\t\t}\n\t\t\t\t\telseif (substr($k,0,$var_messageLimit) == $varM)\n\t\t\t\t\t{\n\t\t\t\t\t\t$curid \t\t\t\t\t= explode(\"_\",$k);\t// explode the name of variable to get the variable id\n\t\t\t\t\t\t$varmsg_arr[$curid[1]] \t= trim($v);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Get the required values from products table\n\t\t\t\t$sql_prod \t\t\t= \"SELECT product_id,manufacture_id,product_model,product_name,product_webprice,product_discount,product_discount_enteredasval,product_bulkdiscount_allowed,\n\t\t\t\t\t\t\t\t\t\t\tproduct_total_preorder_allowed,product_variables_exists,product_variables_exists,product_variablesaddonprice_exists,\n\t\t\t\t\t\t\t\t\t\t\tproduct_variablecomboprice_allowed,product_variablecombocommon_image_allowed,default_comb_id,\n\t\t\t\t\t\t\t\t\t\t\tprice_normalprefix,price_normalsuffix,price_fromprefix,price_fromsuffix,price_specialofferprefix,price_specialoffersuffix, \n\t\t\t\t\t\t\t\t\t\t\tprice_discountprefix,price_discountsuffix, price_yousaveprefix, price_yousavesuffix,price_noprice \n\t\t\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\t\tproducts \n\t\t\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\t\t\tproduct_id = $product_id \n\t\t\t\t\t\t\t\t\t\tLIMIT \n\t\t\t\t\t\t\t\t\t\t\t1\";\n\t\t\t\t$ret_prod \t\t\t= $db->query($sql_prod);\n\t\t\t\tif($db->num_rows($ret_prod))\n\t\t\t\t{\n\t\t\t\t\t$row_prod \t\t\t\t\t\t= $db->fetch_array($ret_prod);\n\t\t\t\t\t$row_prod['check_comb_price'] \t= 'YES';\n\t\t\t\t\t$comb_arr \t\t\t\t\t\t= get_combination_id($product_id,$var_arr);\n\t\t\t\t\t$row_prod['combination_id'] \t= $comb_arr['combid'];\n\t\t\t\t\t$price_arr \t\t\t\t\t\t= show_Price($row_prod,array(),'other_3',false,4);\n\t\t\t\t\t$cleanprice_arr \t\t\t\t= show_Price($row_prod,array(),'other_3',false,6);\n\t\t\t\t\tif($price_arr['discounted_price'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$row_prod['promise_price'] \t\t= $price_arr['discounted_price'];\n\t\t\t\t\t\t$row_prod['cleanpromise_price'] = $cleanprice_arr['discounted_price'];\n\t\t\t\t\t}\t\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$row_prod['promise_price'] \t\t= $price_arr['base_price'];\n\t\t\t\t\t\t$row_prod['cleanpromise_price'] = $cleanprice_arr['base_price'];\n\t\t\t\t\t}\t\n\t\t\t\t}\n ?>\n\t\t\t <form method=\"post\" action=\"\" name=\"frm_pricepromise\" id=\"frm_pricepromise\" class=\"frm_cls\" onsubmit=\"return validate_pricepromise_fields(this)\" >\n\t\t\t <input type=\"hidden\" name=\"action_pricepurpose\" value=\"insert_det\" />\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"container\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"container\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"form-bottom\">\n\n\n\n\t\t <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" class=\"reg_table\">\n\t\t\t\t\t <tr>\n\t\t\t\t\t<? if($fetch_arr_admin['pricepromise_topcontent']!='')\n\t\t\t\t\t {\n\t\t\t\t\t ?>\n\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"price_bottcntnt\">\n\t\t\t\t\t\t<? echo stripslashes($fetch_arr_admin['pricepromise_topcontent'])?>\n\t\t\t\t\t\t </td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t<?\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td align=\"left\" class=\"shoppingcartheader\">\n\t\t\t\t\t<div class=\"reg_shlf_hdr_outr\"><div class=\"reg_shlf_hdr_in\"><span><?=$Captions_arr['PRICE_PROMISE']['PRICE_PROMISE_THE_PROD_HEAD']?></span></div></div></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td align=\"left\" class=\"regifontnormal\"><?php echo nl2br(stripslash_normal($row_dyn['message']))?></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td valign=\"top\" align=\"left\" >\n\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td align=\"left\" valign=\"middle\" class=\"regiconentA\"><?=$Captions_arr['PRICE_PROMISE']['PRICE_PROMISE_MANUFACT']?>:<?=$row_prod['manufacture_id']?>\n\t\t\t\t\t<input type=\"hidden\" name=\"prod_manufacture_id\" id=\"prod_manufacture_id\" class=\"form-control\" value=\"<?=$row_prod['manufacture_id']?>\" />\n\t\t\t\t\t</td>\t\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td align=\"left\" valign=\"middle\" class=\"regiconentA\"><?=$Captions_arr['PRICE_PROMISE']['PRICE_PROMISE_MODEL']?>: <?=$row_prod['product_model']?>\n\t\t\t\t\t<input class=\"hidden\" type=\"hidden\" name=\"prod_model\" id=\"prod_model\" value=\"<?=$row_prod['product_model']?>\" />\n\t\t\t\t\t</td>\t\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td align=\"left\" valign=\"middle\" class=\"regiconentA\"><?=$Captions_arr['PRICE_PROMISE']['PRICE_PROMISE_OUR_PRICE']?>: <?=$row_prod['promise_price']?>\n\t\t\t\t\t<input type=\"hidden\" name=\"prom_admin_price\" id=\"prom_admin_price\" value=\"<?=$row_prod['cleanpromise_price']?>\" />\n\t\t\t\t\t</td>\t\n\t\t\t\t\t</tr>\n\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td align=\"right\" class=\"col1\">\n\t\t\t\t\t\t\t\t\t<div class=\"field_name_div\">\n\t\t\t\t\t\t\t\t<?=$Captions_arr['PRICE_PROMISE']['PRICE_PROMISE_REQ_QTY']?><span class=\"redtext\">*</span>\t</div>\n\t\t\t\t\t\t\t\t<div class=\"field_value_div\">\n\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"prom_customer_qty\" size=\"30\" id=\"prom_customer_qty\" value=\"1\" />\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td align=\"left\" class=\"shoppingcartheader\">\n\t\t\t\t\t<div class=\"reg_shlf_hdr_outr\"><div class=\"reg_shlf_hdr_in\"><span><?=$Captions_arr['PRICE_PROMISE']['PRICE_PROMISE_PRICE_BEAT_HEAD']?></span></div></div></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td valign=\"top\" align=\"left\" >\n\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td align=\"right\" class=\"col1\">\n\t\t\t\t\t\t\t\t\t<div class=\"field_name_div\">\n\t\t\t\t\t\t\t\t<?=$Captions_arr['PRICE_PROMISE']['PRICE_PROMISE_WHAT_PRICE']?><span class=\"redtext\">*</span>\t</div>\n\t\t\t\t\t\t\t\t<div class=\"field_value_div\">\n\t\t\t\t\t\t\t\t<input class=\"form-control\" type=\"text\" name=\"prom_customer_price\" id=\"prom_customer_price\" value=\"\" /> \t(per item)\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td align=\"right\" class=\"col1\">\n\t\t\t\t\t\t\t\t\t<div class=\"field_name_div\">\n\t\t\t\t\t\t\t\t<?=$Captions_arr['PRICE_PROMISE']['PRICE_PROMISE_WHERE_SEE']?><span class=\"redtext\">*</span>\t</div>\n\t\t\t\t\t\t\t\t<div class=\"field_value_div\">\n\t\t\t\t\t\t\t\t<input class=\"form-control\" type=\"text\" name=\"prom_price_location\" id=\"prom_price_location\" value=\"\" />\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\n\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<?php\n\t\t\t\t\t\t\t// Initializing the array to hold the values to be used in the javascript validation of the static and dynamic fields\n\t\t\t\t\t\t\t$chkout_Req\t\t\t= $chkout_Req_Desc = $chkout_Email = $chkout_Confirm = $chkout_Confirmdesc = array();\n\t\t\t\t\t\t\t$chkout_Numeric \t= $chkout_multi = $chkout_multi_msg\t= array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$chkout_Req[]\t\t\t= \"'prom_customer_qty'\";\n\t\t\t\t\t\t\t$chkout_Req_Desc[]\t\t= \"'\".$Captions_arr['PRICE_PROMISE']['PRICE_PROMISE_REQUIRED_QTY'].\"'\";\n\t\t\t\t\t\t\t$chkout_Req[]\t\t\t= \"'prom_customer_price'\";\n\t\t\t\t\t\t\t$chkout_Req_Desc[]\t\t= \"'\".$Captions_arr['PRICE_PROMISE']['PRICE_PROMISE_WHAT_PRICE'].\"'\";\n\t\t\t\t\t\t\t$chkout_Req[]\t\t\t= \"'prom_price_location'\";\n\t\t\t\t\t\t\t$chkout_Req_Desc[]\t\t= \"'\".$Captions_arr['PRICE_PROMISE']['PRICE_PROMISE_WHERE_SEE'].\"'\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$chkout_Numeric[]\t\t= \"'prom_customer_qty','prom_customer_price'\";\n\t\t\t\t\t\t\t// Including the file to show the dynamic fields for checkout to the top of static fields\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$head_class \t\t\t= 'shoppingcartheader';\n\t\t\t\t\t\t\t$cur_pos \t\t\t\t= 'Top';\n\t\t\t\t\t\t\t$section_typ\t\t\t= 'pricepromise';\n\t\t\t\t\t\t\t$formname \t\t\t\t= 'frm_pricepromise'; \n\t\t\t\t\t\t\t$cont_leftwidth \t\t= '50%';\n\t\t\t\t\t\t\t$cont_rightwidth \t\t= '50%';\n\t\t\t\t\t\t\t$cellspacing \t\t\t= 0;\n\t\t\t\t\t\t\t$head_class\t\t\t\t= 'shoppingcartheader';\n\t\t\t\t\t\t\t$specialhead_tag_start \t= '<div class=\"reg_shlf_hdr_outr\"><div class=\"reg_shlf_hdr_in\"><span>';\n\t\t\t\t\t\t\t$specialhead_tag_end \t= '</span></div></div>';\n\t\t\t\t\t\t\t$cont_class \t\t\t= 'regiconentA'; \n\t\t\t\t\t\t\t$texttd_class\t\t\t= 'form-control';\n\t\t\t\t\t\t\t$cellpadding \t\t\t= 0;\t\n\t\t\t\t\t\t\tinclude 'show_dynamic_fields.php';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t $sql_section = \"SELECT section_id FROM element_sections WHERE section_type='pricepromise' AND sites_site_id=$ecom_siteid\";\n\t\t\t\t\t\t\t $ret_section = $db->query($sql_section);\n\t\t\t\t\t\t\t// Get the list of credit card static fields to be shown in the checkout out page in required order\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($db->num_rows($ret_section))\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\t\twhile($row_section = $db->fetch_array($ret_section))\n\t\t\t\t\t\t\t\t{\t\t\t\n\t\t\t\t\t\t\t\t\t $sql_elemnts =\"SELECT error_msg,element_name FROM elements WHERE element_sections_section_id=\".$row_section['section_id'].\" AND sites_site_id=\".$ecom_siteid.\"\";\n\t\t\t\t\t\t\t\t\t $ret_elemnts = $db->query($sql_elemnts);\n\t\t\t\t\t\t\t\t\t// Section to handle the case of required fields\n\t\t\t\t\t\t\t\t\tif($db->num_rows($ret_elemnts))\n\t\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\twhile($row_elemnts = $db->fetch_array($ret_elemnts))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif($row_elemnts['mandatory']=='Y')\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$chkout_Req[]\t\t= \"'\".$row_elemnts['element_name'].\"'\";\n\t\t\t\t\t\t\t\t\t\t\t\t$chkout_Req_Desc[]\t= \"'\".$row_elemnts['error_msg'].\"'\"; \n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td align=\"left\" class=\"usermenucontentAz\">\n\t\t\t\t\t\t\t\t<div class=\"cart_top_links\"><div class=\"redbutton\"><div>\n\t\t\t\t\t\t\t\t<input name=\"pricepromise_submit\" type=\"submit\" class=\"btn-primary-bt topcart-bt\" id=\"Submit\" value=\"<?=$Captions_arr['PRICE_PROMISE']['PRICE_PROMISE_SUBMIT_REQ']?>\"/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t<?\n\t\t\t\t\tif($fetch_arr_admin['pricepromise_bottomcontent']!='')\n\t\t\t\t\t{\n\t\t\t\t\t?>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<tr class=\"regitable\">\n\t\t\t\t\t\t\t\t<td align=\"left\" valign=\"top\" class=\"pricepromise_cntnt\">\n\t\t\t\t\t\t\t\t<? echo stripslashes($fetch_arr_admin['pricepromise_bottomcontent'])?>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t<? \n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t</table>\n\t\t\t</div>\n\t\t\n </div>\n </div>\n </div>\n\t\t <?php\n\t\t\t\techo $submit_promisefields;\n\t\t ?>\t\n\t\t\t\t</form>\n\t\t<script type=\"text/javascript\">\n\t\tfunction validate_pricepromise_fields(frm)\n\t\t{\n\t\t\t<?php\n\t\t\t\t// Blank checking\n\t\t\t\tif (count($chkout_Req))\n\t\t\t\t{\n\t\t\t\t\t$chkout_Req_Str \t\t\t= implode(\",\",$chkout_Req);\n\t\t\t\t\t$chkout_Req_Desc_Str \t\t= implode(\",\",$chkout_Req_Desc);\n\t\t\t\t\techo \"fieldRequired \t\t= Array(\".$chkout_Req_Str.\");\";\n\t\t\t\t\techo \"fieldDescription \t\t= Array(\".$chkout_Req_Desc_Str.\");\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"fieldRequired \t\t= Array();\";\n\t\t\t\t\techo \"fieldDescription \t\t= Array();\";\n\t\t\t\t}\t\n\t\t\t\t// Email checking\n\t\t\t\tif (count($chkout_Email))\n\t\t\t\t{\n\t\t\t\t\t$chkout_Email_Str = implode(\",\",$chkout_Email);\n\t\t\t\t\techo \"fieldEmail \t\t= Array(\".$chkout_Email_Str.\");\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\techo \"fieldEmail \t\t= Array();\";\n\t\t\t\t// Password checking\n\t\t\t\tif (count($chkout_Confirm))\n\t\t\t\t{\n\t\t\t\t\t$chkout_Confirm_Str \t= implode(\",\",$chkout_Confirm);\n\t\t\t\t\t$chkout_Confirmdesc_Str\t= implode(\",\",$chkout_Confirmdesc);\n\t\t\t\t\techo \"fieldConfirm \t\t= Array(\".$chkout_Confirm_Str.\");\";\n\t\t\t\t\techo \"fieldConfirmDesc \t= Array(\".$chkout_Req_Desc_Str.\");\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"fieldConfirm \t\t= Array();\";\n\t\t\t\t\techo \"fieldConfirmDesc \t= Array();\";\n\t\t\t\t}\t\n\t\t\t\t// Numeric checking\n\t\t\t\tif (count($chkout_Numeric))\n\t\t\t\t{\n\t\t\t\t\t$chkout_Numeric_Str \t= implode(\",\",$chkout_Numeric);\n\t\t\t\t\techo \"fieldNumeric \t\t= Array(\".$chkout_Numeric_Str.\");\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\techo \"fieldNumeric \t\t= Array();\";\n\t\t\t\t\t\n\t\t\t?>\n\t\t\t\n\t\t\tif(Validate_Form_Objects(frm,fieldRequired,fieldDescription,fieldEmail,fieldConfirm,fieldConfirmDesc,fieldNumeric))\n\t\t\t{\n\t\t\t\t/* Checking the case of checkboxes or radio buttons */\n\t\t\t\t<?php\n\t\t\t\t\tif (count($chkout_multi))\n\t\t\t\t\t{\n\t\t\t\t\t\tfor ($i=0;$i<count($chkout_multi);$i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo \n\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t\tvar atleast_one = false;\n\t\t\t\t\t\t\t\t\tfor(j=0;j<frm.elements.length;j++)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (frm.elements[j].type=='checkbox' || frm.elements[j].type=='radio')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (frm.elements[j].name=='\".$chkout_multi[$i].\"'+'[]')\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif(frm.elements[j].checked==true)\n\t\t\t\t\t\t\t\t\t\t\t\t\tatleast_one = true;\n\t\t\t\t\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (atleast_one == false)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\talert('\".$chkout_multi_msg[$i].\"');\n\t\t\t\t\t\t\t\t\t\tdocument.getElementById('\".$chkout_multi[$i].\"'+'[]').focus();\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\";\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t?>\n\t\t\t}\t\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\t\n\t\t</script>\n\n\t\t<?php\t\n\t\t}", "function m_showCustomOpt(){\n\t\t\n\t\t#DECLARYFING TEMPLATE FILE\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"optionCustom\", $this->optionsTemplate);\n\t\t\n\t\t#INTIALIZING TEMPLATE BLOCKS\t\t\n\t\t$this->ObTpl->set_block(\"optionCustom\",\"TPL_MAINOPTIONS_BLK\",\"mainoption_blk\");\t\t\n\t\t$this->ObTpl->set_block(\"TPL_MAINOPTIONS_BLK\",\"TPL_CTMOPTIONS_BLK\",\"dspctmoption_blk\");\n\t\t$this->ObTpl->set_var(\"TPL_SHOPURL\",SITE_URL.\"ecom/\");\n\t\t\n\t\t$this->ObTpl->set_var(\"mainoption_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"dspctmoption_blk\",\"\");\n\t\t\n\t\t#QUERY TO GET DEPARTMENTS UNDER SELECTED DEPARTMENT\n\t\t$query= \"SELECT * FROM \". CHOICES ;\n\t\tif(isset($this->request['search']) && !empty($this->request['search']))\n\t\t{\n\t\t\t$query=$query.\" WHERE vName LIKE '%\".$this->request['search'].\"%' OR vDescription LIKE '%\".$this->request['search'].\"%'\";\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SEARCH\",$this->request['search']);\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_VIEWALL\",\"<a href='\".SITE_URL.\"ecom/adminindex.php?action=ec_option.home'>View All</a>\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SEARCH\",\"\");\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_VIEWALL\",\"\");\n\t\t}\n\t\t\n\t\t$query=$query.\" order by vName\";\n\t\t$this->obDb->query=$query;\t\n\t\t\n\t\t$resChoice=$this->obDb->fetchQuery();\n\t\t$varCount1=$this->obDb->record_count;\n\t\t$this->ObTpl->set_var(\"TPL_VAR_CURRENCY\",CONST_CURRENCY);\n\t\t$this->ObTpl->set_var(\"TPL_TOTAL_RECORDS1\",$varCount1);\n\t\tif($varCount1>0)\n\t\t{\n\t\t\tfor($i=0;$i<$varCount1;$i++)\n\t\t\t{\n\t\t\t\tif($resChoice[$i]->iUseInventory==1)\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_USTOCK\",\"yes\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_USTOCK\",\"no\");\n\t\t\t\t}\t\n\n\t\t\t\tif(file_exists($this->imagePath.\"options/\".$resChoice[$i]->vImage) && $resChoice[$i]->vImage!=\"\")\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_IMGLBL\",\"Edit\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_IMGLBL\",\"Add\");\n\t\t\t\t}\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_CHOICEID\",$resChoice[$i]->iChoiceid_PK);\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_CTITLE\",$resChoice[$i]->vName);\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TYPE\",$resChoice[$i]->vType);\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PRICE\",$resChoice[$i]->fPrice);\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MESSAGE\",\"\");\n\t\t\t\t$this->ObTpl->parse(\"dspctmoption_blk\",\"TPL_CTMOPTIONS_BLK\",true);\t\n\t\t\t}\n\t\t$this->ObTpl->parse(\"mainoption_blk\",\"TPL_MAINOPTIONS_BLK\",true);\n\t\t}\n\t\t\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\n\t\treturn($this->ObTpl->parse(\"return\",\"optionCustom\"));\n\t}", "public function setUp() {\n $this->account_product_option = new AccountProductOption();\n\n // Define\n $this->phactory->define( 'website_product_options', array( 'website_id' => self::WEBSITE_ID, 'product_id' => self::PRODUCT_ID, 'product_option_id' => self::PRODUCT_OPTION_ID, 'price' => self::PRICE ) );\n $this->phactory->define( 'product_options', array( 'option_type' => self::OPTION_TYPE ) );\n $this->phactory->define( 'product_option_list_items', array( 'product_option_id' => self::PRODUCT_OPTION_ID, 'value' => self::VALUE ) );\n $this->phactory->define( 'website_product_option_list_items', array( 'website_id' => self::WEBSITE_ID, 'product_id' => self::PRODUCT_ID, 'product_option_id' => self::PRODUCT_OPTION_ID, 'price' => self::WEBSITE_PRODUCT_OPTION_LIST_ITEM_PRICE ) );\n $this->phactory->recall();\n }", "private function updateOptions()\n {\n $scrappageCollection = Mage::getModel('scrappagescheme/scrap')->getCollection()\n ->addFieldToFilter('scrap_status', 0)\n ->addFieldToFilter('percentage', array('gt' => 0))\n ->setOrder('scrap_id', 'asc');\n\n Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);\n $successCount = $failedCount = $errorCount = 1;\n\n if (count($scrappageCollection)) {\n foreach ($scrappageCollection as $data) {\n $product = Mage::getModel('catalog/product')->getCollection()\n ->addAttributeToSelect('*')\n ->addAttributeToFilter('price', array('gt' => 0))\n ->addAttributeToFilter('sku', array('eq' => $data['sku']))->getFirstItem();\n\n if ($product->getName()) {\n\n $optionInstance = $product->getOptionInstance()->unsetOptions();\n $product->setHasOptions(1);\n\n $option = $this->getProductOption($data['percentage']);\n\n if (isset($option['is_require']) && ($option['is_require'] == 1)) {\n $product->setRequiredOptions(1);\n }\n $product->setPay4leterEnable(360);\n $product->setPay4leterPlans(407);\n\n $optionInstance->addOption($option);\n $optionInstance->setProduct($product);\n try {\n\n $product->save();\n\n Mage::getModel('scrappagescheme/scrap')->load($data['scrap_id'])->setStatus(1)->save();\n\n // Success\n Mage::log('Name :' . $product->getName(), null, 'MarchScrappageSuccessProducts.log', true);\n Mage::log('Sku :' . $product->getSku(), null, 'MarchScrappageSuccessProducts.log', true);\n Mage::log('Price :' . $product->getPrice(), null, 'MarchScrappageSuccessProducts.log', true);\n Mage::log('Count :' . $successCount++, null, 'MarchScrappageSuccessProducts.log', true);\n Mage::log('-----------------------------', null, 'MarchScrappageSuccessProducts.log', true);\n\n } catch (Exception $e) {\n\n // Error\n Mage::log($product->getId(), null, 'MarchScrappageErrorProducts.log', true);\n Mage::log($data['sku'] . ' ::' . $data['sku'], null, 'MarchScrappageErrorProducts.log', true);\n Mage::log($errorCount++, null, 'MarchScrappageSuccessProducts.log', true);\n Mage::log('-----------------------------', null, 'MarchScrappageErrorProducts.log', true);\n\n }\n\n } else {\n // Failed\n Mage::log('Name :' . $data['name'], null, 'MarchScrappageFailedProducts.log', true);\n Mage::log('Sku :' . $data['sku'], null, 'MarchScrappageFailedProducts.log', true);\n Mage::log('Count :' . $failedCount++, null, 'MarchScrappageFailedProducts.log', true);\n Mage::log('-----------------------------', null, 'MarchScrappageFailedProducts.log', true);\n }\n\n Mage::log('Name :' . $data['name'], null, 'MarchScrappageRunProductList.log', true);\n Mage::log('Sku :' . $data['sku'], null, 'MarchScrappageRunProductList.log', true);\n Mage::log('-----------------------------', null, 'MarchScrappageRunProductList.log', true);\n }\n } else {\n Mage::log('=============END===============', null, 'MarchScrappageCompleted.log', true);\n }\n }", "function rakitpc() {\r\n $term_names = array('T-shirts');\r\n\r\n // The WP_Query\r\n $query = new WP_Query( array(\r\n 'posts_per_page' => -1,\r\n 'post_type' => 'product',\r\n 'post_status' => 'publish',\r\n 'hide_empty' => 0,\r\n 'orderby' => 'title',\r\n 'tax_query' => array( array(\r\n 'taxonomy' => 'product_cat', // for a Product category (or 'product_tag' for a Product tag)\r\n 'field' => 'name', // can be 'name', 'slug' or 'term_id'\r\n 'terms' => $term_names,\r\n ) ),\r\n 'echo' => '0'\r\n ) );\r\n\r\n $output = '<select>';\r\n // foreach ( $products as $product ) {\r\n if ( $query->have_posts() ) :\r\n while ( $query->have_posts() ) : $query->the_post();\r\n\r\n $permalink = get_permalink($query->post->ID);\r\n $title = $query->post->post_title;\r\n $output .= '<option value=\"' . $permalink . '\">' . $title . '</option>';\r\n\r\n endwhile;\r\n\r\n wp_reset_postdata();\r\n\r\n $output .='</select>';\r\n\r\n else :\r\n\r\n $output = '<p>No products found<p>';\r\n\r\n endif;\r\n\r\n return $output;\r\n}", "function createOptBox() {\n\t if (DEBUG&&DEBUGLEVEL&1) debug('Start method frontend::createOptBox()');\n\t global $languageXML;\n\t $this->site[] = ' <TABLE BORDER=\"0\" CLASS=\"optBox\">';\n\t $this->site[] = ' <FORM METHOD=\"get\" ACTION=\"./index.php\">';\n\t $this->site[] = ' <TR>';\n\t $this->site[] = ' <TD ALIGN=\"left\" COLSPAN=\"2\" CLASS=\"optBoxItem\">'.$languageXML['LANG']['HEADER']['OPTBOX']['SELECTTRAP'].':</TD>';\n\t $this->site[] = ' </TR>';\n\t $this->site[] = ' <TR>';\n\t $this->site[] = ' <TD ALIGN=\"left\" COLSPAN=\"2\" class=\"optBoxItem\">';\n\t $this->site[] = ' <SELECT NAME=\"trapSelect\">';\n\t $this->site[] = ' <OPTION VALUE=\"all\" '.common::selected(\"all\",$_REQUEST['trapSelect'],\"selected\").' >'.$languageXML['LANG']['HEADER']['OPTBOX']['SELECTTRAPVALUE']['TRAPACTUEL'].'</OPTION>';\n\t $this->site[] = ' <OPTION VALUE=\"ARCHIVED\" '.common::selected(\"ARCHIVED\",$_REQUEST['trapSelect'],\"selected\").' >'.$languageXML['LANG']['HEADER']['OPTBOX']['SELECTTRAPVALUE']['TRAPARCHIVED'].'</OPTION>';\n\t $this->site[] = common::checkIfEnableUnknownTraps($this->configINI['global']['useUnknownTraps']);\n\t $this->site[] = ' </SELECT>';\n\t $this->site[] = ' </TD>';\n\t $this->site[] = ' </TR>';\n\t $this->site[] = ' <TR>';\n\t $this->site[] = ' <TD ALIGN=\"left\" COLSPAN=\"2\" CLASS=\"optBoxItem\">'.$languageXML['LANG']['HEADER']['OPTBOX']['SEVERITYDETAIL'].':</TD>';\n\t $this->site[] = ' </TR>';\n\t $this->site[] = ' <TR>';\n\t $this->site[] = ' <TD ALIGN=\"left\" COLSPAN=\"2\" class=\"optBoxItem\">';\n\t $this->site[] = ' <SELECT NAME=\"severity\">';\n\t $this->site[] = ' <OPTION VALUE=\"\" '.common::selected(\"\",$_REQUEST['severity'],\"selected\").' >'.$languageXML['LANG']['HEADER']['OPTBOX']['OPTION']['VALUEALL'].'</OPTION>';\n\t $this->site[] = ' <OPTION VALUE=\"OK\" '.common::selected(\"OK\",$_REQUEST['severity'],\"selected\").' >Traps ok</OPTION>';\n\t $this->site[] = ' <OPTION VALUE=\"WARNING\" '.common::selected(\"WARNING\",$_REQUEST['severity'],\"selected\").' >Traps warning</OPTION>';\n\t $this->site[] = ' <OPTION VALUE=\"CRITICAL\" '.common::selected(\"CRITICAL\",$_REQUEST['severity'],\"selected\").' >Traps critical</OPTION>';\n\t $this->site[] = ' </SELECT>';\n\t $this->site[] = ' </TD>';\n\t $this->site[] = ' </TR>';\n\t $this->site[] = common::createCategoryFilter();\n\t $this->site[] = ' <TR>';\n\t $this->site[] = ' <TD ALIGN=\"left\" CLASS=\"optBoxItem\">'.$languageXML['LANG']['HEADER']['OPTBOX']['OLDERENTRIESFIRST'].':</TD>';\n\t $this->site[] = ' <TD></TD>';\n\t $this->site[] = ' </TR>';\n\t $this->site[] = ' <TR>';\n\t $this->site[] = ' <TD ALIGN=\"left\" VALIGN=\"bottom\" CLASS=\"optBoxItem\"><INPUT TYPE=\"checkbox\" name=\"oldestfirst\" '.common::selected(\"on\",$_REQUEST['oldestfirst'],\"checked\").' ></TD>';\n\t $this->site[] = ' <TD ALIGN=\"right\" CLASS=\"optBoxItem\"><INPUT TYPE=\"submit\" VALUE=\"'.$languageXML['LANG']['HEADER']['OPTBOX']['UPDATEBUTTON'].'\"></TD>';\n\t $this->site[] = ' <INPUT TYPE=\"hidden\" NAME=\"hostname\" VALUE=\"'.$_GET['hostname'].'\">';\n\t $this->site[] = ' </TR>';\n\t $this->site[] = ' </FORM>';\n\t $this->site[] = ' </TABLE>';\n\t if (DEBUG&&DEBUGLEVEL&1) debug('End method frontend::createOptBox()');\n\t}", "function gdpr_compliance_options_page( ) { \r\n\tadd_menu_page( \r\n\t\t'GDPR Compliance Rock Content',\r\n\t\t'GDPR', \r\n\t\t'manage_options', \r\n\t\t'gdpr-compliance-options', \r\n\t\t'gdpr_options_page',\r\n 'dashicons-bell', \r\n\t\t5 \r\n ); \r\n}", "public function options_page() {\n\t\tpremise_field_section( array(\n\t\t\tarray(\n\t\t\t\t'type' => 'text',\n\t\t\t\t'name' => 'pwps_theme_options',\n\t\t\t),\n\n\t\t\tarray(\n\t\t\t\t'type' => 'submit',\n\t\t\t)\n\t\t) );\n\t}", "function create_pack_drop_down($product)\r\n{\r\n $id = $product->get_id();\r\n\r\n $packs = get_post_meta($id, 'pri_packs', false);\r\n //if ( is_page( 'cart' ) || is_cart() || is_product() ) {\r\n if (!empty(WC()->cart)) {\r\n foreach (WC()->cart->get_cart() as $cart_item_key => $cart_item) {\r\n $product_id = $cart_item['product_id'];\r\n if ($product_id == $id) {\r\n if (isset($cart_item['pack_step'])) {\r\n $step = $cart_item['pack_step'];\r\n }\r\n\r\n }\r\n }\r\n //echo 'step:'.$step;\r\n //}\r\n }\r\n if (!empty($packs)) {\r\n ?>\r\n <label for=\"cars\"><?php _e('Choose a pack:', 'storefront'); ?></label>\r\n\r\n <select name=\"packs\" class=\"pri-packs\">\r\n <?php\r\n foreach ($packs[0] as $pack) {\r\n echo $pack['PACKNAME'] . ' ' . $pack['PACKQUANT'] . '<br>';\r\n echo ' <option value=\"' . $pack['PACKQUANT'] . '\">' . $pack['PACKNAME'] . ' | ' . $pack['PACKQUANT'] . '</option>';\r\n }\r\n ?>\r\n </select>\r\n <br>\r\n <label><?php _e('Number of packs:', 'p18w'); ?> </label>\r\n <input id=\"num-packs\" />\r\n <?php\r\n }\r\n}", "function gdpr_options_page(){ ?>\r\n\t<div class=\"wrap\">\t\r\n\t\t<h1> <?php echo __( 'GDPR Compliance Rock Content', 'gdpr-compliance'); ?> </h1>\r\n\t\t<hr>\r\n\t\t<form action=\"options.php\" method=\"POST\">\r\n\r\n\t\t\t<?php settings_fields('gdpr_settings'); do_settings_sections('gdpr_settings'); ?>\r\n\r\n\t\t\t<table class=\"form-table\">\r\n\t\t\t\t<!-- Display -->\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"> <?php echo __('Habilite ou desabilite', 'gdpr-compliance') ?> </th>\r\n\t\t\t\t\t<td>\r\n\t\t\t\t\t\t<?php $options = get_option( 'gdpr_display' ); ?>\r\n\t\t\t\t\t\t<label for=\"show-gdpr\"> \r\n\t\t\t\t\t\t\t<input type='radio' required name='gdpr_display' id=\"show-gdpr\" value='mostrar' <?php checked( 'mostrar', get_option( 'gdpr_display' ) ); ?> >\r\n\t\t\t\t\t\t\t<?php echo __('Mostrar', ' gdpr-compliance'); ?>\r\n\t\t\t\t\t\t</label> \r\n\t\t\t\t\t\t<br>\r\n\t\t\t\t\t\t<label for=\"hide-gdpr\"> \r\n\t\t\t\t\t\t\t<input type='radio' required name='gdpr_display' id=\"hide-gdpr\" value='ocultar' <?php checked( 'ocultar', get_option( 'gdpr_display' ) ); ?> >\r\n\t\t\t\t\t\t\t<?php echo __('Esconder', ' gdpr-compliance'); ?>\r\n\t\t\t\t\t\t</label> \r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\r\n\t\t\t\t<!--Position -->\r\n\t\t\t \t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"> <?php echo __('Escolher a posição', 'gdpr-compliance') ?> </th>\r\n\t\t\t\t\t<td>\r\n\t\t\t\t\t\t<?php $options = get_option( 'gdpr_position' ); ?>\t \r\n\t\t\t\t\t\t<label for=\"top\"> \r\n\t\t\t\t\t\t\t<input type='radio' required id=\"top\" name='gdpr_position' value='top' <?php checked( 'top', get_option( 'gdpr_position' ) ); ?> >\r\n\t\t\t\t\t\t\t<?php echo __('Parte de cima', ' gdpr-compliance'); ?>\r\n\t\t\t\t\t\t</label> \r\n\t\t\t\t\t\t<br>\r\n\t\t\t\t\t\t<label for=\"bottom\"> \r\n\t\t\t\t\t\t\t<input type='radio' required id=\"bottom\" name='gdpr_position' value='bottom' <?php checked( 'bottom', get_option( 'gdpr_position' ) ); ?> >\r\n\t\t\t\t\t\t\t<?php echo __('Parte inferior', ' gdpr-compliance'); ?>\r\n\t\t\t\t\t\t</label> \r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\r\n\t\t\t\t<!-- Color theme -->\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"> <?php echo __('Tema de cores', 'gdpr-compliance') ?> </th>\r\n\t\t\t\t\t<td>\r\n\t\t\t\t\t\t<?php $options = get_option( 'gdpr_color_theme' ); ?>\r\n\t\t\t\t\t\t<label for=\"theme-ocean\" class=\"gdpr_theme-color-label\"> \r\n\t\t\t\t\t\t\t<input type='radio' required id=\"theme-ocean\" name='gdpr_color_theme' value='ocean' <?php checked( 'ocean', get_option( 'gdpr_color_theme' ) ); ?> >\r\n\t\t\t\t\t\t\t<p class=\"\"><?php echo __('Ocean', ' gdpr-compliance'); ?></p>\r\n\t\t\t\t\t\t\t<div class=\"gdpr_theme gdpr_theme--ocean\">\r\n\t\t\t\t\t\t\t\t<span></span><span></span><span></span><span></span><span></span>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</label> \r\n\r\n\t\t\t\t\t\t<label for=\"theme-light\" class=\"gdpr_theme-color-label\"> \r\n\t\t\t\t\t\t\t<input type='radio' required id=\"theme-light\" name='gdpr_color_theme' value='light' <?php checked( 'light', get_option( 'gdpr_color_theme' ) ); ?> >\r\n\t\t\t\t\t\t\t<p> <?php echo __('Light', ' gdpr-compliance'); ?> </p>\r\n\t\t\t\t\t\t\t<div class=\"gdpr_theme gdpr_theme--light\">\r\n\t\t\t\t\t\t\t\t<span></span><span></span><span></span><span></span><span></span>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</label> \r\n\r\n\t\t\t\t\t\t<label for=\"theme-forest\" class=\"gdpr_theme-color-label\"> \r\n\t\t\t\t\t\t\t<input type='radio' required id=\"theme-forest\" name='gdpr_color_theme' value='forest' <?php checked( 'forest', get_option( 'gdpr_color_theme' ) ); ?> >\r\n\t\t\t\t\t\t\t<p> <?php echo __('Forest', ' gdpr-compliance'); ?> </p>\r\n\t\t\t\t\t\t\t<div class=\"gdpr_theme gdpr_theme--forest\">\r\n\t\t\t\t\t\t\t\t<span></span><span></span><span></span><span></span><span></span>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</label>\t\t\t\t\t\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\r\n\t\t\t\t<!-- Label button -->\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"> <?php echo __('Label do botão', 'gdpr-compliance'); ?> </th>\r\n\t\t\t\t\t<td>\r\n\t\t\t\t\t\t<?php $options = get_option( 'gdpr_label_button' ); ?>\t\r\n \t\t\t\t\t<input type='text' name='gdpr_label_button' size=\"40\" value=\"<?php echo esc_attr(get_option('gdpr_label_button')); ?>\" placeholder=\"Aceito\"> \r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr> \r\n\r\n\t\t\t\t<!-- Message -->\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"> <?php echo __('Caixa de consentimento', 'gdpr-compliance'); ?> </th>\r\n\t\t\t\t\t<td>\r\n\t\t\t\t\t\t<?php $options = get_option('gdpr_textarea_message');\r\n\t\t\t\t\t\t$args = array (\r\n\t\t\t\t\t\t\t'media_buttons' => false,\r\n\t\t\t\t\t\t\t'textarea_rows' => '5'\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\twp_editor( $options, 'gdpr_textarea_message', $args );\t?>\r\n\t\t\t\t\t</td>\r\n\r\n\t\t\t\t</tr> \r\n\r\n\t\t\t</table>\r\n\t\t\t\r\n\t\t\t<?php submit_button(); ?>\t\r\n\r\n\t\t</form>\r\n\t</div>\r\n\t<?php\t\r\n}", "function square_cut_pizza_custom_js() {\n\n if ( 'product' != get_post_type() ) :\n return;\n endif;\n\n ?><script type='text/javascript'>\n jQuery( document ).ready( function() {\n jQuery( '.options_group.pricing' ).addClass( 'show_if_square_cut_pizza' ).show();\n });\n\n </script><?php\n\n}", "protected function init() {\n\t\t\t$option = new Admin_Theme_Element_Colorchooser();\n\t\t\t$option->setName( 'Top tail background color' )\n\t\t\t\t\t->setDescription( 'Please select your custom color for body background' )\n\t\t\t\t\t->setId( SHORTNAME . '_toptail_background_color' . '_' . $this->getName() )\n\t\t\t\t\t->setStd( '#e09fa0' );\n\t\t\t$this->addOptionToGroup( $option );\n\t\t\t$option = null;\n\n\t\t\t$option = new Admin_Theme_Element_File();\n\t\t\t$option->setName( 'Top tail pattern image' )\n\t\t\t\t\t->setDescription( 'You can upload custom pattern image.' )\n\t\t\t\t\t->setId( SHORTNAME . '_toptail_pattern' . '_' . $this->getName() )\n\t\t\t\t\t->setStd( get_template_directory_uri() . '/images/skin/skin4/top-pattern.png' );\n\t\t\t$this->addOptionToGroup( $option );\n\t\t\t$option = null;\n\n\t\t\t$option = new Admin_Theme_Element_Select();\n\t\t\t$option->setName( 'Top tail pattern repeat' )\n\t\t\t\t\t->setDescription( 'Custom pattern repeat settings for color' )\n\t\t\t\t\t->setId( SHORTNAME . '_toptail_pattern_repeat' . '_' . $this->getName() )\n\t\t\t\t\t->setStd( 'repeat' )\n\t\t\t\t\t->setOptions( array( 'repeat', 'no-repeat', 'repeat-x', 'repeat-y' ) );\n\t\t\t$this->addOptionToGroup( $option );\n\t\t\t$option = null;\n\n\t\t\t$option = new Admin_Theme_Element_Select();\n\t\t\t$option->setName( 'Top tail attachment' )\n\t\t\t\t\t->setDescription( 'Custom pattern position color' )\n\t\t\t\t\t->setId( SHORTNAME . '_toptail_attachment' . '_' . $this->getName() )\n\t\t\t\t\t->setStd( 'scroll' )\n\t\t\t\t\t->setOptions( array( 'fixed', 'scroll' ) );\n\t\t\t$this->addOptionToGroup( $option );\n\t\t\t$option = null;\n\n\t\t\t$option = new Admin_Theme_Element_Select();\n\t\t\t$option->setName( 'Top tail pattern horizontal position' )\n\t\t\t\t\t->setDescription( 'Custom pattern horizontal position color ' )\n\t\t\t\t\t->setId( SHORTNAME . '_toptail_pattern_x' . '_' . $this->getName() )\n\t\t\t\t\t->setStd( 'left' )\n\t\t\t\t\t->setOptions( array( 'left', 'right', 'center' ) );\n\t\t\t$this->addOptionToGroup( $option );\n\t\t\t$option = null;\n\n\t\t\t$option = new Admin_Theme_Element_Select();\n\t\t\t$option->setName( 'Top tail pattern vertical' )\n\t\t\t\t\t->setDescription( 'Custom pattern vertical position color' )\n\t\t\t\t\t->setId( SHORTNAME . '_toptail_pattern_y' . '_' . $this->getName() )\n\t\t\t\t\t->setStd( 'top' )\n\t\t\t\t\t->setOptions( array( 'top', 'bottom', 'center' ) );\n\t\t\t$this->addOptionToGroup( $option );\n\t\t\t$option = null;\n\n\t\t\t$option = new Admin_Theme_Element_Separator();\n\t\t\t$this->addOptionToGroup( $option );\n\t\t\t$option = null;\n\n\t\t\t$option = new Admin_Theme_Element_Colorchooser();\n\t\t\t$option->setName( 'Top line text color' )\n\t\t\t\t\t->setDescription( 'Please select your custom color for topline text' )\n\t\t\t\t\t->setId( SHORTNAME . '_topline_textcolor' . '_' . $this->getName() )\n\t\t\t\t\t->setStd( '#E9D9C0' );\n\t\t\t$this->addOptionToGroup( $option );\n\n\t\t\t$option = new Admin_Theme_Element_Colorchooser();\n\t\t\t$option->setName( 'Top line links color' )\n\t\t\t\t\t->setDescription( 'Please select your custom color for topline links' )\n\t\t\t\t\t->setId( SHORTNAME . '_topline_linkscolor' . '_' . $this->getName() )\n\t\t\t\t\t->setStd( '#ffffff' );\n\t\t\t$this->addOptionToGroup( $option );\n\n\t\t\t\t\t\t$option = new Admin_Theme_Element_Colorchooser();\n\t\t\t$option->setName( 'Top line hover links color' )\n\t\t\t\t\t->setDescription( 'Please select your custom hover color for topline links' )\n\t\t\t\t\t->setId( SHORTNAME . '_topline_linkscolor_hover' . '_' . $this->getName() )\n\t\t\t\t\t->setStd( '#6f4135' );\n\t\t\t$this->addOptionToGroup( $option );\n\n\t\t\t$option = new Admin_Theme_Element_Separator();\n\t\t\t$this->addOptionToGroup( $option );\n\t\t\t$option = null;\n\n\t\t\t$option = new Admin_Theme_Element_Colorchooser();\n\t\t\t$option->setName( 'Menu text color' )\n\t\t\t\t\t->setDescription( 'Please select your custom color for menu text' )\n\t\t\t\t\t->setId( SHORTNAME . '_menu_text' . '_' . $this->getName() )\n\t\t\t\t\t->setStd( '#6f4135' );\n\t\t\t$this->addOptionToGroup( $option );\n\n\t\t\t$option = new Admin_Theme_Element_Colorchooser();\n\t\t\t$option->setName( 'Menu active text color' )\n\t\t\t\t\t->setDescription( 'Please select your custom color for menu active item text' )\n\t\t\t\t\t->setId( SHORTNAME . '_menu_active_text' . '_' . $this->getName() )\n\t\t\t\t\t->setStd( '#bfada7' );\n\t\t\t$this->addOptionToGroup( $option );\n\n\t\t\t$option = new Admin_Theme_Element_Separator();\n\t\t\t$this->addOptionToGroup( $option );\n\t\t\t$option = null;\n\n\t\t\t$option = new Admin_Theme_Element_Title();\n\t\t\t\t$option->setName( 'Logo styles' );\n\t\t\t\t$this->addOptionToGroup( $option );\n\t\t\t$option = null;\n\n\t\t\t$option = new Admin_Theme_Element_File();\n\t\t\t$option->setName( 'Use custom logo image' )\n\t\t\t\t\t->setDescription( 'You can upload custom logo image.' )\n\t\t\t\t\t->setId( SHORTNAME . '_logo_custom' . '_' . $this->getName() )\n\t\t\t\t\t->setStd( get_template_directory_uri() . '/images/skin/skin4/logo.png' );\n\t\t\t$this->addOptionToGroup( $option );\n\t\t\t$option = null;\n\n\t\t\t$option = new Admin_Theme_Element_Select();\n\t\t\t$option->setName( __( 'Logo position', 'retro' ) )\n\t\t\t\t\t->setDescription( __( 'Choose logo position', 'retro' ) )\n\t\t\t\t\t->setId( SHORTNAME . '_logo_position' )\n\t\t\t\t\t->setStd( 'center' )\n\t\t\t\t\t->setOptions( array( 'left', 'center', 'right' ) );\n\t\t\t;\n\t\t\t$this->addOptionToGroup( $option );\n\t\t\t$option = null;\n\n\t\t\t$option = new Admin_Theme_Element_Checkbox();\n\t\t\t$option->setName( __( 'Hide logo image', 'retro' ) )\n\t\t\t\t\t->setDescription( __( 'Check this box if you want to hide logo image and use text site name instead', 'retro' ) )\n\t\t\t\t\t->setId( SHORTNAME . '_logo_txt' )\n\t\t\t\t\t->setStd( '' );\n\t\t\t$this->addOptionToGroup( $option );\n\t\t\t$option = null;\n\n\t\t\t$option = new Admin_Theme_Element_File();\n\t\t\t$option = new Admin_Theme_Element_Colorchooser();\n\t\t\t$option->setName( 'Logo text color' )\n\t\t\t\t\t->setDescription( 'Please select your custom color for logo text' )\n\t\t\t\t\t->setId( SHORTNAME . '_logo_color_skin4' )\n\t\t\t\t\t->setStd( '#e67778' );\n\t\t\t$this->addOptionToGroup( $option );\n\n\t\t\t$option = new Admin_Theme_Element_Select_Gfont();\n\t\t\t$option->setName( __( 'Choose a Font for logo', 'retro' ) )\n\t\t\t\t\t->setDescription( __( 'Choose a Font for titles, etc.', 'retro' ) )\n\t\t\t\t\t->setId( SHORTNAME . '_logo_font' )\n\t\t\t\t\t->setStd( 'Open Sans' )\n\t\t\t\t\t->setCustomized();\n\t\t\t$this->addOptionToGroup( $option );\n\t\t\t$option = null;\n\n\t\t\t$option = new Admin_Theme_Element_Select();\n\t\t\t$option->setName( __( 'Logo font style', 'retro' ) )\n\t\t\t\t\t->setDescription( __( 'Logo font style', 'retro' ) )\n\t\t\t\t\t->setId( SHORTNAME . '_logo_font_style' )\n\t\t\t\t\t->setStd( 'normal' )\n\t\t\t\t\t->setOptions( array( 'italic', 'normal' ) );\n\t\t\t;\n\t\t\t$this->addOptionToGroup( $option );\n\t\t\t$option = null;\n\n\t\t\t$option = new Admin_Theme_Element_Text();\n\t\t\t$option->setName( __( 'Logo font weight', 'retro' ) )\n\t\t\t\t\t->setDescription( __( 'Logo font weight', 'retro' ) )\n\t\t\t\t\t->setId( SHORTNAME . '_logo_font_weight' )\n\t\t\t\t\t->setStd( '600' );\n\t\t\t$this->addOptionToGroup( $option );\n\t\t\t$option = null;\n\n\t\t\t$option = new Admin_Theme_Element_Text();\n\t\t\t$option->setName( __( 'Logo text size', 'retro' ) )\n\t\t\t\t\t->setDescription( __( 'Logo text size at any units', 'retro' ) )\n\t\t\t\t\t->setId( SHORTNAME . '_logo_font_size_skin4' )\n\t\t\t\t\t->setStd( '47px' );\n\t\t\t$this->addOptionToGroup( $option );\n\t\t\t$option = null;\n\t}", "public function free_pro() {\n $free_pro = isset($this->config['free_pro']) ? $this->config['free_pro'] : array();\n if (!empty($free_pro)) {\n if (!empty($free_pro['free_theme_name']) && !empty($free_pro['pro_theme_name']) && !empty($free_pro['features']) && is_array($free_pro['features'])) {\n echo '<div class=\"feature-section\">';\n echo '<div id=\"free_pro\" class=\"cw-about-page-tab-pane cw-about-page-fre-pro\">';\n echo '<table class=\"free-pro-table\">';\n echo '<thead>';\n echo '<tr class=\"cw-about-page-text-right\">';\n echo '<th></th>';\n echo '<th>' . esc_html($free_pro['free_theme_name']) . '</th>';\n echo '<th>' . esc_html($free_pro['pro_theme_name']) . '</th>';\n echo '</tr>';\n echo '</thead>';\n echo '<tbody>';\n foreach ($free_pro['features'] as $feature) {\n echo '<tr>';\n if (!empty($feature['title']) || !empty($feature['description'])) {\n echo '<td>';\n $this->display_feature_title_and_description($feature);\n echo '</td>';\n }\n if (!empty($feature['is_in_lite']) && ( $feature['is_in_lite'] == 'true' )) {\n echo '<td class=\"only-lite\"><span class=\"dashicons-before dashicons-yes\"></span></td>';\n } else {\n echo '<td class=\"only-pro\"><span class=\"dashicons-before dashicons-no-alt\"></span></td>';\n }\n if (!empty($feature['is_in_pro']) && ( $feature['is_in_pro'] == 'true' )) {\n echo '<td class=\"only-lite\"><span class=\"dashicons-before dashicons-yes\"></span></td>';\n } else {\n echo '<td class=\"only-pro\"><span class=\"dashicons-before dashicons-no-alt\"></span></td>';\n }\n echo '</tr>';\n }\n if (!empty($free_pro['pro_theme_link']) && !empty($free_pro['get_pro_theme_label'])) {\n echo '<tr>';\n echo '<td>';\n echo '</td>';\n echo '<td colspan=\"2\" class=\"cw-about-page-text-right\"><a href=\"' . esc_url($free_pro['pro_theme_link']) . '\" target=\"_blank\" class=\"button button-primary button-hero\">' . wp_kses_post($free_pro['get_pro_theme_label']) . '</a></td>';\n echo '</tr>';\n }\n echo '</tbody>';\n echo '</table>';\n\n echo '</div>';\n echo '</div>';\n }// End if().\n }// End if().\n }", "public function prod_or_sandbox_field_callback() {\n\t\n\t\t$options = $this->options;\n\t\t$html = '';\n\t\n\t\t$current = isset($options['prod_or_sandbox'])?$options['prod_or_sandbox']:'sandbox';\n\t\t\t\n\t\t$html .= '<input type=\"radio\" id=\"prod_or_sandbox_prod\" name=\"' . mangopayWCConfig::OPTION_KEY . '[prod_or_sandbox]\" value=\"prod\"' . checked( 'prod', $current, false ) . '/>';\n\t\t$html .= '<label for=\"prod_or_sandbox_prod\">' . __( 'Production', 'mangopay' ) . '</label> ';\n\t\t\t\n\t\t$html .= '<input type=\"radio\" id=\"prod_or_sandbox_sandbox\" name=\"' . mangopayWCConfig::OPTION_KEY . '[prod_or_sandbox]\" value=\"sandbox\"' . checked( 'sandbox', $current, false ) . '/>';\n\t\t$html .= '<label for=\"prod_or_sandbox_sandbox\">' . __( 'Sandbox', 'mangopay' ) . '</label>';\n\t\n\t\t$html .= \"\n\t\t\t<script>\n\t\t\t(function($) {\n\t\t\t\t$(document).ready(function() {\n\t\t\t\t\tif( $('#prod_or_sandbox_prod').is(':checked') ){\n\t\t\t\t\t\tenvSwitch( 'prod' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tenvSwitch( 'sandbox' );\n\t\t\t\t\t}\n\t\t\t\t\t$('#prod_or_sandbox_prod').on( 'change', function( e ){\n\t\t\t\t\t\tenvSwitch($(this).val());\n\t\t\t\t\t});\n\t\t\t\t\t$('#prod_or_sandbox_sandbox').on( 'change', function( e ){\n\t\t\t\t\t\tenvSwitch($(this).val());\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tfunction envSwitch( current ) {\n\t\t\t\t\tswitch( current ) {\n\t\t\t\t\t\tcase 'prod':\n\t\t\t\t\t\t\t$('#sand_client_id').closest('tr').hide();\n\t\t\t\t\t\t\t$('#sand_passphrase').closest('tr').hide();\n\t\t\t\t\t\t\t$('#prod_client_id').closest('tr').show();\n\t\t\t\t\t\t\t$('#prod_passphrase').closest('tr').show();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'sandbox':\n\t\t\t\t\t\t\t$('#sand_client_id').closest('tr').show();\n\t\t\t\t\t\t\t$('#sand_passphrase').closest('tr').show();\n\t\t\t\t\t\t\t$('#prod_client_id').closest('tr').hide();\n\t\t\t\t\t\t\t$('#prod_passphrase').closest('tr').hide();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})( jQuery );\n\t\t\t</script>\n\t\t\";\n\t\n\t\techo $html;\n\t}", "function request_form() {\n\tif (is_single() && has_tag('discontinued-products')) { ?>\n\t\t<br/><h2 class=\"page-section-break\" id=\"help-form\">Request Product Help</h2>\n\t\t<?php gravity_form(105, false, false, false, '', true); ?>\n\t\t<br/><br/>\n\t<?php }\n\telseif (is_single() && (in_category('product-guides') || has_tag('product-types'))) { ?>\n\t\t<br/><h2 class=\"page-section-break\" id=\"help-form\">Request Product Help</h2>\n\t\t<?php gravity_form(101, false, false, false, '', true); ?>\n\t\t<br/><br/>\n\t<?php }\n\telseif (is_single() && in_category('application-guides')) { ?>\n\t\t<br/><h2 class=\"page-section-break\" id=\"help-form\">Request Application Help</h2>\n\t\t<?php gravity_form(102, false, false, false, '', true); ?>\n\t\t<br/><br/>\n\t<?php }\n\telseif (is_single() && has_tag('sku-product-specs')) { ?>\n\t\t<br/><h2 class=\"page-section-break\" id=\"quote-form\">Request Product Price</h2>\n\t\t<?php gravity_form(1, false, false, false, '', true); ?>\n\t\t<br/><br/>\n\t<?php }\n\telseif (is_single() && has_tag('product-overviews')) { ?>\n\t\t<br/><h2 class=\"page-section-break\" id=\"quote-form\">Request Product Price</h2>\n\t\t<?php gravity_form(6, false, false, false, '', true); ?>\n\t\t<br/><br/>\n\t<?php }\t\n\telseif (is_single() && has_tag('product-configurators')) { ?>\n\t\t<br/><h2 class=\"page-section-break\" id=\"quote-form\">Request Product Price</h2>\n\t\t<?php echo '<p>Please select the options you require for the <strong>' . get_the_title() . '</strong> in your application and request a quote.</p>';\n\t\tif (has_tag('capo')) {\n\t\t\tgravity_form(16, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('leo-record')) {\n\t\t\tgravity_form(11, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('imp')) {\n\t\t\tgravity_form(12, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('dmp331')) {\n\t\t\tgravity_form(14, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('dmp333')) {\n\t\t\tgravity_form(15, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('dmp343')) {\n\t\t\tgravity_form(17, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('dps200')) {\n\t\t\tgravity_form(18, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('dmp334')) {\n\t\t\tgravity_form(19, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('dmp304')) {\n\t\t\tgravity_form(20, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('pgs40')) {\n\t\t\tgravity_form(21, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('pgs700')) {\n\t\t\tgravity_form(22, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('pgs1000')) {\n\t\t\tgravity_form(23, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('dmp331p')) {\n\t\t\tgravity_form(24, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('dmk331p')) {\n\t\t\tgravity_form(25, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('implr')) {\n\t\t\tgravity_form(26, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('imcl')) {\n\t\t\tgravity_form(27, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('series-33x')) {\n\t\t\tgravity_form(28, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('series-41x')) {\n\t\t\tgravity_form(29, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('imsl')) {\n\t\t\tgravity_form(30, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('swl')) {\n\t\t\tgravity_form(31, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('iwsl')) {\n\t\t\tgravity_form(32, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('imctl')) {\n\t\t\tgravity_form(33, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('imstl')) {\n\t\t\tgravity_form(34, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('s12c')) {\n\t\t\tgravity_form(35, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('s12s')) {\n\t\t\tgravity_form(36, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('dm01')) {\n\t\t\tgravity_form(37, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('lex1')) {\n\t\t\tgravity_form(38, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('leo1')) {\n\t\t\tgravity_form(39, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('leo2')) {\n\t\t\tgravity_form(40, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag(array('eco1', 'eco2'))) {\n\t\t\tgravity_form(41, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('pd33x')) {\n\t\t\tgravity_form(42, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('pd39x')) {\n\t\t\tgravity_form(43, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('dg2000p')) {\n\t\t\tgravity_form(44, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('lmk458')) {\n\t\t\tgravity_form(45, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('lmk382')) {\n\t\t\tgravity_form(46, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('lmk307')) {\n\t\t\tgravity_form(47, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('lmp307')) {\n\t\t\tgravity_form(48, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('lmk306')) {\n\t\t\tgravity_form(49, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('lmp305')) {\n\t\t\tgravity_form(50, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('lmk807')) {\n\t\t\tgravity_form(51, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('lmk809')) {\n\t\t\tgravity_form(52, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('asm')) {\n\t\t\tgravity_form(53, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('xmd')) {\n\t\t\tgravity_form(54, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('xmpi')) {\n\t\t\tgravity_form(55, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('dmd331')) {\n\t\t\tgravity_form(56, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('dmd341')) {\n\t\t\tgravity_form(57, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('asl')) {\n\t\t\tgravity_form(58, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('as')) {\n\t\t\tgravity_form(59, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('asmt')) {\n\t\t\tgravity_form(60, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('dmp457')) {\n\t\t\tgravity_form(61, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('dmk457')) {\n\t\t\tgravity_form(62, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('baroli-02')) {\n\t\t\tgravity_form(63, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('baroli-05')) {\n\t\t\tgravity_form(64, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('baroli-02p')) {\n\t\t\tgravity_form(65, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('baroli-05p')) {\n\t\t\tgravity_form(66, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('dm10')) {\n\t\t\tgravity_form(67, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('leo3')) {\n\t\t\tgravity_form(68, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('series-35x')) {\n\t\t\tgravity_form(69, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('series-23ed')) {\n\t\t\tgravity_form(70, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('series-25ed')) {\n\t\t\tgravity_form(71, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('p200is')) {\n\t\t\tgravity_form(72, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('dmp331i')) {\n\t\t\tgravity_form(73, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('dmp333i')) {\n\t\t\tgravity_form(74, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('lmk331')) {\n\t\t\tgravity_form(75, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('lmk351')) {\n\t\t\tgravity_form(76, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('dps')) {\n\t\t\tgravity_form(77, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('ds200')) {\n\t\t\tgravity_form(78, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('ds210')) {\n\t\t\tgravity_form(79, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('ds200p')) {\n\t\t\tgravity_form(80, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('ds201p')) {\n\t\t\tgravity_form(81, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('imtg')) {\n\t\t\tgravity_form(82, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('pa430')) {\n\t\t\tgravity_form(83, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('kl1')) {\n\t\t\tgravity_form(84, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('srp94')) {\n\t\t\tgravity_form(85, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('cmc99')) {\n\t\t\tgravity_form(86, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('mtm3000')) {\n\t\t\tgravity_form(87, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('adt681')) {\n\t\t\tgravity_form(88, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('adt672')) {\n\t\t\tgravity_form(89, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('gefran-industrial') && has_tag(array('pressure-transducers-mv', 'pressure-transducers-v', 'pressure-transmitters', 'pressure-sensors', 'digital-pressure-sensors'))) {\n\t\t\tgravity_form(96, false, false, false, '', true);\n\t\t}\n\t\telseif (has_tag('gefran-melt') && has_tag(array('pressure-transducers-mv', 'pressure-transducers-v', 'pressure-transmitters', 'pressure-sensors', 'digital-pressure-sensors'))) {\n\t\t\tgravity_form(120, false, false, false, '', true);\n\t\t} ?>\n\t\t<br/><br/>\n\t<?php }\n}", "protected function show_early_selectors() {\n\t\t\tglobal $learndash_question_types;\n\n\t\t\t/**\n\t\t\t * Filter selector for Question Types.\n\t\t\t */\n\t\t\tif ( ! empty( $learndash_question_types ) ) {\n\t\t\t\techo '<select name=\"question_type\" id=\"question_type\" class=\"postform\">';\n\t\t\t\techo '<option value=\"\">' . sprintf(\n\t\t\t\t\t// translators: placeholder: Question.\n\t\t\t\t\tesc_html_x( 'Show all %s types', 'placeholder: Question', 'learndash' ),\n\t\t\t\t\tLearnDash_Custom_Label::get_label( 'question' )\n\t\t\t\t);\n\n\t\t\t\tif ( ( isset( $_GET['question_type'] ) ) && ( ! empty( $_GET['question_type'] ) ) ) {\n\t\t\t\t\t$selected_question_type = esc_attr( $_GET['question_type'] );\n\t\t\t\t} else {\n\t\t\t\t\t$selected_question_type = '';\n\t\t\t\t}\n\n\t\t\t\tforeach ( $learndash_question_types as $q_type => $q_label ) {\n\t\t\t\t\techo '<option value=\"' . esc_attr( $q_type ) . '\" ' . selected( $q_type, $selected_question_type, false ) . '>' . esc_attr( $q_label ) . '</option>';\n\t\t\t\t}\n\n\t\t\t\techo '</select>';\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filter selector for legacy ProQuiz Question Categories.\n\t\t\t */\n\t\t\t$categoryMapper = new WpProQuiz_Model_CategoryMapper();\n\t\t\t$question_pro_categories = $categoryMapper->fetchAll();\n\t\t\tif ( ! empty( $question_pro_categories ) ) {\n\n\t\t\t\tif ( ( isset( $_GET['question_pro_category'] ) ) && ( ! empty( $_GET['question_pro_category'] ) ) ) {\n\t\t\t\t\t$selected_question_pro_category = esc_attr( $_GET['question_pro_category'] );\n\t\t\t\t} else {\n\t\t\t\t\t$selected_question_pro_category = '';\n\t\t\t\t}\n\t\t\t\techo '<select name=\"question_pro_category\" id=\"question_pro_category\" class=\"postform\">';\n\t\t\t\techo '<option value=\"\">' . esc_html__( 'Show all ProQuiz Categories', 'learndash' );\n\n\t\t\t\tforeach ( $question_pro_categories as $question_pro_category ) {\n\t\t\t\t\techo '<option value=\"' . absint( $question_pro_category->getCategoryId() ) . '\" ' . selected( $question_pro_category->getCategoryId(), $selected_question_pro_category, false ) . '>' . esc_attr( $question_pro_category->getCategoryName() ) . '</option>';\n\t\t\t\t}\n\n\t\t\t\techo '</select>';\n\t\t\t}\n\t\t}", "function press_theme(){\n\n\tglobal $wpdb;\n\t$title = __(\"Theme Settings\");\n\tif($_POST) {\n\t\tunset($_POST['submit']);\t\t\n\t\t$adcode = $_POST['adcode'];\n\t\t$data = $wpdb->escape($_POST);\n\t\t$data['adcode'] = $adcode;\n\t\tunset($_POST, $adcode);\n\t\tupdate_option('newspres_options', $data);\t\t\n\t}\n\t// this item save as db,and item name is this theme public name \n\t$newspres_options = wptap_get_settings('newspres_options');\n\t// circularly acquire the data of newspres_options and present it in the form of array\n\textract($newspres_options, EXTR_OVERWRITE);\n?>\t\n<div class=\"wrap\">\n\t<?php screen_icon('options-general'); ?>\n\t<h2><?php echo esc_html( $title); ?></h2>\n\t<form method=\"post\" action=\"<?php echo $actionurl; ?>\" id=\"newspresform\">\n\n\t<div class=\"metabox-holder\">\n\t\t<div class=\"postbox\">\n\t\t\t<h3><?php _e('Global Settings') ?></h3>\n\t\t\t<div class=\"wptap-admin-container\">\n\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t<!-- title name, color & logo -->\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><label for=\"homepagetitle\"><?php _e('Home Page Title:'); ?></label></th>\n\t\t\t\t\t\t<td><input type=\"text\" class=\"regular-text\" value=\"<?php echo $homepagetitle; ?>\" id=\"homepagetitle\" name=\"homepagetitle\" /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<!-- End name ###-->\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><label for=\"titlecolor\"><?php _e('Title Text Color:'); ?></label></th>\n\t\t\t\t\t\t<td><input type=\"text\" class=\"small-text\" value=\"<?php echo $titlecolors; ?>\" id=\"titlecolor\" name=\"titlecolors\" /><div id=\"colorpicker\" name=\"titlecolor\"></div></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<!-- End title color ### -->\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><label for=\"siteicon\"><?php _e('Site Icon:'); ?><br><span style=\"color:#B83B3B;\"><?php _e('(This must be a png file with size less than 256k)'); ?></span></label></th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div id=\"upload_pages_button\" style=\"float:left;width:150px;\"></div>\n\t\t\t\t\t\t\t<img src=\"<?php echo plugin_dir_url(__FILE__) ?>/images/icons/<?php echo $pages_icon.'.png'; ?>\" id=\"current_logo_icon\" style=\"vertical-align:middle;\" />\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"pages_icon\" id=\"pages_icon\" value=\"<?php echo $pages_icon; ?>\">\n\t\t\t\t\t\t\t<?php press_icon(); ?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<!-- other mobile icons response -->\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"></th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div id=\"upload_pages_response\"></div><div id=\"upload_pages_progress\" style=\"display:none\">\n\t\t\t\t\t\t\t\t<img src=\"<?php echo plugin_dir_url(__FILE__) . '/images/loading.gif'; ?>\" alt=\"\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<!-- iPhone disk icons -->\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><label for=\"iphonedesktopicon\"><?php _e('iPhone Desktop Icon:'); ?></label><br /><span style=\"color:#B83B3B;\"><?php _e('(57*57 png file)'); ?></span></th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div id=\"upload_button\" style=\"float:left;width:150px;\"></div>\n\t\t\t\t\t\t\t\t<?php if(file_exists(ABSPATH . 'apple-touch-icon.png')) { echo '<img src=\"'.get_option('home').'/apple-touch-icon.png\" alt=\"\" />';} ?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<!-- iPhone icons response -->\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"></th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t<div id=\"upload_response\"></div><div id=\"upload_progress\" style=\"display:none\">\n\t\t\t\t\t\t\t<img src=\"<?php echo plugin_dir_url(__FILE__) . '/images/loading.gif'; ?>\" alt=\"\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\n\t\t\t\t\t<!-- Begin theme style -->\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t <th scope=\"row\"><label for=\"themestyle\"><?php _e('Theme Style:'); ?></label></th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<?php $themestyles = array('Blooming Lavender', 'Miss Jade', 'Naughty Pumpkin', 'Persian Rose', 'Rocky Blue');?>\n\t\t\t\t\t\t\t<select name=\"themestyle\" id=\"themestyle\">\n\t\t\t\t\t\t\t\t<option value=\"Black\">Black(Default)</option>\n\t\t\t\t\t\t\t\t<?php foreach($themestyles as $style): ?>\n\t\t\t\t\t\t\t\t<option value=\"<?php echo $style; ?>\" <?php if($themestyle==$style) echo 'selected=\"selected\"'; ?>><?php echo $style; ?></option>\n\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\t\t\n\t\t\t\t\t<!--# End theme style/ -->\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\n\t<!-- Begin Booker mark -->\n\t<div class=\"metabox-holder\">\n\t\t<div class=\"postbox\">\n\t\t\t<h3><?php _e('Bookmark Setting') ?></h3>\n\t\t\t\n\t\t\t<div class=\"wptap-admin-container\">\n\t\t\t\t<table class=\"form-table\" >\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\" style=\"width:120px;\">\n\t\t\t\t\t\t<label for=\"Twitter\"><?php _e('Display \\'Twitter\\':'); ?></label></th>\n\t\t\t\t\t\t<td><input type=\"checkbox\" value=\"1\" id=\"bookmarktwitter\" name=\"bookmarktwitter\" <?php checked('1', $bookmarktwitter); ?>/></td>\n\n\t\t\t\t\t\t<th scope=\"row\" style=\"width:120px;\"><label for=\"Facebook\"><?php _e('Display \\'Facebook\\':'); ?></label></th>\n\t\t\t\t\t\t<td><input type=\"checkbox\" value=\"1\" id=\"bookmarkfacebook\" name=\"bookmarkfacebook\" <?php checked('1', $bookmarkfacebook); ?>/></td>\n\n\t\t\t\t\t\t<th scope=\"row\" style=\"width:120px;\"><label for=\"MySpace\"><?php _e('Display \\'MySpace\\':'); ?></label></th>\n\t\t\t\t\t\t<td><input type=\"checkbox\" value=\"1\" id=\"bookmarkmyspace\" name=\"bookmarkmyspace\" <?php checked('1', $bookmarkmyspace); ?>/></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\" style=\"width:120px;\"><label for=\"Twitter ID\"><?php _e('Twitter URL:'); ?></label></th>\n\t\t\t\t\t\t<td><input type=\"text\" value=\"<?php echo $twitterurl; ?>\" id=\"twitterurl\" name=\"twitterurl\" class=\"large-text\"/></td>\n\n\t\t\t\t\t\t<th scope=\"row\" style=\"width:120px;\"><label for=\"Twitter ID\"><?php _e('Facebook URL:'); ?></label></th>\n\t\t\t\t\t\t<td><input type=\"text\" value=\"<?php echo $facebookurl; ?>\" id=\"facebookurl\" name=\"facebookurl\" class=\"large-text\"/></td>\n\n\t\t\t\t\t\t<th scope=\"row\" style=\"width:120px;\"><label for=\"Twitter ID\"><?php _e('MySpace URL:'); ?></label></th>\n\t\t\t\t\t\t<td><input type=\"text\" value=\"<?php echo $myspaceurl; ?>\" id=\"myspaceurl\" name=\"myspaceurl\" class=\"large-text\"/></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<!--###### End Book mark ##############-->\n\n\t<!-- display show settings post set ,post entry set and page set -->\n\t<div class=\"metabox-holder\">\n\t\t<div class=\"postbox\">\n\t\t\t<table class=\"widefat post fixed\" cellspacing=\"0\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th class=\"manage-column\" scope=\"col\">Post Setting(home)</th>\n\t\t\t\t\t\t<th class=\"manage-column\" scope=\"col\"> Post Entry Setting</th>\n\t\t\t\t\t\t<th class=\"manage-column\" scope=\"col\">Page Setting</th>\t\t\t\t\t\t\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\n\t\t\t\t<tbody class=\"wptap-admin-container\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><input type=\"checkbox\" value=\"1\" id=\"h_postdisplayauthor\" name=\"h_postdisplayauthor\" <?php checked('1', $h_postdisplayauthor); ?>/> <?php _e('Display \\'Author\\''); ?></td>\n\t\t\t\t\t\t<td><input type=\"checkbox\" value=\"1\" id=\"p_postdisplayauthor\" name=\"p_postdisplayauthor\" <?php checked('1', $p_postdisplayauthor); ?>/> <?php _e('Display \\'Author\\''); ?></td>\n\n\t\t\t\t\t\t<td><input type=\"checkbox\" value=\"1\" id=\"pagedisplayauthor\" name=\"pagedisplayauthor\" <?php checked('1', $pagedisplayauthor); ?>/> <?php _e('Display \\'Author\\''); ?></td>\n\t\t\t\t\t</tr>\n\n\t\t\t\t\t<tr class=\"alternate\">\n\t\t\t\t\t\t<td><input type=\"checkbox\" value=\"1\" id=\"h_postdisplaycategory\" name=\"h_postdisplaycategory\" <?php checked('1', $h_postdisplaycategory); ?>/> <?php _e('Display \\'Category\\''); ?></td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td><input type=\"checkbox\" value=\"1\" id=\"p_postdisplaydate\" name=\"p_postdisplaydate\" <?php checked('1', $p_postdisplaydate); ?>/> <?php _e('Display \\'Date\\''); ?></td>\n\n\t\t\t\t\t\t<td><input type=\"checkbox\" value=\"1\" id=\"pagedisplaydate\" name=\"pagedisplaydate\" <?php checked('1', $pagedisplaydate); ?>/> <?php _e('Display \\'Date\\''); ?></td>\n\t\t\t\t\t</tr>\n\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><input type=\"checkbox\" value=\"1\" id=\"h_postdisplaytags\" name=\"h_postdispalytags\" <?php checked('1', $h_postdispalytags); ?>/> <?php _e('Display \\'Tags\\''); ?></td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td><input type=\"checkbox\" value=\"1\" id=\"p_postdiscategory\" name=\"p_postdiscategory\" <?php checked('1', $p_postdiscategory); ?>/> <?php _e('Display \\'Category\\''); ?></td>\n\n\t\t\t\t\t\t<td><input type=\"checkbox\" value=\"1\" id=\"pagedisplaycategory\" name=\"pagedisplaycategory\" <?php checked('1', $pagedisplaycategory); ?>/> <?php _e('Display \\'Category\\''); ?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\n\t\t\t\t\t<tr class=\"alternate\">\n\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td><input type=\"checkbox\" value=\"1\" id=\"p_postdisplaytags\" name=\"p_postdisplaytags\" <?php checked('1', $p_postdisplaytags); ?>/> <?php _e('Display \\'Tags\\''); ?></td>\n\n\t\t\t\t\t\t<td><input type=\"checkbox\" value=\"1\" id=\"pagedisplaytags\" name=\"pagedisplaytags\" <?php checked('1', $pagedisplaytags); ?>/> <?php _e('Display \\'Tags\\''); ?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t</div>\n\t<!-- display show settings post set ,post entry set and page set ################################## -->\n\n\t\t<!-- Begin Home Menu Settings -->\n\t\t<div class=\"metabox-holder\">\n\t\t\t<div class=\"postbox\">\n\t\t\t\t<h3><?php _e('Home Menu Settings') ?></h3>\n\t\t\t\t\n\t\t\t\t<div class=\"wptap-admin-container\">\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t\t<th scope=\"row\"><label for=\"header menu\"><?php _e('Header Menu Settings:'); ?></label></th>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" value=\"1\" id=\"menudisplayhome\" name=\"menudisplayhome\" <?php checked('1', $menudisplayhome); ?>/> <?php _e('Display \\'Home\\' on menu '); ?><br />\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" value=\"1\" id=\"menudisplaycategory\" name=\"menudisplaycategory\" <?php checked('1', $menudisplaycategory); ?>/> <?php _e('Display \\'Category\\' on menu '); ?><br />\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" value=\"1\" id=\"menudisplaypage\" name=\"menudisplaypage\" <?php checked('1', $menudisplaypage); ?>/> <?php _e('Display \\'Pages\\' on menu '); ?><br />\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" value=\"1\" id=\"menudisplaysearch\" name=\"menudisplaysearch\" <?php checked('1', $menudisplaysearch); ?>/> <?php _e('Display \\'Search\\' on menu '); ?><br />\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" value=\"1\" id=\"menudisplaylogin\" name=\"menudisplaylogin\" <?php checked('1', $menudisplaylogin); ?>/> <?php _e('Display \\'Login\\' on menu '); ?>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<!-- Bengin Category -->\n\t\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t\t<th scope=\"row\"><label for=\"Categories\"><?php _e('Categories to Display:'); ?></label></th>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t$categories = get_categories('pad_counts=true');\n\n\t\t\t\t\t\t\t\t\tforeach($categories as $cat) {\n\t\t\t\t\t\t\t\t\t\t$checkeded = '';\n\t\t\t\t\t\t\t\t\t\tif(is_array($menucagegories) && in_array($cat->cat_ID, $menucagegories)) $checkeded = ' checked=\"checked\"';\n\n\t\t\t\t\t\t\t\t\t\techo ' <input type=\"checkbox\" name=\"menucagegories[]\" id=\"cat'.$cat->cat_ID.'\" value=\"'.$cat->cat_ID.'\" '.$checkeded.'> ' . $cat->cat_name . '(<span class=\"red\">'.$cat->count.'</span>)';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<!--####### End Category ######-->\n\t\t\t\t\t\t<!-- Begin Pages loop -->\n\t\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t\t<th scope=\"row\"><label for=\"Pages\"><?php _e('Pages to Display:'); ?></label></th>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t$pages = get_pages();\n\n\t\t\t\t\t\t\t\t\tforeach($pages as $page) {\n\t\t\t\t\t\t\t\t\t\t$checkeded = '';\n\t\t\t\t\t\t\t\t\t\tif(is_array($menupagelist) && in_array($page->ID, $menupagelist)) $checkeded = ' checked=\"checked\"';\n\n\t\t\t\t\t\t\t\t\t\techo ' <input type=\"checkbox\" name=\"menupagelist[]\" id=\"page'.$page->ID.'\" value=\"'.$page->ID.'\" '.$checkeded.'> ' . $page->post_title;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\t\n\t\t\t\t\t\t<!--####### End Pages #######-->\n\t\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<!--#### End Header Menu Settings ########-->\n\t\t<!-- Begin advertising setting /-->\n\t\t<div class=\"metabox-holder\">\n\t\t\t<div class=\"postbox\">\n\t\t\t\t<h3><?php _e('Ads Setting') ?></h3>\n\t\t\t\t<div class=\"wptap-admin-container\">\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t\t<th scope=\"row\"><label for=\"adcode\">AD Code:</label></th>\n\t\t\t\t\t\t\t<td><textarea id=\"adcode\" name=\"adcode\" class=\"large-text code\" rows=\"6\"><?php echo stripslashes($adcode); ?></textarea></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<!-- ##### End advertising setting ####-->\n\t</div>\n\t\t\n\t<input type=\"submit\" name=\"submit\" class=\"button-primary\" value=\"<?php esc_attr_e('Save Change') ?>\" />\n\t</form>\n\t\n</div>\n<?php\n}", "function display_wpjobus_resume_portfolio_settings ($post) {\n\t\t\t$wpjobus_resume_portfolio = get_post_meta($post->ID, 'wpjobus_resume_portfolio',true);\n\n\t\t?>\n\t\t\n\t\t<input type=\"hidden\" name=\"cmb_nonce\" value=\"<?php echo wp_create_nonce(basename(__FILE__)); ?>\" />\n\n\t\t<div id='review_options_popup'>\n\n\t\t\t<div id=\"resume_portfolio\">\n\n\t\t\t\t<?php \n\n\t\t\t\t\tfor ($i = 0; $i < (count($wpjobus_resume_portfolio)); $i++) {\n\t\t\t\t?>\n\t\t\t\t\n\t\t\t\t<div class=\"option_item\" id=\"<?php echo $i; ?>\">\n\t\t\t\t\t\n\t\t\t\t\t<span class='text'>Project <?php echo ($i+1); ?></span>\n\n\t\t\t\t\t<div class=\"full\" style=\"margin-top: 20px; margin-bottom: 20px;\">\n\n\t\t\t\t\t\t<span class=\"text\">Name:</span>\n\t\t\t\t\t\t<input type='text' id='wpjobus_resume_portfolio[<?php echo $i; ?>][0]' name='wpjobus_resume_portfolio[<?php echo $i; ?>][0]' value='<?php if (!empty($wpjobus_resume_portfolio[$i][0])) echo $wpjobus_resume_portfolio[$i][0]; ?>' class='criteria_name' placeholder=\"\">\n\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class=\"full\" style=\"margin-top: 20px; margin-bottom: 20px;\">\n\n\t\t\t\t\t\t<span class=\"text\">Category:</span>\n\t\t\t\t\t\t<input type='text' id='wpjobus_resume_portfolio[<?php echo $i; ?>][1]' name='wpjobus_resume_portfolio[<?php echo $i; ?>][1]' value='<?php if (!empty($wpjobus_resume_portfolio[$i][1])) echo $wpjobus_resume_portfolio[$i][1]; ?>' class='criteria_name_two' placeholder=\"\" style=\"width: 400px;\">\n\t\t\t\t\t\t<span class=\"info-text\" style=\"margin-left: 0;\">You can leave it empty</span>\n\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class=\"full\" style=\"margin-top: 20px; margin-bottom: 20px;\">\n\n\t\t\t\t\t\t<span class=\"text\">Note:</span>\n\t\t\t\t\t\t<textarea class=\"criteria_notes\" name=\"wpjobus_resume_portfolio[<?php echo $i; ?>][2]\" id='wpjobus_resume_portfolio[<?php echo $i; ?>][2]' cols=\"70\" rows=\"7\" ><?php if (!empty($wpjobus_resume_portfolio[$i][2])) echo $wpjobus_resume_portfolio[$i][2]; ?></textarea>\n\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class=\"full\" style=\"margin-top: 20px; margin-bottom: 20px;\">\n\t\t\t\t\t\t<span class=\"text\">Image:</span>\n\n\t\t\t\t\t\t<span>\n\n\t\t\t\t\t\t<?php if(!empty($wpjobus_resume_portfolio[$i][3])) { ?>\n\n\t\t\t <div style=\"width: 90%; width: -webkit-calc(100% - 120px); width: calc(100% - 120px); float: left;\"><img class=\"criteria-image\" id=\"your_image_url_img<?php echo $i; ?>3\" src=\"<?php if (!empty($wpjobus_resume_portfolio[$i][3])) echo $wpjobus_resume_portfolio[$i][3]; ?>\" style=\"float: left; margin-bottom: 20px;\" /> </div>\n\t\t\t <input class=\"criteria-image-url\" id=\"your_image_url<?php echo $i; ?>3\" type=\"text\" size=\"36\" name=\"wpjobus_resume_portfolio[<?php echo $i; ?>][3]\" style=\"max-width: 200px; float: left; margin-top: 10px; display: none;\" value=\"<?php if (!empty($wpjobus_resume_portfolio[$i][3])) echo $wpjobus_resume_portfolio[$i][3]; ?>\" />\n\t\t\t <input class=\"criteria-image-button-remove button\" id=\"your_image_url_button_remove<?php echo $i; ?>3\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px; margin-left: 112px;\" value=\"Remove\" /> </br>\n\t\t\t <input class=\"criteria-image-button button\" id=\"your_image_url_button<?php echo $i; ?>3\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px; display: none;\" value=\"Upload Image\" /> </br>\n\n\t\t\t <?php } else { ?>\n\n\t\t\t <div style=\"width: 90%; width: -webkit-calc(100% - 120px); width: calc(100% - 120px); float: left;\"><img class=\"criteria-image\" id=\"your_image_url_img<?php echo $i; ?>3\" src=\"<?php if (!empty($wpjobus_resume_portfolio[$i][3])) echo $wpjobus_resume_portfolio[$i][3]; ?>\" style=\"float: left; margin-bottom: 20px;\" /> </div>\n\t\t\t <input class=\"criteria-image-url\" id=\"your_image_url<?php echo $i; ?>3\" type=\"text\" size=\"36\" name=\"wpjobus_resume_portfolio[<?php echo $i; ?>][3]\" style=\"max-width: 200px; float: left; margin-top: 10px; display: none;\" value=\"<?php if (!empty($wpjobus_resume_portfolio[$i][3])) echo $wpjobus_resume_portfolio[$i][3]; ?>\" />\n\t\t\t <input class=\"criteria-image-button-remove button\" id=\"your_image_url_button_remove<?php echo $i; ?>3\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px; margin-left: 112px; display: none;\" value=\"Remove\" /> </br>\n\t\t\t <input class=\"criteria-image-button button\" id=\"your_image_url_button<?php echo $i; ?>3\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px;\" value=\"Upload Image\" /> </br>\n\n\t\t\t <?php } ?>\n\n\t\t\t <script>\n\t\t\t\t var image_custom_uploader;\n\t\t\t\t var $thisItem = '';\n\n\t\t\t\t jQuery(document).on('click','.criteria-image-button', function(e) {\n\t\t\t\t e.preventDefault();\n\n\t\t\t\t $thisItem = jQuery(this);\n\n\t\t\t\t //If the uploader object has already been created, reopen the dialog\n\t\t\t\t if (image_custom_uploader) {\n\t\t\t\t image_custom_uploader.open();\n\t\t\t\t return;\n\t\t\t\t }\n\n\t\t\t\t //Extend the wp.media object\n\t\t\t\t image_custom_uploader = wp.media.frames.file_frame = wp.media({\n\t\t\t\t title: 'Choose Image',\n\t\t\t\t button: {\n\t\t\t\t text: 'Choose Image'\n\t\t\t\t },\n\t\t\t\t multiple: false\n\t\t\t\t });\n\n\t\t\t\t //When a file is selected, grab the URL and set it as the text field's value\n\t\t\t\t image_custom_uploader.on('select', function() {\n\t\t\t\t attachment = image_custom_uploader.state().get('selection').first().toJSON();\n\t\t\t\t var url = '';\n\t\t\t\t url = attachment['url'];\n\t\t\t\t $thisItem.parent().find('.criteria-image-url').val(url);\n\t\t\t\t $thisItem.parent().find( \"img.criteria-image\" ).attr({\n\t\t\t\t src: url\n\t\t\t\t });\n\t\t\t\t $thisItem.parent().find(\".criteria-image-button\").css(\"display\", \"none\");\n\t\t\t\t $thisItem.parent().find(\".criteria-image-button-remove\").css(\"display\", \"block\");\n\t\t\t\t });\n\n\t\t\t\t //Open the uploader dialog\n\t\t\t\t image_custom_uploader.open();\n\t\t\t\t });\n\n\t\t\t\t jQuery(document).on('click','.criteria-image-button-remove', function(e) {\n\t\t\t\t jQuery(this).parent().find('.criteria-image-url').val('');\n\t\t\t\t jQuery(this).parent().find( \"img.criteria-image\" ).attr({\n\t\t\t\t src: ''\n\t\t\t\t });\n\t\t\t\t jQuery(this).parent().find(\".criteria-image-button\").css(\"display\", \"block\");\n\t\t\t\t jQuery(this).css(\"display\", \"none\");\n\t\t\t\t });\n\t\t\t\t\t\t</script>\n\n\t\t\t \t</span>\n\n\t\t\t </div>\n\n\t\t\t\t\t<button name=\"button_del_portfolio\" type=\"button\" class=\"button-secondary button_del_portfolio\">delete</button>\n\t\t\t\t\t\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<?php \n\t\t\t\t\t}\n\t\t\t\t?>\n\n\n\t\t\t</div>\n\n\t\t\t<div id=\"template_portfolio\">\n\t\t\t\t\n\t\t\t\t<div class=\"option_item\" id=\"999\">\n\t\t\t\t\t<span class='text'>Project 999</span>\n\n\t\t\t\t\t<div class=\"full\" style=\"margin-top: 20px; margin-bottom: 20px;\">\n\n\t\t\t\t\t\t<span class=\"text\">Name:</span>\n\t\t\t\t\t\t<input type='text' id='' name='' value='' class='criteria_name' placeholder=\"\">\n\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class=\"full\" style=\"margin-top: 20px; margin-bottom: 20px;\">\n\n\t\t\t\t\t\t<span class=\"text\">Category:</span>\n\t\t\t\t\t\t<input type='text' id='' name='' value='' class='criteria_name_two' placeholder=\"\" style=\"width: 400px;\">\n\t\t\t\t\t\t<span class=\"info-text\" style=\"margin-left: 0;\">You can leave it empty</span>\n\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class=\"full\" style=\"margin-top: 20px; margin-bottom: 20px;\">\n\n\t\t\t\t\t\t<span class=\"text\">Note:</span>\n\t\t\t\t\t\t<textarea class=\"criteria_notes\" name=\"\" id='' cols=\"70\" rows=\"7\" ></textarea>\n\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class=\"full\" style=\"margin-top: 20px; margin-bottom: 20px;\">\n\t\t\t\t\t\t<span class=\"text\">Image:</span>\n\n\t\t\t\t\t\t<span>\n\n\t\t\t\t\t\t<?php if(!empty($wpjobus_resume_testimonials[$i][3])) { ?>\n\n\t\t\t <div style=\"width: 90%; width: -webkit-calc(100% - 120px); width: calc(100% - 120px); float: left;\"><img class=\"criteria-image\" id=\"\" src=\"\" style=\"float: left; margin-bottom: 20px;\" /> </div>\n\t\t\t <input class=\"criteria-image-url\" id=\"\" type=\"text\" size=\"36\" name=\"\" style=\"max-width: 200px; float: left; margin-top: 10px; display: none;\" value=\"\" />\n\t\t\t <input class=\"criteria-image-button-remove button\" id=\"\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px; margin-left: 112px;\" value=\"Remove\" /> </br>\n\t\t\t <input class=\"criteria-image-button button\" id=\"your_image_url_button<?php echo $i; ?>3\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px; display: none;\" value=\"Upload Image\" /> </br>\n\n\t\t\t <?php } else { ?>\n\n\t\t\t <div style=\"width: 90%; width: -webkit-calc(100% - 120px); width: calc(100% - 120px); float: left;\"><img class=\"criteria-image\" id=\"your_image_url_img<?php echo $i; ?>3\" src=\"\" style=\"float: left; margin-bottom: 20px;\" /> </div>\n\t\t\t <input class=\"criteria-image-url\" id=\"your_image_url<?php echo $i; ?>3\" type=\"text\" size=\"36\" name=\"\" style=\"max-width: 200px; float: left; margin-top: 10px; display: none;\" value=\"\" />\n\t\t\t <input class=\"criteria-image-button-remove button\" id=\"your_image_url_button_remove<?php echo $i; ?>3\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px; margin-left: 112px; display: none;\" value=\"Remove\" /> </br>\n\t\t\t <input class=\"criteria-image-button button\" id=\"your_image_url_button<?php echo $i; ?>3\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px;\" value=\"Upload Image\" /> </br>\n\n\t\t\t <?php } ?>\n\n\t\t\t <script>\n\t\t\t\t var image_custom_uploader;\n\t\t\t\t var $thisItem = '';\n\n\t\t\t\t jQuery(document).on('click','.criteria-image-button', function(e) {\n\t\t\t\t e.preventDefault();\n\n\t\t\t\t $thisItem = jQuery(this);\n\n\t\t\t\t //If the uploader object has already been created, reopen the dialog\n\t\t\t\t if (image_custom_uploader) {\n\t\t\t\t image_custom_uploader.open();\n\t\t\t\t return;\n\t\t\t\t }\n\n\t\t\t\t //Extend the wp.media object\n\t\t\t\t image_custom_uploader = wp.media.frames.file_frame = wp.media({\n\t\t\t\t title: 'Choose Image',\n\t\t\t\t button: {\n\t\t\t\t text: 'Choose Image'\n\t\t\t\t },\n\t\t\t\t multiple: false\n\t\t\t\t });\n\n\t\t\t\t //When a file is selected, grab the URL and set it as the text field's value\n\t\t\t\t image_custom_uploader.on('select', function() {\n\t\t\t\t attachment = image_custom_uploader.state().get('selection').first().toJSON();\n\t\t\t\t var url = '';\n\t\t\t\t url = attachment['url'];\n\t\t\t\t $thisItem.parent().find('.criteria-image-url').val(url);\n\t\t\t\t $thisItem.parent().find( \"img.criteria-image\" ).attr({\n\t\t\t\t src: url\n\t\t\t\t });\n\t\t\t\t $thisItem.parent().find(\".criteria-image-button\").css(\"display\", \"none\");\n\t\t\t\t $thisItem.parent().find(\".criteria-image-button-remove\").css(\"display\", \"block\");\n\t\t\t\t });\n\n\t\t\t\t //Open the uploader dialog\n\t\t\t\t image_custom_uploader.open();\n\t\t\t\t });\n\n\t\t\t\t jQuery(document).on('click','.criteria-image-button-remove', function(e) {\n\t\t\t\t jQuery(this).parent().find('.criteria-image-url').val('');\n\t\t\t\t jQuery(this).parent().find( \"img.criteria-image\" ).attr({\n\t\t\t\t src: ''\n\t\t\t\t });\n\t\t\t\t jQuery(this).parent().find(\".criteria-image-button\").css(\"display\", \"block\");\n\t\t\t\t jQuery(this).css(\"display\", \"none\");\n\t\t\t\t });\n\t\t\t\t\t\t</script>\n\n\t\t\t \t</span>\n\n\t\t\t </div>\n\n\t\t\t\t\t<button name=\"button_del_portfolio\" type=\"button\" class=\"button-secondary button_del_portfolio\">delete</button>\n\t\t\t\t</div>\n\n\t\t\t</div>\n\n\t\t\t<div class=\"option_item\">\n\t\t\t\t<button type=\"button\" name=\"submit_add_portfolio\" id='submit_add_portfolio' value=\"add\" class=\"button-secondary\">Add new project</button>\n\t\t\t</div>\n\n\t\t\t\n\n\t\t\t<br>\n\n\n\t\t</div>\t<!-- end review_options_pop -->\n\n\n\n\n\n\t\t<?php\n\n\t\t}", "function ec_print_product_select( $id ){\n\t\n\tglobal $wpdb;\n\t$total = $wpdb->get_var( \"SELECT COUNT( ec_product.product_id ) as total FROM ec_product\" );\n\t\n\tif( $total > 500 ){\n\t\t\n\t\techo \"<input type=\\\"text\\\" class=\\\"ec_editor_select_box\\\" id=\\\"\" . $id . \"\\\">\";\n\t\t\n\t}else{\n\t\t\n\t\techo \"<select class=\\\"ec_editor_select_box\\\" id=\\\"\" . $id . \"\\\">\";\n\t\t$products = $wpdb->get_results( \"SELECT ec_product.product_id, ec_product.title, ec_product.model_number FROM ec_product ORDER BY ec_product.title\" );\n\t\tif( count( $products ) > 0 ){\n\t\t\techo \"<option value=\\\"0\\\">Select a Product</option>\";\n\t\t\tfor( $i=0; $i<count( $products ); $i++ ){\n\t\t\t\techo \"<option value=\\\"\" . $products[$i]->product_id . \"\\\">\" . $products[$i]->title . \"</option>\";\n\t\t\t}\n\t\t}else{\n\t\t\techo \"<option value=\\\"0\\\">No Products Exist</option>\";\n\t\t}\n\t\techo \"</select>\";\n\t\t\n\t}\n\t\n}", "function themetek_meta_box_portfolio_templates() {\n\t\t\tglobal $post;\n\t\t\t// Add an nonce field so we can check for it later\n\t\t\twp_nonce_field( 'themetek_meta_box_portfolio_templates', 'themetek_meta_box_portfolio_templates_nonce' );\n\t\t\t// Retrieve an existing value from the database and use the value for the form.\n\t\t\t$values = get_post_custom( $post->ID );\n\t\t\t$selected = isset( $values['page_portfolio_style'] ) ? esc_attr( $values['page_portfolio_style'][0] ) :'';\n\n\t\t\t// Display portfolio item template styles\n\t\t\techo '<div class=\"tek_meta_block meta_block_top\">';\n\t\t\t\techo '<select name=\"page_portfolio_style\" id=\"page_portfolio_style\">';\n\t\t\t\t\techo '<option value=\"single-full\" '.esc_attr(selected( $selected, 'single-full' )).'>Single image full width</option>';\n\t\t\t\t\techo '<option value=\"single-side\" '.esc_attr(selected( $selected, 'single-side' )).'>Single image side</option>';\n\t\t\t\t\techo '<option value=\"gallery-full\" '.esc_attr(selected( $selected, 'gallery-full' )).'>Gallery full width</option>';\n\t\t\t\t\techo '<option value=\"gallery-side\" '.esc_attr(selected( $selected, 'gallery-side' )).'>Gallery side</option>';\n\t\t\t\t\techo '<option value=\"gallery-list\" '.esc_attr(selected( $selected, 'gallery-list' )).'>Gallery list</option>';\n\t\t\t\techo '</select>';\n\t\t\techo '</div>';\n\t\t}" ]
[ "0.6277473", "0.6229693", "0.59814805", "0.58137125", "0.56802297", "0.5622738", "0.5543028", "0.55337167", "0.55321425", "0.5520376", "0.551956", "0.5516747", "0.5469622", "0.54635376", "0.54361576", "0.54319715", "0.5423544", "0.5423059", "0.5407074", "0.53882396", "0.5358101", "0.53149307", "0.53097665", "0.5308236", "0.5296547", "0.5290706", "0.529016", "0.5284925", "0.52798045", "0.5275506" ]
0.6297707
0
Try to save a Variation with a negative price difference
function testNegativeVariationPrice() { $this->loginAs('admin'); $smallRedShortsVariation = $this->objFromFixture('Variation', 'shortsSmallRedCotton'); $originalAmount = $smallRedShortsVariation->Amount; $this->assertTrue($originalAmount->getAmount() >= 0); $newAmount = new Money(); $newAmount->setAmount(-1); $newAmount->setCurrency($originalAmount->getCurrency()); $smallRedShortsVariation->Amount = $newAmount; $errorMessage = null; try { $smallRedShortsVariation->write(); } catch (Exception $e) { $errorMessage = $e->getMessage(); } //Make sure there is an error when trying to save $this->assertTrue($errorMessage != null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdateVolumesWaiverProductDecreasingVolumeNotST()\n {\n $hedge = $this->hedgeRepository->find(2);\n $this->hedgeVolumeManager->updateVolumesByHedge($hedge);\n\n $rmpSubSegmentRiskLevel = $this->doctrine->getRepository(RmpSubSegmentRiskLevel::class)->findOneBy([\n 'rmpSubSegment' => $hedge->getHedgeLines()->first()->getRmpSubSegment(),\n 'riskLevel' => $hedge->getHedgingTool()->getRiskLevel()\n ]);\n\n $this->assertEquals(300, $rmpSubSegmentRiskLevel->getConsumption());\n\n }", "public function testUpdateVolumesNoWaiverDecreasingVolumeNotST()\n {\n $hedge = $this->hedgeRepository->find(1);\n $this->hedgeVolumeManager->updateVolumesByHedge($hedge);\n\n $rmpSubSegmentRiskLevel = $this->doctrine->getRepository(RmpSubSegmentRiskLevel::class)->findOneBy([\n 'rmpSubSegment' => $hedge->getHedgeLines()->first()->getRmpSubSegment(),\n 'riskLevel' => $hedge->getHedgingTool()->getRiskLevel()\n ]);\n\n $this->assertEquals(200, $rmpSubSegmentRiskLevel->getConsumption());\n }", "public function testUpdateVolumesNoWaiverDecreasingVolumeST()\n {\n $hedge = $this->hedgeRepository->find(4);\n $this->hedgeVolumeManager->updateVolumesByHedge($hedge);\n\n $rmpSubSegmentRiskLevel = $this->doctrine->getRepository(RmpSubSegmentRiskLevel::class)->findOneBy([\n 'rmpSubSegment' => $hedge->getHedgeLines()->first()->getRmpSubSegment(),\n 'riskLevel' => $hedge->getHedgingTool()->getRiskLevel()\n ]);\n\n $this->assertEquals(300, $rmpSubSegmentRiskLevel->getConsumption());\n }", "public function testUpdateVolumesWaiverVolumeDecreasingVolumeNotST()\n {\n $hedge = $this->hedgeRepository->find(3);\n $this->hedgeVolumeManager->updateVolumesByHedge($hedge);\n\n $rmpSubSegmentRiskLevel = $this->doctrine->getRepository(RmpSubSegmentRiskLevel::class)->findOneBy([\n 'rmpSubSegment' => $hedge->getHedgeLines()->first()->getRmpSubSegment(),\n 'riskLevel' => $hedge->getHedgingTool()->getRiskLevel()\n ]);\n\n $this->assertEquals(2500, $rmpSubSegmentRiskLevel->getWaiverConsumption());\n\n }", "public function disStock($id,$cant){\n $product = Product:: findOrFail($id);\n\n $product->unity = $product->unity - $cant;\n\n $product->save();\n\n return $product;\n }", "public function testUpdateVolumesNoWaiverIncreasingVolumeST()\n {\n $hedge = $this->hedgeRepository->find(5);\n $this->hedgeVolumeManager->updateVolumesByHedge($hedge);\n\n $rmpSubSegmentRiskLevel = $this->doctrine->getRepository(RmpSubSegmentRiskLevel::class)->findOneBy([\n 'rmpSubSegment' => $hedge->getHedgeLines()->first()->getRmpSubSegment(),\n 'riskLevel' => $hedge->getHedgingTool()->getRiskLevel()\n ]);\n\n $this->assertEquals(0, $rmpSubSegmentRiskLevel->getConsumption());\n }", "public function saveAmount($varValue, DataContainer $dc)\n {\n // FIXME: currently a variant change is currently not possible\n \n $objApparelArticle = \\ApparelArticleModel::findByPk($dc->activeRecord->apparealArticle);\n if ($objApparelArticle->autoUpdateStock)\n {\n $oldValue = 0;\n if (is_numeric($dc->activeRecord->amount))\n {\n $oldValue = $dc->activeRecord->amount;\n }\n\n $amountDifference = $oldValue - $varValue;\n\n if ($amountDifference <> 0 && $dc instanceof \\DataContainer && $dc->activeRecord && $dc->activeRecord->apparealArticleVariant)\n {\n $objApparelArticleVariant = \\ApparelArticleVariantModel::findByPk($dc->activeRecord->apparealArticleVariant);\n if ($objApparelArticleVariant != null)\n {\n $objApparelArticleVariant->stock = $objApparelArticleVariant->stock + $amountDifference;\n $objApparelArticleVariant->save();\n\n $this->createNewVersion(\\ApparelArticleVariantModel::getTable(), $dc->activeRecord->apparealArticleVariant);\n $this->log('A new version of record \"' . \\ApparelArticleVariantModel::getTable() . '.id=' . $orderId . '\" has been created', __METHOD__, TL_GENERAL);\n }\n \n $msg = \"\";\n if ($amountDifference > 0)\n {\n $msg = $GLOBALS['TL_LANG']['MSC']['apparel_order_item_increasedStockSuccess'];\n }\n else if ($amountDifference < 0)\n {\n $msg = $GLOBALS['TL_LANG']['MSC']['apparel_order_item_decreasedStockSuccess'];\n $amountDifference = ($amountDifference * -1);\n }\n \n $objApparelArticle = \\ApparelArticleModel::findByPk($dc->activeRecord->apparealArticle);\n \n \\Message::addConfirmation(sprintf($msg, \\ApparelManagerHelper::getArticleTitleWithNumber($objApparelArticle), $objApparelArticleVariant->name, $amountDifference));\n }\n }\n\n return $varValue;\n }", "function webt_single_product_calc_amount_saved()\n{\n // The $_REQUEST contains all the data sent via ajax\n if (isset($_REQUEST) && !empty($_REQUEST['vari_id'])) {\n $percentage = 0;\n $variation_id = sanitize_text_field($_REQUEST['vari_id']);\n $variable_product = wc_get_product($variation_id);\n $regular_price = $variable_product->get_regular_price();\n $sale_price = $variable_product->get_sale_price();\n\n if (!empty($sale_price)) {\n\n $amount_saved = $regular_price - $sale_price;\n $currency_symbol = get_woocommerce_currency_symbol();\n\n $percentage = round((($regular_price - $sale_price) / $regular_price) * 100);\n }\n die($percentage);\n }\n ///\n $percentage = 0;\n $product = wc_get_product();\n $regular_price = $product->get_regular_price();\n $sale_price = $product->get_sale_price();\n\n if (!empty($sale_price)) {\n\n $amount_saved = $regular_price - $sale_price;\n $currency_symbol = get_woocommerce_currency_symbol();\n\n $percentage = round((($regular_price - $sale_price) / $regular_price) * 100);\n }\n return $percentage;\n}", "public function testUpdateVolumesNoWaiverOperationSellDecreasingVolumeWithHedgingToolCallSell()\n {\n $hedge = $this->hedgeRepository->find(6);\n $this->hedgeVolumeManager->updateVolumesByHedge($hedge);\n\n $rmpSubSegmentRiskLevel = $this->doctrine->getRepository(RmpSubSegmentRiskLevel::class)->findOneBy([\n 'rmpSubSegment' => $hedge->getHedgeLines()->first()->getRmpSubSegment(),\n 'riskLevel' => 0\n ]);\n\n $this->assertEquals(300, $rmpSubSegmentRiskLevel->getConsumption());\n }", "public function save_variation_product_data( $variation_id, $i ) {\n if ( ! isset( $_POST['security'] ) || ! wp_verify_nonce( sanitize_key( $_POST['security'] ), 'save-variations' ) ) {\n return;\n }\n\n $data = array(\n '_unit_product' => '',\n '_unit_price_auto' => '',\n '_unit_price_regular' => '',\n '_sale_price_label' => '',\n '_sale_price_regular_label' => '',\n '_unit_price_sale' => '',\n '_parent_unit_product' => '',\n '_parent_unit' => '',\n '_parent_unit_base' => '',\n '_mini_desc' => '',\n '_service' => '',\n 'delivery_time' => '',\n '_min_age' => '',\n );\n\n foreach ( $data as $k => $v ) {\n $data_k = 'variable' . ( substr( $k, 0, 1 ) === '_' ? '' : '_' ) . $k;\n $data[ $k ] = ( isset( $_POST[ $data_k ][ $i ] ) ? wc_clean( wp_unslash( $_POST[ $data_k ][ $i ] ) ) : null );\n }\n\n $product = wc_get_product( $variation_id );\n $product_parent = wc_get_product( $product->get_parent_id() );\n\n // Check if parent has unit_base + unit otherwise ignore data\n if ( empty( $data['_parent_unit'] ) || empty( $data['_parent_unit_base'] ) ) {\n $data['_unit_price_auto'] = '';\n $data['_unit_price_regular'] = '';\n $data['_unit_price_sale'] = '';\n }\n\n // If parent has no unit, delete unit_product as well\n if ( empty( $data['_parent_unit'] ) ) {\n $data['_unit_product'] = '';\n }\n\n $data['product-type'] = $product_parent->get_type();\n $data['_sale_price_dates_from'] = isset( $_POST['variable_sale_price_dates_from'][ $i ] ) ? wc_clean( wp_unslash( $_POST['variable_sale_price_dates_from'][ $i ] ) ) : '';\n $data['_sale_price_dates_to'] = isset( $_POST['variable_sale_price_dates_to'][ $i ] ) ? wc_clean( wp_unslash( $_POST['variable_sale_price_dates_to'][ $i ] ) ) : '';\n $data['_sale_price'] = isset( $_POST['variable_sale_price'][ $i ] ) ? wc_clean( wp_unslash( $_POST['variable_sale_price'][ $i ] ) ) : '';\n\n $product = WC_Germanized_Meta_Box_Product_Data::save_product_data( $product, $data, true );\n\n // store trusted shop data\n $data = array(\n '_ts_gtin' => '',\n '_ts_mpn' => '',\n );\n\n foreach ( $data as $k => $v ) {\n $data_k = 'variable' . ( substr( $k, 0, 1 ) === '_' ? '' : '_' ) . $k;\n $data[ $k ] = ( isset( $_POST[ $data_k ][ $i ] ) ? wc_clean( wp_unslash( $_POST[ $data_k ][ $i ] ) ) : null );\n }\n\n foreach ( $data as $key => $value ) {\n $product = wc_ts_set_crud_data( $product, $key, $value );\n }\n\n if ( is_object( $product ) ) {\n $product->save();\n }\n }", "function testVariationsDisabledAfterAttributeAdded() {\n\t \n\t $this->loginAs('admin');\n\t $teeshirtA = $this->objFromFixture('Product', 'teeshirtA');\n\t $variations = $teeshirtA->Variations();\n\t \n\t $this->assertTrue($variations->exists());\n\t \n\t foreach ($variations as $variation) {\n\t $this->assertTrue($variation->isEnabled());\n\t }\n\t \n\t //Add an attribute\n\t $cutAttribute = $this->objFromFixture('Attribute', 'attrCut');\n\t $existingAttributes = $teeshirtA->getManyManyComponents('Attributes');\n\t $existingAttributes->add($cutAttribute);\n\n\t $teeshirtA->writeComponents();\n\n\t //Add the default options for the new attribute\n\t $existingOptions = $teeshirtA->getComponents('Options');\n\t $defaultOptions = DataObject::get('Option', \"ProductID = 0 AND AttributeID = 4\");\n\t \n\t foreach ($defaultOptions as $option) {\n\t $existingOptions->add($option);\n\t }\n\t $teeshirtA->writeComponents();\n\n\t $teeshirtA->write();\n\n\t foreach ($teeshirtA->Variations() as $variation) {\n\t $this->assertTrue(!$variation->isEnabled());\n\t }\n\t}", "function wpsc_save_variation_set() {\n\t_deprecated_function( __FUNCTION__, '3.8');\n\treturn false;\n}", "function UPDATE_QUANTITE_PRODUIT($total_sp,$id_pp)\n{\n $sql = \"errur\";\n try {\n $con = getDatabaseConnexion();\n $requete = \"UPDATE `produit` SET `quantit`=`quantit`-'$total_sp' WHERE id='$id_pp' \";\n $stmt = $con->query($requete);\n } catch (PDOException $e) {\n echo $sql . \"<br>\" . $e->getMessage();\n }\n}", "public function save()\n {\n $this->validate(null, $this->getValidationMessages());\n\n if (! $this->manualVolume) {\n $this->variant->volume_unit = null;\n $this->variant->volume_value = null;\n }\n\n $data = $this->prepareAttributeData();\n $this->variant->attribute_data = $data;\n\n $this->variant->save();\n $this->savePricing();\n $this->updateImages();\n\n $this->updateSlots();\n\n $this->notify('Variant updated');\n }", "private function _updateUniqueOptionPrice() {\n /*$query=\"UPDATE \".DB_PREFIX.\"product p LEFT JOIN \".DB_PREFIX.\"\"\n . \"product_option_value pov ON p.product_id = pov.product_id \"\n . \"SET p.unique_option_price=IFNULL(pov.price,0) WHERE pov.option_id \"\n . \"IN (\".self::default_option_id.\",\".self::swarovski_option_id.\")\";\n $this->db->query($query);*/\n }", "function lds_travel_discounted_price($original_price,$discount){\n\n $discounted_cost = (int)$original_price-(((int)$original_price * (int)$discount)/100);\n \n return round($discounted_cost);\n\n}", "function recordSaleOrDeath($itemID, $amount, $sale_or_death, $salePrice = -1){\n\t\t\tif($this->checkAmountAvailable($itemID, $amount)){\n\t\t\t$date = date(\"Y-m-d\");\n\t\t\t$currentItemAmount = $this->getAmountItems($itemID);\n\t\t\tif($salePrice ==-1 && $sale_or_death != \"DEATH\")\n\t\t\t\t$salePrice = $this->getPlantPrice($itemID);\n\n\t\t\t$stmt = $this->con->prepare(\"INSERT INTO NEWCHANGE (itemID, userID, DateOfChange, NumChange, Sale_or_death, currentItemAmount, salePrice)\n\t\t\t\tVALUES (?,?,?,?,?,?,?)\");\n\t\t\t$stmt->bind_param(\"iisisid\", $itemID, $userID, $date, $amount, $sale_or_death, $currentItemAmount, $salePrice);\n\t\t\tif($stmt->execute())\n\t\t\t\t$this->$decreaseItemAmount($itemID, $amount);\n\n\t\t}\n\t\t/*\n\t\t* The update operation\n\t\t* When this method is called the record with the given id is updated with the new given values\n\t\t*/\n\t\tfunction updateItem($ido, $newName = \"\", $newPrice = \"\"){\n\t\t\t$orig = $this->con->prepare(\"SELECT * FROM PLANT WHERE itemID = ? \");\n\t\t\t$orig->bind_param(\"i\", $ido);\n\t\t\t$orig->execute();\n\t\t\t$orig->bind_result($id, $name, $price);\n\n\t\t\tif($newName == \"\"){\n\t\n\t\t\t}else{\n\t\t\t\t$name = $newName;\n\t\t\t}\n\n\t\t\tif($newPrice == \"\"){\n\n\t\t\t}else{\n\t\t\t\t$price = $newPrice;\n\t\t\t}\n\n\t\t\t$stmt = $this->con->prepare(\"UPDATE PLANT SET Price= ? itemName = ? WHERE itemID = ?\");\n\t\t\t\n\n\t\t\t$stmt->bind_param(\"sdi\", $price,$name, $id);\n\t\t\tif($stmt->execute())\n\t\t\t\treturn true; \n\t\t\treturn false; \n\t\t}\n\t\t/*\n\t\t* updates a plants other name if a mistake was made (e.g spelling error)\n\t\t*\n\t\t*/\n\t\tfunction updateOtherNames($id, $origName, $newName){\n\t\t\t$stmt = $this->con->prepare(\"UPDATE Plant_OtherNames SET OtherNames = ? WHERE itemID = ? and OtherNames = ?\");\n\t\t\t$stmt->bind_param(\"sis\", $newName, $id, $origName);\n\t\t\tif($stmt->execute())\n\t\t\t\treturn true; \n\t\t\treturn false; \n\n\t\t}\n\t\t/*\n\t\t* deletes other name for a plant if it was added incorrectly\n\t\t*\n\t\t*/\n\t\tfunction deleteOtherNames($id, $origName){\n\t\t\t$stmt = $this->con->prepare(\"DELETE FROM Plant_OtherNames WHERE itemID = ? and OtherNames = ?\");\n\t\t\t$stmt->bind_param(\"is\", $id, $origName);\n\t\t\tif($stmt->execute())\n\t\t\t\treturn true; \n\t\t\treturn false; \n\n\t\t}\n\t\t/*\n\t\t* if a tag is incorrectly assigned to plant, it can be removed by this fucntion\n\t\t*\n\t\t*/\n\t\tfunction deleteTags($itemID, $tagID){\n\t\t\t$stmt = $this->con->prepare(\"DELETE FROM Plant_OtherNames WHERE itemID = ? and TagID = ?\");\n\t\t\t$stmt->bind_param(\"is\", $plantID, $tagID);\n\t\t\tif($stmt->execute())\n\t\t\t\treturn true; \n\t\t\treturn false; \n\n\t\t}\n\n\t\t/*\n\t\t* makes sure itemID exists\n\t\t*\n\t\t*/\n\t\tfunction checkItemID($itemID){\n\t\t\t$stmt = $this->con->prepare(\"SELECT itemID FROM PLANT WHERE itemID = ?\");\n\t\t\t$stmt->bind_param(\"i\", $itemID);\n\t\t\t//$stmt->bind_result($itemidN);\n\t\t\t$stmt->execute();\n\n\t\t\treturn $stmt->fetch();\n\n\n\t\t}\n\t\tfunction checkAmountAvailable($itemID, $amount){\n\t\t\tif($this->checkItemID($itemID)){\n\t\t\t\t$stmt = $this->con->prepare(\"SELECT Amount FROM ITEMS_AVAILABLE WHERE itemID = ?\");\n\t\t\t\t$stmt->bind_param(\"i\", $itemID);\n\t\t\t\tif($stmt->execute()){\n\t\t\t\t\t$stmt->bind_result($amountCurrent);\n\t\t\t\t\t$stmt->fetch();\n\t\t\t\t\tif($amountCurrent >= $amount)\n\t\t\t\t\t\treturn true;\n\n\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t\treturn false;\n\t\t}\n\t\t\t/*\n\t\t* makes sure tagID exists\n\t\t*\n\t\t*/\n\t\tfunction checkTagID($tagID){\n\t\t\t$stmt = $this->con->prepare(\"SELECT TagID FROM TAGS WHERE TagID = ?\");\n\t\t\t$stmt->bind_param(\"i\", $tagID);\n\t\t\t//$stmt->bind_result($itemidN);\n\t\t\t$stmt->execute();\n\n\t\t\treturn $stmt->fetch();\n\n\t\t}\n\t\t\t/*\n\t\t* makes sure cohortID exists\n\t\t*\n\t\t*/\n\t\tfunction checkCohortID($cohortID){\n\t\t\t$stmt = $this->con->prepare(\"SELECT cohortID FROM COHORT WHERE cohortID = ?\");\n\t\t\t$stmt->bind_param(\"i\", $cohortID);\n\t\t\t//$stmt->bind_result($itemidN);\n\t\t\t$stmt->execute();\n\n\t\t\treturn $stmt->fetch();\n\t\t\n\n\t\t}\n\t\tfunction checkCohortAmount($cohortID, $amount){\n\t\t\t$stmt = $this->con->prepare(\"SELECT numInit, numDeceased, numSold FROM COHORT WHERE cohortID = ?\");\n\t\t\t$stmt->bind_param(\"i\", $cohortID);\n\t\t\t$stmt->bind_result($numInit, $numDeceased, $numSold);\n\n\t\t\tif($stmt->execute())\n\t\t\t\tif($stmt->fetch()){\n\t\t\t\t\t$depleted = $numDeceased + $numSold;\n\t\t\t\t\t$available = $numInit - $depleted;\n\n\t\t\t\t\tif($amount > $available)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t}\n\t\n\t\tfunction deactivateCohort($cohortID){\n\t\t\t$stmt = $this->con->prepare(\"UPDATE COHORT SET Active = ? WHERE cohortID = ?\");\n\t\t\t$inactive = 0;\n\t\t\t$stmt->bind_param(\"ii\", $inactive, $cohortID);\n\n\t\t\tif($stmt->execute())\n\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}\n\t\tfunction verifyEmail($email){\n\t\t\t$stmt = $this->con->prepare(\"SELECT email FROM USERS WHERE email = ?\");\n\t\t\t$stmt->bind_param(\"s\", $email);\n\t\t\t$stmt->execute();\n\n\t\t\treturn $stmt->fetch();\n\t\t\n\t\t}\n\t\t\t/*\n\t\t*\n\t\t* Add new Cohort of plant \n\t\t*\n\t\t*/\n\t\tfunction addCohort($itemID, $method, $numInit, $date = \"\", $numSold = 0, $numDeceased = 0, $active = 1, $price = -1){\n\t\t\t\n\t\t\tif($date ==\"\")\n\t\t\t\t$date = date(\"Y-m-d\");\n\t\t\tif($price == -1)\n\t\t\t\t$price = $this->getPlantPrice($itemID);\n\t\t\t$stmt = $this->con->prepare(\"INSERT INTO COHORT (itemID, DatePlanted, method, numInit, numDeceased, numSold, cohortPrice, Active) VALUES (?,?,?,?,?,?, ?)\");\n\t\t\t$stmt->bind_param(\"issiiidi\", $itemID, $date, $method,$numInit,$numDeceased, $numSold, $price, $active);\n\n\t\t\tif($stmt->execute() && $this->increaseItemAmount($itemID,$numInit))\n\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}\n\t\t/*\n\t\t*\n\t\t* records a new sale\n\t\t*\n\t\t*/\n\t\tfunction recordSale($userID, $cohortID, $amountSold, $salePrice = -1){\n\t\t\tif($this->checkAmountAvailable($itemID, $amountSold) && $this->checkCohortAmount($cohortID, $amountSold)){\n\t\t\t$itemID = $this->getitemIDFromCohort($cohortID);\n\t\t\t$date = date(\"Y-m-d\");\n\t\t\t$currentItemAmount = $this->getAmountItems($itemID);\n\t\t\t$currentCohortAmount = $this->getNumberItemsInCohort($cohortID);\n\n\t\t\tif($salePrice ==-1)\n\t\t\t\t$salePrice = $this->getPlantPrice($itemID);\n\t\t\t$stmt = $this->con->prepare(\"INSERT INTO NEWCHANGE (userID, cohortID, DateOfChange, NumChange, Sale_or_Death, currentCohortAmount, currentItemAmount, salePrice) VALUES (?,?,?,?,?, ?,?,?)\" );\n\t\t\t$sale = \"SALE\";\n\t\t\t$stmt->bind_param(\"iisisiid\", $userID, $cohortID,$date , $amountSold, $sale, $currentCohortAmount, $currentItemAmount, $salePrice);\n\t\t\tif($stmt->execute()){\n\t\t\t\t$this->decreaseItemAmount($this->getitemIDFromCohort($cohortID), $amountSold);\n\t\t\t\t$this->updateCohortStats($cohortID, $amountSold, $sale);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t}\n\t\treturn false;\n\n\n\t\t}\n\t\t/*\n\t\t*\n\t\t* bassically record Sale but with death in mind, it is redundant but helps with function calls being easy\n\t\t*\n\t\t*/\n\t\tfunction recordDeath($userID, $cohortID, $amountDead, $salePrice = -1){\n\t\t\tif($this->checkAmountAvailable($itemID, $amountSold) && $this->checkCohortAmount($cohortID, $amountSold)){\n\t\t\t$itemID = $this->getitemIDFromCohort($cohortID);\n\t\t\t$date = date(\"Y-m-d\");\n\t\t\t$currentItemAmount = $this->getAmountItems($itemID);\n\t\t\t$currentCohortAmount = $this->getNumberItemsInCohort($cohortID);\n\t\t\t\t$stmt = $this->con->prepare(\"INSERT INTO NEWCHANGE (userID, cohortID, DateOfChange, NumChange, Sale_or_Death, currentCohortAmount, currentItemAmount, salePrice) VALUES (?,?,?,?,?, ?,?,?)\" );\n\t\t\t$death = \"DEATH\";\n\t\t\t$stmt->bind_param(\"iisisiid\", $userID, $cohortID,$date , $amountSold, $death, $currentCohortAmount, $currentItemAmount, $salePrice);\n\t\t\tif($stmt->execute()){\n\t\t\t\t$this->decreaseItemAmount($this->getitemIDFromCohort($cohortID), $amountSold);\n\t\t\t\t$this->updateCohortStats($cohortID, $amountSold, $death);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t}\n\t\treturn false;\n\t\t}\n\t\t/*\n\t\t* update the cohorts information\n\t\t*\n\t\t*/\n\t\tfunction updateCohortStats($cohortID, $amount, $death_or_sale){\n\t\t\t$stmt = $this->con->prepare(\"SELECT numInit, numDeceased, numSold FROM COHORT WHERE cohortID = ?\");\n\t\t\t$updateC = $this->con->prepare(\"UPDATE COHORT SET numDeceased = ?, numSold = ? , Active = ? WHERE cohortID = ?\");\n\n\t\t\t$stmt->bind_param(\"i\", $cohortID);\n\t\t\t$stmt->bind_result($initial, $dead, $sold);\n\n\t\t\tif($stmt->execute())\n\t\t\t\tif($stmt->fetch()){\n\t\t\t\t\t$newSold = $sold;\n\t\t\t\t\t$newDead = $dead;\n\t\t\t\t\t$isActive = 1;\n\t\t\t\t\tif($death_or_sale == \"SALE\")\n\t\t\t\t\t\t$newSold += $amount;\n\t\t\t\t\t\t\n\t\t\t\t\tif($death_or_sale == \"DEATH\")\n\t\t\t\t\t\t$newDead +=$amount;\n\t\t\t\t\tif(($numInit - ($newDead + $newSold)) == 0)\n\t\t\t\t\t\t\t$isActive = 0;\n\t\t\t\t\t$updateC->bind_param(\"iiii\", $newDead, $newSold, $isActive, $cohortID);\n\n\t\t\t\t\tif($updateC->execute())\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\t\t\t\treturn false;\n\n\n\t\t}\n\t\t\t/*\n\t\t* get Cohorts \n\t\t* \n\t\t*/\n\t\tfunction getCohorts(){\n\t\t\t$stmt = $this->con->prepare(\"SELECT * FROM COHORT\");\n\t\t\t$stmt->bind_result($cohortID, $itemID, $DatePlanted, $method, $numInit, $numDeceased, $numSold, $cohortPrice, $Active );\n\t\t\t$cohorts = array();\n\t\t\tif($stmt->execute())\n\t\t\t\twhile($stmt->fetch()){\n\t\t\t\t\t$cohort = array();\n\t\t\t\t\t$cohort['cohortID'] = $cohortID;\n\t\t\t\t\t$cohort['itemID'] = $itemID;\n\t\t\t\t\t$cohort['DatePlanted'] = $DatePlanted;\n\t\t\t\t\t$cohort['method'] = $method;\n\t\t\t\t\t$cohort['numInit'] = $numInit;\n\t\t\t\t\t$cohort['numDeceased'] = $numDeceased;\n\t\t\t\t\t$cohort['numSold'] = $cohortID;\n\t\t\t\t\t$cohort['cohortPrice'] = $cohortID;\n\t\t\t\t\t$cohort['$Active'] = $Active;\n\n\t\t\t\t\tarray_push($cohorts, $cohort);\n\t\t\t\t}\n\t\t\treturn $cohorts;\n\n\n\t\t}\n\t\t\tfunction getitemIDFromCohort($cohortID){\n\t\t\t$itemIdRec = $this->con->prepare(\"SELECT itemID FROM COHORT WHERE cohortID = ?\");\n\t\t\t$itemIDRec->bind_param(\"id\", $cohortID);\n\t\t\t$itemIDRec->bind_result($itemID);\n\t\t\tif($itemIDRec->execute()){\n\t\t\t\tif($itemIDRec->fetch())\n\t\t\t\t\treturn $itemID;\n\t\t\t}\n\t\t\treturn -1;\n\n\t\t}\n\t\t\t/*\n\t\t*\n\t\t* get number of items left in cohort\n\t\t*\n\t\t*/\n\t\tfunction getNumberItemsInCohort($cohortID){\n\t\t\tif($this->checkCohortID($cohortID)){}\n\n\t\t\t$stmt = $this->con->prepare(\"SELECT numInit, numDeceased, numSold FROM COHORT WHERE cohortID = ?\");\n\t\t\t$stmt->bind_param(\"i\", $cohortID);\n\t\t\t$stmt->bind_result($numInit, $numDeceased, $numSold);\n\n\t\t\tif($stmt->execute())\n\t\t\t\tif($stmt->fetch())\n\t\t\t\t\treturn $numInit - ($numSold + $numDeceased);\n\n\t\t\treturn false;\n\n\t\t\t}\n\t\t}", "public function save_production_point($form) {\n //unless it's the first time\n $form = (object)$form;\n if ($form->id_good == 0) return -4;\n \n //get the current state of the production point\n $ppoint = $this->db->select(\"id_player, id_good, pptype_id, active, plevel\")\n ->from(\"productionpoints\")\n ->where(\"id\",$form->row_id)\n ->get()->result()[0];\n //get the production point info\n $ppcost = $this->db->select(\"conv_cost as cost\")\n ->from(\"prodpoint_types\")\n ->where(\"id\", $ppoint->pptype_id)\n ->get()->result()[0]->cost;\n \n $this->db->trans_begin();\n if (($ppoint->id_good != $form->id_good) && ($ppoint->id_good != 0)) {\n //pay the conversion if changing the production \n $cost = $ppcost * $ppoint->plevel;\n $this->db->set(\"gold\",\"gold - $cost\",false)\n ->where(\"id\", $ppoint->id_player)\n ->where(\"gold >\", $cost)\n ->update(\"players\");\n if ($this->db->affected_rows() != 1) {\n $this->db->trans_rollback();\n return -1;\n } \n }\n $ppoint->id_good = $form->id_good;\n \n if ($ppoint->plevel < $form->plevel) {\n //pay the cost of the increased level\n $cost = $ppcost * ($form->plevel - $ppoint->plevel);\n $this->db->set(\"gold\",\"gold - $cost\",false)\n ->where(\"id\", $ppoint->id_player)\n ->where(\"gold >\", $cost)\n ->update(\"players\");\n if ($this->db->affected_rows() != 1) {\n $this->db->trans_rollback();\n return -2;\n } \n }\n $ppoint->plevel = $form->plevel;\n \n $ppoint->active = $form->active;\n unset($ppoint->id_player, $ppoint->pptype_id);\n $this->db->where(\"id\", $form->row_id)\n ->update(\"productionpoints\", $ppoint);\n if ($this->db->affected_rows() != 1) {\n $this->db->trans_rollback();\n return -3;\n } \n $this->db->trans_commit();\n return 1;\n }", "function ovacrs_price_special_time( $product_id, $rent_time, $key_rt ){\n\n \n $ovacrs_rt_startdate = get_post_meta( $product_id, 'ovacrs_rt_startdate', true );\n $ovacrs_rt_price = get_post_meta( $product_id, 'ovacrs_rt_price', true );\n $ovacrs_rt_price_hour = get_post_meta( $product_id, 'ovacrs_rt_price_hour', true );\n $ovacrs_rt_discount = get_post_meta( $product_id, 'ovacrs_rt_discount', true );\n\n $price_type = get_post_meta( $product_id, 'ovacrs_price_type', true );\n \n if( $ovacrs_rt_startdate[$key_rt] ){\n \n \n\n\n // Check if PickUp Date bettwen date of Range Time\n if( $price_type == 'day' ){\n\n $rt_price = $ovacrs_rt_price[$key_rt];\n // Return ST Price Discount\n if( isset( $ovacrs_rt_discount[$key_rt] ) ){\n $ovacrs_rt_discount_duration_val = $ovacrs_rt_discount[$key_rt]['duration'];\n arsort($ovacrs_rt_discount_duration_val);\n\n $ovacrs_rt_discount_duration_type = $ovacrs_rt_discount[$key_rt]['duration_type'];\n $ovacrs_rt_discount_duration_price = $ovacrs_rt_discount[$key_rt]['price'];\n $st_set_price = set_price_by_rt_discount($ovacrs_rt_discount_duration_val, $ovacrs_rt_discount_duration_type, $ovacrs_rt_discount_duration_price, $price_type='days', $rent_time['rent_time_day'] );\n $rt_price = $st_set_price != false ? $st_set_price : $rt_price;\n }\n\n return $rt_price;\n \n\n }else if( $price_type == 'hour' ){\n\n $rt_price = $ovacrs_rt_price_hour[$key_rt];\n\n // Set Price by RT(ST) Discount\n if( isset( $ovacrs_rt_discount[$key_rt] ) ){\n $ovacrs_rt_discount_duration_val = $ovacrs_rt_discount[$key_rt]['duration'];\n arsort($ovacrs_rt_discount_duration_val);\n $ovacrs_rt_discount_duration_type = $ovacrs_rt_discount[$key_rt]['duration_type'];\n $ovacrs_rt_discount_duration_price = $ovacrs_rt_discount[$key_rt]['price'];\n $st_set_price = set_price_by_rt_discount( $ovacrs_rt_discount_duration_val, $ovacrs_rt_discount_duration_type, $ovacrs_rt_discount_duration_price, $price_type='hours', $rent_time['rent_time_hour'] );\n $rt_price = $st_set_price != false ? $st_set_price : $rt_price;\n }\n\n return $rt_price;\n\n }else{ // Price type is Mixed\n\n if( $rent_time['rent_time_day_raw'] < 1 ){\n\n $rt_price = $ovacrs_rt_price_hour[$key_rt];\n // Set Price by RT(ST) Discount\n if( isset( $ovacrs_rt_discount[$key_rt] ) ){\n $ovacrs_rt_discount_duration_val = $ovacrs_rt_discount[$key_rt]['duration'];\n arsort($ovacrs_rt_discount_duration_val);\n $ovacrs_rt_discount_duration_type = $ovacrs_rt_discount[$key_rt]['duration_type'];\n $ovacrs_rt_discount_duration_price = $ovacrs_rt_discount[$key_rt]['price'];\n $st_set_price = set_price_by_rt_discount( $ovacrs_rt_discount_duration_val, $ovacrs_rt_discount_duration_type, $ovacrs_rt_discount_duration_price, $price_type='hours', $rent_time['rent_time_hour'] );\n $rt_price = $st_set_price != false ? $st_set_price : $rt_price;\n }\n\n return $rt_price;\n\n }else{\n\n $rt_price = $ovacrs_rt_price[$key_rt];\n // Set Price by RT(ST) Discount\n if( isset( $ovacrs_rt_discount[$key_rt] ) ){\n $ovacrs_rt_discount_duration_val = $ovacrs_rt_discount[$key_rt]['duration'];\n arsort($ovacrs_rt_discount_duration_val);\n\n $ovacrs_rt_discount_duration_type = $ovacrs_rt_discount[$key_rt]['duration_type'];\n $ovacrs_rt_discount_duration_price = $ovacrs_rt_discount[$key_rt]['price'];\n $st_set_price = set_price_by_rt_discount( $ovacrs_rt_discount_duration_val, $ovacrs_rt_discount_duration_type, $ovacrs_rt_discount_duration_price, $price_type='days', $rent_time['rent_time_day'] );\n $rt_price = $st_set_price != false ? $st_set_price : $rt_price;\n }\n\n return $rt_price;\n\n }\n }\n \n } // endif\n}", "function product_sale_price()\n{\n\tglobal $site;\n\t\n\t$sale_start = $site['timestamp'];\n\t$sale_expire = $site['timestamp'] + 90*24*60*60;\n\t\n\tupdate('products')\n\t\t->values(array($_POST['field']=>$_POST['value'],\n\t\t\t\t\t 'sale_start'=>$sale_start,\n\t\t\t\t\t 'sale_expire'=>$sale_expire))\n\t\t->where('product_id = '.$_POST['id']);\n\t\n\treturn true;\n}", "public function save()\n {\n $this->validate(null, $this->getValidationMessages());\n\n if ($this->image) {\n if ($this->image instanceof Media) {\n $this->image->copy($this->variant, 'variants');\n $this->image->setCustomProperty('primary', true);\n $this->image->save();\n }\n if ($this->image instanceof TemporaryUploadedFile) {\n $this->validateOnly('image', ['image' => 'image']);\n $media = $this->variant->addMedia($this->image->getRealPath())\n ->preservingOriginal()\n ->toMediaCollection('variants');\n $media->setCustomProperty('primary', true);\n $media->save();\n }\n }\n\n if ($this->removeImage) {\n $image = $this->variant->media()->first();\n if ($image) {\n $image->forceDelete();\n }\n }\n\n if (! $this->manualVolume) {\n $this->variant->volume_unit = null;\n $this->variant->volume_value = null;\n }\n\n $data = $this->prepareAttributeData();\n $this->variant->attribute_data = $data;\n\n $this->variant->save();\n $this->savePricing();\n $this->image = null;\n // $this->variant->refresh();\n $this->removeImage = false;\n\n $this->updateSlots();\n\n $this->notify('Variant updated');\n }", "public function afterVat()\n {\n return $this->totalPrice() * config('qalzam.vat');\n }", "public function admin_change() {\n\t foreach($this->Stock->find('all') as $top){\n $rand = $top['Stock']['value'] + (rand(1,100)-50)/100;\n $data = array('id' => $top['Stock']['id'], 'value' => $rand ,\n 'variation' => $rand - $top['Stock']['yesterday']);\n $this->Stock->save($data);\n }\n\n $this->Session->setFlash(__('Stocks changed'));\n $this->redirect(array('controller' => 'func', 'action' => 'index'));\n\t}", "private function hitungDValueNegatif()\n {\n for ($i=0; $i < count($this->m_keputusan); $i++) {\n $arr = [];\n foreach ($this->m_keputusan[$i] as $key => $value) {\n if ($key == 'nama') {\n $arr[$key] = $value;\n } elseif ($key == 'id') {\n $arr[$key] = $value;\n } else {\n $hasil = $value - $this->k_negatif[$key];\n $arr[$key] = pow($hasil,2);\n }\n }\n $this->d_value_n[] = $arr;\n }\n // echo \"Langkah 6<br><br>\";\n // print_r($this->d_value_n);\n }", "public function save() \r\n\t{\r\n\t\tif (count($this->newOptions) > 0) {\r\n\t\t\r\n\t\t\tforeach ($this->newOptions as $option) {\r\n\t\t\t\t\r\n\t\t\t\t$label = array(\r\n\t\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t\t\"store_id\" => array(\"0\"),\r\n\t\t\t\t\t\t\t\t\"value\" => $option->label\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\t$data = array(\r\n\t\t\t\t\t\t\"label\" => $label,\r\n\t\t\t\t\t\t\"order\" => \"0\",\r\n\t\t\t\t\t\t\"is_default\" => \"0\"\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\t$result = $this->client->catalogProductAttributeAddOption($this->sessionid, $this->attribute, $data);\r\n\t\t\t\t\r\n\t\t\t\t$this->log->addInfo('enviado', array(\"label\" => $option->label, \"result\" => $result));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// e agora apagar as opcoes que nao existem\r\n\t\tif (count($this->delOptions) > 0) {\r\n\t\t\t\t\r\n\t\t\tforeach ($this->delOptions as $option) {\r\n\t\t\r\n\t\t\t\t$result = $this->client->catalogProductAttributeRemoveOption($this->sessionid, $this->attribute, $option->value);\r\n\t\t\r\n\t\t\t\t$this->log->addInfo('apagado', array(\"label\" => $option->label, \"result\" => $result));\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\t// se houve modificacoes no magento, destruimos a cache\r\n\t\tif (count($this->delOptions) > 0 || count($this->newOptions) > 0) { $this->destroyCache(); }\r\n\t}", "private function _productWithOption($labour_cost, $unique_option_price, $metal_price) {\n $my_final_price = $labour_cost+$unique_option_price*$metal_price;\n if(!$this->db->query(\"UPDATE oc_product set price = $my_final_price ,is_updated= 1 where product_id = $this->current_product_id AND model != 'grouped'\")) {\n //echo mysql_error().\"<br>\"; \n echo \"price \".$my_final_price.\"<br>\";\n echo \"prod_id \".$this->current_product_id;\n // die('here');\n }\n }", "function subtractPrizeOfDB($quantity, $type) {\n\n $query = mysqli_query(\"SELECT `prize_type`, prize_id, `prize_amount` FROM `prizes` WHERE `type` = '$type'\");\n $result = $query->fetch_assoc();\n $subtract_priza = $result['prize_amount'] - $quantity;\n $id_prize = $result['prize_id'];\n mysqli_query(\"UPDATE `prizes` SET `prize_amount` = $subtract_priza WHERE `prize_id` = $id_prize\");\n \n }", "public function testPrice(): void\n {\n $expected = $actual = 42.42;\n\n self::assertSame($this->article, $this->article->setPrice($actual));\n self::assertSame($expected, $this->article->getPrice());\n }", "protected function getPriceOriginalValue()\n\t{\n\t\t$price_original = $this->input('price_original');\n\n\t\treturn $price_original > 0 ? $price_original : $this->input('price');\n\t}", "public function save()\n {\n $this->withValidator(function (Validator $validator) {\n $validator->after(function ($validator) {\n if ($validator->errors()->count()) {\n $this->notify(\n __('adminhub::validation.generic'),\n level: 'error'\n );\n }\n // dd(1);\n });\n })->validate(null, $this->getValidationMessages());\n\n $isNew = ! $this->product->id;\n\n DB::transaction(function () use ($isNew) {\n $data = $this->prepareAttributeData();\n $variantData = $this->prepareAttributeData($this->variantAttributes);\n\n $this->product->attribute_data = $data;\n\n $this->product->save();\n\n if (($this->getVariantsCount() <= 1) || $isNew) {\n if (! $this->variant->product_id) {\n $this->variant->product_id = $this->product->id;\n }\n\n if (! $this->manualVolume) {\n $this->variant->volume_unit = null;\n $this->variant->volume_value = null;\n }\n\n $this->variant->attribute_data = $variantData;\n\n $this->variant->save();\n\n if ($isNew) {\n $this->savePricing();\n }\n }\n\n // We generating variants?\n $generateVariants = (bool) count($this->optionValues) && ! $this->variantsDisabled;\n\n if ($generateVariants) {\n GenerateVariants::dispatch($this->product, $this->optionValues);\n }\n\n if (! $generateVariants && $this->product->variants->count() <= 1 && ! $isNew) {\n // Only save pricing if we're not generating new variants.\n $this->savePricing();\n }\n\n $this->saveUrls();\n\n $this->product->syncTags(\n collect($this->tags)\n );\n\n $this->updateImages($this->product);\n\n $channels = collect($this->availability['channels'])->mapWithKeys(function ($channel) {\n return [\n $channel['channel_id'] => [\n 'starts_at' => ! $channel['enabled'] ? null : $channel['starts_at'],\n 'ends_at' => ! $channel['enabled'] ? null : $channel['ends_at'],\n 'enabled' => $channel['enabled'],\n ],\n ];\n });\n\n $gcAvailability = collect($this->availability['customerGroups'])->mapWithKeys(function ($group) {\n $data = Arr::only($group, ['starts_at', 'ends_at']);\n\n $data['purchasable'] = $group['status'] == 'purchasable';\n $data['visible'] = in_array($group['status'], ['purchasable', 'visible']);\n $data['enabled'] = $group['status'] != 'hidden';\n\n return [\n $group['customer_group_id'] => $data,\n ];\n });\n\n $this->product->customerGroups()->sync($gcAvailability);\n\n $this->product->channels()->sync($channels);\n\n if (count($this->associationsToRemove)) {\n ProductAssociation::whereIn('id', $this->associationsToRemove)->delete();\n }\n\n $this->associations->each(function ($assoc) {\n if (! empty($assoc['id'])) {\n ProductAssociation::find($assoc['id'])->update([\n 'type' => $assoc['type'],\n ]);\n\n return;\n }\n\n ProductAssociation::create([\n 'product_target_id' => $assoc['inverse'] ? $this->product->id : $assoc['target_id'],\n 'product_parent_id' => $assoc['inverse'] ? $assoc['target_id'] : $this->product->id,\n 'type' => $assoc['type'],\n ]);\n });\n\n $this->product->collections()->detach(\n $this->collectionsToDetach->pluck('id')\n );\n\n $this->collections->each(function ($collection) {\n $this->product->collections()\n ->syncWithoutDetaching(\n $collection['id'],\n ['position' => $collection['position']]\n );\n });\n\n $this->updateSlots();\n\n $this->product->refresh();\n\n $this->variantsEnabled = $this->getVariantsCount() > 1;\n\n $this->syncAvailability();\n\n $this->dispatchBrowserEvent('remove-images');\n\n $this->variant = $this->product->variants->first();\n\n $this->notify('Product Saved');\n });\n\n if ($isNew) {\n return redirect()->route('hub.products.show', [\n 'product' => $this->product->id,\n ]);\n }\n }" ]
[ "0.600373", "0.5779003", "0.57241565", "0.5655029", "0.56032526", "0.55580556", "0.5546349", "0.55253327", "0.54652077", "0.5458507", "0.53769565", "0.53106827", "0.5271078", "0.5263365", "0.52428204", "0.5196479", "0.5187409", "0.5172843", "0.51714724", "0.5133971", "0.5110689", "0.5076337", "0.5047458", "0.50376296", "0.5034849", "0.50268084", "0.5022093", "0.5021519", "0.5015523", "0.50047" ]
0.8221343
0
Load the required dependencies for this plugin. Include the following files that make up the plugin: Orchestrates the hooks of the plugin. Bitwise_Sidebar_Content_i18n. Defines internationalization functionality. Bitwise_Sidebar_Content_Admin. Defines all hooks for the admin area. Bitwise_Sidebar_Content_Public. Defines all hooks for the public side of the site. Create an instance of the loader which will be used to register the hooks with WordPress.
private function load_dependencies() { /** * The class responsible for defining internationalization functionality * of the plugin. */ require_once __DIR__ . '/class-bitwise-sidebar-content-i18n.php'; /** * The class responsible for handling DB operations */ require_once __DIR__ . '/class-bitscr-data-store.php'; require_once __DIR__ . '/class-bitscr-common.php'; /** * The class responsible for defining all actions that occur in the admin area. */ require_once dirname( __DIR__ ) . '/admin/class-bitwise-sidebar-content-admin.php'; $this->admin = Bitwise_Sidebar_Content_Admin::get_instance(); /** * The class responsible for creating required tables if they are missing */ require_once __DIR__ . '/class-bitwise-sidebar-content-db.php'; require_once __DIR__ . '/class-bitscr-content-table.php'; require_once __DIR__ . '/class-bitscr-course.php'; $this->bitscr_courses = Bitscr_Course::get_instance(); require_once __DIR__ . '/class-bitwise-sc-content.php'; $this->bit_sc_content = Bitwise_SC_Content::get_instance(); /** * The class responsible for defining all actions that occur in the public-facing * side of the site. */ require_once dirname( __DIR__ ) . '/public/class-bitwise-sidebar-content-public.php'; $this->public = Bitwise_Sidebar_Content_Public::get_instance(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function load_dependencies() {\n\n /**\n * The class responsible for orchestrating the actions and filters of the core plugin.\n */\n require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-junglehunter-loader.php';\n\n /**\n * The class responsible for defining all actions that occur in the admin area.\n */\n require_once plugin_dir_path(dirname(__FILE__)) . 'admin/class-junglehunter-admin.php';\n\n /**\n * The class responsible for defining all actions that occur in the rest endpoint.\n */\n require_once plugin_dir_path(dirname(__FILE__)) . 'rest/class-junglehunter-rest.php';\n\n /**\n * The class responsible for defining all actions that occur in the database\n */\n require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-junglehunter-database.php';\n\n $this->loader = new Junglehunter_Loader();\n }", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-mp-books-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining internationalization functionality\n\t\t * of the plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-mp-books-i18n.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-mp-books-admin.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public-facing\n\t\t * side of the site.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-mp-books-public.php';\n\n\t\t$this->loader = new MP_Books_Loader();\n\n\t}", "private function load_dependencies()\n {\n\n /**\n * The class responsible for orchestrating the actions and filters of the\n * core plugin.\n */\n require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-flo-launch-loader.php';\n\n /**\n * The class responsible for defining internationalization functionality\n * of the plugin.\n */\n require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-flo-launch-i18n.php';\n\n /**\n * The class responsible for defining all actions that occur in the admin area.\n */\n require_once plugin_dir_path(dirname(__FILE__)) . 'admin/class-flo-launch-admin.php';\n\n /**\n * The class responsible for defining all actions that occur in the public-facing\n * side of the site.\n */\n require_once plugin_dir_path(dirname(__FILE__)) . 'public/class-flo-launch-public.php';\n\n $this->loader = new Flo_Launch_Loader();\n\n }", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wp-primary-category-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining internationalization functionality\n\t\t * of the plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wp-primary-category-i18n.php';\n\n\t\t/**\n\t\t * The class responsible for enqueuing all the assets.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wp-primary-category-assets.php';\n\n\t\t/**\n\t\t * The class responsible for implementing the UI to change the primary category\n\t\t * in the categories metabox.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wp-primary-category-admin.php';\n\n\t\t$this->loader = new WP_Primary_Category_Loader();\n\n\t}", "function load() {\n\t\t\t$this->constants();\n\t\t\t/* hook into WordPress */\n\t\t\t$this->hooks();\n\t\t\t/* include the required admin files */\n\t\t\t$this->admin_includes();\n\t\t}", "private function load_dependencies()\n {\n // The class responsible for orchestrating the actions and filters of the core plugin.\n require_once plugin_dir_path(dirname(__FILE__)).'includes/class-special-offer-loader.php';\n\n // The class responsible for defining internationalization functionality of the plugin.\n require_once plugin_dir_path(dirname(__FILE__)).'includes/class-special-offer-i18n.php';\n\n // The class responsible for defining all actions that occur in the admin area.\n require_once plugin_dir_path(dirname(__FILE__)).'admin/class-special-offer-admin.php';\n\n // The class responsible for defining all actions that occur in the public-facing side of the site.\n require_once plugin_dir_path(dirname(__FILE__)).'public/class-special-offer-public.php';\n\n // The class responsible for defining all actions that occur in the public-facing side of the site.\n require_once plugin_dir_path(dirname(__FILE__)).'includes/class-special-offer-data.php';\n\n $this->loader = new Special_Offer_Loader();\n }", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-sepa-traderiq-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining internationalization functionality\n\t\t * of the plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-sepa-traderiq-i18n.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-sepa-traderiq-admin.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public-facing\n\t\t * side of the site.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-sepa-traderiq-public.php';\n\n\t\t$this->loader = new Sepa_Traderiq_Loader();\n\n\t}", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-akamai-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-akamai-admin.php';\n\n\t\t$this->loader = new Akamai_Loader();\n\n\t}", "private function load_dependencies() {\n\n /**\n * The class responsible for orchestrating actions that occur in the public-facing\n * side of the site.\n */\n require_once LAST_WORD_PLUGIN_DIR . 'PublicController.php';\n\n /**\n * The abstract superclass responsible for my last word slur.\n */\n require_once self::WPLW_MY_LAST_WORD_DIR . '/MyLastWord.php';\n\n /**\n * The concrete subclasses responsible for my last word post and shortcode views\n */\n require_once self::WPLW_MY_LAST_WORD_DIR . '/MyLastWordPostContent.php';\n require_once self::WPLW_MY_LAST_WORD_DIR . '/MyLastWordShortcode.php';\n\n\n }", "private function load_dependencies() {\n\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-single-post-meta-manager-admin.php';\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-single-post-meta-manager-public.php';\n\n\t\trequire_once plugin_dir_path( __FILE__ ) . 'class-single-post-meta-manager-loader.php';\n\t\t$this->loader = new Single_Post_Meta_Manager_Loader();\n\n\t}", "public function load() {\n\t\tif ( function_exists('bbpress') ) {\n\t\t\t$this->setup_globals();\n\t\t\t$this->includes();\n\t\t\t$this->setup_actions();\n\t\t} else {\n\t\t\tadd_action( 'admin_notices', array(__CLASS__, 'need_bbpress') );\n\t\t}\n\t}", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-pressapps-fullscreen-login-loader.php';\n\n\t\t/**\n\t\t * The Helpers responsible for defining all functions in both\n\t\t * side of the site.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/pressapps-fullscreen-login-helpers.php';\n\n\t\t/**\n\t\t * The class responsible for defining internationalization functionality\n\t\t * of the plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-pressapps-fullscreen-login-i18n.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-pressapps-fullscreen-login-admin.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public-facing\n\t\t * side of the site.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-pressapps-fullscreen-login-public.php';\n\n\t\t/**\n\t\t * Load Recaptcha\n\t\t */\n\t\tif ( ! class_exists( 'PAFL_Captcha' ) ){\n\t\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/lib/recaptcha/Captcha.php';\n\t\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/lib/recaptcha/Exception.php';\n\t\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/lib/recaptcha/Response.php';\n\t\t}\n\n\t\tif ( ! class_exists( 'Hybrid_Auth' ) ) {\n\t\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/lib/hybridauth/Hybrid/Auth.php';\n\t\t}\n\n\t\t$this->loader = new Pressapps_Fullscreen_Login_Loader();\n\t}", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-onyx-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining internationalization functionality\n\t\t * of the plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-onyx-i18n.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-onyx-admin.php';\n\t\t/**\n\t\t * The class responsible for defining all actions related to setting pages.\n\t\t */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-onyx-setting-pages.php';\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public-facing\n\t\t * side of the site.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-onyx-public.php';\n\n\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-onyx-admin-api-sync.php';\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-onyx-admin-api-terms-sync.php';\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-onyx-admin-api-product-sync.php';\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-onyx-wpml-product-sync.php';\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-onyx-admin-api-orders-sync.php';\n\n\n\t\t$this->loader = new Onyx_Loader();\n\n\t}", "private function load_dependencies(): void\n {\n require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-product-documentation-plugin-loader.php';\n require_once plugin_dir_path(dirname(__FILE__)) . 'admin/class-product-documentation-plugin-admin.php';\n\n $this->loader = new Product_Documentation_Plugin_Loader();\n }", "public function hooks() {\n\t\tdefine( 'THEMEISLE_COMPANION_VERSION', '2.0.0' );\n\t\tif ( $this->is_zerif() ) {\n\t\t\t$this->loader->add_action( 'widgets_init', $this, 'zerif_register_widgets' );\n\t\t}\n\n\n\n\t\tif ( $this->is_hestia() ) {\n\t\t\t$this->loader->add_action( 'after_setup_theme', $this, 'hestia_require' );\n\t\t\t$this->loader->add_action( 'after_setup_theme', $this, 'hestia_fix_duplicate_widgets' );\n\t\t\t$this->loader->add_action( 'wp_enqueue_scripts', $this, 'hestia_enqueue_clients_style' );\n\t\t\t$this->loader->add_filter( 'hestia_clients_bar_default_content', $this, 'hestia_load_clients_default_content' );\n\t\t\t$this->loader->add_filter( 'hestia_top_bar_alignment_default', $this, 'hestia_top_bar_default_alignment' );\n\t\t\t$this->loader->add_action( 'customize_register', $this, 'hestia_require_customizer', 0 );\n\t\t\t$this->loader->add_action( 'after_switch_theme', $this, 'hestia_set_front_page' );\n\t\t}\n\n\t\tif ( $this->is_hestia_pro() ) {\n\t\t\t$this->loader->add_action( 'after_setup_theme', $this, 'hestia_fix_duplicate_widgets' );\n\t\t\t$this->loader->add_filter( 'hestia_clients_bar_default_content', $this, 'hestia_load_clients_default_content' );\n\t\t\t$this->loader->add_filter( 'hestia_top_bar_alignment_default', $this, 'hestia_top_bar_default_alignment' );\n\t\t}\n\n\t\tif ( $this->is_shop_isle() ) {\n\t\t\trequire_once $this->inc_dir . 'shop-isle' . DIRECTORY_SEPARATOR . 'functions.php';\n\t\t}\n\t}", "public function __construct() {\n\t\tif ( defined( 'BITWISE_SIDEBAR_CONTENT_VERSION' ) ) {\n\t\t\t$this->version = BITWISE_SIDEBAR_CONTENT_VERSION;\n\t\t} else {\n\t\t\t$this->version = '1.0.0';\n\t\t}\n\t\t$this->plugin_name = 'bitwise-sidebar-content';\n\n\t\t$this->load_dependencies();\n\t\t$this->set_locale();\n\t\t$this->define_admin_hooks();\n\t\t$this->define_public_hooks();\n\t}", "public function init()\n\t{\n\t\t$this->bridge->do_action($this->plugin_key . '_pre_init');\n\n\t\t$this->build_constants();\n\t\t$this->init_shared_properties();\n\t\t$this->init_properties();\n\t\t$this->init_load_libraries();\n\t\t$this->init_update_plugin();\n\t\t$this->init_hooks();\n\t\t$this->register_framework_media();\n\t\t$this->enqueue_media();\n\n\t\tif ($this->is_admin_page())\n\t\t{\n\t\t\t// @since rev 164 enqueue common javascript when inside an admin\n\t\t\t// page by default\n\t\t\t$this->bridge->wp_enqueue_script('bwp-op');\n\n\t\t\t// @since rev 164 split the sidebar\n\t\t\t$this->bridge->add_action('bwp_option_action_before_main', array($this, 'show_sidebar_right'), 12);\n\t\t\t$this->bridge->add_action('bwp_option_action_before_tabs', array($this, 'show_header'), 12);\n\t\t}\n\n\t\t$this->bridge->do_action($this->plugin_key . '_loaded');\n\t}", "private static function load_dependencies() {\n $plugin_dir = plugin_dir_path(dirname(__FILE__));\n\n /**\n * The class responsible for defining internationalization functionality\n * of the plugin.\n */\n require_once $plugin_dir . 'includes/class-ptb-extra-i18n.php';\n\n // The classes of metaboxes\n require_once $plugin_dir . 'includes/class-ptb-cmb-map.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-video.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-audio.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-slider.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-gallery.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-file.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-event-date.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-rating.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-progress-bar.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-icon.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-telephone.php';\n do_action('ptb_extra_loaded');\n }", "private function define_admin_hooks() {\n $admin = new Admin\\Admin();\n $login = new Admin\\Login();\n $editor = new Admin\\Editor();\n $widget = new Admin\\Widget();\n $media = new Admin\\Media();\n $menu = new Menu\\Menu();\n\n // Admin.\n $this->loader->add_action( 'login_enqueue_scripts', $admin, 'enqueue_styles' );\n $this->loader->add_action( 'admin_enqueue_scripts', $admin, 'enqueue_styles', 50 );\n $this->loader->add_filter( 'get_user_option_admin_color', $admin, 'set_admin_color_based_on_env' );\n $this->loader->add_action( 'admin_enqueue_scripts', $admin, 'enqueue_scripts' );\n\n // Login page.\n $this->loader->add_filter( 'login_headerurl', $login, 'custom_login_url' );\n\n // Editor.\n $this->loader->add_action( 'admin_init', $editor, 'add_editor_styles' );\n\n // Widgets.\n $this->loader->add_action( 'widgets_init', $widget, 'register_widget_position' );\n\n // Menu.\n $this->loader->add_action( 'after_setup_theme', $menu, 'register_menu_positions' );\n\n // Media.\n $this->loader->add_action( 'upload_mimes', $media, 'enable_mime_types' );\n $this->loader->add_action( 'wp_prepare_attachment_for_js', $media, 'enable_svg_library_preview', 10, 3 );\n $this->loader->add_action( 'after_setup_theme', $media, 'add_theme_support' );\n $this->loader->add_action( 'after_setup_theme', $media, 'add_custom_image_sizes' );\n $this->loader->add_filter( 'wp_handle_upload_prefilter', $media, 'check_svg_on_media_upload' );\n }", "private function load_dependencies() {\n\n\t\t/**\n\t\t * This file contains the common helper functions.\n\t\t */\n\t\trequire_once( RTMEDIA_TRANSCODING_PATH . 'includes/rtmedia-transcoding-functions.php' );\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core plugin.\n\t\t */\n\t\trequire_once( RTMEDIA_TRANSCODING_PATH . 'includes/class-rtmedia-transcoding-loader.php' );\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once( RTMEDIA_TRANSCODING_PATH . 'admin/class-rtmedia-transcoding-admin.php' );\n\n\t\t/**\n\t\t * The class responsible for settings page content\n\t\t */\n\t\trequire_once( RTMEDIA_TRANSCODING_PATH . 'admin/class-rtmedia-transcoding-admin-settings.php' );\n\n\t\t/**\n\t\t * The class responsible for all the core functionality\n\t\t */\n\t\trequire_once( RTMEDIA_TRANSCODING_PATH . 'includes/class-rtmedia-transcoding-process.php' );\n\n\t\t$this->loader = new RTMedia_Transcoding_Loader();\n\t}", "private function load_dependencies()\n {\n $this->loader = new ActionAndFiltersLoader();\n }", "public static function load_dependencies() {\n\t\t\t\t\t\t\n\t\t//Load route right away so we can optimize dependency loading below\n\t\tHeadway::load(array('common/route' => true));\t\t\n\t\t\t\t\t\t\n\t\t//Core loading set\n\t\t$dependencies = array(\n\t\t\t'defaults/default-design-settings',\n\n\t\t\t'data/data-options' => 'Option',\n\t\t\t'data/data-layout-options' => 'LayoutOption',\n\t\t\t'data/data-skin-options',\n\t\t\t'data/data-blocks',\n\t\t\t'data/data-wrappers',\n\t\t\t'data/data-snapshots',\n\n\t\t\t'common/layout' => true,\n\t\t\t'common/capabilities' => true,\n\t\t\t'common/responsive-grid' => true,\n\t\t\t'common/seo' => true,\n\t\t\t'common/social-optimization' => true,\n\t\t\t'common/feed' => true,\n\t\t\t'common/compiler' => true,\n\t\t\t'common/templates',\n\t\t\t\t\t\t\n\t\t\t'admin/admin-bar' => true,\t\t\n\t\t\t\n\t\t\t'api/api-panel',\n\n\t\t\t'updater/plugin-updater',\n\t\t\t'updater/theme-updater',\n\t\t\t\t\n\t\t\t'blocks' => true,\n\t\t\t'wrappers' => true,\n\t\t\t'elements' => true,\n\n\t\t\t'fonts/web-fonts-api',\n\t\t\t'fonts/web-fonts-loader' => true,\n\t\t\t'fonts/traditional-fonts',\n\t\t\t'fonts/google-fonts',\n\t\t\t\t\t\t\n\t\t\t'display' => true,\n\n\t\t\t'widgets' => true,\n\n\t\t\t'compatibility/woocommerce/compatibility-woocommerce' => 'CompatibilityWooCommerce'\n\t\t);\n\t\t\n\t\t//Child theme API\n\t\tif ( HEADWAY_CHILD_THEME_ACTIVE === true )\n\t\t\t$dependencies['api/api-child-theme'] = 'ChildThemeAPI';\n\t\t\n\t\t//Visual editor classes\n\t\tif ( HeadwayRoute::is_visual_editor() || (defined('DOING_AJAX') && DOING_AJAX && strpos($_REQUEST['action'], 'headway') !== false ) )\n\t\t\t$dependencies['visual-editor'] = true;\n\n\t\t//Admin classes\n\t\tif ( is_admin() )\n\t\t\t$dependencies['admin'] = true;\n\t\t\t\n\t\t//Load stuff now\n\t\tHeadway::load(apply_filters('headway_dependencies', $dependencies));\n\t\t\n\t\tdo_action('headway_setup');\n\n\t}", "private function load_dependencies() {\n\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-cognito-login-loader.php';\t\t\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-cognito-login-shortcodes.php';\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-cognito-login-admin.php';\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-cognito-login-settings.php';\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-cognito-login-public.php';\t\t\n\n\t\t$this->loader = new Cognito_Login_Loader();\n\t\t$this->shortcodes = new Cognito_Login_Shortcodes( $this->get_plugin_name(), $this->get_version() );\n\t}", "private function load_dependencies() {\n $this->enqueue_scripts();\n if( ( get_option('enabled_features')['shortcuts'] == true ) ){ \n $this->add_shortcuts();\n }\n if( ( get_option('enabled_features')['command_pallete'] == true ) ){ \n $this->add_command_pallete();\n }\n }", "function oik_loader_loaded() {\n\n\tadd_action( \"run_oik-loader.php\", \"oik_loader_run_oik_loader\");\n\tadd_action( \"oik_admin_menu\", \"oik_loader_oik_admin_menu\");\n\tadd_action( \"oik_admin_loaded\", \"oik_loader_oik_admin_loaded\");\n\n}", "private function load_dependencies() {\n // Admin Panel\n if (is_admin()) {\n require_once ZGPBLD_DIR . '/classes/zgpbld-base-module.php';\n require_once ZGPBLD_DIR . '/classes/zgpbld-helper.php';\n require_once ZGPBLD_DIR . '/classes/zgpbld-bootstrap.php';\n require_once ZGPBLD_DIR . '/classes/zigapage-notice.php';\n }\n\n // Front-End Site\n if (!is_admin()) {\n require_once ZGPBLD_DIR . '/classes/zgpbld-base-module.php';\n require_once ZGPBLD_DIR . '/classes/zgpbld-helper.php';\n require_once ZGPBLD_DIR . '/classes/zgpbld-bootstrap.php';\n }\n }", "function load_dependencies(){\n wp_register_script(\n 'dependencies-script',\n get_template_directory_uri() . '/js/block-dependencies.js',\n array( 'wp-blocks', 'wp-element', 'wp-editor', 'wp-components' )\n );\n\n wp_enqueue_script( 'dependencies-script' );\n}", "private function plugin_loader(){\n include dirname( __FILE__ ) . '/class-autoloader.php';\n ClassAutoloader::run();\n PluginLoader::get_instance( $this );\n }", "public function load_includes() {\n\t\t\n\t\trequire_once( GW_GO_PORTFOLIO_INCLUDES . 'functions.php' );\n\t\trequire_once( GW_GO_PORTFOLIO_INCLUDES . 'class_gw_metabox.php' );\n\n\t}", "public function __construct(){\r\n\t\t\t$this->get_settings();\r\n\t\t\tif($this->loader_enabled()){\r\n\t\t\t\tadd_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));\r\n\t\t\t\tadd_action('wp_head', array($this, 'loader_custom_styles'), 100);\r\n\t\t\t\tadd_action('wp_footer',\tarray($this, 'show_loader_html'));\r\n\t\t\t}\r\n\t\t}" ]
[ "0.7474064", "0.7451972", "0.73659074", "0.73358226", "0.7300118", "0.72747207", "0.71815056", "0.712079", "0.7017519", "0.7013282", "0.6998914", "0.6906815", "0.68324083", "0.6814386", "0.6796892", "0.67566335", "0.6704421", "0.6616456", "0.660708", "0.6597814", "0.6591994", "0.6516746", "0.65157133", "0.6510322", "0.65099525", "0.6496569", "0.64727014", "0.64356315", "0.64323175", "0.6379359" ]
0.78439367
0
Define the locale for this plugin for internationalization. Uses the Bitwise_Sidebar_Content_i18n class in order to set the domain and to register the hook with WordPress.
private function set_locale() { $plugin_i18n = new Bitwise_Sidebar_Content_i18n(); add_action( 'plugins_loaded', array( $plugin_i18n, 'load_plugin_textdomain' ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function set_locale() {\r\n\r\n\t\t$plugin_i18n = new ShipArea_i18n();\r\n\t\t$plugin_i18n->set_domain( 'shiparea' );\r\n\r\n\t\tadd_action( 'plugins_loaded', [ $plugin_i18n, 'load_plugin_textdomain' ] );\r\n\t}", "private function set_locale() {\n\t\t$etc_i18n = new i18n;\n\t\t$etc_i18n->set_domain( self::PLUGIN_ID );\n\n\t\tadd_action( 'plugins_loaded', array( $etc_i18n, 'load_plugin_textdomain' ) );\n\t}", "private function set_locale() {\n\n\t\t$plugin_i18n = new Pressapps_Fullscreen_Login_i18n();\n\t\t$plugin_i18n->set_domain( $this->get_plugin_name() );\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "private function set_locale() {\n $plugin_i18n = new Internationalization();\n\n $this->loader->add_action( 'after_setup_theme', $plugin_i18n, 'load_theme_textdomain' );\n }", "private function set_locale() {\n\n\t\t$plugin_i18n = new WP_Primary_Category_I18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "private static function set_locale() {\n\n $plugin_i18n = new PTB_Extra_i18n();\n $plugin_i18n->set_domain(self::$plugin_name);\n $plugin_i18n->load_plugin_textdomain();\n }", "private function set_locale()\n {\n\n $plugin_i18n = new Flo_Launch_i18n();\n\n $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');\n\n }", "private function set_locale()\n {\n $plugin_i18n = new PluginI18n();\n $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');\n }", "private function set_locale()\n {\n $plugin_i18n = new Special_Offer_i18n();\n $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');\n }", "private function set_locale() {\n\n\t\t$plugin_i18n = new Onyx_i18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "private function set_locale() {\r\n\r\n\t\t$plugin_i18n = new Blossomthemes_Email_Newsletter_i18n();\r\n\r\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\r\n\r\n\t}", "private function set_locale() {\n\n\t\t$plugin_i18n = new H4mpy_Npm_i18n();\n\n\t\t$this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');\n\n\t}", "private function setLocale() {\n\n add_action( 'plugins_loaded', array( $this, 'load_plugin_textdomain'));\n }", "private function set_locale() {\n\n\t\t$plugin_i18n = new Sepa_Traderiq_i18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "private function set_locale() {\n\n\t\t$plugin_i18n = new MP_Books_i18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "function bbp_plugin_locale($locale = '', $domain = '')\n{\n}", "private function set_locale() {\n\n\t\t$plugin_i18n = new WP_Carousel_Pro_i18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "private function set_locale() {\n\t\t\tload_plugin_textdomain( PAS_SLUG, false, PAS_GLOBAL_DIR . 'language' );\n\t }", "public function localization_setup() {\r\n\t\t//load_plugin_textdomain( 'fs-pods-repeater-field', false, basename( dirname( __FILE__ ) ) . '/languages' );\t\r\n\t}", "function i18n() {\n\t$locale = apply_filters( 'plugin_locale', get_locale(), 'jw-login-page-customizer' );\n\tload_textdomain( 'jw-login-page-customizer', WP_LANG_DIR . '/jw-login-page-customizer/jw-login-page-customizer-' . $locale . '.mo' );\n\tload_plugin_textdomain( 'jw-login-page-customizer', false, plugin_basename( JW_LOGIN_PAGE_CUSTOMIZER_PATH ) . '/languages/' );\n}", "function wp_rest_api_controller_text_domain_init() {\n\tload_plugin_textdomain( 'wp-rest-api-controller', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );\n}", "function themeprefix_acf_localize_fields_when_exporting() {\n acf_update_setting( 'l10n_textdomain', 'theme_domain' );\n}", "function widget_with_layouts_init_lang(){\r\n\tload_plugin_textdomain('widget-with-layouts', false, dirname( plugin_basename( __FILE__ ) ). '/language/');\r\n}", "public function i18n() {\n\n // Set filter for plugin's languages directory\n $lang_dir = ZGPBLD_DIR . '/i18n/languages/';\n $lang_dir = apply_filters('rockfm_languages_directory', $lang_dir);\n\n $lang_domain = 'zgpbd_admin';\n $lang_domain = apply_filters('rockfm_languages_domain', $lang_domain);\n \n // Traditional WordPress plugin locale filter\n $locale = apply_filters('plugin_locale', get_locale(), 'zgpb_page_builder');\n $mofile = sprintf('%1$s-%2$s.mo', 'wpzgpb', $locale);\n\n // Setup paths to current locale file\n $mofile_local = $lang_dir . $mofile;\n \n if (file_exists($mofile_local)) {\n \n // Look in local /wp-content/plugins/wpbp/languages/ folder\n load_textdomain($lang_domain, $mofile_local);\n } else {\n // Load the default language files - but this is not working for some reason\n load_plugin_textdomain($lang_domain, false, dirname(plugin_basename(__FILE__)) . '/i18n/languages/');\n }\n }", "public function localization_setup() {\n\t\tload_plugin_textdomain( '{%= function_prefix %}', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );\n\t}", "public function load_localisation() {\n\t\tload_plugin_textdomain( 'mild-notify', false, dirname( plugin_basename( $this->file ) ) . '/lang/' );\n\t}", "public function localization_setup() {\n load_plugin_textdomain( 'event-calendar-pro', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );\n }", "function gus_ui_init() {\n\t$locale = apply_filters( 'plugin_locale', get_locale(), 'gus_ui' );\n\tload_textdomain( 'gus_ui', WP_LANG_DIR . '/gus_ui/gus_ui-' . $locale . '.mo' );\n\tload_plugin_textdomain( 'gus_ui', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );\n\n}", "public function localization_setup() {\n load_plugin_textdomain( 'snhotel', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );\n }", "function handle_load_domain() {\r\n // get current language\r\n $locale = get_locale ();\r\n // locate translation file\r\n $mofile = WP_PLUGIN_DIR . '/' . plugin_basename ( dirname ( __FILE__ ) ) . '/lang/' . $this->plugin_domain . '-' . $locale . '.mo';\r\n // load translation\r\n load_textdomain ( $this->plugin_domain, $mofile );\r\n }" ]
[ "0.75849015", "0.7494329", "0.7456553", "0.73431945", "0.72670114", "0.72350305", "0.7174119", "0.71540743", "0.7116089", "0.7115153", "0.70934576", "0.70363265", "0.7021727", "0.70196664", "0.6943411", "0.6901608", "0.68872786", "0.676701", "0.66999954", "0.6593145", "0.65754294", "0.6507043", "0.6434491", "0.6423632", "0.6382619", "0.6377504", "0.6370185", "0.63306487", "0.63226897", "0.6300009" ]
0.7956903
0
Register all of the hooks related to the admin area functionality of the plugin.
private function define_admin_hooks() { $plugin_admin = $this->admin; add_action( 'admin_enqueue_scripts', array( $plugin_admin, 'enqueue_styles' ) ); add_action( 'admin_enqueue_scripts', array( $plugin_admin, 'enqueue_scripts' ) ); add_action( 'admin_menu', array( $plugin_admin, 'admin_sidebar_menu' ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function define_admin_hooks() {\n\n\t\t$plugin_admin = new Pressapps_Fullscreen_Login_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\t\t$this->loader->add_action( 'admin_init', \t\t $plugin_admin, 'register_wp_menu_links' );\n\t\t\n\n\t}", "private function define_admin_hooks()\n {\n $plugin_admin = new Special_Offer_Admin();\n\n $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles');\n $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts');\n $this->loader->add_action('add_meta_boxes', $plugin_admin, 'metaboxes', 10, 2);\n $this->loader->add_action('save_post', $plugin_admin, 'save', 1,2);\n $this->loader->add_action('init', $plugin_admin, 'so_tinymce_admin_head');\n $this->loader->add_filter('mce_external_plugins', $plugin_admin, 'tinymce_plugin');\n $this->loader->add_filter('mce_buttons', $plugin_admin, 'tinymce_button');\n }", "private function define_admin_hooks() {\n $plugin_admin = new Junglehunter_Admin($this->get_plugin_name(), $this->get_version());\n\n $this->loader->add_action('admin_menu', $plugin_admin, 'junglehunter_add_menus');\n $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'junglehunter_enqueue_styles');\n $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'junglehunter_enqueue_scripts');\n }", "private function define_admin_hooks() {\n\n\t\t$plugin_admin = new Cognito_Login_Admin( $this->get_plugin_name(), $this->get_version() );\t\t\n\n\t\t$this->loader->add_action( 'admin_menu', $plugin_admin, 'add_menu_items');\n\t\t$this->loader->add_action( 'admin_init', $plugin_admin, 'create_settings');\t\t\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_admin_styles');\n\t}", "private function define_admin_hooks()\n {\n $plugin_admin = new Kajuta_Shelter_Admin(\n $this->get_kajuta_shelter(),\n $this->get_version()\n );\n\n /*$this->loader->add_action(\n 'admin_enqueue_scripts',\n $plugin_admin,\n 'enqueue_styles'\n );\n $this->loader->add_action(\n 'admin_enqueue_scripts',\n $plugin_admin,\n 'enqueue_scripts'\n );*/\n\n $this->loader->add_action('init', $plugin_admin, 'register_post');\n }", "private function define_admin_hooks()\n {\n\n $plugin_admin = new Flo_Launch_Admin($this->get_plugin_name(), $this->get_version());\n\n $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles');\n $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts');\n\n }", "private function define_admin_hooks(): void\n {\n $plugin_admin = new Product_Documentation_Plugin_Admin($this->plugin_name);\n\n $this->loader->add_action('add_meta_boxes', $plugin_admin, 'add_new_meta_box');\n }", "private function define_admin_hooks() {\n\n\t\t$plugin_admin = new Sepa_Traderiq_Admin( $this->get_sepa_traderiq(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\n\t}", "private function define_admin_hooks() {\n\n\t\t$admin = new Single_Post_Meta_Manager_Admin( $this->get_version() );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $admin, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'add_meta_boxes', $admin, 'add_meta_box' );\n\n\t}", "private function define_admin_hooks() {\r\n\r\n\t\t$plugin_admin = new Blossomthemes_Email_Newsletter_Admin( $this->get_plugin_name(), $this->get_version() );\r\n\r\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\r\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\r\n\t\t$this->loader->add_action( 'init', $plugin_admin, 'blossomthemes_register_form' );\r\n\t\t$this->loader->add_action( 'admin_menu', $plugin_admin, 'blossomthemes_email_newsletter_settings_page' );\r\n\t\t$this->loader->add_action( 'admin_init', $plugin_admin, 'blossomthemes_email_newsletter_register_settings' );\r\n\t\t$this->loader->add_filter('pll_get_post_types', $plugin_admin, 'add_subscribe_form_cpt_to_pll', 10, 2);\r\n\t}", "private function define_admin_hooks() {\n $admin = new Admin\\Admin();\n $login = new Admin\\Login();\n $editor = new Admin\\Editor();\n $widget = new Admin\\Widget();\n $media = new Admin\\Media();\n $menu = new Menu\\Menu();\n\n // Admin.\n $this->loader->add_action( 'login_enqueue_scripts', $admin, 'enqueue_styles' );\n $this->loader->add_action( 'admin_enqueue_scripts', $admin, 'enqueue_styles', 50 );\n $this->loader->add_filter( 'get_user_option_admin_color', $admin, 'set_admin_color_based_on_env' );\n $this->loader->add_action( 'admin_enqueue_scripts', $admin, 'enqueue_scripts' );\n\n // Login page.\n $this->loader->add_filter( 'login_headerurl', $login, 'custom_login_url' );\n\n // Editor.\n $this->loader->add_action( 'admin_init', $editor, 'add_editor_styles' );\n\n // Widgets.\n $this->loader->add_action( 'widgets_init', $widget, 'register_widget_position' );\n\n // Menu.\n $this->loader->add_action( 'after_setup_theme', $menu, 'register_menu_positions' );\n\n // Media.\n $this->loader->add_action( 'upload_mimes', $media, 'enable_mime_types' );\n $this->loader->add_action( 'wp_prepare_attachment_for_js', $media, 'enable_svg_library_preview', 10, 3 );\n $this->loader->add_action( 'after_setup_theme', $media, 'add_theme_support' );\n $this->loader->add_action( 'after_setup_theme', $media, 'add_custom_image_sizes' );\n $this->loader->add_filter( 'wp_handle_upload_prefilter', $media, 'check_svg_on_media_upload' );\n }", "protected function define_admin_hooks() {\n $this->loader->add_action( 'admin_menu', $this->settings, 'register_menu_page' );\n $this->loader->add_action( 'admin_init', $this->settings, 'register_setting' );\n $this->loader->add_action( 'admin_notices', $this->settings, 'admin_notices' );\n $this->loader->add_action( 'admin_enqueue_scripts', $this->settings, 'enqueue_scripts_and_styles', 10, 1 );\n $this->loader->add_filter( 'plugin_action_links_' . TRP_PLUGIN_BASE , $this->settings, 'plugin_action_links', 10, 1 );\n $this->loader->add_action( 'trp_settings_navigation_tabs', $this->settings, 'add_navigation_tabs' );\n $this->loader->add_action( 'trp_language_selector', $this->settings, 'languages_selector', 10, 1 );\n\n\t $this->loader->add_action( 'trp_settings_tabs', $this->advanced_tab, 'add_advanced_tab_to_settings', 10, 1 );\n\t $this->loader->add_action( 'admin_menu', $this->advanced_tab, 'add_submenu_page_advanced' );\n\t $this->loader->add_action( 'trp_output_advanced_settings_options', $this->advanced_tab, 'output_advanced_options' );\n\t $this->loader->add_action( 'trp_before_output_advanced_settings_options', $this->advanced_tab, 'trp_advanced_settings_content_table' );\n\t $this->loader->add_action( 'admin_init', $this->advanced_tab, 'register_setting' );\n\t $this->loader->add_action( 'admin_notices', $this->advanced_tab, 'admin_notices' );\n\n //Machine Translation tab\n $this->loader->add_action( 'trp_settings_tabs', $this->machine_translation_tab, 'add_tab_to_navigation', 10, 1 );\n $this->loader->add_action( 'admin_menu', $this->machine_translation_tab, 'add_submenu_page' );\n $this->loader->add_action( 'admin_init', $this->machine_translation_tab, 'register_setting' );\n $this->loader->add_action( 'admin_notices', $this->machine_translation_tab, 'admin_notices' );\n\n //Machine Translation Logger defaults\n $this->loader->add_action( 'trp_machine_translation_sanitize_settings', $this->machine_translator_logger, 'sanitize_settings', 10, 1 );\n\n //Error manager hooks\n $this->loader->add_action( 'admin_init', $this->error_manager, 'show_notification_about_errors', 10 );\n $this->loader->add_action( 'admin_menu', $this->error_manager, 'register_submenu_errors_page', 10 );\n $this->loader->add_action( 'trp_dismiss_notification', $this->error_manager, 'clear_notification_from_db', 10, 2 );\n $this->loader->add_filter( 'trp_machine_translation_sanitize_settings', $this->error_manager, 'clear_disable_machine_translation_notification_from_db', 10, 1 );\n $this->loader->add_filter( 'trp_error_manager_page_output', $this->error_manager, 'show_instructions_on_how_to_fix', 7, 1 );\n $this->loader->add_filter( 'trp_error_manager_page_output', $this->error_manager, 'output_db_errors', 10, 1 );\n\n $this->loader->add_action( 'wp_ajax_nopriv_trp_get_translations_regular', $this->editor_api_regular_strings, 'get_translations' );\n\n\t $this->loader->add_action( 'wp_ajax_trp_get_translations_regular', $this->editor_api_regular_strings, 'get_translations' );\n $this->loader->add_action( 'wp_ajax_trp_save_translations_regular', $this->editor_api_regular_strings, 'save_translations' );\n $this->loader->add_action( 'wp_ajax_trp_split_translation_block', $this->editor_api_regular_strings, 'split_translation_block' );\n $this->loader->add_action( 'wp_ajax_trp_create_translation_block', $this->editor_api_regular_strings, 'create_translation_block' );\n\n\t $this->loader->add_action( 'wp_ajax_trp_get_translations_gettext', $this->editor_api_gettext_strings, 'gettext_get_translations' );\n\t $this->loader->add_action( 'wp_ajax_trp_save_translations_gettext', $this->editor_api_gettext_strings, 'gettext_save_translations' );\n\n $this->loader->add_action( 'wp_ajax_trp_get_similar_string_translation', $this->translation_memory, 'ajax_get_similar_string_translation' );\n\n\t $this->loader->add_filter( 'trp_get_existing_translations', $this->translation_manager, 'display_possible_db_errors', 20, 3 );\n $this->loader->add_action( 'wp_ajax_trp_save_editor_user_meta', $this->translation_manager, 'save_editor_user_meta', 10 );\n\n\n $this->loader->add_action( 'wp_ajax_trp_process_js_strings_in_translation_editor', $this->translation_render, 'process_js_strings_in_translation_editor' );\n $this->loader->add_filter( 'trp_skip_selectors_from_dynamic_translation', $this->translation_render, 'skip_base_attributes_from_dynamic_translation', 10, 1 );\n\n\n\t $this->loader->add_action( 'admin_menu', $this->upgrade, 'register_menu_page' );\n\t $this->loader->add_action( 'admin_init', $this->upgrade, 'show_admin_notice' );\n\t $this->loader->add_action( 'admin_enqueue_scripts', $this->upgrade, 'enqueue_update_script', 10, 1 );\n\t $this->loader->add_action( 'wp_ajax_trp_update_database', $this->upgrade, 'trp_update_database' );\n\n $this->loader->add_action( 'wp_ajax_trp_install_plugins', $this->install_plugins, 'install_plugins_request' );\n\n /* add hooks for license operations */\n if( !empty( $this->active_pro_addons ) ) {\n $this->loader->add_action('admin_init', $this->plugin_updater, 'activate_license');\n $this->loader->add_filter('pre_set_site_transient_update_plugins', $this->plugin_updater, 'check_license');\n $this->loader->add_action('admin_init', $this->plugin_updater, 'deactivate_license');\n $this->loader->add_action('admin_notices', $this->plugin_updater, 'admin_activation_notices');\n }\n\n /* add license page */\n global $trp_license_page;//this global was used in the addons, so we need to use it here also so we don't initialize the license page multiple times (backward compatibility)\n if( !isset( $trp_license_page ) ) {\n $trp_license_page = $this->license_page;\n $this->loader->add_action('admin_menu', $this->license_page, 'license_menu');\n }\n\n }", "private function define_admin_hooks() {\n\t\t$plugin_admin = new Akamai_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\n\t\t$this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_admin_menu' );\n\n\n\t\t// Add Settings link to the plugin\n\t\t$plugin_basename = plugin_basename( plugin_dir_path( __DIR__ ) . $this->plugin_name . '.php' );\n\t\t$this->loader->add_filter( 'plugin_action_links_' . $plugin_basename, $plugin_admin, 'add_action_links' );\n\n\t\t// Save/Update our plugin options\n\t\t$this->loader->add_action( 'admin_init', $plugin_admin, 'options_update' );\n\n\t\t// Validate Credentials AJAX\n\t\t$this->loader->add_action( 'wp_ajax_akamai_verify_credentials', $plugin_admin, 'verify_credentials' );\n\n\t\t// Purging Actions/Hooks\n\t\t$this->loader->add_action( 'save_post', $this, 'purgeOnPost' );\n\t\t$this->loader->add_action( 'comment_post', $this, 'purgeOnComment', 10, 3 );\n\t\t$this->loader->add_action( 'transition_comment_status', $this, 'purgeOnCommentStatus', 10, 3 );\n\t\t$this->loader->add_action( 'wp_trash_post', $this, 'purgeOnPost' );\n\t\t$this->loader->add_action( 'admin_notices', $this, 'admin_notices' );\n\t\t$this->loader->add_action( 'send_headers', $this, 'sendHeaders' );\n\t}", "private function define_admin_hooks() {\n\n\t\t$plugin_admin = new H4mpy_Npm_Admin($this->get_h4mpy_npm(), $this->get_version());\n\n\t\t$this->loader->add_action('admin_menu', $plugin_admin, 'menu');\n\t}", "private function define_admin_hooks()\n {\n $plugin_admin = new AdminTasks($this->get_mtii_utilities_plugin_name(), $this->get_version());\n $reg_utilities_admin = new UserFunctionsInAdminArea($this->get_mtii_utilities_plugin_name(), $this->get_version());\n $ajax_class = new AjaxCallsUtilities($this->get_mtii_utilities_plugin_name(), $this->get_version());\n $admin_page_creation = new AdminPages($this->get_mtii_utilities_plugin_name(), $this->get_version());\n $mtii_cron_tasks = new CronTasks($this->get_mtii_utilities_plugin_name(), $this->get_version());\n $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles');\n $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts');\n $this->loader->add_action('after_setup_theme', $plugin_admin, 'remove_admin_bar');\n $this->loader->add_action('user_new_form', $reg_utilities_admin, 'mtii_utilities_admin_reg_form');\n $this->loader->add_action('user_profile_update_errors', $reg_utilities_admin, 'mtii_utilities_profile_update_errors', 10, 3);\n $this->loader->add_action('show_user_profile', $reg_utilities_admin, 'mtii_utilities_show_extra_profile_fields');\n $this->loader->add_action('edit_user_profile', $reg_utilities_admin, 'mtii_utilities_show_extra_profile_fields');\n $this->loader->add_action('admin_menu', $admin_page_creation, 'mtii_utilities_create_menu_page');\n $this->loader->add_action('admin_menu', $admin_page_creation, 'mtii_utilities_admin_settings');\n $this->loader->add_action(\"wp_ajax_mtii_signed_doc_approval\", $ajax_class, \"mtii_signed_doc_approval\");\n $this->loader->add_action(\"wp_ajax_mtii_signed_doc_disapproval\", $ajax_class, \"mtii_signed_doc_disapproval\");\n $this->loader->add_action(\"wp_ajax_get_org_details_coop_or_ngo\", $ajax_class, \"get_org_details_coop_or_ngo\");\n $this->loader->add_action(\"wp_ajax_nopriv_get_org_details_coop_or_ngo\", $ajax_class, \"please_login\");\n $this->loader->add_action(\"wp_ajax_nopriv_mtii_signed_doc_approval\", $ajax_class, \"please_login\");\n $this->loader->add_action(\"wp_ajax_nopriv_mtii_signed_doc_disapproval\", $ajax_class, \"please_login\");\n $this->loader->add_action(\"admin_notices\", $plugin_admin, \"author_admin_notice\");\n $this->loader->add_action(\"init\", $mtii_cron_tasks, \"mtii_schedule_daily_cron_task\");\n $this->loader->add_action(\"josbiz_mtii_daily_tasks\", $mtii_cron_tasks, \"mtii_daily_tasks_scheduler\");\n\n /**\n * ============================================================\n * Filters\n * ============================================================\n */\n $this->loader->add_filter('wp_mail_from', $plugin_admin, 'wpb_sender_email');\n $this->loader->add_filter('wp_mail_from_name', $plugin_admin, 'wpb_sender_name');\n $this->loader->add_filter(\n 'plugin_action_links_'.MTII_UTILITIES_PLUGIN_NAME.'/'.MTII_UTILITIES_PLUGIN_NAME.'.php',\n $plugin_admin, 'mtii_utilities_action_links'\n );\n $this->loader->add_filter('cron_schedules', $mtii_cron_tasks, 'mtii_custom_cron_schedules');\n\n }", "private function define_admin_hooks() {\n\t\t$onyx_admin_orders_sync_Class = new Onyx_Admin_API_Orders_Sync( $this->get_plugin_name(), $this->get_version() );\n\t\t$onyx_API_Sync_Class = new Onyx_Admin_API_Sync( $this->get_plugin_name(), $this->get_version() );\n\t\t$onyx_admin_pages = new Onyx_Settings_Pages( $this->get_plugin_name(), $this->get_version() );\n\t\t$plugin_admin = new Onyx_Admin( $this->get_plugin_name(), $this->get_version() );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\t\t$this->loader->add_action( 'admin_menu', $plugin_admin, 'personalised_menu' );\n\t\t$this->loader->add_action( 'admin_init', $onyx_admin_pages, 'register_onyx_plugin_settings');\n\t\t$this->loader->add_action( 'woocommerce_product_data_tabs', $plugin_admin, 'wc_onyx_product_tab' );\n\t\t$this->loader->add_action( 'woocommerce_product_data_panels', $plugin_admin, 'wc_onyx_product_panel' );\n\t\t$this->loader->add_action( 'woocommerce_process_product_meta', $plugin_admin, 'wc_onyx_process_product_options' );\n $this->loader->add_action('onyx_erp_schedule_sync', $onyx_admin_pages,'process_erp_sync_job');\n\t\t$this->loader->add_action( 'product_cat_edit_form_fields',$onyx_admin_pages, 'product_cat_taxonomy_custom_fields', 10, 2 );\n\t\t$this->loader->add_action( 'woocommerce_admin_order_data_after_billing_address', $onyx_admin_orders_sync_Class,'onyx_display_order_erp_id', 10, 1 );\n\t\t$this->loader->add_action( 'init', $plugin_admin,'register_onyx_erp_posted_order_status' );\n $this->loader->add_action( 'user_register', $plugin_admin,'onyx_post_user_data_to_erp', 10,1 );\n $this->loader->add_action( 'profile_update', $plugin_admin,'onyx_post_user_data_to_erp', 10,2 );\n\t}", "private function define_admin_hooks() {\n\t\t$plugin_admin = new RTMedia_Transcoding_Admin( $this->get_plugin_name(), RTMEDIA_TRANSCODING_VERSION );\n\t\t$this->loader->add_action( 'admin_menu', $plugin_admin, 'rtmedia_transcoding_add_page' );\n\t\t$this->loader->add_action( 'admin_init', $plugin_admin, 'admin_init' );\n\t\t$this->loader->add_action( 'admin_init', $plugin_admin->settings_page, 'save_api_key' );\n\t\t$this->loader->add_action( 'wp_ajax_rtmedia_free_encoding_subscribe', $plugin_admin->settings_page, 'free_encoding_subscribe' );\n\t\t$this->loader->add_action( 'wp_ajax_rtm_disable_transcoding', $plugin_admin->settings_page, 'disable_encoding' );\n\t\t$this->loader->add_action( 'wp_ajax_rtm_enable_transcoding', $plugin_admin->settings_page, 'enable_encoding' );\n\t\t$this->loader->add_action( 'wp_ajax_rtm_unsubscribe_transcoding', $plugin_admin->settings_page, 'unsubscribe_service' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\t}", "private function register_admin_actions() {\n // add the admin panel\n $admin_controller = self::get_controller( 'Admin' );\n laterpay_event_dispatcher()->add_subscriber( $admin_controller );\n\n $settings_controller = self::get_controller( 'Admin_Settings' );\n laterpay_event_dispatcher()->add_subscriber( $settings_controller );\n\n // plugin backend\n $controller = self::get_controller( 'Admin_Pricing' );\n laterpay_event_dispatcher()->add_subscriber( $controller );\n\n $controller = self::get_controller( 'Admin_Notice' );\n laterpay_event_dispatcher()->add_subscriber( $controller );\n\n $controller = self::get_controller( 'Admin_Appearance' );\n laterpay_event_dispatcher()->add_subscriber( $controller );\n\n $controller = self::get_controller( 'Admin_Account' );\n laterpay_event_dispatcher()->add_subscriber( $controller );\n\n $controller = self::get_controller( 'Admin_Advanced' );\n laterpay_event_dispatcher()->add_subscriber( $controller );\n\n laterpay_event_dispatcher()->add_subscriber( self::get_controller( 'Admin_TinyMCE' ) );\n\n laterpay_event_dispatcher()->add_subscriber( self::get_controller( 'Admin_Contributions' ) );\n\n // register callbacks for adding meta_boxes\n $post_metabox_controller = self::get_controller( 'Admin_Post_Metabox' );\n laterpay_event_dispatcher()->add_subscriber( $post_metabox_controller );\n\n $column_controller = self::get_controller( 'Admin_Post_Column' );\n laterpay_event_dispatcher()->add_subscriber( $column_controller );\n\n // Make sure block registration is possible.\n if ( function_exists( 'register_block_type' ) ) {\n // register block editor blocks.\n laterpay_event_dispatcher()->add_subscriber( self::get_controller( 'Admin_Post_Blocks' ) );\n }\n }", "private function define_admin_hooks() {\n\n\t\t$plugin_admin = new WP_Carousel_Pro_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_admin_styles' );\n\n\t\t$this->loader->add_filter( 'post_updated_messages', $plugin_admin, 'wpcp_carousel_updated_messages', 10, 2 );\n\t\t$this->loader->add_filter( 'manage_sp_wp_carousel_posts_columns', $plugin_admin, 'filter_carousel_admin_column' );\n\t\t$this->loader->add_action( 'manage_sp_wp_carousel_posts_custom_column', $plugin_admin, 'display_carousel_admin_fields', 10, 2 );\n\t\t$this->loader->add_action( 'admin_action_sp_wpcp_duplicate_carousel', $plugin_admin, 'sp_wpcp_duplicate_carousel' );\n\t\t$this->loader->add_filter( 'post_row_actions', $plugin_admin, 'sp_wpcp_duplicate_carousel_link', 10, 2 );\n\t\t$this->loader->add_filter( 'admin_footer_text', $plugin_admin, 'sp_wpcp_review_text', 10, 2 );\n\n\t\t// Help Page.\n\t\t$help_page = new WP_Carousel_Pro_Help( $this->get_plugin_name(), $this->get_version() );\n\t\t$this->loader->add_action( 'admin_menu', $help_page, 'help_admin_menu', 40 );\n\t\t$this->loader->add_filter( 'plugin_action_links', $help_page, 'add_plugin_action_links', 10, 2 );\n\n\t}", "public function hooks()\n\t\t{\t\t\t\n\t\t\t\n\t\t\tadd_action( 'admin_menu', array( $this, 'menu' ) );\n\n\t\t}", "public function hooks()\n\t\t{\n\n\t\t\tadd_action( 'admin_menu', array( $this, 'menu' ) );\n\t\t}", "public function registerHookCallbacks() {\r\n\r\n\t\t\tadd_action( 'plugins_loaded', array( $this, 'init' ), 1 );\r\n\t\t\tif ( is_admin() ) {\r\n\t\t\t\tadd_action( 'admin_init', array( $this, 'process_admin_swicher' ) );\r\n\t\t\t\tadd_action( 'admin_bar_menu', __CLASS__ . '::adminLanguageSwitcher', 999 );\r\n\t\t\t\tadd_action( 'zwt_language_switcher', array( $this, 'zwt_language_switcher_temp' ), 1 );\r\n\t\t\t} else {\r\n\r\n\t\t\t\tif ( $this->ls_settings[ 'show_footer_selector' ] ) {\r\n\t\t\t\t\tadd_action( 'wp_footer', array( $this, 'language_selector_footer' ), 19 );\r\n\t\t\t\t}\r\n\t\t\t\tif ( !empty( $this->ls_settings[ 'alt_lang_availability' ] ) ) {\r\n\t\t\t\t\tadd_filter( 'the_content', array( $this, 'post_availability' ), 100 );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ( !is_admin() ) {\r\n\t\t\t\tadd_action( 'wp_head', array( $this, 'custom_language_switcher_style' ), 20 );\r\n\t\t\t\tadd_action( 'wp_head', array( $this, 'add_header_lang_links' ) );\r\n\t\t\t}\r\n\t\t}", "public function register_hooks() {\n\t\t\\add_action( 'admin_init', [ $this, 'auto_update_notification_not_if_dismissed' ] );\n\t\t\\add_action( 'update_site_option_auto_update_core_major', [ $this, 'auto_update_notification_even_if_dismissed' ] );\n\t\t\\add_action( 'update_site_option_auto_update_plugins', [ $this, 'auto_update_notification_not_if_dismissed' ] );\n\t}", "public function admin_hooks()\n {\n wp_enqueue_script('apf-admin-script', APF_URL . 'includes/Admin/Assets/js/admin.js', array('jquery'), '1.0.0', true);\n wp_localize_script('apf-admin-script', 'apfAjax', array('ajaxurl' => admin_url('admin-ajax.php'), 'apfurl' => APF_URL));\n wp_enqueue_style('apf-admin-style', APF_URL . 'includes/Admin/Assets/css/admin.css');\n }", "public function hooks() {\n\t\tadd_action( 'plugins_loaded', array( $this, 'write' ) );\n\t\tadd_action( 'admin_init', array( $this, 'deactivate' ) );\n\t\tadd_action( 'admin_notices', array( $this, 'admin_notices' ) );\n\t}", "private function define_admin_hooks() {\n\n\t\t$plugin_admin = new MP_Books_Admin( $this->get_plugin_name(), $this->get_version() );\n\t\t$plugin_custom_post_type_mp_book = new Custom_Post_Type_MP_Book($this->get_plugin_name(), $this->get_version());\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\t\t// register all custom widgets\n\t\t$this->loader->add_action( 'widgets_init', $plugin_admin, 'register_all_widgets' );\n\n\t\t// Custom Post Type - MP_Book functions\n\t\t$this->loader->add_action( 'init', $plugin_custom_post_type_mp_book, 'register_custom_post_type_mp_book' );\n\t\t$this->loader->add_action( 'add_meta_boxes', $plugin_custom_post_type_mp_book, 'register_mp_book_meta_boxes' );\n\t\t$this->loader->add_action( 'post_edit_form_tag', $plugin_custom_post_type_mp_book, 'update_edit_form' ); // allow form to upload files\n\t\t$this->loader->add_action( 'save_post', $plugin_custom_post_type_mp_book, 'save_book_data', 10 , 1 ); // this will only save if the post type is 'mp_book'. Use 'save_post' for any other post type.\n\n\t\t// epub mime types - as wp doesn't support this for uploading\n\t\t$this->loader->add_filter( 'upload_mimes', $plugin_custom_post_type_mp_book, 'mp_ebook_mime_types1', 1, 1);\n\t\t$this->loader->add_filter( 'upload_mimes', $plugin_custom_post_type_mp_book, 'mp_ebook_mime_types2');\n\t\t$this->loader->add_filter( 'upload_mimes', $plugin_custom_post_type_mp_book, 'mp_ebook_mime_types3');\n\n\t}", "function shibboleth_admin_hooks() {\n\tif ( defined( 'WP_ADMIN' ) && WP_ADMIN === true ) {\n\t\trequire_once __DIR__ . '/options-admin.php';\n\t\trequire_once __DIR__ . '/options-user.php';\n\t}\n}", "public function register_hook_callbacks() {\n global $wp_version;\n\n\n\n add_action('admin_menu', array(&$this, 'loadMenu'));\n\n //add lang dir\n add_filter('rockfm_languages_directory', array(&$this, 'rockfm_lang_dir_filter'));\n add_filter('rockfm_languages_domain', array(&$this, 'rockfm_lang_domain_filter'));\n add_filter('plugin_locale', array(&$this, 'rockfm_lang_locale_filter'));\n \n \n \n \n //showing screen\n //add_action('current_screen', array(&$this, 'action_zgpb_init')); \n \n \n \n //end format wordpress editor \n add_action('init', array($this, 'init'));\n \n // i18n\n add_action('init', array(&$this, 'i18n'));\n\n //call post processing\n /* if (isset($_POST['_rockfm_type_submit']) && absint($_POST['_rockfm_type_submit']) === 0) {\n add_action('plugins_loaded', array(&$this, 'zgpbld_process_form'));\n }*/\n \n //disable update notifications\n if(is_admin()){\n // add_filter( 'site_transient_update_plugins', array(&$this, 'disable_plugin_updates'));\n \n //if(ZIGAFORM_F_LITE===1){\n // add_filter((is_multisite() ? 'network_admin_' : '').'plugin_action_links', array($this, 'plugin_add_links'), 10, 2);\n \n // ZigaForm Upgrade\n add_action( 'admin_notices', array( $this, 'zigaform_upgrade' ) );\n //}\n \n } \n \n }", "public function register_admin_scripts()\n {\n }", "public function register_admin_scripts() {\n\n\t}" ]
[ "0.8313708", "0.82929444", "0.82753336", "0.8192659", "0.81788284", "0.8176138", "0.8119812", "0.81047237", "0.80645883", "0.7992007", "0.79716235", "0.78755736", "0.7823784", "0.7772622", "0.7691783", "0.766254", "0.76356757", "0.7455628", "0.7423053", "0.73234946", "0.72872573", "0.72417414", "0.7141863", "0.7135187", "0.71032333", "0.7096873", "0.7094484", "0.70575976", "0.7046082", "0.7018238" ]
0.84381217
0
Update shipping Info It has 2 logic in it. Update your own shipping info, and update already created trade records which has no shipping info.
public function updateShippingInfo($userID, $data){ if(!is_numeric($userID) || // $data['shippingFullName'] == '' || $data['shippingAddress'] == '' || $data['shippingCity'] == '' || $data['shippingState'] == '' || $data['shippingZip'] == '' || $data['shippingCountryID'] == '' || !is_numeric($data['shippingCountryID']) ) return false; //Update my shipping info global $db; $db->updateFromArray(TABLE_TRADE_USERS, $data, ['userID' => $userID]); //Update trade table which has no shipping info with this info. //It will check trade table, and create records in trade_shipping_info $tradeIns = new BuckysTrade(); $tradeShippingInfoIns = new BuckysTradeShippingInfo(); //---------------- Update for seller ----------------------// $requiredList = $tradeIns->getShippingInfoRequiredTrade($userID, 'seller'); if(!empty($requiredList) && count($requiredList) > 0){ foreach($requiredList as $tradeData){ //Add shipping info $shippingRecID = $tradeShippingInfoIns->addTradeShippingInfo($userID); if(!empty($shippingRecID) && is_numeric($shippingRecID)){ //update trade table $tradeIns->updateTrade($tradeData['tradeID'], ['sellerShippingID' => $shippingRecID]); } } } //---------------- Update for buyer ----------------------// $requiredList = $tradeIns->getShippingInfoRequiredTrade($userID, 'buyer'); if(!empty($requiredList) && count($requiredList) > 0){ foreach($requiredList as $tradeData){ //Add shipping info $shippingRecID = $tradeShippingInfoIns->addTradeShippingInfo($userID); if(!empty($shippingRecID) && is_numeric($shippingRecID)){ //update trade table $tradeIns->updateTrade($tradeData['tradeID'], ['buyerShippingID' => $shippingRecID]); } } } //-------------------- Update Buyer Shipping Info -----------------------// $tradeShippingInfoIns->updateTradeShippingInfo($userID, $data); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateFromShipping($data)\n {\n $table = $this->getMainTable();\n $this->_getWriteAdapter()->update(\n $table, array(\n 'quote_id' => $data['quote_id'],\n 'w3w' => $data['w3w'],\n 'address_id' => $data['address_id']\n ), 'quote_id = ' . $data['quote_id']\n );\n }", "private function setShippingInformation()\n {\n if ($this->_checkoutSession->getLastRealOrder()->getIsVirtual()) {\n $this->_paymentRequest->setShipping()->setAddressRequired()->withParameters('false');\n } else {\n $this->_paymentRequest->setShipping()->setAddressRequired()->withParameters('true');\n $shipping = $this->_checkoutSession->getLastRealOrder()->getShippingAddress();\n if ($shipping) {\n if (count($shipping->getStreet()) === 4) {\n $this->_paymentRequest->setShipping()->setAddress()->withParameters(\n $shipping->getStreetLine(1),\n $shipping->getStreetLine(2),\n $shipping->getStreetLine(4),\n \\UOL\\PagSeguro\\Helper\\Data::fixPostalCode($shipping->getPostcode()),\n $shipping->getCity(),\n $this->getRegionAbbreviation($shipping),\n $this->getCountryName($shipping['country_id']),\n $shipping->getStreetLine(3)\n );\n } else {\n $address = \\UOL\\PagSeguro\\Helper\\Data::addressConfig($shipping['street']);\n\n $this->_paymentRequest->setShipping()->setAddress()->withParameters(\n $this->getShippingAddress($address[0], $shipping),\n $this->getShippingAddress($address[1]),\n $this->getShippingAddress($address[3]),\n \\UOL\\PagSeguro\\Helper\\Data::fixPostalCode($shipping->getPostcode()),\n $shipping->getCity(),\n $this->getRegionAbbreviation($shipping),\n $this->getCountryName($shipping['country_id']),\n $this->getShippingAddress($address[2])\n );\n }\n\n $this->_paymentRequest->setShipping()->setType()\n ->withParameters(\\PagSeguro\\Enum\\Shipping\\Type::NOT_SPECIFIED); //Shipping Type\n $this->_paymentRequest->setShipping()->setCost()\n ->withParameters(number_format($this->getShippingAmount(), 2, '.', '')); //Shipping Coast\n }\n }\n }", "function updateBillingShippingDetails($arrPost)\n {\n $objCore = new Core();\n $varWhr = 'pkCustomerID = ' . $_SESSION['sessUserInfo']['id'];\n $arrClmsUpdate = array(\n 'BillingFirstName' => $arrPost['frmBillingFirstName'],\n 'BillingLastName' => $arrPost['frmBillingLastName'],\n 'BillingOrganizationName' => $arrPost['frmBillingOrganizationName'],\n 'BillingAddressLine1' => $arrPost['frmBillingAddressLine1'],\n 'BillingAddressLine2' => $arrPost['frmBillingAddressLine2'],\n 'BillingCountry' => $arrPost['frmBillingCountry'],\n 'BillingPostalCode' => $arrPost['frmBillingPostalCode'],\n 'BillingPhone' => $arrPost['frmBillingPhone'],\n 'ShippingFirstName' => ($arrPost['frmShippingFirstName']),\n 'ShippingLastName' => $arrPost['frmShippingLastName'],\n 'ShippingOrganizationName' => $arrPost['frmShippingOrganizationName'],\n 'ShippingAddressLine1' => $arrPost['frmShippingAddressLine1'],\n 'ShippingAddressLine2' => $arrPost['frmShippingAddressLine2'],\n 'ShippingCountry' => $arrPost['frmShippingCountry'],\n 'ShippingPostalCode' => $arrPost['frmShippingPostalCode'],\n 'ShippingPhone' => $arrPost['frmShippingPhone'],\n 'BusinessAddress' => $arrPost['frmBusinessAddress']\n );\n\n $arrUpdateID = $this->update(TABLE_CUSTOMER, $arrClmsUpdate, $varWhr);\n }", "public function update(Request $request, shipping $shipping)\n {\n $shipping = shipping::where('id','=', $request->id);\n\n $relatedManifests = samples::where('shipping_manifest_id','=', $request->shipping_manifest_id);\n\n $shipping->update([\n 'shipping_site_id'=>$request->shipping_site_id,\n 'shipping_date'=>$request->shipping_date,\n 'shipping_site_contact_person'=>$request->shipping_site_contact_person,\n 'shipping_laboratory_phone'=>$request->shipping_laboratory_phone,\n 'shipping_laboratory_email'=>$request->shipping_laboratory_email, \n 'shipping_officer_name'=>$request->shipping_officer_name,\n 'shipping_officer_phone'=>$request->shipping_officer_phone,\n 'number_of_cryovial_tubes'=>$request->number_of_cryovial_tubes,\n 'tracking_waybill_number'=>$request->tracking_waybill_number,\n 'processing_site_id'=>$request->processing_site_id,\n /*\n 'receiving_lab_officer_name'=>$request->receiving_lab_officer_name,\n 'receiving_lab_officer_phone'=>$request->receiving_lab_officer_phone,\n \n */\n 'manifest_status'=>$request->manifest_status,\n 'voided'=>0,\n 'date_voided'=>\"\",\n 'voided_by'=>\"\",\n 'updated_by'=>Auth::user()->id,\n 'date_updated'=>date(\"Y-m-d\")\n ]);\n \n $relatedManifests->update([\n 'date_specimen_shipped'=>$request->shipping_date,\n 'sample_status'=>'Delivered To Shipping Site',\n /* 'date_specimen_arrived_sequence_lab'=>$request->date_specimen_arrived_sequence_lab,\n 'receiving_lab_officer'=>$request->receiving_lab_officer_name,\n 'receiving_lab_officer_phone'=>$request->receiving_lab_officer_phone,\n */\n // Bring down some values here \n 'updated_by'=>Auth::user()->id,\n 'date_updated'=>date(\"Y-m-d\") \n ]);\n\n\n audit::create([\n 'action'=>\"Updated New Shipping, Manifest ID: \".$request->shipping_manifest_id,\n 'description'=>'A Shipping Record was created',\n 'doneby'=>Auth::user()->id \n ]);\n session()->flash('message','The Shipping Record with Manifest ID : '.$request->shipping_manifest_id.' was updated successfully!');\n \n return redirect()->back();\n }", "public function testUpdateQuoteWithNewShipping()\n {\n $data = ['shippingMethod' => 'test'];\n\n $this->restriction->expects($this->atLeastOnce())\n ->method('canSubmit')\n ->willReturn(true);\n $extensionAttributesMock = $this->mockExtensionAttributes();\n $address = $this->getMockBuilder(Address::class)\n ->disableOriginalConstructor()\n ->setMethods([\n 'getPostcode',\n 'getShippingMethod',\n ])\n ->getMock();\n $address->expects($this->atLeastOnce())\n ->method('getPostcode')\n ->willReturn('111');\n $address->expects($this->atLeastOnce())\n ->method('getShippingMethod')\n ->willReturn('dummy_shipping_method');\n $shippingAssignmentsMock = $this->getMockBuilder(ShippingAssignmentInterface::class)\n ->disableOriginalConstructor()\n ->getMockForAbstractClass();\n $extensionAttributesMock->expects($this->atLeastOnce())\n ->method('getShippingAssignments')\n ->willReturn([$shippingAssignmentsMock]);\n $shippingMock = $this->getMockBuilder(ShippingInterface::class)\n ->disableOriginalConstructor()\n ->getMockForAbstractClass();\n $shippingAssignmentsMock->expects($this->atLeastOnce())\n ->method('getShipping')\n ->willReturn($shippingMock);\n $shippingMock->expects($this->any())\n ->method('setMethod')\n ->with($data['shippingMethod']);\n $this->quote->expects($this->atLeastOnce())\n ->method('getShippingAddress')\n ->willReturn($address);\n\n $this->assertEquals(true, $this->quoteUpdater->updateQuote(1, $data));\n }", "public function update_shipping($fData){\r\n\t\t$this->create_shipping_update_table();\r\n\t\t\t$Uquery = $this->db->insert(\r\n\t\t\t\t$this->ch_tableUpdate,\r\n\t\t\t\t$fData,\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'%s',\r\n\t\t\t\t\t'%s',\r\n\t\t\t\t\t'%s',\r\n\t\t\t\t\t'%s',\r\n\t\t\t\t\t'%s'\r\n\t\t\t\t)\r\n\t\t\t);\r\n\r\n\t\tif($Uquery){\r\n\t\t\t\treturn 'success';\r\n\t\t\t}else{\r\n\t\t\t\treturn '\"' .$consignmentNo . '\"' . ' Status Update Failed, Please Check All data Again. '; \r\n\t\t}\r\n\t}", "public function updateShipping($id){\n\t\t$orderClass = $this->_classes['order'];\n\t\t$current_user = Session::read('userLogin');\n\n\t\t$orderCollection = $orderClass::collection();\n\n\t\t// Get datas from the shipping form.\n\t\t$datas = $this->request->data;\n\t\t$update = true;\n\t\t$count = 0;\n\t\t$missing = false;\n\n\t\t// Check if form is well completed.\n\t\tforeach ($datas as $data) {\n\t\t\tif ($data == null){\n\t\t\t\t$missing = true;\n\t\t\t} else {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\n\t\t// If yes, we prepare the array of modification datas.\n\t\tif ((!$missing) && ($count > 6)) {\n\t\t\t$order = $orderClass::find('first', array(\n\t\t\t\t'conditions' => array('_id' => new MongoId($id))\n\t\t\t));\n\t\t\t$modification_datas[\"author\"] = $current_user[\"email\"];\n\t\t\t$modification_datas[\"date\"] = new MongoDate(strtotime('now'));\n\t\t\t$modification_datas[\"type\"] = \"shipping\";\n\t\t\t$modification_datas[\"old_datas\"] = array(\n\t\t\t\t\"firstname\" => $order[\"shipping\"][\"firstname\"],\n\t\t\t\t\"lastname\" => $order[\"shipping\"][\"lastname\"],\n\t\t\t\t\"address\" => $order[\"shipping\"][\"address\"],\n\t\t\t\t\"city\" => $order[\"shipping\"][\"city\"],\n\t\t\t\t\"state\" => $order[\"shipping\"][\"state\"],\n\t\t\t\t\"zip\" => $order[\"shipping\"][\"zip\"],\n\t\t\t\t\"phone\" => $order[\"shipping\"][\"phone\"]\n\t\t\t);\n\n\t\t\t// We push the modifications datas with the old shipping.\n\t\t\t$orderCollection->update(\n\t\t\t\tarray(\"_id\" => new MongoId($id)),\n\t\t\t\tarray('$push' => array('modifications' => $modification_datas))\n\t\t\t);\n\t\t\t$orderCollection->update(\n\t\t\t\tarray(\"_id\" => new MongoId($id)),\n\t\t\t\tarray('$set' => array('shipping' => $datas))\n\t\t\t);\n\t\t\tFlashMessage::write(\"Shipping details has been updated.\", array('class' => 'pass'));\n\t\t} else {\n\t\t\tFlashMessage::write(\n\t\t\t\t\"Some informations for the new shipping are missing\",\n\t\t\t\tarray('class' => 'warning')\n\t\t\t);\n\t\t}\n\t}", "public function update_shipping()\n\t{\n\t\n\t if($this->ion_auth->logged_in()==1)\n\t\t\t{\n\t $adorder = new App();\n\t $this->app = new App();\n\t \n\t\t \n\t\t $customerid=$_POST['customer'];\n\t\t \n\t\t \n\t\t \n\t\t\n\t\t\t\t \n\t \n\n\t//---shipping address---------------------\t\t\t\t \n\n\t\t\t\t$shippingaddress= $adorder->getshippingaddress($customerid);\n\t\t \n\t\t //print_r($shippingaddress);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$shiphtml=\"\";\n\t\t $shiphtml.='<option value=\"\">Select Address</option>';\n\t\t\t\tforeach ($shippingaddress as $items){\n\n $shiphtml.='<option value=\"'.$items[id].'\">'.$items[address].'</option>';\n\n\t\t\t\t\t}\n\t\t \n\t\t $shiphtml.='<option value=\"-1\">New Address</option>';\n\t\t\t\t\n\t\t\techo $shiphtml;\t\n\t\t\n\t\t \n\t }\n\t\telse\n\t\t{\n\n\t\t\t$this->template->load('login_master','content');\n\n\t\t}\n\t \n}", "public function updateShippingAddress()\n {\n if (!$this->shippingAddress instanceof Address) {\n return;\n }\n\n $this->shippingCity = $this->shippingAddress->getCity();\n $this->shippingCountry = $this->shippingAddress->getCountry();\n $this->shippingLatitude = $this->shippingAddress->getLatitude();\n $this->shippingLongitude = $this->shippingAddress->getLongitude();\n $this->shippingPostalCode = $this->shippingAddress->getPostalCode();\n $this->shippingState = $this->shippingAddress->getState();\n $this->shippingStreet = $this->shippingAddress->getStreet();\n }", "public function update(Request $request)\n {\n $ship_count = $request->input('ship_count');\n for ($ship_cnt = 1; $ship_cnt < $ship_count; $ship_cnt++) {\n $count = $request->input('count' . $ship_cnt);\n for ($cnt = 1; $cnt < $count; $cnt++) {\n if (empty($request->input(\"outbound_shipping_detail_id\" . $ship_cnt . \"_\" . $cnt))) {\n $outbound_shipping = array(\n \"outbound_method_id\" => $request->input('outbound_method' . $ship_cnt . \"_\" . $cnt),\n \"shipment_detail_id\" => $request->input('shipment_detail_id' . $ship_cnt . \"_\" . $cnt),\n \"order_id\" => $request->input('order_id'),\n \"product_ids\" => $request->input('product_id' . $ship_cnt . \"_\" . $cnt),\n \"qty\" => $request->input('total_unit' . $ship_cnt . \"_\" . $cnt)\n );\n $outbound_shipping_detail = new Outbound_shipping_detail($outbound_shipping);\n $outbound_shipping_detail->save();\n } else {\n $outbound_shipping = array(\n \"outbound_method_id\" => $request->input('outbound_method' . $ship_cnt . \"_\" . $cnt),\n \"shipment_detail_id\" => $request->input('shipment_detail_id' . $ship_cnt . \"_\" . $cnt),\n \"order_id\" => $request->input('order_id'),\n \"product_ids\" => $request->input('product_id' . $ship_cnt . \"_\" . $cnt),\n \"qty\" => $request->input('total_unit' . $ship_cnt . \"_\" . $cnt)\n );\n Outbound_shipping_detail::where('outbound_shipping_detail_id', $request->input(\"outbound_shipping_detail_id\" . $ship_cnt . \"_\" . $cnt))->update($outbound_shipping);\n }\n }\n }\n $order_detail = array('steps' => '7');\n Order::where('order_id', $request->input('order_id'))->update($order_detail);\n return redirect('order/reviewshipment')->with('Success', 'Outbound Shipping Information Added Successfully');\n }", "function update_shipment($name, $name2 = \"\", $address, $address2 = \"\", $zipcode, $city, $state, $phone, $msg) {\n\t\tif ($this->check_return_shipment()) {\n\t\t\t$sql = sprintf(\"UPDATE %s SET FirstName = %s, LastName = %s, address = %s, address2 = %s, ZipCode = %s, City = %s, State = %s, message = %s, phone = %s WHERE order_id = %d\", \n\t\t\t\tSHIP_ADDRESS, \n\t\t\t\t$this->prepare_string_value($name), \n\t\t\t\t$this->prepare_string_value($name2), \n\t\t\t\t$this->prepare_string_value($address), \n\t\t\t\t$this->prepare_string_value($address2), \n\t\t\t\t$this->prepare_string_value($zipcode), \n\t\t\t\t$this->prepare_string_value($city), \n\t\t\t\t$this->prepare_string_value($state),\n\t\t\t\t$this->prepare_string_value($msg),\n\t\t\t\t$this->prepare_string_value($phone),\n\t\t\t\t$_SESSION['order_id']);\n\t\t\tif (mysql_query($sql)) {\n\t\t\t\t$this->error = $this->messages(21);\n\t\t\t} else {\n\t\t\t\t$this->error = $this->messages(1);\n\t\t\t}\n\t\t}\t\n\t}", "public function updateShippingMethodAction()\n {\n $result = $this->_getHelper()->updateShippingMethod($this->getRequest());\n if ($result['result'] !== true) {\n Mage::getSingleton('checkout/session')->addError($result['message']);\n }\n $this->_sendCartContentResponse(true);\n }", "public function update(Request $request, Shipping $shipping)\n {\n $this->validate($request,[\n 'type'=>'string|required',\n 'price'=>'nullable|numeric',\n 'status'=>'required|in:active,inactive'\n ]);\n $data=$request->all();\n // return $data;\n $status=$shipping->update($data);\n if($status){\n request()->session()->flash('success','Shipping successfully updated');\n }\n else{\n request()->session()->flash('error','Error, Please try again');\n }\n return redirect()->route('admin.shippings.index');\n }", "public function editshippingAction() {\n\t\t// get the logged in user's info from the database\n\t\t\t$this->getLoggedInUser();\n\t\t\n\t\t$addressMapper = new Application_Model_Mapper_Users_ShippingAddressesMapper;\n\t\t\n\t\t// if editing an existing shipping address\n\t\tif($this->_request->getQuery('shippingAddressID')) {\n\t\t\t$address = $addressMapper->find($this->_request->getQuery('shippingAddressID'));\n\t\t\t// if the address doesn't belong to logged in user\n\t\t\t\tif(!$this->_acl->isAllowed($this->user, $address, 'update')) $this->errorAndRedirect('You can only edit your own addresses!', 'details');\n\t\t}\n\t\t// if creating a new address\n\t\telse {\n\t\t\t$address = new Application_Model_Users_ShippingAddress(array('userID' => $this->user->userID));\n\t\t\tif(!$this->_acl->isAllowed($this->user, $address, 'create')) $this->errorAndRedirect('You cannot create new addresses', 'details');\n\t\t}\n\t\t\n\t\t// process the form if it was submitted\n\t\tif($this->_request->isPost()) {\n\t\t\t$request = $this->getRequest();\n\t\t\t$address->setOptions($request->getPost());\n\t\t\t$form = new Application_Form_Account_ShippingAddress;\n\n\t\t\tif($form->isValid($request->getPost())) {\n \t// save the address and get the ID\n \t$addressID = $addressMapper->save($address);\n \tif(isset($address->shippingAddressID)) $addressID = $address->shippingAddressID;\n\n \t// if chosen as default shipping address\n \tif(isset($request->defaultShipping)) {\n \t\t$this->user->setOptions(array('defaultShippingAddressID' => $addressID));\n \t\t$this->usersMapper->save($this->user);\n \t}\n \t// display success message and redirect\n \t$this->msg('Your address has been saved!'); \n // redirect to account details page \n \t$this->_helper->redirector('details', 'account'); \t\n }\n\t\t\telse $this->msg(array('error' => 'Your submission was not valid')); // If form is NOT valid\t\n\t\t}\n\t\t\n\t\t$this->view->address = $address;\n\t}", "public function maybe_add_shipping_data()\n {\n global $woocommerce;\n\n if ($this->address_override && !empty($this->checkout_form) && $woocommerce->cart->needs_shipping()) {\n\n // Set the type of field\n $field_type = !empty($this->checkout_form['ship_to_different_address']) ? 'shipping' : 'billing';\n\n // Get the address\n $address = array(\n 'SHIPTONAME' => $this->checkout_form[$field_type . '_first_name'] . ' ' . $this->checkout_form[$field_type . '_last_name'],\n 'SHIPTOSTREET' => $this->checkout_form[$field_type . '_address_1'],\n 'SHIPTOSTREET2' => isset($this->checkout_form[$field_type . '_address_2']) ? $this->checkout_form[$field_type . '_address_2'] : '',\n 'SHIPTOCITY' => isset($this->checkout_form[$field_type . '_city']) ? wc_clean(stripslashes($this->checkout_form[$field_type . '_city'])) : '',\n 'SHIPTOSTATE' => isset($this->checkout_form[$field_type . '_state']) ? $this->checkout_form[$field_type . '_state'] : '',\n 'SHIPTOZIP' => isset($this->checkout_form[$field_type . '_postcode']) ? $this->checkout_form[$field_type . '_postcode'] : '',\n 'SHIPTOCOUNTRYCODE' => isset($this->checkout_form[$field_type . '_country']) ? $this->checkout_form[$field_type . '_country'] : '',\n 'SHIPTOPHONENUM' => isset($this->checkout_form[$field_type . '_phone']) ? $this->checkout_form[$field_type . '_phone'] : '',\n );\n\n // Add data to payment\n $this->payment = array_merge($this->payment, $address);\n }\n }", "public function handleShipping() { \n $error = array('status' => false);\n $model = new ShippingInfoForm();\n $model->setAttributeByDefault();\n\n $creditCardModel = new CreditCardForm;\n\n if (isset($_POST['ShippingInfoForm'])) {\n $model->attributes = $_POST['ShippingInfoForm'];\n\n if ($model->validate()) {\n $shipping_id = UserProfile::model()->saveShippingInfo($_POST['ShippingInfoForm']);\n Yii::app()->session['shipping_id'] = $shipping_id; \n $this->redirect($this->createUrl(\"/web/payment/placeOrder\"));\n }\n }\n \n $shipping_country_name = \"\";\n // getting shipping country name on behalf of country_id(region id) to disable the Cash On Delivery option for international customers\n $shipping_country_name = Region::model()->getRegionName($model->shipping_country);\n \n $criteria = new CDbCriteria;\n if ($country_list = Cart::model()->getCartCountryList()) {\n\n $criteria->addInCondition(\"name\", $country_list);\n }\n $criteria->order = \"name ASC\";\n $regionList = CHtml::listData(Region::model()->findAll($criteria), 'id', 'name');\n $this->render('//payment/payment_method', array(\n 'model' => $model,\n 'regionList' => $regionList,\n 'creditCardModel' => $creditCardModel,\n 'country_name' => $shipping_country_name,\n 'error' => $error\n ));\n }", "private function UpdateInCart()\n\t{\n\t\tif(isset($_REQUEST['selectedShippingMethod'])) {\n\t\t\t$id = $_REQUEST['selectedShippingMethod'];\n\n\t\t\t// Legancy - Vendor template\n\t\t\tif(isset($id[0])) {\n\t\t\t\t$id = $id[0];\n\t\t\t}\n\n\t\t\t// Make sure split shipping is disabled here - it doesn't work on\n\t\t\t// the cart pages.\n\t\t\t$this->getQuote()->SetIsSplitShipping(false);\n\t\t\t$shippingAddress = $this->getQuote()->getShippingAddress(0);\n\t\t\t$cachedShippingMethod = $shippingAddress->getCachedShippingMethod($id);\n\n\t\t\tif(!empty($cachedShippingMethod)) {\n\t\t\t\t$shippingAddress->setShippingMethod(\n\t\t\t\t\t$cachedShippingMethod['price'],\n\t\t\t\t\t$cachedShippingMethod['description'],\n\t\t\t\t\t$cachedShippingMethod['module']\n\t\t\t\t);\n\t\t\t\t$shippingAddress->setHandlingCost($cachedShippingMethod['handling']);\n\t\t\t}\n\t\t\t$shippingAddress->removeCachedShippingMethods();\n\t\t}\n\n\t\tif(!empty($_REQUEST['qty']) && is_array($_REQUEST['qty'])) {\n\t\t\tforeach($_REQUEST['qty'] as $itemId => $quantity) {\n\t\t\t\ttry {\n\t\t\t\t\tif(!$this->getQuote()->hasItem($itemId)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// if the quantity updated to 0, then remove it from cart\n\t\t\t\t\tif (empty ($quantity)) {\n\t\t\t\t\t\t$this->getQuote()\n\t\t\t\t\t\t->removeItem($itemId);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$item = $this->getQuote()->getItemById($itemId);\n\t\t\t\t\t\tif(!$item->getParentId()) {\n\t\t\t\t\t\t\t$item->setQuantity($quantity);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(ISC_QUOTE_EXCEPTION $e) {\n\t\t\t\t\tflashMessage($e->getMessage(), MSG_ERROR);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// update the coupon code, if there are any applied, as shipping method\n\t\t// changed affect the coupon amount.\n\t\ttry {\n\t\t\t$this->getQuote()\n\t\t\t->reapplyCoupons(true);\n\t\t}\n\t\tcatch(ISC_QUOTE_EXCEPTION $e) {\n\t\t\tflashMessage($e->getMessage(), MSG_ERROR);\n\t\t}\n\n\t\tif(empty($_REQUEST['selectedShippingMethod'])) {\n\t\t\tflashMessage(getLang('CartUpdated'), MSG_SUCCESS);\n\t\t}\n\n\t\tredirect('cart.php');\n\t}", "function updateShippingInfo( $objectID, $optionList )\n {\n $basket = eZBasket::currentBasket();\n $shippingInfo = eZShippingManager::updateShippingInfo( $basket->attribute( 'productcollection_id' ) );\n return array( 'status' => eZModuleOperationInfo::STATUS_CONTINUE );\n }", "public function update() {\n\t\t$current_user = Session::read('userLogin');\n\t\t$orderClass = $this->_classes['order'];\n\n\t\t$_shipToHeaders = array(\n\t\t\t'ShipDate',\n\t\t\t'OrderNum',\n\t\t\t'ShipMethod',\n\t\t\t'Tracking #',\n\t\t\t'Cost',\n\t\t\t'SKU',\n\t\t\t'Email'\n\t\t);\n\n\t\tif ($this->request->data) {\n\t\t\t$sendEmail = (boolean) $this->request->data['send_email'];\n\n\t\t\tif ($_FILES['upload']['error'] == 0) {\n\t\t\t\t$file = $_FILES['upload']['tmp_name'];\n\t\t\t\t$objReader = PHPExcel_IOFactory::createReaderForFile(\"$file\");\n\t\t\t\t$objPHPExcel = $objReader->load(\"$file\");\n\n\t\t\t\tforeach ($objPHPExcel->getWorksheetIterator() as $worksheet) {\n\t\t\t\t\t$highestRow = $worksheet->getHighestRow();\n\t\t\t\t\t$highestColumn = $worksheet->getHighestColumn();\n\t\t\t\t\t$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn);\n\n\t\t\t\t\tfor ($row = 1; $row <= $highestRow; ++ $row) {\n\t\t\t\t\t\tfor ($col = 0; $col < $highestColumnIndex; ++ $col) {\n\t\t\t\t\t\t\t$cell = $worksheet->getCellByColumnAndRow($col, $row);\n\t\t\t\t\t\t\t$val = $cell->getValue();\n\n\t\t\t\t\t\t\tif ($row == 1) {\n\t\t\t\t\t\t\t\t$heading[] = $val;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (in_array($heading[$col], $_shipToHeaders) && ($val != null)) {\n\t\t\t\t\t\t\t\t\t$shipRecords[$row - 1][$heading[$col]] = $val;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($shipRecords) {\n\t\t\t\t$updated = array();\n\n\t\t\t\tforeach ($shipRecords as $shipRecord) {\n\t\t\t\t\t$checkedItems = array();\n\t\t\t\t\t$order = $orderClass::lookup(substr($shipRecord['OrderNum'], 0, 8));\n\n\t\t\t\t\tif ($order && !empty($order->items)) {\n\t\t\t\t\t\t$item = Item::find('first', array(\n\t\t\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t\t\t'vendor_style' => $shipRecord['SKU']\n\t\t\t\t\t\t)));\n\t\t\t\t\t\tif ($item) {\n\t\t\t\t\t\t\t$itemId = (string) $item->_id;\n\t\t\t\t\t\t\t$orderData = $order->data();\n\n\t\t\t\t\t\t\tforeach ($orderData['items'] as $orderItem) {\n\t\t\t\t\t\t\t\tif ($orderItem['item_id'] == $itemId) {\n\t\t\t\t\t\t\t\t\t$orderItem['status'] = \"Order Shipped\";\n\t\t\t\t\t\t\t\t\t$orderItem['tracking_number'] = $shipRecord['Tracking #'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$checkedItems[] = $orderItem;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$order->items = $checkedItems;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$order->ship_method = $shipRecord['ShipMethod'];\n\t\t\t\t\t\t$details = array(\n\t\t\t\t\t\t\t'Order' => $order->order_id,\n\t\t\t\t\t\t\t'SKU' => $shipRecord['SKU'],\n\t\t\t\t\t\t\t'First Name' => $order->shipping->firstname,\n\t\t\t\t\t\t\t'Last Name' => $order->shipping->lastname,\n\t\t\t\t\t\t\t'Ship Method' => $order->ship_method,\n\t\t\t\t\t\t\t'Tracking Number' => $shipRecord['Tracking #']\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$trackingNum = $orderClass::find('first', array(\n\t\t\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t\t\t'tracking_numbers' => $shipRecord['Tracking #']\n\t\t\t\t\t\t)));\n\t\t\t\t\t\t$user = User::find('first', array('condition' => array('_id' => $order->user_id)));\n\n\t\t\t\t\t\tif (empty($trackingNum) && $sendEmail) {\n\t\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t\t'order' => $order->data(),\n\t\t\t\t\t\t\t\t'email' => $shipRecord['Email'],\n\t\t\t\t\t\t\t\t'details' => $details\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (Environment::get() == 'production')\n\t\t\t\t\t\t\t\tMailer::send('Order_Shipped', $shipRecord['Email'], $data);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tMailer::send('Order_Shipped', $current_user[\"email\"], $data);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($orderClass::setTrackingNumber($order->order_id, $shipRecord['Tracking #'])){\n\t\t\t\t\t\t\tif (empty($order->auth_confirmation)) {\n\t\t\t\t\t\t\t\tif ($orderClass::process($order) && $user->purchase_count == 1) {\n\t\t\t\t\t\t\t\t\tif ($user->invited_by) {\n\t\t\t\t\t\t\t\t\t\t$inviter = User::find('first', array(\n\t\t\t\t\t\t\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'invitation_code' => $user->invited_by\n\t\t\t\t\t\t\t\t\t\t)));\n\t\t\t\t\t\t\t\t\t\tif ($inviter) {\n\t\t\t\t\t\t\t\t\t\t\t$credit = Credit::create();\n\t\t\t\t\t\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t\t\t\t\t\t'user_id' => (string) $inviter->_id,\n\t\t\t\t\t\t\t\t\t\t\t\t'sign' => '+',\n\t\t\t\t\t\t\t\t\t\t\t\t'amount' => Credit::INVITE_CREDIT\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\tUser::applyCredit($data);\n\t\t\t\t\t\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t\t\t\t\t\t'reason' => \"Invitation Credit\",\n\t\t\t\t\t\t\t\t\t\t\t\t'sign' => \"+\",\n\t\t\t\t\t\t\t\t\t\t\t\t'amount' => Credit::INVITE_CREDIT,\n\t\t\t\t\t\t\t\t\t\t\t\t'description' => null,\n\t\t\t\t\t\t\t\t\t\t\t\t'user_id' => $inviter->_id\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\tCredit::add($credit, $data);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$order->save();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$details['Confirmation Number'] = $order->auth_confirmation;\n\t\t\t\t\t\t$details['Errors'] = $order->auth_error;\n\t\t\t\t\t\t$updated[] = $details;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn compact('updated');\n\t}", "function setShipInfo($data) {\n\t\treturn $this->controller->Session->write('Order.Shipping', $data);\n\t}", "function updateShipment($shipid){\n\n $id = $shipid;\n $shipdate = date(\"Y-m-d\");\n // Calculates the total cost.\n $sql = \"SELECT SUM(`package`.`weight` * `countries`.`multiplier`) AS total_cost FROM `package`, `countries` WHERE `countries`.`id_countries` = `package`.`country_id` AND `package`.`shipment_id` = $id\";\n \n try{\n \n\n $db = new db();\n\n $db = $db->connect();\n \n $stmt = $db->query($sql);\n $sum_cost = $stmt->fetch();\n $total_cost = $sum_cost['total_cost'];\n $db = null;\n\n \n }catch(PDOException $e){\n echo '{\"error\": {\"text\": '.$e->getMessage().'}';\n }\n //Calculates the total weight\n $sql = \"SELECT SUM(`package`.`weight`) AS total_weight FROM `package`, `countries` WHERE `countries`.`id_countries` = `package`.`country_id` AND `package`.`shipment_id` = $id\";\n \n try{\n \n $db = new db();\n\n $db = $db->connect();\n \n $stmt = $db->query($sql);\n $sum_weight = $stmt->fetch();\n $total_weight = $sum_weight['total_weight'];\n $db = null;\n\n \n }catch(PDOException $e){\n echo '{\"error\": {\"text\": '.$e->getMessage().'}';\n }\n\n //Inserts date, total weight and cost to current shipment.\n $sql = \"UPDATE `shipment` SET \n shipdate = :shipdate, \n total_weight = :total_weight, \n total_cost = :total_cost \n WHERE id_shipment = $id\";\n\n try{\n\n $db = new db();\n\n $db = $db->connect();\n\n $stmt = $db->prepare($sql);\n\n $stmt->bindParam(':shipdate', $shipdate);\n $stmt->bindParam(':total_weight', $total_weight);\n $stmt->bindParam(':total_cost', $total_cost);\n\n $stmt->execute();\n\n }catch(PDOException $e){\n echo '{\"error\": {\"text\": '.$e->getMessage().'}';\n }\n\n }", "function setShipping($price, $info) {\n\t\t$this->setShipRate($price);\n\t\t$this->setShipInfo($info);\n\t}", "static function update_shipments_from_post()\n {\n if (empty($_POST['bshipment'])) return null;\n $success = true;\n $changed = false;\n // Update all shipment conditions\n if (!empty($_POST['max_weight'])) {\n foreach ($_POST['max_weight'] as $shipment_id => $max_weight) {\n $max_weight = Weight::getWeight(contrexx_input2raw($max_weight));\n $shipper_id = intval($_POST['sid'][$shipment_id]);\n $fee = floatval($_POST['fee'][$shipment_id]);\n $free_from = floatval($_POST['free_from'][$shipment_id]);\n if ( $max_weight == Weight::getWeight(self::$arrShipments[$shipper_id][$shipment_id]['max_weight'])\n && $free_from == self::$arrShipments[$shipper_id][$shipment_id]['free_from']\n && $fee == self::$arrShipments[$shipper_id][$shipment_id]['fee']) {\n continue;\n }\n//DBG::log(\"Shipment::update_shipments_from_post(): max_weight $max_weight == \".self::$arrShipments[$shipper_id][$shipment_id]['max_weight'].\", free_from $free_from == \".self::$arrShipments[$shipper_id][$shipment_id]['free_from'].\", fee $fee == \".self::$arrShipments[$shipper_id][$shipment_id]['fee']);\n $changed = true;\n $success &= self::_update_shipment(\n $shipment_id, $shipper_id, $fee, $free_from, $max_weight);\n }\n }\n foreach ($_POST['shipper_name'] as $shipper_id => $shipper_name) {\n $shipper_name = contrexx_input2raw($shipper_name);\n $active = !empty($_POST['active'][$shipper_id]);\n $zone_id = intval($_POST['zone_id'][$shipper_id]);\n $zone_id_old = Zones::getZoneIdByShipperId($shipper_id);\n if ( $shipper_name == self::$arrShippers[$shipper_id]['name']\n && $active == self::$arrShippers[$shipper_id]['active']\n && $zone_id == $zone_id_old) {\n continue;\n }\n $changed = true;\n $success &= self::_update_shipper($shipper_id, $active);\n $success &= self::_rename_shipper(\n $shipper_id, $shipper_name);\n $success &= Zones::update_shipper_relation($zone_id, $shipper_id);\n }\n if ($changed) return $success;\n return null;\n }", "public function UpdateShippingModuleVars()\n\t{\n\t\treturn $this->UpdateModuleVars('Shipping');\n\t}", "protected function _assignFreeShipping(){\n //get delivery postcode\n $delivery_address = new Address($this->context->cart->id_address_delivery);\n //if no postcode setted\n if (!$delivery_address->postcode)\n $delivery_address->postcode = 75000; //set temporary postcode\n\n $id_zone = Address::getZoneByZipCode($delivery_address->postcode);\n $zone = new Zone($id_zone);\n\n if ($this->display_debug) $this->errors[] = \"Cart id #\".$this->context->cart->id; //Debug message\n //get total with taxes\n $total_wt = $this->context->cart->getTotalProductsPriceWithTax();\n\n //set freeShipping roof\n $free_shipping = $zone->free_shipping;\n\n //@TODO Manage free shipping according to Carrier free_shipping instead of Zone free_shipping\n //========================================================\n //Temporary solution (hard coding)\n //\n //Hard Code to manage \"livraison le soir\" and \"livraison express\" special cases:\n //\"livraison le soir\" is a jet carrier, but should be considered as Ecolo for prices\n //\"livraison express\" is a UPS carrier, but it has its own free shipping price\n //(different than Saver which use the normal free shipping for UPS zone\n //==========\n\n //get Ecolos free_shipping\n $ecolo_zone = new Zone(ID_ZONE_ECOLOTRANS);\n\n //set special free shipping case\n ////Used to show the good price for \"livraison le soir\" or \"Livraison Express\" (see order-carrier.tpl line 418)\n $special_case_free_shipping = false;\n if (($id_zone == ID_ZONE_JET && $total_wt >= $ecolo_zone->free_shipping) ||\n ($id_zone == ID_ZONE_UPS && $total_wt >= DELIVERY_FREE_SHIPPING_UPS_EXPRESS))\n $special_case_free_shipping = true;\n\n $this->context->smarty->assign(array(\n 'special_case_free_shipping' => $special_case_free_shipping //Used to show the good price for \"livraison le soir\" or \"Livraison Express\" (see order-carrier.tpl line 418)\n ));\n\n\n //for free shipping calculus reconsidere as zone Ecolo if \"livraison le soir\" selected\n $carrier = new Carrier($this->context->cart->id_carrier);\n\n if ($carrier->name == 'Livraison le soir'){\n if ($this->display_debug)\n $this->errors[] = \"Zone Jet, reconsidered as Ecolo for free shipping price: Livraison le soir\";\n $zone = $ecolo_zone;\n $free_shipping = $zone->free_shipping;\n }\n\n ////for free shipping calculus reconsidere as zone Ecolo if \"livraison le soir\" selected\n if ($carrier->name == 'Livraison Express'){\n if ($this->display_debug)\n $this->errors[] = \"Zone Ups, using constant var (in settings.inc) for free shipping price: Livraison Express\";\n $free_shipping = DELIVERY_FREE_SHIPPING_UPS_EXPRESS; //see config/settings.inc.php line 65\n }\n //=========================================================\n\n if ($total_wt >= $free_shipping || $this->context->cart->custom_relay > 0 ||\n $this->context->smarty->getTemplateVars('is_adjustment') == true){\n if ($this->display_debug) $this->errors[] = \"Free shipping\"; //Debug message\n //total product price > free shipping price OR ajustment cart\n\n //create and add a new FreeShipping rule\n $this->context->cart->addCustomFreeShippingRule();\n $this->context->smarty->assign(array(\n 'free_shipping' => true,\n ));\n }\n else{\n if ($this->display_debug) $this->errors[] = \" NOT Free shipping, delete free shipping if exist\"; //Debug message\n //Delete FreeShipping rule if found\n $this->context->cart->deleteCustomFreeShippingRule();\n $this->context->smarty->assign(array(\n 'free_shipping' => false,\n ));\n }\n }", "function calculateShipping() {\n\t\t// Some logic to call 3rd part for calculating shipping cost by passing $this->shipFrom and $this->shipTo \n\t\t// @need to implement this later\n\t\t// Code to access shipping rate api by passing shipFromAddress, shipFromZip, shipToAddress, shipToZip, weight in lbs, shipping service to ups shipping api......\n\t\treturn 45.90; // Returning hardcoded value for now\n\t}", "private function makeBillingSameAsShipping() {\n $shippingAddress = $this->getQuote()->getShippingAddress();\n //Only the followng fields need to be set\n $billingData = array();\n $billingData['city'] = $shippingAddress->getCity();\n $billingData['street'] = $shippingAddress->getStreet();\n $billingData['region'] = $shippingAddress->getRegion();\n $billingData['region_id'] = $shippingAddress->getRegionId();\n $billingData['postcode'] = $shippingAddress->getPostcode();\n $billingData['country_id'] = $shippingAddress->getCountryId();\n $billingData['telephone'] = $shippingAddress->getTelephone();\n $billingData['fax'] = $shippingAddress->getFax();\n\n $this->getQuote()\n ->getBillingAddress()\n ->addData($billingData)\n ->save();\n }", "public function setShippingAmount($amount);", "function set_shipment_data() {\n\t\tif (!$this->check_return_shipment()) { // create an empty record if there is no shipment data\n\t\t\t$this->insert_new_shipment();\n\t\t}\n\t\t$sql = sprintf(\"SELECT * FROM %s WHERE order_id = %d\", SHIP_ADDRESS, $_SESSION['order_id']);\n\t\tif ($result = mysql_query($sql)) {\n\t\t\t$obj = mysql_fetch_object($result);\n\t\t\t$this->ship_name = $obj->FirstName;\n\t\t\t$this->ship_name2 = $obj->LastName;\n\t\t\t$this->ship_address = $obj->address;\n\t\t\t$this->ship_address2 = $obj->address2;\n\t\t\t$this->ship_zipcode = $obj->ZipCode;\n\t\t\t$this->ship_city = $obj->City;\n\t\t\t$this->ship_state = $obj->State;\n\t\t\t$this->ship_phone = $obj->phone;\n\t\t\t$this->ship_msg = $obj->message;\n\t\t} else {\n\t\t\t$this->error = $this->messages(1);\n\t\t}\n\t}", "public function update(Request $request, $id)\n {\n $shipping=Shipping::find($id);\n $this->validate($request,[\n 'type'=>'string|required',\n 'price'=>'nullable|numeric',\n 'status'=>'required|in:active,inactive'\n ]);\n $data=$request->all();\n // return $data;\n $status=$shipping->fill($data)->save();\n if($status){\n request()->session()->flash('success','Shipping successfully updated');\n }\n else{\n request()->session()->flash('error','Error, Please try again');\n }\n return redirect()->route('shipping.index');\n }" ]
[ "0.731799", "0.70409733", "0.6954522", "0.6915075", "0.6861783", "0.6800433", "0.6798355", "0.67208105", "0.6682073", "0.6607309", "0.6399671", "0.63357776", "0.6325058", "0.63031936", "0.62433845", "0.62066126", "0.6191371", "0.6174485", "0.6170027", "0.6149239", "0.61365175", "0.6125162", "0.6108832", "0.61062163", "0.6052392", "0.60175395", "0.6002327", "0.5971463", "0.5933887", "0.59109837" ]
0.7244805
1
Get users who are at top, by having items
public function getUsersTopByItems($limit = 10){ if(!is_numeric($limit)) return; global $db; $avaiableTime = date('Y-m-d H:i:s'); $query = sprintf(" SELECT tUser.*, user.firstName, user.lastName, (SELECT COUNT(*) FROM %s AS tItem WHERE tUser.userID=tItem.userID AND tItem.expiryDate >= '%s' AND tItem.status=%d) AS itemCount FROM %s AS tUser LEFT JOIN %s AS USER ON tUser.userID=USER.userID WHERE USER.status=%d ORDER BY itemCount DESC LIMIT %d ", TABLE_TRADE_ITEMS, $avaiableTime, BuckysTradeItem::STATUS_ITEM_ACTIVE, TABLE_TRADE_USERS, TABLE_USERS, BuckysUser::STATUS_USER_ACTIVE, $limit); $result = $db->getResultsArray($query); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function userItemsTop($userId, array $params = array())\n {\n $path = \"/users/$userId/items/top\";\n return $this->_getFeed($path, $params);\n }", "public function getTopGrabbers()\n\t{\n\t\treturn $this->pdo->query(\"\n\t\t\tSELECT id, username, SUM(grabs) AS grabs\n\t\t\tFROM users\n\t\t\tGROUP BY id, username HAVING SUM(grabs) > 0\n\t\t\tORDER BY grabs DESC\n\t\t\tLIMIT 10\"\n\t\t);\n\t}", "public function topUser()\n {\n $input = Input::all();\n $limit = 10;\n if(!empty($input))\n {\n $limit = $input['limit'];\n }\n $user = User::orderBy('weeklyCommits', 'DESC')->get();;\n return $user->take($limit);\n }", "public function getTopArtists($user, $period = null, $limit = null, $page = null)\n {\n return $this->getClient()->call('user.gettopartists', array(\n 'user' => $user,\n 'period' => $period,\n 'limit' => $limit,\n 'page' => $page,\n ));\n }", "public function getUserItems() {\n return DB::table('users as u')\n ->select('i.sku', 'i.image_link', 'i.discount', 'i.title', 'i.brand', 'i.price', 'i.price_discount', 'i.is_active')\n ->join('user_items as ui', 'ui.user_id', '=', 'u.id')\n ->join('items as i', 'ui.item_id', '=', 'i.id')\n ->where('u.id', \\Auth::user()->id)\n ->orderBy('i.is_active', 'desc')\n ->orderBy('i.created_at', 'desc')\n ->get();\n }", "function top_users($n=false){\r\n\r\n//include required module\r\ninclude_once(get_module_path(\"top_users\").\"/top_users.php\");\r\n\r\nreturn top_users::top_users_by_points($this->get_n($n));\r\n\r\n}", "public function userCollectionItemsTop($userId, $collectionKey, array $params = array())\n {\n $path = \"/users/$userId/collections/$collectionKey/items/top\";\n return $this->_getFeed($path, $params);\n }", "function ra_top_users($limit = 5, $size){\n\t$users = qa_db_select_with_pending(qa_db_top_users_selectspec(qa_get_start()));\n\t\n\t$output = '<ul class=\"top-users-list clearfix\">';\n\t$i = 1;\n\tforeach($users as $u){\n\t\tif(defined('QA_WORDPRESS_INTEGRATE_PATH')){\n\t\t\trequire_once QA_INCLUDE_DIR.'qa-app-posts.php';\n\t\t\t$u['handle'] = qa_post_userid_to_handle($u['userid']);\n\t\t}\n\t\t\n\t\t$output .= '<li class=\"top-user\">';\n\t\t$output .= '<div class=\"avatar pull-left\" data-handle=\"'.$u['handle'].'\" data-id=\"'. qa_handle_to_userid($u['handle']).'\">';\n\t\t$output .= ra_get_avatar($u['handle'], $size).'</div>';\n\t\t$output .= '<div class=\"top-user-data\">';\n\t\t\n\t\t$output .= '<a href=\"'.qa_path_html('user/'.$u['handle']).'\" class=\"name\">'.ra_name($u['handle']).'</a>';\n\t\t\n\t\t//$output .= ra_user_badge($u['handle']);\t\n\t\t$output .= '<dl class=\"points\">'.$u['points'].' '._ra_lang('Points').'</dl>';\t\t\n\t\t$output .= '</div>';\n\t\t$output .= '</li>';\n\t\tif($i==$limit)break;\n\t\t$i++;\n\t\n\t}\n\t$output .= '</ul>';\n\techo $output;\n}", "protected function markTopItems()\n {\n $items = [];\n foreach ($this->items as $item) {\n if (empty($item['items'])) {\n $item['top'] = true;\n }\n $items[] = $item;\n }\n $this->items = $items;\n }", "function getTopArtists($max_entries = null)\n\t{\n\t\treturn $this->getGenericLevel3('topartists', 'user', $max_entries);\n\t}", "public function groupItemsTop($groupId, array $params = array())\n {\n $path = \"/groups/$groupId/items/top\";\n return $this->_getFeed($path, $params);\n }", "public function getTopTags($user, $limit = null)\n {\n return $this->getClient()->call('user.gettoptags', array(\n 'user' => $user,\n 'limit' => $limit,\n ));\n }", "function users_Bid_All_Item() {\n\t\t$query = 'SELECT u.name \n\t\t\t\t FROM bid b, users u\n\t\t\t\t WHERE b.bidder = u.email\n\t\t\t\t GROUP BY u.name, u.email\n\t\t\t\t HAVING COUNT(DISTINCT b.itemID) = (SELECT COUNT(*)\n\t\t\t\t\t\t\t\t\t\t\t\t\t FROM item i2\n\t\t\t\t\t\t\t\t\t\t\t\t\t WHERE i2.loanSetting=\\'BID\\');\n\t\t\t\t ';\n\t\t$result = pg_query($query);\n\t\n\t\treturn $result;\n\t}", "public function testTopShouldGetTheTopCount()\n {\n $this->get('/search/repos?top=10');\n $items = $this->response->json('items');\n $this->assertCount(10, $items);\n\n $this->get('/search/repos?top=20');\n $items = $this->response->json('items');\n $this->assertCount(20, $items);\n\n $this->get('/search/repos?top=2');\n $items = $this->response->json('items');\n $this->assertCount(2, $items);\n }", "static function getUserItems() {\n\t\t$id = Users::getUser();\n\t\t\n\t\t$id = parent::escape($id, \"sql\");\n\t\t\n\t\t$data = parent::query(\"SELECT *\n\t\t\t\t\t\t\t\tFROM `user_objects`\n\t\t\t\t\t\t\t\tWHERE `user_id` = '$id'\n\t\t\t\t\t\t\t\tAND `approve` = '1'\n\t\t\t\t\t\t\t\");\n\t\t\t\t\t\t\t\n\t\treturn $data;\n\t}", "function getRecentUsers($total) {\n\t\t\t$data = $this->fetch(\"SELECT id, username, email, created FROM `\" . $this->prefix . \"users` ORDER BY id DESC LIMIT $total\");\n\t\t\t return $data;\n\t\t}", "public function getItemsTopByOffers($limit = 10) {\n \n if (!is_numeric($limit))\n return;\n \n global $db;\n \n $avaiableTime = date('Y-m-d H:i:s', time() - TRADE_ITEM_LIFETIME * 3600 * 24);\n \n \n \n $query = sprintf(\"\n SELECT tItem.*, user.firstName, user.lastName, (SELECT COUNT(*) FROM %s AS tOffer WHERE tOffer.targetItemID=tItem.itemID AND tOffer.status=%d) AS offerCount \n FROM %s AS tItem \n LEFT JOIN %s AS user ON tItem.userID=user.userID \n WHERE tItem.status=%d AND tItem.createdDate >='%s' ORDER BY offerCount DESC LIMIT %d \n \n \", TABLE_TRADE_OFFERS, BuckysTradeOffer::STATUS_OFFER_ACTIVE,TABLE_TRADE_ITEMS, TABLE_USERS, BuckysTradeItem::STATUS_ITEM_ACTIVE, $avaiableTime, $limit);\n \n\n $result = $db->getResultsArray($query);\n \n return $result;\n }", "function getTrackedItems($userToken) {\n global $items;\n\n $userItems = $items->find(array('userToken' => $userToken));\n\n// echo \"\\nUser [\".$userToken.\"]:\\n\";\n echo json_encode(iterator_to_array($userItems));\n}", "public function top()\n\t{\n\t\t// callables to fetch user data\n\t\t$fetchUsers = function($start, $pageSize) {\n\t\t\treturn array(\n\t\t\t\tqa_opt('cache_userpointscount'),\n\t\t\t\tqa_db_select_with_pending(qa_db_top_users_selectspec($start, $pageSize))\n\t\t\t);\n\t\t};\n\t\t$userScore = function($user) {\n\t\t\treturn qa_html(qa_format_number($user['points'], 0, true));\n\t\t};\n\n\t\t$qa_content = $this->rankedUsersContent($fetchUsers, $userScore);\n\n\t\t$qa_content['title'] = empty($qa_content['ranking']['items'])\n\t\t\t? qa_lang_html('main/no_active_users')\n\t\t\t: qa_lang_html('main/highest_users');\n\n\t\t$qa_content['ranking']['sort'] = 'points';\n\n\t\treturn $qa_content;\n\t}", "private function get_top_sellers()\n {\n global $wpdb;\n\n // $query = array();\n // $query['fields'] = \"SELECT SUM( order_item_meta.meta_value ) as qty, order_item_meta_2.meta_value as product_id\n // FROM {$wpdb->posts} as posts\";\n // $query['join'] = \"INNER JOIN {$wpdb->prefix}woocommerce_order_items AS order_items ON posts.ID = order_id \";\n // $query['join'] .= \"INNER JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS order_item_meta ON order_items.order_item_id = order_item_meta.order_item_id \";\n // $query['join'] .= \"INNER JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS order_item_meta_2 ON order_items.order_item_id = order_item_meta_2.order_item_id \";\n // $query['where'] = \"WHERE posts.post_type IN ( '\" . implode(\"','\", wc_get_order_types('order-count')) . \"' ) \";\n // $query['where'] .= \"AND posts.post_status IN ('wc-processing','wc-completed') \";\n // $query['where'] .= \"AND order_item_meta.meta_key = '_qty' \";\n // $query['where'] .= \"AND order_item_meta_2.meta_key = '_product_id' \";\n // $query['groupby'] = 'GROUP BY product_id';\n // $query['orderby'] = 'ORDER BY qty DESC';\n // $query['limits'] = 'LIMIT ' . $this->top_seller_limit;\n\n // return $wpdb->get_results(implode(' ', $query));\n\n // $top_sellers = $wpdb->get_results(\n // $wpdb->prepare(\n // \"SELECT p.ID\n // FROM {$wpdb->prefix}posts p\n // INNER JOIN {$wpdb->prefix}woocommerce_order_itemmeta oim\n // ON p.ID = oim.meta_value\n // INNER JOIN {$wpdb->prefix}woocommerce_order_itemmeta oim2\n // ON oim.order_item_id = oim2.order_item_id\n // INNER JOIN {$wpdb->prefix}woocommerce_order_items oi\n // ON oim.order_item_id = oi.order_item_id\n // INNER JOIN {$wpdb->prefix}posts as o\n // ON o.ID = oi.order_id\n // WHERE p.post_type = 'product'\n // AND p.post_status = 'publish'\n // AND o.post_status IN ('wc-processing','wc-completed')\n // AND oim.meta_key = '_product_id'\n // AND oim2.meta_key = '_qty'\n // AND p.ID NOT IN (\n // SELECT DISTINCT object_id\n // FROM {$wpdb->prefix}term_relationships\n // WHERE term_taxonomy_id = %d\n // )\n // GROUP BY p.ID\n // ORDER BY COUNT(oim2.meta_value) * 1 DESC\n // LIMIT %d\",\n // [$this->point_cat, $this->top_seller_limit]\n // )\n // );\n\n $top_sellers = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT p.post_id\n FROM {$wpdb->prefix}postmeta AS p\n WHERE\n p.meta_key = 'total_sales' AND\n p.post_id NOT IN (\n SELECT DISTINCT t.object_id\n FROM {$wpdb->prefix}term_relationships AS t\n WHERE t.term_taxonomy_id = %d\n )\n ORDER BY p.meta_value * 1 DESC\n LIMIT %d\",\n [$this->point_cat, $this->top_seller_limit]\n )\n );\n\n return $top_sellers;\n }", "public function getRecentItems($limit = 10) {\n \n if (!is_numeric($limit))\n return;\n \n global $db;\n \n $avaiableTime = date('Y-m-d H:i:s', time() - TRADE_ITEM_LIFETIME * 3600 * 24);\n \n $query = sprintf(\"\n SELECT tItem.*, user.firstName, user.lastName \n FROM %s AS tItem \n LEFT JOIN %s AS user ON tItem.userID=user.userID \n WHERE tItem.status=%d AND tItem.createdDate >='%s' ORDER BY tItem.createdDate DESC LIMIT %d \n \n \", TABLE_TRADE_ITEMS, TABLE_USERS, BuckysTradeItem::STATUS_ITEM_ACTIVE, $avaiableTime, $limit);\n\n $result = $db->getResultsArray($query);\n \n return $result;\n }", "protected function listTopSellers()\n {\n $avgRating = VendorRating::avg('rating');\n $topSellers = VendorRating::where('rating', '>=', $avgRating)->with('vendor')->orderBy('rating', 'desc')->get();\n\n $this->loadPage(compact('topSellers'), 'top_sellers_list');\n }", "function get_user_prew_items($items = array(), $character_id = 0)\n {\n if($character_id == 0):\n\t\t\t$character_id = $this->character_id;\n\t\telse:\n\t\t\t$this->character_id = $character_id;\n\t\tendif;\n\n $sql_if = \"(IF( CAST(caip.gender AS CHAR) = 'Unisex',\n\t\t\t\t\t IF( CAST(caip.gender AS CHAR) = CAST(u.gender as CHAR)\n\t\t\t\t\t OR CAST(caip.gender AS CHAR) = 'Unisex', true, false),\n\t\t\t\t true)\n\t\t\t\t )\";\n\n $query = $this->db->select('caip.*')\n ->from('avatar_items caip')\n ->join('avatar_layers cal', 'cal.id=caip.layer')\n ->join('character_items caui', 'caui.item_id=caip.item_id')\n ->join('users u', 'u.character_id=caui.character_id')\n ->where('caui.character_id', $character_id)\n ->where('caui.id IN ('.implode(',', $items).')')\n //->where($sql_if)\n ->order_by('cal.order', 'asc')\n ->get()->result_array();\n\n if (!empty($query)) return $query; else return false;\n }", "function sort_items($user_id) {\n $items = get_current_list($user_id);\n sort($items);\n return $items;\n}", "public function getPendingAvailable($user)\n\t{\n\t\t$query = $this->model->whereHas('users', function ($query) use ($user) {\n $query->where('user_id', '!=', $user->id);\n },'<',DB::raw('nb_users'));\n\n\t\t$query = $query->whereHas('users', function ($query) use ($user) {\n $query->where('user_id', '=', $user->id);\n },'=',0);\n\n \t$query = $query->where('level_id','<=',$user->level_id);\n\n \t$query = $query->where('state','=','pending');\n\n\t\treturn $query->with('users')->with('relation')->paginate(10);\n\t}", "public function getTopTracks($user, $period = null, $limit = null, $page = null)\n {\n return $this->getClient()->call('user.gettoptracks', array(\n 'user' => $user,\n 'period' => $period,\n 'limit' => $limit,\n 'page' => $page,\n ));\n }", "function retrieve_top_team_visitors($promoters_pt_ids, $team_fan_page_id){\n\t\t\n\t//\tif(!$promoters_pt_ids)\n\t//\t\treturn array();\n\t\t\n\t\t$sql = \"SELECT\n\t\t\n\t\t\t\t\tusers_oauth_uid,\n\t\t\t\t\tcount(*) as count\n\t\t\n\t\t\t\tFROM \n\t\t\n\t\t\t\t(SELECT \n\t\t\n\t\t\t\t\tuv.users_oauth_uid as \tusers_oauth_uid\n\t\t\t\t\t\t\n\t\t\t\tFROM \tuser_views uv\n\t\t\t\t\n\t\t\t\tWHERE \tuv.team_fan_page_id = ? \";\n\t\t\t\t\n\t\t\t\tif($promoters_pt_ids)\n\t\t\t\t\t$sql .= \" OR \";\n\t\t\t\t\n\t\tforeach($promoters_pt_ids as $key => $pt_id){\n\t\t\tif($key == (count($promoters_pt_ids) - 1)){\n\t\t\t\t//last\n\t\t\t\t\n\t\t\t\t$sql .= \"uv.promoters_teams_id = ? \";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t$sql .= \"uv.promoters_teams_id = ? OR \";\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t$sql .= \") t\n\t\t\n\t\t\t\tGROUP BY users_oauth_uid\n\t\t\t\tORDER BY count DESC\n\t\t\t\tLIMIT 50\";\n\t\t\n\t\t$query = $this->db->query($sql, array_merge(array($team_fan_page_id), $promoters_pt_ids));\n\t\treturn $query->result();\n\t\t\n\t}", "public function getTop()\n {\n // get snacks\n $top = DB::table('votes')\n ->join('users', 'users.id', '=', 'votes.user_id')\n ->groupBy('votes.user_id')\n ->select('users.email', DB::raw('count(*) as total_votes'))\n ->get();\n\n // passing the columns which I want from the result set. Useful when we have not selected required fields\n $arrColumns = array('email', 'total_votes');\n\n // define the first row which will come as the first row in the csv\n $arrFirstRow = array('email', 'total votes');\n\n // building the options array\n $options = array(\n 'columns' => $arrColumns,\n 'firstRow' => $arrFirstRow,\n 'headers' => array(\n 'Content-Type' => 'text/csv',\n 'Content-Disposition' => 'attachment; filename=\"top_users.csv\"'\n ),\n );\n\n return convertToCSV($top, $options);\n }", "function get_user_data($from, $number_of_items, $column, $direction) {\n\tglobal $origin;\n global $course_info;\n\tglobal $is_western_name_order;\t\n global $session_id;\n \n\t$a_users = array();\n\n\t// limit\n\tif (!isset($_GET['keyword']) || empty($_GET['keyword'])) {\n\t\t$limit = 'LIMIT '.intval($from).','.intval($number_of_items);\n\t}\n\n\tif (!in_array($direction, array('ASC', 'DESC'))) {\n\t\t$direction = 'ASC';\n\t}\n \n\tswitch ($column) {\n\t case 2: //official code\n $order_by = 'ORDER BY user.official_code '.$direction;\n break;\n\t\tcase 3:\n\t\t\tif ($is_western_name_order) {\n\t\t\t\t$order_by = 'ORDER BY user.firstname '.$direction.', user.lastname '.$direction;\n\t\t\t} else {\n\t\t\t\t$order_by = 'ORDER BY user.lastname '.$direction.', user.firstname '.$direction;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tif ($is_western_name_order) {\n\t\t\t\t$order_by = 'ORDER BY user.lastname '.$direction.', user.firstname '.$direction;\n\t\t\t} else {\n\t\t\t\t$order_by = 'ORDER BY user.firstname '.$direction.', user.lastname '.$direction;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 5: //username\n\t\t\t$order_by = 'ORDER BY user.username '.$direction;\n\t\t\tbreak; \n\t\tdefault:\n\t\t\tif ($is_western_name_order) {\n $order_by = 'ORDER BY user.lastname '.$direction.', user.firstname '.$direction;\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$order_by = 'ORDER BY user.firstname '.$direction.', user.lastname '.$direction;\n\t\t\t}\n\t\t\tbreak;\n\t}\n \n $session_id = api_get_session_id();\n $course_code = api_get_course_id();\n \n $a_course_users = CourseManager :: get_user_list_from_course_code($course_code, $session_id, $limit, $order_by);\n\n\tforeach ($a_course_users as $user_id => $o_course_user) {\n\t\tif ((isset($_GET['keyword']) && search_keyword($o_course_user['firstname'], $o_course_user['lastname'], $o_course_user['username'], $o_course_user['official_code'], $_GET['keyword'])) || !isset($_GET['keyword']) || empty($_GET['keyword'])) {\n\n\t\t\t$groups_name = GroupManager :: get_user_group_name($user_id);\n\t\t\t$temp = array();\n\t\t\tif (api_is_allowed_to_edit(null, true)) {\n\t\t\t\t//if (api_get_setting('allow_user_course_subscription_by_course_admin') == 'true') {\n \t$temp[] = $user_id;\n //}\n\t\t\t\t$image_path = UserManager::get_user_picture_path_by_id($user_id, 'web', false, true);\n\t\t\t\t$user_profile = UserManager::get_picture_user($user_id, $image_path['file'], 22, USER_IMAGE_SIZE_SMALL, ' width=\"22\" height=\"22\" ');\n\t\t\t\tif (!api_is_anonymous()) {\n\t\t\t\t\t$photo = '<a href=\"userInfo.php?'.api_get_cidreq().'&origin='.$origin.'&amp;uInfo='.$user_id.'\" title=\"'.get_lang('Info').'\" ><img src=\"'.$user_profile['file'].'\" '.$user_profile['style'].' alt=\"'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'\" title=\"'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'\" /></a>';\n\t\t\t\t} else {\n\t\t\t\t\t$photo = '<img src=\"'.$user_profile['file'].'\" '.$user_profile['style'].' alt=\"'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'\" title=\"'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'\" />';\n\t\t\t\t}\n \n\t\t\t\t$temp[] = $photo;\n\t\t\t\t$temp[] = $o_course_user['official_code'];\n\t\t\t\t\n\t\t\t\tif ($is_western_name_order) {\n\t\t\t\t\t$temp[] = $o_course_user['firstname'];\n\t\t\t\t\t$temp[] = $o_course_user['lastname'];\n\t\t\t\t} else {\n\t\t\t\t\t$temp[] = $o_course_user['lastname'];\n\t\t\t\t\t$temp[] = $o_course_user['firstname'];\n\t\t\t\t}\n\n $temp[] = $o_course_user['username']; \n\t\t\t\t$temp[] = isset($o_course_user['role']) ? $o_course_user['role'] : null; //Description\n\t\t\t\t$temp[] = implode(', ', $groups_name); //Group\t\t\t\t\n\n\t\t\t\t// Status\n $default_status = '-';\n\t\t\t\tif ((isset($o_course_user['status_rel']) && $o_course_user['status_rel'] == 1) || (isset($o_course_user['status_session']) && $o_course_user['status_session'] == 2)) {\n\t\t\t\t\t$default_status = get_lang('CourseManager');\n\t\t\t\t} elseif (isset($o_course_user['tutor_id']) && $o_course_user['tutor_id'] == 1) {\n\t\t\t\t\t$default_status = get_lang('Tutor');\n\t\t\t\t}\n $temp[] = $default_status;\n \n //Active\n\t\t\t\t$temp[] = $o_course_user['active'];\n \n //User id for actions\n\t\t\t\t$temp[] = $user_id;\n\t\t\t} else {\n\t\t\t\t$image_path = UserManager::get_user_picture_path_by_id($user_id, 'web', false, true);\n\t\t\t\t$image_repository = $image_path['dir'];\n\t\t\t\t$existing_image = $image_path['file'];\n\t\t\t\tif (!api_is_anonymous()) {\n\t\t\t\t\t$photo= '<a href=\"userInfo.php?'.api_get_cidreq().'&origin='.$origin.'&amp;uInfo='.$user_id.'\" title=\"'.get_lang('Info').'\" ><img src=\"'.$image_repository.$existing_image.'\" alt=\"'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'\" width=\"22\" height=\"22\" title=\"'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'\" /></a>';\n\t\t\t\t} else {\n\t\t\t\t\t$photo= '<img src=\"'.$image_repository.$existing_image.'\" alt=\"'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'\" width=\"22\" height=\"22\" title=\"'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'\" />';\n\t\t\t\t}\n $temp[] = $user_id;\n\t\t\t\t$temp[] = $photo;\n $temp[] = $o_course_user['official_code'];\n\n\t\t\t\tif ($is_western_name_order) {\n\t\t\t\t\t$temp[] = $o_course_user['firstname'];\n\t\t\t\t\t$temp[] = $o_course_user['lastname'];\n\t\t\t\t} else {\n\t\t\t\t\t$temp[] = $o_course_user['lastname'];\n\t\t\t\t\t$temp[] = $o_course_user['firstname'];\n\t\t\t\t}\t\t\t\t\n\t\t\t\t$temp[] = $o_course_user['username'];\n\t\t\t\t$temp[] = $o_course_user['role'];\n\t\t\t\t$temp[] = implode(', ', $groups_name);//Group\n \n if ($course_info['unsubscribe'] == 1) {\n //User id for actions\n $temp[] = $user_id;\n }\n\t\t\t\t//$temp[] = $o_course_user['official_code'];\t\t\t\t\n\t\t\t}\n\t\t\t$a_users[$user_id] = $temp;\n\t\t}\n\t}\n\treturn $a_users;\n}", "function loan_Statistic_Owner($item) {\n\t\t$query = 'SELECT u.name\n\t\t\t\t FROM item i, users u\n\t\t\t\t WHERE i.owner = u.email\n\t\t\t\t AND i.item_name = \\''.$item.'\\';\n\t\t\t\t ';\n\t\t$result = pg_query($query);\n\t\n\t\treturn $result;\n\t}" ]
[ "0.6557293", "0.6434428", "0.5989113", "0.5962029", "0.5959882", "0.590758", "0.58514917", "0.5748956", "0.57301056", "0.5729502", "0.55634993", "0.55399495", "0.5535605", "0.5532563", "0.5503855", "0.54932606", "0.54634356", "0.5460995", "0.54486984", "0.54044485", "0.5376746", "0.53586864", "0.534382", "0.53284097", "0.53006077", "0.52995086", "0.5296955", "0.52874225", "0.5259623", "0.5246046" ]
0.6644231
0
Get the backlogs for the given account
public function getBacklogs($accountId, $includeArchived = false) { $path = 'api/accounts/' . $accountId . '/backlogs.json'; if ($includeArchived) { $path .= '?include_archived=true'; } return $this->getDataApiData($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBacklogs()\n {\n $repo = $this->getRepository('ScrunoBoardBundle:Backlog');\n\n return $repo->findAll();\n }", "public function getHistory($username=\"this\") {\r\n\t\tif ($username==\"this\") return $this->UserDBHelper->getHistory(\"*\");\r\n\t\telse return $this->UserDBHelper->getHistory($username);\r\n\t}", "public function returnLogs () {\n\t\tglobal $cfg, $db;\n\n\t\t$toReturn = [];\n\n\t\t$source = $db->query(sprintf(\"SELECT * FROM %s_history WHERE module = '%s'\", $cfg->db->prefix, \"sys-login\"));\n\n\t\tif($source->num_rows > 0) {\n\t\t\twhile ($data = $source->fetch_object()) {\n\t\t\t\tarray_push($toReturn, $data);\n\t\t\t}\n\t\t}\n\n\t\treturn $toReturn;\n\t}", "public function get_user_billing_history() {\n\t\t\treturn $this->build_request( 'user/billing/history' )->fetch();\n\t\t}", "public function get_all_history()\n {\n $sentence = new SentenceUtil();\n $sentence->fromCommand(\"/system/history/getall\");\n $this->talker->send($sentence);\n $rs = $this->talker->getResult();\n $i = 0;\n if ($i < $rs->size()) {\n return $rs->getResultArray();\n } else {\n return \"No History\";\n }\n }", "private static function get_logs()\n {\n $filter = new LogFilter();\n \n # Will be nice if we stored the ID of the last log we covered previously, but until then\n # use the time period to cover logs that came in the during the time this script was sleeping.\n $filter->set_max_age(EMAIL_ALERT_INTERVAL + 2);\n \n $filter->enable_alert_level(iRAP\\Logging\\LogLevel::ERROR);\n $filter->enable_alert_level(iRAP\\Logging\\LogLevel::CRITICAL);\n $filter->enable_alert_level(iRAP\\Logging\\LogLevel::ALERT);\n $filter->enable_alert_level(iRAP\\Logging\\LogLevel::EMERGENCY);\n \n return LogTable::getInstance()->load_filter(null, null, $filter);\n }", "public function getLogs();", "public function getAllBackups();", "public function index()\n {\n $posts = account::all()->toArray();\n return array_reverse($posts);\n }", "private function getAccount()\n {\n $links = [];\n\n return $links;\n }", "public function getLogs()\n {\n\n $query = \"SELECT\n *\n FROM\n log\n ORDER BY\n id\n desc\n LIMIT 11\";\n\n $stmt = self::$dbh->prepare($query);\n\n $stmt->execute();\n\n return $stmt->fetchall(\\PDO::FETCH_ASSOC);\n }", "public function index()\n {\n $blogs = Blogs::orderBy('id')->get();\n error_log($blogs);\n return $blogs;\n }", "public function index()\n {\n return Account::latest()\n ->where('user_id', auth()->id())\n ->get();\n }", "public function history($account_id, $params = [])\n {\n return $this->httpGet(sprintf('/accounts/%s/ledger', $account_id), $params, 'SIGN');\n }", "public function get_log_including_accounts() {\n\t\tif(is_null($this->id)) throw new BadMethodCallException('Server must be in directory before log entries can be listed');\n\t\t$stmt = $this->database->prepare(\"\n\t\t\t(SELECT se.id, se.actor_id, se.date, se.details, se.server_id, NULL as entity_id, 'server' as type\n\t\t\tFROM server_event se\n\t\t\tWHERE se.server_id = ?\n\t\t\tORDER BY id DESC)\n\t\t\tUNION\n\t\t\t(SELECT ee.id, ee.actor_id, ee.date, ee.details, NULL as server_id, ee.entity_id, 'server account' as type\n\t\t\tFROM server_account sa\n\t\t\tINNER JOIN entity_event ee ON ee.entity_id = sa.entity_id\n\t\t\tWHERE sa.server_id = ?\n\t\t\tORDER BY id DESC)\n\t\t\tORDER BY date DESC, id DESC\n\t\t\");\n\t\t$stmt->bind_param('dd', $this->id, $this->id);\n\t\t$stmt->execute();\n\t\t$result = $stmt->get_result();\n\t\t$log = array();\n\t\twhile($row = $result->fetch_assoc()) {\n\t\t\tif($row['type'] == 'server') {\n\t\t\t\t$log[] = new ServerEvent($row['id'], $row);\n\t\t\t} elseif($row['type'] == 'server account') {\n\t\t\t\t$log[] = new ServerAccountEvent($row['id'], $row);\n\t\t\t}\n\t\t}\n\t\t$stmt->close();\n\t\treturn $log;\n\t}", "public function getList()\n {\n return $this->master->call('account/', 'GET');\n }", "public function loadAccountHistory() {\n $this->layout = 'ajax';\n $authUser = $this->Auth->user();\n $CustomerID = $authUser['player'];\n $freePlay = @$_POST[\"freePlay\"];\n $endDate = new DateTime();\n $iniDate = new DateTime();\n date_sub($iniDate, date_interval_create_from_date_string('15 days'));\n $loadAccHis = array();\n $loadAccHis['data'] = $this->Sportbook->getAccountHistory($CustomerID, $freePlay, date_format($iniDate, 'Y-m-d'), date_format($endDate, 'Y-m-d'));\n $this->set('data', $loadAccHis);\n $this->render('json');\n }", "public function getWallets($account)\n {\n }", "public function searchHistory()\n {\n $searchHistory = SearchLog::where('user_id', auth()->user()->id)->orderBy('id', 'desc')->get();\n\n return response()->json($searchHistory, 200);\n }", "public function indexHistory()\n {\n // if(!Auth::guard('web')->check()){\n // return redirect('/');\n // }\n $history = BorrowedBook::where('user_id', Auth::user()->id)->get();\n\n return view('history', compact('history'));\n }", "public function showLogs()\n {\n return $this->json((new ApiLogsBroker())->findAll());\n }", "public function getAllRevisionLogs();", "public function getBackups()\n {\n return $this->backups;\n }", "function getChatHistory(){\n\t\t$db=JFactory::getDBO();\n\t\t$query = 'SELECT c.*,u.username,u.name,ub.user_id as blocked_users FROM #__openchat_msg as c \n\t\tLEFT JOIN #__users as u ON c.user_id=u.id \n\t\tLEFT JOIN #__openchat_blocked_users as ub ON c.user_id=ub.user_id\n\t\tORDER BY c.id DESC LIMIT '.$this->limitstart.','.$this->perPage;\n\t\t$db->setQuery($query);\n\t\t$db->query();\n\t\t$rows=$db->loadObjectList();\n\t\t$total=$this->getTotal();\n\t\t$this->pagination=new JPagination($total,$this->limitstart,$this->perPage);\n\t\treturn $rows;\n\t}", "public function backlogs($id)\n {\n $user = Auth::user();\n $user_id = $user->id;\n\n if ($user->role_id == 1 || $user->role_id == 2) {\n $data = DB::table('backlogprojectview')->where('project_id', $id)->get();\n return response()->json(['data' => $data], 200);\n } else {\n $member = DB::table('members')->where('user_id', $user_id)->where('project_id', $id)->first();\n $member_id = $member->id;\n\n $data_raw = DB::table('assignees')->where('member_id', $member_id)->get();\n\n $backlog_id = [];\n\n foreach ($data_raw as $value) {\n array_push($backlog_id, $value->backlog_id);\n }\n\n $data = DB::table('backlogprojectview')->whereIn('id', $backlog_id)->where('project_id', $id)->get();\n return response()->json(['data' => $data], 200);\n }\n }", "public function getHistory()\n {\n return $this->_history;\n }", "public function getLoanHistory() {\r\n\t\r\n\t}", "public static function getUsersHistory(int $id)\n {\n return Cash::where('user_id', $id)->get();\n }", "function getAllWorkLogs() {\n $db = DB::getInstance();\n $logs = $db->query(\n \"SELECT s.id, s.last_update, s.note, u.fname, u.lname\n FROM sage_work_log s\n JOIN users u ON u.id = s.user_id\")->results(true);\n return $logs;\n }", "function logs(){\n $result = $this->dma->managementApiCall(\"GET\", \"{$this->hashid}/logs\");\n return $result['response'];\n }" ]
[ "0.75527936", "0.6304079", "0.6303098", "0.59877515", "0.5960305", "0.595604", "0.58837324", "0.5820649", "0.5799671", "0.5799009", "0.5757584", "0.57465357", "0.5731548", "0.57126355", "0.5708327", "0.56932676", "0.5671439", "0.5627151", "0.5618512", "0.56177115", "0.5587802", "0.55870396", "0.558089", "0.55511457", "0.55435735", "0.5537752", "0.5530637", "0.5520052", "0.55002433", "0.5497105" ]
0.7808792
0
Fetch the sprints for a given backlog
public function getSprints($backlogId, $includeStories = false) { $path = 'api/backlogs/' . $backlogId . '/sprints.json'; if ($includeStories) { $path .= '?include_associated_data=true'; } return $this->getDataApiData($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTasksFromSprint($project_id,$sprint_id)\n {\n\t$sql = \"SELECT * FROM Task WHERE sprint_id=\".$sprint_id;\n\t$res = $this->conn->query($sql);\n\treturn $res;\n }", "abstract public function getSprints($project);", "public function getSprint($backlogId, $sprintId, $includeStories = false)\n {\n $path = 'api/backlogs/' . $backlogId . '/sprints/' . $sprintId . '.json';\n\n if ($includeStories) {\n $path .= '?include_associated_data=true';\n }\n\n return $this->getDataApiData($path);\n }", "function burndown($project_key, $assignee = null){\n\t\t\t\n\t\t$boards = $this->jira->get_boards(strtoupper($project_key));//Project key needs to be upper case\n\t\t\n\t\t$current_sprint_id = $this->jira->get_current_sprint_id($project_key);//Get the current sprint ID and use it to build the URL for the burndown json\n\t\t\n\t\t$data = $this->jira->jira_graph_connect($boards->values[0]->id, $current_sprint_id);\n\t\t\n\t\t//Define the sprint timebox\n\t\t$sprint_start_date = '3000-12-31';\n\t\t$sprint_end_date = '2000-12-31';\n\t\tforeach($data->workRateData->rates as $rates){\n\t\t\t//Atlassian store ther unix time stamp as number of miliseconds since epoch -.-\n\t\t\tif(date(\"Y-m-d\", substr($rates->start, 0, -3)) < $sprint_start_date){//Find sprint start date\n\t\t\t\t$sprint_start_date = date(\"Y-m-d\", substr($rates->start, 0, -3));\n\t\t\t}\n\t\t\tif(date(\"Y-m-d\", substr($rates->end, 0, -3)) > $sprint_end_date){//Find sprint end date\n\t\t\t\t$sprint_end_date = date(\"Y-m-d\", substr($rates->end, 0, -3));\n\t\t\t}\n\t\t}\n\n\t\t//Find how much of the sprint has been completed\n\t\t$total_seconds = 0;\n\t\t$issue_array = array();\n\t\tforeach($data->changes as $key => $changes){//$changes is provided in chronological order, so we can just add remove add remove until we get to the end and we should have the right result\n\t\t\t\n\t\t\tif($assignee !== null){//If this is set then this is a personal burndown, so we need to exclude all issues that don't match this assignee\n\t\t\t\t$assignee_issue = $this->jira->get_issue($changes[0]->key);\n\t\t\t\tif(!isset($assignee_issue->fields->assignee->name) || $assignee_issue->fields->assignee->name != $assignee){//Does this issue assignee match the passed in assignee?\n\t\t\t\t\tcontinue;//If it doesn't stop this loop and start the next\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($changes[0]->statC->newValue)){//If an item has a value add it to the array\n\t\t\t\t$issue_array[$changes[0]->key]['value'] = $changes[0]->statC->newValue;\n\t\t\t}elseif(isset($changes[0]->added) && $changes[0]->added == false){//If the item has \"added\": false this means it was removed from the sprint and needs to be unset from our array\n\t\t\t\tunset($issue_array[$changes[0]->key]);\n\t\t\t}\n\t\t\tif(isset($changes[0]->column->done) && $changes[0]->column->done == true){//If done is true then record the timestamp it was completed\n\t\t\t\t$issue_array[$changes[0]->key]['done'] = date(\"Y-m-d\", substr($key, 0, -3));\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t *Now that we have a clean array loop and count to get the total\n\t\t */\n\t\tforeach($issue_array as $ia){\n\t\t\tif(isset($ia['value'])){\n\t\t\t\t$total_seconds = $total_seconds + $ia['value'];//If the changes has hours add them to the total\n\t\t\t}\n\t\t}\n\t\t$total_hours = ($total_seconds/60)/60;//Convert time from seconds to hours\n\t\t\n\t\t/*\n\t\t *Find how many week days there are between sprint start and sprint end excluding weekends\n\t\t *Add these days to an array that we can use to contain our burndown progress\n\t\t */\n\t\t$sprint_days = array();\n\t\t$begin = new DateTime( $sprint_start_date );\n\t\t$end = new DateTime( $sprint_end_date );\n\t\t$end = $end->modify( '+1 day' ); \n\t\t\n\t\t$interval = new DateInterval('P1D');\n\t\t$daterange = new DatePeriod($begin, $interval ,$end);\n\t\t\n\t\tforeach($daterange as $date){\n\t\t\tif($date->format(\"l\") !== \"Saturday\" && $date->format(\"l\") !== \"Sunday\"){//Don't include weekends\n\t\t\t\t$sprint_days[$date->format(\"Y-m-d\")] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t/*\n\t\t *Now that we have an array of days and an array of issues,\n\t\t *loop through the array of issues and add their value to the total for each day\n\t\t */\n\t\tforeach($issue_array as $issue){\n\t\t\tif(isset($issue['done']) && isset($issue['value'])){\n\t\t\t\t//If for what ever reason someone does work on a weekend, move move the work date to the following monday so that it doesn't break the graph.\n\t\t\t\tif(date('w', strtotime($issue['done'])) == 0 || date('w', strtotime($issue['done'])) == 6) {//Is the day on a weekend?\n\t\t\t\t\t$issue['done'] = date('Y-m-d', strtotime(\"next monday\", strtotime($issue['done'])));//If so move the time entry to the next monday\n\t\t\t\t}\n\t\t\t\t$sprint_days[$issue['done']] = $sprint_days[$issue['done']] + $issue['value'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t *Now that we have all of the data in a useable format, build the graph URL\n\t\t */\n\t\t$bench_increment = round($total_hours/count($sprint_days), 2);\n\t\t$bench_daily = $total_hours;\n\n\t\t$bench_string = \"\";\n\t\twhile($bench_daily > 0){//Create a string for the linear line for the optimal burndown bench mark\n\t\t\t$bench_string = $bench_string . round($bench_daily, 0) . \",\";\n\t\t\t$bench_daily = $bench_daily - $bench_increment;//Reduce increment as we count down\n\t\t}\n\t\t$bench_string = $bench_string . \"0\";\n\t\t\n\t\t$progress_string = \"\";\n\t\t$progress_total = $total_hours;\n\t\tforeach($sprint_days as $key => $sprint_day){//Create a string for the sprint progress burn down\n\t\t\tif($key > $this->jira->get_day_in_sydney()){//Line needs to stop after today so break the loop if the $key is greater than today\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$progress_total = $progress_total - (($sprint_day/60)/60);//Convert from seconds to hours and then subtract from total\n\t\t\t$progress_string = $progress_string . \",\" . $progress_total;\n\t\t}\n\t\t$progress_string = $total_hours . $progress_string;\n\n\t\t//Using Image Charts to generate graphs https://image-charts.com/documentation\n\t\t$chart_url = \"https://image-charts.com/chart?cht=lc&chg=10,10,3,2&chd=t:\" . $bench_string . \"|\" . $progress_string . \"&chds=0,\" . $total_hours . \"&chs=500x500&chco=999999,FF0000&chxt=x,y&chxr=0,0,\" . count($sprint_days) . \",1|1,0,\" . $total_hours . \"&chma=30,30,30,30\";\n\t\t\n\t\t//Build and Send the payload\n\t\t$payload['status'] = 200;\n\t\t$payload['success'] = 'true';\n\t\t$payload['url'] = $chart_url;\n\t\t$this->output->set_status_header('200');\n\t\t$this->output->set_header('Content-Type: application/json; charset=utf-8');\n\t\techo json_encode($payload);\n\t}", "public function getSprintStories($sprintId)\n {\n $path = 'api/sprints/' . $sprintId . '/sprint-stories.json';\n\n return $this->getDataApiData($path);\n }", "function getTasksForSprint(PDO $pdo, $sprint)\n{\n $stmt = $pdo->prepare('SELECT \n t.counter as tasknumber,\n t.title as description, \n t.status_id as status,\n t.dev_due_date,\n t.test_due_date,\n t.accp_release_date,\n t.product,\n (SELECT nickname FROM cms_employee_data AS e WHERE e.counter = t.assigned_by LIMIT 1) AS task_owner,\n m.project_id as projectId,\n GROUP_CONCAT(d.nickname) as workers,\n t.sprint\n FROM \n `pmt_tasks` t\n INNER JOIN\n `pmt_modules` m\n ON \n t.module_id = m.counter\n INNER JOIN\n (SELECT nickname, assignment_id FROM cms_employee_data c INNER JOIN pmt_assignment_details ad ON c.counter = ad.assigned_to WHERE ad.is_active = \\'1\\' AND ad.type = \\'TASK\\' ) d\n ON \n d.assignment_id = t.counter\n WHERE t.sprint = :sprint and t.is_active = \\'1\\'\n GROUP BY t.counter\n ORDER BY t.counter;');\n $stmt->bindParam(':sprint', $sprint);\n\n if ($stmt->execute()) {\n return transformPDOResult($stmt, 'T');\n }\n return array();\n}", "public function getTasksOfBoard($backlogId)\n {\n $em = $this->getEm();\n\n $query = $em->createQuery(\n 'SELECT t FROM ScrunoBoardBundle:Task t WHERE t.backlog = :backlog ORDER BY t.position ASC'\n )->setParameter('backlog', $backlogId);\n\n return $query->getResult();\n }", "public function backlogUpdate(Request $request)\n {\n // pending\n\n if (!empty($request->input('pending'))) {\n $data = $request->input('pending');\n $backlogs = DB::table('backlogs')->get();\n\n foreach ($backlogs as $bl) {\n $id = $bl->id;\n foreach ($data as $value) {\n if ($value['id'] == $id) {\n DB::table('backlogs')->where('id', $id)->update([\n 'status_id' => 1,\n ]);\n }\n }\n }\n\n }\n\n // progress\n\n if (!empty($request->input('progress'))) {\n $data = $request->input('progress');\n $backlogs = DB::table('backlogs')->get();\n\n foreach ($backlogs as $bl) {\n $id = $bl->id;\n foreach ($data as $value) {\n if ($value['id'] == $id) {\n DB::table('backlogs')->where('id', $id)->update([\n 'status_id' => 2,\n ]);\n\n // update project status\n\n $b_log = DB::table('backlogs')->where('id', $id)->first();\n\n $pro = DB::table('projects')->where('id', $b_log->project_id)->first();\n\n if ($pro->status_id == 1) {\n DB::table('projects')->where('id', $pro->id)->update([\n 'status_id' => 2,\n ]);\n }\n }\n }\n }\n\n }\n\n // testing\n\n if (!empty($request->input('testing'))) {\n $data = $request->input('testing');\n $backlogs = DB::table('backlogs')->get();\n\n foreach ($backlogs as $bl) {\n $id = $bl->id;\n foreach ($data as $value) {\n if ($value['id'] == $id) {\n DB::table('backlogs')->where('id', $id)->update([\n 'status_id' => 4,\n ]);\n }\n }\n }\n\n }\n\n // completed\n\n if (!empty($request->input('completed'))) {\n $data = $request->input('completed');\n $backlogs = DB::table('backlogs')->get();\n\n foreach ($backlogs as $bl) {\n $id = $bl->id;\n foreach ($data as $value) {\n if ($value['id'] == $id) {\n DB::table('backlogs')->where('id', $id)->update([\n 'status_id' => 3,\n ]);\n }\n }\n }\n\n }\n\n }", "function getTasksForSprintAndPrevious(PDO $pdo, $sprint)\n{\n $acceptance_release_date = getSprintAcceptanceReleaseDate($pdo, $sprint);\n\n $stmt = $pdo->prepare('SELECT \n t.counter as tasknumber,\n t.title as description, \n t.status_id as status,\n t.dev_due_date,\n t.test_due_date,\n t.accp_release_date,\n t.product,\n (SELECT nickname FROM cms_employee_data AS e WHERE e.counter = t.assigned_by LIMIT 1) AS task_owner,\n m.project_id as projectId,\n GROUP_CONCAT(d.nickname) as workers,\n t.sprint\n FROM \n `pmt_tasks` t\n INNER JOIN\n `pmt_modules` m\n ON \n t.module_id = m.counter\n INNER JOIN\n (SELECT nickname, assignment_id FROM cms_employee_data c INNER JOIN pmt_assignment_details ad ON c.counter = ad.assigned_to WHERE ad.is_active = \\'1\\' AND ad.type = \\'TASK\\' ) d\n ON \n d.assignment_id = t.counter\n WHERE \n (t.status_id NOT IN (10) and t.is_active = \\'1\\' and t.sprint != \"\" and t.accp_release_date < :acceptance_release_date)\n OR \n (t.sprint = :sprint and t.is_active = \\'1\\')\n GROUP BY t.counter\n ORDER BY t.counter;');\n $stmt->bindParam(':acceptance_release_date', $acceptance_release_date);\n $stmt->bindParam(':sprint', $sprint);\n\n if ($stmt->execute()) {\n return transformPDOResult($stmt, 'T');\n }\n return array();\n}", "public function findAll()\n {\n return ProjectSprintTask::all();\n }", "public static function getSprintsByProjectId($project_id):array{\n $sprints = Sprints::where('project_id',$project_id)->get()->toArray();\n return $sprints;\n }", "function pleyers_get_sprints( $query ) {\n\t if ( is_admin() || ! $query->is_main_query() ) {\n\t return;\n\t }\n\n \tif ( is_archive() && !is_post_type_archive( 'sprints' ) ) {\n $query->set( 'posts_per_page', 20 );\n\t $query->set('orderby', 'date');\n $query->set( 'order', 'DESC' );\n\n return;\n }\n\n\t if ( is_post_type_archive( 'sprints' ) ) {\n\t $query->set( 'posts_per_page', 5 );\n\t $query->set('orderby', 'date');\n\t $query->set('order', 'DESC');\n\n\t return;\n\t }\n\n\t if ( is_search() ) {\n\t \t$query->set( 'posts_per_page', 10 );\n\t $query->set('orderby', 'date');\n $query->set( 'order', 'DESC' );\n\t\t}\n\n\t}", "function retrieveSchedulers() {\n\t\t$GLOBALS['log']->info('Gathering Schedulers');\n\t\t$executeJobs = array();\n\t\t$query \t= \"SELECT id \" .\n\t\t\t\t\"FROM schedulers \" .\n\t\t\t\t\"WHERE deleted=0 \" .\n\t\t\t\t\"AND status = 'Active' \" .\n\t\t\t\t\"AND date_time_start < \".db_convert(\"'\".TimeDate::getInstance()->nowDb().\"'\",'datetime').\" \" .\n\t\t\t\t\"AND (date_time_end > \".db_convert(\"'\".TimeDate::getInstance()->nowDb().\"'\",'datetime').\" OR date_time_end IS NULL)\";\n\t\t\t\t\n\t\t$result\t= $this->db->query($query);\n\t\t$rows=0;\n\t\t$executeTimes = array();\n\t\t$executeIds = array();\n\t\t$executeJobTimes = array();\n\t\twhile(($arr = $this->db->fetchByAssoc($result)) != null) {\n\t\t\t$focus = BeanFactory::getBean('Schedulers', $arr['id']);\n\t\t\t$executeTimes[$rows] = $this->deriveDBDateTimes($focus);\n\t\t\tif(count($executeTimes) > 0) {\n\t\t\t\tforeach($executeTimes as $k => $time) {\n\t\t\t\t$executeIds[$rows] = $focus->id;\n\t\t\t\t\t$executeJobTimes[$rows] = $time;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$rows++;\n\t\t}\n\t\t$executeJobs['ids'] = $executeIds;\n\t\t$executeJobs['times'] = $executeJobTimes;\n\t\treturn $executeJobs;\n\t}", "protected function _getReleases() { }", "public function getProductionsNextPerformances($production_title) {\r\n\t\t$this_query_name = \"#getProductionsNextPerformances\";\r\n\t\tif (!array_key_exists($this_query_name, $this->prepared_quieres)) {\r\n\t\t\t$sql = \"SELECT * \r\n\t\t\t\tFROM Performance\r\n\t\t\t\tWHERE \r\n\t\t\t\t\tPerformance.title = :title\r\n\t\t\t\t\tAND\r\n\t\t\t\t\tPerformance.date_time > (SELECT current_date)\r\n\t\t\t\tORDER BY Performance.date_time\";\r\n\t\t\t//prepare\r\n\t\t\t$this->makePreparedQuery($this_query_name, $sql);\r\n\t\t}\r\n\t\t//build the params\t\t\r\n\t\t$params = array(\":title\" => $production_title);\r\n\t\t//return the results\r\n\t\treturn $this->executePreparedQuery($this_query_name, $params);\r\n\t}", "public static function getStories2($id, $user){\n $stories = DB::table('project AS p')\n ->join('sprint AS s', 'p.id', 's.project_id')\n ->join('user_story AS us', 's.id', 'us.sprint_id')\n ->join('user_user_story as uus', 'uus.user_story_id', 'us.id')\n ->join('users as u', 'uus.user_id', 'u.id')\n ->select('p.id as project_id', 's.id as sprint_id', 's.name as sprint_name', 's.duration', 's.state as sprint_state',\n 'us.id as story_id', 'us.name as story_name', 'us.priority', 'us.state as story_state', \n 'uus.state as uu_story_state', 'uus.worked_hours as story_worked_hours')\n ->where('s.id', '=', $id)\n ->where('u.id',$user)\n ->orderby('us.priority', 'desc');\n \n return $stories->distinct()->get();\n \n }", "function pull_sports() {\n global $CFG, $USER;\n $context = get_context_instance(CONTEXT_SYSTEM);\n\n if (has_capability('block/student_gradeviewer:sportsadmin', $context)) {\n $sports = get_records('block_courseprefs_sports');\n } else {\n $sql = \"SELECT spo.* FROM {$CFG->prefix}block_courseprefs_sports spo,\n {$CFG->prefix}block_student_sports spm\n WHERE spm.usersid = {$USER->id}\n AND spm.path = spo.id\";\n $sports = get_records_sql($sql);\n }\n\n if(!$sports) {\n $sports = array();\n }\n\n return array_map('flatten_sport', $sports);\n}", "public function index($project_id = 0, $productbacklogid = 0)\n { \n if ($this->session->userdata('logged_in'))\n {\n $session_data = $this->session->userdata('logged_in');\n $data['sprint_backlogs'] = \n $this->sprint_backlog_model->read_all($productbacklogid);\n $data['currentproductbacklogid'] = $productbacklogid;\n $productbacklog = \n $this->product_backlog_model->read($productbacklogid);\n $data['productbacklog'] = $productbacklog;\n $data['main_content'] = 'sprint_backlog/sprint_backlogs_view';\n $data['project_id'] = $project_id;\n\n $project = $this->project_model->read($project_id);\n\n if (isset($productbacklog[0]))\n {\n $data['pagetitle'] = $project[0]->project_name . ', ' . \n $productbacklog[0]->backlog_name . ': ' .\n $this->lang->line('title_sprint_backlogs');\n }\n\n else\n {\n $data['pagetitle'] = $this->lang->line('title_sprint_backlogs');\n }\n\n $data['error_message'] = \n $this->session->flashdata('$error_message');\n $data['heading'] = $this->lang->line('title_db_error');\n $data['login_user_id'] = $session_data['user_id'];\n $data['login_id'] = $session_data['id'];\n $this->load->view('template', $data);\n }\n else\n {\n redirect('login','refresh');\n }\n }", "public static function fetchProjectsFromQueue()\n {\n foreach (['jlQueueId' => 'jlProjectId', 'jsQueueId' => 'jsProjectId'] as $queueType => $projectType) {\n if (session()->has($queueType)) {\n // check job queue for finished pf project\n $jobQueue = (new JobQueue)->find(session()->get($queueType));\n $jobQueue->getJobResult();\n if ('done' == $jobQueue->status) {\n session([$projectType => $jobQueue->getResult()['projectId']]);\n }\n session()->forget($queueType);\n }\n }\n }", "function wporg_get_featured_workshops( $number = 1 ) {\n\t$query = wporg_get_archive_query(\n\t\t'wporg_workshop',\n\t\tarray(\n\t\t\t'posts_per_page' => $number,\n\t\t)\n\t);\n\n\treturn $query->get_posts();\n}", "public static function detailSprint($id){\n $record = DB::table('sprint AS s')\n ->select('s.name')\n ->where('s.id', '=', $id)\n ->first();\n return $record;\n }", "public static function findBySprintId(string $id)\n {\n $attrs = self::parseSprintId($id);\n\n return Sprint::whereWeek($attrs['week'])\n ->where('year', 'like', '%'.$attrs['year'])\n ->firstOrFail();\n }", "public function getBacklogStats($accountId, $backlogId) {\n $path = 'api/accounts/' . $accountId . '/backlogs/' . $backlogId .'/stats.json';\n\n return $this->getDataApiData($path);\n }", "public static function retrieveFeeds() {\n\t\t\t$intervals = array('daily');\n\t\t\t$day = date('N');\n\t\t\tif ($day == '6') {\n\t\t\t\t$intervals[] = 'weekly';\n\t\t\t}\n\t\t\t$week = date('W');\n\t\t\tif ($week % 2 == 0) {\n\t\t\t\t$intervals[] = 'bi weekly';\n\t\t\t}\n\t\t\t$day_of_month = date('j');\n\t\t\tif ($day_of_month == 1) {\n\t\t\t\t$intervals[] = 'monthly';\n\t\t\t}\n\t\t\t$month = date('n');\n\t\t\tif ($month % 2 == 0) {\n\t\t\t\t$intervals[] = 'bi monthly';\n\t\t\t}\n\t\t\tif ($month % 6 == 0) {\n\t\t\t\t$intervals[] = '6 months';\n\t\t\t}\n\t\t\t$sql = \"SELECT * \n\t\t\t\tFROM `feeds` \n\t\t\t\tWHERE `status` = 'active' \n\t\t\t\tAND `interval` IN ('\".implode(\"', '\", $intervals).\"') \n\t\t\t\tORDER BY `priority` ASC\";\n\t\t\t$result = query($sql);\n\t\t\treturn $result->fetchAll();\n\t\t}", "public function getQueues();", "public function getRegressions(Request $request, $project_key)\n {\n $where = $this->getIssueQueryWhere($project_key, $request->all());\n\n $his_resolvers = $request->input('his_resolvers') ? explode(',', $request->input('his_resolvers')) : [];\n $or = [];\n foreach ($his_resolvers as $resolver)\n {\n $or[] = [ 'his_resolvers' => $resolver ];\n }\n if ($or)\n {\n $where['$and'][] = [ '$or' => $or ];\n }\n\n $where['$and'][] = [ 'regression_times' => [ '$exists' => 1 ] ];\n\n $sprint_start_time = $sprint_complete_time = 0;\n $sprint_no = $request->input('sprint') ?: '';\n if ($sprint_no)\n {\n $sprint = Sprint::where('project_key', $project_key)->where('no', intval($sprint_no))->first();\n\n $sprint_start_time = strtotime(date('Ymd', $sprint->start_time));\n if (isset($sprint->real_complete_time) && $sprint->real_complete_time > 0)\n {\n $sprint_complete_time = $sprint->real_complete_time;\n }\n }\n\n $dimension = $request->input('stat_dimension') ?: '';\n if ($dimension)\n {\n $results = [];\n }\n else\n {\n $results = [ 'ones' => [], 'gt_ones' => [] ];\n }\n\n $results = [];\n $query = DB::collection('issue_' . $project_key)->whereRaw($where);\n $issues = $query->orderBy('no', 'desc')->take(1000)->get();\n foreach($issues as $issue)\n {\n $no = $issue['no'];\n $regression_times = $issue['regression_times'];\n $resolved_logs = isset($issue['resolved_logs']) ? $issue['resolved_logs'] : [];\n\n if ($sprint_start_time > 0)\n {\n $tmp_log = [];\n foreach($resolved_logs as $rl)\n {\n if ($rl['at'] > $sprint_start_time && ($sprint_complete_time <= 0 || $rl['at'] < $sprint_complete_time))\n {\n if ($his_resolvers && !in_array($rl['user']['id'], $his_resolvers))\n {\n continue;\n }\n else\n {\n $tmp_log[] = $rl;\n }\n }\n }\n if (!$tmp_log)\n {\n continue;\n }\n\n $resolved_logs = $tmp_log;\n $regression_times = count($tmp_log);\n }\n\n if ($dimension == 'resolver')\n {\n $log_cnt = count($resolved_logs);\n $tmp_uids = [];\n foreach ($resolved_logs as $key => $log) \n {\n $uid = $log['user']['id'];\n if (in_array($uid, $tmp_uids))\n {\n continue;\n }\n else\n {\n $tmp_uids[] = $uid;\n }\n \n if (!isset($results[$uid]))\n {\n $results[$uid] = [ 'ones' => [], 'gt_ones' => [], 'name' => isset($log['user']['name']) ? $log['user']['name'] : '' ];\n }\n if ($regression_times > 1)\n {\n if ($key == $log_cnt - 1)\n {\n $results[$uid]['ones'][] = $no;\n }\n else\n {\n $results[$uid]['gt_ones'][] = $no;\n }\n }\n else\n {\n $results[$uid]['ones'][] = $no;\n }\n }\n }\n else if ($dimension)\n {\n $dimension_values = isset($issue[$dimension]) ? $issue[$dimension] : '';\n if ($dimension_values && is_array($dimension_values))\n {\n if (isset($dimension_values['id']))\n {\n if (!isset($results[$dimension_values['id']]))\n {\n $results[$dimension_values['id']] = [ 'ones' => [], 'gt_ones' => [], 'name' => isset($dimension_values['name']) ? $dimension_values['name'] : '' ];\n }\n if ($regression_times > 1)\n {\n $results[$dimension_values['id']]['gt_ones'][] = $no;\n }\n else\n {\n $results[$dimension_values['id']]['ones'][] = $no;\n }\n }\n else\n {\n foreach($dimension_values as $val)\n {\n if (!isset($results[$val]))\n {\n $results[$val] = [ 'ones' => [], 'gt_ones' => [] ];\n }\n\n if ($regression_times > 1)\n {\n $results[$val]['gt_ones'][] = $no;\n }\n else\n {\n $results[$val]['ones'][] = $no;\n }\n } \n }\n }\n else if ($dimension_values)\n {\n if (!isset($results[$dimension_values]))\n {\n $results[$dimension_values] = [ 'ones' => [], 'gt_ones' => [] ];\n }\n\n if ($regression_times > 1)\n {\n $results[$dimension_values]['gt_ones'][] = $no;\n }\n else\n {\n $results[$dimension_values]['ones'][] = $no;\n }\n }\n }\n else\n {\n if (!isset($results[0]))\n {\n $results[0] = [ 'ones' => [], 'gt_ones' => [] ];\n }\n if ($regression_times > 1)\n {\n $results[0]['gt_ones'][] = $no;\n }\n else\n {\n $results[0]['ones'][] = $no;\n }\n }\n }\n return Response()->json([ 'ecode' => 0, 'data' => $this->arrangeRegressionData($results, $project_key, $dimension) ]);\n }", "public function backlogs($id)\n {\n $user = Auth::user();\n $user_id = $user->id;\n\n if ($user->role_id == 1 || $user->role_id == 2) {\n $data = DB::table('backlogprojectview')->where('project_id', $id)->get();\n return response()->json(['data' => $data], 200);\n } else {\n $member = DB::table('members')->where('user_id', $user_id)->where('project_id', $id)->first();\n $member_id = $member->id;\n\n $data_raw = DB::table('assignees')->where('member_id', $member_id)->get();\n\n $backlog_id = [];\n\n foreach ($data_raw as $value) {\n array_push($backlog_id, $value->backlog_id);\n }\n\n $data = DB::table('backlogprojectview')->whereIn('id', $backlog_id)->where('project_id', $id)->get();\n return response()->json(['data' => $data], 200);\n }\n }", "public function getSprintStory($sprintId, $storyId)\n {\n $path = 'api/sprints/' . $sprintId . '/sprint-stories/' . $storyId .'.json';\n\n return $this->getDataApiData($path);\n }", "public function getJobs($limit);", "protected function get()\n\t{\n\t\tif (request()->has('_storyblok') || !config('storyblok.cache')) {\n\t\t\t$response = $this->makeRequest();\n\t\t} else {\n\t\t\t$uniqueTag = md5(serialize($this->getSettings()));\n\n\t\t\t$response = Cache::remember($this->cacheKey . $this->slug . '-' . $uniqueTag, config('storyblok.cache_duration') * 60, function () {\n\t\t\t\treturn $this->makeRequest();\n\t\t\t});\n\t\t}\n\n\t\t$this->totalStories = $response['headers']['Total'][0];\n\n\t\treturn collect($response['stories']);\n\t}" ]
[ "0.6484543", "0.60912675", "0.607182", "0.55817056", "0.53890556", "0.53649247", "0.52681416", "0.5261578", "0.5235714", "0.5137166", "0.51056236", "0.50641257", "0.506081", "0.50545675", "0.5001446", "0.49823067", "0.4942836", "0.4936113", "0.4925102", "0.48673433", "0.483662", "0.48362073", "0.4834727", "0.47718498", "0.47679684", "0.47500518", "0.4717989", "0.47098544", "0.4697703", "0.4695702" ]
0.6475765
1
Fetch Sprint Stories (meta data about the story in a sprint) for a given sprint
public function getSprintStories($sprintId) { $path = 'api/sprints/' . $sprintId . '/sprint-stories.json'; return $this->getDataApiData($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSprintStory($sprintId, $storyId)\n {\n $path = 'api/sprints/' . $sprintId . '/sprint-stories/' . $storyId .'.json';\n\n return $this->getDataApiData($path);\n }", "public function getSprints($backlogId, $includeStories = false)\n {\n $path = 'api/backlogs/' . $backlogId . '/sprints.json';\n\n if ($includeStories) {\n $path .= '?include_associated_data=true';\n }\n\n return $this->getDataApiData($path);\n }", "abstract public function getSprints($project);", "protected function get()\n\t{\n\t\tif (request()->has('_storyblok') || !config('storyblok.cache')) {\n\t\t\t$response = $this->makeRequest();\n\t\t} else {\n\t\t\t$uniqueTag = md5(serialize($this->getSettings()));\n\n\t\t\t$response = Cache::remember($this->cacheKey . $this->slug . '-' . $uniqueTag, config('storyblok.cache_duration') * 60, function () {\n\t\t\t\treturn $this->makeRequest();\n\t\t\t});\n\t\t}\n\n\t\t$this->totalStories = $response['headers']['Total'][0];\n\n\t\treturn collect($response['stories']);\n\t}", "public function get_stories(): array {\n\t\t$stories_query = new WP_Query();\n\n\t\t/**\n\t\t * List of story posts.\n\t\t *\n\t\t * @var WP_Post[] $result\n\t\t */\n\t\t$result = $stories_query->query( $this->query_args );\n\n\t\tupdate_post_thumbnail_cache( $stories_query );\n\n\t\treturn $result;\n\t}", "public function getstoryfromslug($slug){\n $result_story = $this->findOneBy(array(\n \"slug\" => $slug,\n \"story_is_allowed\"=>'1'\n ),'story');\n return $result_story;\n }", "public function getSprint($backlogId, $sprintId, $includeStories = false)\n {\n $path = 'api/backlogs/' . $backlogId . '/sprints/' . $sprintId . '.json';\n\n if ($includeStories) {\n $path .= '?include_associated_data=true';\n }\n\n return $this->getDataApiData($path);\n }", "public function getStories() {\n\t\tif (!$this->isLibrary()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ($this->stories === null) {\n\t\t\t// get stories from cache\n\t\t\t$this->stories = 0;\n\t\t\t$cache = WCF::getCache()->get('libraryData', 'counts');\n\t\t\tif (isset($cache[$this->libraryID]['stories']))\n\t\t\t\t$this->stories = $cache[$this->libraryID]['stories'];\n\t\t}\n\n\t\treturn $this->stories;\n\t}", "public static function retrieveByStory( $story ) {\n $query = Doctrine_Query::create()\n ->select('sr.*')\n ->from('StoryRating sr')\n ->where('sr.story_id = ? AND user_id <> 1', $story['id']);\n return $query->execute();\n }", "public function fetchStories($total = 20) {\n \n $current_page = 0;\n $nb_stories = 0;\n $stories = [];\n \n while($nb_stories < $total) {\n \n // fetch new page\n $html = file_get_contents($this->url . $current_page);\n $dom = new DOMDocument();\n @$dom->loadHTML('<?xml encoding=\"UTF-8\">' . $html);\n $xpath = new DOMXPath($dom);\n $tags = $xpath->query($this->path);\n \n // fetch stories from page\n foreach($tags as $tag) {\n \n // Format story\n $story = $this->splitStory($tag, $xpath);\n\n if($nb_stories < $total) {\n $stories[] = $story;\n $nb_stories++;\n }\n }\n \n $current_page++;\n \n }\n return $stories;\n }", "public static function getStories2($id, $user){\n $stories = DB::table('project AS p')\n ->join('sprint AS s', 'p.id', 's.project_id')\n ->join('user_story AS us', 's.id', 'us.sprint_id')\n ->join('user_user_story as uus', 'uus.user_story_id', 'us.id')\n ->join('users as u', 'uus.user_id', 'u.id')\n ->select('p.id as project_id', 's.id as sprint_id', 's.name as sprint_name', 's.duration', 's.state as sprint_state',\n 'us.id as story_id', 'us.name as story_name', 'us.priority', 'us.state as story_state', \n 'uus.state as uu_story_state', 'uus.worked_hours as story_worked_hours')\n ->where('s.id', '=', $id)\n ->where('u.id',$user)\n ->orderby('us.priority', 'desc');\n \n return $stories->distinct()->get();\n \n }", "public function getStories($project, $filter = '') {\n\n\t\t\t// Encode the filter\n\t\t\t$filter = urlencode($filter);\n\n\t\t\t// Make the fields safe\n\t\t\t$filter = escapeshellcmd($filter);\n\t\t\t$project = escapeshellcmd($project);\n\n\t\t\t// Request the stories\n\t\t\t$cmd = \"curl -H \\\"X-TrackerToken: {$this->token}\\\" \"\n\t\t\t\t . \"-X GET \"\n\t\t\t\t . \"https://www.pivotaltracker.com/services/v3/projects/$project/stories\";\n\t\t\t// Add the filter, if it was specified\n\t\t\tif ($filter != '') $cmd .= \"?filter=$filter\";\n\t\t\t$xml = shell_exec($cmd);\n\t\t\t\n\t\t\t// Return an object\n\t\t\t$story = new SimpleXMLElement($xml);\n\t\t\treturn $story;\n\t\n\t\t}", "public function stories() {\n return $this->hasMany(User_StoryModel::class,'sprint_id', 'id');\n }", "public static function findBySprintId(string $id)\n {\n $attrs = self::parseSprintId($id);\n\n return Sprint::whereWeek($attrs['week'])\n ->where('year', 'like', '%'.$attrs['year'])\n ->firstOrFail();\n }", "public function show(Story $story)\n {\n //\n dd($story);\n }", "public function show(Story $story)\n {\n //\n }", "public function frontpage()\n {\n $sections = StoryRepository::getFrontPageSectionStories();\n// dd($sections);\n\n \n\n foreach ($sections['news'] as $story) {\n \n if($story->subsection_id != 0){\n $subsection = SubSection::with(['section'])->where('id', $story->subsection_id)->first();\n $story->Asection = $subsection->name;\n $story->Aurl = \"/section/\" . $subsection->section->slug . \"/\" . $subsection->slug;\n }\n else{\n $section = Section::where('id', $story->section_id)->first();\n $story->Asection = $section->name;\n $story->Aurl = \"/section/\" . $section->slug;\n }\n }\n\n foreach ($sections['sports'] as $story) {\n \n if($story->subsection_id != 0){\n $subsection = SubSection::with(['section'])->where('id', $story->subsection_id)->first();\n $story->Asection = $subsection->name;\n $story->Aurl = \"/section/\" . $subsection->section->slug . \"/\" . $subsection->slug;\n }\n else{\n $section = Section::where('id', $story->section_id)->first();\n $story->Asection = $section->name;\n $story->Aurl = \"/section/\" . $section->slug;\n }\n }\n\n foreach ($sections['opinion'] as $story) {\n \n if($story->subsection_id != 0){\n $subsection = SubSection::with(['section'])->where('id', $story->subsection_id)->first();\n $story->Asection = $subsection->name;\n $story->Aurl = \"/section/\" . $subsection->section->slug . \"/\" . $subsection->slug;\n }\n else{\n $section = Section::where('id', $story->section_id)->first();\n $story->Asection = $section->name;\n $story->Aurl = \"/section/\" . $section->slug;\n }\n }\n\n // dd($sections);\n\n\n $minutes = 720;\n\n\n $latest = Story::with(['section'])->latest('publish_date')->take(5)->get();\n\n\n // $latest = Cache::remember('latestStories', $minutes, function () {\n // return Story::with(['section'])->latest('publish_date')->take(7)->get();\n // });\n\n \n //$latest = Story::with(['section'])->latest()->take(10)->get();\n\n // check WebFront.php for result\n // currently this will return every story with a unique priority... 7/28/2018\n $frontPageStories = WebFront::frontPage();\n\n foreach ($frontPageStories as $story) {\n \n if($story->subsection_id != 0){\n $subsection = SubSection::with(['section'])->where('id', $story->subsection_id)->first();\n $story->Asection = $subsection->name;\n $story->Aurl = \"/section/\" . $subsection->section->slug . \"/\" . $subsection->slug;\n }\n else{\n $section = Section::where('id', $story->section_id)->first();\n $story->Asection = $section->name;\n $story->Aurl = \"/section/\" . $section->slug;\n }\n }\n\n //dd($frontPageStories);\n\n // returns array of 2 cube ads & 1 banner ad\n // increases served counters\n $ads = AdRepository::cubesAndBanner(2,1);\n\n // gets latest issue model\n $issue = Issue::with(['layout'])->latest('id')->whereNotNull('issu_url')->first();\n\n //dd($ads);\n\n return view('stories.index', compact('sections', 'latest', 'frontPageStories', 'ads', 'issue'));\n }", "function getTasksFromSprint($project_id,$sprint_id)\n {\n\t$sql = \"SELECT * FROM Task WHERE sprint_id=\".$sprint_id;\n\t$res = $this->conn->query($sql);\n\treturn $res;\n }", "function pleyers_get_sprints( $query ) {\n\t if ( is_admin() || ! $query->is_main_query() ) {\n\t return;\n\t }\n\n \tif ( is_archive() && !is_post_type_archive( 'sprints' ) ) {\n $query->set( 'posts_per_page', 20 );\n\t $query->set('orderby', 'date');\n $query->set( 'order', 'DESC' );\n\n return;\n }\n\n\t if ( is_post_type_archive( 'sprints' ) ) {\n\t $query->set( 'posts_per_page', 5 );\n\t $query->set('orderby', 'date');\n\t $query->set('order', 'DESC');\n\n\t return;\n\t }\n\n\t if ( is_search() ) {\n\t \t$query->set( 'posts_per_page', 10 );\n\t $query->set('orderby', 'date');\n $query->set( 'order', 'DESC' );\n\t\t}\n\n\t}", "public function getStoryByUrl($url, $path = '') {\n $result = $this->clientRequest($this->storyServer . '/stories/' . $this->keyId . '/url/' . $url);\n return [\n \"url\" => $url,\n \"data\" => $result['data'],\n \"raw\" => $result['raw'],\n \"safeJson\" => $result['safeJson'],\n \"appServer\" => (empty($path)) ? $this->appServer : $this->appServer . '/' . $path\n ];\n }", "public static function detailSprint($id){\n $record = DB::table('sprint AS s')\n ->select('s.name')\n ->where('s.id', '=', $id)\n ->first();\n return $record;\n }", "private function get_stories($catID)\n\t{\n\t\tglobal $do_not_duplicate;\n\t\t$query = new WP_Query(array('posts_per_page' => 3, 'offset' => 2, 'cat' => $catID, 'post__not_in' => $do_not_duplicate));\n\n\t\twhile($query->have_posts())\n\t\t{\n\t\t\t$query->the_post();\n\t\t\techo '<li class=\"story-item\">';\t\t\n\t\t\tprintf('<a class=\"text-headline-small\" href=\"%1$s\">%2$s</a>', get_the_permalink(), get_the_title());\n\t\t\tprintf('<div class=\"category-author\">By %1$s | %2$s</div>', coauthors_posts_links(null, null, null, null, false), get_the_date('M. j, Y'));\n\t\t\tprintf('<p>%1$s</p>', get_the_excerpt());\n\t\t\techo '</li>';\n\t\t}\t\n\t}", "public function getAlsoReadStories($story) {\n\t\t$also_read_story_ids = array();\n\t\tforeach ($story['cards'] as $card) {\n\t\t\tforeach ($card['story-elements'] as $StoryElement) {\n\t\t\t\tif($StoryElement['subtype'] == 'also-read') {\n\t\t\t\t\t$also_read_story_ids[] = $StoryElement['metadata']['linked-story']['id'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $also_read_story_ids;\n\t}", "public function index()\n {\n return Story::all();\n }", "public function get_top_stories()\n {\n \t$client = new Client();\n \t$url_string = $this->base_api.\"topstories\".$this->after_item;\n \t$response = $client->get($url_string);\n \t$response = $response->json();\n \treturn $response;\n }", "public function getStoriesFromTheme() {\n \n $stories = array(); \n foreach ($this->getThemes(true) AS $theme) {\n if (is_array($theme['stories'])) {\n foreach ($theme['stories'] as &$story) {\n $story['score_50'] = empty($story['score_50'])?null:(int)$story['score_50'];\n $story['theme_unique_id'] = $theme['code'] . $story['unique_id'];\n }\n $stories = array_merge($stories, $theme['stories']); \n }\n }\n\n return $stories;\n }", "public function getAlsoReadStory($story) {\n\n\t\t$also_read_ids = array_unique($this->getAlsoReadStories($story));\n\t\t$AlsoReadArray = array();\n\n\t\tforeach ($also_read_ids as $id) {\n\n //fetching story information from story id\n\t\t\t$story = $this->client->storyById($id)['story'];\n\n\t\t\t$readarray['linked-story-id'] = $story['story-content-id'];\n\t\t\t$readarray['subheadline'] = $story['subheadline'];\n\t\t\t$readarray['hero-image-caption'] = $story['hero-image-caption'];\n\t\t\t$readarray['slug'] = $story['slug'];\n\n\t\t\t$AlsoReadArray[] = $readarray;\n\n\t\t}\n\t\treturn $AlsoReadArray;\n\t}", "function wporg_get_featured_workshops( $number = 1 ) {\n\t$query = wporg_get_archive_query(\n\t\t'wporg_workshop',\n\t\tarray(\n\t\t\t'posts_per_page' => $number,\n\t\t)\n\t);\n\n\treturn $query->get_posts();\n}", "public function test_get_stories_count(): void {\n\t\t$story_posts = self::$testee->get_stories();\n\t\t$this->assertCount( 1, $story_posts );\n\t}", "public function getStoryById($storyId, $path = '') {\n $result = $this->clientRequest($this->storyServer . '/stories/' . $this->keyId . '/' . $storyId);\n return [\n \"storyId\" => $storyId,\n \"data\" => $result['data'],\n \"raw\" => $result['raw'],\n \"safeJson\" => $result['safeJson'],\n \"appServer\" => (empty($path)) ? $this->appServer : $this->appServer . '/' . $path\n ];\n }" ]
[ "0.6160219", "0.5945436", "0.5715027", "0.57087755", "0.5691529", "0.5684382", "0.5667479", "0.54186755", "0.5379228", "0.53268033", "0.52904207", "0.5212046", "0.51998365", "0.50431126", "0.5032817", "0.5020535", "0.49892813", "0.4959408", "0.4957655", "0.49418056", "0.49268472", "0.48870134", "0.48836708", "0.48824602", "0.4877884", "0.4866555", "0.4823519", "0.482195", "0.48174033", "0.4814316" ]
0.6758283
0
Fetch Sprint Story (meta data about the story in a sprint) for a given sprint and story
public function getSprintStory($sprintId, $storyId) { $path = 'api/sprints/' . $sprintId . '/sprint-stories/' . $storyId .'.json'; return $this->getDataApiData($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function retrieveByStory( $story ) {\n $query = Doctrine_Query::create()\n ->select('sr.*')\n ->from('StoryRating sr')\n ->where('sr.story_id = ? AND user_id <> 1', $story['id']);\n return $query->execute();\n }", "public function getstoryfromslug($slug){\n $result_story = $this->findOneBy(array(\n \"slug\" => $slug,\n \"story_is_allowed\"=>'1'\n ),'story');\n return $result_story;\n }", "public function show(Story $story)\n {\n //\n dd($story);\n }", "public function show(Story $story)\n {\n //\n }", "public function getStory($user, $story){\n\t\t\t$sql=\"SELECT * FROM stories WHERE idstories = \".$story. \" AND users = \".$user;\n\t\t\t\n \n\t\t\t$this->query($sql);\n\n\t\t\t$res=$this->execute();\n\n\t\t\tif($res){\n\t\t\t\t$result=$this->resultset();\n\t\t\t\t\t\t\t\n\t\t\t}else {$result=null;}\n\t\t\treturn $result;\n\t\t\t}", "public function getAlsoReadStory($story) {\n\n\t\t$also_read_ids = array_unique($this->getAlsoReadStories($story));\n\t\t$AlsoReadArray = array();\n\n\t\tforeach ($also_read_ids as $id) {\n\n //fetching story information from story id\n\t\t\t$story = $this->client->storyById($id)['story'];\n\n\t\t\t$readarray['linked-story-id'] = $story['story-content-id'];\n\t\t\t$readarray['subheadline'] = $story['subheadline'];\n\t\t\t$readarray['hero-image-caption'] = $story['hero-image-caption'];\n\t\t\t$readarray['slug'] = $story['slug'];\n\n\t\t\t$AlsoReadArray[] = $readarray;\n\n\t\t}\n\t\treturn $AlsoReadArray;\n\t}", "public function story() : Story \n {\n return $this->story;\n }", "protected function get()\n\t{\n\t\tif (request()->has('_storyblok') || !config('storyblok.cache')) {\n\t\t\t$response = $this->makeRequest();\n\t\t} else {\n\t\t\t$uniqueTag = md5(serialize($this->getSettings()));\n\n\t\t\t$response = Cache::remember($this->cacheKey . $this->slug . '-' . $uniqueTag, config('storyblok.cache_duration') * 60, function () {\n\t\t\t\treturn $this->makeRequest();\n\t\t\t});\n\t\t}\n\n\t\t$this->totalStories = $response['headers']['Total'][0];\n\n\t\treturn collect($response['stories']);\n\t}", "public function getStoryById($storyId, $path = '') {\n $result = $this->clientRequest($this->storyServer . '/stories/' . $this->keyId . '/' . $storyId);\n return [\n \"storyId\" => $storyId,\n \"data\" => $result['data'],\n \"raw\" => $result['raw'],\n \"safeJson\" => $result['safeJson'],\n \"appServer\" => (empty($path)) ? $this->appServer : $this->appServer . '/' . $path\n ];\n }", "public function getSprintStories($sprintId)\n {\n $path = 'api/sprints/' . $sprintId . '/sprint-stories.json';\n\n return $this->getDataApiData($path);\n }", "public function get_story()\n {\n return $this->thread->get_story();\n }", "public function getStoryByUrl($url, $path = '') {\n $result = $this->clientRequest($this->storyServer . '/stories/' . $this->keyId . '/url/' . $url);\n return [\n \"url\" => $url,\n \"data\" => $result['data'],\n \"raw\" => $result['raw'],\n \"safeJson\" => $result['safeJson'],\n \"appServer\" => (empty($path)) ? $this->appServer : $this->appServer . '/' . $path\n ];\n }", "public function get_stories(): array {\n\t\t$stories_query = new WP_Query();\n\n\t\t/**\n\t\t * List of story posts.\n\t\t *\n\t\t * @var WP_Post[] $result\n\t\t */\n\t\t$result = $stories_query->query( $this->query_args );\n\n\t\tupdate_post_thumbnail_cache( $stories_query );\n\n\t\treturn $result;\n\t}", "public function stories() {\n return $this->hasMany(User_StoryModel::class,'sprint_id', 'id');\n }", "public function getAlsoReadStories($story) {\n\t\t$also_read_story_ids = array();\n\t\tforeach ($story['cards'] as $card) {\n\t\t\tforeach ($card['story-elements'] as $StoryElement) {\n\t\t\t\tif($StoryElement['subtype'] == 'also-read') {\n\t\t\t\t\t$also_read_story_ids[] = $StoryElement['metadata']['linked-story']['id'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $also_read_story_ids;\n\t}", "public static function getStories2($id, $user){\n $stories = DB::table('project AS p')\n ->join('sprint AS s', 'p.id', 's.project_id')\n ->join('user_story AS us', 's.id', 'us.sprint_id')\n ->join('user_user_story as uus', 'uus.user_story_id', 'us.id')\n ->join('users as u', 'uus.user_id', 'u.id')\n ->select('p.id as project_id', 's.id as sprint_id', 's.name as sprint_name', 's.duration', 's.state as sprint_state',\n 'us.id as story_id', 'us.name as story_name', 'us.priority', 'us.state as story_state', \n 'uus.state as uu_story_state', 'uus.worked_hours as story_worked_hours')\n ->where('s.id', '=', $id)\n ->where('u.id',$user)\n ->orderby('us.priority', 'desc');\n \n return $stories->distinct()->get();\n \n }", "public function getOneStory($id){\n\t\t$sql = '\n\t\tSELECT sto_title, sto_content, sto_tags, sto_thumbnail, sto_inserted, users_id, usr_username\n\t\tFROM stories\n\t\tLEFT OUTER JOIN users ON stories.users_id = users.id\n\t\tWHERE sto_id = :id\n\t\t';\n\n\t\t$sth = $this->dbh->prepare($sql);\n\t\t$sth->bindValue(':id', $id, \\PDO::PARAM_INT);\n\n\n\t\tif ($sth->execute() === false) {\n\t\t\tprint_r($sth->errorInfo());\n\t\t} else {\n\t\t\treturn $sth->fetchAll();\n\t\t}\n\t}", "public function getStory($storyId, $includeAcceptanceCriteria = false) {\n $path = 'api/stories/'. $storyId .'.json';\n\n if ($includeAcceptanceCriteria) {\n $path .= '?include_associated_data=true';\n }\n\n return $this->getDataApiData($path);\n }", "public static function openGraphMetadata($story) {\n\n $metadata = array(\n 'og:type' => FB_NAMESPACE . ':story',\n 'og:description' => $story->text_short,\n 'og:image' => $story->photos[0]['path'][390],\n 'description' => $story->text_short,\n 'author' => $story->author,\n 'keywords' => implode(',', $story->tags),\n );\n\n if ($story->status == 'bio') {\n $metadata['og:url'] = G_URL . 'story/bio/' . $story->authorSlug;\n $metadata['og:title'] = \"Bio of $story->author\";\n } else {\n $metadata['og:title'] = $story->title;\n $metadata['og:url'] = G_URL . 'story/' . $story->slug;\n }\n\n return $metadata;\n }", "public function findByStory($story, $limit = 50)\n {\n return $this->_em->createQueryBuilder()\n ->select('e, s, p')\n ->from($this->_entityName, 'e')\n ->leftJoin('e.story', 's')\n ->leftJoin('s.project', 'p')\n ->leftJoin('e.user', 'u')\n ->where('e.story = :story')\n ->orderBy('e.id', 'desc')\n ->getQuery()\n ->setMaxResults($limit)\n ->setParameter('story', $story)\n ->execute();\n }", "public function frontpage()\n {\n $sections = StoryRepository::getFrontPageSectionStories();\n// dd($sections);\n\n \n\n foreach ($sections['news'] as $story) {\n \n if($story->subsection_id != 0){\n $subsection = SubSection::with(['section'])->where('id', $story->subsection_id)->first();\n $story->Asection = $subsection->name;\n $story->Aurl = \"/section/\" . $subsection->section->slug . \"/\" . $subsection->slug;\n }\n else{\n $section = Section::where('id', $story->section_id)->first();\n $story->Asection = $section->name;\n $story->Aurl = \"/section/\" . $section->slug;\n }\n }\n\n foreach ($sections['sports'] as $story) {\n \n if($story->subsection_id != 0){\n $subsection = SubSection::with(['section'])->where('id', $story->subsection_id)->first();\n $story->Asection = $subsection->name;\n $story->Aurl = \"/section/\" . $subsection->section->slug . \"/\" . $subsection->slug;\n }\n else{\n $section = Section::where('id', $story->section_id)->first();\n $story->Asection = $section->name;\n $story->Aurl = \"/section/\" . $section->slug;\n }\n }\n\n foreach ($sections['opinion'] as $story) {\n \n if($story->subsection_id != 0){\n $subsection = SubSection::with(['section'])->where('id', $story->subsection_id)->first();\n $story->Asection = $subsection->name;\n $story->Aurl = \"/section/\" . $subsection->section->slug . \"/\" . $subsection->slug;\n }\n else{\n $section = Section::where('id', $story->section_id)->first();\n $story->Asection = $section->name;\n $story->Aurl = \"/section/\" . $section->slug;\n }\n }\n\n // dd($sections);\n\n\n $minutes = 720;\n\n\n $latest = Story::with(['section'])->latest('publish_date')->take(5)->get();\n\n\n // $latest = Cache::remember('latestStories', $minutes, function () {\n // return Story::with(['section'])->latest('publish_date')->take(7)->get();\n // });\n\n \n //$latest = Story::with(['section'])->latest()->take(10)->get();\n\n // check WebFront.php for result\n // currently this will return every story with a unique priority... 7/28/2018\n $frontPageStories = WebFront::frontPage();\n\n foreach ($frontPageStories as $story) {\n \n if($story->subsection_id != 0){\n $subsection = SubSection::with(['section'])->where('id', $story->subsection_id)->first();\n $story->Asection = $subsection->name;\n $story->Aurl = \"/section/\" . $subsection->section->slug . \"/\" . $subsection->slug;\n }\n else{\n $section = Section::where('id', $story->section_id)->first();\n $story->Asection = $section->name;\n $story->Aurl = \"/section/\" . $section->slug;\n }\n }\n\n //dd($frontPageStories);\n\n // returns array of 2 cube ads & 1 banner ad\n // increases served counters\n $ads = AdRepository::cubesAndBanner(2,1);\n\n // gets latest issue model\n $issue = Issue::with(['layout'])->latest('id')->whereNotNull('issu_url')->first();\n\n //dd($ads);\n\n return view('stories.index', compact('sections', 'latest', 'frontPageStories', 'ads', 'issue'));\n }", "public function getSprint($backlogId, $sprintId, $includeStories = false)\n {\n $path = 'api/backlogs/' . $backlogId . '/sprints/' . $sprintId . '.json';\n\n if ($includeStories) {\n $path .= '?include_associated_data=true';\n }\n\n return $this->getDataApiData($path);\n }", "public function story()\n {\n return $this->belongsTo(Story::class);\n }", "public function splitStory($tag, $xpath) {\n \n $story = [];\n \n // retrieve id\n $story[\"id\"] = $this->queryNode(\"a[@class='jTip']\", $xpath, $tag);\n $story[\"id\"] = substr($story[\"id\"], 1); // remove \"#\"\n \n // retrieve content\n $story[\"content\"] = $this->queryNode(\"a[@class='fmllink']\", $xpath, $tag);\n \n // retrieve and format date\n $str = $this->queryNode(\"div[@class='right_part']\", $xpath, $tag);\n $date = substr($str, strpos($str, \"Le \") + 3, 10);\n $date = explode(\"/\", $date);\n $time = substr($str, strpos($str, \"Le \") + 17, 5);\n $story[\"date\"] = $date[2] . \"-\" . $date[1] . \"-\" . $date[0] . \" \" . $time . \":00\";\n \n // retrieve author\n $story[\"author\"] = substr($str, strpos($str, \" - par \") + 7);\n $story[\"author\"] = explode(\" \", $story[\"author\"])[0];\n \n return $story;\n \n }", "public function getSprints($backlogId, $includeStories = false)\n {\n $path = 'api/backlogs/' . $backlogId . '/sprints.json';\n\n if ($includeStories) {\n $path .= '?include_associated_data=true';\n }\n\n return $this->getDataApiData($path);\n }", "abstract public function getSprints($project);", "public function info(){\n try {\n $story=$this;\n if($story->user()->first())\n $story->user = $story->user()->first()->infoSmall();\n /*$story->mentions= $story->completeUserMention($story->mention_id);*/\n $story->excerpt= $story->getExcerpt();\n if($story->book()->get()->count())\n $story->book= $story->book()->first()->infoSmall();\n $story->genres= $story->genre();\n $story->comments= $story->commentsThree($story->comments()->get());\n $story->commentsCount= $story->commentsCount();\n\n return $story;\n } catch (Exception $e) {\n return false;\n }\n }", "public function getStories($project, $filter = '') {\n\n\t\t\t// Encode the filter\n\t\t\t$filter = urlencode($filter);\n\n\t\t\t// Make the fields safe\n\t\t\t$filter = escapeshellcmd($filter);\n\t\t\t$project = escapeshellcmd($project);\n\n\t\t\t// Request the stories\n\t\t\t$cmd = \"curl -H \\\"X-TrackerToken: {$this->token}\\\" \"\n\t\t\t\t . \"-X GET \"\n\t\t\t\t . \"https://www.pivotaltracker.com/services/v3/projects/$project/stories\";\n\t\t\t// Add the filter, if it was specified\n\t\t\tif ($filter != '') $cmd .= \"?filter=$filter\";\n\t\t\t$xml = shell_exec($cmd);\n\t\t\t\n\t\t\t// Return an object\n\t\t\t$story = new SimpleXMLElement($xml);\n\t\t\treturn $story;\n\t\n\t\t}", "function extractStoryboardId()\n{\n $getStoryboardId = $_GET[\"storyboard_id\"];\n return $getStoryboardId;\n}", "public function getStory(): ActiveQuery\n {\n return $this->hasOne(Story::class, ['id' => 'story_id']);\n }" ]
[ "0.61022973", "0.6083936", "0.58745164", "0.57493013", "0.56808144", "0.5659381", "0.5639749", "0.5632634", "0.56096345", "0.5598613", "0.5563886", "0.54707134", "0.5431571", "0.5357277", "0.53488296", "0.5313666", "0.5309183", "0.53080785", "0.52878326", "0.52872777", "0.5235394", "0.51835954", "0.5183313", "0.5177498", "0.5164993", "0.51531833", "0.5123595", "0.51118195", "0.5060003", "0.49701896" ]
0.6329682
0
Extract just the velocity stuff from the backlog stats
public function getVelocityStats($accountId, $backlogId) { $stats = $this->getBacklogStats($accountId, $backlogId); return array( 'velocity_stats' => $stats['velocity_stats'], 'velocity_complete' => $stats['velocity_completed'] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getVelocity(){\n\t\t\treturn $this->velocity;\n\t\t}", "public function getCurrentVelocity()\n {\n $payload = '';\n\n $data = $this->sendRequest(self::FUNCTION_GET_CURRENT_VELOCITY, $payload);\n\n $payload = unpack('v1velocity', $data);\n\n return $payload['velocity'];\n }", "public function parse()\n {\n $Version = $this->getVer();\n $LanguageMap_en = $this->languagemap(\"en\");\n\n $RankedMatchSeason = $this->json(\"$Version/RankedMatchSeason\");\n $RankedMatchSeasonAward = $this->json(\"$Version/RankedMatchSeasonAward\");\n $OridinaryTask = $this->json(\"$Version/OridinaryTask\");\n $Drop_Static = $this->json(\"$Version/Drop_Static\");\n $OutSideItem_Base = $this->json(\"$Version/OutSideItem_Base\");\n\n // (optional) start a progress bar\n $IconArray = [];\n $LoadingIconArray = [];\n //get evolutions array\n\n // loop through data\n foreach ($RankedMatchSeason as $id => $Match) {\n $TaskID = $Match['TaskID'];\n $TaskName = $LanguageMap_en[$OridinaryTask[$TaskID]['TaskName']];\n $TaskOut = [];\n foreach ($OridinaryTask[$TaskID]['FinishCondition'] as $FinishCondition){\n if ($FinishCondition['ProcessShow'] === 0) continue;\n $Process = $FinishCondition['ProcessShow'];\n $Desc = $LanguageMap_en[$FinishCondition['Desc']];\n $Target = $FinishCondition['TargetProcess'];\n $TaskOut[] = \"|Task_$Process Description = $Desc\";\n $TaskOut[] = \"|Task_$Process Int = $Target\";\n }\n $Tasks = implode(\"\\n\",$TaskOut);\n $SeasonAwardID = $Match['SeasonAwardID'];\n $Ranks = [];\n foreach($RankedMatchSeasonAward[$SeasonAwardID] as $Rank){\n $Division = $Rank['BigRankedDivision'];\n switch ($Division) {\n case 1:\n $EnumDivision = \"Beginner Cup\";\n break;\n case 2:\n $EnumDivision = \"Great Cup\";\n break;\n case 3:\n $EnumDivision = \"Expert Cup\";\n break;\n case 4:\n $EnumDivision = \"Veteran Cup\";\n break;\n case 5:\n $EnumDivision = \"Ultra Cup\";\n break;\n case 6:\n $EnumDivision = \"Master Cup\";\n break;\n }\n $Ranks[] = \"|Division = $EnumDivision\";\n $SDropID = $Rank['SDropID'];\n foreach($Drop_Static[$SDropID] as $SdropItem) {\n $ResID = $SdropItem['ResID'];\n $ItemName = $LanguageMap_en[$OutSideItem_Base[$ResID]['OutSideItemName']];\n $Amt = $SdropItem['ResNum'];\n $Ranks[] = \"|Reward_\".$Rank['BigRankedDivision'].\" = \".$ItemName;\n $Ranks[] = \"|Reward_\".$Rank['BigRankedDivision'].\" Amt = \".$Amt.\"\\n\";\n }\n }\n $RanksOut = implode(\"\\n\",$Ranks);\n $String = \"{{-start-}}\";\n $String .= \"'''$TaskID'''\\n\";\n $String .= \"$Tasks\\n\";\n $String .= \"\\n\";\n $String .= \"$RanksOut\\n\";\n $String .= \"\\n\";\n $String .= \"\\n\";\n $String .= \"\\n\";\n $String .= \"\\n\";\n $String .= \"\\n\";\n $String .= \"\\n\";\n $String .= \"{{-stop-}}\";\n $Output[] = $String;\n }\n if (!empty($IconArray)) {\n $this->copyImages($IconArray,\"RankedMatchSeason\");\n }\n // (optional) finish progress bar\n $this->saveExtra(\"Output\\RankedMatchSeason.txt\",implode(\"\\n\\n\",$Output));\n\n // save\n $this->io->text('Saving data ...');\n }", "function getVat();", "public function stats()\n {\n\n // $volunteers_needed_count = Project::where('created_at', '>', $firstofyear)->get()->sum('numVolunteers');\n // $volunteers_signed_up = DB::table('volunteers')->select(DB::raw('sum(number_of_volunteers) as totalVols'))->where('created_at', '>', $firstofyear)->first();\n // $project_count = Project::where('created_at', '>', $firstofyear)->get()->count();\n\n $volunteers_needed_count = Project::all()->sum('numVolunteers');\n $volunteers_signed_up = DB::table('servers')->select(DB::raw('sum(number_of_volunteers) as totalVols'))->first();\n $project_count = Project::all()->count();\n\n\n if (!$volunteers_signed_up->totalVols) {\n $volunteers_signed_up->totalVols = 0;\n }\n\n $thisStat = new \\stdClass();\n $thisStat->totalVolsNeeded = $volunteers_needed_count;\n $thisStat->totalVolsRegistered = $volunteers_signed_up->totalVols;\n $thisStat->project_count = $project_count;\n\n return Fractal::item($thisStat, new StatsTransformer());\n }", "function get_stats($group, $vdbs, $login) {\n $i=0;\n foreach($vdbs as $vdb) {\n $ps_status = call_agent(\"STATUS\", $vdb);\n $status_secs = get_secs($vdb, $login);\n\n $stats[$i]['vdb'] = $vdb;\n $stats[$i]['ps_status'] = $ps_status;\n $stats[$i]['secs_behind'] = $status_secs;\n $i++;\n }\n\n return $stats;\n }", "public function getVat();", "public function getStages();", "function GetBuildingTimeLevel ($user, $planet, $Element, $level) {\n\tglobal $pricelist, $resource, $reslist, $game_config;\n\n\t$level -= 1;\n\n\tif(in_array($Element, $reslist['build'])) {\n\t\t// Pour un batiment ...\n\t\t$cost_metal = floor($pricelist[$Element]['metal'] * pow($pricelist[$Element]['factor'], $level));\n\t\t$cost_crystal = floor($pricelist[$Element]['crystal'] * pow($pricelist[$Element]['factor'], $level));\n\t\t$time = ((($cost_crystal) + ($cost_metal)) / $game_config['game_speed']) * (1 / ($planet[$resource['6']] + 1)) * pow(0.5, $planet[$resource['7']]);\n\t\tif($user['rpg_geologue']!=0)\n\t\t{\n\t\t\t$time = floor(($time * 60 * 60) * 0.75);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$time = floor(($time * 60 * 60) * 1);\n\t\t}\n\t} elseif (in_array($Element, $reslist['tech'])) {\n\t\t// Pour une recherche\n\t\t$cost_metal = floor($pricelist[$Element]['metal'] * pow($pricelist[$Element]['factor'], $level));\n\t\t$cost_crystal = floor($pricelist[$Element]['crystal'] * pow($pricelist[$Element]['factor'], $level));\n\t\t$intergal_lab = $user[$resource[114]];#intergalactic_tech\n\t\tif ( $intergal_lab < \"1\" ) {\n\t\t\t$lablevel = $planet[$resource['12']];\n\t\t} elseif ( $intergal_lab >= \"1\" ) {\n\t\t\t$empire = doquery(\"SELECT * FROM {{table}} WHERE id_owner='\". $user[id] .\"';\", 'planets');\n\t\t\t$NbLabs = 0;\n\t\t\twhile ($colonie = mysql_fetch_array($empire)) {\n\t\t\t\t$techlevel[$NbLabs] = $colonie[$resource['12']];\n\t\t\t\t$NbLabs++;\n\t\t\t}\n\t\t\tif ($intergal_lab >= \"1\") {\n\t\t\t\t$lablevel = 0;\n\t\t\t\tfor ($lab = 1; $lab <= $intergal_lab; $lab++) {\n\t\t\t\t\tasort($techlevel);\n\t\t\t\t\t$lablevel += $techlevel[$lab - 1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$time = (($cost_metal + $cost_crystal) / $game_config['game_speed']) / (($lablevel + 1) * 2)/ (($lablevel + 1) * 2) * pow(0.5, $planet[$resource['14']]);\n\t\tif($user['rpg_technocrate']!=0)\n\t\t{\n\t\t\t$time = floor(($time * 60 * 60) * 0.75);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$time = floor(($time * 60 * 60) * 1);\n\t\t}\n\t} elseif (in_array($Element, $reslist['defense'])) {\n\t\t// Pour les defenses ou la flotte 'tarif fixe' dur�e adapt�e a u niveau nanite et usine robot\n\t\t$time = (($pricelist[$Element]['metal'] + $pricelist[$Element]['crystal']) / $game_config['game_speed']) * (1 / ($planet[$resource['15']] + 1)) * pow(1 / 2, $planet[$resource['7']]);\n\t\tif($user['rpg_ingenieur']!=0)\n\t\t{\n\t\t\t$time = floor(($time * 60 * 60) * 0.75);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$time = floor(($time * 60 * 60) * 1);\n\t\t}\n\t} elseif (in_array($Element, $reslist['fleet'])) {\n\t\t$time = (($pricelist[$Element]['metal'] + $pricelist[$Element]['crystal']) / $game_config['game_speed']) * (1 / ($planet[$resource['8']] + 1)) * pow(1 / 2, $planet[$resource['7']]);\n\t\tif($user['rpg_amiral']!=0)\n\t\t{\n\t\t\t$time = floor(($time * 60 * 60) * 0.75);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$time = floor(($time * 60 * 60) * 1);\n\t\t}\n\t}elseif (in_array($Element, $reslist['item'])) {\n\t\t$time = (($pricelist[$Element]['metal'] + $pricelist[$Element]['crystal']) / $game_config['game_speed']) * (1 / ($planet[$resource['8']] + 1)) * pow(1 / 2, $planet[$resource['7']]);\n\t\t$time = floor(($time * 60 * 60) * 1);\n\t}\n\n\n\treturn $time;\n}", "public function getStatsFacets() {}", "public function getMaxVelocity()\n {\n $payload = '';\n\n $data = $this->sendRequest(self::FUNCTION_GET_MAX_VELOCITY, $payload);\n\n $payload = unpack('v1velocity', $data);\n\n return $payload['velocity'];\n }", "public function getStats() {}", "public function getStats()\n {\n return Batch::statistics()\n ->selectRaw(\"COALESCE( SUM(case when step =1 then weight end ),0) as stepOneWeights \")\n ->selectRaw(\"COALESCE( SUM(case when step =2 then weight end ),0) as stepTwoWeights \")\n ->selectRaw(\"COALESCE( SUM(case when step =3 then weight end ),0) as stepThreeWeights \")\n\n ->first();\n\n }", "public function statsTube($tube)\n\t{\n\t\t$stats = $this->_beanstalk->statsTube($tube);\n\t\treturn array(\n\t\t\t'tube'=>$stats['name'],\n\t\t\t'urgent'=>$stats['current-jobs-urgent'],\n\t\t\t'ready'=>$stats['current-jobs-ready'],\n\t\t\t'reserved'=>$stats['current-jobs-reserved'],\n\t\t\t'delayed'=>$stats['current-jobs-delayed'],\n\t\t\t'buried'=>$stats['current-jobs-buried'],\n\t\t\t);\n\t}", "function parse_stats() {\n // TODO: We should probably do some validation here\n if (!empty($this->http_request->params['stats'][0])) {\n $this->solr_data_store_request->params['stats.field'] = $this->http_request->params['stats'];\n\n $this->solr_data_store_request->params['stats'] = 'true';\n }\n }", "public function getAllData()\n {\n $result = array();\n\n $payload = '';\n\n $data = $this->sendRequest(self::FUNCTION_GET_ALL_DATA, $payload);\n\n $payload = unpack('v1current_velocity/V1current_position/V1remaining_steps/v1stack_voltage/v1external_voltage/v1current_consumption', $data);\n\n $result['current_velocity'] = $payload['current_velocity'];\n $result['current_position'] = IPConnection::fixUnpackedInt32($payload['current_position']);\n $result['remaining_steps'] = IPConnection::fixUnpackedInt32($payload['remaining_steps']);\n $result['stack_voltage'] = $payload['stack_voltage'];\n $result['external_voltage'] = $payload['external_voltage'];\n $result['current_consumption'] = $payload['current_consumption'];\n\n return $result;\n }", "public function run()\n {\n $tags = collect([\n 'first_impact' => [\n 'Oportunidade única em [neighborhood]. [property_type] com',\n 'Sua vez de morar em [neighborhood]. [property_type] com',\n 'Seu lar, doce lar em [neighborhood]. [property_type] com',\n 'As melhores oportunidades estão em [neighborhood]. [property_type] com',\n 'Venha morar no [neighborhood]! [property_type] com',\n 'More no [neighborhood]! [property_type] com',\n '[neighborhood] está te esperando! [property_type] com',\n 'Vem ser feliz no [neighborhood]! [property_type] com',\n 'O desejo de morar em [neighborhood] vai se realizar! [property_type] com',\n 'Venha viver em [neighborhood]! [property_type] com',\n 'Sua casa em [neighborhood]! [property_type] com',\n 'Viva em [neighborhood]! [property_type] com',\n 'Seu lar em [neighborhood]! [property_type] com',\n 'Faça de [neighborhood] seu lar! [property_type] com',\n 'Faça de [neighborhood] seu final feliz! [property_type] com',\n 'Venha ser feliz em [neighborhood]. [property_type] com',\n 'Realize seus sonhos morando em [neighborhood]. [property_type] com',\n '[neighborhood] é seu novo destino! [property_type] com',\n 'Seu endereço agora é em [neighborhood]! [property_type] com',\n 'Aproveite o melhor da vida morando em [neighborhood]. [property_type] com',\n 'Você e sua família morando em [neighborhood]. [property_type] com',\n 'Seus sonhos te esperam em [neighborhood]! [property_type] com',\n 'Seu sonho de morar em [neighborhood] é possível! [property_type] com',\n 'Seu sonho de viver em [neighborhood] transformado em realidade! [property_type] com',\n 'Você, feliz! Morando em [neighborhood]. [property_type] com',\n 'Seu novo lar está em [neighborhood]. [property_type] com',\n 'Aproveite as vantagens de morar em [neighborhood]. [property_type] com',\n 'A moradia dos seus sonhos em [neighborhood]. [property_type] com',\n 'Bem vindo a seu lar, doce lar em [neighborhood]! [property_type] com',\n 'O melhor da vida está te esperando em [neighborhood]. [property_type] com',\n 'Sua família morando em [neighborhood]. [property_type] com',\n '[neighborhood] ficará mais completo com você! [property_type] com',\n 'Que tal morar em [neighborhood]? [property_type] com',\n 'More onde sempre sonhou, more em [neighborhood]. [property_type] com',\n 'Morando em [neighborhood], você nunca mais vai desejar outro lugar. [property_type] com',\n 'Desfrute todas as vantagens em [neighborhood]. [property_type] com',\n 'Não deixe a oportunidade passar! [property_type] em [neighborhood] com',\n 'Viva o melhor que cidade pode oferecer em [neighborhood]. [property_type] com',\n 'Contemple o que há de melhor em [neighborhood]. [property_type] com',\n 'Aprecie toda comodidade de morar em [neighborhood]. [property_type] com',\n 'É sua vez de ter dizer: lar, doce lar morando em [neighborhood]. [property_type] com',\n 'Acredite! Você também pode morar em [neighborhood]. [property_type] com',\n 'Desfrute o bem-estar de morar em [neighborhood]. [property_type] com',\n 'Sinta-se em casa em [neighborhood]. [property_type] com',\n 'Explore todas as qualidades de morar em [neighborhood]. [property_type] com',\n 'Não perca essa oportunidade em [neighborhood]! [property_type] com',\n 'Seu novo lar te espera em [neighborhood]! [property_type] com',\n 'Sua chance de morar em [neighborhood]. [property_type] com',\n 'Grande oportunidade para morar em [neighborhood]. [property_type] com',\n 'Boa oportunidade para quem quer morar em [neighborhood]. [property_type] com',\n 'Destaque em [neighborhood]! [property_type] com',\n 'O imóvel que você busca em [neighborhood] está aqui! [property_type] com',\n 'Não perca tempo! O imóvel que você busca está aqui. [property_type] com',\n 'Sua busca pelo imóvel ideal terminou! [property_type] com',\n 'Viva ao lado do que mais te inspira, viva em [neighborhood]. [property_type] com',\n '[neighborhood] tem tudo o que você procura. [property_type] com',\n 'O lugar ideal para você e sua família é em [neighborhood]. [property_type] com',\n '[neighborhood] é onde seu sonho se torna realidade. [property_type] com',\n '[neighborhood], um lar para chamar de seu. [property_type] com',\n 'Sua chance de morar em [neighborhood]. [property_type] com',\n 'Não perca esta oportunidade de morar em [neighborhood]. [property_type] com',\n 'Oportunidade única para morar em [neighborhood]. [property_type] com',\n 'Venha morar em [neighborhood] e realize seu sonho! [property_type] com',\n '[neighborhood] está te esperando! [property_type] com',\n 'Mais comodidade para você em [neighborhood]. [property_type] com',\n '[neighborhood] nunca esteve tão perto de você. [property_type] com',\n 'O seu futuro está em [neighborhood]. [property_type] com',\n 'Você já pensou de morar em [neighborhood]? [property_type] com',\n 'Venha ser feliz em [neighborhood]. [property_type] com',\n 'Sua felicidade nunca esteve tão perto, venha para [neighborhood]! [property_type] com',\n 'Seu sonho está te esperando em [neighborhood]. [property_type] com',\n 'Mude agora para [neighborhood]! [property_type] com',\n 'Sua chance de realizar seu sonho em [neighborhood]! [property_type] com',\n 'Em [neighborhood] as pessoas são mais felizes! [property_type] com',\n 'Um novo olhar em [neighborhood]. [property_type] com',\n 'Sua casa nova está em [neighborhood]. [property_type] com',\n 'Conheça as vantagens de morar em [neighborhood]. [property_type] com',\n 'Bem vindo ao seu novo lar no [neighborhood]. [property_type] com',\n 'Seu novo lar fica em [neighborhood]. [property_type] com',\n 'Encontre sua casa nova em [neighborhood]. [property_type] com',\n 'Descubra o que há de melhor em [neighborhood]. [property_type] com',\n 'Descubra o prazer de morar em [neighborhood]. [property_type] com',\n 'Seu novo lar te espera no [neighborhood]. [property_type] com',\n 'Faça de [neighborhood] seu mais novo lar! [property_type] com',\n 'Encontre o melhor da vida em [neighborhood]. [property_type] com',\n 'Visite oportunidade em [neighborhood]. [property_type] com',\n 'Apareceu agora está oportunidade em [neighborhood]. [property_type] com',\n 'Conquiste um estilo de vida tranquila morando em [neighborhood]. [property_type] com',\n 'Sempre quis morar em [neighborhood]? Agora é sua chance de realizar esse sonho. [property_type] com',\n 'Finalmente chegou no mercado! [property_type] que você precisa conhecer em [neighborhood] com',\n 'Perto de tudo em [neighborhood]! [property_type] para morar bem com',\n 'Seja bem-vindo em [neighborhood]! [property_type] com',\n 'Em [neighborhood] você encontra essa chance única! [property_type] com',\n 'No coração de [neighborhood] você encontra essa oportunidade! [property_type] com',\n 'Venha morar com sofisticação em [neighborhood]. [property_type] com',\n 'Impecável em [neighborhood]. [property_type] com',\n 'Que tal morar em [neighborhood]? [property_type] com',\n ],\n\n 'area' => [\n '[area]m²,',\n ],\n\n 'bedroom_eq_0' => [\n 'ambientes inteligentes e espaços interligados.',\n 'espaço confortável e ambientes agrupados.',\n 'espaço funcional e cômodos interligados.',\n 'ambiente adaptável e cômodos agrupados.',\n 'ambiente prático e cômodos compartilhados.',\n 'espaço contemporâneo e cômodos interligados.',\n 'espaço inovador e cômodos compartilhados.',\n 'espaço arrojado e cômodos interligados.',\n 'espaço privativo e ambientes interligados.',\n 'espaço criativo e ambientes compartilhados.',\n 'espaço engenhoso e ambientes agrupados.',\n 'estrutura criativa e espaço interligados.',\n 'estrutura prática e cômodos interligados.',\n 'estrutura diferenciada e ambientes interligados.',\n 'disposição prática e dependências interligadas.',\n 'disposição moderna e dependências compartilhadas.',\n 'disposição criativa e dependências agrupadas.',\n 'disposição confortável e ambientes interligados.',\n 'ambiente criativo e dependências compartilhadas.',\n 'ambiente contemporâneo e espaços interligados.',\n 'ambiente agradável e espaços interligados.',\n 'espaços agradáveis e ambientes compartilhados.',\n 'estrutura agradável e cômodos agrupados.',\n 'dependências confortáveis e cômodos agrupados.',\n 'espaços confortáveis e ambientes interligados.',\n 'disposição confortável e ambientes agrupados.',\n 'proporções aconchegantes e ambientes interligados.',\n 'proporções aconchegantes e dependências agrupadas.',\n 'clima agradável e dependências compartilhadas.',\n 'arranjo confortável e dependências interligadas.',\n 'disposição diferenciada e prática.',\n 'ambiente arrojado e cômodos funcionais.',\n 'espaço, bom aproveitamento e distribuição despojada.',\n 'espaço acolhedor e cômodos agrupados.',\n 'ambiente acolhedor e espaços interligados.',\n 'espaço acolhedor e ambientes inteligentes.',\n 'ambientes funcionais que proporcionam praticidade.',\n 'conforto em espaço compacto.',\n 'ambiente compacto e clean.',\n 'design arrojado e ótimo espaço interno.',\n 'conforto e praticidade em espaços interligados.',\n 'ambiente criativo e espaço funcional.',\n 'espaço aconchegante e ambientes interligados.',\n 'dependências aconchegantes e cômodos compartilhados.',\n 'boa utilização do espaço e ambientes interligados.',\n 'boa utilização do espaço e dependências agrupadas.',\n 'ambiente moderno e cômodos interligados.',\n 'ambiente moderno e dependências compartilhadas.',\n 'ambiente criativo e espaço funcional.',\n ],\n\n 'bedroom_eq_1' => [\n 'design adaptável e 1 dormitório.',\n 'cômodos funcionais e 1 dormitório.',\n 'arquitetura diferenciada e 1 dormitório.',\n 'espaço dinâmico e 1 dormitório.',\n 'ambiente privativo e 1 dormitório.',\n 'ambiente arrojado e 1 dormitório.',\n 'ambiente engenhoso e 1 dormitório.',\n 'espaço reservado e 1 dormitório.',\n 'design funcional e 1 dormitório.',\n 'ambiente funcional e 1 dormitório.',\n 'espaço moderno e 1 dormitório.',\n 'estrutura completa e 1 dormitório.',\n 'infraestrutura individual e 1 dormitório.',\n 'ambiente confortável e 1 dormitório.',\n 'praticidade, conforto e 1 dormitório.',\n 'estrutura adaptável e 1 dormitório.',\n 'estrutura funcional e 1 dormitório.',\n 'design prático e 1 dormitório.',\n 'proporções inteligentes e 1 dormitório.',\n 'proporções ideais para você e 1 dormitório.',\n 'proporções aconchegantes e harmoniosas e 1 dormitório.',\n 'ambientes convidativos e 1 dormitório.',\n 'ambientes aconchegantes e 1 dormitório.',\n 'ambientes funcionais e 1 dormitório.',\n 'estrutura adaptável e 1 dormitório.',\n 'ambientes adaptáveis e 1 dormitório.',\n 'ambiente versátil e 1 dormitório.',\n 'espaço convidativo e 1 dormitório.',\n 'versatilidade, ambientes funcionais e 1 dormitório.',\n 'ambientes completos e 1 dormitório.',\n 'ambiente arrojado e 1 dormitório.',\n 'espaços bem aproveitados e 1 dormitório.',\n 'disposição diferenciada e 1 dormitório.',\n 'design moderno e 1 dormitório.',\n 'ambiente diferenciado e 1 dormitório.',\n 'design inteligente e 1 dormitório.',\n 'ambiente do tamanho ideal e 1 dormitório.',\n 'ambiente acolhedor e 1 dormitório.',\n 'ambientes aconchegantes e 1 dormitório.',\n 'design criativo e 1 dormitório.',\n 'design moderno e 1 dormitório.',\n 'conforto, praticidade e 1 dormitório.',\n 'ambiente agradável e 1 dormitório.',\n 'espaço agradável e 1 dormitório.',\n 'espaço aconchegante e 1 dormitório.',\n 'espaços criativos, aconchegantes e 1 dormitório.',\n 'a medida certa para você e 1 dormitório.',\n 'espaço ideal para solteiros ou casais, completo e 1 dormitório.',\n 'espaço bem planejado e 1 dormitório.',\n ],\n\n 'bedroom_eq_2' => [\n 'conforto, praticidade e 2 domitórios.',\n 'design ideal para você e possui 2 domitórios.',\n 'conforto, acolhimento e ainda possui 2 domitórios.',\n 'estrutura inovadora, confortável e possui 2 domitórios.',\n 'espaços aconchegante, ambientes funcionais e possui 2 domitórios.',\n 'ambientes convidativos, confortáveis e possui 2 domitórios.',\n 'ambiente acolhedor, dinâmico e possui 2 domitórios.',\n 'espaço acolhedor, ideal para você e possui 2 domitórios.',\n 'condições perfeitas para você e 2 domitórios.',\n 'ambientes agradáveis, funcionais e possui 2 domitórios.',\n 'estrutura funcional, agradável e possui 2 dormitórios.',\n 'estrutura completa, espaço acolhedor e possui 2 dormitórios.',\n 'espaços agradáveis, muita praticidade e possui 2 dormitórios.',\n 'estrutura moderna e 2 dormitórios.',\n 'espaços aconchegantes, em excelentes condições e possui 2 dormitórios.',\n 'ambientes funcionais, acolhedores e possui 2 dormitórios.',\n 'cômodos modernos e possui 2 dormitórios.',\n 'design moderno e possui 2 dormitórios.',\n 'design adaptável e possui 2 dormitórios.',\n 'ambiente funcional e possui 2 dormitórios.',\n 'área agradável, clima convidativo e possui 2 dormitórios.',\n 'conforto, estrutura adaptável e possui 2 dormitórios.',\n 'estrutura adaptável, possui estrutura completa e 2 dormitórios.',\n 'design agradável, possui ambientes convidativos e 2 dormitórios.',\n 'design confortável, prático e possui 2 dormitórios.',\n 'área confortável, aconchegante e 2 dormitórios.',\n 'ambientes aconchegantes e 2 dormitórios.',\n 'área aconchegante, possui design convidativo e 2 dormitórios.',\n 'área agradável, possui design completo e 2 dormitórios.',\n 'espaços convidativos e possui 2 dormitórios.',\n 'ambientes planejados, perfeito para a famílias crescendo e 2 dormitórios.',\n ],\n\n 'bedroom_eq_3' => [\n 'estrutura ideal e 3 dormitórios.',\n 'arquitetura moderna e 3 dormitórios.',\n 'dimensões modernas e 3 dormitórios.',\n 'ambientes inteligentes e 3 dormitórios.',\n 'disposição perfeita de ambientes e 3 dormitórios.',\n 'conforto, funcionalidade e 3 dormitórios.',\n 'disposição funcional e 3 dormitórios.',\n 'estrutura impecável e 3 dormitórios.',\n 'estrutura moderna, acolhedora e 3 dormitórios.',\n 'design inteligente e 3 dormitórios.',\n 'plena comodidade e 3 dormitórios.',\n 'inovação, modernidade e 3 dormitórios.',\n 'estrutura contemporânea e 3 dormitórios.',\n 'estrutura perfeita e 3 dormitórios.',\n 'estrutura completa e 3 dormitórios.',\n 'estrutura dinâmica e 3 dormitórios.',\n 'estrutura inteligente e 3 dormitórios.',\n 'estrutura funcional e 3 dormitórios.',\n 'design funcional e 3 dormitórios.',\n 'design completo e 3 dormitórios.',\n 'design inteligente e 3 dormitórios.',\n 'estrutura convidativa, completa e 3 dormitórios.',\n 'estrutura completa, pleno conforto e 3 dormitórios.',\n 'pleno conforto, estrutura acolhedora e 3 dormitórios.',\n 'espaço inteligente, estrutura convidativa e 3 dormitórios.',\n 'ambientes convidativos, pleno conforto e 3 dormitórios.',\n 'pleno conforto, ambiente agradável e 3 dormitórios.',\n 'espaço dinâmico, adaptável e 3 dormitórios.',\n 'design inteligente, aconchegante e 3 dormitórios.',\n 'espaço funcional, confortável e 3 dormitórios.',\n 'espaços bem planejados, funcionais e 3 dormitórios, acomodação até para a sogra!',\n 'ambiente moderno, amplo e ainda 3 dormitórios.',\n ],\n\n 'bedroom_gte_4' => [\n 'estrutura completa e [bedrooms] dormitórios.',\n 'estrutura ilimitada e [bedrooms] dormitórios.',\n 'estrutura perfeita e [bedrooms] dormitórios.',\n 'estrutura confortável e [bedrooms] dormitórios.',\n 'arquitetura acolhedora e [bedrooms] dormitórios.',\n 'arquitetura diferenciada e [bedrooms] dormitórios.',\n 'arquitetura personalizada e [bedrooms] dormitórios.',\n 'arquitetura singular e [bedrooms] dormitórios.',\n 'arquitetura funcional e [bedrooms] dormitórios.',\n 'arquitetura adaptável e [bedrooms] dormitórios.',\n 'arquitetura inteligente e [bedrooms] dormitórios.',\n 'arquitetura dinâmica e [bedrooms] dormitórios.',\n 'arquitetura moderna e [bedrooms] dormitórios.',\n 'arquitetura inovadora e [bedrooms] dormitórios.',\n 'arquitetura contemporânea e [bedrooms] dormitórios.',\n 'design contemporâneo e [bedrooms] dormitórios.',\n 'design inovador e [bedrooms] dormitórios.',\n 'design singular e [bedrooms] dormitórios.',\n 'design dinâmico e [bedrooms] dormitórios.',\n 'design diferenciado e [bedrooms] dormitórios.',\n 'ambientes estruturados, adaptáveis e [bedrooms] dormitórios.',\n 'design, estrutura convidativa e [bedrooms] dormitórios.',\n 'ambientes completos, arquitetura aconchegante e [bedrooms] dormitórios.',\n 'arquitetura agradável, ambientes acolhedores e [bedrooms] dormitórios.',\n 'design acolhedor, estrutura prática, completa e [bedrooms] dormitórios.',\n 'design diferenciado, convidativo e [bedrooms] dormitórios.',\n 'design inteligente, estrutura convidativa e [bedrooms] dormitórios.',\n 'estrutura completa, acolhedora e [bedrooms] dormitórios.',\n 'ambientes inteligentes, estrutura convidativa e [bedrooms] dormitórios.',\n 'arquitetura diferenciada, inteligente e [bedrooms] dormitórios.',\n 'espaço, conforto e [bedrooms] dormitórios.',\n 'dependências completas e [bedrooms] dormitórios.',\n 'espaço, conforto e [bedrooms] dormitórios.',\n 'ambientes completos, para toda a família e [bedrooms] dormitórios.',\n 'design criativo, ambientes amplos, confortáveis e [bedrooms] dormitórios.',\n 'design criativo, ambientes aconchegantes e [bedrooms] dormitórios.',\n 'estrutura moderna e [bedrooms] dormitórios.',\n 'estrutura inovadora, ambientes convidativos e [bedrooms] dormitórios.',\n 'inovação, conforto e [bedrooms] dormitórios.',\n 'design único, ambientes inteligentes e [bedrooms] dormitórios.',\n ],\n\n 'price_20_lt_avg' => [\n 'Um achado!',\n 'O melhor preço do mercado!',\n 'Melhor momento para fechar negócio!',\n 'Melhor oportunidade do mercado!',\n 'Um verdadeiro presente!',\n 'As melhores condições do mercado!',\n 'Não deixe para depois!',\n 'Oportunidade imperdível!',\n 'Sua melhor chance!',\n 'Sua melhor oportunidade de negócio!',\n 'Um verdadeiro achado!',\n 'O melhor que você vai encontrar!',\n 'O mercado está a seu favor!',\n 'Com as melhores condições!',\n 'Sua melhor oportunidade hoje!',\n 'A melhor oportunidade de investimento!',\n 'Essa é a sua chance de fechar o melhor negócio!',\n 'O melhor preço da região!',\n 'Um achado com as melhores condições!',\n 'O mercado está te favorecendo, aproveite!',\n 'Alerta de melhor oportunidade!',\n 'Garantia de melhor negócio!',\n 'Aproveite o melhor momento para investir!',\n 'O melhor momento para o seu investimento!',\n 'Um achado no mercado!',\n 'Custo benefício incrível!',\n 'Melhor momento para investir!',\n 'Sua chance de realizar o melhor negócio!',\n 'Aproveite o mercado a seu favor!',\n 'Melhor hora para fechar negócio!',\n 'Não perca esta oportunidade!',\n 'Você não pode ficar fora dessa!',\n 'Não deixe essa chance passar, aproveite!',\n 'Garanta já, é sua chance de aproveitar os melhores valores!',\n 'Uma excelente oportunidade!',\n 'O melhor custo benefício!',\n 'Garanta o melhor preço!',\n 'Faça o seu melhor negócio!',\n 'Não deixe essa oferta passar, preço imperdível!',\n 'Condições incríveis!',\n 'Não perca essa oportunidade!',\n 'Oportunidade única para fechar um excelente negócio!',\n 'Faça um negócio incrível!',\n 'Melhor opção para investimento!',\n 'Não deixe essa oportunidade de ouro escapar!',\n 'Não deixe para amanhã, faça o melhor negócio agora mesmo!',\n 'Preço muito abaixo da média. Não perca essa chance!',\n 'O melhor preço para um ótimo negócio!',\n 'Faça um excelente negócio, pagando muito abaixo da média!',\n 'Valor excelente no mercado!',\n 'Super desconto com base no valor de mercado!',\n 'Uma pechincha, não perca essa oportunidade!',\n 'Imóvel com preço muito abaixo do mercado, confira!',\n 'A hora de negociar é agora, o melhor preço do mercado!',\n 'O melhor preço por m², não perca essa oportunidade!',\n ],\n\n 'price_bt_2_n_19_lt_avg' => [\n 'Excelente oportunidade de negócio!',\n 'Aproveite a chance!',\n 'Excelente negócio!',\n 'Momento excelente para fechar!',\n 'Essa oportunidade vale a pena!',\n 'Ótimo momento para fazer negócio!',\n 'Aproveite, vale a pena!',\n 'Oportunidade de ouro!',\n 'Realize um excelente negócio!',\n 'Não perca essa oportunidade de ouro!',\n 'Não perca essa excelente oportunidade!',\n 'Chance de negócio excelente!',\n 'Não deixe essa oportunidade passar!',\n 'Aproveite agora essa excelente oportunidade!',\n 'Investimento excelente!',\n 'Realize um investimento excelente!',\n 'Ótimo momento para investir!',\n 'Ótimo momento para fechar!',\n 'Sua chance de realizar um ótimo investimento!',\n 'Sua chance de negociar com excelentes condições!',\n 'Excelente opção de negócio!',\n 'Ótima escolha de investimento!',\n 'Um negócio excelente!',\n 'Está diante de um ótimo negócio!',\n 'Ótimo dia para fechar negócio!',\n 'Parabéns por encontrar uma oportunidade de ouro!',\n 'Hora certa para aproveitar essa oportunidade excelente!',\n 'Agarre essa excelente oportunidade!',\n 'Alerta de oportunidade!',\n 'Agarre essa oportunidade!',\n 'Com ótimo preço, essa é sua oportunidade!',\n 'Melhor preço praticado!',\n 'Ótima oportunidade da região!',\n 'Imóvel com ótimo preço, veja e compare!',\n 'Boa chance para negociar sua casa nova.',\n 'Preço do m² menor que a média, grande chance!',\n 'Está procurando ótimos investimentos? Preço mais atrativo do mercado!',\n ],\n\n 'price_eq_avg' => [\n 'Bom investimento!',\n 'Esse é um bom negócio!',\n 'Faça um investimento seguro!',\n 'Boas condições para negociação.',\n 'Bom momento para investir.',\n 'Investimento seguro!',\n 'Aproveite essa oportunidade!',\n 'Um bom negócio e com boas condições.',\n 'Aproveite as boas condições do mercado.',\n 'Boa oportunidade de investimento.',\n 'Uma boa oportunidade no mercado.',\n 'Mercado favorável e boas condições.',\n 'Aproveite as boas condições!',\n 'Mercado favorável para o investimento.',\n 'Boas condições no mercado.',\n 'Não perca a chance de realizar um bom negócio.',\n 'Sua chance de fechar um bom negócio!',\n 'Boa hora para negociar.',\n 'Momento para um investimento seguro.',\n 'Realize um bom negócio!',\n 'Aproveite as condições favoráveis para fechar negócio!',\n 'Aproveite o momento e boas condições para investir.',\n 'Bom momento e boas condições.',\n 'Boa hora para agarrar a oportunidade.',\n 'Uma boa chance de realizar um negócio seguro.',\n 'Oportunidade segura de investimento acertado.',\n 'Aproveite as condições favoráveis do mercado.',\n 'Boa chance de fechar negócio com boas condições.',\n 'Boa oportunidade e momento para fechar negócio.',\n 'Bom dia para investir.',\n 'Ótimo preço!',\n 'Oportunidade muito boa de negócio.',\n 'Aproveite as ótimas condições do mercado!',\n 'Sua grande chance para fechar um negócio seguro!',\n 'Não perca essa oportunidade e feche um negócio seguro!',\n 'Aproveite os bons valores do mercado!',\n 'Bom momento para investir!',\n 'Conheça mais sobre essa oportunidade!',\n 'A sua estabilidade está aqui!',\n 'Preço justo, saiba mais!',\n ],\n\n 'price_gt_avg' => [\n 'Mercado aquecido!',\n 'Oportunidade de valorização.',\n 'Seu investimento em um destaque no mercado!',\n 'Essa é uma oportunidade em valorização!',\n 'Em alta no mercado!',\n 'Oportunidade de investimento em valorização!',\n 'Oportunidade valorizada no mercado!',\n 'Oportunidade de investimento aquecido no mercado.',\n 'Chance de investimento com potencial de crescimento e valorização!',\n 'Aproveite a chance em crescimento e valorização!',\n 'Ótimo período e expectativas no setor imobiliário!',\n 'Agarre a chance de fechar um negócio de destaque.',\n 'Oportunidade em alta no mercado!',\n 'Período de crescimento e com potencial de valorização.',\n 'Negócio de destaque no mercado imobiliário!',\n 'Investimento com potencial de valorização!',\n 'Potencial de valorização e crescimento!',\n 'Negócio com potencial de valorização!',\n 'Faça um negócio com potencial real no setor imobiliário!',\n 'Investimento em negócio com potencial!',\n 'Oportunidade em valorização.',\n 'Investimento em local valorizado e com boas expectativas no mercado.',\n 'Seu momento de investir com potencial de crescimento.',\n 'Alerta de período de crescimento e valorização!',\n 'Um destaque no mercado com potencial de valorização!',\n 'Invista em um destaque no mercado!',\n 'Invista em um destaque em moradia!',\n 'Oportunidade de investir em destaque para moradia!',\n 'Destaque em moradia.',\n 'Encontrou uma oportunidade em valorização!',\n 'Sua hora de investir com oportunidades de crescimento!',\n 'Preço valorizado e uma ótima chance para investimento.',\n 'Ótima opção de investimento em período de valorização!',\n ],\n\n 'real_state' => [\n 'Entre em contato agora com [client].',\n 'Fale agora com [client].',\n 'Contate agora [client].',\n 'Contate agora [client] e fale com o corretor.',\n 'Entre em contato com [client], estão te esperando!',\n 'Oferta de [client], entre em contato!',\n 'Contate [client] para falar com o corretor.',\n 'Contate agora [client] e converse com os corretores.',\n 'Entre em contato com [client] e converse com um dos corretores.',\n 'Entre em contato com [client] para falar com o corretor.',\n 'Contate [client] para falar com um dos corretores.',\n 'Entre em contato ainda hoje com [client].',\n 'Fale com [client] e converse com o corretor.',\n 'Fale com [client] o corretor está te esperando!',\n 'Converse com [client], há um corretor te aguardando.',\n 'Oferta de [client], converse com um dos corretores!',\n 'Contate hoje [client] e fale com o corretor.',\n 'Oferta exclusiva de [client], contate para falar com o corretor.',\n 'Entre em contato com [client], há um corretor te aguardando!',\n 'Contate [client] e converse com o corretor.',\n 'Contate [client] e converse com o corretor.',\n 'Contate hoje [client] e converse com um dos corretores.',\n 'Fale com o corretor, contate agora [client].',\n 'Fale com o corretor! Entre em contato com [client].',\n 'O corretor está te aguardando! Contate [client].',\n 'Converse com o corretor, contate hoje [client].',\n 'Oferta exclusiva de [client], entre em contato sobre imóveis em [city].',\n 'Oferta de [client], entre em e fale sobre imóveis em [city]!',\n 'Fale agora com [client] sobre imóveis em [city].',\n 'Contate [client] e fale com o corretor sobre imóveis em [city].',\n ],\n ]);\n\n $data = [];\n\n foreach($tags as $tag => $texts){\n $descs = array_map(function($text) use($tag){\n return [\n 'text' => $text,\n 'tag' => $tag,\n 'created_at' => \\Carbon\\Carbon::now(),\n 'updated_at' => \\Carbon\\Carbon::now()\n ];\n }, $texts);\n\n $data = array_merge($data, $descs);\n }\n\n DB::table('auto_descs')->insert($data);\n }", "function featuredPoem()\n {\n $array = $this->model->getFeaturedPoem();\n $result = array();\n foreach($array as $name => $value) {\n $result[] = $value;\n }\n return $result; \n }", "function getProfiling() {\n $i = 0;\n $total = 0;\n $result = array();\n \n foreach ($this->markers as $marker => $time) {\n if ($marker == 'Start') {\n $diff = '-';\n } else {\n if (extension_loaded('bcmath')) {\n $diff = bcsub($time, $temp, 6);\n $total = bcadd($total, $diff, 6);\n } else {\n $diff = $time - $temp;\n $total = $total + $diff;\n }\n }\n \n $result[$i]['name'] = $marker;\n $result[$i]['time'] = $time;\n $result[$i]['diff'] = $diff;\n $result[$i]['total'] = $total;\n \n $temp = $time;\n $i++;\n }\n\n return $result;\n }", "public function get_velos()\r\n {\r\n return $this->_velos;\r\n }", "public static abstract function getStages(): array;", "public function getStats();", "public function extract();", "private function getTrendingBets() {\n $bets = Bet::where('isFinished', false)->where('isDeleted', '<', 1)->getQuery()->get()->map(\n function ($bet) {\n $bet->backersCount = UserBet::where('betId', $bet->betId)->count('userBetId');\n return $bet;\n }\n )->toArray();\n return array_slice($bets, 0, 5, true);\n }", "abstract public function getStatistic();", "protected function _getSlackVariables()\n {\n $restrictionQty = $this->getRestrictionQty();\n\n $slackVariables = [];\n for ($i = 0; $i < $restrictionQty + 1; $i++) {\n $slackRow = [];\n for ($j = 0; $j < $restrictionQty; $j++)\n $slackRow[] = $i == $j ? 1 : 0;\n\n $slackVariables[] = $slackRow;\n }\n\n return $slackVariables;\n }", "function F89da123b($Vf894427c, $V2da2c443, $V6ae4aaa3) // team events launcher\n {\n $V10dad7cb = '';\n $Vf1a19314 = $V2da2c443;\n if (preg_match(\"/^(.*)\\\\|(.+)/\", $Vf1a19314, $Vb74df323)) {\n $V10dad7cb = $Vb74df323[1];\n $Vf1a19314 = $Vb74df323[2];\n }\n if (isset($GLOBALS['cfg']['data_filter']['events'][$V10dad7cb]) && preg_match($GLOBALS['cfg']['data_filter']['events'][$V10dad7cb], $Vf1a19314, $Vb74df323))\n return;\n if (!$this->V75125d17)\n return;\n\n $variance = $GLOBALS['skillset']['defaults']['variance'];\n $players = array('add' => array(), 'substract' => array());\n $skills = array('add' => 0.0, 'substract' => 0.0);\n foreach ($this->V75125d17 as $Vd915074e => $V163b0d74) { // itera sobre todos los players\n $V29a7e964 = $this->V75125d17[$Vd915074e]['vdata']['role'][1];\n $band = false;\n if ($band = isset($this->V75125d17[$Vd915074e]['events'][$this->Vb77eef69][$Vf894427c])) { // es del equipo\n // agrega el evento\n if (!isset($this->V75125d17[$Vd915074e]['events'][$this->Vb77eef69][$Vf894427c][$V29a7e964]['1D'][$V2da2c443]))\n $this->V75125d17[$Vd915074e]['events'][$this->Vb77eef69][$Vf894427c][$V29a7e964]['1D'][$V2da2c443] = 0;\n $this->V75125d17[$Vd915074e]['events'][$this->Vb77eef69][$Vf894427c][$V29a7e964]['1D'][$V2da2c443] += $V6ae4aaa3;\n // agrega el player a los add\n $players['add'][] = $Vd915074e;\n $skills['add'] += $this->V75125d17[$Vd915074e]['profile']['org_skill'];\n }\n if (!$band || (isset($this->V75125d17[$Vd915074e]['events'][$this->Vb77eef69]) && count($this->V75125d17[$Vd915074e]['events'][$this->Vb77eef69]) > 1)) {\n // agrega el player a los substract\n $players['substract'][] = $Vd915074e;\n $skills['substract'] += $this->V75125d17[$Vd915074e]['profile']['org_skill'];\n }\n }\n $n = array('add' => count($players['add']), 'substract' => count($players['substract']));\n $event_factor = $this->F4af5007c($V2da2c443);\n if ($event_factor && $n['add'] && $n['substract']) {\n $max_n = max($n['add'], $n['substract']);\n $av_skills = array('substract' => $skills['substract'] / $max_n, 'add' => $skills['add'] / $max_n);\n $prob_add_wins = 1 / (1 + exp(($av_skills['substract'] - $av_skills['add']) * ($event_factor > 0 ? 1 : -1) / ($variance * $max_n)));\n $factor = (1 - $prob_add_wins) * $V6ae4aaa3 * $event_factor * min($n['add'], $n['substract']);\n $prob_array = array('add' => array(), 'substract' => array());\n $prob_sum = array('add' => 0.0, 'substract' => 0.0);\n foreach ($players as $type => $player_list) {\n $enemy_av_skill = $type == 'add' ? $av_skills['substract'] : $av_skills['add'];\n foreach ($player_list as $index => $id) {\n $skill = $this->V75125d17[$id]['profile']['org_skill'];\n $prob_win = 1 / (1 + exp(($enemy_av_skill - $skill) * ($event_factor > 0 ? 1 : -1) / $variance));\n $prob_array[$type][$index] = $type == 'add' ? 1 - $prob_win : $prob_win;\n $prob_sum[$type] += $prob_array[$type][$index];\n }\n }\n foreach ($players as $type => $player_list) {\n $negative = $type == 'add' ? 1.0 : -1.0;\n foreach ($player_list as $index => $id) {\n $player_team_factor = $prob_array[$type][$index] / $prob_sum[$type];\n $this->V75125d17[$id]['profile']['skill'] += $negative * $factor * $player_team_factor;\n }\n }\n }\n }", "public function attackReport(): array {\n $value = new KingdomLogStatusValue($this->log->status);\n\n $data = [];\n\n $oldDefender = $this->log->old_defender;\n $newDefender = $this->log->new_defender;\n\n if ($value->kingdomWasAttacked() || $value->bombsDropped()) {\n $kingdomAttacked = $this->kingdomAttacked->setLog($this->log);\n\n $data['kingdom'] = $this->fetchKingdomInformation($oldDefender, $newDefender);\n $data['buildings'] = $kingdomAttacked->fetchBuildingDamageReport();\n $data['units'] = $kingdomAttacked->fetchUnitDamageReport();\n $data['defender_units'] = $kingdomAttacked->fetchUnitKillReport();\n $data['defender_buildings'] = [];\n } else if ($value->attackedKingdom() || $value->lostAttack()) {\n $attackedKingdom = $this->attackedKingdom->setLog($this->log);\n\n $data['units'] = $attackedKingdom->attackedKingdomReport();\n $data['defender_units'] = $attackedKingdom->fetchUnitDamageReport();\n $data['defender_buildings'] = $attackedKingdom->fetchBuildingsDamageReport();\n } else if ($value->tookKingdom()) {\n $tookKingdom = $this->tookKingdom->setLog($this->log);\n\n $data = $tookKingdom->fetchChanges();\n\n $data['kingdom'] = $this->fetchKingdomInformation($oldDefender);\n }\n\n return $data;\n }", "function wg_get_tun_list() {\n\tglobal $config, $wgg;\n\n\t// Format tunnel description if one is configured\n\t$tunDescr = fn($tunnel) => !empty($tunnel['descr']) ? \" ({$tunnel['descr']})\" : null;\n\n\t$a_ret = array();\n\n\t// Always include the unassigned option first\n\t$a_ret['unassigned'] = 'Unassigned';\n\n\tif (is_array($wgg['tunnels'])) {\n\t\tforeach ($wgg['tunnels'] as $tunnel) {\n\t\t\t$a_ret[$tunnel['name']] = \"{$tunnel['name']}{$tunDescr($tunnel)}\";\t\n\t\t}\n\t}\n\n\t// Consumers of this function always expect an array type\n\treturn $a_ret;\n}", "private function parse(){\n\t\t$patterns = [\n\t\t\t\"title\"\t \t=> '_<!\\[LOG\\[(.*)\\]LOG\\]!>_',\n\t\t\t\"time\"\t \t=> '_time=\"([^\"]*)\"_',\n\t\t\t\"date\"\t \t=> '_date=\"([^\"]*)\"_',\n\t\t\t\"component\"\t=> '_component=\"([^\"]*)\"_',\n\t\t\t\"context\"\t=> '_context=\"([^\"]*)\"_',\n\t\t\t\"type\"\t \t=> '_type=\"([^\"]*)\"_',\n\t\t\t\"thread\"\t=> '_thread=\"([^\"]*)\"_',\n\t\t\t\"file\"\t \t=> '_file=\"([^\"]*)\">_'\n\t\t];\n\t\tforeach($patterns as $name => $pattern){\n\t\t\t$matches = [];\n\t\t\tpreg_match($pattern, $this->line, $matches);\n\t\t\tif(isset($matches[1])){\n\t\t\t\t$this->properties->{$name} = $matches[1];\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.52169657", "0.50620997", "0.4764487", "0.47207725", "0.4702528", "0.46474642", "0.46023643", "0.45855057", "0.45395374", "0.45362255", "0.44946995", "0.44935173", "0.4449705", "0.4436767", "0.44340006", "0.4428632", "0.44152606", "0.4374905", "0.43519565", "0.43467268", "0.43264875", "0.4303505", "0.42986426", "0.42904428", "0.42871904", "0.42715007", "0.4247633", "0.4242999", "0.4238608", "0.42312396" ]
0.6508056
0
Pull all the stories from a theme (or all themes)
public function getStoriesFromTheme() { $stories = array(); foreach ($this->getThemes(true) AS $theme) { if (is_array($theme['stories'])) { foreach ($theme['stories'] as &$story) { $story['score_50'] = empty($story['score_50'])?null:(int)$story['score_50']; $story['theme_unique_id'] = $theme['code'] . $story['unique_id']; } $stories = array_merge($stories, $theme['stories']); } } return $stories; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_stories(): array {\n\t\t$stories_query = new WP_Query();\n\n\t\t/**\n\t\t * List of story posts.\n\t\t *\n\t\t * @var WP_Post[] $result\n\t\t */\n\t\t$result = $stories_query->query( $this->query_args );\n\n\t\tupdate_post_thumbnail_cache( $stories_query );\n\n\t\treturn $result;\n\t}", "function render_theme_stories(): void {\n\t$injector = Services::get_injector();\n\n\t/**\n\t * Customizer instance.\n\t *\n\t * @var Customizer $customizer Customizer instance.\n\t */\n\t$customizer = $injector->make( Customizer::class );\n\t//phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped\n\techo $customizer->render_stories();\n}", "function theme_gs_helper_related_stories($vars) {\n $output = '';\n \n if (!empty($vars['stories'])) {\n $items = array();\n \n foreach ($vars['stories'] as $nid => $title) {\n $items[] = l($title, 'node/' . $nid);\n } \n \n $output .= theme('item_list', array('items' => $items));\n }\n \n return $output;\n}", "public function fetchStories($total = 20) {\n \n $current_page = 0;\n $nb_stories = 0;\n $stories = [];\n \n while($nb_stories < $total) {\n \n // fetch new page\n $html = file_get_contents($this->url . $current_page);\n $dom = new DOMDocument();\n @$dom->loadHTML('<?xml encoding=\"UTF-8\">' . $html);\n $xpath = new DOMXPath($dom);\n $tags = $xpath->query($this->path);\n \n // fetch stories from page\n foreach($tags as $tag) {\n \n // Format story\n $story = $this->splitStory($tag, $xpath);\n\n if($nb_stories < $total) {\n $stories[] = $story;\n $nb_stories++;\n }\n }\n \n $current_page++;\n \n }\n return $stories;\n }", "public function getThemes();", "public function getThemes();", "private function get_stories($catID)\n\t{\n\t\tglobal $do_not_duplicate;\n\t\t$query = new WP_Query(array('posts_per_page' => 3, 'offset' => 2, 'cat' => $catID, 'post__not_in' => $do_not_duplicate));\n\n\t\twhile($query->have_posts())\n\t\t{\n\t\t\t$query->the_post();\n\t\t\techo '<li class=\"story-item\">';\t\t\n\t\t\tprintf('<a class=\"text-headline-small\" href=\"%1$s\">%2$s</a>', get_the_permalink(), get_the_title());\n\t\t\tprintf('<div class=\"category-author\">By %1$s | %2$s</div>', coauthors_posts_links(null, null, null, null, false), get_the_date('M. j, Y'));\n\t\t\tprintf('<p>%1$s</p>', get_the_excerpt());\n\t\t\techo '</li>';\n\t\t}\t\n\t}", "protected function get()\n\t{\n\t\tif (request()->has('_storyblok') || !config('storyblok.cache')) {\n\t\t\t$response = $this->makeRequest();\n\t\t} else {\n\t\t\t$uniqueTag = md5(serialize($this->getSettings()));\n\n\t\t\t$response = Cache::remember($this->cacheKey . $this->slug . '-' . $uniqueTag, config('storyblok.cache_duration') * 60, function () {\n\t\t\t\treturn $this->makeRequest();\n\t\t\t});\n\t\t}\n\n\t\t$this->totalStories = $response['headers']['Total'][0];\n\n\t\treturn collect($response['stories']);\n\t}", "public function getStories() {\n\t\tif (!$this->isLibrary()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ($this->stories === null) {\n\t\t\t// get stories from cache\n\t\t\t$this->stories = 0;\n\t\t\t$cache = WCF::getCache()->get('libraryData', 'counts');\n\t\t\tif (isset($cache[$this->libraryID]['stories']))\n\t\t\t\t$this->stories = $cache[$this->libraryID]['stories'];\n\t\t}\n\n\t\treturn $this->stories;\n\t}", "function getPeoplestories()\n\t\t\t{\n\t\t\t\t$sql = 'SELECT p.article_text,p.created_on,CONCAT(u.first_name, \" \", u.last_name) AS \"user_name\" ,u.profile_pic \n\t\t\t\t\t\t\t\tFROM '.USER.' as u ,'.PEOPLE_STORIES.' p \n\t\t\t\t\t\t\t\tWHERE u.user_id = p.user_id \n\t\t\t\t\t\t\t\torder by RAND() \n\t\t\t\t\t\t\t\tLIMIT 3';\n\t\t\t\t$query = $this->db->query($sql);\n\t\t\t\treturn $query->result();\n\t\t\t}", "public function getTopics($idTheme){\n $sql = \"SELECT t.id, t.title, t.pubDate, t.author, a.username FROM topic t\n INNER JOIN account a ON t.author=a.id\n WHERE t.theme=\".intval($idTheme).\"\n ORDER BY t.pubDate DESC;\";\n $res = mysqli_query($this->link, $sql);\n $topics = mysqli_fetch_all($res);\n return $topics;\n }", "public function getThemes()\n {\n $limit = (isset($this->requestParams['limit']) ? $this->requestParams['limit'] : 10);\n $page = (isset($this->requestParams['page']) ? $this->requestParams['page'] : 1);\n\n if ($limit <= 0) {\n throw new PushApiException(PushApiException::INVALID_RANGE, \"Invalid limit value\");\n }\n\n if ($page < 1) {\n throw new PushApiException(PushApiException::INVALID_RANGE, \"Invalid page value\");\n }\n\n if (!$theme = Theme::getThemes($limit, $page)) {\n throw new PushApiException(PushApiException::NOT_FOUND);\n }\n\n $this->send($theme);\n }", "public function get_top_stories()\n {\n \t$client = new Client();\n \t$url_string = $this->base_api.\"topstories\".$this->after_item;\n \t$response = $client->get($url_string);\n \t$response = $response->json();\n \treturn $response;\n }", "public function test_get_stories_count(): void {\n\t\t$story_posts = self::$testee->get_stories();\n\t\t$this->assertCount( 1, $story_posts );\n\t}", "public function all()\n {\n $list = [];\n\n /** @var UniformResourceLocator $locator */\n $locator = $this->grav['locator'];\n\n $iterator = $locator->getIterator('themes://');\n\n /** @var DirectoryIterator $directory */\n foreach ($iterator as $directory) {\n if (!$directory->isDir() || $directory->isDot()) {\n continue;\n }\n\n $theme = $directory->getFilename();\n\n try {\n $result = $this->get($theme);\n } catch (Exception $e) {\n $exception = new RuntimeException(sprintf('Theme %s: %s', $theme, $e->getMessage()), $e->getCode(), $e);\n\n /** @var Debugger $debugger */\n $debugger = $this->grav['debugger'];\n $debugger->addMessage(\"Theme {$theme} cannot be loaded, please check Exceptions tab\", 'error');\n $debugger->addException($exception);\n\n continue;\n }\n\n if ($result) {\n $list[$theme] = $result;\n }\n }\n ksort($list, SORT_NATURAL | SORT_FLAG_CASE);\n\n return $list;\n }", "function create_news_article_gallery_feed($categories, $galleryStyle, $myBethel, $blerts='No'){\n // set $DisplayImages and $DisplayTeaser to Yes, as it is used for the normal feeds - so we need to still set those\n global $DisplayImages;\n $DisplayImages = 'Yes';\n global $DisplayTeaser;\n $DisplayTeaser = 'Yes';\n\n // grab the global variable so we don't use stories that have already been used\n if( !array_key_exists('stories-already-used', $GLOBALS) ){\n $GLOBALS['stories-already-used'] = array();\n }\n\n // this is legacy code. It will be used for the archive and for any feed that includes old articles\n $arrayOfArticles = autoCache('get_xml', array($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/articles.xml\", $categories, \"inspect_news_article\"), 300, $blerts);\n\n // This is the new version of news.\n $arrayOfNewsAndStories = autoCache('get_xml', array($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/news-and-stories.xml\", $categories, \"inspect_news_article\"), 300, $blerts);\n\n $arrayOfNewsAndStories = sort_by_date($arrayOfNewsAndStories);\n\n $threeStories = array();\n $onlyLookForCoronavirus = False;\n// $coronavirusArticleId = 'c0a958b58c5865fc6f6501cb65bc8c89'; // TODO: THIS CAN BE REMOVED ONCE WE DON't HAVE THE CORNAVIRUS ARTICLE\n\n foreach( $arrayOfNewsAndStories as $index => $article) {\n $id = $article['id'];\n // if it's already been used, skip this article\n // if its the Homepage Top Feature, skip any that aren't tagged as homepage\n if( in_array($id, $GLOBALS['stories-already-used']) || ($galleryStyle == 'Homepage Top Feature' && !$article['featured-homepage-article']) || ($galleryStyle == 'About Page Feature' && !$article['about-page']) )\n continue;\n\n // TODO: THIS CHECK CAN BE REMOVED ONCE WE DON't HAVE THE CORNAVIRUS ARTICLE\n// if($onlyLookForCoronavirus === True && $galleryStyle == 'Homepage Top Feature' && $id != $coronavirusArticleId){\n// continue;\n// }\n\n // If the news feed is set to use blerts, we check to make sure they include the values we want, else continue\n // if we include public alerts, then we only want to skip internal ones\n // if we don't want blerts, then we skip all blerts\n // if we want to include internal, then we don't skip any\n if( ($blerts == 'Yes - Public Bethel Alert' and $article['bethel-alert'] == 'Internal Bethel Alert')\n or ($blerts == 'No' and $article['bethel-alert'] != 'No')){\n continue;\n }\n\n // We add the mybethel class for the community dashboard\n $add_mybethel_class = '';\n if( strpos($_SERVER['REQUEST_URI'], '_portal/') !== false )\n $add_mybethel_class = 'img-fluid';\n // Add the srcset to the gallery-image to be passed along to the html twig file\n $article['gallery-image'] = srcset($article['image-path'], false, true, $classes = $add_mybethel_class, $article['title']);\n\n // don't use this story on this page again\n array_push($GLOBALS['stories-already-used'], $id);\n\n array_push($threeStories, $article);\n unset($arrayOfNewsAndStories[$index]);\n\n // TODO: THIS IS THE DEFAULT CODE, but we don't want to do this while we have the cornavirus locked in position 3\n // exit once there are 3\n if( sizeof($threeStories) >= 3)\n break;\n // TODO: If its the homepage top feature and we have 2 and the coronavirus isn't in it, we only need to look for the cornavirus article.\n// if( $galleryStyle == 'Homepage Top Feature' && sizeof($threeStories) == 2 && !in_array($coronavirusArticleId, $GLOBALS['stories-already-used'])) {\n// $onlyLookForCoronavirus = True;\n// }\n// elseif( sizeof($threeStories) == 3) {\n// break;\n// }\n }\n\n $arrayOfArticles = array_merge($arrayOfArticles, $arrayOfNewsAndStories);\n global $NumArticles;\n $sortedArticles = sort_by_date($arrayOfArticles);\n\n // Only grab the first X number of articles.\n $sortedArticles = array_slice($sortedArticles, 0, $NumArticles, true);\n\n// echo \"<script>console.log( 'Debug Objects: \" . $galleryStyle . \"' );</script>\";\n\n $renderFile = \"feature_home_news_gallery.html\";\n if( $galleryStyle == \"Feature Top\") {\n $renderFile = \"feature_top_news_gallery.html\";\n } else if( $galleryStyle == \"Feature Left\") {\n $renderFile = \"feature_left_news_gallery.html\";\n }\n\n $twig = makeTwigEnviron('/code/news/twig');\n $html = $twig->render($renderFile, array(\n 'sortedArticles' => $sortedArticles,\n 'threeStories' => $threeStories,\n 'myBethel' => $myBethel\n ));\n\n return $html;\n}", "public static function get_all()\n\t{\n\t\tif ( !isset( self::$all_themes ) ) {\n\t\t\t$dirs = array( FILMIO_PATH . '/system/themes/*' , FILMIO_PATH . '/3rdparty/themes/*', FILMIO_PATH . '/user/themes/*' );\n\t\t\tif ( Site::is( 'multi' ) ) {\n\t\t\t\t$dirs[] = Site::get_dir( 'config' ) . '/themes/*';\n\t\t\t}\n\t\t\t$themes = array();\n\t\t\tforeach ( $dirs as $dir ) {\n\t\t\t\t$themes = array_merge( $themes, Utils::glob( $dir, GLOB_ONLYDIR | GLOB_MARK ) );\n\t\t\t}\n\n\t\t\t$themes = array_filter( $themes, function($a) {return file_exists( $a . \"/theme.xml\" );} );\n\t\t\t$themefiles = array_map( 'basename', $themes );\n\t\t\tself::$all_themes = array_combine( $themefiles, $themes );\n\t\t}\n\t\treturn self::$all_themes;\n\t}", "function fetch_theme()\n {\n global $chosen;\n return $chosen;\n }", "public function getThemes($idCategory){\n $sql = \"SELECT t.id, t.title FROM theme t\n WHERE t.category=\".intval($idCategory).\";\";\n $res = mysqli_query($this->link, $sql);\n $themes = mysqli_fetch_all($res);\n return $themes;\n }", "public function getByTheme($theme);", "function themes($name, $theme_dir) {\r\n $handle = @opendir($theme_dir);\r\n $list = array();\r\n while ($file = readdir($handle)) {\r\n if ($file == '.' || $file == '..')\r\n continue;\r\n // TODO: optimize the string concatenation\r\n if (!is_dir($theme_dir . '/' . $file))\r\n continue;\r\n if (!is_file($theme_dir . '/' . $file . '/theme.php'))\r\n continue;\r\n $list[$theme_dir . '/' . $file] = $file;\r\n }\r\n closedir($handle);\r\n\r\n $this->select($name, $list);\r\n }", "public function get_story()\n {\n return $this->thread->get_story();\n }", "function gschichtn_ajax_more_posts() {\n\t$offset = $_POST['offset'];\n\t$ppp = $_POST['ppp'];\n\t$return = array();\n\n\t$stories_reloaded = new WP_Query( array(\n\t\t'post_type' => 'story',\n\t\t'post_status' => 'publish',\n\t\t'posts_per_page' => $ppp,\n\t\t'offset' => $offset,\n\t\t'orderby' => 'date',\n\t\t'order' => 'DESC'\n\t) );\n\n\twhile ( $stories_reloaded->have_posts() ) {\n\t\t$stories_reloaded->the_post();\n\n\t\t$storyCategory = get_the_terms( get_the_id(), 'story-category' );\n\t\t$storyFormat = get_the_terms( get_the_id(), 'story-format' );\n\t\t$storyYear = get_the_terms( get_the_id(), 'story-year' );\n\n\t\tarray_push( $return, array(\n\t\t\t'id' => get_the_id(),\n\t\t\t'title' => get_the_title(),\n\t\t\t'image' => wp_get_attachment_image_src( get_post_thumbnail_id( $stories_reloaded->ID ), 'thumbnail-200' ),\n\t\t\t'story-category' => array(\n\t\t\t\t'name' => $storyCategory[0]->name,\n\t\t\t\t'slug' => $storyCategory[0]->slug\n\t\t\t),\n\t\t\t'story-format' => array(\n\t\t\t\t'name' => $storyFormat[0]->name,\n\t\t\t\t'slug' => $storyFormat[0]->slug\n\t\t\t),\n\t\t\t'story-year' => $storyYear, \n\t\t\t'permalink' => get_the_permalink()\n\t\t) );\n\t}\n\n\treturn wp_send_json( $return );\n}", "public function index()\n {\n return Story::all();\n }", "public static function get_all_data()\n\t{\n\t\tif ( !isset( self::$all_data ) ) {\n\t\t\tforeach ( self::get_all() as $theme_dir => $theme_path ) {\n\t\t\t\t$themedata = array();\n\t\t\t\t$themedata['dir'] = $theme_dir;\n\t\t\t\t$themedata['path'] = $theme_path;\n\t\t\t\t$themedata['theme_dir'] = $theme_path;\n\n\t\t\t\t$themedata['info'] = simplexml_load_file( $theme_path . '/theme.xml' );\n\t\t\t\t$themedata['info']['filename'] = $theme_path . '/theme.xml';\n\t\t\t\tif ( $themedata['info']->getName() != 'pluggable' || (string) $themedata['info']->attributes()->type != 'theme' ) {\n\t\t\t\t\t$themedata['screenshot'] = Site::get_url( 'admin_theme' ) . \"/images/screenshot_default.png\";\n\t\t\t\t\t$themedata['info']->description = '<span class=\"error\">' . _t( 'This theme is a legacy theme that is not compatible with Filmio ' ) . Version::get_Filmioversion() . '. <br><br>Please update your theme.</span>';\n\t\t\t\t\t$themedata['info']->license = '';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tforeach ( $themedata['info'] as $name=>$value ) {\n\t\t\t\t\t\tif($value->count() == 0) {\n\t\t\t\t\t\t\t$themedata[$name] = (string) $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$themedata[$name] = $value->children();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $screenshot = Utils::glob( $theme_path . '/screenshot.{png,jpg,gif}', GLOB_BRACE ) ) {\n\t\t\t\t\t\t$themedata['screenshot'] = Site::get_url( 'filmio' ) . dirname( str_replace( FILMIO_PATH, '', $theme_path ) ) . '/' . basename( $theme_path ) . \"/\" . basename( reset( $screenshot ) );\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$themedata['screenshot'] = Site::get_url( 'admin_theme' ) . \"/images/screenshot_default.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tself::$all_data[$theme_dir] = $themedata;\n\t\t\t}\n\t\t}\n\t\treturn self::$all_data;\n\t}", "function cohort_get_list_of_themes() {\n $themes = array();\n $allthemes = get_list_of_themes();\n foreach ($allthemes as $key => $theme) {\n if (empty($theme->hidefromselector)) {\n $themes[$key] = get_string('pluginname', 'theme_'.$theme->name);\n }\n }\n return $themes;\n}", "public function getLimitedStories(){\n\t\t$sql = '\n\t\tSELECT *\n\t\tFROM stories\n\t\tORDER BY RAND()\n\t\tLIMIT 12\n\t\t';\n\n\t\t$sth = $this->dbh->prepare($sql);\n\n\t\tif ($sth->execute() === false) {\n\t\t\tprint_r($sth->errorInfo());\n\t\t} else {\n\t\t\treturn $sth->fetchAll();\n\t\t}\n\t}", "public function getThemes($backlogId, $includeStories = false) {\n $path = 'api/backlogs/' . $backlogId . '/themes.json';\n\n if ($includeStories) {\n $path .= '?include_associated_data=true';\n }\n\n return $this->getDataApiData($path);\n }", "public function index()\n {\n $results = app('db')->select(\"SELECT * FROM themes\");\n return $results;\n }", "function rw_material_get_themenliste(){\n\n\t$links =[];\n\n\t$args = array(\n\t\t\"post_type\" => \"themenseite\",\n\t\t\"post_status\" => \"publish\",\n\t\t\"orderby\" => \"title\",\n\t\t\"order\" => \"ASC\",\n\t\t\"posts_per_page\" => 1000,\n\t);\n\t$themen = get_posts($args);\n\n\tforeach ($themen as $thema){\n\n\t\t$pattern = '<a class=\"button\" href=\"%s\">%s</a>';\n\t\t$link = sprintf($pattern, $thema->guid, $thema->post_title);\n\t\t$links[] = $link;\n\n\t}\n\n\treturn implode('<span> · </span>', $links);\n\n}" ]
[ "0.6529666", "0.6246832", "0.5991553", "0.596242", "0.5902879", "0.5902879", "0.5834432", "0.5815732", "0.5572879", "0.5551509", "0.5464429", "0.5455386", "0.5422353", "0.5415906", "0.53975046", "0.5394214", "0.53876436", "0.53821266", "0.5378943", "0.5360829", "0.5327634", "0.5322421", "0.53147334", "0.5301037", "0.52876055", "0.52835625", "0.5240163", "0.5226557", "0.5203408", "0.5171366" ]
0.7207561
0
Removes an item from the database (Sets 'isActive'= False for the specified ingredient) Note: type is the type of ingredient (base, bread, cheese, fry (or fries), and toppings)
function removeIngredient($type, $id) { $mysqli = getConnection(); if (strtolower($type) == "base") { $type = "Bases"; } else if (strtolower($type) == "bread") { $type = "Breads"; } else if (strtolower($type) == "cheese") { $type = "Cheeses"; } else if (strtolower($type) == "fry" || strtolower($type) == "fries" ) { $type = "Fries"; } else if (strtolower($type) == "topping") { $type = "Toppings"; } $query = "UPDATE $type SET isActive=0 WHERE id=$id"; $mysqli->query($query) or trigger_error($mysqli->error."[$query]"); $mysqli->close(); echo json_encode("Removed"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeitem($item);", "public function action_delete_item()\n {\n try {\n $type_stub = $this->request->param('id');\n $type = $this->_crud_items[$type_stub];\n $id = $this->request->param('toggle');\n\n if (empty($type)) {\n IbHelpers::set_message('This action cannot be performed on items of type '.$type_stub, 'error popup_box');\n $this->request->redirect('/admin/'.$this->_plugin);\n }\n\n if (!empty($type['delete_permission']) && !Auth::instance()->has_access($type['delete_permission'])) {\n IbHelpers::set_message('You need access to the &quot;'.$type['delete_permission'].'&quot; permission to perform this action.', 'error popup_box');\n $this->request->redirect('/admin/'.$this->_plugin);\n }\n\n $model = ORM::factory($type['model'])->where('id', '=', $id)->find_undeleted();\n $model->delete_and_save();\n\n IbHelpers::set_message(htmlspecialchars($type['name'].' #'.$id.' successfully deleted.'), 'success popup_box');\n\n $name_plural = isset($type['name_plural']) ? $type['name_plural'] : $type['name'].'s';\n $stub_plural = isset($type['stub_plural']) ? $type['stub_plural'] : $type_stub.'s';\n\n $this->request->redirect('/admin/'.$this->_plugin.'/'.$stub_plural);\n }\n catch (Exception $e) {\n Log::instance()->add(Log::ERROR, \"Error deleting\\n\".$e->getMessage().\"\\n\".$e->getTraceAsString());\n IbHelpers::set_message('Unexpected internal error deleting. If this problem continues, please ask an administrator to check the error logs.');\n $this->request->redirect('/admin');\n }\n }", "public function remove( $item );", "public function remove($item);", "public function remove(string $identity, int $quantity = 1): void\n {\n DatabaseConnection::getInstance();\n $statement = DatabaseConnection::$pdo->prepare(\"UPDATE inventory SET amount = greatest(0, amount - :quantity) \n WHERE owner = :user \n AND item_type = (SELECT item_id FROM item \n WHERE lower(item_internal_name) = lower(:item)) AND amount > 0\");\n $statement->bindValue(':user', $this->char->id());\n $statement->bindValue(':item', $identity);\n $statement->bindValue(':quantity', $quantity);\n $statement->execute();\n }", "public function deleteItem() {\n $this->request->onlyAllow('post');\n $this->response->type('json');\n\n $status = false;\n $message = \"\";\n\n if (isset($this->request->data)) {\n $id = $this->request->data['id'];\n $type = $this->request->data['type'];\n $status = $this->Library->deleteItem($type, $id);\n }\n\n if ($status) {\n $message = \"Deletion successful\";\n } else {\n $message = \"Deletion unsuccessful\";\n }\n\n $this->set(compact('status', 'message', 'data'));\n $this->set('_serialize', array('data', 'status', 'message'));\n }", "public function remove_item() {\r\n\t\t$data = array(\r\n\t\t\t\t'rowid' => $this->input->post('row_id'),\r\n\t\t\t\t'qty' => 0\r\n\t\t);\t\t\r\n\t\t$this->cart->update($data);\r\n\t\t$this->load_cart();\r\n\t}", "function RemoveItem($itemid, $qty = null, $type = null, $mp = null, $basket_table_id = null)\n {\n if (count($this->MenuItems >= 1))\n {\n foreach($this->MenuItems as $item)\n {\n if ($item['item_id'] == $itemid)\n {\n if ((isset($qty)) && ($qty !=\"\"))\n {\n if ((($mp != \"\") && ($mp == $item['multiprice_description'])) || ($mp == \"\"))\n {\n if ((!isset($basket_table_id)) || ($basket_table_id == \"\") || ((isset($basket_table_id)) && ($item['id'] == $basket_table_id)))\n {\n //lower amount in basket table\n $DBA = new DatabaseInterface();\n\n $fields = array(0 => 'id', 1 => 'number_of_items');\n $idfields = array(0 =>'item_id', 1 => 'basket_id');\n $idvals = array(0 => $itemid, 1 => $this->ID);\n if ($mp != \"\")\n {\n array_push($idfields, 'multiprice_description');\n array_push($idvals, $mp);\n }\n\n if ((isset($basket_table_id)) && ($basket_table_id != \"\"))\n {\n array_push($idfields, 'id');\n array_push($idvals, $basket_table_id);\n }\n\n $rs = $DBA->selectQuery(DBBASKETITEMSTABLE, $fields, $idfields, $idvals);\n\n if (!isset($rs[2]))\n {\n while ($res = mysql_fetch_array($rs[0]))\n {\n $existid = $res['id'];\n $num = $res['number_of_items'];\n }\n }\n\n unset($fields, $idfields, $idvals, $rs, $res, $DBA);\n\n $newnum = $num - $qty;\n\n $DBA = new DatabaseInterface();\n\n if ($newnum !=0)\n {\n $fields = array(0 => 'number_of_items');\n $fieldvals = array(0 => $newnum);\n $idfields = array(0 => 'id');\n $idvals = array(0 => $existid);\n if ($mp != \"\")\n {\n array_push($idfields, 'multiprice_description');\n array_push($idvals, $mp);\n }\n $rs = $DBA->updateQuery(DBBASKETITEMSTABLE, $fields, $fieldvals, $idfields, $idvals);\n if (!isset($rs))\n {\n if (!isset($type))\n {\n error_push('Error updating quantity');\n }\n }\n else\n {\n if (!isset($type))\n {\n session_push('Quantity updated');\n }\n }\n unset($fields, $idfields, $idvals, $fieldvals, $rs, $DBA, $newnum, $num, $existid);\n }\n else\n {\n $DBA = new DatabaseInterface();\n $fields = array(0 => '*');\n $idfields = array(0 => 'basket_id', 1 => 'item_id');\n $idvals = array(0 => $this->ID, 1 => $itemid);\n if ($mp != \"\")\n {\n array_push($idfields, 'multiprice_description');\n array_push($idvals, $mp);\n }\n\n if ((isset($basket_table_id)) && ($basket_table_id != \"\"))\n {\n array_push($idfields, 'id');\n array_push($idvals, $basket_table_id);\n }\n\n $rs = $DBA->selectQuery(DBBASKETITEMSTABLE, $fields, $idfields, $idvals);\n\n if (!isset($rs[2]))\n {\n while ($res = mysql_fetch_array($rs[0]))\n {\n $btid = $res['id'];\n $hasextras = $res['hasextras'];\n $haschoices = $res['haschoices'];\n }\n }\n unset($fields, $idfields, $idvals, $rs, $res, $DBA);\n\n $DBA = new DatabaseInterface();\n $sql = \"delete from \" . DBBASKETITEMSTABLE . \" where basket_id = '\" . $this->ID . \"' and item_id = \" . $itemid;\n if ($mp != \"\")\n {\n $sql .= \" and multiprice_description = '\" . $mp . \"'\";\n }\n\n if ((isset($basket_table_id)) && ($basket_table_id != \"\"))\n {\n $sql .= \" and id = '\" . $basket_table_id . \"'\";\n }\n\n $rs = $DBA->runQuery($sql);\n\n if (!isset($rs))\n {\n if (!isset($type))\n {\n error_push('Error removing item');\n }\n }\n else\n {\n if (!isset($type))\n {\n session_push('Item removed');\n }\n }\n unset($DBA, $sql, $rs);\n\n if ($hasextras == 'Y')\n {\n $DBA = new DatabaseInterface();\n $sql = \"delete from \" . DBBASKETEXTRAITEMSTABLE . \" where basket_id='\" . $this->ID . \"' and item_id = \" . $itemid;\n if (isset($basket_table_id))\n {\n $sql .= \" and basket_table_id = '\" . $basket_table_id . \"'\";\n }\n $rs = $DBA->runQuery($sql);\n }\n\n if ($haschoices == 'Y')\n {\n $DBA = new DatabaseInterface();\n $sql = \"delete from \" . DBBASKETCHOICEITEMSTABLE . \" where basket_id='\" . $this->ID . \"' and item_id = \" . $itemid;\n if (isset($basket_table_id))\n {\n $sql .= \" and basket_table_id = '\" . $basket_table_id . \"'\";\n }\n $rs = $DBA->runQuery($sql);\n }\n unset($DBA, $sql, $rs);\n }\n $this->updateBasket();\n }\n }\n }\n else\n {\n //remove record from basket table\n if ((($mp != \"\") && ($mp == $item['multiprice_description'])) || ($mp == \"\") || (!isset($mp)))\n {\n $DBA = new DatabaseInterface();\n $fields = array(0 => '*');\n $idfields = array(0 => 'basket_id', 1 => 'item_id');\n $idvals = array(0 => $this->ID, 1 => $itemid);\n if ($mp != \"\")\n {\n array_push($idfields, 'multiprice_description');\n array_push($idvals, $mp);\n }\n\n if ((isset($basket_table_id)) && ($basket_table_id !=\"\"))\n {\n array_push($idfields, 'id');\n array_push($idvals, $basket_table_id);\n }\n\n $rs = $DBA->selectQuery(DBBASKETITEMSTABLE, $fields, $idfields, $idvals);\n\n if (!isset($rs[2]))\n {\n while ($res = mysql_fetch_array($rs[0]))\n {\n $btid = $res['id'];\n $hasextras = $res['hasextras'];\n $haschoices = $res['haschoices'];\n }\n }\n\n unset($fields, $idfields, $idvals, $rs, $res, $DBA);\n $DBA = new DatabaseInterface();\n $sql = \"delete from \" . DBBASKETITEMSTABLE . \" where basket_id = '\" . $this->ID . \"' and item_id = \" . $itemid;\n if ($mp != \"\")\n {\n $sql .= \" and multiprice_description = '\" . $mp . \"'\";\n }\n\n if ((isset($basket_table_id)) && ($basket_table_id != \"\"))\n {\n $sql .= \" and id = '\" . $basket_table_id . \"'\";\n }\n\n $rs = $DBA->runQuery($sql);\n if (!isset($rs))\n {\n if (!isset($type))\n {\n error_push('Error removing item');\n }\n }\n else\n {\n if (!isset($type))\n {\n session_push('Item removed');\n }\n }\n unset($DBA, $sql, $rs);\n if ($hasextras == 'Y')\n {\n $DBA = new DatabaseInterface();\n $sql = \"delete from \" . DBBASKETEXTRAITEMSTABLE . \" where basket_id='\" . $this->ID . \"' and item_id = \" . $itemid;\n if ((isset($basket_table_id)) && ($basket_table_id != \"\"))\n {\n $sql .= \" and basket_table_id = '\" . $basket_table_id . \"'\";\n }\n $rs = $DBA->runQuery($sql);\n }\n unset($DBA, $sql, $rs);\n \n if ($haschoices == \"Y\")\n {\n $DBA = new DatabaseInterface();\n $sql = \"delete from \" . DBBASKETCHOICEITEMSTABLE . \" where basket_id='\" . $this->ID . \"' and item_id = \" . $itemid;\n if (isset($basket_table_id))\n {\n $sql .= \" and basket_table_id = '\" . $basket_table_id . \"'\";\n }\n $rs = $DBA->runQuery($sql);\n }\n unset($DBA, $sql, $rs);\n }\n }\n }\n }\n }\n }", "function cleanDBonItemDelete($itemtype, $ID) {\n\n return $this->deleteByCriteria(['itemtype' => $itemtype, 'items_id' => $ID], 1);\n }", "public function destroy($type=null,$item_id,$id)\n {\n $item = Rating::find($id);\n $item->delete();\n return back()->with('danger', 'Rating removed successfully!');\n }", "public function remove(Item $Item) : bool ;", "public function removeItem($itemId)\n {\n $item = $this->getItemById($itemId);\t\t\n\t\t\n if ($item) {\n\t\t\t$imageDir = Mage::getBaseDir(). DS .'designtool' . DS .'saveimg'. DS;\n\t\t\t$itemCollection = Mage::getModel(\"sales/quote_item\")\n\t\t\t\t\t\t\t->getCollection()\n\t\t\t\t\t\t\t->addFieldToFilter(\"front_image\", $item->getFrontImage())\n\t\t\t\t\t\t\t->addFieldToFilter('parent_item_id', array('neq' => 'NULL'));\n\t\t\tif(count($itemCollection->getData())==1)\n\t\t\t{\n\t\t\t\tif (file_exists($imageDir.$item->getFrontImage())){\n\t\t\t\t\tunlink($imageDir.$item->getFrontImage());\n\t\t\t\t}\n\t\t\t\tif (file_exists($imageDir.$item->getBackImage())){\n\t\t\t\t\tunlink($imageDir.$item->getBackImage());\n\t\t\t\t}\n\t\t\t\tif (file_exists($imageDir.$item->getLeftImage())){\n\t\t\t\t\tunlink($imageDir.$item->getLeftImage());\n\t\t\t\t}\n\t\t\t\tif (file_exists($imageDir.$item->getRightImage())){\n\t\t\t\t\tunlink($imageDir.$item->getRightImage());\n\t\t\t\t}\n\t\t\t}\n\t\t\n $item->setQuote($this);\n /**\n * If we remove item from quote - we can't use multishipping mode\n */\n $this->setIsMultiShipping(false);\n $item->isDeleted(true);\n if ($item->getHasChildren()) {\n foreach ($item->getChildren() as $child) {\n $child->isDeleted(true);\n }\n }\n\n $parent = $item->getParentItem();\n if ($parent) {\n $parent->isDeleted(true);\n }\n\n Mage::dispatchEvent('sales_quote_remove_item', array('quote_item' => $item));\n }\n\n return $this;\n }", "public function test_remove_item()\n\t{\n\t\t$basket = new Model_Basket;\n\n\t\t$item_1 = $this->get_item();\n\t\t$basket->add_item($item_1);\n\n\t\t$item_2 = $this->get_item();\n\t\t$item_2->identifier = 2;\n\t\t$basket->add_item($item_2);\n\n\t\t$basket->remove_item($item_1->get_identifier());\n\n\t\t$this->assertSame($basket->item_count(), 1);\n\t}", "public function delete($item);", "function item_delete()\n {\n $key = $this->get('id');\n $this->supplies->delete($key);\n $this->response(array('ok'), 200);\n }", "public function deleteItem($itemId);", "public function removeQuantity(object $model, int $quantity = 1): CartItem;", "public function remove (Item $item): void\n {\n foreach ($this->items as $key => $entity) {\n if ($item->getId() === $entity->getId()) {\n unset($this->items[$key]);\n break;\n }\n }\n }", "public function deleteItem( $type, $id, $restore = FALSE ) {\n\t\t$id = intval( $id );\n\n\t\tif ( $type !== 'crew' ) {\n\t\t\t$this->dbDelete( \"delete_$type\", $type . 's', 'id', $id, 'i' );\n\t\t} else {\n\t\t\t$data = [\n\t\t\t\t'disabled' => $restore ? 0 : 1\n\t\t\t];\n\n\t\t\t$this->dbUpdate( 'disable_user', 'user_settings', $data, \"id = $id\" );\n\t\t}\n\n\t}", "public function removeItem($id)\n {\n }", "public function delete($item) { }", "function once_delete_item($table,$type=''){\n\t\t// Check statements type\n\t\tif($type=='project_id'){\n\t\t\t$sql=\"AND project_id=\".$this->data['project_id'].\"\";\n\t\t}else if($type=='user_id'){\n\t\t\t$sql=\"AND user_id=\".$this->data['user_id'].\"\";\n\t\t}else if($type=='all'){\n\t\t\t$sql=\"AND project_id=\".$this->data['project_id'].\" AND user_id=\".$this->data['user_id'].\"\";\n\t\t}else{\n\t\t\t$sql='';\n\t\t}\n\n\t\t// Get selected data\n\t\t$stmt = $this->pdo->prepare(\"SELECT * FROM edit_\".$table.\" WHERE id=:id \".$sql.\" LIMIT 1\");\n\t\t$stmt->bindParam(':id', $this->data['id'], PDO::PARAM_INT);\n\t\t$stmt->execute();\n\n\t\t// Check if item exist\n\t\tif($stmt->rowCount()){\n\t\t\t// Delete selected item\n\t\t\t$stmt = $this->pdo->prepare(\"DELETE FROM edit_\".$table.\" WHERE id=:id LIMIT 1\");\n\t\t\t$stmt->bindParam(':id', $this->data['id'], PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\n\t\t\tif($stmt->rowCount()){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\t$this->set_error('Can not delete item from: '.$table.'');\n\t\t\t}\n\t\t}else{\n\t\t\t$this->set_error('Item not exist in: '.$table.'');\n\t\t}\n\t}", "public function removeByItemName(string $itemName): void;", "public function onReminderUserItemRemoveEvent(ReminderUserItemEvent $event)\n {\n assert(($item = $event->getEntity()));\n\n $this->container->get('entity_manager')->remove($item);\n $this->container->get('entity_manager')->flush($item);\n }", "public function throw_item_away($type, $id) {\n\t\t$type = (int)$type;\n\t\t$id = (int)$id;\n\t\tif ($type <= 0) {\n\t\t\tthrow new IllegalArgumentException(\"type\", \"N+\\{0}\",$type);\n\t\t}\n\t\tif ($id <= 0) {\n\t\t\tthrow new IllegalArgumentException(\"id\", \"N+\\{0}\",$id);\n\t\t}\n\n\t\tquery(\n\t\t\t\"UPDATE user_items SET amount=amount-1 \".\n\t\t\t\"WHERE uid={$this->uid} AND id=$id AND type=$type AND amount>0\"\n\t\t);\n\t\tif (mysql_affected_rows() == 0) {\n\t\t\tthrow new Exception(\"Item cannot thrown away!\",\n\t\t\t\tself::ERR_ITEM_DOES_NOT_EXIST);\n\t\t}\n\t}", "public function deleteItem() {\n\n\t\t$data = file_get_contents(\"php://input\");\n\n\t\tif (!empty($data)) {\n\t\t\t\n\t\t\t$pedido = new Pedidos();\n\t\t\t$itens = new Itens();\n\n\t\t\t$data = json_decode($data, true);\n\n\t\t\tif (isset($data['id_pedido']) && !empty($data['id_pedido']) && is_numeric($data['id_pedido'])) {\n\n\t\t\t\t$id_pedido = addslashes($data['id_pedido']);\n\t\t\t\t\n\t\t\t\tif ($pedido->verificaStatus($id_pedido) == 0) {\n\t\t\t\t\t\n\t\t\t\t\tforeach ($data['itens'] as $item) {\n\t\t\t\t\t\t$id = addslashes($item['id']);\n\t\t\t\t\t\t$itens->deleteItem($id_pedido, $id);\n\t\t\t\t\t}\n\n\t\t\t\t\t$pedido->updateTotal($id_pedido);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}", "function removeSupplierItem(SupplierItemInterface $supplierItem);", "public function removeFromCart($item){\r\n if (array_key_exists($item, $this->cart)) {\r\n if ($this->cart[$item] > 1) {\r\n $this->cart[$item] -= 1; // if count of items in cart is more than 1, decrement its count by 1\r\n } else {\r\n unset($this->cart[$item]); // if only one item of this type left in cart, remove item from cart\r\n }\r\n }\r\n }", "public function delete()\n {\n $items = $this->item();\n $items->delete();\n parent::delete();\n }", "public function remove( $item ) {\n\t\t$items = $this->get();\n\n\t\t// If the item is not in dismissed items, there's nothing to do.\n\t\tif ( ! array_key_exists( $item, $items ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tunset( $items[ $item ] );\n\n\t\t$this->set( $items );\n\t}" ]
[ "0.645224", "0.63982385", "0.63101", "0.63080823", "0.6141252", "0.60783166", "0.5987915", "0.5970493", "0.5954562", "0.58872545", "0.58454746", "0.57850486", "0.57708275", "0.5719405", "0.5697386", "0.5658442", "0.5658114", "0.56445205", "0.5618893", "0.56143016", "0.56131834", "0.55679184", "0.5554892", "0.5546318", "0.55425656", "0.55298203", "0.55107963", "0.5505424", "0.5496237", "0.5489319" ]
0.7037199
0
Get rate of change within the last two days
public function getRecentRateChange() { $qb = $this->em->createQueryBuilder(); $qb ->select('ex.rawData') ->from('AppBundle\Entity\ExchangeRate', 'ex') ->addOrderBy('ex.dateUpdated', 'DESC') ->setMaxResults(2); $result = $qb->getQuery()->getResult('CustomHydrator'); $dayOne = json_decode($result[0], true); $dayTwo = json_decode($result[1], true); $count = count($dayOne); $delta = array(); for ($i = 0; $i < $count; ++$i) { $delta[] = [ 'code' => $dayOne[$i]['code'], 'change' => $dayOne[$i]['rate'] - $dayTwo[$i]['rate'], 'rate' => $dayOne[$i]['rate'], ]; } return $delta; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GetCurrencyRateByLastDateWRate($fecha, $moneda, $db) {\n\n $sql = \"SELECT 1/rate AS rate,\n fecha\n FROM tipocambio\n WHERE DATE_FORMAT(fecha,'%Y-%m-%d') = '\" . $fecha . \"'\n AND currency = '\" . $moneda . \"'\n AND rate <> 0 LIMIT 1\";\n \n $result = DB_query($sql,$db);\n if ($myrow = DB_fetch_row($result)) {\n return $myrow[0]; \n } else {\n return 0;\n }\n}", "protected abstract function rate();", "public static function getHashrateDiff() {\n\t\t$latest = BlockchainSnapshot::getLatestBlockchainSnapshot();\n\t\t$before = BlockchainSnapshot::getLatestBlockchainSnapshot(1);\n\n\t\t$result = [\n\t\t\t'hashrate' => round($latest->hashrate / 1024 / 1024, 0),\n\t\t\t'dayHashrateDiff' => round(($latest->hashrate - $before->hashrate) / 1024 / 1024, 0),\n\t\t];\n\n\t\tif($before->hashrate == 0) {\n\t\t\t$result['dayHashrateDiffPercent'] = '+ 100%';\n\t\t}\n\t\telse {\n\t\t\t$result['dayHashrateDiffPercent'] = round((($latest->hashrate / $before->hashrate) - 1) * 100, 0);\n\t\t\t$result['dayHashrateDiffPercent'] = $result['dayHashrateDiffPercent'] >= 0 ? '+ ' . $result['dayHashrateDiffPercent'] : '- ' . -$result['dayHashrateDiffPercent'];\n\t\t}\n\n\t\treturn $result;\n\t}", "public static function getDollarExchangeRate()\n {\n $doc = new DOMDocument();\n date_default_timezone_set('UTC');\n $urlWS_c = \"https://gee.bccr.fi.cr/Indicadores/Suscripciones/WS/wsindicadoreseconomicos.asmx/ObtenerIndicadoresEconomicos?Indicador=317&FechaInicio=\" . date(\"d/m/Y\") . \"&FechaFinal=\" . date(\"d/m/Y\") . \"&Nombre=Juan%20Carlos%20Sequeira%20Piedra&SubNiveles=N&[email protected]&Token=SI62R0E60A\";\n\n $xml = file_get_contents($urlWS_c);\n $doc->loadXML($xml);\n $ind = $doc->getElementsByTagName('INGC011_CAT_INDICADORECONOMIC');\n\n foreach ($ind as $node) {\n $change = substr($node->getElementsByTagName('NUM_VALOR')->item(0)->nodeValue, 0, -6);\n }\n return $change;\n }", "public function fetchDropRate(): float {\n switch ($this->value) {\n case self::INCREASE_STATS_BY_TWO_HUNDRED_FIFTY:\n return 0.02;\n case self::INCREASE_STATS_BY_FIVE_HUNDRED:\n return 0.05;\n case self::INCREASE_STATS_BY_ONE_THOUSAND:\n return 0.08;\n case self::INCREASE_STATS_BY_TWO_THOUSAND:\n return 0.10;\n case self::INCREASE_STATS_BY_THREE_THOUSAND:\n return 0.14;\n default:\n // @codeCoverageIgnoreStart\n return 0.0;\n // @codeCoverageIgnoreEnd\n }\n }", "public function getSuperReducedRate()\n {\n $period = $this->getCurrentPeriod();\n\n return ($period ? $period->getSuperReducedRate() : null);\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRenewDays();", "public function getRate(): float\n {\n return $this->rate;\n }", "private function getUpdateRateValue($day) {\n\t\t$update_rate_value = 0;\n\t\t$previous_rate_day = PHP_INT_MIN;\n\t\t\n\t\tforeach ($this->quality_update_rates as $update_rate) {\n\t\t\tif ($update_rate->applied_down_to_day < $day && $update_rate->applied_down_to_day >= $previous_rate_day) {\n\t\t\t\t$update_rate_value = $update_rate->update_rate;\n\t\t\t\t$previous_rate_day = $update_rate->applied_down_to_day;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $update_rate_value;\n\t}", "public static function getTodayRate()\n {\n // return CurrenciesRateModel::whereDate('created_at', Carbon::now()->format('Y-m-d'))->first();\n return CurrenciesRateModel::orderBy('id', 'desc')->first();\n }", "function generate_repay_ratio($from_date,$to_date){\n list($from_year,$from_month,$from_mday) = explode('-', $from_date);\n list($to_year,$to_month,$to_mday) = explode('-', $to_date);\n $resp = new xajaxResponse();\n $calc = new Date_Calc();\n $to_date = $to_year .\"-\".$to_month.\"-31 23:59:59\";\n //LOAN LOSS PROVISSIONS\n $next=0;\n $y_list ='';\n $x_list='';\n $from_days = $calc->dateToDays(28, $from_month, $from_year);\n $to_days = $calc->dateToDays(28, $to_month, $to_year);\n $diff = $to_days - $from_days;\n while($next <= $diff){\n $apparent_date = $calc->daysToDate($calc->dateToDays(28, $from_month, $from_year) + $next, '%Y-%m-28');\n preg_match(\"/(\\d+)-(\\d+)-28/\", $apparent_date, $arr);\n $apparent_date = $calc->endOfMonthBySpan(0, $arr[2], $arr[1], '%Y-%m-%d');\n //CALCULATE CUMMULATED REPAYMENT RATE\n $sched_res = mysql_query(\"select sum(s.princ_amt) as princ_amt from schedule s join disbursed d on s.loan_id=d.id left join written_off w on d.id=w.loan_id where (w.date >='\".$apparent_date.\"' or w.date is null) and s.date <= '\".$apparent_date.\"'\");\n $sched = mysql_fetch_array($sched_res);\n $sched_amt = ($sched['princ_amt']!= NULL) ? $sched['princ_amt'] : 1;\n $paid_res = mysql_query(\"select sum(p.princ_amt) as princ_amt from payment p join disbursed d on p.loan_id=d.id left join written_off w on d.id=w.loan_id where (w.date >='\".$apparent_date.\"' or w.date is null) and p.date <= '\".$apparent_date.\"'\");\n $paid = mysql_fetch_array($paid_res);\n $paid_amt = ($paid['princ_amt'] != NULL) ? $paid['princ_amt'] : 0;\n \n //CALCULATE REPAYMENT RATE FOR THIS MONTH\n $nowsched_res = mysql_query(\"select sum(s.princ_amt) as princ_amt from schedule s join disbursed d on s.loan_id=d.id left join written_off w on d.id=w.loan_id where (w.date >='\".$apparent_date.\"' or w.date is null) and s.date like '\".$arr[1].\"-\".$arr[2].\"-%' \");\n $nowsched = mysql_fetch_array($nowsched_res);\n $nowsched_amt = ($sched['princ_amt']!= NULL) ? $nowsched['princ_amt'] : 1;\n $nowpaid_res = mysql_query(\"select sum(p.princ_amt) as princ_amt from payment p join disbursed d on p.loan_id=d.id left join written_off w on d.id=w.loan_id where (w.date >='\".$apparent_date.\"' or w.date is null) and p.date like '\".$arr[1].\"-\".$arr[2].\"-%'\");\n $nowpaid = mysql_fetch_array($nowpaid_res);\n $nowpaid_amt = ($nowpaid['princ_amt'] != NULL) ? $nowpaid['princ_amt'] : 0;\n \n\n $percent = ($paid_amt / $sched_amt) * 100.00;\n $nowpercent = ($nowpaid_amt / $nowsched_amt) * 100.00;\n $percent = sprintf(\"%.02f\", $percent);\n $nowpercent = sprintf(\"%.02f\", $nowpercent);\n if($y_list == ''){\n $y_list = $percent;\n $nowy_list = $nowpercent;\n }else{\n $y_list = $y_list .\",\".$percent;\n $nowy_list = $nowy_list .\",\".$nowpercent;\n }\n $month_year = date('M', strtotime($apparent_date)) .\" \". date('Y', strtotime($apparent_date));\n if($x_list == '')\n $x_list = $month_year;\n else\n $x_list = $x_list .\",\".$month_year; \n $next = $next + 30;\n }\n\n // Create the basic graph\n $x_array = split(',', $x_list);\n $y_array = split(',', $y_list);\n $nowy_array = split(',', $nowy_list);\n //print_r($x_array.\"<br>\".$y_array);\n //exit();\n//CREATE GRAPH\n $graph = new Graph(900,600,'auto');\n $graph->SetScale(\"textlin\");\n $graph->SetMarginColor(\"lightblue\");\n $graph->SetShadow();\n $graph->img->SetMargin(40,80,30,80);\n $graph->img->SetImgFormat(\"jpeg\");\n\n // Adjust the position of the legend box\n $graph->legend->Pos(0.02,0.15, \"right\", \"center\");\n\n // Adjust the color for theshadow of the legend\n $graph->legend->SetShadow('[email protected]');\n $graph->legend->SetFillColor('[email protected]');\n\n // Get localised version of the month names\n $graph->xaxis->SetTickLabels($x_array);\n\n // Set a nice summer (in Stockholm) image\n //$graph->SetBackgroundImage('stship.jpg',BGIMG_COPY);\n\n // Set axis titles and fonts\n $graph->xaxis->title->Set(\"Months\");\n //$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);\n //$graph->xaxis->title->SetColor('white');\n $graph->title->SetFont(FF_VERDANA,FS_NORMAL,12);\n $graph->title->SetColor(\"darkred\");\n\n\n $graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,7);\n $graph->xaxis->SetColor('darkblue');\n $graph->xaxis->SetLabelAngle(70);\n\n $graph->yaxis->title->Set(\"Repayment Rate (%)\");\n $graph->yaxis->SetFont(FF_FONT1,FS_BOLD);\n $graph->yaxis->SetColor('white');\n\n //$graph->ygrid->Show(false);\n $graph->ygrid->SetColor('[email protected]');\n\n // Setup graph title\n $graph->title->Set(\"REPAYMENT RATE PLOTTED AGAINST TIME\");\n // Some extra margin (from the top)\n $graph->title->SetMargin(3);\n $graph->title->SetFont(FF_COMIC,FS_NORMAL,12);\n\n \n // Create the first line\n $p1 = new LinePlot($y_array);\n $p1->mark->SetType(MARK_FILLEDCIRCLE);\n $p1->mark->SetFillColor(\"red\");\n $p1->mark->SetWidth(4);\n $p1->SetColor(\"red\");\n $p1->SetCenter();\n $p1->SetLegend(\"Cummulated Repayment Rate (%)\");\n $graph->Add($p1);\n\n // Create the second line\n $p2 = new LinePlot($nowy_array);\n $p2->mark->SetType(MARK_FILLEDCIRCLE);\n $p2->mark->SetFillColor(\"darkblue\");\n $p2->mark->SetWidth(4);\n $p2->SetColor(\"blue\");\n $p2->SetCenter();\n $p2->SetLegend(\"Repayment Rate (%)\");\n $graph->Add($p2);\n $graph->Stroke(\"repay_ratio.jpg\");\n return $resp;\n}", "public function get_rate($date)\n\t{\n\t\treturn $this->rate = $this->db->query_row(\n\t\t\tROMANIA_EXCHANGE_RATE_SQL_LOAD, \n\t\t\tarray(date(\"Y-m-d\", strtotime($date))));\n\t}", "public function getCurrentRate()\n {\n return $this->currentRate()->orderBy('id', 'desc')->first();\n }", "function getOBDBounceRate($sDur,$StartDate,$EndDate,$con)\n{\n$chartOBDBounceRatearray=array();\n$cond=\"duration<='\".$sDur.\"' \";\n$getDashbord_OBDBounceRate=mysql_query(\"select count(1) as total,date(date_time) as OBDDate from hul_hungama.tbl_hulobd_success_fail_details nolock where date(date_time) between '\".$StartDate.\"' and '\".$EndDate.\"' and service='HUL' and status=2 and $cond group by date(date_time) desc \",$con);\n$i=1;\n$total_count=0;\nwhile($data= mysql_fetch_array($getDashbord_OBDBounceRate))\n{\n$count=$data['total'];\n$obd_date=$data['OBDDate'];\n$total_count=$total_count+$count;\n$chartOBDBounceRatearray[] = array($i,$count);\n$i++;\n}\n\n$bouncRate_percetage=percentage($i, $total_count, 2);\n$GLOBALS['btratePercentage']=$bouncRate_percetage;\n//$_SESSION['btratePercentage']=$bouncRate_percetage;\n\nreturn $chartOBDBounceRatearray;\n}", "public function getRate()\n {\n return $this->rate;\n }", "public function yearlyRecurringRevenue();", "function calculationOfLikelihood($ticker, $ticker1Change, $choosenTime, $case)\n{\n global $con;\n $tickers = $con->getAllTickerInfo();\n $countTickers = count($tickers);\n $resultValueArray = [[]];\n // initialize a helper array for the calculation\n for ($ArraySize2 = 0; $ArraySize2 < $countTickers; $ArraySize2++) {\n for ($ArraySize = 0; $ArraySize < 10; $ArraySize++) {\n $resultValueArray[$tickers[$ArraySize2][\"ticker\"]][$ArraySize] = 0;\n }\n }\n // runs over all tickers (Ticker1 and Ticker 2)\n for ($varTicker = 0; $varTicker < $countTickers; $varTicker++) {\n $tickerName1 = $ticker;\n $tickerName2 = $tickers[$varTicker][\"ticker\"];\n $ticker2Change = $con->getCurrentChangeByTickerAndDate($tickerName2, ($choosenTime + 1));\n if (count($ticker1Change) != count($ticker2Change)) {\n continue;\n }\n $arrayCount = count($ticker1Change);\n for ($day = 0; $day < $arrayCount; $day++) {\n // convoluted switch-case to get the right combination of course changes (get the correct case)\n switch (true) {\n case $ticker1Change[$day] >= 0.1:\n switch (true) {\n\n case $ticker2Change[$day] >= 0.1:\n $resultValueArray[$tickers[$varTicker][\"ticker\"]][0] += 1;\n break;\n\n case $ticker2Change[$day] < 0.1 and $ticker2Change[$day] > -0.1:\n $resultValueArray[$tickers[$varTicker][\"ticker\"]][1] += 1;\n break;\n\n case $ticker2Change[$day] <= -0.1:\n $resultValueArray[$tickers[$varTicker][\"ticker\"]][2] += 1;\n break;\n default:\n echo \"fehler: \" . $ticker1Change[$day] . \" oder \" . $ticker2Change[$day] . \"<br>\";\n break;\n }\n break;\n\n case $ticker1Change[$day] < 0.1 and $ticker1Change[$day] > -0.1:\n switch (true) {\n\n case $ticker2Change[$day] >= 0.1:\n $resultValueArray[$tickers[$varTicker][\"ticker\"]][3] += 1;\n break;\n\n case $ticker2Change[$day] < 0.1 and $ticker2Change[$day] > -0.1:\n $resultValueArray[$tickers[$varTicker][\"ticker\"]][4] += 1;\n break;\n\n case $ticker2Change[$day] <= -0.1:\n $resultValueArray[$tickers[$varTicker][\"ticker\"]][5] += 1;\n break;\n default:\n echo \"fehler: \" . $ticker1Change[$day] . \" oder \" . $ticker2Change[$day] . \"<br>\";\n break;\n }\n break;\n\n case $ticker1Change[$day] <= -0.1:\n switch (true) {\n\n case $ticker2Change[$day] >= 0.1:\n $resultValueArray[$tickers[$varTicker][\"ticker\"]][6] += 1;\n break;\n\n case $ticker2Change[$day] < 0.1 and $ticker2Change[$day] > -0.1:\n $resultValueArray[$tickers[$varTicker][\"ticker\"]][7] += 1;\n break;\n\n case $ticker2Change[$day] <= -0.1:\n $resultValueArray[$tickers[$varTicker][\"ticker\"]][8] += 1;\n break;\n\n default:\n echo \"fehler: \" . $ticker1Change[$day] . \" oder \" . $ticker2Change[$day] . \"<br>\";\n break;\n }\n break;\n default:\n echo \"fehler: \" . $ticker1Change[$day] . \" oder \" . $ticker2Change[$day] . \"<br>\";\n break;\n }\n\n }\n $resultValueArray[$tickers[$varTicker][\"ticker\"]][9] = $arrayCount;\n }\n global $result;\n // get highest and lowest values of the result array\n $result[0] = highest($resultValueArray, $tickers, ($case));\n $result[1] = lowest($resultValueArray, $tickers, ($case + 2));\n}", "public function changesDaily( )\n {\n return $this->setChangeFreq( self::CHANGE_FREQ_DAILY );\n }", "public function getRates();", "public function getRates();", "public function getTransactionDataLast2Years(){\n $to = $this->date->date('Y-m-d');\n $from = strtotime($to.\"-2year\");\n $from = $this->date->date('Y-m-d',$from);\n $to .= ' 23:59:59';\n $transactionResource = $this->transactionFactory->create()->getResource();\n $result = [];\n \n $data = $transactionResource->getReceivedCreditTransactionsByMonth($from,$to);\n $result = $this->_processReceivedData($data,$result);\n \n $data = $transactionResource->getSpentCreditTransactionsByMonth($from,$to);\n $result = $this->_processSpentData($data,$result);\n \n $result = array_values($result);\n return $result;\n }", "public function getChangeFrequency()\n {\n return null;\n }", "function calculateDaysLeft($feed_quantity, $number, $rate)\n {\n $result = $feed_quantity / ($number * $rate);\n return $result;\n }", "public function getChangeFreq()\n {\n return $this->changeFreq;\n }", "public function getScheduleOfChangePrice($approach){\n $prices = $this->getPrices()->asArray(true)->all();\n\n if(!$prices){\n //if goods doesn't have prices yet return default price\n return [['date' => date('d.m.Y', $this->created_at),'price' => $this->default_price]];\n }\n\n for($i=0,$j=0; $i < count($prices); $i++,$j++){\n $dates[$j] = $prices[$i]['start_date'];\n if($prices[$i]['end_date'] > 0){\n $j++;\n //get next day after end period\n $dates[$j] = $prices[$i]['end_date'] + 60*60*24;\n }\n }\n\n //get unique dates array and sort it\n $dates = array_unique($dates);\n sort($dates);\n\n //get schedule\n $scheduleOfChangePrices = [];\n for($i=0,$j=0; $i < count($dates); $i++){\n $dates[$i] = date('d.m.Y', $dates[$i]);\n $price = $this->getPriceByDate($dates[$i], $approach);\n $price = $price ? $price : $this->default_price;\n if($i == 0 || $i > 0 && $price != $scheduleOfChangePrices[$j-1]['price']){\n $scheduleOfChangePrices[$j]['date'] = $dates[$i];\n $scheduleOfChangePrices[$j]['price'] = $price;\n $j++;\n }\n }\n\n return $scheduleOfChangePrices;\n }", "function firstRate()\n {\n return date('Ymd').'0';\n }", "public function getConversionRate() \n {\n\t\t\ttry{\n\t\t\t\t$guj_request = $this->guzzle_client->get($this->url);\t\n\t\t\t}\n\t\t\tcatch(Exception $e) {\n\t\t\t\treturn ['status' => false, 'msg' => \"Something went wrong try again. If error persist contact admin.\"];\n\t\t\t}\n\t\t\tif($guj_request->getStatusCode() == 200){\n\t\t\t\t$res = $guj_request->getBody();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t // Get the actual response without headers\n\t\t\t\t$res_json = json_decode($res, true);\n\t\t\t\tif($res_json['success']){\n\t\t\t\t\treturn ['status' => true, 'res' => $res];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\treturn ['status' => false, 'msg' => \"Error in getting latest currency conversion rate. Contact admin.\"];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn ['status' => false, 'msg' => \"Something went wrong try again. If error persist contact admin.\", 'status_code' => $guj_request->getStatusCode()];\n\t\t\t}\n }", "function calculateYearlyDonation($original_currency, $frequency, $amount) { \n $amount = floatval($amount);\n $multipler = $frequency == \"monthly\" ? 12 : 1;\n\n if ($original_currency != \"usd\") {\n $rate = calculateRate($original_currency);\n $converted = $amount / $rate;\n\n $result['dollars'] = number_format($multipler * $converted, 2);\n $result[$original_currency] = number_format($multipler * $amount, 2); \n } else {\n $result['dollars'] = $multipler * $amount;\n }\n\n return $result;\n}", "public function getMaxRate()\n {\n return 0;\n }" ]
[ "0.5696219", "0.55894697", "0.5502829", "0.5452995", "0.5387172", "0.53643733", "0.53143287", "0.5308405", "0.5284989", "0.527999", "0.5278731", "0.5277968", "0.5274387", "0.5272911", "0.5262674", "0.5248291", "0.5237188", "0.5228836", "0.52034867", "0.5167621", "0.5167621", "0.5129021", "0.51057935", "0.5100868", "0.5098673", "0.5075001", "0.5072025", "0.50671595", "0.50665486", "0.5044912" ]
0.67982453
0
Build all stages of aggregate query function Generates a query stage array based on which functions were used. Should not be called directly.
private function _build_stages() { $select = array(); if($this->qb_distinct === true) { foreach($this->qb_select as $select_key=> $select_val) { if($select_val) { $this->group_by($select_key); } } } // Filter Where conditions if(!empty($this->qb_where)) { array_push($select, array('$match'=>$this->qb_where)); } if(!empty($this->qb_groupby)) { array_push($select, $this->qb_groupby); }else { // build offset condition if(!empty($this->qb_offset)) { array_push($select, array('$skip' => $this->qb_offset)); } // build order by condition if(!empty($this->qb_orderby)) { array_push($select, array('$sort' => $this->qb_orderby)); } // build select required if(!empty($this->qb_select)) { array_push($select, array('$project' => $this->qb_select)); } // build limit condition if(!empty($this->qb_limit)) { array_push($select, array('$limit' => $this->qb_limit)); } } // Having group if(!empty($this->qb_having)) { array_push($select, array('$match'=>$this->qb_having)); } return $select; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function buildStructuredQuery()\n {\n $structuredQuery = [];\n\n // cursor\n if ($this->cursor) {\n $structuredQuery['cursor'] = $this->cursor;\n }\n\n // expressions\n if ($this->expressions) {\n $structuredQuery['expr'] = json_encode($this->expressions);\n }\n\n // facets\n if ($this->facets) {\n $structuredQuery['facet'] = json_encode($this->facets);\n }\n\n // filter query\n if ($this->fq->query) {\n $structuredQuery['filterQuery'] = (string)$this->fq;\n }\n\n // query\n if ($this->q->query) {\n $structuredQuery['query'] = (string)$this->q;\n }\n\n // options\n if ($this->options) {\n $structuredQuery['queryOptions'] = json_encode($this->options);\n }\n\n // highlights\n // partial\n // parser\n $structuredQuery['queryParser'] = 'structured';\n\n // return\n if ($this->returnFields) {\n $structuredQuery['return'] = $this->returnFields;\n }\n\n // size\n $structuredQuery['size'] = $this->size;\n\n // sort\n if ($this->sort) {\n $structuredQuery['sort'] = $this->sort;\n }\n\n if (!$this->cursor) {\n $structuredQuery['start'] = $this->start;\n }\n\n // stats\n if ($this->stats) {\n\n // Parse fields\n $stats = array_map(function($field) {\n return \"\\\"{$field}\\\":{}\";\n }, $this->stats);\n\n $structuredQuery['stats'] = \"{\" . implode(',', $stats) . \"}\";\n }\n\n return $structuredQuery;\n }", "public function aggregateQuery()\n {\n $qb = clone $this->queryBuilder;\n print_r($qb->getQuery()->getDql());\n $qb->resetDQLPart('select');\n $qb->resetDQLPart('orderBy');\n foreach ($this->getGrid()->getColumns() as $key => $column) {\n if (!$column->getOption('hidden')) {\n if ($column->getOption('aggregate')) {\n if (strpos($column->getOption('aggregate'), '#') !== false) {\n $qb->addSelect('\\'' . substr($column->getOption('aggregate'), 1) . '\\'');\n } else {\n $qb->addSelect($column->getOption('aggregate'));\n }\n } else {\n $qb->addSelect('\\'\\'');\n }\n }\n }\n // print_r($qb->getQuery()->getDql());\n // die;\n\n return $qb;\n }", "private function buildQuery(): array\n {\n // init var\n $parameters = [$this->id];\n\n /*\n * Start query, as you can see this query is build in the wrong place, because of the filter\n * it is a special case wherein we allow the query to be in the actionfile itself\n */\n $query =\n 'SELECT i.*, UNIX_TIMESTAMP(i.sent_on) AS sent_on, d.*\n FROM forms_data AS i\n INNER JOIN forms_data_fields AS d ON i.id = d.data_id\n WHERE i.form_id = ?';\n\n // add start date\n if ($this->filter['start_date'] !== '') {\n // explode date parts\n $chunks = explode('/', $this->filter['start_date']);\n\n // add condition\n $query .= ' AND i.sent_on >= ?';\n $parameters[] = BackendModel::getUTCDate(null, gmmktime(23, 59, 59, $chunks[1], $chunks[0], $chunks[2]));\n }\n\n // add end date\n if ($this->filter['end_date'] !== '') {\n // explode date parts\n $chunks = explode('/', $this->filter['end_date']);\n\n // add condition\n $query .= ' AND i.sent_on <= ?';\n $parameters[] = BackendModel::getUTCDate(null, gmmktime(23, 59, 59, $chunks[1], $chunks[0], $chunks[2]));\n }\n\n return [$query, $parameters];\n }", "public function build_query();", "public function build() {\n\t\t$this->validate_input();\n\n\t\t// this only performs a shallow copy\n\t\t$constructor = clone $this;\n\n\t\tif (!$this->ignore_filtering) {\n\t\t\t$where_clauses = FilterTreeTransform::make_where_clauses($this->state,\n\t\t\t\t$this->settings, $this->table, $this->alias_lookup);\n\t\t\tforeach ($where_clauses as $where_clause) {\n\t\t\t\t$constructor->add_where_item($where_clause);\n\t\t\t}\n\t\t}\n\t\t$order_clause = SortTreeTransform::make_order_clause($this->state, $this->settings, $this->table);\n\t\tif ($order_clause) {\n\t\t\t$constructor->order_clause($order_clause);\n\t\t}\n\t\tif (!$this->ignore_pagination) {\n\t\t\t$limit_clause = LimitPaginationTreeTransform::make_limit_offset_clause($this->state, $this->settings, $this->table);\n\t\t\tif ($limit_clause) {\n\t\t\t\t$constructor->limit_offset_clause($limit_clause);\n\t\t\t}\n\t\t}\n\t\treturn $constructor->make_sql();\n\t}", "protected function buildQuery()\n {\n $aFactory = array(\n $this->getQueryType(),\n $this->prefixTable(),\n $this->getFrom(),\n $this->buildParameters(),\n $this->buildUpdateOnDuplicate()\n );\n return array_diff($aFactory, array(null));\n }", "function _buildQuery()\n\t{\n\t\treturn $this->_dataset->getQuery();\n\t}", "function aggregate(){\n\n\t\t}", "protected function _build_record_objects()\n {\n $result = array();\n if ($this->_query_type == CULTURE24_API_EVENTS) {\n $result = $this->_build_event_objects();\n $this->_store_event_validation_errors();\n } elseif ($this->_query_type == CULTURE24_API_VENUES) {\n $result = $this->_build_venue_objects();\n }\n return $result;\n }", "public function _aggregate(){\n }", "public function generateQueryArray()\n {\n return [\n 'query' => [\n 'dis_max' => [\n 'queries' => [\n [\n 'match' => ['name.exact_match' => $this->getOriginalSearchTerm()],\n ],\n [\n 'match' => ['name_filtered.exact_match' => $this->getSearchTerm()],\n ],\n ],\n ],\n ],\n 'sort' => $this->prepareSortOrder(),\n ];\n }", "public function createQuery() {\n $queryArr = array();\n\n $this->addSelect($queryArr);\n $this->addFrom($queryArr);\n $this->addWhere($queryArr);\n $this->addGroupBy($queryArr);\n $this->addSortBy($queryArr);\n $this->addHaving($queryArr);\n\n $this->query = implode(' ', $queryArr) . ';';\n }", "abstract protected function getAggregates(ContainerInterface $container, QueryBuilder $queryBuilder, Request $request);", "private function buildSelect(): void {\r\n\r\n $this -> query[] = 'SELECT';\r\n $this -> buildDistinct();\r\n\r\n if(0 === count($this -> select)) {\r\n $this -> query[] = '*';\r\n }\r\n else {\r\n\r\n foreach($this -> select as &$select) {\r\n\r\n if($select instanceof self) {\r\n\r\n $sql = $select -> build();\r\n $this -> bind($sql -> getParameters());\r\n $select = $sql -> getQuery();\r\n }\r\n }\r\n\r\n $this -> query[] = implode(', ', $this -> select);\r\n }\r\n }", "private function setupQueryFields($all_fields, $selected_fields)\n {\n global $joins, $raw_fields, $group_by, $subq_fields, $subq_where, $global_db, $conso_db, $raw_where, $format;\n $year_mons = self::createYMarray();\n $total_fields = \"\";\n $subq_case = \"\";\n\n // Loop through all the fields\n foreach ($selected_fields as $key => $field) {\n if ($field['active']) {\n $data = $all_fields->where('qry_as', '=', $key)->first();\n if (!$data) {\n continue;\n }\n\n // set join if needed\n if (!is_null($data->joins)) {\n if (preg_match('/_conso_/', $data->joins)) {\n $_join = preg_replace('/_conso_/', $conso_db, $data->joins);\n }\n if (preg_match('/_global_/', $data->joins)) {\n $_join = preg_replace('/_global_/', $global_db, $data->joins);\n }\n $joins[$key] = $_join;\n }\n\n // Output format drives how query fields and clauses are built\n // For \"COUNTER\", metrics and joins are embedded in a subquery\n if ($format == 'COUNTER') {\n if ($data->is_metric) {\n $subq_case .= $data->qry_counter . ' ';\n } else {\n $raw_fields .= $data->qry_as . ',';\n if ($data->qry != $data->qry_as) {\n $subq_fields .= $data->qry . ' as ' . $data->qry_as . ',';\n } else {\n $subq_fields .= $data->qry_as . ',';\n }\n }\n // Group the field if reportField says to\n if ($data->group_it) {\n $group_by[] = $data->qry_as;\n }\n } else {\n if ($data->is_metric) {\n // For \"Compact\", Metric fields that sum-by-yearmon become output columns.\n // Assign metric-by-year as query fields\n foreach ($year_mons as $ym) {\n $raw_fields .= preg_replace('/@YM@/', $ym, $data->qry) . ' as ';\n $raw_fields .= $data->qry_as . '_' . self::prettydate($ym) . ',';\n }\n // (if we're spanning multiple months,extend the reporting-period-total string)\n if (sizeof($year_mons) > 1) {\n $total_fields .= \"sum(\" . $data->qry_as . \") as RP_\" . $data->qry_as . ',';\n }\n // Build raw_where string (for ignoring zero-records)\n // Metric fields that sum-by-yearmon become output columns. Assign metric-by-yr as query fields\n $raw_where .= ($raw_where != \"\") ? \" or \" : \"(\";\n $raw_where .= $data->qry_as . \">0\";\n } else {\n if ($data->qry != $data->qry_as) {\n $raw_fields .= $data->qry . ' as ' . $data->qry_as . ',';\n } else {\n $raw_fields .= $data->qry_as . ',';\n }\n\n // update filter based on column setting\n if (isset($field['limit'])) {\n $input_filters[$key] = $field['limit'];\n }\n }\n // Group the field if reportField says to\n if ($data->group_it) {\n $group_by[] = $data->qry;\n }\n }\n }\n }\n\n if ($format == 'COUNTER') {\n $raw_fields .= \"Metric_Type, sum(data) as Reporting_Period_Total\";\n $subq_fields .= \"yearmon, RF.qry_as as Metric_Type, sum(CASE\" . $subq_case . \" ELSE 0 END) as data\";\n\n // For \"COUNTER\", Metric names become column-values and sums are displayed by yearmon.\n foreach ($year_mons as $ym) {\n $raw_fields .= \",sum(case yearmon when '\" . $ym . \"' then data else 0 end) as '\" . $ym . \"'\";\n }\n $group_by[] = \"Metric_Type\";\n } else {\n $raw_where .= ($raw_where == \"\") ? \"\" : \")\";\n $raw_fields = $raw_fields . $total_fields;\n $raw_fields = rtrim($raw_fields, ',');\n }\n return;\n }", "abstract public function resolveExtendedAggregates(): array;", "public function query()\n {\n // Array of strings by table type and year\n $strings = $this->range->totalStrings();\n $array = [];\n // Loop through all years in the range and all tables\n foreach ($this->range->years() as $year) {\n foreach ($this->range->tables() as $type => $metrics) {\n\n // If there is no string for this table type, skip\n if (! isset($strings[$type][$year]) || $strings[$type] == []) {\n continue;\n }\n $rangeString = $strings[$type][$year];\n\n // Bypass empty string\n if ($rangeString == 'SUM() AS total') {\n continue;\n }\n $table = $this->setTable($type, $year);\n $queryString = $this->buildQueryString($table, $rangeString);\n\n $this->setQueryString($queryString, $metrics);\n\n $this->setPrograms($table)\n ->setChannels($table)\n ->setGroups($table)\n ->getResults();\n $array[$year][$type] = $this->query;\n }\n }\n return $array;\n }", "abstract public function stages (): array;", "public function aggregatedFields(): array;", "function build_map_aggregated_query($userloc = null, $bottomleft_coor=null,$topright_coor=null,$zoom = 15, $workingDays = -1, $peakHours = -1, $contract = -1, $tool = \"ndt\")\r\n{\r\n\tglobal $geographical_divisions, $geographical_division_zoom_levels, $geographical_division_map_shape;\r\n\tglobal $min_connections_per_postal_code, $min_connections_per_municipality, $min_connections_per_prefecture, $min_connections_per_periphery, $min_connections_per_country, $sliding_window_in_days;\r\n\tglobal $lang_lang_short,$mlablang,$lang_postal_code_short, $lang_postal_code_prefix, $lang_periphery_prefix, $lang_prefecture_prefix, $bandwidths;\r\n\t\r\n\t$region_level = -1;\r\n\tif($zoom == 100)\r\n\t\t$region_level = 1;\r\n\telse\r\n\t{\r\n\t\tforeach ($geographical_division_zoom_levels as $lev => $z)\r\n\t\t{\r\n\t\t\tif($zoom < $z)\r\n\t\t\t{ \r\n\t\t\t\t$region_level = ($lev == 0)? 0: ($lev-1);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif($region_level<0)\r\n\t\t$region_level = 0;\r\n\t$area_mode = $geographical_division_map_shape[$region_level];\r\n\t/*\r\n\tif ($zoom < 8) //peripheries view (polygons)\r\n\t\t$granularity = 3;\r\n\telseif ($zoom < 11) //prefectures view (polygons)\r\n\t\t$granularity = 2;\r\n\telseif ($zoom < 13) //municiplaities view (icons)\r\n\t\t$granularity = 1;\r\n\telseif ($zoom < 15) //postal codes view (polygons)\r\n\t\t$granularity = 0;\r\n\telseif($zoom == 100)\r\n\t{\r\n\t\t$granularity = 2;\r\n\t}\t\r\n\telse\r\n\t\treturn null;*/\r\n\t\t\r\n\t$areatypes = array(\"periphery\",\"prefecture\",\"municipality\",\"postal_code\");\r\n\t\r\n\t\r\n\t/**************************************** Build region range clause **********************************************/\r\n\t/* Either restrict view in a specified window, or show a window of selected zoom around user location */\r\n\t/*****************************************************************************************************************/\r\n\tif (!is_array($bottomleft_coor) && !is_array($topright_coor))\r\n\t{\r\n\t\tif (is_array($userloc)) //no boundaries set -> show everything around user\r\n\t\t{\r\n\t\t\t$lat_diff = 0.0065798;\r\n\t\t\t$lng_diff = 0.0119737;\r\n\t\t\t$min_lat = $userloc['latitude'] - $lat_diff;\r\n\t\t\t$min_lng = $userloc['longitude'] - $lng_diff;\r\n\t\t\t$max_lat = $userloc['latitude'] + $lat_diff;\r\n\t\t\t$max_lng = $userloc['longitude'] + $lng_diff;\r\n\t\t}\r\n\t}\r\n\telse //map dragged/zoomed/panned show everything in selected area\r\n\t{\r\n\t\t$min_lat = $bottomleft_coor['lat'];\r\n\t\t$min_lng = $bottomleft_coor['lng'];\r\n\t\t$max_lat = $topright_coor['lat'];\r\n\t\t$max_lng = $topright_coor['lng'];\r\n\t}\r\n\t\r\n\t$viewportpolygon = \"GeomFromText('Polygon(($min_lng $min_lat,$min_lng $max_lat,$max_lng $max_lat,$max_lng $min_lat,$min_lng $min_lat))')\";\r\n\t\r\n\t$region_range_where_clause =\"\";\r\n\t$region_range_join_clause =\"\";\r\n\t//$i=$granularity;\r\n\t$areatype = $areatypes[$region_level];\r\n\tif($region_level >= $geographical_divisions)\r\n\t\t$areatable = \"postal_codes\";\r\n\telse\r\n\t\t$areatable = \"region_level_\".$region_level;\r\n\t$areaagregationtable = \"aggregation_per_\".$areatype;\r\n\t$areaagregationtable .= ($tool == \"ndt\")? \"\":\"_glasnost\";\r\n\t$min_connections_per_area_variable = ($tool == \"ndt\")? \"min_connections_per_$areatype\":\"min_connections_per_$areatype\".\"_glasnost\";\r\n\tglobal $$min_connections_per_area_variable;\r\n\t$min_connections = $$min_connections_per_area_variable;\r\n\t$prefix = isset(${\"lang_\".$areatype.\"_prefix\"})? ${\"lang_\".$areatype.\"_prefix\"}:\"\";\r\n\t$areanamecol = \"CONCAT('\".$prefix.\"',name_lang$mlablang)\";\r\n\t$idcol = \"id\";\r\n\tif ($region_level == 3)\r\n\t\t$idcol = \"code\";\r\n\t\r\n\t$contract_filter = (isset($bandwidths[$contract]))? \" AND contract = '\".$bandwidths[$contract]['d'].\" \".$bandwidths[$contract]['u'].\"' \":\" AND contract = 'all'\";\r\n\t$filter = \" workingDay = $workingDays AND peakHour = $peakHours\".$contract_filter;\r\n\t\r\n\tif (isset($min_lat) && $area_mode==\"point\") // detailed view with boundaries or user location with showing circles around a center and not polygons\r\n\t\t$region_range_where_clause =\"WHERE a.latitude > $min_lat AND a.latitude < $max_lat AND a.longitude > $min_lng AND a.longitude < $max_lng \";\r\n\r\n\t//if in prefectures or peripheries zoom level then check possibly multiple polygons (namely prefecture polygons) for intersecting with viewport\r\n\tif ($region_level < 2)\r\n\t{\t\t\r\n\t\t$prefecturetype = 1; // i.e. areatype = prefecture: table field for checking overlaps with viewport\r\n\t\t$wc = \"WHERE \".$areatype.\"_id IS NOT NULL\";\r\n\t\t//Show all peripheries no matter what region viewport defines\r\n\t\tif (isset($min_lat) && $region_level == 1)\r\n\t\t\t//old one, replaced by spatial query: $wc .= \" AND latitude > $min_lat AND latitude < $max_lat AND longitude > $min_lng AND longitude < $max_lng \";\r\n\t\t\t$wc .= \" AND Intersects($viewportpolygon, SHAPE) \";\r\n\t\t\r\n\t\t$region_range_join_clause = \" JOIN \r\n\t\t\t\t\t(SELECT distinct \".$areatype.\"_id AS id \r\n\t\t\t\t\tFROM detailed_{$areatypes[$prefecturetype]}_polygons \r\n\t\t\t\t\t$wc) d ON a.id=d.id \";\r\n\t\t\r\n\t\t$area_query['pols'] = \"SELECT \".$areatype.\"_id id, enc_pol_points as points, enc_pol_levels as levels\r\n\t\t\t\t\t\tFROM detailed_{$areatypes[$prefecturetype]}_polygons d\r\n\t\t\t\t\t\t$wc\r\n\t\t\t\t\t\tORDER BY \".$areatype.\"_id, polid, aa\"; \r\n\t\t//$area_query['pols'] = \"SELECT id, enc_pol_points as points, enc_pol_levels as levels\r\n\t\t\t//\t\t\tFROM local_exchange_polygons WHERE Intersects($viewportpolygon, SHAPE)\"; \r\n\t}\r\n\t\r\n\tif ($_SESSION['profile'] > 1)//privileged user level 1 ---> show her isps\r\n\t\t$order_by_clause = \"a.$idcol, isp_id\";\r\n\telse\r\n\t\t$order_by_clause = \"a.$idcol\";\r\n\t\t\r\n\tif($tool == \"ndt\")\r\n\t\t$metric_fields = \" avgup, avgdown, round(avgloss,3)*100 avgloss, avgrtt, avgjitter\";\r\n\telse\r\n\t\t$metric_fields = \" bittorent_throttled_connections, bittorent_measurements, connections_with_bittorent_measurements,\r\n\t\temule_throttled_connections, emule_measurements, connections_with_emule_measurements, gnutella_throttled_connections, gnutella_measurements,\r\n\t\tconnections_with_gnutella_measurements, http_throttled_connections, http_measurements, connections_with_http_measurements, ssh_throttled_connections,\r\n\t\tssh_measurements, connections_with_ssh_measurements, pop_throttled_connections, pop_measurements, connections_with_pop_measurements, imap_throttled_connections,\r\n\t\timap_measurements, connections_with_imap_measurements, flash_throttled_connections, flash_measurements, connections_with_flash_measurements\";\r\n\t\t\r\n\t$area_query[] = \"SELECT STRAIGHT_JOIN a.$idcol as $areatype, $areanamecol as areaname, latitude, longitude, $region_level category, isp_id, \r\n\t\t\t\t\t\t$metric_fields,\r\n\t\t\t\t\t\tmeasurements_sum measurements, connections_count connections\r\n\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t$areatable a $region_range_join_clause\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tLEFT JOIN \r\n\t\t\t\t\t\t(SELECT * FROM $areaagregationtable WHERE $filter) aggms \r\n\t\t\t\t\t\tON a.$idcol=aggms.$areatype \r\n\t\t\t\t\t\t$region_range_where_clause\r\n\t\t\t\t\t\t ORDER BY $order_by_clause\";\r\n\r\n\treturn $area_query;\r\n}", "public function build()\n {\n $columns = array_keys($this->params);\n $bind = array_values($this->params);\n\n $sets = array();\n foreach($columns as $column){\n $sets[] = \"{$column} = ?\";\n }\n $sets = join(\", \", $sets);\n\n $query = \"UPDATE {$this->table} SET {$sets}\";\n\n list($whereQuery, $whereBind) = $this->where->build();\n return array(\n $query . $whereQuery,\n array_merge($bind, $whereBind)\n );\n }", "public function generateQuery();", "public function buildSelect() {\n\t\t$this->qry->select('*');\n\t\t// -TODO- only selected fields\n\t\t$this->qry->from($this->obj->table);\n\t\t// -TODO- JOIN for objects, and GROUP BY if necessary\n\t}", "protected function _buildQuery() {\n\n //loop through our array segments and create strings\n $keys = array('where', 'join'); \n foreach($keys as $key) {\n $db_keys = $this->{$key};\n //do where\n if (! empty($db_keys) and count($db_keys) > 0) { \n $db_keys = implode(' ', $db_keys); \n } else {\n //cant unset or we get errors, so just set to ''\n $db_keys = '';\n } \n\n $this->{$key} = $db_keys; \n }\n\n //are we doing a delete or a select statement\n $select_prefix = ($this->is_delete) ? 'DELETE' : 'SELECT';\n //do we only want distinct results\n $distinct = ($this->is_distinct) ? ' DISTINCT' : '';\n // Format strings into a select query\n $this->query = sprintf(\"%s %s %s FROM %s%s%s%s%s%s%s\",\n $select_prefix,\n $distinct,\n $this->select,\n $this->table,\n $this->join,\n $this->where,\n $this->group_by,\n $this->order,\n $this->limit, \n $this->offset\n );\n\n return stripslashes(mysql_real_escape_string($this->query)); \n }", "public function buildQuery(){\r\n\t\tif(count($this->orderByArray) > 0){\r\n\t\t\t$string = array();\r\n\t\t\t\r\n\t\t\tforeach($this->orderByArray as $condition){\r\n\t\t\t\t$string[] = ($condition['COLUMN']+1).' '.($condition['ASC']?'ASC':'DESC');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->string_orderby = 'ORDER BY '.implode(',', $string);\r\n\t\t}else{\r\n\t\t\t$this->string_orderby = '';\r\n\t\t}\r\n\t\t\r\n\t\t//construct the new query\r\n\t\t$searchString = array();\r\n\t\tforeach($this->searchKeywords as $keyword){\r\n\t\t\t$string = array();\r\n\t\t\tforeach($this->searchColumns as $search){\r\n\t\t\t\t$string[] = $search.=\" LIKE '\".$keyword.\"%'\";\r\n\t\t\t}\r\n\t\t\t$searchString[] = '('.implode(' OR ', $string).')';\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//found a 'having' need to inject our code rather than append\r\n\t\t$pos = strpos($this->query, 'HAVING');\r\n\t\tif($pos !== false){\r\n\t\t\t$pos+=6;\r\n\t\t\tif(count($searchString) > 0){\r\n\t\t\t\t$newQuery = substr($this->query, 0, $pos).' '.implode(' AND ', $searchString).' AND '.substr($this->query, $pos);\r\n\t\t\t}else{\r\n\t\t\t\t$newQuery = $this->query;\r\n\t\t\t}\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//otherwise standard query so no need to inject\r\n\t\telse{\r\n\t\t\t//only add this conditon if we ARE searching\r\n\t\t\tif(count($searchString) > 0){\r\n\t\t\t\t$this->string_search = 'HAVING '.implode(' AND ', $searchString);\t\r\n\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t$newQuery = $this->query.' '.$this->string_search;\r\n\t\t}\r\n\t\t\r\n\t\t//query for calculating the total rows counted\r\n\t\t$this->string_totalRowsQuery = \"SELECT COUNT(1) AS 'total' FROM (\".$newQuery.\") as t\";\r\n\t\t\r\n\t\t//get the limits\r\n\t\t$this->calculateLimit();\r\n\t\t\r\n\t\t//create the final query\r\n\t\t$this->string_query = $newQuery.' '.$this->string_orderby.' '.$this->string_limit;\r\n\t}", "public function getGroupQueries() {}", "private function build_sql_query() {\n\t\t$root_condition = $this->build_root_condition();\n\t\t$this->maybe_add_restrictions( $root_condition );\n\n\t\tif( null === $this->orderby ) {\n\t\t\t$this->dont_order();\n\t\t}\n\n\t\t$this->orderby->set_order( $this->order );\n\n\t\tif( null === $this->limit ) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\t'The query limit has not been set. This is necessary to ensure the scalability.'\n\t\t\t);\n\t\t}\n\n\t\treturn $this->expression_builder->build(\n\t\t\t$root_condition,\n\t\t\t$this->offset,\n\t\t\t$this->limit,\n\t\t\t$this->orderby,\n\t\t\t$this->element_selector_provider->get_selector(),\n\t\t\t$this->need_found_rows,\n\t\t\t$this->result_transformation\n\t\t);\n\t}", "private function setQueries()\n {\n /** @var Collection<int,GoogleBookQuery> */\n $queries = collect([]);\n\n foreach ($this->original as $item) {\n $isbnItems = [];\n\n foreach ($this->isbnFields as $field) {\n if ($item->{$field}) {\n $isbnItems[] = $item->{$field};\n\n $query = GoogleBookQuery::make(\n isbnItems: $isbnItems,\n identifier: $item->{$this->identifier},\n );\n $queries->add($query);\n }\n }\n }\n\n return $queries;\n }", "abstract protected function getQueries();", "protected function _build_select() {\n\n if (!$this->cnt_query) {\n return parent::_build_select();\n }\n\n // If the query is raw we need to remove the LIMIT and OFFSET and\n // replace the param values before proceeding.\n if ($this->_is_raw_query) {\n $this->_values = $this->_raw_parameters;\n $query = $this->_raw_query;\n\n $new_vals = array();\n\n if (is_array($this->_values)) {\n foreach ($this->_values as $k => $v) {\n\n // @todo find a better way to do this for raw_queries\n if ($k == 'limit') {\n $query = str_ireplace('LIMIT :limit', '', $query);\n continue;\n }\n\n if ($k == 'offset') {\n $query = str_ireplace('OFFSET :offset', '', $query);\n continue;\n }\n\n if (!is_numeric($v)) {\n $v = '\"' . $v . '\"'; \n }\n\n $query = str_replace(':' . $k, $v, $query);\n } \n }\n\n $query = \"SELECT COUNT(*) as _dt_record_cnt FROM (\" . $query . \") dt_bridge_cnt\";\n\n return $query;\n }\n\n // Build and return the full SELECT statement by concatenating\n // the results of calling each separate builder method.\n $query = $this->_join_if_not_empty(\" \", array(\n $this->_build_select_start(),\n $this->_build_join(),\n $this->_build_where(),\n $this->_build_group_by(),\n $this->_build_having(),\n $this->_build_order_by(),\n $this->_build_limit(),\n $this->_build_offset(),\n ));\n\n $query = \"SELECT COUNT(*) as _dt_record_cnt FROM (\" . $query . \") dt_bridge_cnt\";\n return $query;\n }" ]
[ "0.5967459", "0.58329016", "0.5784251", "0.57041204", "0.56263554", "0.55240333", "0.54737324", "0.5456892", "0.54188627", "0.5403925", "0.5328204", "0.5319553", "0.5299444", "0.5232148", "0.52267504", "0.52250284", "0.5217537", "0.5211312", "0.5140554", "0.5123169", "0.5116624", "0.5095794", "0.5088787", "0.50872153", "0.5084832", "0.5068017", "0.50454485", "0.50435513", "0.5029304", "0.4998844" ]
0.77353245
0
OR LIKE Generates a %LIKE% portion of the query. Separates multiple calls with 'OR'.
public function or_like($field, $match = '', $side = 'both', $escape = NULL, $mongoSyntax = FALSE) { return $this->_like($field, $match, 'OR ', $side, '', $escape, $mongoSyntax); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function orLike($field, $match = '', $side = 'both')\n {\n return $this->_like($field, $match, 'OR ', $side);\n }", "public function or_like($field, $match = '', $side = 'both')\n\t{\n\t\treturn $this->_like($field, $match, 'OR ', $side);\n\t}", "function or_like($col, $match = '', $side = 'both', $not = false)\n\t{\n\t\treturn $this->like($col, $match, $side, true, $not);\n\t}", "public function orWhere()\n {\n $args = array_merge(array('OR'), func_get_args());\n return call_user_func_array(array($this, '_where'), $args);\n }", "function boolean_sql_where_short($string,$match){\n\t$match_a = explode(',',$match);\n\tfor($ith=0;$ith<count($match_a);$ith++){\n\t\t$like_a[$ith] = \" $match_a[$ith] LIKE '%$string%' \";\n\t}\n\t$like = implode(\" OR \",$like_a);\n\n\treturn $like;\n}", "protected function _applySearchToQuery() {\n\t\tif (!isset($this->_searchString) || empty($this->_searchString)) return;\n\t\t\n\t\t// join on any necessary relations.\n\t\t// make sure fields are searched.\n\t\t$search_like = array();\n\t\tforeach ($this->_searchFields as $alias => $fields) {\n\t\t\tforeach ($fields as $field) {\n\t\t\t\t$search_like[] = $alias . '.' . $field . ' LIKE \"%' . $this->_searchString . '%\"';\n\t\t\t}\n\t\t}\n\t\t$where = '(' . implode(' OR ', $search_like) . ')';\n\t\t$this->query()->addWhere($where);\n\t}", "function or_like ( $arrValue, $table = false, $join = false ) { \n\n if ( empty( $arrValue ) ) $this->InvalidArgExceptionThrow( 1 );\n\n if ( $join ) $this->joinTable( $join );\n\n foreach( $arrValue as $key => $value ) { \n $this->db->or_like( $key, $value );\n }\n\n if ( !$table )\n $query = $this->db->get( $this->table ); \n else\n $query = $this->db->get( $table );\n \n return $query->result_array();\n }", "private function and_or( $or ) {\n\t\treturn $or ? 'OR' : 'AND';\n\t}", "function concatArgs($variable, $args){\n $output = \"\";\n foreach ($args as $key=>$value){\n $output = $output.\" \".$variable.\" LIKE '%\".$value.\"%'\";\n\n if ($key < count($args)-1){\n $output = $output.\" OR \";\n }\n }\n return $output;\n}", "function &like($col, $match = '', $side = 'both', $or = false, $not = false)\n\t{\n\t\t$this->q_cached = false;\n\t\t\n\t\tif( ! is_array($col) && $match == '')\n\t\t{\n\t\t\tif($not)\n\t\t\t\t$this->q_where[] = 'NOT';\n\t\t\t\n\t\t\t$obj = new IgnitedQuery($this);\n\t\t\t$obj->q_as = false;\n\t\t\t\n\t\t\t$this->q_where[$this->_protect_identifiers($k).' LIKE'] = $obj;\n\t\t\treturn $obj;\n\t\t}\n\t\t\n\t\tif( ! is_array($col))\n\t\t\t$col = array($col => $match);\n\t\t\n\t\tforeach($col as $k => $v)\n\t\t{\n\t\t\tif($or && ! empty($this->q_where))\n\t\t\t\t$this->q_where[] = 'OR';\n\t\t\t\n\t\t\tif($not)\n\t\t\t\t$this->q_where[] = 'NOT';\n\t\t\t\n\t\t\t$key = $this->_protect_identifiers($k).' LIKE';\n\t\t\t\n\t\t\tif(is_object($v))\n\t\t\t{\n\t\t\t\t$this->q_where[$key] = $v;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$v = $this->escape_str($v);\n\t\t\t\t\n\t\t\t\tif($side == 'before')\n\t\t\t\t\t$this->q_where[$key] = \"'%$v'\";\n\t\t\t\telseif($side == 'after')\n\t\t\t\t\t$this->q_where[$key] = \"'$v%'\";\n\t\t\t\telse\n\t\t\t\t\t$this->q_where[$key] = \"'%$v%'\";\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "function orNotLike($field, $match = '', $side = 'both')\n {\n return $this->_like($field, $match, 'OR ', $side, 'NOT');\n }", "public function orConditions($data = array()) {\r\n\t\t\t\r\n\t\t\t\r\n\t\t$filter = trim($data['filter']);\r\n\t\t$condition = array(\r\n\t\t\t\t'OR' => array(\r\n\t\t\t\t\t\t$this->alias . '.description LIKE' => '%' . $filter . '%',\r\n\t\t\t\t\t\t$this->alias . '.name LIKE' => '%' . $filter . '%',\n\t\t\t\t\t\t$this->alias . '.upc LIKE' => '%' . $filter . '%',\n\t\t\t\t\t\t$this->alias . '.manufacturer LIKE' => '%' . $filter . '%',\n\t\t\t\t\t\t$this->alias . '.category_1 LIKE' => '%' . $filter . '%',\n\t\t\t\t\t\t$this->alias . '.model LIKE' => '%' . $filter . '%',\n\t\t\t\t\t\t$this->alias . '.sku LIKE' => '%' . $filter . '%',\n\t\t\t\t\t\t$this->alias . '.asin LIKE' => '%' . $filter . '%',\r\n\t\t\t\t)\r\n\t\t);\r\n\t\treturn $condition;\r\n\t}", "function search_advanced_get_where_sql($table, $fields, $params, $use_fulltext = TRUE) {\n\t$query = elgg_extract(\"query\", $params, \"\");\n\tif (empty($query)) {\n\t\treturn \"\";\n\t}\n\t\n\t$query_array = explode(\" \", $query);\n\t\n\tif (count($query_array) > 1) {\n\t\t$multi_query = array();\n\t\tforeach ($query_array as $value) {\n\t\t\t$temp_field = trim($value);\n\t\t\tif (!empty($temp_field)) {\n\t\t\t\t$multi_query[] = $temp_field;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (count($multi_query) > 1) {\n\t\t\t$query = $multi_query;\n\t\t}\n\t}\n\t\n\t// add the table prefix to the fields\n\tif ($table) {\n\t\tforeach ($fields as $i => $field) {\n\t\t\t$fields[$i] = \"$table.$field\";\n\t\t}\n\t}\n\t\n\tif (!is_array($query)) {\n\t\t$query = array($query);\n\t}\n\n\t$likes = array();\n\tforeach ($fields as $field) {\n\t\t$field_likes = array();\n\t\tforeach ($query as $query_part) {\n\t\t\t$query_part = sanitise_string($query_part);\n\t\t\n\t\t\t$field_likes[] = \"$field LIKE '%$query_part%'\";\n\t\t}\n\t\t$likes[] = \"(\" . implode(' AND ', $field_likes) . \")\";\n\t}\n\t$likes_str = implode(' OR ', $likes);\n\t$where = \"($likes_str)\";\n\n\treturn $where;\n}", "private function macroWhereLike(): void\n {\n Builder::macro('whereLike', function ($attributes, string $searchTerm) {\n $this->where(function (Builder $query) use ($attributes, $searchTerm) {\n foreach (Arr::wrap($attributes) as $attribute) {\n $query->when(\n str_contains($attribute, '.'),\n function (Builder $query) use ($attribute, $searchTerm) {\n [$relationName, $relationAttribute] = explode('.', $attribute);\n\n $query->orWhereHas($relationName, function (Builder $query) use ($relationAttribute, $searchTerm) {\n $query->where($relationAttribute, 'LIKE', \"%{$searchTerm}%\");\n });\n },\n function (Builder $query) use ($attribute, $searchTerm) {\n $query->orWhere($attribute, 'LIKE', \"%{$searchTerm}%\");\n }\n );\n }\n });\n\n return $this;\n });\n }", "function like($str);", "public function orClause($field, $value)\n\t{\n\t\t$this->sql .= \" OR $field=$value\";\n\t}", "public static function sqlor() {\n\t\t$args = func_get_args();\n\t\t$function = 'or';\n\t\t$res = false;\n\t\tforeach ($args as $arg) {\n\t\t\tif (!empty($arg))\n\t\t\t\t$res[] = $arg;\n\t\t}\n\t\tif (!empty($res))\n\t\t\t$res = '(' . implode(') '.$function.' (', $res) . ')';\n\t\telse\n\t\t\t$res = '1=0';\n\t\treturn $res;\n\t}", "function ctrl_search_where($where){\n global $wpdb;\n if (is_search())\n $where .= \"OR (t.name LIKE '%\".get_search_query().\"%' AND {$wpdb->posts}.post_status = 'publish')\";\n return $where;\n }", "public function or_not_like($field, $match = '', $side = 'both')\n\t{\n\t\treturn $this->_like($field, $match, 'OR ', $side, 'NOT ');\n\t}", "public function get_like($string){\n\t\t$this->db->like($this->fields_like[0],$string);\n\t\tunset($this->fields_like[0]);\n\t\tforeach ($this->fields_like as $field) {\n\t\t\t$this->db->or_like($field,$string);\n\t\t}\n\t\t$query = $this->db->get($this->table);\n\t\treturn $query->result();\n\t}", "protected function sql_like($column, $value, $format = '%s', $and = true)\n\t{\n\t\t$sql = $this->_sql_and($and);\n\t\t$sql .= $this->wpdb->prepare(\" `$column` LIKE $format\", $value);\n\n\t\treturn $sql;\n\t}", "public function or_where($key, $value = NULL, $escape = NULL)\n {\n return $this->_wh('qb_where', $key, $value, ' OR ');\n }", "function search_get_where_sql($table, $fields, $params, $use_fulltext = TRUE) {\n\tglobal $CONFIG;\n\t$query = $params['query'];\n\n\t// add the table prefix to the fields\n\tforeach ($fields as $i => $field) {\n\t\tif ($table) {\n\t\t\t$fields[$i] = \"$table.$field\";\n\t\t}\n\t}\n\t\n\t$where = '';\n\n\t// if query is shorter than the min for fts words\n\t// it's likely a single acronym or similar\n\t// switch to literal mode\n\tif (elgg_strlen($query) < $CONFIG->search_info['min_chars']) {\n\t\t$likes = array();\n\t\t$query = sanitise_string($query);\n\t\tforeach ($fields as $field) {\n\t\t\t$likes[] = \"$field LIKE '%$query%'\";\n\t\t}\n\t\t$likes_str = implode(' OR ', $likes);\n\t\t$where = \"($likes_str)\";\n\t} else {\n\t\t// if we're not using full text, rewrite the query for bool mode.\n\t\t// exploiting a feature(ish) of bool mode where +-word is the same as -word\n\t\tif (!$use_fulltext) {\n\t\t\t$query = '+' . str_replace(' ', ' +', $query);\n\t\t}\n\t\t\n\t\t// if using advanced, boolean operators, or paired \"s, switch into boolean mode\n\t\t$booleans_used = preg_match(\"/([\\-\\+~])([\\w]+)/i\", $query);\n\t\t$advanced_search = (isset($params['advanced_search']) && $params['advanced_search']);\n\t\t$quotes_used = (elgg_substr_count($query, '\"') >= 2); \n\t\t\n\t\tif (!$use_fulltext || $booleans_used || $advanced_search || $quotes_used) {\n\t\t\t$options = 'IN BOOLEAN MODE';\n\t\t} else {\n\t\t\t// natural language mode is default and this keyword isn't supported in < 5.1\n\t\t\t//$options = 'IN NATURAL LANGUAGE MODE';\n\t\t\t$options = '';\n\t\t}\n\t\t\n\t\t// if short query, use query expansion.\n\t\t// @todo doesn't seem to be working well.\n//\t\tif (elgg_strlen($query) < 5) {\n//\t\t\t$options .= ' WITH QUERY EXPANSION';\n//\t\t}\n\t\t$query = sanitise_string($query);\n\n\t\t$fields_str = implode(',', $fields);\n\t\t$where = \"(MATCH ($fields_str) AGAINST ('$query' $options))\";\n\t}\n\n\treturn $where;\n}", "public function stringCompare() {\n return 'LIKE';\n }", "private function _like($field, $match = '', $type = 'AND ')\n\t{\n\t\tif ( !is_array($field))\n\t\t{\n\t\t\t$field = array($field => $match);\n\t\t}\n\t\tforeach ($field as $k => $v)\n\t\t{\n\t\t\t$prefix = (count($this->ar_like) == 0) ? '' : $type;\n\t\t\t$v = $this->escape_str($v);\n\t\t\t$this->ar_like[] = $prefix.\" $k LIKE '%{$v}%'\";\n\t\t}\n\t\treturn $this;\n\t}", "public function search($keyword){\n\t\t\t\n\t\t\tif(is_array($keyword) && count($keyword) > 0){\n\t\t\t\t\n\t\t\t\t$like = array();\n\t\t\t\t$like2 = array();\n\t\t\t\t$like3 = array();\n\t\t\t\t$like4 = array();\n\t\t\t\t$like5 = array();\n\t\t\t\t\n\t\t\t\t//\"(category LIKE '%\".$value.\"%' OR colour LIKE '%\".$value.\"%' OR brand LIKE '%\".$value.\"%' OR name LIKE '%\".$value.\"%' OR description LIKE '%\".$value.\"%')\"\n\t\t\t\tforeach($keyword as $value) {\n\t\t\t\t\t$like[] = \"category LIKE '%\" . $this->db->escape($value) . \"%'\";\n\t\t\t\t\t$like2[] = \"gender LIKE '%\" . $this->db->escape($value) . \"%'\";\n\t\t\t\t\t$like3[] = \"brand LIKE '%\" . $this->db->escape($value) . \"%'\";\n\t\t\t\t\t$like4[] = \"name LIKE '%\" . $this->db->escape($value) . \"%'\";\n\t\t\t\t\t$like5[] = \"description LIKE '%\" . $this->db->escape($value) . \"%'\";\n\t\t\t\t}\n\t\t\t\t$like_string = \"(\" . implode(' OR ', $like) . \")\";\n\t\t\t\t$like_string2 = \"(\" . implode(' OR ', $like2) . \")\";\n\t\t\t\t$like_string3 = \"(\" . implode(' OR ', $like3) . \")\";\n\t\t\t\t$like_string4 = \"(\" . implode(' OR ', $like4) . \")\";\n\t\t\t\t$like_string5 = \"(\" . implode(' OR ', $like5) . \")\";\n\t\t\t\t\n\t\t\t\t$this->db->where($like_string);\n\t\t\t\t$this->db->where($like_string2);\n\t\t\t\t$this->db->where($like_string3);\n\t\t\t\t$this->db->where($like_string4);\n\t\t\t\t$this->db->where($like_string5);\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$this->db->like('LOWER(category)',strtolower($keyword));\n\t\t\t\t$this->db->or_like('LOWER(gender)',strtolower($keyword));\n\t\t\t\t$this->db->or_like('LOWER(brand)',strtolower($keyword));\n\t\t\t\t$this->db->or_like('LOWER(name)',strtolower($keyword));\n\t\t\t\t$this->db->or_like('LOWER(description)',strtolower($keyword));\n\t\t\t}\n\t\t\t\n\t\t\t//$this->db->order_by('id','DESC');\n\t\t\t$query = $this->db->get('products');\n\t\t\tif($query->num_rows() > 0){\n\t\t\n\t\t\t\tforeach ($query->result() as $row){\n\t\t\t\t\t$data[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "protected function _search($query)\n {\n if ($this->_search) {\n $str = '';\n foreach ($this->_searchable as $col => $isSearchable) {\n if ($isSearchable) {\n switch ($col) {\n default:\n $str .= '\"'.$col.'\" LIKE \\'%'.$this->_search.'%\\' OR';\n break;\n }\n }\n }\n $str = trim($str,' OR');\n $query->Where($str);\n }\n }", "public function orWhere($cond, array $bind = []);", "public function orWhere(array $where);", "function PMA_getSearchSqls($table, $field, $search_str, $search_option)\n {\n global $err_url;\n\n // Statement types\n $sqlstr_select = 'SELECT';\n $sqlstr_delete = 'DELETE';\n\n // Fields to select\n $tblfields = PMA_DBI_fetch_result('SHOW FIELDS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($GLOBALS['db']),\n null, 'Field');\n\n // Table to use\n $sqlstr_from = ' FROM ' . PMA_backquote($GLOBALS['db']) . '.' . PMA_backquote($table);\n\n $search_words = (($search_option > 2) ? array($search_str) : explode(' ', $search_str));\n $search_wds_cnt = count($search_words);\n\n $like_or_regex = (($search_option == 4) ? 'REGEXP' : 'LIKE');\n $automatic_wildcard = (($search_option < 3) ? '%' : '');\n\n $fieldslikevalues = array();\n foreach ($search_words as $search_word) {\n // Eliminates empty values\n if (strlen($search_word) === 0) {\n continue;\n }\n\n $thefieldlikevalue = array();\n foreach ($tblfields as $tblfield) {\n if (! isset($field) || strlen($field) == 0 || $tblfield == $field) {\n $thefieldlikevalue[] = PMA_backquote($tblfield)\n . ' ' . $like_or_regex . ' '\n . \"'\" . $automatic_wildcard\n . $search_word\n . $automatic_wildcard . \"'\";\n }\n } // end for\n\n if (count($thefieldlikevalue) > 0) {\n $fieldslikevalues[] = implode(' OR ', $thefieldlikevalue);\n }\n } // end for\n\n $implode_str = ($search_option == 1 ? ' OR ' : ' AND ');\n if ( empty($fieldslikevalues)) {\n // this could happen when the \"inside field\" does not exist\n // in any selected tables\n $sqlstr_where = ' WHERE FALSE';\n } else {\n $sqlstr_where = ' WHERE (' . implode(') ' . $implode_str . ' (', $fieldslikevalues) . ')';\n }\n unset($fieldslikevalues);\n\n // Builds complete queries\n $sql['select_fields'] = $sqlstr_select . ' * ' . $sqlstr_from . $sqlstr_where;\n // here, I think we need to still use the COUNT clause, even for\n // VIEWs, anyway we have a WHERE clause that should limit results\n $sql['select_count'] = $sqlstr_select . ' COUNT(*) AS `count`' . $sqlstr_from . $sqlstr_where;\n $sql['delete'] = $sqlstr_delete . $sqlstr_from . $sqlstr_where;\n\n return $sql;\n }" ]
[ "0.7012939", "0.66999894", "0.6418904", "0.62499434", "0.6134148", "0.61152655", "0.6022138", "0.5893417", "0.58860177", "0.5849165", "0.5834963", "0.5816638", "0.58120644", "0.5799184", "0.57692987", "0.57641834", "0.5732398", "0.5715312", "0.56625605", "0.5659723", "0.56464595", "0.5628467", "0.56246823", "0.55996764", "0.55925846", "0.5572867", "0.5566955", "0.5563723", "0.55599594", "0.55437213" ]
0.67501307
1
OR NOT LIKE Generates a NOT LIKE portion of the query. Separates multiple calls with 'OR'.
public function or_not_like($field, $match = '', $side = 'both', $escape = NULL, $mongoSyntax = FALSE) { return $this->_like($field, $match, 'OR ', $side, 'NOT', $escape, $mongoSyntax); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function orNotLike($field, $match = '', $side = 'both')\n {\n return $this->_like($field, $match, 'OR ', $side, 'NOT');\n }", "public function or_not_like($field, $match = '', $side = 'both')\n\t{\n\t\treturn $this->_like($field, $match, 'OR ', $side, 'NOT ');\n\t}", "function or_not_like($col, $match = '', $side = 'both')\n\t{\n\t\treturn $this->or_like($col, $match, $side, true);\n\t}", "protected function sql_not_like($column, $value, $format = '%s', $and = true)\n\t{\n\t\t$sql = $this->_sql_and($and);\n\t\t$sql .= $this->wpdb->prepare(\" `$column` NOT LIKE $format\", $value);\n\n\t\treturn $sql;\n\t}", "function notLike($field, $match = '', $side = 'both')\n {\n return $this->_like($field, $match, 'AND ', $side, 'NOT');\n }", "public function notLike($column, $value) { return $this->addCondition($column, $value, Criterion::NOT_LIKE); }", "function or_like($col, $match = '', $side = 'both', $not = false)\n\t{\n\t\treturn $this->like($col, $match, $side, true, $not);\n\t}", "public function where_not_like( $column_name, $value = null ) {\n\t\treturn $this->_add_simple_where( $column_name, 'NOT LIKE', $value );\n\t}", "public function orNotLike($column, $value)\n {\n $this->where($column, 'NOT LIKE', $value, 'OR');\n return $this;\n }", "public function notLike(string $column, mixed $value, string $type = Condition::AND): CriteriaInterface;", "public function not_like($field, $match = '', $side = 'both', $escape = NULL, $mongoSyntax = FALSE)\n {\n return $this->_like($field, $match, 'AND ', $side, 'NOT', $escape, $mongoSyntax);\n }", "function &or_not_where($where = false, $value = null, $escape = true)\n\t{\n\t\treturn $this->not_where($where, $value, $escape, true);\n\t}", "public function where_not_like($column_name, $value) {\n return $this->_add_simple_where($column_name, 'NOT LIKE', $value);\n }", "public function testOrmCriteriaLikeAndNotLike()\n {\n $userModel = new IdiormDbal('users');\n\n $userModel->criteria('firstname', 'LIKE', '%Jo%');\n\n $users = $userModel->get();\n\n $this->assertCount(1, $users);\n\n $this->assertEquals('John', $users[0]['firstname']);\n\n $userModel = new IdiormDbal('users');\n\n $userModel->criteria('firstname', 'LIKE', '%J%');\n\n $users = $userModel->get();\n\n $this->assertCount(2, $users);\n\n $this->assertEquals('Jane', $users[1]['firstname']);\n\n $userModel = new IdiormDbal('users');\n\n $userModel->criteria('firstname', 'NOT LIKE', '%Jo%');\n\n $users = $userModel->get();\n\n $this->assertCount(1, $users);\n\n $this->assertEquals('Jane', $users[0]['firstname']);\n }", "function &not_where($where = false, $value = null, $escape = true, $or = false)\n\t{\n\t\treturn $this->where($where, $value, $escape, $or, true);\n\t}", "public function notLike($a, $b = null)\n\t{\n\t\t$items = \\is_array($a) ? $a : [$a => $b];\n\n\t\treturn $this->conditions($items, self::OP_NOT_LIKE);\n\t}", "public function not_like($field, $match = '', $side = 'both')\n\t{\n\t\treturn $this->_like($field, $match, 'AND ', $side, ' NOT');\n\t}", "function orLike($field, $match = '', $side = 'both')\n {\n return $this->_like($field, $match, 'OR ', $side);\n }", "private function _notuses($option) {\n\t\tif (count($option) > 0) {\n\t\t\t$where = $this->tableNames['page'].'.page_id NOT IN (SELECT '.$this->tableNames['templatelinks'].'.tl_from FROM '.$this->tableNames['templatelinks'].' WHERE (';\n\t\t\t$ors = [];\n\t\t\tforeach ($option as $linkGroup) {\n\t\t\t\tforeach ($linkGroup as $link) {\n\t\t\t\t\t$_or = '('.$this->tableNames['templatelinks'].'.tl_namespace='.intval($link->getNamespace());\n\t\t\t\t\tif ($this->parameters->getParameter('ignorecase')) {\n\t\t\t\t\t\t$_or .= ' AND LOWER(CAST('.$this->tableNames['templatelinks'].'.tl_title AS char))=LOWER('.$this->DB->addQuotes($link->getDbKey()).'))';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$_or .= ' AND '.$this->tableNames['templatelinks'].'.tl_title='.$this->DB->addQuotes($link->getDbKey()).')';\n\t\t\t\t\t}\n\t\t\t\t\t$ors[] = $_or;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$where .= implode(' OR ', $ors).'))';\n\t\t}\n\t\t$this->addWhere($where);\n\t}", "function or_where_not_in($column, $values) {\n return $this->where_not_in($column, $values, 'OR');\n }", "public function or_like($field, $match = '', $side = 'both', $escape = NULL, $mongoSyntax = FALSE)\n {\n return $this->_like($field, $match, 'OR ', $side, '', $escape, $mongoSyntax);\n }", "function not_like($col, $match = '', $side = 'both')\n\t{\n\t\treturn $this->like($col, $match, $side, true);\n\t}", "function &like($col, $match = '', $side = 'both', $or = false, $not = false)\n\t{\n\t\t$this->q_cached = false;\n\t\t\n\t\tif( ! is_array($col) && $match == '')\n\t\t{\n\t\t\tif($not)\n\t\t\t\t$this->q_where[] = 'NOT';\n\t\t\t\n\t\t\t$obj = new IgnitedQuery($this);\n\t\t\t$obj->q_as = false;\n\t\t\t\n\t\t\t$this->q_where[$this->_protect_identifiers($k).' LIKE'] = $obj;\n\t\t\treturn $obj;\n\t\t}\n\t\t\n\t\tif( ! is_array($col))\n\t\t\t$col = array($col => $match);\n\t\t\n\t\tforeach($col as $k => $v)\n\t\t{\n\t\t\tif($or && ! empty($this->q_where))\n\t\t\t\t$this->q_where[] = 'OR';\n\t\t\t\n\t\t\tif($not)\n\t\t\t\t$this->q_where[] = 'NOT';\n\t\t\t\n\t\t\t$key = $this->_protect_identifiers($k).' LIKE';\n\t\t\t\n\t\t\tif(is_object($v))\n\t\t\t{\n\t\t\t\t$this->q_where[$key] = $v;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$v = $this->escape_str($v);\n\t\t\t\t\n\t\t\t\tif($side == 'before')\n\t\t\t\t\t$this->q_where[$key] = \"'%$v'\";\n\t\t\t\telseif($side == 'after')\n\t\t\t\t\t$this->q_where[$key] = \"'$v%'\";\n\t\t\t\telse\n\t\t\t\t\t$this->q_where[$key] = \"'%$v%'\";\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "function or_not_like ( $arrValue, $table = false, $join = false ) { \n\n if ( empty( $arrValue ) ) $this->InvalidArgExceptionThrow( 1 );\n \n if ( $join ) $this->joinTable( $join );\n\n foreach( $arrValue as $key => $value ) { \n $this->db->or_not_like( $key, $value );\n }\n\n if ( !$table )\n $query = $this->db->get( $this->table ); \n else\n $query = $this->db->get( $table );\n \n return $query->result_array();\n }", "public function notLike(QueryBuilder $queryBuilder, string $right): Andx|Orx|Comparison|null\n {\n return $queryBuilder->expr()->notLike($this->dbKey, $queryBuilder->expr()->literal('%' . $right . '%'));\n }", "private function _nottitle($option) {\n\t\tforeach ($option as $comparisonType => $titles) {\n\t\t\tforeach ($titles as $title) {\n\t\t\t\tif ($this->parameters->getParameter('openreferences')) {\n\t\t\t\t\tif ($this->parameters->getParameter('ignorecase')) {\n\t\t\t\t\t\t$_or = \"LOWER(CAST(pl_title AS char)) {$comparisonType}\".strtolower($this->DB->addQuotes($title));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$_or = \"pl_title {$comparisonType} \".$this->DB->addQuotes($title);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($this->parameters->getParameter('ignorecase')) {\n\t\t\t\t\t\t$_or = \"LOWER(CAST({$this->tableNames['page']}.page_title AS char)) {$comparisonType}\".strtolower($this->DB->addQuotes($title));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$_or = \"{$this->tableNames['page']}.page_title {$comparisonType}\".$this->DB->addQuotes($title);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$ors[] = $_or;\n\t\t\t}\n\t\t}\n\t\t$where .= 'NOT ('.implode(' OR ', $ors).')';\n\t\t$this->addWhere($where);\n\t}", "public function or_like($field, $match = '', $side = 'both')\n\t{\n\t\treturn $this->_like($field, $match, 'OR ', $side);\n\t}", "public function or_where_not_in($field = NULL, $values = NULL)\n\t{\n\t\treturn $this->_where_in($field, $values, TRUE, 'OR ');\n\t}", "protected function _or_and_where($where, $match, $type = 'AND', $not ='') {\n\n if(trim($type) == 'OR'){\n $type = '$or';\n if(trim($not) == 'NOT') {\n $type = '$nor';\n }\n }else {\n $type = '$and';\n\n if(trim($not) == 'NOT') {\n $type = '$not';\n }\n }\n\n if(empty($where)) {\n if($type == '$not' && $this->qb_where_group_count == 0) {\n $order['$nor'] = array();\n $current_match['$and'] = array($match, array('true'=>true));\n array_push($order['$nor'], $current_match);\n $where = $order;\n }else {$where = $match;}\n\n }else {\n if($type == '$not') {\n $order['$nor'] = array();\n $current_match['$and'] = array($where, $match);\n array_push($order['$nor'], $current_match);\n $where = $order;\n }else {\n $order[$type] = array();\n array_push($order[$type], $where);\n array_push($order[$type], $match);\n $where = $order;\n }\n }\n\n return $where;\n }", "public static function orWhereNotExists($callback)\n {\n /** @var \\Illuminate\\Database\\Query\\Builder $instance */\n return $instance->orWhereNotExists($callback);\n }" ]
[ "0.7025169", "0.6746773", "0.67140555", "0.6343601", "0.6278392", "0.62032014", "0.6184922", "0.6175474", "0.6171449", "0.60913926", "0.60894275", "0.60414666", "0.6035504", "0.59954065", "0.59671724", "0.58944356", "0.5829547", "0.57837343", "0.5761966", "0.56646556", "0.566271", "0.56599206", "0.56440276", "0.5642191", "0.55872905", "0.5507528", "0.5469775", "0.54336727", "0.54186153", "0.541277" ]
0.68167406
1
Wildcard in Mongo convert SQL wildcard to Regular Expression of MongoDB
protected function _wildcard_mongo($match) { $match = str_replace($this->sql_wildcard, $this->mongo_regex, $match); return $match; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function queryFormats ($pattern = \"*\") {}", "private function searchWildcards() {\n \t// Figure out all the variables used in the condition\n \t// Check if any of them contains WILDCARDx in their names where x is an integer\n \t// Add such variable names with wildcard names to $this->wildcards array\n \tpreg_match_all('/(\\$[_\\d\\w]*WILDCARD\\d+[_\\d\\w]*)/', $this->condition, $matches);\n \t\n \t$this->wildcards = array_unique($matches[0]);\n }", "protected function opRegex($field) {\n $this->query->addWhere($this->options['group'], $field, $this->value, 'REGEXP');\n }", "public function queryFormats($pattern = '*') {\n\t}", "function sqlSearchStr($srch_str) {\n $srch_str = str_replace(\"*\", \"%\", $srch_str);\n $srch_str = str_replace(\"?\", \"_\", $srch_str);\n return $srch_str;\n }", "public function getSqlSearchPattern(){\n $name = $this->getClearOriginal();\n $shortCordReplace = $this->replaceDelimetrs($name);\n $doubleCordReplace = $this->replaceDelimetrs($name,'__');\n $tripleCordReplace = $this->replaceDelimetrs($name,'___'); \n return array($shortCordReplace,$doubleCordReplace,$tripleCordReplace);\n }", "public function wildcard() {\n return $this->wildcard;\n }", "public function wildcard($cpLen) {\n\t\t$this->_additionalParameters = true;\n\t\t$this->_pattern = substr($this->_pattern, 0, $cpLen > 2 && $this->_pattern[$cpLen - 2] == '/' ? -1 : -1);\n\t}", "public function dataProviderMatchWildcard()\n {\n return [\n // *\n ['*', 'any', true],\n ['*', '', true],\n ['begin*end', 'begin-middle-end', true],\n ['begin*end', 'beginend', true],\n ['begin*end', 'begin-d', false],\n ['*end', 'beginend', true],\n ['*end', 'begin', false],\n ['begin*', 'begin-end', true],\n ['begin*', 'end', false],\n ['begin*', 'before-begin', false],\n // ?\n ['begin?end', 'begin1end', true],\n ['begin?end', 'beginend', false],\n ['begin??end', 'begin12end', true],\n ['begin??end', 'begin1end', false],\n // []\n ['gr[ae]y', 'gray', true],\n ['gr[ae]y', 'grey', true],\n ['gr[ae]y', 'groy', false],\n ['a[2-8]', 'a1', false],\n ['a[2-8]', 'a3', true],\n ['[][!]', ']', true],\n ['[-1]', '-', true],\n // [!]\n ['gr[!ae]y', 'gray', false],\n ['gr[!ae]y', 'grey', false],\n ['gr[!ae]y', 'groy', true],\n ['a[!2-8]', 'a1', true],\n ['a[!2-8]', 'a3', false],\n // -\n ['a-z', 'a-z', true],\n ['a-z', 'a-c', false],\n // slashes\n ['begin/*/end', 'begin/middle/end', true],\n ['begin/*/end', 'begin/two/steps/end', true],\n ['begin/*/end', 'begin/end', false],\n ['begin\\\\\\\\*\\\\\\\\end', 'begin\\middle\\end', true],\n ['begin\\\\\\\\*\\\\\\\\end', 'begin\\two\\steps\\end', true],\n ['begin\\\\\\\\*\\\\\\\\end', 'begin\\end', false],\n // dots\n ['begin.*.end', 'begin.middle.end', true],\n ['begin.*.end', 'begin.two.steps.end', true],\n ['begin.*.end', 'begin.end', false],\n // case\n ['begin*end', 'BEGIN-middle-END', false],\n ['begin*end', 'BEGIN-middle-END', true, ['caseSensitive' => false]],\n // file path\n ['begin/*/end', 'begin/middle/end', true, ['filePath' => true]],\n ['begin/*/end', 'begin/two/steps/end', false, ['filePath' => true]],\n ['begin\\\\\\\\*\\\\\\\\end', 'begin\\middle\\end', true, ['filePath' => true]],\n ['begin\\\\\\\\*\\\\\\\\end', 'begin\\two\\steps\\end', false, ['filePath' => true]],\n ['*', 'any', true, ['filePath' => true]],\n ['*', 'any/path', false, ['filePath' => true]],\n ['[.-0]', 'any/path', false, ['filePath' => true]],\n ['*', '.dotenv', true, ['filePath' => true]],\n // escaping\n ['\\*\\?', '*?', true],\n ['\\*\\?', 'zz', false],\n ['begin\\*\\end', 'begin\\middle\\end', true, ['escape' => false]],\n ['begin\\*\\end', 'begin\\two\\steps\\end', true, ['escape' => false]],\n ['begin\\*\\end', 'begin\\end', false, ['escape' => false]],\n ['begin\\*\\end', 'begin\\middle\\end', true, ['filePath' => true, 'escape' => false]],\n ['begin\\*\\end', 'begin\\two\\steps\\end', false, ['filePath' => true, 'escape' => false]],\n ];\n }", "protected function constrainByWildcard($query)\n {\n $query->where(\"{$this->table}.entity_type\", '*');\n }", "function mysql_escape_string(/*.string.*/ $s){}", "public function like($field = \"\", $value = \"\", $flags = \"i\", $enable_start_wildcard = TRUE, $enable_end_wildcard = TRUE)\r\n {\r\n $field = (string) trim($field);\r\n $this->where_init($field);\r\n $value = (string) trim($value);\r\n $value = quotemeta($value);\r\n\r\n if ($enable_start_wildcard !== TRUE)\r\n {\r\n $value = \"^\" . $value;\r\n }\r\n\r\n if ($enable_end_wildcard !== TRUE)\r\n {\r\n $value .= \"$\";\r\n }\r\n\r\n $regex = \"/$value/$flags\";\r\n $this->wheres[$field] = new MongoRegex($regex);\r\n return $this;\r\n }", "protected function fullTextWildcards($term)\n {\n $reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];\n $term = str_replace($reservedSymbols, '', $term);\n \n $words = explode(' ', $term);\n \n foreach ($words as $key => $word) {\n /*\n * applying + operator (required word) only big words\n * because smaller ones are not indexed by mysql\n */\n if (strlen($word) >= 1) {\n $words[$key] = '+' . $word . '*';\n }\n }\n \n $searchTerm = implode(' ', $words);\n \n return $searchTerm;\n }", "private function getRegExp()\n {\n return '/\\-\\- query/';\n }", "function regexp($pattern);", "protected function fullTextWildcards($term)\n\t{\n\t\t$reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];\n\t\t$term = str_replace($reservedSymbols, '', $term);\n\n\t\t$words = explode(' ', $term);\n\n\t\tforeach ($words as $key => $word) {\n\t\t\t/*\n\t\t\t * applying + operator (required word) only big words\n\t\t\t * because smaller ones are not indexed by mysql\n\t\t\t */\n\t\t\tif (strlen($word) >= 1) {\n\t\t\t\t$words[$key] = $word.'*';\n\t\t\t}\n\t\t}\n\n\t\t$searchTerm = implode(',', $words);\n\n\t\treturn $searchTerm;\n\t}", "function getWithLike(string $pattern): array\n {\n $this->createPDO('select');\n $this->PDOLink->setCommand('Select a.Name from Author as a where a.Name LIKE ?');\n $this->PDOLink->setValues('%' . $pattern . '%');\n return $this->PDOLink->execute();\n }", "function search_products(){\r\n$mongoClient = (new MongoDB\\Client);\r\n\r\n//Select a database\r\n$db = $mongoClient->Ecommerce;\r\n\r\n$userInput = $_POST['userInput'];\r\n\r\n$regexObj = new MongoDB\\BSON\\Regex($userInput, 'i');\r\n\r\n$search = array( '$or' => array( array('name' => $regexObj), array('description' => $regexObj), array('country' => $regexObj), array('type' => $regexObj)));\r\n\r\n//Find all of the products that match this criteria\r\n$cursor = $db->products->find($search);\r\n\r\n$result = \"\";\r\n\r\n//Output products\r\nforeach ($cursor as $product){\r\n $result .= '<div><h3>'. $product[\"name\"] .'</h3><div class=\"flip-card\"><div class=\"flip-card-inner\"><div class=\"flip-card-front\"><img src= \"../'. $product[\"image\"] .'\"></div><div class=\"flip-card-back\"><p id=\"abv\">ABV: '. $product[\"abv\"] . '%</p><p id=\"country\">'. $product[\"country\"] .' <i class=\"fa fa-globe\" aria-hidden=\"true\"></i></p><p id=\"wineDescription\">'. $product[\"description\"] .'</p></div></div></div><h5>'. $product[\"type\"] .' Wine | £'. $product[\"price\"] .'</h5><button onclick=\\'addToBasket(\"' . $product[\"name\"] . '\", \"' . $product[\"price\"] . '\")\\'>Add To Cart</button></div>';\r\n}return $result;\r\n\r\n//close the connection\r\n$mongoClient->close();\r\n\r\n}", "function wildCardMatch($haystack, $needle)\n{\n\t// Quote the entire needle, so that everything is treated literally\n\t$pattern = preg_quote($needle, '#');\n\n\t// Then replace literal wildcards with a regular expression group\n\t$pattern = str_replace('\\*', '(.*?)', $pattern);\n\n\t// Run the regular expression\n\tpreg_match_all('#'.$pattern.'#s', $haystack, $matches);\n\n\t// Return the matches\n\treturn $matches;\n}", "public function testSelectFilterLangMatchesWithStar()\n {\n // test data\n $this->fixture->query('INSERT INTO <http://example.com/> {\n <http://s> <http://p1> \"foo\" .\n <http://s> <http://p1> \"in de\"@de .\n <http://s> <http://p1> \"in en\"@en .\n }');\n\n $res = $this->fixture->query('\n SELECT ?s ?o WHERE {\n ?s <http://p1> ?o .\n FILTER langMatches (lang(?o), \"*\")\n }\n ');\n $this->assertEquals(\n [\n 'query_type' => 'select',\n 'result' => [\n 'variables' => [\n 's', 'o'\n ],\n 'rows' => [],\n ],\n 'query_time' => $res['query_time']\n ],\n $res\n );\n }", "public function escapeWildcards($string, $escapeCharacter = '\\\\') {\n\t\treturn preg_replace('/([_%' . preg_quote($escapeCharacter, '/') . '])/',\n\t\t\taddcslashes($escapeCharacter, '$\\\\') . '$1', $string);\n\t}", "function searchUsers($nameSearch) {\n //Figure out how to bind wildcard parameter\n $nameSearch = \"%$nameSearch%\";\n\n $conn = getConnection();\n $DBQuery = \"select * from users where username LIKE :nameSearch;\";\n $statement = $conn->prepare($DBQuery);\n $statement->bindParam(':nameSearch', $nameSearch);\n $statement->execute();\n $users = $statement->fetchAll();\n return $users;\n}", "function str_like(string $s_pattern, string $str): bool{\n $_str_replace_all = function ($s_sub, $s_re, $str) {\n do {\n $str = str_replace($s_sub, $s_re, $str, $c);\n } while ($c > 0);\n return $str;\n };\n // to convert your patterns to regex, place a ^ at the beginning, and a $ at the end, then replace * with .* and escape .s.\n // 'goo*', => preg_match('#^goo.*$#','google.com')\n // '*gl*', => preg_match('#^.*gl.*$#', 'google.com');\n // 'google.com', => preg_match('#^google\\.com$#', 'google.com')\n $_pattern_2_regex = function ($s_pattern) use ($_str_replace_all) {\n // => '#^goo.*$#'\n $regex = preg_quote($s_pattern);\n // caratteri che vengono escaped: . \\ + * ? ^ $ [ ] ( ) { } < > = ! | :\n $regex = \"/^$regex$/i\"; // case insensitive\n $regex = $_str_replace_all($sub = '\\*', $re = '(.*)', $regex);\n $regex = $_str_replace_all($sub = '%', $re = '(.*)', $regex);\n return $regex;\n };\n $regex = $_pattern_2_regex($s_pattern);\n $r = preg_match($regex, $str, $a_matches);\n // if (true) {\n // unset($a_matches[0]);\n // echo \"$regex $r =>\" . json_encode(array_values($a_matches)) . \"\\n\";\n // }\n return $r == 1;\n}", "protected function convertQuery_Wildcard(\n Zend_Search_Lucene_Search_Query_Wildcard $query, $context = null)\n {\n // Push the current query onto the query stack\n array_push($this->queryStack, $query);\n\n // A wildcard query has a pattern, which is really just a\n // query term\n $term = $query->getPattern();\n\n // Replace any Lucene wildcard characters with '_', '%',\n // etc. in the term's text\n $text = $term->text;\n $text = preg_replace('/\\\\?/', '_', $text);\n $text = preg_replace('/\\\\*/', '%', $text);\n $term->text = $text;\n\n // Now convert the term to its native equvalent\n $nativeQuery = $this->convertTerm($term, $context);\n\n // Pop the query stack\n array_pop($this->queryStack);\n\n return $nativeQuery;\n }", "private function scorm_forge_cols_regexp($columns,$remodule='(\".*\")?,') {\n $regexp = '/^';\n foreach ($columns as $column) {\n $regexp .= $remodule;\n }\n $regexp = substr($regexp,0,-1) . '/';\n return $regexp;\n }", "protected function fullTextWildcards($term)\n {\n // removing symbols used by MySQL\n $reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~', ';', '\"'];\n $term = str_replace($reservedSymbols, '', $term);\n\n $words = explode(' ', $term);\n\n foreach($words as $key => $word) {\n /*\n * applying + operator (required word) only big words\n * because smaller ones are not indexed by mysql\n */\n if(strlen($word) >= 3) {\n $words[$key] = '+' . $word . '*';\n }\n }\n\n $searchTerm = implode( ' ', $words);\n\n return $searchTerm;\n }", "private function matchWildcard($wildcard, $haystack)\n {\n $wildcard = array_map(function ($val) {\n if ($val === '*') {\n return $val;\n }\n\n return \"([{$val}])\";\n }, str_split($wildcard));\n\n $regex = implode('', $wildcard);\n\n $regex = str_replace(\n ['*', '\\*', '\\?'], // wildcard chars\n ['.*', '.'], // regexp chars\n $regex\n );\n\n preg_match_all('/^'.$regex.'$/is', $haystack, $matches, PREG_SET_ORDER);\n\n return count(\n ($matches[0] ?? [])\n );\n }", "function searchFlu($server, $db, $collection, $query = null) { \n \n $conn = new MongoClient($server); \n $_db = $conn->{$db}; \n $collection = $_db->{$collection};\n $criteria['state'] = $query; \n $cursor= $collection->find($criteria)->fields(array('lat' => true,'lng' => true,'usertype'=>true,'petType'=>true)); \n $cursor->sort(array('city' => 1)); \n foreach ($cursor as $result) { \n $result['_id'] = $result['_id']->{'$id'}; \n $output['results'][] = $result; \n } \n \n $conn->close(); \n if($cursor->count()>0)\n return $output; \n else return array(); \n}", "function match($expr, $subject = NULL, array $constraints = array()) {\n static $tokens = NULL;\n\n\n if (is_null($tokens)) {\n $latin = '\\pL';\n\n if ( ! IS_UNICODE) {\n $latin = 'a-zA-Z€$';\n $latin .= 'âêîôûÂÊÎÔÛÄËÏÖÜäëïöü';\n $latin .= 'áéíóúÁÉÍÓÚñÑÙÒÌÈÀùòìèàŷŶŸÿ';\n }\n\n\n $chars = preg_quote('$-_.+!*\\'(),', '/');\n $tokens = array(\n '/\\\\\\\\\\*([a-z_][a-z\\d_]*?)(?=\\b)/i' => '(?<\\\\1>.+?)',\n '/\\\\\\:([a-z_][a-z\\d_]*?)(?=\\b)/i' => '(?<\\\\1>[^\\/]+?)',\n '/%s/' => '(?<=\\W|^)(\\w*[\\d' . $latin . $chars . ']+\\w*)(?=\\W|$)',\n '/%r/' => '([\\d' . $latin . $chars . ']+?)',\n '/%R/' => '[^\\d' . $latin . $chars . ']+',\n '/%d/' => '(?<=\\D|^)(-?[0-9\\.,]+?)(?=\\D|$)',\n '/%g/' => '([\\d' . $latin . ']+?)',\n '/%G/' => '[^\\d' . $latin . ']+',\n '/%l/' => '\\d' . $latin . $chars,\n '/%L/' => '\\d' . $latin,\n '/\\\\\\\\([\\^|bws+$?[\\]])/i' => '\\\\1',\n '/\\\\\\\\\\*/' => '(.+?|())',\n '/\\\\\\\\\\)/' => '|())',\n '/\\\\\\\\\\(/' => '(?:',\n );\n }\n\n\n $expr = preg_quote($expr, '/');\n\n if (is_array($constraints)) {\n $test = array();\n\n foreach ($constraints as $item => $value) {\n if (is_num($as = preg_replace('/[^a-z\\d_]/', '', $item))) {\n continue;\n }\n\n $item = preg_quote($item, '/');\n $value = strtr($value, '/', '\\\\/');\n $expr = str_replace($item, \"(?<$as>$value)\", $expr);\n }\n }\n\n\n $regex = preg_replace(array_keys($tokens), $tokens, $expr);\n\n if (func_num_args() === 1) {\n return \"/$regex/\";\n } elseif (@preg_match(\"/$regex/u\", $subject, $matches)) {\n return $matches;\n }\n\n return FALSE;\n}", "public function search(string $text): Collection\n {\n if (!empty($text)) {\n return $this->getQueryBuilder()\n ->where('description', 'like', $text) //mongodb regex needs to be improved\n ->get();\n } else {\n return $this->all();\n }\n }" ]
[ "0.5511497", "0.5435907", "0.5375247", "0.5294028", "0.5266543", "0.50113606", "0.50036585", "0.49055701", "0.4879176", "0.48654237", "0.48326954", "0.48142058", "0.47971505", "0.47929", "0.4788808", "0.47876453", "0.47867203", "0.4773662", "0.47678006", "0.47607982", "0.47371626", "0.47091025", "0.46826196", "0.4657619", "0.46364233", "0.46313643", "0.4615945", "0.4590287", "0.4580802", "0.45677862" ]
0.7038006
0
Starts a query group, but NOTs the group
public function not_group_start() { $this->group_start('NOT'); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function or_not_group_start()\n {\n $this->group_start('NOT', 'OR');\n\n return $this;\n }", "public function addGroupQuery($value) {}", "public function group_start($not = '', $type = 'AND ')\n {\n\n $this->qb_where_group_count += 1;\n $this->mongo_group_status[$this->qb_where_group_count][0] = $not;\n $this->mongo_group_status[$this->qb_where_group_count][1] = $type;\n $this->qb_where_group_started[$this->qb_where_group_count] = array();\n\n return $this;\n }", "public function skipGroup(string $group): void;", "public function hook_query_index(&$query) {\n $query->where('user_group_id', '1');\n\t }", "public function group($query) {\r\n\t\t$args = func_get_args();\r\n\t\t$this->queryData['group'][] = call_user_func_array(array($this->db, 'formatQuery'), $args);\r\n\t\treturn $this;\r\n\t}", "public function getGroupQueries() {}", "public function group(bool $and = false);", "public function or_group_start()\n {\n $this->group_start('', 'OR');\n\n return $this;\n }", "public function checkGroup()\n {\n if (strpos($this->query, 'GROUP')) {\n return true;\n }\n\n return $this->query = $this->query . \" GROUP BY user.id\";\n }", "public function resetQuery()\n {\n $this->querySkip = true;\n return $this;\n }", "public function group($group = []) {\n\t\t$this->_queryOptions['group'] = array_merge($this->_queryOptions['group'], $group);\n\t}", "public function resetSkippedGroups(): void;", "public function startGroup(HTML_QuickForm2_Node $group)\r\n {\r\n }", "public function group();", "public function group();", "public function group();", "function set_mygrp(){\r\n\t $_SESSION['mygroupId'] = $_POST['query'];\r\n\t }", "function cacsp_filter_query_for_bp_group( $query ) {\n\t// Only modify 'event' queries.\n\t$post_types = $query->get( 'post_type' );\n\tif ( ! in_array( 'cacsp_paper', (array) $post_types ) ) {\n\t\treturn;\n\t}\n\n\t$bp_group = $query->get( 'bp_group', null );\n\tif ( null === $bp_group ) {\n\t\treturn;\n\t}\n\n\tif ( ! is_array( $bp_group ) ) {\n\t\t$group_ids = array( $bp_group );\n\t} else {\n\t\t$group_ids = $bp_group;\n\t}\n\n\t// Empty array will always return no results.\n\tif ( empty( $group_ids ) ) {\n\t\t$query->set( 'post__in', array( 0 ) );\n\t\treturn;\n\t}\n\n\t// Convert group IDs to a tax query.\n\t$tq = $query->get( 'tax_query' );\n\t$group_terms = array();\n\tforeach ( $group_ids as $group_id ) {\n\t\t$group_terms[] = 'group_' . $group_id;\n\t}\n\n\t$tq[] = array(\n\t\t'taxonomy' => 'cacsp_paper_group',\n\t\t'terms' => $group_terms,\n\t\t'field' => 'name',\n\t\t'operator' => 'IN',\n\t);\n\n\t$query->set( 'tax_query', $tq );\n}", "public function undoGroupSkipping(string $group): void;", "public function scopeNotStarted($query)\n {\n $query->where('started_at', '>', Carbon::now());\n return $query;\n }", "public function setFirstGroup(?string $group): void;", "public function newQueryInSameGroup($excludeThis = false)\n {\n $query = $this->newQuery();\n $groupColumn = (array) $this->getGroupColumn();\n if ($groupColumn) {\n $group = [];\n foreach ($groupColumn as $column) {\n $group[] = $this->$column;\n }\n $query->inGroup($group);\n }\n if ($excludeThis) {\n $query->whereKeyNot($this->getKey());\n }\n return $query;\n }", "public function stopQuery(){}", "public function groupBy($group) {\n if ($this->type != QUERY_SELECT)\n throw new InvalidQueryType();\n\n $this->groups[] = $group;\n\n return $this;\n }", "function gmw_ps_filter_bp_groups_query( $query_args, $gmw ) {\n\n /****** keywords ******/\n if ( ! empty( $gmw['form_values']['keywords'] ) ) {\n $query_args['search_terms'] = $gmw['form_values']['keywords'];\n }\n\n /****** Orderby ******/\n $orderby = gmw_ps_get_orderby_value( $gmw );\n\n // abort if no value found\n if ( '' != $orderby ) {\n $query_args['type'] = $orderby;\n }\n\n /****** Group Types *****/\n $output = gmw_ps_bp_get_object_types_query( $gmw, 'group', 'bpgt' );\n\t\n\tif ( false != $output['usage'] ) {\n\t\t$query_args[ $output['usage'] ] = $output['types'];\n\t}\n\n return $query_args;\n}", "function before_group_REG () {\n global $db;\n global $ilPag;\n global $ilSemana;\n global $gfValor;\n global $groups;\n global $gfDevNp ;\n $gfDevNp =0;\n $group = $groups['REG'];\n $db->execute(\"delete from condetalle where det_regnumero = \" . $group->currValue);\n $ilPag +=1;\n}", "public function group_end()\n {\n if($this->qb_where_group_count > 0) {\n // get data was cached\n $where_group = $this->qb_where_group_started[$this->qb_where_group_count];\n $type = $this->mongo_group_status[$this->qb_where_group_count][1];\n\n // restore counting of grouping\n $this->qb_where_group_count --;\n\n $this->_build_where_condition('qb_where',$where_group, $type);\n }\n\n return $this;\n }", "protected function start_query(){\r\n\t\t$this->timer = microtime(true);\r\n\t\t$this->fetch_iterator = 0;\r\n\t}", "public function _add_simple_group_filter()\n\t{\n\t\t//check for the \"sgid\" get parameter\n\t\tif (isset($_GET['sgid']) AND !is_array($_GET['sgid']) AND intval($_GET['sgid']) >= 0)\n\t\t{\n\t\t\t//get the table prefix\n\t\t\t$table_prefix = Kohana::config('database.default.table_prefix');\n\t\t\t\n\t\t\t//get the params\n\t\t\t$sg_id = intval($_GET['sgid']);\n\t\t\t$params = Event::$data;\n\t\t\tarray_push($params,\t'i.id IN (SELECT DISTINCT incident_id FROM '.$table_prefix.'simplegroups_groups_incident WHERE simplegroups_groups_id = '. $sg_id. ')');\n\t\t\t\n\t\t\t//figure out if we're on the backend or not, and if we're not hide private categories\n\t\t\t$only_public = (strpos(url::current(), \"admin/\") === 0) ? \"\" : \" AND sgc.category_visible = 1 \"; \n\t\t\t\n\t\t\t$category_ids = $this->_get_group_categories();\t\t\t\n\t\t\t// Check if there are any category ids\n\t\t\tif (count($category_ids) > 0)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t//what's the logical operator:\n\t\t\t\tif($this->_get_logical_operator() == \"or\")\n\t\t\t\t{\n\t\t\t\t\t//first we need to find out what the original SQL for categories looked like:\n\t\t\t\t\t$category_sql = $this->_create_default_category_sql();\n\t\t\t\t\t$i = 0;\n\t\t\t\t\t$found_it = false;\n\t\t\t\t\tforeach($params as $key=>$value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(strcmp($value, $category_sql) == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$i = $key;\n\t\t\t\t\t\t\t$found_it = true;\n\t\t\t\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\t//if we found it, lets remove it.\n\t\t\t\t\tif($found_it)\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($params[$i]);\n\t\t\t\t\t}\n\t\t\t\t\tif(strlen($category_sql) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$category_sql = ' OR ('.$category_sql.')' ;\n\t\t\t\t\t}\n\t\t\t\t\t$category_ids = implode(\",\", $category_ids);\n\t\t\t\t\tarray_push($params,\n\t\t\t\t\t\t'(i.id IN (SELECT DISTINCT incident_id FROM '.$table_prefix.'simplegroups_incident_category sgic '.\n\t\t\t\t\t\t\t'INNER JOIN '.$table_prefix.'simplegroups_category sgc ON (sgc.id = sgic.simplegroups_category_id) '.\n\t\t\t\t\t\t\t'WHERE (sgc.id IN ('. $category_ids . ') OR sgc.parent_id IN ('.$category_ids.'))'.$only_public.' ) '.$category_sql. ')');\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tforeach($category_ids as $c)\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($params,\n\t\t\t\t\t\t'i.id IN (SELECT DISTINCT incident_id FROM '.$table_prefix.'simplegroups_incident_category sgic '.\n\t\t\t\t\t\t\t'INNER JOIN '.$table_prefix.'simplegroups_category sgc ON (sgc.id = sgic.simplegroups_category_id) '.\n\t\t\t\t\t\t\t'WHERE ((sgc.id = '. $c . ') OR sgc.parent_id = (' . $c . '))'.$only_public.' ) ');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tEvent::$data = $params;\n\t\t}\n\t}" ]
[ "0.6280561", "0.6056717", "0.59822935", "0.58319837", "0.5587646", "0.5426971", "0.5408017", "0.53725314", "0.531505", "0.52902216", "0.52133524", "0.51501566", "0.5131191", "0.51200426", "0.50627655", "0.50627655", "0.50627655", "0.5059035", "0.50137085", "0.50116044", "0.5006736", "0.50040144", "0.5003298", "0.49904785", "0.49767432", "0.49714717", "0.4954601", "0.4944395", "0.4867301", "0.48617908" ]
0.66281164
0
Starts a query group, but ORs the group
public function or_group_start() { $this->group_start('', 'OR'); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addGroupQuery($value) {}", "public function or_not_group_start()\n {\n $this->group_start('NOT', 'OR');\n\n return $this;\n }", "public function group($group = []) {\n\t\t$this->_queryOptions['group'] = array_merge($this->_queryOptions['group'], $group);\n\t}", "public function group($query) {\r\n\t\t$args = func_get_args();\r\n\t\t$this->queryData['group'][] = call_user_func_array(array($this->db, 'formatQuery'), $args);\r\n\t\treturn $this;\r\n\t}", "function gmw_ps_filter_bp_groups_query( $query_args, $gmw ) {\n\n /****** keywords ******/\n if ( ! empty( $gmw['form_values']['keywords'] ) ) {\n $query_args['search_terms'] = $gmw['form_values']['keywords'];\n }\n\n /****** Orderby ******/\n $orderby = gmw_ps_get_orderby_value( $gmw );\n\n // abort if no value found\n if ( '' != $orderby ) {\n $query_args['type'] = $orderby;\n }\n\n /****** Group Types *****/\n $output = gmw_ps_bp_get_object_types_query( $gmw, 'group', 'bpgt' );\n\t\n\tif ( false != $output['usage'] ) {\n\t\t$query_args[ $output['usage'] ] = $output['types'];\n\t}\n\n return $query_args;\n}", "public function group(bool $and = false);", "public function setGroupBy(array $group_by): QueryModifier;", "public function whereGroup($group, $group_connector = 'and')\n {\n\n }", "public function hook_query_index(&$query) {\n $query->where('user_group_id', '1');\n\t }", "public function orNest()\n {\n return $this->nest('OR');\n }", "public function groupBy($group) {\n if ($this->type != QUERY_SELECT)\n throw new InvalidQueryType();\n\n $this->groups[] = $group;\n\n return $this;\n }", "public function or() : SqlComando {\n\t\t$this->acrescentarTextoComando('OR ');\n\n\t\treturn $this;\n\t}", "abstract protected function _buildGroupBy( $group );", "public function or() {\n\t\t$this->comandoString .= \"OR \";\n\n\t\treturn $this;\n\t}", "public function getGroupQueries() {}", "public function group_start($not = '', $type = 'AND ')\n {\n\n $this->qb_where_group_count += 1;\n $this->mongo_group_status[$this->qb_where_group_count][0] = $not;\n $this->mongo_group_status[$this->qb_where_group_count][1] = $type;\n $this->qb_where_group_started[$this->qb_where_group_count] = array();\n\n return $this;\n }", "protected function _buildGroupBy()\n {\n if (empty($this->_groupBy)) {\n return;\n }\n\n $this->_query .= \" GROUP BY \";\n\n foreach ($this->_groupBy as $key => $value) {\n $this->_query .= $value . \", \";\n }\n\n $this->_query = rtrim($this->_query, ', ') . \" \";\n }", "public function groupby($field = false){\n\t \tif($field!=false){\n\t \t\t$group_by_temp = array($field);\n\t\t \tarray_push($this->groupbyQuery, $group_by_temp);\n\t\t }else{\n\t\t \t$this->groupbyQuery = false;\n\t\t }\n\t\t return $this;\n\t }", "public function add_group( array $args, $position = 0 );", "public function or()\n {\n $this->_whereConnector = 'OR';\n return $this;\n }", "public function _add_simple_group_filter()\n\t{\n\t\t//check for the \"sgid\" get parameter\n\t\tif (isset($_GET['sgid']) AND !is_array($_GET['sgid']) AND intval($_GET['sgid']) >= 0)\n\t\t{\n\t\t\t//get the table prefix\n\t\t\t$table_prefix = Kohana::config('database.default.table_prefix');\n\t\t\t\n\t\t\t//get the params\n\t\t\t$sg_id = intval($_GET['sgid']);\n\t\t\t$params = Event::$data;\n\t\t\tarray_push($params,\t'i.id IN (SELECT DISTINCT incident_id FROM '.$table_prefix.'simplegroups_groups_incident WHERE simplegroups_groups_id = '. $sg_id. ')');\n\t\t\t\n\t\t\t//figure out if we're on the backend or not, and if we're not hide private categories\n\t\t\t$only_public = (strpos(url::current(), \"admin/\") === 0) ? \"\" : \" AND sgc.category_visible = 1 \"; \n\t\t\t\n\t\t\t$category_ids = $this->_get_group_categories();\t\t\t\n\t\t\t// Check if there are any category ids\n\t\t\tif (count($category_ids) > 0)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t//what's the logical operator:\n\t\t\t\tif($this->_get_logical_operator() == \"or\")\n\t\t\t\t{\n\t\t\t\t\t//first we need to find out what the original SQL for categories looked like:\n\t\t\t\t\t$category_sql = $this->_create_default_category_sql();\n\t\t\t\t\t$i = 0;\n\t\t\t\t\t$found_it = false;\n\t\t\t\t\tforeach($params as $key=>$value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(strcmp($value, $category_sql) == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$i = $key;\n\t\t\t\t\t\t\t$found_it = true;\n\t\t\t\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\t//if we found it, lets remove it.\n\t\t\t\t\tif($found_it)\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($params[$i]);\n\t\t\t\t\t}\n\t\t\t\t\tif(strlen($category_sql) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$category_sql = ' OR ('.$category_sql.')' ;\n\t\t\t\t\t}\n\t\t\t\t\t$category_ids = implode(\",\", $category_ids);\n\t\t\t\t\tarray_push($params,\n\t\t\t\t\t\t'(i.id IN (SELECT DISTINCT incident_id FROM '.$table_prefix.'simplegroups_incident_category sgic '.\n\t\t\t\t\t\t\t'INNER JOIN '.$table_prefix.'simplegroups_category sgc ON (sgc.id = sgic.simplegroups_category_id) '.\n\t\t\t\t\t\t\t'WHERE (sgc.id IN ('. $category_ids . ') OR sgc.parent_id IN ('.$category_ids.'))'.$only_public.' ) '.$category_sql. ')');\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tforeach($category_ids as $c)\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($params,\n\t\t\t\t\t\t'i.id IN (SELECT DISTINCT incident_id FROM '.$table_prefix.'simplegroups_incident_category sgic '.\n\t\t\t\t\t\t\t'INNER JOIN '.$table_prefix.'simplegroups_category sgc ON (sgc.id = sgic.simplegroups_category_id) '.\n\t\t\t\t\t\t\t'WHERE ((sgc.id = '. $c . ') OR sgc.parent_id = (' . $c . '))'.$only_public.' ) ');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tEvent::$data = $params;\n\t\t}\n\t}", "public function group();", "public function group();", "public function group();", "public function checkGroup()\n {\n if (strpos($this->query, 'GROUP')) {\n return true;\n }\n\n return $this->query = $this->query . \" GROUP BY user.id\";\n }", "public function or_where_open()\n\t{\n\t\t$this->_where[] = ['OR' => '('];\n\n\t\treturn $this;\n\t}", "public function addGroupBy() {\n $this->group_by_clause = new SqlGroupByClause();\n return $this->group_by_clause;\n }", "public function addGroup($group): self;", "public function applyGroup($sql,$group)\n\t{\n\t\tif($group!='')\n\t\t\treturn $sql.' GROUP BY '.$group;\n\t\telse\n\t\t\treturn $sql;\n\t}", "abstract protected function perform_or($first, $second);" ]
[ "0.6531855", "0.6162257", "0.6125954", "0.60432166", "0.5696498", "0.55580086", "0.54932255", "0.54848206", "0.5477028", "0.5447474", "0.5446658", "0.53668606", "0.53584623", "0.53572434", "0.5298289", "0.52773434", "0.524697", "0.5240974", "0.52132875", "0.51971245", "0.5196769", "0.5184604", "0.5184604", "0.5184604", "0.5181292", "0.51796156", "0.5174393", "0.5166804", "0.5165291", "0.51587874" ]
0.6901443
0
Starts a query group, but OR NOTs the group
public function or_not_group_start() { $this->group_start('NOT', 'OR'); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function or_group_start()\n {\n $this->group_start('', 'OR');\n\n return $this;\n }", "public function addGroupQuery($value) {}", "public function group_start($not = '', $type = 'AND ')\n {\n\n $this->qb_where_group_count += 1;\n $this->mongo_group_status[$this->qb_where_group_count][0] = $not;\n $this->mongo_group_status[$this->qb_where_group_count][1] = $type;\n $this->qb_where_group_started[$this->qb_where_group_count] = array();\n\n return $this;\n }", "public function group(bool $and = false);", "public function not_group_start()\n {\n $this->group_start('NOT');\n\n return $this;\n }", "public function group($group = []) {\n\t\t$this->_queryOptions['group'] = array_merge($this->_queryOptions['group'], $group);\n\t}", "public function checkGroup()\n {\n if (strpos($this->query, 'GROUP')) {\n return true;\n }\n\n return $this->query = $this->query . \" GROUP BY user.id\";\n }", "public function hook_query_index(&$query) {\n $query->where('user_group_id', '1');\n\t }", "function gmw_ps_filter_bp_groups_query( $query_args, $gmw ) {\n\n /****** keywords ******/\n if ( ! empty( $gmw['form_values']['keywords'] ) ) {\n $query_args['search_terms'] = $gmw['form_values']['keywords'];\n }\n\n /****** Orderby ******/\n $orderby = gmw_ps_get_orderby_value( $gmw );\n\n // abort if no value found\n if ( '' != $orderby ) {\n $query_args['type'] = $orderby;\n }\n\n /****** Group Types *****/\n $output = gmw_ps_bp_get_object_types_query( $gmw, 'group', 'bpgt' );\n\t\n\tif ( false != $output['usage'] ) {\n\t\t$query_args[ $output['usage'] ] = $output['types'];\n\t}\n\n return $query_args;\n}", "public function group($query) {\r\n\t\t$args = func_get_args();\r\n\t\t$this->queryData['group'][] = call_user_func_array(array($this->db, 'formatQuery'), $args);\r\n\t\treturn $this;\r\n\t}", "public function whereGroup($group, $group_connector = 'and')\n {\n\n }", "public function getGroupQueries() {}", "public function _add_simple_group_filter()\n\t{\n\t\t//check for the \"sgid\" get parameter\n\t\tif (isset($_GET['sgid']) AND !is_array($_GET['sgid']) AND intval($_GET['sgid']) >= 0)\n\t\t{\n\t\t\t//get the table prefix\n\t\t\t$table_prefix = Kohana::config('database.default.table_prefix');\n\t\t\t\n\t\t\t//get the params\n\t\t\t$sg_id = intval($_GET['sgid']);\n\t\t\t$params = Event::$data;\n\t\t\tarray_push($params,\t'i.id IN (SELECT DISTINCT incident_id FROM '.$table_prefix.'simplegroups_groups_incident WHERE simplegroups_groups_id = '. $sg_id. ')');\n\t\t\t\n\t\t\t//figure out if we're on the backend or not, and if we're not hide private categories\n\t\t\t$only_public = (strpos(url::current(), \"admin/\") === 0) ? \"\" : \" AND sgc.category_visible = 1 \"; \n\t\t\t\n\t\t\t$category_ids = $this->_get_group_categories();\t\t\t\n\t\t\t// Check if there are any category ids\n\t\t\tif (count($category_ids) > 0)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t//what's the logical operator:\n\t\t\t\tif($this->_get_logical_operator() == \"or\")\n\t\t\t\t{\n\t\t\t\t\t//first we need to find out what the original SQL for categories looked like:\n\t\t\t\t\t$category_sql = $this->_create_default_category_sql();\n\t\t\t\t\t$i = 0;\n\t\t\t\t\t$found_it = false;\n\t\t\t\t\tforeach($params as $key=>$value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(strcmp($value, $category_sql) == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$i = $key;\n\t\t\t\t\t\t\t$found_it = true;\n\t\t\t\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\t//if we found it, lets remove it.\n\t\t\t\t\tif($found_it)\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($params[$i]);\n\t\t\t\t\t}\n\t\t\t\t\tif(strlen($category_sql) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$category_sql = ' OR ('.$category_sql.')' ;\n\t\t\t\t\t}\n\t\t\t\t\t$category_ids = implode(\",\", $category_ids);\n\t\t\t\t\tarray_push($params,\n\t\t\t\t\t\t'(i.id IN (SELECT DISTINCT incident_id FROM '.$table_prefix.'simplegroups_incident_category sgic '.\n\t\t\t\t\t\t\t'INNER JOIN '.$table_prefix.'simplegroups_category sgc ON (sgc.id = sgic.simplegroups_category_id) '.\n\t\t\t\t\t\t\t'WHERE (sgc.id IN ('. $category_ids . ') OR sgc.parent_id IN ('.$category_ids.'))'.$only_public.' ) '.$category_sql. ')');\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tforeach($category_ids as $c)\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($params,\n\t\t\t\t\t\t'i.id IN (SELECT DISTINCT incident_id FROM '.$table_prefix.'simplegroups_incident_category sgic '.\n\t\t\t\t\t\t\t'INNER JOIN '.$table_prefix.'simplegroups_category sgc ON (sgc.id = sgic.simplegroups_category_id) '.\n\t\t\t\t\t\t\t'WHERE ((sgc.id = '. $c . ') OR sgc.parent_id = (' . $c . '))'.$only_public.' ) ');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tEvent::$data = $params;\n\t\t}\n\t}", "public function setGroupBy(array $group_by): QueryModifier;", "public function groupby($field = false){\n\t \tif($field!=false){\n\t \t\t$group_by_temp = array($field);\n\t\t \tarray_push($this->groupbyQuery, $group_by_temp);\n\t\t }else{\n\t\t \t$this->groupbyQuery = false;\n\t\t }\n\t\t return $this;\n\t }", "public function group_end()\n {\n if($this->qb_where_group_count > 0) {\n // get data was cached\n $where_group = $this->qb_where_group_started[$this->qb_where_group_count];\n $type = $this->mongo_group_status[$this->qb_where_group_count][1];\n\n // restore counting of grouping\n $this->qb_where_group_count --;\n\n $this->_build_where_condition('qb_where',$where_group, $type);\n }\n\n return $this;\n }", "function cacsp_filter_query_for_bp_group( $query ) {\n\t// Only modify 'event' queries.\n\t$post_types = $query->get( 'post_type' );\n\tif ( ! in_array( 'cacsp_paper', (array) $post_types ) ) {\n\t\treturn;\n\t}\n\n\t$bp_group = $query->get( 'bp_group', null );\n\tif ( null === $bp_group ) {\n\t\treturn;\n\t}\n\n\tif ( ! is_array( $bp_group ) ) {\n\t\t$group_ids = array( $bp_group );\n\t} else {\n\t\t$group_ids = $bp_group;\n\t}\n\n\t// Empty array will always return no results.\n\tif ( empty( $group_ids ) ) {\n\t\t$query->set( 'post__in', array( 0 ) );\n\t\treturn;\n\t}\n\n\t// Convert group IDs to a tax query.\n\t$tq = $query->get( 'tax_query' );\n\t$group_terms = array();\n\tforeach ( $group_ids as $group_id ) {\n\t\t$group_terms[] = 'group_' . $group_id;\n\t}\n\n\t$tq[] = array(\n\t\t'taxonomy' => 'cacsp_paper_group',\n\t\t'terms' => $group_terms,\n\t\t'field' => 'name',\n\t\t'operator' => 'IN',\n\t);\n\n\t$query->set( 'tax_query', $tq );\n}", "public function groupBy($group) {\n if ($this->type != QUERY_SELECT)\n throw new InvalidQueryType();\n\n $this->groups[] = $group;\n\n return $this;\n }", "public function newQueryInSameGroup($excludeThis = false)\n {\n $query = $this->newQuery();\n $groupColumn = (array) $this->getGroupColumn();\n if ($groupColumn) {\n $group = [];\n foreach ($groupColumn as $column) {\n $group[] = $this->$column;\n }\n $query->inGroup($group);\n }\n if ($excludeThis) {\n $query->whereKeyNot($this->getKey());\n }\n return $query;\n }", "public function xGroup($operation, $key = null, $group = null, $id_or_consumer = null, $mkstream = false, $entries_read = -2) {}", "public function skipGroup(string $group): void;", "public function scopeInGroup($query, $group)\n {\n $groupColumn = (array) $this->getGroupColumn();\n $group = is_null($group) ? [ null ] : array_values((array) $group);\n foreach ($group as $i => $value) {\n $query->where($groupColumn[$i], $value);\n }\n }", "public function visitEnterSelectorGroup(): bool {\n $this->start($this->appendElement('selector-group'));\n return TRUE;\n }", "public function group();", "public function group();", "public function group();", "public function orNest()\n {\n return $this->nest('OR');\n }", "public function addWhere($group, $field, $value = NULL, $operator = NULL): void {\n // Ensure all variants of 0 are actually 0. Thus '', 0 and NULL are all\n // the default group.\n if (empty($group)) {\n $group = 0;\n }\n // Check for a group.\n if (!isset($this->where[$group])) {\n $this->setWhereGroup('AND', $group);\n }\n if (!empty($operator) && $operator !== 'LIKE') {\n $this->where[$group]['conditions'][] = [\n 'field' => $field,\n 'value' => $value,\n 'operator' => $operator,\n ];\n }\n }", "abstract protected function _buildGroupBy( $group );", "function query() {\n foreach ($this->query->relationships as $alias => $info) {\n if ($info['table'] == 'og_membership') {\n // If there is a og_membership table present. Add some conditions.\n $rel = $this->relationship;\n $this->query->add_where_expression(NULL, $alias . '.gid = ' . $rel . '.gid');\n $this->query->add_where_expression(NULL, $alias . '.group_type = ' . $rel . '.group_type');\n break;\n }\n }\n\n parent::query();\n }" ]
[ "0.6566082", "0.624975", "0.59300166", "0.5832302", "0.5812583", "0.5592924", "0.5578818", "0.55428797", "0.5495143", "0.54783416", "0.52757645", "0.5255907", "0.5181923", "0.51343316", "0.51010436", "0.5053335", "0.5046965", "0.502001", "0.49838457", "0.49500844", "0.49495137", "0.49297008", "0.49145147", "0.49138945", "0.49138945", "0.49138945", "0.48830053", "0.48819372", "0.48756504", "0.4871616" ]
0.6864432
0
Ends a query group
public function group_end() { if($this->qb_where_group_count > 0) { // get data was cached $where_group = $this->qb_where_group_started[$this->qb_where_group_count]; $type = $this->mongo_group_status[$this->qb_where_group_count][1]; // restore counting of grouping $this->qb_where_group_count --; $this->_build_where_condition('qb_where',$where_group, $type); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function end()\n {\n return $this->endGroup();\n }", "public function closeGroup()\n {\n $this->groupSeq = -1;\n }", "public function end();", "public function end();", "public function closeGroup();", "public function endGroup()\n {\n return $this->getParentContext();\n }", "abstract public function end();", "abstract public function end();", "function close_group()\n\t{\n\t\t$tag = array_pop($this->open_tags);\n\t\t$this->tabs = mb_substr($this->tabs, 0, -1);\n\t\t$this->doc .= $this->tabs . \"</$tag>\\n\";\n\t}", "public function close_query();", "public function end(){}", "public function endBatch()\n\t{\n\t\t$this->endElement();\n\t}", "public function end() : void;", "public function stopQuery(){}", "public function groupEnd()\n {\n $this->append(')');\n\n return $this;\n }", "public static function End()\r\n {\r\n $data = ob_get_contents();\r\n ob_end_flush();\r\n \r\n self::write(self::$group, self::$id, self::$ttl, $data);\r\n }", "public function endBatch() {\n\t}", "public function end() {\n\t}", "private function end()\n {\n }", "public function end(): void\n {\n $this->limit = '';\n unset($this->main);\n $this->order = '';\n unset($this->query);\n unset($this->table);\n $this->where = '';\n }", "function end() {\n }", "public function end(): int;", "public function end($logging_key) {\n unset($this->queryLog[$logging_key]);\n }", "public function stopQuery(): void\n {\n }", "public function addGroupQuery($value) {}", "public function end() {\n return $this->destroy($this->id());\n }", "public function finishGroup(HTML_QuickForm2_Node $group)\r\n {\r\n $this->renderElement($group);\r\n }", "public function endCurrentBatch() :void;", "public function end(): void\n {\n // nothing by default\n }", "public function endQueryCapture() {\n $queries = Database::getLog('views');\n\n $this->additionalQueries = $queries;\n }" ]
[ "0.7050051", "0.67536896", "0.6425701", "0.6425701", "0.64155537", "0.6391028", "0.6382531", "0.6382531", "0.6151538", "0.6149396", "0.6141606", "0.61039495", "0.6103316", "0.610053", "0.6059227", "0.60572267", "0.6005817", "0.59762496", "0.59204537", "0.5920222", "0.5817693", "0.5755913", "0.57441556", "0.57235855", "0.56897396", "0.5653192", "0.56063056", "0.5603506", "0.5548975", "0.5540013" ]
0.70585835
0
Admin mail template for jobseeker
function eyerecruit_jobseeker_mail_templates_callback() { ?> <div class="wrap"> <p><h3>Mail template Jobseeker Admin</h3></p> <?php if(isset($_GET['settings-updated'])){ ?> <div class="updated settings-error notice is-dismissible" id="setting-error-settings_updated"> <p> <strong>Settings saved.</strong> </p> <button class="notice-dismiss" type="button"> <span class="screen-reader-text">Dismiss this notice.</span> </button> </div> <?php } ?> <form method="post" action="options.php"> <?php settings_fields('founder_options_jobseeker'); $founder_options_jobseeker = get_option('founder_options_jobseeker'); $argss = array( 'textarea_name' => 'founder_options_jobseeker[jobseeker_mail_template]', ); $contents = isset($founder_options_jobseeker['jobseeker_mail_template']) ? $founder_options_jobseeker['jobseeker_mail_template'] : ''; ?> <table class="form-table"> <tr> <th><label for="subject">Subject</label></th> <td><textarea style="width:100%" name="founder_options_jobseeker[jobseeker_subject]" id="subject"><?php echo $founder_options_jobseeker['jobseeker_subject']; ?></textarea></td> </tr> <tr> <th><label>Admin mail Editor</label></th> <td><?php wp_editor( $contents, 'jobseeker_mail_template', $argss); ?></td> </tr> </table><?php submit_button(); ?> </form> </div> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emails($args, &$request) {\n\t\t$this->validate();\n\t\t$this->setupTemplate($request, true);\n\n\t\t$templateMgr =& TemplateManager::getManager($request);\n\t\t$templateMgr->assign('pageHierarchy', array(array($request->url(null, 'manager'), 'manager.journalManagement')));\n\t\t$templateMgr->assign('helpTopicId','journal.managementPages.emails');\n\t\t$templateMgr->display('manager/emails/emails.tpl');\n\t}", "function transport_email_admin(){\n}", "function send_admin_mail() {\n\t // mail to admin (comes with the next version)\n\t}", "function email() {\n//set the page title\n $data['title'] = 'Email';\n//set the sub view\n $data['content'] = 'backend/admin/email_inbox';\n//load email template\n $this->load->view('backend/admin/includes/email_template', $data);\n }", "function display_mailform ()\n{\n global $_CONF, $LANG31, $LANG_ADMIN, $_IMAGE_TYPE;\n\n require_once $_CONF['path_system'] . 'lib-admin.php';\n\n $retval = '';\n\n $retval .= COM_startBlock($LANG31[1], '',\n COM_getBlockTemplate('_admin_block', 'header'));\n\n $menu_arr = array(\n array('url' => $_CONF['site_admin_url'],\n 'text' => $LANG_ADMIN['admin_home'])\n );\n\n $desc = '<p>' . $LANG31[19] . '</p>';\n $icon = $_CONF['layout_url'] . '/images/icons/mail.' . $_IMAGE_TYPE;\n $retval .= ADMIN_createMenu($menu_arr, $desc, $icon);\n\n $mail_templates = new Template($_CONF['path_layout'] . 'admin/mail');\n $mail_templates->set_file(array('form' => 'mailform.thtml'));\n $mail_templates->set_var('site_url', $_CONF['site_url']);\n $mail_templates->set_var('site_admin_url', $_CONF['site_admin_url']);\n $mail_templates->set_var('layout_url', $_CONF['layout_url']);\n $mail_templates->set_var('startblock_email', COM_startBlock($LANG31[1],\n '', COM_getBlockTemplate('_admin_block', 'header')));\n $mail_templates->set_var('php_self', $_CONF['site_admin_url']\n . '/mail.php');\n $mail_templates->set_var('lang_note', $LANG31[19]);\n $mail_templates->set_var('lang_to', $LANG31[18]);\n $mail_templates->set_var('lang_selectgroup', $LANG31[25]);\n\n $thisUsersGroups = SEC_getUserGroups();\n uksort($thisUsersGroups, 'strcasecmp');\n $group_options = '';\n foreach ($thisUsersGroups as $groupName => $groupID) {\n if ($groupName != 'All Users') {\n $group_options .= '<option value=\"' . $groupID . '\">'\n . ucwords($groupName) . '</option>';\n }\n }\n\n $mail_templates->set_var('group_options', $group_options);\n $mail_templates->set_var('lang_from', $LANG31[2]);\n $mail_templates->set_var('site_name', $_CONF['site_name']);\n $mail_templates->set_var('lang_replyto', $LANG31[3]);\n $mail_templates->set_var('site_mail', $_CONF['site_mail']);\n $mail_templates->set_var('lang_subject', $LANG31[4]);\n $mail_templates->set_var('lang_body', $LANG31[5]);\n $mail_templates->set_var('lang_sendto', $LANG31[6]);\n $mail_templates->set_var('lang_allusers', $LANG31[7]);\n $mail_templates->set_var('lang_admin', $LANG31[8]);\n $mail_templates->set_var('lang_options', $LANG31[9]);\n $mail_templates->set_var('lang_HTML', $LANG31[10]);\n $mail_templates->set_var('lang_urgent', $LANG31[11]);\n $mail_templates->set_var('lang_ignoreusersettings', $LANG31[14]);\n $mail_templates->set_var('lang_send', $LANG31[12]);\n $mail_templates->set_var('end_block',\n COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer')));\n $mail_templates->set_var('xhtml', XHTML);\n $mail_templates->set_var('gltoken_name', CSRF_TOKEN);\n $mail_templates->set_var('gltoken', SEC_createToken());\n\n $mail_templates->parse('output', 'form');\n $retval .= $mail_templates->finish($mail_templates->get_var('output'));\n\n $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));\n\n return $retval;\n}", "public function email() {\r\n $this->load->view('layout/templates/email', $this->template_vars);\r\n }", "public function MailPublishToAdmin($data)\r\n\t{\r\n\t\t$mailer = $this->getConfiguredMailer();\r\n\t\t\r\n\t\t$replace = array(\r\n\t\t\t'JOB_TITLE' => $data['title'],\r\n\t\t\t'SITE_NAME' => SITE_NAME,\r\n\t\t\t'JOB_URL' => BASE_URL . URL_JOB .'/' . $data['id'] . '/' . $data['url_title'] . '/',\r\n\t\t\t'JOB_TITLE' => $data['title'],\r\n\t\t\t'JOB_COMPANY' => $data['company'],\r\n\t\t\t'JOB_DESCRIPTION' => $data['description'],\r\n\t\t\t'JOB_POSTER_EMAIL' => $data['poster_email'],\r\n\t\t\t'JOB_EDIT_URL' => BASE_URL . 'post/' . $data['id'] . '/' . $data['auth'] . '/',\r\n\t\t\t'JOB_DEACTIVATE_URL' => BASE_URL . 'deactivate/' . $data['id'] . '/' . $data['auth'] . '/',\r\n\t\t\t'JOB_POSTER_IP' => $_SERVER['REMOTE_ADDR'],\r\n\t\t\t'JOB_POST_DATE' => $data['created_on']\r\n\t\t);\r\n\t\t\r\n\t\tif ($data['postRequiresModeration'])\r\n\t\t{\r\n\t\t\t$email_data = $this->getEmailData('email_PublishToAdmin_firstPost', $replace);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$email_data = $this->getEmailData('email_PublishToAdmin', $replace);\r\n\t\t}\r\n\t\t\r\n\t\t$subject = $email_data['subject'];\r\n\t\t$msg = $email_data['message'];\r\n\t\t\r\n\t\t$mailer->SetFrom(NOTIFY_EMAIL, SITE_NAME);\r\n \t$mailer->AddAddress(NOTIFY_EMAIL);\r\n\t\t$mailer->Subject = $subject;\r\n\t\t$mailer->Body = $this->nl2br($msg);\r\n\t\t$mailer->AltBody = $msg;\r\n\t\t\r\n\t\tif ($mailer->Send())\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function ServerAdminMail( )\n\t{\n\t\t// call our conf reader\n\t\t$this->core = new ServerAdminCore;\n\t\t//var_dump($this);\n\t\t$this->setProgramsAndDefaults( 'mail' );\n\n\t\tif($vpostmail = $this->getConfig('mail', 'vpostmail'))\n\t\t{\n\t\t\t$this->vpostmail = $vpostmail;\n\t\t}\n\t\t\n\t\t$this->addProg('vpostmail', $this->vpostmail);\n\t}", "function eyerecruit_mail_templates_callback() {\n\t?>\n\t\t<div class=\"wrap\">\n\t\t\n\t\t\t<p><h3>Mail template employer Admin</h3></p> \n\t\t\t\n\t\t\t<?php \n\t\t\t\tif(isset($_GET['settings-updated'])){\n\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"updated settings-error notice is-dismissible\" id=\"setting-error-settings_updated\"> \n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong>Settings saved.</strong>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<button class=\"notice-dismiss\" type=\"button\">\n\t\t\t\t\t\t\t\t<span class=\"screen-reader-text\">Dismiss this notice.</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php \n\t\t\t\t}\n\t\t\t?>\n\n\t\t\t<form method=\"post\" action=\"options.php\">\n\n\t\t\t\t<?php \n\t\t\t\t\tsettings_fields('founder_options_employer');\n\t\t\t\t\t$founder_options_employer = get_option('founder_options_employer');\n\n\t\t\t\t\t$argss = array(\n\t\t\t\t\t\t\t'textarea_name' => 'founder_options_employer[employer_mail_template]',\n\t\t\t\t\t\t);\n\t\t\t\t\t$contents = isset($founder_options_employer['employer_mail_template']) ? $founder_options_employer['employer_mail_template'] : '';\n\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label for=\"subject\">Subject</label></th>\n\t\t\t\t\t\t\t<td><textarea style=\"width:100%\" name=\"founder_options_employer[employer_subject]\" id=\"subject\"><?php echo $founder_options_employer['employer_subject']; ?></textarea></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label>Admin mail Editor</label></th>\n\t\t\t\t\t\t\t<td><?php wp_editor( $contents, 'employer_mail_template', $argss); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table><?php \n\t\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\n\t<?php \n}", "public function formhandler_htmlmail() {\n\t\t$this->forceReturnPath = $GLOBALS['TYPO3_CONF_VARS']['SYS']['forceReturnPath'];\n\n\t\t$this->mailer = 'TYPO3 ' . TYPO3_version;\n\t}", "function bmg_mail_config_markup() {\n\t//Double check user capabilities\n\tif( !current_user_can('manage_options')) {\n\t\treturn;\n\t}\n\n\tinclude( plugin_dir_path( __FILE__ ) . './templates/admin/mail-config.php');\n}", "public function emailConfigAction()\n {\n $block = $this->getLayout()->createBlock(\n 'ddg_automation/adminhtml_dashboard_tabs_config'\n );\n $this->getResponse()->setBody($block->toHtml());\n }", "public function email_template_setting() {\r\n\t\t\t$email_template = get_option( 'cp_failure_email_template' );\r\n\t\t\t$email_template_sbj = get_option( 'cp_failure_email_subject' );\r\n\r\n\t\t\tif ( isset( $email_template_sbj ) && '' !== $email_template_sbj ) {\r\n\t\t\t\t$subject = $email_template_sbj;\r\n\t\t\t} else {\r\n\t\t\t\t/* translators: %s Product name */\r\n\t\t\t\t$subject = sprintf( __( 'Important Notification! - [SITE_NAME] - %s [MAILER_SERVICE_NAME] configuration error', 'convertpro-addon' ), CPRO_BRANDING_NAME );\r\n\t\t\t}\r\n\r\n\t\t\tif ( isset( $email_template ) && '' !== $email_template ) {\r\n\t\t\t\t$template = $email_template;\r\n\t\t\t} else {\r\n\t\t\t\t$template = 'The design <strong>[DESIGN_NAME]</strong> integrated with <strong>[MAILER_SERVICE_NAME]</strong> is not working! The following error occured when a user tried to subscribe - \\n\\n[ERROR_MESSAGE]\\n\\nPlease check <a href=\"[DESIGN_LINK]\" target=\"_blank\" rel=\"noopener\">configuration</a> settings ASAP.\\n\\n ----- \\n\\n The details of the subscriber are given below.\\n\\n [FORM_SUBMISSION_DATA] \\n\\n ----- \\n\\n [ [SITE_NAME] - [SITE_URL] ]';\r\n\t\t\t\t$template = str_replace( '\\n', \"\\n\", $template );\r\n\t\t\t}\r\n\r\n\t\t\tob_start();\r\n\t\t\t?>\r\n\t\t\t<h3 class=\"cp-gen-set-title cp-error-services-title\"><?php esc_html_e( 'Error Notification', 'convertpro-addon' ); ?></h3>\r\n\t\t\t<p>\r\n\t\t\t<?php\r\n\t\t\tesc_html_e( 'This is an email that will be sent to you every time a user subscribes through a form and some error is encountered. You can customize the email subject and body in the fields below. ', 'convertpro-addon' );\r\n\t\t\t?>\r\n\t\t\t<strong>Note:</strong>\r\n\t\t\t<?php\r\n\t\t\tesc_html_e( 'This is applicable when you integrate with some mailer service.', 'convertpro-addon' );\r\n\t\t\t?>\r\n\t\t\t</p>\r\n\t\t\t<table class=\"cp-postbox-table form-table\">\r\n\t\t\t\t<tbody>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th scope=\"row\">\r\n\t\t\t\t\t\t\t<label for=\"option-admin-menu-subject-page\"><?php esc_html_e( 'Template Subject', 'convertpro-addon' ); ?></label>\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<input type=\"text\" id=\"cp_failure_email_subject\" name=\"cp_failure_email_subject\" value=\"<?php echo esc_html( stripslashes( $subject ) ); ?>\" />\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th scope=\"row\">\r\n\t\t\t\t\t\t\t<label for=\"option-admin-menu-template-page\"><?php esc_html_e( 'Template', 'convertpro-addon' ); ?></label>\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<textarea id=\"cp_failure_email_template\" name=\"cp_failure_email_template\" rows=\"10\" cols=\"50\" ><?php echo esc_textarea( ( stripslashes( $template ) ) ); ?></textarea>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</tbody>\r\n\t\t\t</table>\r\n\t\t\t<?php\r\n\t\t\techo ob_get_clean(); //PHPCS:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\r\n\t\t}", "public function form_email()\n\t{\n\t\tif ($this->errstr)\n\t\t{\n\t\t\tFsb::$tpl->set_switch('error_handler');\n\t\t}\n\n\t\t// Liste des groupes\n\t\t$list_groups = Html::list_groups('email_groups[]', GROUP_SPECIAL|GROUP_NORMAL, $this->data['groups'], true, array(GROUP_SPECIAL_VISITOR));\n\n\t\tFsb::$tpl->set_switch('email_mass');\n\t\tFsb::$tpl->set_vars(array(\n\t\t\t'LIST_GROUPS' =>\t\t$list_groups,\n\t\t\t'VALUE_SUBJECT' =>\t\thtmlspecialchars($this->data['subject']),\n\t\t\t'VALUE_USERS' =>\t\thtmlspecialchars($this->data['users']),\n\t\t\t'VALUE_CONTENT' =>\t\thtmlspecialchars($this->data['content']),\n\t\t\t'CONTENT' =>\t\t\tHtml::make_errstr($this->errstr),\n\n\t\t\t'U_ACTION' =>\t\t\tsid('index.' . PHPEXT . '?p=general_email'),\n\t\t));\n\t}", "public function admin_email_send() {\n add_action( 'neh_cron_hook', 'neh_cron_execution' );\n }", "function job_apply_templates_callback() {\n\t?>\n\t\t<div class=\"wrap\">\n\t\t\n\t\t\t<p><h3>Job Apply Mail Template</h3></p> \n\t\t\t\n\t\t\t<?php \n\t\t\t\tif(isset($_GET['settings-updated'])){\n\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"updated settings-error notice is-dismissible\" id=\"setting-error-settings_updated\"> \n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong>Settings saved.</strong>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<button class=\"notice-dismiss\" type=\"button\">\n\t\t\t\t\t\t\t\t<span class=\"screen-reader-text\">Dismiss this notice.</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php \n\t\t\t\t}\n\t\t\t?>\n\n\t\t\t<form method=\"post\" action=\"options.php\">\n\n\t\t\t\t<?php \n\t\t\t\t\tsettings_fields('job_apply');\n\t\t\t\t\t$job_apply = get_option('job_apply');\n\n\t\t\t\t\t$argss = array(\n\t\t\t\t\t\t\t'textarea_name' => 'job_apply[job_apply_template]',\n\t\t\t\t\t\t);\n\t\t\t\t\t$contents = isset($job_apply['job_apply_template']) ? $job_apply['job_apply_template'] : '';\n\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label for=\"subject\">Subject</label></th>\n\t\t\t\t\t\t\t<td><textarea style=\"width:100%\" name=\"job_apply[job_apply_subject]\" id=\"subject\"><?php echo $job_apply['job_apply_subject']; ?></textarea></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label>Mail Editor</label></th>\n\t\t\t\t\t\t\t<td><?php wp_editor( $contents, 'job_apply_template', $argss); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table><?php \n\t\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\n\t<?php \n}", "public function indexAction() {\n\n //GET NAVIGATION\n $this->view->navigation = $navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitepageadmincontact_admin_main', array(), 'sitepageadmincontact_admin_main_mails');\n\n //GET FORM\n $this->view->form = $form = new Sitepageadmincontact_Form_Admin_Mail_Mail();\n\n //CHECK METHOD\n if ($this->getRequest()->isPost() && $form->isValid($this->_getAllParams())) {\n //GET VALUES\n $values = $form->getValues();\n\n //GET VIEW OBJECT\n $view = Zend_Registry::isRegistered('Zend_View') ? Zend_Registry::get('Zend_View') : null;\n\n //GET SITE TITLE\n $site_title = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.site.title', Engine_Api::_()->getApi('settings', 'core')->getSetting('core.general.site.title', 1));\n\n //check if Sitemailtemplates Plugin is enabled\n $sitemailtemplates = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitemailtemplates');\n\n //INITIALISE VARIABLES\n $contact_string = \"\";\n $template_header = \"\";\n $template_footer = \"\";\n if(!$sitemailtemplates) {\n //GET SITE \"Email Template Header Background Color\" COLOR\n $site_title_color = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.title.color', \"#ffffff\");\n\n //GET SITE \"Email Template Header Title Text Color\" COLOR\n $site_header_color = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.header.color', \"#79b4d4\");\n\n //GET SITE \"Email Body Outer Background\" COLOR\n $site_bg_color = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.bg.color', \"#f7f7f7\");\n\n //SET TEMPLATE HEADER\n $template_header.= \"<table width='98%' cellspacing='0' border='0'><tr><td width='100%' bgcolor='$site_bg_color' style='font-family:arial,tahoma,verdana,sans-serif;padding:40px;'><table width='620' cellspacing='0' cellpadding='0' border='0'>\";\n $template_header.= \"<tr><td style='background:\" . $site_header_color . \"; color:$site_title_color;font-weight:bold;font-family:arial,tahoma,verdana,sans-serif; padding: 4px 8px;vertical-align:middle;font-size:16px;text-align: left;' nowrap='nowrap'>\" . $site_title . \"</td></tr><tr><td valign='top' style='background-color:#fff; border-bottom: 1px solid #ccc; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-family:arial,tahoma,verdana,sans-serif; padding: 15px;padding-top:0;' colspan='2'><table width='100%'><tr><td colspan='2'>\";\n\n //SET TEMPLATE FOOTER\n $template_footer.= \"</td></tr></table></td></tr></td></table></td></tr></table>\";\n\n }\n\n $validator = new Zend_Validate_EmailAddress();\n\n //ATTACH BODY\n $contact_string .= $values['body'];\n\n //GET SET EMAIL ADDRESS OF THE ADMIN\n $emailAdmin = Engine_Api::_()->getApi('settings', 'core')->core_mail_from;\n\n //SET MESSAGESENT TO 0\n $this->view->messageSent = 0;\n\n //CHECK WHETHER THE TEST EMAIL HAS TO BE SENT\n if (!empty($values['page_contactemail_demo'])) {\n $contactAdminEmail = $values['page_contactemail_admin'];\n if (!$validator->isValid($contactAdminEmail)) {\n continue;\n }\n Engine_Api::_()->getApi('mail', 'core')->sendSystem($values['page_contactemail_admin'], 'SITEPAGEADMINCONTACT_CONTACTS_EMAIL_NOTIFICATION', array(\n 'subject' => $values['subject'],\n 'template_header' => $template_header,\n 'message' => $contact_string,\n 'template_footer' => $template_footer,\n 'site_title' => $site_title,\n 'email' => $emailAdmin,\n 'queue' => false));\n $this->view->messageSent = 1;\n $this->view->successMessge = $this->view->translate(\"Your test email has been sent successfully.\");\n } else {\n\n $manageadminsTable = Engine_Api::_()->getDbtable('manageadmins', 'sitepage');\n $manageadminsTableName = $manageadminsTable->info('name');\n $tablePage = Engine_Api::_()->getDbtable('pages', 'sitepage');\n $rName = $tablePage->info('name');\n\n $results = $tablePage->checkPage();\n if (!empty($results)) {\n if (!Engine_Api::_()->sitepage()->hasPackageEnable()) {\n if (!isset($values['packages'])) {\n $values['packages'][0] = 0;\n }\n if (empty($values['categories'][0])) {\n $values['categories'][0] = 0;\n }\n } else {\n if (!isset($values['categories'][0])) {\n $values['categories'][0] = 0;\n }\n }\n\n if (isset($values['categories']) && empty($values['categories'][0]) && isset($values['packages']) && empty($values['packages'][0]) && isset($values['status']) && empty($values['status'][0])) {\n $select = $manageadminsTable->select()->setIntegrityCheck(false)\n ->from($manageadminsTableName, array('user_id'))\n ->join($rName, $rName . '.page_id = ' . $manageadminsTableName . '.page_id', array())\n ->group($manageadminsTableName . '.user_id')\n ->order('user_id ASC');\n } else {\n $select = $manageadminsTable->select()->setIntegrityCheck(false)\n ->from($manageadminsTableName, array('user_id'))\n ->join($rName, $rName . '.page_id = ' . $manageadminsTableName . '.page_id', array())\n ->group($manageadminsTableName . '.user_id')\n ->order('user_id ASC');\n $categories_ids = $values['categories'];\n if (is_array($categories_ids) && !empty($categories_ids) && !empty($values['categories'][0])) {\n $select->where('category_id IN (?)', $categories_ids);\n }\n\n if (Engine_Api::_()->sitepage()->hasPackageEnable()) {\n $packages_ids = $values['packages'];\n if (is_array($packages_ids) && !empty($packages_ids) && !empty($values['packages'][0])) {\n $select->where('package_id IN (?)', $packages_ids);\n }\n }\n\n $status_ids = $values['status'];\n\n if (is_array($status_ids) && (in_array(\"Draft\", $status_ids) && in_array(\"Published\", $status_ids) )) {\n $select->where($rName . '.draft = ?', '0')->orWhere($rName . '.draft = ?', '1');\n } elseif (is_array($status_ids) && in_array(\"Draft\", $status_ids)) {\n $select->where($rName . '.draft = ?', '0');\n } elseif (is_array($status_ids) && in_array(\"Published\", $status_ids)) {\n $select->where($rName . '.draft = ?', '1');\n }\n\n if (is_array($status_ids) && (in_array(\"Open\", $status_ids) && in_array(\"Closed\", $status_ids) )) {\n $select->where($rName . '.closed = ?', '0')->orWhere($rName . '.closed = ?', '1');\n } elseif (is_array($status_ids) && in_array(\"Open\", $status_ids)) {\n $select->where($rName . '.closed = ?', '0');\n } elseif (is_array($status_ids) && in_array(\"Closed\", $status_ids)) {\n $select->where($rName . '.closed = ?', '1');\n }\n\n if (is_array($status_ids) && in_array(\"Featured\", $status_ids)) {\n $select->where($rName . '.featured = ?', '1');\n }\n\n if (is_array($status_ids) && in_array(\"Sponsored\", $status_ids)) {\n $select->where($rName . '.sponsored = ?', '1');\n }\n\n if (is_array($status_ids) && (in_array(\"Approved\", $status_ids) && in_array(\"DisApproved\", $status_ids) )) {\n $select->where($rName . '.approved = ?', '0')->orWhere($rName . '.approved = ?', '1');\n } elseif (is_array($status_ids) && in_array(\"Approved\", $status_ids)) {\n $select->where($rName . '.approved = ?', '1');\n } elseif (is_array($status_ids) && in_array(\"DisApproved\", $status_ids)) {\n $select->where($rName . '.approved = ?', '0');\n }\n\n if (Engine_Api::_()->sitepage()->hasPackageEnable()) {\n if (is_array($status_ids) && (in_array(\"Running\", $status_ids) && in_array(\"Expired\", $status_ids) )) {\n $select->where($rName . '.expiration_date > ?', date(\"Y-m-d H:i:s\"))->orWhere($rName . '.expiration_date < ?', date(\"Y-m-d H:i:s\"));\n } elseif (is_array($status_ids) && in_array(\"Running\", $status_ids)) {\n $select->where($rName . '.expiration_date > ?', date(\"Y-m-d H:i:s\"));\n } elseif (is_array($status_ids) && in_array(\"Expired\", $status_ids)) {\n $select->where($rName . '.expiration_date < ?', date(\"Y-m-d H:i:s\"));\n }\n }\n }\n\n foreach ($select->query()->fetchAll(Zend_Db::FETCH_COLUMN, 0) as $id) {\n\n $email = Engine_Api::_()->getItem('user', $id)->email;\n\n if (!$validator->isValid($email)) {\n continue;\n }\n if (!empty($email)) {\n Engine_Api::_()->getApi('mail', 'core')->sendSystem($email, 'SITEPAGEADMINCONTACT_CONTACTS_EMAIL_NOTIFICATION', array(\n 'subject' => $values['subject'],\n 'template_header' => $template_header,\n 'message' => $contact_string,\n 'template_footer' => $template_footer,\n 'site_title' => $site_title,\n 'email' => $emailAdmin,\n 'queue' => false));\n }\n }\n //GET ADMIN INFO\n $fromAddress = Engine_Api::_()->getApi('settings', 'core')->getSetting('core.mail.from', 'admin@' . $_SERVER['HTTP_HOST']);\n $fromName = Engine_Api::_()->getApi('settings', 'core')->getSetting('core.mail.name', 'Site Admin');\n\n //GET MAIL CORE TABLE\n $mailApi = Engine_Api::_()->getApi('mail', 'core');\n $mailComplete = $mailApi->create();\n $mailComplete\n ->addTo(Engine_Api::_()->user()->getViewer()->email)\n ->setFrom($fromAddress, $fromName)\n ->setSubject('Mailing Complete: ' . $values['subject'])\n ->setBodyHtml('Your email blast to your members has completed. Please note that, while the emails have been\n sent to the recipients\\' mail server, there may be a delay in them actually receiving the email due to\n spam filtering systems, incoming mail throttling features, and other systems beyond SocialEngine\\'s control.')\n ;\n $mailApi->send($mailComplete);\n $this->view->messageSent = 1;\n $this->view->successMessge = $this->view->translate(\"Your emails have been queued for sending.\");\n } else {\n $this->view->messageSent = 1;\n $this->view->successMessge = $this->view->translate(\"Your email can not be sent because no Pages have been created yet.\");\n }\n }\n foreach ($values as $key => $value) {\n Engine_Api::_()->getApi('settings', 'core')->setSetting($key, $value);\n }\n\t\t\t//START LANGUAGE WORK\n\t\t\tEngine_Api::_()->getApi('language', 'sitepage')->languageChanges();\n\t\t\t//END LANGUAGE WORK\n }\n }", "public function index()\n {\n EmailRM::sendEmailTrainingLoopAction(\"\" , \"d\",\"s\",\"acr.email.training_loop.index\");\n\n /* $beautymail = app()->make(\\Snowfire\\Beautymail\\Beautymail::class);\n $beautymail->send('acr.overallview.list2', [], function($message)\n {\n $message\n ->from('ACRM&[email protected]')\n ->to('[email protected]', 'Ahmad Rezae')\n ->subject('This is the test mail from online server!');\n });*/\n\n }", "function jobseeker_profile_builder_templates_callback() {\n\t?>\n\t\t<div class=\"wrap\">\n\t\t\n\t\t\t<p><h3>Jobseeker Profile Builder Template</h3></p> \n\t\t\t\n\t\t\t<?php \n\t\t\t\tif(isset($_GET['settings-updated'])){\n\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"updated settings-error notice is-dismissible\" id=\"setting-error-settings_updated\"> \n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong>Settings saved.</strong>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<button class=\"notice-dismiss\" type=\"button\">\n\t\t\t\t\t\t\t\t<span class=\"screen-reader-text\">Dismiss this notice.</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php \n\t\t\t\t}\n\t\t\t?>\n\n\t\t\t<form method=\"post\" action=\"options.php\">\n\n\t\t\t\t<?php \n\t\t\t\t\tsettings_fields('jobseeker_profile_builder');\n\t\t\t\t\t$jobseeker_profile_builder = get_option('jobseeker_profile_builder');\n\n\t\t\t\t\t$argss = array(\n\t\t\t\t\t\t\t'textarea_name' => 'jobseeker_profile_builder[jobseekerprofilebuilder_mail_template]',\n\t\t\t\t\t\t);\n\t\t\t\t\t$contents = isset($jobseeker_profile_builder['jobseekerprofilebuilder_mail_template']) ? $jobseeker_profile_builder['jobseekerprofilebuilder_mail_template'] : '';\n\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label for=\"subject\">Subject</label></th>\n\t\t\t\t\t\t\t<td><textarea style=\"width:100%\" name=\"jobseeker_profile_builder[jobseekerprofilebuilder_subject]\" id=\"subject\"><?php echo $jobseeker_profile_builder['jobseekerprofilebuilder_subject']; ?></textarea></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label>Mail Editor</label></th>\n\t\t\t\t\t\t\t<td><?php wp_editor( $contents, 'jobseekerprofilebuilder_mail_template', $argss); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table><?php \n\t\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\n\t<?php \n}", "function eyerecruit_thank_mail_templates_callback() {\n\t?>\n\t\t<div class=\"wrap\">\n\t\t\n\t\t\t<p><h3>Thank you email template for jobseeker</h3></p> \n\t\t\t\n\t\t\t<?php \n\t\t\t\tif(isset($_GET['settings-updated'])){\n\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"updated settings-error notice is-dismissible\" id=\"setting-error-settings_updated\"> \n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong>Settings saved.</strong>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<button class=\"notice-dismiss\" type=\"button\">\n\t\t\t\t\t\t\t\t<span class=\"screen-reader-text\">Dismiss this notice.</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php \n\t\t\t\t}\n\t\t\t?>\n\n\t\t\t<form method=\"post\" action=\"options.php\">\n\n\t\t\t\t<?php \n\t\t\t\t\tsettings_fields('founder_options');\n\t\t\t\t\t$founder_options = get_option('founder_options');\n\n\t\t\t\t\t$argss = array(\n\t\t\t\t\t\t\t'textarea_name' => 'founder_options[thanks_jobseeker_mail_template]',\n\t\t\t\t\t\t);\n\t\t\t\t\t$contents = isset($founder_options['thanks_jobseeker_mail_template']) ? $founder_options['thanks_jobseeker_mail_template'] : '';\n\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label for=\"subject\">Subject</label></th>\n\t\t\t\t\t\t\t<td><textarea style=\"width:100%\" name=\"founder_options[subject]\" id=\"subject\"><?php echo $founder_options['subject']; ?></textarea></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label>Activation mail Editor</label></th>\n\t\t\t\t\t\t\t<td><?php wp_editor( $contents, 'thanks_jobseeker_mail_template', $argss); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table><?php \n\t\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\n\t<?php \n}", "public function emailAction()\n {\n return $this->render('SurveyBundle:Survey:email.html.twig');\n }", "function index()\n {\n\n $this->data['temp'] = 'admin/mail/index';\n $this->load->view('admin/main', $this->data);\n }", "public function sendAction() {\n\t\t$emailid = $this->getRequest()->getParam('emailid');\n\t\t$send_mail_status = $this->getRequest()->getParam('send_mail_status');\n\t\t$cms_page_name = Mage::getStoreConfig('webfaqtab1/general/dropdown'); \n\n\t\t$admin_email = Mage::getStoreConfig('trans_email/ident_general/email');\t\t\t\t\t\t \n\t\t$custom_admin_email = Mage::getStoreConfig('webfaqtab1/general/adminmailid');\n\t\t\n\t\tif($custom_admin_email != ''){\n\t\t\t $admin_email = $custom_admin_email;\t\t\t\n\t\t}\t\t\n\t\t \t\t\t\t\n\t\tif($send_mail_status == 1){\t\t\t\n\t\t\t$url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).$cms_page_name;\n\t\t\t$emailTemplate = Mage::getModel('core/email_template')->loadDefault('faq_customer_template');\t\t\n\t\t\t$emailTemplateVariables = array();\n\t\t\t$emailTemplateVariables['url'] = $url;\n\t\t\t$emailTemplateVariables['email'] = $emailid;\t\t\n\t\t\t$processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);\n\t\t\t$mail = Mage::getModel('core/email')\n\t\t\t\t\t ->setToEmail($emailid)\n\t\t\t\t\t ->setBody($processedTemplate)\n\t\t\t\t\t ->setSubject('Website FAQ Reply')\n\t\t\t\t\t ->setFromEmail($admin_email)\n\t\t\t\t\t ->setFromName($name)\n\t\t\t\t\t ->setType('html');\t\n\t\t\ttry {\n\t\t\t\t$mail->send();\n\t\t\t} catch(Exception $error) {\n\t\t\t\tMage::getSingleton('core/session')->addError($error->getMessage());\n\t\t\t\treturn false;\n\t\t\t}\t\t\t\t\t\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t}", "function admin_approval_mail_templates_callback() {\n\t?>\n\t\t<div class=\"wrap\">\n\t\t\n\t\t\t<p><h3>Mail template Admin Approve</h3></p> \n\t\t\t\n\t\t\t<?php \n\t\t\t\tif(isset($_GET['settings-updated'])){\n\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"updated settings-error notice is-dismissible\" id=\"setting-error-settings_updated\"> \n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong>Settings saved.</strong>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<button class=\"notice-dismiss\" type=\"button\">\n\t\t\t\t\t\t\t\t<span class=\"screen-reader-text\">Dismiss this notice.</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php \n\t\t\t\t}\n\t\t\t?>\n\n\t\t\t<form method=\"post\" action=\"options.php\">\n\n\t\t\t\t<?php \n\t\t\t\t\tsettings_fields('admin_approval');\n\t\t\t\t\t$admin_approval = get_option('admin_approval');\n\n\t\t\t\t\t$argss = array(\n\t\t\t\t\t\t\t'textarea_name' => 'admin_approval[adminapprove_mail_template]',\n\t\t\t\t\t\t);\n\t\t\t\t\t$contents = isset($admin_approval['adminapprove_mail_template']) ? $admin_approval['adminapprove_mail_template'] : '';\n\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label for=\"subject\">Subject</label></th>\n\t\t\t\t\t\t\t<td><textarea style=\"width:100%\" name=\"admin_approval[adminapprove_subject]\" id=\"subject\"><?php echo $admin_approval['adminapprove_subject']; ?></textarea></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label>Admin mail Editor</label></th>\n\t\t\t\t\t\t\t<td><?php wp_editor( $contents, 'adminapprove_mail_template', $argss); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table><?php \n\t\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\n\t<?php \n}", "public function mail()\n {\n $info=setting('info');\n\n return view('auth.admin.mail',compact('info'));\n }", "function draftScheduler_manage_page() {\r\n\t\t\t$ifds_msg = $this->ifdsManagePg();\r\n\t\t\tif ( trim( $ifds_msg ) != '' ) {\r\n\t\t\t\techo '<div id=\"message\" class=\"updated fade\"><p><strong>' . $ifds_msg . '</strong></p></div>';\r\n\t\t\t}\r\n\t\t\techo '<div class=\"wrap\">';\r\n\t\t\t$this->draftScheduler_admin_page();\r\n\t\t\techo '</div>';\r\n\t\t}", "function thank_job_apply_templates_callback() {\n\t?>\n\t\t<div class=\"wrap\">\n\t\t\n\t\t\t<p><h3>Thank You Job Apply Mail Template</h3></p> \n\t\t\t\n\t\t\t<?php \n\t\t\t\tif(isset($_GET['settings-updated'])){\n\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"updated settings-error notice is-dismissible\" id=\"setting-error-settings_updated\"> \n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong>Settings saved.</strong>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<button class=\"notice-dismiss\" type=\"button\">\n\t\t\t\t\t\t\t\t<span class=\"screen-reader-text\">Dismiss this notice.</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php \n\t\t\t\t}\n\t\t\t?>\n\n\t\t\t<form method=\"post\" action=\"options.php\">\n\n\t\t\t\t<?php \n\t\t\t\t\tsettings_fields('thank_job_apply');\n\t\t\t\t\t$thank_job_apply = get_option('thank_job_apply');\n\n\t\t\t\t\t$argss = array(\n\t\t\t\t\t\t\t'textarea_name' => 'thank_job_apply[thank_job_apply_template]',\n\t\t\t\t\t\t);\n\t\t\t\t\t$contents = isset($thank_job_apply['thank_job_apply_template']) ? $thank_job_apply['thank_job_apply_template'] : '';\n\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label for=\"subject\">Subject</label></th>\n\t\t\t\t\t\t\t<td><textarea style=\"width:100%\" name=\"thank_job_apply[thank_job_apply_subject]\" id=\"subject\"><?php echo $thank_job_apply['thank_job_apply_subject']; ?></textarea></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label>Mail Editor</label></th>\n\t\t\t\t\t\t\t<td><?php wp_editor( $contents, 'thank_job_apply_template', $argss); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table><?php \n\t\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\n\t<?php \n}", "function forward_job_templates_callback() {\n\t?>\n\t\t<div class=\"wrap\">\n\t\t\n\t\t\t<p><h3>Forward Job Template</h3></p> \n\t\t\t\n\t\t\t<?php \n\t\t\t\tif(isset($_GET['settings-updated'])){\n\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"updated settings-error notice is-dismissible\" id=\"setting-error-settings_updated\"> \n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong>Settings saved.</strong>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<button class=\"notice-dismiss\" type=\"button\">\n\t\t\t\t\t\t\t\t<span class=\"screen-reader-text\">Dismiss this notice.</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php \n\t\t\t\t}\n\t\t\t?>\n\n\t\t\t<form method=\"post\" action=\"options.php\">\n\n\t\t\t\t<?php \n\t\t\t\t\tsettings_fields('forward_job');\n\t\t\t\t\t$forward_job = get_option('forward_job');\n\n\t\t\t\t\t$argss = array(\n\t\t\t\t\t\t\t'textarea_name' => 'forward_job[forward_job_template]',\n\t\t\t\t\t\t);\n\t\t\t\t\t$contents = isset($forward_job['forward_job_template']) ? $forward_job['forward_job_template'] : '';\n\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label for=\"subject\">Subject</label></th>\n\t\t\t\t\t\t\t<td><textarea style=\"width:100%\" name=\"forward_job[forward_job_subject]\" id=\"subject\"><?php echo $forward_job['forward_job_subject']; ?></textarea></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label>Mail Editor</label></th>\n\t\t\t\t\t\t\t<td><?php wp_editor( $contents, 'forward_job_template', $argss); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table><?php \n\t\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\n\t<?php \n}", "public function getTemplateName()\n\t{\n\t\treturn 'uitypes/Email.tpl';\n\t}", "function handler_email_template($handler, $email)\n\t\t{\n\t\t\treturn handler_templates_dir($handler).\"email/$email.txt\";\n\t\t}" ]
[ "0.7043339", "0.6723687", "0.65962476", "0.6582092", "0.6530167", "0.6525491", "0.6475669", "0.64214176", "0.6414994", "0.64007473", "0.6371676", "0.6325561", "0.6309629", "0.62932646", "0.6273112", "0.62021375", "0.6184952", "0.6180497", "0.61493766", "0.6142938", "0.6092093", "0.6088133", "0.60792184", "0.6060136", "0.6047833", "0.60397357", "0.60257936", "0.6011201", "0.6007442", "0.59990144" ]
0.70480824
0
Admin approve mail template for jobseeker
function admin_approval_mail_templates_callback() { ?> <div class="wrap"> <p><h3>Mail template Admin Approve</h3></p> <?php if(isset($_GET['settings-updated'])){ ?> <div class="updated settings-error notice is-dismissible" id="setting-error-settings_updated"> <p> <strong>Settings saved.</strong> </p> <button class="notice-dismiss" type="button"> <span class="screen-reader-text">Dismiss this notice.</span> </button> </div> <?php } ?> <form method="post" action="options.php"> <?php settings_fields('admin_approval'); $admin_approval = get_option('admin_approval'); $argss = array( 'textarea_name' => 'admin_approval[adminapprove_mail_template]', ); $contents = isset($admin_approval['adminapprove_mail_template']) ? $admin_approval['adminapprove_mail_template'] : ''; ?> <table class="form-table"> <tr> <th><label for="subject">Subject</label></th> <td><textarea style="width:100%" name="admin_approval[adminapprove_subject]" id="subject"><?php echo $admin_approval['adminapprove_subject']; ?></textarea></td> </tr> <tr> <th><label>Admin mail Editor</label></th> <td><?php wp_editor( $contents, 'adminapprove_mail_template', $argss); ?></td> </tr> </table><?php submit_button(); ?> </form> </div> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function approveAction()\r\n {\r\n /**\r\n * Confirming the posted id is greater than zero\r\n * if so get the id from the posted value\r\n */\r\n if ($this->getRequest()->getParam('id') > 0) {\r\n $id = $this->getRequest()->getParam('id');\r\n try {\r\n $model = Mage::getModel('customer/customer')->load($this->getRequest()->getParam('id'));\r\n $model->setCustomerstatus('1')->save();\r\n /**\r\n * send email to customer regarding approval of seller registration\r\n */\r\n $template_id = ( int )Mage::getStoreConfig('marketplace/admin_approval_seller_registration/seller_email_template_selection');\r\n /**\r\n * Get the admin email id\r\n */\r\n $adminEmailIdVal = Mage::getStoreConfig('marketplace/marketplace/admin_email_id');\r\n /**\r\n * Get the to mail id\r\n */\r\n $toMailId = Mage::getStoreConfig(\"trans_email/ident_$adminEmailIdVal/email\");\r\n /**\r\n * Get the to mail id\r\n */\r\n $toName = Mage::getStoreConfig(\"trans_email/ident_$adminEmailIdVal/name\");\r\n if ($template_id) {\r\n $emailTemplateForSeller = Mage::getModel('core/email_template')->load($template_id);\r\n } else {\r\n $emailTemplateForSeller = Mage::getModel('core/email_template')->loadDefault('marketplace_admin_approval_seller_registration_seller_email_template_selection');\r\n }\r\n /**\r\n * Get the customer information like\r\n * customer data\r\n * customer email\r\n * customer name\r\n */\r\n $customer = Mage::getModel('customer/customer')->load($id);\r\n $recipient = $customer->getEmail();\r\n $cname = $customer->getName();\r\n $emailTemplateForSeller->setSenderEmail($toMailId);\r\n $emailTemplateForSeller->setSenderName(ucwords($toName));\r\n /**\r\n * Replacing values in email template with dynamic values\r\n */\r\n $emailTemplateForSellerVariables = (array(\r\n 'cname' => ucwords($cname),\r\n 'ownername' => ucwords($toName)\r\n ));\r\n $emailTemplateForSeller->setDesignConfig(array(\r\n 'area' => 'frontend'\r\n ));\r\n $emailTemplateForSeller->getProcessedTemplate($emailTemplateForSellerVariables);\r\n /**\r\n * Sending email\r\n */\r\n $emailTemplateForSeller->send($recipient, ucwords($cname), $emailTemplateForSellerVariables);\r\n /**\r\n * end email\r\n */\r\n $noticMsg = 'Seller approved successfully.';\r\n Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('marketplace')->__($noticMsg));\r\n $this->_redirect('*/*/');\r\n } catch (Exception $e) {\r\n /**\r\n * Display Error message\r\n */\r\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n $this->_redirect('*/*/');\r\n }\r\n }\r\n\r\n $this->_redirect('*/*/');\r\n }", "function wppb_adminApproval_adminEmailContent() {\r\n\t$emailContent = '<br/>' . __( 'The \"Admin Approval\" feature was activated at the time of registration, so please remember that you need to approve this user before he/she can log in!', 'profile-builder') .\"\\r\\n\";\r\n\r\n\treturn $emailContent;\r\n}", "function eyerecruit_jobseeker_mail_templates_callback() {\n\t?>\n\t\t<div class=\"wrap\">\n\t\t\n\t\t\t<p><h3>Mail template Jobseeker Admin</h3></p> \n\t\t\t\n\t\t\t<?php \n\t\t\t\tif(isset($_GET['settings-updated'])){\n\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"updated settings-error notice is-dismissible\" id=\"setting-error-settings_updated\"> \n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong>Settings saved.</strong>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<button class=\"notice-dismiss\" type=\"button\">\n\t\t\t\t\t\t\t\t<span class=\"screen-reader-text\">Dismiss this notice.</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php \n\t\t\t\t}\n\t\t\t?>\n\n\t\t\t<form method=\"post\" action=\"options.php\">\n\n\t\t\t\t<?php \n\t\t\t\t\tsettings_fields('founder_options_jobseeker');\n\t\t\t\t\t$founder_options_jobseeker = get_option('founder_options_jobseeker');\n\n\t\t\t\t\t$argss = array(\n\t\t\t\t\t\t\t'textarea_name' => 'founder_options_jobseeker[jobseeker_mail_template]',\n\t\t\t\t\t\t);\n\t\t\t\t\t$contents = isset($founder_options_jobseeker['jobseeker_mail_template']) ? $founder_options_jobseeker['jobseeker_mail_template'] : '';\n\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label for=\"subject\">Subject</label></th>\n\t\t\t\t\t\t\t<td><textarea style=\"width:100%\" name=\"founder_options_jobseeker[jobseeker_subject]\" id=\"subject\"><?php echo $founder_options_jobseeker['jobseeker_subject']; ?></textarea></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label>Admin mail Editor</label></th>\n\t\t\t\t\t\t\t<td><?php wp_editor( $contents, 'jobseeker_mail_template', $argss); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table><?php \n\t\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\n\t<?php \n}", "function kirim_email_approve_pengajar($pengajar_id)\n{\n $pengajar = get_row_data('pengajar_model', 'retrieve', array($pengajar_id));\n $login = get_row_data('login_model', 'retrieve', array(null, null, null, null, $pengajar_id));\n\n $tabel_profil = '<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n <tr>\n <td valign=\"top\">NIP</td>\n <td>' . $pengajar['nip'] . '</td>\n </tr>\n <tr>\n <td valign=\"top\">Nama</td>\n <td>' . $pengajar['nama'] . '</td>\n </tr>\n <tr>\n <td valign=\"top\">Jenis kelamin</td>\n <td>' . $pengajar['jenis_kelamin'] . '</td>\n </tr>\n <tr>\n <td valign=\"top\">Tempat lahir</td>\n <td>' . $pengajar['tempat_lahir'] . '</td>\n </tr>\n <tr>\n <td valign=\"top\">Tgl. Lahir</td>\n <td>' . tgl_indo($pengajar['tgl_lahir']) . '</td>\n </tr>\n <tr>\n <td valign=\"top\">Alamat</td>\n <td>' . $pengajar['alamat'] . '</td>\n </tr>\n </table>';\n\n @kirim_email('email-template-approve-pengajar', $login['username'], array(\n 'nama' => $nama,\n 'nama_sekolah' => get_pengaturan('nama-sekolah', 'value'),\n 'tabel_profil' => $tabel_profil,\n 'url_login' => site_url('login')\n ));\n}", "function wppb_adminApproval_userEmailContent() {\r\n\t$emailContent = '<br/><br/>' . __( 'Before you can access your account, an administrator needs to approve it. You will be notified via email.', 'profile-builder' );\r\n\r\n\treturn $emailContent;\r\n}", "function job_apply_templates_callback() {\n\t?>\n\t\t<div class=\"wrap\">\n\t\t\n\t\t\t<p><h3>Job Apply Mail Template</h3></p> \n\t\t\t\n\t\t\t<?php \n\t\t\t\tif(isset($_GET['settings-updated'])){\n\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"updated settings-error notice is-dismissible\" id=\"setting-error-settings_updated\"> \n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong>Settings saved.</strong>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<button class=\"notice-dismiss\" type=\"button\">\n\t\t\t\t\t\t\t\t<span class=\"screen-reader-text\">Dismiss this notice.</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php \n\t\t\t\t}\n\t\t\t?>\n\n\t\t\t<form method=\"post\" action=\"options.php\">\n\n\t\t\t\t<?php \n\t\t\t\t\tsettings_fields('job_apply');\n\t\t\t\t\t$job_apply = get_option('job_apply');\n\n\t\t\t\t\t$argss = array(\n\t\t\t\t\t\t\t'textarea_name' => 'job_apply[job_apply_template]',\n\t\t\t\t\t\t);\n\t\t\t\t\t$contents = isset($job_apply['job_apply_template']) ? $job_apply['job_apply_template'] : '';\n\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label for=\"subject\">Subject</label></th>\n\t\t\t\t\t\t\t<td><textarea style=\"width:100%\" name=\"job_apply[job_apply_subject]\" id=\"subject\"><?php echo $job_apply['job_apply_subject']; ?></textarea></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label>Mail Editor</label></th>\n\t\t\t\t\t\t\t<td><?php wp_editor( $contents, 'job_apply_template', $argss); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table><?php \n\t\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\n\t<?php \n}", "function thank_job_apply_templates_callback() {\n\t?>\n\t\t<div class=\"wrap\">\n\t\t\n\t\t\t<p><h3>Thank You Job Apply Mail Template</h3></p> \n\t\t\t\n\t\t\t<?php \n\t\t\t\tif(isset($_GET['settings-updated'])){\n\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"updated settings-error notice is-dismissible\" id=\"setting-error-settings_updated\"> \n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong>Settings saved.</strong>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<button class=\"notice-dismiss\" type=\"button\">\n\t\t\t\t\t\t\t\t<span class=\"screen-reader-text\">Dismiss this notice.</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php \n\t\t\t\t}\n\t\t\t?>\n\n\t\t\t<form method=\"post\" action=\"options.php\">\n\n\t\t\t\t<?php \n\t\t\t\t\tsettings_fields('thank_job_apply');\n\t\t\t\t\t$thank_job_apply = get_option('thank_job_apply');\n\n\t\t\t\t\t$argss = array(\n\t\t\t\t\t\t\t'textarea_name' => 'thank_job_apply[thank_job_apply_template]',\n\t\t\t\t\t\t);\n\t\t\t\t\t$contents = isset($thank_job_apply['thank_job_apply_template']) ? $thank_job_apply['thank_job_apply_template'] : '';\n\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label for=\"subject\">Subject</label></th>\n\t\t\t\t\t\t\t<td><textarea style=\"width:100%\" name=\"thank_job_apply[thank_job_apply_subject]\" id=\"subject\"><?php echo $thank_job_apply['thank_job_apply_subject']; ?></textarea></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label>Mail Editor</label></th>\n\t\t\t\t\t\t\t<td><?php wp_editor( $contents, 'thank_job_apply_template', $argss); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table><?php \n\t\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\n\t<?php \n}", "function AdminApprove()\n{\n\tglobal $txt, $context, $db_prefix, $scripturl, $modSettings, $sourcedir;\n\n\trequire_once($sourcedir . '/Subs-Post.php');\n\n\t// Nothing to do?\n\tif (!isset($_POST['todoAction']))\n\t\tredirectexit('action=regcenter;sa=browse;type=' . $_REQUEST['type'] . ';sort=' . $_REQUEST['sort'] . ';start=' . $_REQUEST['start']);\n\n\t// Cycle through each checked member.\n\tforeach ($_POST['todoAction'] as $id => $email)\n\t{\n\t\t$username = $_POST['username'][$id];\n\t\tif ($_POST['todo'] == 'ok' || $_POST['todo'] == 'okemail')\n\t\t{\n\t\t\t// Approve/activate this member.\n\t\t\tdb_query(\"\n\t\t\t\tUPDATE {$db_prefix}members\n\t\t\t\tSET validation_code = '', is_activated = 1\n\t\t\t\tWHERE ID_MEMBER = $id\n\t\t\t\tLIMIT 1\", __FILE__, __LINE__);\n\n\t\t\t// Check for email.\n\t\t\tif ($_POST['todo'] == 'okemail')\n\t\t\t\tsendmail($email, $txt[700] . ' ' . $context['forum_name'],\n\t\t\t\t\t\t\"$txt[hello_guest] $username!\\n\\n\" .\n\t\t\t\t\t\t\"$txt[admin_approve_accept_desc] $txt[719] $username\\n\\n\" .\n\t\t\t\t\t\t\"$txt[701]\\n\" .\n\t\t\t\t\t\t\"$scripturl?action=profile\\n\\n\" .\n\t\t\t\t\t\t$txt[130]);\n\t\t}\n\t\telseif ($_POST['todo'] == 'reject' || $_POST['todo'] == 'rejectemail')\n\t\t{\n\t\t\trequire_once($sourcedir . '/ManageMembers.php');\n\t\t\tdeleteMembers($id);\n\n\t\t\t// Send email telling them they aren't welcome?\n\t\t\tif ($_POST['todo'] == 'rejectemail')\n\t\t\t\tsendmail($email, $txt['admin_approve_reject'],\n\t\t\t\t\t\"$username,\\n\\n\" .\n\t\t\t\t\t\"$txt[admin_approve_reject_desc]\\n\\n\" .\n\t\t\t\t\t$txt[130]);\n\t\t}\n\t\telseif ($_POST['todo'] == 'delete' || $_POST['todo'] == 'deleteemail')\n\t\t{\n\t\t\trequire_once($sourcedir . '/ManageMembers.php');\n\t\t\tdeleteMembers($id);\n\n\t\t\t// Send email telling them they aren't welcome?\n\t\t\tif ($_POST['todo'] == 'deleteemail')\n\t\t\t\tsendmail($email, $txt['admin_approve_delete'],\n\t\t\t\t\t\"$username,\\n\\n\" .\n\t\t\t\t\t\"$txt[admin_approve_delete_desc]\\n\\n\" .\n\t\t\t\t\t$txt[130]);\n\t\t}\n\t\telseif ($_POST['todo'] == 'remind')\n\t\t{\n\t\t\t$request = db_query(\"\n\t\t\t\tSELECT validation_code\n\t\t\t\tFROM {$db_prefix}members\n\t\t\t\tWHERE ID_MEMBER = $id\n\t\t\t\tLIMIT 1\", __FILE__, __LINE__);\n\t\t\tlist ($actpass) = mysql_fetch_row($request);\n\t\t\tmysql_free_result($request);\n\n\t\t\tsendmail($email, $txt['admin_approve_remind'],\n\t\t\t\t\"$username,\\n\\n\" .\n\t\t\t\t\"$txt[admin_approve_remind_desc] $context[forum_name].\\n\\n$txt[admin_approve_remind_desc2]\\n\\n\" .\n\t\t\t\t\"$scripturl?action=activate;u=$id;code=$actpass\\n\\n\" .\n\t\t\t\t$txt[130]);\n\t\t}\n\t}\n\n\t// Update the member's stats.\n\tupdateStats('member');\n\n\tredirectexit('action=regcenter;sa=browse;type=' . $_REQUEST['type'] . ';sort=' . $_REQUEST['sort'] . ';start=' . $_REQUEST['start']);\n}", "private function send_email_approve($data) {\r\n if (!empty($this->settings['approve'])) {\r\n $users = get_list_user(''.DB_PREFIX.'users.id in(' . generate_where_in($this->settings['approve']) . ')', $this->settings['approve'], 'user_email,user_name');\r\n if (empty($users)) {\r\n return;\r\n }\r\n $config = array();\r\n $subject = Pf::email_template()->get_element_subject('pf_comment_mail_template', 'approve_comment');\r\n $config['subject'] = str_replace('{sitename}', $this->settings['site_name'], $subject);\r\n $message = Pf::email_template()->get_element_body('pf_comment_mail_template', 'approve_comment');\r\n foreach ($users as $item) {\r\n $config['to'][$item['user_email']] = $item['user_name'];\r\n }\r\n $data['sitename'] = $this->settings['site_name'];\r\n foreach ($data as $key => $item) {\r\n $message = str_replace('{' . $key . '}', $item, $message);\r\n }\r\n $config['from'] = $this->settings['email'];\r\n $this->mail->send($config, $message);\r\n }\r\n }", "public function disapproveAction()\r\n {\r\n /**\r\n * Checking the posted id values is greater than 0\r\n * if so retreive the posted id value\r\n */\r\n if ($this->getRequest()->getParam('id') > 0) {\r\n $id = $this->getRequest()->getParam('id');\r\n try {\r\n $model = Mage::getModel('customer/customer')->load($this->getRequest()->getParam('id'));\r\n $model->setCustomerstatus('2')->save();\r\n /**\r\n * send email to admin regarding disapprove of seller registration\r\n */\r\n $templateId = ( int )Mage::getStoreConfig('marketplace/admin_approval_seller_registration/seller_email_template_disapprove');\r\n /**\r\n * Get the admin configuration information related mail like\r\n * admin email id\r\n * to mail id\r\n * to name\r\n */\r\n $adminEmailIdData = Mage::getStoreConfig('marketplace/marketplace/admin_email_id');\r\n $toMailId = Mage::getStoreConfig(\"trans_email/ident_$adminEmailIdData/email\");\r\n $toName = Mage::getStoreConfig(\"trans_email/ident_$adminEmailIdData/name\");\r\n /**\r\n * Check the template id has been set in admin section\r\n * if so load the template id\r\n * else load the admin approval seller registration seller email template disapprove template\r\n */\r\n if ($templateId) {\r\n $emailTemplateForSeller = Mage::getModel('core/email_template')->load($templateId);\r\n } else {\r\n $emailTemplateForSeller = Mage::getModel('core/email_template')->loadDefault('marketplace_admin_approval_seller_registration_seller_email_template_disapprove');\r\n }\r\n /**\r\n * get the customer information like\r\n * Customer data\r\n * customer name\r\n * customer email\r\n */\r\n $customer = Mage::getModel('customer/customer')->load($id);\r\n $recipient = $customer->getEmail();\r\n $cname = $customer->getName();\r\n /**\r\n * Replacing the retrieved values dynamicall in the email template\r\n */\r\n $emailTemplateForSellerVariables = (array(\r\n 'ownername' => ucwords($toName),\r\n 'cname' => ucwords($cname)\r\n ));\r\n\r\n $emailTemplateForSeller->setSenderName(ucwords($toName));\r\n $emailTemplateForSeller->setSenderEmail($toMailId);\r\n\r\n $emailTemplateForSeller->setDesignConfig(array(\r\n 'area' => 'frontend'\r\n ));\r\n $emailTemplateForSeller->getProcessedTemplate($emailTemplateForSellerVariables);\r\n /**\r\n * Send email function\r\n */\r\n $emailTemplateForSeller->send($recipient, ucwords($cname), $emailTemplateForSellerVariables);\r\n /**\r\n * end email\r\n * Display the success message on seller disapprove success\r\n */\r\n Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('marketplace')->__('Seller disapproved.'));\r\n $this->_redirect('*/*/');\r\n } catch (Exception $e) {\r\n /**\r\n * Display error message if the seller action is failure\r\n */\r\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n $this->_redirect('*/*/');\r\n }\r\n }\r\n\r\n $this->_redirect('*/*/');\r\n }", "function eyerecruit_thank_mail_templates_callback() {\n\t?>\n\t\t<div class=\"wrap\">\n\t\t\n\t\t\t<p><h3>Thank you email template for jobseeker</h3></p> \n\t\t\t\n\t\t\t<?php \n\t\t\t\tif(isset($_GET['settings-updated'])){\n\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"updated settings-error notice is-dismissible\" id=\"setting-error-settings_updated\"> \n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong>Settings saved.</strong>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<button class=\"notice-dismiss\" type=\"button\">\n\t\t\t\t\t\t\t\t<span class=\"screen-reader-text\">Dismiss this notice.</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php \n\t\t\t\t}\n\t\t\t?>\n\n\t\t\t<form method=\"post\" action=\"options.php\">\n\n\t\t\t\t<?php \n\t\t\t\t\tsettings_fields('founder_options');\n\t\t\t\t\t$founder_options = get_option('founder_options');\n\n\t\t\t\t\t$argss = array(\n\t\t\t\t\t\t\t'textarea_name' => 'founder_options[thanks_jobseeker_mail_template]',\n\t\t\t\t\t\t);\n\t\t\t\t\t$contents = isset($founder_options['thanks_jobseeker_mail_template']) ? $founder_options['thanks_jobseeker_mail_template'] : '';\n\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label for=\"subject\">Subject</label></th>\n\t\t\t\t\t\t\t<td><textarea style=\"width:100%\" name=\"founder_options[subject]\" id=\"subject\"><?php echo $founder_options['subject']; ?></textarea></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label>Activation mail Editor</label></th>\n\t\t\t\t\t\t\t<td><?php wp_editor( $contents, 'thanks_jobseeker_mail_template', $argss); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table><?php \n\t\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\n\t<?php \n}", "public function actionApproval() {\n // $model->unsetAttributes(); // clear any default values\n $model = new BbiiPost();\n if (isset(\\Yii::$app->request->get()['BbiiMessage'])) {\n $model->load(\\Yii::$app->request->get()['BbiiPost']);\n }\n // restrict filtering to unapproved posts\n $model->approved = 0;\n\n return $this->render('approval', array(\n 'model' => $model, \n ));\n }", "function classieraPendingPost( $new_status, $old_status, $post ) {\r\n if ( $new_status == 'private' ) {\r\n $author = get_userdata($post->post_author);\r\n\t\tglobal $redux_demo;\r\n\t\t$classieraEmailIMG = $redux_demo['classiera_email_header_img']['url'];\r\n\t\t$trns_new_post_posted = $redux_demo['trns_new_post_posted'];\r\n\t\t$email_subject = $trns_new_post_posted;\r\n\t\t$adminEmail = get_bloginfo('admin_email');\t\r\n\t\tob_start();\r\n\t\tinclude(TEMPLATEPATH . '/templates/email/email-header.php');\r\n\t\t?>\r\n\t\t<div class=\"classiera-email-welcome\" style=\"padding: 50px 0; background: url('<?php echo $classieraEmailIMG; ?>') repeat-x; background-size: cover;\">\r\n\t\t\t<h4 style=\"font-size:18px; color: #232323; text-align: center; font-family: 'Ubuntu', sans-serif; font-weight: normal; text-transform: uppercase;\"><?php echo $trns_new_post_posted; ?></h4>\r\n\t\t\t<span class=\"email-seprator\" style=\"width:100px; height: 2px; background: #b6d91a; margin: 0 auto; display: block;\"></span>\r\n\t\t\t<h3 style=\"font-family: 'Ubuntu', sans-serif; font-size:24px; text-align: center; text-transform: uppercase;\">\r\n\t\t\t\t<?php esc_html_e( 'Hello Admin, New Ads Posted on', 'classiera' ); ?>, <?php echo $blog_title ?>\r\n\t\t\t</h3>\r\n\t\t</div>\r\n\t\t<div class=\"classiera-email-content\" style=\"padding: 50px 0; width:600px; margin:0 auto;\">\r\n\t\t\t<p style=\"font-size: 16px; font-family: 'Lato', sans-serif; color: #6c6c6c;\">\r\n\t\t\t\t<?php esc_html_e( 'Hi', 'classiera' ); ?>, <?php echo $author->display_name ?>. <?php esc_html_e( 'Have Post New Ads', 'classiera' ); ?><strong>(<?php echo $post->post_title ?>)</strong> <?php esc_html_e( 'on', 'classiera' ); ?> <?php echo $blog_title = get_bloginfo('name'); ?>!\r\n\t\t\t</p>\r\n\t\t\t <p style=\"font-size: 16px; font-family: 'Lato', sans-serif; color: #6c6c6c;\"><?php esc_html_e( 'Please Approve or Reject this Post from WordPress Dashboard.', 'classiera' ); ?> </p>\r\n\t\t</div>\r\n\t\t<?php\r\n\t\tinclude(TEMPLATEPATH . '/templates/email/email-footer.php');\r\n\t\t$message = ob_get_contents();\r\n\t\tob_end_clean();\r\n\t\twp_mail($adminEmail, $email_subject, $message);\r\n }\r\n}", "private function approvalTask()\n {\n $this->data['pageTitle'] = \"Approval\";\n\n $this->data['forms'] = $this->resource->query()\n ->orderBy('updated_at','desc')\n ->with(['product'=>function($q){\n return $q->orderBy('id','DESC');\n },'product.approvalretailman'])->whereHas('workflow',function($q){\n return $q->where('status','=',\\SwiftWorkflowActivity::INPROGRESS,'AND')\n ->whereHas('nodes',function($q){\n return $q->where('user_id','=',0)->whereHas('permission',function($q){\n $q->where('permission_type','=',\\SwiftNodePermission::RESPONSIBLE,'AND');\n if($this->controller->currentUser->isSuperUser())\n {\n $q->whereIn('permission_name',['pr-approval-others','pr-approval-key-account','pr-approval-hospitality','pr-approval-van']);\n }\n else\n {\n $q->whereIn('permission_name',(array)array_keys($this->controller->currentUser->getMergedPermissions()));\n }\n return $q;\n });\n });\n })\n ->get();\n\n $this->data['hasForms'] = (boolean)count($this->data['forms']);\n \n $this->sortForms();\n\n return $this->controller->makeView('product-returns.tasker',$this->data);\n }", "function kirim_email_approve_siswa($siswa_id)\n{\n $retrieve_siswa = get_row_data('siswa_model', 'retrieve', array($siswa_id));\n $login = get_row_data('login_model', 'retrieve', array(null, null, null, $siswa_id));\n\n $tabel_profil = '<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n <tr>\n <td valign=\"top\">NIS</td>\n <td>' . $retrieve_siswa['nis'] . '</td>\n </tr>\n <tr>\n <td valign=\"top\">Nama</td>\n <td>' . $retrieve_siswa['nama'] . '</td>\n </tr>\n <tr>\n <td valign=\"top\">Jenis kelamin</td>\n <td>' . $retrieve_siswa['jenis_kelamin'] . '</td>\n </tr>\n <tr>\n <td valign=\"top\">Tempat lahir</td>\n <td>' . $retrieve_siswa['tempat_lahir'] . '</td>\n </tr>\n <tr>\n <td valign=\"top\">Tgl. Lahir</td>\n <td>' . tgl_indo($retrieve_siswa['tgl_lahir']) . '</td>\n </tr>\n <tr>\n <td valign=\"top\">Alamat</td>\n <td>' . $retrieve_siswa['alamat'] . '</td>\n </tr>\n </table>';\n\n @kirim_email('email-template-approve-siswa', $login['username'], array(\n 'nama' => $nama,\n 'nama_sekolah' => get_pengaturan('nama-sekolah', 'value'),\n 'tabel_profil' => $tabel_profil,\n 'url_login' => site_url('login')\n ));\n}", "function eyerecruit_mail_templates_callback() {\n\t?>\n\t\t<div class=\"wrap\">\n\t\t\n\t\t\t<p><h3>Mail template employer Admin</h3></p> \n\t\t\t\n\t\t\t<?php \n\t\t\t\tif(isset($_GET['settings-updated'])){\n\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"updated settings-error notice is-dismissible\" id=\"setting-error-settings_updated\"> \n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong>Settings saved.</strong>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<button class=\"notice-dismiss\" type=\"button\">\n\t\t\t\t\t\t\t\t<span class=\"screen-reader-text\">Dismiss this notice.</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php \n\t\t\t\t}\n\t\t\t?>\n\n\t\t\t<form method=\"post\" action=\"options.php\">\n\n\t\t\t\t<?php \n\t\t\t\t\tsettings_fields('founder_options_employer');\n\t\t\t\t\t$founder_options_employer = get_option('founder_options_employer');\n\n\t\t\t\t\t$argss = array(\n\t\t\t\t\t\t\t'textarea_name' => 'founder_options_employer[employer_mail_template]',\n\t\t\t\t\t\t);\n\t\t\t\t\t$contents = isset($founder_options_employer['employer_mail_template']) ? $founder_options_employer['employer_mail_template'] : '';\n\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label for=\"subject\">Subject</label></th>\n\t\t\t\t\t\t\t<td><textarea style=\"width:100%\" name=\"founder_options_employer[employer_subject]\" id=\"subject\"><?php echo $founder_options_employer['employer_subject']; ?></textarea></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label>Admin mail Editor</label></th>\n\t\t\t\t\t\t\t<td><?php wp_editor( $contents, 'employer_mail_template', $argss); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table><?php \n\t\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\n\t<?php \n}", "function admin_page_code()\n {\n global $wpdb;\n\n if (isset($_POST['review_form'])) {\n $review = $_POST['review'];\n $resume_id = $_POST['resume_id'];\n $user_id = $_POST['user_id'];\n $to = $_POST['email'];\n\n $result = $wpdb->update(\"{$wpdb->prefix}resume_review\", array('admin_review' => $review), array('resume_id' => $resume_id, 'user_id' => $user_id));\n\n $subject = 'Your Resume review';\n $message = 'Here is the review of your resume ' . $review;\n wp_mail($to, $subject, $message);\n }\n }", "function transport_email_admin(){\n}", "function bbp_notice_edit_user_pending_email()\n{\n}", "function email() {\n//set the page title\n $data['title'] = 'Email';\n//set the sub view\n $data['content'] = 'backend/admin/email_inbox';\n//load email template\n $this->load->view('backend/admin/includes/email_template', $data);\n }", "function emails($args, &$request) {\n\t\t$this->validate();\n\t\t$this->setupTemplate($request, true);\n\n\t\t$templateMgr =& TemplateManager::getManager($request);\n\t\t$templateMgr->assign('pageHierarchy', array(array($request->url(null, 'manager'), 'manager.journalManagement')));\n\t\t$templateMgr->assign('helpTopicId','journal.managementPages.emails');\n\t\t$templateMgr->display('manager/emails/emails.tpl');\n\t}", "function execute()\n {\n plugin::execute();\n\n /* Log view */\n if(!$this->view_logged){\n $this->view_logged = TRUE;\n new log(\"view\",\"mailqueue/\".get_class($this),$this->dn);\n }\n\n $smarty= get_smarty();\n $tmp = $this->plInfo();\n foreach($tmp['plProvidedAcls'] as $name => $desc){\n $smarty->assign($name.\"ACL\",$this->getacl($name));\n $smarty->assign($name.\"_W\",$this->acl_is_writeable($name));\n }\n $error =false;\n\n /******************\n Handle options \n ******************/\n\n $action = $server = $entry = \"\";\n $types = array( \n \"all_del\" => \"del\",\n \"all_hold\" => \"hold\",\n \"all_unhold\" => \"unhold\",\n \"all_requeue\" => \"requeue\");\n foreach($_POST as $name => $value){\n foreach($types as $type => $target){\n if(preg_match(\"/^\".$type.\"/\",$name) && $this->acl_is_writeable($target.\"All\")){\n $entry = $this->list_get_selected_items();\n $action = $target;\n break;\n }\n }\n if(!empty($action)) break;\n }\n\n $types = array(\"del\",\"hold\",\"unhold\",\"header\",\"requeue\");\n foreach($_POST as $name => $value){\n foreach($types as $type){\n if(preg_match(\"/^\".$type.\"__/\",$name) && $this->acl_is_writeable($type)){\n $action = $type;\n $server = preg_replace(\"/^\".$type.\"__[^_]*__([^_]*)$/\",\"\\\\1\",$name); \n $entry[$server][] = preg_replace(\"/^\".$type.\"__([^_]*)__.*/\",\"\\\\1\",$name); \n break;\n }\n }\n if(!empty($action)) break;\n }\n\n /* Send action for given mail id */\n if(in_array_strict($action,array(\"del\",\"hold\",\"unhold\",\"requeue\"))){\n foreach($entry as $server => $entries){\n $this->si_queue->send_queue_action($entries,$server,$action);\n }\n }\n\n\n /******************\n Display mail header\n ******************/\n\n if($action == \"header\"){\n $server = key($entry);\n $entry = $entry[$server];\n\n /* Create table which displays the header informations */\n $data = $this->si_queue->header($entry,$server);\n $data = preg_replace(\"/([^\\s]*:)/\",\"\\n\\\\1\",$data);\n $this->disp_header = $data;\n if($this->si_queue->is_error()){\n msg_dialog::display(_(\"Error\"),msgPool::siError($this->si_queue->get_error()),ERROR_DIALOG);\n $this->disp_header = FALSE;\n }\n }\n\n /* Back is posted from the header display page */\n if(isset($_POST['back'])){\n $this->disp_header = false;\n }\n\n /* If there is a header in disp_header, then display it */\n if($this->disp_header){\n $smarty->assign(\"header\",$this->disp_header);\n return ($smarty->fetch (get_template_path('header.tpl', TRUE)));\n }\n\n\n /******************\n Query mailqueues \n ******************/\n\n $entries = array();\n if($this->acl_is_readable(\"query\")){\n $within_minutes = -1;\n if($this->Time != \"nolimit\"){\n $within_minutes = 60*60*$this->Time;\n }\n\n if($this->Server == \"all\"){\n $entries = array();\n foreach($this->ServerList as $mac => $name){\n if(!tests::is_mac($mac)) continue;\n $entries = array_merge($entries,$this->si_queue->query_mailqueue($mac,$this->Search,$within_minutes));\n if($this->si_queue->is_error()){\n msg_dialog::display(_(\"Error\"),msgPool::siError($this->si_queue->get_error()),ERROR_DIALOG);\n }\n }\n }else{\n $entries = $this->si_queue->query_mailqueue($this->Server,$this->Search,$within_minutes);\n if($this->si_queue->is_error()){\n msg_dialog::display(_(\"Error\"),msgPool::siError($this->si_queue->get_error()),ERROR_DIALOG);\n }\n }\n }\n\n /* Sort entries \n */ \n $data = array();\n foreach($entries as $entry){\n $data[uniqid($entry[$this->OrderBy])] = $entry;\n }\n\n /* Sort entries by given direction \n */\n if($this->SortType == \"down\"){\n uksort($data, 'strnatcasecmp');\n }else{\n uksort($data, 'strnatcasecmp');\n $data = array_reverse($data);\n }\n\n $count = count($data);\n $entries = array_slice($data,$this->Page,$this->range);\n\n /* Add ServerName to results \n */\n foreach($entries as $key => $data){\n $entries[$key]['ServerName'] = $this->ServerList[$data['Server']];\n } \n \n /******************\n create html output \n ******************/\n\n $smarty->assign(\"query_allowed\",$this->acl_is_readable(\"query\"));\n $smarty->assign(\"all_ok\" , count($entries));\n $smarty->assign(\"entries\" , $entries);\n $smarty->assign(\"plug\" , \"?plug=\".$_GET['plug']);\n\n $smarty->assign(\"r_stats\" , $this->getStats());\n $smarty->assign(\"stats\" , array_flip($this->getStats()));\n\n $smarty->assign(\"stat\" , $this->Stat);\n $smarty->assign(\"p_server\" , set_post($this->Server));\n $smarty->assign(\"p_servers\" , set_post($this->ServerList));\n $smarty->assign(\"p_serverKeys\" , set_post(array_flip($this->ServerList)));\n $smarty->assign(\"p_time\" , $this->Time);\n $smarty->assign(\"p_times\" , $this->getTimes());\n $smarty->assign(\"p_timeKeys\" , array_flip($this->getTimes()));\n $smarty->assign(\"search_for\" , set_post($this->Search));\n $smarty->assign(\"range_selector\", range_selector($count, $this->Page, $this->range,\"EntriesPerPage\")); \n $smarty->assign(\"OrderBy\" , set_post($this->OrderBy));\n\n /* Display sort arrow */\n if($this->SortType == \"up\"){\n $smarty->assign(\"SortType\",\"<img src='images/lists/sort-up.png' alt='\"._(\"up\").\"' border='0'>\");\n }else{\n $smarty->assign(\"SortType\",\"<img src='images/lists/sort-down.png' alt='\"._(\"down\").\"' border='0'>\");\n }\n\n return ($smarty->fetch (get_template_path('contents.tpl', TRUE)));\n }", "function classieraRejectedPost( $new_status, $old_status, $post ){\r\n if ($new_status == 'rejected'){\t\t\r\n $author = get_userdata($post->post_author);\t\t\r\n\t\t$author_email = $author->user_email;\r\n\t\t$author_display = $author->user_login;\r\n\t\t$blog_title = get_bloginfo('name');\r\n\t\tglobal $redux_demo;\r\n\t\t$classieraEmailIMG = $redux_demo['classiera_email_header_img']['url'];\r\n\t\t$email_subject = esc_html__( 'Your Ad is Rejected..!', 'classiera' );\r\n\t\t$adminEmail = get_bloginfo('admin_email');\t\r\n\t\tob_start();\r\n\t\tinclude(TEMPLATEPATH . '/templates/email/email-header.php');\r\n\t\t?>\r\n\t\t<div class=\"classiera-email-welcome\" style=\"padding: 50px 0; background: url('<?php echo $classieraEmailIMG; ?>') repeat-x; background-size: cover;\">\r\n\t\t\t<h4 style=\"font-size:18px; color: #232323; text-align: center; font-family: 'Ubuntu', sans-serif; font-weight: normal; text-transform: uppercase;\"><?php echo $email_subject; ?></h4>\r\n\t\t\t<span class=\"email-seprator\" style=\"width:100px; height: 2px; background: #b6d91a; margin: 0 auto; display: block;\"></span>\r\n\t\t\t<h3 style=\"font-family: 'Ubuntu', sans-serif; font-size:24px; text-align: center; text-transform: uppercase;\">\r\n\t\t\t\t<?php esc_html_e( 'Hello', 'classiera' ); ?>, <?php echo $author_display ?>\r\n\t\t\t</h3>\r\n\t\t</div>\r\n\t\t<div class=\"classiera-email-content\" style=\"padding: 50px 0; width:600px; margin:0 auto;\">\r\n\t\t\t<p style=\"font-size: 16px; font-family: 'Lato', sans-serif; color: #6c6c6c;\">\r\n\t\t\t\t<?php esc_html_e( 'We want to inform you, your ad is rejected, which you have posts on', 'classiera' ); ?> &nbsp;<?php echo $blog_title = get_bloginfo('name'); ?>!\r\n\t\t\t</p>\r\n\t\t\t<p style=\"font-size: 16px; font-family: 'Lato', sans-serif; color: #6c6c6c;\"><?php esc_html_e( 'Please visit your Dashboard to see post status, For more information contact with website admin at this email.', 'classiera' ); ?> <a href=\"mailto:<?php echo $adminEmail; ?>\"><?php echo $adminEmail; ?></a> </p>\r\n\t\t</div>\r\n\t\t<?php\r\n\t\tinclude(TEMPLATEPATH . '/templates/email/email-footer.php');\r\n\t\t$message = ob_get_contents();\r\n\t\tob_end_clean();\t\t\r\n\t\twp_mail($author_email, $email_subject, $message);\r\n }\r\n}", "public function actionApproved()\n\t{\n $this->iostatus = 3;\n $this->_iov();\n\t}", "function forward_job_templates_callback() {\n\t?>\n\t\t<div class=\"wrap\">\n\t\t\n\t\t\t<p><h3>Forward Job Template</h3></p> \n\t\t\t\n\t\t\t<?php \n\t\t\t\tif(isset($_GET['settings-updated'])){\n\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"updated settings-error notice is-dismissible\" id=\"setting-error-settings_updated\"> \n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong>Settings saved.</strong>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<button class=\"notice-dismiss\" type=\"button\">\n\t\t\t\t\t\t\t\t<span class=\"screen-reader-text\">Dismiss this notice.</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php \n\t\t\t\t}\n\t\t\t?>\n\n\t\t\t<form method=\"post\" action=\"options.php\">\n\n\t\t\t\t<?php \n\t\t\t\t\tsettings_fields('forward_job');\n\t\t\t\t\t$forward_job = get_option('forward_job');\n\n\t\t\t\t\t$argss = array(\n\t\t\t\t\t\t\t'textarea_name' => 'forward_job[forward_job_template]',\n\t\t\t\t\t\t);\n\t\t\t\t\t$contents = isset($forward_job['forward_job_template']) ? $forward_job['forward_job_template'] : '';\n\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label for=\"subject\">Subject</label></th>\n\t\t\t\t\t\t\t<td><textarea style=\"width:100%\" name=\"forward_job[forward_job_subject]\" id=\"subject\"><?php echo $forward_job['forward_job_subject']; ?></textarea></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label>Mail Editor</label></th>\n\t\t\t\t\t\t\t<td><?php wp_editor( $contents, 'forward_job_template', $argss); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table><?php \n\t\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\n\t<?php \n}", "public function emailAction()\n {\n return $this->render('SurveyBundle:Survey:email.html.twig');\n }", "public function IndexAction() {\n\n\t\t// Instantiate the grid container\n\t\t$submittedBlock = $this->getLayout()\n\t\t\t->createBlock('bricks_incentivize_adminhtml/submitted');\n\n\t\t// Add the grid container as the item on the page, and set the active menu item and title\n\t\t$this->loadLayout()\n\t\t\t->_setActiveMenu('bricks/submitted_emails')\n\t\t\t->_title('Submitted Emails / Incentivize')\n\t\t\t->_addContent($submittedBlock)\n\t\t\t->renderLayout();\n\t}", "public function createJobPost(){\n $pageName = \"CreateJob\";\n include_once SYSTEM_PATH.'/view/header.tpl';\n include_once SYSTEM_PATH.'/view/createJobPost.tpl';\n\tinclude_once SYSTEM_PATH.'/view/footer.tpl';\n }", "public function sendAction() {\n\t\t$emailid = $this->getRequest()->getParam('emailid');\n\t\t$send_mail_status = $this->getRequest()->getParam('send_mail_status');\n\t\t$cms_page_name = Mage::getStoreConfig('webfaqtab1/general/dropdown'); \n\n\t\t$admin_email = Mage::getStoreConfig('trans_email/ident_general/email');\t\t\t\t\t\t \n\t\t$custom_admin_email = Mage::getStoreConfig('webfaqtab1/general/adminmailid');\n\t\t\n\t\tif($custom_admin_email != ''){\n\t\t\t $admin_email = $custom_admin_email;\t\t\t\n\t\t}\t\t\n\t\t \t\t\t\t\n\t\tif($send_mail_status == 1){\t\t\t\n\t\t\t$url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).$cms_page_name;\n\t\t\t$emailTemplate = Mage::getModel('core/email_template')->loadDefault('faq_customer_template');\t\t\n\t\t\t$emailTemplateVariables = array();\n\t\t\t$emailTemplateVariables['url'] = $url;\n\t\t\t$emailTemplateVariables['email'] = $emailid;\t\t\n\t\t\t$processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);\n\t\t\t$mail = Mage::getModel('core/email')\n\t\t\t\t\t ->setToEmail($emailid)\n\t\t\t\t\t ->setBody($processedTemplate)\n\t\t\t\t\t ->setSubject('Website FAQ Reply')\n\t\t\t\t\t ->setFromEmail($admin_email)\n\t\t\t\t\t ->setFromName($name)\n\t\t\t\t\t ->setType('html');\t\n\t\t\ttry {\n\t\t\t\t$mail->send();\n\t\t\t} catch(Exception $error) {\n\t\t\t\tMage::getSingleton('core/session')->addError($error->getMessage());\n\t\t\t\treturn false;\n\t\t\t}\t\t\t\t\t\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t}", "private function sendApprovalEmails()\n\t\t{\n\t\t\tforeach ($this->approvals as $approval)\n\t\t\t{\n\t\t\t\t$approval->Load();\n\t\t\t\t$approval->Save($this->id);\n\t\t\t\t$msgSuccess = $this->sendApprovalEmail($approval);\n\t\t\t}\n\t\t}" ]
[ "0.6726356", "0.67165583", "0.6669145", "0.6446035", "0.63755095", "0.63455546", "0.63172513", "0.6309945", "0.63076174", "0.6301679", "0.6285442", "0.62850296", "0.6255928", "0.62440854", "0.6194032", "0.61729735", "0.6155953", "0.6155755", "0.6142619", "0.6130804", "0.6112149", "0.60054374", "0.6000418", "0.59614176", "0.59566957", "0.59340495", "0.592656", "0.5915462", "0.5896728", "0.58781046" ]
0.7056944
0
Forward doc mail template
function forward_doc_templates_callback() { ?> <div class="wrap"> <p><h3>Forward doc Template</h3></p> <?php if(isset($_GET['settings-updated'])){ ?> <div class="updated settings-error notice is-dismissible" id="setting-error-settings_updated"> <p> <strong>Settings saved.</strong> </p> <button class="notice-dismiss" type="button"> <span class="screen-reader-text">Dismiss this notice.</span> </button> </div> <?php } ?> <form method="post" action="options.php"> <?php settings_fields('forward_doc'); $forward_doc = get_option('forward_doc'); $argss = array( 'textarea_name' => 'forward_doc[forward_doc_template]', ); $contents = isset($forward_doc['forward_doc_template']) ? $forward_doc['forward_doc_template'] : ''; ?> <table class="form-table"> <tr> <th><label for="subject">Subject</label></th> <td><textarea style="width:100%" name="forward_doc[forward_doc_subject]" id="subject"><?php echo $forward_doc['forward_doc_subject']; ?></textarea></td> </tr> <tr> <th><label>Mail Editor</label></th> <td><?php wp_editor( $contents, 'forward_doc_template', $argss); ?></td> </tr> </table><?php submit_button(); ?> </form> </div> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function template_redirect() {\r\n// global $wp_query;\r\n if ( $this->is_enewsletter_page( 'unsubscribe_page' ) ) {\r\n// $this->load_template( 'page-unsubscribe.php' );\r\n require_once( $this->plugin_dir . \"email-newsletter-files/page-unsubscribe.php\" );\r\n exit;\r\n }\r\n }", "function _template_redirect() {\n\n\t\t}", "private function makeDoc() {\n $template_path = $this->file_folder . $this->template->file_guid;\n \n $templateProcessor = new \\PhpOffice\\PhpWord\\TemplateProcessor($template_path);\n \n $fld_arr = $templateProcessor->getVariables();\n\n foreach($fld_arr as $fld)\n {\n $templateProcessor->setValue($fld, $this->getFieldValue($fld));\n }\n \n $this->file_name = $this->getFileName() . \".\" . File::extension($this->template->file_name);\n $this->file_guid = Uuid::generate(4) . \".\" . File::extension($this->template->file_name);\n\n $this->file_path = $this->file_folder . $this->file_guid;\n\n $templateProcessor->saveAs($this->file_path);\n }", "public function show(Doc $doc)\n {\n $templateProcessor = new TemplateProcessor(resource_path('asset/template1.docx'));\n\n\n $receiver = User::find($doc->receiver)->name ?? \"\";\n\n $templateProcessor->setValue('speed', $doc->speed);\n //$templateProcessor->setValue('explanation', Html::addHtml($doc->explanation));\n $templateProcessor->setValue('confidentiality', $doc->confidentiality);\n $templateProcessor->setValue('date', $doc->date);\n $templateProcessor->setValue('subject', $doc->subject);\n $templateProcessor->setValue('sender', $receiver);\n $templateProcessor->setValue('receiver', $receiver);\n\n\n\n /*TODO:\n 把 parse html地方弄好\n https://github.com/PHPOffice/PHPWord/issues/902#issuecomment-564561115\n 注意細節\n */\n $section = (new PhpWord())->addSection();\n Html::addHtml($section, $doc->explanation, false, false);\n $containers = $section->getElements();\n $templateProcessor->cloneBlock('htmlblock', count($containers), true, true);\n for($i = 0; $i < count($containers); $i++) {\n $templateProcessor->setComplexBlock('html#' . ($i+1), $containers[$i]);\n }\n\n\n //$xmlWriter = \\PhpOffice\\PhpWord\\IOFactory::createWriter($templateProcessor, 'Word2007');\n try {\n $templateProcessor->saveAs(storage_path($doc->id.'.docx'));\n } catch (Exception $e) {\n }\n\n return response()->download(storage_path($doc->id.'.docx'));\n }", "public function process()\n\t{\t\n\t\t $lstVars = phpfox::getService('emailsystem.vars')->get();\n $editor= $this->getParam('idEditor');\n if($editor == null)\n {\n $editor = \"template_content\";\n }\n $this->template()->assign(\n array(\n 'lstVars' => $lstVars,\n 'editor' =>$editor,\n )\n );\n\t}", "function bbp_get_reply_move_template()\n{\n}", "function bbp_get_reply_edit_template()\n{\n}", "function bbp_template_redirect()\n{\n}", "function bbp_get_single_reply_template()\n{\n}", "public function generate()\n\t{\n\t\tif (TL_MODE == 'BE')\n\t\t{\n\t\t\t$objTemplate = new BackendTemplate('be_wildcard');\n\n\t\t\t$objTemplate->wildcard = '### IAO MEMBER AGREEMENT LIST ###';\n\n\t\t\t$objTemplate->title = $this->headline;\n\t\t\t$objTemplate->id = $this->id;\n\t\t\t$objTemplate->link = $this->name;\n\t\t\t$objTemplate->href = 'contao/main.php?do=modules&amp;act=edit&amp;id=' . $this->id;\n\n\t\t\treturn $objTemplate->parse();\n\t\t}\n\n\t\t//wenn eine feste PDF zugewiesen wurde\n\t\tif(strlen(\\Input::get('file')) > 0 )\n\t\t{\n\n\t\t\t$objPdf = \t\\FilesModel::findByPath(\\Input::get('file'));\n\t\t\t// print_r($objPdf);\n\t\t\t// exit();\n\t\t\tif($objPdf !== null && file_exists(TL_ROOT . '/' . \\Input::get('file')))\n\t\t\t{\n\t\t\t\theader(\"Content-type: application/pdf\");\n\t\t\t\theader('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past\n\t\t\t\theader('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');\n\t \t\t\t// header('Content-Length: '.strlen(TL_ROOT . '/' . $objPdf->path));\n\t\t\t\theader('Content-Disposition: inline; filename=\"'.$objPdf->name.'\";');\n\n\t\t\t\t// The PDF source is in original.pdf\n\t\t\t\treadfile(TL_ROOT . '/' . $objPdf->path);\n\t\t\t\texit();\n\t\t }\n\t\t}\n\n // Fallback template\n\t\tif (strlen($this->fe_iao_template)) $this->strTemplate = $this->fe_iao_template;\n\n\t\t// Set the item from the auto_item parameter\n\t\tif ($GLOBALS['TL_CONFIG']['useAutoItem'] && \\Input::get('auto_item'))\n\t\t{\n\t\t\t\\Input::setGet('pid', \\Input::get('auto_item'));\n\t\t}\n\n\t\treturn parent::generate();\n\t}", "public function sendDocument(\\Doc & $doc, $keys = array())\n {\n global $action;\n \n include_once (\"FDL/sendmail.php\");\n include_once (\"FDL/Lib.Vault.php\");\n $err = '';\n if (!$doc->isAffected()) {\n return $err;\n }\n\n try {\n $this->stopIfNoRecip=true;\n $message = $this->getMailMessage($doc, $keys);\n if (!$message) {\n return \"\";\n }\n $this->stopIfNoRecip=false;\n } catch (\\Exception $e) {\n $this->stopIfNoRecip=false;\n return $e->getMessage();\n }\n $err = $message->send();\n\n $to = $message->getTo();\n $cc = $message->getCc();\n $bcc = $message->getBCC();\n $subject=$message->subject;\n $from=$message->getFrom();\n $savecopy = $this->getRawValue(\"tmail_savecopy\") == \"yes\";\n if (($err == \"\") && $savecopy) {\n createSentMessage($to, $from, $cc, $bcc, $subject, $message, $doc);\n }\n $recip = \"\";\n if ($to) {\n $recip.= sprintf(_(\"sendmailto %s\") , $to);\n }\n if ($cc) {\n $recip.= ' ' . sprintf(_(\"sendmailcc %s\") , $cc);\n }\n if ($bcc) {\n $recip.= ' ' . sprintf(_(\"sendmailbcc %s\") , $bcc);\n }\n \n if (self::NOTIFY_SENDMAIL_AUTO === $this->notifySendMail) {\n $notifySendMail = \\ApplicationParameterManager::getParameterValue('CORE', 'CORE_NOTIFY_SENDMAIL');\n if (is_null($notifySendMail)) {\n $notifySendMail = self::NOTIFY_SENDMAIL_ALWAYS;\n }\n } else {\n $notifySendMail = $this->notifySendMail;\n }\n \n if ($err == \"\") {\n $doc->addHistoryEntry(sprintf(_(\"send mail %s with template %s\") , $recip, $this->title) , HISTO_INFO, \"SENDMAIL\");\n $action->log->info(sprintf(_(\"Mail %s sent to %s\") , $subject, $recip));\n if (self::NOTIFY_SENDMAIL_ALWAYS === $notifySendMail) {\n addWarningMsg(sprintf(_(\"send mail %s\") , $recip));\n }\n } else {\n $doc->addHistoryEntry(sprintf(_(\"cannot send mail %s with template %s : %s\") , $recip, $this->title, $err) , HISTO_ERROR);\n $action->log->error(sprintf(_(\"cannot send mail %s to %s : %s\") , $subject, $recip, $err));\n if (self::NOTIFY_SENDMAIL_ALWAYS === $notifySendMail || self::NOTIFY_SENDMAIL_ERRORS_ONLY === $notifySendMail) {\n addWarningMsg(sprintf(_(\"cannot send mail %s\") , $err));\n }\n }\n return $err;\n }", "public function sendCopyTo()\n {\n $vars = $this->templateContainer->getTemplateVars();\n $this->checkInvoice($vars);\n parent::sendCopyTo();\n }", "public function actionDefault() {\n\t\t\n\t\t// create available templates list\n\t\t$templateList = $this->paperboy->getTemplates();\n \t\t\n \t\t$templateSelect = $this->form->select(array(\n \t\t\t'values' => array_keys($templateList),\n \t\t\t'aliases' => array_values($templateList),\n \t\t\t'selected' => $this->newsletterTemplateID,\n \t\t\t'optionsOnly' =>true\n \t\t));\n \t\t$this->parser->setParserVar('templateSelect', $templateSelect);\n \t\t\n \t\t// create recipients list select\n \t\t$recipientLists = $this->paperboy->getRecipientLists();\n\t\t\n\t\t$newsletterSelect = $this->form->select(array(\n\t\t\t'values' => array_keys($recipientLists),\n\t\t\t'aliases' => array_values($recipientLists),\n\t\t\t'selected' => $this->newsletterID,\n\t\t\t'optionsOnly' =>true\n\t\t));\n\t\t$this->parser->setParserVar('newsletterSelect', $newsletterSelect);\n\n\t\t// create \"to\", \"cc\", \"bcc\" recipient selects\n\t\t$newsletterListSelect = $this->form->select(array(\n\t\t\t'values' => array_keys($recipientLists),\n\t\t\t'aliases' => array_values($recipientLists),\n\t\t\t'optionsOnly' =>true\n\t\t));\n\t\t$this->parser->setParserVar('newsletterListSelect', $newsletterListSelect);\n\t\t\n\t\t// create page list\n\t\t$this->parser->setParserVar('pageSelect', $this->makePageList());\n\t\t\n\t\t// create attachments panel content\n\t\t$this->attachmentsNr = count($this->newsletterAttachments);\n\t\t$this->parser->setParserVar('attachmentsNr', $this->attachmentsNr);\n\t\t$tplAttachment = $this->parser->getTemplate($this->templatesPath . 'cmt_paperboy_attach_file.tpl');\n\t\t$tplAttachedFile = $this->parser->getTemplate($this->templatesPath . 'cmt_paperboy_attached_file.tpl');\n\t\t$contentAttachments = '';\n\t\t\n\t\t$maxAttachments = $this->applicationSettings['maxAttachments'];\n\t\t$usedAttachmentsNr = count($this->newsletterAttachments);\n\t\t$unusedAttachmentsNr = $maxAttachments - $usedAttachmentsNr;\n\t\t$attachmentNr = 1;\n\n\t\tfor ($attachmentNr = 1; $attachmentNr <= $maxAttachments; $attachmentNr++) {\n\n\t\t\t$this->parser->setParservar('attachmentNr', $attachmentNr);\n\t\t\t\n\t\t\tif (isset($this->newsletterAttachments[$attachmentNr])) {\n\t\t\t\t$this->parser->setParservar('attachedFileName', $this->newsletterAttachments[$attachmentNr]['name']);\n\t\t\t\t\n\t\t\t\t$fileSizeParams = $this->fileHandler->formatFileSize($this->newsletterAttachments[$attachmentNr]['size']);\n\t\t\t\t$this->parser->setMultipleParserVars($fileSizeParams);\n\t\t\t\t\n\t\t\t\t$contentAttachments .= $this->parser->parse($tplAttachedFile);\n\t\t\t} else {\n\t\t\t\t$this->parser->deleteParservar('attachedFilename');\n\t\t\t\t$contentAttachments .= $this->parser->parse($tplAttachment);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->parser->setParserVar('contentAttachments', $contentAttachments);\n\n\t\t// show page\n\t\t$this->showPage($this->parser->parseTemplate($this->templatesPath . 'cmt_paperboy_editmail.tpl'));\n\t}", "public function handleTemplateRedirect()\n {\n $query = WordPress::getQuery();\n $isNlPreview = false;\n\n // Check for preview or post type\n if (isset($_GET['p']) && $_GET['post_type'] == 'lbwp-nl') {\n $newsletterId = intval($_GET['p']);\n $isNlPreview = true;\n }\n\n // Check the page name to start with the lbwp-nl slug (for live single display)\n if (isset($query->query['pagename']) && Strings::startsWith($query->query['pagename'], 'lbwp-nl/')) {\n $newsletterId = WordPress::getPostIdByName($query->query_vars['name'], 'lbwp-nl');\n $isNlPreview = true;\n }\n\n if (isset($query->query['lbwp-nl'])) {\n $newsletterId = WordPress::getPostIdByName($query->query_vars['lbwp-nl'], 'lbwp-nl');\n $isNlPreview = true;\n }\n\n // If newsletter preview, show the NL and exit\n if ($isNlPreview) {\n echo $this->getPreview($newsletterId);\n exit;\n }\n }", "function main($content, $conf) {\n\t\t$this->conf = $conf;\n\t\t$this->pi_setPiVarDefaults();\n\t\t$this->pi_loadLL();\n\t\t$this->init();\n\t\t$template = $this->cObj->fileResource($this->conf['templateFile']);\n\t\t//t3lib_utility_Debug::debug($this->conf);\n\t\t\n\t\t$thisurl = \"http://\".$_SERVER['HTTP_HOST'].\"/\";\n\t\t$thanks = $this->pi_getPageLink($this->conf['pidThanks']);\n\t\t$thaturl = $thisurl . $thanks;\n\t\t\t\n\t\tif($this->piVars['submit']){\n\t\t\t$templateEmail = $this->cObj->getSubpart($template, '###EMAIL###');\n\t\t\t$templateEmailEntry = $this->cObj->getSubpart($template, '###EMAIL_ENTRY###');\n\t\t\t\n\t\t\tforeach($this->piVars as $key=>$value){\n\t\t\t\tif($key != 'submit'){\n\t\t\t\t\t$singleMark['###KEY###'] = $key;\n\t\t\t\t\t$singleMark['###VALUE###'] = $value;\n\t\t\t\t\t$emailEntry .= $this->cObj->substituteMarkerArrayCached($templateEmailEntry, $singleMark, $multiMark, array());\n\t\t\t\t}\n\t\t\t}\n\t\t\t$multiMark['###EMAIL_ENTRY###'] = $emailEntry;\n\t\t\t$emailBody = $this->cObj->substituteMarkerArrayCached($templateEmail, $singleMark, $multiMark, array());\n\t\t\t$singleMark['###NAME###'] = $this->piVars['name'];\n\t\t\t$singleMark['###EMAIL###'] = $this->piVars['email'];\n\t\t\t$emailsubject = $this->cObj->substituteMarkerArrayCached($this->conf['subject'], $singleMark, $multiMark, array());\n\t\t\t$this->sendEmail($this->conf['fromName'],$this->conf['fromEmail'],$this->conf['toName'],$this->conf['toEmail'],$emailsubject,$emailBody);\n\t\t\t$this->insertEntry($emailsubject, $emailBody);\n\t\t\tif($this->conf['sendToUser']){\n\t\t\t\t$emailBody = $this->cObj->substituteMarkerArrayCached($this->cObj->getSubpart($template, '###EMAIL_USER###'), $singleMark, $multiMark, array());\n\t\t\t\t$emailsubject = $this->cObj->substituteMarkerArrayCached($this->conf['subjectUser'], $singleMark, $multiMark, array());\n\t\t\t\t$this->sendEmail($this->conf['fromName'],$this->conf['fromEmail'],$this->conf['toName'],$this->conf['toEmail'],$emailsubject,$emailBody);\n\t\t\t}\n\t\t\tif($this->conf['pidThanks']){\n\t\t\t\t\n\t\t\t\t$GLOBALS['TSFE']->pSetup['headerData.']['98'] = 'TEXT';\n\t\t\t\t$GLOBALS['TSFE']->pSetup['headerData.']['98.']['value'] = '<script type=\"text/javascript\">top.location.href = \"'.$thaturl.'\";</script>';\n\t\t\t\treturn '';\n\t\t\t}else{\n\t\t\t\treturn $this->cObj->getSubpart($template, '###EMAIL_TENX###');\n\t\t\t}\n\t\t}\n\t\t$singleMark['###LEGAL_URL###'] = $this->pi_getPageLink($this->conf['pidLegal'],$target='',$urlParameters=array());\n\t\treturn $this->cObj->substituteMarkerArrayCached($this->cObj->getSubpart($template, '###MAIN###'), $singleMark, $multiMark, array());\n\t}", "public function template_redirect() {\n\t\tif ( bbp_is_single_topic() && !bbp_is_topic_merge() && !bbp_is_topic_edit() && !bbp_is_topic_split() ) {\n\t\t\t$file = 'ucc-single-topic.php';\n\t\t\t$file = apply_filters( 'ucc_btr_template_redirect', $file );\n\n\t\t\tif ( file_exists( trailingslashit( get_stylesheet_directory() ) . $file ) ) {\n\t\t\t\tinclude ( trailingslashit( get_stylesheet_directory() ) . $file );\n\t\t\t\texit;\n\t\t\t} elseif ( file_exists( trailingslashit( get_template_directory() ) . $file ) ) {\n\t\t\t\tinclude ( trailingslashit( get_template_directory() ) . $file );\n\t\t\t\texit;\n\t\t\t} else {\n\t\t\t\tinclude ( trailingslashit( $this->template_dir ) . $file );\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t}", "protected function content_template() {}", "public function formhandler_htmlmail() {\n\t\t$this->forceReturnPath = $GLOBALS['TYPO3_CONF_VARS']['SYS']['forceReturnPath'];\n\n\t\t$this->mailer = 'TYPO3 ' . TYPO3_version;\n\t}", "function pshb_template_redirect() {\n\t// get all feeds\n\t$feed_urls = pshb_get_feed_urls();\n\t$comment_feed_urls = pshb_get_comment_feed_urls();\n\n\t// get current url\n\t$urls = array_unique( array_merge( $feed_urls, $comment_feed_urls ) );\n\t$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\n\t// check if current url is one of the feed urls\n\tif ( in_array( $current_url, $urls ) ) {\n\t\t$hub_urls = pshb_get_pubsub_endpoints();\n\t\t// add all \"hub\" headers\n\t\tforeach ( $hub_urls as $hub_url ) {\n\t\t\theader( 'Link: <'.$hub_url.'>; rel=\"hub\"', false );\n\t\t}\n\t\t// add the \"self\" header\n\t\theader( 'Link: <'.$current_url.'>; rel=\"self\"', false );\n\t}\n}", "function handler_email_template($handler, $email)\n\t\t{\n\t\t\treturn handler_templates_dir($handler).\"email/$email.txt\";\n\t\t}", "function phone_notes_send_pdf()\n{\n\t//Email headers\n\t$current_user = wp_get_current_user();\n\t$to = $current_user->user_email;\n\t$subject = \"Phone Notes Overview\";\n\t$message = \"A generated list of your phone notes\";\n\t$headers = \"\";\n\t\n\t//Generate PDF\n\t$pdfoutput = phone_notes_dompdf_creator(phone_notes_create_html(phone_notes_get_notes()));\n\n\t//Create Temp File and store pdfoutput\n\tdate_default_timezone_set(\"Europe/Amsterdam\");\n\t$now = date(\"Y-m-d His\");\n\t$tempfile = sys_get_temp_dir().\"/Phone Notes Overview - \".$now.\".pdf\";\n\tfile_put_contents($tempfile , $pdfoutput);\n\t\n\t//Send email\n\tif (wp_mail( $to, $subject, $message, $headers, $tempfile))\n\t{\n\t\t//Delete temp file\n\t\tunlink($tempfile);\n\t\treturn true;\n\t};\n\t\n\t//Delete temp file\n\tunlink($tempfile);\n\treturn false;\n}", "public function contact()\n\t{\n\t\t$this->include_template('blog.single');\n\t}", "function templateRedirect() {\n\t\tglobal $wp_query;\n\t\t\n\t\t// init var\n\t\t$templates = array();\n\t\t\n\t\t// Get post_type and language\n\t\t$els = explode( '_t_', $wp_query->query_vars['post_type'] );\n\t\t\n\t\t// Basically single\n\t\t$slug = 'single';\n\t\t\n\t\t// Make archive if needed\n\t\tif( is_archive() )\n\t\t\t$slug = 'archive';\n\n\t\t// Make the templates\n\t\t$templates[] = $slug.'-'.$els[0].'-'.$els[1].'.php' ;\n\t\t$templates[] = $slug.'-'.$els[0].'.php' ;\n\t\t$templates[] = $slug.'.php';\n\t\t\n\t\t// Add the templates for the view\n\t\tlocate_template( $templates, true );\n\t\texit();\n\t}", "public function contacto(){\n $this->smarty->display('contacto.tpl');\n }", "function mail_message($n, $e, $subject,$template_file) {\n\n\t/*Extracts the message content from $template_file.\n\t*/\n\n\t#get template contents, and replace variables with data\n\t$email_message = file_get_contents($template_file);\n\t$email_message = str_replace(\"#NAME#\", $n, $email_message);\n\t$email_message = str_replace(\"#SUBJECT#\", $subject, $email_message);\n\t\t\n\t#construct the email headers\n\t$to = $e; \n\t$from = \"[email protected]\";\n\t$email_subject = \"CONTACT #\".time().\": \".\"Party Invitation\";\n\n\t$headers = \"From: \" . $from . \"\\r\\n\";\n\t$headers .= 'MIME-Version: 1.0' . \"\\n\"; //these headers will allow our HTML tags to be displayed in the email\n\t$headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\"; \n\n\t#now mail\n\tmail($to, $email_subject, $email_message, $headers);\n}", "public function send()\n {\n $vars = $this->templateContainer->getTemplateVars();\n $this->checkInvoice($vars);\n\n parent::send();\n }", "function emails($args, &$request) {\n\t\t$this->validate();\n\t\t$this->setupTemplate($request, true);\n\n\t\t$templateMgr =& TemplateManager::getManager($request);\n\t\t$templateMgr->assign('pageHierarchy', array(array($request->url(null, 'manager'), 'manager.journalManagement')));\n\t\t$templateMgr->assign('helpTopicId','journal.managementPages.emails');\n\t\t$templateMgr->display('manager/emails/emails.tpl');\n\t}", "public function template() {}", "function _make($filename, $data)\n{\n\textract($data); // $data arg is subbed as $data['body']; when make is called from Mail.php \n\n\t// echo \"i am here\"; exit;\n\t//it only wants to include views/$filename.php only when function make is called.\n\tob_start();\n\n\t//include template\n\n\tinclude(__DIR__.'/../../../resources/SAM_resources/views/emails/'.$filename.'.php');\n\t//get content of the file\n\t$content = ob_get_contents();\n\n\tob_end_clean();\n\n\treturn $content;\n\n}", "public function sendTemplate()\n\t{\n\t\t$_ENV['APP_PRESENTER_SEND_TEMPLATE_BEGIN'] = microtime(TRUE);\n\n\t\ttry {\n\t\t\tparent::sendTemplate();\n\n\t\t} finally {\n\t\t\t$_ENV['APP_PRESENTER_SEND_TEMPLATE_END'] = microtime(TRUE);\n\t\t}\n\t}" ]
[ "0.6243398", "0.60992146", "0.60750157", "0.6017103", "0.5977295", "0.5918413", "0.5875425", "0.5872749", "0.5731921", "0.5711577", "0.5705109", "0.56866986", "0.56639457", "0.5646311", "0.5633369", "0.5609408", "0.55957687", "0.55530065", "0.5545997", "0.55032897", "0.5498591", "0.5495157", "0.5468061", "0.5447606", "0.5443348", "0.54425055", "0.5435697", "0.5430183", "0.54151213", "0.5390892" ]
0.62407964
1