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
Get the standard rate.
public function getStandardRate() { $period = $this->getCurrentPeriod(); return ($period ? $period->getStandardRate() : null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRate(): float\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getBaseRate()\n { \n\n return $this->_price;\n }", "public function get()\n {\n $qry = \"select option_value from wp_options where option_name = 'nreai_rate'\";\n $results = $this->wpdb->get_results($qry);\n if (empty($results)) {\n\t\t\t//sets default value to 1.5%:\n $val = .015 * 100;\n\t\t\treturn $val;\n } else {\n\t\t\t//returns converted saved rate:\n return $results[0]->option_value * 100;\n }\n //print_r($results);exit;\n }", "public function getMaxRate()\n {\n return 0;\n }", "public function getStandardPricing() {\n return $this->standard_pricing;\n }", "public function getCalculationRate()\n {\n return $this->calculationRate;\n }", "public function getCurrencyRate()\n {\n return $this->currencyRate;\n }", "public function getSourceCurrencyBaseRate()\n {\n return $this->sourceCurrencyBaseRate;\n }", "public function getSuperReducedRate()\n {\n $period = $this->getCurrentPeriod();\n\n return ($period ? $period->getSuperReducedRate() : null);\n }", "public function getMinRate()\n {\n return 0;\n }", "public function getRentalRate()\n {\n return $this->rentalRate;\n }", "public function getStandardPrice()\n {\n return $this->_getTotalPriceElement(substr(__FUNCTION__, 3));\n }", "public function getCurrentRate()\n {\n return $this->currentRate()->orderBy('id', 'desc')->first();\n }", "public function rates()\n {\n return $this->_rates;\n }", "public function getFieldPriceRate()\n {\n return $this->fieldPriceRate;\n }", "public function getPercentageRate()\n {\n return 0;\n }", "public function getRates()\n {\n return $this->_rates;\n }", "public function getFormattedRate()\n {\n if(!is_null($this->attributes['rate']) && !empty($this->attributes['rate']))\n {\n return '$' . $this->attributes['rate'];\n }\n return DEFAULT_PRICE_TEXT;\n }", "public function getWeightRate()\n {\n return 0;\n }", "public function getRates()\n {\n return $this->rates;\n }", "public function getRates()\n {\n return $this->rates;\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 getConversionRate()\n {\n return isset($this->conversion_rate) ? $this->conversion_rate : 0.0;\n }", "public function getTargetCurrencyBaseRate()\n {\n return $this->targetCurrencyBaseRate;\n }", "public function getRate($currency);", "public static function getRates()\n {\n //Reference: ReadTheDocs, link: https://guzzle.readthedocs.io/en/latest/\n //$client = new \\GuzzleHttp\\Client();\n //$res = $client->request('GET','http://data.fixer.io/api/latest?access_key=afd6c48270d18d80d6740d5fc77c4b1c&format=1');\n //$body = json_decode($res->getBody()->getContents());\n //$uzs = round(($body->rates->UZS)/($body->rates->USD),2);\n $uzs = 8450.0;\n return $uzs;\n }", "public function get_conversion_rate() {\n\t\treturn $this->total > 0 ? round( ( $this->converted / $this->total ) * 100, 2 ) : 0;\n\t}", "protected function getExchangeRate()\r\n\t{\r\n\t\treturn $this->exchangeRate;\r\n\t}" ]
[ "0.78396255", "0.77859116", "0.7726386", "0.74769926", "0.7177523", "0.71543825", "0.71534485", "0.7115889", "0.7012228", "0.70097613", "0.69916946", "0.6970512", "0.69363874", "0.6921358", "0.682697", "0.6788286", "0.67460966", "0.6714408", "0.6702351", "0.66865706", "0.66834676", "0.66829747", "0.66829747", "0.66595876", "0.6655904", "0.6646788", "0.6594385", "0.65679824", "0.65672016", "0.6561949" ]
0.85741246
0
Get the parking rate.
public function getParkingRate() { $period = $this->getCurrentPeriod(); return ($period ? $period->getParkingRate() : null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCurrentParkingPrice(){\n\t\treturn($this->qrticketsDAO->getCurrentParkingPrice());\n\t}", "public function getRate(): float\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getBaseRate()\n { \n\n return $this->_price;\n }", "public function getCurrencyRate()\n {\n return $this->currencyRate;\n }", "public function getFieldPriceRate()\n {\n return $this->fieldPriceRate;\n }", "public function getCalculationRate()\n {\n return $this->calculationRate;\n }", "public function getRentalRate()\n {\n return $this->rentalRate;\n }", "protected function getExchangeRate()\r\n\t{\r\n\t\treturn $this->exchangeRate;\r\n\t}", "public function getPreferentialPrice()\n {\n return $this->preferential_price;\n }", "public function getValuePerServing(): float\n {\n return $this->_valuePerServing;\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}", "public function getPerItemRate()\n {\n return 0;\n }", "public function getRate($currencyCode);", "public function getPrice()\n {\n return $this->transaction->getAttribute('amount') / config('payment.base');\n }", "public function getRate($currency);", "public function getConsumptionPerKilometer()\n {\n return $this->consumptionPerKilometer;\n }", "public function getKmPrice() {\n return $this->get(self::KM_PRICE);\n }", "public function getCurrentRate()\n {\n return $this->currentRate()->orderBy('id', 'desc')->first();\n }", "private function lookupShippingRate()\n {\n return 8.90;\n }", "public function getPercentageRate()\n {\n return 0;\n }", "public function getCurrencyRate()\n {\n $rate = $this->_getData('currency_rate');\n if ($rate === null) {\n $rate = $this->_storeManager->getStore($this->getStoreId())\n ->getCurrentCurrencyRate();\n }\n if (!$rate) {\n $rate = 1;\n }\n\n return $rate;\n }", "public function getPaymentPrice()\n {\n return $this->paymentPrice;\n }", "public function cost()\n {\n $cin_date = new \\DateTime($this->check_in);\n $cout_date = new \\DateTime($this->check_out);\n $diff = $cin_date->diff($cout_date);\n\n //multiply p/pn by about of days spent. \n return $this->room->price_per_night * (int)$diff->days;\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 getPricePerUnit()\r\n\t{\r\n\t\treturn $this->pricePerUnit;\r\n\t}", "public function get()\n {\n $qry = \"select option_value from wp_options where option_name = 'nreai_rate'\";\n $results = $this->wpdb->get_results($qry);\n if (empty($results)) {\n\t\t\t//sets default value to 1.5%:\n $val = .015 * 100;\n\t\t\treturn $val;\n } else {\n\t\t\t//returns converted saved rate:\n return $results[0]->option_value * 100;\n }\n //print_r($results);exit;\n }", "public function getPacing()\n {\n return $this->pacing;\n }", "public function _get__price() {\n return $this->getprice();\n }" ]
[ "0.7429479", "0.71393514", "0.6954472", "0.68682826", "0.681269", "0.6775928", "0.67234564", "0.6675538", "0.64788795", "0.6413758", "0.63850313", "0.6370517", "0.636863", "0.63138336", "0.6311756", "0.62935513", "0.6285803", "0.6282756", "0.6236652", "0.6232574", "0.6228537", "0.61881006", "0.61787593", "0.6131038", "0.60866386", "0.6048875", "0.6045574", "0.5999605", "0.5994525", "0.59730375" ]
0.83711094
0
$ANTLR end "T__9" $ANTLR start "ID"
function mID(){ try { $_type = PolyLexer::$ID; $_channel = PolyLexer::$DEFAULT_TOKEN_CHANNEL; // Poly.g:21:4: ( ( 'a' .. 'z' )+ ) // Poly.g:21:6: ( 'a' .. 'z' )+ { // Poly.g:21:6: ( 'a' .. 'z' )+ $cnt1=0; //loop1: do { $alt1=2; $LA1_0 = $this->input->LA(1); if ( (($LA1_0>=$this->getToken('97') && $LA1_0<=$this->getToken('122'))) ) { $alt1=1; } switch ($alt1) { case 1 : // Poly.g:21:6: 'a' .. 'z' { $this->matchRange(97,122); } break; default : if ( $cnt1 >= 1 ) break 2;//loop1; $eee = new EarlyExitException(1, $this->input); throw $eee; } $cnt1++; } while (true); } $this->state->type = $_type; $this->state->channel = $_channel; } catch(Exception $e){ throw $e; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mID(){\n try {\n $_type = GroupLexer::T_ID;\n $_channel = GroupLexer::DEFAULT_TOKEN_CHANNEL;\n // ./src/php/Antlr/StringTemplate/Language/Group.g\n // ./src/php/Antlr/StringTemplate/Language/Group.g\n {\n if ( ($this->input->LA(1)>=$this->getToken('65') && $this->input->LA(1)<=$this->getToken('90'))||$this->input->LA(1)==$this->getToken('95')||($this->input->LA(1)>=$this->getToken('97') && $this->input->LA(1)<=$this->getToken('122')) ) {\n $this->input->consume();\n\n } else {\n $mse = new MismatchedSetException(null,$this->input);\n $this->recover($mse);\n throw $mse;}\n\n // ./src/php/Antlr/StringTemplate/Language/Group.g\n //loop1:\n do {\n $alt1=2;\n $LA1_0 = $this->input->LA(1);\n\n if ( ($LA1_0==$this->getToken('45')||($LA1_0>=$this->getToken('48') && $LA1_0<=$this->getToken('57'))||($LA1_0>=$this->getToken('65') && $LA1_0<=$this->getToken('90'))||$LA1_0==$this->getToken('95')||($LA1_0>=$this->getToken('97') && $LA1_0<=$this->getToken('122'))) ) {\n $alt1=1;\n }\n\n\n switch ($alt1) {\n \tcase 1 :\n \t // ./src/php/Antlr/StringTemplate/Language/Group.g\n \t {\n \t if ( $this->input->LA(1)==$this->getToken('45')||($this->input->LA(1)>=$this->getToken('48') && $this->input->LA(1)<=$this->getToken('57'))||($this->input->LA(1)>=$this->getToken('65') && $this->input->LA(1)<=$this->getToken('90'))||$this->input->LA(1)==$this->getToken('95')||($this->input->LA(1)>=$this->getToken('97') && $this->input->LA(1)<=$this->getToken('122')) ) {\n \t $this->input->consume();\n\n \t } else {\n \t $mse = new MismatchedSetException(null,$this->input);\n \t $this->recover($mse);\n \t throw $mse;}\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop1;\n }\n } while (true);\n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "function mID(){\n try {\n $_type = t018llstarLexer::T_ID;\n $_channel = t018llstarLexer::DEFAULT_TOKEN_CHANNEL;\n // runtime/Php/test/Antlr/Tests/grammers/t018llstar.g\n // runtime/Php/test/Antlr/Tests/grammers/t018llstar.g\n {\n if ( ($this->input->LA(1)>=$this->getToken('65') && $this->input->LA(1)<=$this->getToken('90'))||$this->input->LA(1)==$this->getToken('95')||($this->input->LA(1)>=$this->getToken('97') && $this->input->LA(1)<=$this->getToken('122')) ) {\n $this->input->consume();\n\n } else {\n $mse = new MismatchedSetException(null,$this->input);\n $this->recover($mse);\n throw $mse;}\n\n // runtime/Php/test/Antlr/Tests/grammers/t018llstar.g\n //loop1:\n do {\n $alt1=2;\n $LA1_0 = $this->input->LA(1);\n\n if ( (($LA1_0>=$this->getToken('48') && $LA1_0<=$this->getToken('57'))||($LA1_0>=$this->getToken('65') && $LA1_0<=$this->getToken('90'))||$LA1_0==$this->getToken('95')||($LA1_0>=$this->getToken('97') && $LA1_0<=$this->getToken('122'))) ) {\n $alt1=1;\n }\n\n\n switch ($alt1) {\n \tcase 1 :\n \t // runtime/Php/test/Antlr/Tests/grammers/t018llstar.g\n \t {\n \t if ( ($this->input->LA(1)>=$this->getToken('48') && $this->input->LA(1)<=$this->getToken('57'))||($this->input->LA(1)>=$this->getToken('65') && $this->input->LA(1)<=$this->getToken('90'))||$this->input->LA(1)==$this->getToken('95')||($this->input->LA(1)>=$this->getToken('97') && $this->input->LA(1)<=$this->getToken('122')) ) {\n \t $this->input->consume();\n\n \t } else {\n \t $mse = new MismatchedSetException(null,$this->input);\n \t $this->recover($mse);\n \t throw $mse;}\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop1;\n }\n } while (true);\n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function ID();", "public function ID();", "private function parse_id_class()\n\t{\n\t\tpreg_match_all('/\\.([^# \\{\\.]+)/', $this->matched_tag, $m);\n\t\t$this->add_attr('class', @$m[1]);\n\t\tpreg_match_all('/#([^\\. \\{\\#]+)/', $this->matched_tag, $m);\n\t\t$this->add_attr('id', @$m[1]);\n\t}", "public function getIdentifier(): string|int;", "public function identifier();", "public function identifier();", "function id(): int;", "public function getIdentifier(): string\n {\n return 'id';\n }", "protected function getIDPattern() {\n return '\\d+';\n }", "public function ID(): string;", "abstract public function getID();", "public function quoteIdentifier($id);", "protected function scanId()\n {\n return $this->scanInput('/^#([\\w\\-]+)/', 'id');\n }", "public abstract function getIdentifier();", "abstract public function get_identifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "abstract public function identifier(): string;" ]
[ "0.6286385", "0.6225354", "0.536857", "0.536857", "0.5298297", "0.52973294", "0.526191", "0.526191", "0.5200615", "0.51396006", "0.5123275", "0.509923", "0.50852865", "0.50758064", "0.503564", "0.50328374", "0.5031795", "0.4942244", "0.4942244", "0.4942244", "0.4942244", "0.4942244", "0.4942244", "0.4942244", "0.4942244", "0.4942244", "0.4942244", "0.4942244", "0.4942244", "0.491896" ]
0.647083
0
Is valid if the given value is a valid "locale identifier".
protected function isValid($value) { if (!preg_match(Locale::PATTERN_MATCH_LOCALEIDENTIFIER, $value)) { $this->addError('Value is no valid I18n locale identifier.', 1327090892); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static final function isValidLocaleCode($code = '') {\n\t\treturn (boolean) ((preg_match('(^([a-zA-Z]{2})((_|-)[a-zA-Z]{2})?$)', $code) > 0) ? TRUE : FALSE);\n\t}", "function has_valid_name_format($value)\n{\n $regex = \"/^([a-zA-Z' ]+)$/\";\n return has_format_matching($value, $regex);\n}", "public static function isLocale($parameter) {\r\n\r\n\t\treturn self::isMatchRegex($parameter, \"/^[a-z]{2,4}_[A-Z]{2,3}$/\", \"Locale\")\r\n\t\t\t&& !self::isEmpty($parameter);\r\n\t}", "static function validateLanguageCode( $code ) {\n\t\tglobal $wmincLangCodeLength;\n\t\tif( strlen( $code ) > $wmincLangCodeLength ) { return false; }\n\t\tif( $code == 'be-x-old' ) { return true; } // one exception...\n\t\treturn (bool) preg_match( '/^[a-z][a-z][a-z]?(-[a-z]+)?$/', $code );\n\t}", "function validaAlfaNum ($Cad) {\n // prueba si la entrada es una cadena alfanumerica\n return preg_match(\"/^[a-zñÑ0-9]*$/i\", $Cad );\n}", "private function loginradius_is_valid_guid($value){\n\treturn preg_match('/^\\{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\\}?$/i', $value);\n}", "private function checkIdNumberFormat($id_number)\n {\n return (preg_match('/(^[A-Z][0-9]{9})/u', $id_number) === 1) ? true : false;\n }", "public function is_valid_id($id){\n\t\treturn (boolean) preg_match('/^[A-z0-9]+$/', $id);\n\t}", "function has_valid_phone_format($value) {\n if(preg_match(\"/^([0-9]{3}|\\([0-9]{3}\\))(-|\\s*)[0-9]{3}(-|\\s*)[0-9]{4}$/\", $value))\n return true;\n else\n return false;\n }", "abstract protected function assertValidLocale($locale);", "public function validateValue($value);", "function has_valid_username_format($value){\n if(preg_match(\"/^[A-Za-z0-9\\_]+$/\", $value))\n return true;\n else\n return false;\n }", "function isValidTagIdentifier ($name) {\r\n\t\treturn preg_match(\"/^[A-Za-z0-9_-]+$/\", $name);// ajout de : / debut et fin\r\n }", "private function validate_udsId($value) {\n if (ctype_xdigit($value) && hexdec($value) <= hexdec('0x10000')) {\n return true;\n } else {\n return false;\n }\n }", "public function isValid($value) {\n $value = htmlspecialchars($value);\n $value = str_replace(array(\"-\",\"_\"), \"\", $value);\n\n if (ctype_alnum($value)) {\n return true;\n }\n\n if (ctype_alpha($value)) {\n return true;\n }\n\n return false;\n }", "function validateName($name)\n\t{\n\t\treturn preg_match('/^\\pL+$/u', $name);\n\t}", "function validateID($id) {\n return ( is_numeric ( $id ) );\n }", "public function validCurrencyCode($value)\n {\n if($value==\"\")\n return true;\n\n if(!preg_match('/^[A-Z]{3}$/', $value)){\n $this->form_validation->set_message('validCurrencyCode', _l(\"The {field} has not contain valid currency code.\", $this));\n return false;\n }\n\n return true;\n }", "function validate_pno_nl($dob) {\n //NL has same Pno format like Germany\n return validate_pno_de($dob);\n}", "public function validateAlpha($attribute, $value) {\n return preg_match('/^[\\pL]+$/u', $value);\n }", "function validaAlfa ($Cad) {\n // prueba si la entrada son cadenas alfabeticas\n return preg_match(\"/^[a-zñÑáéíóúÁÉÍÓÚ]*$/i\", $Cad );\n}", "public function validateValue($value)\n\t{\n\t\tif(is_string($value) && $this->validateIDN)\n\t\t\t$value=$this->encodeIDN($value);\n\t\t// make sure string length is limited to avoid DOS attacks\n\t\t$valid=is_string($value) && strlen($value)<=254 && (preg_match($this->pattern,$value) || $this->allowName && preg_match($this->fullPattern,$value));\n\t\tif($valid)\n\t\t\t$domain=rtrim(substr($value,strpos($value,'@')+1),'>');\n\t\tif($valid && $this->checkMX && function_exists('checkdnsrr'))\n\t\t\t$valid=checkdnsrr($domain,'MX');\n\t\tif($valid && $this->checkPort && function_exists('fsockopen') && function_exists('dns_get_record'))\n\t\t\t$valid=$this->checkMxPorts($domain);\n\t\treturn $valid;\n\t}", "public function isValid($value)\n {\n $result = (preg_match($this->guidPattern, $value))? true: false;\n return $result;\n }", "public function testValidatePhoneAutomaticDetectionFromInternationalInput()\n\t{\n\t\t$this->assertTrue($this->performValidation(['value' => '+3216123456', 'params' => 'AUTO']));\n\n\t\t// Validator with wrong international input.\n\t\t$this->assertFalse($this->performValidation(['value' => '003216123456', 'params' => 'AUTO']));\n\n\t\t// Validator with wrong international input.\n\t\t$this->assertFalse($this->performValidation(['value' => '+321456', 'params' => 'AUTO']));\n\t}", "function validate_id( $id ) {\n\n if ( validate_length( $id, 4, 64) ) return 'id-length-too-short-or-too-long';\n // if ( ! preg_match(\"/^[a-zA-Z0-9\\-_@\\.]+$/\", $id) ) return 'id-malformed';\n return false;\n\n}", "public function isValidValue($value);", "private function is_valid($name, $value) {\n\t\tif (in_array(\"%%INT%%\", $this->validParams[$name]) \n\t\t\t&& preg_match('/[0-9].+/', $value))\n\t\t\treturn true;\n\t\tif (in_array(\"%%ANY%%\", $this->validParams[$name]))\n\t\t\treturn true;\n\t\telse\t\n\t\t\treturn in_array($value, $this->validParams[$name]);\n\t}", "public function validate($value)\n {\n return $this->match($this->regex, $value, self::NOT_ALPHA);\n }", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_ONEMONTH,self::VALUE_THREEMONTH,self::VALUE_SIXMONTH,self::VALUE_ONEYEAR,self::VALUE_TWOYEAR,self::VALUE_THREEYEAR,self::VALUE_FIVEYEAR,self::VALUE_SEVENYEAR,self::VALUE_TENYEAR,self::VALUE_TWENTYYEAR,self::VALUE_THIRTYYEAR));\n\t}", "protected function isValidValue($value)\n {\n if ( ! is_string($value)) {\n return false;\n }\n\n return $value == '{today}' || preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/', $value);\n }" ]
[ "0.63462645", "0.62260664", "0.61593777", "0.60630906", "0.6042186", "0.5974189", "0.59728384", "0.59044904", "0.5836261", "0.57742906", "0.5722602", "0.57131016", "0.56913793", "0.5682918", "0.5641361", "0.5626017", "0.56129533", "0.55921173", "0.5579778", "0.5573351", "0.5563613", "0.5563068", "0.55402243", "0.5539937", "0.5525971", "0.5524184", "0.5523137", "0.5510276", "0.5482047", "0.5471742" ]
0.73879457
0
Create form action and strip the identifier parameter. We use this function to create the action for the form. This action cannot contain an identifier since these are used for statistics and failed form submits cannot be tracked.
private function createAction(): string { // pages $action = implode('/', $this->url->getPages()); // init parameters $parameters = $this->url->getParameters(); $moduleParameters = []; $getParameters = []; // sort by key (important for action order) ksort($parameters); // loop and filter parameters foreach ($parameters as $key => $value) { // skip identifier if ($key === 'identifier') { continue; } // normal parameter if (\SpoonFilter::isInteger($key)) { $moduleParameters[] = $value; } else { // get parameter $getParameters[$key] = $value; } } // single language if ($this->getContainer()->getParameter('site.multilanguage')) { $action = LANGUAGE . '/' . $action; } // add to action if (count($moduleParameters) > 0) { $action .= '/' . implode('/', $moduleParameters); } if (count($getParameters) > 0) { $action .= '?' . http_build_query($getParameters, null, '&', PHP_QUERY_RFC3986); } // remove trailing slash $action = rtrim($action, '/'); // cough up action return '/' . $action; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFormAction()\n {\n return $this->formAction;\n }", "public function getFormAction( ) {\n\t\treturn $this->getOptions(\"action\");\n\t}", "public function getFormActionURI ()\n {\n return $this->formActionURI;\n }", "protected abstract function getSubmitAction();", "protected abstract function getSubmitAction();", "public function getFormAction()\n {\n // controller_name is folder name inside controller folder\n // action is php file name inside above controller_name folder\n return $this->getUrl('wholesale/index/post',['_secure'=>true]);\n\n }", "public function action($action = null)\n {\n if ($action !== null) {\n $this->action = admin_url($action);\n\n return;\n }\n\n if ($this->action) {\n return $this->action;\n }\n\n if ($this->isMode(static::MODE_EDIT)) {\n return $this->form->resource().'/'.$this->id;\n }\n\n if ($this->isMode(static::MODE_CREATE)) {\n return $this->form->resource(-1);\n }\n\n return '';\n }", "public function login_form_add_action_input() {\n\t\t$action = '';\n\t\tif ( ! empty( $_GET['action'] ) ) {\n\t\t\t$action = $_GET['action'];\n\t\t}\n\t\t?><input type=\"hidden\" name=\"login-form-action-parameter\" id=\"login-form-action-parameter\" value=\"<?php echo $action; ?>\">\n\t\t<?php\n\t}", "public function __fixFormAction($context){\n\t\t\t\n\t\t\tif(!isset($_GET['redirect'])) return;\n\t\t\t\t\t\t\n\t\t\t$pattern = '/<form action=\"([^\"]+)/i';\t\t\n\t\t\t$replacement = '<form action=\"$1?redirect=' . General::sanitize($_GET['redirect']);\n\t\t\t\n\t\t\tif(isset($_GET['lightbox']) && $_GET['lightbox'] == 'true'){\n\t\t\t\t$replacement .= '&amp;lightbox=true';\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($_GET['redirect-delete']) && strlen(trim($_GET['redirect-delete'])) > 0){\n\t\t\t\t$replacement .= '&amp;redirect-delete=' . General::sanitize($_GET['redirect-delete']);\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t## Add the query into the form action\n\t\t\t$context['output'] = preg_replace(\n\t\t\t\t$pattern, \n\t\t\t\t$replacement, \n\t\t\t\t$context['output']\n\t\t\t);\n\t\t\t\n\t\t}", "public function getFormActionUrl()\r\n\t{\r\n\t if ($this->hasFormActionUrl()) {\r\n\t return $this->getData('form_action_url');\r\n\t }\r\n\t return $this->getUrl('*/qanda/save');\r\n\t}", "public function formAction($action)\n {\n return $this->setFormAction($action);\n }", "function acfe_form_unique_action_id($form, $type){\n \n $name = $form['name'] . '-' . $type;\n \n global $acfe_form_uniqid;\n \n $acfe_form_uniqid = acf_get_array($acfe_form_uniqid);\n \n if(!isset($acfe_form_uniqid[$type])){\n \n $acfe_form_uniqid[$type] = 1;\n \n }\n \n if($acfe_form_uniqid[$type] > 1)\n $name = $name . '-' . $acfe_form_uniqid[$type];\n \n $acfe_form_uniqid[$type]++;\n \n return $name;\n \n}", "public function getFormAction()\r\n {\r\n // controller_name is folder name inside controller folder\r\n // action is php file name inside above controller_name folder\r\n\r\n return $this->_storeManager->getStore()->getFormAction();\r\n // here controller_name is index, action is booking\r\n }", "public function getFormAction()\n {\n return $this->getUrl('checkout/cart/advancedAdd');\n }", "public function getFormAction()\n {\n return $this->getUrl('support/customer/replyPost', ['_secure' => true, '_current' => true]);\n }", "protected function getFormAction()\n {\n return 'update_attachments';\n }", "function form_open($action = '', $attributes = '', $hidden = array())\n {\n if ($attributes == '')\n {\n $attributes = 'method=\"post\"';\n }\n\n // If no action is provided then set to the current url\n $action = get_permalink();\n $action .= '?a=sent';\n $action .= '&p=' . urlencode(get_permalink());\n\n $form = '<form action=\"' . $action . '\"';\n\n $form .= _attributes_to_string($attributes, TRUE);\n\n $form .= '>';\n//dd(get_permalink());\n\n if (is_array($hidden) AND count($hidden) > 0)\n {\n $form .= sprintf(\"<div style=\\\"display:none\\\">%s</div>\", form_hidden($hidden));\n }\n\n return $form;\n }", "public function getFormId()\n {\n return '';\n }", "function buildForm() {\n\t\t$formMethod = 'post';\n\t\tswitch ( $this->getController()->getAction() ) {\n\t\t\tcase mvcDaoController::ACTION_DELETE:\n\t\t\t\t$formAction = $this->getEngine()->getTemplateVar('daoUriDoDelete');\n\t\t\tbreak;\n\n\t\t\tcase mvcDaoController::ACTION_EDIT:\n\t\t\t\t$formAction = $this->getEngine()->getTemplateVar('daoUriDoEdit');\n\t\t\tbreak;\n\n\t\t\tcase mvcDaoController::ACTION_NEW:\n \n\t\t\t\t$formAction = $this->getEngine()->getTemplateVar('daoUriDoNew');\n\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$formAction = $this->getEngine()->getTemplateVar('daoUriView');\n\t\t\t\t$formMethod = 'get';\n\t\t\tbreak;\n\t\t}\n\t\t$this->getEngine()->assign('formAction', $formAction);\n\t\t$this->getEngine()->assign('formMethod', $formMethod);\n\n\t\tif ( $this->getController()->getAction() == mvcDaoController::ACTION_NEW ) {\n\t\t\t$this->getEngine()->assign('oObject', utilityOutputWrapper::wrap($this->getModel()->getNewObject()));\n\t\t} else {\n\t\t\t$this->getEngine()->assign('oObject', utilityOutputWrapper::wrap($this->getController()->getExistingObject()));\n\t\t}\n\t}", "public function createAction($actionID)\n\t{\n\t\tif(($action=parent::createAction($actionID))===null && strpos($actionID, '-') !== false){\n\t\t\trequire_once Yii::getPathOfAlias('app.vendors.Zend.Filter').'.php';\n\t\t\t$newActionID = Zend_Filter::filterStatic($actionID, 'Word_DashToCamelCase');\n\t\t\tif(method_exists($this,'action'. $newActionID)){\n\t\t\t\treturn new CInlineAction($this,$newActionID);\n\t\t\t}\n\t\t}else{\n\t\t\treturn $action;\n\t\t}\n\t}", "public function newAction() {\n return parent::NewForm();\n }", "public function formStart (string $action = \"#\", string $method = \"post\", ?string $class = null, ?string $id = null);", "private function createDeleteForm(Action $action)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('action_delete', array('id' => $action->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function createAction($actionID)\n {\n if ($action = parent::createAction($actionID))\n {\n return $action;\n }\n else\n {\n $this->actionMissing();\n }\n }", "function _createAction($action, $base) {\n if ($action === false) {\n return $base;\n }\n if ($action === true) {\n $url = new SimpleUrl('');\n } else {\n $url = new SimpleUrl($action);\n }\n return $url->makeAbsolute($base);\n }", "public function get_form($action)\n\t{\n\t\t$s = '<form action=\"'.$action.'\" method=\"post\" id=\"'.$this->id.'\"><fieldset>';\n\t\tforeach ( $this->items as $it ){\n\t\t\t$s .= $it->get_label_input();\n\t\t}\n\t\t$s .= '<div class=\"appui-form-label\"> </div><div class=\"appui-form-field\"><input type=\"submit\"></div></fieldset></form>';\n\t\treturn $s;\n\t}", "public function getFormActionUrl()\n {\n if ($this->hasFormActionUrl()) {\n return $this->getData('form_action_url');\n }\n return $this->getUrl('*/' . $this->_controller . '/signup');\n }", "function start_form(string $action = '', $attributes = [], array $hidden = []): string\n {\n $drawHtml = '';\n $drawHtml .= '<div class=\"row\">';\n $drawHtml .= '<div class=\"col-lg-7 col-md-7 col-12 mx-auto\">';\n $drawHtml .= form_open($action, $attributes, $hidden);\n $drawHtml .= csrf_field();\n\n return $drawHtml;\n }", "function edit_component_tool_outputs_data_actions_action(&$form) {\n // use current time as form_key to enable webform component clone.\n $form['form_key']['#default_value'] = 'form_key_' . time();\n\n unset($form['validation']);\n unset($form['display']);\n\n $form = array_merge($form, get_edit_component_base_form_elements($form, 'action'));\n\n // form field to edit attributes, available attributes for command includes:\n $form['extra']['attributes']['type'] = [\n '#type' => 'radios',\n '#title' => t('Type'),\n '#description' => t('Type of action (either <span style=\"color: #FF5666\">format</span> or \n <span style=\"color: #FF5666\">metadata</span> currently).'),\n '#options' => drupal_map_assoc([\n 'format',\n 'metadata',\n ]),\n '#required' => TRUE,\n '#default_value' => 'format',\n ];\n $form['extra']['attributes']['name'] = [\n '#type' => 'textfield',\n '#title' => t('Name'),\n '#description' => t('If <span style=\"color: #FF5666\">type=\"metadata\"</span>, the name of the metadata element.'),\n ];\n $form['extra']['attributes']['default'] = [\n '#type' => 'textfield',\n '#title' => t('Name'),\n '#description' => t('If <span style=\"color: #FF5666\">type=\"format\"</span>, \n the default format if none of the nested options apply.'),\n ];\n\n // grab populated data from 'extra' column from webform_component table and\n // fill it as default values for edit component form fields.\n edit_component_form_fields_default_value($form);\n}", "public function createAction();" ]
[ "0.6101844", "0.59893566", "0.59503245", "0.5899666", "0.5899666", "0.58662355", "0.57034284", "0.5680038", "0.56536", "0.56418526", "0.56264013", "0.56135416", "0.560564", "0.55473053", "0.55301213", "0.55237347", "0.55228144", "0.5512959", "0.54886943", "0.5474247", "0.54425377", "0.5417418", "0.53916115", "0.5377442", "0.5366797", "0.5336403", "0.5313581", "0.53016615", "0.5293625", "0.52731806" ]
0.6192192
0
return total score of the cards in the player's hand
public function getScore(): int { $totalValue = 0; foreach ($this->cards as $card) { if ($card instanceof Card) { $totalValue += $card->getValue(); } else { continue; } } return $totalValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function score(): int{\n $total = 0;\n foreach($this->frames as $k => $frame){\n $total += $frame->score();\n }\n return $total;\n }", "public function getScore($hand)\n {\n $card = new CardController();\n $this->ranked_hand = $this->rankingCardsByNumber($card->getRankCardById($hand));\n arsort($this->ranked_hand);\n $this->score = 0;\n if ($this->isRoyalFlush($hand)) {\n $this->score = 10;\n return $this;\n } elseif ($this->isStraightFlush($hand)) {\n $this->score = 9;\n return $this;\n } elseif ($this->isFourOfKind($hand)) {\n $this->score = 8;\n return $this;\n } elseif ($this->isFullHouse($hand)) {\n $this->score = 7;\n return $this;\n } elseif ($this->isFlush($hand)) {\n $this->score = 6;\n return $this;\n } elseif ($this->isStraight($hand)) {\n $this->score = 5;\n return $this;\n } elseif ($this->isThreeOfKind($hand)) {\n $this->score = 4;\n return $this;\n } elseif ($this->isTwoPair($hand)) {\n $this->score = 3;\n return $this;\n } elseif ($this->isOnePair($hand)) {\n $this->score = 2;\n return $this;\n }\n return $this;\n }", "public function score()\n {\n// return 0;\n $score = 0;\n $roll = 0;\n\n foreach (range(1, self::FRAMES_PER_GAME) as $frame) {\n // check for a strike\n if ($this->isStrike($roll)) {\n// $score += $this->rolls[$roll] + $this->strikeBonus($roll);\n $score += $this->pinCount($roll) + $this->strikeBonus($roll);\n // strike bonus\n// $score += $this->rolls[$roll];\n// // strike bonus\n// $score += $this->strikeBonus($roll);\n\n $roll++;\n\n continue;\n }\n\n $score += $this->defaultFrameScore($roll);\n\n // check for a spare\n if ($this->isSpare($roll)) {\n // you got a spare\n// $score += $this->defaultFrameScore($roll);\n// $score += $this->spareBonus($roll);\n $score += $this->spareBonus($roll);\n }\n\n $roll += 2;\n }\n\n return $score;\n// return array_sum($this->rolls);\n }", "function getTotalScore(){\n\t\treturn $this->quizcreator_score + $this->quiztaker_score;\n\t}", "function getHandTotal($hand, $total = 0) \n{\n // todo\n\tforeach($hand as $card)\n\t{\n\t\t$total += getCardValue($card);\n\t\tif($total > 21 && aceInHand($hand))\n\t\t{\n\t\t\t$total -= 10;\n\t\t}\n\t}\n\treturn $total;\n}", "public function computerScore()\n {\n return $this->computerPlayerScore;\n }", "public function countCards();", "public function sum()\n {\n return $this->hand->sum();\n }", "function CalculateScore()\n\t{\n\t\t$this->nPageScore = $this->GetPageScore();\n\t\n\t\t// If no page score found then reguardless of any other mods, no damage was done\n\t\tif ($this->nPageScore == null)\n\t\t{\n\t\t\treturn (0); \n\t\t}\n\t\t\n\t\t// Otherwise we can add this page score to the players scoring total\n\t\t$this->nScoreTotal = $this->nScoreTotal + $this->nPageScore;\t\n\t\t\n\t\t// Get the move's base score modifer since a result score was found\n\t\t//... what about PGX ???? - is it the move mod used if in ER?\n\t\t$this->nScoreTotal = $this->nScoreTotal + $this->nMod;\n\t\t\n\t\t// Add character move expriance to the total \n\t\t$this->nScoreTotal = $this->nScoreTotal + $this->nExperience;\n\t\t\n\t\t// Get the grand total of all score modifers that apply to this turn\n\t\t$this->nScoreModTotal = $this->objGTScoreMods->CalculateModTotal($this);\n\t\t\n\t\t// Only add the score mod total if anything was returned\n\t\tif ($this->nScoreModTotal != null)\n\t\t{\n\t\t\t$this->nScoreTotal = $this->nScoreTotal + $this->nScoreModTotal;\n\t\t}\n\t\t\n\t\treturn ($this->nScoreTotal);\n\t}", "public function totalScore()\n {\n return $this->totalScore;\n }", "public function score(){\n\t\treturn $this->score;\n\t}", "public function humanScore()\n {\n return $this->humanPlayerScore;\n }", "public function score(): int\n {\n $score = 0;\n $previousRoll = 0;\n $addSpareBonus = false;\n\n foreach ($this->frames as $index => $frameScore) {\n $score += $addSpareBonus ? $frameScore * 2 : $frameScore;\n $addSpareBonus = false;\n if (($index + 1) % 2 === 0) {\n $addSpareBonus = $frameScore + $previousRoll === 10;\n }\n $previousRoll = $frameScore;\n }\n\n return $score;\n }", "public function getScore();", "function get_player_score($mac)\n\t{\n\t\t$db = db_init();\n\t\t$player_id = get_player_id($mac);\n\t\t$sql = \"select Score from rank where PlayerId = \".$player_id.\";\";\n\t\t$result = mysqli_query($db, $sql);\n\t\t$row = mysqli_fetch_row($result);\n\t\tif(!empty($row))\n\t\t{\n\t\t\treturn $row[0];\n\t\t}\n\t\treturn -1;\n\t}", "function countCards($deck, $player_card_value){\n $player_win_by_value = 21 - $player_card_value;\n //checks the top card to see if it is worth it to take a hit\n foreach($deck[0] as $card){\n foreach($card as $value){\n return($value <= $player_win_by_value);\n }\n }\n }", "public function getTotal()\n\t{\n\t\t$firstAce = true;\n\t\t$total = array(0,0);\n\t\t\n\t\trsort($this->cards);\n\t\t\n\t\tforeach($this->cards as $card)\n\t\t{\n\t\t\tif($card->getValue() != Value::ACE)\n\t\t\t{\n\t\t\t\t$total[0] += $card->getNumericalValue();\n\t\t\t\t$total[1] += $card->getNumericalValue();\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$total[0]++;\n\t\t\t\t\n\t\t\t\tif(true == $firstAce)\n\t\t\t\t{\n\t\t\t\t\t$total[1] += 11;\n\t\t\t\t\t$firstAce = false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$total[1]++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(($total[0] == $total[1]) || ($total[1] > 21))\n\t\t{\n\t\t\t$total = array($total[0]);\n\t\t}\n\t\t\n\t\treturn $total;\n\t}", "public function getScore ()\r\n {\r\n return $this->score;\r\n }", "public function playerSum()\n {\n return $this->player->getLastRollSum();\n }", "public function getScore()\n {\n return $this->score;\n }", "public function getScore()\n {\n return $this->score;\n }", "public function getScore()\n {\n return $this->score;\n }", "public function getScore()\n {\n return $this->score;\n }", "public function getScore()\n {\n return $this->score;\n }", "public function getScore()\n {\n return $this->score;\n }", "public function getScore() {\n return $this->score;\n }", "public function calculateScore()\n {\n // \n $this->score = 0;\n $multiplier = 0;\n \n // if the current price is above a minimum price\n if(isset($this->current_price) && ($this->current_price >= $this->min_current_price)) {\n $price_divider = round(($this->current_price / $this->min_current_price));\n $this->score = $this->score + $price_divider; \n }\n \n // if the bid count is above a minimum bid count\n if(isset($this->bid_count) && ($this->bid_count >= $this->min_bid_count)) {\n $bid_count_divider = round(($this->bid_count / $this->min_bid_count));\n $this->score = $this->score + $bid_count_divider;\n }\n \n // if the feedback score is above a minimum feedback score\n if(isset($this->feedback_score) && ($this->feedback_score >= $this->min_feedback_score)) {\n $feedback_score_divider = round(($this->feedback_score / $this->min_feedback_score));\n $this->score = $this->score + $feedback_score_divider;\n }\n \n return $this->score;\n }", "public function getScore()\n\t{\n\t\treturn (float)$this->hit['_score'];\n\t}", "function getTotalPoints() {\n global $players;\n \n $winnersPoints = getWinnersPoint();\n $total = 0;\n \n for ($i = 0; $i < 4; $i++) {\n if ($players[$i] != $winnersPoints) {\n $total += $players[$i];\n }\n }\n \n return $total;\n }", "public function getScore()\n {\n return $this->_score;\n }" ]
[ "0.7236394", "0.7111552", "0.7056839", "0.6943948", "0.6935831", "0.6770871", "0.6753481", "0.67040175", "0.66121644", "0.6568427", "0.655526", "0.6500606", "0.64896685", "0.6483089", "0.64413255", "0.63873506", "0.63387674", "0.6312425", "0.62946934", "0.62889224", "0.62889224", "0.62889224", "0.62889224", "0.62889224", "0.62889224", "0.6248765", "0.62341094", "0.6189779", "0.6183252", "0.6178205" ]
0.76510584
0
Get Time Difference [Millisecond]
public function getTimeDifference(): float { return $this->timerStop - $this->timerStart; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getMilliseconds()\n {\n return round(microtime(true) * 1000);\n }", "protected function get_time()\n\t{\n\t\t$ret_val = microtime(true) - $this->timer;\n\n\t\treturn $ret_val;\n\t}", "private function get_time_interval() {\n if ($this->microtime_start === null) {\n $this->microtime_start = microtime(true);\n return 0.0;\n }\n $now = microtime(true);\n $dif = $now - $this->microtime_start;\n $this->microtime_start = $now;\n\n return $dif;\n }", "function _getTime() {\n\t\tlist($usec, $sec) = explode(' ', microtime());\n\t\treturn ((float)$sec + (float)$usec);\n\t}", "public function getTime()\t\t\r\n\t\t{\r\n\t\t list($usec, $sec) = explode(\" \", microtime());\r\n\t\t return $sec + (int)(round($usec * 1000));\r\n\t\t}", "public function getTimestampMs()\n {\n return $this->timestamp * 1000 + $this->millisecond;\n }", "private static function getTime(): float\n {\n return microtime(true);\n }", "public function MeasureTime ()\r\n\t{\r\n\t\treturn abs (microtime (true)- $this->measure);\r\n\t}", "function _getMicrotime () {\r\n\t\t\tlist($msec, $sec) = explode(\" \",microtime());\r\n\t\t\treturn ((float)$msec + (float)$sec);\r\n\t\t}", "function microtiming() {\n\tlist($usec, $sec) = explode(\" \", microtime());\nreturn ((float)$usec + (float)$sec); }", "public function getMicroTimeInFloat()\n {\n list($usec, $sec) = explode(' ', microtime());\n return ((float) $usec + (float)$sec);\n }", "function _time(){\n list($usec, $sec) = explode(\" \", microtime());\n return ((float)$usec + (float)$sec);\n }", "public static function get_time(){\n return microtime(TRUE);\n }", "function elapsed_time()\n {\n $mtime = microtime(); \n $mtime = explode(\" \",$mtime); \n $mtime = $mtime[1] + $mtime[0]; \n return ($mtime - $this->start_time); \n }", "public function time(){\n\t\t/*list($usec, $seconds) = explode(\" \", microtime());\n\t\treturn ((float)$usec + (float)$seconds);\n\t\t*/\n\t\treturn microtime(true);\n\t}", "function getTime() {\n static $timer = false, $start;\n if ($timer === false) {\n $start = array_sum(explode(' ',microtime()));\n $timer = true;\n return NULL;\n } else {\n $timer = false;\n $end = array_sum(explode(' ',microtime()));\n return round(($end - $start) * 1000, 3);\n }\n}", "private function getmicrotime(){ \n list($usec, $sec) = explode(\" \",microtime()); \n return ((float)$usec + (float)$sec); \n }", "public function getTime () {\n\t\t#/home/grabli66/haxe/std/php/_std/Date.hx:35: characters 3-22\n\t\treturn $this->__t * 1000.0;\n\t}", "public static function getMicroTime() {\n\t\t$time = microtime();\n\t\t$time = explode(' ', $time);\n\t\treturn $time[1] + $time[0];\n\t}", "function _getmicrotime() { \r\n \r\n list($_milisegundos, $_segundos) = explode(\" \", microtime()); \r\n \r\n return ((float)$_milisegundos + (float)$_segundos); \r\n }", "function millitime(){\n\t$microtime = microtime();\n\t$comps = explode(' ', $microtime);\n\n\t// Note: Using a string here to prevent loss of precision in case of \"overflow\" (PHP converts it to a double)\n\treturn sprintf('%d%03d', $comps[1], $comps[0] * 1000);\n}", "public function getTime()\n {\n return round($this->time * 100, 2);\n }", "function getUTCMilliseconds(){\n return round(rand(1,9)/10 * 2147483647) * rand(1,999) % 1E10;\n }", "public function getTiming()\n {\n return $this->getExecutionTime() * 1000;\n }", "function getmicrotime() {\r\n list($usec, $sec) = explode(\" \", microtime());\r\n return (float)$usec + (float)$sec;\r\n }", "public function getMilliseconds($microtime = NULL) {\n\t}", "public function getNanos() {}", "public function getNanos() {}", "function _getmicrotime() { \r\n\tlist($usec, $sec) = explode(\" \", microtime()); \r\n\treturn ((float)$usec + (float)$sec); \r\n}", "private function _getMicroTime()\n\t{\n\t\tlist($usec, $sec) = explode(' ',microtime());\n\t\treturn ((float)$usec + (float)$sec);\n\t}" ]
[ "0.7499284", "0.73969233", "0.7372702", "0.73670155", "0.72674143", "0.7246766", "0.72367954", "0.7120577", "0.69819045", "0.6960493", "0.69451904", "0.69328976", "0.6921483", "0.6876559", "0.6841647", "0.68377376", "0.6829753", "0.68049806", "0.68003833", "0.6782204", "0.67705965", "0.67599", "0.670311", "0.6688505", "0.66829777", "0.66456044", "0.6636949", "0.6636949", "0.6627088", "0.66236526" ]
0.7451156
1
encode the id to a few chars
private function __encode($id) { $return = ''; while ($id > 0) { $return = substr($this->__codeSet, ($id % $this->__base), 1) . $return; $id = floor($id / $this->__base); } return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEncodedIdAttribute(): string\n {\n return Optimus::encode($this->id);\n }", "function encodeId($argId)\n{\n $seaSalt = mt_rand(1,98);\n $salt = ($seaSalt & 1)? $seaSalt + 1 : $seaSalt;\n $id = $argId * ($salt / 2) + $seaSalt;\n $seaSalt = (string) ($seaSalt < 10)? '0' . $seaSalt : $seaSalt;\n $id .= $seaSalt;\n return (int) $id;\n}", "public static function encodeId($id) {\n\t\t$hashids = new \\Hashids\\Hashids(SALT);\n\t\treturn $hashids->encode($id);\n\t}", "public static function enCryptId($id){\n\t\t\n\t\treturn str_pad($id, 5 , \"0\", STR_PAD_LEFT); \n\t}", "public function get_adv_id($id){\n\t\treturn str_pad($id, 3, 0, STR_PAD_LEFT);\t\t\n\t}", "public function getIdRepresentation(){\n\t\treturn bin2hex($this->getKey());\n\t}", "public function ClientFormattedID() {\n return self::integerToBase64($this->ID);\n }", "public function get_format_id($enc_id){\n\t\treturn str_replace(array('%20','/','+','='), array('','','','',), $enc_id);\n\t}", "public function encodeID($id) {\n // Strings don't currently have a secure\n // method, so simple base64 encoding will work for now.\n if (!is_numeric($id)) {\n return '=_' . base64_encode($id);\n }\n\n $id = (int) $id;\n if ($id < 1) {\n return false;\n }\n if ($id > pow(2, 31)) {\n return false;\n }\n\n $segment1 = $this->getHash($id, 16);\n $segment2 = $this->getHash($segment1, 8);\n $dec = (int) base_convert($segment2, 16, 10);\n $dec = ($dec > $id) ? $dec - $id : $dec + $id;\n $segment2 = base_convert($dec, 10, 16);\n $segment2 = str_pad($segment2, 8, '0', STR_PAD_LEFT);\n $segment3 = $this->getHash($segment1 . $segment2, 8);\n $hex = $segment1 . $segment2 . $segment3;\n $bin = pack('H*', $hex);\n $oid = base64_encode($bin);\n $oid = str_replace(array('+', '/', '='), array('$', ':', ''), $oid);\n\n return $oid;\n }", "function makeid($newid) {\n\t// the characters we will use\n\t$chars\t= \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\n\t// splits $chars into an array of individual characters\n\t$tmp = preg_split(\"//u\", $chars, -1, PREG_SPLIT_NO_EMPTY);\n\n\t// shuffles/randomizes the $tmp array\n\tshuffle($tmp);\n\n\t// turns the randomized array into a string\n\t$tmp2 = join(\"\", $tmp);\n\n\t// returns the first 10 characters of the randomized string\n\treturn mb_substr($tmp2,0,20,\"UTF-8\");\n}", "public function encode()\n {\n return base64_encode(Cipher::encrypt($this->id));\n }", "public function encodeID($value)\n {\n // $hashids = new Hashids();\n\n // $hashids = new Hashids('', $padding);\n // $hashids->encode($value);\n // return $hashids;\n\n // $val=($value*111985);\n $val=($value*111985);\n\n $hashids = base64_encode($val);\n\n return $hashids;\n\n\n\n\n\n\n }", "public function getStrId();", "function encode_id($id): ?string\n {\n if (empty($id)) {\n return null;\n }\n\n return app('hash.id')->encode($id);\n }", "public static function encryptId($id){\n return substr(md5($id), 0, 6).dechex($id);\n }", "public function generateCode(): string\n {\n $hashids = new Hashids();\n\n return $hashids->encode($this->id);\n }", "private function createId()\n {\n $data = openssl_random_pseudo_bytes(16);\n $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0010\n $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10\n\n return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));\n }", "public function randId()\n {\n $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charLen = strlen($chars);\n $randStr = '';\n for ($i = 0; $i < 8; $i++) {\n $randStr .= $chars[rand(0, $charLen - 1)];\n }\n return $randStr;\n }", "function CreateID() {\n $result = \"\";\n $length = 16;\n for ($i=0; $i < $length; $i++) {\n $result.= dechex(mt_rand(0,$length-1));\n }\n return $result;\n }", "protected function getItoa64(): string\n {\n return './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n }", "public static function prepare_id($id)\n {\n $char_in = array('/', '.', ',', ':');\n $id = str_replace($char_in, '-', $id);\n \n return $id;\n }", "protected static function createId() {\n if (!isset(self::$_idFormat)) {\n self::$_idFormat = sprintf('wmailer.id.%.5f.%d.%%05d', microtime(true), rand(1000, 9999));\n }\n return sprintf(self::$_idFormat, ++self::$_idIndex);\n }", "function toBasicNumeralId($garyId){\n\t$s = substr($garyId, strlen($garyId) - 4, 4);\n\t$s = preg_replace(\"/^0+/\", \"\", $s);\n\treturn $s;\n}", "function idgen($chr){\r\n\t$number = uniqid();\r\n\t$varray = str_split($number);\r\n\t$len = sizeof($varray);\r\n\t$id = array_slice($varray, $len-$chr, $len);\r\n\t$id = implode(\",\", $id);\r\n\t$id = str_replace(',', '', $id);\r\n\r\n return $id;\r\n}", "public function createID()\n {\n $string = mapModel::newMapID();\n $idNum = preg_replace('#[^0-9]#', '', $string);\n $idNum++;\n $count = 5 - (strlen((string)$idNum));\n $finalmapid = \"map\";\n for ($x = 0; $x < $count; $x++) {\n $finalmapid .= \"0\";\n }\n $finalmapid .= $idNum;\n return $finalmapid;\n }", "public function id()\n {\n return $this->cleanName.Str::upper($this->value);\n }", "static function encodeIDCard($idCard){\n\t\t$idCard = trim($idCard);\n\t\tif(strtoupper(substr($idCard,-1)) === 'X'){\n\t\t\t$numberStr = substr($idCard,0,-1);\n\t\t\t$hasX = 1;\n\t\t}else{\n\t\t\t$numberStr = $idCard;\n\t\t\t$hasX = 0;\n\t\t}\n\t\tif($numberStr[0] === '-' ){\n\t\t\tthrow new Exception(\"input contains invalid chars!\");\n\t\t}\n\t\tif($hasX){\n\t\t\t$numberStr = \"-\".$numberStr;\n\t\t}\n\t\t\n\t\treturn self::encode($numberStr);\n\t}", "function createID(){\n $dtAcc = new DataAccess();\n \n $preID = $dtAcc->runQuery('SELECT art_id FROM Articles ORDER BY art_id LIMIT 0, 1');\n \n if($preID->rowcount() > 0){\n foreach ($temp as $row){\n $oldID = $row['art_id'];\n }\n } else {\n $oldID = '0000';\n }\n \n $temp = $oldID + 1;\n \n return substr($oldID, 0, strlen($id)-1) . $temp;\n }", "public function Id2Url($id)\n {\n $byte1[]=$this->Str2Arr('3go8&$8*3*3h0k(2)2');\n $byte2[]=$this->Str2Arr($id);\n $magic=$byte1[0];\n $song_id=$byte2[0];\n for ($i=0; $i<count($song_id);\n $i++) {\n $song_id[$i]=$song_id[$i]^$magic[$i%count($magic)];\n }\n $result=base64_encode(md5($this->Arr2Str($song_id), 1));\n $result=str_replace('/', '_', $result);\n $result=str_replace('+', '-', $result);\n return $result;\n }", "private function convertId($id) {\n $idstr = (string)$id;\n $x = substr($idstr, 0, 1);\n $y = substr($idstr, 1, 1);\n $z = substr($idstr, 2);\n $steamid = 'STEAM_'.$x.':'.$y.':'.$z;\n return $steamid;\n }" ]
[ "0.77582043", "0.7281159", "0.7120651", "0.7033238", "0.7020309", "0.7015201", "0.70128876", "0.7012078", "0.6996553", "0.69721836", "0.6962095", "0.6918987", "0.6899623", "0.67988795", "0.67437357", "0.6656157", "0.6618778", "0.65875584", "0.6586606", "0.6578846", "0.657568", "0.65578854", "0.6523969", "0.6522392", "0.65206635", "0.65145373", "0.649479", "0.64794755", "0.64659625", "0.64647776" ]
0.7636585
1
$query = "select from fb_like where anketa_id=" . $anketa_id . " and user_id='" . $user>fb_id . "'";
public function getLikeByUser($anketa_id, $fb_id) { $query = "SELECT * FROM fb_like WHERE anketa_id=" . $anketa_id . " and user_id='" . $fb_id . "' LIMIT 1"; return $this->get_row($query); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function has_liked_by($user1, $user2)\r\n{\r\n $db = db();\r\n $query = $db->query(\"SELECT `id` FROM `liked_by` WHERE `user_id`=$user2 AND `liked_by`=$user1\");\r\n if ($query && $query->num_rows > 0) {\r\n return true;\r\n }\r\n return false;\r\n}", "function userLikedThisPost($post_id){\n\n $result = query(\"SELECT * FROM likes WHERE user_id=\" .loggedInUserId() . \" AND post_id={$post_id}\");\n // echo $result;\n // shorthand if statement\n confirmQuery($result);\n return mysqli_num_rows($result) >= 1 ? true : false;\n}", "function userLikedThisPost($post_id = '') {\n $result = query(\"SELECT * FROM likes WHERE user_id=\" .loggedInUserId() . \" AND post_id ={$post_id}\");\n return mysqli_num_rows($result) >= 1 ? true : false;\n}", "function userLiked($post_id)\n{\n global $conn;\n global $user_id;\n $sql = \"SELECT * FROM rating_community_info WHERE user_id='$user_id'\n AND b_code='자유게시판' and post_id=$post_id AND rating_action='like'\";\n $result = mysqli_query($conn, $sql);\n if (mysqli_num_rows($result) > 0) {\n return true;\n } else {\n return false;\n }\n}", "function userLiked($id_post)\n {\n global $link;\n global $id_user;\n $sql = \"SELECT * FROM rating_info WHERE id_user=$id_user\n AND id_post=$id_post AND rating_action='like'\";\n $result = mysqli_query($link, $sql);\n if (mysqli_num_rows($result) > 0) {\n return true;\n }else{\n return false;\n }\n }", "function checkLike($actor_id,$username) // vérifie si l'utilisateur actuel a déjà ajouté une mention (\"je recommande / déconseille\")\n{\n\t$db = dbConnect();\n\t$result = $db->prepare('SELECT account.id_user, username, vote.id_user, id_actor, vote \n\t\t\t\t\t\t\tFROM account\n\t\t\t\t\t\t\tINNER JOIN vote\n\t\t\t\t\t\t\tON account.id_user = vote.id_user\n\t\t\t\t\t\t\tWHERE username = :username\n\t\t\t\t\t\t\tAND id_actor = :actor');\n\t$result->execute(array('username' => $username, 'actor' => $actor_id));\n\t$data = $result->fetch();\n\t$result->closeCursor();\n\tif(!$data)\n\t{\n\t\t$like_state = false;\n\t}\n\telse\n\t{\n\t\t$like_state = $data['vote'];\n\t}\n\treturn $like_state;\n}", "function getLikes($fb_id){\n\t$count = 0;\n\t$number = 0;\n\t$uid = $GLOBALS['facebook']->getUser();\n\t$url = $url = $_SERVER['HTTP_REFERER'];\n\tif (!is_null($fb_id)){\n\t\ttry{\n\t\t\t/*\n\t\t\t$array_my_likes include object which user likes.\n\t\t\t{\n \t\t\t \"data\": [\n\t\t\t {\n\t\t\t \"name\" \n\t\t\t \"category\" \n\t\t\t \"id\" \n\t\t\t \"created_time\"\n\t\t\t }\n\t\t\t ]\n\t\t\t} \n\t\t\t*/\n\t\t\t$array_my_likes = $GLOBALS['facebook']->api(\"/me/likes\", 'GET');\n\t\t\t$array_frd_likes = $GLOBALS['facebook']->api(\"/${fb_id}/likes\", 'GET');\n\t\t\t\n\t\t\tforeach ($array_my_likes['data'] as $my_likes){\n\t\t\t\tforeach ($array_frd_likes['data'] as $frd_likes){\n\t\t\t\t\tif ($my_likes['id'] === $frd_likes['id']){\n\t\t\t\t\t\t$same_likes[] = $my_likes;\n\t\t\t\t\t\t$count++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$number++;\n\t\t\t}\n\t\t\t$percent = ($count / $number) * 100;\n\t\t\t$percent = round($percent);\n\t\t\trequire 'templates/result.php';\n\t\t} catch(FacebookApiException $e){\n \t\tloginToFb($GLOBALS['param']);\n\t error_log($e->getType());\n \terror_log($e->getMessage());\n \t\t} \t\n\t}\n\telse {\n\t\techo '指定された友人がいません';\n\t}\n}", "function checkCurrentUserLike ($user_id, $image_id, $connDb) {\n\t$sql_get_like = \"SELECT * FROM likes WHERE image_id = :image_id AND user_id = :user_id\";\n\t$get_like = $connDb->prepare($sql_get_like);\n\t$get_like->bindValue(':image_id', $image_id);\n\t$get_like->bindValue(':user_id', $user_id);\n\t$get_like->execute();\n\t$like_found = $get_like->fetch(PDO::FETCH_ASSOC);\n\treturn($like_found);\n}", "function getFavouriteBooks($user){\n global $conn;\n $query = \"SELECT e_store.books.*\n FROM e_store.likes\n INNER JOIN e_store.users ON userid = users.id\n INNER JOIN e_store.books ON bookid = books.id\n WHERE username = :user;\";\n\n $stmt = $conn->prepare($query);\n $stmt->execute( array('user' => $user) );\n return $stmt->fetchAll();\n }", "public function check_if_user_liked_image(){\n //create query\n $query = \"SELECT user_id, image_id FROM \". $this->table .\" WHERE user_id = :user_id\";\n //Prepare statment\n $stmt = $this->conn->prepare($query);\n //make sure id is absolute number\n $user_id = abs((int)$this->user_id);\n //bind id\n $stmt->bindParam(':user_id', $user_id);\n //execute query\n $stmt->execute();\n //return result\n return $stmt;\n }", "public function getUserPostLike($user_id)\n {\n return Like::find()->with('user')->with('post')->where(['user_id' => \"$user_id\",'status' => '1'])->orderBy(['created_date'=>SORT_DESC])->all();\n \n }", "public function check_if_user_liked_an_image(){\n //create query\n $query = \"SELECT user_id, image_id FROM \". $this->table .\" WHERE user_id = :user_id AND image_id = :image_id\";\n //Prepare statment\n $stmt = $this->conn->prepare($query);\n //make sure id is absolute number\n $user_id = abs((int)$this->user_id);\n $image_id = abs((int)$this->image_id);\n //bind id\n $stmt->bindParam(':user_id', $user_id);\n $stmt->bindParam(':image_id', $image_id);\n //execute query\n $stmt->execute();\n //return result\n return $stmt;\n }", "function userLiked($pid)\n{\n \n $sql = \"SELECT * FROM rating_info WHERE pid=$pid AND rating_action='like'\";\n $result = $db->prepare($sql);\n $result->execute(array($_GET['id']));\n $result->fetchAll(PDO::FETCH_ASSOC);\n $likecount = $result->rowCount();\n if ($likecount > 0) {\n return true;\n }else{\n return false;\n }\n }", "public function check_liked(){\n\t\t\t//query\n\t\t\t$query = \"SELECT count(*) FROM \".$this->table.\" WHERE post_id = :post_id and user_id = :user_id\";\n\n\t\t\t//prepate stmt\n\t\t\t$stmt = $this->conn->prepare($query);\n\n\t\t\t//bind params to stmt\n\t\t\t$stmt->bindParam(':post_id', $this->post_id);\n\t\t\t$stmt->bindParam(':user_id', $this->user_id);\n\n\t\t\t//execute stmt\n\t\t\t$stmt->execute();\n\n\t\t\t$result = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t\treturn $result;\n\t\t}", "function userDisliked($post_id)\n{\n global $conn;\n global $user_id;\n $sql = \"SELECT * FROM rating_community_info WHERE b_code='자유게시판' and user_id='$user_id'\n AND post_id=$post_id AND rating_action='dislike'\";\n $result = mysqli_query($conn, $sql);\n if (mysqli_num_rows($result) > 0) {\n return true;\n } else {\n return false;\n }\n}", "function userDisliked($id_post)\n {\n global $link;\n global $id_user;\n $sql = \"SELECT * FROM rating_info WHERE id_user = $id_user\n AND id_post=$id_post AND rating_action='dislike'\";\n $result = mysqli_query($link, $sql); \n if (mysqli_num_rows($result) > 0) {\n return true;\n }else{\n return false;\n }\n }", "public function check_like($confideid){\n\t\t\t$query = $this->db->query(\"SELECT user_id, confide_id FROM likes WHERE user_id = '\".@$_SESSION['user_id'].\"' AND confide_id = \".$confideid.\"\");\n\t\t\treturn $query->result_array();\n\t}", "function buygift($fb_id, $page){\n\t\t$user = $this->User->find('first', array('conditions' => (array('User.id'=>$this->Auth->getUserId()))));\n\t\t$remote_user = json_decode(file_get_contents('https://graph.facebook.com/'.$fb_id.'?'. $user['User']['facebook_access_key']));\n\t\t$remote_user_likes = json_decode(file_get_contents('https://graph.facebook.com/'.$fb_id.'/likes?'.$user['User']['facebook_access_key']));\n\t//\t$control = json_decode($user['Interest']['likes']);\n\t\t//$likes = json_decode(file_get_contents('https://graph.facebook.com/'.$fb_id.'/likes?'.$user['User']['facebook_access_key']));\n\t\t$this->set('remote_user',$remote_user);\n\t\t$this->set('remote_user_likes',$remote_user_likes);\n\t\t\n\t\t$this->set('page',$page);\n\t\t\n\t\t$results = array();\n\t\t$results_counter = 0;\n\t\t$display_array = array();\n\t\tfor ($counter = $page*10;$counter<($page*10+10);$counter++){\t\n\t\t\t//$results[$results_counter]=$this->printSearchResults($this->itemsearch($remote_user_likes->data[$counter]->name));\n\t\t$data=$this->itemsearch($remote_user_likes->data[$counter]->name);\n\t\t\n\t\tif ($data->Items->Item) {\n\t\t\t$display_array[$results_counter]=$remote_user_likes->data[$counter];\n\t\t\t$results[$results_counter]=$data->Items->Item;\n\t\t\t$results_counter++;\n\t\t\t}\n\t\t}\n\t\t$this->set('display_array',$display_array);\n\t\t$this->set('results',$results);\n\t}", "function checkIfLiked($checkLikeQuery) {\n $numOfLikes = getNumOfRows($checkLikeQuery);\n\n if($numOfLikes > 0) {\n $like = \"Unlike\";\n }\n else {\n $like = \"Like\";\n }\n\n return $like;\n}", "function likes($post_id,$enroll){\n\t\t$like = 1;\n\t\t$sqllike = \"SELECT l_like FROM likes WHERE post_id ='\".$post_id.\"' AND l_like = '\".$like.\"'\";\n\t\t$result = $this->select($sqllike);\n\t\t$c_likes = $result->num_rows;\n\n\t\t$sqlcom = \"SELECT id FROM post_comments WHERE post_id ='\".$post_id.\"'\";\n\t\t$result = $this->select($sqlcom);\n\t\t$c_post = $result->num_rows;\n\t\t//check if user liked post\n\t\t$sql = \"SELECT * FROM likes WHERE post_id ='\".$post_id.\"' AND user_enroll = '\".$enroll.\"'\";\n\t\t$query = $this->select($sql);\n\t\t$check = $query->fetch_row();\n\t\tif($check >= 1){\n\t\t\tif($c_likes == 1){\n\t\t\t\techo $c_likes .\" like\";\n\t\t\t}else{\n\t\t\t\techo $c_likes .\" likes\";\n\t\t\t}\n\t\t}else{\n\t\t\tif($c_likes == 0){\n\t\t\t\techo $c_likes .\" like\";\n\t\t\t}else{\n\t\t\t\techo $c_likes .\" likes\";\n\t\t\t}\n\t\t}\n\t}", "public function getLikeUser($post_id)\n {\n $likes_buddy = Like::find()->with('user')->where(['post_id' => $post_id,'status' => '1'])->orderBy(['updated_date'=>SORT_DESC])->all();\n \n // echo '<pre>';print_r($likes_buddy);exit;\n \n return $likes_buddy;\n }", "public function likedBy(User $user)\n { \n return $this->likes->contains('user_id', $user->id); \n // contains() is a laravel connection method so right now \n // we added the user id and we check if \n // the user with that id already liked the post \n }", "public function getUserLikedStatus () {\n $query = \"SELECT created_by FROM likes WHERE post_id = ? AND created_by = ?\";\n $stmt = $this->db ->prepare($query);\n $stmt ->bind_param(\"ii\",$this->postId, $this->userId);\n $stmt -> execute();\n $result = $stmt -> get_result();\n if ($result -> num_rows === 1)\n return true;\n else\n return false;\n }", "public function getLikeUserNames($post_id)\n {\n $session = Yii::$app->session;\n $likes_buddy_counts = 0;\n $uid = $session->get('user_id');\n $likes_buddy_names = Like::find()->with('user')->where(['post_id' => \"$post_id\",'status' => '1'])->andwhere(['not in','user_id',array(\"$uid\")])->orderBy(['created_date'=>SORT_DESC])->limit(3)->all();\n if(count($likes_buddy_names) == 3)\n $offset = 2;\n else \n $offset = count($likes_buddy_names)-3;\n if($offset >=1)\n {\n $likes_buddy_counts = Like::find()->with('user')->where(['post_id' => \"$post_id\",'status' => '1'])->andwhere(['not in','user_id',array(\"$uid\")])->orderBy(['created_date'=>SORT_DESC])->offset($offset)->all();\n } \n $is_like_login = Like::find()->with('user')->where(['post_id' => \"$post_id\",'status' => '1','user_id'=> \"$uid\"])->orderBy(['updated_date'=>SORT_DESC])->one();\n \n if(!empty($is_like_login))\n {\n if(!empty($likes_buddy_names))\n $names = 'You, ';\n else\n $names = ucfirst($is_like_login['user']['fname']).' '.ucfirst($is_like_login['user']['lname']);\n $ctr = count($likes_buddy_counts)-1;\n }\n else\n {\n $names = '';\n $ctr = count($likes_buddy_counts);\n }\n foreach($likes_buddy_names AS $like_buddy_name)\n {\n $names .= ucfirst($like_buddy_name['user']['fname']).' '.ucfirst($like_buddy_name['user']['lname']).', ';\n }\n \n $data['count'] = $ctr; \n $data['like_ctr'] = count($likes_buddy_names);\n $data['names'] = trim($names, \", \");\n $data['login_user_details'] = $is_like_login;\n \n return $data;\n }", "function getPostlikes($post_id){\n\n $result = query(\"SELECT * FROM likes WHERE post_id=$post_id\");\n confirmQuery($result);\n echo mysqli_num_rows($result);\n\n}", "function check_buddy($buddy) {\n global $db,$userid;\n return !db(\"SELECT buddy FROM \".$db['buddys'].\" WHERE user = '\".intval($userid).\"' AND buddy = '\".intval($buddy).\"'\",true) ? true : false;\n}", "function friends( $user_id1 ) {\r\n\t\tglobal $wpdb;\r\n\r\n\t\t$results = $wpdb->get_results( $wpdb->prepare(\r\n\t\t\t\"SELECT user_id1, user_id2 \r\n\t\t\tFROM {$this->table_name} \r\n\t\t\tWHERE status = 1 AND \r\n\t\t\t\t ( user_id1 = %d OR user_id2 = %d ) \r\n\t\t\tORDER BY time DESC\",\r\n\t\t\t$user_id1,\r\n\t\t\t$user_id1\r\n\t\t), ARRAY_A );\r\n\r\n\t\tif ( $results )\r\n\t\t\treturn $results;\r\n\r\n\t\treturn false;\r\n\t}", "function getOtherUsers($db, $post_id, $user) {\n $sql = \"SELECT by_user\n FROM Favorites\n WHERE post_id = $post_id AND by_user != '$user'\";\n $result = mysqli_query($db, $sql);\n\n $arr = array();\n while ($row = mysqli_fetch_assoc($result)) {\n array_push($arr, $row['by_user']);\n }\n\n return $arr;\n }", "public function getLikes() {\r\n $app = Aplicacion::getSingleton();\r\n $conn = $app->conexionBd();\r\n $sql = 'SELECT LP.idPost, LP.time FROM likedposts LP WHERE '.$_SESSION['user']->id().' = LP.idUser ORDER BY LP.time DESC'; // Return the user\r\n $rs = $conn->query($sql);\r\n if ($rs->num_rows > 0) {\r\n return $rs;\r\n } else return false;\r\n }", "function extract_friend_of_user($facebook_user)\n{\n\t$facebook_user_id = sqlsafestring($facebook_user['id']) ;\n\t$user_friends_related_to_app = $facebook_user['friends']['data'];\n\tforeach ($user_friends_related_to_app as $one_friend_data_id)\n\t{\n\t\t$id_of_current_friend = $one_friend_data_id['id'];\t\n\t\t$query_to_add_friend_releated_to_app = \"Insert into FriendConnection values ('\" . $facebook_user_id .\"','\". $id_of_current_friend .\"' ) \" ;\n\t\tquery_to_mysql($query_to_add_friend_releated_to_app);\n\t}\n}" ]
[ "0.67493325", "0.6411649", "0.6220996", "0.6167817", "0.61367154", "0.6129213", "0.6039838", "0.5970677", "0.59426844", "0.5939615", "0.5911081", "0.58578557", "0.5804134", "0.5793549", "0.5709435", "0.5696219", "0.56882435", "0.5680344", "0.5600215", "0.5590904", "0.5586651", "0.55847245", "0.5535166", "0.5507856", "0.5495731", "0.5482044", "0.5477656", "0.5459925", "0.54569304", "0.54336476" ]
0.6644448
1
Update the specified Report in storage.
public function update(Report $report) { $this->authorize('update',$report); $attributes = $this->validateReport(); $attributes['user_id'] = auth()->user()->type == 'admin' ? request()->get('user_id') : auth()->id(); $report->update($attributes); if (request()->wantsJson()) { return response()->JSON($report); } else { return redirect('/reports'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update( Request $request, report $report ) {\n //\n }", "public function update(Request $request, Report $report)\n {\n //\n }", "public function update(Request $request, Report $report)\n {\n //\n }", "public function update(Request $request, Report $report)\n {\n //\n }", "public function update(Request $request, Report $report)\n {\n //\n }", "public function update(Request $request, Report $report)\n {\n //\n }", "public function update(Request $request, Report $report)\n {\n //\n }", "public function update(Request $request, Report $report)\n {\n //\n }", "public function update(Request $request, Report $report)\n {\n $input = $request->all();\n\n\n $validator = Validator::make($input, [\n 'name' => 'required',\n 'detail' => 'required'\n ]);\n\n\n if($validator->fails()){\n return $this->sendError('Validation Error.', $validator->errors());\n }\n\n\n $report->name = $input['name'];\n $report->detail = $input['detail'];\n $report->save();\n\n\n return $this->sendResponse($report->toArray(), 'Report successfully updated.');\n }", "public function update(Request $request, report $report)\n {\n //\n }", "public function update(Request $request,$report)\n {\n $this->dictionaryService->getOne($request['reportType_id']);\n return $this->successResponse($this->reportService->edit($request->all(),$report));\n }", "public function actionUpdateReport()\n {\n $this->requirePostRequest();\n $this->requirePermission($this->permissions['sproutReports-editReports']);\n\n $request = Craft::$app->getRequest();\n\n $reportElement = new Report();\n\n $reportId = $request->getBodyParam('reportId');\n $settings = $request->getBodyParam('settings');\n\n if ($reportId && $settings) {\n $reportElement = SproutBaseReports::$app->reports->getReport($reportId);\n\n if (!$reportElement) {\n throw new NotFoundHttpException(Craft::t('sprout-base-reports', 'No report exists with the id “{id}”', ['id' => $reportId]));\n }\n\n $reportElement->settings = is_array($settings) ? $settings : [];\n\n if (SproutBaseReports::$app->reports->saveReport($reportElement)) {\n Craft::$app->getSession()->setNotice(Craft::t('sprout-base-reports', 'Query updated.'));\n\n return $this->redirectToPostedUrl($reportElement);\n }\n }\n\n // Encode back to object after validation for getResults method to recognize option object\n $reportElement->settings = Json::encode($reportElement->settings);\n\n Craft::$app->getSession()->setError(Craft::t('sprout-base-reports', 'Could not update report.'));\n\n // Send the report back to the template\n Craft::$app->getUrlManager()->setRouteParams([\n 'report' => $reportElement\n ]);\n\n return null;\n }", "public function update(ReportRequest $request, $id)\n {\n //\n }", "public function update(Request $request, ReportPeriod $reportPeriod)\n {\n //\n }", "public function update(Request $request, ProgressReport $progressReport)\n {\n //\n }", "public function update(Request $request, Reporte $reporte)\n {\n //\n }", "public function update(Request $request, Reported $reported)\n {\n //\n }", "public function update(Report $reports)\n { \n return redirect('/../');\n\n }", "public function edit(Report $report)\n {\n //\n }", "public function edit(Report $report)\n {\n //\n }", "public function edit(Report $report)\n {\n //\n }", "public function edit(Report $report)\n {\n //\n }", "public function edit(Report $report)\n {\n //\n }", "public function edit(Report $report)\n {\n //\n }", "public function edit(Report $report)\n {\n //\n }", "private function _sql_update_existing_report()\n {\n\n try{\n Database::instance()->begin();\n $this->save_widget();\n if(!is_object($this->chart))\n {\n $this->chart = new Model_Charts($this->chart_id);\n }\n $this->set_chart_id($this->chart->save());\n\n //echo '_sql_update_existing_report(): '.Debug::vars($this->get_data()); die();\n\t\t\t$data = $this->get_data();\n\t\t\t$data['rolledback_to_version'] = null;\n DB::update(self::MAIN_TABLE)->set($data)->where('id','=',$this->id)->execute();\n\n\t\t\t// Log the action\n\t\t\t$activity = new Model_Activity;\n\t\t\t$activity->set_item_type('report')->set_action('update')->set_item_id($this->id)->save();\n\n Database::instance()->commit();\n }\n catch(Exception $e)\n {\n Database::instance()->rollback();\n throw $e;\n }\n }", "public function update(Report $reports)\n { \n return redirect('/../');\n\n }", "public function setReport(IReport $report);", "public function edit(report $report)\n {\n //\n }", "function updateReport($companySymbol, $companyName, $reportActive, $reportUpdate,\n $reportHeadline, $reportAuthor, $researchTypeGov, $researchTypeInsider,\n $researchTypeQoe, $reportDate, $reportFileLocation, $refArray)\n {\n //TO DO\n //1. Need to add check to only update those columns that have changed or have new values\n // May be easiest to retrieve report first and allow user to change what needs to change\n //2. Make sure to update report references and remove those that need removing\n\n $result = connectToDb();\n if ($result->isError())\n {\n //error log - 'Cannot connect to db\n //$result = new Result(ERROR, 'Cannot connect to database', NULL);\n }\n else\n {\n $query = \"select id from 3da_reports \n where company_symbol = '$companySymbol'\n and report_date = '$reportDate'\";\n \n $dbresult = db_query( $query );\n if(!($dbresult))\n {\n $result = new Result(ERROR, 'Cannot run query', NULL);\n }\n else\n {\n $num_results = mysql_num_rows($dbresult);\n if ($num_results > 0)\n {\n //to do - there may be more than one row\n $row = mysql_fetch_object($dbresult);\n $reportId = $row->id;\n \n $query = \"update 3da_reports \n set company_name = '$companyName',\n report_active = '$reportActive',\n report_update = '$reportUpdate',\n report_headline = '$reportHeadline',\n report_author = '$reportAuthor',\n research_corpgov = '$researchTypeGov',\n research_insider = '$researchTypeInsider',\n research_qoe = '$researchTypeQoe',\n report_filename = '$reportFileLocation'\n where id = '$reportId'\";\n \n $dbresult = db_query( $query );\n if(!($dbresult))\n {\n $result = new Result(ERROR, 'Cannot run query', NULL);\n }\n else\n {\n $refArraySize = sizeof($refArray);\n\n //DB SUCCESS - Add rows to 3da_report_references\n if ($refArraySize > 0 ) \n {\n $query = \"insert into 3da_report_references values\";\n $index = 0;\n foreach ($refArray as $refArrayKey => $refArrayValue)\n {\n if ($index == 0) {\n $query = $query.\"('$reportId', '$refArrayValue', '$refArrayKey')\";\n }\n else\n {\n $query = $query.\",('$reportId', '$refArrayValue', '$refArrayKey')\";\n }\n $index = $index + 1;\n }\n $query = $query.\";\";\n\n $dbresult = db_query( $query );\n if(!$dbresult)\n {\n //error log - 'Cannot run query.'.mysql_error().'<BR>';\n $result = new Result(ERROR, 'Cannot run query', NULL);\n }\n else\n {\n //error log - 'Report DB Records inserted: '.mysql_affected_rows().'<BR>';\n $result = new Result(SUCCESS, 'Report updated', $dbresult);\n }\n }\n }\n }\n else\n {\n echo \"No rows match values passed in\";\n }\n }\n }\n return $result;\n }" ]
[ "0.73832583", "0.73528653", "0.73528653", "0.73528653", "0.73528653", "0.73528653", "0.73528653", "0.73528653", "0.7209944", "0.7181284", "0.68874365", "0.6847641", "0.672301", "0.6560343", "0.63997334", "0.63767844", "0.6350593", "0.6331278", "0.63185316", "0.63185316", "0.63185316", "0.63185316", "0.63185316", "0.63185316", "0.63185316", "0.62989634", "0.6291805", "0.6269267", "0.6201966", "0.61574495" ]
0.7381741
1
Store a newly created Report in storage.
public function store(Report $report) { $this->authorize('store', $report); $attributes = $this->validateReport(); $attributes['user_id'] = auth()->user()->type == 'admin' ? request()->get('user_id') : auth()->id(); $report = Report::create($attributes); if (request()->wantsJson()) { return response()->JSON($report); } else { return redirect('/reports'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(ReportCreateRequest $request)\n {\n $input = $request->all();\n $user = Auth::user();\n\n $meta = Meta::create([\n 'title' => ($request->meta_title != null) ? $request->meta_title : $request->title,\n 'description' => $request->meta_description,\n 'keywords' => $request->meta_keywords,\n ]);\n $input['meta_id'] = $meta->id;\n\n $user->reports()->create($input);\n\n $request->session()->flash('message', 'Report created successfully');\n\n return redirect()->route('admin.reports.index');\n }", "public function store(Request $request)\n {\n $this->authorize('save', Report::class);\n $report = Report::create(\n [\n 'reportData' => $request->reportData,\n 'user_id' => $request->user_id,\n 'type' => $request->type,\n ]\n );\n event(\n new LogActivity(\n __('Report type') . ' | ' . $request->type . ' | #' . $report->id,\n __('Report saved'),\n __('Report')\n )\n );\n return redirect(route('home'))\n ->with('success', __('Report saved successfully'));\n }", "public function store(Requests\\StoreReportRequest $request)//StoreReportRequest $request\n\t{\n\t\t\n\t\tif(Report::create($request->all())){\n\t\t\t//return redirect('pages.home');\n\t\t\t$data = $request->all();\n \t\n\t\tevent (new UserCreateReport($data));\n\t\t//return Request::all();\n\t\tflash('Usuario guardado correctamente');\n\n\t\treturn redirect()->back();// es temporal\n\n\t\t//return view('pages.home' , compact('reports' , 'data'));\n\t\t}\n\t\t\n\t\t \n\t\t\n\n\t\n\n\t}", "public function store(Request $request)\n { \n $this->authorize('store', Report::class);\n $user = auth()->user();\n $validator = $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required',\n 'group' => 'required',\n 'tags' => 'required'\n ]);\n\n $fields = $request->only(['title', 'description']);\n $fields['user_id'] = $user->id;\n $fields['group_title'] = $request->group;\n $report = Report::create($fields);\n\n $this->reportStoringServices->createAndAttachTags($report, $request->tags);\n\n if($request->photos) {\n $uploadStatus = $this->reportStoringServices->storeFiles($request->photos, config('files.allowedImagesExtensions'), $report->id);\n if (!$uploadStatus)\n return $this->invalidFiles();\n }\n if($request->audios) {\n $uploadStatus = $this->reportStoringServices->storeFiles($request->audios, config('files.allowedAudioFilesExtensions'), $report->id);\n if (!$uploadStatus)\n return $this->invalidFiles();\n } \n flash('Successfully created report: '.$report->title)->success();\n return redirect()->route('reports.index'); \n }", "public function store(Request $request)\n {\n \n $validatedData = $request->validate([\n 'report_date' => ['required'],\n 'report' => ['required', 'mimetypes:application/pdf', 'max:10000'],\n ]);\n\n if($request->hasFile('report'))\n {\n // get file\n $filenameWithExt = $request->file('report')->getClientOriginalName();\n $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);\n $filename = str_replace(' ', '', $filename);\n $ext = $request->file('report')->getClientOriginalExtension();\n $storedname = $filename.'_'.time().'.'.$ext;\n $store = $request->file('report')->storeAs('public/uploads/employees/' . Auth::user()->id .'/reports/', $storedname);\n if($store)\n {\n $clpath = Storage::url($storedname);\n $imgfile = str_replace('/storage/', 'storage/uploads/employees/' . Auth::user()->id . '/reports/', $clpath);\n }\n }else\n {\n $imgfile = NULL;\n }\n\n $report = Report::create([\n 'user_id' => AUTH::user()->id,\n 'category_id' => AUTH::user()->category_id,\n 'report_date' => $request->report_date,\n 'report' => $imgfile,\n ]); \n \n Session::flash('success', 'You have successfully uploaded a report.');\n return redirect()->back();\n }", "public function store(MonthlyReportRequest $request)\n { \n //Creating the new report\n $report = $this->report->create($request->all());\n\n //If the student is absent, it is not necessary create the sessions\n if($report->student_present == true ){\n\n //Creating the new sessions \n $sessionsIds = array();\n foreach ($request->input('new', array()) as $id => $sessionData)\n { \n $session = new Session;\n $session->fill($sessionData);\n $session->monthly_report_id = $report->id;\n $session->save();\n }\n }\n \n\n //Sending the user to the monthly report\n return redirect()->route('monthlyreport/index');\n }", "public function store(CreateReportingRequest $request)\n {\n $this->reporting->create($request->all());\n\n return redirect()->route('admin.reporting.reporting.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('reporting::reportings.title.reportings')]));\n }", "public function store ()\n {\n $report = Report::create (Input::all ());\n $report->user_id = Input::get ('user_id');\n $id = $report->save ();\n\n if ( ! empty($report->reply)) {\n /* Send System message*/\n $sysmsg = new SystemMessage();\n $sysmsg->user_id = Input::get ('user_id');\n $sysmsg->title = 'Reply for Report';\n $sysmsg->content = $report->reply;\n $sysmsg->save ();\n }\n\n return redirect ('admin/report/' . $report->id)\n ->with ('tips' , 'create new report success!');\n\n }", "function createReport()\n\t{\n\t\tif (!empty($this->data)) \n\t\t{ \n\t\t\t//Determine if user is pulling existing report or deleting report\n\t\t\tif(isset($this->params['form']['existing']))\n\t\t\t{\n\t\t\t\tif($this->params['form']['existing']=='Pull')\n\t\t\t\t{\n\t\t\t\t\t//Pull report\n\t\t\t\t\t$this->Report->pull_report($this->data['Misc/saved_reports']); \n\t\t\t\t}\n\t\t\t\telse if($this->params['form']['existing']=='Delete')\n\t\t\t\t{\n\t\t\t\t\t//Delete report\n\t\t\t\t\t$this->Report->delete_report($this->data['Misc']['saved_reports']);\n\n\t\t\t\t\t//Return user to form\n\t\t\t\t\t$this->flash('Your report has been deleted.','/'.$this->name.'/'.$this->action.'');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//Filter out fields\n\t\t\t\t$this->Report->init_display($this->data);\n\t\t\t\t\n\t\t\t\t//Set sort parameter\n\t\t\t\tif(!isset($this->params['form']['order_by_primary'])) { $this->params['form']['order_by_primary']=NULL; }\n\t\t\t\tif(!isset($this->params['form']['order_by_secondary'])) { $this->params['form']['order_by_secondary']=NULL; }\n\t\t\t\t$this->Report->get_order_by($this->params['form']['order_by_primary'], $this->params['form']['order_by_secondary']);\n\n\t\t\t\t//Store report name\n\t\t\t\tif(!empty($this->params['form']['report_name']))\n\t\t\t\t{\n\t\t\t\t\t$this->Report->save_report_name($this->params['form']['report_name']);\n\t\t\t\t}\n\n\t\t\t\t//Store report if save was executed\n\t\t\t\tif($this->params['form']['submit']=='Create And Save Report')\n\t\t\t\t{\n\t\t\t\t\tif(empty($this->params['form']['report_name']))\n\t\t\t\t\t{\n\t\t\t\t\t\t//Return user to form\n\t\t\t\t\t\t$this->flash('Must enter a report name when saving.','/'.$this->name.'/'.$this->action.'');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->Report->save_report();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Set report fields\n\t\t\t$this->set('report_fields', $this->Report->report_fields);\n\n\t\t\t//Set report name\n\t\t\t$this->set('report_name', $this->Report->report_name);\n\n\t\t\t//Allow search to go 2 associations deep\n\t\t\t$this->{$this->modelClass}->recursive = 2;\n\n\t\t\t//Set report data\n\t\t\tprint_r($this->Report->order_by);\n\t\t\t$this->set('report_data', $this->{$this->modelClass}->find('list',array('order' => $this->Report->order_by)));\n\t\t} \n\t\telse\n\t\t{\n\t\t\t//Setup options for report component\n\t\t\t/*\n\t\t\t\tYou can setup a level two association by doing the following:\n\t\t\t\t\"VehicleDriver\"=>\"Employee\" ie $models = Array (\"Vehicle\", \"VehicleDriver\"=>\"Employee\");\n\t\t\t\tPlease note that all fields within a level two association cannot be sorted.\n\t\t\t*/\n\t\t\t$models =\tArray (\"Banco\",'Marca','Linea','Temporada');\n\n\t\t\t//Set array of fields\n\t\t\t$this->set('report_form', $this->Report->init_form($models));\n\n\t\t\t//Set current controller\n\t\t\t$this->set('cur_controller', $this->name);\n\n\t\t\t//Pull all existing reports\n\t\t\t$this->set('existing_reports', $this->Report->existing_reports());\n\t\t}\n\t}", "public function store(CreateLabReportsRequest $request)\n\t{\n\t $request = $this->saveFiles($request);\n\t\tLabReports::create($request->all());\n\n\t\treturn redirect()->route(config('quickadmin.route').'.labreports.index');\n\t}", "public function store(Request $request)\n {\n $this->dictionaryService->getOne($request['reportType_id']);\n return $this->successResponse($this->reportService->create($request->all()), Response::HTTP_CREATED);\n }", "public function store(CreateReportsRequest $request)\n {\n $input = $request->all();\n\n $reports = $this->reportsRepository->create($input);\n\n Flash::success('Reports saved successfully.');\n\n return redirect(route('backend.reports.index'));\n }", "public function store(Request $request, Reported $reported)\n {\n //\n }", "public function store(Request $request)\n {\n $Report = new report;\n $Report->description = $request->description;\n $Report->lat = $request->lat;\n $Report->lng = $request->lng;\n $Report->reported_by = $request->id;\n $saved = $Report->save();\n if($saved) {\n return [\n 'Success' => true,\n 'Message' => 'Report successfully created' \n ];\n }else {\n return [\n 'Success' => false,\n 'Message' => 'Something went wrong' \n ];\n }\n }", "public function store(Request $request)\n {\n if (!Auth::check()) {\n return redirect()->route('report.index');\n }\n $title = $request->input('title');\n $reported_at = strtotime($request->input('reported_at'));\n $pic_url = $request->input('pic_url');\n $company_id = 1;\n $content = $request->input('content', '');\n $report = Report::create([\n 'title' => $title,\n 'reported_at' => $reported_at,\n 'content' => $content,\n 'pic_url' => $pic_url,\n 'company_id' => $company_id,\n ]);\n ReportTimeLine::create(['report_id' => $report->id, 'time_line_id' => TimeLine::first()->id]);\n if ($request->input('continue')) {\n return redirect()->route('report.create')->with(['success' => $title . ' 已成功建立']);\n }\n return redirect()->route('report.index');\n }", "public function store(ReportRequest $request): RedirectResponse\n {\n $file = $this->fileUploadService->uploadFile($request, Report::path());\n\n $report = new Report();\n\n $report->name = $request->name;\n $report->month = $request->month;\n $report->entries = $request->entries;\n $report->exits = $request->exits;\n $report->balance = $request->entries - $request->exits;\n $report->file_id = $file->id;\n\n $report->save();\n\n toast('Relatório cadastrado com sucesso!','success');\n\n return redirect()->route('reports.index');\n }", "public function store(CreateReportsRequest $request)\n\t{\n\n\t\t$userId = parent::getUserId();\n\n\t\t$input = array(\n\t\t\t'user_id' => $userId,\n\t\t\t'location_id' => $request->get('location_id'),\n\t\t\t'brand_id' => $request->get('brand_id'),\n\t\t\t'area_range' => $request->get('area_range'),\n\t\t\t'name' => $request->get('name'),\n\t\t\t'search_group' => $request->get('search_group')\n\t\t);\n\n\t\t$bInserted = Reports::create($input);\n\n\t\tif($bInserted){\n\t\t\t$bStatus = true;\n\t\t\t$sMessage = \"Saved successfully\";\n\t\t\t$iStatusCode = 201;\n\n\t\t}else{\n\t\t\t$bStatus = false;\n\t\t\t$sMessage = \"Error saving\";\n\t\t\t$iStatusCode = 204;\n\n\t\t}\n\t\n\t\t$aReturnData = array(\n\t\t\t'status' => $bStatus,\n\t \t'message' => $sMessage\n\t );\n\n\t\treturn Response::json($aReturnData,$iStatusCode);\n\n\t}", "public function store()\n { \n \n $client = $_POST['client'];\n $pracid = Session::get('userid');\n\n $reports = new Report;\n $reports->userid = $client;\n $reports->step = '1';\n $reports->date = Carbon::now();\n $reports->status = 'Pending Review';\n $reports->prac_id = $pracid;\n $reports->updated_at = Carbon::now();\n $reports->save();\n\n $totalAnswers = count(Question::where('step','=',1)->lists('id'));\n\n for($a = 1; $a < $totalAnswers+1; $a++) \n {\n $reports->questions()->attach($a, array('answers' => $_POST['answersid'][$a]));\n }\n\n return redirect('practitioner/dashboard');\n }", "public function store(Request $request)\n {\n $report = Report::create([\n 'name'=>$request->name,\n 'id_no'=>$request->id_no,\n 'dose_no'=>$request->dose_no,\n 'health_facility_id'=>$request->facility\n ]);\n\n return redirect()->back();\n }", "public function store(Request $request)\n {\n $request->validate\n ([\n 'description' => 'required',\n ]);\n\n if(Auth::check()){\n $report=Report::create([\n 'description'=> $request->input('report'),\n 'user_id' => Auth::id()\n ]);\n\n if($report){\n return redirect()->route('properties.index')->with('success','New Report Successfuly Added');\n }\n }\n }", "public function store()\n {\n $this->storage->set($this);\n\n }", "public function store(Request $request)\n {\n $this->expenseReportService->store($request);\n }", "public function storeReportAction() {\n if (!Auth::isAuth()) {\n return $this->redirect($this->generateUrl('login_register'));\n }\n \n $allowed_frequencies = array('weekly', 'monthly', 'quarterly');\n \n $request = $this->getRequest();\n $project_hash = $request->get('project_hash', false);\n if(!$project_hash) {\n $this->get('session')->setFlash('error', 'The request is incorrect.');\n return $this->redirect($request->headers->get('referer'));\n }\n $em = $this->getDoctrine()->getEntityManager();\n $project = $em->getRepository('FrontFrontBundle:Project')->getProjectByHash(Auth::getAuthParam('id'), $project_hash);\n \n if(empty($project)) { // check if user owns project\n $this->get('session')->setFlash('error', 'The request is incorrect.');\n return $this->redirect($request->headers->get('referer'));\n }\n \n $request_params = $request->request->all();\n $report_title = $request->get('report_title');\n $report_desc = $request->get('report_desc');\n $frequency = $request->get('frequency');\n \n if(!in_array($frequency, $allowed_frequencies)) {\n $this->get('session')->setFlash('error', 'The request is incorrect.');\n return $this->redirect($request->headers->get('referer'));\n }\n \n $send_me = $request->get('send_me');\n \n unset($request_params['project_hash'], $request_params['report_title'], $request_params['report_desc'], $request_params['frequency'], $request_params['send_me'], $request_params['modify_id']);\n \n $modify_id = $request->get('modify_id');\n if(is_numeric($modify_id)) { // if modifying a report\n $report_data = $em->getRepository('FrontFrontBundle:ProjectReport')->getReportData(Auth::getAuthParam('id'), $modify_id);\n if(empty($report_data)) { // user does not own report\n $this->get('session')->setFlash('error', 'The request is incorrect.');\n return $this->redirect($request->headers->get('referer'));\n } else {\n $em->getRepository('FrontFrontBundle:ProjectReport')->updateReport($modify_id, $report_title, $report_desc, $frequency, $send_me, serialize($request_params));\n }\n } else {\n $em->getRepository('FrontFrontBundle:ProjectReport')->saveReport($project['id'], $report_title, $report_desc, $frequency, $send_me, serialize($request_params));\n }\n \n\n $this->get('session')->setFlash('notice', 'Operation successfull.');\n return $this->redirect($this->generateUrl('account_report_list').'?hash='.$project_hash);\n }", "public function store(Request $request)\n {\n // TODO add validator\n $report = new Report();\n $report->desc = $request->desc;\n $report->charity = $request->charity;\n $report->skipped = $request->skipped;\n $report->save();\n return $this->respond(['data' => ['status' => 'ok', 'report' => $this->reportTransformer->transform($report)]]);\n\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'title' => 'required',\n 'description' => 'required',\n 'category_id' => 'required|exists:categories,id'\n\n ]);\n \n $report = Report::create([\n 'finder_id' => auth()->id(),\n 'title' => request('title'),\n 'category_id' => request('category_id'),\n 'description' => request('description')\n ]);\n\n return response()->json([\n 'report' => $report,\n 'message' => 'Report successfully submitted'\n ]);\n }", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t\t$tanggalawal = Request::input('tanggalawal');\n\t\t$tanggalakhir = Request::input('tanggalakhir');\n\t\t$idsupp = Request::input('idsupp');\n\t\t$belis = Beli::where('tglorderbeli', '>=', $tanggalawal)\n \t\t\t\t->where('tglorderbeli', '<=', $tanggalakhir)\n \t\t\t\t->where('idsupp', 'like', $idsupp)->get();\n\t\t$pdf = PDF::loadView('owner.report.pdf.reportpurchaseperiod', compact('belis', 'tanggalawal', 'tanggalakhir', 'idsupp'));\n\t\treturn $pdf->setPaper('a4')->stream('reportpurchaseperiod' . '.pdf');\n\t}", "public function store() {\n\t\t//\n\t}", "public function store() {\n\t\t//\n\t}", "public function store() {\n\t\t//\n\t}" ]
[ "0.7448054", "0.7076878", "0.6963399", "0.69505554", "0.6908089", "0.6726051", "0.67148334", "0.66788733", "0.66268355", "0.65843874", "0.6551295", "0.652301", "0.6513425", "0.64596003", "0.6458813", "0.64265764", "0.63663", "0.6345978", "0.6341576", "0.62882334", "0.62812185", "0.62575835", "0.62551415", "0.6220343", "0.621522", "0.6167366", "0.61498946", "0.61406565", "0.61406565", "0.61406565" ]
0.75890386
0
Validate the specified report.
protected function validateReport() { return request()->validate([ 'control_definition_id' => 'required', 'instance_id' => 'required', 'json_data' => 'required|json', 'active' => 'required' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validate($reportErrors = true){\n $this->_validator->validate($this->_data); \n if ($reportErrors) {\n if (count($this->_validator->errors()) > 0) {\t\n foreach ($this->_validator->errors() as $idx => $field){\n foreach($field as $eidx => $error) {\n $this->_message_stream->addMessage(\"danger\", $error);\n }\n }\n }\n }\n if (count($this->_validator->errors()) > 0) {\n return false;\n }\n return true;\n }", "public function testValidate(): void {\n $obj = new Magento\\Report('My Title', '21-05-11 03:25:00', 'My Content');\n $result = $obj->validate();\n\n $this->assertIsBool($result);\n $this->assertEquals(1, $result);\n $this->assertNotEquals(0, $result);\n\n // When Properties are not defined\n $obj = new Magento\\Report();\n $result = $obj->validate();\n\n $this->assertIsBool($result);\n $this->assertEquals(0, $result);\n $this->assertNotEquals(1, $result);\n }", "public function renderReport(Report $report)\n {\n $registered = array();\n\n $writer = $this->getWriter();\n $writer->write('<?xml version=\"1.0\"?>' . PHP_EOL);\n $writer->write('<phpmd-baseline>' . PHP_EOL);\n\n foreach ($report->getRuleViolations() as $violation) {\n $ruleName = get_class($violation->getRule());\n $filePath = Paths::getRelativePath($this->basePath, $violation->getFileName());\n $methodName = $violation->getMethodName();\n\n // deduplicate similar violations\n $key = $ruleName . $filePath . $methodName;\n if (isset($registered[$key])) {\n continue;\n }\n\n $xmlTag = sprintf(\n ' <violation rule=\"%s\" file=\"%s\"%s/>' . PHP_EOL,\n $ruleName,\n $filePath,\n $methodName === null ? '' : ' method=\"' . $methodName . '\"'\n );\n $writer->write($xmlTag);\n $registered[$key] = true;\n }\n\n $writer->write('</phpmd-baseline>' . PHP_EOL);\n }", "public function testGetAllValidReports() : void {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"report\");\n\n\t\t$reportId = generateUuidV4();\n\t\t// create a new Report and insert to into mySQL\n\t\t$report = new Report($reportId, $this->category->getCategoryId(), $this->VALID_REPORTCONTENT, $this->VALID_REPORTDATETIME, $this->VALID_IPADDRESS, $this->VALID_REPORTLAT, $this->VALID_REPORTLONG, $this->VALID_STATUS, $this->VALID_URGENCY, $this->VALID_USERAGENT);\n\t\t$report->insert($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$results = Report::getAllReports($this->getPDO());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"report\"));\n\t\t$this->assertCount(1, $results);\n\t\t$this->assertContainsOnlyInstancesOf(\"Edu\\\\Cnm\\\\Infrastructure\\\\Report\", $results);\n\n\t\t// grab the result from the array and validate it\n\t\t$pdoReport = $results[0];\n\t\t$this->assertEquals($pdoReport->getReportId(), $report->getReportId());\n\t\t$this->assertEquals($pdoReport->getReportCategoryId(), $this->category->getCategoryId());\n\t\t$this->assertEquals($pdoReport->getReportContent(), $this->VALID_REPORTCONTENT);\n\t\t//format the date too seconds since the beginning of time to avoid round off error\n\t\t$this->assertEquals($pdoReport->getReportDateTime()->getTimestamp(), $this->VALID_REPORTDATETIME->getTimestamp());\n\t\t$this->assertEquals($pdoReport->getReportIpAddress(), $this->VALID_IPADDRESS);\n\t\t$this->assertEquals($pdoReport->getReportLat(), $this->VALID_REPORTLAT);\n\t\t$this->assertEquals($pdoReport->getReportLong(), $this->VALID_REPORTLONG);\n\t\t$this->assertEquals($pdoReport->getReportStatus(), $this->VALID_STATUS);\n\t\t$this->assertEquals($pdoReport->getReportUrgency(), $this->VALID_URGENCY);\n\t\t$this->assertEquals($pdoReport->getReportUserAgent(), $this->VALID_USERAGENT);\n\t}", "public function testGetAllValidReportsByUrgency() : void {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"report\");\n\n\t\t$reportId = generateUuidV4();\n\t\t// $reportCategoryId = generateUuidV4();\n\t\t// create a new Report and insert to into mySQL\n\t\t$report = new Report($reportId, $this->category->getCategoryId(), $this->VALID_REPORTCONTENT, $this->VALID_REPORTDATETIME, $this->VALID_IPADDRESS, $this->VALID_REPORTLAT, $this->VALID_REPORTLONG, $this->VALID_STATUS, $this->VALID_URGENCY, $this->VALID_USERAGENT);\n\t\t$report->insert($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$results = Report::getReportByReportUrgency($this->getPDO(), $this->VALID_URGENCY);\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"report\"));\n\t\t$this->assertCount(1, $results);\n\t\t$this->assertContainsOnlyInstancesOf(\"Edu\\\\Cnm\\\\Infrastructure\\\\Report\", $results);\n\n\t\t// grab the result from the array and validate it\n\t\t$pdoReport = $results[0];\n\t\t$this->assertEquals($pdoReport->getReportId(), $report->getReportId());\n\t\t$this->assertEquals($pdoReport->getReportCategoryId(), $this->category->getCategoryId());\n\t\t$this->assertEquals($pdoReport->getReportContent(), $this->VALID_REPORTCONTENT);\n\t\t//format the date too seconds since the beginning of time to avoid round off error\n\t\t$this->assertEquals($pdoReport->getReportDateTime()->getTimestamp(), $this->VALID_REPORTDATETIME->getTimestamp());\n\t\t$this->assertEquals($pdoReport->getReportIpAddress(), $this->VALID_IPADDRESS);\n\t\t$this->assertEquals($pdoReport->getReportLat(), $this->VALID_REPORTLAT);\n\t\t$this->assertEquals($pdoReport->getReportLong(), $this->VALID_REPORTLONG);\n\t\t$this->assertEquals($pdoReport->getReportStatus(), $this->VALID_STATUS);\n\t\t$this->assertEquals($pdoReport->getReportUrgency(), $this->VALID_URGENCY);\n\t\t$this->assertEquals($pdoReport->getReportUserAgent(), $this->VALID_USERAGENT);\n\t}", "function Run_Report()\n\t{\n\t\t$this->start_date = date('YmdHis');\n\t\t$this->end_date = date('YmdHis',strtotime('-1 year'));\n\t\t\n\t\t// Build the list for the files\t\n\t\t$full_list = new stdClass();\n\t\t$full_list->error_list = $this->Get_Error_List();\n\n\n\t\t\n\t\t// Build the fulfillment file\n\t\tif($full_list->error_list > 0 )\n\t\t{\n\t\t\t$error_file = $this->Build_Error_File($full_list->error_list);\n\t\t}\n\t\t\t\t\n\t\t$this->Mail_Files($error_file);\n\t\t\n\t\treturn TRUE;\n\t}", "public function validateData()\n {\n\t\t// 1%-5% of data lost is orange. greater is red\n\t\t// 1%-5% of the lines rejected is orange. greater is red\n\t\t// no records collected is red\n\t\t// 5 - 10 different node counts is orange, 11+ is red\n\t\t// \n\t\t// any encoding rejects is orange\n\t\t// any short rejects is orange\n\n //setup report array\n $this->_reportStatus = [\n 'green' => [],\n 'orange' => [],\n 'red' => []\n ];\n\n //run tests\n $this->_reportDataLostError();\n $this->_reportNoRecordsCollected();\n $this->_reportVariableNodeCounts();\n $this->_reportUtf8EncodingReject();\n $this->_reportTooShort();\n\n //add raw data report\n $this->_reportStatus['raw'] = [\n\t\t\t'Nummber of records collected' => count($this->_items),\n 'Number of records that included non UTF-8 encoding' => $this->_count_encoding_rejects,\n\t\t\t\"Character count in UTF-8 reject records\" => $this->_reject_char_count,\n 'Number of records with too few columns' => $this->_count_too_short,\n\t\t\t'Character count lost in rejected short records' => $this->_short_char_count,\n 'Number of records that weren\\'t arrays' => $this->_count_not_array,\n 'Number of rejected catalogs' => $this->_reject_catalog,\n\t\t\t'Column counts and how many records had each count' => $this->_count_nodes,\n ];\n }", "public function testInsertValidReport() : void {\n\t// count the number of rows and save it for later\n\t$numRows = $this->getConnection()->getRowCount(\"report\");\n\n\t$reportId = generateUuidV4();\n\t// create a new Report and insert to into mySQL\n\t$report = new Report($reportId, $this->category->getCategoryId(), $this->VALID_REPORTCONTENT, $this->VALID_REPORTDATETIME, $this->VALID_IPADDRESS, $this->VALID_REPORTLAT, $this->VALID_REPORTLONG, $this->VALID_STATUS, $this->VALID_URGENCY, $this->VALID_USERAGENT);\n\t$report->insert($this->getPDO());\n\n\t// grab the date from mySQL and enforce the fields match our expectations\n\t\t$pdoReport = Report::getReportByReportId($this->getPDO(), $report->getReportId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"report\"));\n\t\t$this->assertEquals($pdoReport->getReportId(), $reportId);\n\t\t$this->assertEquals($pdoReport->getReportCategoryId(), $this->category->getCategoryId());\n\t\t$this->assertEquals($pdoReport->getReportContent(), $this->VALID_REPORTCONTENT);\n\t\t$this->assertEquals($pdoReport->getReportIpAddress(), $this->VALID_IPADDRESS);\n\t\t// format the date to seconds since the beginning of time to avoid round off error\n\t\t$this->assertEquals($pdoReport->getReportDateTime()->getTimestamp(), $this->VALID_REPORTDATETIME->getTimestamp());\n\t\t$this->assertEquals($pdoReport->getReportUserAgent(), $this->VALID_USERAGENT);\n\t\t$this->assertEquals($pdoReport->getReportLat(), $this->VALID_REPORTLAT);\n\t\t$this->assertEquals($pdoReport->getReportLong(), $this->VALID_REPORTLONG);\n\t\t$this->assertEquals($pdoReport->getReportStatus(), $this->VALID_STATUS);\n\t\t$this->assertEquals($pdoReport->getReportUrgency(), $this->VALID_URGENCY);\n\t}", "public static function validate() {}", "public function validate();", "public function validate();", "public function validate();", "public function testGetAllValidReportsByStatus() : void {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"report\");\n\n\t\t$reportId = generateUuidV4();\n\t\t// $reportCategoryId = generateUuidV4();\n\t\t// create a new Report and insert to into mySQL\n\t\t$report = new Report($reportId, $this->category->getCategoryId(), $this->VALID_REPORTCONTENT, $this->VALID_REPORTDATETIME, $this->VALID_IPADDRESS, $this->VALID_REPORTLAT, $this->VALID_REPORTLONG, $this->VALID_STATUS, $this->VALID_URGENCY, $this->VALID_USERAGENT);\n\t\t$report->insert($this->getPDO());\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$results = Report::getReportByReportStatus($this->getPDO(), $this->VALID_STATUS);\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"report\"));\n\t\t$this->assertCount(1, $results);\n\t\t$this->assertContainsOnlyInstancesOf(\"Edu\\\\Cnm\\\\Infrastructure\\\\Report\", $results);\n\t\t// grab the result from the array and validate it\n\t\t$pdoReport = $results[0];\n\t\t$this->assertEquals($pdoReport->getReportId(), $report->getReportId());\n\t\t$this->assertEquals($pdoReport->getReportCategoryId(), $this->category->getCategoryId());\n\t\t$this->assertEquals($pdoReport->getReportContent(), $this->VALID_REPORTCONTENT);\n\t\t$this->assertEquals($pdoReport->getReportIpAddress(), $this->VALID_IPADDRESS);\n\t\t//format the date too seconds since the beginning of time to avoid round off error\n\t\t$this->assertEquals($pdoReport->getReportDateTime()->getTimestamp(), $this->VALID_REPORTDATETIME->getTimestamp());\n\t\t$this->assertEquals($pdoReport->getReportUserAgent(), $this->VALID_USERAGENT);\n\t\t$this->assertEquals($pdoReport->getReportLat(), $this->VALID_REPORTLAT);\n\t\t$this->assertEquals($pdoReport->getReportLong(), $this->VALID_REPORTLONG);\n\t\t$this->assertEquals($pdoReport->getReportStatus(), $this->VALID_STATUS);\n\t\t$this->assertEquals($pdoReport->getReportUrgency(), $this->VALID_URGENCY);\n\t}", "public function validate() {\n $this->validator->run();\n }", "public abstract function validate();", "abstract protected function doReport(array $input_params,array $report_params) : bool ;", "public function __construct(Report $report)\n {\n $this->report = $report;\n }", "public function __construct(Report $report)\n {\n $this->report = $report;\n }", "public function __construct(Report $report)\n {\n $this->report = $report;\n }", "public function show(report $report)\n {\n \n }", "abstract public function validate();", "abstract public function validate();", "abstract public function validate();", "abstract public function validate();", "abstract public function validate();", "abstract public function validate();", "abstract public function validate();", "abstract public function validate();", "abstract protected function validate();", "abstract protected function validate();" ]
[ "0.65099114", "0.6345092", "0.59439635", "0.5684092", "0.56570095", "0.5622393", "0.54792386", "0.54687536", "0.5459185", "0.5456733", "0.5456733", "0.5456733", "0.5445381", "0.54423577", "0.54338384", "0.5433611", "0.5417207", "0.5417207", "0.5417207", "0.5404474", "0.5398089", "0.5398089", "0.5398089", "0.5398089", "0.5398089", "0.5398089", "0.5398089", "0.5398089", "0.53812003", "0.53812003" ]
0.7511662
0
Commit the current session, if necessary. If an anonymous user already has an empty session, destroy it.
function phpSessionCommit() { if (empty($_SESSION)) { if (phpSessionStarted() && phpSessionSaveSession()) { // Destroy empty anonymous sessions. phpSessionDestroy(); } } else if (phpSessionSaveSession()) { if (!phpSessionStarted()) { phpSessionStart(); } // Write the session data. session_write_close(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function commit(): void\n {\n \\session_write_close();\n\n //update status\n $this->status = \\session_status();\n }", "public function emptySession() {\n\t\t$this->_EmptyCurrentSession();\n\t\t$this->newSession(FALSE);\n\t}", "protected function updateSession(): void\n {\n if ($this->authz->isLoggedOut()) {\n $this->timestamp = null;\n $this->session->clear();\n\n return;\n }\n\n $user = $this->authz->user();\n $context = $this->authz->context();\n\n $uid = $user->getAuthId();\n $cid = $context !== null ? $context->getAuthId() : null;\n $checksum = $user->getAuthChecksum();\n\n $this->session->persist($uid, $cid, $checksum, $this->timestamp);\n }", "public function commit()\r\n {\r\n $this->logout();\r\n $this->connect($this->host);\r\n $this->login($this->username, $this->password);\r\n }", "public function flush()\n {\n $this->session->forget($this->storageKey);\n }", "protected function logout() {\n\n if(session_status() == PHP_SESSION_ACTIVE) {\n\n $sql = 'DELETE FROM `user_sessions` WHERE (`session_id` = ?)';\n $param = array(session_id());\n $this->insert($sql, $param);\n }\n }", "public function flush() {\t\t$_SESSION = array ();\r\n\t\tsession_destroy ();\r\n\t\t$this->refresh ();\r\n\t}", "protected function ensureSession() {\n if ($this->currentUser->isAnonymous() && !$this->sessionManager->isStarted()) {\n // Add something to $_SESSION so the session ID will persist.\n // TODO: Replace this with something cleaner once core provides it.\n // See https://www.drupal.org/node/2865991.\n $_SESSION['flag'] = TRUE;\n $this->sessionManager->start();\n }\n }", "public function endSession()\n {\n $this->_iState = 0;\n $_SESSION['authstate'] = 0;\n setcookie('access_token', '', 0);\n setcookie('access_token_secret', '', 0);\n }", "public function close() {\n\t\tif ($this->isModified) {\n\t\t\t$encryptedValue = $this->crypto->encrypt(json_encode($this->sessionValues), $this->passphrase);\n\t\t\t$this->session->set(self::encryptedSessionName, $encryptedValue);\n\t\t\t$this->isModified = false;\n\t\t}\n\t\t$this->session->close();\n\t}", "private function emptySession() {\n\t\t$_SESSION = array();\n\t}", "public static function flush()\n {\n \t$_SESSION = array();\n }", "public function clearIdentity()\n {\n $this->session->clear('user');\n\n // Clears all session data and regenerates session ID\n $this->session->destroy();\n\n }", "public static function logout()\n {\n if (!empty(Myy::$app) && !empty(Myy::$app->getSession())) {\n Myy::$app->getSession()->close();\n }\n Myy::$user_id = 0;\n }", "public function flush()\n\t{\n\t\tself::__init();\n\t\t$_SESSION = [];\n\t}", "public function clearSession();", "public function logout()\n {\n eaGB_Session::write('userId', null);\n eaGB_Session::write('validUntil', null);\n eaGB_Session::regenerate();\n $this->loggedIn = false;\n }", "public function logout()\n\t{\n\t\t$this->create_session();\n\t}", "public function clear() {\n\t\ttry {\n\t\t\t$this->_db->query('DELETE FROM session WHERE sid = ?', array($_COOKIE['PHPSESSID']));\n\t\t} catch (Exception $ex) {\n\t\t\tthrow new Zend_Auth_Storage_Exception();\n\t\t}\n\t}", "public function commit()\n {\n if ($this->txns == 1) {\n $this->conn->getPDO()->commit();\n }\n $this->txns = max(0, $this->txns - 1);\n }", "public function logout(){\n\n\t\t$this->session_manager->finish();\n\t\n\t}", "public function flush()\n {\n $this->session['data'] = [\n 'csrf_token' => $this->token(),\n ':new:' => [],\n ':old:' => []\n ];\n }", "public function flush()\n\t{\n\t\t$this->session['data'] = array(\n\t\t\t':new:' => array(),\n\t\t\t':old:' => array(),\n\t\t);\n\t}", "function destroy_current_session() {\n // TODO destroy the session file completely\n }", "function destroy_current_session() {\n // TODO destroy the session file completely\n }", "public function clear(): void\n {\n $_SESSION = [];\n session_regenerate_id(true);\n }", "public static function save()\n {\n session_write_close();\n }", "public function __destruct() { session_write_close(); }", "public function logOut()\n {\n $user_session = new Container('user');\n $user_session->getManager()->getStorage()->clear('user');\n $this->setCurrentUser(null);\n }", "public function endSession() {\n if ($this->sessionStarted === false) {\n // we should ensure that init has been called.\n throw new PersistentSessionException ( \"Please call the init before invoking startSession\" );\n } else if ($this->isActiveSession ()) {\n\n // there is a active session available\n // delete the session from database\n $this->model->deleteSession ( $this->session );\n\n // deleted from database now its time for cookie!\n $this->writeClientCookie ( $this->session->clientKey, (time () - 3600) );\n\n // and unset the object itself\n $this->session = null;\n\n }\n }" ]
[ "0.7085134", "0.64747226", "0.644941", "0.61655504", "0.61195725", "0.6088849", "0.6056969", "0.60050666", "0.5968106", "0.5961526", "0.59271884", "0.5904449", "0.58348024", "0.5808433", "0.577231", "0.5770498", "0.57669246", "0.5717686", "0.57091725", "0.5708362", "0.5687455", "0.56834626", "0.5680995", "0.5679934", "0.5679934", "0.5661436", "0.5644709", "0.5611556", "0.5611482", "0.5608899" ]
0.77339894
0
Drops the wp_session table on plugin deactivation
function phpSessionUninstall() { global $wpdb; $table_name = $wpdb->prefix . 'session'; $wpdb->query("DROP TABLE IF EXISTS $table_name"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function DeleteUpgradeSession()\n\t{\n\t\t$query = \"DROP TABLE [|PREFIX|]upgrade_session\";\n\t\t$GLOBALS['ISC_CLASS_DB']->Query($query);\n\t}", "function bpax_trigger_deactivating_plugin() {\n\tglobal $wpdb;\n\t$table_name = $wpdb->prefix . 'ware2go_api_logs_bpax';\n\t$sql = \"DROP TABLE IF EXISTS $table_name;\";\n\t$wpdb->query( $sql );\n}", "public function on_plugin_uninstall() {\n\t\tglobal $wpdb;\n\t\t$sql = 'DROP TABLE ' . SA_DB_TABLE . ';';\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\tdbDelta($sql);\n\t}", "public function unplug(){\n session_destroy();\n header('Location: index.php');\n }", "public static function plugin_deactivation( ) {\n\t\t//tidy up\n\t\tglobal $wpdb;\n\t\t\n\t\t$prefix = $wpdb->prefix.'dekaagcrm_';\n\t\t\n\t\t$wpdb->query(\"DELETE * FROM {$prefix}diploma\");\n\t\t\n\t\t$wpdb->query(\"DELETE * FROM {$prefix}form_row\");\n\t\t\n\t\t$wpdb->query(\"DELETE * FROM {$prefix}form\");\n\t}", "function clear_session() {\n\t\tdelete_site_option( 'update_' . $this->upgrade_name . '_session' );\n\t}", "function wfs_deactivate () {\n\tglobal $wp_wfs_configure_table, $wpdb;\n\t$wpdb->query(\"DROP TABLE {$wp_wfs_configure_table}\");\n\tdelete_option('webfonts_public_key');\n\tdelete_option('webfonts_private_key');\n\tdelete_option('webfonts_userid');\n\tdelete_option('webfonts_usertype');\n\t}", "function shariff3uu_purge_transients_deactivation() {\n\t// Makes sure the $wpdb class is ready.\n\tif ( ! isset( $wpdb ) ) {\n\t\tglobal $wpdb;\n\t}\n\t// Deletes transients.\n\t// phpcs:disable\n\t$wpdb->query( 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE \"_transient_timeout_shariff%\"' );\n\t$wpdb->query( 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE \"_transient_shariff%\"' );\n\t// phpcs:enable\n\t// Clears the object cache.\n\twp_cache_flush();\n}", "public function on_deactivation() {\n\t\t$this->get_settings()->delete();\n\t}", "public function on_deactivation() {\n\t\t$this->get_settings()->delete();\n\t}", "public function on_deactivation() {\n\t\t$this->get_settings()->delete();\n\t}", "function session_drop(){\n\t\tsession_unset();\n\t\t$_SESSION = array();\n\t}", "static function deactivate() {\n global $wpdb;\n\n delete_option(WF_BDL_OPTIONS_KEY);\n delete_option(WF_BDL_IPS_KEY);\n self::ajax_clear_usernames(false);\n $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . WF_BDL_LOG_TABLE);\n }", "function gwwus_deactivation() {\n\twp_clear_scheduled_hook( 'gwwus_hourly_event_hook' );\n delete_option( \"gwwus-dkp_current-import-row\"); \n}", "function deconnection() {\n\t\t\tsession_unset();\n\t\t\tsession_destroy();\n\t\t}", "function my_hook_jallo_deactivation_callback_function($keyword)\n{\n // drop your table here, etc., and...\n // exec_query('drop table if exists `unknown_sms_data`');\n // you can leave your database entries for next time your hook reactivated.\n return true; \n}", "public function cleanSessionTable() {\n\t\t$sqlQuery = sprintf(\"DELETE FROM session WHERE expiration <= NOW()\");\n\t\t$this->getDb()->query($sqlQuery);\n\t}", "function dexpro_plugin_deactivation() {\n}", "public function deactivation() {\n\t\twp_clear_scheduled_hook( 'scheduled_event' );\n\t}", "public function uninstall(){\n global $wpdb;\n\n self::clear_cache();\n self::delete_files();\n delete_option(MF_SETTINGS_KEY);\n //DB version\n delete_option(MF_DB_VERSION_KEY);\n\n $sql = \"DELETE a.* FROM $wpdb->postmeta AS a, \".MF_TABLE_POST_META.\" AS b WHERE b.meta_id = a.meta_id\";\n $wpdb->query($sql);\n\n $sql = \"DROP TABLE \" . MF_TABLE_POSTTYPES;\n $wpdb->query($sql);\n \n $sql = \"DROP TABLE \" . MF_TABLE_CUSTOM_TAXONOMY;\n $wpdb->query($sql);\n \n $sql = \"DROP TABLE \" . MF_TABLE_CUSTOM_FIELDS;\n $wpdb->query($sql);\n\n $sql = \"DROP TABLE \" . MF_TABLE_CUSTOM_GROUPS;\n $wpdb->query($sql);\n\n $sql = \"DROP TABLE \" . MF_TABLE_POST_META;\n $wpdb->query($sql);\n \n $current = get_option('active_plugins');\n $plugin = plugin_basename(MF_PATH.'/main.php');\n array_splice($current, array_search( $plugin, $current), 1 );\n do_action('deactivate_' . trim( $plugin ));\n update_option('active_plugins', $current);\n\n wp_redirect('options-general.php');\n }", "function uninstall() {\n\nSQLExec('DROP TABLE IF EXISTS espcounter_devices');\nSQLExec('DROP TABLE IF EXISTS espcounter_config');\nSQLExec('delete from settings where NAME like \"%APPESPCOUNTER%\"');\nSQLExec(\"delete from pvalues where property_id in (select id FROM properties where object_id in (select id from objects where class_id = (select id from classes where title = 'ESPCounter')))\");\nSQLExec(\"delete from properties where object_id in (select id from objects where class_id = (select id from classes where title = 'ESPCounter'))\");\nSQLExec(\"delete from objects where class_id = (select id from classes where title = 'ESPCounter')\");\nSQLExec(\"delete from classes where title = 'ESPCounter'\");\t \nunsubscribeFromEvent($this->name, 'HOURLY');\n parent::uninstall();\n\n }", "public function handle_clear_session() {\n\t\tglobal $wpdb;\n\n\t\tif ( ! current_user_can( self::$capability ) || ! wp_verify_nonce( $_GET['nonce'], 'pantheon_clear_session' ) ) {\n\t\t\twp_die( esc_html__( \"You don't have permission to do this.\", 'pantheon-sessions' ) );\n\t\t}\n\n\t\tif ( 'all' == $_GET['session'] ) {\n\t\t\t$wpdb->query( \"DELETE FROM $wpdb->pantheon_sessions\" );\n\t\t\t$message = 'delete-all-session';\n\t\t} else {\n\t\t\t$wpdb->query( $wpdb->prepare( \"DELETE FROM $wpdb->pantheon_sessions WHERE session_id=%s\", sanitize_text_field( $_GET['session'] ) ) );\n\t\t\t$message = 'delete-session';\n\t\t}\n\t\twp_safe_redirect( add_query_arg( 'message', $message, wp_get_referer() ) );\n\t\texit;\n\n\t}", "public function uninstall(){\n\t\tparent::uninstall();\n\n\t\tif(!$this->debug){\n\t\t\tdelete_option($this->varName . '_api-key');\n\t\t\tdelete_option($this->varName . '_report-code');\n\t\t\tdelete_option($this->varName . '_chart-size');\n\n\t\t\tglobal $wpdb;\n\n\t\t\t// drop the dbs\n\t\t\t$wpdb->query(\"DROP TABLE \" . $this->dbPrefix . \"countries\");\n\t\t\t$wpdb->query(\"DROP TABLE \" . $this->dbPrefix . \"country_states\");\n\t\t}\n\t}", "function uninstall()\r\n {\r\n SQLExec('DROP TABLE IF EXISTS gpslog');\r\n SQLExec('DROP TABLE IF EXISTS gpslocations');\r\n SQLExec('DROP TABLE IF EXISTS gpsdevices');\r\n SQLExec('DROP TABLE IF EXISTS gpsactions');\r\n parent::uninstall();\r\n }", "function deleteSession()\n{\n session_unset();\n}", "function secu_logout()\n{\n\tsession_unset();\n}", "public static function uninstall()\n\t\t{\n\t\t\tglobal $wpdb;\n\t\t\t//\n\t\t}", "private function session_cleanup() {\n\t\tforeach ($this->sessions as $i => $s) {\n\t\t\tif ($s->is_expired()) {\n\t\t\t\t$this->sessions[$i] = NULL;\n\t\t\t}\n\t\t}\n\t\t$this->sessions = array_values(array_filter($this->sessions));\n\t\t$this->write();\n\t}", "function uninstall() {\n SQLExec('DROP TABLE IF EXISTS ssdp_devices');\n unsubscribeFromEvent($this->name, 'SAY');\n parent::uninstall();\n }", "function uninstall() {\n\t\tDB::execute ( \"DROP TABLE IF EXISTS `\" . TABLE_PREFIX . \"rep_tickets_snapshot`\" );\n\t\tDB::execute ( \"DROP TABLE IF EXISTS `\" . TABLE_PREFIX . \"rep_finance_summary`\" );\n\t\t\n\t\t//Time Reports Plus\n\t\t$homescreen_tab_table = TABLE_PREFIX . 'homescreen_tabs';\n\t\tif (DB::tableExists ( $homescreen_tab_table )) {\n\t\t\tDB::execute ( \"DELETE FROM $homescreen_tab_table WHERE type IN ('TimeReportsPlusHomescreenTab') \" );\n\t\t} //if\n\n\t\treturn parent::uninstall ();\n\t}" ]
[ "0.7470335", "0.7217573", "0.7201592", "0.7117961", "0.7094081", "0.7069681", "0.70645857", "0.68838716", "0.6869757", "0.6869757", "0.6869757", "0.6794163", "0.6769877", "0.6700902", "0.6691273", "0.66627795", "0.6642025", "0.66372955", "0.6614037", "0.65871066", "0.6575128", "0.65697736", "0.65630436", "0.6556059", "0.6555941", "0.6524286", "0.6498596", "0.648085", "0.64800984", "0.646759" ]
0.8212235
0
Creates the wp_session table on plugin activation
function phpSessionInstall() { global $wpdb; global $sessions_db_version; $table_name = $wpdb->prefix . 'session'; $sql = "CREATE TABLE IF NOT EXISTS $table_name ( ID bigint(20) unsigned NOT NULL, sid varchar(64) NOT NULL DEFAULT '', hostname varchar(128) NOT NULL DEFAULT '', timestamp int(11) NOT NULL DEFAULT '0', cache int(11) NOT NULL DEFAULT '0', session longtext, PRIMARY KEY (sid), KEY timestamp (timestamp), KEY ID (ID) );"; require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); dbDelta($sql); add_option('session_db_version', $session_db_version); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function CreateUpgradeSession()\n\t{\n\t\t$query = \"CREATE TABLE [|PREFIX|]upgrade_session (\n\t\t\ttype varchar(20) NOT NULL default '',\n\t\t\tdata TEXT NOT NULL\n\t\t);\";\n\t\t$GLOBALS['ISC_CLASS_DB']->Query($query);\n\n\t\t// Create the primary record\n\t\t$upgradeSession = array(\n\t\t\t'type' => 'primary',\n\t\t\t'data' => ''\n\t\t);\n\t\t$GLOBALS['ISC_CLASS_DB']->InsertQuery(\"upgrade_session\", $upgradeSession);\n\t}", "function prtf_plugin_activation() {\r\n \tglobal $wpdb;\r\n \tglobal $your_db_name;\r\n $table_name = $wpdb->prefix . 'guestbook';\r\n\t// create the database table\r\n\tif($wpdb->get_var(\"show tables like '$table_name'\") != $table_name)\r\n\t{\r\n\t\t$sql = \"CREATE TABLE \" . $table_name . \" (\r\n\t\t`id` mediumint(9) NOT NULL AUTO_INCREMENT,\r\n\t\t`username` varchar(30) NOT NULL,\r\n\t\t`email` varchar(30) NOT NULL,\r\n\t\t`comment` tinytext NOT NULL,\r\n\t\tUNIQUE KEY id (id)\r\n\t\t);\";\r\n\r\n\t\trequire_once(ABSPATH . 'wp-admin/includes/upgrade.php');\r\n\t\tdbDelta($sql);\r\n\r\n\t}\r\n\r\n}", "public function on_plugin_activation() {\n\t\tglobal $wpdb;\n\t\t// Create events table\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS \" . $wpdb->prefix . \"slick_audio (\n\t\t\tid mediumint(9) NOT NULL,\n\t\t\tdata mediumtext NOT NULL,\n\t\t\tPRIMARY KEY (id)\n\t\t);\";\n\t\t$wpdb->query($sql);\n\t\tregister_uninstall_hook(__FILE__, array($this, 'on_plugin_uninstall'));\n\t}", "public static function activate() {\n\n\t\t// Create needed tables in plugin activation.\n//\t\t$new_modified_tables = new Table();\n//\t\tif ( intval( $new_modified_tables->db_version ) > intval( get_option( 'last_TSB_dbs_version' ) )) {\n//\t\t\t/*\n//\t\t\t * Check is your table exist in database or not you can use from it\n//\t\t\t * for all of your table in first time that your plugin is created.\n//\t\t\t*/\n//\t\t\tif ( 1 !== $new_modified_tables->have_name_of_your_table ) {\n//\t\t\t\t$new_modified_tables->create_your_table_name();\n//\t\t\t}\n//\n//\t\t\tupdate_option(\n//\t\t\t\t'last_TSB_dbs_version',\n//\t\t\t\t$new_modified_tables->db_version\n//\t\t\t);\n//\n//\t\t}\n\n // Initialize plugin settings and info in option table.\n Info::add_info_in_plugin_activation();\n\n\t}", "function create_plugin_database_table()\n{\n $db = new DignosisDB;\n $db->Activate();\n}", "public function stt_activate() {\n global $wpdb;\n $table_version = get_option('stt_table_version');\n if (!$table_version) {\n // Insert latest version of the database.\n $table_name = static::table_name();\n $sql = \"CREATE TABLE IF NOT EXISTS {$table_name} (\n id int NOT NULL AUTO_INCREMENT,\n priority int NOT NULL,\n order_schema char(30),\n post_id bigint(20) unsigned,\n primary key (id)\n );\";\n\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n dbDelta( $sql );\n update_option('stt_table_version', '1');\n }\n }", "function wfs_activate(){ //This is all the stuff the plug-in needs to do when it is activated\n\n\tglobal $wp_wfs_configure_table;\n\t$sql = \"DROP TABLE IF EXISTS `\".$wp_wfs_configure_table.\"`;\n\t\tCREATE TABLE `\".$wp_wfs_configure_table.\"` (\n\t\t`wfs_configure_id` int(200) NOT NULL auto_increment,\n\t\t`project_name` varchar(255) NOT NULL default '',\n\t\t`project_key` varchar(255) NOT NULL default '',\n\t\t`project_day` varchar(255) NOT NULL default '0-6',\n\t\t`project_page_option` enum('0','1','2') NOT NULL default '0',\n\t\t`project_pages` text NOT NULL,\n\t\t`project_options` enum('0','1') NOT NULL default '0',\n\t\t`wysiwyg_enabled` enum('0','1') NOT NULL default '0' COMMENT '0>disabled, 1>enabled',\n\t\t`is_active` enum('0','1') NOT NULL default '0' COMMENT '0>inActive, 1>Active',\n\t\t`user_id` varchar(255) NOT NULL default '',\n\t\t`user_type` enum('0','1') NOT NULL default '0' COMMENT '0>free, 1> paid',\n\t\t `editor_select` enum('0','1') NOT NULL DEFAULT '0',\n\t\t`updated_date` timestamp NOT NULL default '0000-00-00 00:00:00' on update CURRENT_TIMESTAMP,\n\t\tPRIMARY KEY (`wfs_configure_id`)\n\t\t) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 ;\";\ncreateTable($wp_wfs_configure_table, $sql); //Little function to check that the table does not already exist\n}", "static function activate() {\n require_once ABSPATH . 'wp-admin/includes/upgrade.php';\n global $wpdb;\n\n $log = \"CREATE TABLE IF NOT EXISTS `\" . $wpdb->prefix . WF_BDL_LOG_TABLE . \"` (\n `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `username` varchar(64) NOT NULL,\n `ip` varchar(15) NOT NULL,\n `reason` varchar(64) NOT NULL,\n `timestamp` datetime NOT NULL,\n PRIMARY KEY (`id`)\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8\";\n dbDelta($log);\n\n self::ajax_clear_ips(false);\n self::ajax_clear_usernames(false);\n }", "public static function activate() {\n\n\t\t// add plugin related tables to DB\n\t\trequire plugin_dir_path( __FILE__ ) . 'class-wpeo-schema.php';\n\t\t\n\t\tWPEO_Schema::init();\n\n\t\tdo_action('create_settings_table');\n\t\tdo_action('create_events_table');\n\t}", "function init() {\n\t\t\tif (current_user_can('activate_plugins')) {\n\t\t\t\tforeach ($this->pages as $page) {\n\t\t\t\t\t$options = $page->option_groups;\n\t\t\t\t\tif (is_array($options) and count($options) > 0) {\n\t\t\t\t\t\tUfOptionUtilities::add_options($options);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($this->tables) {\n\t\t\t\t\trequire_once(ABSPATH . 'wp-admin/upgrade-functions.php');\n\n\t\t\t\t\tforeach ($this->tables as $table_name => $sql) {\n\t\t\t\t\t\tmaybe_create_table($table_name, $sql);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function activate()\n {\n $charset_collate = $this->wpdb->get_charset_collate();\n\n $query = \"CREATE TABLE IF NOT EXISTS {$this->mediaTable} (\n `id` mediumint(9) NOT NULL AUTO_INCREMENT,\n `title` varchar(255) NULL,\n `url` varchar(255) NULL,\n `date` DATE NULL,\n `active` bool NULL,\n `description` text,\n `image_url` varchar(255),\n \n `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n `edited` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n PRIMARY KEY (`id`)\n ) $charset_collate;\n \";\n\n $this->wpdb->query($query);\n }", "function create_tables( $plugin_file ) {\n\tregister_activation_hook( $plugin_file, 'jn\\jurassic_ninja_create_table' );\n}", "function mollom_activate() {\r\n\tglobal $wpdb, $wp_db_version, $wp_roles;\r\n\t\r\n\t// create a new table to store mollom sessions if it doesn't exist\r\n\t$mollom_table = $wpdb->prefix . MOLLOM_TABLE;\r\n\tif($wpdb->get_var(\"SHOW TABLES LIKE '$mollom_table'\") != $mollom_table) {\r\n\t\t$sql = \"CREATE TABLE \" . $mollom_table . \" (\r\n\t\t\t\t`comment_ID` BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT '0',\r\n\t\t\t\t`mollom_session_ID` VARCHAR( 40 ) NULL DEFAULT NULL,\r\n\t\t\t\t`mollom_had_captcha` INT ( 1 ) NOT NULL DEFAULT '0',\r\n\t\t\t\t`mollom_spaminess` FLOAT NOT NULL DEFAULT '0.00',\r\n\t\t\t\tUNIQUE (\r\n\t\t\t\t\t`comment_ID` ,\r\n\t\t\t\t\t`mollom_session_ID`\r\n\t\t\t\t)\r\n\t\t\t);\";\r\n\t\trequire_once(ABSPATH . 'wp-admin/includes/upgrade.php');\r\n\t\tdbDelta($sql);\r\n\t}\r\n\t\r\n\t// if there is no version option, mollom is installed for the first time\r\n\tif (!get_option('mollom_version')) {\r\n\t\t//Set these variables if they don't exist\r\n\t\t$version = MOLLOM_VERSION;\r\n\t\tadd_option('mollom_version', $version);\r\n\t}\t\r\n\t\r\n\t// also, let's create these variables if they don't exist\r\n\tif(!get_option('mollom_private_key'))\r\n\t\tadd_option('mollom_private_key', '');\r\n\tif(!get_option('mollom_public_key'))\t\t\r\n\t\tadd_option('mollom_public_key', '');\r\n\tif(!get_option('mollom_servers'))\r\n\t\tadd_option('mollom_servers', NULL);\r\n\tif(!get_option('mollom_ham_count'))\r\n\t\tadd_option('mollom_ham_count', 0);\r\n\tif(!get_option('mollom_spam_count'))\r\n\t\tadd_option('mollom_spam_count', 0);\r\n\tif(!get_option('mollom_unsure_count'))\r\n\t\tadd_option('mollom_unsure_count', 0);\r\n\tif(!get_option('mollom_count_moderated'))\r\n\t\tadd_option('mollom_count_moderated', 0);\r\n\tif(!get_option('mollom_site_policy'))\r\n\t\tadd_option('mollom_site_policy', true);\r\n\t// deprecated. Backward compatibility only\r\n\tif((!get_option('mollom_dbrestore')) && ($wp_db_version < 8645))\r\n\t\tadd_option('mollom_dbrestore', false);\r\n\tif(!get_option('mollom_reverseproxy'))\r\n\t\tadd_option('mollom_reverseproxy', false);\r\n\tif(!get_option('mollom_reverseproxy_addresses'))\r\n\t\tadd_option('mollom_reverseproxy_addresses', NULL);\r\n\tif(!get_option('mollom_roles')) {\r\n\t\t$mollom_roles = array();\r\n\t\tforeach ($wp_roles->roles as $role => $data) {\t\t\r\n\t\t\t$mollom_roles[] = $role;\r\n\t\t}\r\n\t\tadd_option('mollom_roles', serialize($mollom_roles));\r\n\t}\r\n\t\r\n\t// if a previous installed version doesn't match with this version, mollom might need an update\r\n\tif (get_option('mollom_version') != MOLLOM_VERSION) {\r\n\t\t// updates of the database if the plugin was already installed\r\n\t\t$version = MOLLOM_VERSION;\r\n\t\tupdate_option('mollom_version', $version);\r\n\t\t\r\n\t\t// legacy code here: \r\n\t\t// 1. moving data from old to new data model if necessary (0.4 -> 0.5)\r\n\t\t$comments_table = $wpdb->prefix . 'comments';\r\n\t\t\t\r\n\t\t// only update if mollom_session_id still exists\r\n\t\tforeach ($wpdb->get_col(\"DESC $comments_table\", 0) as $column ) {\r\n\t\t\tif ($column == 'mollom_session_ID') {\r\n\t\t\t\t$comments = $wpdb->get_results(\"SELECT comment_ID, mollom_session_ID FROM $comments_table WHERE mollom_session_ID IS NOT NULL\");\r\n\r\n\t\t\t\tif ($comments) {\r\n\t\t\t\t\t$stat = true;\r\n\t\t\t\r\n\t\t\t\t\tforeach($comments as $comment) {\t\t\t\t\r\n\t\t\t\t\t\tif(!$wpdb->query( $wpdb->prepare(\"INSERT INTO $mollom_table(comment_ID, mollom_session_ID) VALUES(%d, %s)\", $comment->comment_ID, $comment->mollom_session_ID))) {\r\n\t\t\t\t\t\t\t$stat = false;\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t\tif($stat) {\r\n\t\t\t\t\t\t$wpdb->query(\"ALTER TABLE $wpdb->comments DROP COLUMN mollom_session_id\");\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\twp_die(__('Something went wrong while moving data from comments to the Mollom data table', MOLLOM_I8N));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// 2. Add extra columns to the mollom table\tif it already exists\r\n\t\t$columns = $wpdb->get_col(\"DESC $mollom_table\", 0);\r\n\t\tif (!in_array('mollom_had_captcha', $columns)) {\r\n\t\t\t$wpdb->query(\"ALTER TABLE $mollom_table ADD mollom_had_captcha TINYINT (1) NOT NULL DEFAULT 0\");\r\n\t\t}\r\n\t\tif (!in_array('mollom_spaminess', $columns)) {\r\n\t\t\t$wpdb->query(\"ALTER TABLE $mollom_table ADD mollom_spaminess FLOAT NOT NULL DEFAULT '0.00'\");\r\n\t\t}\r\n\t\t\r\n\t\t// end of legacy code\r\n\t}\r\n}", "static function session_started() {\r\n\t\tHealthCheck::display_notice(\r\n\t\t\tsprintf(\r\n\t\t\t\t'%s<br>%s',\r\n\t\t\t\tesc_html__( 'You have successfully enabled Troubleshooting Mode, all plugins will appear inactive until you log out and back in again.', 'health-check' ),\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'<a href=\"%1$s\">%2$s</a><script type=\"text/javascript\">window.location = \"%1$s\";</script>',\r\n\t\t\t\t\tesc_url( admin_url( '/' ) ),\r\n\t\t\t\t\tesc_html__( 'Return to the Dashboard', 'health-check' )\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t}", "function phpSessionUninstall() {\n global $wpdb;\n $table_name = $wpdb->prefix . 'session';\n\n $wpdb->query(\"DROP TABLE IF EXISTS $table_name\");\n}", "function DBP_tb_Create(){\n global $wpdb;\n // step 1\n $DBP_db_name = $wpdb -> prefix .\"dbp_tb_login\";\n\n //step 2\n $DBP_query = \"CREATE TABLE $DBP_db_name(\n id int(10) NOT NULL AUTO_INCREMENT,\n user_name varchar (100) DEFAULT '',\n password varchar (100) DEFAULT '',\n email varchar (100) DEFAULT '',\n PRIMARY KEY (id)\n \n )\";\n\n //step 3\n require_once(ABSPATH.\"wp-admin/includes/upgrade.php\");\n dbDelta($DBP_query);\n\n}", "protected function checkSessionTable()\n {\n $this->db->raw(\"CREATE TABLE IF NOT EXISTS `session` (\n `id` char(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `deleted_at` timestamp NULL DEFAULT NULL,\n `created_by` int(11) DEFAULT NULL,\n `updated_by` int(11) DEFAULT NULL,\n `deleted_by` int(11) DEFAULT NULL,\n `data` longtext COLLATE utf8_unicode_ci,\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\"\n );\n }", "function on_session_start() { }", "public static function plugin_activated()\n\t{\n\t\t$page_definitions = array\n\t\t\t(\n\t\t\t\t'member-login' => array\n\t\t\t\t(\n\t\t\t\t\t'title' => __( 'Sign In', 'personalize-login' ),\n\t\t\t\t\t'content' => '[custom-login-form]'\n\t\t\t\t),\n\t\t\t\t'member-account' => array\n\t\t\t\t(\n\t\t\t\t\t'title' => __( 'Your Account', 'personalize-login' ),\n\t\t\t\t\t'content' => '[account-info]'\n\t\t\t\t),\n\t\t\t);\n\t \n\t\tforeach ( $page_definitions as $slug => $page )\n\t\t{\n\t\t\t// Check that the page doesn't exist already\n\t\t\t$query = new WP_Query( 'pagename=' . $slug );\n\t\t\tif ( ! $query->have_posts() )\n\t\t\t\twp_insert_post\n\t\t\t\t\t(\n\t\t\t\t\t\tarray\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t'post_content' => $page['content'],\n\t\t\t\t\t\t\t'post_name' => $slug,\n\t\t\t\t\t\t\t'post_title' => $page['title'],\n\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t'post_type' => 'page',\n\t\t\t\t\t\t\t'ping_status' => 'closed',\n\t\t\t\t\t\t\t'comment_status' => 'closed',\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t}\n\t}", "public static function activate()\n {\n\t\tglobal $wpdb;\n\t\t$table_name = $wpdb->prefix . 'skip_volunteer';\n\t $sql = \"CREATE TABLE $table_name (\n\t id mediumint(9) unsigned NOT NULL AUTO_INCREMENT,\n\t project_date DATE NOT NULL,\n\t club varchar(150) NOT NULL,\n\t project varchar(150) NOT NULL,\n\t description longtext NOT NULL,\n\t adult int(9) NOT NULL,\n\t children int(9) NOT NULL,\n\t families int(9) NOT NULL,\n\t hours int(9) NOT NULL,\n\t PRIMARY KEY (id)\n\t );\";\n\t \n\t require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t dbDelta( $sql );\n }", "function on_plugin_activation() {\n\t\t\n\t}", "public function activate() {\n\n\n\n\t\t//$this->create_update_database();\n\t\t//$this->create_user_role();\n\t\t$this->create_user_roles();\n\t\techo \"Mplugin Activated\";\n\t\t\n\t\t\n\t}", "public function activation () {\r\n\t\t$this->register_plugin_version();\r\n\t}", "public function activation () {\n\t\t$this->register_plugin_version();\n\t}", "public function activation () {\n\t\t$this->register_plugin_version();\n\t}", "protected function initSessionInfo(){\n\t\t$class = get_class( $this );\n\t\tif( !isset( $_SESSION[ 'tables' ][ $class ] ) ){\n\t\t\t$_SESSION['tables'][$class] = [\n\t\t\t\t'page'\t\t=> self::_fstPg,\n\t\t\t\t'sort'\t\t=> [ 'field' => NULL, 'dir' => 'asc' ],\n\t\t\t\t'line_id'\t=> NULL,\n\t\t\t\t'filter'\t=> ''\n\t\t\t];\n\t\t}\n\t}", "private function create(){\n\t\t$this->id = session_id();\n\t\t// And write session into database\n\t\t$insert = array(\"phpkey\" => $this->id, \"created\" => DateManager::now());\n\t\t$sql = new SqlManager();\n\t\t$sql->insert(\"session\", $insert);\n\t\t// Save data in instance\n\t\t$this->data = $insert;\n\t\t$this->data['id'] = $sql->getLastInsertID();\n\t\t// Write meta data into database\n\t\tforeach($_SERVER as $key => $value){\n\t\t\tMeta::save(\"session\", $this->data['id'], $key, $value);\n\t\t}\n\t\t// Set login status\n\t\t$this->loggedin = false;\n\t\t// Create user and config object for session\n\t\t$this->user = new User();\n\t\t$this->config = new Config();\n\t}", "public function event_plugin_activation()\r\n\t{\r\n\t\t$anon_id = bb_get_option('loginless-anon-id');\r\n\t\tif ( empty( $anon_id ) ) {\r\n\t\t\t$sitename = strtolower( $_SERVER['SERVER_NAME'] );\r\n\t\t\tif ( substr( $sitename, 0, 4 ) == 'www.' ) {\r\n\t\t\t\t$sitename = substr( $sitename, 4 );\r\n\t\t\t}\r\n\t\t\t$user_id = bb_new_user( $this->_user_login_base, $this->_user_login_base . '@' . $sitename, bb_get_option('url'));\t\r\n\t\t\tif ( ! is_wp_error($user_id) && ! empty($user_id) ) {\r\n\t\t\t\t$this->_anon_user_id = intval($user_id);\r\n\t\t\t\treturn bb_update_option('loginless-anon-id', intval($user_id));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function create_table_activate() {\r\n\r\n global $wpdb;\r\n\r\n $nom_table_contact = $wpdb->prefix . 'contact_form';\r\n\r\n $sql = \"CREATE TABLE IF NOT EXISTS $nom_table_contact (\r\n form_id bigint(20) unsigned NOT NULL auto_increment,\r\n form_name VARCHAR (100) NOT NULL,\r\n form_activate int(1) NOT NULL,\r\n PRIMARY KEY (form_id))\";\r\n\r\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r\n\r\n dbDelta($sql);\r\n\r\n $sql = \"INSERT INTO wp_contact_form (form_name, form_activate) VALUES ('Formulaire de contact', 0)\";\r\n\r\n $wpdb->query($sql);\r\n\r\n}", "public static function createSession() {\n\n\t\t$s = new stdClass();\n\t\t$s->userid = user::$id;\n\t\t$s->ssid = session_id();\n\t\t$s->lastvisitDate = date('Y-m-d H:i:s');\n\t\tdatabase::insertRow('#_sessions', $s);\n\t}" ]
[ "0.6892733", "0.6645987", "0.65068245", "0.64482915", "0.6401709", "0.63998175", "0.6381275", "0.62915826", "0.62789935", "0.6208845", "0.6107563", "0.6092698", "0.6065648", "0.60324746", "0.6019211", "0.60176224", "0.59560156", "0.59172845", "0.5910743", "0.5910396", "0.5908314", "0.58969104", "0.5869879", "0.5850046", "0.5850046", "0.58241653", "0.58199656", "0.5771938", "0.5767164", "0.5754195" ]
0.75286037
0
Serialized export taxonomies that contain all the policy tags as nested protocol buffers. Generated from protobuf field bool serialized_taxonomies = 3;
public function getSerializedTaxonomies() { return $this->readOneof(3); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setSerializedTaxonomies($var)\n {\n GPBUtil::checkBool($var);\n $this->writeOneof(3, $var);\n\n return $this;\n }", "function bbp_register_taxonomies()\n{\n}", "public function filter_wpseo_sitemaps_supported_taxonomies($taxonomies){\n\t\t \n\t\t\treturn $taxonomies;\n\t\t}", "private function get_taxonomies() {\n\t\t// Only return taxonomies that are shown in the admin interface.\n\t\t// Otherwise, the list could be confusing to editors or provide invalid options.\n\t\treturn get_taxonomies(\n\t\t\tarray( \n\t\t\t\t'public' => true,\n\t\t\t\t'show_ui' => true\n\t\t\t),\n\t\t\t'objects'\n\t\t);\n\t}", "function register_taxonomies() {\n\t}", "function register_taxonomies() {\n\t}", "function register_taxonomies() {\n\t}", "function register_taxonomies() {\n\t}", "public static function getTaxonomies()\n {\n $post = self::globalPost();\n\n if (! empty($post->ID)) {\n $post = get_post($post->ID);\n\n $post_type = $post->post_type;\n\n $taxonomies = get_object_taxonomies($post_type, 'objects');\n\n return $taxonomies;\n }\n return false;\n }", "function register_taxonomies(){\n\t\t}", "public static function get_all_taxonomies() {\n\t\treturn self::$_taxonomies;\n\t}", "public function taxonomies( $taxonomies ) {\n\t\t$current_language = Translations_For_AW_With_Prisna_Utils::current_language();\n\t\tif ( $current_language && $current_language !== PrisnaWPTranslateConfig::getSettingValue( 'from' ) ) {\n\t\t\t$taxonomies['name'] = Translations_For_AW_With_Prisna_Utils::translate(\n\t\t\t\t$taxonomies['name'],\n\t\t\t\tPrisnaWPTranslateConfig::getSettingValue( 'from' ),\n\t\t\t\t$current_language\n\t\t\t);\n\t\t}\n\t\treturn $taxonomies;\n\t}", "private function saveCustomTaxonomies() {\n if(!$this->postId || !$this->data->getCustomTaxonomies()) return;\n\n // Delete old taxonomy values first when updating. Do this only when the first page is being crawled.\n if($this->data->getCustomTaxonomies() && $this->isFirstPage && $this->isRecrawl) {\n $taxNames = array_unique(array_map(function($v) {\n return $v['taxonomy'];\n }, $this->data->getCustomTaxonomies()));\n\n // Taxonomies saved via wp_insert_post are removed here. They must not be removed. For example, post_tag\n // taxonomy is saved via wp_insert_post prior to calling this method. Hence, already-saved tags are removed\n // here when recrawling a post. This must not be the case. Exclude already-saved taxonomy names such as\n // \"post_tag\". These values are already overwritten.\n $excluded = ['post_tag', 'category'];\n $taxNames = array_values(array_diff($taxNames, $excluded));\n\n if($taxNames) wp_delete_object_term_relationships($this->postId, $taxNames);\n }\n\n foreach($this->data->getCustomTaxonomies() as $taxonomyData) {\n $taxValue = $taxonomyData['data'];\n $taxName = $taxonomyData['taxonomy'];\n $isAppend = isset($taxonomyData['append']) && $taxonomyData['append'];\n\n // Make sure the value is an array.\n if (!is_array($taxValue)) $taxValue = [$taxValue];\n\n // Save them as terms\n $termIds = [];\n foreach($taxValue as $tv) {\n $termId = Utils::insertTerm($tv, $taxName);\n if (!$termId) continue;\n\n $termIds[] = $termId;\n }\n\n // If there is no term ID, continue with the next one.\n if (!$termIds) continue;\n\n wp_set_post_terms($this->postId, $termIds, $taxName, $isAppend);\n }\n }", "public function register_taxonomies()\n\t{ }", "public function register_taxonomies() {\n }", "public static function get_taxonomies($enabled = true) {\n global $DB;\n\n return $DB->get_records('sharedresource_classif', array('enabled' => $enabled));\n }", "public function register_taxonomies() {\n\n\t}", "public function register_taxonomies() {\n\n\t}", "public function register_taxonomies() {\n\n\t}", "public function register_taxonomies() {\n\n\t}", "public function register_taxonomies() {\n\n\t}", "public function register_taxonomies()\n\t{\n\t}", "public function get_taxonomies( $taxonomies ) {\n\t\treturn array_diff( $taxonomies, get_taxonomies( array( '_pll' => true ) ) );\n\t}", "public function register_taxonomies()\n {\n }", "public static function get_accessible_taxonomies() {\n\t\tstatic $accessible_taxonomies;\n\n\t\tif ( isset( $accessible_taxonomies ) && did_action( 'wp_loaded' ) ) {\n\t\t\treturn $accessible_taxonomies;\n\t\t}\n\n\t\t$accessible_taxonomies = get_taxonomies( [ 'public' => true ], 'objects' );\n\t\t$accessible_taxonomies = self::filter_exclude_taxonomies( $accessible_taxonomies );\n\n\t\tif ( ! is_array( $accessible_taxonomies ) ) {\n\t\t\t$accessible_taxonomies = [];\n\t\t}\n\n\t\treturn $accessible_taxonomies;\n\t}", "private function updateTaxonomies()\n {\n $forbidden = apply_filters('cgit_seo_taxonomies_hidden', [\n 'nav_menu',\n 'link_category',\n 'post_format',\n ]);\n \n $taxonomies = array_diff(get_taxonomies(), $forbidden);\n $taxonomies = apply_filters('cgit_seo_taxonomies', $taxonomies);\n \n $this->taxonomies = $taxonomies;\n }", "public static function get_layered_nav_chosen_taxonomies() {\n if ( ! is_array( self::$_chosen_taxonomies ) ) {\n self::$_chosen_taxonomies = array();\n $taxonomies = jh_wpjm_get_all_taxonomies();\n\n if ( ! empty( $taxonomies ) ) {\n foreach ( $taxonomies as $tax ) {\n $taxonomy = $tax['taxonomy'];\n $filter_terms = ! empty( $_GET[ 'filter_' . $taxonomy ] ) ? explode( ',', masvideos_clean( wp_unslash( $_GET[ 'filter_' . $taxonomy ] ) ) ) : array(); // WPCS: sanitization ok, input var ok, CSRF ok.\n\n if ( empty( $filter_terms ) || ! taxonomy_exists( $taxonomy ) ) {\n continue;\n }\n\n $query_type = ! empty( $_GET[ 'query_type_' . $taxonomy ] ) && in_array( $_GET[ 'query_type_' . $taxonomy ], array( 'and', 'or' ), true ) ? masvideos_clean( wp_unslash( $_GET[ 'query_type_' . $taxonomy ] ) ) : ''; // WPCS: sanitization ok, input var ok, CSRF ok.\n self::$_chosen_taxonomies[ $taxonomy ]['terms'] = array_map( 'sanitize_title', $filter_terms ); // Ensures correct encoding.\n self::$_chosen_taxonomies[ $taxonomy ]['query_type'] = $query_type ? $query_type : apply_filters( 'masvideos_movie_layered_nav_default_query_type', 'and' );\n }\n }\n }\n return self::$_chosen_taxonomies;\n }", "function register_taxonomies() {\n Content_Type_Tax::register();\n Series_Tax::register();\n }", "public static function get_layered_nav_chosen_taxonomies() {\n if ( ! is_array( self::$_chosen_taxonomies ) ) {\n self::$_chosen_taxonomies = array();\n $taxonomies = jh_wpjm_get_all_taxonomies();\n\n if ( ! empty( $taxonomies ) ) {\n foreach ( $taxonomies as $tax ) {\n $taxonomy = $tax['taxonomy'];\n $filter_terms = ! empty( $_GET[ 'filter_' . $taxonomy ] ) ? explode( ',', masvideos_clean( wp_unslash( $_GET[ 'filter_' . $taxonomy ] ) ) ) : array(); // WPCS: sanitization ok, input var ok, CSRF ok.\n\n if ( empty( $filter_terms ) || ! taxonomy_exists( $taxonomy ) ) {\n continue;\n }\n\n $query_type = ! empty( $_GET[ 'query_type_' . $taxonomy ] ) && in_array( $_GET[ 'query_type_' . $taxonomy ], array( 'and', 'or' ), true ) ? masvideos_clean( wp_unslash( $_GET[ 'query_type_' . $taxonomy ] ) ) : ''; // WPCS: sanitization ok, input var ok, CSRF ok.\n self::$_chosen_taxonomies[ $taxonomy ]['terms'] = array_map( 'sanitize_title', $filter_terms ); // Ensures correct encoding.\n self::$_chosen_taxonomies[ $taxonomy ]['query_type'] = $query_type ? $query_type : apply_filters( 'masvideos_video_layered_nav_default_query_type', 'and' );\n }\n }\n }\n return self::$_chosen_taxonomies;\n }", "public function taxonomies(): \\Illuminate\\Database\\Eloquent\\Relations\\MorphToMany\n {\n return $this->morphToMany(\n PortfolioTaxonomy::class,\n 'taxonomyable',\n 'taxonomyables',\n 'taxonomyable_id',\n 'taxonomy_id',\n );\n }" ]
[ "0.76698405", "0.6115087", "0.5858229", "0.5824339", "0.5810498", "0.5810498", "0.5810498", "0.5810498", "0.57813764", "0.5759223", "0.57423955", "0.55991524", "0.55621797", "0.5554953", "0.55538225", "0.5553553", "0.55364394", "0.55364394", "0.55364394", "0.55364394", "0.55364394", "0.5531425", "0.55266845", "0.5508372", "0.54193074", "0.53839153", "0.527577", "0.5259172", "0.5246425", "0.521702" ]
0.7677382
0
Serialized export taxonomies that contain all the policy tags as nested protocol buffers. Generated from protobuf field bool serialized_taxonomies = 3;
public function setSerializedTaxonomies($var) { GPBUtil::checkBool($var); $this->writeOneof(3, $var); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSerializedTaxonomies()\n {\n return $this->readOneof(3);\n }", "function bbp_register_taxonomies()\n{\n}", "public function filter_wpseo_sitemaps_supported_taxonomies($taxonomies){\n\t\t \n\t\t\treturn $taxonomies;\n\t\t}", "private function get_taxonomies() {\n\t\t// Only return taxonomies that are shown in the admin interface.\n\t\t// Otherwise, the list could be confusing to editors or provide invalid options.\n\t\treturn get_taxonomies(\n\t\t\tarray( \n\t\t\t\t'public' => true,\n\t\t\t\t'show_ui' => true\n\t\t\t),\n\t\t\t'objects'\n\t\t);\n\t}", "function register_taxonomies() {\n\t}", "function register_taxonomies() {\n\t}", "function register_taxonomies() {\n\t}", "function register_taxonomies() {\n\t}", "public static function getTaxonomies()\n {\n $post = self::globalPost();\n\n if (! empty($post->ID)) {\n $post = get_post($post->ID);\n\n $post_type = $post->post_type;\n\n $taxonomies = get_object_taxonomies($post_type, 'objects');\n\n return $taxonomies;\n }\n return false;\n }", "function register_taxonomies(){\n\t\t}", "public static function get_all_taxonomies() {\n\t\treturn self::$_taxonomies;\n\t}", "public function taxonomies( $taxonomies ) {\n\t\t$current_language = Translations_For_AW_With_Prisna_Utils::current_language();\n\t\tif ( $current_language && $current_language !== PrisnaWPTranslateConfig::getSettingValue( 'from' ) ) {\n\t\t\t$taxonomies['name'] = Translations_For_AW_With_Prisna_Utils::translate(\n\t\t\t\t$taxonomies['name'],\n\t\t\t\tPrisnaWPTranslateConfig::getSettingValue( 'from' ),\n\t\t\t\t$current_language\n\t\t\t);\n\t\t}\n\t\treturn $taxonomies;\n\t}", "private function saveCustomTaxonomies() {\n if(!$this->postId || !$this->data->getCustomTaxonomies()) return;\n\n // Delete old taxonomy values first when updating. Do this only when the first page is being crawled.\n if($this->data->getCustomTaxonomies() && $this->isFirstPage && $this->isRecrawl) {\n $taxNames = array_unique(array_map(function($v) {\n return $v['taxonomy'];\n }, $this->data->getCustomTaxonomies()));\n\n // Taxonomies saved via wp_insert_post are removed here. They must not be removed. For example, post_tag\n // taxonomy is saved via wp_insert_post prior to calling this method. Hence, already-saved tags are removed\n // here when recrawling a post. This must not be the case. Exclude already-saved taxonomy names such as\n // \"post_tag\". These values are already overwritten.\n $excluded = ['post_tag', 'category'];\n $taxNames = array_values(array_diff($taxNames, $excluded));\n\n if($taxNames) wp_delete_object_term_relationships($this->postId, $taxNames);\n }\n\n foreach($this->data->getCustomTaxonomies() as $taxonomyData) {\n $taxValue = $taxonomyData['data'];\n $taxName = $taxonomyData['taxonomy'];\n $isAppend = isset($taxonomyData['append']) && $taxonomyData['append'];\n\n // Make sure the value is an array.\n if (!is_array($taxValue)) $taxValue = [$taxValue];\n\n // Save them as terms\n $termIds = [];\n foreach($taxValue as $tv) {\n $termId = Utils::insertTerm($tv, $taxName);\n if (!$termId) continue;\n\n $termIds[] = $termId;\n }\n\n // If there is no term ID, continue with the next one.\n if (!$termIds) continue;\n\n wp_set_post_terms($this->postId, $termIds, $taxName, $isAppend);\n }\n }", "public function register_taxonomies()\n\t{ }", "public function register_taxonomies() {\n }", "public static function get_taxonomies($enabled = true) {\n global $DB;\n\n return $DB->get_records('sharedresource_classif', array('enabled' => $enabled));\n }", "public function register_taxonomies() {\n\n\t}", "public function register_taxonomies() {\n\n\t}", "public function register_taxonomies() {\n\n\t}", "public function register_taxonomies() {\n\n\t}", "public function register_taxonomies() {\n\n\t}", "public function register_taxonomies()\n\t{\n\t}", "public function get_taxonomies( $taxonomies ) {\n\t\treturn array_diff( $taxonomies, get_taxonomies( array( '_pll' => true ) ) );\n\t}", "public function register_taxonomies()\n {\n }", "public static function get_accessible_taxonomies() {\n\t\tstatic $accessible_taxonomies;\n\n\t\tif ( isset( $accessible_taxonomies ) && did_action( 'wp_loaded' ) ) {\n\t\t\treturn $accessible_taxonomies;\n\t\t}\n\n\t\t$accessible_taxonomies = get_taxonomies( [ 'public' => true ], 'objects' );\n\t\t$accessible_taxonomies = self::filter_exclude_taxonomies( $accessible_taxonomies );\n\n\t\tif ( ! is_array( $accessible_taxonomies ) ) {\n\t\t\t$accessible_taxonomies = [];\n\t\t}\n\n\t\treturn $accessible_taxonomies;\n\t}", "private function updateTaxonomies()\n {\n $forbidden = apply_filters('cgit_seo_taxonomies_hidden', [\n 'nav_menu',\n 'link_category',\n 'post_format',\n ]);\n \n $taxonomies = array_diff(get_taxonomies(), $forbidden);\n $taxonomies = apply_filters('cgit_seo_taxonomies', $taxonomies);\n \n $this->taxonomies = $taxonomies;\n }", "public static function get_layered_nav_chosen_taxonomies() {\n if ( ! is_array( self::$_chosen_taxonomies ) ) {\n self::$_chosen_taxonomies = array();\n $taxonomies = jh_wpjm_get_all_taxonomies();\n\n if ( ! empty( $taxonomies ) ) {\n foreach ( $taxonomies as $tax ) {\n $taxonomy = $tax['taxonomy'];\n $filter_terms = ! empty( $_GET[ 'filter_' . $taxonomy ] ) ? explode( ',', masvideos_clean( wp_unslash( $_GET[ 'filter_' . $taxonomy ] ) ) ) : array(); // WPCS: sanitization ok, input var ok, CSRF ok.\n\n if ( empty( $filter_terms ) || ! taxonomy_exists( $taxonomy ) ) {\n continue;\n }\n\n $query_type = ! empty( $_GET[ 'query_type_' . $taxonomy ] ) && in_array( $_GET[ 'query_type_' . $taxonomy ], array( 'and', 'or' ), true ) ? masvideos_clean( wp_unslash( $_GET[ 'query_type_' . $taxonomy ] ) ) : ''; // WPCS: sanitization ok, input var ok, CSRF ok.\n self::$_chosen_taxonomies[ $taxonomy ]['terms'] = array_map( 'sanitize_title', $filter_terms ); // Ensures correct encoding.\n self::$_chosen_taxonomies[ $taxonomy ]['query_type'] = $query_type ? $query_type : apply_filters( 'masvideos_movie_layered_nav_default_query_type', 'and' );\n }\n }\n }\n return self::$_chosen_taxonomies;\n }", "function register_taxonomies() {\n Content_Type_Tax::register();\n Series_Tax::register();\n }", "public static function get_layered_nav_chosen_taxonomies() {\n if ( ! is_array( self::$_chosen_taxonomies ) ) {\n self::$_chosen_taxonomies = array();\n $taxonomies = jh_wpjm_get_all_taxonomies();\n\n if ( ! empty( $taxonomies ) ) {\n foreach ( $taxonomies as $tax ) {\n $taxonomy = $tax['taxonomy'];\n $filter_terms = ! empty( $_GET[ 'filter_' . $taxonomy ] ) ? explode( ',', masvideos_clean( wp_unslash( $_GET[ 'filter_' . $taxonomy ] ) ) ) : array(); // WPCS: sanitization ok, input var ok, CSRF ok.\n\n if ( empty( $filter_terms ) || ! taxonomy_exists( $taxonomy ) ) {\n continue;\n }\n\n $query_type = ! empty( $_GET[ 'query_type_' . $taxonomy ] ) && in_array( $_GET[ 'query_type_' . $taxonomy ], array( 'and', 'or' ), true ) ? masvideos_clean( wp_unslash( $_GET[ 'query_type_' . $taxonomy ] ) ) : ''; // WPCS: sanitization ok, input var ok, CSRF ok.\n self::$_chosen_taxonomies[ $taxonomy ]['terms'] = array_map( 'sanitize_title', $filter_terms ); // Ensures correct encoding.\n self::$_chosen_taxonomies[ $taxonomy ]['query_type'] = $query_type ? $query_type : apply_filters( 'masvideos_video_layered_nav_default_query_type', 'and' );\n }\n }\n }\n return self::$_chosen_taxonomies;\n }", "public function taxonomies(): \\Illuminate\\Database\\Eloquent\\Relations\\MorphToMany\n {\n return $this->morphToMany(\n PortfolioTaxonomy::class,\n 'taxonomyable',\n 'taxonomyables',\n 'taxonomyable_id',\n 'taxonomy_id',\n );\n }" ]
[ "0.76784796", "0.6117054", "0.58606696", "0.5827008", "0.5812241", "0.5812241", "0.5812241", "0.5812241", "0.5783966", "0.5761019", "0.5745007", "0.56013995", "0.55632585", "0.55569285", "0.5555781", "0.555486", "0.55384344", "0.55384344", "0.55384344", "0.55384344", "0.55384344", "0.553346", "0.5528826", "0.55103254", "0.5421124", "0.53856784", "0.527734", "0.52608734", "0.52480346", "0.5219131" ]
0.76682264
1
Return smashcast's category id for game name
private function searchCategoryFromName(String $name) : int { $result = $this->client->get('search/games', ['query' => ['q' => $name]]); $result = $this->getContentFromGuzzle($result); $game = $result['categories']; if (0 == count($game)) { throw new GameNotFoundException(); } if (count($game) > 1) { $game = $this->getMostSimilarGame($name, $game); } return (int)$game[0]['category_id']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_category()\n {\n return 'Fun and Games';\n }", "public static function get_category_name(): string {\n return get_config('tool_moodlenet', 'profile_category');\n }", "function category_games()\n{\n\tglobal $smcFunc;\n\n\t$no = 30;\n\t// Load Category information\n \t$result = $smcFunc['db_query']('', '\n\t\tSELECT\n\t\tc.id_category,\n\t\tcount(g.id_category) AS games,\n\t\tc.category_name,\n\t\tc.category_icon\n\t\tFROM {db_prefix}arcade_games g, {db_prefix}arcade_categories c\n\t\tWHERE g.id_category = c.id_category AND g.enabled = 1\n \t\tGROUP BY g.id_category\n \t\tORDER BY c.category_order\n \t\tLIMIT 0, {int:limit}',\n\t\tarray(\n\t\t'limit' => $no,\n\t\t)\n\t);\n\twhile ($cat = $smcFunc['db_fetch_assoc']($result))\n\t{\n\t\t$cats[$cat['id_category']] = $cat;\n\t}\n\treturn $cats;\n}", "function get_category_id( $cat_name ){\n\t$term = get_term_by( 'name', $cat_name, 'category' );\n\treturn $term->term_id;\n}", "private function _getCategoryID($cat_name) {\n $query = \"SELECT category_id FROM \". DB_PREFIX.\"category_description\"\n . \" WHERE name='\".$cat_name.\"' AND language_id ='1'\";\n $result = $this->db->query($query);\n return $result->row['category_id'];\n }", "function get_cat_ID($cat_name='General') {\r\n\tglobal $gcdb;\r\n\t\r\n\t$cid = $gcdb->get_var(\"SELECT tag_ID FROM $gcdb->tags WHERE tag_name='$cat_name'\");\r\n\r\n\treturn $cid?$cid:1;\t// default to cat 1\r\n}", "public function getCategoryID() {\n\t\t\treturn \tget_cat_id($this->getCategoryName());\n\t\t}", "public function getIdFromName($name)\n {\n $statCategory = $this->find('all')\n ->select(['id'])\n ->where(['name' => $name])\n ->first();\n\n return $statCategory ? $statCategory->id : null;\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 }", "function mp_get_categoryid()\r\n\t{\r\n\t\t$suffix=qa_session_var_suffix();\r\n\t\t\r\n\t\t// lets check if we have a cookie defined already\r\n\t\tif (!empty($_COOKIE['qa_session'])) {\r\n\t\t\t@list($handle, $sessioncode, $remember, $categoryid)=explode('/', $_COOKIE['qa_session']);\r\n\t\t\t\r\n\t\t\t$_SESSION['mp_session_category_id_'.$suffix] = $categoryid;\r\n\r\n\t\t}\r\n\t\t\r\n\t\treturn @$_SESSION['mp_session_category_id_'.$suffix];\r\n\t}", "public function getStoreCategoryByName($category){\n\n\n $storecat = Mage::getModel('catalog/category')->getCollection()->addFieldToFilter('name',$category)->getFirstItem();\n $id = $storecat->getEntityId();\n\n if($id){\n return $storecat->getEntityId();\n } else {\n return $id;\n }\n }", "function getcategoryidshort ($request) {\n global $catsdump;\n\n foreach ($catsdump as $cat) {\n if (killentities($cat['name']) == $request) {\n return $cat['id'];\n }\n }\n}", "function get_id_by_name($name)\n\t{\n\t\t$this->db->select('id');\n\t\t$this->db->from('castings_categories');\n\t\t$this->db->where('name',$name);\n\t\t$query = $this->db->get()->first_row('array');\n\t\treturn $query['id'];\n \t\n\t}", "function get_cat($catname) // get category id (existing or make new)\n{\n\t$tbl_categories = Database :: get_course_table(TABLE_LINK_CATEGORY);\n\n\t$result = api_sql_query(\"SELECT `id` FROM \".$tbl_categories.\" WHERE `category_title`='\".addslashes($catname).\"'\", __FILE__, __LINE__);\n\n\tif (mysql_num_rows($result) >= 1 && ($row = mysql_fetch_array($result)))\n\t\treturn $row['id']; // several categories with same name: take first\n\n\t$result = api_sql_query(\"SELECT MAX(display_order) FROM \".$tbl_categories.\"\", __FILE__, __LINE__);\n\tlist ($max_order) = mysql_fetch_row($result);\n\n\tapi_sql_query(\"INSERT INTO \".$tbl_categories.\" (category_title, description, display_order) VALUES ('\".addslashes($catname).\"','','\". ($max_order +1).\"')\", __FILE__, __LINE__);\n\n\treturn mysql_insert_id();\n}", "public function getCategoryByName($name);", "function getCategoryName($catID)\n{\n\n $catOptions = get_option('rss_import_categories');\n if (!empty($catOptions)) {\n $idnum = 'cat_name_' . $catID;\n return $catOptions[$idnum];\n }\n}", "public function get_id_category()\n\t{\n\t\treturn $this->id_category;\n\t}", "function audio_category($cat_id,$lang_id)\n{\n\tglobal $db;\n\t$sql_cat = \"select category_name from cr_audio_category_details where audio_cat_id=$cat_id and lang_id=$lang_id\";\n\t$res_cat = $db->select_data($sql_cat);\n\tif(count($res_cat)>0) \n\t{\n\t\treturn $res_cat[0]['category_name'];\n\t}else\n\t{\n\t\treturn false;\n\t}\n}", "public function get_category_id ($category_name) {\n \treturn $this->db->query(\"SELECT $this->_pk_field FROM $this->_table WHERE nama_kategori = ?\", $category_name)->row(0)->kategori_id;\n }", "function getcategoryid ($request) {\n global $catsdump;\n\n foreach ($catsdump as $cat) {\n if (trim($cat['name']) == $request) {\n return $cat['id'];\n }\n }\n}", "public static function getCategory();", "public function get_category() {\n\t\treturn isset( $_GET['category'] ) ? absint( $_GET['category'] ) : 0;\n\t}", "function getCategory($category)\n{\n switch ($category) {\n case 'showcaves':\n $Category = \"Showcave\";\n break;\n case 'caves':\n $Category = \"Cave\";\n break;\n case 'subterranea':\n $Category = \"Subterranea\";\n break;\n case 'mines':\n $Category = \"Mine\";\n break;\n case 'karst':\n $Category = \"Karst\";\n break;\n case 'springs':\n $Category = \"Spring\";\n break;\n case 'gorges':\n $Category = \"Gorge\";\n break;\n default:\n $Category = \"Subterranea\";\n break;\n }\n return $Category;\n}", "public static function convert_name_to_id( $category ) {\n\t\tif ( strpos( $category, '{T}' ) === false ) {\n\t\t\t$category = wp_specialchars_decode( addslashes( $category ) );\n\n\t\t\treturn get_cat_ID( $category );\n\t\t} else {\n\t\t\treturn $category;\n\t\t}\n\t}", "function get_categoryname_by_id($data)\n\t {\n\t //\n\t\t$table = 'category';\n\t\t$input_data = array('table'=>$table, 'column_id'=>'category_id', 'column_name'=>'category_name','val'=>$data['category_id']);\n\t\treturn $this->_fun_get_text_by_id($input_data);\n\t }", "public function category()\n {\n return $this->belongsTo('category_game', 'cat_id');\n }", "public function getCategory(): string\n {\n return $this->category;\n }", "public function getCategoryName(): string {\n\t\treturn ($this->categoryName);\n\t}", "function _get_cat_id_by_url ($cat_name = \"\") {\n\t\t$cat_id = 0;\n\t\tforeach ((array)$this->_articles_cats as $cur_cat_id => $cur_cat_info) {\n\t\t\tif ($cur_cat_info[\"url\"] == $cat_name) {\n\t\t\t\t$cat_id = $cur_cat_id;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $cat_id;\n\t}", "private function parseCategory($categoryId) {\n\t\t// TODO We could implement function to parse response HTML source code and pick theese by regex.\n\t\tswitch ($categoryId) {\n\t\t\tcase '1':\n\t\t\t\treturn 'Movies';\n\t\t\t\tbreak;\n\t\t\tcase '8':\n\t\t\t\treturn 'Movies::Cam';\n\t\t\t\tbreak;\n\t\t\tcase '9':\n\t\t\t\treturn 'Movies::TS/TC';\n\t\t\t\tbreak;\n\t\t\tcase '11':\n\t\t\t\treturn 'Movies::DVDRip/DVDScreener';\n\t\t\t\tbreak;\n\t\t\tcase '12':\n\t\t\t\treturn 'Movies::DVD-R';\n\t\t\t\tbreak;\n\t\t\tcase '13':\n\t\t\t\treturn 'Movies::Bluray';\n\t\t\t\tbreak;\n\t\t\tcase '14':\n\t\t\t\treturn 'Movies::BlurayRip';\n\t\t\t\tbreak;\n\t\t\tcase '15':\n\t\t\t\treturn 'Movies::Boxsets';\n\t\t\t\tbreak;\n\t\t\tcase '29':\n\t\t\t\treturn 'Movies::Documentaries';\n\t\t\t\tbreak;\n\t\t\tcase '36':\n\t\t\t\treturn 'Movies::Foreign';\n\t\t\t\tbreak;\n\t\t\tcase '37':\n\t\t\t\treturn 'Movies::WEBRip';\n\t\t\t\tbreak;\n\t\t\tcase '43':\n\t\t\t\treturn 'Movies::HDRip';\n\t\t\t\tbreak;\n\t\t\tcase '47':\n\t\t\t\treturn 'Movies::4K';\n\t\t\t\tbreak;\n\t\t\tcase '2':\n\t\t\t\treturn 'TV';\n\t\t\t\tbreak;\n\t\t\tcase '26':\n\t\t\t\treturn 'TV::Episodes';\n\t\t\t\tbreak;\n\t\t\tcase '27':\n\t\t\t\treturn 'TV::BoxSets';\n\t\t\t\tbreak;\n\t\t\tcase '32':\n\t\t\t\treturn 'TV::Episodes HD';\n\t\t\t\tbreak;\n\t\t\tcase '44':\n\t\t\t\treturn 'TV::Foreign';\n\t\t\t\tbreak;\n\t\t\tcase '3':\n\t\t\t\treturn 'Games';\n\t\t\t\tbreak;\n\t\t\tcase '17':\n\t\t\t\treturn 'Games::PC';\n\t\t\t\tbreak;\n\t\t\tcase '18':\n\t\t\t\treturn 'Games::XBOX';\n\t\t\t\tbreak;\n\t\t\tcase '19':\n\t\t\t\treturn 'Games::XBOX360';\n\t\t\t\tbreak;\n\t\t\tcase '20':\n\t\t\t\treturn 'Games::PS2';\n\t\t\t\tbreak;\n\t\t\tcase '21':\n\t\t\t\treturn 'Games::PS3';\n\t\t\t\tbreak;\n\t\t\tcase '22':\n\t\t\t\treturn 'Games::PSP';\n\t\t\t\tbreak;\n\t\t\tcase '28':\n\t\t\t\treturn 'Games::Wii';\n\t\t\t\tbreak;\n\t\t\tcase '30':\n\t\t\t\treturn 'Games::Nintendo DS';\n\t\t\t\tbreak;\n\t\t\tcase '39':\n\t\t\t\treturn 'Games::PS4';\n\t\t\t\tbreak;\n\t\t\tcase '40':\n\t\t\t\treturn 'Games::XBOXONE';\n\t\t\t\tbreak;\n\t\t\tcase '42':\n\t\t\t\treturn 'Games::Mac';\n\t\t\t\tbreak;\n\t\t\tcase '48':\n\t\t\t\treturn 'Games::Nintendo Switch';\n\t\t\t\tbreak;\n\t\t\tcase '4':\n\t\t\t\treturn 'Music';\n\t\t\t\tbreak;\n\t\t\tcase '16':\n\t\t\t\treturn 'Music::Music Videos';\n\t\t\t\tbreak;\n\t\t\tcase '31':\n\t\t\t\treturn 'Music::Audio';\n\t\t\t\tbreak;\n\t\t\tcase '5':\n\t\t\t\treturn 'Books';\n\t\t\t\tbreak;\n\t\t\tcase '45':\n\t\t\t\treturn 'Books::EBooks';\n\t\t\t\tbreak;\n\t\t\tcase '46':\n\t\t\t\treturn 'Books::Comics';\n\t\t\t\tbreak;\n\t\t\tcase '6':\n\t\t\t\treturn 'Applications';\n\t\t\t\tbreak;\n\t\t\tcase '23':\n\t\t\t\treturn 'Applications::PC-ISO';\n\t\t\t\tbreak;\n\t\t\tcase '24':\n\t\t\t\treturn 'Applications::Mac';\n\t\t\t\tbreak;\n\t\t\tcase '25':\n\t\t\t\treturn 'Applications::Mobile';\n\t\t\t\tbreak;\n\t\t\tcase '33':\n\t\t\t\treturn 'Applications::0-day';\n\t\t\t\tbreak;\n\t\t\tcase '7':\n\t\t\t\treturn 'Animation';\n\t\t\t\tbreak;\n\t\t\tcase '34':\n\t\t\t\treturn 'Animation::Anime';\n\t\t\t\tbreak;\n\t\t\tcase '35':\n\t\t\t\treturn 'Animation::Cartoons';\n\t\t\t\tbreak;\n\t\t\tcase '38':\n\t\t\t\treturn 'Animation::Education';\n\t\t\t\tbreak;\t\t\t\n\t\t}\n\t}" ]
[ "0.6431402", "0.6364751", "0.63584435", "0.6285062", "0.62689674", "0.62492317", "0.6210693", "0.6166442", "0.60858613", "0.6059933", "0.60215956", "0.5990671", "0.5958174", "0.5953885", "0.59474754", "0.5929761", "0.5926342", "0.5909893", "0.5907017", "0.58957446", "0.5892565", "0.5871538", "0.58574605", "0.5853169", "0.5840111", "0.58328104", "0.5826524", "0.58202", "0.5793576", "0.5778909" ]
0.65105885
0
turn an array of id's into an array of objects
public static function GetArray($id_array) { $class = get_called_class(); $instance_array = array(); foreach($id_array as $id) { $new = $class::Get($id); if (!is_null($new)) { array_push($instance_array, $new); } } return $instance_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function fetchIDArray($idArray, $asObject = true)\n {\n global $eZContentObjectContentObjectCache;\n\n $uniqueIDArray = array_unique($idArray);\n\n $useVersionName = true;\n if ($useVersionName) {\n $versionNameTables = ', ezcontentobject_name ';\n $versionNameTargets = ', ezcontentobject_name.name as name, ezcontentobject_name.real_translation ';\n\n $versionNameJoins = \" and ezcontentobject.id = ezcontentobject_name.contentobject_id and\n ezcontentobject.current_version = ezcontentobject_name.content_version and \" .\n eZContentLanguage::sqlFilter('ezcontentobject_name', 'ezcontentobject');\n }\n\n $db = eZDB::instance();\n // All elements from $uniqueIDArray should be casted to (int)\n $objectWhereINSQL = $db->generateSQLINStatement($uniqueIDArray, 'ezcontentobject.id', false, false, 'int');\n $query = \"SELECT ezcontentclass.serialized_name_list as class_serialized_name_list, ezcontentobject.* $versionNameTargets\n FROM\n ezcontentclass,\n ezcontentobject\n $versionNameTables\n WHERE\n ezcontentclass.id=ezcontentobject.contentclass_id AND\n $objectWhereINSQL\n $versionNameJoins\";\n\n $resRowArray = $db->arrayQuery($query);\n\n $objectRetArray = array();\n foreach ($resRowArray as $resRow) {\n $objectID = $resRow['id'];\n $resRow['class_name'] = eZContentClass::nameFromSerializedString($resRow['class_serialized_name_list']);\n if ($asObject) {\n $className = self::getClassName(\n isset($resRow['contentclass_identifier']) ? $resRow['contentclass_identifier'] : null\n );\n $obj = new $className($resRow);\n $obj->ClassName = $resRow['class_name'];\n $eZContentObjectContentObjectCache[$objectID] = $obj;\n $objectRetArray[$objectID] = $obj;\n } else {\n $objectRetArray[$objectID] = $resRow;\n }\n }\n\n return $objectRetArray;\n }", "public function convertFromId($input) {\n\t\t$output = array();\n\n\t\twhile(list($key, $val) = each($input)) {\n\t\t\t$convert = false;\n\n\t\t\tif($key === 'id') {\n\t\t\t\t$convert = true;\n\t\t\t} elseif(substr($key, -3) === '_id') {\n\t\t\t\t$convert = true;\n\t\t\t} elseif(is_array($val)) {\n\t\t\t\t$output[$key] = $this->convertFromId($val);\n\t\t\t} else {\n\t\t\t\t$output[$key] = $val;\n\t\t\t}\n\n\t\t\tif($convert) {\n\t\t\t\t$output[$key] = $this->_convertFromId($val);\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}", "function getByIds(array $ids);", "public function toArray ( $id = null );", "public static function getIds($array)\n {\n if (count($array) === 0)\n {\n return array();\n }\n \n // is_object covers stdClass objects. instanceof Object doesn't. Yes this is weird.\n if (is_object($array[0]))\n {\n if (isset($array[0]->id))\n {\n return self::getResultsForProperty($array, 'id');\n }\n else\n {\n return self::getResultsForMethod($array, 'getId'); \n }\n }\n else\n {\n return self::getResultsForKey($array, 'id'); \n }\n }", "public function findAllByIdArray($idArray);", "public function _convertFromId($input) {\n\t\tif(!is_array($input)) {\n\t\t\treturn $input . '';\n\t\t}\n\n\t\t$output = array();\n\n\t\twhile(list($key, $value) = each($input)) {\n\t\t\t$output[$key] = $this->_convertFromId($value);\n\t\t}\n\n\t\treturn $output;\n\t}", "function toIdArray($inArray,$idField,$valueField1,$valueField2){\n if(isset($inArray)) {\n foreach ($inArray as $row) {\n $outArray[$row->$idField]=$row->$valueField1.\" -> \".$row->$valueField2;\n //print_r($row->hotel_Id);\n }\n }\n return $outArray;\n }", "public function convertToId($input) {\n\t\t$output = array();\n\n\t\twhile(list($key, $val) = each($input)) {\n\t\t\t$convert = false;\n\n\t\t\tif($key === 'id') {\n\t\t\t\t$convert = true;\n\t\t\t} elseif(substr($key, -3) === '_id') {\n\t\t\t\t$convert = true;\n\t\t\t} elseif(is_array($val)) {\n\t\t\t\t$output[$key] = $this->convertToId($val);\n\t\t\t} else {\n\t\t\t\t$output[$key] = $val;\n\t\t\t}\n\n\t\t\tif($convert) {\n\t\t\t\t$output[$key] = $this->_convertToId($val);\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}", "public function getIDArray( $objects ) {\n return ArrayHelper::map($objects, 'hvi_id', 'hvi_id');\n }", "public static function fetchFromIds(array $ids): array;", "public function getIds(): array;", "public static function to_id_array($items)\n\t{\n\t\t$IDs = [];\n\n\t\tif (empty($items))\n\t\t{\n\t\t\t$items = [];\n\t\t}\n\n\t\tforeach ($items as $item)\n\t\t\t$IDs[] = $item->id;\n\n\t\treturn $IDs;\n\t}", "public function getByArrayId($array)\n {\n foreach($array as $k => $v){\n $array[$k] = $this->getRep()->findOneBy(array('tag_id'=>$v));\n }\n return $array;\n }", "public function ids(): array;", "public static function convertIds($ids = [])\n {\n $objIds = [];\n foreach ($ids as $id)\n $objIds[] = self::objectId($id);\n return $objIds;\n }", "function findByIds(array $ids);", "public function getObjectIds()\n {\n $object_ids = array();\n \n foreach ($this->getItems() as $item)\n {\n if (!array_key_exists($item->getClass(), $object_ids))\n {\n $object_ids[$item->getClass()] = array();\n }\n\n $object_ids[$item->getClass()][] = $item->getId();\n }\n \n return $object_ids;\n }", "public function getIdList(array $list)\n {\n return array_map(function($element) {\n if($element instanceof \\MongoId) {\n return $element;\n }\n\n if($element instanceof Model) {\n return $element->getMongoId();\n }\n\n return new \\MongoId($element);\n }, $list);\n }", "public function getAllId(): array;", "function getEncodesObjectIds($array)\n{\n if (!empty($array)) {\n foreach ($array as $key => $value) {\n if (is_array($value)) {\n $array[$key] = getEncodesObjectIds($value);\n } else if(is_object($value)){\n\n $array[$key] = (object)getEncodesObjectIds((array)$value);\n } else {\n $array[$key] = is_null($array[$key]) ? \"\" : $array[$key];\n //encodes all key if id found in key\n if (stristr($key, \"id\") && $key != \"validat\") {\n $array[$key] = encodes($value);\n }\n }\n }\n }\n return $array;\n}", "public static function getIds(array $array, $pk = \"id\") {\n\t\t$result = [];\n\t\tforeach ($array as $r) {\n\t\t\tif (is_array($r)) {\n\t\t\t\t$result[] = $r[$pk];\n\t\t\t} else {\n\t\t\t\t$result[] = $r->$pk;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public static function getListByIds( array $ids )\r\n {\r\n if( !sizeof($ids) ) return array();\r\n\r\n $className = self::getModelClass( true );\r\n\r\n $properties = (array) $className::identityProperty();\r\n \r\n $propertiesCount = sizeof( $properties );\r\n \r\n $list = array();\r\n $sortIds = array();\r\n\r\n foreach( $ids as &$modelId )\r\n {\r\n $modelId = is_array( $modelId ) ? $modelId : array( $modelId );\r\n\r\n if( sizeof( $modelId ) != $propertiesCount )\r\n throw new Exception( 'Model identity properties count do not equal count of values given.' );\r\n\r\n $model = ModelWatcher::instance()->get( $className, $modelId );\r\n\r\n if( $model )\r\n {\r\n $list[ $model->getId() ] = $model;\r\n }\r\n\r\n $sortIds[] = is_array( $modelId ) ? implode(':', $modelId) : $modelId;\r\n }\r\n\r\n $condition = new \\Sql\\Condition();\r\n\r\n if( sizeof( $ids ) !== sizeof( $list ) )\r\n {\r\n for( $i = 0; $i < $propertiesCount; $i++ )\r\n {\r\n $idParts = array();\r\n\r\n foreach( $ids as &$modelId )\r\n {\r\n if( isset( $list[ implode( ':', is_array( $modelId ) ? $modelId : array( $modelId ) ) ] ) ) continue;\r\n\r\n $idParts[] = $modelId[ $i ];\r\n }\r\n\r\n if( !empty( $idParts ) )\r\n {\r\n $condition->where( $properties[ $i ] . ' IN ( ' . implode( ',', $idParts ) . ' ) ' );\r\n }\r\n }\r\n unset( $idParts );\r\n\r\n $stmt = \\SqlDb::factory()->prepare( 'SELECT * FROM ' . self::getModelTable() . ' ' . $condition );\r\n\r\n $stmt->execute();\r\n\r\n $className = self::getModelClass();\r\n $tableColumns = null;\r\n\r\n while ( $modelData = $stmt->fetch( \\PDO::FETCH_ASSOC ) )\r\n {\r\n $model = new $className;\r\n\r\n if( null === $tableColumns )\r\n {\r\n $tableColumns = $model->tableReflection()->columns;\r\n }\r\n\r\n // set && normalize property values\r\n foreach( $tableColumns as $column )\r\n {\r\n $model->{$column->name} = self::castFromSql( $modelData[ $column->name ], $column->datatype );\r\n }\r\n\r\n $list[ implode( ':', is_array( $model->id ) ? $model->id : array( $model->id ) ) ] = $model;\r\n\r\n ModelWatcher::instance()->bind( $model );\r\n }\r\n\r\n // sort with initial ids order\r\n $list = \\Erum\\Arr::ksortByArray( $list, $sortIds );\r\n }\r\n\r\n return $list;\r\n }", "public function id_list($id) {\n $data = array();\n $query = $this->db->query(\"SELECT id FROM transection WHERE id>'$id'\");\n foreach ($query->result_array() as $row) {\n $data[] = $row;\n }\n return $data;\n }", "public function getObjectArray()\r\n {\r\n $array = $this->getArray();\r\n $result = array();\r\n\r\n if (is_array($array))\r\n {\r\n foreach ($array as $key => $item)\r\n {\r\n $stdClass = new \\stdClass();\r\n $stdClass->id = $key;\r\n $stdClass->value = $item;\r\n\r\n $result[] = $stdClass;\r\n }\r\n }\r\n\r\n return $result;\r\n }", "public function getObjectsByIds(array $ids){\n if (empty($ids)) {\n throw new InvalidArgumentException('Invalid Ids');\n }\n \n //check ids\n foreach($ids as $id){\n if(!is_numeric($id)){\n throw new InvalidArgumentException('Invalid Id: '.$id);\n }\n }\n \n $results = $this->getMapper()->fetchObjectsByIds($ids);\n \n if (count($results) == 0) {\n throw new NotFoundException('No Component Models Found: '.implode(', ',$ids), 404);\n }\n //@todo check to make sure all results asked for are recieved\n \n $array = array();\n foreach ($results as $row) {\n $array[$row->id] = $row;\n }\n\n return $array;\n }", "public function toArray() {\n $a = array();\n if( $this->id ) {\n $a[\"id\"] = $this->id;\n }\n return $a;\n }", "public function getsuggObj($idsInfoArray) {\n\tforeach ($idsInfoArray as $idsArray) {\n\t foreach ($idsArray as $modName => $idsArray) {\n\t\tif (empty($modName) || empty($idsArray)) {\n\t\t return;\n\t\t}\n\t\t$modInfo = Engine_Api::_()->getApi('modInfo', 'suggestion')->getPluginDetailed($modName);\n\t\t$modInfo = $modInfo[$modName];\n\t\t$table = Engine_Api::_()->getItemTable($modInfo['itemType']);\n\t\t$select = $table->select()->where($modInfo['idColumnName'] . \" IN (\" . implode(',', $idsArray) . \")\");\n\t\t$fetch = $table->fetchAll($select);\n\t\t$finalFetch[$modName] = $fetch;\n\t\t$finalobj[] = $finalFetch;\n\t }\n\t}\n\treturn $finalobj;\n }", "public static function getIdArrayFromInstances(array $instances)\n\t{\n\t\treturn static::getArrayOfSingleFieldFromInstances($instances, '_id');\n\t}", "public function ids() \n {\n $ids = array();\n\n foreach ($this->_ids as $id) {\n $ids[$id] = $this->{$id};\n }\n\n return $ids;\n }" ]
[ "0.6720866", "0.6593601", "0.6550273", "0.65432906", "0.65187263", "0.6431583", "0.64239395", "0.6365223", "0.6351161", "0.6333955", "0.6322918", "0.6298908", "0.6253295", "0.6244481", "0.6187263", "0.61439556", "0.61283433", "0.6100871", "0.60560095", "0.5932929", "0.59252757", "0.5890156", "0.58549875", "0.5841472", "0.5811444", "0.5794042", "0.57901764", "0.578937", "0.5767298", "0.5757526" ]
0.66800714
1
return $this>db>get("categories order by catName".$this>lang, null, "id, questions, catName".$this>lang." as catName");
public function getAllCategories() { $sql = "select id, questions, catName".$this->lang." as catName from categories order by (case when (catNameAz like '%Digər%') then 'яяяяяя' else catName end)"; return $this->db->rawQuery($sql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function getAllCategories(){\n $results = \\DB::select(\"SELECT * FROM \" . self::$categoryTableName . \" where name not like '%sincategoria%' order by code\");\n \n return $results;\n }", "function getCategories(){\n return executeeQuery(\"SELECT * FROM kategorije\");\n}", "function get_categories(){\n $this->db->order_by('name');\n\n // get the data from the table and store in query\n $query = $this->db->get('categories');\n\n // return the data as an array\n return $query->result_array();\n }", "function getCategories($languageCode){\r\n\t\r\n\t$sql=\"SELECT idlanguage FROM `languages` WHERE languagecode='$languageCode'\";\r\n\t//echo \"<br>\".$sql.\"<br>\";\r\n\t$row = doSQL_Read($sql);\r\n\t$idlanguage = $row[0][\"idlanguage\"];\r\n\t\r\n\tif($idlanguage==\"\") $idlanguage=\"1\";\r\n\t\r\n\t$sql=\"SELECT id, category FROM categories WHERE active='1' AND idlanguage='$idlanguage' ORDER BY category\";\r\n\t//echo \"<br>\".$sql.\"<br>\";\r\n\t$v_data = doSQL_Read($sql);\r\n\r\n\treturn $v_data;\r\n}", "public function read_by_cat(){\n //Query \n $req = 'SELECT a.id, a.titre, a.contenu, a.dateCreation, a.dateModification, a.auteur, a.categorie, c.libelle as category_name\n FROM '.$this->table.' a inner join categorie c on a.categorie = c.id where c.libelle = ?;\n ';\n\n // prepare query\n //prepare statement \n $stmt = $this->conn->prepare($req);\n\n //BIND the ID\n $stmt->bindParam(1, $this->libelle);\n //Execute it \n $stmt->execute();\n //prepare statement \n \n \n return $stmt;\n \n }", "public function getCategories(){\n if($this->get_request_method() != \"GET\"){\n $this->response('',406);\n }\n\n $query=\"SELECT `id`, `nombre` FROM `categoria`\";\n\n $this->db->get($query);\n }", "function getCat() {\r\n global $con;\r\n $stmt = $con->prepare(\"SELECT * FROM categories ORDER BY cat_id ASC\");\r\n $stmt->execute();\r\n $rows = $stmt->fetchAll();\r\n return $rows;\r\n }", "function afficherCategory(){\n $sql=\"SElECT * From category\";\n $db = config::getConnexion();\n try{\n $liste=$db->query($sql);\n return $liste;\n }\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n }", "function get_categories(){\n $this->db->select(\"banners.*,categories.title as cat_title\");\n $this->db->order_by(\"banners.id desc\");\n $this->db->join(\"categories\",\"categories.id = banners.type_value and banners.type = 'category'\",\"left\");\n $q = $this->db->get($this->table_name);\n\n return $q->result();\n \n }", "function category_name($id) {\n\n global $course_id;\n\n $r = Database::get()->querySingle(\"SELECT cat_title FROM forum_category\n WHERE id = ?d\n AND course_id = ?d\", $id, $course_id);\n if ($r) {\n return $r->cat_title;\n } else {\n return FALSE;\n }\n}", "public static function getCategories() {\n $db = Database::getDB();\n\n try {\n \n $query = 'SELECT * FROM categories ORDER BY categoryID';\n $statement = $db->prepare($query);\n $statement->execute();\n $categories = $statement->fetchAll();\n $statement->closeCursor();\n \n return $categories;\n\n } catch (PDOException $e) {\n $error_message = $e->getMessage();\n // display_db_error($error_message);\n }\n}", "public function getListeCat(){\n\t\t\treturn DAO::queryAll('select nomCategorie from Categorie');\n\t\t}", "public function getAllCategories()\n {\n // Use default select statement unless other SQL has been supplied\n $this->sql = $this->defaultSelect . ' order by name';\n\n return $this->find();\n }", "function carregaCategorias($conn){\n\t\t$buscar=$conn->query(\"SELECT * from categorias order by nome asc\");\n\t\treturn $buscar->fetchAll(PDO::FETCH_ASSOC);\n\t}", "public function OrderBy(){\n$productos = $this->db->query(\"SELECT * FROM productos ORDER BY id ASC\"); \nreturn $productos; \n}", "function category_list() {\n\t$sql = \"SELECT cid,category FROM categories ORDER BY category\";\n\treturn $_ENV['dbi']->fetch_all($sql,'array');\n}", "function RecupCategories()\n\t{\n\t\t$sql=\"SElECT * From Categorie\";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "function afficherCategories(){\n\t\t$sql=\"SElECT * From categorie\";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "function getCategories(){\n\t\t$query = $this->db->get('categorias');\n\t\tif($query->num_rows() > 0) return $query;\n\t\telse return NULL;\n\t}", "public function ListaCategoria() {\n $consultaListaCategoria = $this->db->select(\"SELECT * FROM categorias \");\n return $consultaListaCategoria;\n }", "public static function getAllCategory(){\n \treturn self::orderby('wordingCategory')\n \t\t\t\t->get(['wordingCategory']);\n }", "function getCategory($name,$Lang,$Languages) {\n\tif (empty($name)) $name=\"Default\";\n\t$tmp=split(\"!\",$name);\n\t$maingroup=0;\n\t$found=true;\n\t$i=0;\n\tdo {\n\t\t$sql=\"select D.*,C.parent_id from categories C left join categories_description D on C.categories_id=D.categories_id \";\n\t\t$sql.=\"where (categories_name = '\".$tmp[$i].\"' or categories_meta_title ='\".$tmp[$i].\"') and \";\n\t\t$sql.=\"C.parent_id=$maingroup and language_id=$Lang\";\n\t\t$rs=getAll(\"shop\",$sql,\"getCategory\");\n\t\tif ($rs) {\n\t\t\t$maingroup=$rs[0][\"categories_id\"];\n\t\t\t$i++;\n\t\t} else {\n\t\t\t$found=false;\n\t\t}\n\t} while ($rs and $found and $i<count($tmp));\n\tfor (;$i<count($tmp); $i++) {\n\t\t$maingroup=createCategory($tmp[$i],$maingroup,$Lang,$Languages);\n\t}\n\treturn $maingroup;\n}", "public function read_by_categories(){\r\n //create query\r\n $query = 'SELECT\r\n c.name as category_name,\r\n p.id,\r\n p.category_id,\r\n p.name,\r\n p.price,\r\n p.description,\r\n p.stock,\r\n p.product_img,\r\n p.created_at\r\n FROM '.$this->table . ' p LEFT JOIN categories c ON p.category_id=c.id WHERE p.category_id = :category_id ORDER BY p.created_at DESC';\r\n \r\n //prepare statement\r\n $stmt = $this->conn->prepare($query);\r\n\r\n //clean the data\r\n $this->category_id = htmlspecialchars(strip_tags($this->category_id));\r\n \r\n //bind param\r\n $stmt->bindParam(':category_id', $this->category_id);\r\n \r\n //execute query\r\n $stmt->execute();\r\n // if($stmt->execute()){\r\n // return true;\r\n // } else {\r\n // printf(\"Errorr %s. \\n\", $stmt->error);\r\n // return false;\r\n // }\r\n }", "function selectAllTech() {\n return db()->query(\"SELECT * FROM post WHERE category_id = 3 ORDER BY post_id DESC\");\n }", "function smarty_function_adminGetCategories(array $args, Smarty_Internal_Template $smarty){\n\n\t$log = Logger::getLogger(\"com.dalisra.smartyfunction.adminGetCategories\");\n\n $log->debug(\"Preparing Query\");\n $params = array();\n $params['from'] = 'categories';\n $params['orderby'] = \"priority\";\n $list = APP::$db->getData($params);\n if(!$list){\n $log->debug(\"Got error executing query: \" . APP::$db->db_error);\n }\n\n $smarty->assign(\"list\", $list);\n\n}", "function get_ticketscategory()\n\t{\n\t\treturn $this->db->order_by(\"category\", \"ASC\")->get('support_ticket_category')->result();\t\t\n\t}", "function affichercategories(){\r\n\t\t$sql=\"SElECT * From categorie\";\r\n\t\t$db = config::getConnexion();\r\n\t\ttry{\r\n\t\t$liste=$db->query($sql);\r\n\t\treturn $liste;\r\n\t\t}\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n }\t\r\n\t}", "function ListarCategoria()\n\t{\n\t\t$sql = \"SELECT * FROM categoria\";\n\t\treturn EjecutarConsulta($sql);\n\t}", "public function modelListCategories(){\n\t\t\t$conn = Connection::getInstance();\n\t\t\t$query = $conn->query(\"select * from categories where parent_id = 0 order by id desc\");\n\t\t\treturn $query->fetchAll();\n\t\t}", "function get_list()\n {\n $db_obj = new DB();\n\t$category_list_query=\"SELECT * FROM category order by order_num desc\";\n $result = $db_obj->query($category_list_query);\n return $result;\n }" ]
[ "0.6863063", "0.67370665", "0.6708064", "0.66828024", "0.6602711", "0.6565937", "0.65509444", "0.6533797", "0.6456496", "0.6441543", "0.6408063", "0.63891035", "0.6385315", "0.6373115", "0.63655806", "0.6357995", "0.6336212", "0.63184595", "0.63133895", "0.6311889", "0.63072777", "0.6303572", "0.62825125", "0.6279956", "0.62772596", "0.6277195", "0.6268778", "0.62684435", "0.62610185", "0.6258856" ]
0.7321685
0
Alters the webform views local tasks.
public function alterLocalTasks(&$local_tasks) { // We want to unset all the "standard" tabs - those generated by // Drupal\views\Plugin\Derivative\ViewsLocalTask since we manage menu tabs // of webform submission views on our own. foreach (webform_views_applicable_views() as $trio) { list($view_id, $display_id, $path) = $trio; $plugin_id = 'view.' . $view_id . '.' . $display_id; unset($local_tasks['views_view:' . $plugin_id]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openlucius_core_filter_local_tasks(&$local_tasks) {\n\n // Fetch active menu item.\n $item = menu_get_item();\n\n // Loop through the tabs.\n foreach ($local_tasks['tabs']['output'] as $key => $tab) {\n\n // Check if path is set.\n if (isset($local_tasks['tabs']['output'][$key]['#link']['path'])) {\n\n // Get the path.\n $path = $local_tasks['tabs']['output'][$key]['#link']['path'];\n\n // Unset the edit tab on edit pages.\n if ($item['path'] == 'node/%/edit' && ($path == 'node/%/view' || $path == 'node/%/edit')) {\n unset($local_tasks['tabs']['output'][$key]);\n }\n\n // Remove view and revision links.\n if ($path == 'node/%/view') {\n unset($local_tasks['tabs']['output'][$key]);\n }\n }\n }\n}", "public function edit()\n\t{\n\t\tsession_start();\n\t\tif(isset($_SESSION[\"UserID\"])) {\n\t\t\t$Result = $this->showTasks();\n\t\t\t$this->data[\"Record\"] = \\utility\\table::TableEdit($Result[\"Record\"]);\n\t\t\t$this->template = 'edit_task';\n\t\t} else {\n\t\t\theader('Location: index.php');\n\t\t}\n\t}", "public function edit()\r\n {\r\n if($this->getSessionHandler()->isLoggedIn())\r\n {\r\n $id = $this->getRequestObject()->getParameter('id');\r\n $record = todos::create()->findOne($id);\r\n \r\n $v = new EditTaskView();\r\n $v->injectData(array('data' => $record, 'id' => $id));\r\n echo $v->render();\r\n }\r\n else\r\n {\r\n $this->displayMessage('You must login to view this area!');\r\n }\r\n\r\n }", "function update_task_list($active = NULL) {\n // Default list of tasks.\n $tasks = array(\n 'info' => 'Overview',\n 'select' => 'Select updates',\n 'run' => 'Run updates',\n 'finished' => 'Review log',\n );\n\n drupal_set_content('left', theme('task_list', $tasks, $active));\n}", "public function change()\n {\n $task = $this->getTask();\n $subtask = $this->getSubtask($task);\n $fragment = $this->request->getStringParam('fragment');\n\n $status = $this->subtaskStatusModel->toggleStatus($subtask['id']);\n $subtask['status'] = $status;\n\n if ($fragment === 'table') {\n $html = $this->renderTable($task);\n } elseif ($fragment === 'rows') {\n $html = $this->renderRows($task);\n } else {\n $html = $this->helper->subtask->renderToggleStatus($task, $subtask);\n }\n\n $this->response->html($html);\n }", "protected function index()\n {\n $this->set('tasks', $this->model->getAll());\n }", "function da_vinci_menu_local_tasks(&$variables) {\n $output = '';\n\n if (!empty($variables['primary'])) {\n $variables['primary']['#prefix'] = '<h2 class=\"element-invisible\">' . t('Primary tabs') . '</h2>';\n $variables['primary']['#prefix'] .= '<ul class=\"tabs primary clearfix\">';\n $variables['primary']['#suffix'] = '</ul>';\n $output .= drupal_render($variables['primary']);\n }\n if (!empty($variables['secondary'])) {\n $variables['secondary']['#prefix'] = '<h2 class=\"element-invisible\">' . t('Secondary tabs') . '</h2>';\n if (arg(0) == 'user') {\n $variables['secondary'][0]['#link']['title'] = t('My account');\n $variables['secondary']['#prefix'] .= '<ul class=\"nav nav-tabs\">';\n }\n else {\n $variables['secondary']['#prefix'] .= '<ul class=\"tabs secondary clearfix\">';\n }\n $variables['secondary']['#suffix'] = '</ul>';\n $output .= drupal_render($variables['secondary']);\n }\n return $output;\n}", "function taskEditI() {\r\n\t\t\t$this->obj_edit->editItem();\r\n\t\t}", "public function editAction()\n {\n $tctaskId = $this->getRequest()->getParam('id');\n $tctask = $this->_initTctask();\n if ($tctaskId && !$tctask->getId()) {\n $this->_getSession()->addError(\n Mage::helper('bs_report')->__('This tc task no longer exists.')\n );\n $this->_redirect('*/*/');\n return;\n }\n $data = Mage::getSingleton('adminhtml/session')->getTctaskData(true);\n if (!empty($data)) {\n $tctask->setData($data);\n }\n Mage::register('tctask_data', $tctask);\n $this->loadLayout();\n $this->_title(Mage::helper('bs_report')->__('Report'))\n ->_title(Mage::helper('bs_report')->__('TC Tasks'));\n if ($tctask->getId()) {\n $this->_title($tctask->getTctaskName());\n } else {\n $this->_title(Mage::helper('bs_report')->__('Add tc task'));\n }\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n $this->renderLayout();\n }", "public function update()\r\n {\r\n if($this->getSessionHandler()->isLoggedIn())\r\n {\r\n $id = $this->getRequestObject()->getParameter('id');\r\n $todo = todo::findOne($id);\r\n $todo->message = $this->getRequestObject()->getParameter('message');\r\n $todo->isdone = $this->getRequestObject()->getParameter('isdone');\r\n $todo->ownerid = $this->getRequestObject()->getParameter('ownerid');\r\n $todo->owneremail = $this->getRequestObject()->getParameter('owneremail');\r\n $todo->createddate = $this->getRequestObject()->getParameter('createddate');\r\n $todo->duedate = $this->getRequestObject()->getParameter('duedate');\r\n \r\n //validate\r\n if($todo->validate() !== true)\r\n {\r\n //returns array of error messages\r\n $errors = $todo->validate();\r\n $v = new ValidationView();\r\n $v->injectData(array('messages' => $errors));\r\n echo $v->render();\r\n die(); //halt execution if it's invalid\r\n }\r\n \r\n $todo->save();\r\n header(\"Location: index.php?page=tasks&action=show&id=$id\");\r\n }\r\n else\r\n {\r\n $this->displayMessage('You must login to view this area!');\r\n }\r\n }", "public function formEditAsistenciaManual(){\r\n Obj::run()->View->render();\r\n }", "public function updateTask()\n\t{\n\t\t// Check for request forgeries\n\t\tRequest::checkToken(['get', 'post']);\n\n\t\tif (!User::authorise('core.edit', $this->_option))\n\t\t{\n\t\t\tApp::abort(403, Lang::txt('JERROR_ALERTNOAUTHOR'));\n\t\t}\n\n\t\t$project_id = Request::getInt('project', 0);\n\n\t\tif (!$project_id)\n\t\t{\n\t\t\treturn $this->cancelTask();\n\t\t}\n\n\t\t// Load the group page\n\t\t$model = new Project($project_id);\n\n\t\t//$ids = Request::getArray('id', array());\n\t\t$roles = Request::getArray('role', array());\n\n\t\t// Instantiate project owner\n\t\t$objO = $model->table('Owner');\n\n\t\tforeach ($roles as $id => $role)\n\t\t{\n\t\t\t$checked = array($id);\n\t\t\t//$role = (isset($roles[$id]) ? $roles[$id] : 0);\n\n\t\t\t// Changing role(s)\n\t\t\t$left = $checked;\n\n\t\t\tif ($role == 0)\n\t\t\t{\n\t\t\t\t// Get all managers\n\t\t\t\t$all = $objO->getIds($model->get('id'), 1);\n\n\t\t\t\t$remaining = array_diff($all, $checked);\n\n\t\t\t\tif (!$remaining && count($all) > 0)\n\t\t\t\t{\n\t\t\t\t\t$left = array_diff($checked, array($all[0])); // leave one manager\n\n\t\t\t\t\tNotify::error(Lang::txt('PLG_PROJECTS_TEAM_OWNERS_REASSIGN_NOMANAGERS'));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($objO->reassignRole($model->get('id'), $left, 0, $role))\n\t\t\t{\n\t\t\t\tNotify::success(Lang::txt('COM_PROJECTS_TEAM_OWNERS_ROLE_CHANGED'));\n\n\t\t\t\t// Sync with system group\n\t\t\t\t$objO->sysGroup($model->get('alias'), $this->config->get('group_prefix', 'pr-'));\n\t\t\t}\n\t\t}\n\n\t\tif (!Request::getInt('no_html', 0))\n\t\t{\n\t\t\t$this->cancelTask();\n\t\t}\n\t}", "public function filtertaskAction() {\r\n $this->_helper->layout()->disableLayout();\r\n $data = $this->getRequest()->getParams();\r\n\r\n unset($data['module']);\r\n unset($data['controller']);\r\n unset($data['action']);\r\n\r\n $this->view->filtertasks = $this->taskModel->filtertask($data);\r\n }", "public function index()\r\n {\r\n //commonTasks();\r\n redirect(base_url() . 'admin/dashboard', 'refresh');\r\n }", "function wptodo_manage() {\n\tglobal $wpdb, $user_ID;\n\t$wptodo_table = $wpdb->prefix . \"wptodo\";\n\tif($_POST['wptodo_addtask'] && $_POST['wptodo_title']) wptodo_addtask($_POST); //If we have a new task let's add it\n\tif($_POST['wptodo_updatetask']) wptodo_updatetask($_POST); //Update my task\n\tif($_POST['wptodo_comment_task']) wptodo_addcomment($_POST); //Add comments to tasks\n\tif($_POST['wptodo_filter_status'] != NULL) wptodo_manage_main($_POST['wptodo_filter_status']); \n\tif($_POST['wptodo_deletetask']) wptodo_deletetask($_POST['wptodo_taskid']); //Update my task\n\tif($_GET['view']) wptodo_view($_GET['view']);\n\telse if($_GET['edit']) wptodo_edit($_GET['edit']);\n\telse wptodo_manage_main(\"\");\n }", "function edit()\n\t{\n\t if (JRequest::getVar('task') == 'add') {\n\t \n\t }\n\t\tparent::display();\n\t}", "function collabco_theme_menu_local_tasks_alter(&$data, $router_item, $root_path) {\n if (is_numeric(arg(1))) {\n $node = node_load(arg(1));\n if (empty($node)) {\n return;\n }\n $ntype = $node->type;\n if (isset($data['tabs'][0]['output'])) {\n foreach ($data['tabs'][0]['output'] as $key => $value) {\n if ($ntype == 'idea' || $ntype == 'hub') {\n unset($data['tabs'][0]['output'][$key]);\n }\n }\n }\n }\n if (arg(0) == 'user' && is_numeric(arg(1)) && arg(2) == FALSE) {\n $data['tabs'][0]['count'] = 0;\n }\n}", "function cvve_menu_local_tasks(&$variables) {\n\t$output = '';\n\n\tif (!empty($variables['primary'])) {\n\t\t$variables['primary']['#prefix'] = '<h2 class=\"element-invisible\">' . t('Primary tabs') . '</h2>';\n\t\t$variables['primary']['#prefix'] .= '<ul class=\"tabs primary clearfix\">';\n\t\t$variables['primary']['#suffix'] = '</ul>';\n\t\t$output .= drupal_render($variables['primary']);\n\t}\n\tif (!empty($variables['secondary'])) {\n\t\t$variables['secondary']['#prefix'] = '<h2 class=\"element-invisible\">' . t('Secondary tabs') . '</h2>';\n\t\t$variables['secondary']['#prefix'] .= '<ul class=\"tabs secondary clearfix\">';\n\t\t$variables['secondary']['#suffix'] = '</ul>';\n\t\t$output .= drupal_render($variables['secondary']);\n\t}\n\n\treturn $output;\n}", "function task_threadviews($task)\n{\n\tglobal $mybb, $db, $lang, $plugins;\n\n\tif($mybb->settings['delayedthreadviews'] != 1)\n\t{\n\t\treturn;\n\t}\n\n\t// Update thread views\n\t$query = $db->simple_select(\"threadviews\", \"tid, COUNT(tid) AS views\", \"\", array('group_by' => 'tid'));\n\twhile($threadview = $db->fetch_array($query))\n\t{\n\t\t$db->update_query(\"threads\", array('views' => \"views+{$threadview['views']}\"), \"tid='{$threadview['tid']}'\", 1, true);\n\t}\n\n\t$db->write_query(\"TRUNCATE TABLE \".TABLE_PREFIX.\"threadviews\");\n\n\tif(is_object($plugins))\n\t{\n\t\t$plugins->run_hooks('task_threadviews', $task);\n\t}\n\n\tadd_task_log($task, $lang->task_threadviews_ran);\n}", "function reload_projectroom_task($project_code = '') {\n $page_data['project_code'] = $project_code;\n $this->load->view('backend/admin/project_task' , $page_data);\n }", "function dgd7_menu_local_tasks_alter(&$data, $router_item, $root_path) {\n\tif($root_path == 'user/%'){\n\t\t//Change the first title from 'View' to 'Profile'\n\t\tif($data['tabs'][0]['output'][0]['#link']['title'] == t('View')){\n\t\t\t$data['tabs'][0]['output'][0]['#link']['title'] = t('Profile');\n\t\t}\n\n\t\t//Chnage the second tab from 'Edit' to 'Edit profile'.\n\t\tif($data['tabs'][0]['output'][1]['#link']['title'] == t('Edit')){\n\t\t\t$data['tabs'][0]['output'][1]['#link']['title'] = t('Edit Profile');\n\t\t}\n\t}\n}", "public function pollTask()\n\t{\n\t\t// Set page title\n\t\t$this->_buildTitle();\n\n\t\t// Set the pathway\n\t\t$this->_buildPathway();\n\n\t\t// Output HTML\n\t\t$this->view\n\t\t\t->set('title', $this->_title)\n\t\t\t->setErrors($this->getErrors())\n\t\t\t->display();\n\t}", "public function applyTask()\n\t{\n\t\t$this->saveTask(false);\n\t}", "function modulePDPTaskLibrary_editTask($selected_task_id) {\n $objResponse = new xajaxResponse();\n if (PamApplication::hasValidSession($objResponse) && PermissionsService::isEditAllowed(PERMISSION_PDP_TASK_LIBRARY)) {\n\n $sql = 'SELECT\n *\n FROM\n pdp_task\n WHERE\n ID_PDPT = ' . $selected_task_id . '\n AND customer_id = ' . CUSTOMER_ID;\n $queryResult = BaseQueries::performQuery($sql);\n $queryResult_row = @mysql_fetch_assoc($queryResult);\n\n $task_id = $queryResult_row['ID_PDPT'];\n $task = trim($queryResult_row['task']);\n $task_description = trim($queryResult_row['task_description']);\n\n $safeFormHandler = SafeFormHandler::create(SAFEFORM_PDPTASKLIBRARY__EDIT_TASK);\n\n $safeFormHandler->addStringInputFormatType('task');\n $safeFormHandler->addStringInputFormatType('task_description');\n $safeFormHandler->storeSafeValue('id_pdpt', $task_id);\n\n $safeFormHandler->finalizeDataDefinition();\n\n $html = '\n <form id=\"pdp_tasklibEditForm\" name=\"pdp_tasklibEditForm\" onsubmit=\"submitSafeForm(\\'' . $safeFormHandler->getFormIdentifier() . '\\', this.name); return false;\">';\n\n $html .= $safeFormHandler->getTokenHiddenInputHtml();\n\n $html .= '\n <p>' . TXT_UCW('EDIT') . ' ' . TXT_UCW('TASK') . ' : ' . $task . '</p>\n <table width=\"600\" cellspacing=\"0\" cellpadding=\"2\" class=\"border1px\">\n <tr>\n <td width=\"10%\" class=\"bottom_line\">' . TXT_UCF('TASK') . ':</td>\n <td width=\"30%\" align=\"left\"><input type=\"text\" size=\"40\" name=\"task\" value=\"' . $task . '\"/></td>\n </tr>\n <tr>\n <td>' . TXT_UCF('DESCRIPTION') . ' :</td>\n <td align=\"left\">\n <textarea name=\"task_description\" cols=\"40\" rows=\"6\">' . $task_description . '</textarea>\n </td>\n </tr>\n </table>\n <br>\n <input type=\"submit\" id=\"submitButton\" value=\"' . TXT_BTN('SAVE') . '\" class=\"btn btn_width_80\">\n <input type=\"button\" value=\"' . TXT_BTN('CANCEL') . '\" class=\"btn btn_width_80\" onclick=\"xajax_modulePDPTaskLibrary_displayTask(' . $task_id . ');return false;\">\n </form>';\n\n $objResponse->assign('mod_pdp_tasklib_right', 'innerHTML', $html);\n }\n return $objResponse;\n}", "public function setTaskName($taskName){ }", "public function editlocalconfigAction()\n {\n $this->init();\n $this->getLayout()->getBlock('head')->setTitle(Mage::helper('includekrexx')->__('Edit local browser settings'));\n $this->renderLayout();\n\n }", "function fusioncore_ajax_get_admin_tasks_html($args=null){\n\tglobal $lstr;\n\t\n\t$output='';\n\n\tif(is_admin()==false)\n\t\treturn $lstr['NotAuthorizedErrorText'];\n\n\telse{\n\t\t$output.='<div class=\"infotable_title\">'.gettext('Administrative Tasks').'</div>';\n\n\t\t$output.='\n\t\t<table class=\"infotable\">\n\t\t<thead>\n\t\t<tr><th>'.gettext('Task').'</th></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t';\n\t\t\n\t\t$base_url=get_base_url();\n\t\t$admin_base=$base_url.\"admin/\";\n\t\t$config_base=$base_url.\"config/\";\n\t\t\n\t\t// check for setup tasks that need to be done\n\t\t$setupoutput=\"\";\n\t\t\n\t\t$opt=get_option(\"system_settings_configured\");\n\t\tif($opt!=1)\n\t\t\t$setupoutput.=\"<li><a href='\".$admin_base.\"?fusionwindow=globalconfig.php' target='_top'>\n\t\t\t\t<b>\".gettext(\"Configure system settings\").\"</b></a><br>\".gettext(\"Configure basic settings for your Fusion system\").\".</li>\";\n\t\t\n\t\t$opt=get_option(\"security_credentials_updated\");\n\t\tif($opt!=1)\n\t\t\t$setupoutput.=\"<li><a href='\".$admin_base.\"?fusionwindow=credentials.php' target='_top'><b>\".gettext(\"Reset security credentials\").\"</b></a>\n\t\t\t\t\t\t\t<br>\".gettext(\"Change the default credentials used by the Fusion system\").\".</li>\";\n\t\t\t\n\t\t$opt=get_option(\"mail_settings_configured\");\n\t\tif($opt!=1)\n\t\t\t$setupoutput.=\"<li><a href='\".$admin_base.\"?fusionwindow=mailsettings.php' target='_top'>\n\t\t\t\t<b>\".gettext(\"Configure mail settings\").\"</b></a><br>\".gettext(\"Configure email settings for your Fusion system\").\".</li>\";\n\t\t\t\n\t\t$servers=get_servers();\n\t\tif(count($servers)==0)\n\t\t\t$setupoutput.=\"<li><a href='\".$config_base.\"?fusionwindow=servers.php' target='_top'><b>\".gettext(\"Define fused servers\").\"</b></a>\n\t\t\t\t\t\t\t<br>\".gettext(\"Configure servers that should be integrated into Fusion\").\".</li>\";\n\t\t\t\n\t\t// get saved credentials\n\t\t$sc=get_option(\"server_credentials\");\n\t\tif($sc==null)\n\t\t\t$sc=array();\n\t\telse\n\t\t\t$sc=unserialize($sc);\n\t\tif(count($sc)==0)\n\t\t\t$setupoutput.=\"<li><a href='\".$config_base.\"?fusionwindow=main.php' target='_top'><b>\".gettext(\"Define server credentials\").\"</b></a>\n\t\t\t\t\t<br>\".gettext(\"Define credentials used to authenticated to fused servers\").\".</li>\";\n\t\t\n\t\t\n\t\tif($setupoutput!=\"\"){\n\t\t\t$output.=\"<tr><td><span class='infotable_subtitle'>\".gettext(\"Initial Setup Tasks\").\":</span></td></tr>\";\n\t\t\t$output.=\"<tr><td>\";\n\t\t\t$output.=\"<ul>\";\n\t\t\t$output.=$setupoutput;\n\t\t\t$output.=\"</ul>\";\n\t\t\t$output.=\"</td></tr>\";\n\t\t}\n\n\t\t// check for important tasks that need to be done\n\t\t$alertoutput=\"\";\n\n\t\t$update_info=array(\n\t\t\t\"last_update_check_succeeded\" => get_option(\"last_update_check_succeeded\"),\n\t\t\t\"update_available\" => get_option(\"update_available\"),\n\t\t\t);\n\t\t$updateurl=get_base_url().\"admin/?fusionwindow=updates.php\";\n\t\tif($update_info[\"last_update_check_succeeded\"]==0){\n\t\t\t$alertoutput.=\"<li><div style='float: left; margin-right: 5px;'><img src='\".theme_image(\"unknown_small.png\").\"'></div>\n\t\t\t\t\t\t\t\".gettext(\"The last\").\" <a href='\".$updateurl.\"' target='_top'>\".gettext(\"update check failed\").\"</a>.</li>\";\n\t\t\t}\n\t\telse if($update_info[\"update_available\"]==1){\n\t\t\t$alertoutput.=\"<li><div style='float: left; margin-right: 5px;'><img src='\".theme_image(\"critical_small.png\").\"'></div>\n\t\t\t\t\t\t\".gettext(\"A new Nagios Fusion\").\" <a href='\".$updateurl.\"' target='_top'>\".gettext(\"update is available\").\"</a>.</li>\";\n\t\t\n\t\t\t}\n\t\t\n\t\t\t\n\n\t\tif($alertoutput!=\"\"){\n\t\t\t$output.=\"<tr><td><span class='infotable_subtitle'>\".gettext(\"Important Tasks\").\":</span></td></tr>\";\n\t\t\t$output.=\"<tr><td>\";\n\t\t\t$output.=\"<ul>\";\n\t\t\t$output.=$alertoutput;\n\t\t\t$output.=\"</ul>\";\n\t\t\t$output.=\"</td></tr>\";\n\t\t}\n\n\t\t$output.=\"<tr><td><span class='infotable_subtitle'>\".gettext(\"Ongoing Tasks\").\":</span></td></tr>\";\n\t\t$output.=\"<tr><td>\";\n\t\t$output.=\"<ul>\";\n\t\t$output.=\"<li><a href='\".$config_base.\"?fusionwindow=servers.php' target='_top'>\".gettext(\"Configure your fused servers\").\"</a><br>\".gettext(\"Add or modify servers to be fused\").\".</li>\";\n\t\t$output.=\"<li><a href='\".$admin_base.\"?fusionwindow=users.php' target='_top'>\".gettext(\"Add new user accounts\").\"</a><br>\".gettext(\"Setup new users with access to Nagios Fusion\").\".</li>\";\n\t\t$output.=\"</ul>\";\n\t\t$output.=\"</td></tr>\";\n\t\t\n\t\t$output.='\n\t\t</tbody>\n\t\t</table>\n\t\t';\n\t\t}\n\t\t\n\t$output.='\n\t<div class=\"ajax_date\">Last Updated: '.get_datetime_string(time()).'</div>\n\t';\n\t\n\treturn $output;\n\t}", "public function setcurrentrevisionTask()\n\t{\n\t\t// Check if they are logged in\n\t\tif (User::isGuest())\n\t\t{\n\t\t\t$url = Request::getString('REQUEST_URI', '', 'server');\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url('index.php?option=com_users&view=login&return=' . base64_encode($url), false)\n\t\t\t);\n\t\t}\n\n\t\t// Incoming\n\t\t$newversion_id = trim(Request::getString('version_id', ''));\n\t\t$newversion = Version::oneOrFail($newversion_id);\n\t\tif ($this->page->get('id') != $newversion->get('page_id'))\n\t\t{\n\t\t\t$this->setError(Lang::txt('COM_WIKI_ERROR_PAGE_NOT_FOUND'));\n\t\t\treturn $this->displayTask();\n\n\t\t}\n\n\t\t$this->page->set('version_id', $newversion_id);\n\n\t\tif (!$this->page->save())\n\t\t{\n\t\t\t$this->setError($this->page->getError());\n\t\t\treturn $this->displayTask();\n\t\t}\n\t\t$this->page->log('page_version_changed');\n\n\t\tEvent::trigger('wiki.onWikiAfterSave', array(&$this->page, false));\n\n\t\t// Log activity\n\t\t$recipients = array(\n\t\t\t['wiki.site', 1],\n\t\t\t['user', $this->page->get('created_by')],\n\t\t\t['user', $this->page->version->get('created_by')],\n\t\t\t['user', $newversion->get('created_by')]\n\t\t);\n\t\tif ($this->page->get('scope') != 'site')\n\t\t{\n\t\t\t$recipients[] = [$this->page->get('scope'), $this->page->get('scope_id')];\n\t\t\t$recipients[0] = ['wiki.' . $this->page->get('scope'), $this->page->get('scope_id')];\n\t\t}\n\n\t\tEvent::trigger('system.logActivity', [\n\t\t\t'activity' => [\n\t\t\t\t'action' => ($this->page['id'] ? 'updated' : 'created'),\n\t\t\t\t'scope' => 'wiki.page',\n\t\t\t\t'scope_id' => $this->page->get('id'),\n\t\t\t\t'description' => Lang::txt('COM_WIKI_ACTIVITY_PAGE_UPDATED', '<a href=\"' . Route::url($this->page->link()) . '\">' . $this->page->title . '</a>'),\n\t\t\t\t'details' => array(\n\t\t\t\t\t'title' => $this->page->title,\n\t\t\t\t\t'url' => Route::url($this->page->link()),\n\t\t\t\t\t'name' => $this->page->get('pagename'),\n\t\t\t\t\t'oldrevision' => $this->page->version->get('id'),\n\t\t\t\t\t'newrevision' => $this->page->get('version_id')\n\t\t\t\t)\n\t\t\t],\n\t\t\t'recipients' => $recipients\n\t\t]);\n\t\tApp::redirect($this->page->link('history'));\n\t}", "function run_task()\n\t{\n\t\t//-----------------------------------------\n\t\t// Enabled?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( ! $this->ipsclass->vars['update_topic_views_immediately'] )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Load DB file\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$this->ipsclass->DB->load_cache_file( $this->root_path.'sources/sql/'.SQL_DRIVER.'_extra_queries.php', 'sql_extra_queries' );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Get SQL query\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$this->ipsclass->DB->cache_add_query( 'updateviews_get', array(), 'sql_extra_queries' );\n\t\t\t$o = $this->ipsclass->DB->cache_exec_query();\n\t\t\t\n\t\t\twhile( $r = $this->ipsclass->DB->fetch_row( $o ) )\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Update...\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$this->ipsclass->DB->simple_construct( array( 'update' => 'topics',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'set' => 'views=views+'.intval( $r['topicviews'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"tid=\".intval($r['views_tid'])\n\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$this->ipsclass->DB->simple_exec(); \n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Delete from table\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$this->ipsclass->DB->build_and_exec_query( array( 'delete' => 'topic_views' ) );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Log to log table - modify but dont delete\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$this->class->append_task_log( $this->task, 'Обновлены счетчики просмотров тем' );\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Unlock Task: DO NOT MODIFY!\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->class->unlock_task( $this->task );\n\t}", "function showAdmin_saveAdminTask() {\n if (!Session::has('adminid')) {\n return Redirect::to('/admin/login');\n }\n\n $taskId = 0;\n\n $input = Input::all();\n if (!empty($input)) {\n $taskName = $input['task_name'];\n $slug = $this->createUniqueSlug($taskName, 'admintasks');\n $boardId = $input['board_id'];\n } else {\n return Redirect::to('/');\n }\n\n\n $saveList = array(\n 'task_name' => $taskName,\n 'board_id' => $boardId,\n 'status' => '1',\n 'slug' => $slug,\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n );\n\n $adminTasks = DB::table('admintasks')\n ->insertGetId(\n $saveList\n );\n\n return View::make('AdminBoards.ajax_add_task')->with('adminTasks', $adminTasks)->render();\n exit;\n }" ]
[ "0.6040176", "0.58971727", "0.5773575", "0.57001066", "0.56967795", "0.5671654", "0.5599412", "0.55961436", "0.554553", "0.55393416", "0.5539337", "0.549915", "0.5487729", "0.548643", "0.5470217", "0.5456661", "0.54530966", "0.5438853", "0.54371285", "0.5436991", "0.53983444", "0.53684044", "0.53550136", "0.5352382", "0.5340679", "0.53362215", "0.5327587", "0.5323974", "0.527459", "0.52675927" ]
0.73536086
0
/ Constructor It is recommended that sublasses calls parent::__construct($attributes) after setting default attributes
function __construct($attributes = array()){ $defaults = array(); parent::__construct(array_merge($defaults, $attributes)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct($attributes = array())\n {\n parent::__construct($attributes);\n }", "public function __construct($attributes = array())\n {\n parent::__construct($attributes);\n }", "public function __construct($attributes = null) {\n parent::__construct($attributes);\n }", "public function __construct(array $attributes = array()) {\n parent::__construct($attributes);\n }", "public function __construct(array $attributes = array()) {\n parent::__construct($attributes);\n }", "public function __construct(array $attributes = array())\n {\n parent::__construct($attributes);\n }", "public function __construct(array $attributes = array())\n {\n parent::__construct($attributes);\n }", "public function __construct(array $attributes = array()) {\n parent::__construct(array(), $attributes);\n }", "public function __construct(array $attributes = []){\r\n\r\n parent::__construct($attributes);\r\n }", "public function __construct(array $attributes = [])\n {\n parent::__construct($attributes);\n }", "public function __construct(array $attributes = [])\n {\n parent::__construct($attributes);\n }", "public function __construct(array $attributes = [])\n {\n parent::__construct($attributes);\n }", "public function __construct(array $attributes)\n {\n parent::__construct($attributes);\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct($attributes = []){\n\t\tparent::__construct($attributes);\n\t\t$this->fields = $this->fields ?: [];\n\t}", "public function __construct($attributes)\n {\n $this->setAttributes($attributes);\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }" ]
[ "0.8698702", "0.8698702", "0.8578872", "0.8475263", "0.8475263", "0.84557277", "0.84557277", "0.8326853", "0.8322881", "0.81879973", "0.81879973", "0.81879973", "0.8183505", "0.80104756", "0.80104756", "0.80104756", "0.80104756", "0.80104756", "0.80104756", "0.80104756", "0.80104756", "0.80104756", "0.80104756", "0.80104756", "0.7967387", "0.79666436", "0.79207504", "0.79207504", "0.79207504", "0.79207504" ]
0.87625366
0
Returns the name of the artifact.
public function getArtifact(): string { return $this->artifact; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getName()\r\n {\r\n return basename($this->getFile(), '.project.gmx');\r\n }", "public function name(): string\n {\n return $this->vendor . '/' . $this->package;\n }", "public function name()\n {\n return $this->vendor() . '/' . $this->package();\n }", "public function getName()\n {\n return $this->package->getName();\n }", "public function getPackageDownloadName();", "public function getArtifactUri()\n {\n return $this->artifact_uri;\n }", "public function getName()\n {\n $data = $this->getComposerData();\n return $data['name'];\n }", "public function getName()\n\t{\n\t\t// Ensure the name is a string\n\t\t$name = (string) $this->getManifest()->name;\n\n\t\t// Filter the name for illegal characters\n\t\t$name = \\JFilterInput::getInstance()->clean($name, 'string');\n\n\t\treturn $name;\n\t}", "public function getName() : string\n {\n return $this->file->getName();\n }", "public function getName(): string\n {\n return $this->getRelativePath();\n }", "public function getName() : string {\n return $this->fileName;\n }", "public function getArchiveName()\n\t{\n\t\t$result = $this->setting->get(Setting::SETTING_EXPORT_ARCHIVE_NAME);\n\n\t\treturn is_string($result) ? $result : '';\n\t}", "public function getName() {\n\t\treturn $this->file;\n\t}", "public function getName() {\n return basename($this->uri);\n }", "protected function getFilename(): string\n {\n return $this->manager->getAttribute('filename');\n }", "public function getImageName()\n {\n return $this\n ->get('imagename')\n ->get('name');\n }", "public function name(): string\n {\n if (! $this->isValid()) {\n throw new InvalidArgumentException('Unable to find package name from invalid VCS URL');\n }\n\n return \\implode('/', $this->url->getSegments());\n }", "public function get_name(): string {\n\t\treturn $this->project->name;\n\t}", "function getName(){\n return basename($this->getUrl());\n }", "private function getExportFilename() {\n // Get a filename safe verison of the site name.\n $site_name = preg_replace('/[^a-z0-9]+/', '-', strtolower(\\Drupal::config('system.site')->get('name')));\n return $site_name . '.package.yml';\n }", "public function getName() {\n\t\t$name = count($this->album) ? end($this->album) : $this->lonely->title;\n\t\t$name = str_replace('_', ' ', $name);\n\t\treturn $name;\n\t}", "public function getName()\n {\n return $this->getNamespace('addon.name');\n }", "protected function _getAssetName()\n {\n //$k = $this->_tbl_key;\n //return 'com_helloworld.message.'.(int) $this->$k;\n global $logger;\n $logger->severe(\"_getAssetName()\");\n return \"com_ask\";\n }", "public function get_name() {\n\t\treturn __('Image', CCTM_TXTDOMAIN);\n\t}", "public function get_package_title() {\n $package = $this->get_product();\n\n return $package ? $package->get_title() : '';\n }", "public function filename()\n\t{\n\t\treturn $this->path . $this->name;\n\t}", "public function name()\n\t{\n\t\treturn pathinfo($this->file, PATHINFO_FILENAME);\n\t}", "public function getName(): string\n {\n return strlen($this->name) ? $this->name : str_replace(' ', '_', $this->getFilename());\n }", "public function getName()\n\t{\n\t\t// Return commands without namespace if standalone\n\t\tif (!$this->isInsideLaravel()) {\n\t\t\treturn str_replace('deploy:', null, $this->name);\n\t\t}\n\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn self::FILE_NAME_PREFIX . date('md') . '01.TXT';\n\t}" ]
[ "0.6941804", "0.69248444", "0.6846185", "0.68381673", "0.6791309", "0.66851443", "0.6644584", "0.6488318", "0.6462127", "0.6430152", "0.64081967", "0.63884425", "0.6353879", "0.6346402", "0.6334869", "0.6313495", "0.6281382", "0.6260773", "0.6255172", "0.62225133", "0.6173188", "0.61614764", "0.61439484", "0.61431545", "0.61396784", "0.6132691", "0.6114176", "0.6096107", "0.60957587", "0.60915375" ]
0.798014
0
Sets the transformer on this transformation.
public function setTransformer(Transformer $transformer): void { $this->transformer = $transformer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setTransformer(Transformer $transformer)\n {\n $this->transformer = $transformer;\n return $this;\n }", "public function setDefaultTransformer(TransformerContract $transformer)\n {\n $this->transformer = $transformer;\n }", "public static function transformer()\n {\n }", "protected function transformer()\n {\n //$settings = $this->getSettings();\n return $this->settings['transformer'];\n \n // return new EventTransformer;\n }", "public function getTransformer()\n {\n return Transformer::class;\n }", "public function getTransformer() {\n if (!isset(self::$transformer)) {\n $vm = $this->getViewMode();\n if ($vm == self::TRANSFORM_DEBUG_XML ||\n $vm == self::TRANSFORM_STRUCTURE_XML\n ) {\n self::$transformer = new XMLTransformer();\n } elseif ($vm == self::TRANSFORM_JSON) {\n self::$transformer = new JSONTransformer();\n } else {\n self::$transformer = new XSLTTransformer();\n }\n }\n\n return self::$transformer;\n }", "protected function createTransformer()\n {\n if ($this->option('transformer')) {\n $model = ucwords($this->getNameInput());\n\n $this->call('starter:transformer', ['name' => $model . 'Transformer']);\n }\n }", "public function getTransformer(): Transformer|null\n {\n return $this->transformer;\n }", "abstract protected function getTransformer();", "public function requireTransformer($value = true): self\n {\n app(Transformer::class)->requireTransformer($value);\n\n return $this;\n }", "public function getDefaultTransformer()\n {\n if (is_null($this->transformer)) {\n return new Transformer();\n } else {\n return $this->transformer;\n }\n }", "public function unsetTransformerProperty()\n {\n unset($this->transformer);\n }", "public function getTransformer()\n {\n return new WorkflowItemTransformer();\n }", "abstract protected function transformer();", "protected function registerTransformer()\n {\n $this->app->singleton('api.transformer', function ($app) {\n $transformer = $this->app->make('j4k\\Api\\Transformer\\FractalTransformer');\n return new TransformerFactory($app, $transformer);\n });\n }", "protected function getTransformer()\n {\n if (is_callable($this->transformer) || $this->transformer instanceof TransformerAbstract) {\n return $this->transformer;\n }\n\n return Craft::createObject($this->transformer);\n }", "protected function getTaskTransformer()\n {\n return app(TaskTransformer::class);\n }", "protected function transformer()\n {\n return new CharacterTransformer;\n }", "public function setFileName($transformerFilename, $isAbsolutePath = false);", "public function getTransformer()\n {\n return new ResumeItemTransformer();\n }", "public function transformer()\n {\n return ArtistTransformer::class;\n }", "public function transformer()\n {\n return DeviceTransformer::class;\n }", "public function setValue($value, bool $transform = false)\n {\n if (null === $value)\n $this->value = null;\n elseif ($transform && $this->transformer !== null)\n $this->value = $this->transformer->deserialize($value);\n else\n $this->value = $value;\n\n return $this;\n }", "public function getRouteTransformer(): RouteTransformer\n {\n return $this->routeTransformer;\n }", "public function setModelTransformer(TransformerAbstract $modelTransformer)\n {\n $this->modelTransformer = $modelTransformer;\n return $this;\n }", "public static function transformer()\n {\n return LectureTransformer::class;\n }", "public function setTranslator(Translator $t)\n {\n $this->translator = $t;\n }", "public function getTransformer()\n {\n return new LogsTransformer();\n }", "public function setTask( $task ){\n\t\t\n\t\t$this->task = $task;\n\t}", "function setXSLT($sXSLT_=null){\n\t\t\t$this->_sXSLT=$sXSLT_;\n\t\t}" ]
[ "0.70906264", "0.6495122", "0.6208409", "0.60923445", "0.60072416", "0.5919417", "0.58955896", "0.57839537", "0.5764424", "0.5610389", "0.55718434", "0.5546453", "0.54959136", "0.5395274", "0.53894764", "0.5377172", "0.53063464", "0.5299671", "0.5225984", "0.5169169", "0.51568544", "0.5129102", "0.51144326", "0.49962962", "0.49737525", "0.49658355", "0.49641165", "0.49383265", "0.4914173", "0.4856063" ]
0.74626696
0
Replace current domain to example.com
protected function _replaceDomain($str) { $url = Mage::getBaseUrl(); $url = str_replace('/index.php', '', $url); $str = str_replace('/index.php', '', $str); return str_replace($url, 'http://example.com/', $str); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public function _replace_domain($domain) {\n\t\t\t$domain = preg_replace('/\\*(?!\\?)/', CORE_HOSTNAME_WORD, $domain);\n\t\t\t$domain = str_replace(array('.*?', '*?.', '.'),\n\t\t\t\tarray('(.'.CORE_HOSTNAME_WORD.')?', '('.CORE_HOSTNAME_WORD.'.)?', '\\\\.'), $domain);\n\t\t\t$domain = preg_replace('/('.CORE_HOSTNAME_WORD.'\\?(\\\\\\.)|(\\\\\\.)'.CORE_HOSTNAME_WORD.'\\?)/', '($2$3$4$5)?', $domain);\n\t\t\treturn \"/^{$domain}$/\";\n\t\t}", "public function resetDomain(): string\n {\n return textdomain($this->getDefaultDomain());\n }", "public static function normalizeDomain()\n\t{\n\t\t$home = get_home_url();\n\n\t\t$protocol = (isset($_SERVER['HTTPS']) && $_SERVER[\"HTTPS\"] == \"on\") ? \"https://\" : \"http://\";\n\t\t$referUrl = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER[\"REQUEST_URI\"];\n\n\t\tif (substr($referUrl, 0, (strlen($home)) ) !== $home) {\n\t\t header('Location: ' . $home . '/' . $_SERVER['REQUEST_URI']);\n\t\t exit;\n\t\t}\n\t}", "public function replace_host( $old, $new, $subject ) {\r\n\t\t$subject = str_replace( 'www.' . $old, $new, $subject );\r\n\t\t$subject = str_replace( $old, $new, $subject );\r\n\r\n\t\treturn $subject;\r\n\t}", "private function domain_replace( string $target ) : string {\n\t\tif ( ! defined( 'IDG_REDIRECT_DOMAIN_REPLACEMENTS' ) ) {\n\t\t\treturn $target;\n\t\t}\n\n\t\t$replacements = IDG_REDIRECT_DOMAIN_REPLACEMENTS;\n\t\t$keys = array_keys( $replacements );\n\t\t$values = array_values( $replacements );\n\n\t\t$target = \\str_replace( $keys, $values, $target );\n\n\t\treturn $target;\n\t}", "public static function currentDomain()\n {\n return (isset($_SERVER['HTTPS']) ? \"https\" : \"http\") . \"://\".$_SERVER[\"HTTP_HOST\"];\n }", "protected function set_cookie_domain() {\n\t\tif ( defined( 'COOKIE_DOMAIN' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$cookie_domain = $this->get_domain();\n\n\t\t// Remove `www.` from cookie domain.\n\t\tif ( substr( $cookie_domain, 0, 4 ) === 'www.' ) {\n\t\t\t$cookie_domain = substr( $cookie_domain, 4 );\n\t\t}\n\n\t\t/**\n\t\t * Modify cookie domain before definition.\n\t\t *\n\t\t * @param string $cookie_domain\n\t\t *\n\t\t * @return string\n\t\t */\n\t\t$cookie_domain = apply_filters( 'hercules_cookie_domain', $cookie_domain );\n\n\t\tif ( is_string( $cookie_domain ) ) {\n\t\t\tdefine( 'COOKIE_DOMAIN', $cookie_domain );\n\t\t}\n\t}", "function sa_blog_domain(){\n\tglobal $current_blog;\n\tif(isset($current_blog)){\n\t\treturn $current_blog->domain;\n\t}\n\treturn str_replace('http://', '', get_option('siteurl'));\n}", "function wp_irving_jwt_token_cookie_domain( $domain ) {\n\treturn strstr( home_url(), 'alley.test' ) ? '.alley.test' : '.irvingjs.com';\n}", "function setDomain($value) {\n $this->domain = trim($value);\n }", "function gmt_courses_get_site_domain() {\n\t\t$sitename = strtolower( $_SERVER['SERVER_NAME'] );\n\t\tif ( substr( $sitename, 0, 4 ) == 'www.' ) {\n\t\t\t$sitename = substr( $sitename, 4 );\n\t\t}\n\t\treturn $sitename;\n\t}", "public function setDomain($domain);", "function ReplaceLocalHost($url)\n {\n global $localhost;\n return str_replace($localhost, \"localhost\", $url);\n }", "public function setDomain($value)\n {\n $this->domain = $value;\n }", "function domain($url)\n {\n return str_ireplace('www.', '', parse_url($url, PHP_URL_HOST));\n }", "function _switcher_is_domain($domain) {\n $host = $_SERVER['HTTP_HOST'];\n return (substr($host, -strlen($domain)) == $domain);\n}", "public function setDomain(?string $domain): string\n {\n return textdomain($domain);\n }", "public function modifyApiDomain( $value ) {\n\n $this->oauth_tokens[ NF_ZohoCRM()->constants->api_domain ] = $value;\n }", "protected function setCurrentDomain($currentDomain)\n {\n $this->currentDomain = (is_string($currentDomain) ? $currentDomain : json_encode($currentDomain));\n }", "function replace_domain($pic_url)\n{\n $search_arr[0]=\"image16-c.poco.cn\";\n $replace_arr[0]=\"image19-d.yueus.com\";\n\n $search_arr[1]=\"image16-d.poco.cn\";\n $replace_arr[1]=\"image19-d.yueus.com\";\n\n $search_arr[2]=\"image17-c.poco.cn\";\n $replace_arr[2]=\"image19-d.yueus.com\";\n\n $search_arr[3]=\"img16.poco.cn\";\n $replace_arr[3]=\"image19-d.yueus.com\";\n\n $search_arr[4]=\"yue-icon.yueus.com\";\n $replace_arr[4]=\"yue-icon-d.yueus.com\";\n\n $search_arr[5]=\"seller-icon.yueus.com\";\n $replace_arr[5]=\"seller-icon-d.yueus.com\";\n\n return str_replace($search_arr,$replace_arr,$pic_url);\n}", "function setDomain($domain)\n {\n $this->domain = $domain;\n }", "public function rewrite_cdn_url( $original ) {\n\n $trailing_string = '/wp-content/uploads/';\n $cms_url = get_option( 'siteurl' );\n $cdn_url = get_option('cdn_url');\n\n\n if ( ! empty( $cdn_url ) ) {\n\n return str_replace( $cms_url . $trailing_string, $cdn_url . '/', $original );\n\n } else {\n\n return $original;\n\n }\n\n }", "public function setDefaultDomain(string $domain): void\n {\n $this->defaultDomain = $domain;\n }", "function local_domains( $domains ) {\n\t\t// Example allows local URLs to be matched when site accessed as any of the 3 examples.\n\t\t$domains[] = 'example.com';\n\t\t$domains[] = 'example-pro.com';\n\t\t$domains[] = 'example-deluxe.com';\n\n\t\t// Example makes sure that the current multisite's canonical domain is included\n\t\t// in match check even if domain mapping etc. has changed the URL of site.\n\t\tif ( is_multisite() ) {\n\t\t\t$blog_details = get_blog_details();\n\n\t\t\tif ( false !== $blog_details && ! in_array( $blog_details->domain, $domains ) ) {\n\t\t\t\t$domains[] = $blog_details->domain;\n\t\t\t}\n\t\t}\n\n\t\treturn $domains;\n\t}", "public function setTestDomain($domain)\n {\n if (!preg_match('/^https*:\\/\\//i', $domain)) {\n $domain = 'https://' . $domain;\n }\n\n $this->testDomain = $domain;\n }", "function wasabi_domain( $domain ) {\n\t\treturn 'wasabisys.com';\n\t}", "public function setupDomain(string $domain): void;", "public function setDomain(string $domain): void\n {\n $this->domain = $domain;\n }", "function vpopmail_add_alias_domain($domain, $aliasdomain)\n{\n}", "function siteURL($trailing_slash = true) { // uses current URL \n $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443 || $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') ? \"https://\" : \"http://\";\n $domainName = $_SERVER['HTTP_HOST'].($trailing_slash ? '/' : '');\n return $protocol.$domainName;\n}" ]
[ "0.65537035", "0.64052683", "0.6366985", "0.635005", "0.62737995", "0.6248022", "0.6216461", "0.6140916", "0.60923064", "0.60754955", "0.59805423", "0.59404296", "0.5906517", "0.58928686", "0.57754505", "0.57723755", "0.57538986", "0.57253754", "0.5720254", "0.5684391", "0.5644616", "0.5633856", "0.560473", "0.5592221", "0.55800635", "0.5576168", "0.55741", "0.55726814", "0.55697405", "0.5559987" ]
0.67702305
0
Validates entity title value, throws an Exception if not valid
public function validateTitle() : bool { if( $this->title === 'mr' || $this->title === 'mrs' || $this->title === 'miss' || $this->title === 'master' || $this->title === 'mx'){ return true; } else { throw new \Exception('title is not valid'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateTitle($title) {\r\n if($title != null)\r\n {\r\n return \"Project title is required\";\r\n }\r\n }", "public function validateTitle(&$var)\n {\n if (!is_string($var) || strlen($var) === 0) {\n throw new Exception('no_title');\n }\n }", "function validate_title($title){\r\n\t\t$validation = False;\r\n\r\n\t\t$length = strlen($title);\r\n\t\tif($length < 4 || $length > 35){\r\n\t\t\t$error = \"Error: Title length must be between 4 and 35 characters.<br>\";\r\n\t\t} \r\n\t\telse \r\n\t\t\t$validation = True;\r\n\t\treturn $validation;\r\n\t}", "public function validTitle($title)\r\n {\r\n if (empty(trim($title))) {\r\n $this->_errors['title'] = \"Contractor title is required.\";\r\n }\r\n }", "public function testSettingInvalidTitle()\n {\n $this->expectException(\\InvalidArgumentException::class);\n $attachmentFieldObject = new AttachmentField();\n $attachmentFieldObject->setTitle(null);\n }", "private function _checkArtTitle(&$artTitle)\n {\n if (!is_string($artTitle)) {\n $artTitle = strval($artTitle);\n }\n if (!isset($artTitle) || strlen($artTitle) == 0) {\n throw new Klarna_ArgumentNotSetException(\"artTitle\", 50059);\n }\n }", "public function testValidationTitleNotNull()\n {\n $headers = $this->authorize();\n\n $post = [\n \"title\" => null,\n \"content\" => $this->faker->sentence,\n \"images\" => base64_encode(file_get_contents($this->faker->imageUrl(640, 480, 'animals', true))),\n 'tags' => 'lagos, benin'\n ];\n\n $this->client->request('POST', 'post',\n [],\n [],\n $headers,\n json_encode($post)\n );\n\n $response = json_decode($this->client->getResponse()->getContent(), true);\n\n $this->assertResponseStatusCodeSame(422);\n\n $this->assertContains('This value should not be null.', $response['errors']['title']);\n\n }", "function validTitle($title) { \n/*\tIf title is not alpha and not equal to Mr or Mrs or Miss or Ms, return false.\n User input for title field is required as arguement.\n\tReturn true. */\n \n\tif (!ctype_alpha($title)) {\n\t\t\tif ($title != \"Mr\" || $title != \"Master\" || $title != \"Lord\" || $title != \"Ms\" || $title != \"Miss\" || $title != \"Mrs\" || $title != \"Lady\") {\n\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "protected function getTitle()\n {\n return (string) $this->validate()->entry->title;\n }", "private function titleError($title) {\n\t\t\t$modelBlog = new Model_Blog(); //tworzymy model\n\t\t\t$count = $modelBlog->checkTitle($title); //pobieramy wszystkie dane do widoku\t\t\t\n\t\t\tif ($count['count(*)'] == \"0\" ) { return false; } else {return true; }\n\t\t}", "public static\tfunction validarTitulo($title)\n\t{\n\t $cadena = htmlentities($title,ENT_QUOTES,\"UTF-8\");\n\t if($title == $cadena)\n\t \treturn TRUE;\n\t else\n\t \treturn FALSE;\n\t}", "public function testReturnTitleIsCorrect()\n {\n $this->assertEquals('Một con đường khác cho vắc-xin Covid-19', $this->pageParser->getTitle());\n }", "public function testSettingInvalidTitle()\n {\n $this->expectException(\\InvalidArgumentException::class);\n $attachmentObject = new Attachment();\n $attachmentObject->setTitle(null);\n }", "public function testValidationTitleNotBlank()\n {\n $headers = $this->authorize();\n\n $post = [\n \"title\" => '',\n \"content\" => $this->faker->sentence,\n \"images\" => base64_encode(file_get_contents($this->faker->imageUrl(640, 480, 'animals', true))),\n 'tags' => 'lagos, benin'\n ];\n\n $this->client->request('POST', 'post',\n [],\n [],\n $headers,\n json_encode($post)\n );\n\n $response = json_decode($this->client->getResponse()->getContent(), true);\n\n $this->assertResponseStatusCodeSame(422);\n\n $this->assertContains('This value should not be blank.', $response['errors']['title']);\n\n }", "function validateTitle($title)\n\t{\n\t\t$len = strlen($title);\n\t\tif ($len < 5 || $len > 50)\n\t\t{\n\t\t\t$_SESSION['addSessionError'] .= 'Title must be 5-50 characters<br/>';\n\t\t\t$valid = false;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "function check_module_title()\n {\n $this->form_validation->set_rules('moduleTitle', 'Module Code', 'trim|required|xss_clean|min_length[5]|max_length[55]');\n\n if ($this->form_validation->run() == FALSE)\n {\n print('Module title must be between 5 and 55 characters.');\n }\n }", "function checkTitle() {\n\t\t## get access tot eh errorField array\n\t\tglobal $errorField, $_POST;\n\t\t\n\t\t## get input name\n\t\t$name = func_get_arg(0);\n\t\t$othername = func_get_arg(1);\n\t\t\n\t\tif(isset($_POST[$name]) && preg_match(\"/[^default]/\",$_POST[$name]) ) {\n\t\t\tif($_POST[$name] === \"Other\") {\n\t\t\t\t## check the othername var if set.\n\t\t\t\tif (isset($_POST[$othername]) && preg_match(\"/\\w+/\",$_POST[$othername]) ) {\n\t\t\t\t\t## good data, do nothing.\n\t\t\t\t} else {\n\t\t\t\t\t## data is bad/not set flag error.\n\t\t\t\t\t$tmpErrorField = array ($othername => $othername);\n\t\t\t\t\t$errorField = array_merge ($errorField,$tmpErrorField);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function TourneyEditView_field_handler_tourney_edit_validate($element, &$form_state) {\n // Only allow titles where the first character is capitalized.\n if (!ctype_upper(substr($element['#value'], 0, 1))) {\n //form_error($element, t('All titles must be capitalized.'));\n }\n}", "private function validate() {\n if (empty($this->slug)) {\n $this->slug = parent::createSlug();\n }\n \n if (empty($this->name)) {\n throw new Exception(\"Organisation name cannot be empty\"); \n }\n \n if (empty($this->desc)) {\n throw new Exception(\"Organisation description cannot be empty\"); \n }\n \n if (empty($this->created)) {\n $this->created = time(); \n }\n \n $nulls = [ \"contact_website\", \"contact_phone\", \"contact_fax\", \"contact_email\", \"logo\", \"flickr_photo_id\" ];\n \n foreach ($nulls as $var) {\n if (is_null($this->$var)) {\n $this->$var = \"\";\n }\n }\n \n return true;\n }", "public function validate() {\n\t\t\n\t\t$data = $this->getData();\n\t\t\n\t\tif(!isset($data['title']) || empty($data['title'])) {\n\t\t\tGregory::get()->addError('Vous devez entrer un titre');\n\t\t}\n\t\t\n\t\tif(!isset($data['date']) || empty($data['date'])) {\n\t\t\tGregory::get()->addError('Vous devez entrer une date');\n\t\t}\n\t\t\n\t\tif(isset($data['date']) && !preg_match('/^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$/',$data['date'])) {\n\t\t\tGregory::get()->addError('Vous devez entrer une date au format AAAA-MM-JJ');\n\t\t}\n\t\t\n\t\tif(Gregory::get()->hasErrors()) throw new Exception('Votre formulaire contient des erreurs');\n\t\t\n\t}", "public function testTitle()\n\t{\n\t\t$this->visit('/')->seeInElement('title', '^\\s*$', true);\n\n\t\t$title = trim($this->crawler->filter('title')->text());\n\t\t$actualLength = strlen($title);\n\t\t$maximumLength = 55;\n\n\t\t$this->assertTrue($actualLength <= $maximumLength, 'Page title should be lower than '. $maximumLength .' characters');\n\t}", "public function isTitleValid($title): bool\n {\n return $this->valText($title, 64);\n }", "public function setArticleTitle( $newArticleTitle) : void {\n//verify the article title is secure\n\t$newArticleTitle = trim($newArticleTitle);\n\t$newArticleTitle = filter_var($newArticleTitle, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES);\n\tif(empty($newArticleTitle) === true) {\n\t\tthrow(new \\InvalidArgumentException(\"this title is invalid\"));\n\t}\n//verify the article title will fit in the database\n\tif(strlen($newArticleTitle) >= 50) {\n\t\tthrow(new \\RangeException(\"Nah. Make this shorter.\"));\n\t}\n\t//convert and store the new title\n\t$this->articleTitle = $newArticleTitle;\n}", "public function testValidationTitleLengthMinimumOfThree()\n {\n $headers = $this->authorize();\n\n $post = [\n \"title\" => 'ab',\n \"content\" => $this->faker->sentence,\n \"images\" => base64_encode(file_get_contents($this->faker->imageUrl(640, 480, 'animals', true))),\n 'tags' => 'lagos, benin'\n ];\n\n $this->client->request('POST', 'post',\n [],\n [],\n $headers,\n json_encode($post)\n );\n\n $response = json_decode($this->client->getResponse()->getContent(), true);\n\n $this->assertResponseStatusCodeSame(422);\n\n $this->assertContains('This value is too short. It should have 3 characters or more.', $response['errors']['title']);\n\n }", "public static function validateTitle()\n\t{\n\t\treturn [\n\t\t\tnew LengthValidator(null, 255),\n\t\t];\n\t}", "function validate_title($object = null, $value)\n\t{\n\t\tif (isset($value) == false || empty($value) ) {\n\t\t\treturn Localized::ModelValidation(\n\t\t\t\t$this->tableName(),\n\t\t\t\tReading_Queue::title,\n\t\t\t\t\"FIELD_EMPTY\"\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}", "public function title($title = null)\n {\n return $this->validateAlphaNumeric($this->struct['Title'], func_get_args(), 10);\n }", "protected function checkForSearchEngineFriendlyTitle(DataModel $model)\n\t{\n // only check title field length on models that will be\n // shown in search results or shared on social networks\n if ( !in_array( $model->getName(), $this->sefFriendlyModels ) )\n {\n return;\n }\n\n $fieldName = $model->getFieldAlias('title');\n\n $fieldValue = $model->getFieldValue($fieldName);\n\n // Strip HTML from the title field\n $sanitizedValue = $model->getContainer()->input->getCmd($fieldValue, '');\n\n $length = strlen($sanitizedValue);\n\n if ( $length > 60 )\n {\n throw new SearchEngineUnfriendlyTitleField( Text::sprintf('COM_CAJOBBOARD_EXCEPTION_MODEL_FIELD_TITLE_IS_SEARCH_ENGINE_UNFRIENDLY', $length) );\n }\n\n $model->setFieldValue($fieldName, $sanitizedValue);\n }", "public function titleTest($title){\n $title = htmlspecialchars(strip_tags($title));\n $reqTitleTest = $this->findFirst(array(\"conditions\"=>\"`title` = '$title'\"));\n if (!$reqTitleTest) {\n return false;\n }else{\n return true;\n }\n }", "public function titleValidatesProvider()\n {\n $faker = \\Faker\\Factory::create();\n\n return array(\n array(substr($faker->text(90), 0, 90), true),\n array(null, false),\n array(\"This is a string that could be more than 100 characters long but will we really know for sure until I check it out?\", false),\n array(\"A little bit of this & that\", true)\n );\n }" ]
[ "0.70656157", "0.7045493", "0.6616273", "0.6569437", "0.64888924", "0.64387065", "0.63978463", "0.63917744", "0.6305146", "0.6270208", "0.62626946", "0.6218797", "0.62159634", "0.6193709", "0.61861324", "0.61768323", "0.60999066", "0.60945135", "0.6051893", "0.60405576", "0.6033433", "0.598639", "0.596161", "0.59296024", "0.5905119", "0.5900806", "0.58630013", "0.58580333", "0.5822038", "0.5820139" ]
0.7487116
0
Create a copy of this service linked to a MongoDB collection.
private function forCollection($collection): self { $copy = $this; if (!$collection instanceof Collection) { if (!isset($this->database)) { throw new \LogicException("Not connected to a MongoDB Database object"); } $collection = $this->database->selectCollection($collection); } elseif (!$this->usesSameDatabase($collection)) { $copy = $copy->withoutProperty('database'); } return $copy->withProperty('collection', $collection); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCollection(): Collection\n {\n if (!isset($this->collection)) {\n throw new \\LogicException(\n \"Create a copy that's linked to a MongoDB Collection by calling the `for()` method\"\n );\n }\n\n return $this->collection;\n }", "private function collection($name) {\n return new MongoCollection($this->dbmanager, $this->dbname, $name);\n }", "public function create($data){\r\n\t\treturn MongoDatabase::addDataTo($this::CollectionName, $data);\r\n\t}", "public function getCollection()\n\t{\n\t\tif (!isset($this->_collection))\n {\n $this->_collection = Yii::app()->edmsMongoCollection($this->_collectionName,$this->_dbName,$this->_connectionId);\n $this->callObjectMethods($this->_collection,$this->_callAfterCollectionCreate,self::CALLAFTER_COLLECTIONCREATE);\n }\n\n\t\treturn $this->_collection;\n\t}", "public function createService(ServiceLocatorInterface $serviceLocator)\n {\n $config = $serviceLocator->get('Config');\n\n return new ClicksMongoDB($config['mongodb']['db']);\n }", "function __construct($mongo_url = NULL) {\n\t\t\n\t\t//$connection = new Mongo('mongodb://<username>:<password>@xyz.mongolab.com:12345/dbname');\n\n\t\tif(empty($mongo_url)) {\n\t\t\t$this->connection = new Mongo($this->mongo_url);\n\t\t} else {\n\t\t\t$this->connection = new Mongo($mongo_url);\n\t\t}\n\t\t\n\t\t$this->selectDB(MONGO_DB_NAME);\n\t\t$this->selectCollection('collection_name');\n\t}", "public function makeDocumentSet()\n\t{\n\t\t$config = array();\n\t\t$config['hasId'] = false;\n\t\t$config['collection'] = $this->getCollection();\n\t\t$config['requirementModifiers'] = array(\n\t\t\tShanty_Mongo_DocumentSet::DYNAMIC_INDEX => array(\"Document:\".$this->getDocumentClass())\n\t\t);\n\t\t\n\t\t$documentSetClass = $this->getDocumentSetClass();\n\t\treturn new $documentSetClass($this->export(), $config);\n\t}", "public function copy(Collection $c);", "public function __construct($collection) { }", "public function selectCollection($name)\n {\n return new MongoCollection($this, $name);\n }", "function copy(): Collection\n {\n return new static($this->mapFields);\n }", "public function getCollectionByBName($collectionName) {\n /*\n couldnt find how to use lavarel Mongodb plugin with creating collection on the fly\n so not using db config here\n */\n $mongo = new Mongo('mongodb://testuser01:[email protected]:37368/testdb01');\n $db = $mongo->selectDB('testdb01');\n $collection = new MongoCollection($db, $collectionName);\n return $collection;\n }", "public static function getInstance()\n {\n $mongo = Di::getDefault()->get('mongo');\n\n return new static($mongo);\n }", "public function getStorage()\n {\n if (!isset($this->collection) && !isset($this->database)) {\n throw new \\LogicException(\n \"Create a copy that's linked to a MongoDB Collection or Database by calling the `for()` method\"\n );\n }\n\n return $this->collection ?? $this->database;\n }", "public function getMongoCollection()\n {\n return $this->database->getMongoDB()->selectCollection($this->name);\n }", "public function __construct(Database $mongoDB)\r\n {\r\n try {\r\n $mongoDB->createCollection($this->collectionName);\r\n } catch (\\Exception $e) {\r\n echo $e->getMessage() . \"\\n\";\r\n }\r\n\r\n $this->collection = $mongoDB->selectCollection($this->collectionName);\r\n $this->collection->deleteMany(array());\r\n $this->collection->dropIndexes();\r\n }", "protected function setCollection()\n {\n $databaseManager = app(DatabaseManager::class);\n $client = $databaseManager->connection('mongodb')->getMongoClient();\n $collection =$client->{config('database.connections.mongodb.database')}->subjects;\n\n return $collection;\n }", "public function __construct($mongohost='localhost',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$mongoport='27017',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$dbname=\"onixtest\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$collection=\"products\")\n\t{\n\t\t$this->mongo = new Mongo();\n\t\t$this->overwrite = true;\n\t\t$this->m = $this->mongo;\n\t\t$this->db = $this->m->selectDb($dbname);\n\t\t$this->collection = $this->db->selectCollection($collection);\n\t\t$this->collection->ensureIndex('RecordReference');\n\t}", "public function __construct() {\n $this->db = 'trivia';\n\n if (!(self::$server instanceof \\utilities\\Mongo)) {\n self::$server = new \\Mongo();\n }\n }", "function get_db_collection() {\r\n $m = new Mongo();\r\n\r\n // select a database (stats)\r\n // select a collection (analogous to a relational database's table)\r\n\r\n $collection = $m->stats->entries;\r\n\r\n // remove all from collection (uncomment and refresh to clear database)\r\n //$collection->remove();\r\n\r\n return $collection;\r\n}", "function createCollection()\n{\n global $collectionId, $dataBase;\n\n $response = $dataBase->createCollection(\n 'Movies',\n ['*'],\n ['*'],\n [\n [\n 'label' => 'Name',\n 'key' => 'name',\n 'type' => 'text',\n 'default' => 'Empty Name',\n 'required' => true,\n 'array' => false\n ],\n [\n 'label' => 'Release Year',\n 'key' => 'release_year',\n 'type' => 'numeric',\n 'default' => 1970,\n 'required' => true,\n 'array' => false\n ]\n ]\n );\n\n $collectionId = $response['$id'];\n\n return [\n 'call' => 'api.createCollection',\n 'response' => $response\n ];\n}", "public function createOrUpdateCollection($collectionName) {\n /*\n couldnt find how to use lavarel Mongodb plugin with creating collection on the fly\n so not using db config here\n */\n $mongo = new Mongo('mongodb://testuser01:[email protected]:37368/testdb01');\n $db = $mongo->selectDB('testdb01');\n $collection = new MongoCollection($db, $collectionName);\n $trackActivityCollection = $mongo->selectDB('testdb01')->createCollection($collectionName);\n $trackActivity = array();\n $trackActivity['activity_id'] = $this->activityId;\n $trackActivity['user_id'] = $this->userId;\n $trackActivity['event'] = $this->event;\n $trackActivity['user_agent'] = $this->userAgent;\n $trackActivity['ip_address'] = $this->ipAddress;\n $trackActivityCollection->save($trackActivity);\n return true;\n }", "public function __construct()\n {\n $this->services = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n }", "protected function setDiMongo()\n {\n $options = getOptionsMongo();\n\n if (isset($options['username']) && isset($options['password'])) {\n $dsn = sprintf(\n 'mongodb://%s:%s@%s',\n $options['username'],\n $options['password'],\n $options['host']\n );\n } else {\n $dsn = sprintf(\n 'mongodb://%s',\n $options['host']\n );\n }\n\n $mongo = new Client($dsn);\n\n $this->container->setShared(\n 'mongo',\n $mongo->selectDatabase($options['dbname'])\n );\n }", "private function getTodoCollection() : Collection\n {\n return $this->mongo->selectCollection($this->databaseName, 'todos');\n }", "public function __clone()\n {\n foreach ($this->collection as $k => $v) {\n $this->collection[$k] = clone $v;\n }\n }", "public function createNewInstance(array $inputData)\n\t{\n\t\t$instance = $this->CollectionInstance->newInstance();\n\n $instance->page_version_id = $inputData['page_version_id'];\n $instance->collection_set_id = array_get($inputData, 'collection_set_id', null);\n $instance->name = $inputData['name'];\n $instance->sort = $inputData['sort'];\n\n $instance->save();\n\n return $instance;\n\t}", "public function __construct()\n {\n $this->collection = Collection::findBySlug('rare-scrilla');\n }", "protected function createCollection(string $id, string $name = null): void\n {\n $name ??= $id;\n\n if (!$this->projectDB->exists(App::getEnv('_APP_DB_SCHEMA', 'appwrite'), $name)) {\n $attributes = [];\n $indexes = [];\n $collection = $this->collections[$id];\n\n foreach ($collection['attributes'] as $attribute) {\n $attributes[] = new Document([\n '$id' => $attribute['$id'],\n 'type' => $attribute['type'],\n 'size' => $attribute['size'],\n 'required' => $attribute['required'],\n 'signed' => $attribute['signed'],\n 'array' => $attribute['array'],\n 'filters' => $attribute['filters'],\n ]);\n }\n\n foreach ($collection['indexes'] as $index) {\n $indexes[] = new Document([\n '$id' => $index['$id'],\n 'type' => $index['type'],\n 'attributes' => $index['attributes'],\n 'lengths' => $index['lengths'],\n 'orders' => $index['orders'],\n ]);\n }\n\n try {\n $this->projectDB->createCollection($name, $attributes, $indexes);\n } catch (\\Throwable $th) {\n throw $th;\n }\n }\n }", "static function listenToAddDocumentToCollection(sfEvent $event)\n {\n $model = $event['object'];\n\n $docFields = $model->getSolrDocumentFields();\n $doc = uvmcSolrEventListener::transformArrayToSolrDocument($docFields);\n\n self::$documentCollection[] = $doc;\n }" ]
[ "0.6190158", "0.606236", "0.5828334", "0.57899266", "0.56612337", "0.561815", "0.561421", "0.5560902", "0.55589616", "0.5540751", "0.5528269", "0.55150586", "0.5478216", "0.5462045", "0.54243547", "0.5411986", "0.53852165", "0.53826225", "0.53387755", "0.53306645", "0.53293484", "0.52928203", "0.5261472", "0.5224826", "0.52221143", "0.5217114", "0.521463", "0.5168942", "0.514139", "0.5132076" ]
0.62588066
0
Check if the give Collection uses the same MongoDB database.
private function usesSameDatabase(Collection $collection): bool { return isset($this->database) && $this->database->getManager() === $collection->getManager() && $this->database->getDatabaseName() === $collection->getDatabaseName(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function compareCollection(DocumentSchema $document)\n {\n return $document->getCollection() == $this->getCollection()\n && $document->getDatabase() == $this->getDatabase();\n }", "public function check_is_same_db() {\n\t\treturn isset($this->options['separate_db'])?(bool)$this->options['separate_db']: false;\n\t}", "public static function renameCollection(string $from, string $to) {\n $options = array(\"connectTimeoutMS\" => 30000);\n $client = new MongoDB\\Client(MONGODB_URI, $options);\n $db = $client->selectDatabase('admin');\n if ($db) {\n try {\n $db->command(array('renameCollection'=> MY_DB_NAME.\".\".$from,'to'=>MY_DB_NAME.\".\".$to));\n return true;\n } catch (Exception $e) {\n echo $e;\n return false;\n }\n } else {\n echo \"Could not connect to the admin DB. Rename Collection failed\";\n return false;\n }\n }", "function mongoCollectionFindOne($server, $db, $collection, $query = null) {\n\n try {\n\n $conn = new MongoClient($server);\n $_db = $conn->{$db};\n $collection = $_db->{$collection};\n \n if($query) {\n return $collection->findOne($query);\n } else {\n return $collection->findOne();\n }\n \n } catch (MongoConnectionException $e) {\n die('Error connecting to MongoDB server');\n } catch (MongoException $e) {\n die('Error: ' . $e->getMessage());\n }\n \n}", "public static function get_database () {\n\t\t$conn = MongoManager::get_connection ();\n\t\tif (! $conn) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $conn->{conf ('Mongo', 'name')};\n\t}", "function using(string $databaseName)\n{\n Container\\set(MONGODB_USING_DBNAME, $databaseName);\n}", "public function GetDatabase()\n\t{\n\t\treturn $this->mongo_client_db;\n\t}", "public function collection_exists($uri) {\r\n\t\t$col = $this->find_collection($uri);\r\n\t\tif ( $col !== FALSE ) {\r\n\t\t\treturn TRUE;\r\n\t\t} else {\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t}", "protected function collection()\n {\n return $this->option('collection') ||\n Str::endsWith($this->argument('name'), 'Collection');\n }", "private function forCollection($collection): self\n {\n $copy = $this;\n\n if (!$collection instanceof Collection) {\n if (!isset($this->database)) {\n throw new \\LogicException(\"Not connected to a MongoDB Database object\");\n }\n\n $collection = $this->database->selectCollection($collection);\n } elseif (!$this->usesSameDatabase($collection)) {\n $copy = $copy->withoutProperty('database');\n }\n\n return $copy->withProperty('collection', $collection);\n }", "static protected function wDatabase($database = 'Webiny')\n {\n return ServiceManager::getInstance()->getService('Mongo.' . $database);\n }", "function get_db_collection() {\r\n $m = new Mongo();\r\n\r\n // select a database (stats)\r\n // select a collection (analogous to a relational database's table)\r\n\r\n $collection = $m->stats->entries;\r\n\r\n // remove all from collection (uncomment and refresh to clear database)\r\n //$collection->remove();\r\n\r\n return $collection;\r\n}", "public function createOrUpdateCollection($collectionName) {\n /*\n couldnt find how to use lavarel Mongodb plugin with creating collection on the fly\n so not using db config here\n */\n $mongo = new Mongo('mongodb://testuser01:[email protected]:37368/testdb01');\n $db = $mongo->selectDB('testdb01');\n $collection = new MongoCollection($db, $collectionName);\n $trackActivityCollection = $mongo->selectDB('testdb01')->createCollection($collectionName);\n $trackActivity = array();\n $trackActivity['activity_id'] = $this->activityId;\n $trackActivity['user_id'] = $this->userId;\n $trackActivity['event'] = $this->event;\n $trackActivity['user_agent'] = $this->userAgent;\n $trackActivity['ip_address'] = $this->ipAddress;\n $trackActivityCollection->save($trackActivity);\n return true;\n }", "public function getDatabase()\n {\n if (! $this->database instanceof \\MongoDB) {\n throw new \\Exception('Mongo database object not set.');\n }\n\n return $this->database;\n }", "public function getCollectionByBName($collectionName) {\n /*\n couldnt find how to use lavarel Mongodb plugin with creating collection on the fly\n so not using db config here\n */\n $mongo = new Mongo('mongodb://testuser01:[email protected]:37368/testdb01');\n $db = $mongo->selectDB('testdb01');\n $collection = new MongoCollection($db, $collectionName);\n return $collection;\n }", "public function testCacheStorageMongoSaveSucceeds()\n {\n\n $mongo = Cache::storage(new Mongo())\n ->setConnection(function() {\n $m = new \\MongoClient();\n $db = $m->mongocache;\n\n return $db;\n })\n ->setCollection('test');\n $this->assertTrue($mongo->save('test',range('c', 'a')));\n }", "protected function setCollection()\n {\n $databaseManager = app(DatabaseManager::class);\n $client = $databaseManager->connection('mongodb')->getMongoClient();\n $collection =$client->{config('database.connections.mongodb.database')}->subjects;\n\n return $collection;\n }", "private static function selectDatabaseIfNecessary() {\n\t\t\n\t\tif (strcasecmp(DatabaseManager::$lastDatabaseSelected, SystemDatabaseManager::$dbName) != 0) {\n\t\t\t\n\t\t\tif (DatabaseManager::selectDatabase(SystemDatabaseManager::$dbName, SystemDatabaseManager::$instance->connection)) {\n\t\t\t\tDatabaseManager::$lastDatabaseSelected = SystemDatabaseManager::$dbName;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "private function collection($name) {\n return new MongoCollection($this->dbmanager, $this->dbname, $name);\n }", "public function getMongoCollection()\n {\n return $this->database->getMongoDB()->selectCollection($this->name);\n }", "public function isCollection(): bool\n {\n return (bool)$this->get(ConfigUtil::COLLECTION);\n }", "public function getStorage()\n {\n if (!isset($this->collection) && !isset($this->database)) {\n throw new \\LogicException(\n \"Create a copy that's linked to a MongoDB Collection or Database by calling the `for()` method\"\n );\n }\n\n return $this->collection ?? $this->database;\n }", "public function drop(): bool\n {\n try {\n $uri = Api::buildDatabaseUri($this->connection->getBaseUri(), $this->getDatabase()->getDatabaseName(), Api::COLLECTION);\n $uri = $this->isSystem() ? sprintf(\"%s/%s?isSystem=true\", $uri, $this->getName()) : sprintf(\"%s/%s\", $uri, $this->getName());\n $response = $this->connection->delete($uri);\n $data = json_decode((string)$response->getBody(), true);\n return true;\n } catch (ClientException $exception) {\n $response = json_decode((string)$exception->getResponse()->getBody(), true);\n $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);\n // Collection not found.\n if ($exception->getResponse()->getStatusCode() === 404) {\n return false;\n }\n\n throw $databaseException;\n }\n }", "function requireDatabase() {\n\tif (is_object($this->db) and $this->db->connected === true) { return true; }\n\treturn false;\n\t}", "public function hasCollection(): bool\n {\n return $this->has(ConfigUtil::COLLECTION);\n }", "public function save(): bool\n {\n try {\n // If the collection is a new one, we will create this collection on server.\n if ($this->isNew()) {\n $uri = Api::buildDatabaseUri($this->connection->getBaseUri(), $this->getDatabase()->getDatabaseName(), Api::COLLECTION);\n $response = $this->connection->post($uri, $this->getCreateParameters());\n $data = json_decode((string)$response->getBody(), true);\n\n // Update object.\n $this->isNew = false;\n $this->setAttributes($data);\n return true;\n }\n\n return $this->update();\n } catch (ClientException $exception) {\n $response = json_decode((string)$exception->getResponse()->getBody(), true);\n $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);\n throw $databaseException;\n }\n }", "static function in_database() {\n $class = $this->class;\n\n $db = DB::connect();\n\n try {\n $result = $db->prepare(\"SELECT * FROM $class\")->execute();\n } catch (Exception $e) {\n return false;\n }\n\n return true;\n }", "public function hasDb(): bool;", "public function isDatabaseServer();", "public function isConnected()\n {\n return $this->mongo instanceof \\Mongo && $this->mongo->connected;\n }" ]
[ "0.6754551", "0.6507118", "0.59181184", "0.5874796", "0.5834175", "0.57523245", "0.5751729", "0.57405674", "0.56743854", "0.5640353", "0.5633022", "0.5621055", "0.562032", "0.56090903", "0.5562869", "0.55055445", "0.54945517", "0.5477149", "0.5471823", "0.5461817", "0.5460056", "0.54433995", "0.54405034", "0.54168665", "0.5385189", "0.53725046", "0.5341744", "0.534151", "0.533378", "0.5319234" ]
0.8485236
0
Configure opts, inserting map and schema.
protected function configure(array &$opts): void { $this->configureMap($opts); array_unshift( $opts, opt\setting('schema', $this->schema), opt\setting('collection', $this->collection->getCollectionName()), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_opts($opts){\n\t\t$table = isset($opts['table']) ? $opts['table'] : null;\n\t\t$left = isset($opts['left']) ? $opts['left'] : 'lft';\n\t\t$right = isset($opts['right']) ? $opts['right'] : 'rgt';\n\t\t$id = isset($opts['id']) ? $opts['id'] : 'id';\n\t\t$title = isset($opts['title']) ? $opts['title'] : 'title';\n\t\t$this->set_table($table);\n\t\t$this->left_col = $left;\n\t\t$this->right_col = $right;\n\t\t$this->id_col = $id;\n\t\t$this->title_col = $title;\n\t}", "static function _extractMap(array $opts)\n {\n (new ExtractorMap($opts))->extract();\n }", "protected function init(): void\n {\n $id = $this->getOption('id');\n if (null !== $id) {\n if (\\is_array($id)) {\n $this->addIds($id);\n } else {\n $this->addId($id);\n }\n }\n\n $queries = $this->getOption('query');\n if (null !== $queries) {\n if (\\is_array($queries)) {\n $this->addQueries($queries);\n } else {\n $this->addQuery($queries);\n }\n }\n }", "public function init($opts = ['host' => ''])\n {\n $this->initConfig();\n $this->initSrc($opts);\n }", "protected function assure(array $req_argv_map){\n \n // canary...\n if(empty($req_argv_map)){ return; }//if\n \n foreach($req_argv_map as $name => $default_val){\n \n if(!$this->existsField($name)){\n \n if($default_val === null){\n \n throw new \\InvalidArgumentException(\n sprintf(\n '%s was not passed in and is required, you need to pass it in: --%s=<VALUE>',\n $name,\n $name\n )\n );\n \n }else{\n \n $this->setField($name,$default_val);\n \n }///if/else\n }//if\n \n }//foreach\n \n }", "private static function loadMap() {\n if (is_array(self::$map)) {\n // already loaded\n return;\n }\n self::$map = array();\n $opts = Doctrine_Query::create()->from('Opt')->execute();\n foreach ($opts as $opt) {\n self::$map[$opt->name] = $opt->value;\n }\n }", "static function init(array $opts)\n {\n if ((new Packer($opts))->init()) // if files-added\n (new Indexer($opts))->index();\n }", "private function configureSourceData(Cmd $cmd)\n {\n if (count($this->tablesToDump)) {\n $this->configureSourceTables($cmd);\n } else {\n $this->configureSourceDatabases($cmd);\n }\n }", "public function prePopulateMapTable() {}", "protected function _options(array $options): void\n {\n if (!empty($options['targetForeignKey'])) {\n $this->setTargetForeignKey($options['targetForeignKey']);\n }\n if (!empty($options['joinTable'])) {\n $this->_junctionTableName($options['joinTable']);\n }\n if (!empty($options['through'])) {\n $this->setThrough($options['through']);\n }\n if (!empty($options['saveStrategy'])) {\n $this->setSaveStrategy($options['saveStrategy']);\n }\n if (isset($options['sort'])) {\n $this->setSort($options['sort']);\n }\n }", "private function initialize()\n {\n $config = $this->parse_config();\n\n $config['dbname'] = $config['database'];\n switch (strtolower($config['dbms']))\n {\n case 'mysql':\n case 'mariadb':\n $config['driver'] = 'mysql';\n $config['commands'][] = 'SET SQL_MODE=ANSI_QUOTES';\n break;\n case 'pgsql':\n $config['driver'] = 'pgsql';\n break;\n case 'sybase':\n $config['driver'] = 'dblib';\n break;\n case 'oracle':\n $config['driver'] = 'oci';\n $config['dbname'] = '//' .$config['host']. ':' .$config['port']. '/' .$config['database'];\n break;\n case 'sqlite':\n $config['driver'] = 'sqlite';\n break;\n }\n if (!in_array($config['driver'], PDO::getAvailableDrivers()))\n {\n throw new InvalidArgumentException('Unsupported PDO driver: {<b>'.$config['driver'].'</b>}');\n }\n\n $stack = [];\n foreach ($config As $key => $value)\n {\n if(!in_array($key, ['driver', 'dbms', 'username', 'password', 'database', 'debug', 'prefix', 'commands', 'options']))\n {\n $stack[] = is_int($key) ? $value : strtolower($key) . '=' . $value;\n }\n }\n if (in_array(strtolower($config['dbms']), ['mysql', 'pgsql', 'sybase']) AND isset($config['charset']))\n {\n $config['commands'][] = \"SET NAMES '{$config['charset']}'\" . (\n (strtolower($config['dbms']) === 'mysql' AND isset($config['collation'])) ?\n \" COLLATE '{$config['collation']}'\" : ''\n );\n }\n $config['dsn'] = $config['driver'] . ':' . implode(';', $stack);\n $config['options'] = (isset($config['options']) AND is_array($config['options'])) ? $config['options'] : [];\n $config['debug'] = (isset($config['debug']) AND is_bool($config['debug'])) ? $config['debug'] : false;\n\n $this->config = $config;\n }", "protected function configure()\n {\n $this\n ->addArgument(\n 'project',\n InputArgument::OPTIONAL,\n 'Connect to server and go to project root.'\n )\n ->addArgument(\n 'script',\n InputArgument::OPTIONAL,\n 'Connect to server then project\\'s script.'\n )\n ->addOption(\n 'projects',\n 'p',\n InputOption::VALUE_NONE,\n 'List available projects.'\n )\n ->addOption(\n 'scripts',\n 's',\n InputOption::VALUE_NONE,\n 'List available scripts for a project.'\n )\n ->addOption(\n 'force',\n 'f',\n InputOption::VALUE_NONE,\n 'Skip ping test.'\n );\n }", "protected function setDefaults()\n {\n $this->options['dsn'] = null;\n $this->options['table'] = 'HTTP_Session2_Container_Doctrine_Record';\n $this->options['autooptimize'] = false;\n }", "private function _setup_options() {\n $options = get_option('dkovotables_options');\n if (empty($options)) {\n $options = array();\n }\n $this->options = wp_parse_args($options, $this->default_options);\n }", "function gmapper_install () {\n\n // global variables\n update_option(GM_OPTION_VERSION, '0.9.10');\n add_option(GM_OPTION_API_KEY,'');\n add_option(GM_OPTION_WIPEALL, 'on');\n update_option(GM_OPTION_ICON_PATH, '/wp-content/plugins/GoogleMapper/icons');\n\n // install the tables\n include_once('install/install_sql.php');\n gm_install_tables();\n\n // install the examples\n include_once('install/install_examples.php');\n gm_install_examples();\n\n}", "function __construct( $opts )\n\t\t{\n\t\t\tparent::__construct( $opts );\t\t\t\n\t\t}", "static function extractMap2(array $opts)\n {\n (new ExtractorMap2($opts))->extract();\n }", "public function __construct( $opts ) {\n $this->error_messages = self::default_error_messages();\n $this->validators = self::default_validators();\n\n foreach( array('required','widget','label','initial','help_text','error_messages','show_hidden_initial','validators') as $optname ) {\n if(!array_key_exists($optname,$opts) )\n continue;\n if(is_array($opts[$optname])) {\n $this->$optname = array_merge($this->$optname,$opts[$optname]);\n } else {\n $this->$optname = $opts[$optname];\n }\n }\n\n if(is_null($this->widget)) {\n $this->widget = $this->default_widget();\n }\n // widget can be a string containing name of the widget class\n if(is_string($this->widget)) {\n $this->widget = new $this->widget();\n }\n\n $extra_attrs = $this->widget_attrs($this->widget);\n if($extra_attrs) {\n $this->widget->attrs = array_merge(\n $this->widget->attrs, $extra_attrs);\n }\n\n $this->uniq = Field::$creation_counter++;\n }", "public function setUp() {\n $this->map= new Hashmap(\n array(\n 'k1' => 'v1',\n 'k2' => 'v2',\n 'k3' => 'v3',\n )\n );\n }", "function iform_map_get_map_options($args, $readAuth) {\n // read out the activated preset layers\n $presetLayers = [];\n if (!empty($args['preset_layers'])) {\n foreach($args['preset_layers'] as $key => $value) {\n if (is_int($key)) {\n // normally a checkbox group would just output an array\n $presetLayers[] = $value;\n } elseif ($value!==0) {\n // but the Drupal version of the the parameters form (deprecated) leaves a strange array structure in the parameter value.\n $presetLayers[] = $key;\n }\n }\n }\n\n $options = array(\n 'readAuth' => $readAuth,\n 'presetLayers' => $presetLayers,\n 'editLayer' => true,\n 'layers' => [],\n 'initial_lat'=>$args['map_centroid_lat'],\n 'initial_long'=>$args['map_centroid_long'],\n 'initial_zoom'=>(int) $args['map_zoom'],\n 'width'=>$args['map_width'],\n 'height'=>$args['map_height'],\n 'standardControls'=>array('layerSwitcher','panZoomBar'),\n 'rememberPos'=>isset($args['remember_pos']) ? ($args['remember_pos']==true) : false\n );\n // If they have defined a custom base layer, add it\n if (!empty($args['wms_base_title']) && !empty($args['wms_base_url']) && !empty($args['wms_base_layer'])) {\n data_entry_helper::$onload_javascript .= \"var baseLayer = new OpenLayers.Layer.WMS(\n '\".$args['wms_base_title'].\"',\n '\".$args['wms_base_url'].\"',\n {layers: '\".$args['wms_base_layer'].\"', sphericalMercator: true}, {singleTile: true}\n );\\n\";\n $options['layers'][] = 'baseLayer';\n }\n // Also add any custom base layers they have defined\n if (!empty($args['tile_cache_layers'])) {\n $options['tilecacheLayers'] = json_decode($args['tile_cache_layers'], true);\n }\n if (!empty($args['other_base_layer_config'])) {\n $options['otherBaseLayerConfig'] = json_decode($args['other_base_layer_config'], true);\n }\n // And any indicia Wms layers from the GeoServer\n if (!empty($args['indicia_wms_layers'])) {\n $wmsLayers = explode(\"\\n\", $args['indicia_wms_layers']);\n // Each layer may either just be a feature name or, optionally, may be\n // prefixed by a title in the form title = feature.\n foreach ($wmsLayers as $layer) {\n $separatorPos = strpos($layer, '=');\n if ($separatorPos !== FALSE) {\n // A title is present.\n $title = trim(substr($layer, 0, $separatorPos));\n $feature = trim(substr($layer, $separatorPos + 1));\n $options['indiciaWMSLayers'][$title] = $feature;\n }\n else {\n $options['indiciaWMSLayers'][] = $layer;\n }\n }\n }\n // set up standard control list if supplied\n if (array_key_exists('standard_controls', $args) && $args['standard_controls']) {\n $args['standard_controls'] = str_replace(\"\\r\\n\", \"\\n\", $args['standard_controls']);\n $options['standardControls']=explode(\"\\n\", $args['standard_controls']);\n // If drawing controls are enabled, then allow polygon recording.\n if (count(array_intersect(['drawPolygon', 'drawLine', 'drawPoint'], $options['standardControls'])) > 0)\n $options['allowPolygonRecording']=true;\n }\n // And pass through any translation strings, only if they exist\n $msgGeorefSelectPlace = lang::get('LANG_Georef_SelectPlace');\n if ($msgGeorefSelectPlace!='LANG_Georef_SelectPlace') $options['msgGeorefSelectPlace'] = $msgGeorefSelectPlace;\n $msgGeorefNothingFound = lang::get('LANG_Georef_NothingFound');\n if ($msgGeorefNothingFound!='LANG_Georef_NothingFound') $options['msgGeorefNothingFound'] = $msgGeorefNothingFound;\n // if in Drupal, and IForm proxy is installed, then use this path as OpenLayers proxy\n if (function_exists('hostsite_module_exists') && hostsite_module_exists('iform_proxy')) {\n $options['proxy'] = data_entry_helper::getRootFolder(true) . hostsite_get_config_value('iform', 'proxy_path', 'proxy') . '&url=';\n }\n // And a single location boundary if defined\n if (!empty($args['location_boundary_id']))\n $location = $args['location_boundary_id'];\n elseif (isset($args['display_user_profile_location']) && $args['display_user_profile_location']) {\n $location = hostsite_get_user_field('location');\n }\n if (!empty($location)) {\n iform_map_zoom_to_location($location, $readAuth);\n }\n return $options;\n}", "public function init(array $options): void\n {\n if (isset($options['table'])) {\n $this->table = $options['table'];\n }\n\n $this->pdo = $this->getOrCreatePdo($options);\n }", "public function __construct(){\r\n\t\t\r\n\t\t$datastore = config::get($this, 'datastore');\r\n\t\t\r\n\t\tif($datastore != ''){\r\n\t\t\t$this->datastore = $datastore;\r\n\t\t}\r\n\t\t\r\n\t\t$map = config::get($this, 'mapDbToObject');\r\n\t\tif(is_array($map)){\r\n\t\t\t$this->mapDbToObject = $map;\r\n\t\t}\r\n\t\t\r\n\t\tif($this->table == ''){\r\n\t\t\t$this->table = inflector::getSpecificfromcontext($this);\r\n\t\t}\r\n\t}", "protected function configure($options = array(), $attributes = array())\n {\n $this->addOption('html', false);\n $this->addOption('model', false);\n $this->addOption('method', '__toString');\n $this->addOption('key_method', 'getPrimaryKey');\n $this->addOption('order_by', null);\n $this->addOption('query', null);\n $this->addOption('multiple', false);\n $this->addOption('table_method', null);\n \n // csak Doctrine_Query table_method eseten. \n // Nem keri le a teljes tablat, csak a valueval egyezot\n $this->addOption('cached_value', true); \n \n $this->addOption('showed_value', false);\n \n // amig nincs kivalasztva semmi, ez jelenik meg\n $this->addOption('empty', 'Not granted');\n\n $this->addOption('has_hidden', false);\n $this->addOption('choices', false);\n\n //parent::configure($options, $attributes); \n }", "public function __construct() {\n $this->buildCustomMappings();\n }", "final public function setupOptions()\n {\n \n $this->loadOptions();\n \n //first arg is path we don't need it here\n array_shift($this->args);\n \n foreach ($this->args as $value) {\n \n if(strpos($value, '-') !== false || strpos($value, '--') !== false) {\n \n $this->loadInternalOption($value);\n \n }\n \n }\n \n }", "protected function configure()\n {\n $this->addOption(\n 'output-format',\n 'of',\n InputOption::VALUE_REQUIRED,\n 'Output format (human, json)',\n 'human'\n );\n $this->githubConfigure();\n }", "public function setup($opts = ['db-url' => '', 'no-interaction|n' => false])\n {\n $this->io()->title('Setting up a new Drupal site - ' . $this->getConfigValue('project.human_name'));\n $this->installComposerDependencies();\n $this->buildFrontendReqs();\n $this->drupalInstall($opts);\n\n // Don't try to import configurations for new installation.\n if (file_exists($this->getDocroot() . '/' . $this->getConfigValue('drupal.config.path') . '/core.extension.yml')) {\n $this->importConfig();\n $this->cacheRebuild();\n }\n }", "protected function configure()\n {\n $this->addOption(\n 'connection',\n null,\n InputOption::VALUE_REQUIRED,\n 'Select DB connection type for Magento configurations with several databases',\n 'default'\n );\n }", "function setOpts($arr){\n\t\t\tforeach($arr AS $key => $value){\n\t\t\t\tif ($key == \"idcol\"){\n\t\t\t\t\t$this->opts[$key] = $value;\n\t\t\t\t}else{\n\t\t\t\t\tthrow new Exception(\"Invalid key: \\\"\" . $key . \"\\\".\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "protected function configure(): void\n {\n $this->setHelp($this->getDescription());\n $this->addOption(\n self::OPTION_NAME_LIMIT,\n self::OPTION_NAME_LIMIT_SHORTCUT,\n InputOption::VALUE_OPTIONAL,\n 'Limit of importSource to import at this run',\n self::OPTION_LIMIT_DEFAULT\n );\n }" ]
[ "0.63032216", "0.5522468", "0.5274416", "0.5119357", "0.4979843", "0.49458876", "0.48806676", "0.48732698", "0.48686853", "0.48614848", "0.48502085", "0.484614", "0.48379588", "0.47934413", "0.4775712", "0.47724545", "0.47655883", "0.47613865", "0.47578144", "0.47504118", "0.4747744", "0.47466007", "0.4731257", "0.47057736", "0.4671662", "0.4665212", "0.46628085", "0.46619186", "0.46479636", "0.46392992" ]
0.77861524
0
Get the result builder used by this service.
public function getResultBuilder(): ResultBuilder { return $this->resultBuilder; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function build(): ResultBuilder\n {\n return new ResultBuilder(get_called_class());\n }", "public function getBuilder()\n {\n return $this->_builder;\n }", "public function getBuilder()\n {\n return $this->builder;\n }", "public function getBuilder()\n {\n return $this->builder;\n }", "public function builder()\n {\n $this->assert = Result::BUILDER;\n return $this;\n }", "public function getBuilder()\n {\n $cache = $this->getCache($this->configuration->cache);\n $persistence = $this->getPersistence();\n $secureBases = $this->getSecureBaseDirectories();\n $configurationFiles = $this->getConfigurationFiles($secureBases);\n $repository = ConfigurationFileRepository::getInstance($secureBases, $configurationFiles);\n\n /*\n * We only populate up to the secureBases because adding a DIC or service manager by configuration starts\n * making the configuration-based approach pay off less. If you need a DIC or service manager for your\n * configuration builder (which you will if you use object/method callbacks for value filters) then you need\n * to wire the Builder object with your own code.\n */\n\n $builder = new Builder(\n $cache,\n $persistence,\n $repository\n );\n\n return $builder;\n }", "protected function getDatagridBuilder()\n {\n return $this->datagridBuilder;\n }", "public function getDataBuilder(): DataBuilder\n {\n return $this->config->getDataBuilder();\n }", "protected function getHttpClientBuilder(): Builder\n {\n return $this->httpClientBuilder;\n }", "public static function builder()\n {\n $builder = new Builder;\n $builder->engine = new BuilderFactory;\n return $builder;\n }", "abstract public function getBuilder(): BuilderBase;", "protected function build()\n {\n return $this;\n }", "public function getCommandBuilder () {\r\n return $this->getSchema()\r\n ->getCommandBuilder();\r\n }", "public function withResultBuilder(ResultBuilder $builder)\n {\n return $this->withProperty('resultBuilder', $builder);\n }", "public function builder();", "public static function getViewBuilder()\n {\n if (null === static::$viewBuilder) {\n static::$viewBuilder = static::instantiateViewBuilder();\n }\n\n return static::$viewBuilder;\n }", "public static function builder(): GetSnapshotRequestBuilder\n\t{\n\t\treturn new GetSnapshotRequestBuilder();\n\t}", "public function builder() {\n\t\t\treturn new Field_Builder();\n\t\t}", "public function getRequestBuilder()\n {\n return new RequestBuilder();\n }", "public function getRequestBuilder(): RequestBuilderInterface\n {\n return new RequestBuilder();\n }", "public static function queryBuilder(){\n // Set query builder to fetch result sets as associative arrays (instead of creating stdClass objects)\n Capsule::connection()->setFetchMode(\\PDO::FETCH_ASSOC);\n $table = Database::getSchemaTable(static::$_table_id)->name;\n return Capsule::table($table);\n }", "protected function getSchemaBuilder()\n {\n return $this->getConnection()->getSchemaBuilder();\n }", "protected function getSchemaBuilder()\n {\n return $this->getConnection()->getSchemaBuilder();\n }", "public function getContainerBuilder(): Nette\\DI\\ContainerBuilder\n {\n return $this->compiler->getContainerBuilder();\n }", "protected static function getUrlBuilder()\n {\n if (!isset(static::$urlBuilder)) {\n static::$urlBuilder = new UrlBuilder;\n }\n\n return static::$urlBuilder;\n }", "protected function getSchemaBuilder()\n {\n return $this->getDbConnection()->getSchemaBuilder();\n }", "public function getCurrentQueryBuilder()\n {\n return $this->builder;\n }", "public function getExpressionBuilder()\n {\n if (null === $this->expressionBuilder) {\n $this->expressionBuilder = new ExpressionBuilder();\n }\n\n return $this->expressionBuilder;\n }", "public function getBuilder(): ?BuilderInterface\n {\n }", "public function query(): Builder\n {\n $this->interrogate();\n\n return $this->builder;\n }" ]
[ "0.7734301", "0.731538", "0.72639924", "0.72639924", "0.71658236", "0.65873206", "0.6497851", "0.6323672", "0.62545127", "0.62119406", "0.6167678", "0.6140116", "0.6110747", "0.6101955", "0.6081716", "0.60730106", "0.60673445", "0.60163045", "0.59804535", "0.5976686", "0.5931329", "0.5831334", "0.5831334", "0.5828411", "0.5820257", "0.5816696", "0.57847905", "0.57641995", "0.57303923", "0.5719705" ]
0.8496453
0
/ setDumpBinaryPath > path tempat pg_dump.exe, di linux cb lgsg pg_dump aja setHost > ip database postgre setDbName > nama db setUserName> nama username db setPassword > pass username db setStorePath > path tempat nyimpan db, usahain uda mode 775 includeTables > table2 yg mau diimport
public function dump() { $dumpDB = PostgreSql::create() // ->setDumpBinaryPath('C:\\PostgreSQL\\pg96\\bin\\pg_dump.exe') ->setDumpBinaryPath('pg_dump') ->setHost(env('DB_HOST')) ->setDbName(env('DB_DATABASE')) ->setUserName(env('DB_USERNAME')) ->setPassword(env('DB_PASSWORD')) ->setStorePath(public_path('upload/backup.sql')); //->includeTables(['tr_ap_invoice_dtl', 'tr_ap_invoice_hdr', 'tr_ap_invoice_dtl', 'tr_ap_invoice_hdr', 'tr_asset_mutations', 'tr_bank', 'tr_bankjv', 'tr_contract', 'tr_contract_invoice', 'tr_currency_rate', 'tr_invoice_journal', 'tr_invoice_paymdtl', 'tr_invoice_paymhdr', 'tr_invpaym_journal', 'tr_meter', 'tr_period_meter', 'tr_purchase_order_dtl', 'tr_purchase_order_hdr', 'tr_ledger', 'tr_invoice', 'tr_invoice_detail', 'ms_unit', 'ms_tenant', 'users']); if($dumpDB->dumpToFile()) return $dumpDB->downloadBackup(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function databaseDump()\n\t{\n\t\t// dump the database\n\t\t$mysqldump_command = $this->_database_options['mysqldump_path'] . 'mysqldump -h' . \n\t\t\t\t\t\t\t $this->_database_options['host'] . ' -u' . \n\t\t\t\t\t\t\t $this->_database_options['username'] . ' -p' . \n\t\t\t\t\t\t\t $this->_database_options['password'] . ' --databases ' . \n\t\t\t\t\t\t\t $this->_database_options['dbname'] . ' > ' . $this->_tmp_dir . $this->_filename; \n\t\t\t\t\t\t\t \n\t\t$output = '';\t\t\n\t\t$return_var = 0;\t\t \n\t\texec($mysqldump_command, $output, $return_var);\n\t\tif ($return_var == 2) {\n\t\t\tthrow new Exception('mysqldump dump failed');\n\t\t}\n\t\t\n\t\t\n\t\t// gzip the results\n\t\t$gzip_command = 'tar -zcf ' . $this->_tmp_dir . $this->_filename . '.tar.gz -C ' . $this->_tmp_dir . ' ' . $this->_filename;\n\t\texec($gzip_command);\n\t}", "function _coda_backup_migrate_dump_tables() {\n $filename = $_ENV['CODA_SITE_LOCAL_PATH'] . '/sql/dump.sql';\n\n // Dump the database.\n $temp_file = _backup_migrate_temp_file();\n\n $success = _backup_migrate_get_dump_sql(\n $filename, \n variable_get(\"backup_migrate_exclude_tables\", _backup_migrate_default_exclude_tables()),\n variable_get(\"backup_migrate_nodata_tables\", _backup_migrate_default_structure_only_tables())\n );\n $filename .= \".sql\";\n $filemime = 'text/x-sql';\n\n\n // Save or download the results.\n if ($success) {\n rename($temp_file, $filepath);\n }\n\n // Delete any temporary files we've created.\n _backup_migrate_temp_file(\"\", TRUE);\n}", "public function createDump()\n {\n\n View::$sendBody = false;\n\n $metaModel = PATH_GW.'data/metamodels/ChinouMetaModel.xml';\n\n $dump = new LibDbDeveloperCreatePgTestdata();\n\n $dump->setSchema( 'ramses_test' );\n $dump->setMetaModell($metaModel);\n\n $dump->generateSqlScript();\n\n SFiles::write( PATH_GW.'data/ddl/TestDataDump.sql' ,$dump->getDdl() );\n\n }", "public function genBackup($dbname = \"base_db\", $chmod = null) {\n try {\n\n $html = \"\";\n $smt1 = $this->db->query(\"SHOW TABLES\");\n $tables1 = $smt1->result_array();\n $tables = array();\n foreach ($tables1 as $tbl1) {\n if (stristr($_SERVER['SERVER_SOFTWARE'], 'Win32')) {\n $tblname1 = $tbl1['Tables_in_' . strtolower($dbname)];\n } else {\n $tblname1 = $tbl1['Tables_in_' . $dbname];\n }\n $tables[] = $tblname1;\n }\n\n\n $sql = \"/*!40101 SET NAMES utf8 */;\\n/*!40101 SET SQL_MODE=''*/;\\n\\n\\n/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\\n/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\\n/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\\n/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\\n\\n--\\n-- Base de datos: `$dbname`\\n--\\n\\n\";\n\n $sql .= \"CREATE DATABASE IF NOT EXISTS {$dbname} ;\\n\\n\";\n $sql .= \"USE {$dbname} ;\\n\\n\";\n\n\n foreach ($tables as $table) {\n $html .= \"<tr><td>Backing up {$table} table...</td></tr>\";\n\n $result = $this->db->query('SELECT * FROM ' . $table);\n $fields = $this->db->list_fields($table);\n $numFields = count($fields);\n\n $sql .= \"\\n\\n-------------------------------------------------------\\n\\n--\\n-- Estructura de tabla para la tabla `$table`\\n--\\n\\nDROP TABLE IF EXISTS $table ;\";\n $row_result = $this->db->query('SHOW CREATE TABLE ' . $table);\n $row2 = $row_result->result_array();\n $row2 = array_values($row2[0]);\n /* $matches = array();\n preg_match(\"/COMMENT '(.*?)'/\", $row2[1], $matches).\"<br /><br />\";\n echo $matches[0]; */\n $sql.= \"\\n\\n {$row2[1]} ;\\n\\n\";\n\n foreach ($result->result_array() as $row) {\n //($row = $result->_fetch_row())\n\n $sql .= 'INSERT INTO ' . $table . ' VALUES(';\n $j = 0;\n foreach ($fields as $field) {\n $row[$field] = addslashes($row[$field]);\n $row[$field] = str_replace(\"\\n\", \"\\\\n\", $row[$field]);\n if (isset($row[$field])) {\n $sql .= '\"' . $row[$field] . '\"';\n } else {\n $sql.= '\"\"';\n }\n\n if ($j < ($numFields - 1)) {\n $sql .= ',';\n }\n $j++;\n }\n $sql.= \");\\n\";\n }\n \n\n $sql.=\"\\n\\n/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\\n/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;\\n/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;\\n/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;\";\n\n $html .= \" OK\" . \"<br />\";\n }\n } catch (Exception $e) {\n var_dump($e->getMessage());\n return false;\n }\n\n $this->create(BACKPATH . \"_backup_db/backup/db-backup-\" . $dbname . \"-\" . date(\"Ymd-His\", time()) . \".sql\", $sql, 'w+', $chmod);\n\n\n return $html . \" Todos los backup generados se encuentran en la carpeta backup de este modulo.\";\n }", "function rex_a1_export_db($filename)\n{\n global $REX,$I18N;\n\n $fp = @fopen($filename, \"w\");\n\n if (!$fp)\n {\n return false;\n }\n\n // Im Frontend gibts kein I18N\n if(!is_object($I18N))\n $I18N = rex_create_lang($REX['LANG']);\n\n $sql = rex_sql::factory();\n $tables = rex_sql::showTables(1, $REX['TABLE_PREFIX']);\n\n $nl = \"\\n\";\n $insertSize = 5000;\n\n // ----- EXTENSION POINT\n rex_register_extension_point('A1_BEFORE_DB_EXPORT');\n\n // Versionsstempel hinzufügen\n fwrite($fp, '## Redaxo Database Dump Version '.$REX['VERSION'].$nl);\n fwrite($fp, '## Prefix '.$REX['TABLE_PREFIX'].$nl);\n fwrite($fp, '## charset '.$I18N->msg('htmlcharset').$nl.$nl);\n// fwrite($fp, '/*!40110 START TRANSACTION; */'.$nl);\n\n foreach ($tables as $table)\n {\n if ($table != $REX['TABLE_PREFIX'].'user' // User Tabelle nicht exportieren\n && substr($table, 0 , strlen($REX['TABLE_PREFIX'].$REX['TEMP_PREFIX'])) != $REX['TABLE_PREFIX'].$REX['TEMP_PREFIX']) // Tabellen die mit rex_tmp_ beginnne, werden nicht exportiert!\n {\n //---- export metadata\n $create = rex_sql::showCreateTable($table);\n\n fwrite($fp, \"DROP TABLE IF EXISTS `$table`;\\n\");\n fwrite($fp, \"$create;\\n\");\n\n $fields = $sql->getArray(\"SHOW FIELDS FROM `$table`\");\n\n foreach ($fields as $idx => $field)\n {\n if (preg_match('#^(bigint|int|smallint|mediumint|tinyint|timestamp)#i', $field['Type']))\n {\n $fields[$idx] = 'int';\n }\n elseif (preg_match('#^(float|double|decimal)#', $field['Type']))\n {\n $fields[$idx] = 'double';\n }\n elseif (preg_match('#^(char|varchar|text|longtext|mediumtext|tinytext)#', $field['Type']))\n {\n $fields[$idx] = 'string';\n }\n // else ?\n }\n\n //---- export tabledata\n $start = 0;\n $max = $insertSize;\n\n do\n {\n $sql->freeResult();\n $sql->setQuery(\"SELECT * FROM `$table` LIMIT $start,$max\");\n\n if ($sql->getRows() > 0 && $start == 0)\n {\n fwrite($fp, \"\\nLOCK TABLES `$table` WRITE;\");\n fwrite($fp, \"\\n/*!40000 ALTER TABLE `$table` DISABLE KEYS */;\");\n }\n elseif ($sql->getRows() == 0)\n {\n break;\n }\n\n $start += $max;\n $values = array();\n\n while($sql->hasNext())\n {\n $record = array();\n\n foreach ($fields as $idx => $type)\n {\n $column = $sql->getValue($idx);\n\n switch ($type)\n {\n case 'int':\n $record[] = intval($column);\n break;\n case 'double':\n $record[] = sprintf('%.10F', (double) $column);\n break;\n case 'string':\n default:\n $record[] = $sql->escape($column, \"'\", true);\n break;\n }\n }\n\n $values[] = $nl .' ('.implode(',', $record).')';\n $sql->next();\n }\n\n if (!empty($values))\n {\n $values = implode(',', $values);\n fwrite($fp, \"\\nINSERT INTO `$table` VALUES $values;\");\n unset($values);\n }\n }\n while ($sql->getRows() >= $max);\n\n if ($start > 0)\n {\n fwrite($fp, \"\\n/*!40000 ALTER TABLE `$table` ENABLE KEYS */;\");\n fwrite($fp, \"\\nUNLOCK TABLES;\\n\\n\");\n }\n }\n }\n\n fclose($fp);\n\n\n $hasContent = true;\n\n // Den Dateiinhalt geben wir nur dann weiter, wenn es unbedingt notwendig ist.\n if (rex_extension_is_registered('A1_AFTER_DB_EXPORT'))\n {\n $content = rex_get_file_contents($filename);\n $hashBefore = md5($content);\n // ----- EXTENSION POINT\n $content = rex_register_extension_point('A1_AFTER_DB_EXPORT', $content);\n $hashAfter = md5($content);\n\n if ($hashAfter != $hashBefore)\n {\n rex_put_file_contents($filename, $content);\n $hasContent = !empty($content);\n unset($content);\n }\n }\n\n return $hasContent;\n}", "function mysql_php_dump($dbname) {\n\n\t\t/*HEADER*/\n\t\t$this->dbname = $dbname;\n\t\t$this->output\n\t\t\t\t\t\t = \"\n-- mysql_export_sql.php dump file\n-- version \".mysql_get_server_info().\"\n--\n-- Host: http://\".$_SERVER[\"HTTP_HOST\"].\"\n-- Generation Time: \".date('M d, Y at h:i A').\"\n-- Server software: \".$_SERVER['SERVER_SOFTWARE'].\"\n-- PHP Version: \".phpversion().\"\\n\n--\n-- Database: `$this->dbname`\n--\n-- --------------------------------------------------------\";\n\n\t}", "function mysqldumpHoaDb($backupfile) {\n\tinclude 'hoaDbCred.php';\n\tsystem(\"mysqldump -h $host -u $dbadmin -p$password $dbname > $backupfile\");\n}", "public function database_mysql_dump($tables = '*') {\n\n $return = '';\n\n $modelName = $this->modelClass;\n\n $dataSource = $this->{$modelName}->getDataSource();\n $databaseName = $dataSource->getSchemaName();\n\n\n // Do a short header\n $return .= '-- Database: `' . $databaseName . '`' . \"\\n\";\n $return .= '-- Generation time: ' . date('D jS M Y H:i:s') . \"\\n\\n\\n\";\n\n\n if ($tables == '*') {\n $tables = array();\n $result = $this->{$modelName}->query('SHOW TABLES');\n foreach($result as $resultKey => $resultValue){\n $tables[] = current($resultValue['TABLE_NAMES']);\n }\n } else {\n $tables = is_array($tables) ? $tables : explode(',', $tables);\n }\n\n // Run through all the tables\n foreach ($tables as $table) {\n $tableData = $this->{$modelName}->query('SELECT * FROM ' . $table);\n\n $return .= 'DROP TABLE IF EXISTS ' . $table . ';';\n $createTableResult = $this->{$modelName}->query('SHOW CREATE TABLE ' . $table);\n $createTableEntry = current(current($createTableResult));\n $return .= \"\\n\\n\" . $createTableEntry['Create Table'] . \";\\n\\n\";\n\n // Output the table data\n foreach($tableData as $tableDataIndex => $tableDataDetails) {\n\n $return .= 'INSERT INTO ' . $table . ' VALUES(';\n\n foreach($tableDataDetails[$table] as $dataKey => $dataValue) {\n\n if(is_null($dataValue)){\n $escapedDataValue = 'NULL';\n }\n else {\n // Convert the encoding\n $escapedDataValue = mb_convert_encoding( $dataValue, \"UTF-8\", \"ISO-8859-1\" );\n\n // Escape any apostrophes using the datasource of the model.\n $escapedDataValue = $this->{$modelName}->getDataSource()->value($escapedDataValue);\n }\n\n $tableDataDetails[$table][$dataKey] = $escapedDataValue;\n }\n $return .= implode(',', $tableDataDetails[$table]);\n\n $return .= \");\\n\";\n }\n\n $return .= \"\\n\\n\\n\";\n }\n\n // Set the default file name\n $path=\"backup/\";\n $fileName = $databaseName . '-backup-' . date('Y-m-d_H-i-s') . '.sql';\n $handle = fopen($path.$fileName,'w+');\n $is_write=fwrite($handle,$return); \n fclose($handle);\n if($is_write)\n {\n $data['file_name']=str_replace(\".sql\",'', $fileName);\n $data['file_size']=filesize($path.$fileName);\n $data['file_path']=$path.$fileName;\n $data['date']=date('Y-m-d h:i:s');\n\n $check=$this->Backup_restor->save($data);\n if($check){\n $this->Session->setFlash('Your Backup saved Successfully', 'default', array(), 'msg');\n $this->redirect('/admin/backuprestor');\n exit();\n }\n }\n // Serve the file as a download\n //$this->rander('ajax');\n $this->autoRender = false;\n /*$this->response->type('Content-Type: text/x-sql');\n $this->response->download($fileName);\n $this->response->body($return);*/\n}", "public function dumpDB()\n {\n $aTables = $this->_getDbTables();\n $oDb = oxDb::getDb();\n\n foreach ($aTables as $sTable) {\n $sFile = $this->getDumpFolderPath() . $sTable . '_dump.sql';\n if (file_exists($sFile)) {\n unlink($sFile);\n }\n\n $sql = \"SELECT * INTO OUTFILE '\" . $sFile . \"' FROM $sTable\";\n $oDb->Query($sql);\n }\n\n $aChecksum = $this->_getTableChecksum($aTables);\n\n file_put_contents($this->getDumpFolderPath() . 'dbdata', serialize($aChecksum));\n }", "abstract public function dumpDatabase($dbHandle, $path);", "private function backupDatabase() {\n $backups = Files::getDirContent(SRC.'compilers/backup/');\n $c = count($backups);\n if ($c > 10) {\n for ($i = 0; $i < ($c-10); $i++) {\n unlink($backups[$i]);\n }\n }\n $databaseConfig = Config::get('database',true);\n $user = (string) $databaseConfig->user;\n $password = (string) $databaseConfig->password;\n $database = (string) $databaseConfig->database;\n $file = SRC.'compilers/backup/'.$database.'-export_'.date('Y-n-d_h-i-s').'.sql';\n shell_exec(\"mysqldump -u$user -p$password $database > $file\");\n }", "private function export(){\n return(\"export PATH={$this->PATH} ; export PGDATA={$this->PGDATA} ;\");\n }", "function dumpMySQL($serveur, $login, $password, $base, $mode)\n{\n $connexion = mysql_connect($serveur, $login, $password);\n mysql_select_db($base, $connexion);\n \n $entete = \"-- ----------------------\\n\";\n $entete .= \"-- dump de la base \".$base.\" au \".date(\"d-M-Y\").\"\\n\";\n $entete .= \"-- ----------------------\\n\\n\\n\";\n $creations = \"\";\n $insertions = \"\\n\\n\";\n \n $listeTables = $result = mysql_query(\"SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'iga_magasin' ORDER BY table_name DESC\");\n while($table = mysql_fetch_array($listeTables))\n {\n // si l'utilisateur a demandé la structure ou la totale\n if($mode == 1 || $mode == 3)\n {\n $creations .= \"-- -----------------------------\\n\";\n $creations .= \"-- creation de la table \".$table[0].\"\\n\";\n $creations .= \"-- -----------------------------\\n\";\n $listeCreationsTables = mysql_query(\"show create table \".$table[0], $connexion);\n while($creationTable = mysql_fetch_array($listeCreationsTables))\n {\n $creations .= $creationTable[1].\";\\n\\n\";\n }\n }\n // si l'utilisateur a demandé les données ou la totale\n if($mode > 1)\n {\n $donnees = mysql_query(\"SELECT * FROM \".$table[0]);\n\t $numResults = mysql_num_rows($donnees); \n\t // Empeche les erreurs si la table est vide \n\t if($numResults != 0)\n {\n\t $compteur = 0;\n\t $insertions .= \"-- -----------------------------\\n\";\n\t $insertions .= \"-- insertions dans la table \".$table[0].\"\\n\";\n\t $insertions .= \"-- -----------------------------\\n\";\n\t $insertions .= \"INSERT INTO \".$table[0].\" VALUES\";\n\t while($nuplet = mysql_fetch_array($donnees))\n\t {\n\t $insertions .= \"(\";\n\t for($i=0; $i < mysql_num_fields($donnees); $i++)\n\t {\n\t if($i != 0)\n\t $insertions .= \", \";\n\t if(mysql_field_type($donnees, $i) == \"string\" || mysql_field_type($donnees, $i) == \"blob\")\n\t $insertions .= \"'\";\n\t $insertions .= addslashes($nuplet[$i]);\n\t if(mysql_field_type($donnees, $i) == \"string\" || mysql_field_type($donnees, $i) == \"blob\")\n\t $insertions .= \"'\";\n\t }\n\t\t\t\t\t\t$compteur++;\n\t\t\t\t\t\tif($compteur != $numResults)\n\t\t\t\t\t\t\t$insertions .= \"),\\n\";\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$insertions .= \");\\n\";\n\t }\n\t }\n }\n }\n \n mysql_close($connexion);\n \n $fichierDump = fopen(\"../bdd/db-backup.sql\", \"wb\");\n fwrite($fichierDump, $entete);\n fwrite($fichierDump, $creations);\n fwrite($fichierDump, $insertions);\n fclose($fichierDump);\n\tif(!is_dir('E:\\BackUp'))\n\t\tmkdir('E:\\BackUp');\n\t$fichierDump = fopen(\"E:/BackUp/db-backup.sql\", \"wb\");\n fwrite($fichierDump, $entete);\n fwrite($fichierDump, $creations);\n fwrite($fichierDump, $insertions);\n fclose($fichierDump);\n\n}", "public function putdb_PostgreSQLDatabase($conf, $sspak, $dropdb) {\n\t\t$usernameArg = escapeshellarg(\"--username=\".$conf['db_username']);\n\t\t$passwordArg = \"PGPASSWORD=\".escapeshellarg($conf['db_password']);\n\t\t$databaseArg = escapeshellarg($conf['db_database']);\n\t\t$hostArg = escapeshellarg(\"--host=\".$conf['db_server']);\n\n\t\t// Create database if needed\n\t\t$result = $this->exec(\"echo \\\"select count(*) from pg_catalog.pg_database where datname = $databaseArg\\\" | $passwordArg psql $usernameArg $hostArg $databaseArg -qt\");\n\t\tif(trim($result['output']) == '0') {\n\t\t\t$this->exec(\"$passwordArg createdb $usernameArg $hostArg $databaseArg\");\n\t\t}\n\n\t\t$stream = $sspak->readStreamForFile('database.sql.gz');\n\t\treturn $this->exec(\"gunzip -c | $passwordArg psql $usernameArg $hostArg $databaseArg\", array('inputStream' => $stream));\n\t\tfclose($stream);\n\t}", "public function backup()\n {\n $filename = 'dbbackup_' . date(\"dmY\") . '.sql';\n $filess = __DIR__ . '/../../backup/' . $filename;\n\n $tables = array();\n $this->query(\"SET NAMES 'utf8'\");\n $tables = $this->query('SHOW TABLES');\n //Missatges::debugVar($tables);\n // Cycle through each provided table\n // Generate the filename for the sql file\n\n $handle = fopen($filess, 'w+');\n foreach ($tables as $t) {\n $table = $t['Tables_in_' . config::DB['name']];\n\n $result = $this->query('SELECT * FROM ' . $table);\n\n // First part of the output – remove the table\n $return = 'DROP TABLE IF EXISTS ' . $table . ';';\n fwrite($handle, $return);\n // Second part of the output – create table\n $row2 = $this->query('SHOW CREATE TABLE ' . $table);\n $ssql_create = $row2[0]['Create Table'];\n //Missatges::debugVar($ssql_create);\n\n $return = \"\\n\\n\" . $ssql_create . \";\\n\\n\";\n fwrite($handle, $return);\n\n //si no hi ha columnes botam a la seguent taula\n if (count($result) == 0) {\n break;\n }\n $num_fields = count($result[0]);\n\n // Third part of the output – insert values into new table\n foreach ($result as $row) {\n //Missatges::debugVar($row);\n $return = 'INSERT INTO ' . $table . ' VALUES(';\n fwrite($handle, $return);\n $j = 0;\n foreach ($row as $field) {\n $return = '';\n $field = addslashes($field);\n $field = preg_replace(\"#\\n#\", \"\\\\n\", $field);\n if (isset ($field)) {\n $return .= '\"' . $field . '\"';\n } else {\n $return .= '\"\"';\n }\n if ($j < ($num_fields - 1)) {\n $return .= ',';\n }\n fwrite($handle, $return);\n $j++;\n }\n fwrite($handle, \");\\n\");\n }\n fwrite($handle, $return);\n fwrite($handle, \"\\n\\n\\n\");\n }\n\n // Save the sql file\n fclose($handle);\n\n // Print the message\n return $filename;\n }", "public function backup_db()\n {\n $this->load->dbutil();\n\n // Backup your entire database and assign it to a variable\n $backup = $this->dbutil->backup();\n\n // Load the file helper and write the file to your server\n $this->load->helper('file');\n write_file('database/backup/', $backup);\n\n // Load the download helper and send the file to your desktop\n $this->load->helper('download');\n force_download('kampungjawa.sql', $backup);\n }", "public function dbDump($opt){\n\t\n\t$file = USER.'/config/config.php';\n\t\n\tif(!file_exists($file)) return false;\n\t\n\tinclude($file);\n\n\t$dst = ($opt['file'] != '') ? $opt['file'] : DUMPDIR.'/export-'.time().'.sql';\n\n\t$cmd = DUMPBIN.\" \".\n\t\t\t'--host='.\t\t$config['db']['host'].' '.\n\t\t\t'--user='.\t\t$config['db']['login'].' '.\n\t\t\t'--password='.\t$config['db']['password'].' '.\n\t\t\t'--comments=0 '.\n\t\t\t\n\t\t\t$config['db']['database'].' > '.$dst;\n\n\tsystem($cmd, $r);\n\n\treturn ($r == 0) ? true : false;\n}", "static public function dumpDB($vars, $print=true);", "private function importSql($dumpfile) {\n\t$dbname = $this->getConfig('local', 'db_name');\n\t$dbuser = $this->getConfig('local', 'db_uname');\n\t$pass = $this->getConfig('local', 'db_pass');\n\n\texec(\"mysql -u $dbuser -p{$pass} $dbname < $dumpfile\"); //yep it's super sketch\n\t\n\t$additional = $this->getConfig('misc', 'additional_sql');\n\tif ($additional) {\n $db = new PDO(\"mysql:host=localhost;dbname=$dbname\", $dbuser, $pass);\n $db->prepare($additional)->execute();\n\t}\n }", "function backupTables() {\n\tglobal $ax, $calID, $set, $lcV;\n\t\n\techo \"<fieldset><legend>{$ax['mdb_backup']}</legend>\\n\";\n\t//get table names\n\t$tables = getTables();\n\tif (empty($tables)) {\n\t\techo \"{$ax['mdb_noshow_tables']}\\n\";\n\t\t$result = false;\n\t} else {\n\t\t$sqlFile = backupDatabase($tables,true); //create backup file\n\t\t//save .sql dump file\n\t\t$fName = \"./files/{$calID}-dump-\".date('Ymd-His').'.sql';\n\t\techo \"<br>{$ax['mdb_file_name']} <strong>{$fName}</strong><br>\\n\";\n\t\tif (file_put_contents($fName, $sqlFile) !== false) {\n\t\t\techo \"{$ax['mdb_file_saved']}<br>\\n\";\n\t\t\t$result = basename($fName);\n\t\t} else {\n\t\t\techo \"<br><br><strong>{$ax['mdb_write_error']}</strong><br>\\n\";\n\t\t\t$result = false;\n\t\t}\n\t}\n\techo \"</fieldset>\\n\";\n\treturn $result;\n}", "public function exportThemeSql() {\n $ignore_insert_table = array(\n _DB_PREFIX_ . 'connections', _DB_PREFIX_ . 'connections_page', _DB_PREFIX_ . 'connections_source',\n _DB_PREFIX_ . 'guest', _DB_PREFIX_ . 'statssearch',\n _DB_PREFIX_ . 'sekeyword', _DB_PREFIX_ . 'favorite_product',\n _DB_PREFIX_ . 'pagenotfound', _DB_PREFIX_ . 'shop_url',\n _DB_PREFIX_ . 'employee', _DB_PREFIX_ . 'employee_shop',\n _DB_PREFIX_ . 'contact', _DB_PREFIX_ . 'contact_lang',\n _DB_PREFIX_ . 'contact', _DB_PREFIX_ . 'contact_shop'\n );\n $installFolder = _PS_MODULE_DIR_ . \"leotempcp/install\";\n if (!is_dir($installFolder))\n mkdir($installFolder, 0755);\n $backupfile = $installFolder . \"/theme.sql\";\n \n $fp = @fopen($backupfile, 'w');\n if ($fp === false) {\n $this->_html[\"error\"] = \"Error when export DbStruct! Can not write file in leotemcp/install\";\n return false;\n }\n fwrite($fp, 'SET NAMES \\'utf8\\';' . \"\\n\\n\");\n // Find all tables\n $tables = Db::getInstance()->executeS('SHOW TABLES');\n $found = 0;\n $sql = '';\n foreach ($tables as $table) {\n $table = current($table);\n\n // Skip tables which do not start with _DB_PREFIX_\n if (Tools::strlen($table) < Tools::strlen(_DB_PREFIX_) || strncmp($table, _DB_PREFIX_, Tools::strlen(_DB_PREFIX_)) != 0)\n continue;\n\n // Export the table schema\n $schema = Db::getInstance()->executeS('SHOW CREATE TABLE `' . $table . '`');\n\n if (count($schema) != 1 || !isset($schema[0]['Table']) || !isset($schema[0]['Create Table'])) {\n fclose($fp);\n //$this->delete();\n //echo Tools::displayError('An error occurred while backing up. Unable to obtain the schema of').' \"'.$table;\n $this->_html[\"error\"] = \"An error occurred while backing up. Unable to obtain the schema of \".$table;\n return false;\n }\n\n if (!in_array($schema[0]['Table'], $ignore_insert_table)) {\n $sql .= \"\\n\" . 'TRUNCATE TABLE ' . str_replace(\"`\"._DB_PREFIX_ , \"`PREFIX_\", \"`\".$schema[0]['Table']) . '`;' . \"\\n\";\n\n $data = Db::getInstance()->query('SELECT * FROM `' . $schema[0]['Table'] . '`', false);\n $sizeof = DB::getInstance()->NumRows();\n $lines = explode(\"\\n\", $schema[0]['Create Table']);\n\n if ($data && $sizeof > 0) {\n // Export the table data\n $sql .= 'INSERT INTO ' . str_replace('`'._DB_PREFIX_, '`PREFIX_', '`'.$schema[0]['Table']) . \"` VALUES\\n\";\n //fwrite($fp, 'INSERT INTO `'.$schema[0]['Table'].\"` VALUES\\n\");\n $i = 1;\n while ($row = DB::getInstance()->nextRow($data)) {\n $s = '(';\n\n foreach ($row as $field => $value) {\n //special table\n if ($schema[0]['Table'] == _DB_PREFIX_ . \"leowidgets\" && $field == \"params\") {\n $configs = Tools::jsonDecode(base64_decode($value) ,true);\n \n foreach ($configs as $kconfig => $vconfig) {\n if (strpos($kconfig, \"htmlcontent\") !== false || strpos($kconfig, \"content\") !== false || strpos($kconfig, \"information\") !== false || strpos($kconfig, \"raw_html\") !== false) {\n $vconfig = str_replace('\"' . __PS_BASE_URI__ . 'modules/', '\"modules/', $vconfig);\n $configs[$kconfig] = str_replace('\"' . __PS_BASE_URI__ . 'themes/', '\"themes/', $vconfig);\n }\n \n }\n $value = base64_encode(Tools::jsonEncode($configs));\n }\n\n $tmp = \"'\" . pSQL($value, true) . \"',\";\n if ($tmp != \"'',\")\n $s .= $tmp;\n else {\n foreach ($lines as $line)\n if (strpos($line, '`' . $field . '`') !== false) {\n if (preg_match('/(.*NOT NULL.*)/Ui', $line))\n $s .= \"'',\";\n else\n $s .= 'NULL,';\n break;\n }\n }\n }\n $s = rtrim($s, ',');\n\n if (($i % 200 == 0 || ($schema[0]['Table'] == _DB_PREFIX_ . \"leowidgets\" && $i % 20 == 0)) && $i < $sizeof)\n $s .= \");\\nINSERT INTO \" . str_replace('`'._DB_PREFIX_, '`PREFIX_', '`'.$schema[0]['Table']) . \"` VALUES\\n\";\n elseif ($i < $sizeof)\n $s .= \"),\\n\";\n else\n $s .= \");\\n\";\n $sql .= $s;\n \n //fwrite($fp, $s);\n ++$i;\n }\n }\n }\n $found++;\n }\n //table PREFIX_condition\n $sql = str_replace(\" \"._DB_PREFIX_, \" PREFIX_\", $sql);\n //img link\n //$sql = str_replace('src=\\\"' . __PS_BASE_URI__ . 'modules/', 'src=\\\"modules/', $sql);\n \n fwrite($fp, $sql);\n fclose($fp);\n if ($found == 0) {\n //echo Tools::displayError('No valid tables were found to backup.' );\n $this->_html[\"error\"] = \"No valid tables were found to backup.\";\n return false;\n }\n\n $this->_html[\"confirm\"][] .= 'Create theme.sql was successful';\n }", "public function exportDBStruct() {\n $ignore_insert_table = array(\n _DB_PREFIX_ . 'sekeyword', _DB_PREFIX_ . 'statssearch', _DB_PREFIX_ . 'favorite_product',\n _DB_PREFIX_ . 'pagenotfound');\n //copy + export to \n $installFolder = _PS_MODULE_DIR_ . \"leotempcp/install\";\n if (!is_dir($installFolder))\n mkdir($installFolder, 0755);\n $backupfile = $installFolder . \"/db_structure.sql\";\n\n $fp = @fopen($backupfile, 'w');\n if ($fp === false) {\n $this->_html[\"error\"] = \"Error when export DbStruct! Can not write file in leotemcp/install\";\n return false;\n }\n fwrite($fp, 'SET NAMES \\'utf8\\';' . \"\\n\\n\");\n // Find all tables\n $tables = Db::getInstance()->executeS('SHOW TABLES');\n //$found = 0;\n $data = \"\";\n \n foreach ($tables as $table) {\n $table = current($table);\n\n // Skip tables which do not start with _DB_PREFIX_\n if (Tools::strlen($table) < Tools::strlen(_DB_PREFIX_) || strncmp($table, _DB_PREFIX_, Tools::strlen(_DB_PREFIX_)) != 0)\n continue;\n // Export the table schema\n $schema = Db::getInstance()->executeS('SHOW CREATE TABLE `' . $table . '`');\n if (in_array($schema[0]['Table'], $ignore_insert_table)) {\n continue;\n }\n \n $data .= $schema[0]['Create Table'] . \";\\n\\n\";\n if (count($schema) != 1 || !isset($schema[0]['Table']) || !isset($schema[0]['Create Table'])) {\n fclose($fp);\n $this->_html[\"error\"] = \"An error occurred while backing up. Unable to obtain the schema of \".$table;\n return false;\n }\n }\n \n $data = str_replace(\"CREATE TABLE `\" . _DB_PREFIX_, \"CREATE TABLE `PREFIX_\", $data);\n //$tableName = str_replace(_DB_PREFIX_, \"_DB_PREFIX_\", $table);\n fwrite($fp, $data);\n fclose($fp);\n $this->_html[\"confirm\"][] .= 'Create datastruct was successful';\n }", "public function back_up2()\n\t{\n\t\t //ENTER THE RELEVANT INFO BELOW\n $mysqlDatabaseName ='perumahan';\n $mysqlUserName ='root';\n $mysqlPassword ='';\n $mysqlHostName ='localhost';\n $mysqlExportPath ='perumahanex.sql';\n\n //DO NOT EDIT BELOW THIS LINE\n //Export the database and output the status to the page\n $command='mysqldump --opt -h' .$mysqlHostName .' -u' .$mysqlUserName .' -p' .$mysqlPassword .' ' .$mysqlDatabaseName .' > ~/' .$mysqlExportPath;\n exec($command);\n\n\t\t\n\t}", "function dump($table = '', $folder = NULL)\n\t{\n\t\tif($folder !== NULL)\n\t\t\t$folder = ROOT.'lf/backup/';\n\t\t\t\n\t\tshell_exec('/usr/bin/mysqldump -u\"'.$this->conf['user'].'\" -p\"'.$this->conf['pass'].'\" '.$this->conf['name'].' '.$table.' > '.$folder.$this->conf['name'].'.sql');\n\t}", "public static function dumpDatabase($vchamilo, $outputfilerad)\n {\n // Separating host and port, if sticked.\n if (strstr($vchamilo->db_host, ':') !== false) {\n list($host, $port) = explode(':', $vchamilo->db_host);\n } else {\n $host = $vchamilo->db_host;\n }\n\n // By default, empty password.\n $pass = '';\n $pgm = null;\n\n if (empty($port)) {\n $port = 3306;\n }\n\n // Password.\n if (!empty($vchamilo->db_password)) {\n $pass = \"-p\".escapeshellarg($vchamilo->db_password);\n }\n\n // Making the commands for each database.\n $cmds = array();\n //if ($CFG->ostype == 'WINDOWS') {\n if (false) {\n $cmd_main = \"-h{$host} -P{$port} -u{$vchamilo->db_user} {$pass} {$vchamilo->main_database}\";\n $cmds[] = $cmd_main . ' > ' . $outputfilerad;\n } else {\n $cmd_main = \"-h{$host} -P{$port} -u{$vchamilo->db_user} {$pass} {$vchamilo->main_database}\";\n $cmds[] = $cmd_main . ' > ' . escapeshellarg($outputfilerad);\n }\n\n $mysqldumpcmd = self::getConfig('vchamilo', 'cmd_mysqldump', true);\n\n $pgm = !empty($mysqldumpcmd) ? stripslashes($mysqldumpcmd) : false;\n\n if (!$pgm) {\n $message = \"Database dump command not available check here: \";\n $url = api_get_path(WEB_CODE_PATH).'admin/configure_plugin.php?name=vchamilo';\n $message .= Display::url($url, $url);\n Display::addFlash(Display::return_message($message));\n\n return false;\n } else {\n $phppgm = str_replace(\"\\\\\", '/', $pgm);\n $phppgm = str_replace(\"\\\"\", '', $phppgm);\n $pgm = str_replace('/', DIRECTORY_SEPARATOR, $pgm);\n\n if (!is_executable($phppgm)) {\n $message = \"Database dump command $phppgm does not match any executable\";\n Display::addFlash(Display::return_message($message));\n\n return false;\n }\n\n // executing all commands\n foreach ($cmds as $cmd) {\n\n // Final command.\n $cmd = $pgm.' '.$cmd;\n // Prints log messages in the page and in 'cmd.log'.\n /*if ($LOG = fopen(dirname($outputfilerad).'/cmd.log', 'a')){\n fwrite($LOG, $cmd.\"\\n\");\n }*/\n\n // Executes the SQL command.\n exec($cmd, $execoutput, $returnvalue);\n\n /*if ($LOG){\n foreach($execoutput as $execline) fwrite($LOG, $execline.\"\\n\");\n fwrite($LOG, $returnvalue.\"\\n\");\n fclose($LOG);\n }*/\n }\n }\n\n // End with success.\n return 1;\n }", "function dumpDatabase($database) {\r\n\r\n\t\t// Set content-type and charset\r\n\t\theader ('Content-Type: text/html; charset=iso-8859-1');\r\n\r\n\t\t// Connect to database\r\n\t\t$db = @mysql_select_db($database);\r\n\r\n\t\tif (!empty($db)) {\r\n\r\n\t\t\t// Get all table names from database\r\n\t\t\t$c = 0;\r\n\t\t\t$result = mysql_list_tables($database);\r\n\t\t\tfor($x = 0; $x < mysql_num_rows($result); $x++) {\r\n\t\t\t\t$table = mysql_tablename($result, $x);\r\n\t\t\t\tif (!empty($table)) {\r\n\t\t\t\t\t$arr_tables[$c] = mysql_tablename($result, $x);\r\n\t\t\t\t\t$c++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// List tables\r\n\t\t\t$dump = '';\r\n\t\t\tfor ($y = 0; $y < count($arr_tables); $y++){\r\n\r\n\t\t\t\t// DB Table name\r\n\t\t\t\t$table = $arr_tables[$y];\r\n\r\n\t\t\t\t// Structure Header\r\n\t\t\t\t$structure .= \"-- \\n\";\r\n\t\t\t\t$structure .= \"-- Table structure for table `{$table}` \\n\";\r\n\t\t\t\t$structure .= \"-- \\n\\n\";\r\n\r\n\t\t\t\t// Dump Structure\r\n\t\t\t\t$structure .= \"DROP TABLE IF EXISTS `{$table}`; \\n\";\r\n\t\t\t\t$structure .= \"CREATE TABLE `{$table}` (\\n\";\r\n\t\t\t\t$result = mysql_db_query($database, \"SHOW FIELDS FROM `{$table}`\");\r\n\t\t\t\twhile($row = mysql_fetch_object($result)) {\r\n\r\n\t\t\t\t\t$structure .= \" `{$row->Field}` {$row->Type}\";\r\n\t\t\t\t\t$structure .= (!empty($row->Default)) ? \" DEFAULT '{$row->Default}'\" : false;\r\n\t\t\t\t\t$structure .= ($row->Null != \"YES\") ? \" NOT NULL\" : false;\r\n\t\t\t\t\t$structure .= (!empty($row->Extra)) ? \" {$row->Extra}\" : false;\r\n\t\t\t\t\t$structure .= \",\\n\";\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$structure = ereg_replace(\",\\n$\", \"\", $structure);\r\n\r\n\t\t\t\t// Save all Column Indexes in array\r\n\t\t\t\tunset($index);\r\n\t\t\t\t$result = mysql_db_query($database, \"SHOW KEYS FROM `{$table}`\");\r\n\t\t\t\twhile($row = mysql_fetch_object($result)) {\r\n\r\n\t\t\t\t\tif (($row->Key_name == 'PRIMARY') AND ($row->Index_type == 'BTREE')) {\r\n\t\t\t\t\t\t$index['PRIMARY'][$row->Key_name] = $row->Column_name;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (($row->Key_name != 'PRIMARY') AND ($row->Non_unique == '0') AND ($row->Index_type == 'BTREE')) {\r\n\t\t\t\t\t\t$index['UNIQUE'][$row->Key_name] = $row->Column_name;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (($row->Key_name != 'PRIMARY') AND ($row->Non_unique == '1') AND ($row->Index_type == 'BTREE')) {\r\n\t\t\t\t\t\t$index['INDEX'][$row->Key_name] = $row->Column_name;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (($row->Key_name != 'PRIMARY') AND ($row->Non_unique == '1') AND ($row->Index_type == 'FULLTEXT')) {\r\n\t\t\t\t\t\t$index['FULLTEXT'][$row->Key_name] = $row->Column_name;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Return all Column Indexes of array\r\n\t\t\t\tif (is_array($index)) {\r\n\t\t\t\t\tforeach ($index as $xy => $columns) {\r\n\r\n\t\t\t\t\t\t$structure .= \",\\n\";\r\n\r\n\t\t\t\t\t\t$c = 0;\r\n\t\t\t\t\t\tforeach ($columns as $column_key => $column_name) {\r\n\r\n\t\t\t\t\t\t\t$c++;\r\n\r\n\t\t\t\t\t\t\t$structure .= ($xy == \"PRIMARY\") ? \" PRIMARY KEY (`{$column_name}`)\" : false;\r\n\t\t\t\t\t\t\t$structure .= ($xy == \"UNIQUE\") ? \" UNIQUE KEY `{$column_key}` (`{$column_name}`)\" : false;\r\n\t\t\t\t\t\t\t$structure .= ($xy == \"INDEX\") ? \" KEY `{$column_key}` (`{$column_name}`)\" : false;\r\n\t\t\t\t\t\t\t$structure .= ($xy == \"FULLTEXT\") ? \" FULLTEXT `{$column_key}` (`{$column_name}`)\" : false;\r\n\r\n\t\t\t\t\t\t\t$structure .= ($c < (count($index[$xy]))) ? \",\\n\" : false;\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$structure .= \"\\n);\\n\\n\";\r\n\r\n\t\t\t\t// Header\r\n\t\t\t\t$structure .= \"-- \\n\";\r\n\t\t\t\t$structure .= \"-- Dumping data for table `$table` \\n\";\r\n\t\t\t\t$structure .= \"-- \\n\\n\";\r\n\r\n\t\t\t\t// Dump data\r\n\t\t\t\tunset($data);\r\n\t\t\t\t$result = mysql_query(\"SELECT * FROM `$table`\");\r\n\t\t\t\t$num_rows = mysql_num_rows($result);\r\n\t\t\t\t$num_fields = mysql_num_fields($result);\r\n\r\n\t\t\t\tfor ($i = 0; $i < $num_rows; $i++) {\r\n\r\n\t\t\t\t\t$row = mysql_fetch_object($result);\r\n\t\t\t\t\t$data .= \"INSERT INTO `$table` (\";\r\n\r\n\t\t\t\t\t// Field names\r\n\t\t\t\t\tfor ($x = 0; $x < $num_fields; $x++) {\r\n\r\n\t\t\t\t\t\t$field_name = mysql_field_name($result, $x);\r\n\r\n\t\t\t\t\t\t$data .= \"`{$field_name}`\";\r\n\t\t\t\t\t\t$data .= ($x < ($num_fields - 1)) ? \", \" : false;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$data .= \") VALUES (\";\r\n\r\n\t\t\t\t\t// Values\r\n\t\t\t\t\tfor ($x = 0; $x < $num_fields; $x++) {\r\n\t\t\t\t\t\t$field_name = mysql_field_name($result, $x);\r\n\r\n\t\t\t\t\t\t$data .= \"'\" . str_replace('\\\"', '\"', mysql_escape_string($row->$field_name)) . \"'\";\r\n\t\t\t\t\t\t$data .= ($x < ($num_fields - 1)) ? \", \" : false;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$data.= \");\\n\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$data.= \"\\n\";\r\n\r\n\t\t\t\t$dump .= $structure . $data;\r\n\t\t\t\t$dump .= \"-- --------------------------------------------------------\\n\\n\";\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn $dump;\r\n\r\n\t\t}\r\n\r\n\t}", "private function backup_table_bindump($potsql, $table_name) {\n\n\t\t$microtime = microtime(true);\n\n\t\tglobal $updraftplus, $wpdb;\n\n\t\t// Deal with Windows/old MySQL setups with erroneous table prefixes differing in case\n\t\t// Can't get binary mysqldump to make this transformation\n\t\t// $dump_as_table = ($this->duplicate_tables_exist == false && stripos($table, $this->table_prefix) === 0 && strpos($table, $this->table_prefix) !== 0) ? $this->table_prefix.substr($table, strlen($this->table_prefix)) : $table;\n\n\t\t$pfile = md5(time().rand()).'.tmp';\n\t\tfile_put_contents($this->updraft_dir.'/'.$pfile, \"[mysqldump]\\npassword=\\\"\".addslashes($this->dbinfo['pass']).\"\\\"\\n\");\n\n\t\t$where_array = apply_filters('updraftplus_backup_table_sql_where', array(), $table_name, $this);\n\t\t$where = '';\n\t\t\n\t\tif (!empty($where_array) && is_array($where_array)) {\n\t\t\t// N.B. Don't add a WHERE prefix here; most versions of mysqldump silently strip it out, but one was encountered that didn't.\n\t\t\t$first_loop = true;\n\t\t\tforeach ($where_array as $condition) {\n\t\t\t\tif (!$first_loop) $where .= \" AND \";\n\t\t\t\t$where .= $condition;\n\t\t\t\t$first_loop = false;\n\t\t\t}\n\t\t}\n\n\t\t// Note: escapeshellarg() adds quotes around the string\n\t\tif ($where) $where = \"--where=\".escapeshellarg($where);\n\n\t\tif (strtolower(substr(PHP_OS, 0, 3)) == 'win') {\n\t\t\t$exec = \"cd \".escapeshellarg(str_replace('/', '\\\\', $this->updraft_dir)).\" & \";\n\t\t} else {\n\t\t\t$exec = \"cd \".escapeshellarg($this->updraft_dir).\"; \";\n\t\t}\n\n\t\t// Allow --max_allowed_packet to be configured via constant. Experience has shown some customers with complex CMS or pagebuilder setups can have extrememly large postmeta entries.\n\t\t$msqld_max_allowed_packet = (defined('UPDRAFTPLUS_MYSQLDUMP_MAX_ALLOWED_PACKET') && (is_int(UPDRAFTPLUS_MYSQLDUMP_MAX_ALLOWED_PACKET) || is_string(UPDRAFTPLUS_MYSQLDUMP_MAX_ALLOWED_PACKET))) ? UPDRAFTPLUS_MYSQLDUMP_MAX_ALLOWED_PACKET : '1M';\n\n\t\t$exec .= \"$potsql --defaults-file=$pfile $where --max_allowed_packet=$msqld_max_allowed_packet --quote-names --add-drop-table\";\n\t\t\n\t\tstatic $mysql_version = null;\n\t\tif (null === $mysql_version) {\n\t\t\t$mysql_version = $wpdb->get_var('SELECT VERSION()');\n\t\t\tif ('' == $mysql_version) $mysql_version = $wpdb->db_version();\n\t\t}\n\t\tif ($mysql_version && version_compare($mysql_version, '5.1', '>=')) {\n\t\t\t$exec .= \" --no-tablespaces\";\n\t\t}\n\t\t\n\t\t$exec .= \" --skip-comments --skip-set-charset --allow-keywords --dump-date --extended-insert --user=\".escapeshellarg($this->dbinfo['user']).\" --host=\".escapeshellarg($this->dbinfo['host']).\" \".$this->dbinfo['name'].\" \".escapeshellarg($table_name);\n\t\t\n\t\t$ret = false;\n\t\t$any_output = false;\n\t\t$writes = 0;\n\t\t$write_bytes = 0;\n\t\t$handle = function_exists('popen') ? popen($exec, 'r') : false;\n\t\tif ($handle) {\n\t\t\twhile (!feof($handle)) {\n\t\t\t\t$w = fgets($handle, 1048576);\n\t\t\t\tif (is_string($w) && $w) {\n\t\t\t\t\t$this->stow($w);\n\t\t\t\t\t$writes++;\n\t\t\t\t\t$write_bytes += strlen($w);\n\t\t\t\t\t$any_output = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$ret = pclose($handle);\n\t\t\t// The manual page for pclose() claims that only -1 indicates an error, but this is untrue\n\t\t\tif (0 != $ret) {\n\t\t\t\t$updraftplus->log(\"Binary mysqldump: error (code: $ret)\");\n\t\t\t\t// Keep counter of failures? Change value of binsqldump?\n\t\t\t\t$ret = false;\n\t\t\t} else {\n\t\t\t\tif ($any_output) {\n\t\t\t\t\t$updraftplus->log(\"Table $table_name: binary mysqldump finished (writes: $writes, bytes $write_bytes, return code $ret) in \".sprintf(\"%.02f\", max(microtime(true)-$microtime, 0.00001)).\" seconds\");\n\t\t\t\t\t$ret = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$updraftplus->log(\"Binary mysqldump error: bindump popen failed\");\n\t\t}\n\n\t\t// Clean temporary files\n\t\t@unlink($this->updraft_dir.'/'.$pfile);// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged\n\n\t\treturn $ret;\n\n\t}", "public function actionExport()\r\n\t{\r\n\t\t//备份文件名\r\n\t\t$filename = Yii::app()->request->getParam('filename');\r\n\t\t//备份方法,php or shell\r\n\t\t$method = Yii::app()->request->getParam('method');\r\n\t\t//使用扩展插入\r\n\t\t$extendins = Yii::app()->request->getParam('extendins');\r\n\r\n\t\t//获取分卷编号\r\n\t\t$volume = isset($_GET['volume']) ? (intval($_GET['volume']) + 1) : 1;\r\n\t\t\t\t\t\t\t\r\n\t\tif(empty($filename) || strlen($filename) > 40){\t//文件名长度判断\r\n\t\t\tcpmessage('documents_were_incorrect_length');\r\n\t\t} else {\r\n\t\t\t$filename = preg_replace(\"/[^a-z0-9_]/i\", '',(str_replace('.', '_', $filename)));\r\n\t\t}\r\n\r\n\t\t$db = Yii::app()->db;\r\n\t\t$command=$db->createCommand('SET SQL_QUOTE_SHOW_CREATE=0');//无报错执行关闭我的创建表和列时不加引号\r\n\t\t$command->execute();\r\n\t\t//数据表名\t\t\t\r\n\t\t$tables = $db->schema->tableNames;\r\n\t\tif(empty($tables) || !is_array($tables)) {\r\n\t\t\tthrow new CHttpException(500,'Backup table wrong. Please connect administrator!');\r\n\t\t}\r\n\r\n\r\n\t\t$time = date('Y-m-d H:i:s');\r\n\t\t$idstring = '# Identify: '.base64_encode(\"$_SGLOBAL[timestamp],\".'yiicms1.0'.\",$type,$method,$volume\").\"\\n\";\r\n\t\t$setnames = \"SET NAMES 'UTF8';\\n\\n\";\r\n\r\n\t\t//备份文件路径\r\n\t\t$backupfile = dirname(Yii::app()->basePath).'/backup/'.$filename;\r\n\t\t\r\n\t\t\r\n\t\tif($method == 'multivol') {//分卷备份\r\n\t\t\tglobal $filesize;\r\n\t\t\t$sqldump = '';\r\n\t\t\t$sizelimit = intval(Yii::app()->request->getParam('sizelimit'));\r\n\t\t\t$tableid = intval(Yii::app()->request->getParam('tableid'));//表ID\r\n\t\t\t$startfrom = intval(Yii::app()->request->getParam('startfrom'));//起始位置\r\n\t\t\t$tablenum = count($tables);\r\n\t\t\t$filesize = $sizelimit * 1000;\r\n\t\t\t$complate = true;\r\n\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tfor( ; $complate && $tableid < $tablenum && strlen($sqldump) + 500 < $filesize; ++$tableid) {\r\n\r\n\t\t\t\t$sqldump .= $this->sqldumptable($tables[$tableid], $startfrom, strlen($sqldump));\r\n\r\n\t\t\t\tif($complate) {\r\n\t\t\t\t\t$startfrom = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$dumpfile = sprintf($backupfile.'-%s'.'.sql', $volume);\r\n\t\t\t!$complate && $tableid --;\r\n\t\t\tif(trim($sqldump)) {\r\n\t\t\t\t$sqldump = \"$idstring\".\r\n\t\t\t\t\"# <?exit();?>\\n\".\r\n\t\t\t\t\"# Yii CMS Multi-Volume Data Dump Vol.$volume\\n\".\r\n\t\t\t\t\"# Version: Yii CMS \".X_VER.\"\\n\".\r\n\t\t\t\t\"# Time: $time\\n\".\r\n\t\t\t\t\"# Type: $type\\n\".\r\n\t\t\t\t\"# Table Prefix: NULL\\n\".\r\n\t\t\t\t\"#\\n\".\r\n\t\t\t\t\"# Yii CMS: http://u.discuz.net\\n\".\r\n\t\t\t\t\"# Please visit our website for newest infomation about Yii CMS\\n\".\r\n\t\t\t\t\"# ---------------------------------------------------------\\n\\n\\n\".\r\n\t\t\t\t\"$setnames\".\r\n\t\t\t\t$sqldump;\r\n\r\n\t\t\t\t$fp = fopen($dumpfile, 'wb');\r\n\r\n\t\t\t\t@flock($fp, 2);\r\n\t\t\t\tif(!fwrite($fp, $sqldump)) {\r\n\t\t\t\t\tfclose($fp);\r\n\t\t\t\t\tcpmessage('failure_writes_the_document_check_file_permissions', 'admincp.php?ac=backup');\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfclose($fp);\r\n\t\t\t\t\tif($usezip == 2) {\r\n\t\t\t\t\t\t$zipfile = sprintf($backupfile.'-%s'.'.zip', $volume);\r\n\t\t\t\t\t\t$zipfile = new Zip($zipfile);\r\n\t\t\t\t\t\tif(!$zipfile->create($dumpfile, PCLZIP_OPT_REMOVE_PATH, S_ROOT.'./data/'.$backupdir)) {\r\n\t\t\t\t\t\t\tcpmessage('failure_writes_the_document_check_file_permissions', 'admincp.php?ac=backup');\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t@unlink($dumpfile);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfclose($fp);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//分卷备份跳转\t\t\t\t\t\r\n\t\t\t\t\tglobal $filesize, $startrows;\r\n\r\n\t\t\t\t\t$this->redirect(array('export','volume'=>$volume,'tableid'=>$tableid,'startfrom'=>$startrows,'sizelimit'=>$sizelimit,'method'=>$method,'filename'=>$filename));\r\n\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t//使用压缩\r\n\t\t\t\tif($usezip == 1){\r\n\t\t\t\t\t$zipfile = $backupfile.'.zip';\r\n\t\t\t\t\t$zipfile = new Zip($zipfile);\r\n\t\t\t\t\t$unlinks = '';\r\n\t\t\t\t\t$arrayzipfile = array();\r\n\t\t\t\t\tfor($i = 1; $i < $volume; ++$i){\r\n\t\t\t\t\t\t$dumpfile = sprintf($backupfile.'-%s'.'.sql', $i);\r\n\t\t\t\t\t\t$arrayzipfile[] = $dumpfile;\r\n\t\t\t\t\t\t$unlinks .= \"@unlink('$dumpfile');\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif($zipfile->create($arrayzipfile, PCLZIP_OPT_REMOVE_PATH, S_ROOT.'./data/'.$backupdir)) {\r\n\t\t\t\t\t\t@eval($unlinks);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcpmessage('complete_database_backup', 'admincp.php?ac=backup', 1, array($volume-1));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfclose(fopen(S_ROOT.'./data/'.$backupdir.'/index.htm', 'a'));\r\n\t\t\t\t\tcpmessage('successful_data_compression_and_backup_server_to', 'admincp.php?ac=backup');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//fclose(fopen(S_ROOT.'./data/'.$backupdir.'/index.htm', 'a'));\r\n\t\t\t\t\t//cpmessage('complete_database_backup', 'admincp.php?ac=backup', 1, array($volume-1));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$tablesstr = '';\r\n\t\t\tforeach($tables as $value) {\r\n\t\t\t\t$tablesstr .= $value.' ';\r\n\t\t\t}\r\n\r\n\t\t\t\r\n\t\t\t$sql = \"SHOW VARIABLES LIKE 'basedir'\";\r\n\t\t\t$command=$db->createCommand($sql);\r\n\t\t\t$query = $command->queryRow();\r\n\r\n\t\t\t$mysql_base = $query['Value'];\r\n\r\n\r\n\t\t\t$dumpfile = $datafile_root.'.sql';\r\n\r\n\t\t\t@unlink($dumpfile);\r\n\r\n\t\t\t$mysqlbin = $mysql_base == '/' ? '' : addslashes($mysql_base).'bin/';\r\n\t\t\t$version = '5.1';\r\n\t\t\t$username = $db->username;\r\n\t\t\t$password = $db->password;\r\n\t\t\t$dbport = 3306;\r\n\r\n\t\t\t$charset = $db->charset;\r\n\r\n\t\t\t$host = $db->connectionString;\r\n\t\t\tlist($dbhost, $dbname) = explode(';', $host);\r\n\t\t\t\r\n\t\t\tlist($t1, $dbhost) = explode('=', $dbhost);\r\n\t\t\tlist($t1, $dbname) = explode('=', $dbname);\r\n\r\n\r\n\t\t\t$exec = '\"'.$mysqlbin.'mysqldump\" --force --quick --default-character-set='.$charset.' '.($version > 4.1 ? '--skip-opt --create-options' : '-all').' --add-drop-table'.($extendins == 1 ? '--extended-insert' : '').''.($version > '4.1' && $sqlcompat == 'MYSQL40' ? '--compatible=mysql40' : '').' --host='.$dbhost.($dbport ? (is_numeric($dbport) ? ' --port='.$dbport : ' --sock='.$dbport) : '').' --user='.$username.' --password='.$password.' '.$dbname.' '.$tablesstr.' > '.$dumpfile;\r\n\r\n\r\n\r\n\t\t\t$mx = shell_exec($exec);\r\n\r\n\t\t\tif(file_exists($dumpfile)) {\r\n\t\t\t\tif(is_writable($dumpfile)) {\r\n\t\t\t\t\t$fp = fopen($dumpfile, 'rb+');\r\n\t\t\t\t\tfwrite($fp, $idstring.\"# <?exit();?>\\n \".$setnames.\"\\n #\");\r\n\t\t\t\t\tfclose($fp);\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcpmessage('shell_backup_failure', 'admincp.php?ac=backup');\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function EXPORT_TABLES($host,$user,$pass,$name, $tables=false, $backup_name=false, $gzipped=false){ \n\t\t\tset_time_limit(3000); \n\t\t\t$mysqli = new \\mysqli($host,$user,$pass,$name); \n\t\t\t$mysqli->select_db($name); $mysqli->query(\"SET NAMES 'utf8'\");\n\t\t\t$queryTables = $mysqli->query('SHOW TABLES');\n\t\t\twhile($row = $queryTables->fetch_row()) \n\t\t\t{ \n\t\t\t\t$target_tables[] = $row[0]; \n\t\t\t} \n\t\t\tif($tables !== false)\n\t\t\t{ \n\t\t\t\t$target_tables = array_intersect( $target_tables, $tables); \n\t\t\t} \n\t\t\t$content = \"SET SQL_MODE = \\\"NO_AUTO_VALUE_ON_ZERO\\\";\\r\\nSET time_zone = \\\"+07:00\\\";\\r\\nSET FOREIGN_KEY_CHECKS=0;\\r\\n\\r\\n\\r\\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\\r\\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\\r\\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\\r\\n/*!40101 SET NAMES utf8 */;\\r\\n--\\r\\n-- Database: `\".$name.\"`\\r\\n--\\r\\n\\r\\n\\r\\n\";\t\t\t\n\t\t\tforeach($target_tables as $table){\n\t\t\t\tif (empty($table))\n\t\t\t\t{ \n\t\t\t\t\tcontinue; \n\t\t\t\t} \n\t\t\t\t$result = $mysqli->query('SELECT * FROM `'.$table.'`'); \n\t\t\t\t$fields_amount=$result->field_count; \n\t\t\t\t$rows_num=$mysqli->affected_rows; \n\t\t\t\t$content .= \"DROP TABLE IF EXISTS `\". $table .\"`;\";\n\t\t\t\t$res = $mysqli->query('SHOW CREATE TABLE '.$table); \n\t\t\t\t$TableMLine=$res->fetch_row(); \n\t\t\t\t$content .= \"\\n\\n\".$TableMLine[1].\";\\n\\n\";\n\t\t\t\tfor ($i = 0, $st_counter = 0; $i < $fields_amount; $i++, $st_counter=0) {\n\t\t\t\t\twhile($row = $result->fetch_row()) { //when started (and every after 100 command cycle):\n\t\t\t\t\t\tif ($st_counter%100 == 0 || $st_counter == 0 ) {$content .= \"\\nINSERT INTO \".$table.\" VALUES\";}\n\t\t\t\t\t\t$content .= \"\\n(\"; for($j=0; $j<$fields_amount; $j++){ $row[$j] = str_replace(\"\\n\",\"\\\\n\", addslashes($row[$j]) ); if (isset($row[$j])){$content .= '\"'.$row[$j].'\"' ;} else{$content .= '\"\"';} if ($j<($fields_amount-1)){$content.= ',';} } $content .=\")\";\n\t\t\t\t\t\t//every after 100 command cycle [or at last line] ....p.s. but should be inserted 1 cycle eariler\n\t\t\t\t\t\tif ( (($st_counter+1)%100==0 && $st_counter!=0) || $st_counter+1==$rows_num) {$content .= \";\";} else {$content .= \",\";} $st_counter=$st_counter+1;\n\t\t\t\t\t}\n\t\t\t\t} $content .=\"\\n\\n\\n\";\n\t\t\t}\n\t\t\t// function\n\t\t\t// $content .=\"\\r\\n\\r\\nDELIMITER ;;\\r\\n\\r\\nDROP FUNCTION IF EXISTS `numberToLetter`;;\\r\\nCREATE FUNCTION `numberToLetter`(`number` DOUBLE) RETURNS varchar(2) CHARSET latin1\\r\\nDETERMINISTIC\\r\\nBEGIN\\r\\nDECLARE ltr varchar(2);\\r\\n\\r\\nIF(number <= 100 AND number > 90) THEN SET ltr = 'A+';\\r\\nELSEIF(number <= 90 AND number > 85) THEN SET ltr = 'A';\\r\\nELSEIF(number <= 85 AND number > 80) THEN SET ltr = 'A-';\\r\\nELSEIF(number <= 80 AND number > 75) THEN SET ltr = 'B+';\\r\\nELSEIF(number <= 75 AND number > 70) THEN SET ltr = 'B';\\r\\nELSEIF(number <= 70 AND number > 65) THEN SET ltr = 'B-';\\r\\nELSEIF(number <= 65 AND number > 60) THEN SET ltr = 'C+';\\r\\nELSEIF(number <= 60 AND number > 55) THEN SET ltr = 'C';\\r\\nELSEIF(number <= 55 AND number > 50) THEN SET ltr = 'C-';\\r\\nELSE SET ltr = 'D';\\r\\nEND IF;\\r\\nRETURN (ltr);\\r\\nEND;;\\r\\n\\r\\n\\r\\nDELIMITER ;\";\n\t\t\t\n\t\t\t$content .= \"\\r\\nSET FOREIGN_KEY_CHECKS=1;\\r\\n/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\\r\\n/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\\r\\n/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\";\n\t\t\t\n\t\t\t// $backup_name = $backup_name ? $backup_name : $name.\"___(\".date('H-i-s').\"_\".date('d-m-Y').\")__rand\".rand(1,11111111).\".sql\";\n\t\t\t\n\t\t\t//compress\n\t\t\tif($gzipped) \n\t\t\t{\n\t\t\t\tif (function_exists('gzencode'))\n\t\t\t\t{\n\t\t\t\t\t$content = gzencode($content, 9);\n\t\t\t\t\t$backup_name = $backup_name . '.gz';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// ob_get_clean(); header('Content-Type: application/octet-stream'); header(\"Content-Transfer-Encoding: Binary\"); header(\"Content-disposition: attachment; filename=\\\"\".$backup_name.\"\\\"\");\n\t\t\t// echo $content;\n\t\t\t// exit;\n\t\t\t\n\t\t\treturn $content;\n\t\t}", "function backup ($tabledata, $filename=\"\")\n {\n $fileout = \"\";\n foreach ($tabledata as $key => $data)\n {\n $sql = \"select {$data[\"fields\"]} from $key\";\n \n if ($data[\"where\"])\n {\n $sql .= \" where \".$data[\"where\"];\n } \n \n if ($this->debug) echo $this->debugmsg ($sql);\n \n $qry = $this->query ($sql);\n \n \n $fields = $this->field_names ($qry); \n while ($row = $this->fetch_object($qry))\n {\n \n $fileline = \"insert into $key ({$fields[\"fieldlist\"]}) values (!0!\";\n foreach ($fields[\"fieldinfo\"] as $id => $value)\n {\n if ($this->debug)\n {\n echo $this->debugmsg ($this->pre_r($value)); \n } \n if ($value[\"type\"] == \"INTEGER\")\n {\n $fileline .= \",\".$row->$value[\"name\"]; \n }\n else\n if ($value[\"type\"] == \"DATE\")\n {\n $fileline .= \",'\".$this->tran_date($row->$value[\"name\"], \"m/d/Y\").\"'\"; \n }\n else \n if ($value[\"type\"] == \"TIMESTAMP\")\n {\n $fileline .= \",'\".$this->tran_date($row->$value[\"name\"], \"m/d/Y h:i:s\").\"'\"; \n } \n else\n {\n $fileline .= \",'\".$row->$value[\"name\"].\"'\"; \n } \n \n } \n $fileline .=\");\\n\";\n $fileline = str_replace (\"!0!,\", \"\", $fileline);\n if ($this->debug)\n {\n echo $this->debugmsg ($this->pre_r($fileline)); \n } \n \n $fileout .= $fileline; \n \n } \n } \n /* Output the gzip file */\n if ($this->debug)\n {\n echo $this->debugmsg ($this->pre_r($fileout)); \n } \n if (function_exists (\"gzopen\"))\n {\n $rand = rand(1000000, 99999999); \n \n if ($filename == \"\") $filename = $this->tmppath.\"$rand.gz\";\n $zp = gzopen($filename, \"w9\");\n // write string to file\n gzwrite($zp, $fileout);\n // close file\n gzclose($zp);\n if ($this->debug)\n {\n\t echo $this->debugmsg (\"Created backup file $filename\", \"blue\"); \n } \n } \n else\n {\n $filename = \"none\"; \n if ($this->debug)\n {\n \t echo $this->debugmsg (\"Please make sure you have enable zlib module in PHP\", \"red\"); \n } \n } \n return $filename; \n }" ]
[ "0.6795184", "0.67000467", "0.66891867", "0.64917797", "0.6457278", "0.64027834", "0.63279104", "0.62190384", "0.6205626", "0.61767685", "0.6129574", "0.6087037", "0.5972342", "0.5971179", "0.59397626", "0.5930003", "0.59176767", "0.59100634", "0.586811", "0.58625853", "0.5786067", "0.5774382", "0.5772289", "0.5768651", "0.5739758", "0.57283866", "0.57233286", "0.57219476", "0.570932", "0.5638497" ]
0.7180923
0
Extracts and processes images from ZIParchive.
protected function extractAndProcessImages($zipName, $process) { $images = []; $zip = new \ZipArchive; $result = $zip->open($zipName); if ($result === true) { for ($i = 0; $i < $zip->numFiles; $i++) { $fileName = $zip->getNameIndex($i); if (Image::isImagePath($fileName)) { $fileNames[] = $fileName; } } if (!empty($fileNames)) { sort($fileNames); foreach ($fileNames as $fileName) { $data = $zip->getFromName($fileName); $imgType = Image::getImageTypeFromPath($fileName); $image = new Image($data, $imgType); $process($image, $fileName); } } $zip->close(); } return $images; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function extract_from_archive($type) {\n if (($type === \"ar-zip\") && ($this->setup->get('HAS_PHP_ZIP'))) {\n $za = new ZipArchive();\n $err = $za->open($this->source_path, ZipArchive::RDONLY);\n $extracted = false;\n if ($err === true) { // No Error\n for($i = 0; $i < $za->numFiles; $i++) {\n $entry = $za->getNameIndex($i);\n if (substr($entry, -1, 1) == '/') {\n // is directory\n continue;\n }\n // Deduce type from file extension\n $stat = $za->statIndex($i);\n $label = $stat['name'];\n $tmp = explode(\".\", $label);\n $ext = end($tmp);\n if (!empty($ext)\n && array_search($ext, self::IMG_EXT) !== false) {\n $extracted = fopen(\n \"php://temp/maxmemory:\". 2 * 1024 * 1024, 'r+');\n fwrite($extracted, $za->getFromIndex($i));\n break;\n }\n }\n $za->close();\n return $extracted;\n } else if ($err === ZipArchive::ER_NOZIP) {\n throw new WrongType(\"Not a zip file\", $err);\n } else {\n // Despite these errors, we can probably try again later.\n throw new Exception(\"Unhandled Zip error code: $err\", 5);\n }\n }\n if (($type === \"ar-rar\") && ($this->setup->get('HAS_PHP_RAR'))) {\n $rar = RarArchive::open($this->source_path);\n if (!$rar) {\n /* Give up entirely, we won't detect file type.\n This module does not detect if the type is incorrect. */\n throw new UnhandledArchive(\"Error opening rar archive\", 4);\n }\n $extracted = false;\n $entries = $rar->getEntries();\n // TODO instead of sorting full entry paths, perhaps sort labels only?\n sort($entries, SORT_NATURAL);\n foreach ($entries as $entry) {\n if ($entry->isDirectory()) continue;\n $label = $entry->getName();\n $tmp = explode(\".\", $label);\n $ext = end($tmp);\n if (!empty($ext) && array_search($ext, self::IMG_EXT) !== false) {\n $stream = $entry->getStream();\n if ($stream !== false) {\n $extracted = fopen(\n \"php://temp/maxmemory:\". 2 * 1024 * 1024, 'r+');\n fwrite($extracted, stream_get_contents($stream));\n fclose($stream);\n break;\n }\n }\n }\n $rar->close();\n return $extracted;\n }\n throw new UnhandledArchive(\"No handler for archive of type $type.\", 2);\n }", "public function updateImages($zip_file_path)\n {\n $zipper = new Zipper();\n $zipper->make($zip_file_path)->extractTo(public_path(config('webmagic.ecommerce.products_img_path')));\n }", "function export_extract_images($content) {\n global $OUTPUT;\n\n // Find img tags\n preg_match_all('/<img(.*?)>/is', $content, $imgs, PREG_SET_ORDER);\n $extractedcount = 0;\n\n for ($imgcount = 0; isset($imgs[$imgcount]); ++$imgcount) {\n $img = $imgs[$imgcount];\n\n // Extract source of image\n if (preg_match('/.*?src=(?:\\'|\")([^>]*?)(?:\\'|\")/is',\n $img[1], $sources)) {\n $source = trim($sources[1]);\n\n // An img tag may hold an embedded image.\n // Those will be loaded into $this->images\n if (preg_match('/data:image\\/(?<type>.*?);(?<encoding>.*?),' .\n '(?<data>.*)/is', $source, $embeddings)){\n $embeddings['data'] = trim($embeddings['data']);\n $embeddings['type'] = trim($embeddings['type']);\n\n // We only know, how to handle base64 encoded data\n if (preg_match('/base64/is', $embeddings['encoding'])) {\n $image['includename'] = get_string('imagefolder',\n 'qformat_qtex') .\n ($extractedcount+1).'.'.$embeddings['type'];\n\n // Insert image into array\n $this->images[$image['includename']] =\n base64_decode($embeddings['data']);\n } else {\n echo $OUTPUT->notification(get_string('embederror',\n 'qformat_qtex'));\n }\n }\n // Or it may hold a path to an image (which should be imported\n // elsewhere).\n else {\n $image['includename'] = get_string('imagefolder',\n 'qformat_qtex') .\n basename($source);\n $image['filepath'] = $source;\n }\n\n // Replace img tag by include statement\n if (isset($image)) {\n $extractedcount++;\n\n $pattern = preg_quote($img[0], '/');\n $replacement =\n $this->create_macro('image',\n array($image['includename']));\n $content = preg_replace('/'.$pattern.'/is',\n $replacement, $content);\n\n unset($image);\n }\n }\n }\n\n return $content;\n }", "function publication_zip_preview($zarc)\n{\nglobal $_POST;\nglobal $_FILES;\nglobal $site_servers;\nglobal $site_server_activ;\nglobal $folder;\n\n\n$vp=$zarc;\n\n\t\t$archive = new PclZip($_SERVER[\"DOCUMENT_ROOT\"].$vp);\n\t\tif ($archive->extract(PCLZIP_OPT_PATH,$_SERVER[\"DOCUMENT_ROOT\"].site_root.$site_servers[$site_server_activ].\"/\".$folder) == true) \n\t\t{\n\t\t\t$afiles=array();\n\n \t\t\t$dir = opendir ($_SERVER[\"DOCUMENT_ROOT\"].site_root.$site_servers[$site_server_activ].\"/\".$folder);\n \t\t\twhile ($file = readdir ($dir)) \n \t\t\t{\n\t\t\t\tif($file <> \".\" && $file <> \"..\")\n \t\t\t{\n\t\t\t\t\tif (preg_match(\"/.jpg$|.jpeg$/i\",$file) and !preg_match(\"/thumb/i\",$file)) \n\t\t\t\t\t{ \n\t\t\t\t\t\t$file=result_file($file);\n\t\t\t\t\t\t$afiles[count($afiles)]=$file;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t@unlink($_SERVER[\"DOCUMENT_ROOT\"].site_root.$site_servers[$site_server_activ].\"/\".$folder.\"/\".$file);\n\t\t\t\t\t}\n\t\t\t\t\tif (preg_match(\"/php/i\",$file)) \n\t\t\t\t\t{\n\t\t\t\t\t\t@unlink($_SERVER[\"DOCUMENT_ROOT\"].site_root.$site_servers[$site_server_activ].\"/\".$folder.\"/\".$file);\n\t\t\t\t\t}\n \t\t\t}\n \t\t\t }\n \t\t\tclosedir ($dir);\n\t\t\t@unlink($_SERVER[\"DOCUMENT_ROOT\"].$vp);\n\n\t\t\tsort ($afiles);\n\t\t\treset ($afiles);\t\n\n\t\t\tfor($n=0;$n<count($afiles);$n++)\n\t\t\t{\n\t\t\t\t$file=$afiles[$n];\n\n\t\t\t\tphoto_resize($_SERVER[\"DOCUMENT_ROOT\"].site_root.$site_servers[$site_server_activ].\"/\".$folder.\"/\".$file,$_SERVER[\"DOCUMENT_ROOT\"].site_root.$site_servers[$site_server_activ].\"/\".$folder.\"/thumbs\".$n.\".jpg\",1);\n\t\t\t\tphoto_resize($_SERVER[\"DOCUMENT_ROOT\"].site_root.$site_servers[$site_server_activ].\"/\".$folder.\"/\".$file,$_SERVER[\"DOCUMENT_ROOT\"].site_root.$site_servers[$site_server_activ].\"/\".$folder.\"/thumbz\".$n.\".jpg\",2);\n\t\t\t\t\n\t\t\t\tpublication_watermark_add(0,$_SERVER[\"DOCUMENT_ROOT\"].site_root.$site_servers[$site_server_activ].\"/\".$folder.\"/thumbz\".$n.\".jpg\");\n\n\t\t\t\tif($n==0)\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\tphoto_resize($_SERVER[\"DOCUMENT_ROOT\"].site_root.$site_servers[$site_server_activ].\"/\".$folder.\"/\".$file,$_SERVER[\"DOCUMENT_ROOT\"].site_root.$site_servers[$site_server_activ].\"/\".$folder.\"/thumb1.jpg\",1);\n\t\t\t\t\tphoto_resize($_SERVER[\"DOCUMENT_ROOT\"].site_root.$site_servers[$site_server_activ].\"/\".$folder.\"/\".$file,$_SERVER[\"DOCUMENT_ROOT\"].site_root.$site_servers[$site_server_activ].\"/\".$folder.\"/thumb2.jpg\",2);\n\t\t\t\t\tpublication_watermark_add(0,$_SERVER[\"DOCUMENT_ROOT\"].site_root.$site_servers[$site_server_activ].\"/\".$folder.\"/thumb2.jpg\");\n\t\t\t\t}\n\n\t\t\t\t@unlink($_SERVER[\"DOCUMENT_ROOT\"].site_root.$site_servers[$site_server_activ].\"/\".$folder.\"/\".$file);\n\t\t\t}\n\n\t\t}\n\n}", "public function extract_zip($zip_files){\t\t\n\t\tif(extension_loaded('zip'))\t{ \n\t\t\t$zip_path = 'uploads/download/';\n\t\t\t// Checking files are selected\n\t\t\t$zip = new ZipArchive(); // Load zip library \n\t\t\t$zip_name = time().'.zip'; // Zip name\n\t\t\tif($zip->open($zip_path.$zip_name, ZIPARCHIVE::CREATE) !== TRUE){ \n\t\t\t // Opening zip file to load files\n\t\t\t\t$error .= '* Sorry ZIP creation failed at this time';\n\t\t\t}\n\t\t\tforeach($zip_files as $file){ \n\t\t\t\t$zip->addFile($file,basename($file)); // Adding files into zip\n\t\t\t}\n\t\t\t$zip->close();\n\t\t\tif(file_exists($zip_path.$zip_name)){\n\t\t\t\t// push to download the zip\n\t\t\t\theader('Content-type: application/zip');\n\t\t\t\theader('Content-Disposition: attachment; filename=\"'.$zip_name.'\"');\n\t\t\t\treadfile($zip_path.$zip_name);\n\t\t\t\t// remove zip file is exists in temp path\n\t\t\t\tunlink($zip_path.$zip_name);\n\t\t\t}else{\n\t\t\t\t$error .= 'File not exists';\n\t\t\t}\n\n\t\t}\t\t\n\t\telse{\n\t\t\t$error .= '* You dont have ZIP extension';\n\t\t}\n\t\t\n\t\techo $error;\n\t\t\n\t}", "public function extractFilesAction(){\n \t$filesDir = $this->container->getParameter('income_files_dir');\n \t$filesDir = array_diff(scandir($this->container->getParameter('income_files_dir')), array('..', '.'));\n \t$files = array_map(function($i){if (substr($i,-3)=='.gz') return $i;},$filesDir);\n\n \tforeach ($files as $file) {\n \t\tif (empty($file)) continue;\n\t \n\t \t$filesDir = $this->container->getParameter('income_files_dir');\n\n\t \tif (PHP_OS == 'WINNT'){\n\t \t\t$unzip = $this->container->getParameter('winnt_gunzip').' -d';\n\t \t}else{\n\t \t\t$unzip = 'unzip';\n\t \t}\n\t \tsystem($unzip.' '.$filesDir.$file);\n\t \t$decompressed_file = substr($file, 0,-3); \t\t\n \t}\n die();\n }", "public function extract()\n {\n $tarPath = $this->filePath;\n\n // is it gzipped?\n if (preg_match('/^(.*?\\.tar)\\.gz$/', $this->filePath, $match)) {\n $pharData = new PharData($this->filePath);\n\n // creates a tar file in the same dir\n $pharData->decompress();\n\n // set the tar path (file without the .gz extension)\n $tarPath = $match[1];\n\n unset($pharData);\n\n // destroy the gzip file\n unlink($this->filePath);\n }\n\n // extract the tar\n $pharData = new PharData($tarPath);\n\n $pharData->extractTo($this->extractionPath, null, $this->overwrite);\n\n unset($pharData);\n\n // destroy the tar file\n unlink($tarPath);\n }", "public function _extractArchive($outputDir)\n {\n if (!function_exists('zip_open')) {\n throw new BaseZF_Archive_Exception('Unable to extract archive cause \"zip_open\" function is not available.');\n }\n\n $zip = zip_open($this->_options['path']);\n\n while ($zipEntry = zip_read($zip)) {\n\n $completePath = $outputDir . dirname(zip_entry_name($zipEntry));\n $completeName = $outputDir . zip_entry_name($zipEntry);\n\n // Walk through path to create non existing directories\n // This won't apply to empty directories ! They are created further below\n if (!$this->_options['inmemory']) {\n\n $fullPath = '';\n foreach (explode(DIRECTORY_SEPARATOR, $completePath) as $path) {\n\n $fullPath .= $path . DIRECTORY_SEPARATOR;\n\n if (!is_dir($fullPath)) {\n mkdir($fullPath, 0777);\n }\n }\n }\n\n if (zip_entry_open($zip, $zipEntry, 'r')) {\n\n // memory storage only\n if ($this->_options['inmemory']) {\n\n $zipEntrySize = zip_entry_filesize($zipEntry);\n\n // check if memory is available before set file content in php var\n $availableMemory = memory_get_usage() - ini_get('memory_limit');\n if ($availableMemory < $zipEntrySize) {\n throw new BaseZF_Archive_Exception(sprintf(\n 'Unable to extract archive in memory cause require %d byts in memory and %d byts is available.',\n $zipEntrySize,\n $availableMemory\n ));\n }\n\n $this->_files[] = array(\n 'name' => $completeName,\n 'path' => $completeName,\n 'type' => 0,\n 'ext' => pathinfo($completeName, PATHINFO_EXTENSION),\n 'data' => zip_entry_read($zipEntry, $zipEntrySize),\n\n // unknow value have 0 or -1 look http://php.net/stat for details\n 'stat' => array(\n 0 => 0, // 0 dev device number\n 1 => 0, // 1 ino inode number *\n 2 => 0, // 2 mode inode protection mode\n 3 => 0, // 3 nlink number of links\n 4 => 0, // 4 uid userid of owner *\n 5 => 0, // 5 gid groupid of owner *\n 6 => 0, // 6 rdev device type, if inode device\n 7 => $zipEntrySize, // 7 size size in bytes\n 8 => time(), // 8 atime time of last access (Unix timestamp)\n 9 => time(), // 9 mtime time of last modification (Unix timestamp)\n 10 => time(), // 10 ctime time of last inode change (Unix timestamp)\n 11 => -1, // 11 blksize blocksize of filesystem IO **\n 12 => -1, // 12 blocks number of blocks allocated **\n ),\n );\n } else if (!$this->_options['overwrite'] && file_exists($completeName)) {\n\n throw new BaseZF_Archive_Exception(sprintf('Unable to overwrite existing %s file cause overwrite options is disable', $completeName));\n\n // physical storage\n } else if ($fd = fopen($completeName, 'w+')) {\n fwrite($fd, zip_entry_read($zipEntry, zip_entry_filesize($zipEntry)));\n fclose($fd);\n }\n\n zip_entry_close($zipEntry);\n }\n }\n\n zip_close($zip);\n\n }", "public function extract()\n {\n $options = func_get_args();\n //array_shift($options);\n\n // parse options\n if (isset($options[0]) && is_string($options[0])) {\n $options[PCLZIP_OPT_PATH] = $options[0];\n if (isset($options[1]) && is_string($options[1])) {\n $options[PCLZIP_OPT_REMOVE_PATH] = $options[1];\n }\n } else {\n $options = $this->makeKeyValueArrayFromList($options);\n }\n\n // filters initiation\n if (isset($options[PCLZIP_OPT_PATH]))\n $extractPath = rtrim($options[PCLZIP_OPT_PATH], '/');\n else $extractPath = rtrim(getcwd(), '/');\n\n $filters = $this->createFilters($options);\n list($preExtractCallback, $postExtractCallback) = $this->extractCallbacks($options, PCLZIP_CB_PRE_EXTRACT, PCLZIP_CB_POST_EXTRACT);\n $selectFilter = $this->createSelector($options);\n\n if (isset($options[PCLZIP_OPT_EXTRACT_AS_STRING]))\n $anotherOutputFormat = PCLZIP_OPT_EXTRACT_AS_STRING;\n else if (isset($options[PCLZIP_OPT_EXTRACT_IN_OUTPUT]))\n $anotherOutputFormat = PCLZIP_OPT_EXTRACT_IN_OUTPUT;\n else $anotherOutputFormat = false;\n\n if (isset($options[PCLZIP_OPT_REPLACE_NEWER]))\n $doNotReplaceNewer = false;\n else $doNotReplaceNewer = true;\n\n if (isset($options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION]))\n $restrictExtractDir = $options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION];\n else $restrictExtractDir = false;\n\n $report = array();\n foreach ($this->listContent() as $file_header) {\n $file_header = (object)$file_header;\n // add file information to report\n $report[] = $file_header;\n // refuse by select rule\n if (call_user_func($selectFilter, $file_header->stored_filename,\n $file_header->filename, $file_header->index)\n === self::SELECT_FILTER_REFUSE) {\n //\n // I don't know need to remain this file in report or not,\n // but for now I remove\n array_pop($report);\n // $file_header->status = 'filtered';\n //\n continue;\n }\n\n //\n // add extract path in case of extraction\n // for some reason need to do it before call pre extract callback\n // (pclzip.lib.php v2.8.2, line 3670)\n // so I decided to do it here too\n //\n if ($anotherOutputFormat === false) {\n $file_header->filename = realpath($extractPath).'/'.\n $file_header->filename;\n //\n // check for path correlation with restricted path\n //\n if ($restrictExtractDir !== false) {\n $filename = $file_header->filename;\n $restrictedDir = realpath($restrictExtractDir);\n if (strncasecmp($restrictedDir, $filename,\n strlen($restrictedDir)) !== 0) {\n // refuse file extraction\n $file_header->status = 'filtered';\n continue;\n }\n }\n }\n\n // apply pre extract callback\n $callback_result = call_user_func($preExtractCallback,\n $file_header);\n if ($callback_result == 1) {\n // go on ...\n } elseif ($callback_result == 0) {\n // skip current file\n $file_header->status = 'skipped';\n continue;\n } elseif ($callback_result == 2) {\n // skip & stop extraction\n $file_header->status = 'aborted';\n break;\n }\n\n // return content\n if ($anotherOutputFormat == PCLZIP_OPT_EXTRACT_AS_STRING) {\n $file_header->content\n = $this->archive->getFileContent($file_header->stored_filename);\n }\n // echo content\n else if ($anotherOutputFormat == PCLZIP_OPT_EXTRACT_IN_OUTPUT) {\n echo $this->archive->getFileContent($file_header->stored_filename);\n }\n // extract content\n else if ($anotherOutputFormat === false) {\n // apply path filters\n foreach ($filters as $filter) call_user_func($filter,\n $file_header->stored_filename, $file_header->filename);\n // dir extraction process\n if ($file_header->folder) {\n // if dir doesn't exist\n if (!is_dir($file_header->filename)) {\n // try to create folder\n if (!mkdir($file_header->filename)) {\n $file_header->status = 'path_creation_fail';\n continue;\n }\n }\n }\n // file extraction process\n else {\n // check if path is already taken by a folder\n if (is_dir($file_header->filename)) {\n $file_header->status = 'already_a_directory';\n continue;\n }\n\n // check if file exists and it's newer\n if (is_file($file_header->filename)) {\n if (filemtime($file_header->filename)\n > $file_header->mtime) {\n // skip extraction if option EXTRACT_NEWER isn't set\n if ($doNotReplaceNewer) {\n $file_header->status = 'newer_exist';\n continue;\n }\n }\n }\n $directory = dirname($file_header->filename);\n // check if running process can not create extraction folder\n if (!is_dir($directory) && !mkdir($directory)) {\n $file_header->status = 'path_creation_fail';\n continue;\n } else if (!is_writable($directory)) {\n // check if file path is not writable\n $file_header->status = 'write_protected';\n continue;\n }\n // extraction\n $stream = $this->archive->getFileStream($file_header->stored_filename);\n if (file_put_contents($file_header->filename, $stream)) {\n // ok\n }\n // extraction fails\n else {\n $file_header->status = 'write_error';\n continue;\n }\n }\n }\n\n // apply post extract callback\n $callback_result = call_user_func($postExtractCallback,\n $file_header);\n if ($callback_result == 1) {\n // go on\n } elseif ($callback_result == 2) {\n // skip & stop extraction\n break;\n }\n }\n\n foreach ($report as $i => $reportItem) {\n $report[$i] = (array)$reportItem;\n }\n\n return $report;\n }", "public function mosaicImages () {}", "public static function extract_assets($zip_path) {\n\n\t\tif(!file_exists($zip_path)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$zip = new ZipArchive();\n\t\t\n\t\tif ($zip->open($zip_path) === true) {\n\n\t\t $allow_exts = array('jpg','png','jpeg','JPG','gif','svg','SVG');\t\n\t\t \n\t\t for($i = 0; $i < $zip->numFiles; $i++) {\n\t\t \n\t\t $a_file = $zip->getNameIndex($i);\n\t\t \n\t\t $extension = explode('.', $a_file);\n\t\t $extension = $extension[count($extension) - 1];\n\n\t\t //Extract only allowed extension\n\t\t\t\tif(in_array($extension, $allow_exts)) {\n\n\t\t\t\t\t$zip->extractTo(ASL_PLUGIN_PATH.'public', array($a_file));\n\t\t\t\t}\n\t\t } \n\n\t\t //Close the connection \n\t\t $zip->close(); \n\n\t\t return true; \n\t\t}\n\n\t\treturn false;\n\t}", "private function parse_item_images() {\n\t\t$this->get_item_images();\n\n\t\tif ( ! empty( $this->images ) ) {\n\t\t\tforeach ( $this->images as $src => $img ) {\n\t\t\t\t$this->parse_item_image( $src, $img );\n\t\t\t}\n\t\t}\n\t}", "public function extract()\n {\n $this->getLogger()->info(\"Extracting {$this->source} into \" . $this->getPath() . '...');\n if (!is_dir($this->getPath()) || !$this->fs->isEmpty($this->getPath())) {\n throw new InstallerException(\n \"The target path {$this->getPath()} is not a directory or is not empty when extracting the archive.\"\n );\n }\n if (!is_file($this->source)) {\n throw new InstallerException(\"{$this->source} doesn't exists or is not a file.\");\n }\n\n $zip = new \\ZipArchive();\n if ($zip->open($this->source) !== true) {\n throw new InstallerException(\"Unable to open zip {$this->source}.\");\n }\n $zip_paths = array();\n for ($i = 0; $i < $zip->numFiles; $i++) {\n $zip_paths[$i] = $zip->getNameIndex($i);\n }\n $target_paths = Installer::junkParent($zip_paths);\n foreach ($target_paths as $i => $name) {\n if (empty($name)) {\n continue;\n }\n\n $target_path = $this->getPath() . '/' . $name;\n // Check is name ends with '/' (directory name)\n if (strpos($name, '/', strlen($name) - 1) === false) {\n // We have a file name\n // We load each zipped file in memory.\n // It is much faster than getting the Stream handle.\n // For Sugar 7 archive we peak at 24MB so it shouldn't be an issue.\n $content = $zip->getFromIndex($i);\n if ($content === false) {\n throw new InstallerException(\"Error while extracting {$name} from the archive.\");\n }\n if (file_put_contents($target_path, $content) === false) {\n throw new InstallerException(\"Error while writting to file {$target_path}.\");\n }\n } else {\n // We have a dir name\n $this->fs->mkdir($target_path);\n }\n }\n\n if (!$zip->close()) {\n throw new InstallerException(\"Unable to close zip {$this->source}.\");\n }\n $this->getLogger()->info('Extraction OK.');\n }", "protected function _extract() {\n\t\tif (empty ( $_GET ['current'] ) || false == ($current = $this->_findDir ( trim ( $_GET ['current'] ) )) || empty ( $_GET ['target'] ) || false == ($file = $this->_find ( trim ( $_GET ['target'] ), $current )) || ! $this->_isAllowed ( $current, 'write' )) {\n\t\t\treturn $this->_result ['error'] = 'Invalid parameters';\n\t\t}\n\t\t$this->_checkArchivers ();\n\t\t$mime = $this->_mimetype ( $file );\n\t\tif (empty ( $this->_options ['archivers'] ['extract'] [$mime] )) {\n\t\t\treturn $this->_result ['error'] = 'Invalid parameters';\n\t\t}\n\t\t$cwd = getcwd ();\n\t\t$arc = $this->_options ['archivers'] ['extract'] [$mime];\n\t\t$cmd = $arc ['cmd'] . ' ' . $arc ['argc'] . ' ' . escapeshellarg ( basename ( $file ) );\n\t\tchdir ( dirname ( $file ) );\n\t\texec ( $cmd, $o, $c );\n\t\tchdir ( $cwd );\n\t\tif ($c == 0) {\n\t\t\t$this->_content ( $current, true );\n\t\t} else {\n\t\t\t$this->_result ['error'] = 'Unable to extract files from archive';\n\t\t}\n\t}", "protected function _extract()\n\t{\n\t\tif (empty($_GET['current']) \n\t\t|| false == ($current = $this->_findDir(trim($_GET['current'])))\n\t\t|| empty($_GET['target'])\n\t\t|| false == ($file = $this->_find(trim($_GET['target']), $current))\n\t\t|| !$this->_isAllowed($current, 'write')\n\t\t) {\n\t\t\treturn $this->_result['error'] = 'Invalid parameters';\n\t\t}\n\t\t$this->_checkArchivers();\n\t\t$mime = $this->_mimetype($file);\n\t\tif (empty($this->_options['archivers']['extract'][$mime])) {\n\t\t\treturn $this->_result['error'] = 'Invalid parameters';\n\t\t}\n\t\t$cwd = getcwd();\n\t\t$arc = $this->_options['archivers']['extract'][$mime];\n\t\t$cmd = $arc['cmd'].' '.$arc['argc'].' '.escapeshellarg(basename($file));\n\t\tchdir(dirname($file));\n\t\texec($cmd, $o, $c);\n\t\tchdir($cwd);\n\t\tif ($c == 0) {\n\t\t\t$this->_content($current, true);\n\t\t} else {\n\t\t\t$this->_result['error'] = 'Unable to extract files from archive';\n\t\t}\n\t}", "function extractZipArchive($archive, $destination){\n /* if(!class_exists('ZipArchive')){\n echo 'Your PHP version does not support unzip functionality.'; \n } \n if(is_readable($archive)) {\n echo (\"$archive is readable\").\"<br>\";\n } else {\n echo (\"$archive is not readable\").\"<br>\";\n } \n */\n\n echo $archive.\"<br>\";\n echo $destination.\"<br>\";\n\n $zip = new ZipArchive();\n // Check if archive is readable.\n if($zip->open($archive) === TRUE){\n // Check if destination is writable\n if(is_writeable($destination)){\n $zip->extractTo($destination);\n $zip->close();\n echo 'Files unzipped successfully'; \n }else{\n echo 'Directory not writeable by webserver.'; \n }\n }else{\n echo 'Cannot read '. $archive.' archive.'; \n }\n }", "public static function readImage($imageDir, $entryName, $zipEntry)\n {\n $imageDir = $_SERVER['DOCUMENT_ROOT'] . $imageDir;\n if (!file_exists($imageDir))\n {\n mkdir($imageDir, 0777, true);\n\t}\n \n $img = zip_entry_read($zipEntry, zip_entry_filesize($zipEntry));\n if ($img !== null)\n {\n $imagePath = $imageDir . \"/\" . basename($entryName);\n file_put_contents($imagePath, $img);\n } \n }", "private function collect_images() {\n $images = new DirectoryIterator($this->images_dir);\n foreach ($images as $image) {\n if (!$image->isDot()) {\n $name = $image->getBasename();\n $this->images[] = array(\n 'path' => $this->poster_loc . DS . $name,\n 'name' => $name\n );\n }\n }\n return $this->images;\n }", "protected function arrayFromZip($params = array()) {\n if (!$this->isZipFile($this->data[AdImageFields::FILENAME])) {\n throw new \\RuntimeException(\n $this->data[AdImageFields::FILENAME].\" doesn't resolve to a zip file\");\n }\n\n $data = $this->exportData();\n $filename = $data[AdImageFields::FILENAME];\n unset($data[AdImageFields::FILENAME]);\n $params = array_merge($data, $params);\n\n $request = $this->getApi()->prepareRequest(\n '/'.$this->assureParentId().'/'.$this->getEndpoint(),\n RequestInterface::METHOD_POST,\n $params\n );\n\n $request->getFileParams()->offsetSet(AdImageFields::FILENAME, $filename);\n $response = $this->getApi()->executeRequest($request);\n\n $result = array();\n $content = $response->getContent();\n foreach ($content['images'] as $image) {\n $adimage = new AdImage(\n substr($this->getParentId(), 4).':'.$image[AdImageFields::HASH],\n $this->getParentId(),\n $this->getApi());\n\n $adimage->{AdImageFields::HASH} = $image[AdImageFields::HASH];\n\n $result[] = $adimage;\n }\n\n return $result;\n }", "protected function unpackFaviconArchive()\n {\n /* @var $Favicon File */\n $Favicon = $this->owner->Favicon();\n $FaviconData = $Favicon->getString();\n $tmpName = tempnam(TEMP_PATH, 'ss');\n file_put_contents($tmpName, $FaviconData);\n $dir = $this->getThemeAssetsFolder();\n ZipHelper::unzipTo($tmpName, $dir);\n }", "function createZipImages($dir)\n {\n $dirPath = CONFIG_DIR.'/content/backups/'. $dir;\n $zipPath = CONFIG_DIR.'/content/backups/'. $dir . '.zip';\n $zip = new \\ZipArchive();\n $result = $zip->open($zipPath, \\ZipArchive::CREATE | \\ZipArchive::OVERWRITE);\n if ($result != true) reportError('Failed to create ZIP archive. zipImages. result: ' . $result);\n\n /* ref: https://stackoverflow.com/questions/4914750/how-to-zip-a-whole-folder-using-php */\n $files = new \\RecursiveIteratorIterator(new \\RecursiveDirectoryIterator($dirPath),\\RecursiveIteratorIterator::LEAVES_ONLY);\n set_time_limit(0);\n foreach ($files as $name => $file) {\n if (!$file->isDir()) { // directories are added automatically)\n $filePath = $file->getRealPath();\n $relativePath = substr($filePath, strlen($dirPath) + 1);\n $zip->addFile($filePath, $relativePath);\n }\n }\n\n if (!$zip->close())\n reportError('Failed to close ZIP archive.');\n return $zipPath;\n\n }", "function wp_image_archives ( $args = '' ) {\n\tglobal $image_archives;\n\treturn $image_archives->image_archives_template_tag ( $args );\n}", "function zip_extract_file()\n{\n if (empty($_POST) === false) {\n $zipper = new Zipclass();\n $arrfile = $_POST['arrfile'];\n $arrfile = json_decode($arrfile);\n $root = $_SERVER['DOCUMENT_ROOT'] . '/';\n $location = $_POST['location'];\n $error_ck = false;\n $msg = '';\n if (empty($arrfile) === false && isset($arrfile) === true) {\n $error_ck = true;\n }\n if ($error_ck === true) {\n if (is_array($arrfile)) {\n foreach ($arrfile as $file) {\n if (file_exists($file)) {\n if ($zipper->zip_extract($file, $root . $location) === false) {\n echo 'Opss something is wrong!';\n } else {\n $msg = 'successfully';\n }\n }\n }\n }\n } else {\n echo 'Invalid location';\n }\n \n if (empty($msg) === false) {\n echo $msg;\n $msg = '';\n }\n }\n}", "function extractArchive($type, $filename, $temporaryDirectory = '')\n{\n if ( ! in_array($type, ['tar', 'zip'])) {\n return;\n }\n \n $extension = ($type === 'tar') ? '.tar.gz' : '.zip' ;\n \n if ($temporaryDirectory === '') {\n $temporaryDirectory = substr($filename, 0, strpos($filename, $extension));\n }\n \n if ($type === 'tar') {\n exec('tar -xzvf ' . $filename);\n } else {\n exec('unzip ' . $filename);\n }\n \n exec('mv ' . $temporaryDirectory . '/* .');\n exec('rm -rf ' . $temporaryDirectory . '/');\n exec('rm -rf ' . $filename);\n}", "public function deconstructImages () {}", "function extractFiles($file,$data)\n{\n\tglobal $txt;\n\n\tif($data['extension'] == 'zip')\n\t{\n\t\tif (class_exists('ZipArchive'))\n\t\t{\n\n\t\t\t$zip = new ZipArchive;\n\n\t\t\tif ($zip->open($file) === TRUE) \n\t\t\t{\n \t\t\t\t$zip->extractTo($data['dirname'] . '/' . $data['basename']);\n \t\t\t\t$zip->close();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfatal_lang_error('fm_zipnotinstalled',0);\n\t\t}\n\t}\n\n\telseif($data['extension'] == 'rar')\n\t{\n\t\tif (class_exists('extract'))\n\t\t{\n\t\t\t$rar = rar_open($file.$data['dirname']);\n\t\t\t$list = rar_list($rar);\n\n\t\t\tforeach($list as $file)\n\t\t\t{\n \t\t\t\t$entry = rar_entry_get($rar, $file);\n \t\t\t\t$entry->extract('.');\n\t\t\t}\n\t\t\t\trar_close($rar);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfatal_lang_error('fm_rarnotinstalled',0);\n\t\t}\n\t}\n}", "public function deconstructImages() {\n\t}", "public function extract($folder, array $files = []);", "function govdocs_refresh_images($tiff, &$item) {\n $label = $item->objectProfile->objLabel;\n $datastreams = $item->get_datastreams_list_as_array();\n $returnValue = \"\";\n $success = 0;\n exec('kdu_compress -i \"' . $tiff . '\" -o \"' . $tiff . '.jp2' . '\" -rate 0.5 Clayers=1 Clevels=7 \"Cprecincts={256,256},{256,256},{256,256},{128,128},{128,128},{64,64},{64,64},{32,32},{16,16}\" \"Corder=RPCL\" \"ORGgen_plt=yes\" \"ORGtparts=R\" \"Cblk={32,32}\" Cuse_sop=yes', $output, $returnValue);\n if ($returnValue == '0') {\n if (array_key_exists('JP2', $datastreams)) {\n $item->purge_datastream('JP2');\n }\n $item->add_datastream_from_file(\"$tiff.jp2\", 'JP2', \"Compressed JP2\", 'image/jp2', 'M');\n file_delete(\"$tiff.jp2\");\n $success++;\n }\n\n exec(\"convert {$tiff}[0] -colorspace RGB -thumbnail 120x $tiff-tn.jpg\", $output, $returnValue);\n\n if ($returnValue == '0') {\n if (array_key_exists('TN', $datastreams)) {\n $item->purge_datastream('TN');\n }\n $item->add_datastream_from_file(\"$tiff-tn.jpg\", 'TN', 'Thumbnail', 'image/jpeg', 'M');\n file_delete(\"$tiff-tn.jpg\");\n $success++;\n }\n file_delete(\"$tiff-tn.jpg\");\n exec(\"convert -resize 800 \\\"{$tiff}\\\"[0] \\\"$tiff-med.jpg\\\"\", $output, $returnValue);\n if ($returnValue == '0') {\n if (array_key_exists('JPEG', $datastreams)) {\n $item->purge_datastream('JPEG');\n }\n $item->add_datastream_from_file(\"$tiff-med.jpg\", 'JPEG', \"JPEG image\", 'image/jpeg', 'M');\n file_delete(\"$tiff-med.jpg\");\n $success++;\n }\n return $success;\n}", "public function flattenImages () {}" ]
[ "0.6170165", "0.6101969", "0.596314", "0.585909", "0.5720752", "0.5709998", "0.56765956", "0.5631443", "0.558303", "0.5393253", "0.53713435", "0.5363779", "0.5342337", "0.5315989", "0.5311573", "0.5297112", "0.5296096", "0.52931833", "0.52880734", "0.5251864", "0.5209951", "0.5209385", "0.51976484", "0.5182372", "0.5175111", "0.51511806", "0.51347154", "0.5121311", "0.5103158", "0.5062157" ]
0.7228088
0
Pass an audited entity or the audit entity and return a collection of RevisionEntity s for that record
public function getRevisionEntities($entity) { $entityManager = \SoliantEntityAudit\Module::getModuleOptions()->getEntityManager(); if (gettype($entity) != 'string' and in_array(get_class($entity), array_keys(\SoliantEntityAudit\Module::getModuleOptions()->getAuditedClassNames()))) { $auditEntityClass = 'SoliantEntityAudit\\Entity\\' . str_replace('\\', '_', get_class($entity)); $identifiers = $this->getEntityIdentifierValues($entity); } elseif ($entity instanceof AbstractAudit) { $auditEntityClass = get_class($entity); $identifiers = $this->getEntityIdentifierValues($entity, true); } else { $auditEntityClass = 'SoliantEntityAudit\\Entity\\' . str_replace('\\', '_', $entity); } $search = array('auditEntityClass' => $auditEntityClass); if (isset($identifiers)) $search['entityKeys'] = serialize($identifiers); return $entityManager->getRepository('SoliantEntityAudit\\Entity\\RevisionEntity') ->findBy($search, array('id' => 'DESC')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function revisionIds(OCCaseInterface $entity);", "public function revisionIds(BlogInterface $entity);", "public function getRevisions()\n {\n return $this->_revisions;\n }", "public function getAllAuditLogs($entity): Collection\n {\n if (!$this->isAuditable($entity)) {\n return new Collection;\n }\n\n return $entity->auditLogItems()->orderBy('created_at', 'desc')->get();\n }", "public function getRevisions() {\n return $this->revisions;\n }", "public function documentRevisions()\n {\n return $this->belongsToMany(DocumentRevision::class);\n }", "public function getAllRevisionLogs();", "public function getAssociationRevisionEntity(AbstractAudit $entity, $field, $value) {\r\n $em = \\SoliantEntityAudit\\Module::getModuleOptions()->getEntityManager();\r\n\r\n foreach ($entity->getAssociationMappings() as $mapping) {\r\n\r\n if ($mapping['fieldName'] == $field) {\r\n $qb = $em->createQueryBuilder();\r\n $qb->select('revisionEntity')\r\n ->from('SoliantEntityAudit\\\\Entity\\\\RevisionEntity', 'revisionEntity')\r\n ->innerJoin('revisionEntity.revision', 'revision')\r\n ->andWhere('revisionEntity.targetEntityClass = ?1')\r\n ->andWhere('revisionEntity.entityKeys = ?2')\r\n ->andWhere('revision.timestamp <= ?3')\r\n ->setParameter(1, $mapping['targetEntity'])\r\n ->setParameter(2, serialize(array('id' => $value)))\r\n ->setParameter(3, $entity->getRevisionEntity()->getRevision()->getTimestamp())\r\n ->orderBy('revision.timestamp', 'DESC')\r\n ->setMaxResults(1);\r\n\r\n $result = $qb->getQuery()->getResult();\r\n\r\n if ($result) return reset($result);\r\n }\r\n\r\n }\r\n\r\n return;\r\n }", "public function revisionIds(BookEntityInterface $entity);", "public function getRevisionLog();", "public function getRevisionsTo(string $revision): array;", "function getRevisions() {\n if($this->revisions === false) {\n $this->revisions = Files::findRevisions($this, $this->getState(), $this->getVisibility());\n } // if\n return $this->revisions;\n }", "public function revisionIds(ProductEntityInterface $entity);", "public function revisionOverview() {\n // Get entity type id.\n $entity_type_id = $this->entityType;\n\n // Get storage.\n $storage = $this\n ->entityTypeManager()\n ->getStorage($this->entityType);\n\n // Load the entity.\n $entity = $storage->load($this->entityId);\n\n // Get the current user.\n $account = $this->currentUser();\n\n // Build the renderable array.\n $build['#title'] = $this->t('Revisions for %title', ['%title' => $entity->label()]);\n $header = [$this->t('Revision'), $this->t('Operations')];\n\n // Get the entity type admin permission.\n $admin_permission = $entity\n ->getEntityType()\n ->getAdminPermission();\n\n // Check if currect user has the admin permission.\n $user_is_admin = $account->hasPermission($admin_permission);\n\n $rows = [];\n\n // Get the revision ids.\n $vids = $storage->revisionIds($entity);\n\n $latest_revision = TRUE;\n\n // Iterate the revisions.\n foreach (array_reverse($vids) as $vid) {\n $revision = $storage->loadRevision($vid);\n $username = [\n '#theme' => 'username',\n '#account' => $revision->getRevisionUser(),\n ];\n\n // Use revision link to link to revisions that are not active.\n $date = $this->dateFormatter->format($revision->getRevisionCreationTime(), 'short');\n if ($vid != $entity->getRevisionId()) {\n $link = Link::fromTextAndUrl($date, new Url(\"entity.{$entity_type_id}.revision\", [\n $entity_type_id => $entity->id(),\n \"{$entity_type_id}_revision\" => $vid,\n ]))->toString();\n }\n else {\n $link = $entity->toLink($date)->toString();\n }\n\n $row = [];\n $column = [\n 'data' => [\n '#type' => 'inline_template',\n '#template' => '{% trans %}{{ date }} by {{ username }}{% endtrans %}{% if message %}<p class=\"revision-log\">{{ message }}</p>{% endif %}',\n '#context' => [\n 'date' => $link,\n 'username' => $this->renderer->renderPlain($username),\n 'message' => [\n '#markup' => $revision->getRevisionLogMessage(),\n '#allowed_tags' => Xss::getHtmlTagList(),\n ],\n ],\n ],\n ];\n $row[] = $column;\n\n if ($latest_revision) {\n $row[] = [\n 'data' => [\n '#prefix' => '<em>',\n '#markup' => $this->t('Current revision'),\n '#suffix' => '</em>',\n ],\n ];\n foreach ($row as &$current) {\n $current['class'] = ['revision-current'];\n }\n $latest_revision = FALSE;\n }\n else {\n $links = [];\n if ($user_is_admin) {\n $links['revert'] = [\n 'title' => $this->t('Revert'),\n 'url' => Url::fromRoute(\"entity.{$entity_type_id}.revision_revert\", [\n $entity_type_id => $entity->id(),\n \"{$entity_type_id}_revision\" => $vid,\n ]),\n ];\n\n $links['delete'] = [\n 'title' => $this->t('Delete'),\n 'url' => Url::fromRoute(\"entity.{$entity_type_id}.revision_delete\", [\n $entity_type_id => $entity->id(),\n \"{$entity_type_id}_revision\" => $vid,\n ]),\n ];\n }\n\n $row[] = [\n 'data' => [\n '#type' => 'operations',\n '#links' => $links,\n ],\n ];\n }\n\n $rows[] = $row;\n }\n\n $build['revisions_table'] = [\n '#theme' => 'table',\n '#rows' => $rows,\n '#header' => $header,\n ];\n\n return $build;\n }", "public function revisionIds(BibliographicReferenceInterface $entity);", "function history() {\n $id = @$this->params['id'];\n if (!$id) throw new xException('Missing id parameter');\n // Retrieves all versions that impact this record\n // (directly or indirectly)\n $r = xModel::load('version_relation', array(\n 'model_name' => $this->model,\n 'id_field_value' => $id,\n 'xorder_by' => 'versions_relations.version_id',\n 'xorder' => 'DESC'\n ))->get();\n $versions = array();\n foreach ($r as $rr) $versions[] = $rr['version_id'];\n //\n $data = array();\n foreach ($versions as $version) {\n $data[$version] = array(\n 'version' => xModel::load('version', array(\n 'id' => $version\n ))->get(0),\n 'modifications' => xModel::load('version_data', array(\n 'version_id' => $version,\n 'xjoin' => array()\n ))->get(),\n );\n }\n return $data;\n }", "public function revisionIds(AwsFileInterface $entity);", "public function getChanges();", "public function revisionIds(eleague_runsheetInterface $entity);", "public function recordedChanges(): MorphMany\n {\n return $this->morphMany($this->auditTrailModel(), 'auditable');\n }", "public function audits()\n {\n return $this->morphMany(Log::class, 'auditable');\n }", "public function revisionOverview() {\n $entityTypeId = $this->entityTypeId;\n $entity = $this->currentRoute->getParameter($entityTypeId);\n $account = $this->currentUser();\n $langcode = $entity->language()->getId();\n $langname = $entity->language()->getName();\n $languages = $entity->getTranslationLanguages();\n $hasTranslations = (count($languages) > 1);\n /* @var \\Drupal\\custom_entity_tools\\EntityBaseStorage $entityStorage */\n $entityStorage = $this->entityTypeManager()->getStorage($this->entityTypeId);\n\n $build['#title'] = $hasTranslations ? $this->t('@langname revisions for %title', ['@langname' => $langname, '%title' => $entity->label()]) : $this->t('Revisions for %title', ['%title' => $entity->label()]);\n $header = [$this->t('Revision'), $this->t('Operations')];\n\n $revertPermission = (($account->hasPermission(\"revert $entityTypeId revisions\") || $account->hasPermission(\"administer $entityTypeId entities\")));\n $deletePermission = (($account->hasPermission(\"delete $entityTypeId revisions\") || $account->hasPermission(\"administer $entityTypeId entities\")));\n\n $rows = [];\n\n $vids = $entityStorage->revisionIds($entity);\n\n $latestRevision = TRUE;\n\n foreach (array_reverse($vids) as $vid) {\n /** @var \\Drupal\\custom_entity_tools\\Entity\\EntityBaseInterface $revision */\n $revision = $entityStorage->loadRevision($vid);\n // Only show revisions that are affected by the language that is being\n // displayed.\n if ($revision->hasTranslation($langcode) && $revision->getTranslation($langcode)->isRevisionTranslationAffected()) {\n $username = [\n '#theme' => 'username',\n '#account' => $revision->getRevisionUser(),\n ];\n\n // Use revision link to link to revisions that are not active.\n $date = \\Drupal::service('date.formatter')->format($revision->getRevisionCreationTime(), 'short');\n if ($vid != $entity->getRevisionId()) {\n $link = $this->l($date, new Url(\"entity.$entityTypeId.revision\", [$entityTypeId => $entity->id(), 'revision' => $vid]));\n }\n else {\n $link = $entity->link($date);\n }\n\n $row = [];\n $column = [\n 'data' => [\n '#type' => 'inline_template',\n '#template' => '{% trans %}{{ date }} by {{ username }}{% endtrans %}{% if message %}<p class=\"revision-log\">{{ message }}</p>{% endif %}',\n '#context' => [\n 'date' => $link,\n 'username' => \\Drupal::service('renderer')->renderPlain($username),\n 'message' => ['#markup' => $revision->getRevisionLogMessage(), '#allowed_tags' => Xss::getHtmlTagList()],\n ],\n ],\n ];\n $row[] = $column;\n\n if ($latestRevision) {\n $row[] = [\n 'data' => [\n '#prefix' => '<em>',\n '#markup' => $this->t('Current revision'),\n '#suffix' => '</em>',\n ],\n ];\n foreach ($row as &$current) {\n $current['class'] = ['revision-current'];\n }\n $latestRevision = FALSE;\n }\n else {\n $links = [];\n if ($revertPermission) {\n $links['revert'] = [\n 'title' => $this->t('Revert'),\n 'url' => Url::fromRoute(\"entity.$entityTypeId.revision_revert_confirm\", [\n $entityTypeId => $entity->id(),\n 'revision' => $vid,\n ]),\n ];\n }\n\n if ($deletePermission) {\n $links['delete'] = [\n 'title' => $this->t('Delete'),\n 'url' => Url::fromRoute(\"entity.$entityTypeId.revision_delete_confirm\", [\n $entityTypeId => $entity->id(),\n 'revision' => $vid,\n ]),\n ];\n }\n\n $row[] = [\n 'data' => [\n '#type' => 'operations',\n '#links' => $links,\n ],\n ];\n }\n\n $rows[] = $row;\n }\n }\n\n $build['revisions_table'] = [\n '#theme' => 'table',\n '#rows' => $rows,\n '#header' => $header,\n ];\n\n return $build;\n }", "public static function get_all_revisions() {\n\t\t$post = self::get_post();\n\n\t\tif ( ! $post ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$revisions = wp_get_post_revisions( $post->ID, array(\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby' => 'date',\n\t\t\t'order' => 'DESC',\n\t\t) );\n\n\t\treturn $revisions;\n\t}", "public function audits()\n {\n return $this->morphMany(Auditing::class, 'auditable');\n }", "protected static function getChangedEntities()\r\n\t\t{\r\n\t\t\tself::$arrChangedEntities = array();\r\n\t\t\tforeach( self::$arrInstances as $strClass => $arrClassInstance )\r\n\t\t\t{\r\n\t\t\t\tforeach( $arrClassInstance as $intObjectId => $objEntity )\r\n\t\t\t\t{\r\n\t\t\t\t\tif( ( $objEntity->getChanged() == true ) && ( $objEntity->getRemoved() == false ) ) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tself::$arrChangedEntities[ $strClass ][ $intObjectId ] = $objEntity;\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\treturn self::$arrChangedEntities;\r\n\t\t}", "public function revisions(RouteMatchInterface $route_match) {\n $output = [];\n\n $parameter_name = $route_match->getRouteObject()->getOption('_entity_type_id');\n $entity = $route_match->getParameter($parameter_name);\n\n if ($entity && $entity instanceof ContentEntityInterface) {\n $tree = \\Drupal::service('multiversion.entity_index.rev.tree')->getTree($entity->uuid());\n $output = [\n '#theme' => 'item_list',\n '#attributes' => ['class' => ['workspace']],\n '#attached' => ['library' => ['workspace/drupal.workspace.admin']],\n '#items' => $tree,\n '#list_type' => 'ul',\n ];\n }\n return $output;\n }", "public function revisionOverview(ChartEntityInterface $chart_entity) {\n $account = $this->currentUser();\n $chart_entity_storage = $this->entityTypeManager()->getStorage('chart_entity');\n\n $langcode = $chart_entity->language()->getId();\n $langname = $chart_entity->language()->getName();\n $languages = $chart_entity->getTranslationLanguages();\n $has_translations = (count($languages) > 1);\n $build['#title'] = $has_translations ? $this->t('@langname revisions for %title', ['@langname' => $langname, '%title' => $chart_entity->label()]) : $this->t('Revisions for %title', ['%title' => $chart_entity->label()]);\n\n $header = [$this->t('Revision'), $this->t('Operations')];\n $revert_permission = (($account->hasPermission(\"revert all chart entity revisions\") || $account->hasPermission('administer chart entity entities')));\n $delete_permission = (($account->hasPermission(\"delete all chart entity revisions\") || $account->hasPermission('administer chart entity entities')));\n\n $rows = [];\n\n $vids = $chart_entity_storage->revisionIds($chart_entity);\n\n $latest_revision = TRUE;\n\n foreach (array_reverse($vids) as $vid) {\n /** @var \\Drupal\\chart_intigration\\ChartEntityInterface $revision */\n $revision = $chart_entity_storage->loadRevision($vid);\n // Only show revisions that are affected by the language that is being\n // displayed.\n if ($revision->hasTranslation($langcode) && $revision->getTranslation($langcode)->isRevisionTranslationAffected()) {\n $username = [\n '#theme' => 'username',\n '#account' => $revision->getRevisionUser(),\n ];\n\n // Use revision link to link to revisions that are not active.\n $date = $this->dateFormatter->format($revision->getRevisionCreationTime(), 'short');\n if ($vid != $chart_entity->getRevisionId()) {\n $link = $this->l($date, new Url('entity.chart_entity.revision', [\n 'chart_entity' => $chart_entity->id(),\n 'chart_entity_revision' => $vid,\n ]));\n }\n else {\n $link = $chart_entity->link($date);\n }\n\n $row = [];\n $column = [\n 'data' => [\n '#type' => 'inline_template',\n '#template' => '{% trans %}{{ date }} by {{ username }}{% endtrans %}{% if message %}<p class=\"revision-log\">{{ message }}</p>{% endif %}',\n '#context' => [\n 'date' => $link,\n 'username' => $this->renderer->renderPlain($username),\n 'message' => [\n '#markup' => $revision->getRevisionLogMessage(),\n '#allowed_tags' => Xss::getHtmlTagList(),\n ],\n ],\n ],\n ];\n $row[] = $column;\n\n if ($latest_revision) {\n $row[] = [\n 'data' => [\n '#prefix' => '<em>',\n '#markup' => $this->t('Current revision'),\n '#suffix' => '</em>',\n ],\n ];\n foreach ($row as &$current) {\n $current['class'] = ['revision-current'];\n }\n $latest_revision = FALSE;\n }\n else {\n $links = [];\n if ($revert_permission) {\n $links['revert'] = [\n 'title' => $this->t('Revert'),\n 'url' => $has_translations ?\n Url::fromRoute('entity.chart_entity.translation_revert', [\n 'chart_entity' => $chart_entity->id(),\n 'chart_entity_revision' => $vid,\n 'langcode' => $langcode,\n ]) :\n Url::fromRoute('entity.chart_entity.revision_revert', [\n 'chart_entity' => $chart_entity->id(),\n 'chart_entity_revision' => $vid,\n ]),\n ];\n }\n\n if ($delete_permission) {\n $links['delete'] = [\n 'title' => $this->t('Delete'),\n 'url' => Url::fromRoute('entity.chart_entity.revision_delete', [\n 'chart_entity' => $chart_entity->id(),\n 'chart_entity_revision' => $vid,\n ]),\n ];\n }\n\n $row[] = [\n 'data' => [\n '#type' => 'operations',\n '#links' => $links,\n ],\n ];\n }\n\n $rows[] = $row;\n }\n }\n\n $build['chart_entity_revisions_table'] = [\n '#theme' => 'table',\n '#rows' => $rows,\n '#header' => $header,\n ];\n\n return $build;\n }", "function history($model, $id, $conditions = null, $fields = null, $order = null, $limit = null, $recursive = null) {\n\t\t\n\t\textract($this->settings[$model->alias]);\n\t\t\n\t\tif (!$id) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$model = new $model->alias;\n\t\t$version = $model->revision(null, true);\n\t\t$conditions = array(\n\t\t\t$version->alias.'.'.$version->primaryKey => $id\n\t\t);\n\t\t$results = $version->findAll($conditions, $fields, $order, $limit, $recursive);\n\t\t\n\t\t$dates = Set::extract($results, \"{n}.$version->alias.$date_start\");\n\t\tforeach ($version->__associations as $association) {\n\t\t\tforeach ($version->$association as $name => $assoc) {\n\t\t\t\tswitch ($association) {\n\t\t\t\t\tcase 'hasOne':\n\t\t\t\t\tcase 'belongsTo':\n\t\t\t\t\t\t$dates = array_merge($dates, Set::extract($results, \"{n}.$name.$date_start\"));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'hasAndBelongsToMany':\n\t\t\t\t\tcase 'hasMany':\n\t\t\t\t\t\t$data = Set::extract($results, \"{n}.$name.{n}.$date_start\");\n\t\t\t\t\t\t$dates = array_merge($dates, $this->__flatten($data));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tunset($results);\n\t\t$dates = Set::filter(array_unique($dates));\n\t\t$revisions = array();\n\t\tforeach ($dates as $d) {\n\t\t\t$model = new $model->alias;\n\t\t\t$version = $model->revision($d);\n\t\t\t$conditions = array(\n\t\t\t\t$version->alias.'.'.$version->primaryKey => $id\n\t\t\t);\n\t\t\t$tmp = $version->find($conditions, $fields, $order, $limit, $recursive);\n\t\t\tif (!empty($tmp)) {\n\t\t\t\t$revisions[$d] = $tmp;\n\t\t\t}\n\t\t}\n\t\tkrsort($revisions);\n\t\treturn $revisions;\n\t}", "public function get()\n\t{\n\t\t$pagingModel = new \\Vtiger_Paging_Model();\n\t\t$limit = 100;\n\t\tif ($requestLimit = $this->controller->request->getHeader('x-row-limit')) {\n\t\t\t$limit = (int) $requestLimit;\n\t\t}\n\t\t$pagingModel->set('limit', $limit);\n\t\tif ($requestOffset = $this->controller->request->getHeader('x-row-offset')) {\n\t\t\t$pagingModel->set('page', (int) $requestOffset);\n\t\t}\n\t\t$recentActivities = \\ModTracker_Record_Model::getUpdates($this->controller->request->getInteger('record'), $pagingModel, 'changes');\n\t\t$response = [];\n\t\t$isRawData = $this->isRawData();\n\t\tforeach ($recentActivities as $recordModel) {\n\t\t\t$row = [\n\t\t\t\t'time' => $recordModel->get('changedon'),\n\t\t\t\t'owner' => $recordModel->getModifiedBy()->getDisplayName(),\n\t\t\t\t'status' => \\App\\Language::translate($recordModel->getStatusLabel(), 'ModTracker'),\n\t\t\t];\n\t\t\tif ($isRawData) {\n\t\t\t\t$row['rawOwner'] = $recordModel->getModifiedBy()->getId();\n\t\t\t\t$row['rawStatus'] = $recordModel->getStatusLabel();\n\t\t\t}\n\t\t\tif ($recordModel->isCreate() || $recordModel->isUpdate() || $recordModel->isTransferEdit()) {\n\t\t\t\t$data = [];\n\t\t\t\tforeach ($recordModel->getFieldInstances() as $fieldModel) {\n\t\t\t\t\tif ($fieldModel && ($fieldInstance = $fieldModel->getFieldInstance()) && $fieldInstance->isViewable() && 5 !== $fieldModel->getFieldInstance()->getDisplayType()) {\n\t\t\t\t\t\t$fieldName = $fieldInstance->getName();\n\t\t\t\t\t\t$data[$fieldName]['from'] = $fieldInstance->getUITypeModel()->getHistoryDisplayValue($fieldModel->get('prevalue'), $recordModel, true);\n\t\t\t\t\t\t$data[$fieldName]['to'] = $fieldInstance->getUITypeModel()->getHistoryDisplayValue($fieldModel->get('postvalue'), $recordModel, true);\n\t\t\t\t\t\tif ($isRawData) {\n\t\t\t\t\t\t\t$data[$fieldName]['rawFrom'] = $fieldModel->get('prevalue');\n\t\t\t\t\t\t\t$data[$fieldName]['rawTo'] = $fieldModel->get('postvalue');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$row['data'] = $data;\n\t\t\t} elseif ($recordModel->isRelationLink() || $recordModel->isRelationUnLink()) {\n\t\t\t\t$relationInstance = $recordModel->getRelationInstance();\n\t\t\t\t$row['data'] = [\n\t\t\t\t\t'targetModule' => $relationInstance->get('targetmodule'),\n\t\t\t\t\t'targetLabel' => $relationInstance->getValue(),\n\t\t\t\t];\n\t\t\t\tif ($isRawData) {\n\t\t\t\t\t$row['data']['targetId'] = $relationInstance->get('targetid');\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($row) {\n\t\t\t\t$response[] = $row;\n\t\t\t}\n\t\t}\n\t\treturn $response;\n\t}", "function getRevisions($id, $first, $num, $chunk_size = 8192, $media = false) {\n if($media) {\n $changelog = new MediaChangeLog($id, $chunk_size);\n } else {\n $changelog = new PageChangeLog($id, $chunk_size);\n }\n return $changelog->getRevisions($first, $num);\n}" ]
[ "0.6538435", "0.64730597", "0.63061416", "0.6301983", "0.62602484", "0.6227662", "0.6194535", "0.61858845", "0.6175312", "0.61180776", "0.609852", "0.5973929", "0.5926711", "0.58471656", "0.58252126", "0.5820514", "0.5805482", "0.5799422", "0.5775162", "0.57645726", "0.57473135", "0.5625342", "0.56055015", "0.5591717", "0.55910224", "0.55837303", "0.55580795", "0.5464766", "0.5460413", "0.5459962" ]
0.75230974
0
This is a helper function to get all partial layouts list.
public static function allList() { $keys = array_keys(\One::app()->layoutManager->getPartialLayouts()); $list = []; foreach ($keys as $key) { $list[$key] = ucfirst($key); } return $list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLayoutList()\n {\n // get a list of all the layouts\n $layouts = File::files(base_path(config('pilot.plugins.pages.pathToPageLayouts', 'vendor/flex360/pilot/resources/views/layouts')));\n\n // clean up paths\n foreach ($layouts as $index => $layout) {\n // manipulate the path into a blade friendly form\n $layout = str_replace(base_path(config('pilot.plugins.pages.pathToLayoutCleanup', 'vendor/flex360/pilot/resources/views/')), '', $layout);\n\n $layout = str_replace('.blade.php', '', $layout);\n\n $layout = str_replace('.php', '', $layout);\n\n $layout = str_replace('/', '.', $layout);\n\n // remove the old layout\n unset($layouts[$index]);\n\n // add the layout in a select list friendly format\n $layouts[$layout] = ucfirst(substr($layout, strrpos($layout, '.') + 1));\n\n // remove any ignored layouts\n $ignoredLayouts = config('pilot.plugins.pages.ignoredLayouts');\n\n // ignore home layout when not the root page\n if (!$this->isRoot()) {\n $ignoredLayouts[] = 'layouts.home';\n }\n\n if (in_array($layout, $ignoredLayouts)) {\n unset($layouts[$layout]);\n }\n }\n\n return $layouts;\n }", "public static function getLayouts(): array;", "function getLayouts(): array\n {\n return array_keys($this->options['layouts']);\n }", "public static function getLayouts() {\n static $layouts = FALSE;\n\n if (!$layouts) {\n // This can be called before ds_update_8003() has run. If that is the case\n // return an empty array and don't static cache anything.\n if (!\\Drupal::hasService('plugin.manager.core.layout')) {\n return [];\n }\n $layouts = \\Drupal::service('plugin.manager.core.layout')->getDefinitions();\n }\n\n return $layouts;\n }", "public static function getAllLayouts()\n\t{\n\t\t$all = (new \\App\\Db\\Query())->select(['name', 'label'])->from('vtiger_layout')->all();\n\t\t$folders = [\n\t\t\t'basic' => Language::translate('LBL_DEFAULT'),\n\t\t];\n\t\tforeach ($all as $row) {\n\t\t\t$folders[$row['name']] = Language::translate($row['label']);\n\t\t}\n\n\t\treturn $folders;\n\t}", "public function get_layouts() {\n\t\treturn $this->layouts;\n\t}", "public function getPageLayouts()\n\t{\n\t\t$objLayout = $this->Database->execute(\"SELECT l.id, l.name, t.name AS theme FROM tl_layout l LEFT JOIN tl_theme t ON l.pid=t.id ORDER BY t.name, l.name\");\n\n\t\tif ($objLayout->numRows < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t$return = array();\n\n\t\twhile ($objLayout->next())\n\t\t{\n\t\t\t$return[$objLayout->theme][$objLayout->id] = $objLayout->name;\n\t\t}\n\n\t\treturn $return;\n\t}", "private function getPartials()\n {\n return [\n 'partial1' => 'partials.set_event',\n 'partial3' => 'partials.manage_notification',\n 'partial4' => 'partials.view_calendar',\n 'partial2' => 'partials.generate_attendance'\n ];\n }", "protected function get_layouts() {\n\t\treturn [\n\t\t\t'carousel' => __( 'Box Carousel', 'web-stories' ),\n\t\t\t'circles' => __( 'Circle Carousel', 'web-stories' ),\n\t\t\t'grid' => __( 'Grid', 'web-stories' ),\n\t\t\t'list' => __( 'List', 'web-stories' ),\n\t\t];\n\t}", "private function getPartials()\n\t{\n\t\t$partials = $this->kpiRepository->partials(\n\t\t\tconfig('filter.vendor'),\n\t\t\tconfig('filter.technologies')\n\t\t);\n\n\t\t$availablePartials = $this->partialsArrayFrom(\n\t\t\t$this->kpis\n\t\t);\n\n\t\tforeach ($partials as $partial) {\n\t\t\tif(in_array($partial->name, $availablePartials)) {\n\t\t\t\t$this->partials[$partial->vendor][$partial->tech][] = $partial;\n\t\t\t}\t\t\n\t\t}\n\t}", "public function layout(): iterable\n {\n $template = Layout::view('platform::dummy.block');\n\n return [\n Layout::split([\n $template,\n $template,\n ])->ratio('30/70')->reverseOnPhone(),\n\n Layout::split([\n $template,\n $template,\n ])->ratio('40/60'),\n\n Layout::split([\n $template,\n $template,\n ])->ratio('50/50'),\n\n Layout::split([\n $template,\n $template,\n ])->ratio('60/40'),\n\n Layout::split([\n $template,\n $template,\n ])->ratio('70/30'),\n ];\n }", "protected function getLayouts() {\n $lReadOnly = (!$this -> mUsr -> canEdit('job-cms.template')) ? ' disabled' : '';\n $lArr = CCor_Res::get('htb', array('domain' => 'phl'));\n aSort($lArr);\n \n $lLayouts = array_merge(array(\"\" => \"\"), $lArr);\n\t$lRet = '<select id=\"layout1\" name=\"layout\" class=\"cms_lay w100p\" onchange=\"Flow.cmsTemplate.addItem(this);\"'.$lReadOnly.'>';\n foreach ($lLayouts as $lKey => $lName) {\n $lRet.= '<option value=\"'.$lKey.'\">'.htm($lName).'</option>'.LF;\n }\n $lRet.= '</select>';\n \n return $lRet;\n }", "public static function fmxListLayouts()\n\t{\n\t\tglobal $fmx_host;\n\t\tglobal $fmx_database;\n\t\t\n\t\t// assemble the URL\n\t\t$udat['protocal'] = FMX_PROTOCAL;\n\t\t$udat['space'] = '';\n\t\t$udat['host'] = $fmx_host;\n\t\t$udat['fmi'] = 'fmi';\n\t\t$udat['data'] = 'data';\n\t\t$udat['apiVersion'] = FMX_APIVERSION;\n\t\t$udat['databases'] = 'databases';\n\t\t$udat['database'] = $fmx_database;\n\t\t$udat['layouts'] = 'layouts';\n\t\t$url = implode($udat,'/');\n\t\t\n\t\t// send request to FileMaker Server\n\t\t$result = SELF::curlFileMaker($url,NULL,'GET');\n\t\t\n\t\treturn $result;\n\t}", "function getI55Layouts() {\n return array(\n 'default' => 'default',\n 'tabbed' => 'tabbed',\n 'stacking' => 'stacking'\n );\n}", "public function getLayoutsAttribute()\n {\n\n $layout = Layout::getAllLists($this->template_id);\n\n return $layout;\n }", "public function declaredLayouts() {\n $cid = self::class . '::' . __FUNCTION__;\n $info = &drupal_static($cid);\n if (isset($info)) {\n return $info;\n }\n if ($cache = $this->cache->get($cid)) {\n return $info = $cache->data;\n }\n $info = [];\n foreach ($this->hookThemes() as $theme) {\n $info = drupal_array_merge_deep($info, $theme->invokeLayoutHook());\n }\n foreach ($info as $name => &$i) {\n $i += ['name' => $name, 'fields' => []];\n foreach ($i['fields'] as $field_name => &$f) {\n $f += [\n 'display' => [],\n 'variable' => $field_name,\n ];\n }\n }\n $this->cache->set($cid, $info);\n return $info;\n }", "public function layouts() {\n\t\trequire_once FUSION_BUILDER_PLUGIN_DIR . 'inc/admin-screens/layouts.php';\n\t}", "function themeslist() {\n\t$layouts = array();\n\n\tif ($handle = opendir(dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'layouts')) {\n\t\twhile (false !== ($file = readdir($handle))) {\n\t\t\tif ($file != \".\" && $file != \"..\" && is_dir(dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'layouts'.DIRECTORY_SEPARATOR.$file) && file_exists(dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'layouts'.DIRECTORY_SEPARATOR.$file.DIRECTORY_SEPARATOR.'css'.DIRECTORY_SEPARATOR.'cometchat.css')) {\n\t\t\t\t$layouts[] = $file;\n\t\t\t}\n\t\t}\n\t\tclosedir($handle);\n\t}\n\n\n\treturn $layouts;\n}", "public static function getAvailableLayouts($theme);", "protected function FetchLayoutFiles()\n {\n $dir = APP.'Template'.DS.'Layout'.DS;\n $res = scandir($dir);\n // debug($res);\n \n $layoutFiles = array();\n foreach($res as $key => $name)\n {\n if(strpos($name, '.ctp') && in_array($name, ['default.ctp', 'error.ctp', 'installer.ctp']) == false)\n {\n $name = str_replace('.ctp', '', $name);\n $layoutFiles[$name] = $name;\n }\n }\n // debug($layoutFiles);\n \n return $layoutFiles;\n }", "function vb_get_default_view_layouts( $objects = 'posts' ) {\n\n\t$layouts_files = scandir( views()->layouts_dir );\n\n\t$view_layouts = array();\n\tforeach ( $layouts_files as $layout ) {\n\t\tif ( ! is_file( views()->layouts_dir . $layout ) )\n\t\t\tcontinue;\n\n\t\t$is_layout = vb_is_view_layout( views()->layouts_dir . $layout );\n\n\t\tif ( ! $is_layout ) continue;\n\t\t\n\t\t$view_layouts[$layout] = views()->layouts_dir . $layout;\n\t}\n\n\treturn $view_layouts;\n}", "public function formatLayoutTemplateFiles()\n {\n if(defined('THEME_FOLDER')) {\n $name = $this->getName();\n $presenter = substr($name, strrpos(':' . $name, ':'));\n $layout = $this->layout ? $this->layout : 'layout';\n $dir = dirname($this->getReflection()->getFileName());\n $dir = is_dir(\"$dir/templates\") ? $dir : dirname($dir);\n $list = array(\n \"$dir/templates/\" . THEME_FOLDER . \"/$presenter/@$layout.latte\",\n \"$dir/templates/\" . THEME_FOLDER . \"/$presenter.@$layout.latte\",\n \"$dir/templates/\" . THEME_FOLDER . \"/$presenter/@$layout.phtml\",\n \"$dir/templates/\" . THEME_FOLDER . \"/$presenter.@$layout.phtml\",\n );\n do {\n $list[] = \"$dir/templates/\" . THEME_FOLDER . \"/@$layout.latte\";\n $list[] = \"$dir/templates/\" . THEME_FOLDER . \"/@$layout.phtml\";\n $dir = dirname($dir);\n } while ($dir && ($name = substr($name, 0, strrpos($name, ':'))));\n return $list;\n } else {\n return parent::formatLayoutTemplateFiles();\n }\n }", "public function get_client_layouts() {\n\t\treturn $this->client_layouts;\n\t}", "public function add_builder_available_layouts($layouts) {\n\t\tforeach( $this->cp_layouts as $item=>$info) {\n\t\t\t$layouts[] = array(\n\t\t\t\t'layout' => array(\n\t\t\t\t\t'type' => $info['type'],\n\t\t\t\t\t'item' => $item,\n\t\t\t\t\t'specificity' => 'single-' . $item\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn $layouts;\n\t}", "public function getAvailableTemplateLayouts($pageUid) {\n\t\t$templateLayouts = array();\n\n\t\t// Check if the layouts are extended by ext_tables\n\t\tif (isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['if_fluidfeed']['templateLayouts'])\n\t\t\t&& is_array($GLOBALS['TYPO3_CONF_VARS']['EXT']['if_fluidfeed']['templateLayouts'])) {\n\t\t\t$templateLayouts = $GLOBALS['TYPO3_CONF_VARS']['EXT']['if_fluidfeed']['templateLayouts'];\n\t\t}\n\n\t\t// Add TsConfig values\n\t\tforeach($this->getTemplateLayoutsFromTsConfig($pageUid) as $templateKey => $title) {\n\t\t\t$templateLayouts[] = array($title, $templateKey);\n\t\t}\n\n\t\treturn $templateLayouts;\n\t}", "private function getLayoutOptions()\n {\n $layouts = $this->get('finder')->in($this->get('path.theme').'layout')->files();\n $options = array();\n foreach ($layouts as $layout) {\n $options[$layout->getFileName()] = $layout->getFileName();\n }\n\n return $options;\n }", "function acquia_get_layouts_options() {\n $contexts = acquia_get_layout_contexts();\n foreach ($contexts as $layout => &$info) {\n $info = t(str_replace(array(\"-\", \"_\"), \" \", $info));\n }\n\n return $contexts;\n}", "public function getLayout();", "public function getLayout();", "public function layoutOptions() {\n return array_map(function (array $info) {\n return $info['title'];\n }, $this->declaredLayouts());\n }" ]
[ "0.76976055", "0.70900166", "0.69243836", "0.68779564", "0.6837626", "0.6687899", "0.6600866", "0.65536994", "0.6460349", "0.6450029", "0.64074683", "0.6356343", "0.62945515", "0.62181824", "0.6153496", "0.6057986", "0.60212064", "0.59968626", "0.5952724", "0.593242", "0.59265447", "0.5914242", "0.58992404", "0.5847524", "0.5809536", "0.5791509", "0.5664955", "0.56337667", "0.56337667", "0.5631645" ]
0.7635139
1
Serializes the specified data. The default implementation will create a serializer based on the configuration given by [[serializer]]. It then uses the serializer to serialize the given data.
protected function serializeData($data) { return Yii::createObject($this->serializer)->serialize($data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function serialize($data)\n {\n if ($this->serializer === null) {\n return Json::encode($data);\n }\n\n return call_user_func($this->serializer, $data);\n }", "private function serialize($serializerClass,$data){\n\t\tif(!class_exists($serializerClass,true)){\n\t\t\t$this->exitWithError(\"Serializer class $serializerClass does not exist\");\n\t\t}\n\t\t\n\t\t$reflectionClass = new \\ReflectionClass($serializerClass);\n\t\t$serializerInterface = 'PhpPlatform\\RESTFul\\Serialization\\Serialize';\n\t\tif(!($reflectionClass->implementsInterface($serializerInterface))){\n\t\t\t$this->exitWithError(\"$serializerClass does not implement $serializerInterface\");\n\t\t}\n\t\t$serializerInstance = $reflectionClass->newInstance();\n\t\t$serializeMethod = $reflectionClass->getMethod(\"serialize\");\n\t\t\n\t\t$serializedData = $serializeMethod->invoke($serializerInstance,$data);\n\t\treturn $serializedData;\n\t}", "protected function serializeData($data): mixed\n {\n return Yii::createObject($this->serializer)->serialize($data);\n }", "protected function serialize($data)\n {\n return serialize($data);\n }", "public function serialize($data);", "protected function doSerialize($data)\n {\n if ($data instanceof Collection) {\n $serialized['data'] = $this->serializeCollection($data);\n } elseif ($data instanceof Resource) {\n $serialized['data'] = $this->serializeResource($data);\n } elseif (null === $data || [] === $data) {\n $serialized['data'] = $data;\n } else {\n throw new RuntimeException('Unable to serialize the provided data.');\n }\n return $this->serializeIncluded($serialized);\n }", "private function _serialize($data = array())\n {\n \treturn serialize($data);\n }", "public function serialize($data, array $context = [])\n {\n $context = array_merge($this->defaultSerializationContext, $context);\n\n return $this->serializer->serialize($data, $this->serializeTo, $this->createContext($context));\n }", "private function _format_serialize($data = array())\n\t{\n\t\treturn serialize($data);\n\t}", "function serializeData ($data) {\n $obj = json_decode($data, true);\n $newStructure = $this->buildStructureFromObj($obj);\n return serialize($newStructure);\n }", "public function serialize($data)\n {\n if (is_string($data) === true) {\n return $data;\n } else {\n $data = json_encode($data);\n if ($data === '[]') {\n return '{}';\n } else {\n return $data;\n }\n }\n }", "public static function serialize($data)\n\t{\n\t\treturn maybe_serialize($data);\n\t}", "public function serialize($data) {\n return json_encode($data);\n }", "public static function maybe_serialize( $data ) {\n if ( is_array( $data ) || is_object( $data ) )\n return serialize( $data );\n\n if ( self::is_serialized( $data ) )\n return serialize( $data );\n\n return $data;\n }", "protected function _encode($data) {\n return serialize($data);\n }", "public function serialize($data, $format, $groups = null);", "public function serialize($data): string\n {\n return json_encode($data, JSON_THROW_ON_ERROR | $this->options, $this->depth);\n }", "public static function maybe_serialize( $data ) {\n\t\treturn is_array( $data ) ? serialize( $data ) : $data;\n\t}", "public function apply($data) {\n\t\tif ($this->shouldSerialize($data)) {\n\t\t\treturn $this->serializeData($data);\n\t\t}\n\t\treturn $data;\n\t}", "public function serialize($data) : string\n {\n if (is_string($data)) {\n return $data;\n }\n $searchResult = $this->serializer->serialize($data, 'json');\n\n return $searchResult;\n }", "protected function encode($data)\n {\n return serialize($data);\n }", "protected function encode($data)\n {\n return serialize($data);\n }", "public function serialize()\n {\n $data = $this->getData();\n\n return serialize($data);\n }", "public function serialize($data)\n\t{\n\t\treturn Base64Native::serialize($data);\n\t}", "public function getSerializer();", "public static function setSerializer($serializer) \n {\n \tself::$serializer = $serializer;\n }", "protected function _serializeMessage($data)\n {\n return $this->real_call->_serializeMessage($data);\n }", "private function encode($data) {\n return serialize(json_decode(json_encode($data), true));\n }", "public function jsonEncode($data)\n {\n return $this->jsonEncoder->serialize($data);\n }", "public function writeSimple(AbstractType $data){\n return json_encode($this->write($data));\n }" ]
[ "0.7423191", "0.67545813", "0.6754283", "0.6693737", "0.65899974", "0.65317965", "0.6381131", "0.63495773", "0.634186", "0.63383746", "0.6235438", "0.6227941", "0.61409235", "0.6043501", "0.5866347", "0.58660555", "0.582272", "0.57732916", "0.5679064", "0.56114995", "0.5600827", "0.5600827", "0.5516078", "0.5472349", "0.53870237", "0.53153074", "0.5291042", "0.52891856", "0.528778", "0.5284296" ]
0.70737916
1
Reads a file of parameter definitions and set/modify the values therein. If the filename begins with a + or , the BoolVariables will be ORed or ANDed with any current values. Blank lines and lines beginning are ignored. Values may have any whitespace after the name and are the rest of line.
public static function ReadParamsFile( /* const char * */$file, // filename to read /* bool */$init_only, // only set parameters that need to be // initialized when Init() is called /* ParamsVectors * */$member_params) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function parse($filename, $variables = []);", "function pais_params($filename='pais_params.cfg') {\n\ttry {\n\t\tglobal $cfg, $dic;\n\t\tif (file_exists($filename)) {\n\t if ($handle = fopen($filename, 'r')) {\n\t while (!feof($handle)) {\n\t list($type, $name, $value) = preg_split(\"/\\||=/\", fgets($handle), 3);\n\t\t\t\t\tif (trim($type)!='#') { \n\t\t\t\t\t#PARAMS $pais[mexico][variable]\n\t\t\t\t\t\t$pais_params[trim($type)][trim($name)] = trim($value);\n\t\t\t\t\t\t$val.=$type.' | '.$name.' = '.$value.\"<br/>\\n\\r\";\n\t\t\t\t\t}\t\n\t }\t \n\t }\t \n\t\t\treturn $val;\n\t\t}else{\n\t\t\t$msj = \"¡ERROR CRÍTICO!<br/> No se ha logrado cargar el archivo diccionario, por favor, contacte al administrador del sistema.<br/>\";\n\t \tthrow new Exception($msj, 1); \t\n\t }\t\n\t} catch (Exception $e) {\t\t\n\t\tprint($e->getMessage());\n\t\treturn false;\n\t}\t \n}", "private function loadParams($filename) {\n //gets paras from the file\n $siteparams = SpycSceau::YAMLLoad(SCEAU_ROOT_DIR . '/lib/sceau/const/' . $filename);\n //reads all params and stores each one localy\n foreach ($siteparams as $key => $value) {\n $funcname = \"set$key\";\n $this->$funcname($value);\n }\n }", "protected function prepareParams()\n\t{\n\t\t$params = [];\n\t\t$filename = $this->path . 'params.php';\n\n\t\tif (is_file($filename)) {\n\t\t\tinclude($filename);\n\n\t\t\t$this->assign($params);\n\t\t}\n\t}", "function setParameters(&$xp) {\n $this->readInParameters(\"param_em.txt\");\n\n // Now we need to check the input values, and set the pointers to the appropriate data\n foreach ($this->indices as $index) { // loops over all indices in the parameters file\n \t// check the values of the input data (stored in the $xp array) against\n\t// the ranges of the corresponding $xpmin and $xpmax for this index range\n\t// Note: the number of dimensions for $xpmin (and $xpmax) may vary!\n\n\t$dimensions = count($this->parameters[\"xpmin\"][$index]);\n\t$withinRange = true; // this will be set to FALSE if one of the ranges don't match\n\tfor ($i = 0; $i < $dimensions; $i++) {\n\t if ($xp[$i] < $this->parameters[\"xpmin\"][$index][$i] or\n\t \t$xp[$i] > $this->parameters[\"xpmax\"][$index][$i])\n\t\t$withinRange = false;\n }\n\n if ($withinRange == true)\n {\n // print(\"<br>Using parameters from Range $index</br>\");\n\t\t $this->w1 = $this->parameters[\"w1\"][$index];\n\t\t $this->w2 = $this->parameters[\"w2\"][$index]; \n \t $this->w3 = $this->parameters[\"w3\"][$index]; \n \t $this->b1 = $this->parameters[\"b1\"][$index];\n \t $this->b2 = $this->parameters[\"b2\"][$index];\n \t $this->b3 = $this->parameters[\"b3\"][$index];\n \t $this->xtmin = $this->parameters[\"xtmin\"][$index];\n \t $this->xtmax = $this->parameters[\"xtmax\"][$index];\n \t $this->xpmin = $this->parameters[\"xpmin\"][$index];\n \t $this->xpmax = $this->parameters[\"xpmax\"][$index];\n \t return true;\n }\n }\n print(\"<br>No valid ranges found!</br>\");\n return false;\n }", "public function setInputFromFile($file) {\n\t\t$this->inputFromFile = $file;\n\t}", "public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters)\n {\n // Nothing to do. Function called with one or more parameters.\n }", "function values_from_file($file,$template,$param){\n\t$lines = file_get_contents($file);\n\t$lines = trim($lines);\n\t$lines = explode(\"\\n\", $lines);\n\t$lines = array_map('trim',$lines);\n\t\n\t$new_lines = array();\n\tforeach( $lines as $item){\n\t\t$parts = explode('=',$item);\n\t\t$parts = array_map('trim',$parts);\n\t\t$new_lines[] = \"<xsl:when test=\\\"current()='$parts[1]'\\\">$parts[0]</xsl:when>\";\n\t}\n\n\t$lines = implode(\"\\n\",$new_lines);\n\treturn $lines;\n}", "function jot_prepare_file_vars($file = null) {\n\n\t// input names => defaults\n\t$values = array(\n\t\t'title' => '',\n\t\t'description' => '',\n\t\t'access_id' => ACCESS_DEFAULT,\n\t\t'tags' => '',\n\t\t'container_guid' => elgg_get_page_owner_guid(),\n\t\t'guid' => null,\n\t\t'entity' => $file,\n\t);\n\n\tif ($file) {\n\t\tforeach (array_keys($values) as $field) {\n\t\t\tif (isset($file->$field)) {\n\t\t\t\t$values[$field] = $file->$field;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (elgg_is_sticky_form('file')) {\n\t\t$sticky_values = elgg_get_sticky_values('file');\n\t\tforeach ($sticky_values as $key => $value) {\n\t\t\t$values[$key] = $value;\n\t\t}\n\t}\n\n\telgg_clear_sticky_form('file');\n\n\treturn $values;\n}", "public function load()\n {\n $lines = explode(\"\\n\", $this->text);\n\n foreach ($lines as $line) {\n $data = explode(\"=\", $line);\n\n if (!defined($data[0]) && isset($data[1])) {\n define($data[0], $data[1]);\n }\n }\n }", "public function setVariables($variables);", "public function setFileParameters(array $params = [])\n {\n foreach ($params as $key => $value) {\n $this->request->addPostFile($key, $value);\n }\n }", "function set_file($strFile, $arrContent, $boolFile = true)\n\t{\n\t\t$this->boolFile = $boolFile;\n\t\t// sets $this->strFileContent\n\t\t$this->open_file($strFile);\n\t\t$this->arrContent = $arrContent;\n\t}", "public function updateINI($file, $params = null, $profile = '')\n {\n if (!$profile) {\n $profile = $this->currentProfile;\n }\n if (!file_exists($file)) {\n return false;\n }\n $iniLines = file($file);\n $iniParams = [];\n foreach ($iniLines as $num => $line) {\n $line = trim($line);\n if (empty($line) || in_array(substr($line, 0, 1), [';','#'])) {\n continue;\n }\n list($id, $value) = explode('=', $line, 2);\n $id = trim($id);\n $iniParams[$id] = $num;\n }\n if ($params === null) {\n $params = array_keys($this->params[$profile]);\n }\n\n foreach ($params as $id) {\n if (isset($iniParams[$id])) {\n $iniLines[$iniParams[$id]] = $id.' = '.$this->getValue($id, $profile).\"\\n\";\n } else {\n $line = \"\\n\";\n if (isset($this->params[$profile][$id]['label'])) {\n $line .= '# '.$this->params[$profile][$id]['label'].\"\\n\";\n }\n if (isset($this->params[$profile][$id]['description'])) {\n $line .= '# '.$this->params[$profile][$id]['description'].\"\\n\";\n }\n if (isset($this->params[$profile][$id]['values'])) {\n $line .= '# allowed values: ';\n for ($i = 0, $l = count($this->params[$profile][$id]['values']); $i < $l; $i++) {\n $line .= $this->params[$profile][$id]['values'][$i];\n if ($i < $l - 1) {\n $line .= ', ';\n }\n }\n $line .= \"\\n\";\n }\n $iniLines[] = $line.$id.' = '.$this->getValue($id, $profile).\"\\n\";\n }\n }\n file_put_contents($file, implode('', $iniLines));\n\n return true;\n }", "function parse_config_file ($filename) {\n\tif (!file_exists($filename)) {\n\t\treturn false;\n\t}\n\tif (substr($filename, -4, 4) === '.ini') {\n\t\t$return = array();\n\t\t$lines = file($filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n\t\tif ($lines === false) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!empty($lines)) {\n\t\t\tforeach ($lines as $linenum => $linestr) {\n\t\t\t\tif (substr($linestr, 0, 1) === ';') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$line = explode(' = ', $linestr);\n\t\t\t\t$key = trim($line[0]);\n\t\t\t\tif ((isset($line[1])) && (substr($key, 0, 1) !== '[')) {\n\t\t\t\t\tif (isset($value)) {\n\t\t\t\t\t\tunset($value);\n\t\t\t\t\t}\n\t\t\t\t\tif ((substr($line[1], 0, 1) === '\"') && (substr($line[1], -1, 1) === '\"')) {\n\t\t\t\t\t\t$value = str_replace(array('\\\\\"', '\\\\\\\\'), array('\"', '\\\\'), substr($line[1], 1, -1));\n\t\t\t\t\t}\n\t\t\t\t\telseif ((ctype_digit($line[1])) || ((substr($line[1], 0, 1) === '-') && (ctype_digit(substr($line[1], 1))))) {\n\t\t\t\t\t\t$num = $line[1];\n\t\t\t\t\t\tif (substr($num, 0, 1) === '-') {\n\t\t\t\t\t\t\t$num = substr($line[1], 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (substr($num, 0, 1) === '0') {\n\t\t\t\t\t\t\tif (substr($line[1], 0, 1) === '-') {\n\t\t\t\t\t\t\t\t$value = -octdec($line[1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$value = octdec($line[1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$value = (int)$line[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunset($num);\n\t\t\t\t\t}\n\t\t\t\t\telseif ($line[1] === 'true') {\n\t\t\t\t\t\t$value = true;\n\t\t\t\t\t}\n\t\t\t\t\telseif ($line[1] === 'false') {\n\t\t\t\t\t\t$value = false;\n\t\t\t\t\t}\n\t\t\t\t\telseif ($line[1] === 'null') {\n\t\t\t\t\t\t$value = null;\n\t\t\t\t\t}\n\t\t\t\t\telseif (preg_match('/^0[xX][0-9a-fA-F]+$/', $line[1])) {\n\t\t\t\t\t\t$value = hexdec(substr($line[1], 2));\n\t\t\t\t\t}\n\t\t\t\t\telseif (preg_match('/^\\-0[xX][0-9a-fA-F]+$/', $line[1])) {\n\t\t\t\t\t\t$value = -hexdec(substr($line[1], 3));\n\t\t\t\t\t}\n\t\t\t\t\telseif (preg_match('/^0b[01]+$/', $line[1])) {\n\t\t\t\t\t\t$value = bindec(substr($line[1], 2));\n\t\t\t\t\t}\n\t\t\t\t\telseif (preg_match('/^\\-0b[01]+$/', $line[1])) {\n\t\t\t\t\t\t$value = -bindec(substr($line[1], 3));\n\t\t\t\t\t}\n\t\t\t\t\telseif (filter_var($line[1], FILTER_VALIDATE_FLOAT) !== false) {\n\t\t\t\t\t\t$value = (float)$line[1];\n\t\t\t\t\t}\n\t\t\t\t\telseif (defined($line[1])) {\n\t\t\t\t\t\t$value = constant($line[1]);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ttrigger_error('Unknown value in ini file on line ' . ($linenum + 1) . ': ' . $linestr, E_USER_WARNING);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($value)) {\n\t\t\t\t\t\tif (!isset($lastkey)) {\n\t\t\t\t\t\t\t$return[$key] = $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$return = array_merge_recursive_distinct($return, string_to_nested_array($lastkey, array($key => $value)));\n\t\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\t$lastkey = substr($key, 1, -1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $return;\n\t}\n\telseif (substr($filename, -4, 4) === '.php') {\n\t\tinclude $filename;\n\t\tif ((isset($config)) && (is_array($config))) {\n\t\t\treturn $config;\n\t\t}\n\t}\n\treturn false;\n}", "private function loadParams($fileName = '', $paramName = '')\n {\n if (empty($fileName)) {\n $fileName = $this->paramsFileName;\n }\n\n foreach ($this->pathsToParams as $path) {\n $path = $this->absPath . $path;\n\n // Loading of base parameters\n $this->paramsMerge($this->values, $this->loadParamsFromFile(\n $path . $fileName, $paramName\n ));\n\n // Loading of alternate domain parameters fo debug\n if (!empty($this->alternateDomain)) {\n $this->paramsMerge($this->values, $this->loadParamsFromFile(\n $path . $this->pathDomains . $this->alternateDomain . '/' . $fileName, $paramName\n ));\n }\n // Loading of domain parameters\n if (!empty($this->workDomain)) {\n $this->paramsMerge($this->values, $this->loadParamsFromFile(\n $path . $this->pathDomains . $this->workDomain . '/' . $fileName, $paramName\n ));\n }\n }\n }", "protected static function editParameter($depends, array $params)\n {\n if(count($depends) > 0 && count($params) > 0){\n foreach ($depends as $key => $value) {\n if(!preg_match('/array(\\s+)\\$(.*?)/', $value) && !preg_match('/\\$(.*?)(\\s+)\\=(\\s+)(.*?)/', $value)){\n unset($depends[$key]);\n }\n }\n\n if(count($depends) == count($params)) return $params;\n\n $depends = array_values($depends);\n $params = array_values($params);\n\n foreach($depends as $key => $dep){\n if(!isset($params[$key])){\n $newParm = preg_split('/\\=/',$dep);\n \n if(count($newParm) > 1){\n $newParm = trim(array_filter($newParm)[1]);\n }\n\n if(! is_array($newParm) && strtolower($newParm) == 'false'){\n $params[] = false;\n }\n elseif(! is_array($newParm) && strtolower($newParm) == 'true'){\n $params[] = true;\n }else{\n $params[] = $newParm;\n }\n }\n }\n }\n return $params;\n }", "function readConfigParams($paramList = array())\n{\n $rtn = array();\n global $pgpoolConfigParam, $pgpoolConfigBackendParam,\n $pgpoolConfigWdOtherParam, $pgpoolConfigHbDestinationParam,\n $pgpoolConfigWdNodeParam, $pgpoolConfigWdHbNodeParam;\n\n // Try to read pgpool.conf\n $configFile = @file(_PGPOOL2_CONFIG_FILE);\n if ($configFile == FALSE) {\n $errTpl = new Smarty();\n $errTpl->assign('message', $_SESSION[SESSION_MESSAGE]);\n errorPage('e4');\n }\n\n // Defined array in definePgpoolConfParam.php\n $defines_arr = $pgpoolConfigParam + $pgpoolConfigBackendParam +\n $pgpoolConfigWdOtherParam + $pgpoolConfigHbDestinationParam +\n $pgpoolConfigWdNodeParam + $pgpoolConfigWdHbNodeParam;\n\n $arr = array();\n // Convert lines in files to array\n foreach ($configFile as $line_num => $line) {\n $line = trim($line);\n if (substr($line, 0, 1) == '#' || strpos($line, '=') === FALSE) {\n continue;\n }\n\n list($key, $value) = explode('=', $line);\n\n // 設定ファイルのパラメータのキー\n $key = trim($key);\n\n switch ($key) {\n case 'recovery_1st_stage_command':\n case 'recovery_2nd_stage_command':\n $key_wo_num = $key;\n break;\n\n default:\n // In case of \"health_check_*0\", the number is left.\n $num = preg_replace('/[^0-9]/', NULL, $key);\n $key_wo_num = str_replace($num, NULL, $key);\n break;\n }\n\n // Ignore params not specified to read\n if ($paramList && is_array($paramList) && ! in_array($key_wo_num, $paramList)) {\n continue;\n }\n\n // Remove quotes and comments\n $value = trimValue($value);\n\n // Change true/false to on/off\n if ($value == 'true') {\n $value = 'on';\n } elseif ($value == 'false') {\n $value = 'off';\n }\n\n if (! isset($defines_arr[$key_wo_num])) {\n continue;\n\n // Params with multiple values\n // (backend_*, other_pgpool_*, heartbeat_destination_*, heartbeat_device*)\n } elseif (isset($defines_arr[$key_wo_num]['multiple']) &&\n $defines_arr[$key_wo_num]['multiple'] == TRUE)\n {\n $rtn[$key_wo_num][$num] = $value;\n\n } else {\n // Ignore param not defined definePgpoolConfParam.php\n if (preg_match('/^(health_check|connect_time).*[0-9]$/', $key)) {\n // In case of \"health_check_*0\", the number is left.\n $rtn[$key] = $value;\n } else {\n $rtn[$key_wo_num] = $value;\n }\n }\n }\n\n // Set default value if there is no line about the param\n if ($paramList && is_array($paramList)) {\n foreach ($paramList as $key) {\n if (! isset($rtn[$key]) || $rtn[$key] == NULL) {\n $default_value = $defines_arr[$key]['default'];\n\n if (isset($defines_arr[$key]['multiple']) &&\n $defines_arr[$key]['multiple'])\n {\n $rtn[$key][0] = $default_value;\n } else {\n $rtn[$key] = $default_value;\n }\n }\n }\n\n } elseif ($defines_arr) {\n foreach ($defines_arr as $key => $param_info) {\n if (! isset($rtn[$key])) {\n $default_value = (isset($defines_arr[$key]['default'])) ?\n $defines_arr[$key]['default'] : NULL;\n\n if (isset($defines_arr[$key]['multiple']) &&\n $defines_arr[$key]['multiple'])\n {\n $rtn[$key][0] = $default_value;\n } else {\n $rtn[$key] = $default_value;\n }\n }\n }\n }\n\n return $rtn;\n}", "function alterParameters(&$parms) {\n drupal_alter('forena_parameters', $this->report_name, $parms );\n }", "public function LoadParameters()\n {\n $parameters = array();\n \n $file = file($this->InputPath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n\n foreach ($file as $key => $line) \n {\n \n if (is_null($line) or empty($line) or strpos(substr($line, 0, 5), '//')!== false )\n {\n continue;\n }\n \n list($keyValue, $value) = explode(\"=\", $line);\n\n if ((is_null($value)) or empty($value))\n {\n throw new ConfigurationException(\"No value defined in [\".$line.\"] line of ini file.\");\n }\n \n $value = trim($value); \n if (strtolower($value) == \"null\")\n {\n $value = \"\";\n }\n else\n {\n $value = trim($value);\n }\n \n $keyValue = trim($keyValue);\n if ($keyValue == \"URL OK\")\n {\n $keyValue = \"URL_OK\";\n } \n else if ($keyValue == \"URL Error\")\n {\n $keyValue = \"URL_ERROR\";\n } \n else if ($keyValue == \"Encoding Method\")\n {\n $keyValue = \"EncodingMethod\";\n } \n \n $parameters[$keyValue] = $value; \n }\n \n Log::Info(\"File [\".$this->InputPath.\"] has been loaded.\");\n \n return $parameters;\n }", "function config($file) {\n\t\tpreg_match_all(\n\t\t\t'/(?<=^|\\n)(?:'.\n\t\t\t\t'\\[(?<section>.+?)\\]|'.\n\t\t\t\t'(?<lval>[^\\h\\r\\n;].*?)\\h*=\\h*'.\n\t\t\t\t'(?<rval>(?:\\\\\\\\\\h*\\r?\\n|.+?)*)'.\n\t\t\t')(?=\\r?\\n|$)/',\n\t\t\t$this->read($file),\n\t\t\t$matches,PREG_SET_ORDER);\n\t\tif ($matches) {\n\t\t\t$sec='globals';\n\t\t\tforeach ($matches as $match) {\n\t\t\t\tif ($match['section']) {\n\t\t\t\t\t$sec=$match['section'];\n\t\t\t\t\tif (preg_match('/^(?!(?:global|config|route|map|redirect)s\\b)'.\n\t\t\t\t\t\t'((?:\\.?\\w)+)/i',$sec,$msec) && !$this->exists($msec[0]))\n\t\t\t\t\t\t$this->set($msec[0],NULL);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (preg_match('/^(config|route|map|redirect)s\\b/i',\n\t\t\t\t\t\t$sec,$cmd)) {\n\t\t\t\t\t\tcall_user_func_array(\n\t\t\t\t\t\t\tarray($this,$cmd[1]),\n\t\t\t\t\t\t\tarray_merge(array($match['lval']),\n\t\t\t\t\t\t\t\tstr_getcsv($match['rval'])));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$args=array_map(\n\t\t\t\t\t\t\tfunction($val) {\n\t\t\t\t\t\t\t\tif (is_numeric($val))\n\t\t\t\t\t\t\t\t\treturn $val+0;\n\t\t\t\t\t\t\t\t$val=ltrim($val);\n\t\t\t\t\t\t\t\tif (preg_match('/^\\w+$/i',$val) &&\n\t\t\t\t\t\t\t\t\tdefined($val))\n\t\t\t\t\t\t\t\t\treturn constant($val);\n\t\t\t\t\t\t\t\treturn trim(preg_replace(\n\t\t\t\t\t\t\t\t\tarray('/\\\\\\\\\"/','/\\\\\\\\\\h*(\\r?\\n)/'),\n\t\t\t\t\t\t\t\t\tarray('\"','\\1'),$val));\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t// Mark quoted strings with 0x00 whitespace\n\t\t\t\t\t\t\tstr_getcsv(preg_replace('/(?<!\\\\\\\\)(\")(.*?)\\1/',\n\t\t\t\t\t\t\t\t\"\\\\1\\x00\\\\2\\\\1\",$match['rval']))\n\t\t\t\t\t\t);\n\t\t\t\t\t\tpreg_match('/^(?<section>[^:]+)(?:\\:(?<func>.+))?/',\n\t\t\t\t\t\t\t$sec,$parts);\n\t\t\t\t\t\t$func=isset($parts['func'])?$parts['func']:NULL;\n\t\t\t\t\t\t$custom=(strtolower($parts['section'])!='globals');\n\t\t\t\t\t\tif ($func)\n\t\t\t\t\t\t\t$args=array($this->call($func,\n\t\t\t\t\t\t\t\tcount($args)>1?array($args):$args));\n\t\t\t\t\t\tcall_user_func_array(\n\t\t\t\t\t\t\tarray($this,'set'),\n\t\t\t\t\t\t\tarray_merge(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t($custom?($parts['section'].'.'):'').\n\t\t\t\t\t\t\t\t\t$match['lval']\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tcount($args)>1?array($args):$args\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}\n\t\treturn $this;\n\t}", "public static function ReadParamsFromFp(/* FILE * */$fp, /* inT64 */$end_offset, /* bool */$init_only,\n ParamsVectors $member_params) {\n $line[MAX_PATH]; // input line\n $anyerr = false; // true if any error\n $foundit; // found parameter\n $length; // length of line\n $valptr; // value field\n\n while (($end_offset < 0 || ftell($fp) < $end_offset) && fgets($line, MAX_PATH, $fp)) {\n if ($line[0] != '\\n' && $line[0] != '#') {\n $length = strlen($line);\n if ($line[$length - 1] == '\\n')\n $line[length - 1] = '\\0'; // cut newline\n for ($valptr = $line; $valptr && $valptr != ' ' && $valptr != '\\t';\n $valptr++);\n if ($valptr) {\n // found blank\n $valptr = '\\0'; // make name a string\n do\n $valptr++; // find end of blanks\n while ($valptr == ' ' || $valptr == '\\t');\n }\n $foundit = self::SetParam($line, $valptr, $init_only, $member_params);\n\n if (!$foundit) {\n $anyerr = true; // had an error\n tprintf(\"read_params_file: parameter not found: %s\\n\", line);\n exit(1);\n }\n }\n }\n return $anyerr;\n }", "protected function processVariableInString( File $phpcsFile, $stackPtr ) {\n\t\t$tokens = $phpcsFile->getTokens();\n\n\t\t// There will always be embeds if the processVariableInString() was called.\n\t\t$embeds = TextStrings::getEmbeds( $tokens[ $stackPtr ]['content'] );\n\n\t\t// Merge any custom variables with the defaults.\n\t\t$this->merge_allow_lists();\n\n\t\tforeach ( $embeds as $embed ) {\n\t\t\t// Grab any variables contained in the embed.\n\t\t\tif ( preg_match_all( '`\\$(\\{)?(?<name>[a-zA-Z_\\x80-\\xff][a-zA-Z0-9_\\x80-\\xff]*)(?(1)\\})`', $embed, $matches ) === 0 ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ( $matches['name'] as $var_name ) {\n\t\t\t\t// If it's a php reserved var, then its ok.\n\t\t\t\tif ( Variables::isPHPReservedVarName( $var_name ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Likewise if it is a mixed-case var used by WordPress core.\n\t\t\t\tif ( isset( $this->wordpress_mixed_case_vars[ $var_name ] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$suggested_name = SnakeCaseHelper::get_suggestion( $var_name );\n\t\t\t\tif ( $suggested_name !== $var_name ) {\n\t\t\t\t\t$error = 'Variable \"$%s\" is not in valid snake_case format, try \"$%s\"';\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t$var_name,\n\t\t\t\t\t\t$suggested_name,\n\t\t\t\t\t);\n\t\t\t\t\t$phpcsFile->addError( $error, $stackPtr, 'InterpolatedVariableNotSnakeCase', $data );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function setSourceFromFile($filename) {}", "protected function processVariable( File $phpcsFile, $stackPtr ) {\n\t\t$tokens = $phpcsFile->getTokens();\n\n\t\t// If it's a php reserved var, then its ok.\n\t\tif ( Variables::isPHPReservedVarName( $tokens[ $stackPtr ]['content'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Merge any custom variables with the defaults.\n\t\t$this->merge_allow_lists();\n\n\t\t$var_name = ltrim( $tokens[ $stackPtr ]['content'], '$' );\n\n\t\t// Likewise if it is a mixed-case var used by WordPress core.\n\t\tif ( isset( $this->wordpress_mixed_case_vars[ $var_name ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$obj_operator = $phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true );\n\t\tif ( \\T_OBJECT_OPERATOR === $tokens[ $obj_operator ]['code']\n\t\t\t|| \\T_NULLSAFE_OBJECT_OPERATOR === $tokens[ $obj_operator ]['code']\n\t\t) {\n\t\t\t// Check to see if we are using a variable from an object.\n\t\t\t$var = $phpcsFile->findNext( Tokens::$emptyTokens, ( $obj_operator + 1 ), null, true );\n\t\t\tif ( \\T_STRING === $tokens[ $var ]['code'] ) {\n\t\t\t\t$bracket = $phpcsFile->findNext( Tokens::$emptyTokens, ( $var + 1 ), null, true );\n\t\t\t\tif ( \\T_OPEN_PARENTHESIS !== $tokens[ $bracket ]['code'] ) {\n\t\t\t\t\t$obj_var_name = $tokens[ $var ]['content'];\n\n\t\t\t\t\tif ( isset( $this->allowed_mixed_case_member_var_names[ $obj_var_name ] ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t$suggested_name = SnakeCaseHelper::get_suggestion( $obj_var_name );\n\t\t\t\t\tif ( $suggested_name !== $obj_var_name ) {\n\t\t\t\t\t\t$error = 'Object property \"$%s\" is not in valid snake_case format, try \"$%s\"';\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t$obj_var_name,\n\t\t\t\t\t\t\t$suggested_name,\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$phpcsFile->addError( $error, $var, 'UsedPropertyNotSnakeCase', $data );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$in_class = false;\n\t\tif ( ContextHelper::has_object_operator_before( $phpcsFile, $stackPtr ) === true ) {\n\t\t\t// The variable lives within a class, and is referenced like\n\t\t\t// this: MyClass::$_variable or $class->variable.\n\t\t\t$in_class = true;\n\t\t}\n\n\t\t$suggested_name = SnakeCaseHelper::get_suggestion( $var_name );\n\t\tif ( $suggested_name !== $var_name ) {\n\t\t\tif ( $in_class && ! isset( $this->allowed_mixed_case_member_var_names[ $var_name ] ) ) {\n\t\t\t\t$error = 'Object property \"$%s\" is not in valid snake_case format, try \"$%s\"';\n\t\t\t\t$error_name = 'UsedPropertyNotSnakeCase';\n\t\t\t} elseif ( ! $in_class ) {\n\t\t\t\t$error = 'Variable \"$%s\" is not in valid snake_case format, try \"$%s\"';\n\t\t\t\t$error_name = 'VariableNotSnakeCase';\n\t\t\t}\n\n\t\t\tif ( isset( $error, $error_name ) ) {\n\t\t\t\t$data = array(\n\t\t\t\t\t$var_name,\n\t\t\t\t\t$suggested_name,\n\t\t\t\t);\n\t\t\t\t$phpcsFile->addError( $error, $stackPtr, $error_name, $data );\n\t\t\t}\n\t\t}\n\t}", "function prepare($file=NULL)\r\n\t{\r\n\t\tglobal $db;\r\n\t\t\r\n\t\tif($file)\r\n\t\t\t$this->input_file = $file;\r\n\t\t\t\r\n\t\tif(file_exists($this->input_file))\r\n\t\t\t$this->input_file = $this->input_file;\r\n\t\telse\r\n\t\t\t$this->input_file = TEMP_DIR.'/'.$this->input_file;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//Checking File Exists\r\n\t\tif(!file_exists($this->input_file))\r\n\t\t{\r\n\t\t\t$this->log('File Exists','No');\r\n\t\t}else{\r\n\t\t\t$this->log('File Exists','Yes');\r\n\t\t}\r\n\t\t\r\n\t\t//Get File info\r\n\t\t$this->input_details = $this->get_file_info();\r\n\t\t//Loging File Details\r\n\t\t$this->log .= \"\\nPreparing file...\\n\";\r\n\t\t$this->log_file_info();\r\n\t\t\r\n\t\t//Insert Info into database\r\n\t\t//$this->insert_data();\t\t\r\n\t\t\r\n\t\t//Gett FFMPEG version\r\n\t\t$result = shell_output(FFMPEG_BINARY.\" -version\");\r\n\t\t$version = parse_version('ffmpeg',$result);\r\n\t\t\r\n\t\t\r\n\t\t$this->vconfigs['map_meta_data'] = 'map_meta_data';\r\n\t\t\r\n\t\tif(strstr($version,'Git'))\r\n\t\t{\r\n\t\t\t$this->vconfigs['map_meta_data'] = 'map_metadata';\r\n\t\t}\r\n\t\t\r\n\t}", "protected function preprocessVariables(Variables $variables) {}", "static function enableSetFile($settings = array())\n {\n if ($settings === true) {\n $settings = array();\n }\n\n self::structSet('modules', 'setFile', $settings + array(\n 'path' => dSystem::getGlobal('baseDir') . '/dat/',\n 'cbAfterFileAccept' => false, // Callback(filename, Ofilename)\n ));\n }", "private function reload() {\n\t\t$conffile = $this->getPath();\n\t\tif (is_file($conffile) == True) {\n\t\t\t$file = @fopen($conffile, \"r\");\n\t\t\tif (!$file) return false; // abort if file is not readable\n\t\t\twhile (!feof($file)) {\n\t\t\t\t$line = fgets($file, 1024);\n\t\t\t\t$line = trim($line); // remove spaces at the beginning and end\n\t\t\t\tif (($line == \"\")||($line[0] == \"#\")) continue; // ignore comments and empty lines\n\t\t\t\t// search keywords\n\t\t\t\tfor ($i = 0; $i < sizeof($this->settings); $i++) {\n\t\t\t\t\t$keyword = $this->settings[$i];\n\t\t\t\t\t$keylen = strlen($keyword);\n\t\t\t\t\tif (strtolower(substr($line, 0, $keylen + 2)) == strtolower($keyword . \": \")) {\n\t\t\t\t\t\t// module settings\n\t\t\t\t\t\tif (strtolower(substr($line, 0, $keylen + 2)) == \"modules: \") {\n\t\t\t\t\t\t\t$option = substr($line, $keylen + 2, strlen($line) - $keylen - 2);\n\t\t\t\t\t\t\t$pos = strpos($option, \":\");\n\t\t\t\t\t\t\t$this->moduleSettings[substr($option, 0, $pos)] = explode(LAMConfig::LINE_SEPARATOR, substr($option, $pos + 2));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// type settings\n\t\t\t\t\t\telseif (strtolower(substr($line, 0, $keylen + 2)) == \"types: \") {\n\t\t\t\t\t\t\t$option = substr($line, $keylen + 2, strlen($line) - $keylen - 2);\n\t\t\t\t\t\t\t$pos = strpos($option, \":\");\n\t\t\t\t\t\t\t$this->typeSettings[substr($option, 0, $pos)] = substr($option, $pos + 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// general settings\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$this->$keyword = substr($line, $keylen + 2, strlen($line) - $keylen - 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telseif (strtolower($line) == strtolower($keyword . \":\")) {\n\t\t\t\t\t\t// set empty options\n\t\t\t\t\t\t$this->$keyword = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfclose($file);\n\t\t}\n\t\t// check modules\n\t\t$scopes = $this->get_ActiveTypes();\n\t\tfor ($s = 0; $s < sizeof($scopes); $s++) {\n\t\t\t$scope = $scopes[$s];\n\t\t\t$moduleVar = \"modules_\" . $scope;\n\t\t\tif(isset( $this->typeSettings[$moduleVar] )){\n $modules = explode(\",\", $this->typeSettings[$moduleVar]);\n $available = getAvailableModules($scope);\n // only return available modules\n $ret = array();\n for ($i = 0; $i < sizeof($modules); $i++) {\n\t\t\t\tif (in_array($modules[$i], $available)) $ret[] = $modules[$i];\n }\n $this->$moduleVar = implode(\",\", $ret);\n }\n\t\t}\n\t\treturn true;\n\t}", "private function setVariables() {\n // set program variables\n $this->tmp_name = $_FILES['fileupload']['tmp_name'];\n $this->file_name = $_FILES['fileupload']['name'];\n $this->file_type = $_FILES['fileupload']['type'];\n $this->file_size = $_FILES['fileupload']['size'];\n\n $this->file_mime = $this->getFile_mime($this->tmp_name);\n\n $extentionArray = $this->getExtention($this->file_name);\n $this->raw_extention = $extentionArray[0];\n $this->file_extention = $extentionArray[1];\n }" ]
[ "0.5644701", "0.54715323", "0.5396854", "0.5075988", "0.5018352", "0.4958872", "0.49159747", "0.48723128", "0.4859017", "0.4808388", "0.4806267", "0.47586706", "0.46786502", "0.4588374", "0.4521501", "0.45208505", "0.44957712", "0.4454951", "0.44465822", "0.44308278", "0.44301805", "0.441525", "0.43997392", "0.4395686", "0.43797076", "0.43750036", "0.437148", "0.43601003", "0.43569666", "0.43492633" ]
0.56900793
0
Read parameters from the given file pointer (stop at end_offset). static bool
public static function ReadParamsFromFp(/* FILE * */$fp, /* inT64 */$end_offset, /* bool */$init_only, ParamsVectors $member_params) { $line[MAX_PATH]; // input line $anyerr = false; // true if any error $foundit; // found parameter $length; // length of line $valptr; // value field while (($end_offset < 0 || ftell($fp) < $end_offset) && fgets($line, MAX_PATH, $fp)) { if ($line[0] != '\n' && $line[0] != '#') { $length = strlen($line); if ($line[$length - 1] == '\n') $line[length - 1] = '\0'; // cut newline for ($valptr = $line; $valptr && $valptr != ' ' && $valptr != '\t'; $valptr++); if ($valptr) { // found blank $valptr = '\0'; // make name a string do $valptr++; // find end of blanks while ($valptr == ' ' || $valptr == '\t'); } $foundit = self::SetParam($line, $valptr, $init_only, $member_params); if (!$foundit) { $anyerr = true; // had an error tprintf("read_params_file: parameter not found: %s\n", line); exit(1); } } } return $anyerr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function ReadParamsFile(\n /* const char * */$file, // filename to read\n /* bool */$init_only, // only set parameters that need to be\n // initialized when Init() is called\n /* ParamsVectors * */$member_params) {\n\n }", "public function canKeepReading ()\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($this->isReadValid() && !$this->readVariables['reachedEnd'])\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tswitch ($this->readVariables['format'])\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcase 'delimited':\r\n\t\t\t\t\t\t\t\t$content = false;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($this->readVariables['destination'] == 'file')\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif (XXX_Type::isResource($this->readVariables['fileStream']))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$content = XXX_FileSystem_Local::getFileContent($this->readVariables['file']);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$this->readVariables['keepReading'] = 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$this->readVariables['valid'] = false;\r\n\t\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\telse if ($this->readVariables['destination'] == 'buffer')\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$content = $this->readVariables['buffer'];\r\n\t\t\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\t\tif ($content !== false)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$firstPosition = XXX_String::findFirstPosition($content, $this->readVariables['delimiter']);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif ($firstPosition !== false)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$this->readVariables['keepReading'] = 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$this->readVariables['reachedEnd'] = true;\r\n\t\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\tbreak;\r\n\t\t\t\t\t\t\tcase 'empty':\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 'custom':\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 'http':\r\n\t\t\t\t\t\t\t\tif ($this->readVariables['reachedHead'] && ($this->readVariables['bodyLength'] == 0 || ($this->readVariables['bodyLength'] > 0 && $this->readVariables['bytesRead'] >= $this->readVariables['bodyLength'])))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$this->readVariables['keepReading'] = false;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$this->readVariables['reachedEnd'] = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 'fixedLength':\r\n\t\t\t\t\t\t\t\tif ($this->readVariables['dataLength'] > 0 && $this->readVariables['bytesRead'] >= $this->readVariables['dataLength'])\r\n\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$this->readVariables['keepReading'] = false;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$this->readVariables['reachedEnd'] = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 'shortPrefixedLength':\r\n\t\t\t\t\t\t\t\tif ($this->readVariables['reachedPrefixedLength'] && $this->readVariables['dataLength'] > 0 && $this->readVariables['bytesRead'] >= $this->readVariables['dataLength'])\r\n\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$this->readVariables['keepReading'] = false;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$this->readVariables['reachedEnd'] = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 'longPrefixedLength':\r\n\t\t\t\t\t\t\t\tif ($this->readVariables['reachedPrefixedLengthLength'] && $this->readVariables['reachedPrefixedLength'] && $this->readVariables['dataLength'] > 0 && $this->readVariables['bytesRead'] >= $this->readVariables['dataLength'])\r\n\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$this->readVariables['keepReading'] = false;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$this->readVariables['reachedEnd'] = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Has not timed out or closed\r\n\t\t\t\t\t\tif ($this->hasTimedOutOrClosed())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->readVariables['keepReading'] = false;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$this->readVariables['valid'] = false;\r\n\t\t\t\t\t\t}\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\t$this->readVariables['keepReading'] = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\treturn $this->readVariables['keepReading'];\r\n\t\t\t\t}", "abstract function readfile();", "public function offset($offset = false, $seek = SEEK_SET)\n {\n if ($offset === false) \n\t\t{\n if (is_resource($this->handle)) \n return ftell($this->handle);\n } \n\t\telseif ($this->open() === true) \n\t\t{\n return fseek($this->handle, $offset, $seek) === 0;\n }\n\n return false;\n }", "abstract public function readData($fileName);", "public function isEndOfParameters()\n\t{\n\t\treturn $this->_endOfParameters;\n\t}", "abstract public function read();", "abstract public function read();", "function setFilePos($point,$params,$seek)\r\n\t\t{\r\n\t\t\tfseek($point,$seek);\r\n\t\t\twhile ($line = fgets($point))\r\n\t\t\t{\r\n\t\t\t\t$line_elems = explode('#', $line);\r\n\t\t\t\t$bit_pos = $line_elems[count($line_elems)-1];\r\n\t\t\t\tfseek($point,$bit_pos);\r\n\t\t\t\t$line = fgets($point);\r\n\t\t\t\t$line_elems = explode('#', $line);\r\n\t\t\t\tif( $line_elems[0] < $params['id'] )\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tif( $line_elems[4]<=0 )\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tfseek($point,$bit_pos-20);\r\n\t\t\t}\r\n\r\n\t\t\tif( $bit_pos == '' || $bit_pos == null )\r\n\t\t\t\tfseek($point,0);\r\n\t\t\telse\r\n\t\t\t\tfseek($point,$bit_pos);\r\n\r\n\t\t}", "public function startReading ()\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($this->settings['activeOperation'] == false)\r\n\t\t\t\t\t{\t\t\t\t\r\n\t\t\t\t\t\t// Connection should not have timed out or closed\r\n\t\t\t\t\t\tif (!$this->hasTimedOut() && !$this->hasClosed())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$error = false;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Open file stream\r\n\t\t\t\t\t\t\tif ($this->readVariables['destination'] == 'file')\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif ($this->readVariables['fileAppend'])\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$this->readVariables['fileStream'] = XXX_FileSystem_Local::fileStream_openForAppendedWriting($this->readVariables['file'], $this->readVariables['file_standardizePath']);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$this->readVariables['fileStream'] = XXX_FileSystem_Local::fileStream_openForWriting($this->readVariables['file'], $this->readVariables['file_standardizePath']);\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\tif (!XXX_Type::isResource($this->readVariables['fileStream']))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$error = true;\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\t\r\n\t\t\t\t\t\t\tif (!$error)\r\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$this->settings['activeOperation'] = 'read';\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$this->readVariables['valid'] = true;\r\n\t\t\t\t\t\t\t\t$this->readVariables['keepReading'] = true;\r\n\t\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 (!$this->readVariables['valid'])\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->stopReading();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn $this->readVariables['valid'];\r\n\t\t\t\t}", "function read($file,$section=false){\n\t\treturn parse_ini_file($file,$section);\n\t}", "public function stream_seek(int $offset, int $whence = SEEK_SET): bool;", "protected function _dataSeek($n = 0)\n {\n return false;\n }", "function data_seek($offset)\n {\n if (!$this->pNativeClass->data_seek($offset)) {\n $this->_throwError();\n }\n }", "public function stream_seek($offset, $mode) {\n\n\t\tswitch($mode) {\n\n\t\t\tcase SEEK_SET :\n\n\t\t\t\tif($offset < strlen($this->data) && $offset >= 0) {\n\n\t\t\t\t\t$this->position = $offset;\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn false;\n\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\n\t\t\tbreak;\n\t\t\tcase SEEK_CUR :\n\n\t\t\t\tif($offset >= 0) {\n\n\t\t\t\t\t$this->position += $offset;\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn false;\n\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\n\t\t\tbreak;\n\t\t\tcase SEEK_END :\n\n\t\t\t\tif(strlen($this->data) + $offset >= 0) {\n\n\t\t\t\t\t$this->position = strlen($this->data) + $offset;\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn false;\n\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\n\t\t\tbreak;\n\t\t\tdefault :\n\n\t\t\t\treturn false;\n\n\t\t\tbreak;\n\n\t\t}\n\n\t}", "public function hasStartOffset(){\n return $this->_has(2);\n }", "public abstract function read($file);", "private function readInputFile(): bool\n {\n try {\n $this->filePath = $this->argument('input');\n $this->content = File::get($this->filePath);\n return true;\n } catch (\\Illuminate\\Contracts\\Filesystem\\FileNotFoundException $exception) {\n return false;\n }\n }", "public function stream_eof(): bool;", "public function stream_eof(): bool;", "public function stream_eof() {\n\t\t\t$eof = $this->position>=$this->size;\n\t\t\t\n//\t\t\tZLog::Write(LOGLEVEL_DEBUG, sprintf(\"GoImapStreamWrapper::eof \".var_export($eof, true)));\n\t\t\treturn $eof;\n }", "abstract protected function doRead();", "public function stream_seek($offset, $type) {\n \n switch($type) {\n case SEEK_SET:\n if($offset < strlen(static::$strings[$this->string]) && $offset >= 0) {\n $this->position = $offset;\n return true;\n } else\n return false;\n break;\n case SEEK_CUR:\n if($offset >= 0) {\n $this->position += $offset;\n return true;\n } else\n return false;\n break;\n case SEEK_END:\n if(strlen(static::$strings[$this->string]) + $offset >= 0) {\n $this->position = strlen(static::$strings[$this->string]) + $offset;\n return true;\n } else\n return false;\n break;\n default:\n return false;\n }\n \n }", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();" ]
[ "0.55652755", "0.55265945", "0.5418343", "0.5200577", "0.51235265", "0.5112901", "0.5084615", "0.5084615", "0.508346", "0.5007503", "0.50055313", "0.49545133", "0.495324", "0.4841796", "0.48360503", "0.47919595", "0.4789617", "0.4783979", "0.47609466", "0.47609466", "0.47574744", "0.4750033", "0.4747636", "0.47473684", "0.47473684", "0.47473684", "0.47473684", "0.47473684", "0.47473684", "0.47473684" ]
0.6593165
0
Print parameters to the given file. static void
public static function PrintParams($fp, ParamsVectors $member_params) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function printUsage($file = null)\n {\n if (!$this->_usage)\n return;\n\n if (is_null($file))\n echo $this->getUsage();\n else\n fwrite($file, $this->getUsage());\n }", "function toPrint($printPath=false) {\n echo \"[$this->code] $this->name \";\n if ($printPath) {\n echo $this->getAbsolutePath();\n }\n echo \"\\n\";\n }", "function printParams()\n {\n foreach (func_get_args() as $param) {\n $_param = '_' . $param;\n if (isset($this->$_param)) {\n switch ($param) {\n case 'filter':\n echo ' filter=\"url(#' . $this->$_param . ')\"';\n break;\n\n default:\n echo ' ' . str_replace('_', '-', $param) . '=\"' . $this->$_param . '\"';\n break;\n }\n }\n }\n }", "public function printHelp($file = null)\n {\n if (is_null($file))\n echo $this->formatHelp();\n else\n fwrite($file, $this->formatHelp());\n }", "public function printVersion($file = null)\n {\n if (!$this->version)\n return;\n\n if (is_null($file))\n echo $this->getVersion() . \"\\n\";\n else\n fwrite($file, $this->getVersion() . \"\\n\");\n }", "public function show() {\n\t\t\tforeach ($this->vars as $key=>$value)\n\t\t\t\t$$key=$value;\n\n\t\t\trequire $this->filename;\n\t\t}", "public function show(File $file)\n {\n\n }", "function print__f($anything,$filename='errors.txt'){\n\t\tob_start();\n\t\tprint__r($_SERVER[REQUEST_URI]);\n\t\tprint__r(date('Y-m-d H:i:s'));\n\t\tprint__r($anything);\n\t\t$message=ob_get_clean();\n\t\t\t/*complie filename*/\n\t\t$file=(strpos($filename,'.txt')) ? str_replace('/','',$filename) : $filename.'.txt' ;\n\t\t$fh=@fopen(GATEWAY_DATA_DIR.'errors/'.$file,'w+');\n\t\t#print__r(GATEWAY_DATA_DIR.'/errors/'.$file);\n\t\t#die;\n\t\t@fwrite($fh,$message);\n\t\tfclose($fh);\n\t\t\t\n\t}", "public function show(File $file)\n {\n }", "public static function write(/** $var1, $var2, .. **/) \r\n {\r\n if (!self::$debug_on_off OR !self::$switchOn) return; //do nothing \r\n $argv = func_get_args();\r\n $backtrace = debug_backtrace();\r\n self::displayAndLog($argv,$backtrace); \r\n }", "public function show(File $file)\n {\n //\n }", "public function show(File $file)\n {\n //\n }", "public function show(File $file)\n {\n //\n }", "public function show(File $file)\n {\n //\n }", "function dump()\n {\n $arguments = func_get_args();\n require(\"../views/dump.php\");\n exit;\n }", "function printFile($service, $fileId) {\n try {\n $file = $service->files->get($fileId);\n\n print \"Title: \" . $file->getName();\n print \"; Description: \" . $file->getDescription();\n print \"; MIME type: \" . $file->getMimeType();\n print \"<br>\";\n } catch (Exception $e) {\n print \"An error occurred: \" . $e->getMessage();\n }\n }", "function PrintDetails ()\n {\n\t static $i = 0 ;\n\t echo \"name of the file is : \".$_FILES[\"file\"][\"name\"][$i] ;\n\t echo \"<br/>\" ;\n\t echo \"size of the file is : \".$_FILES[\"file\"][\"size\"][$i];\n\t echo \"<br/>\" ;\n\t echo \"type of the file is : \".$_FILES[\"file\"][\"type\"][$i];\n\t echo \"<br/>\" ;\n\t echo \"tmp_name of the file is : \".$_FILES[\"file\"][\"tmp_name\"][$i];\n\t echo \"<br/>\" ;\n\t echo \" error : \".$_FILES[\"file\"][\"error\"][$i].\"<br/>\" ;\n\t $file_extension = strtolower(pathinfo($_FILES[\"file\"][\"name\"][$i] ,PATHINFO_EXTENSION ) );\n\t echo \"file extension is :\". $file_extension.\"<br/>\" ;\n\t $i++ ; \n }", "function printinfo();", "function debug_text($namafile,$contentdebug) {\r\n\t$myfile = fopen($namafile, \"w\") or die(\"Unable to open file!\");\r\n\tfwrite($myfile, $contentdebug);\r\n\tfclose($myfile);\r\n}", "public static function pr()\n\t{\n\t\t$args = func_get_args();\n\t\t$html = false;\n\t\tif($args[0] == static::DEBUG_HTML) {\n\t\t\tArrayHelper::remove($args, 0);\n\t\t\t$html = true;\n\t\t}\n\t\tforeach($args as $data)\n\t\t{\n\t\t\tif(!empty($data)) {\n\t\t\t\tif($html || static::$debugFormat == 'html')\n\t\t\t\t\techo static::prHtml(uniqid(), print_r($data, true));\n\t\t\t\telse\n\t\t\t\t\techo \"<pre>\".print_r($data, true).\"</pre>\";\n\t\t\t}\n\t\t}\n\t}", "function show($filename, $data = array()) {\n\t\tif(file_exists(__DIR__.'/../output/'.$filename)) {\n\t\t\textract($data);\n\t\t\tforeach ($GLOBALS as $key => $value) {\n\t\t\t\t$$key = $value;\n\t\t\t}\n\t\t\trequire(__DIR__.'/../output/'.$filename);\n\t\t} else {\n\t\t\tinclude __DIR__.'/errors/not_found.php';\n\t\t}\n\t}", "function write() {\n var_dump(\"writing stuff to TXT\");\n }", "function helpPrint() {\r\n echo \"--help - Napoveda\r\n--input=filename.ext - Vstupni xml soubor\r\n--output=filename.ext - Vystupni xml soubor\r\n--header='text' - Hlavicka vlozena na zacetek vystupniho souboru\r\n--etc=num - Maximalni počet sloupcu vzniklych ze stejnojmennych podelementu\r\n-a - Nebudou se generovat sloupce z atributu\r\n-b - Vice stejnych alelementu se bude brat jako jeden element (Nelze kombinovat s '--etc')\r\n-g - Vystupem je XML s relacema\r\n\";\r\n}", "function info($filename);", "public function tprint_print();", "function pr() {\n $args = func_get_args();\n foreach ($args as $arg) {\n echo \"<pre>\";\n print_r($arg);\n echo \"</pre>\";\n }\n}", "function printFile($service, $fileId) {\n try {\n $file = $service->files->get($fileId);\n print \"Title: \" . $file->getTitle();\n print \"Description: \" . $file->getDescription();\n print \"MIME type: \" . $file->getMimeType();\n } catch (apiAuthException $apie) {\n // Credentials have been revoked.\n // TODO: Redirect the user to the authorization URL.\n throw new RuntimeException('Not implemented!');\n } catch (apiException $e) {\n print \"An error occurred: \" . $e->getMessage();\n }\n }", "public static function dump()\n\t{\n\t if (func_num_args() === 0)\n\t {\n \treturn;\n\t }\n \n\t // Get all passed variables\n\t $variables = func_get_args();\n\n\t echo '<pre>';\n\t \n\t foreach ($variables as $var)\n\t {\n\t var_dump($var);\n\t }\n\n\t echo '</pre>';\n\n\t}", "public function printFileField(array $field)\n {\n $this->printInputField($field, \"file\");\n }", "function PrintElement($num, $title, $file)\n{\n if (!empty($file)) {\n\n $txt = $title.\": \".$file;\n // Fuente\n $this->SetFont('Times','',12);\n // Imprimir texto en una columna de 6 cm de ancho (si el valor es 60)\n $this->MultiCell(190,7,$txt);\n // $this->Cell(0,5,$txt);\n // $this->Ln();\n // Guardar ordenada\n $this->y0 = $this->GetY();\n }\n}" ]
[ "0.61845183", "0.6122365", "0.5843553", "0.58261263", "0.5817596", "0.5777967", "0.57135135", "0.56969535", "0.5633691", "0.5543075", "0.551717", "0.551717", "0.551717", "0.551717", "0.550629", "0.55000913", "0.54877657", "0.54402936", "0.54358935", "0.54155266", "0.5403082", "0.5392306", "0.5351629", "0.5346154", "0.5344036", "0.53163266", "0.53088194", "0.5307276", "0.53031504", "0.52944636" ]
0.6375692
0
Figure out whether a group identifier is contained within a VOOT result set
function vr_is_member_of($group, array $groups) { foreach ($groups as $g) { if ($g['id'] === $group) { return TRUE; } } return FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasGroup(): bool;", "public function hasGroupid(){\n return $this->_has(1);\n }", "protected function groupoidPresent() {\r\n $len = count($this->map);\r\n for ( $i=0; $i<$len; $i+=1 ) {\r\n if ( $this->map[$i]->get('dbCol') === \"groupoid\" ) \r\n return true;\t\t\r\n }\r\n return false;\t\t\t\r\n }", "public function hasGroup($name);", "function contains($groupName, $fullGroupArray){\n global $log;\n foreach($fullGroupArray as $groupLines) {\n $log->debug(\"Search for \" .$groupName .\" using \" .$groupLines);\n if (strpos($groupLines, $groupName) !== false) {\n return true;\n }\n }\n return false;\n}", "public function inGroup($group)\n {\n foreach ($this->getGroups() as $_group) {\n if ($_group->getKey() === $group->getKey()) {\n return true;\n }\n }\n\n return false;\n }", "function bbp_group_is_member()\n{\n}", "public function hasGroup()\n {\n return $this->group_id > 0;\n }", "function in_group($group)\n{\n\tif(!isset($_SESSION[\"user_groups\"]))\n\t{\n\t\treturn false;\n\t}\n\n\t/**\n\t* create array with all groups, user is member of\n\t*/\n\t$group_member_of=explode_and_slice($_SESSION[\"user_groups\"],\";\");\n\n\t/**\n\t* admin's have permissions for all groups\n\t*/\n\t$query = $GLOBALS['db']->Execute(\"SELECT ID FROM \".PREFIX.\"groups \".\n\t\t\"WHERE groups = 'admin'\");\n\t$data = $query->FetchRow();\n\t$group_id = $data[0];\n\t\n\tif(in_array($group_id, $group_member_of)) {\n\t\treturn true;\n\t}\n\n\n\t$group_id = get_group_id_from_name($group);\n\n\tif(in_array($group_id, $group_member_of)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "public function inGroup( $group ) {\n\t\treturn ( $this->getRoles()->where( 'group', 'LIKE', $group )->first() ? true : false );\n\t}", "public function is_curruser_in_group_by_group_name($input_group_name)\r\n\t{\r\n\t\t$result = false;\r\n\t\tfor($i=0; $i<count($this -> curr_g_arr); $i++)\r\n\t\t{\r\n\t\t\tif($this -> curr_g_arr[$i]['group_name'] == $input_group_name)\r\n\t\t\t{\r\n\t\t\t\t$result = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "private function isGroup($gid){\n $sql = 'SELECT * FROM `'.$this->tableGroup.'` \n WHERE `groupid` = ?';\n $params = array($gid);\n $result = $this->execute($sql,$params)->fetchAll();\n if(count($result)>0){\n return true;\n }else{\n return false; \n }\n }", "public function checkIfInGroup($group) {\n \treturn DB::table('group_members')\n\t\t\t->whereUserId($this->id)\n\t\t\t->whereGroupId($group->id)\n\t\t\t->count() > 0;\n }", "public function hasGroup ($identifier) {\n\t\tforeach($this->getGroups() as $group) {\n\t\t\tif ($group->getIdentifier() === $identifier) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function openlucius_core_group_contains_all_team_members($gid, $tid) {\n\n // Get the group users.\n $group_users = openlucius_core_fetch_group_users($gid);\n $group_users = array_keys($group_users);\n\n // Get the team users.\n $team_users = openlucius_core_fetch_team_users($tid);\n\n // Loop through team users again.\n foreach ($team_users as $uid) {\n\n // Check if the user is not in the group.\n if (!in_array($uid, $group_users)) {\n\n // Return false.\n return FALSE;\n }\n }\n\n return TRUE;\n}", "public function isGroupname($gid){\n $sql = 'SELECT * FROM `'.$this->tableGroup.'` \n WHERE `groupname` = ?';\n $params = array($gid);\n $result = $this->execute($sql,$params)->fetchAll();\n if(count($result)>0){\n return true;\n }else{\n return false; \n }\n }", "function is_a_member_of_group($group_name)\r\n { \r\n $this->find_foreign_key('group_id'); \r\n \r\n if($this->group->name == $group_name)\r\n return true;\r\n else\r\n return false;\r\n }", "public function is($group)\n {\n if (empty($this->groups[$group])) {\n return false;\n }\n\n static $my_groups;\n\n if (!is_array($my_groups)) {\n $my_groups = array($this->info['usergroupid']);\n\n foreach (explode(',', $this->info['membergroupids']) as $id) {\n if ($id) {\n $my_groups[] = intval($id);\n }\n }\n }\n return (bool) count(array_intersect($my_groups, $this->groups[$group]));\n }", "public function hasGroup(string $group): bool\n {\n return $this->inGroup($group);\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 }", "function is_member($user_id, $group_id) {\r\n\t\r\n\tData::set('sql', 'SELECT `user_id` FROM `' . Data::get('db') . '`.`group_members` WHERE `user_id` = \"' . MySQL::clean($user_id) . '\" AND `group_id` = \"' . MySQL::clean($group_id) . '\"', true);\r\n\t\r\n\t$result = MySQL::search(Data::get('sql'));\r\n\t\r\n\t// Now check if there was a result returned.\r\n\tif (isset($result[0])) {\r\n\t\treturn true;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n\t\r\n}", "public function isCompliment()\r\n {\r\n $select = $this->_db->select();\r\n $select->from(array('zgm' => 'zanby_groups__members'), 'zgm.user_id')\r\n ->joinInner(array('zgi' => 'zanby_groups__items'), 'zgi.id = zgm.group_id')\r\n ->joinLeft(array('zgr' => 'zanby_groups__relations'), 'zgr.child_group_id = zgi.id')\r\n ->joinLeft(array('zgif' => 'zanby_groups__items'), 'zgif.id = zgr.parent_group_id')\r\n ->where('zgm.user_id = ?', $this->id)\r\n ->where('zgif.type IN (?)', 'family')\r\n ->where('zgif.payment_type IN (?)', 'business')\r\n ->where('zgi.type IN (?)', Warecorp_Group_Enum_GroupType::GROUP_TYPE_SIMPLE)\r\n ->where('zgm.is_approved', 1);\r\n $groups = $this->_db->fetchCol($select);\r\n\r\n return (bool) $groups;\r\n }", "function memberof_twpn_group($ldap_domain, $ldap_server, $query_user, $query_password, $group){\n\n $user_record = twpn_search($ldap_domain, $ldap_server, $query_user, $query_password, \"(cn=$query_user)\");\n $groups = $user_record[0]['memberof'];\n\n //remove 1st entry of array, which gives count of # of records\n array_shift($groups);\n\n //regex accepts any OUs, and is case insensitive\n $pattern = \"/CN=\".$group.\",(OU=.+,?)+\".domain_to_dcs($ldap_domain).\"/i\";\n\n foreach ($groups as $key => $value){\n if(preg_match($pattern,$value)== 1) return true;\n }\n return false;\n}", "function ht_dms_is_group( $id = false ) {\n\n\treturn ht_dms_is( HT_DMS_GROUP_POD_NAME, $id );\n\n}", "public function isGroup(): bool\n {\n }", "public function isInGroup($group_name)\n {\n if ($this->config['cas_saml']) {\n $groups = $this->getAttributes()[$this->config['cas_saml_attr_groups']];\n\n if (empty($groups)) {\n return false;\n }\n\n if (!is_string($groups)) {\n $groups = implode(\",\", $groups);\n }\n\n return preg_match(\"/\" . trim($group_name) . \"/i\", $groups);\n }\n\n return false;\n }", "protected function groupsExist() {\n return !empty($this->group_storage->loadMultiple());\n }", "public function exists($group, $namespace = null);", "public function exists($group, $namespace = null);", "private function isInGroup($customerId, array $groupIds) {\n return array_search(Mage::getModel('rewards/customer')->load($customerId)->getGroupId(), $groupIds) !== false;\n }" ]
[ "0.6841888", "0.6742813", "0.66340256", "0.6578457", "0.65239376", "0.64427227", "0.62853646", "0.62691224", "0.626799", "0.6261873", "0.62003607", "0.61894023", "0.61499584", "0.6120157", "0.60717386", "0.6042519", "0.60319006", "0.601236", "0.59981453", "0.595179", "0.59507495", "0.5941237", "0.59329224", "0.5901971", "0.5896715", "0.58911985", "0.5882547", "0.58823", "0.58823", "0.58670825" ]
0.7403669
0
Set the user meta/key value to fetch the VOOT role, this is set at login time
function vr_set_fetch_voot_role_meta($username, WP_User $user) { update_user_meta($user->ID, "fetch_voot_role", TRUE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vr_set_role($cookie, WP_User $user)\n{\n $fetchVootRole = get_user_meta($user->ID, \"fetch_voot_role\", TRUE);\n if (!$fetchVootRole) {\n return;\n }\n\n $config = parse_ini_file(\"config/vr.ini\", TRUE);\n if (!is_array($config) || empty($config)) {\n $message = \"[voot-roles] ERROR: configuration file is malformed\";\n error_log($message);\n die($message);\n }\n\n $clientPath = $config['OAuth']['clientPath'];\n require_once $clientPath . DIRECTORY_SEPARATOR . \"lib\" . DIRECTORY_SEPARATOR . \"_autoload.php\";\n\n $groups = array();\n\n try {\n $appId = $config['OAuth']['appId'];\n\n $client = new \\OAuth\\Client\\Api($appId);\n $client->setUserId($user->ID);\n $client->setScope(\"read\");\n $client->setReturnUri(vr_determine_return_uri());\n\n $apiEndpoint = $config['Voot']['apiEndpoint'];\n\n $message = \"[voot-roles] INFO: performing VOOT call\";\n error_log($message);\n\n $response = $client->makeRequest($apiEndpoint . \"/groups/@me\");\n\n if (200 !== $response->getStatusCode()) {\n $message = \"[voot-roles] ERROR: unexpected status code from VOOT provider (\" . $response->getStatusCode() . \"): \" . $response->getContent();\n error_log($message);\n die($message);\n }\n\n $content = $response->getContent();\n if (empty($content)) {\n $message = \"[voot-roles] ERROR: empty response from VOOT provider\";\n error_log($message);\n die($message);\n }\n\n $data = json_decode($content, TRUE);\n if (NULL === $data || !is_array($data)) {\n $message = \"[voot-roles] ERROR: invalid/no JSON response from VOOT provider: \" . $content;\n error_log($message);\n die($message);\n }\n\n if (!array_key_exists(\"entry\", $data)) {\n $message = \"[voot-roles] ERROR: invalid JSON response from VOOT provider, missing 'entry': \" . $content;\n error_log($message);\n die($message);\n }\n $groups = $data['entry'];\n\n } catch (\\OAuth\\Client\\ApiException $e) {\n // FIXME: we probably should just return, if it didn't work out...well\n $message = \"[voot-roles] OAuth ERROR: \" . $e->getMessage();\n error_log($message);\n die($message);\n }\n\n // FIXME: use WP_Roles to go through all registered roles\n if (vr_is_member_of($config['Voot']['administratorRoleGroup'], $groups)) {\n $role = \"administrator\";\n } elseif (vr_is_member_of($config['Voot']['editorRoleGroup'], $groups)) {\n $role = \"editor\";\n } elseif (vr_is_member_of($config['Voot']['authorRoleGroup'], $groups)) {\n $role = \"author\";\n } elseif (vr_is_member_of($config['Voot']['contributorRoleGroup'], $groups)) {\n $role = \"contributor\";\n } else {\n // everyone who succesfully authenticates will become a subscriber\n $role = \"subscriber\";\n }\n\n if (!in_array($role, $user->roles)) {\n $user->set_role($role);\n wp_update_user(array('ID' => $user->ID, 'role' => $role));\n }\n\n // we fetched the role of the user and set the role accordingly, now set\n // it to FALSE until next wp_login\n update_user_meta($user->ID, \"fetch_voot_role\", FALSE);\n}", "private function setRole()\n {\n $this->role = $this->getUser()->getRoles();\n\n if(in_array('ROLE_USER', $this->role) && count($this->role) > 1) {\n unset($this->role[array_search('ROLE_USER', $this->role)]);\n }\n }", "function bbp_user_add_role_to_signup_meta($meta = array())\n{\n}", "function bbp_set_user_role($user_id = 0, $new_role = '')\n{\n}", "public function _setRealUser() {\n\t\t$user = $this->Auth->user();\n\t\t$user['id'] = $user['real_user_id'];\n\t\tunset($user['real_user_id']);\n\n\t\t$this->Auth->login($user);\n\t}", "function bbp_user_add_role_on_activate($user_id = 0, $password = '', $meta = array())\n{\n}", "function a_role()\n\t{\n\t\tif ($this->params->event == 'pre_get'){\n\t\t\t$this->_get_filtered(TRUE, FALSE);\n\t\t\t\n\t\t\tif (isset($this->params->for_user) && !empty($this->params->for_user)) {\n\t\t\t\t$this->params->where_in['id'] = $this->_get_role($this->params->for_user);\n\t\t\t}\n\t\t}\n\t}", "function local_tcapi_set_role_permission_overrides() {\n\tglobal $CFG,$DB;\n\t$role = $DB->get_record('role', array('archetype'=>'user'), 'id', MUST_EXIST);\n\tif (isset($role->id)) {\n\t\trequire_once $CFG->dirroot.'/lib/accesslib.php';\n\t\trole_change_permission($role->id, context_system::instance(), 'moodle/webservice:createtoken', CAP_ALLOW);\n\t\trole_change_permission($role->id, context_system::instance(), 'webservice/rest:use', CAP_ALLOW);\n\t\trole_change_permission($role->id, context_system::instance(), 'local/tcapi:use', CAP_ALLOW);\n\t}\n}", "function catch_role_from( $check, $user_id, $meta_key, $meta_value ) {\n if ( !$blog_id = $this->get_blog_id_from_cap_key( $meta_key ) ) {\n return NULL;\n }\n\n // Get the old role\n $user = new WP_User( $user_id );\n $user->for_blog( $blog_id );\n\n if ( !empty( $user->roles[0] ) ) {\n $this->role_from = $user->roles[0];\n }\n\n return NULL;\n }", "public function setSessionDataUserRole(){\n $session_data = $this->session->userdata('logged_in');\n return $session_data['userrole'];\n }", "function userRoles($role = 0, $set_user = null) {\n\t\tglobal $framework, $user;\n\t\tif ($set_user) {\n\t\t\t$user = $this->userData($set_user, 1);\n\t\t\t$role = $user['role'];\n\t\t} \n\t\t\n\t\tif ($role == 1) {\n\t\t\t$role = 'User';\n\t\t} elseif ($role == 2) {\n\t\t\t$role = 'Artist';\n\t\t} elseif ($role == 3) {\n\t\t\t$role = 'Music Aggregator';\n\t\t} elseif ($role == 4) {\n\t\t\t$role = 'Administrator';\n\t\t} elseif ($role == 5) {\n\t\t\t$role = 'Super Administrator';\n\t\t}\n\t\treturn $role;\n\t}", "public function setUserTypeForACL(){\n // to set customer type same as website\n if(isset( $this->client) && $this->client )\n {\n $this->userType = 'client';\n $this->isLogged = true ;\n }\n else\n {\n $this->userType = 'visitor';\n $this->isLogged = false ;\n }\n }", "private function getUserRole()\n {\n $user = $this->user;\n\n $admin = Sentinel::findRoleBySlug('super-admin');\n $dpeo = Sentinel::findRoleBySlug('dpeo');\n $adpeo = Sentinel::findRoleBySlug('adpeo');\n $teo = Sentinel::findRoleBySlug('teo');\n $ateo = Sentinel::findRoleBySlug('ateo');\n $teacher = Sentinel::findRoleBySlug('teacher');\n\n if ($user->inRole($admin)) {\n return 'admin';\n } elseif ($user->inRole($dpeo)) {\n return 'dpeo';\n } elseif ($user->inRole($adpeo)) {\n return 'adpeo';\n } elseif ($user->inRole($teo)) {\n return 'teo';\n } elseif ($user->inRole($ateo)) {\n return 'ateo';\n } elseif ($user->inRole($teacher)) {\n return 'teacher';\n }\n \n return false;\n }", "public function role() {}", "public function setUser($user){\n $session=Service::get('session');\n $session->set('isAuth', true);\n $session->set('user', $user);\n $session->set('role', $user->role);\n\n\n }", "public function get_role(){\n $current_session = $this->setting_model->getCurrentSession();\n $userdata = $this->session->userdata();\n if(array_key_exists('student', $userdata)){\n $role = \"student\";\n }else{\n $role = \"admin\";\n }\n return $role;\n \n }", "private function setUser()\n {\n $this->cas_user = phpCAS::getUser();\n Session::put('cas_user', $this->cas_user);\n }", "function bbp_profile_update_role($user_id = 0)\n{\n}", "private static function _get_role()\n {\n static $role = NULL;\n if (NULL !== $role)\n return ($role);\n\n if (!is_user_logged_in())\n return ($role = FALSE);\n\n $user = PeepSoUser::get_instance(get_current_user_id());\n return ($role = $user->get_user_role());\n }", "protected function setLocaleUser()\r\n\t{\r\n\t\tif(method_exists($this->event->getAuthenticationToken()->getUser()->getLangCode(), 'getId'))\r\n\t\t\t$this->getSession()->setLocale($this->event->getAuthenticationToken()->getUser()->getLangCode()->getId());\r\n\t\telse\r\n\t\t\t$this->getSession()->setLocale($this->container->get('pi_app_admin.locale_manager')->parseDefaultLanguage());\r\n\t}", "public function setRole($value) {\r\n\t\t\t\t\t\tif( !$value instanceof Role ) {\r\nif(DEBUG_C)\t\t\t\techo \"<p class='debugClass err'><b>Line \" . __LINE__ . \"</b>: role: MUST BE AN INSTANCE OF CLASS 'Role'! <i>(\" . basename(__FILE__) . \")</i></p>\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$this->role = ($value);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}", "function roles_set_role($role, $user = null) {\r\n\t$user = isset($user) ? $user : elgg_get_logged_in_user_entity();\r\n\tif ($user instanceof ElggUser && $role instanceof ElggRole) {\r\n\t\treturn roles()->setRole($user, $role);\r\n\t}\r\n\treturn false;\r\n}", "public function getUserRoleIdAction ( )\n {\n // specify the needed classes\n $this->view->role = $this->getModel('User')->fromSession()->getRoleId();\n\n }", "function update_meta_on_change( $user_id, $role, $old_roles ){\n switch( $role ){\n case 'dc_vendor':\n var_view($user_id);\n register_approved_date( $user_id );\n return true;\n break; \n }\n}", "function leadin_get_user_role ()\n{\n global $current_user;\n\n $user_roles = $current_user->roles;\n $user_role = array_shift($user_roles);\n\n return $user_role;\n}", "public function setUser()\r\n\t{\r\n\t\t$uinfo = Session::get('uinfo');\r\n\t\t\r\n\t\t$this->page['user'] = empty($uinfo) ? AccountService::defaultUser() : json_decode($uinfo,true);\r\n\t}", "function bbp_set_current_user_default_role()\n{\n}", "public function getRole() {\n $user = new Pas_User_Details();\n $person = $user->getPerson();\n if ($person) {\n $this->_role = $person->role;\n } else {\n $this->_role = 'public';\n }\n return $this->_role;\n }", "function bbp_add_user_form_role_field()\n{\n}", "function user(){\r\n\t\t\tif(isset($_SESSION[\"Auth\"]->id_role)){\r\n\t\t\t\treturn $_SESSION[\"Auth\"]->id_role;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}" ]
[ "0.6612814", "0.6095243", "0.58367723", "0.56337535", "0.56085795", "0.55934495", "0.5563668", "0.5558772", "0.55385274", "0.55206347", "0.54907197", "0.54685843", "0.5451518", "0.5445838", "0.5444211", "0.54428303", "0.54385823", "0.54227114", "0.54114133", "0.5401434", "0.53726417", "0.5371577", "0.5363705", "0.53584516", "0.53572005", "0.53369606", "0.5335643", "0.53325945", "0.5319121", "0.5318823" ]
0.768763
0
Fetch and set the role the user has according to the VOOT membership and the role to group membership mapping
function vr_set_role($cookie, WP_User $user) { $fetchVootRole = get_user_meta($user->ID, "fetch_voot_role", TRUE); if (!$fetchVootRole) { return; } $config = parse_ini_file("config/vr.ini", TRUE); if (!is_array($config) || empty($config)) { $message = "[voot-roles] ERROR: configuration file is malformed"; error_log($message); die($message); } $clientPath = $config['OAuth']['clientPath']; require_once $clientPath . DIRECTORY_SEPARATOR . "lib" . DIRECTORY_SEPARATOR . "_autoload.php"; $groups = array(); try { $appId = $config['OAuth']['appId']; $client = new \OAuth\Client\Api($appId); $client->setUserId($user->ID); $client->setScope("read"); $client->setReturnUri(vr_determine_return_uri()); $apiEndpoint = $config['Voot']['apiEndpoint']; $message = "[voot-roles] INFO: performing VOOT call"; error_log($message); $response = $client->makeRequest($apiEndpoint . "/groups/@me"); if (200 !== $response->getStatusCode()) { $message = "[voot-roles] ERROR: unexpected status code from VOOT provider (" . $response->getStatusCode() . "): " . $response->getContent(); error_log($message); die($message); } $content = $response->getContent(); if (empty($content)) { $message = "[voot-roles] ERROR: empty response from VOOT provider"; error_log($message); die($message); } $data = json_decode($content, TRUE); if (NULL === $data || !is_array($data)) { $message = "[voot-roles] ERROR: invalid/no JSON response from VOOT provider: " . $content; error_log($message); die($message); } if (!array_key_exists("entry", $data)) { $message = "[voot-roles] ERROR: invalid JSON response from VOOT provider, missing 'entry': " . $content; error_log($message); die($message); } $groups = $data['entry']; } catch (\OAuth\Client\ApiException $e) { // FIXME: we probably should just return, if it didn't work out...well $message = "[voot-roles] OAuth ERROR: " . $e->getMessage(); error_log($message); die($message); } // FIXME: use WP_Roles to go through all registered roles if (vr_is_member_of($config['Voot']['administratorRoleGroup'], $groups)) { $role = "administrator"; } elseif (vr_is_member_of($config['Voot']['editorRoleGroup'], $groups)) { $role = "editor"; } elseif (vr_is_member_of($config['Voot']['authorRoleGroup'], $groups)) { $role = "author"; } elseif (vr_is_member_of($config['Voot']['contributorRoleGroup'], $groups)) { $role = "contributor"; } else { // everyone who succesfully authenticates will become a subscriber $role = "subscriber"; } if (!in_array($role, $user->roles)) { $user->set_role($role); wp_update_user(array('ID' => $user->ID, 'role' => $role)); } // we fetched the role of the user and set the role accordingly, now set // it to FALSE until next wp_login update_user_meta($user->ID, "fetch_voot_role", FALSE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vr_set_fetch_voot_role_meta($username, WP_User $user)\n{\n update_user_meta($user->ID, \"fetch_voot_role\", TRUE);\n}", "private function setRole()\n {\n $this->role = $this->getUser()->getRoles();\n\n if(in_array('ROLE_USER', $this->role) && count($this->role) > 1) {\n unset($this->role[array_search('ROLE_USER', $this->role)]);\n }\n }", "function a_role()\n\t{\n\t\tif ($this->params->event == 'pre_get'){\n\t\t\t$this->_get_filtered(TRUE, FALSE);\n\t\t\t\n\t\t\tif (isset($this->params->for_user) && !empty($this->params->for_user)) {\n\t\t\t\t$this->params->where_in['id'] = $this->_get_role($this->params->for_user);\n\t\t\t}\n\t\t}\n\t}", "function userRoles($role = 0, $set_user = null) {\n\t\tglobal $framework, $user;\n\t\tif ($set_user) {\n\t\t\t$user = $this->userData($set_user, 1);\n\t\t\t$role = $user['role'];\n\t\t} \n\t\t\n\t\tif ($role == 1) {\n\t\t\t$role = 'User';\n\t\t} elseif ($role == 2) {\n\t\t\t$role = 'Artist';\n\t\t} elseif ($role == 3) {\n\t\t\t$role = 'Music Aggregator';\n\t\t} elseif ($role == 4) {\n\t\t\t$role = 'Administrator';\n\t\t} elseif ($role == 5) {\n\t\t\t$role = 'Super Administrator';\n\t\t}\n\t\treturn $role;\n\t}", "private function loadRoles() {\n \n // Get the roles for this organisation\n $query = \"SELECT * FROM organisation_roles WHERE organisation_id = ?\";\n \n if ($result = $this->db->fetchAll($query, $this->id)) {\n foreach ($result as $row) {\n $this->roles[$row['role_id']] = $row['role_name'];\n }\n }\n \n return;\n \n }", "function assignRole($role);", "public function getUserRoles();", "function bbp_get_user_role_map()\n{\n}", "public function getRole();", "public function getRole();", "abstract protected function _getUserRoles($user);", "public function testMemberRole() {\n $membership = Og::createMembership($this->group, $this->user);\n $membership->setState(OgMembershipInterface::STATE_ACTIVE)->save();\n\n $membership = $this->entityTypeManager->getStorage('og_membership')->loadUnchanged($membership->id());\n\n $roles = $membership->getRoles();\n $role = current($roles);\n\n $this->assertEquals(1, count($roles));\n $this->assertEquals(OgRoleInterface::AUTHENTICATED, $role->getName());\n }", "function og_ui_user_admin_role($form, $form_state, $obj_type, $oid) {\n if ($group = og_get_group($obj_type, $oid)) {\n $form['group'] = array('#type' => 'value', '#value' => $group);\n\n $rid = arg(7);\n if ($rid) {\n og_set_breadcrumb($obj_type, $oid, array(l(t('Group'), \"$obj_type/$oid/og\")), l(t('Roles'), \"og/$obj_type/$oid/admin/people/roles\"));\n\n $og_roles = og_get_group_default_roles($group->gid);\n if (in_array($rid, $og_roles)) {\n drupal_goto(\"og/$obj_type, $oid/admin/people/roles\");\n }\n // Display the edit role form.\n $role = og_user_role_load($rid);\n $form['name'] = array(\n '#type' => 'textfield',\n '#title' => t('Role name'),\n '#default_value' => $role->name,\n '#size' => 30,\n '#required' => TRUE,\n '#maxlength' => 64,\n '#description' => t('The name for this role. Example: \"moderator\", \"editorial board\", \"site architect\".'),\n );\n $form['rid'] = array(\n '#type' => 'value',\n '#value' => $rid,\n );\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save role'),\n );\n $form['delete'] = array(\n '#type' => 'submit',\n '#value' => t('Delete role'),\n );\n }\n else {\n og_set_breadcrumb($obj_type, $oid, array(l(t('Group'), \"$obj_type/$oid/og\")));\n\n $form['name'] = array(\n '#type' => 'textfield',\n '#size' => 32,\n '#maxlength' => 64,\n );\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Add role'),\n );\n $form['#submit'][] = 'og_ui_user_admin_role_submit';\n $form['#validate'][] = 'og_ui_user_admin_role_validate';\n }\n return $form;\n }\n else {\n // Not a group node.\n drupal_not_found();\n exit;\n }\n}", "public static function assignRoleToUser($user_id,$role_id);", "function bbp_get_moderator_role()\n{\n}", "public function set_users_roles($wp_user) {\n //1 What we need to do is run through all Memberships and get a list of ALL Roles attached to ALL Memberships\n //2 Then we need to get the Roles this user should have according to their active memberships\n //3 Then we need to get an array_diff of the two, and remove the one's that are different\n //4 Then we'll re-add the Roles the user should have (from step 2 above)\n //Along the way we also need to keep track of Roles the user may have which aren't associated with Memberships - and make sure they stay in place\n //And lastly - make sure the user doesn't have an empty $wp_user->roles - if they somehow do - we'll just set the default role\n\n $all_memberships_roles = $this->get_all_roles_from_all_memberships();\n $roles_user_should_have = $this->get_users_active_roles($wp_user);\n $roles_to_remove = array_diff($all_memberships_roles, $roles_user_should_have);\n\n //Remove the Roles they shouldn't have\n $roles_to_remove = MeprHooks::apply_filters('mepr-userroles-remove-roles', $roles_to_remove, $wp_user);\n if(!empty($roles_to_remove)) {\n $this->remove_roles($wp_user, $roles_to_remove);\n }\n\n //Add the Roles they should have\n $roles_user_should_have = MeprHooks::apply_filters('mepr-userroles-add-roles', $roles_user_should_have, $wp_user);\n if(!empty($roles_user_should_have)) {\n $this->add_roles($wp_user, $roles_user_should_have);\n }\n\n //Reset the user caches\n clean_user_cache($wp_user);\n\n //Check if the user now has no Roles - if so - we'll reset them to the default WP Role\n //Need to do this after cleaning user caches to ensure we get the proper $wp_user->roles\n $wp_user = get_user_by('id', $wp_user->ID);\n\n if($wp_user !== false && empty($wp_user->roles)) {\n $this->reset_role($wp_user);\n }\n }", "public function get_roles();", "public function assignRole($user, $role);", "public function setSessionDataUserRole(){\n $session_data = $this->session->userdata('logged_in');\n return $session_data['userrole'];\n }", "function populate(TDProject_Core_Common_ValueObjects_UserViewData $dto) {\n \tparent::populate($dto);\n $this->_roles = $dto->getRoles();\n $this->_roleIdFk = $dto->getDefaultRole()->getRoleId();\n $this->_locales = $dto->getLocales();\n }", "private function getOrCreateRole()\n {\n $yuzuRole = Mage::getModel('api/role')->getCollection()\n ->addfieldToSelect('*')\n ->addFieldToFilter('role_name', array('like' => 'yuzu'))\n ->getFirstItem();\n\n if (!$yuzuRole->getRoleId()) {\n\n $resource = array(\n \"giftmessage\",\n \"core\",\n \"core/magento\",\n \"core/magento/info\",\n \"core/store\",\n \"core/store/list\",\n \"catalog\",\n \"catalog/product\",\n \"catalog/product/info\",\n \"catalog/product/attributes\",\n \"catalog/product/attribute\",\n \"catalog/product/attribute/info\",\n \"catalog/product/attribute/option\",\n \"catalog/product/attribute/types\",\n \"catalog/product/attribute/read\",\n \"catalog/product/media\",\n \"catalog/category\",\n \"catalog/category/info\",\n \"catalog/category/attributes\",\n \"catalog/category/tree\",\n \"sales\",\n \"sales/order\",\n \"sales/order/creditmemo\",\n \"sales/order/creditmemo/list\",\n \"sales/order/creditmemo/info\",\n \"sales/order/invoice\",\n \"sales/order/invoice/info\",\n \"sales/order/invoice/void\",\n \"sales/order/invoice/comment\",\n \"sales/order/shipment\",\n \"sales/order/shipment/info\",\n \"sales/order/shipment/track\",\n \"sales/order/info\",\n \"customer\",\n \"customer/info\",\n \"customer/address\",\n \"customer/address/info\",\n \"cataloginventory\",\n \"cataloginventory/info\",\n \"directory\",\n \"directory/region\",\n \"directory/country\",\n );\n\n $role = Mage::getModel('api/roles');\n\n $role = $role\n ->setName(\"yuzu\")\n ->setPid(false)\n ->setRoleType('G')\n ->save();\n\n Mage::getModel(\"api/rules\")\n ->setRoleId($role->getId())\n ->setResources($resource)\n ->saveRel();\n\n return $role->getId();\n }\n\n return $yuzuRole->getRoleId();\n }", "public function role_ajax(){\n\t\t$tmp_classID\t= $this->pdh->get('member', 'classid', array($this->in->get('requestid')));\n\t\t$mystatus\t\t= $this->pdh->get('calendar_raids_attendees', 'myattendees', array($this->url_id, $this->user->data['user_id']));\n\t\t$myrole\t\t\t= ($mystatus['member_role'] > 0) ? $mystatus['member_role'] : $this->pdh->get('member', 'defaultrole', array($this->in->get('requestid')));\n\t\techo $this->jquery->dd_create_ajax($this->pdh->get('roles', 'memberroles', array($tmp_classID)), array('selected'=>$myrole));exit;\n\t}", "function bbp_filter_user_roles_option()\n{\n}", "function bbp_set_user_role($user_id = 0, $new_role = '')\n{\n}", "function bbp_get_user_role($user_id = 0)\n{\n}", "function roles_set_role($role, $user = null) {\r\n\t$user = isset($user) ? $user : elgg_get_logged_in_user_entity();\r\n\tif ($user instanceof ElggUser && $role instanceof ElggRole) {\r\n\t\treturn roles()->setRole($user, $role);\r\n\t}\r\n\treturn false;\r\n}", "function changeRole(){\n \n global $REQUEST;\n \n //check if anybody is logged in\n if(!isset($_SESSION['isLogged']) || $_SESSION['isLogged'] === false ) {\n return array(\"success\"=>false,\"message\"=>\"Nobody is Logged In\");\n }\n \n //check if logged user on server is the same as logged user in coockies\n if(!isset($REQUEST['id'],$_SESSION['userId'],$_SESSION['role']) || empty($REQUEST['id']) || \n empty($_SESSION['userId']) || $REQUEST['id'] !== $_SESSION['userId'] ){\n return array(\"success\"=>false,\"message\"=>\"Logged User cannot be determined!\");\n }\n \n //check if logged user is admin\n if($_SESSION['role'] !== 'admin'){\n return array(\"success\"=>false,\"message\"=>\"Only admin can change roles!\");\n }\n \n //check if all required fields was provided from UI\n if(!isset($REQUEST['targetUserId'],$REQUEST['role']) || empty($REQUEST['targetUserId']) || empty($REQUEST['role'])){\n return array(\"success\"=>false,\"message\"=>\"Missing required fileds!\");\n }\n \n //check new role\n if($REQUEST['role'] !== 'admin' && $REQUEST['role'] !== 'user' ){\n return array(\"success\"=>false,\"message\"=>\"New role is not valid!\");\n }\n \n $REQUEST['last_modified'] = $this->currentDate; //create last-modified field and assign current date to it\n $dbResult = $this->userModel->updateRole($REQUEST); //call update role method which provides access to DB\n \n //process DB response\n if($dbResult['rowsAffected'] == 1){\n return array(\"success\"=>true,\"message\"=>\"Role changed successfully!\");\n }else if($dbResult['rowsAffected'] == 0){\n return array(\"success\"=>false,\"message\"=>\"Role could not be changed!\",\"error\"=>$dbResult['error']);\n }else{\n return array(\"success\"=>false,\"message\"=>\"Something bad happend.Probably more than 1 Role changed!\");\n }\n \n }", "public function setRoles(Authenticatable $user) {\n if (isset($this->ldapRole) && isset($this->roleMap)) {\n $this->connect();\n $userInfo = $this->adldap->user()->info($user->name, [$this->ldapRole])[0];\n $this->disconnect();\n $userRolesFromLdap = array_slice($userInfo[$this->ldapRole],1);\n $userModel = $this->userModel;\n foreach ($this->roleMap as $role => $entrust_role) {\n $userHasRole = $userModel::find($user->id)->hasRole($entrust_role);\n $ldapHasRole = in_array($role,$userRolesFromLdap);\n $entrust_role = \\App\\Role::where('name','=',$entrust_role)->first();\n if ($userHasRole && !$ldapHasRole) {\n $user->detachRole($entrust_role);\n }\n if (!$userHasRole && $ldapHasRole) {\n $user->attachRole($entrust_role);\n }\n }\n }\n }", "function bbp_get_dynamic_roles()\n{\n}", "function setUserRoles(){\n\n $t = &get_instance();\n\n $t->load->model(\"user_role_model\");\n $user_roles = $t->user_role_model->get_all(\n array(\n \"isActive\" => 1\n )\n );\n\n $roles = array();\n foreach ($user_roles as $role){\n $roles[$role->id] = $role->permissions;\n }\n\n $t->session->set_userdata(\"user_roles\", $roles);\n\n}" ]
[ "0.646518", "0.6262805", "0.62484723", "0.62248313", "0.61529833", "0.61128104", "0.60948795", "0.60734236", "0.6001634", "0.6001634", "0.59584117", "0.5953436", "0.5948547", "0.59453183", "0.5941723", "0.59067255", "0.5896375", "0.5891254", "0.5888673", "0.5870167", "0.58680195", "0.58623224", "0.58584017", "0.58514374", "0.58332074", "0.58216", "0.58078754", "0.5807806", "0.5804067", "0.57989377" ]
0.6303225
1
Return a Bitter instance from the provided Redis connection. Use the 'default' Redis connection.
public function connection($connection = null) { $client = ($connection instanceof PredisClient) ? $connection : Redis::connection($connection ?: 'default'); return new ExtendedBitter($client); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function connection(): RedisConnection\n {\n return $this->redis->connection('default');\n }", "public function connection()\n\t{\n\t\treturn Redis::connection('swoole');\n\t}", "function connect(string $host = '127.0.0.1', int $port = 6379, string $redisInstance = DEFAULT_INSTANCE): Redis\n{\n $redis = new Redis();\n $redis->connect($host, $port);\n\n Container\\set($redisInstance, $redis);\n\n return $redis;\n}", "public static function connect($config)\r\n {\r\n $connection = new Redis();\r\n $connected = $connection -> connect($config[\"host\"], $config[\"port\"]);\r\n if($connected && isset($config[\"password\"]) && $config[\"password\"]!= \"\") $connected = $connection -> auth($config[\"password\"]);\r\n if($connected && isset($config[\"database\"]) && $config[\"database\"]!= \"\") $connected = $connection -> select($config[\"database\"]);\r\n\r\n if(!$connected) Crown::error(\"Database \" . $config[\"id\"] . \" not available\");\r\n else return $connection;\r\n }", "protected function getRedisAdapter()\n {\n }", "public function GetRedisConn() {\n\t\treturn $this->redis_conn;\n\t}", "protected function connection()\n {\n return $this->redis->connection('horizon');\n }", "protected function connection()\n {\n return $this->redis->connection('horizon');\n }", "function redis_init()\n {\n $redis = new Redis();\n if (!$redis->pconnect($GLOBALS['config']['redis_host'], $GLOBALS['config']['redis_port'])) drop_error();\n\n return $redis;\n }", "public function getRedisInstance()\n {\n if (REDIS_ENABLED) {\n try {\n // get instance\n $redis = new \\Redis();\n $redis->pconnect(REDIS_HOST, REDIS_PORT);\n REDIS_AUTH && $redis->auth(REDIS_AUTH);\n $redis->setOption(\\Redis::OPT_SERIALIZER, \\Redis::SERIALIZER_PHP);\n return $redis;\n } catch (\\RedisException $e) {}\n }\n\n return null;\n }", "public function throttleWithRedis()\n {\n $this->throttleWithRedis = true;\n\n return $this;\n }", "static function getInstance() {\n if ( !self::$_instance instanceof RabbitConnection)\n self::$_instance = new RabbitConnection();\n\n return self::$_instance;\n }", "protected static function getRedis($key = NULL) {\n\t\tstatic $config = NULL;\n\t\tis_null($config) && $config = \\Snake\\Libs\\Base\\Config::load('Redis');\n\n\t\t$count = count($config->servers);\n\t\t$server_id = is_null($key) ? 0 : (hexdec(substr(md5($key), 0, 2)) % $count);\n\n\t\tif (!isset(self::$connections[$server_id])) {\n\t\t\t$host = $config->servers[$server_id]['host'];\n\t\t\t$port = $config->servers[$server_id]['port'];\n\t\t\tself::$connections[$server_id] = self::connect($host, $port);\n\t\t}\n\t\treturn self::$connections[$server_id];\n\t}", "protected function manager()\n {\n $conn = \\request()->get('conn');\n\n return RedisManager::instance($conn);\n }", "public function getSignalsConnection()\n {\n $database = config('fair-queue.signals_database');\n return Redis::connection($database);\n }", "public function getRedis()\n {\n return $this->redis;\n }", "public function getRedis()\n {\n return $this->redis;\n }", "public static function getDbCache()\n {\n static $driver;\n if (empty($driver)) {\n $redis = new \\Redis();\n $redis->connect(REDIS_HOST, REDIS_PORT);\n $driver = new \\Doctrine\\Common\\Cache\\RedisCache();\n $driver->setRedis($redis);\n }\n\n return $driver;\n }", "protected function createRedisDriver()\n {\n return $this->createCacheBased('redis');\n }", "public function connect()\n {\n if ($this->resource) {\n return $this;\n }\n\n $redis = new Redis();\n $server = $this->getServer();\n\n if ($server['persistent_id']) {\n //connect or reuse persistent connection\n $success = $redis->pconnect($server['host'], $server['port'], $server['timeout'], $server['persistent_id']);\n } elseif ($server['port']) {\n $success = $redis->connect($server['host'], $server['port'], $server['timeout']);\n } elseif ($server['timeout']) {\n //connect through unix domain socket\n $success = $redis->connect($server['host'], $server['timeout']);\n } else {\n $success = $redis->connect($server['host']);\n }\n\n if (!$success) {\n throw new Exception\\ConnectionException('Could not estabilish connection with Redis instance');\n }\n\n if ($server['password']) {\n $redis->auth($server['password']);\n }\n\n if (!empty($server['auth'])) {\n $redis->auth($server['auth']);\n }\n\n if ($server['database']) {\n $redis->select($server['database']);\n }\n\n foreach ($this->getLibOptions() as $k => $v) {\n $redis->setOption($k, $v);\n }\n\n $this->resource = $redis;\n return $this;\n }", "private function getRedisObject($key)\n {\n if (!array_key_exists($key, $this->connections)) {\n $this->connections[$key] = new \\Redis();\n $this->connections[$key]->connect(\n $this->connectionsOptions[$key][0],\n $this->connectionsOptions[$key][1],\n $this->connectionsOptions[$key][2]\n );\n }\n\n return $this->connections[$key];\n }", "public function connect(array $config)\n {\n return new RedisQueue(\n $this->redis, $config['queue'],\n $config['connection'] ?? $this->connection,\n $config['retry_after'] ?? 60,\n $config['block_for'] ?? null\n );\n }", "function connect() {\n\t\t\t$client = $this->redis->connect('127.0.0.1', 6379);\n\t\t\t$this->assertTrue($client->connected());\n\t\t\t$this->assertTrue($client->AUTH('test'));\n\t\t\treturn $client;\n\t\t}", "public function getClient()\n\t{\n\t\tif ($this->_client === null) {\n\t\t\tif($this->enableProfiling) {\n\t\t\t\t$profileToken = 'bogo.yii.predis.APredisConnection.create()';\n\t\t\t\tYii::beginProfile($profileToken, 'bogo.yii.predis.APredisConnection');\n\t\t\t} else {\n\t\t\t\t$profileToken = null;\n\t\t\t}\n\n\t\t\t// Create instance\n\t\t\t$this->_client = new Predis\\Client($this->connectionParameters, $this->clientOptions);\n\n\t\t\t// Define commands\n\t\t\t$profile = $this->_client->getProfile();\n\t\t\t/* @var $profile Predis\\Profile\\ServerProfile */\n\n\t\t\t// Make sure defineCommands is an array\n\t\t\tif (empty($this->defineCommands)) {\n\t\t\t\t$this->defineCommands = array();\n\t\t\t}\n\n\t\t\tif (!isset($this->defineCommands['delete'])) {\n\t\t\t\t$this->defineCommands['delete'] = 'Predis\\Command\\KeyDelete';\n\t\t\t}\n\n\t\t\tforeach ($this->defineCommands as $alias=>$command) {\n\t\t\t\t$profile->defineCommand($alias, $command);\n\t\t\t}\n\n\t\t\tif ($profileToken) {\n\t\t\t\tYii::endProfile($profileToken, 'bogo.yii.predis.APredisConnection');\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_client;\n\t}", "public static function getInstance(): BotConnection\n {\n if (self::$instance == null) {\n self::$instance = resolve(BotConnection::class);\n }\n\n return self::$instance;\n }", "function get(string $key, string $redisInstance = DEFAULT_INSTANCE)\n{\n $redis = Container\\get($redisInstance);\n return $redis->get($key);\n}", "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 }", "function getConnection( $server ) {\n\t\t// Servers are marked dead for a limited period of time, to\n\t\t// avoid excessive overhead from repeated connection timeouts.\n\t\tif ( isset( $this->downServers[$server] ) ) {\n\t\t\t$now = time();\n\t\t\tif ( $now > $this->downServers[$server] ) {\n\t\t\t\t// Dead time expired\n\t\t\t\tunset( $this->downServers[$server] );\n\t\t\t} else {\n\t\t\t\t// Server is dead\n\t\t\t\twfDebug( \"server $server is marked down for another \" .\n\t\t\t\t\t( $this->downServers[$server] - $now ) . \" seconds, can't get connection\\n\" );\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Check if a connection is already free for use\n\t\tif ( isset( $this->connections[$server] ) ) {\n\t\t\tforeach ( $this->connections[$server] as &$connection ) {\n\t\t\t\tif ( $connection['free'] ) {\n\t\t\t\t\t$connection['free'] = false;\n\t\t\t\t\t--$this->idlePoolSize;\n\n\t\t\t\t\treturn new RedisConnRef( $this, $server, $connection['conn'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( substr( $server, 0, 1 ) === '/' ) {\n\t\t\t// UNIX domain socket\n\t\t\t// These are required by the redis extension to start with a slash, but\n\t\t\t// we still need to set the port to a special value to make it work.\n\t\t\t$host = $server;\n\t\t\t$port = 0;\n\t\t} else {\n\t\t\t// TCP connection\n\t\t\t$hostPort = IP::splitHostAndPort( $server );\n\t\t\tif ( !$hostPort ) {\n\t\t\t\tthrow new MWException( __CLASS__ . \": invalid configured server \\\"$server\\\"\" );\n\t\t\t}\n\t\t\tlist( $host, $port ) = $hostPort;\n\t\t\tif ( $port === false ) {\n\t\t\t\t$port = 6379;\n\t\t\t}\n\t\t}\n\n\t\t$conn = new Redis();\n\t\ttry {\n\t\t\tif ( $this->persistent ) {\n\t\t\t\t$result = $conn->pconnect( $host, $port, $this->connectTimeout );\n\t\t\t} else {\n\t\t\t\t$result = $conn->connect( $host, $port, $this->connectTimeout );\n\t\t\t}\n\t\t\tif ( !$result ) {\n\t\t\t\twfDebugLog( 'redis', \"Could not connect to server $server\" );\n\t\t\t\t// Mark server down for some time to avoid further timeouts\n\t\t\t\t$this->downServers[$server] = time() + self::SERVER_DOWN_TTL;\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ( $this->password !== null ) {\n\t\t\t\tif ( !$conn->auth( $this->password ) ) {\n\t\t\t\t\twfDebugLog( 'redis', \"Authentication error connecting to $server\" );\n\t\t\t\t}\n\t\t\t}\n\t\t} catch ( RedisException $e ) {\n\t\t\t$this->downServers[$server] = time() + self::SERVER_DOWN_TTL;\n\t\t\twfDebugLog( 'redis', \"Redis exception connecting to $server: \" . $e->getMessage() );\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $conn ) {\n\t\t\t$conn->setOption( Redis::OPT_READ_TIMEOUT, $this->readTimeout );\n\t\t\t$conn->setOption( Redis::OPT_SERIALIZER, $this->serializer );\n\t\t\t$this->connections[$server][] = array( 'conn' => $conn, 'free' => false );\n\n\t\t\treturn new RedisConnRef( $this, $server, $conn );\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "static public function getClient()\n {\n if (null === self::$client) {\n\n if (!class_exists('Predis\\Client')) {\n return self::$client = false;\n }\n\n $args = array();\n\n if (!empty($GLOBALS['REDIS_HOST'])) {\n $args['host'] = $GLOBALS['REDIS_HOST'];\n }\n if (!empty($GLOBALS['REDIS_PORT'])) {\n $args['port'] = $GLOBALS['REDIS_PORT'];\n }\n if (!empty($GLOBALS['REDIS_DB'])) {\n $args['database'] = $GLOBALS['REDIS_DB'];\n }\n if (!empty($GLOBALS['REDIS_PASS'])) {\n $args['password'] = $GLOBALS['REDIS_PASS'];\n }\n\n if (empty($info)) {\n self::$client = new \\Predis\\Client();\n } else {\n self::$client = new \\Predis\\Client($args);\n }\n }\n\n return self::$client;\n }", "protected function createRedisDriver()\n {\n $handler = $this->createCacheHandler('redis');\n\n $handler->getCache()->getStore()->setConnection(\n $this->config->get('session.connection')\n );\n\n return $this->buildSession($handler);\n }" ]
[ "0.71767646", "0.6202716", "0.60469794", "0.5946229", "0.59400725", "0.5875379", "0.5816947", "0.5816947", "0.57848054", "0.5777243", "0.57528174", "0.55926204", "0.55775905", "0.55457467", "0.5448967", "0.54269093", "0.54269093", "0.54047227", "0.5374922", "0.5320511", "0.5291592", "0.5274222", "0.52601975", "0.5247846", "0.5222405", "0.52216583", "0.51914203", "0.5145377", "0.5130691", "0.5116206" ]
0.66917634
1
Return a Year instance from the provided event name and date.
public function yearEvents($eventName, $dateTime = null) { $dateTime = ($dateTime instanceof DateTime) ? $dateTime : new Carbon($dateTime); return new Year($eventName, $dateTime); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function year($name)\n {\n return $this->addCommand('year', $this->madeArray($name));\n }", "public static function year(Carbon $date, bool $micro = FALSE)\n {\n return self::new($date->copy()->startOfYear(), $date->copy()->endOfYear(), $micro);\n }", "public function year();", "public function year($value);", "public function getYear();", "private function getYear($date_input) : int\n {\n $year = date('Y', strtotime($date_input));\n \n return $year;\n }", "public function getVehYearsByName($name)\n {\n return $this->vehYearRepository->findOneBy(\n array('name' => $name)\n );\n }", "public static function year($name) {\n\t\treturn new ColumnDefinition('YEAR', $name);\n\t}", "public function year($year)\n {\n empty($year) ? $this->year(date('Y')) : $this->year = $year;\n !is_numeric($this->year) ? $this->year = date('Y') : $this->year = $year; \n self::loadCalendar();\n\n }", "protected function get_year()\n\t{\n\t\treturn $this->get_date()->year;\n\t}", "public function getYear(): int\n {\n return (int) ((string) $this->toFormatInternal('Y'));\n }", "function getYear($date,$numeric=false){\n return $numeric?intval(substr($date, 0,4)):substr($date, 0,4);\n}", "public function fetchYear($year)\n {\n return $this->fetch(new \\DateTime($year.\"-1-1\"), new \\DateTime(($year + 1).\"-1-1\"));\n }", "function DateToYear($Date)\n {\n\treturn date(\"Y\", strtotime($Date));\n }", "public function getYear() {\n if ($this->tmpDate === null) {\n $this->tmpDate = Carbon::createFromFormat('Y-m-d', $this->date);\n }\n return $this->tmpDate->year;\n }", "public static function year()\n\t{\n\t\treturn date('Y');\n\t}", "public function year(int $year = null)\n {\n\n if (!$year) {\n static::$year = null;\n return $this;\n }\n\n $year = trim($year);\n // if (!ctype_digit($year) || $year < 1990 || $year > date('Y')) {\n if (!ctype_digit($year) || $year < 1990) {\n throw new \\Exception(sprintf('\"year\" must be a 4 digit number greater than 1990'));\n }\n $this->setParam('year', $year);\n static::$year = $year;\n return $this;\n }", "public function fromYear( $year ) {\n return $this->setMetaQuery( 'year', $year );\n }", "public function getYear()\n {\n $this->controlTimestamp();\n return date(\"Y\", $this->timestamp);\n }", "public function loadYearFromID($id){\n\t\t$sel_anno = \"SELECT * FROM rb_anni WHERE id_anno = {$id}\";\n\t\t$res_anno = $this->datasource->executeQuery($sel_anno);\n\t\t$year = new AnnoScolastico($res_anno[0]);\n\t\treturn $year;\n\t}", "public function getYear() : int\n {\n return (int) $this->format('Y');\n }", "public function year($value)\r\n\t{\r\n\t\t$this->year = $value;\r\n\t\treturn $this;\r\n\t}", "public function year()\n {\n return $this->config->numbers(date('Y', $this->dateTime));\n }", "public function getYear():int\n {\n return (int)$this->format('Y');\n }", "function getYear($datePart){\n // echo \"datepart-\" . $datePart . \"<br>\";\n return substr($datePart,0,4); \n }", "public function getByYear($date)\n\t{\n\t\t$datetime = strtotime($date);\n\t\t$year = date('Y', $datetime);\n\t\t\n\t\t$select = $this->select()\n ->order('jobShare_added DESC')\n\t\t\t\t ->where('year(jobShare_added) = ?', $year);\n\t\t\t\t \t \n\t\treturn $this->fetchAll($select);\n\t\t\n\t}", "public function yearFormat($date)\n {\n if (is_int($date))\n return date(\"Y\", $date);\n else\n return date(\"Y\", strtotime($date));\n }", "function get_year(&$what, &$obj) {\n if(\n preg_match('/^\\'?(\\d{2,3})\\'? /', $what, $matches, PREG_OFFSET_CAPTURE) ||\n preg_match('/(20|19)\\d\\d/', $what, $matches, PREG_OFFSET_CAPTURE) || \n preg_match('/ \\'?(0\\d)\\'?/', $what, $matches, PREG_OFFSET_CAPTURE)\n ) {\n $off = $matches[0][1];\n\n $what = substr($what, 0, $off) . substr($what, $off + strlen($matches[0][0]));\n $obj['year'] = parse_year($matches[0][0]);\n return;\n }\n}", "function returnYYYY($date) {\r\n return substr(self::dateIt($date), 0, 4);\r\n }", "function get_from_year()\r\n\t{\r\n\t\treturn isset( $_REQUEST[ 'from_year' ] ) ? $_REQUEST[ 'from_year' ]\t: date('Y');\r\n\t}" ]
[ "0.65704304", "0.6494922", "0.6173495", "0.61729753", "0.6102267", "0.5924979", "0.5902084", "0.5854029", "0.58134735", "0.5663267", "0.5646643", "0.563261", "0.5622328", "0.5589659", "0.5587005", "0.55848664", "0.5577373", "0.55761606", "0.556851", "0.5554023", "0.5539411", "0.55242354", "0.550859", "0.54999316", "0.54897135", "0.5421172", "0.53805953", "0.53712696", "0.53564405", "0.5336662" ]
0.6810759
0
Return a Month instance from the provided event name and date.
public function monthEvents($eventName, $dateTime = null) { $dateTime = ($dateTime instanceof DateTime) ? $dateTime : new Carbon($dateTime); return new Month($eventName, $dateTime); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function month(Carbon $date, bool $micro = FALSE)\n {\n return self::new($date->copy()->startOfMonth(), $date->copy()->endOfMonth(), $micro);\n }", "public function month();", "function getMonth( $event_id = null )\n\t{\n\t\t$raid_id = JRequest::getVar('raid_id', $event_id, 'INT');\n\t\tif ($raid_id)\n\t\t{\n\t\t\t$event = $this->getEvent($raid_id);\n\t\t\t\n\t\t\treturn substr($event->start_time,0,7);\n\t\t\t\n\t\t} else {\n\t\t\treturn date(\"Y-m\");\n\t\t}\n\t}", "public function month($month = null, $year = null, $parent = true) \n {\n is_numeric($month) ? $time = strtotime($month . '/1/' . $year) : $time = strtotime($month . ' 1st, ' . $year);\n $month = array();\n $month['long_name'] = date('F', $time);\n $month['long_number'] = date('m', $time);\n $month['short_name'] = date('M', $time);\n $month['short_number'] = date('n', $time);\n $month['number_of_days'] = date('t', $time);\n $month['year'] = date('Y', $time);\n $month['days'] = self::fillPage($month['short_number'], $year);\n $month['weeks'] = self::fillByWeek($month['short_number'], $year);\n if ($parent) { \n $previous = strtotime(\"-1 month\", $time);\n $next = strtotime(\"+1 month\", $time);\n $month['previous'] = self::month(date('m', $previous), date('Y', $previous), false);\n $month['next'] = self::month(date('m', $next), date('Y', $next), false);\n }\n return (object) $month;\n }", "public function month($value);", "function DateToMonth($Date)\n {\n\treturn date(\"m\", strtotime($Date));\n }", "public function getReportMonth($json)\n {\n $firstEntry = $json[0];\n\n return new Carbon( sprintf(\"%s/1/%s\", $firstEntry->report_month, $firstEntry->report_year) );\n }", "function get_month_from_number($id)\n {\n\n $monthNum = $id;\n $dateObj = DateTime::createFromFormat('!m', $monthNum);\n $monthName = $dateObj->format('F'); // March\n return $monthName ;\n }", "public static function month()\n\t{\n\t\treturn date('m');\n\t}", "public function month($name, $value = null, $options = [])\n {\n if ($value instanceof DateTime) {\n $value = $value->format('Y-m');\n }\n\n return $this->input('month', $name, $value, $options);\n }", "public function nextMonth(): Month\n {\n $month = $this->month + 1;\n $year = $this->year;\n if ($month > 12) {\n $month = 1;\n $year += 1;\n }\n return new Month($month, $year);\n }", "public function withMonth(int $month): static\n {\n return new static($this->year(), $month, $this->day());\n }", "protected function get_month()\n\t{\n\t\treturn $this->get_date()->format('m');\n\t}", "public function nextMonth():Month{\n\t\t$month=\t$this->month+1;\n\t\t$year=$this->year;\n\t\tif($month>12){\n\t\t\t$month=1;\n\t\t\t$year+=1;\n\t\t}\n\t\treturn new Month($month,$year);\n\t}", "public function getNextMonthObj()\n {\n if ($this->month == 12) {\n return new Month($this->year + 1, 1);\n } else {\n return new Month($this->year, $this->month + 1);\n }\n }", "public function month($month = 1)\n {\n self::$cronScheduler[3] = $month;\n\n return $this;\n }", "public static function fromMonth(int $year, int $month = 1, string $boundaryType = self::INCLUDE_START_EXCLUDE_END): self\n {\n $startDate = (new DateTimeImmutable())->setDate($year, $month, 1)->setTime(0, 0);\n\n return new self($startDate, $startDate->add(new DateInterval('P1M')), $boundaryType);\n }", "public function month($value)\r\n\t{\r\n\t\t$this->month = $value;\r\n\t\treturn $this;\r\n\t}", "public function build_month_title( $event_date ) {\n\t\t$event_date = Dates::build_date_object( $event_date )->format( Dates::DBDATEFORMAT );\n\n\t\t$title = sprintf(\n\t\t\tesc_html_x( '%1$s for %2$s', 'month view', 'the-events-calendar' ),\n\t\t\t$this->events_label_plural,\n\t\t\tdate_i18n( tribe_get_date_option( 'monthAndYearFormat', 'F Y' ), strtotime( $event_date ) )\n\t\t);\n\n\t\t/**\n\t\t * Filters the Month view title.\n\t\t *\n\t\t * @since 4.9.10\n\t\t *\n\t\t * @param string $title The Month view title.\n\t\t * @param string The date to use to build the title, in the `Y-m-d` format.\n\t\t */\n\t\treturn apply_filters( 'tribe_events_views_v2_month_title', $title, $event_date );\n\t}", "public function getMonth() {\n $strings = [ 'january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december' ];\n if ($this->tmpDate === null) {\n $this->tmpDate = Carbon::createFromFormat('Y-m-d', $this->date);\n }\n $month = $strings[$this->tmpDate->month - 1];\n return Lang::get('common.'.$month);\n }", "public function nextMonth()\n {\n $month = $this->month + 1;\n $year = $this->year;\n if ($month > 12) {\n $month = 1;\n $year += 1;\n }\n return new self($month, $year);\n }", "public function monthly(): self;", "protected function month($month)\n {\n return $this->builder->whereMonth('created_at', Carbon::parse($month)->month);\n }", "public function setMonthName($month_name)\n {\n $this->month_name = $month_name;\n\n return $this;\n }", "public function fetchMonth($year, $month)\n {\n $startDate = new \\DateTime($year.\"-\".$month.\"-1\");\n $endDate = new \\DateTime();\n $endDate->setTimestamp($startDate->getTimeStamp());\n $endDate->modify(\"+1 month\");\n\n return $this->fetch($startDate, $endDate);\n }", "public function getMonth($mm = NULL) {\n $months = [\n 1 => [\n 'name' => 'january',\n 'dim' => 'jan',\n ],\n 2 => [\n 'name' => 'february',\n 'dim' => 'feb',\n ],\n 3 => [\n 'name' => 'march',\n 'dim' => 'mar',\n ],\n 4 => [\n 'name' => 'april',\n 'dim' => 'apr',\n ],\n 5 => [\n 'name' => 'May',\n 'dim' => 'may',\n ],\n 6 => [\n 'name' => 'June',\n 'dim' => 'jun',\n ],\n 7 => [\n 'name' => 'july',\n 'dim' => 'jul',\n ],\n 8 => [\n 'name' => 'August',\n 'dim' => 'aug',\n ],\n 9 => [\n 'name' => 'september',\n 'dim' => 'sep',\n ],\n 10 => [\n 'name' => 'october',\n 'dim' => 'oct',\n ],\n 11 => [\n 'name' => 'november',\n 'dim' => 'nov',\n ],\n 12 => [\n 'name' => 'december',\n 'dim' => 'dec',\n ],\n ];\n if ($mm === NULL) {\n return $months;\n }\n if ($mm <= 0) {\n $mm = 12 + $mm;\n }\n return $months[(int) $mm];\n }", "public static function getMonth($mysqlDate)\n {\n $date = date_parse($mysqlDate);\n return $date['month'];\n }", "public function selectMonth($name, $selected = null, $options = [], $format = '%B')\n {\n $months = [];\n\n foreach (range(1, 12) as $month) {\n $months[$month] = strftime($format, mktime(0, 0, 0, $month, 1));\n }\n\n return $this->select($name, $months, $selected, $options);\n }", "public function selectMonth($name, $selected = null, $options = [], $format = '%B')\n {\n $months = [];\n\n foreach (range(1, 12) as $month) {\n $months[$month] = strftime($format, mktime(0, 0, 0, $month, 1));\n }\n\n return $this->select($name, $months, $selected, $options);\n }", "public function currentMonth($date = null) {\r\n $startDay = new DateTime($date); // inicio de la semana\r\n $endDay = new DateTime($date); // fin de la semana\r\n $startDay->modify('first day of this month');\r\n $endDay->modify('last day of this month');\r\n return array('startDate' => $startDay, 'endDate' => $endDay);\r\n }" ]
[ "0.6336143", "0.5698481", "0.5668067", "0.564332", "0.55388284", "0.54786956", "0.53821844", "0.53696936", "0.5316305", "0.5302338", "0.52920187", "0.5288697", "0.52861136", "0.52804977", "0.5258905", "0.5237874", "0.5230288", "0.52286273", "0.52248746", "0.51961565", "0.51849383", "0.5154171", "0.5131791", "0.51271164", "0.51167125", "0.5113444", "0.51066643", "0.5087718", "0.5087718", "0.5078748" ]
0.6542306
0
Return a Week instance from the provided event name and date.
public function weekEvents($eventName, $dateTime = null) { $dateTime = ($dateTime instanceof DateTime) ? $dateTime : new Carbon($dateTime); return new Week($eventName, $dateTime); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function week(Carbon $date, bool $micro = FALSE)\n {\n return self::new($date->copy()->startOfWeek(), $date->copy()->endOfWeek(), $micro);\n }", "private function __getMonday() {\n\t\t$date = new DateTime('now', new DateTimeZone('Europe/London'));\n\n\t\t$dayOfWeek = $date->format('N');\n\n\t\t// set the time to midnight\n\t\t$date->setTime(0,0,0);\n\n\t\t$offset = $dayOfWeek - 1;\n\n\t\t$date->sub(new DateInterval('P' . $offset . 'D'));\n\n\t\treturn $date;\n\t}", "function weekDay($date) {\r\n $obj = self::dateOBJ($date);\r\n return $obj['day'];\r\n }", "public function weekly(): self;", "function getWeek($week, $year) {\n $dto = new DateTime();\n $result['start'] = $dto->setISODate($year, $week, 1)->format('Y-m-d'); // date of monday for given week number\n $result['end'] = $dto->setISODate($year, $week, 5)->format('Y-m-d'); // date of friday for given week number\n return $result;\n}", "public function weeklyOn(int $day, ?string $time = null): self;", "function getMonday($date) {\r\n $now = $date;\r\n while (1) {\r\n $obj = self::dateOBJ($now);\r\n if ($obj['day'] == 1) return $now;\r\n $now = self::last_day($now);\r\n unset($obj);\r\n }\r\n }", "public function startOfWeek($date = null)\n {\n $now = clone $this->dateTimeProvider->get();\n\n if ($date) {\n $now = $this->modifyDate($now, $date);\n }\n\n $year = $now->format('o'); // o = ISO-8601 year number\n $week = $now->format('W'); // W = ISO-8601 week number of year, weeks starting on Monday\n\n $startOfWeek = $now->setISODate($year, $week);\n $startOfWeek->setTime(0, 0, 0);\n\n return $startOfWeek->format(\\DateTime::ISO8601);\n }", "function getWeekday($_date) {\n \t\treturn date('D', strtotime($_date));\n\t}", "private static function getDateOfDayOfCurrentWeek($nameOfday, \\Bitrix\\Main\\Type\\DateTime $date = null)\n\t{\n\t\t$date = $date? $date: new \\Bitrix\\Main\\Type\\DateTime();\n\n\t\t$nameOfday = mb_strtoupper($nameOfday);\n\t\tif (!in_array($nameOfday, Array('MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY')))\n\t\t\treturn false;\n\n\t\t$relation = '';\n\t\t$day = $date->format('N');\n\t\tif (\n\t\t\t$nameOfday == 'MONDAY' && $day == 1 ||\n\t\t\t$nameOfday == 'TUESDAY' && $day <= 2 ||\n\t\t\t$nameOfday == 'WEDNESDAY' && $day <= 3 ||\n\t\t\t$nameOfday == 'THURSDAY' && $day <= 4 ||\n\t\t\t$nameOfday == 'FRIDAY' && $day <= 5 ||\n\t\t\t$nameOfday == 'SATURDAY' && $day <= 6 ||\n\t\t\t$nameOfday == 'SUNDAY' && $day <= 7\n\t\t)\n\t\t{\n\t\t\t$relation = 'THIS';\n\t\t}\n\t\t$date->add($relation.' '.$nameOfday);\n\n\t\treturn $date;\n\t}", "public function currentWeek($date = null) {\r\n $startDay = new DateTime($date); // inicio de la semana\r\n $endDay = new DateTime($date); // fin de la semana\r\n // Si no es lunes\r\n if ($startDay->format('w') != 1) {\r\n $startDay = $startDay->modify('last monday');\r\n }\r\n // Si no es domingo\r\n if ($endDay->format('w') != 0) {\r\n $endDay = $endDay->modify('next sunday');\r\n }\r\n return array('startDate' => $startDay, 'endDate' => $endDay);\r\n }", "public function get_week_day($date) {\n \tlist($yyyy, $mm, $dd) = explode('/', $date);\n $a = floor((14 - $mm) / 12);\n $y = $yyyy - $a;\n $m = $mm + 12 * $a - 2;\n $d = $this->mod(\n ($dd + $y + floor($y / 4) - floor($y / 100) +\n floor($yyyy / 400) + floor((31 * $m) / 12)),\n 7\n );\n return $this->getDay($d, $date);\n }", "final public function weeklyOn($day, ...$days): self\n {\n return $this->weekly()->daysOfWeek($day, ...$days);\n }", "public function getWeekDay($index){\n $weekday = array(\n 'Sunday' => __d('tasks', 'Sunday'),\n 'Monday' => __d('tasks', 'Monday'),\n 'Tuesday' => __d('tasks', 'Tuesday'),\n 'Wednesday' => __d('tasks', 'Wednesday'),\n 'Thursday' => __d('tasks', 'Thursday'),\n 'Friday' => __d('tasks', 'Friday'),\n 'Saturday' => __d('tasks', 'Saturday')\n );\n if(array_key_exists($index, $weekday)){\n return $weekday[$index];\n } \n return false; \n }", "public function weeklyAt(int $day)\n {\n $rule = $this->getRuleArr();\n\n if ($day < 0) {\n $day = 0;\n }\n\n if ($day > 6) {\n $day = 6;\n }\n\n if ($rule[0] == '*') {\n $rule[0] = 0;\n }\n\n if ($rule[1] == '*') {\n $rule[1] = 0;\n }\n\n if ($rule[2] == '*') {\n $rule[2] = 0;\n }\n\n $rule[5] = $day;\n $this->setRule(implode(' ', $rule));\n return $this;\n }", "public function weekDay(): WeekDay\n {\n return WeekDay::fromValue((int) date('w', strtotime(sprintf(\n '%s-%s-%s',\n $this->year,\n $this->month,\n $this->day\n ))));\n }", "public static final function WEEK()\r\n {\r\n if(null === self::$WEEK)\r\n self::$WEEK = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit( 4, 1, 51 );\r\n \r\n return self::$WEEK;\r\n }", "public function isThisWeek();", "public function startOfWeek();", "public function week($week = 1)\n {\n self::$cronScheduler[4] = $week;\n\n return $this;\n }", "public function getWeekDayName(): string;", "public function week($name, $value = null, $options = [])\n {\n if ($value instanceof DateTime) {\n $value = $value->format('Y-\\WW');\n }\n\n return $this->input('week', $name, $value, $options);\n }", "function getSunday($date) {\r\n $now = $date;\r\n while (1) {\r\n $obj = self::dateOBJ($now);\r\n if ($obj['day'] == 7) return $now;\r\n $now = self::next_date($now);\r\n unset($obj);\r\n }\r\n }", "public function getWeek(): int;", "public function getWeekDay() {\n $weekday = (int) $this->date->format('w');\n\n return ($weekday === 0) ? $weekday = 7 : $weekday;\n }", "function getWeekNumber($ddate)\n{\n\t$date = new DateTime($ddate);\n\t$week = $date->format(\"W\");\n\treturn $week;\n}", "public function isWeekday();", "private function createWeekRow(Date $date): BasicRow {\n $row = new BasicRow();\n $row->addCssClass('sphp', 'week-row');\n $row->appendCell($this->createDayCell($date))->auto();\n $next = $date->nextDay();\n while ($next->getWeekDay() !== 1) {\n $row->appendCell($this->createDayCell($next))->auto();\n $next = $next->nextDay();\n }\n return $row;\n }", "public function getWeek()\n {\n return $this->week;\n }", "public static function getNextWeekDate(){\n\t\treturn PayUTestUtil::getDateFromToday ( PayUConfig::PAYU_DATE_FORMAT, 7);\n\t}" ]
[ "0.64605445", "0.5587605", "0.5581806", "0.5562736", "0.5470306", "0.5457817", "0.54407185", "0.53782773", "0.53331524", "0.53305084", "0.532447", "0.5323895", "0.5323296", "0.5287521", "0.5286516", "0.52323115", "0.52219397", "0.52200603", "0.5213524", "0.52074975", "0.51783675", "0.5175498", "0.51629984", "0.5134906", "0.50912684", "0.50895125", "0.5080732", "0.5072123", "0.506818", "0.50658286" ]
0.6212215
1
Return a Day instance from the provided event name and date.
public function dayEvents($eventName, $dateTime = null) { $dateTime = ($dateTime instanceof DateTime) ? $dateTime : new Carbon($dateTime); return new Day($eventName, $dateTime); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDay($day = NULL, $date = NULL) {\n $days = [\n 0 => [\n 'name' => t('sunday'),\n 'dim' => t('sun'),\n ],\n 1 => [\n 'name' => t('monday'),\n 'dim' => t('mon'),\n ],\n 2 => [\n 'name' => 'tuesday',\n 'dim' => 'tue',\n ],\n 3 => [\n 'name' => 'wednesday',\n 'dim' => 'wed',\n ],\n 4 => [\n 'name' => 'thursday',\n 'dim' => 'thu',\n ],\n 5 => [\n 'name' => 'friday',\n 'dim' => 'fri',\n ],\n 6 => [\n 'name' => 'saturday',\n 'dim' => 'sat',\n ],\n ];\n if ($day === NULL) {\n return $days;\n }\n return $days[$day];\n }", "public static function day(Carbon $date, bool $micro = FALSE)\n {\n return self::new($date->copy()->startOfDay(), $date->copy()->endOfDay(), $micro);\n }", "function findDayFromDate($date) {\n $day = date(\"D\",strtotime($date));\n return $day;\n }", "public static function GetDayFromDate($DateInput) {\n $DateOut = date_parse($DateInput);\n return $DateOut['day'];\n }", "public function get_day($date, $type){\n\t\tif(empty($type)){\n\t\t\t$letter = 'l';\n\t\t}else{\n\t\t\t$letter = 'D';\n\t\t}\n\t\treturn date($letter, strtotime($date));\n\t}", "public function withDay(int $day): static\n {\n return new static($this->year(), $this->month(), $day);\n }", "public static function createFromDate($year = null, $month = null, $day = null, $tz = null)\n {\n return static::create($year, $month, $day, null, null, null, $tz);\n }", "function weekDay($date) {\r\n $obj = self::dateOBJ($date);\r\n return $obj['day'];\r\n }", "public static function create(int $year, int $month, int $day): Date\n {\n return new static($year, $month, $day);\n }", "private function createDateObject(string $date): Google_Service_Calendar_EventDateTime\n {\n $obj = new Google_Service_Calendar_EventDateTime;\n $obj->setDateTime(Carbon::parse($date)->format(DATE_RFC3339));\n return $obj;\n }", "public function getByName(string $name)\n {\n $nameData = $this->where('name', $name)->first();\n\n $month = ltrim(substr($nameData->month_day, 0, 2), '\\0');\n $day = ltrim(substr($nameData->month_day, 2, 2), '\\0');\n\n $nameData->date = $day . '. ' . $month . '.';\n\n return $nameData;\n }", "public static function fromDay(int $year, int $month = 1, int $day = 1, string $boundaryType = self::INCLUDE_START_EXCLUDE_END): self\n {\n $startDate = (new DateTimeImmutable())->setDate($year, $month, $day)->setTime(0, 0);\n\n return new self($startDate, $startDate->add(new DateInterval('P1D')), $boundaryType);\n }", "public function oneById(EventId $id): Event;", "function getDay($key)\n {\n return $this->data[$key];\n }", "public function day($value)\r\n\t{\r\n\t\t$this->day = $value;\r\n\t\treturn $this;\r\n\t}", "public function createEvent($name, $data = array())\n {\n $owner = $this->getOwner(); /* @var ActiveRecord $owner */\n $event = new Event();\n $event->sender = $owner;\n $event->name = $name;\n $event->params = $data;\n return $event;\n }", "function DateToDay($Date)\n {\n\treturn date(\"d\", strtotime($Date));\n }", "public function getEasterMonday(?int $year = null): Date {\n return $this->getEasterSunday($year)->jumpDays(1);\n }", "function from_date($date) {\n\t\treturn $this->appointmentDate($date);\n\t}", "public function day($day = 1)\n {\n self::$cronScheduler[2] = $day;\n\n return $this;\n }", "public function getEvent(string $siteId, string $eventId): Event\n {\n $data = $this->api->get(\"sites/{$siteId}/events/{$eventId}\")->json();\n\n return new Event(...$data);\n }", "public function day($value);", "function getMonday($date) {\r\n $now = $date;\r\n while (1) {\r\n $obj = self::dateOBJ($now);\r\n if ($obj['day'] == 1) return $now;\r\n $now = self::last_day($now);\r\n unset($obj);\r\n }\r\n }", "public function new(string $name,object $subject = null,$data = null){\n return new Event($name,$subject,$data);\n }", "public function episode ($name)\n {\n $name = preg_replace(\",.*/,\",\"\",$name);\n $name = preg_replace(\"/_/\",\".\",$name);\n $name = preg_replace(\"/720p/\",\"\",$name);\n $name = preg_replace(\"/x264/\",\"\",$name);\n\n return new Episode($this->seriesNumber($name), $this->episodeNumber($name),$this->seriesName($name),\"\");\n }", "public function day();", "private function __getMonday() {\n\t\t$date = new DateTime('now', new DateTimeZone('Europe/London'));\n\n\t\t$dayOfWeek = $date->format('N');\n\n\t\t// set the time to midnight\n\t\t$date->setTime(0,0,0);\n\n\t\t$offset = $dayOfWeek - 1;\n\n\t\t$date->sub(new DateInterval('P' . $offset . 'D'));\n\n\t\treturn $date;\n\t}", "public function __construct($name, $eventDate) {\n $this->name = $name;\n $sleepTime = strtotime(timespan(time(), $eventDate));\n }", "public function setDay($day)\n {\n $this->day = $day;\n\n return $this;\n }", "public function setDay($day)\n {\n $this->day = $day;\n\n return $this;\n }" ]
[ "0.58097416", "0.5572804", "0.5404221", "0.53747684", "0.52262217", "0.5170364", "0.5166128", "0.5122516", "0.5051984", "0.5035128", "0.5011424", "0.4991446", "0.49812883", "0.4963326", "0.49319142", "0.49271265", "0.48995325", "0.4895793", "0.48596814", "0.48462006", "0.48156223", "0.48134133", "0.48110208", "0.4808719", "0.47927916", "0.47746205", "0.4757258", "0.47521535", "0.4708614", "0.4708614" ]
0.6111423
0
Return a Hour instance from the provided event name and date.
public function hourEvents($eventName, $dateTime = null) { $dateTime = ($dateTime instanceof DateTime) ? $dateTime : new Carbon($dateTime); return new Hour($eventName, $dateTime); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function hour($date_string)\n {\n return substr($date_string, 11, 2);\n }", "public static function hour()\n\t{\n\t\treturn date('H');\n\t}", "public function hour($value);", "public function hour()\n {\n $hour = date('H', $this->dateTime);\n return $this->config->numbers($hour);\n }", "public static function getEventPluginInstance($name)\n {\n if(!in_array($name, self::getEventPlugins(false))) {\n return null; // event plugin is not avaiable so skip loading\n }\n\n $filename = 'EventPlugins'.$name;\n $classname = 'TimeIt'.$filename;\n\n // load class if it isn't available\n if(!class_exists($classname)) {\n Loader::loadFile($filename.'.php','modules/TimeIt/EventPlugins');\n }\n\n $instance = null;\n\n\n if(class_exists($classname)) {\n $instance = new $classname();\n }\n\n return $instance;\n }", "public function convertDateHour($date) {\n return date(\"d/m/Y H:m:s\", strtotime($date));\n }", "function hour()\n {\n return gmdate (\"H:i\", time() + (3600 * $this->desfase));\n }", "public function hour($value)\r\n\t{\r\n\t\t$this->hour = $value;\r\n\t\treturn $this;\r\n\t}", "public function hourlyAt(int $offset): self;", "public function createIntervalHour(): DateContainerInterface\n {\n return $this->createFromFormat('Y-m-d H');\n }", "public function getHour(): int\n {\n return (int) ((string) $this->toFormatInternal('H'));\n }", "function getHours();", "public static final function HOUR()\r\n {\r\n if(null === self::$HOUR)\r\n self::$HOUR = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit( 5, 1, 23 );\r\n \r\n return self::$HOUR;\r\n }", "public function getHour()\n\t{\n\t\treturn $this->hour;\n\t}", "public function hourly(): self;", "public function hour($hour = '*')\n {\n self::$cronScheduler[1] = $hour;\n\n return $this;\n }", "public function getHour()\n {\n return $this->hour;\n }", "public function getActivityByHour($code, $date=null)\n {\n if($code != \"gtjedoc761\")\n die(\"Better luck next time, buddy.\");\n\n if(!$date)\n $date = date(\"Y-m-d\", time());\n\n $query = \"SELECT HOUR(u.createdAt) AS `hour`, COUNT(u.id) AS `count`\n FROM `User` u\n WHERE u.createdAt BETWEEN \\\"\".$date.\" 00:00:00\\\" AND \\\"\".$date.\" 23:59:59\\\"\n GROUP BY `hour`\n ORDER BY `hour`\";\n\n $hours = array();\n for($x = 0; $x < 24; $x++)\n $hours[$x] = 0;\n\n $results = $this->connection->getDbh()->query($query);\n foreach($results as $result)\n {\n $hour = (int) $result[\"hour\"];\n $hours[$hour] = (int) $result[\"count\"];\n }\n\n $info = array();\n foreach($hours as $hour => $count)\n {\n $info[] = array(\"hour\" => $hour, \"count\" => $count);\n }\n\n return $info;\n }", "public function __construct($name, $eventDate) {\n $this->name = $name;\n $sleepTime = strtotime(timespan(time(), $eventDate));\n }", "public function getHour($mode = 24, $withZero = true)\n {\n $this->controlTimestamp();\n if ($mode == 24) {\n if ($withZero)\n return date(\"H\", $this->timestamp);\n else\n return date(\"G\", $this->timestamp);\n } else {\n if ($withZero)\n return date(\"h\", $this->timestamp);\n else\n return date(\"g\", $this->timestamp);\n }\n }", "public function getTempByHour($hour);", "public function getHours()\n {\n $timeframes = (array) $this->getValue('hours.timeframes');\n $hours = array();\n\n foreach($timeframes AS $timeframe){\n\n $open = isset($timeframe['open']) ? $timeframe['open'] : null;\n if(!$open || !is_array($open)) continue;\n\n //Convert days to 0-6\n $days = array_map(function($day){\n\n $days = array('mon','tue','wed','thur','fri','sat','sun');\n return array_search(strtolower(trim($day)), $days);\n\n }, preg_split('#[^A-Za-z\\s]+#', $timeframe['days']));\n\n $days = array_filter($days, function($a){\n return $a !== false;\n });\n\n if(empty($days)){\n continue;\n }\n\n //Format hours\n $open = array_map(function($hour){\n if(!isset($hour['renderedTime'])){\n return null;\n }\n\n //Convert foursquare format to HH:mm format\n $hour['renderedTime'] = str_replace('Noon','12:00 PM', $hour['renderedTime']);\n $hour['renderedTime'] = str_replace('Midnight','00:00 AM', $hour['renderedTime']);\n\n //Split format\n $parts = preg_split('#[^0-9:\\sA-Z]+#', $hour['renderedTime']);\n\n try{\n $open = new \\DateTime($parts[0]);\n $close = new \\DateTime($parts[1]);\n }catch(\\Exception $e){\n return null;\n }\n\n return array('open' => $open->format('H:i'), 'close' => $close->format('H:i'));\n }, $open);\n\n $open = array_filter($open);\n if(empty($open)){\n continue;\n }\n\n $hours[] = array(\n 'days' => array_values($days),\n 'hours' => $open\n );\n }\n\n return $hours;\n }", "function get_hour ($ceros = true)\n {\n $res = substr ($this->hour, 0, 2);\n if ($ceros == true) $res = $this->ceros ($res, 2, 0);\n return $res;\n }", "public function addEventType($name)\n {\n $entity = EventType::firstOrCreate([\n 'name' => $name,\n ]);\n\n $entity->is_active = 1;\n $entity->save();\n\n return $entity;\n }", "public static function newEvent( $eventName , $eventId = null){\n $userData = (new UserData())\n ->setClientIpAddress(Util::getIpAddress())\n ->setClientUserAgent(Util::getHttpUserAgent())\n ->setFbp(Util::getFbp())\n ->setFbc(Util::getFbc());\n\n $event = (new Event())\n ->setEventName($eventName)\n ->setEventTime(time())\n ->setEventSourceUrl(Util::getRequestUri())\n ->setUserData($userData)\n ->setCustomData(new CustomData());\n\n if( $eventId == null ){\n $event->setEventId(EventIdGenerator::guidv4());\n }\n else{\n $event->setEventId($eventId);\n }\n\n return $event;\n }", "public function getHour(): int\n {\n return $this->hour;\n }", "public function hour(String $continent, String $city) {\r\n $timezone = \"{$continent}/{$city}\";\r\n $this->date = new Datetime($this->date, new DateTimeZone($timezone));\r\n return $this->date->format('H:i:s');\r\n }", "public static function createEvent( $eventName, $data, $eventId = null ){\n $event = self::newEvent($eventName, $eventId);\n\n $event = self::addCustomData($event, $data);\n\n return $event;\n }", "public function subHour($value = 1);", "function getHourComponent(){\n\t\t$this->_hour->getStyle()->setBackground($this->getStyle()->getBackground());\n\t\treturn $this->_hour;\n\t}" ]
[ "0.5734085", "0.5413836", "0.53432125", "0.5283705", "0.5196546", "0.51859784", "0.5160806", "0.50864255", "0.5083761", "0.50343657", "0.49571916", "0.48863435", "0.48561403", "0.48355806", "0.48337522", "0.48182666", "0.4783771", "0.47802854", "0.47355604", "0.47323248", "0.47098505", "0.46954176", "0.46503922", "0.46171466", "0.4616267", "0.46100247", "0.4591637", "0.4579182", "0.45753393", "0.45660445" ]
0.67790043
0
Get real locker object.
public function getLocker();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getLocker(): LockManagerInterface\n {\n if (!$this->locker) {\n $this->locker = $this->factory->create();\n }\n\n return $this->locker;\n }", "public function getLock() {\n return $this->lock;\n }", "public function getLock()\n\t{\n\t\t$lock = 0;\n\t\tif ($this->xpdo instanceof modX) {\n\t\t\tif ($this->xpdo->getService('registry', 'registry.modRegistry')) {\n\t\t\t\t$this->xpdo->registry->addRegister('locks', 'registry.modDbRegister', array('directory' => 'locks'));\n\t\t\t\t$this->xpdo->registry->locks->connect();\n\t\t\t\t$this->xpdo->registry->locks->subscribe('/mlmsystemclient/' . md5($this->get('id')));\n\t\t\t\tif ($msgs = $this->xpdo->registry->locks->read(array('remove_read' => false, 'poll_limit' => 1))) {\n\t\t\t\t\t$msg = reset($msgs);\n\t\t\t\t\t$lock = intval($msg);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $lock;\n\t}", "public function lock()\n {\n if (!$this->lock) {\n $this->lock = new Lock($this);\n }\n\n return $this->lock;\n }", "private static function getLockId()\n {\n return getmypid();\n }", "public function getMutex();", "function ld_setup_auth()\n{\n\t// Instantiate the object\n\t$class = apply_filters('ld_class', 'WP_LockAuth');\n\t$auth_obj = new $class();\n\n\treturn $auth_obj;\n}", "function WP_FocusLock() {\n $instance = WP_FocusLock::instance( __FILE__ );\n return $instance;\n}", "abstract protected function getLocker(array $config, ContainerBuilder $container);", "public static function create(string $lockIdentifier)\n {\n if (class_exists(\\TYPO3\\CMS\\Core\\Locking\\LockFactory::class))\n {\n $locker = GeneralUtility::makeInstance(\\TYPO3\\CMS\\Core\\Locking\\LockFactory::class)->createLocker($lockIdentifier);\n }\n elseif (class_exists(\\TYPO3\\CMS\\Core\\Locking\\Locker::class))\n {\n $locker = GeneralUtility::makeInstance(\\TYPO3\\CMS\\Core\\Locking\\Locker::class, $lockIdentifier);\n }\n else\n {\n $locker = null;\n }\n\n return $locker;\n }", "public function get_locked() {\n return $this->locked;\n }", "public function getNinjaMutexLock(): LockAbstract\n {\n if (!empty($this->ninjaMutexLock)) {\n return $this->ninjaMutexLock;\n }\n\n $strategy = $this->command->getMutexStrategy();\n switch ($strategy) {\n case 'mysql':\n return new MySQLPDOLock(\n 'mysql:' . implode(';', [\n 'host=' . config('database.connections.mysql.host'),\n 'port=' . config('database.connections.mysql.port', 3306),\n ]),\n config('database.connections.mysql.username'),\n config('database.connections.mysql.password'),\n config('database.connections.mysql.options'),\n );\n\n case 'redis':\n return $this->getRedisLock(config('database.redis.client', 'phpredis'));\n\n case 'memcached':\n return new MemcachedLock(Cache::getStore()->getMemcached());\n\n case 'file':\n default:\n return new FlockLock($this->command->getMutexFileStorage());\n }\n }", "protected function getLock(?string $key = null): LockingStrategyInterface\n {\n $localKey = $this->getLockKeyHash($key);\n \n /** @noinspection NullCoalescingOperatorCanBeUsedInspection */\n if (isset($this->locks[$localKey])) {\n return $this->locks[$localKey];\n }\n \n return $this->locks[$localKey]\n = GeneralUtility::makeInstance(LockFactory::class)\n ->createLocker(\n $localKey,\n LockingStrategyInterface::LOCK_CAPABILITY_EXCLUSIVE\n | LockingStrategyInterface::LOCK_CAPABILITY_NOBLOCK\n );\n }", "function hw_GetAndLock($connection, $objectID)\n{\n}", "public function getAuthObject() {\n return $this->authObject;\n }", "public function sharedLock()\r\n {\r\n return $this->lock(false);\r\n }", "public function getLocked(){\n return $this->locked;\n }", "public function getScopedLock( $virtualKey ) {\n\t\treturn null;\n\t}", "public function getLockState()\n {\n return $this->lock_state;\n }", "public function getLock($key) {\n\t}", "protected function getCryptObject()\n\t{\n\t\tif ($this->crypt_object === NULL)\n\t\t{\n\t\t\t$crypt_config = new OLP_CryptConfig();\n\t\t\t$this->crypt_object = new OLP_Crypt($crypt_config->getKey(), $crypt_config->getIV());\n\t\t}\n\t\t\n\t\treturn $this->crypt_object;\n\t}", "public function getLockId() {\n if (!isset($this->_lockId)) {\n $this->_lockId = uniqid(mt_rand(), TRUE);\n // We only register a shutdown function if a lock is used.\n drupal_register_shutdown_function('lock_release_all', $this->_lockId);\n }\n return $this->_lockId;\n }", "function getObject(){\n\t\t$class_name = $this->_getObjectClassName();\n\t\tif(class_exists($class_name)){\n\t\t\treturn \\Cache::Get($class_name,$this->getId());\n\t\t}\n\t}", "private function getAuth()\n {\n $auth = $this->password;\n // if private key should be used\n if ($this->privateKey) {\n $auth = new phpseclib\\Crypt\\RSA();\n $auth->loadKey(file_get_contents($this->privateKey));\n if ($this->password) {\n $auth->setPassword($this->password);\n }\n }\n return $auth;\n }", "public function walletlock() {\n\n $args = $this->args;\n $args[ \"method\" ] = __FUNCTION__;\n\n $res = $this->call($args);\n if ($res)\n return $res[ \"result\" ];\n }", "function getLockLevel();", "private function getInstance(): object\n {\n return $this->_intruderInstance;\n }", "public function lock()\n {\n API::put(static::basePath() . $this->id . '/lock');\n $this->setLocked(true);\n\n $order = $this->forgetInCache();\n $order->fireModelEvent('locked', false);\n\n return $order;\n }", "protected function getLockKey()\n {\n return Str::snake($this->getPayableType()) . \"_pay_{$this->getUserId()}\";\n }", "public static function get(): Clock\n {\n if (self::$clock === null) {\n self::$clock = new SystemClock();\n }\n\n return self::$clock;\n }" ]
[ "0.7562325", "0.62794006", "0.6165546", "0.60132664", "0.5910384", "0.58754313", "0.5865454", "0.5847878", "0.5827414", "0.58181274", "0.5814302", "0.58057433", "0.573717", "0.56183434", "0.56014955", "0.55948067", "0.5579323", "0.5532607", "0.5449407", "0.5426877", "0.5420796", "0.53815454", "0.53734076", "0.53627795", "0.52992076", "0.52905166", "0.5242679", "0.5235659", "0.5226849", "0.5200242" ]
0.80507994
0
Return the lock status.
public function getLockStatus();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLockStatus() {\r\n\t\treturn $this->isAcquired;\r\n\t}", "public function getLockState()\n {\n return $this->lock_state;\n }", "public function get_locked() {\n return $this->locked;\n }", "protected function getLock()\n {\n $result = $this->connection->run(\n 'counter',\n array('-u', '-i', $this->getKeyName())\n )->getData(0);\n\n return (int) $result['value'] === 1;\n }", "public function getLock() {\n return $this->lock;\n }", "function getLockLevel();", "public function getLocked(){\n return $this->locked;\n }", "public function getAccountLock()\n {\n $customerModel = $this->getCustomerRegistry()->retrieve($this->getCustomerId());\n $customerStatus = __('Unlocked');\n if ($customerModel->isCustomerLocked()) {\n $customerStatus = __('Locked');\n }\n return $customerStatus;\n }", "public function getLocked() : bool\n {\n return $this->locked;\n }", "public function isLocked()\n {\n return ($this->status == 'locked');\n }", "public function getBitLockerStatus()\n {\n if (array_key_exists(\"bitLockerStatus\", $this->_propDict)) {\n return $this->_propDict[\"bitLockerStatus\"];\n } else {\n return null;\n }\n }", "final public function getStatus()\n {\n return @shm_has_var(self::$shmId, 11511697116117115)\n ? shm_get_var(self::$shmId, 11511697116117115)\n : 'PENDING';\n }", "public function getIsLocked()\r\n {\r\n return $this->isLocked;\r\n }", "public function isLocked()\n\t\t{\n\t\t\treturn $this->getStatus() === Status::LOCKED;\n\t\t}", "public function locked(): bool {\n return $this->_locked;\n }", "public function isLocked()\n {\n return $this->_locked;\n }", "private function is_locked()\n\t\t{\n\t\t\treturn $this->connection_lock;\n\t\t}", "public function getIsLocked() : bool\n {\n return $this->isLocked;\n }", "public function getLock()\n\t{\n\t\t$lock = 0;\n\t\tif ($this->xpdo instanceof modX) {\n\t\t\tif ($this->xpdo->getService('registry', 'registry.modRegistry')) {\n\t\t\t\t$this->xpdo->registry->addRegister('locks', 'registry.modDbRegister', array('directory' => 'locks'));\n\t\t\t\t$this->xpdo->registry->locks->connect();\n\t\t\t\t$this->xpdo->registry->locks->subscribe('/mlmsystemclient/' . md5($this->get('id')));\n\t\t\t\tif ($msgs = $this->xpdo->registry->locks->read(array('remove_read' => false, 'poll_limit' => 1))) {\n\t\t\t\t\t$msg = reset($msgs);\n\t\t\t\t\t$lock = intval($msg);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $lock;\n\t}", "public function lock()\n {\n return $this->_locked = true;\n }", "public function getJobWasLocked()\n {\n return $this->jobWasLocked;\n }", "static public function isLocked(){\n\t\treturn self::$_locked;\n\t}", "public function isLocked() {\r\n return Lib\\Cache::getInstance()->get($this->_lockedCacheKey());\r\n }", "public function Is_Locked() {\n do_action('ch_field_is_locked',$this);\n // Return the locked flag\n return $this->is_locked;\n }", "public function isLockable(): bool;", "function isLocked()\n\t{\n\t\treturn $this->_locked;\n\t}", "public function isLocked(){\n if($this->state=='locked'){\n return true;\n }else{\n return false;\n }\n }", "public function isLocked();", "public function isLocked();", "protected final function _isLocked()\n\t{\n\t\treturn $this->_locked;\n\t}" ]
[ "0.8508975", "0.81759715", "0.73323447", "0.7309516", "0.72250724", "0.7212785", "0.7121482", "0.7037412", "0.69899654", "0.6984348", "0.69385916", "0.69370157", "0.69342744", "0.68564546", "0.6819595", "0.6794291", "0.6791182", "0.67773676", "0.6764728", "0.67518383", "0.6722891", "0.6611683", "0.65981764", "0.65765995", "0.6571104", "0.6567058", "0.65140915", "0.65070146", "0.65070146", "0.64855355" ]
0.9174205
0
Sets the facility (extension name) for the syslog entry.
public function setSyslogFacility($syslogFacility);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setSyslogFacility($syslogFacility) {\r\n\t\t$this->syslogFacility = $syslogFacility;\r\n\t}", "protected function getLogFacility()\n {\n if (isset($this->app->config['log']['syslog']['facility'])) {\n return $this->app->config['log']['syslog']['facility'];\n }\n return $this->defaultFacility;\n }", "public function getName()\n\t{\n\t\treturn 'Syslog';\n\t}", "public function log(SihnonFramework_LogEntry $entry) {\n $fields = $entry->fields();\n $values = $entry->values();\n $formatted_entry = str_replace(array_map(function($name) { return \"%{$name}%\"; }, $fields ), $values, $this->format);\n\n syslog(static::$level_map[$entry->level()], $formatted_entry);\n }", "public function setLoglevel()\n {\n $loglevel = (string)$this->model->getNodeByReference('settings.logLevel');\n\n switch ($loglevel) {\n case 'extended':\n $this->acme_args[] = '--syslog 6';\n $this->acme_args[] = '--log-level 2';\n $this->acme_syslog = 6;\n $this->debug = false;\n break;\n case 'debug':\n $this->acme_args[] = '--syslog 7';\n $this->acme_args[] = '--debug';\n $this->acme_syslog = 7;\n $this->debug = true;\n break;\n case 'debug2':\n $this->acme_args[] = '--syslog 7';\n $this->acme_args[] = '--debug 2';\n $this->acme_syslog = 7;\n $this->debug = true;\n break;\n case 'debug3':\n $this->acme_args[] = '--syslog 7';\n $this->acme_args[] = '--debug 3';\n $this->acme_syslog = 7;\n $this->debug = true;\n break;\n default:\n $this->acme_args[] = '--syslog 6';\n $this->acme_args[] = '--log-level 1';\n $this->acme_syslog = 6;\n $this->debug = false;\n break;\n }\n }", "public function setExtension()\n {\n switch ($this->_format) {\n case 'HTML':\n $this->_extension = '.html';\n break;\n case 'XML':\n $this->_extension = '.xml';\n break;\n case 'CSV':\n default:\n $this->_extension = '.log';\n break;\n }\n }", "public function setSubjectAlternativeNameFormatString(?string $value): void {\n $this->getBackingStore()->set('subjectAlternativeNameFormatString', $value);\n }", "public function set_extension($extension) {\n $oldextension = $this->extension;\n $this->extension = $extension;\n $this->name = str_replace(\".$oldextension\", \".$extension\", $this->name);\n }", "function openlog ($ident, $option, $facility) {}", "public function configure()\n\t{\n\t\tglobal $langs;\n\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'constant' => 'SYSLOG_FACILITY',\n\t\t\t\t'name' => $langs->trans('SyslogFacility'),\n\t\t\t\t'default' => 'LOG_USER'\n\t\t\t)\n\t\t);\n\t}", "public function __construct($options = array()) {\n if ($this->isWindows()) {\n $default_facility = LOG_USER;\n } else {\n $default_facility= LOG_LOCAL0;\n }\n $options += array('ident' => LOGS, 'facility' => $default_facility);\n $this->_ident = $options['ident'];\n $this->_facility = $options['facility'];\n }", "public function setExtension($var) {}", "public function setExtension($var) {}", "function syslog ($priority, $message) {}", "public function __construct($ident = 'Gleez CMS', $facility = LOG_USER)\n\t{\n\t\t$this->_ident = $ident;\n\n\t\t// Open the connection to syslog\n\t\topenlog($this->_ident, LOG_CONS, $facility);\n\t}", "function setFilterName($val){\n $this->file_name_filter = $val;\n }", "public function getFacilityName()\n {\n return $this->getLoginInfoSv()->getFacilityName();\n }", "function setExtension($ext);", "public function setSupname($supname)\n {\n $this->supname = $supname;\n\n }", "protected function setSubstitutionGroup() {\n return strtolower(class_basename(self::class));\n }", "function logger_syslog(\n $logOpts = \\LOG_PID | \\LOG_ODELAY | \\LOG_CONS,\n $facility = \\LOG_USER,\n $levels = Logger::ALL,\n callable $formatter = null,\n $name = null\n ) {\n $logger = \\logger_instance($name);\n if ($logger instanceof AsyncLoggerInterface)\n return $logger->syslogWriter($logOpts, $facility, $levels, $formatter);\n }", "protected function configureSyslogHandler(Writer $log, $base_name)\n {\n $log->useSyslog($base_name, $this->logLevel());\n }", "function revcon_change_post_label() {\n global $menu;\n global $submenu;\n $menu[5][0] = 'Notices';\n $submenu['edit.php'][5][0] = 'Notices';\n $submenu['edit.php'][10][0] = 'Add Notices';\n $submenu['edit.php'][16][0] = 'Notices Tags';\n}", "function TMP_DEBUGGER__SetDebugFileName( $eString_FileName, $eString_DebugType = STRING__TMP_DEBUGGER__DEBUG_TYPE__DEFAULT, $bFlag_Force = FALSE )\n{\n\tglobal $g_TMP_DEBUGGER__aaStrings_DebugTypeData;\n\n\t$g_TMP_DEBUGGER__aaStrings_DebugTypeData[$eString_DebugType] = array( STRING__TMP_DEBUGGER__OUTPUT_TYPE__FILE, $eString_FileName );\n\tlocal_TMP_DEBUGGER__InitializeOutputBuffer( $eString_DebugType, $bFlag_Force );\n}", "function set_file_audit_log($name, $state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->_set_parameter($name, 'FileAuditLog', $state);\n }", "public function setFname(string $fname): void\n {\n $this->_fname = $fname;\n }", "public function setExtraName() {\n $this->extraName = 'T.a.v.' . $this->firstName . ' ' . $this->lastName .\n ' (' . $this->getFullHouseNumber() . ')';\n }", "protected static function log_extension($view, $parent)\n\t{\n\t\tstatic::$extensions[$view->view] = array('view' => $parent->view, 'path' => $parent->path);\n\t}", "public function set($module, $uid, $name, $value);", "public function setNewEventName($val) {\n $this->_new_event_name = $val;\n }" ]
[ "0.58392864", "0.5349603", "0.51664424", "0.50752556", "0.5030573", "0.5009074", "0.4961326", "0.4810642", "0.48029083", "0.47770116", "0.47104555", "0.4709448", "0.4709448", "0.46947393", "0.46651495", "0.4655515", "0.46460858", "0.46287072", "0.46260458", "0.45782232", "0.45086247", "0.44998193", "0.44695252", "0.435825", "0.4352651", "0.43515867", "0.43486667", "0.43483007", "0.43338105", "0.4330102" ]
0.6307802
0
Color selection field styliing.
function nectar_select_color_styles() { global $nectar_options; $nectar_accent_color = (!empty($nectar_options["accent-color"])) ? $nectar_options["accent-color"] : 'transparent'; $nectar_extra_color_1 = (!empty($nectar_options["extra-color-1"])) ? $nectar_options["extra-color-1"] : 'transparent'; $nectar_extra_color_2 = (!empty($nectar_options["extra-color-2"])) ? $nectar_options["extra-color-2"] : 'transparent'; $nectar_extra_color_3 = (!empty($nectar_options["extra-color-3"])) ? $nectar_options["extra-color-3"] : 'transparent'; $nectar_color_css = '.vc_edit-form-tab .chosen-container .chosen-results li.Default:before, .vc_edit-form-tab .chosen-container .chosen-results li.default:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name*="color"].Default + .chosen-container > a:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name*="color"].default + .chosen-container > a:before { background: linear-gradient(to right, #444 49%, #fff 51%); } .vc_edit-form-tab .chosen-container .chosen-results li[class*="Accent-Color"]:before, .vc_edit-form-tab .chosen-container .chosen-results li.Default-Accent-Color:before, .vc_edit-form-tab .chosen-container .chosen-results li[class*="accent-color"]:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name*="color"].Default-Accent-Color + .chosen-container > a:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name*="color"][class*="Accent-Color"] + .chosen-container > a:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name*="color"][class*="accent-color"] + .chosen-container > a:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name*="cta_button_style"].accent-color + .chosen-container > a:before { background-color: '.$nectar_accent_color.'; } .vc_edit-form-tab .chosen-container .chosen-results li[class*="Extra-Color-1"]:before, .vc_edit-form-tab .chosen-container .chosen-results li[class*="extra-color-1"]:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name*="color"][class*="Extra-Color-1"] + .chosen-container > a:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name*="color"][class*="extra-color-1"] + .chosen-container > a:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name*="cta_button_style"].extra-color-1 + .chosen-container > a:before { background-color: '.$nectar_extra_color_1.'; } .vc_edit-form-tab .chosen-container .chosen-results li[class*="Extra-Color-2"]:before, .vc_edit-form-tab .chosen-container .chosen-results li[class*="extra-color-2"]:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name*="color"][class*="Extra-Color-2"] + .chosen-container > a:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name*="color"][class*="extra-color-2"] + .chosen-container > a:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name*="cta_button_style"].extra-color-2 + .chosen-container > a:before { background-color: '.$nectar_extra_color_2.'; } .vc_edit-form-tab .chosen-container .chosen-results li[class*="Extra-Color-3"]:before, .vc_edit-form-tab .chosen-container .chosen-results li[class*="extra-color-3"]:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name*="color"][class*="Extra-Color-3"] + .chosen-container > a:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name*="color"][class*="extra-color-3"] + .chosen-container > a:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name*="cta_button_style"].extra-color-3 + .chosen-container > a:before { background-color: '.$nectar_extra_color_3.'; }'; if( !empty($nectar_options["extra-color-gradient"]) && $nectar_options["extra-color-gradient"]['to'] && $nectar_options["extra-color-gradient"]['from']) { $nectar_gradient_1_from = $nectar_options["extra-color-gradient"]['from']; $nectar_gradient_1_to = $nectar_options["extra-color-gradient"]['to']; $nectar_color_css .= '.vc_edit-form-tab .chosen-container .chosen-results li.extra-color-gradient-1:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name*="color"].extra-color-gradient-1 + .chosen-container > a:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name*="button_color"].extra-color-gradient-1 + .chosen-container > a:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name="icon_color"].extra-color-gradient-1 + .chosen-container > a:before { background: linear-gradient(to right, '.$nectar_gradient_1_from.', '.$nectar_gradient_1_to.'); }'; } if( !empty($nectar_options["extra-color-gradient-2"]) && $nectar_options["extra-color-gradient-2"]['to'] && $nectar_options["extra-color-gradient-2"]['from']) { $nectar_gradient_2_from = $nectar_options["extra-color-gradient-2"]['from']; $nectar_gradient_2_to = $nectar_options["extra-color-gradient-2"]['to']; $nectar_color_css .= '.vc_edit-form-tab .chosen-container .chosen-results li.extra-color-gradient-2:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name*="color"].extra-color-gradient-2 + .chosen-container > a:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name*="button_color"].extra-color-gradient-2 + .chosen-container > a:before, .vc_edit-form-tab .vc_shortcode-param[data-param_type="dropdown"] select[name="icon_color"].extra-color-gradient-2 + .chosen-container > a:before { background: linear-gradient(to right, '.$nectar_gradient_2_from.', '.$nectar_gradient_2_to.'); }'; } wp_add_inline_style( 'nectar-vc', $nectar_color_css ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function optin_form_css();", "protected function set_crud_color_picker()\n\t{\n\t\t$args = func_get_args();\n\t\tif(isset($args[0]) && is_array($args[0]))\n\t\t{\n\t\t\t$args = $args[0];\n\t\t}\n\t\tforeach ($args as $field)\n\t\t{\n\t\t\t$this->mCrud->callback_field($field, array($this, 'callback_color_picker'));\n\t\t}\n\t}", "function setSelectStyle() {\n\t\n\t\t## get access to errorField array\n\t\tglobal $errorField;\n\t\t## get the first argument which is the input name\n\t\t$key = func_get_arg(0);\n\t\t## if no args set, print the default input style.\n\t\tif ($key) {\n\t\t\tif (!empty($errorField)) {\n\t\t\t\tif (array_key_exists($key, $errorField)) {\n\t\t\t\t\tprint \"error\";\n\t\t\t\t} else {\n\t\t\t\t\tprint \"field\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprint \"field\";\n\t\t\t}\n\t\t} else {\n\t\t\tprint \"field\";\n\t\t}\n\t}", "public function wc_catc_options_color_field_render( ) { \n\n\t\t$options = get_option( $this->key );\n\t\t$val = ( isset( $options['wc_catc_options_message_bg_color'] ) ) ? $options['wc_catc_options_message_bg_color'] : '';\n\t\t?>\n\t\t<input type=\"text\" name=\"wc_catc_options[wc_catc_options_message_bg_color]\" id=\"wc_catc_options_color_field\" class=\"wp-color-picker-field\" value=\"<?php echo $val; ?>\"/>\n\t\t<?php\n\n\t}", "public function foodbakery_edit_jobs_job_type_fields($tag) {\n\n\t global $foodbakery_form_fields;\n\n\t wp_enqueue_style('wp-color-picker');\n\n\t wp_enqueue_script('wp-color-picker');\n\n\t if (isset($tag->term_id)) {\n\n\t\t$t_id = $tag->term_id;\n\n\t } else {\n\n\t\t$t_id = \"\";\n\n\t }\n\n\t ?>\n\n\t <script type=\"text/javascript\">\n\n\t jQuery(document).ready(function ($) {\n\n\t \t$('.bg_color').wpColorPicker();\n\n\t });\n\n\t </script>\n\n\t <?php\n\n\t $cat_meta = get_option(\"job_type_color_$t_id\");\n\n\t $job_type_color = $cat_meta['text'];\n\n\t ?>\n\n\n\n\t <tr>\n\n\t <th><label for=\"cat_f_img_url\"> <?php esc_html_e(\"Job Type Color\", \"foodbakery\"); ?></label></th>\n\n\t <td>\n\n\t \t<ul class=\"form-elements\" style=\"margin:0; padding:0;\">\n\n\t \t <li class=\"to-field\" style=\"width:100%;\">\n\n\t\t\t <?php\n\n\t\t\t $foodbakery_opt_array = array(\n\n\t\t\t\t'id' => '',\n\n\t\t\t\t'std' => esc_attr($job_type_color),\n\n\t\t\t\t'cust_id' => \"job_type_color\",\n\n\t\t\t\t'cust_name' => \"job_type_color\",\n\n\t\t\t\t'classes' => 'bg_color',\n\n\t\t\t\t'return' => false,\n\n\t\t\t );\n\n\t\t\t $foodbakery_form_fields->foodbakery_form_text_render($foodbakery_opt_array);\n\n\t\t\t ?>\n\n\t \t </li>\n\n\t \t</ul>\n\n\t </td>\n\n\t </tr>\n\n\t <?php\n\n\t}", "function vamico_colorpicker_field_edit_category( $term ) {\n\n\t$color = get_term_meta( $term->term_id, 'vamico_cat_bg_color', true );\n\t$color = ( ! empty( $color ) ) ? \"#{$color}\" : '';\n\t?>\n<tr class=\"form-field term-colorpicker-wrap\">\n\t<th scope=\"row\"><label for=\"term-colorpicker\"><?php esc_html_e( 'Background Color', 'vamico' ); ?></label></th>\n\t<td>\n\t\t<input name=\"vamico_cat_bg_color\" value=\"<?php echo esc_attr( $color ); ?>\" class=\"colorpicker\" id=\"term-colorpicker\" />\n\t\t<p class=\"description\"><?php esc_html_e( 'Select the category background-color which displays in background of the Category Text.', 'vamico' ); ?></p>\n\t</td>\n</tr>\n\t<?php\n}", "public function getFieldColor()\n {\n return $this->fieldColor;\n }", "abstract protected function getColor();", "public function getColor();", "function _alm_paging_color_callback() {\n\n\t $options = get_option( 'alm_settings' );\n\n\t\tif(!isset($options['_alm_paging_color']))\n\t\t $options['_alm_paging_color'] = '0';\n\n\t $color = $options['_alm_paging_color'];\n\n\t\t $selected0 = '';\n\t\t if($color == 'default') $selected0 = 'selected=\"selected\"';\n\n\t\t $selected1 = '';\n\t\t if($color == 'blue') $selected1 = 'selected=\"selected\"';\n\n\t\t $selected2 = '';\n\t\t if($color == 'green') $selected2 = 'selected=\"selected\"';\n\n\t\t $selected3 = '';\n\t\t if($color == 'red') $selected3 = 'selected=\"selected\"';\n\n\t\t $selected4 = '';\n\t\t if($color == 'purple') $selected4 = 'selected=\"selected\"';\n\n\t\t $selected5 = '';\n\t\t if($color == 'grey') $selected5 = 'selected=\"selected\"';\n\n\t\t $selected6 = '';\n\t\t if($color == 'white') $selected6 = 'selected=\"selected\"';\n\n\t $html = '<label for=\"alm_settings_paging_color\">'.__('Choose your paging navigation color', 'ajax-load-more-paging').'.</label><br/>';\n\t $html .= '<select id=\"alm_settings_paging_color\" name=\"alm_settings[_alm_paging_color]\">';\n\t $html .= '<option value=\"default\" ' . $selected0 .'>Default</option>';\n\t $html .= '<option value=\"blue\" ' . $selected1 .'>Blue</option>';\n\t $html .= '<option value=\"green\" ' . $selected2 .'>Green</option>';\n\t $html .= '<option value=\"red\" ' . $selected3 .'>Red</option>';\n\t $html .= '<option value=\"purple\" ' . $selected4 .'>Purple</option>';\n\t $html .= '<option value=\"grey\" ' . $selected5 .'>Grey</option>';\n\t $html .= '<option value=\"white\" ' . $selected6 .'>White</option>';\n\t $html .= '</select>';\n\n\t $html .= '<div class=\"clear\"></div>';\n\t $html .= '<div class=\"ajax-load-more-wrap pages paging-'.$color.'\"><span class=\"pages\">'.__('Preview', 'ajax-load-more-paging') .'</span>';\n\t $html .= '<ul class=\"alm-paging\" style=\"opacity: 1;\"><li class=\"active\"><a href=\"javascript:void(0);\"><span>1</span></a></li><li><a href=\"javascript:void(0);\"><span>2</span></a></li><li><a href=\"javascript:void(0);\"><span>3</span></a></li><li><a href=\"javascript:void(0);\"><span>4</span></a></li><li><a href=\"javascript:void(0);\"><span>5</span></a></li></ul>';\n\t $html .= '</div>';\n\t echo $html;\n\t ?>\n\n\t<script>\n \t//Button preview\n \tvar colorArray = \"paging-default paging-grey paging-purple paging-green paging-red paging-blue paging-white\";\n \tjQuery(\"select#alm_settings_paging_color\").change(function() {\n \t\tvar color = jQuery(this).val();\n\t\t\tjQuery('.ajax-load-more-wrap.pages').removeClass(colorArray);\n\t\t\tjQuery('.ajax-load-more-wrap.pages').addClass('paging-'+color);\n\t\t});\n\t\tjQuery(\"select#alm_settings_paging_color\").click(function(e){\n\t\t\te.preventDefault();\n\t\t});\n\n\t\t// Check if Disable CSS === true\n\t\tif(jQuery('input#alm_paging_disable_css_input').is(\":checked\")){\n\t jQuery('select#alm_settings_paging_color').parent().parent().hide(); // Hide button color\n \t}\n \tjQuery('input#alm_paging_disable_css_input').change(function() {\n \t\tvar el = jQuery(this);\n\t if(el.is(\":checked\")) {\n\t \tel.parent().parent('tr').next('tr').hide(); // Hide paging color\n\t }else{\n\t \tel.parent().parent('tr').next('tr').show(); // show paging color\n\t }\n\t });\n\n </script>\n\n\t<?php\n\t}", "function pyis_dpd_helpscout_do_field_colorpicker( $args = array() ) {\n\tpyis_dpd_helpscout_fieldhelpers()->fields->do_field_colorpicker( $args['name'], $args );\n}", "public function colorField($value) {\n return $this->setProperty('colorField', $value);\n }", "function wd_acf_color_palette() { ?>\n <script type=\"text/javascript\">\n (function($) {\n acf.add_filter('color_picker_args', function( args, $field ){\n args.palettes = ['#E40A19', '#413E6B', '#1A1A1A', '#6A6A6A', '#BEBEBE', '#E3E3E3', '#EBAF88', '#CBE19C', '#F8C0C9', '#92C6ED', '#F1E2C3', '#FFF']\n return args;\n });\n })(jQuery);\n </script>\n <?php }", "public function getFillColor () {}", "function textFieldStyle($formHiddenFieldValue,$errArrayVal,$errArray)\r\n{\r\n\tif ( isset($errArrayVal) \r\n\t\t && (!strcasecmp($errArrayVal , 'Required') \r\n\t\t\t || !strcasecmp($errArrayVal, 'Format')\r\n\t\t\t || !strcasecmp($errArrayVal, 'Max'))) //Check if this field has failed validation.\r\n\t\t\t {\r\n\t\t\t\t echo 'background-color: #FF9F9F';\r\n\t} else if ($errArray) { // If this field passes validation but other fields have failed.\r\n\t\t echo 'background-color: #B8F5B1';\r\n\t}\r\n\r\n}", "function themeColor()\r\n{\r\nglobal $xoopsDB, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $myts;\r\nxoops_cp_header();\r\nadminmenu(1);\r\n$theme = isset($_GET['theme']) ? $_GET['theme'] : $xoopsConfig['theme_set'];\r\n$lid = isset($_GET['lid']) ? intval($_GET['lid']) : '';\t\r\n$playerid = isset($_GET['playerid']) ? intval($_GET['playerid']) : 1;\r\n$styleoption = 2;\r\n\r\n$themeresult = $xoopsDB->query(\"select bgcolor, backcolor, frontcolor, lightcolor from \".$xoopsDB->prefix(\"webshow_theme\").\" where themetitle = \\\"$theme\\\"\");\r\nlist($themebgcolor, $themebackcolor, $themefrontcolor, $themelightcolor) = $xoopsDB->fetchRow($themeresult);\r\n\r\necho \"<table class='outer'>\r\n<th colspan='2'>\r\n<h3>\"._WSA_THEMEEDITOR.\"</h3>\r\n</th>\r\n<tr colspan='2'><td colspan='2'>\r\n<span style=\\\"font-size:90%;\\\">\"._WSA_THEMEEDITORDSC.\"</span>\r\n</td></tr>\";\r\n\r\necho \"<tr colspan='2'><td width='45%'>\";\r\n$tform = new XoopsThemeForm(\"Theme Color Editor\", \"colorform\", XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/admin/themestyle.php', 'post');\r\n$tform->setExtra('enctype=\"multipart/form-data\"');\r\n//** THEME SELECT\r\n$theme_tray = new XoopsformElementTray(\"<b>\"._WSA_THEMEPREVIEW.\"</b>\",'' );\r\n// example XoopsformSelect($caption, $name, $value=null, $size=1, $multiple=false, $id=\"\")\r\n$theme_select=new XoopsformSelect(\"\", 'theme', $theme, 3, false, $theme);\r\n $theme_select->setExtra(\"onchange='window.location=\\\"themestyle.php?playerid=\".$playerid.\"&amp;lid=\".$lid.\"&amp;theme=\\\"+this.value'\");\r\n foreach ($xoopsConfig['theme_set_allowed'] as $themeset) {\r\n $theme_select->addOption($themeset,$themeset,false);\r\n }\r\n$theme_tray->addElement($theme_select, true);\t\r\n$tform->addElement($theme_tray);\r\n$css_bgclr = _WSA_CSS_BGCLR;\r\n$css_bgclr_error = \"\";\r\n$css_bkclr = _WSA_CSS_BKCLR;\r\n$css_bkclr_error = \"\";\r\n$css_ftclr= _WSA_CSS_FTCLR;\r\n$css_ftclr_error = \"\";\r\n$css_ltclr= _WSA_CSS_LTCLR;\r\n$css_ltclr_error = \"\";\r\n if($themebgcolor ==\"\"){\r\n $css_bgclr_error = _WSA_CSS_MISSING;\r\n }\r\n if($themebackcolor ==\"\"){\r\n $css_bkclr_error = _WSA_CSS_MISSING;\r\n }\r\n if($themefrontcolor ==\"\"){\r\n $css_ftclr_error = _WSA_CSS_MISSING;\r\n }\r\n if($themelightcolor ==\"\"){\r\n $css_ltclr_error = _WSA_CSS_MISSING;\r\n }\r\n$tform->addElement(new XoopsformColorPicker(\"<b>\"._WSA_PLAYBGCLR.\"</b><br /><span style=\\\"font-size: 85%; font-weight: 500;\\\">\".$css_bgclr.\"</span><br /><span style=\\\"font-size: 80%; font-weight: 500; color: #CC0000;\\\">\".$css_bgclr_error.\"</span>\",'themebgcolor',$themebgcolor),false);\r\n$tform->addElement(new XoopsformColorPicker(\"<b>\"._WSA_DISBKCLR.\"</b><br /><span style=\\\"font-size: 85%; font-weight: 500;\\\">\".$css_bkclr.\"</span><br /><span style=\\\"font-size: 80%; font-weight: 500; color: #CC0000;\\\">\".$css_bkclr_error.\"</span>\",'themebackcolor',$themebackcolor),false);\r\n$tform->addElement(new XoopsformColorPicker(\"<b>\"._WSA_DISFTCLR.\"</b><br /><span style=\\\"font-size: 85%; font-weight: 500;\\\">\".$css_ftclr.\"</span><br /><span style=\\\"font-size: 80%; font-weight: 500; color: #CC0000;\\\">\".$css_ftclr_error.\"</span>\",'themefrontcolor',$themefrontcolor),false);\r\n$tform->addElement(new XoopsformColorPicker(\"<b>\"._WSA_DISLTCLR.\"</b><br /><span style=\\\"font-size: 85%; font-weight: 500;\\\">\".$css_ltclr.\"</span><br /><span style=\\\"font-size: 80%; font-weight: 500; color: #CC0000;\\\">\".$css_ltclr_error.\"</span>\",'themelightcolor',$themelightcolor),false);\r\n\r\n//**HIDDEN VARS\r\n$tform->addElement(new XoopsformHidden('op', \"themeColorS\"), false);\r\n$tform->addElement(new XoopsformHidden('playerid', $playerid), false);\r\n$tform->addElement(new XoopsformHidden('lid', $lid), false);\r\n\r\n// SUBMIT BUTTONS\t\r\n$themebutton_tray = new XoopsformElementTray('' ,'');\r\n$themesubmit_btn = new XoopsformButton('', 'post', \"Save Changes\", 'submit');\r\n$themebutton_tray->addElement($themesubmit_btn);\r\n$tform->addElement($themebutton_tray);\t\r\n$tform->display();\r\n\r\necho \"<b>\"._WSA_THEMERESTORE.\"</b>\r\n<br /><span style=\\\"font-size:90%;\\\">\"._WSA_THEMERESTOREDSC.\"</span>\r\n<br />\r\n<form method=\\\"post\\\" action=\\\"themestyle.php\\\">\r\n<input type=\\\"button\\\" value=\\\"\"._WSA_THEMERESET.\"\\\" onClick=\\\"location='themestyle.php?op=themeFilter&amp;theme=\".$theme.\"'\\\">\r\n<input type=\\\"button\\\" value=\\\"\"._WSA_THEMERESETALL.\"\\\" onClick=\\\"location='themestyle.php?op=themeFilterAll&amp;theme=\".$theme.\"'\\\">\r\n</form>\r\n</td><td align='center'>\";\r\n//** PLAYER DEMO\r\n if($lid == \"\"){\r\n $linkresult = $xoopsDB->query(\"SELECT lid FROM \".$xoopsDB->prefix(\"webshow_links\").\" WHERE lid>0 and listtype != 'embed' ORDER BY date DESC LIMIT 1\");\r\n list($lid) = $xoopsDB->fetchRow($linkresult);\r\n }\r\n\r\n include \"../include/movie.inc.php\";\r\n $movie = loadMovie($lid, $playerid, $styleoption); \r\n \r\n //** LINK SELECT\r\n $linktree = new XoopsTree($xoopsDB->prefix(\"webshow_links\"),\"lid\",\"title\"); \r\n ob_start();\r\n //**function makeMySelBox($title,$order=\"\",$preset_id=0, $none=0, $sel_name=\"\", $onchange=\"\")\r\n $linktree->makeMySelBox('title','lid',$lid,0,'lid','window.location=\"player.php?op='.$playerop.'&amp;playerid='.$playerid.'&amp;theme='.$theme.'&amp;styleoption=2&amp;lid=\"+this.value');\r\n $linkselbox = ob_get_contents();\r\n ob_end_clean(); \r\n echo \"<div class=\\\"item\\\"><div class=\\\"itemHead\\\"><h3 style=\\\"margin:0px; padding:0px\\\">\"._WSA_PREVIEW.\"</h3></div>\";\r\n echo \"<div class=\\\"itemBody\\\" style=\\\"margin: 0px; padding: 5px\\\">\".$movie; \r\n echo \"<br />\"._WSA_PREVIEWLINK.\"&nbsp;&nbsp;&nbsp;\".$linkselbox;\r\n echo \"<br />\"._WSA_PREVIEW_DSC.\"</div></div>\";\r\n\r\n//**Player Select\r\n$playertree= new XoopsTree($xoopsDB->prefix(\"webshow_player\"),\"playerid\",\"playertitle\");\r\nob_start();\r\n//**function makeMySelBox($title,$order=\"\",$preset_id=0, $none=0, $sel_name=\"\", $onchange=\"\")\r\n$playertree->makeMySelBox(\"playertitle\",\"playertitle\",$playerid,0,$playerid,'window.location=\"themestyle.php?theme='.$theme.'&amp;playerid=\"+this.value');\r\n$playerselbox = ob_get_contents();\r\nob_end_clean();\r\necho \"<br />\"._WSA_PREVIEWPLAYER.\"&nbsp;&nbsp;&nbsp;\".$playerselbox.\"<br />\"; \r\n\r\necho \"</td></tr></table>\";\t\r\nxoops_cp_footer();\r\n}", "function getColorMode() {\n return $this->colormode;\n }", "function reference_knb_syntax_highlighting_style_form()\n{\n $styles = reference_get_syntax_highlighting_style();\n $option = new DSC\\Reference\\Options();\n $syntax_highlighting_style = $option->getSyntaxHighlightingStyle();\n ?>\n\n <select name=\"reference_knb_syntax_highlighting_style\" class=\"reference_select\" id=\"reference_knb_syntax_highlighting_style\">\n <?php foreach ($styles as $style) { ?>\n <option value=\"<?php esc_attr_e($style); ?>\" <?php selected(esc_attr($syntax_highlighting_style), $style); ?>>\n <?php esc_html_e(ucfirst($style)); ?>\n </option>\n <?php } ?>\n </select>\n\n <?php esc_html_e(' Select the highlightning style for displayed codes.', 'reference'); ?>\n\n <p class=\"description\">\n <?php esc_html_e('This option allows you to change the style for displaying your codes your [reference_highlighter] shortcode.', 'reference'); ?>\n </p>\n\n <?php\n return;\n}", "function register_custom_css( $fields ){\r\n return $fields;\r\n }", "function acf_load_cta_color_field_choices( $field ) {\n\t// reset choices\n\t$field['choices'] = array(\n\t\t'black' => 'Black',\n\t\t'white' => 'White',\n\t);\n\n\treturn $field;\n}", "public function keyboardColor()\n {\n }", "public function addHighlightField($field) {}", "function classymissy_admin_color_picker($label, $name, $value, $tooltip = NULL) {\n\t$output = \"<div class='bpanel-option-set'>\\n\";\n\tif (! empty ( $label )) :\n\t\t$output .= \"<label>{$label}</label>\";\n\t\t$output .= \"<div class='hr_invisible'></div><div class='clear'></div>\";\n\tendif;\n\t\n\t$output .= \"<input type='text' class='my-color-field medium' name='{$name}' value='{$value}' />\";\n\n\techo ($output);\n\tif ($tooltip != NULL)\n\t\tclassymissy_adminpanel_tooltip ( $tooltip );\n\n\techo \"</div>\\n\";\n}", "function optinforms_form3_default_fields_color() {\r\n\tglobal $optinforms_form3_fields_color;\r\n\tif(empty($optinforms_form3_fields_color)) {\r\n\t\t$optinforms_form3_fields_color = \"#666666\";\r\n\t}\r\n\treturn $optinforms_form3_fields_color;\r\n}", "function print_bordercolor_list($text_color){\n\nprint \"<br> TEXT COLOR:\" . $text_color;\n\n\t $color_list =array(\n\t \"#FF0000\" => \"Red\",\n\t \"#CC033C\" => \"Crimson\",\n\t \"#FF6F00\" => \"Orange\",\n\t \"#FFCC00\" => \"Gold\",\n\t \"#009000\" => \"Green\",\n\t \"#00FF00\" => \"Lime\",\n\t \"#963939\" => \"Brown\",\n\t \"#C69633\" => \"Brass\",\n\t \"#0000FF\" => \"Blue\",\n\t \"#000090\" => \"Navy\",\n\t \"#FE00FF\" => \"Indigo\",\n\t \"#F99CF9\" => \"Pink\",\n\t \"#900090\" => \"Purple\",\n\t \"#000000\" => \"Black\",\n\t \"#FFFFFF\" => \"White\",\n\t \"#DDDDDD\" => \"Grey\",\n\t \"#666666\" => \"Gray\",\n\t \"#F6F9F9;\" => \"Silver\");\n\n\n\t echo \"\\n\";\n\tforeach($color_list as $key=>$tcolor)\n\t{\n\t\t$check_value = \"\";\n\t\tif ($text_color == $key)\n\t \t\t$check_value = ' SELECTED ';\n\n\t\t$white_text = \"\";\n\t\tif ($key == \"#000000\" OR $key == \"#000090\" OR $key == \"#666666\" OR $key == \"#0000FF\" )\n\t \t\t$white_text = ';color:#FFFFFF ';\n\t\techo '<option value=\"'.$key.'\" style=\"background-color:'.$key. $white_text .'\" '.$check_value .'>'.$tcolor.'</option>';\n\t\techo \"\\n\";\n\t}\n\n\n\n}", "function cv_render_color_scheme_styles( $sections ) {\n\n foreach ( $sections as $section => $colors ) {\n\n $section_tag = '.cv-section-' . $section;\n\n /* Section Styles */\n echo\n $section_tag . \" {\"\n . \"background-color: {$colors['primary_bg']};\"\n . \"color: {$colors['content']};\"\n . \"}\"\n . $section_tag . \".top-both,\"\n . $section_tag . \".top-border {\"\n . \"border-top: 1px solid {$colors['borders']};\"\n . \"}\"\n . $section_tag . \".bottom-both,\"\n . $section_tag . \".bottom-border {\"\n . \"border-bottom: 1px solid {$colors['borders']};\"\n . \"}\"\n . $section_tag . \".top-arrow .cv-top-arrow:after {\"\n . \"border-bottom-color: {$colors['primary_bg']};\"\n . \"}\"\n . $section_tag . \".top-arrow.top-border .cv-top-arrow:before {\"\n . \"border-bottom-color: {$colors['borders']};\"\n . \"}\"\n . $section_tag . \".bottom-arrow .cv-bottom-arrow:after {\"\n . \"border-top-color: {$colors['primary_bg']};\"\n . \"}\"\n . $section_tag . \".bottom-arrow.bottom-border .cv-bottom-arrow:before {\"\n . \"border-top-color: {$colors['borders']};\"\n . \"}\"\n ;\n\n /* Text Selection */\n $rgb = 0.85 > cv_hex_brightness( $sections['header']['accent'] ) ? '255,255,255' : '0,0,0';\n echo\n $section_tag . \" *::selection {\"\n . \"background: {$colors['accent']};\"\n . \"color: rgba({$rgb},0.85);\"\n . \"}\"\n . $section_tag . \" *::-moz-selection {\"\n . \"background: {$colors['accent']};\"\n . \"color: rgba({$rgb},0.85);\"\n . \"}\"\n ;\n\n /* Headers */\n echo\n $section_tag . \" h1,\"\n . $section_tag . \" h2,\"\n . $section_tag . \" h3,\"\n . $section_tag . \" h4,\"\n . $section_tag . \" h5,\"\n . $section_tag . \" h6 {\"\n . \"color: {$colors['headers']};\"\n . \"}\"\n ;\n\n /* Strong text */\n echo\n $section_tag . \" strong {\"\n . \"color: {$colors['headers']};\"\n . \"}\"\n ;\n\n /* Links */\n echo\n $section_tag . \" a {\"\n . \"color: {$colors['accent']};\"\n . \"}\"\n . $section_tag . \" .sidebar a:not(.button) {\"\n . \"color: {$colors['content']};\"\n . \"}\"\n . $section_tag . \" a:hover {\"\n . \"color: {$colors['focused']};\"\n . \"}\"\n ;\n\n }\n\n}", "public function render() {\n\t\t\tif ( true === $this->field['regular'] && false !== $this->field['default']['regular'] ) {\n\t\t\t\techo '<span class=\"linkColor\">';\n\t\t\t\techo '<strong>' . esc_html__( 'Regular', 'redux-framework' ) . '</strong>&nbsp;';\n\t\t\t\techo '<input ';\n\t\t\t\techo 'id=\"' . esc_attr( $this->field['id'] ) . '-regular\" ';\n\t\t\t\techo 'name=\"' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '[regular]\"';\n\t\t\t\techo 'value=\"' . esc_attr( $this->value['regular'] ) . '\"';\n\t\t\t\techo 'class=\"color-picker redux-color redux-color-regular redux-color-init ' . esc_attr( $this->field['class'] ) . '\"';\n\t\t\t\techo 'type=\"text\"';\n\t\t\t\techo 'data-default-color=\"' . esc_attr( $this->field['default']['regular'] ) . '\"';\n\n\t\t\t\tif ( ReduxCore::$_pro_loaded ) {\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'field' => $this->field,\n\t\t\t\t\t\t'index' => 'regular',\n\t\t\t\t\t);\n\n\t\t\t\t\t// phpcs:ignore WordPress.NamingConventions.ValidHookName\n\t\t\t\t\techo esc_html( apply_filters( 'redux/pro/render/color_alpha', $data ) );\n\t\t\t\t}\n\n\t\t\t\techo '/>';\n\t\t\t\techo '</span>';\n\t\t\t}\n\n\t\t\tif ( true === $this->field['hover'] && false !== $this->field['default']['hover'] ) {\n\t\t\t\techo '<span class=\"linkColor\">';\n\t\t\t\techo '<strong>' . esc_html__( 'Hover', 'redux-framework' ) . '</strong>&nbsp;';\n\t\t\t\techo '<input ';\n\t\t\t\techo 'id=\"' . esc_attr( $this->field['id'] ) . '-hover\"';\n\t\t\t\techo 'name=\"' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '[hover]\"';\n\t\t\t\techo 'value=\"' . esc_attr( $this->value['hover'] ) . '\"';\n\t\t\t\techo 'class=\"color-picker redux-color redux-color-hover redux-color-init ' . esc_attr( $this->field['class'] ) . '\"';\n\t\t\t\techo 'type=\"text\"';\n\t\t\t\techo 'data-default-color=\"' . esc_attr( $this->field['default']['hover'] ) . '\"';\n\n\t\t\t\tif ( ReduxCore::$_pro_loaded ) {\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'field' => $this->field,\n\t\t\t\t\t\t'index' => 'hover',\n\t\t\t\t\t);\n\n\t\t\t\t\t// phpcs:ignore WordPress.NamingConventions.ValidHookName\n\t\t\t\t\techo esc_html( apply_filters( 'redux/pro/render/color_alpha', $data ) );\n\t\t\t\t}\n\n\t\t\t\techo '/>';\n\t\t\t\techo '</span>';\n\t\t\t}\n\n\t\t\tif ( true === $this->field['visited'] && false !== $this->field['default']['visited'] ) {\n\t\t\t\techo '<span class=\"linkColor\">';\n\t\t\t\techo '<strong>' . esc_html__( 'Visited', 'redux-framework' ) . '</strong>&nbsp;';\n\t\t\t\techo '<input ';\n\t\t\t\techo 'id=\"' . esc_attr( $this->field['id'] ) . '-visited\"';\n\t\t\t\techo 'name=\"' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '[visited]\"';\n\t\t\t\techo 'value=\"' . esc_attr( $this->value['visited'] ) . '\"';\n\t\t\t\techo 'class=\"color-picker redux-color redux-color-visited redux-color-init ' . esc_attr( $this->field['class'] ) . '\"';\n\t\t\t\techo 'type=\"text\"';\n\t\t\t\techo 'data-default-color=\"' . esc_attr( $this->field['default']['visited'] ) . '\"';\n\n\t\t\t\tif ( ReduxCore::$_pro_loaded ) {\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'field' => $this->field,\n\t\t\t\t\t\t'index' => 'visited',\n\t\t\t\t\t);\n\n\t\t\t\t\t// phpcs:ignore WordPress.NamingConventions.ValidHookName\n\t\t\t\t\techo esc_html( apply_filters( 'redux/pro/render/color_alpha', $data ) );\n\t\t\t\t}\n\n\t\t\t\techo '/>';\n\t\t\t\techo '</span>';\n\t\t\t}\n\n\t\t\tif ( true === $this->field['active'] && false !== $this->field['default']['active'] ) {\n\t\t\t\techo '<span class=\"linkColor\">';\n\t\t\t\techo '<strong>' . esc_html__( 'Active', 'redux-framework' ) . '</strong>&nbsp;';\n\t\t\t\techo '<input ';\n\t\t\t\techo 'id=\"' . esc_attr( $this->field['id'] ) . '-active\"';\n\t\t\t\techo 'name=\"' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '[active]\"';\n\t\t\t\techo 'value=\"' . esc_attr( $this->value['active'] ) . '\"';\n\t\t\t\techo 'class=\"color-picker redux-color redux-color-active redux-color-init ' . esc_attr( $this->field['class'] ) . '\"';\n\t\t\t\techo 'type=\"text\"';\n\t\t\t\techo 'data-default-color=\"' . esc_attr( $this->field['default']['active'] ) . '\"';\n\n\t\t\t\tif ( ReduxCore::$_pro_loaded ) {\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'field' => $this->field,\n\t\t\t\t\t\t'index' => 'active',\n\t\t\t\t\t);\n\n\t\t\t\t\t// phpcs:ignore WordPress.NamingConventions.ValidHookName\n\t\t\t\t\techo esc_html( apply_filters( 'redux/pro/render/color_alpha', $data ) );\n\t\t\t\t}\n\n\t\t\t\techo '/>';\n\t\t\t\techo '</span>';\n\t\t\t}\n\n\t\t\tif ( true === $this->field['focus'] && false !== $this->field['default']['focus'] ) {\n\t\t\t\techo '<span class=\"linkColor\">';\n\t\t\t\techo '<strong>' . esc_html__( 'Focus', 'redux-framework' ) . '</strong>&nbsp;';\n\t\t\t\techo '<input ';\n\t\t\t\techo 'id=\"' . esc_attr( $this->field['id'] ) . '-focus\"';\n\t\t\t\techo 'name=\"' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '[focus]\"';\n\t\t\t\techo 'value=\"' . esc_attr( $this->value['focus'] ) . '\"';\n\t\t\t\techo 'class=\"color-picker redux-color redux-color-focus redux-color-init ' . esc_attr( $this->field['class'] ) . '\"';\n\t\t\t\techo 'type=\"text\"';\n\t\t\t\techo 'data-default-color=\"' . esc_attr( $this->field['default']['focus'] ) . '\"';\n\n\t\t\t\tif ( ReduxCore::$_pro_loaded ) {\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'field' => $this->field,\n\t\t\t\t\t\t'index' => 'focus',\n\t\t\t\t\t);\n\n\t\t\t\t\t// phpcs:ignore WordPress.NamingConventions.ValidHookName\n\t\t\t\t\techo esc_html( apply_filters( 'redux/pro/render/color_alpha', $data ) );\n\t\t\t\t}\n\n\t\t\t\techo '/>';\n\t\t\t\techo '</span>';\n\t\t\t}\n\t\t}", "static function add_colour_sports(): void {\r\n\t\tself::add_acf_field(self::colour_sports, [\r\n\t\t\t'label' => 'Sports category colour',\r\n\t\t\t'type' => 'color_picker',\r\n\t\t\t'default_value' => '#189647',\r\n\t\t\t'instructions' => 'Choose a sports colour for modules to'\r\n\t\t\t . ' use if they like. The default is #189647.',\r\n\t\t\t'required' => 1,\r\n\t\t\t'conditional_logic' => '',\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '25',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t]);\r\n\t}", "function print_color($value) {\r\n\t\tif(isset($value['std'])) {\r\n\t\t\t$default = $value['std'];\r\n\t\t} else {\r\n\t\t\t$default = false;\r\n\t\t}\r\n\t\tif(isset($value['protected'][0][\"id\"])) {\r\n\t\t\t$protectedValue = $value['protected'][0][\"id\"];\r\n\t\t} else {\r\n\t\t\t$protectedValue = false;\r\n\t\t}\r\n\t\t\r\n\t\t$protected_value = $this->get_field_value($protectedValue, $default);\r\n\t\t\r\n\t\t\r\n\t\tif(((isset($value['protected'][0][\"id\"]) && $value['protected'][0][\"id\"]!=\"\") && $protected_value==$value['protected'][0][\"value\"]) || (!isset($value['protected'][0][\"id\"]))) {\r\n\t\t\t$input_value = $this->get_field_value($value['id'], $default);\r\n\t\t?>\r\n\t\t<?php if( isset($value['home']) && $value['home'] == \"yes\" ) { ?><div class=\"input-item-half-width-inside clearfix\"><?php } else { ?>\r\n\t\t<div class=\"input-item-full-width clearfix\">\r\n\t\t<?php } ?>\r\n\t\t\t<label style=\"width:158px;\"><?php echo $value['title'];?></label>\r\n\t\t\t<span class=\"input-text\">\r\n\t\t\t\t<input type=\"value\" class=\"color\" name=\"<?php echo $value['id'];?>\" value=\"<?php echo $input_value;?>\" style=\"width: 280px; border: #D1D1D1 1px solid; border-radius: 3px; outline: 0; font: 12px Arial, sans-serif; color: #333; padding: 7px 10px;\"/>\r\n\t\t\t</span>\r\n\t\t\r\n\t\t</div>\r\n\t\t<?php\r\n\t\t}\r\n\t}", "public function getHighlightFormatter($field_override) {}" ]
[ "0.6278533", "0.6221974", "0.6171046", "0.61220825", "0.6102852", "0.5875436", "0.58527195", "0.58134717", "0.57853156", "0.574749", "0.5721655", "0.5709984", "0.5569016", "0.55508083", "0.5548594", "0.5527773", "0.54968244", "0.54959035", "0.54836404", "0.5481912", "0.5467695", "0.5466948", "0.544557", "0.5430355", "0.5415885", "0.541042", "0.5395018", "0.53795797", "0.5379208", "0.5374573" ]
0.6948827
0
Add steadysets icon family into page builder.
function vc_iconpicker_type_steadysets( $icons ) { $steadysets_icons = array( array('steadysets-icon-type' => 'steadysets-icon-type'), array('steadysets-icon-box' => 'steadysets-icon-box'), array('steadysets-icon-archive' => 'steadysets-icon-archive'), array('steadysets-icon-envelope' => 'steadysets-icon-envelope'), array('steadysets-icon-email' => 'steadysets-icon-email'), array('steadysets-icon-files' => 'steadysets-icon-files'), array('steadysets-icon-uniE606' => 'steadysets-icon-uniE606'), array('steadysets-icon-connection-empty' => 'steadysets-icon-connection-empty'), array('steadysets-icon-connection-25' => 'steadysets-icon-connection-25'), array('steadysets-icon-connection-50' => 'steadysets-icon-connection-50'), array('steadysets-icon-connection-75' => 'steadysets-icon-connection-75'), array('steadysets-icon-connection-full' => 'steadysets-icon-connection-full'), array('steadysets-icon-microphone' => 'steadysets-icon-microphone'), array('steadysets-icon-microphone-off' => 'steadysets-icon-microphone-off'), array('steadysets-icon-book' => 'steadysets-icon-book'), array('steadysets-icon-cloud' => 'steadysets-icon-cloud'), array('steadysets-icon-book2' => 'steadysets-icon-book2'), array('steadysets-icon-star' => 'steadysets-icon-star'), array('steadysets-icon-phone-portrait' => 'steadysets-icon-phone-portrait'), array('steadysets-icon-phone-landscape' => 'steadysets-icon-phone-landscape'), array('steadysets-icon-tablet' => 'steadysets-icon-tablet'), array('steadysets-icon-tablet-landscape' => 'steadysets-icon-tablet-landscape'), array('steadysets-icon-laptop' => 'steadysets-icon-laptop'), array('steadysets-icon-uniE617' => 'steadysets-icon-uniE617'), array('steadysets-icon-barbell' => 'steadysets-icon-barbell'), array('steadysets-icon-stopwatch' => 'steadysets-icon-stopwatch'), array('steadysets-icon-atom' => 'steadysets-icon-atom'), array('steadysets-icon-syringe' => 'steadysets-icon-syringe'), array('steadysets-icon-pencil' => 'steadysets-icon-pencil'), array('steadysets-icon-chart' => 'steadysets-icon-chart'), array('steadysets-icon-bars' => 'steadysets-icon-bars'), array('steadysets-icon-cube' => 'steadysets-icon-cube'), array('steadysets-icon-image' => 'steadysets-icon-image'), array('steadysets-icon-crop' => 'steadysets-icon-crop'), array('steadysets-icon-graph' => 'steadysets-icon-graph'), array('steadysets-icon-select' => 'steadysets-icon-select'), array('steadysets-icon-bucket' => 'steadysets-icon-bucket'), array('steadysets-icon-mug' => 'steadysets-icon-mug'), array('steadysets-icon-clipboard' => 'steadysets-icon-clipboard'), array('steadysets-icon-lab' => 'steadysets-icon-lab'), array('steadysets-icon-bones' => 'steadysets-icon-bones'), array('steadysets-icon-pill' => 'steadysets-icon-pill'), array('steadysets-icon-bolt' => 'steadysets-icon-bolt'), array('steadysets-icon-health' => 'steadysets-icon-health'), array('steadysets-icon-map-marker' => 'steadysets-icon-map-marker'), array('steadysets-icon-stack' => 'steadysets-icon-stack'), array('steadysets-icon-newspaper' => 'steadysets-icon-newspaper'), array('steadysets-icon-uniE62F' => 'steadysets-icon-uniE62F'), array('steadysets-icon-coffee' => 'steadysets-icon-coffee'), array('steadysets-icon-bill' => 'steadysets-icon-bill'), array('steadysets-icon-sun' => 'steadysets-icon-sun'), array('steadysets-icon-vcard' => 'steadysets-icon-vcard'), array('steadysets-icon-shorts' => 'steadysets-icon-shorts'), array('steadysets-icon-drink' => 'steadysets-icon-drink'), array('steadysets-icon-diamond' => 'steadysets-icon-diamond'), array('steadysets-icon-bag' => 'steadysets-icon-bag'), array('steadysets-icon-calculator' => 'steadysets-icon-calculator'), array('steadysets-icon-credit-cards' => 'steadysets-icon-credit-cards'), array('steadysets-icon-microwave-oven' => 'steadysets-icon-microwave-oven'), array('steadysets-icon-camera' => 'steadysets-icon-camera'), array('steadysets-icon-share' => 'steadysets-icon-share'), array('steadysets-icon-bullhorn' => 'steadysets-icon-bullhorn'), array('steadysets-icon-user' => 'steadysets-icon-user'), array('steadysets-icon-users' => 'steadysets-icon-users'), array('steadysets-icon-user2' => 'steadysets-icon-user2'), array('steadysets-icon-users2' => 'steadysets-icon-users2'), array('steadysets-icon-unlocked' => 'steadysets-icon-unlocked'), array('steadysets-icon-unlocked2' => 'steadysets-icon-unlocked2'), array('steadysets-icon-lock' => 'steadysets-icon-lock'), array('steadysets-icon-forbidden' => 'steadysets-icon-forbidden'), array('steadysets-icon-switch' => 'steadysets-icon-switch'), array('steadysets-icon-meter' => 'steadysets-icon-meter'), array('steadysets-icon-flag' => 'steadysets-icon-flag'), array('steadysets-icon-home' => 'steadysets-icon-home'), array('steadysets-icon-printer' => 'steadysets-icon-printer'), array('steadysets-icon-clock' => 'steadysets-icon-clock'), array('steadysets-icon-calendar' => 'steadysets-icon-calendar'), array('steadysets-icon-comment' => 'steadysets-icon-comment'), array('steadysets-icon-chat-3' => 'steadysets-icon-chat-3'), array('steadysets-icon-chat-2' => 'steadysets-icon-chat-2'), array('steadysets-icon-chat-1' => 'steadysets-icon-chat-1'), array('steadysets-icon-chat' => 'steadysets-icon-chat'), array('steadysets-icon-zoom-out' => 'steadysets-icon-zoom-out'), array('steadysets-icon-zoom-in' => 'steadysets-icon-zoom-in'), array('steadysets-icon-search' => 'steadysets-icon-search'), array('steadysets-icon-trashcan' => 'steadysets-icon-trashcan'), array('steadysets-icon-tag' => 'steadysets-icon-tag'), array('steadysets-icon-download' => 'steadysets-icon-download'), array('steadysets-icon-paperclip' => 'steadysets-icon-paperclip'), array('steadysets-icon-checkbox' => 'steadysets-icon-checkbox'), array('steadysets-icon-checkbox-checked' => 'steadysets-icon-checkbox-checked'), array('steadysets-icon-checkmark' => 'steadysets-icon-checkmark'), array('steadysets-icon-refresh' => 'steadysets-icon-refresh'), array('steadysets-icon-reload' => 'steadysets-icon-reload'), array('steadysets-icon-arrow-right' => 'steadysets-icon-arrow-right'), array('steadysets-icon-arrow-down' => 'steadysets-icon-arrow-down'), array('steadysets-icon-arrow-up' => 'steadysets-icon-arrow-up'), array('steadysets-icon-arrow-left' => 'steadysets-icon-arrow-left'), array('steadysets-icon-settings' => 'steadysets-icon-settings'), array('steadysets-icon-battery-full' => 'steadysets-icon-battery-full'), array('steadysets-icon-battery-75' => 'steadysets-icon-battery-75'), array('steadysets-icon-battery-50' => 'steadysets-icon-battery-50'), array('steadysets-icon-battery-25' => 'steadysets-icon-battery-25'), array('steadysets-icon-battery-empty' => 'steadysets-icon-battery-empty'), array('steadysets-icon-battery-charging' => 'steadysets-icon-battery-charging'), array('steadysets-icon-uniE669' => 'steadysets-icon-uniE669'), array('steadysets-icon-grid' => 'steadysets-icon-grid'), array('steadysets-icon-list' => 'steadysets-icon-list'), array('steadysets-icon-wifi-low' => 'steadysets-icon-wifi-low'), array('steadysets-icon-folder-check' => 'steadysets-icon-folder-check'), array('steadysets-icon-folder-settings' => 'steadysets-icon-folder-settings'), array('steadysets-icon-folder-add' => 'steadysets-icon-folder-add'), array('steadysets-icon-folder' => 'steadysets-icon-folder'), array('steadysets-icon-window' => 'steadysets-icon-window'), array('steadysets-icon-windows' => 'steadysets-icon-windows'), array('steadysets-icon-browser' => 'steadysets-icon-browser'), array('steadysets-icon-file-broken' => 'steadysets-icon-file-broken'), array('steadysets-icon-align-justify' => 'steadysets-icon-align-justify'), array('steadysets-icon-align-center' => 'steadysets-icon-align-center'), array('steadysets-icon-align-right' => 'steadysets-icon-align-right'), array('steadysets-icon-align-left' => 'steadysets-icon-align-left'), array('steadysets-icon-file' => 'steadysets-icon-file'), array('steadysets-icon-file-add' => 'steadysets-icon-file-add'), array('steadysets-icon-file-settings' => 'steadysets-icon-file-settings'), array('steadysets-icon-mute' => 'steadysets-icon-mute'), array('steadysets-icon-heart' => 'steadysets-icon-heart'), array('steadysets-icon-enter' => 'steadysets-icon-enter'), array('steadysets-icon-volume-decrease' => 'steadysets-icon-volume-decrease'), array('steadysets-icon-wifi-mid' => 'steadysets-icon-wifi-mid'), array('steadysets-icon-volume' => 'steadysets-icon-volume'), array('steadysets-icon-bookmark' => 'steadysets-icon-bookmark'), array('steadysets-icon-screen' => 'steadysets-icon-screen'), array('steadysets-icon-map' => 'steadysets-icon-map'), array('steadysets-icon-measure' => 'steadysets-icon-measure'), array('steadysets-icon-eyedropper' => 'steadysets-icon-eyedropper'), array('steadysets-icon-support' => 'steadysets-icon-support'), array('steadysets-icon-phone' => 'steadysets-icon-phone'), array('steadysets-icon-email2' => 'steadysets-icon-email2'), array('steadysets-icon-volume-increase' => 'steadysets-icon-volume-increase'), array('steadysets-icon-wifi-full' => 'steadysets-icon-wifi-full'), ); return array_merge( $icons, $steadysets_icons ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sober_include_shadow_icons() {\n\techo '<div id=\"svg-defs\" class=\"svg-defs hidden\">';\n\tinclude get_template_directory() . '/images/sprite.svg';\n\techo '</div>';\n}", "public function getIconFarm();", "public function icons() {\n\t\trequire_once FUSION_BUILDER_PLUGIN_DIR . 'inc/admin-screens/icons.php';\n\t}", "private function autoSetIcon(): void\n {\n switch (static::class) {\n case Human::class:\n $this->icon = IconEnum::HUMAN;\n break;\n case Ai::class:\n $this->icon = IconEnum::AI;\n break;\n }\n }", "function jobstar_core_pe_icon_option() {\r\n return apply_filters( 'jobstar_get_pe_icon_sets', array(\r\n \r\n 'pe-7s-album' => 'Album',\r\n 'pe-7s-arc' => 'Arc',\r\n 'pe-7s-back-2' => 'Back 2',\r\n 'pe-7s-bandaid' => 'Bandaid',\r\n 'pe-7s-car' => 'Car',\r\n 'pe-7s-diamond' => 'Diamond',\r\n 'pe-7s-door-lock' => 'Door Lock',\r\n 'pe-7s-eyedropper' => 'Eyedropper',\r\n 'pe-7s-female' => 'Female',\r\n 'pe-7s-gym' => 'Gym',\r\n 'pe-7s-hammer' => 'Hammer',\r\n 'pe-7s-headphones' => 'Headphones',\r\n 'pe-7s-helm' => 'Helm',\r\n 'pe-7s-hourglass' => 'Hourglass',\r\n 'pe-7s-leaf' => 'Leaf',\r\n 'pe-7s-magic-wand' => 'Magic Wand',\r\n 'pe-7s-male' => 'Male',\r\n 'pe-7s-map-2' => 'Map 2',\r\n 'pe-7s-next-2' => 'Next 2',\r\n 'pe-7s-paint-bucket' => 'Paint Bucket',\r\n 'pe-7s-pendrive' => 'Pendrive',\r\n 'pe-7s-photo' => 'Photo',\r\n 'pe-7s-piggy' => 'Piggy',\r\n 'pe-7s-plugin' => 'Plugin',\r\n 'pe-7s-refresh-2' => 'Refresh 2',\r\n 'pe-7s-rocket' => 'Rocket',\r\n 'pe-7s-settings' => 'Settings',\r\n 'pe-7s-shield' => 'Shield',\r\n 'pe-7s-smile' => 'Smile',\r\n 'pe-7s-usb' => 'Usb',\r\n 'pe-7s-vector' => 'Vector',\r\n 'pe-7s-wine' => 'Wine',\r\n 'pe-7s-cloud-upload' => 'Cloud Upload',\r\n 'pe-7s-cash' => 'Cash',\r\n 'pe-7s-close' => 'Close',\r\n 'pe-7s-bluetooth' => 'Bluetooth',\r\n 'pe-7s-cloud-download' => 'Cloud Download',\r\n 'pe-7s-way' => 'Way',\r\n 'pe-7s-close-circle' => 'Close Circle',\r\n 'pe-7s-id' => 'Id',\r\n 'pe-7s-angle-up' => 'Angle Up',\r\n 'pe-7s-wristwatch' => 'Wristwatch',\r\n 'pe-7s-angle-up-circle' => 'Angle Up Circle',\r\n 'pe-7s-world' => 'World',\r\n 'pe-7s-angle-right' => 'Angle Right',\r\n 'pe-7s-volume' => 'Volume',\r\n 'pe-7s-angle-right-circle' => 'Angle Right Circle',\r\n 'pe-7s-users' => 'Users',\r\n 'pe-7s-angle-left' => 'Angle Left',\r\n 'pe-7s-user-female' => 'User Female',\r\n 'pe-7s-angle-left-circle' => 'Angle Left Circle',\r\n 'pe-7s-up-arrow' => 'Up Arrow',\r\n 'pe-7s-angle-down' => 'Angle Down',\r\n 'pe-7s-switch' => 'Switch',\r\n 'pe-7s-angle-down-circle' => 'Angle Down Circle',\r\n 'pe-7s-scissors' => 'Scissors',\r\n 'pe-7s-wallet' => 'Wallet',\r\n 'pe-7s-safe' => 'Safe',\r\n 'pe-7s-volume2' => 'Volume2',\r\n 'pe-7s-volume1' => 'Volume1',\r\n 'pe-7s-voicemail' => 'Voicemail',\r\n 'pe-7s-video' => 'Video',\r\n 'pe-7s-user' => 'User',\r\n 'pe-7s-upload' => 'Upload',\r\n 'pe-7s-unlock' => 'Unlock',\r\n 'pe-7s-umbrella' => 'Umbrella',\r\n 'pe-7s-trash' => 'Trash',\r\n 'pe-7s-tools' => 'Tools',\r\n 'pe-7s-timer' => 'Timer',\r\n 'pe-7s-ticket' => 'Ticket',\r\n 'pe-7s-target' => 'Target',\r\n 'pe-7s-sun' => 'Sun',\r\n 'pe-7s-study' => 'Study',\r\n 'pe-7s-stopwatch' => 'Stopwatch',\r\n 'pe-7s-star' => 'Star',\r\n 'pe-7s-speaker' => 'Speaker',\r\n 'pe-7s-signal' => 'Signal',\r\n 'pe-7s-shuffle' => 'Shuffle',\r\n 'pe-7s-shopbag' => 'Shopbag',\r\n 'pe-7s-share' => 'Share',\r\n 'pe-7s-server' => 'Server',\r\n 'pe-7s-search' => 'Search',\r\n 'pe-7s-film' => 'Film',\r\n 'pe-7s-science' => 'Science',\r\n 'pe-7s-disk' => 'Disk',\r\n 'pe-7s-ribbon' => 'Ribbon',\r\n 'pe-7s-repeat' => 'Repeat',\r\n 'pe-7s-refresh' => 'Refresh',\r\n 'pe-7s-add-user' => 'Add User',\r\n 'pe-7s-refresh-cloud' => 'Refresh Cloud',\r\n 'pe-7s-paperclip' => 'Paperclip',\r\n 'pe-7s-radio' => 'Radio',\r\n 'pe-7s-note2' => 'Note2',\r\n 'pe-7s-print' => 'Print',\r\n 'pe-7s-network' => 'Network',\r\n 'pe-7s-prev' => 'Prev',\r\n 'pe-7s-mute' => 'Mute',\r\n 'pe-7s-power' => 'Power',\r\n 'pe-7s-medal' => 'Medal',\r\n 'pe-7s-portfolio' => 'Portfolio',\r\n 'pe-7s-like2' => 'Like2',\r\n 'pe-7s-plus' => 'Plus',\r\n 'pe-7s-left-arrow' => 'Left Arrow',\r\n 'pe-7s-play' => 'Play',\r\n 'pe-7s-key' => 'Key',\r\n 'pe-7s-plane' => 'Plane',\r\n 'pe-7s-joy' => 'Joy',\r\n 'pe-7s-photo-gallery' => 'Photo Gallery',\r\n 'pe-7s-pin' => 'Pin',\r\n 'pe-7s-phone' => 'Phone',\r\n 'pe-7s-plug' => 'Plug',\r\n 'pe-7s-pen' => 'Pen',\r\n 'pe-7s-right-arrow' => 'Right Arrow',\r\n 'pe-7s-paper-plane' => 'Paper Plane',\r\n 'pe-7s-delete-user' => 'Delete User',\r\n 'pe-7s-paint' => 'Paint',\r\n 'pe-7s-bottom-arrow' => 'Bottom Arrow',\r\n 'pe-7s-notebook' => 'Notebook',\r\n 'pe-7s-note' => 'Note',\r\n 'pe-7s-next' => 'Next',\r\n 'pe-7s-news-paper' => 'News Paper',\r\n 'pe-7s-musiclist' => 'Musiclist',\r\n 'pe-7s-music' => 'Music',\r\n 'pe-7s-mouse' => 'Mouse',\r\n 'pe-7s-more' => 'More',\r\n 'pe-7s-moon' => 'Moon',\r\n 'pe-7s-monitor' => 'Monitor',\r\n 'pe-7s-micro' => 'Micro',\r\n 'pe-7s-menu' => 'Menu',\r\n 'pe-7s-map' => 'Map',\r\n 'pe-7s-map-marker' => 'Map Marker',\r\n 'pe-7s-mail' => 'Mail',\r\n 'pe-7s-mail-open' => 'Mail Open',\r\n 'pe-7s-mail-open-file' => 'Mail Open File',\r\n 'pe-7s-magnet' => 'Magnet',\r\n 'pe-7s-loop' => 'Loop',\r\n 'pe-7s-look' => 'Look',\r\n 'pe-7s-lock' => 'Lock',\r\n 'pe-7s-lintern' => 'Lintern',\r\n 'pe-7s-link' => 'Link',\r\n 'pe-7s-like' => 'Like',\r\n 'pe-7s-light' => 'Light',\r\n 'pe-7s-less' => 'Less',\r\n 'pe-7s-keypad' => 'Keypad',\r\n 'pe-7s-junk' => 'Junk',\r\n 'pe-7s-info' => 'Info',\r\n 'pe-7s-home' => 'Home',\r\n 'pe-7s-help2' => 'Help2',\r\n 'pe-7s-help1' => 'Help1',\r\n 'pe-7s-graph3' => 'Graph3',\r\n 'pe-7s-graph2' => 'Graph2',\r\n 'pe-7s-graph1' => 'Graph1',\r\n 'pe-7s-graph' => 'Graph',\r\n 'pe-7s-global' => 'Global',\r\n 'pe-7s-gleam' => 'Gleam',\r\n 'pe-7s-glasses' => 'Glasses',\r\n 'pe-7s-gift' => 'Gift',\r\n 'pe-7s-folder' => 'Folder',\r\n 'pe-7s-flag' => 'Flag',\r\n 'pe-7s-filter' => 'Filter',\r\n 'pe-7s-file' => 'File',\r\n 'pe-7s-expand1' => 'Expand1',\r\n 'pe-7s-exapnd2' => 'Exapnd2',\r\n 'pe-7s-edit' => 'Edit',\r\n 'pe-7s-drop' => 'Drop',\r\n 'pe-7s-drawer' => 'Drawer',\r\n 'pe-7s-download' => 'Download',\r\n 'pe-7s-display2' => 'Display2',\r\n 'pe-7s-display1' => 'Display1',\r\n 'pe-7s-diskette' => 'Diskette',\r\n 'pe-7s-date' => 'Date',\r\n 'pe-7s-cup' => 'Cup',\r\n 'pe-7s-culture' => 'Culture',\r\n 'pe-7s-crop' => 'Crop',\r\n 'pe-7s-credit' => 'Credit',\r\n 'pe-7s-copy-file' => 'Copy File',\r\n 'pe-7s-config' => 'Config',\r\n 'pe-7s-compass' => 'Compass',\r\n 'pe-7s-comment' => 'Comment',\r\n 'pe-7s-coffee' => 'Coffee',\r\n 'pe-7s-cloud' => 'Cloud',\r\n 'pe-7s-clock' => 'Clock',\r\n 'pe-7s-check' => 'Check',\r\n 'pe-7s-chat' => 'Chat',\r\n 'pe-7s-cart' => 'Cart',\r\n 'pe-7s-camera' => 'Camera',\r\n 'pe-7s-call' => 'Call',\r\n 'pe-7s-calculator' => 'Calculator',\r\n 'pe-7s-browser' => 'Browser',\r\n 'pe-7s-box2' => 'Box2',\r\n 'pe-7s-box1' => 'Box1',\r\n 'pe-7s-bookmarks' => 'Bookmarks',\r\n 'pe-7s-bicycle' => 'Bicycle',\r\n 'pe-7s-bell' => 'Bell',\r\n 'pe-7s-battery' => 'Battery',\r\n 'pe-7s-ball' => 'Ball',\r\n 'pe-7s-back' => 'Back',\r\n 'pe-7s-attention' => 'Attention',\r\n 'pe-7s-anchor' => 'Anchor',\r\n 'pe-7s-albums' => 'Albums',\r\n 'pe-7s-alarm' => 'Alarm',\r\n 'pe-7s-airplay' => 'Airplay',\r\n ) );\r\n}", "public function slcr_add_new_icon_set_to_iconbox() { \n\t\t\t$icons_name = \"flaticon\";\n\t\t $param = WPBMap::getParam( 'vc_icon', 'type' );\n\t $param['value'][__( 'Custom Pack', 'moppers' )] = $icons_name;\n\t vc_update_shortcode_param( 'vc_icon', $param ); \n\t // list of icons that add \n\t add_filter( 'vc_iconpicker-type-flaticon', array( $this, 'slcr_add_icon_array' ), 15 ); \n\t add_action( 'vc_base_register_front_css', array( $this, 'slcr_vc_iconpicker_base_register_css' ), 15 );\n \t\tadd_action( 'vc_base_register_admin_css', array( $this, 'slcr_vc_iconpicker_base_register_css' ), 15 );\n\n \t\tadd_action( 'vc_backend_editor_enqueue_js_css', array( $this, 'slcr_vc_iconpicker_editor_css' ), 15 );\n \t\tadd_action( 'vc_frontend_editor_enqueue_js_css', array( $this, 'slcr_vc_iconpicker_editor_css' ), 15 );\n }", "public function icon() {\n\t\t$icon_url = MACHETE_BASE_URL . 'inc/' . $this->params['slug'] . '/icon.svg';\n\t\techo '<img src=\"' . esc_attr( $icon_url ) . '\" style=\"width: 96px; height: 96px;\">';\n\t}", "public static function materialIcons() {\n if (in_array(__FUNCTION__, self::$loaded))\n return;\n self::$loaded[] = __FUNCTION__;\n Conf::append('page.css', 'https://fonts.googleapis.com/icon?family=Material+Icons');\n }", "function add_site_icon() {\n\t\t\n\t\tif ( function_exists( 'has_site_icon' ) && has_site_icon() ) {\n\t\t\twp_site_icon();\n\t\t}\n\t\t\n\t}", "protected function createIcon()\r\n {\r\n switch ($this->suit) {\r\n\r\n // Heart Icon\r\n case 'Heart':\r\n $this->icon = 'H';//'&hearts;';\r\n break;\r\n\r\n // Diamond Icon\r\n case 'Diamond':\r\n $this->icon = 'D';//'&diams;';\r\n break;\r\n\r\n // Spade Icon\r\n case 'Spade':\r\n $this->icon = 'S';//'&spades;';\r\n break;\r\n\r\n // Club Icon\r\n case 'Club':\r\n $this->icon = 'C';//'&clubs;';\r\n break;\r\n }\r\n }", "private function augment_settings_map_markers() {\n\n\t\t$related_to = 'map_end_icon,default_icons';\n\t\t$new_options[ 'default_icons' ] = array( 'related_to' => $related_to , 'type' => 'checkbox' );\n\n\t\t$this->attach_to_slp( $new_options , array( 'page'=> 'slp_experience','section' => 'map', 'group' => 'markers' ) );\n\t}", "abstract protected function form_icon();", "function market_set_icon_file($hook, $type, $icon, $params) {\n\n\t$entity = elgg_extract('entity', $params);\n\t$size = elgg_extract('size', $params, 'large');\n//@EDIT 2020-05-06 - SAJ subtype 'market' replaced by 'qim'\n\tif (!elgg_instanceof($entity, 'object', 'market') && !elgg_instanceof($entity, 'object', 'qim')) {\n\t\treturn;\n\t}\n\t\n\tswitch ($size) {\n\t\tcase 'small' :\n\t\t\t$filename_prefix = 'thumb';\n\t\t\t$metadata_name = 'thumbnail';\n\t\t\tbreak;\n\n\t\tcase 'medium' :\n\t\t\t$filename_prefix = 'smallthumb';\n\t\t\t$metadata_name = 'smallthumb';\n\t\t\tbreak;\n\n\t\tcase 'large' :\n\t\t\t$filename_prefix = 'largethumb';\n\t\t\t$metadata_name = 'largethumb';\n\t\t\tbreak;\n\n\t\tdefault :\n\t\t\t$filename_prefix = \"{$size}thumb\";\n\t\t\t$metadata_name = $filename_prefix;\n\t\t\tbreak;\n\t}\n\n\t$icon->owner_guid = $entity->owner_guid;\n\tif (isset($entity->$metadata_name)) {\n\t\t$icon->setFilename($entity->$metadata_name);\n\t} else {\n\t\t$filename = pathinfo($entity->getFilenameOnFilestore(), PATHINFO_FILENAME);\n\t\t$filename = \"file/{$filename_prefix}{$filename}.jpg\";\n\t\t$icon->setFilename($filename);\n\t}\n\treturn $icon;\n}", "public function icon ( ) { return NULL; }", "public function loadSmileySets()\n\t{\n\t\tglobal $context, $modSettings;\n\n\t\t$context['smiley_sets'] = explode(',', $modSettings['smiley_sets_known']);\n\t\t$set_names = explode(\"\\n\", $modSettings['smiley_sets_names']);\n\t\tforeach ($context['smiley_sets'] as $i => $set)\n\t\t{\n\t\t\t$context['smiley_sets'][$i] = [\n\t\t\t\t'id' => $i,\n\t\t\t\t'path' => htmlspecialchars($set, ENT_COMPAT),\n\t\t\t\t'name' => htmlspecialchars(stripslashes($set_names[$i]), ENT_COMPAT),\n\t\t\t\t'selected' => $set === $modSettings['smiley_sets_default']\n\t\t\t];\n\t\t}\n\t}", "function press_icon(){\n?>\n<div class=\"icon-list\"><p>\n\t<?php $resevi_icon = press_get_icon(); \n\t\t$i=1; foreach($resevi_icon as $name=>$path ):\n\t?>\n\t\t<img id=\"icon-<?php echo $name; ?>\" style=\"width:30px;height:30px;\" src=\"<?php echo $path ;?>\" alt=\"<?php echo $name; ?>\"/>\n\t\t<?php if($i%7==0) echo \"</p><p>\"; ?>\n\t<?php \t$i++; endforeach;\t?>\n</p></div>\n<?php \n}", "function optimizeSvgIcons() {\n $this->taskExec(self::NPM_BIN_PATH . 'svgo -f ' . self::BASE_DIR . '/web/assets/Icons/Content/svg')\n ->dir(self::BASE_DIR)\n ->run();\n }", "public function enableIcon()\n {\n $this->iconEnabled = true;\n }", "public function post_type_icons() { ?>\n\t <style type=\"text/css\" media=\"screen\">\n\t\t\t/* Post Type Websites */\n\t\t\t#adminmenu .menu-icon-websites div.wp-menu-image:before { \n\t\t\t\tcontent: \"\\f322\";\n\t\t\t}\n\t </style><?php \n\t}", "function buildIcons() {\n $this->optimizeSvgIcons();\n $this->taskExec('node ' . self::BASE_DIR . '/build/fe/tasks/icons')\n ->dir(self::BASE_DIR)\n ->run();\n $this->_remove(self::BASE_DIR . '/web/assets/Icons/Content/icons.data.png.css');\n $this->_remove(self::BASE_DIR . '/web/assets/Icons/Content/icons.fallback.css');\n }", "public function get_icon()\n {\n return 'eicon-yoast';\n }", "function learndash_test_admin_icon() { ?>\n\n\t<style type=\"text/css\">\n\t\t#adminmenu #toplevel_page_learndash-lms div.wp-menu-image:before {\n\t\t\tbackground: url('<?php echo esc_url( LEARNDASH_LMS_PLUGIN_URL . '/themes/ld30/assets/iconfont/admin-icons/browser-checkmark.svg' ); ?>') center center no-repeat;\n\t\t\tcontent: '';\n\t\t\topacity: 0.7;\n\t\t}\n\t</style>\n\n\t<?php\n}", "public function create()\n {\n $icones = [\n [\n 'class' => 'flaticon-050-satellite',\n 'code' => 'f131',\n ],\n [\n 'class' => 'flaticon-049-projector',\n 'code' => 'f130',\n ],\n [\n 'class' => 'flaticon-048-abstract',\n 'code' => 'f12f',\n ],\n [\n 'class' => 'flaticon-050-satellite',\n 'code' => 'f131',\n ],\n [\n 'class' => 'flaticon-035-smartphone',\n 'code' => \"f122\"\n ],\n [\n 'class' => 'flaticon-036-brainstorming',\n 'code' => \"f123\"\n ],\n [\n 'class' => 'flaticon-037-idea',\n 'code' => \"f124\"\n ],\n [\n 'class' => 'flaticon-038-graphic-tool-1',\n 'code' => \"f125\"\n ],\n [\n 'class' => 'flaticon-039-vector',\n 'code' => \"f126\"\n ],\n [\n 'class' => 'flaticon-040-rgb',\n 'code' => \"f127\"\n ],\n [\n 'class' => 'flaticon-041-graphic-tool',\n 'code' => \"f128\"\n ],\n [\n 'class' => 'flaticon-042-typography',\n 'code' => \"f129\"\n ],\n [\n 'class' => 'flaticon-043-sketch',\n 'code' => \"f12a\"\n ],\n [\n 'class' => 'flaticon-044-paint-bucket',\n 'code' => \"f12b\"\n ],\n [\n 'class' => 'flaticon-045-video-player',\n 'code' => \"f12c\"\n ],\n [\n 'class' => 'flaticon-046-laptop',\n 'code' => \"f12d\"\n ],\n [\n 'class' => 'flaticon-047-artificial-intelligence',\n 'code' => \"f12e\"\n ],\n ];\n return view('admin.service.add', compact('icones'));\n }", "function market_icon_handler($page) {\n\tif (isset($page[0])) {\n\t\tset_input('guid', $page[0]);\n\t}\n\tif (isset($page[1])) {\n\t\tset_input('size', $page[1]);\n\t}\n\tif (isset($page[2])) {\n\t\tset_input('image', $page[2]);\n\t}\n\n\t$plugin_dir = elgg_get_plugins_path();\n\tinclude(\"$plugin_dir/market/icon.php\");\n\treturn true;\n}", "function qed_filter_theme_fonts_icon_sets( $icons ) {\r\n\t\t$di = qed_di();\r\n\t\tif ( isset( $di['icons_manager'] ) ) {\r\n\t\t\t$qed_icons_list = qed_di( 'icons_manager' )->get_list();\r\n\t\t\tif ( $qed_icons_list ) {\r\n\t\t\t\t$set = array();\r\n\t\t\t\tforeach ( $qed_icons_list as $icon ) {\r\n\t\t\t\t\t$set[ $icon['value'] ] = $icon['label'];\r\n\t\t\t\t}\r\n\t\t\t\t$icons['Swish Design'] = $set;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$icons_manager = new SD_Font_Icons_Manager( array(\r\n\t\t\t'font_file_url' => PARENT_URL . '/assets/csslib/font-awesome.min.css',\r\n\t\t\t'pattern' => '/\\.(fa-(?:\\w+(?:-)?)+):before\\s*{\\s*content/',\r\n\t\t\t'cache_key' => 'qed-font-awesome-icons-list',\r\n\t\t) );\r\n\t\t$font_awesome_icons_list = $icons_manager->get_list();\r\n\t\tif ( $font_awesome_icons_list ) {\r\n\t\t\t$set = array();\r\n\t\t\tforeach ( $font_awesome_icons_list as $icon ) {\r\n\t\t\t\t$icon_class = 'fa ' . $icon['value'];\r\n\t\t\t\t$set[ $icon_class ] = $icon['label'];\r\n\t\t\t}\r\n\t\t\t$icons['Font Awesome'] = $set;\r\n\t\t}\r\n\r\n\t\treturn $icons;\r\n\t}", "function muiteer_disable_site_icon() {\n global $wp_customize;\n $wp_customize->remove_control('site_icon');\n }", "public static function tf_icon_picker() {\n\t\t$icon_fonts = self::get_types();\n\t\tif ( ! empty( $icon_fonts ) ) {\n\t\t\tinclude trailingslashit( dirname( __FILE__ ) ) . 'views/template.php';\n\t\t}\n\t\tdie;\n\t}", "function vc_iconpicker_type_iconsmind( $icons ) {\n\t$iconsmind_icons = array(\n\t\tarray(\"iconsmind-Aquarius\" => \"iconsmind-Aquarius\"), \n\t\tarray(\"iconsmind-Aquarius-2\" => \"iconsmind-Aquarius-2\"), \n\t\tarray(\"iconsmind-Aries\" => \"iconsmind-Aries\"), \n\t\tarray(\"iconsmind-Aries-2\" => \"iconsmind-Aries-2\"), \n\t\tarray(\"iconsmind-Cancer\" => \"iconsmind-Cancer\"), \n\t\tarray(\"iconsmind-Cancer-2\" => \"iconsmind-Cancer-2\"), \n\t\tarray(\"iconsmind-Capricorn\" => \"iconsmind-Capricorn\"), \n\t\tarray(\"iconsmind-Capricorn-2\" => \"iconsmind-Capricorn-2\"), \n\t\tarray(\"iconsmind-Gemini\" => \"iconsmind-Gemini\"), \n\t\tarray(\"iconsmind-Gemini-2\" => \"iconsmind-Gemini-2\"), \n\t\tarray(\"iconsmind-Leo\" => \"iconsmind-Leo\"), \n\t\tarray(\"iconsmind-Leo-2\" => \"iconsmind-Leo-2\"), \n\t\tarray(\"iconsmind-Libra\" => \"iconsmind-Libra\"), \n\t\tarray(\"iconsmind-Libra-2\" => \"iconsmind-Libra-2\"), \n\t\tarray(\"iconsmind-Pisces\" => \"iconsmind-Pisces\"), \n\t\tarray(\"iconsmind-Pisces-2\" => \"iconsmind-Pisces-2\"), \n\t\tarray(\"iconsmind-Sagittarus\" => \"iconsmind-Sagittarus\"), \n\t\tarray(\"iconsmind-Sagittarus-2\" => \"iconsmind-Sagittarus-2\"), \n\t\tarray(\"iconsmind-Scorpio\" => \"iconsmind-Scorpio\"), \n\t\tarray(\"iconsmind-Scorpio-2\" => \"iconsmind-Scorpio-2\"), \n\t\tarray(\"iconsmind-Taurus\" => \"iconsmind-Taurus\"), \n\t\tarray(\"iconsmind-Taurus-2\" => \"iconsmind-Taurus-2\"), \n\t\tarray(\"iconsmind-Virgo\" => \"iconsmind-Virgo\"), \n\t\tarray(\"iconsmind-Virgo-2\" => \"iconsmind-Virgo-2\"), \n\t\tarray(\"iconsmind-Add-Window\" => \"iconsmind-Add-Window\"), \n\t\tarray(\"iconsmind-Approved-Window\" => \"iconsmind-Approved-Window\"), \n\t\tarray(\"iconsmind-Block-Window\" => \"iconsmind-Block-Window\"), \n\t\tarray(\"iconsmind-Close-Window\" => \"iconsmind-Close-Window\"), \n\t\tarray(\"iconsmind-Code-Window\" => \"iconsmind-Code-Window\"), \n\t\tarray(\"iconsmind-Delete-Window\" => \"iconsmind-Delete-Window\"), \n\t\tarray(\"iconsmind-Download-Window\" => \"iconsmind-Download-Window\"), \n\t\tarray(\"iconsmind-Duplicate-Window\" => \"iconsmind-Duplicate-Window\"), \n\t\tarray(\"iconsmind-Error-404Window\" => \"iconsmind-Error-404Window\"), \n\t\tarray(\"iconsmind-Favorite-Window\" => \"iconsmind-Favorite-Window\"), \n\t\tarray(\"iconsmind-Font-Window\" => \"iconsmind-Font-Window\"), \n\t\tarray(\"iconsmind-Full-ViewWindow\" => \"iconsmind-Full-ViewWindow\"), \n\t\tarray(\"iconsmind-Height-Window\" => \"iconsmind-Height-Window\"), \n\t\tarray(\"iconsmind-Home-Window\" => \"iconsmind-Home-Window\"), \n\t\tarray(\"iconsmind-Info-Window\" => \"iconsmind-Info-Window\"), \n\t\tarray(\"iconsmind-Loading-Window\" => \"iconsmind-Loading-Window\"), \n\t\tarray(\"iconsmind-Lock-Window\" => \"iconsmind-Lock-Window\"), \n\t\tarray(\"iconsmind-Love-Window\" => \"iconsmind-Love-Window\"), \n\t\tarray(\"iconsmind-Maximize-Window\" => \"iconsmind-Maximize-Window\"), \n\t\tarray(\"iconsmind-Minimize-Maximize-Close-Window\" => \"iconsmind-Minimize-Maximize-Close-Window\"), \n\t\tarray(\"iconsmind-Minimize-Window\" => \"iconsmind-Minimize-Window\"), \n\t\tarray(\"iconsmind-Navigation-LeftWindow\" => \"iconsmind-Navigation-LeftWindow\"), \n\t\tarray(\"iconsmind-Navigation-RightWindow\" => \"iconsmind-Navigation-RightWindow\"), \n\t\tarray(\"iconsmind-Network-Window\" => \"iconsmind-Network-Window\"), \n\t\tarray(\"iconsmind-New-Tab\" => \"iconsmind-New-Tab\"), \n\t\tarray(\"iconsmind-One-Window\" => \"iconsmind-One-Window\"), \n\t\tarray(\"iconsmind-Refresh-Window\" => \"iconsmind-Refresh-Window\"), \n\t\tarray(\"iconsmind-Remove-Window\" => \"iconsmind-Remove-Window\"), \n\t\tarray(\"iconsmind-Restore-Window\" => \"iconsmind-Restore-Window\"), \n\t\tarray(\"iconsmind-Save-Window\" => \"iconsmind-Save-Window\"), \n\t\tarray(\"iconsmind-Settings-Window\" => \"iconsmind-Settings-Window\"), \n\t\tarray(\"iconsmind-Share-Window\" => \"iconsmind-Share-Window\"), \n\t\tarray(\"iconsmind-Sidebar-Window\" => \"iconsmind-Sidebar-Window\"), \n\t\tarray(\"iconsmind-Split-FourSquareWindow\" => \"iconsmind-Split-FourSquareWindow\"), \n\t\tarray(\"iconsmind-Split-Horizontal\" => \"iconsmind-Split-Horizontal\"), \n\t\tarray(\"iconsmind-Split-Horizontal2Window\" => \"iconsmind-Split-Horizontal2Window\"), \n\t\tarray(\"iconsmind-Split-Vertical\" => \"iconsmind-Split-Vertical\"), \n\t\tarray(\"iconsmind-Split-Vertical2\" => \"iconsmind-Split-Vertical2\"), \n\t\tarray(\"iconsmind-Split-Window\" => \"iconsmind-Split-Window\"), \n\t\tarray(\"iconsmind-Time-Window\" => \"iconsmind-Time-Window\"), \n\t\tarray(\"iconsmind-Touch-Window\" => \"iconsmind-Touch-Window\"), \n\t\tarray(\"iconsmind-Two-Windows\" => \"iconsmind-Two-Windows\"), \n\t\tarray(\"iconsmind-Upload-Window\" => \"iconsmind-Upload-Window\"), \n\t\tarray(\"iconsmind-URL-Window\" => \"iconsmind-URL-Window\"), \n\t\tarray(\"iconsmind-Warning-Window\" => \"iconsmind-Warning-Window\"), \n\t\tarray(\"iconsmind-Width-Window\" => \"iconsmind-Width-Window\"), \n\t\tarray(\"iconsmind-Window-2\" => \"iconsmind-Window-2\"), \n\t\tarray(\"iconsmind-Windows-2\" => \"iconsmind-Windows-2\"), \n\t\tarray(\"iconsmind-Autumn\" => \"iconsmind-Autumn\"), \n\t\tarray(\"iconsmind-Celsius\" => \"iconsmind-Celsius\"), \n\t\tarray(\"iconsmind-Cloud-Hail\" => \"iconsmind-Cloud-Hail\"), \n\t\tarray(\"iconsmind-Cloud-Moon\" => \"iconsmind-Cloud-Moon\"), \n\t\tarray(\"iconsmind-Cloud-Rain\" => \"iconsmind-Cloud-Rain\"), \n\t\tarray(\"iconsmind-Cloud-Snow\" => \"iconsmind-Cloud-Snow\"), \n\t\tarray(\"iconsmind-Cloud-Sun\" => \"iconsmind-Cloud-Sun\"), \n\t\tarray(\"iconsmind-Clouds-Weather\" => \"iconsmind-Clouds-Weather\"), \n\t\tarray(\"iconsmind-Cloud-Weather\" => \"iconsmind-Cloud-Weather\"), \n\t\tarray(\"iconsmind-Drop\" => \"iconsmind-Drop\"), \n\t\tarray(\"iconsmind-Dry\" => \"iconsmind-Dry\"), \n\t\tarray(\"iconsmind-Fahrenheit\" => \"iconsmind-Fahrenheit\"), \n\t\tarray(\"iconsmind-Fog-Day\" => \"iconsmind-Fog-Day\"), \n\t\tarray(\"iconsmind-Fog-Night\" => \"iconsmind-Fog-Night\"), \n\t\tarray(\"iconsmind-Full-Moon\" => \"iconsmind-Full-Moon\"), \n\t\tarray(\"iconsmind-Half-Moon\" => \"iconsmind-Half-Moon\"), \n\t\tarray(\"iconsmind-No-Drop\" => \"iconsmind-No-Drop\"), \n\t\tarray(\"iconsmind-Rainbow\" => \"iconsmind-Rainbow\"), \n\t\tarray(\"iconsmind-Rainbow-2\" => \"iconsmind-Rainbow-2\"), \n\t\tarray(\"iconsmind-Rain-Drop\" => \"iconsmind-Rain-Drop\"), \n\t\tarray(\"iconsmind-Sleet\" => \"iconsmind-Sleet\"), \n\t\tarray(\"iconsmind-Snow\" => \"iconsmind-Snow\"), \n\t\tarray(\"iconsmind-Snowflake\" => \"iconsmind-Snowflake\"), \n\t\tarray(\"iconsmind-Snowflake-2\" => \"iconsmind-Snowflake-2\"), \n\t\tarray(\"iconsmind-Snowflake-3\" => \"iconsmind-Snowflake-3\"), \n\t\tarray(\"iconsmind-Snow-Storm\" => \"iconsmind-Snow-Storm\"), \n\t\tarray(\"iconsmind-Spring\" => \"iconsmind-Spring\"), \n\t\tarray(\"iconsmind-Storm\" => \"iconsmind-Storm\"), \n\t\tarray(\"iconsmind-Summer\" => \"iconsmind-Summer\"), \n\t\tarray(\"iconsmind-Sun\" => \"iconsmind-Sun\"), \n\t\tarray(\"iconsmind-Sun-CloudyRain\" => \"iconsmind-Sun-CloudyRain\"), \n\t\tarray(\"iconsmind-Sunrise\" => \"iconsmind-Sunrise\"), \n\t\tarray(\"iconsmind-Sunset\" => \"iconsmind-Sunset\"), \n\t\tarray(\"iconsmind-Temperature\" => \"iconsmind-Temperature\"), \n\t\tarray(\"iconsmind-Temperature-2\" => \"iconsmind-Temperature-2\"), \n\t\tarray(\"iconsmind-Thunder\" => \"iconsmind-Thunder\"), \n\t\tarray(\"iconsmind-Thunderstorm\" => \"iconsmind-Thunderstorm\"), \n\t\tarray(\"iconsmind-Twister\" => \"iconsmind-Twister\"), \n\t\tarray(\"iconsmind-Umbrella-2\" => \"iconsmind-Umbrella-2\"), \n\t\tarray(\"iconsmind-Umbrella-3\" => \"iconsmind-Umbrella-3\"), \n\t\tarray(\"iconsmind-Wave\" => \"iconsmind-Wave\"), \n\t\tarray(\"iconsmind-Wave-2\" => \"iconsmind-Wave-2\"), \n\t\tarray(\"iconsmind-Windsock\" => \"iconsmind-Windsock\"), \n\t\tarray(\"iconsmind-Wind-Turbine\" => \"iconsmind-Wind-Turbine\"), \n\t\tarray(\"iconsmind-Windy\" => \"iconsmind-Windy\"), \n\t\tarray(\"iconsmind-Winter\" => \"iconsmind-Winter\"), \n\t\tarray(\"iconsmind-Winter-2\" => \"iconsmind-Winter-2\"), \n\t\tarray(\"iconsmind-Cinema\" => \"iconsmind-Cinema\"), \n\t\tarray(\"iconsmind-Clapperboard-Close\" => \"iconsmind-Clapperboard-Close\"), \n\t\tarray(\"iconsmind-Clapperboard-Open\" => \"iconsmind-Clapperboard-Open\"), \n\t\tarray(\"iconsmind-D-Eyeglasses\" => \"iconsmind-D-Eyeglasses\"), \n\t\tarray(\"iconsmind-D-Eyeglasses2\" => \"iconsmind-D-Eyeglasses2\"), \n\t\tarray(\"iconsmind-Director\" => \"iconsmind-Director\"), \n\t\tarray(\"iconsmind-Film\" => \"iconsmind-Film\"), \n\t\tarray(\"iconsmind-Film-Strip\" => \"iconsmind-Film-Strip\"), \n\t\tarray(\"iconsmind-Film-Video\" => \"iconsmind-Film-Video\"), \n\t\tarray(\"iconsmind-Flash-Video\" => \"iconsmind-Flash-Video\"), \n\t\tarray(\"iconsmind-HD-Video\" => \"iconsmind-HD-Video\"), \n\t\tarray(\"iconsmind-Movie\" => \"iconsmind-Movie\"), \n\t\tarray(\"iconsmind-Old-TV\" => \"iconsmind-Old-TV\"), \n\t\tarray(\"iconsmind-Reel\" => \"iconsmind-Reel\"), \n\t\tarray(\"iconsmind-Tripod-andVideo\" => \"iconsmind-Tripod-andVideo\"), \n\t\tarray(\"iconsmind-TV\" => \"iconsmind-TV\"), \n\t\tarray(\"iconsmind-Video\" => \"iconsmind-Video\"), \n\t\tarray(\"iconsmind-Video-2\" => \"iconsmind-Video-2\"), \n\t\tarray(\"iconsmind-Video-3\" => \"iconsmind-Video-3\"), \n\t\tarray(\"iconsmind-Video-4\" => \"iconsmind-Video-4\"), \n\t\tarray(\"iconsmind-Video-5\" => \"iconsmind-Video-5\"), \n\t\tarray(\"iconsmind-Video-6\" => \"iconsmind-Video-6\"), \n\t\tarray(\"iconsmind-Video-Len\" => \"iconsmind-Video-Len\"), \n\t\tarray(\"iconsmind-Video-Len2\" => \"iconsmind-Video-Len2\"), \n\t\tarray(\"iconsmind-Video-Photographer\" => \"iconsmind-Video-Photographer\"), \n\t\tarray(\"iconsmind-Video-Tripod\" => \"iconsmind-Video-Tripod\"), \n\t\tarray(\"iconsmind-Affiliate\" => \"iconsmind-Affiliate\"), \n\t\tarray(\"iconsmind-Background\" => \"iconsmind-Background\"), \n\t\tarray(\"iconsmind-Billing\" => \"iconsmind-Billing\"), \n\t\tarray(\"iconsmind-Control\" => \"iconsmind-Control\"), \n\t\tarray(\"iconsmind-Control-2\" => \"iconsmind-Control-2\"), \n\t\tarray(\"iconsmind-Crop-2\" => \"iconsmind-Crop-2\"), \n\t\tarray(\"iconsmind-Dashboard\" => \"iconsmind-Dashboard\"), \n\t\tarray(\"iconsmind-Duplicate-Layer\" => \"iconsmind-Duplicate-Layer\"), \n\t\tarray(\"iconsmind-Filter-2\" => \"iconsmind-Filter-2\"), \n\t\tarray(\"iconsmind-Gear\" => \"iconsmind-Gear\"), \n\t\tarray(\"iconsmind-Gear-2\" => \"iconsmind-Gear-2\"), \n\t\tarray(\"iconsmind-Gears\" => \"iconsmind-Gears\"), \n\t\tarray(\"iconsmind-Gears-2\" => \"iconsmind-Gears-2\"), \n\t\tarray(\"iconsmind-Information\" => \"iconsmind-Information\"), \n\t\tarray(\"iconsmind-Layer-Backward\" => \"iconsmind-Layer-Backward\"), \n\t\tarray(\"iconsmind-Layer-Forward\" => \"iconsmind-Layer-Forward\"), \n\t\tarray(\"iconsmind-Library\" => \"iconsmind-Library\"), \n\t\tarray(\"iconsmind-Loading\" => \"iconsmind-Loading\"), \n\t\tarray(\"iconsmind-Loading-2\" => \"iconsmind-Loading-2\"), \n\t\tarray(\"iconsmind-Loading-3\" => \"iconsmind-Loading-3\"), \n\t\tarray(\"iconsmind-Magnifi-Glass\" => \"iconsmind-Magnifi-Glass\"), \n\t\tarray(\"iconsmind-Magnifi-Glass2\" => \"iconsmind-Magnifi-Glass2\"), \n\t\tarray(\"iconsmind-Magnifi-Glass22\" => \"iconsmind-Magnifi-Glass22\"), \n\t\tarray(\"iconsmind-Mouse-Pointer\" => \"iconsmind-Mouse-Pointer\"), \n\t\tarray(\"iconsmind-On-off\" => \"iconsmind-On-off\"), \n\t\tarray(\"iconsmind-On-Off-2\" => \"iconsmind-On-Off-2\"), \n\t\tarray(\"iconsmind-On-Off-3\" => \"iconsmind-On-Off-3\"), \n\t\tarray(\"iconsmind-Preview\" => \"iconsmind-Preview\"), \n\t\tarray(\"iconsmind-Pricing\" => \"iconsmind-Pricing\"), \n\t\tarray(\"iconsmind-Profile\" => \"iconsmind-Profile\"), \n\t\tarray(\"iconsmind-Project\" => \"iconsmind-Project\"), \n\t\tarray(\"iconsmind-Rename\" => \"iconsmind-Rename\"), \n\t\tarray(\"iconsmind-Repair\" => \"iconsmind-Repair\"), \n\t\tarray(\"iconsmind-Save\" => \"iconsmind-Save\"), \n\t\tarray(\"iconsmind-Scroller\" => \"iconsmind-Scroller\"), \n\t\tarray(\"iconsmind-Scroller-2\" => \"iconsmind-Scroller-2\"), \n\t\tarray(\"iconsmind-Share\" => \"iconsmind-Share\"), \n\t\tarray(\"iconsmind-Statistic\" => \"iconsmind-Statistic\"), \n\t\tarray(\"iconsmind-Support\" => \"iconsmind-Support\"), \n\t\tarray(\"iconsmind-Switch\" => \"iconsmind-Switch\"), \n\t\tarray(\"iconsmind-Upgrade\" => \"iconsmind-Upgrade\"), \n\t\tarray(\"iconsmind-User\" => \"iconsmind-User\"), \n\t\tarray(\"iconsmind-Wrench\" => \"iconsmind-Wrench\"), \n\t\tarray(\"iconsmind-Air-Balloon\" => \"iconsmind-Air-Balloon\"), \n\t\tarray(\"iconsmind-Airship\" => \"iconsmind-Airship\"), \n\t\tarray(\"iconsmind-Bicycle\" => \"iconsmind-Bicycle\"), \n\t\tarray(\"iconsmind-Bicycle-2\" => \"iconsmind-Bicycle-2\"), \n\t\tarray(\"iconsmind-Bike-Helmet\" => \"iconsmind-Bike-Helmet\"), \n\t\tarray(\"iconsmind-Bus\" => \"iconsmind-Bus\"), \n\t\tarray(\"iconsmind-Bus-2\" => \"iconsmind-Bus-2\"), \n\t\tarray(\"iconsmind-Cable-Car\" => \"iconsmind-Cable-Car\"), \n\t\tarray(\"iconsmind-Car\" => \"iconsmind-Car\"), \n\t\tarray(\"iconsmind-Car-2\" => \"iconsmind-Car-2\"), \n\t\tarray(\"iconsmind-Car-3\" => \"iconsmind-Car-3\"), \n\t\tarray(\"iconsmind-Car-Wheel\" => \"iconsmind-Car-Wheel\"), \n\t\tarray(\"iconsmind-Gaugage\" => \"iconsmind-Gaugage\"), \n\t\tarray(\"iconsmind-Gaugage-2\" => \"iconsmind-Gaugage-2\"), \n\t\tarray(\"iconsmind-Helicopter\" => \"iconsmind-Helicopter\"), \n\t\tarray(\"iconsmind-Helicopter-2\" => \"iconsmind-Helicopter-2\"), \n\t\tarray(\"iconsmind-Helmet\" => \"iconsmind-Helmet\"), \n\t\tarray(\"iconsmind-Jeep\" => \"iconsmind-Jeep\"), \n\t\tarray(\"iconsmind-Jeep-2\" => \"iconsmind-Jeep-2\"), \n\t\tarray(\"iconsmind-Jet\" => \"iconsmind-Jet\"), \n\t\tarray(\"iconsmind-Motorcycle\" => \"iconsmind-Motorcycle\"), \n\t\tarray(\"iconsmind-Plane\" => \"iconsmind-Plane\"), \n\t\tarray(\"iconsmind-Plane-2\" => \"iconsmind-Plane-2\"), \n\t\tarray(\"iconsmind-Road\" => \"iconsmind-Road\"), \n\t\tarray(\"iconsmind-Road-2\" => \"iconsmind-Road-2\"), \n\t\tarray(\"iconsmind-Rocket\" => \"iconsmind-Rocket\"), \n\t\tarray(\"iconsmind-Sailing-Ship\" => \"iconsmind-Sailing-Ship\"), \n\t\tarray(\"iconsmind-Scooter\" => \"iconsmind-Scooter\"), \n\t\tarray(\"iconsmind-Scooter-Front\" => \"iconsmind-Scooter-Front\"), \n\t\tarray(\"iconsmind-Ship\" => \"iconsmind-Ship\"), \n\t\tarray(\"iconsmind-Ship-2\" => \"iconsmind-Ship-2\"), \n\t\tarray(\"iconsmind-Skateboard\" => \"iconsmind-Skateboard\"), \n\t\tarray(\"iconsmind-Skateboard-2\" => \"iconsmind-Skateboard-2\"), \n\t\tarray(\"iconsmind-Taxi\" => \"iconsmind-Taxi\"), \n\t\tarray(\"iconsmind-Taxi-2\" => \"iconsmind-Taxi-2\"), \n\t\tarray(\"iconsmind-Taxi-Sign\" => \"iconsmind-Taxi-Sign\"), \n\t\tarray(\"iconsmind-Tractor\" => \"iconsmind-Tractor\"), \n\t\tarray(\"iconsmind-traffic-Light\" => \"iconsmind-traffic-Light\"), \n\t\tarray(\"iconsmind-Traffic-Light2\" => \"iconsmind-Traffic-Light2\"), \n\t\tarray(\"iconsmind-Train\" => \"iconsmind-Train\"), \n\t\tarray(\"iconsmind-Train-2\" => \"iconsmind-Train-2\"), \n\t\tarray(\"iconsmind-Tram\" => \"iconsmind-Tram\"), \n\t\tarray(\"iconsmind-Truck\" => \"iconsmind-Truck\"), \n\t\tarray(\"iconsmind-Yacht\" => \"iconsmind-Yacht\"), \n\t\tarray(\"iconsmind-Double-Tap\" => \"iconsmind-Double-Tap\"), \n\t\tarray(\"iconsmind-Drag\" => \"iconsmind-Drag\"), \n\t\tarray(\"iconsmind-Drag-Down\" => \"iconsmind-Drag-Down\"), \n\t\tarray(\"iconsmind-Drag-Left\" => \"iconsmind-Drag-Left\"), \n\t\tarray(\"iconsmind-Drag-Right\" => \"iconsmind-Drag-Right\"), \n\t\tarray(\"iconsmind-Drag-Up\" => \"iconsmind-Drag-Up\"), \n\t\tarray(\"iconsmind-Finger-DragFourSides\" => \"iconsmind-Finger-DragFourSides\"), \n\t\tarray(\"iconsmind-Finger-DragTwoSides\" => \"iconsmind-Finger-DragTwoSides\"), \n\t\tarray(\"iconsmind-Five-Fingers\" => \"iconsmind-Five-Fingers\"), \n\t\tarray(\"iconsmind-Five-FingersDrag\" => \"iconsmind-Five-FingersDrag\"), \n\t\tarray(\"iconsmind-Five-FingersDrag2\" => \"iconsmind-Five-FingersDrag2\"), \n\t\tarray(\"iconsmind-Five-FingersTouch\" => \"iconsmind-Five-FingersTouch\"), \n\t\tarray(\"iconsmind-Flick\" => \"iconsmind-Flick\"), \n\t\tarray(\"iconsmind-Four-Fingers\" => \"iconsmind-Four-Fingers\"), \n\t\tarray(\"iconsmind-Four-FingersDrag\" => \"iconsmind-Four-FingersDrag\"), \n\t\tarray(\"iconsmind-Four-FingersDrag2\" => \"iconsmind-Four-FingersDrag2\"), \n\t\tarray(\"iconsmind-Four-FingersTouch\" => \"iconsmind-Four-FingersTouch\"), \n\t\tarray(\"iconsmind-Hand-Touch\" => \"iconsmind-Hand-Touch\"), \n\t\tarray(\"iconsmind-Hand-Touch2\" => \"iconsmind-Hand-Touch2\"), \n\t\tarray(\"iconsmind-Hand-TouchSmartphone\" => \"iconsmind-Hand-TouchSmartphone\"), \n\t\tarray(\"iconsmind-One-Finger\" => \"iconsmind-One-Finger\"), \n\t\tarray(\"iconsmind-One-FingerTouch\" => \"iconsmind-One-FingerTouch\"), \n\t\tarray(\"iconsmind-Pinch\" => \"iconsmind-Pinch\"), \n\t\tarray(\"iconsmind-Press\" => \"iconsmind-Press\"), \n\t\tarray(\"iconsmind-Rotate-Gesture\" => \"iconsmind-Rotate-Gesture\"), \n\t\tarray(\"iconsmind-Rotate-Gesture2\" => \"iconsmind-Rotate-Gesture2\"), \n\t\tarray(\"iconsmind-Rotate-Gesture3\" => \"iconsmind-Rotate-Gesture3\"), \n\t\tarray(\"iconsmind-Scroll\" => \"iconsmind-Scroll\"), \n\t\tarray(\"iconsmind-Scroll-Fast\" => \"iconsmind-Scroll-Fast\"), \n\t\tarray(\"iconsmind-Spread\" => \"iconsmind-Spread\"), \n\t\tarray(\"iconsmind-Star-Track\" => \"iconsmind-Star-Track\"), \n\t\tarray(\"iconsmind-Tap\" => \"iconsmind-Tap\"), \n\t\tarray(\"iconsmind-Three-Fingers\" => \"iconsmind-Three-Fingers\"), \n\t\tarray(\"iconsmind-Three-FingersDrag\" => \"iconsmind-Three-FingersDrag\"), \n\t\tarray(\"iconsmind-Three-FingersDrag2\" => \"iconsmind-Three-FingersDrag2\"), \n\t\tarray(\"iconsmind-Three-FingersTouch\" => \"iconsmind-Three-FingersTouch\"), \n\t\tarray(\"iconsmind-Thumb\" => \"iconsmind-Thumb\"), \n\t\tarray(\"iconsmind-Two-Fingers\" => \"iconsmind-Two-Fingers\"), \n\t\tarray(\"iconsmind-Two-FingersDrag\" => \"iconsmind-Two-FingersDrag\"), \n\t\tarray(\"iconsmind-Two-FingersDrag2\" => \"iconsmind-Two-FingersDrag2\"), \n\t\tarray(\"iconsmind-Two-FingersScroll\" => \"iconsmind-Two-FingersScroll\"), \n\t\tarray(\"iconsmind-Two-FingersTouch\" => \"iconsmind-Two-FingersTouch\"), \n\t\tarray(\"iconsmind-Zoom-Gesture\" => \"iconsmind-Zoom-Gesture\"), \n\t\tarray(\"iconsmind-Alarm-Clock\" => \"iconsmind-Alarm-Clock\"), \n\t\tarray(\"iconsmind-Alarm-Clock2\" => \"iconsmind-Alarm-Clock2\"), \n\t\tarray(\"iconsmind-Calendar-Clock\" => \"iconsmind-Calendar-Clock\"), \n\t\tarray(\"iconsmind-Clock\" => \"iconsmind-Clock\"), \n\t\tarray(\"iconsmind-Clock-2\" => \"iconsmind-Clock-2\"), \n\t\tarray(\"iconsmind-Clock-3\" => \"iconsmind-Clock-3\"), \n\t\tarray(\"iconsmind-Clock-4\" => \"iconsmind-Clock-4\"), \n\t\tarray(\"iconsmind-Clock-Back\" => \"iconsmind-Clock-Back\"), \n\t\tarray(\"iconsmind-Clock-Forward\" => \"iconsmind-Clock-Forward\"), \n\t\tarray(\"iconsmind-Hour\" => \"iconsmind-Hour\"), \n\t\tarray(\"iconsmind-Old-Clock\" => \"iconsmind-Old-Clock\"), \n\t\tarray(\"iconsmind-Over-Time\" => \"iconsmind-Over-Time\"), \n\t\tarray(\"iconsmind-Over-Time2\" => \"iconsmind-Over-Time2\"), \n\t\tarray(\"iconsmind-Sand-watch\" => \"iconsmind-Sand-watch\"), \n\t\tarray(\"iconsmind-Sand-watch2\" => \"iconsmind-Sand-watch2\"), \n\t\tarray(\"iconsmind-Stopwatch\" => \"iconsmind-Stopwatch\"), \n\t\tarray(\"iconsmind-Stopwatch-2\" => \"iconsmind-Stopwatch-2\"), \n\t\tarray(\"iconsmind-Time-Backup\" => \"iconsmind-Time-Backup\"), \n\t\tarray(\"iconsmind-Time-Fire\" => \"iconsmind-Time-Fire\"), \n\t\tarray(\"iconsmind-Time-Machine\" => \"iconsmind-Time-Machine\"), \n\t\tarray(\"iconsmind-Timer\" => \"iconsmind-Timer\"), \n\t\tarray(\"iconsmind-Watch\" => \"iconsmind-Watch\"), \n\t\tarray(\"iconsmind-Watch-2\" => \"iconsmind-Watch-2\"), \n\t\tarray(\"iconsmind-Watch-3\" => \"iconsmind-Watch-3\"), \n\t\tarray(\"iconsmind-A-Z\" => \"iconsmind-A-Z\"), \n\t\tarray(\"iconsmind-Bold-Text\" => \"iconsmind-Bold-Text\"), \n\t\tarray(\"iconsmind-Bulleted-List\" => \"iconsmind-Bulleted-List\"), \n\t\tarray(\"iconsmind-Font-Color\" => \"iconsmind-Font-Color\"), \n\t\tarray(\"iconsmind-Font-Name\" => \"iconsmind-Font-Name\"), \n\t\tarray(\"iconsmind-Font-Size\" => \"iconsmind-Font-Size\"), \n\t\tarray(\"iconsmind-Font-Style\" => \"iconsmind-Font-Style\"), \n\t\tarray(\"iconsmind-Font-StyleSubscript\" => \"iconsmind-Font-StyleSubscript\"), \n\t\tarray(\"iconsmind-Font-StyleSuperscript\" => \"iconsmind-Font-StyleSuperscript\"), \n\t\tarray(\"iconsmind-Function\" => \"iconsmind-Function\"), \n\t\tarray(\"iconsmind-Italic-Text\" => \"iconsmind-Italic-Text\"), \n\t\tarray(\"iconsmind-Line-SpacingText\" => \"iconsmind-Line-SpacingText\"), \n\t\tarray(\"iconsmind-Lowercase-Text\" => \"iconsmind-Lowercase-Text\"), \n\t\tarray(\"iconsmind-Normal-Text\" => \"iconsmind-Normal-Text\"), \n\t\tarray(\"iconsmind-Numbering-List\" => \"iconsmind-Numbering-List\"), \n\t\tarray(\"iconsmind-Strikethrough-Text\" => \"iconsmind-Strikethrough-Text\"), \n\t\tarray(\"iconsmind-Sum\" => \"iconsmind-Sum\"), \n\t\tarray(\"iconsmind-Text-Box\" => \"iconsmind-Text-Box\"), \n\t\tarray(\"iconsmind-Text-Effect\" => \"iconsmind-Text-Effect\"), \n\t\tarray(\"iconsmind-Text-HighlightColor\" => \"iconsmind-Text-HighlightColor\"), \n\t\tarray(\"iconsmind-Text-Paragraph\" => \"iconsmind-Text-Paragraph\"), \n\t\tarray(\"iconsmind-Under-LineText\" => \"iconsmind-Under-LineText\"), \n\t\tarray(\"iconsmind-Uppercase-Text\" => \"iconsmind-Uppercase-Text\"), \n\t\tarray(\"iconsmind-Wrap-Text\" => \"iconsmind-Wrap-Text\"), \n\t\tarray(\"iconsmind-Z-A\" => \"iconsmind-Z-A\"), \n\t\tarray(\"iconsmind-Aerobics\" => \"iconsmind-Aerobics\"), \n\t\tarray(\"iconsmind-Aerobics-2\" => \"iconsmind-Aerobics-2\"), \n\t\tarray(\"iconsmind-Aerobics-3\" => \"iconsmind-Aerobics-3\"), \n\t\tarray(\"iconsmind-Archery\" => \"iconsmind-Archery\"), \n\t\tarray(\"iconsmind-Archery-2\" => \"iconsmind-Archery-2\"), \n\t\tarray(\"iconsmind-Ballet-Shoes\" => \"iconsmind-Ballet-Shoes\"), \n\t\tarray(\"iconsmind-Baseball\" => \"iconsmind-Baseball\"), \n\t\tarray(\"iconsmind-Basket-Ball\" => \"iconsmind-Basket-Ball\"), \n\t\tarray(\"iconsmind-Bodybuilding\" => \"iconsmind-Bodybuilding\"), \n\t\tarray(\"iconsmind-Bowling\" => \"iconsmind-Bowling\"), \n\t\tarray(\"iconsmind-Bowling-2\" => \"iconsmind-Bowling-2\"), \n\t\tarray(\"iconsmind-Box\" => \"iconsmind-Box\"), \n\t\tarray(\"iconsmind-Chess\" => \"iconsmind-Chess\"), \n\t\tarray(\"iconsmind-Cricket\" => \"iconsmind-Cricket\"), \n\t\tarray(\"iconsmind-Dumbbell\" => \"iconsmind-Dumbbell\"), \n\t\tarray(\"iconsmind-Football\" => \"iconsmind-Football\"), \n\t\tarray(\"iconsmind-Football-2\" => \"iconsmind-Football-2\"), \n\t\tarray(\"iconsmind-Footprint\" => \"iconsmind-Footprint\"), \n\t\tarray(\"iconsmind-Footprint-2\" => \"iconsmind-Footprint-2\"), \n\t\tarray(\"iconsmind-Goggles\" => \"iconsmind-Goggles\"), \n\t\tarray(\"iconsmind-Golf\" => \"iconsmind-Golf\"), \n\t\tarray(\"iconsmind-Golf-2\" => \"iconsmind-Golf-2\"), \n\t\tarray(\"iconsmind-Gymnastics\" => \"iconsmind-Gymnastics\"), \n\t\tarray(\"iconsmind-Hokey\" => \"iconsmind-Hokey\"), \n\t\tarray(\"iconsmind-Jump-Rope\" => \"iconsmind-Jump-Rope\"), \n\t\tarray(\"iconsmind-Life-Jacket\" => \"iconsmind-Life-Jacket\"), \n\t\tarray(\"iconsmind-Medal\" => \"iconsmind-Medal\"), \n\t\tarray(\"iconsmind-Medal-2\" => \"iconsmind-Medal-2\"), \n\t\tarray(\"iconsmind-Medal-3\" => \"iconsmind-Medal-3\"), \n\t\tarray(\"iconsmind-Parasailing\" => \"iconsmind-Parasailing\"), \n\t\tarray(\"iconsmind-Pilates\" => \"iconsmind-Pilates\"), \n\t\tarray(\"iconsmind-Pilates-2\" => \"iconsmind-Pilates-2\"), \n\t\tarray(\"iconsmind-Pilates-3\" => \"iconsmind-Pilates-3\"), \n\t\tarray(\"iconsmind-Ping-Pong\" => \"iconsmind-Ping-Pong\"), \n\t\tarray(\"iconsmind-Rafting\" => \"iconsmind-Rafting\"), \n\t\tarray(\"iconsmind-Running\" => \"iconsmind-Running\"), \n\t\tarray(\"iconsmind-Running-Shoes\" => \"iconsmind-Running-Shoes\"), \n\t\tarray(\"iconsmind-Skate-Shoes\" => \"iconsmind-Skate-Shoes\"), \n\t\tarray(\"iconsmind-Ski\" => \"iconsmind-Ski\"), \n\t\tarray(\"iconsmind-Skydiving\" => \"iconsmind-Skydiving\"), \n\t\tarray(\"iconsmind-Snorkel\" => \"iconsmind-Snorkel\"), \n\t\tarray(\"iconsmind-Soccer-Ball\" => \"iconsmind-Soccer-Ball\"), \n\t\tarray(\"iconsmind-Soccer-Shoes\" => \"iconsmind-Soccer-Shoes\"), \n\t\tarray(\"iconsmind-Swimming\" => \"iconsmind-Swimming\"), \n\t\tarray(\"iconsmind-Tennis\" => \"iconsmind-Tennis\"), \n\t\tarray(\"iconsmind-Tennis-Ball\" => \"iconsmind-Tennis-Ball\"), \n\t\tarray(\"iconsmind-Trekking\" => \"iconsmind-Trekking\"), \n\t\tarray(\"iconsmind-Trophy\" => \"iconsmind-Trophy\"), \n\t\tarray(\"iconsmind-Trophy-2\" => \"iconsmind-Trophy-2\"), \n\t\tarray(\"iconsmind-Volleyball\" => \"iconsmind-Volleyball\"), \n\t\tarray(\"iconsmind-weight-Lift\" => \"iconsmind-weight-Lift\"), \n\t\tarray(\"iconsmind-Speach-Bubble\" => \"iconsmind-Speach-Bubble\"), \n\t\tarray(\"iconsmind-Speach-Bubble2\" => \"iconsmind-Speach-Bubble2\"), \n\t\tarray(\"iconsmind-Speach-Bubble3\" => \"iconsmind-Speach-Bubble3\"), \n\t\tarray(\"iconsmind-Speach-Bubble4\" => \"iconsmind-Speach-Bubble4\"), \n\t\tarray(\"iconsmind-Speach-Bubble5\" => \"iconsmind-Speach-Bubble5\"), \n\t\tarray(\"iconsmind-Speach-Bubble6\" => \"iconsmind-Speach-Bubble6\"), \n\t\tarray(\"iconsmind-Speach-Bubble7\" => \"iconsmind-Speach-Bubble7\"), \n\t\tarray(\"iconsmind-Speach-Bubble8\" => \"iconsmind-Speach-Bubble8\"), \n\t\tarray(\"iconsmind-Speach-Bubble9\" => \"iconsmind-Speach-Bubble9\"), \n\t\tarray(\"iconsmind-Speach-Bubble10\" => \"iconsmind-Speach-Bubble10\"), \n\t\tarray(\"iconsmind-Speach-Bubble11\" => \"iconsmind-Speach-Bubble11\"), \n\t\tarray(\"iconsmind-Speach-Bubble12\" => \"iconsmind-Speach-Bubble12\"), \n\t\tarray(\"iconsmind-Speach-Bubble13\" => \"iconsmind-Speach-Bubble13\"), \n\t\tarray(\"iconsmind-Speach-BubbleAsking\" => \"iconsmind-Speach-BubbleAsking\"), \n\t\tarray(\"iconsmind-Speach-BubbleComic\" => \"iconsmind-Speach-BubbleComic\"), \n\t\tarray(\"iconsmind-Speach-BubbleComic2\" => \"iconsmind-Speach-BubbleComic2\"), \n\t\tarray(\"iconsmind-Speach-BubbleComic3\" => \"iconsmind-Speach-BubbleComic3\"), \n\t\tarray(\"iconsmind-Speach-BubbleComic4\" => \"iconsmind-Speach-BubbleComic4\"), \n\t\tarray(\"iconsmind-Speach-BubbleDialog\" => \"iconsmind-Speach-BubbleDialog\"), \n\t\tarray(\"iconsmind-Speach-Bubbles\" => \"iconsmind-Speach-Bubbles\"), \n\t\tarray(\"iconsmind-Aim\" => \"iconsmind-Aim\"), \n\t\tarray(\"iconsmind-Ask\" => \"iconsmind-Ask\"), \n\t\tarray(\"iconsmind-Bebo\" => \"iconsmind-Bebo\"), \n\t\tarray(\"iconsmind-Behance\" => \"iconsmind-Behance\"), \n\t\tarray(\"iconsmind-Betvibes\" => \"iconsmind-Betvibes\"), \n\t\tarray(\"iconsmind-Bing\" => \"iconsmind-Bing\"), \n\t\tarray(\"iconsmind-Blinklist\" => \"iconsmind-Blinklist\"), \n\t\tarray(\"iconsmind-Blogger\" => \"iconsmind-Blogger\"), \n\t\tarray(\"iconsmind-Brightkite\" => \"iconsmind-Brightkite\"), \n\t\tarray(\"iconsmind-Delicious\" => \"iconsmind-Delicious\"), \n\t\tarray(\"iconsmind-Deviantart\" => \"iconsmind-Deviantart\"), \n\t\tarray(\"iconsmind-Digg\" => \"iconsmind-Digg\"), \n\t\tarray(\"iconsmind-Diigo\" => \"iconsmind-Diigo\"), \n\t\tarray(\"iconsmind-Doplr\" => \"iconsmind-Doplr\"), \n\t\tarray(\"iconsmind-Dribble\" => \"iconsmind-Dribble\"), \n\t\tarray(\"iconsmind-Email\" => \"iconsmind-Email\"), \n\t\tarray(\"iconsmind-Evernote\" => \"iconsmind-Evernote\"), \n\t\tarray(\"iconsmind-Facebook\" => \"iconsmind-Facebook\"), \n\t\tarray(\"iconsmind-Facebook-2\" => \"iconsmind-Facebook-2\"), \n\t\tarray(\"iconsmind-Feedburner\" => \"iconsmind-Feedburner\"), \n\t\tarray(\"iconsmind-Flickr\" => \"iconsmind-Flickr\"), \n\t\tarray(\"iconsmind-Formspring\" => \"iconsmind-Formspring\"), \n\t\tarray(\"iconsmind-Forsquare\" => \"iconsmind-Forsquare\"), \n\t\tarray(\"iconsmind-Friendfeed\" => \"iconsmind-Friendfeed\"), \n\t\tarray(\"iconsmind-Friendster\" => \"iconsmind-Friendster\"), \n\t\tarray(\"iconsmind-Furl\" => \"iconsmind-Furl\"), \n\t\tarray(\"iconsmind-Google\" => \"iconsmind-Google\"), \n\t\tarray(\"iconsmind-Google-Buzz\" => \"iconsmind-Google-Buzz\"), \n\t\tarray(\"iconsmind-Google-Plus\" => \"iconsmind-Google-Plus\"), \n\t\tarray(\"iconsmind-Gowalla\" => \"iconsmind-Gowalla\"), \n\t\tarray(\"iconsmind-ICQ\" => \"iconsmind-ICQ\"), \n\t\tarray(\"iconsmind-ImDB\" => \"iconsmind-ImDB\"), \n\t\tarray(\"iconsmind-Instagram\" => \"iconsmind-Instagram\"), \n\t\tarray(\"iconsmind-Last-FM\" => \"iconsmind-Last-FM\"), \n\t\tarray(\"iconsmind-Like\" => \"iconsmind-Like\"), \n\t\tarray(\"iconsmind-Like-2\" => \"iconsmind-Like-2\"), \n\t\tarray(\"iconsmind-Linkedin\" => \"iconsmind-Linkedin\"), \n\t\tarray(\"iconsmind-Linkedin-2\" => \"iconsmind-Linkedin-2\"), \n\t\tarray(\"iconsmind-Livejournal\" => \"iconsmind-Livejournal\"), \n\t\tarray(\"iconsmind-Metacafe\" => \"iconsmind-Metacafe\"), \n\t\tarray(\"iconsmind-Mixx\" => \"iconsmind-Mixx\"), \n\t\tarray(\"iconsmind-Myspace\" => \"iconsmind-Myspace\"), \n\t\tarray(\"iconsmind-Newsvine\" => \"iconsmind-Newsvine\"), \n\t\tarray(\"iconsmind-Orkut\" => \"iconsmind-Orkut\"), \n\t\tarray(\"iconsmind-Picasa\" => \"iconsmind-Picasa\"), \n\t\tarray(\"iconsmind-Pinterest\" => \"iconsmind-Pinterest\"), \n\t\tarray(\"iconsmind-Plaxo\" => \"iconsmind-Plaxo\"), \n\t\tarray(\"iconsmind-Plurk\" => \"iconsmind-Plurk\"), \n\t\tarray(\"iconsmind-Posterous\" => \"iconsmind-Posterous\"), \n\t\tarray(\"iconsmind-QIK\" => \"iconsmind-QIK\"), \n\t\tarray(\"iconsmind-Reddit\" => \"iconsmind-Reddit\"), \n\t\tarray(\"iconsmind-Reverbnation\" => \"iconsmind-Reverbnation\"), \n\t\tarray(\"iconsmind-RSS\" => \"iconsmind-RSS\"), \n\t\tarray(\"iconsmind-Sharethis\" => \"iconsmind-Sharethis\"), \n\t\tarray(\"iconsmind-Shoutwire\" => \"iconsmind-Shoutwire\"), \n\t\tarray(\"iconsmind-Skype\" => \"iconsmind-Skype\"), \n\t\tarray(\"iconsmind-Soundcloud\" => \"iconsmind-Soundcloud\"), \n\t\tarray(\"iconsmind-Spurl\" => \"iconsmind-Spurl\"), \n\t\tarray(\"iconsmind-Stumbleupon\" => \"iconsmind-Stumbleupon\"), \n\t\tarray(\"iconsmind-Technorati\" => \"iconsmind-Technorati\"), \n\t\tarray(\"iconsmind-Tumblr\" => \"iconsmind-Tumblr\"), \n\t\tarray(\"iconsmind-Twitter\" => \"iconsmind-Twitter\"), \n\t\tarray(\"iconsmind-Twitter-2\" => \"iconsmind-Twitter-2\"), \n\t\tarray(\"iconsmind-Unlike\" => \"iconsmind-Unlike\"), \n\t\tarray(\"iconsmind-Unlike-2\" => \"iconsmind-Unlike-2\"), \n\t\tarray(\"iconsmind-Ustream\" => \"iconsmind-Ustream\"), \n\t\tarray(\"iconsmind-Viddler\" => \"iconsmind-Viddler\"), \n\t\tarray(\"iconsmind-Vimeo\" => \"iconsmind-Vimeo\"), \n\t\tarray(\"iconsmind-Wordpress\" => \"iconsmind-Wordpress\"), \n\t\tarray(\"iconsmind-Xanga\" => \"iconsmind-Xanga\"), \n\t\tarray(\"iconsmind-Xing\" => \"iconsmind-Xing\"), \n\t\tarray(\"iconsmind-Yahoo\" => \"iconsmind-Yahoo\"), \n\t\tarray(\"iconsmind-Yahoo-Buzz\" => \"iconsmind-Yahoo-Buzz\"), \n\t\tarray(\"iconsmind-Yelp\" => \"iconsmind-Yelp\"), \n\t\tarray(\"iconsmind-Youtube\" => \"iconsmind-Youtube\"), \n\t\tarray(\"iconsmind-Zootool\" => \"iconsmind-Zootool\"), \n\t\tarray(\"iconsmind-Bisexual\" => \"iconsmind-Bisexual\"), \n\t\tarray(\"iconsmind-Cancer2\" => \"iconsmind-Cancer2\"), \n\t\tarray(\"iconsmind-Couple-Sign\" => \"iconsmind-Couple-Sign\"), \n\t\tarray(\"iconsmind-David-Star\" => \"iconsmind-David-Star\"), \n\t\tarray(\"iconsmind-Family-Sign\" => \"iconsmind-Family-Sign\"), \n\t\tarray(\"iconsmind-Female-2\" => \"iconsmind-Female-2\"), \n\t\tarray(\"iconsmind-Gey\" => \"iconsmind-Gey\"), \n\t\tarray(\"iconsmind-Heart\" => \"iconsmind-Heart\"), \n\t\tarray(\"iconsmind-Homosexual\" => \"iconsmind-Homosexual\"), \n\t\tarray(\"iconsmind-Inifity\" => \"iconsmind-Inifity\"), \n\t\tarray(\"iconsmind-Lesbian\" => \"iconsmind-Lesbian\"), \n\t\tarray(\"iconsmind-Lesbians\" => \"iconsmind-Lesbians\"), \n\t\tarray(\"iconsmind-Love\" => \"iconsmind-Love\"), \n\t\tarray(\"iconsmind-Male-2\" => \"iconsmind-Male-2\"), \n\t\tarray(\"iconsmind-Men\" => \"iconsmind-Men\"), \n\t\tarray(\"iconsmind-No-Smoking\" => \"iconsmind-No-Smoking\"), \n\t\tarray(\"iconsmind-Paw\" => \"iconsmind-Paw\"), \n\t\tarray(\"iconsmind-Quotes\" => \"iconsmind-Quotes\"), \n\t\tarray(\"iconsmind-Quotes-2\" => \"iconsmind-Quotes-2\"), \n\t\tarray(\"iconsmind-Redirect\" => \"iconsmind-Redirect\"), \n\t\tarray(\"iconsmind-Retweet\" => \"iconsmind-Retweet\"), \n\t\tarray(\"iconsmind-Ribbon\" => \"iconsmind-Ribbon\"), \n\t\tarray(\"iconsmind-Ribbon-2\" => \"iconsmind-Ribbon-2\"), \n\t\tarray(\"iconsmind-Ribbon-3\" => \"iconsmind-Ribbon-3\"), \n\t\tarray(\"iconsmind-Sexual\" => \"iconsmind-Sexual\"), \n\t\tarray(\"iconsmind-Smoking-Area\" => \"iconsmind-Smoking-Area\"), \n\t\tarray(\"iconsmind-Trace\" => \"iconsmind-Trace\"), \n\t\tarray(\"iconsmind-Venn-Diagram\" => \"iconsmind-Venn-Diagram\"), \n\t\tarray(\"iconsmind-Wheelchair\" => \"iconsmind-Wheelchair\"), \n\t\tarray(\"iconsmind-Women\" => \"iconsmind-Women\"), \n\t\tarray(\"iconsmind-Ying-Yang\" => \"iconsmind-Ying-Yang\"), \n\t\tarray(\"iconsmind-Add-Bag\" => \"iconsmind-Add-Bag\"), \n\t\tarray(\"iconsmind-Add-Basket\" => \"iconsmind-Add-Basket\"), \n\t\tarray(\"iconsmind-Add-Cart\" => \"iconsmind-Add-Cart\"), \n\t\tarray(\"iconsmind-Bag-Coins\" => \"iconsmind-Bag-Coins\"), \n\t\tarray(\"iconsmind-Bag-Items\" => \"iconsmind-Bag-Items\"), \n\t\tarray(\"iconsmind-Bag-Quantity\" => \"iconsmind-Bag-Quantity\"), \n\t\tarray(\"iconsmind-Bar-Code\" => \"iconsmind-Bar-Code\"), \n\t\tarray(\"iconsmind-Basket-Coins\" => \"iconsmind-Basket-Coins\"), \n\t\tarray(\"iconsmind-Basket-Items\" => \"iconsmind-Basket-Items\"), \n\t\tarray(\"iconsmind-Basket-Quantity\" => \"iconsmind-Basket-Quantity\"), \n\t\tarray(\"iconsmind-Bitcoin\" => \"iconsmind-Bitcoin\"), \n\t\tarray(\"iconsmind-Car-Coins\" => \"iconsmind-Car-Coins\"), \n\t\tarray(\"iconsmind-Car-Items\" => \"iconsmind-Car-Items\"), \n\t\tarray(\"iconsmind-CartQuantity\" => \"iconsmind-CartQuantity\"), \n\t\tarray(\"iconsmind-Cash-Register\" => \"iconsmind-Cash-Register\"), \n\t\tarray(\"iconsmind-Cash-register2\" => \"iconsmind-Cash-register2\"), \n\t\tarray(\"iconsmind-Checkout\" => \"iconsmind-Checkout\"), \n\t\tarray(\"iconsmind-Checkout-Bag\" => \"iconsmind-Checkout-Bag\"), \n\t\tarray(\"iconsmind-Checkout-Basket\" => \"iconsmind-Checkout-Basket\"), \n\t\tarray(\"iconsmind-Full-Basket\" => \"iconsmind-Full-Basket\"), \n\t\tarray(\"iconsmind-Full-Cart\" => \"iconsmind-Full-Cart\"), \n\t\tarray(\"iconsmind-Fyll-Bag\" => \"iconsmind-Fyll-Bag\"), \n\t\tarray(\"iconsmind-Home\" => \"iconsmind-Home\"), \n\t\tarray(\"iconsmind-Password-2shopping\" => \"iconsmind-Password-2shopping\"), \n\t\tarray(\"iconsmind-Password-shopping\" => \"iconsmind-Password-shopping\"), \n\t\tarray(\"iconsmind-QR-Code\" => \"iconsmind-QR-Code\"), \n\t\tarray(\"iconsmind-Receipt\" => \"iconsmind-Receipt\"), \n\t\tarray(\"iconsmind-Receipt-2\" => \"iconsmind-Receipt-2\"), \n\t\tarray(\"iconsmind-Receipt-3\" => \"iconsmind-Receipt-3\"), \n\t\tarray(\"iconsmind-Receipt-4\" => \"iconsmind-Receipt-4\"), \n\t\tarray(\"iconsmind-Remove-Bag\" => \"iconsmind-Remove-Bag\"), \n\t\tarray(\"iconsmind-Remove-Basket\" => \"iconsmind-Remove-Basket\"), \n\t\tarray(\"iconsmind-Remove-Cart\" => \"iconsmind-Remove-Cart\"), \n\t\tarray(\"iconsmind-Shop\" => \"iconsmind-Shop\"), \n\t\tarray(\"iconsmind-Shop-2\" => \"iconsmind-Shop-2\"), \n\t\tarray(\"iconsmind-Shop-3\" => \"iconsmind-Shop-3\"), \n\t\tarray(\"iconsmind-Shop-4\" => \"iconsmind-Shop-4\"), \n\t\tarray(\"iconsmind-Shopping-Bag\" => \"iconsmind-Shopping-Bag\"), \n\t\tarray(\"iconsmind-Shopping-Basket\" => \"iconsmind-Shopping-Basket\"), \n\t\tarray(\"iconsmind-Shopping-Cart\" => \"iconsmind-Shopping-Cart\"), \n\t\tarray(\"iconsmind-Tag-2\" => \"iconsmind-Tag-2\"), \n\t\tarray(\"iconsmind-Tag-3\" => \"iconsmind-Tag-3\"), \n\t\tarray(\"iconsmind-Tag-4\" => \"iconsmind-Tag-4\"), \n\t\tarray(\"iconsmind-Tag-5\" => \"iconsmind-Tag-5\"), \n\t\tarray(\"iconsmind-This-SideUp\" => \"iconsmind-This-SideUp\"), \n\t\tarray(\"iconsmind-Broke-Link2\" => \"iconsmind-Broke-Link2\"), \n\t\tarray(\"iconsmind-Coding\" => \"iconsmind-Coding\"), \n\t\tarray(\"iconsmind-Consulting\" => \"iconsmind-Consulting\"), \n\t\tarray(\"iconsmind-Copyright\" => \"iconsmind-Copyright\"), \n\t\tarray(\"iconsmind-Idea-2\" => \"iconsmind-Idea-2\"), \n\t\tarray(\"iconsmind-Idea-3\" => \"iconsmind-Idea-3\"), \n\t\tarray(\"iconsmind-Idea-4\" => \"iconsmind-Idea-4\"), \n\t\tarray(\"iconsmind-Idea-5\" => \"iconsmind-Idea-5\"), \n\t\tarray(\"iconsmind-Internet\" => \"iconsmind-Internet\"), \n\t\tarray(\"iconsmind-Internet-2\" => \"iconsmind-Internet-2\"), \n\t\tarray(\"iconsmind-Link-2\" => \"iconsmind-Link-2\"), \n\t\tarray(\"iconsmind-Management\" => \"iconsmind-Management\"), \n\t\tarray(\"iconsmind-Monitor-Analytics\" => \"iconsmind-Monitor-Analytics\"), \n\t\tarray(\"iconsmind-Monitoring\" => \"iconsmind-Monitoring\"), \n\t\tarray(\"iconsmind-Optimization\" => \"iconsmind-Optimization\"), \n\t\tarray(\"iconsmind-Search-People\" => \"iconsmind-Search-People\"), \n\t\tarray(\"iconsmind-Tag\" => \"iconsmind-Tag\"), \n\t\tarray(\"iconsmind-Target\" => \"iconsmind-Target\"), \n\t\tarray(\"iconsmind-Target-Market\" => \"iconsmind-Target-Market\"), \n\t\tarray(\"iconsmind-Testimonal\" => \"iconsmind-Testimonal\"), \n\t\tarray(\"iconsmind-Computer-Secure\" => \"iconsmind-Computer-Secure\"), \n\t\tarray(\"iconsmind-Eye-Scan\" => \"iconsmind-Eye-Scan\"), \n\t\tarray(\"iconsmind-Finger-Print\" => \"iconsmind-Finger-Print\"), \n\t\tarray(\"iconsmind-Firewall\" => \"iconsmind-Firewall\"), \n\t\tarray(\"iconsmind-Key-Lock\" => \"iconsmind-Key-Lock\"), \n\t\tarray(\"iconsmind-Laptop-Secure\" => \"iconsmind-Laptop-Secure\"), \n\t\tarray(\"iconsmind-Layer-1532\" => \"iconsmind-Layer-1532\"), \n\t\tarray(\"iconsmind-Lock\" => \"iconsmind-Lock\"), \n\t\tarray(\"iconsmind-Lock-2\" => \"iconsmind-Lock-2\"), \n\t\tarray(\"iconsmind-Lock-3\" => \"iconsmind-Lock-3\"), \n\t\tarray(\"iconsmind-Password\" => \"iconsmind-Password\"), \n\t\tarray(\"iconsmind-Password-Field\" => \"iconsmind-Password-Field\"), \n\t\tarray(\"iconsmind-Police\" => \"iconsmind-Police\"), \n\t\tarray(\"iconsmind-Safe-Box\" => \"iconsmind-Safe-Box\"), \n\t\tarray(\"iconsmind-Security-Block\" => \"iconsmind-Security-Block\"), \n\t\tarray(\"iconsmind-Security-Bug\" => \"iconsmind-Security-Bug\"), \n\t\tarray(\"iconsmind-Security-Camera\" => \"iconsmind-Security-Camera\"), \n\t\tarray(\"iconsmind-Security-Check\" => \"iconsmind-Security-Check\"), \n\t\tarray(\"iconsmind-Security-Settings\" => \"iconsmind-Security-Settings\"), \n\t\tarray(\"iconsmind-Securiy-Remove\" => \"iconsmind-Securiy-Remove\"), \n\t\tarray(\"iconsmind-Shield\" => \"iconsmind-Shield\"), \n\t\tarray(\"iconsmind-Smartphone-Secure\" => \"iconsmind-Smartphone-Secure\"), \n\t\tarray(\"iconsmind-SSL\" => \"iconsmind-SSL\"), \n\t\tarray(\"iconsmind-Tablet-Secure\" => \"iconsmind-Tablet-Secure\"), \n\t\tarray(\"iconsmind-Type-Pass\" => \"iconsmind-Type-Pass\"), \n\t\tarray(\"iconsmind-Unlock\" => \"iconsmind-Unlock\"), \n\t\tarray(\"iconsmind-Unlock-2\" => \"iconsmind-Unlock-2\"), \n\t\tarray(\"iconsmind-Unlock-3\" => \"iconsmind-Unlock-3\"), \n\t\tarray(\"iconsmind-Ambulance\" => \"iconsmind-Ambulance\"), \n\t\tarray(\"iconsmind-Astronaut\" => \"iconsmind-Astronaut\"), \n\t\tarray(\"iconsmind-Atom\" => \"iconsmind-Atom\"), \n\t\tarray(\"iconsmind-Bacteria\" => \"iconsmind-Bacteria\"), \n\t\tarray(\"iconsmind-Band-Aid\" => \"iconsmind-Band-Aid\"), \n\t\tarray(\"iconsmind-Bio-Hazard\" => \"iconsmind-Bio-Hazard\"), \n\t\tarray(\"iconsmind-Biotech\" => \"iconsmind-Biotech\"), \n\t\tarray(\"iconsmind-Brain\" => \"iconsmind-Brain\"), \n\t\tarray(\"iconsmind-Chemical\" => \"iconsmind-Chemical\"), \n\t\tarray(\"iconsmind-Chemical-2\" => \"iconsmind-Chemical-2\"), \n\t\tarray(\"iconsmind-Chemical-3\" => \"iconsmind-Chemical-3\"), \n\t\tarray(\"iconsmind-Chemical-4\" => \"iconsmind-Chemical-4\"), \n\t\tarray(\"iconsmind-Chemical-5\" => \"iconsmind-Chemical-5\"), \n\t\tarray(\"iconsmind-Clinic\" => \"iconsmind-Clinic\"), \n\t\tarray(\"iconsmind-Cube-Molecule\" => \"iconsmind-Cube-Molecule\"), \n\t\tarray(\"iconsmind-Cube-Molecule2\" => \"iconsmind-Cube-Molecule2\"), \n\t\tarray(\"iconsmind-Danger\" => \"iconsmind-Danger\"), \n\t\tarray(\"iconsmind-Danger-2\" => \"iconsmind-Danger-2\"), \n\t\tarray(\"iconsmind-DNA\" => \"iconsmind-DNA\"), \n\t\tarray(\"iconsmind-DNA-2\" => \"iconsmind-DNA-2\"), \n\t\tarray(\"iconsmind-DNA-Helix\" => \"iconsmind-DNA-Helix\"), \n\t\tarray(\"iconsmind-First-Aid\" => \"iconsmind-First-Aid\"), \n\t\tarray(\"iconsmind-Flask\" => \"iconsmind-Flask\"), \n\t\tarray(\"iconsmind-Flask-2\" => \"iconsmind-Flask-2\"), \n\t\tarray(\"iconsmind-Helix-2\" => \"iconsmind-Helix-2\"), \n\t\tarray(\"iconsmind-Hospital\" => \"iconsmind-Hospital\"), \n\t\tarray(\"iconsmind-Hurt\" => \"iconsmind-Hurt\"), \n\t\tarray(\"iconsmind-Medical-Sign\" => \"iconsmind-Medical-Sign\"), \n\t\tarray(\"iconsmind-Medicine\" => \"iconsmind-Medicine\"), \n\t\tarray(\"iconsmind-Medicine-2\" => \"iconsmind-Medicine-2\"), \n\t\tarray(\"iconsmind-Medicine-3\" => \"iconsmind-Medicine-3\"), \n\t\tarray(\"iconsmind-Microscope\" => \"iconsmind-Microscope\"), \n\t\tarray(\"iconsmind-Neutron\" => \"iconsmind-Neutron\"), \n\t\tarray(\"iconsmind-Nuclear\" => \"iconsmind-Nuclear\"), \n\t\tarray(\"iconsmind-Physics\" => \"iconsmind-Physics\"), \n\t\tarray(\"iconsmind-Plasmid\" => \"iconsmind-Plasmid\"), \n\t\tarray(\"iconsmind-Plaster\" => \"iconsmind-Plaster\"), \n\t\tarray(\"iconsmind-Pulse\" => \"iconsmind-Pulse\"), \n\t\tarray(\"iconsmind-Radioactive\" => \"iconsmind-Radioactive\"), \n\t\tarray(\"iconsmind-Safety-PinClose\" => \"iconsmind-Safety-PinClose\"), \n\t\tarray(\"iconsmind-Safety-PinOpen\" => \"iconsmind-Safety-PinOpen\"), \n\t\tarray(\"iconsmind-Spermium\" => \"iconsmind-Spermium\"), \n\t\tarray(\"iconsmind-Stethoscope\" => \"iconsmind-Stethoscope\"), \n\t\tarray(\"iconsmind-Temperature2\" => \"iconsmind-Temperature2\"), \n\t\tarray(\"iconsmind-Test-Tube\" => \"iconsmind-Test-Tube\"), \n\t\tarray(\"iconsmind-Test-Tube2\" => \"iconsmind-Test-Tube2\"), \n\t\tarray(\"iconsmind-Virus\" => \"iconsmind-Virus\"), \n\t\tarray(\"iconsmind-Virus-2\" => \"iconsmind-Virus-2\"), \n\t\tarray(\"iconsmind-Virus-3\" => \"iconsmind-Virus-3\"), \n\t\tarray(\"iconsmind-X-ray\" => \"iconsmind-X-ray\"), \n\t\tarray(\"iconsmind-Auto-Flash\" => \"iconsmind-Auto-Flash\"), \n\t\tarray(\"iconsmind-Camera\" => \"iconsmind-Camera\"), \n\t\tarray(\"iconsmind-Camera-2\" => \"iconsmind-Camera-2\"), \n\t\tarray(\"iconsmind-Camera-3\" => \"iconsmind-Camera-3\"), \n\t\tarray(\"iconsmind-Camera-4\" => \"iconsmind-Camera-4\"), \n\t\tarray(\"iconsmind-Camera-5\" => \"iconsmind-Camera-5\"), \n\t\tarray(\"iconsmind-Camera-Back\" => \"iconsmind-Camera-Back\"), \n\t\tarray(\"iconsmind-Crop\" => \"iconsmind-Crop\"), \n\t\tarray(\"iconsmind-Daylight\" => \"iconsmind-Daylight\"), \n\t\tarray(\"iconsmind-Edit\" => \"iconsmind-Edit\"), \n\t\tarray(\"iconsmind-Eye\" => \"iconsmind-Eye\"), \n\t\tarray(\"iconsmind-Film2\" => \"iconsmind-Film2\"), \n\t\tarray(\"iconsmind-Film-Cartridge\" => \"iconsmind-Film-Cartridge\"), \n\t\tarray(\"iconsmind-Filter\" => \"iconsmind-Filter\"), \n\t\tarray(\"iconsmind-Flash\" => \"iconsmind-Flash\"), \n\t\tarray(\"iconsmind-Flash-2\" => \"iconsmind-Flash-2\"), \n\t\tarray(\"iconsmind-Fluorescent\" => \"iconsmind-Fluorescent\"), \n\t\tarray(\"iconsmind-Gopro\" => \"iconsmind-Gopro\"), \n\t\tarray(\"iconsmind-Landscape\" => \"iconsmind-Landscape\"), \n\t\tarray(\"iconsmind-Len\" => \"iconsmind-Len\"), \n\t\tarray(\"iconsmind-Len-2\" => \"iconsmind-Len-2\"), \n\t\tarray(\"iconsmind-Len-3\" => \"iconsmind-Len-3\"), \n\t\tarray(\"iconsmind-Macro\" => \"iconsmind-Macro\"), \n\t\tarray(\"iconsmind-Memory-Card\" => \"iconsmind-Memory-Card\"), \n\t\tarray(\"iconsmind-Memory-Card2\" => \"iconsmind-Memory-Card2\"), \n\t\tarray(\"iconsmind-Memory-Card3\" => \"iconsmind-Memory-Card3\"), \n\t\tarray(\"iconsmind-No-Flash\" => \"iconsmind-No-Flash\"), \n\t\tarray(\"iconsmind-Panorama\" => \"iconsmind-Panorama\"), \n\t\tarray(\"iconsmind-Photo\" => \"iconsmind-Photo\"), \n\t\tarray(\"iconsmind-Photo-2\" => \"iconsmind-Photo-2\"), \n\t\tarray(\"iconsmind-Photo-3\" => \"iconsmind-Photo-3\"), \n\t\tarray(\"iconsmind-Photo-Album\" => \"iconsmind-Photo-Album\"), \n\t\tarray(\"iconsmind-Photo-Album2\" => \"iconsmind-Photo-Album2\"), \n\t\tarray(\"iconsmind-Photo-Album3\" => \"iconsmind-Photo-Album3\"), \n\t\tarray(\"iconsmind-Photos\" => \"iconsmind-Photos\"), \n\t\tarray(\"iconsmind-Portrait\" => \"iconsmind-Portrait\"), \n\t\tarray(\"iconsmind-Retouching\" => \"iconsmind-Retouching\"), \n\t\tarray(\"iconsmind-Retro-Camera\" => \"iconsmind-Retro-Camera\"), \n\t\tarray(\"iconsmind-secound\" => \"iconsmind-secound\"), \n\t\tarray(\"iconsmind-secound2\" => \"iconsmind-secound2\"), \n\t\tarray(\"iconsmind-Selfie\" => \"iconsmind-Selfie\"), \n\t\tarray(\"iconsmind-Shutter\" => \"iconsmind-Shutter\"), \n\t\tarray(\"iconsmind-Signal\" => \"iconsmind-Signal\"), \n\t\tarray(\"iconsmind-Snow2\" => \"iconsmind-Snow2\"), \n\t\tarray(\"iconsmind-Sport-Mode\" => \"iconsmind-Sport-Mode\"), \n\t\tarray(\"iconsmind-Studio-Flash\" => \"iconsmind-Studio-Flash\"), \n\t\tarray(\"iconsmind-Studio-Lightbox\" => \"iconsmind-Studio-Lightbox\"), \n\t\tarray(\"iconsmind-Timer2\" => \"iconsmind-Timer2\"), \n\t\tarray(\"iconsmind-Tripod-2\" => \"iconsmind-Tripod-2\"), \n\t\tarray(\"iconsmind-Tripod-withCamera\" => \"iconsmind-Tripod-withCamera\"), \n\t\tarray(\"iconsmind-Tripod-withGopro\" => \"iconsmind-Tripod-withGopro\"), \n\t\tarray(\"iconsmind-Add-User\" => \"iconsmind-Add-User\"), \n\t\tarray(\"iconsmind-Add-UserStar\" => \"iconsmind-Add-UserStar\"), \n\t\tarray(\"iconsmind-Administrator\" => \"iconsmind-Administrator\"), \n\t\tarray(\"iconsmind-Alien\" => \"iconsmind-Alien\"), \n\t\tarray(\"iconsmind-Alien-2\" => \"iconsmind-Alien-2\"), \n\t\tarray(\"iconsmind-Assistant\" => \"iconsmind-Assistant\"), \n\t\tarray(\"iconsmind-Baby\" => \"iconsmind-Baby\"), \n\t\tarray(\"iconsmind-Baby-Cry\" => \"iconsmind-Baby-Cry\"), \n\t\tarray(\"iconsmind-Boy\" => \"iconsmind-Boy\"), \n\t\tarray(\"iconsmind-Business-Man\" => \"iconsmind-Business-Man\"), \n\t\tarray(\"iconsmind-Business-ManWoman\" => \"iconsmind-Business-ManWoman\"), \n\t\tarray(\"iconsmind-Business-Mens\" => \"iconsmind-Business-Mens\"), \n\t\tarray(\"iconsmind-Business-Woman\" => \"iconsmind-Business-Woman\"), \n\t\tarray(\"iconsmind-Checked-User\" => \"iconsmind-Checked-User\"), \n\t\tarray(\"iconsmind-Chef\" => \"iconsmind-Chef\"), \n\t\tarray(\"iconsmind-Conference\" => \"iconsmind-Conference\"), \n\t\tarray(\"iconsmind-Cool-Guy\" => \"iconsmind-Cool-Guy\"), \n\t\tarray(\"iconsmind-Criminal\" => \"iconsmind-Criminal\"), \n\t\tarray(\"iconsmind-Dj\" => \"iconsmind-Dj\"), \n\t\tarray(\"iconsmind-Doctor\" => \"iconsmind-Doctor\"), \n\t\tarray(\"iconsmind-Engineering\" => \"iconsmind-Engineering\"), \n\t\tarray(\"iconsmind-Farmer\" => \"iconsmind-Farmer\"), \n\t\tarray(\"iconsmind-Female\" => \"iconsmind-Female\"), \n\t\tarray(\"iconsmind-Female-22\" => \"iconsmind-Female-22\"), \n\t\tarray(\"iconsmind-Find-User\" => \"iconsmind-Find-User\"), \n\t\tarray(\"iconsmind-Geek\" => \"iconsmind-Geek\"), \n\t\tarray(\"iconsmind-Genius\" => \"iconsmind-Genius\"), \n\t\tarray(\"iconsmind-Girl\" => \"iconsmind-Girl\"), \n\t\tarray(\"iconsmind-Headphone\" => \"iconsmind-Headphone\"), \n\t\tarray(\"iconsmind-Headset\" => \"iconsmind-Headset\"), \n\t\tarray(\"iconsmind-ID-2\" => \"iconsmind-ID-2\"), \n\t\tarray(\"iconsmind-ID-3\" => \"iconsmind-ID-3\"), \n\t\tarray(\"iconsmind-ID-Card\" => \"iconsmind-ID-Card\"), \n\t\tarray(\"iconsmind-King-2\" => \"iconsmind-King-2\"), \n\t\tarray(\"iconsmind-Lock-User\" => \"iconsmind-Lock-User\"), \n\t\tarray(\"iconsmind-Love-User\" => \"iconsmind-Love-User\"), \n\t\tarray(\"iconsmind-Male\" => \"iconsmind-Male\"), \n\t\tarray(\"iconsmind-Male-22\" => \"iconsmind-Male-22\"), \n\t\tarray(\"iconsmind-MaleFemale\" => \"iconsmind-MaleFemale\"), \n\t\tarray(\"iconsmind-Man-Sign\" => \"iconsmind-Man-Sign\"), \n\t\tarray(\"iconsmind-Mens\" => \"iconsmind-Mens\"), \n\t\tarray(\"iconsmind-Network\" => \"iconsmind-Network\"), \n\t\tarray(\"iconsmind-Nurse\" => \"iconsmind-Nurse\"), \n\t\tarray(\"iconsmind-Pac-Man\" => \"iconsmind-Pac-Man\"), \n\t\tarray(\"iconsmind-Pilot\" => \"iconsmind-Pilot\"), \n\t\tarray(\"iconsmind-Police-Man\" => \"iconsmind-Police-Man\"), \n\t\tarray(\"iconsmind-Police-Woman\" => \"iconsmind-Police-Woman\"), \n\t\tarray(\"iconsmind-Professor\" => \"iconsmind-Professor\"), \n\t\tarray(\"iconsmind-Punker\" => \"iconsmind-Punker\"), \n\t\tarray(\"iconsmind-Queen-2\" => \"iconsmind-Queen-2\"), \n\t\tarray(\"iconsmind-Remove-User\" => \"iconsmind-Remove-User\"), \n\t\tarray(\"iconsmind-Robot\" => \"iconsmind-Robot\"), \n\t\tarray(\"iconsmind-Speak\" => \"iconsmind-Speak\"), \n\t\tarray(\"iconsmind-Speak-2\" => \"iconsmind-Speak-2\"), \n\t\tarray(\"iconsmind-Spy\" => \"iconsmind-Spy\"), \n\t\tarray(\"iconsmind-Student-Female\" => \"iconsmind-Student-Female\"), \n\t\tarray(\"iconsmind-Student-Male\" => \"iconsmind-Student-Male\"), \n\t\tarray(\"iconsmind-Student-MaleFemale\" => \"iconsmind-Student-MaleFemale\"), \n\t\tarray(\"iconsmind-Students\" => \"iconsmind-Students\"), \n\t\tarray(\"iconsmind-Superman\" => \"iconsmind-Superman\"), \n\t\tarray(\"iconsmind-Talk-Man\" => \"iconsmind-Talk-Man\"), \n\t\tarray(\"iconsmind-Teacher\" => \"iconsmind-Teacher\"), \n\t\tarray(\"iconsmind-Waiter\" => \"iconsmind-Waiter\"), \n\t\tarray(\"iconsmind-WomanMan\" => \"iconsmind-WomanMan\"), \n\t\tarray(\"iconsmind-Woman-Sign\" => \"iconsmind-Woman-Sign\"), \n\t\tarray(\"iconsmind-Wonder-Woman\" => \"iconsmind-Wonder-Woman\"), \n\t\tarray(\"iconsmind-Worker\" => \"iconsmind-Worker\"), \n\t\tarray(\"iconsmind-Anchor\" => \"iconsmind-Anchor\"), \n\t\tarray(\"iconsmind-Army-Key\" => \"iconsmind-Army-Key\"), \n\t\tarray(\"iconsmind-Balloon\" => \"iconsmind-Balloon\"), \n\t\tarray(\"iconsmind-Barricade\" => \"iconsmind-Barricade\"), \n\t\tarray(\"iconsmind-Batman-Mask\" => \"iconsmind-Batman-Mask\"), \n\t\tarray(\"iconsmind-Binocular\" => \"iconsmind-Binocular\"), \n\t\tarray(\"iconsmind-Boom\" => \"iconsmind-Boom\"), \n\t\tarray(\"iconsmind-Bucket\" => \"iconsmind-Bucket\"), \n\t\tarray(\"iconsmind-Button\" => \"iconsmind-Button\"), \n\t\tarray(\"iconsmind-Cannon\" => \"iconsmind-Cannon\"), \n\t\tarray(\"iconsmind-Chacked-Flag\" => \"iconsmind-Chacked-Flag\"), \n\t\tarray(\"iconsmind-Chair\" => \"iconsmind-Chair\"), \n\t\tarray(\"iconsmind-Coffee-Machine\" => \"iconsmind-Coffee-Machine\"), \n\t\tarray(\"iconsmind-Crown\" => \"iconsmind-Crown\"), \n\t\tarray(\"iconsmind-Crown-2\" => \"iconsmind-Crown-2\"), \n\t\tarray(\"iconsmind-Dice\" => \"iconsmind-Dice\"), \n\t\tarray(\"iconsmind-Dice-2\" => \"iconsmind-Dice-2\"), \n\t\tarray(\"iconsmind-Domino\" => \"iconsmind-Domino\"), \n\t\tarray(\"iconsmind-Door-Hanger\" => \"iconsmind-Door-Hanger\"), \n\t\tarray(\"iconsmind-Drill\" => \"iconsmind-Drill\"), \n\t\tarray(\"iconsmind-Feather\" => \"iconsmind-Feather\"), \n\t\tarray(\"iconsmind-Fire-Hydrant\" => \"iconsmind-Fire-Hydrant\"), \n\t\tarray(\"iconsmind-Flag\" => \"iconsmind-Flag\"), \n\t\tarray(\"iconsmind-Flag-2\" => \"iconsmind-Flag-2\"), \n\t\tarray(\"iconsmind-Flashlight\" => \"iconsmind-Flashlight\"), \n\t\tarray(\"iconsmind-Footprint2\" => \"iconsmind-Footprint2\"), \n\t\tarray(\"iconsmind-Gas-Pump\" => \"iconsmind-Gas-Pump\"), \n\t\tarray(\"iconsmind-Gift-Box\" => \"iconsmind-Gift-Box\"), \n\t\tarray(\"iconsmind-Gun\" => \"iconsmind-Gun\"), \n\t\tarray(\"iconsmind-Gun-2\" => \"iconsmind-Gun-2\"), \n\t\tarray(\"iconsmind-Gun-3\" => \"iconsmind-Gun-3\"), \n\t\tarray(\"iconsmind-Hammer\" => \"iconsmind-Hammer\"), \n\t\tarray(\"iconsmind-Identification-Badge\" => \"iconsmind-Identification-Badge\"), \n\t\tarray(\"iconsmind-Key\" => \"iconsmind-Key\"), \n\t\tarray(\"iconsmind-Key-2\" => \"iconsmind-Key-2\"), \n\t\tarray(\"iconsmind-Key-3\" => \"iconsmind-Key-3\"), \n\t\tarray(\"iconsmind-Lamp\" => \"iconsmind-Lamp\"), \n\t\tarray(\"iconsmind-Lego\" => \"iconsmind-Lego\"), \n\t\tarray(\"iconsmind-Life-Safer\" => \"iconsmind-Life-Safer\"), \n\t\tarray(\"iconsmind-Light-Bulb\" => \"iconsmind-Light-Bulb\"), \n\t\tarray(\"iconsmind-Light-Bulb2\" => \"iconsmind-Light-Bulb2\"), \n\t\tarray(\"iconsmind-Luggafe-Front\" => \"iconsmind-Luggafe-Front\"), \n\t\tarray(\"iconsmind-Luggage-2\" => \"iconsmind-Luggage-2\"), \n\t\tarray(\"iconsmind-Magic-Wand\" => \"iconsmind-Magic-Wand\"), \n\t\tarray(\"iconsmind-Magnet\" => \"iconsmind-Magnet\"), \n\t\tarray(\"iconsmind-Mask\" => \"iconsmind-Mask\"), \n\t\tarray(\"iconsmind-Menorah\" => \"iconsmind-Menorah\"), \n\t\tarray(\"iconsmind-Mirror\" => \"iconsmind-Mirror\"), \n\t\tarray(\"iconsmind-Movie-Ticket\" => \"iconsmind-Movie-Ticket\"), \n\t\tarray(\"iconsmind-Office-Lamp\" => \"iconsmind-Office-Lamp\"), \n\t\tarray(\"iconsmind-Paint-Brush\" => \"iconsmind-Paint-Brush\"), \n\t\tarray(\"iconsmind-Paint-Bucket\" => \"iconsmind-Paint-Bucket\"), \n\t\tarray(\"iconsmind-Paper-Plane\" => \"iconsmind-Paper-Plane\"), \n\t\tarray(\"iconsmind-Post-Sign\" => \"iconsmind-Post-Sign\"), \n\t\tarray(\"iconsmind-Post-Sign2ways\" => \"iconsmind-Post-Sign2ways\"), \n\t\tarray(\"iconsmind-Puzzle\" => \"iconsmind-Puzzle\"), \n\t\tarray(\"iconsmind-Razzor-Blade\" => \"iconsmind-Razzor-Blade\"), \n\t\tarray(\"iconsmind-Scale\" => \"iconsmind-Scale\"), \n\t\tarray(\"iconsmind-Screwdriver\" => \"iconsmind-Screwdriver\"), \n\t\tarray(\"iconsmind-Sewing-Machine\" => \"iconsmind-Sewing-Machine\"), \n\t\tarray(\"iconsmind-Sheriff-Badge\" => \"iconsmind-Sheriff-Badge\"), \n\t\tarray(\"iconsmind-Stroller\" => \"iconsmind-Stroller\"), \n\t\tarray(\"iconsmind-Suitcase\" => \"iconsmind-Suitcase\"), \n\t\tarray(\"iconsmind-Teddy-Bear\" => \"iconsmind-Teddy-Bear\"), \n\t\tarray(\"iconsmind-Telescope\" => \"iconsmind-Telescope\"), \n\t\tarray(\"iconsmind-Tent\" => \"iconsmind-Tent\"), \n\t\tarray(\"iconsmind-Thread\" => \"iconsmind-Thread\"), \n\t\tarray(\"iconsmind-Ticket\" => \"iconsmind-Ticket\"), \n\t\tarray(\"iconsmind-Time-Bomb\" => \"iconsmind-Time-Bomb\"), \n\t\tarray(\"iconsmind-Tourch\" => \"iconsmind-Tourch\"), \n\t\tarray(\"iconsmind-Vase\" => \"iconsmind-Vase\"), \n\t\tarray(\"iconsmind-Video-GameController\" => \"iconsmind-Video-GameController\"), \n\t\tarray(\"iconsmind-Conservation\" => \"iconsmind-Conservation\"), \n\t\tarray(\"iconsmind-Eci-Icon\" => \"iconsmind-Eci-Icon\"), \n\t\tarray(\"iconsmind-Environmental\" => \"iconsmind-Environmental\"), \n\t\tarray(\"iconsmind-Environmental-2\" => \"iconsmind-Environmental-2\"), \n\t\tarray(\"iconsmind-Environmental-3\" => \"iconsmind-Environmental-3\"), \n\t\tarray(\"iconsmind-Fire-Flame\" => \"iconsmind-Fire-Flame\"), \n\t\tarray(\"iconsmind-Fire-Flame2\" => \"iconsmind-Fire-Flame2\"), \n\t\tarray(\"iconsmind-Flowerpot\" => \"iconsmind-Flowerpot\"), \n\t\tarray(\"iconsmind-Forest\" => \"iconsmind-Forest\"), \n\t\tarray(\"iconsmind-Green-Energy\" => \"iconsmind-Green-Energy\"), \n\t\tarray(\"iconsmind-Green-House\" => \"iconsmind-Green-House\"), \n\t\tarray(\"iconsmind-Landscape2\" => \"iconsmind-Landscape2\"), \n\t\tarray(\"iconsmind-Leafs\" => \"iconsmind-Leafs\"), \n\t\tarray(\"iconsmind-Leafs-2\" => \"iconsmind-Leafs-2\"), \n\t\tarray(\"iconsmind-Light-BulbLeaf\" => \"iconsmind-Light-BulbLeaf\"), \n\t\tarray(\"iconsmind-Palm-Tree\" => \"iconsmind-Palm-Tree\"), \n\t\tarray(\"iconsmind-Plant\" => \"iconsmind-Plant\"), \n\t\tarray(\"iconsmind-Recycling\" => \"iconsmind-Recycling\"), \n\t\tarray(\"iconsmind-Recycling-2\" => \"iconsmind-Recycling-2\"), \n\t\tarray(\"iconsmind-Seed\" => \"iconsmind-Seed\"), \n\t\tarray(\"iconsmind-Trash-withMen\" => \"iconsmind-Trash-withMen\"), \n\t\tarray(\"iconsmind-Tree\" => \"iconsmind-Tree\"), \n\t\tarray(\"iconsmind-Tree-2\" => \"iconsmind-Tree-2\"), \n\t\tarray(\"iconsmind-Tree-3\" => \"iconsmind-Tree-3\"), \n\t\tarray(\"iconsmind-Audio\" => \"iconsmind-Audio\"), \n\t\tarray(\"iconsmind-Back-Music\" => \"iconsmind-Back-Music\"), \n\t\tarray(\"iconsmind-Bell\" => \"iconsmind-Bell\"), \n\t\tarray(\"iconsmind-Casette-Tape\" => \"iconsmind-Casette-Tape\"), \n\t\tarray(\"iconsmind-CD-2\" => \"iconsmind-CD-2\"), \n\t\tarray(\"iconsmind-CD-Cover\" => \"iconsmind-CD-Cover\"), \n\t\tarray(\"iconsmind-Cello\" => \"iconsmind-Cello\"), \n\t\tarray(\"iconsmind-Clef\" => \"iconsmind-Clef\"), \n\t\tarray(\"iconsmind-Drum\" => \"iconsmind-Drum\"), \n\t\tarray(\"iconsmind-Earphones\" => \"iconsmind-Earphones\"), \n\t\tarray(\"iconsmind-Earphones-2\" => \"iconsmind-Earphones-2\"), \n\t\tarray(\"iconsmind-Electric-Guitar\" => \"iconsmind-Electric-Guitar\"), \n\t\tarray(\"iconsmind-Equalizer\" => \"iconsmind-Equalizer\"), \n\t\tarray(\"iconsmind-First\" => \"iconsmind-First\"), \n\t\tarray(\"iconsmind-Guitar\" => \"iconsmind-Guitar\"), \n\t\tarray(\"iconsmind-Headphones\" => \"iconsmind-Headphones\"), \n\t\tarray(\"iconsmind-Keyboard3\" => \"iconsmind-Keyboard3\"), \n\t\tarray(\"iconsmind-Last\" => \"iconsmind-Last\"), \n\t\tarray(\"iconsmind-Loud\" => \"iconsmind-Loud\"), \n\t\tarray(\"iconsmind-Loudspeaker\" => \"iconsmind-Loudspeaker\"), \n\t\tarray(\"iconsmind-Mic\" => \"iconsmind-Mic\"), \n\t\tarray(\"iconsmind-Microphone\" => \"iconsmind-Microphone\"), \n\t\tarray(\"iconsmind-Microphone-2\" => \"iconsmind-Microphone-2\"), \n\t\tarray(\"iconsmind-Microphone-3\" => \"iconsmind-Microphone-3\"), \n\t\tarray(\"iconsmind-Microphone-4\" => \"iconsmind-Microphone-4\"), \n\t\tarray(\"iconsmind-Microphone-5\" => \"iconsmind-Microphone-5\"), \n\t\tarray(\"iconsmind-Microphone-6\" => \"iconsmind-Microphone-6\"), \n\t\tarray(\"iconsmind-Microphone-7\" => \"iconsmind-Microphone-7\"), \n\t\tarray(\"iconsmind-Mixer\" => \"iconsmind-Mixer\"), \n\t\tarray(\"iconsmind-Mp3-File\" => \"iconsmind-Mp3-File\"), \n\t\tarray(\"iconsmind-Music-Note\" => \"iconsmind-Music-Note\"), \n\t\tarray(\"iconsmind-Music-Note2\" => \"iconsmind-Music-Note2\"), \n\t\tarray(\"iconsmind-Music-Note3\" => \"iconsmind-Music-Note3\"), \n\t\tarray(\"iconsmind-Music-Note4\" => \"iconsmind-Music-Note4\"), \n\t\tarray(\"iconsmind-Music-Player\" => \"iconsmind-Music-Player\"), \n\t\tarray(\"iconsmind-Mute\" => \"iconsmind-Mute\"), \n\t\tarray(\"iconsmind-Next-Music\" => \"iconsmind-Next-Music\"), \n\t\tarray(\"iconsmind-Old-Radio\" => \"iconsmind-Old-Radio\"), \n\t\tarray(\"iconsmind-On-Air\" => \"iconsmind-On-Air\"), \n\t\tarray(\"iconsmind-Piano\" => \"iconsmind-Piano\"), \n\t\tarray(\"iconsmind-Play-Music\" => \"iconsmind-Play-Music\"), \n\t\tarray(\"iconsmind-Radio\" => \"iconsmind-Radio\"), \n\t\tarray(\"iconsmind-Record\" => \"iconsmind-Record\"), \n\t\tarray(\"iconsmind-Record-Music\" => \"iconsmind-Record-Music\"), \n\t\tarray(\"iconsmind-Rock-andRoll\" => \"iconsmind-Rock-andRoll\"), \n\t\tarray(\"iconsmind-Saxophone\" => \"iconsmind-Saxophone\"), \n\t\tarray(\"iconsmind-Sound\" => \"iconsmind-Sound\"), \n\t\tarray(\"iconsmind-Sound-Wave\" => \"iconsmind-Sound-Wave\"), \n\t\tarray(\"iconsmind-Speaker\" => \"iconsmind-Speaker\"), \n\t\tarray(\"iconsmind-Stop-Music\" => \"iconsmind-Stop-Music\"), \n\t\tarray(\"iconsmind-Trumpet\" => \"iconsmind-Trumpet\"), \n\t\tarray(\"iconsmind-Voice\" => \"iconsmind-Voice\"), \n\t\tarray(\"iconsmind-Volume-Down\" => \"iconsmind-Volume-Down\"), \n\t\tarray(\"iconsmind-Volume-Up\" => \"iconsmind-Volume-Up\"), \n\t\tarray(\"iconsmind-Back\" => \"iconsmind-Back\"), \n\t\tarray(\"iconsmind-Back-2\" => \"iconsmind-Back-2\"), \n\t\tarray(\"iconsmind-Eject\" => \"iconsmind-Eject\"), \n\t\tarray(\"iconsmind-Eject-2\" => \"iconsmind-Eject-2\"), \n\t\tarray(\"iconsmind-End\" => \"iconsmind-End\"), \n\t\tarray(\"iconsmind-End-2\" => \"iconsmind-End-2\"), \n\t\tarray(\"iconsmind-Next\" => \"iconsmind-Next\"), \n\t\tarray(\"iconsmind-Next-2\" => \"iconsmind-Next-2\"), \n\t\tarray(\"iconsmind-Pause\" => \"iconsmind-Pause\"), \n\t\tarray(\"iconsmind-Pause-2\" => \"iconsmind-Pause-2\"), \n\t\tarray(\"iconsmind-Power-2\" => \"iconsmind-Power-2\"), \n\t\tarray(\"iconsmind-Power-3\" => \"iconsmind-Power-3\"), \n\t\tarray(\"iconsmind-Record2\" => \"iconsmind-Record2\"), \n\t\tarray(\"iconsmind-Record-2\" => \"iconsmind-Record-2\"), \n\t\tarray(\"iconsmind-Repeat\" => \"iconsmind-Repeat\"), \n\t\tarray(\"iconsmind-Repeat-2\" => \"iconsmind-Repeat-2\"), \n\t\tarray(\"iconsmind-Shuffle\" => \"iconsmind-Shuffle\"), \n\t\tarray(\"iconsmind-Shuffle-2\" => \"iconsmind-Shuffle-2\"), \n\t\tarray(\"iconsmind-Start\" => \"iconsmind-Start\"), \n\t\tarray(\"iconsmind-Start-2\" => \"iconsmind-Start-2\"), \n\t\tarray(\"iconsmind-Stop\" => \"iconsmind-Stop\"), \n\t\tarray(\"iconsmind-Stop-2\" => \"iconsmind-Stop-2\"), \n\t\tarray(\"iconsmind-Compass\" => \"iconsmind-Compass\"), \n\t\tarray(\"iconsmind-Compass-2\" => \"iconsmind-Compass-2\"), \n\t\tarray(\"iconsmind-Compass-Rose\" => \"iconsmind-Compass-Rose\"), \n\t\tarray(\"iconsmind-Direction-East\" => \"iconsmind-Direction-East\"), \n\t\tarray(\"iconsmind-Direction-North\" => \"iconsmind-Direction-North\"), \n\t\tarray(\"iconsmind-Direction-South\" => \"iconsmind-Direction-South\"), \n\t\tarray(\"iconsmind-Direction-West\" => \"iconsmind-Direction-West\"), \n\t\tarray(\"iconsmind-Edit-Map\" => \"iconsmind-Edit-Map\"), \n\t\tarray(\"iconsmind-Geo\" => \"iconsmind-Geo\"), \n\t\tarray(\"iconsmind-Geo2\" => \"iconsmind-Geo2\"), \n\t\tarray(\"iconsmind-Geo3\" => \"iconsmind-Geo3\"), \n\t\tarray(\"iconsmind-Geo22\" => \"iconsmind-Geo22\"), \n\t\tarray(\"iconsmind-Geo23\" => \"iconsmind-Geo23\"), \n\t\tarray(\"iconsmind-Geo24\" => \"iconsmind-Geo24\"), \n\t\tarray(\"iconsmind-Geo2-Close\" => \"iconsmind-Geo2-Close\"), \n\t\tarray(\"iconsmind-Geo2-Love\" => \"iconsmind-Geo2-Love\"), \n\t\tarray(\"iconsmind-Geo2-Number\" => \"iconsmind-Geo2-Number\"), \n\t\tarray(\"iconsmind-Geo2-Star\" => \"iconsmind-Geo2-Star\"), \n\t\tarray(\"iconsmind-Geo32\" => \"iconsmind-Geo32\"), \n\t\tarray(\"iconsmind-Geo33\" => \"iconsmind-Geo33\"), \n\t\tarray(\"iconsmind-Geo34\" => \"iconsmind-Geo34\"), \n\t\tarray(\"iconsmind-Geo3-Close\" => \"iconsmind-Geo3-Close\"), \n\t\tarray(\"iconsmind-Geo3-Love\" => \"iconsmind-Geo3-Love\"), \n\t\tarray(\"iconsmind-Geo3-Number\" => \"iconsmind-Geo3-Number\"), \n\t\tarray(\"iconsmind-Geo3-Star\" => \"iconsmind-Geo3-Star\"), \n\t\tarray(\"iconsmind-Geo-Close\" => \"iconsmind-Geo-Close\"), \n\t\tarray(\"iconsmind-Geo-Love\" => \"iconsmind-Geo-Love\"), \n\t\tarray(\"iconsmind-Geo-Number\" => \"iconsmind-Geo-Number\"), \n\t\tarray(\"iconsmind-Geo-Star\" => \"iconsmind-Geo-Star\"), \n\t\tarray(\"iconsmind-Global-Position\" => \"iconsmind-Global-Position\"), \n\t\tarray(\"iconsmind-Globe\" => \"iconsmind-Globe\"), \n\t\tarray(\"iconsmind-Globe-2\" => \"iconsmind-Globe-2\"), \n\t\tarray(\"iconsmind-Location\" => \"iconsmind-Location\"), \n\t\tarray(\"iconsmind-Location-2\" => \"iconsmind-Location-2\"), \n\t\tarray(\"iconsmind-Map\" => \"iconsmind-Map\"), \n\t\tarray(\"iconsmind-Map2\" => \"iconsmind-Map2\"), \n\t\tarray(\"iconsmind-Map-Marker\" => \"iconsmind-Map-Marker\"), \n\t\tarray(\"iconsmind-Map-Marker2\" => \"iconsmind-Map-Marker2\"), \n\t\tarray(\"iconsmind-Map-Marker3\" => \"iconsmind-Map-Marker3\"), \n\t\tarray(\"iconsmind-Road2\" => \"iconsmind-Road2\"), \n\t\tarray(\"iconsmind-Satelite\" => \"iconsmind-Satelite\"), \n\t\tarray(\"iconsmind-Satelite-2\" => \"iconsmind-Satelite-2\"), \n\t\tarray(\"iconsmind-Street-View\" => \"iconsmind-Street-View\"), \n\t\tarray(\"iconsmind-Street-View2\" => \"iconsmind-Street-View2\"), \n\t\tarray(\"iconsmind-Android-Store\" => \"iconsmind-Android-Store\"), \n\t\tarray(\"iconsmind-Apple-Store\" => \"iconsmind-Apple-Store\"), \n\t\tarray(\"iconsmind-Box2\" => \"iconsmind-Box2\"), \n\t\tarray(\"iconsmind-Dropbox\" => \"iconsmind-Dropbox\"), \n\t\tarray(\"iconsmind-Google-Drive\" => \"iconsmind-Google-Drive\"), \n\t\tarray(\"iconsmind-Google-Play\" => \"iconsmind-Google-Play\"), \n\t\tarray(\"iconsmind-Paypal\" => \"iconsmind-Paypal\"), \n\t\tarray(\"iconsmind-Skrill\" => \"iconsmind-Skrill\"), \n\t\tarray(\"iconsmind-X-Box\" => \"iconsmind-X-Box\"), \n\t\tarray(\"iconsmind-Add\" => \"iconsmind-Add\"), \n\t\tarray(\"iconsmind-Back2\" => \"iconsmind-Back2\"), \n\t\tarray(\"iconsmind-Broken-Link\" => \"iconsmind-Broken-Link\"), \n\t\tarray(\"iconsmind-Check\" => \"iconsmind-Check\"), \n\t\tarray(\"iconsmind-Check-2\" => \"iconsmind-Check-2\"), \n\t\tarray(\"iconsmind-Circular-Point\" => \"iconsmind-Circular-Point\"), \n\t\tarray(\"iconsmind-Close\" => \"iconsmind-Close\"), \n\t\tarray(\"iconsmind-Cursor\" => \"iconsmind-Cursor\"), \n\t\tarray(\"iconsmind-Cursor-Click\" => \"iconsmind-Cursor-Click\"), \n\t\tarray(\"iconsmind-Cursor-Click2\" => \"iconsmind-Cursor-Click2\"), \n\t\tarray(\"iconsmind-Cursor-Move\" => \"iconsmind-Cursor-Move\"), \n\t\tarray(\"iconsmind-Cursor-Move2\" => \"iconsmind-Cursor-Move2\"), \n\t\tarray(\"iconsmind-Cursor-Select\" => \"iconsmind-Cursor-Select\"), \n\t\tarray(\"iconsmind-Down\" => \"iconsmind-Down\"), \n\t\tarray(\"iconsmind-Download\" => \"iconsmind-Download\"), \n\t\tarray(\"iconsmind-Downward\" => \"iconsmind-Downward\"), \n\t\tarray(\"iconsmind-Endways\" => \"iconsmind-Endways\"), \n\t\tarray(\"iconsmind-Forward\" => \"iconsmind-Forward\"), \n\t\tarray(\"iconsmind-Left\" => \"iconsmind-Left\"), \n\t\tarray(\"iconsmind-Link\" => \"iconsmind-Link\"), \n\t\tarray(\"iconsmind-Next2\" => \"iconsmind-Next2\"), \n\t\tarray(\"iconsmind-Orientation\" => \"iconsmind-Orientation\"), \n\t\tarray(\"iconsmind-Pointer\" => \"iconsmind-Pointer\"), \n\t\tarray(\"iconsmind-Previous\" => \"iconsmind-Previous\"), \n\t\tarray(\"iconsmind-Redo\" => \"iconsmind-Redo\"), \n\t\tarray(\"iconsmind-Refresh\" => \"iconsmind-Refresh\"), \n\t\tarray(\"iconsmind-Reload\" => \"iconsmind-Reload\"), \n\t\tarray(\"iconsmind-Remove\" => \"iconsmind-Remove\"), \n\t\tarray(\"iconsmind-Repeat2\" => \"iconsmind-Repeat2\"), \n\t\tarray(\"iconsmind-Reset\" => \"iconsmind-Reset\"), \n\t\tarray(\"iconsmind-Rewind\" => \"iconsmind-Rewind\"), \n\t\tarray(\"iconsmind-Right\" => \"iconsmind-Right\"), \n\t\tarray(\"iconsmind-Rotation\" => \"iconsmind-Rotation\"), \n\t\tarray(\"iconsmind-Rotation-390\" => \"iconsmind-Rotation-390\"), \n\t\tarray(\"iconsmind-Spot\" => \"iconsmind-Spot\"), \n\t\tarray(\"iconsmind-Start-ways\" => \"iconsmind-Start-ways\"), \n\t\tarray(\"iconsmind-Synchronize\" => \"iconsmind-Synchronize\"), \n\t\tarray(\"iconsmind-Synchronize-2\" => \"iconsmind-Synchronize-2\"), \n\t\tarray(\"iconsmind-Undo\" => \"iconsmind-Undo\"), \n\t\tarray(\"iconsmind-Up\" => \"iconsmind-Up\"), \n\t\tarray(\"iconsmind-Upload\" => \"iconsmind-Upload\"), \n\t\tarray(\"iconsmind-Upward\" => \"iconsmind-Upward\"), \n\t\tarray(\"iconsmind-Yes\" => \"iconsmind-Yes\"), \n\t\tarray(\"iconsmind-Barricade2\" => \"iconsmind-Barricade2\"), \n\t\tarray(\"iconsmind-Crane\" => \"iconsmind-Crane\"), \n\t\tarray(\"iconsmind-Dam\" => \"iconsmind-Dam\"), \n\t\tarray(\"iconsmind-Drill2\" => \"iconsmind-Drill2\"), \n\t\tarray(\"iconsmind-Electricity\" => \"iconsmind-Electricity\"), \n\t\tarray(\"iconsmind-Explode\" => \"iconsmind-Explode\"), \n\t\tarray(\"iconsmind-Factory\" => \"iconsmind-Factory\"), \n\t\tarray(\"iconsmind-Fuel\" => \"iconsmind-Fuel\"), \n\t\tarray(\"iconsmind-Helmet2\" => \"iconsmind-Helmet2\"), \n\t\tarray(\"iconsmind-Helmet-2\" => \"iconsmind-Helmet-2\"), \n\t\tarray(\"iconsmind-Laser\" => \"iconsmind-Laser\"), \n\t\tarray(\"iconsmind-Mine\" => \"iconsmind-Mine\"), \n\t\tarray(\"iconsmind-Oil\" => \"iconsmind-Oil\"), \n\t\tarray(\"iconsmind-Petrol\" => \"iconsmind-Petrol\"), \n\t\tarray(\"iconsmind-Pipe\" => \"iconsmind-Pipe\"), \n\t\tarray(\"iconsmind-Power-Station\" => \"iconsmind-Power-Station\"), \n\t\tarray(\"iconsmind-Refinery\" => \"iconsmind-Refinery\"), \n\t\tarray(\"iconsmind-Saw\" => \"iconsmind-Saw\"), \n\t\tarray(\"iconsmind-Shovel\" => \"iconsmind-Shovel\"), \n\t\tarray(\"iconsmind-Solar\" => \"iconsmind-Solar\"), \n\t\tarray(\"iconsmind-Wheelbarrow\" => \"iconsmind-Wheelbarrow\"), \n\t\tarray(\"iconsmind-Windmill\" => \"iconsmind-Windmill\"), \n\t\tarray(\"iconsmind-Aa\" => \"iconsmind-Aa\"), \n\t\tarray(\"iconsmind-Add-File\" => \"iconsmind-Add-File\"), \n\t\tarray(\"iconsmind-Address-Book\" => \"iconsmind-Address-Book\"), \n\t\tarray(\"iconsmind-Address-Book2\" => \"iconsmind-Address-Book2\"), \n\t\tarray(\"iconsmind-Add-SpaceAfterParagraph\" => \"iconsmind-Add-SpaceAfterParagraph\"), \n\t\tarray(\"iconsmind-Add-SpaceBeforeParagraph\" => \"iconsmind-Add-SpaceBeforeParagraph\"), \n\t\tarray(\"iconsmind-Airbrush\" => \"iconsmind-Airbrush\"), \n\t\tarray(\"iconsmind-Aligator\" => \"iconsmind-Aligator\"), \n\t\tarray(\"iconsmind-Align-Center\" => \"iconsmind-Align-Center\"), \n\t\tarray(\"iconsmind-Align-JustifyAll\" => \"iconsmind-Align-JustifyAll\"), \n\t\tarray(\"iconsmind-Align-JustifyCenter\" => \"iconsmind-Align-JustifyCenter\"), \n\t\tarray(\"iconsmind-Align-JustifyLeft\" => \"iconsmind-Align-JustifyLeft\"), \n\t\tarray(\"iconsmind-Align-JustifyRight\" => \"iconsmind-Align-JustifyRight\"), \n\t\tarray(\"iconsmind-Align-Left\" => \"iconsmind-Align-Left\"), \n\t\tarray(\"iconsmind-Align-Right\" => \"iconsmind-Align-Right\"), \n\t\tarray(\"iconsmind-Alpha\" => \"iconsmind-Alpha\"), \n\t\tarray(\"iconsmind-AMX\" => \"iconsmind-AMX\"), \n\t\tarray(\"iconsmind-Anchor2\" => \"iconsmind-Anchor2\"), \n\t\tarray(\"iconsmind-Android\" => \"iconsmind-Android\"), \n\t\tarray(\"iconsmind-Angel\" => \"iconsmind-Angel\"), \n\t\tarray(\"iconsmind-Angel-Smiley\" => \"iconsmind-Angel-Smiley\"), \n\t\tarray(\"iconsmind-Angry\" => \"iconsmind-Angry\"), \n\t\tarray(\"iconsmind-Apple\" => \"iconsmind-Apple\"), \n\t\tarray(\"iconsmind-Apple-Bite\" => \"iconsmind-Apple-Bite\"), \n\t\tarray(\"iconsmind-Argentina\" => \"iconsmind-Argentina\"), \n\t\tarray(\"iconsmind-Arrow-Around\" => \"iconsmind-Arrow-Around\"), \n\t\tarray(\"iconsmind-Arrow-Back\" => \"iconsmind-Arrow-Back\"), \n\t\tarray(\"iconsmind-Arrow-Back2\" => \"iconsmind-Arrow-Back2\"), \n\t\tarray(\"iconsmind-Arrow-Back3\" => \"iconsmind-Arrow-Back3\"), \n\t\tarray(\"iconsmind-Arrow-Barrier\" => \"iconsmind-Arrow-Barrier\"), \n\t\tarray(\"iconsmind-Arrow-Circle\" => \"iconsmind-Arrow-Circle\"), \n\t\tarray(\"iconsmind-Arrow-Cross\" => \"iconsmind-Arrow-Cross\"), \n\t\tarray(\"iconsmind-Arrow-Down\" => \"iconsmind-Arrow-Down\"), \n\t\tarray(\"iconsmind-Arrow-Down2\" => \"iconsmind-Arrow-Down2\"), \n\t\tarray(\"iconsmind-Arrow-Down3\" => \"iconsmind-Arrow-Down3\"), \n\t\tarray(\"iconsmind-Arrow-DowninCircle\" => \"iconsmind-Arrow-DowninCircle\"), \n\t\tarray(\"iconsmind-Arrow-Fork\" => \"iconsmind-Arrow-Fork\"), \n\t\tarray(\"iconsmind-Arrow-Forward\" => \"iconsmind-Arrow-Forward\"), \n\t\tarray(\"iconsmind-Arrow-Forward2\" => \"iconsmind-Arrow-Forward2\"), \n\t\tarray(\"iconsmind-Arrow-From\" => \"iconsmind-Arrow-From\"), \n\t\tarray(\"iconsmind-Arrow-Inside\" => \"iconsmind-Arrow-Inside\"), \n\t\tarray(\"iconsmind-Arrow-Inside45\" => \"iconsmind-Arrow-Inside45\"), \n\t\tarray(\"iconsmind-Arrow-InsideGap\" => \"iconsmind-Arrow-InsideGap\"), \n\t\tarray(\"iconsmind-Arrow-InsideGap45\" => \"iconsmind-Arrow-InsideGap45\"), \n\t\tarray(\"iconsmind-Arrow-Into\" => \"iconsmind-Arrow-Into\"), \n\t\tarray(\"iconsmind-Arrow-Join\" => \"iconsmind-Arrow-Join\"), \n\t\tarray(\"iconsmind-Arrow-Junction\" => \"iconsmind-Arrow-Junction\"), \n\t\tarray(\"iconsmind-Arrow-Left\" => \"iconsmind-Arrow-Left\"), \n\t\tarray(\"iconsmind-Arrow-Left2\" => \"iconsmind-Arrow-Left2\"), \n\t\tarray(\"iconsmind-Arrow-LeftinCircle\" => \"iconsmind-Arrow-LeftinCircle\"), \n\t\tarray(\"iconsmind-Arrow-Loop\" => \"iconsmind-Arrow-Loop\"), \n\t\tarray(\"iconsmind-Arrow-Merge\" => \"iconsmind-Arrow-Merge\"), \n\t\tarray(\"iconsmind-Arrow-Mix\" => \"iconsmind-Arrow-Mix\"), \n\t\tarray(\"iconsmind-Arrow-Next\" => \"iconsmind-Arrow-Next\"), \n\t\tarray(\"iconsmind-Arrow-OutLeft\" => \"iconsmind-Arrow-OutLeft\"), \n\t\tarray(\"iconsmind-Arrow-OutRight\" => \"iconsmind-Arrow-OutRight\"), \n\t\tarray(\"iconsmind-Arrow-Outside\" => \"iconsmind-Arrow-Outside\"), \n\t\tarray(\"iconsmind-Arrow-Outside45\" => \"iconsmind-Arrow-Outside45\"), \n\t\tarray(\"iconsmind-Arrow-OutsideGap\" => \"iconsmind-Arrow-OutsideGap\"), \n\t\tarray(\"iconsmind-Arrow-OutsideGap45\" => \"iconsmind-Arrow-OutsideGap45\"), \n\t\tarray(\"iconsmind-Arrow-Over\" => \"iconsmind-Arrow-Over\"), \n\t\tarray(\"iconsmind-Arrow-Refresh\" => \"iconsmind-Arrow-Refresh\"), \n\t\tarray(\"iconsmind-Arrow-Refresh2\" => \"iconsmind-Arrow-Refresh2\"), \n\t\tarray(\"iconsmind-Arrow-Right\" => \"iconsmind-Arrow-Right\"), \n\t\tarray(\"iconsmind-Arrow-Right2\" => \"iconsmind-Arrow-Right2\"), \n\t\tarray(\"iconsmind-Arrow-RightinCircle\" => \"iconsmind-Arrow-RightinCircle\"), \n\t\tarray(\"iconsmind-Arrow-Shuffle\" => \"iconsmind-Arrow-Shuffle\"), \n\t\tarray(\"iconsmind-Arrow-Squiggly\" => \"iconsmind-Arrow-Squiggly\"), \n\t\tarray(\"iconsmind-Arrow-Through\" => \"iconsmind-Arrow-Through\"), \n\t\tarray(\"iconsmind-Arrow-To\" => \"iconsmind-Arrow-To\"), \n\t\tarray(\"iconsmind-Arrow-TurnLeft\" => \"iconsmind-Arrow-TurnLeft\"), \n\t\tarray(\"iconsmind-Arrow-TurnRight\" => \"iconsmind-Arrow-TurnRight\"), \n\t\tarray(\"iconsmind-Arrow-Up\" => \"iconsmind-Arrow-Up\"), \n\t\tarray(\"iconsmind-Arrow-Up2\" => \"iconsmind-Arrow-Up2\"), \n\t\tarray(\"iconsmind-Arrow-Up3\" => \"iconsmind-Arrow-Up3\"), \n\t\tarray(\"iconsmind-Arrow-UpinCircle\" => \"iconsmind-Arrow-UpinCircle\"), \n\t\tarray(\"iconsmind-Arrow-XLeft\" => \"iconsmind-Arrow-XLeft\"), \n\t\tarray(\"iconsmind-Arrow-XRight\" => \"iconsmind-Arrow-XRight\"), \n\t\tarray(\"iconsmind-ATM\" => \"iconsmind-ATM\"), \n\t\tarray(\"iconsmind-At-Sign\" => \"iconsmind-At-Sign\"), \n\t\tarray(\"iconsmind-Baby-Clothes\" => \"iconsmind-Baby-Clothes\"), \n\t\tarray(\"iconsmind-Baby-Clothes2\" => \"iconsmind-Baby-Clothes2\"), \n\t\tarray(\"iconsmind-Bag\" => \"iconsmind-Bag\"), \n\t\tarray(\"iconsmind-Bakelite\" => \"iconsmind-Bakelite\"), \n\t\tarray(\"iconsmind-Banana\" => \"iconsmind-Banana\"), \n\t\tarray(\"iconsmind-Bank\" => \"iconsmind-Bank\"), \n\t\tarray(\"iconsmind-Bar-Chart\" => \"iconsmind-Bar-Chart\"), \n\t\tarray(\"iconsmind-Bar-Chart2\" => \"iconsmind-Bar-Chart2\"), \n\t\tarray(\"iconsmind-Bar-Chart3\" => \"iconsmind-Bar-Chart3\"), \n\t\tarray(\"iconsmind-Bar-Chart4\" => \"iconsmind-Bar-Chart4\"), \n\t\tarray(\"iconsmind-Bar-Chart5\" => \"iconsmind-Bar-Chart5\"), \n\t\tarray(\"iconsmind-Bat\" => \"iconsmind-Bat\"), \n\t\tarray(\"iconsmind-Bathrobe\" => \"iconsmind-Bathrobe\"), \n\t\tarray(\"iconsmind-Battery-0\" => \"iconsmind-Battery-0\"), \n\t\tarray(\"iconsmind-Battery-25\" => \"iconsmind-Battery-25\"), \n\t\tarray(\"iconsmind-Battery-50\" => \"iconsmind-Battery-50\"), \n\t\tarray(\"iconsmind-Battery-75\" => \"iconsmind-Battery-75\"), \n\t\tarray(\"iconsmind-Battery-100\" => \"iconsmind-Battery-100\"), \n\t\tarray(\"iconsmind-Battery-Charge\" => \"iconsmind-Battery-Charge\"), \n\t\tarray(\"iconsmind-Bear\" => \"iconsmind-Bear\"), \n\t\tarray(\"iconsmind-Beard\" => \"iconsmind-Beard\"), \n\t\tarray(\"iconsmind-Beard-2\" => \"iconsmind-Beard-2\"), \n\t\tarray(\"iconsmind-Beard-3\" => \"iconsmind-Beard-3\"), \n\t\tarray(\"iconsmind-Bee\" => \"iconsmind-Bee\"), \n\t\tarray(\"iconsmind-Beer\" => \"iconsmind-Beer\"), \n\t\tarray(\"iconsmind-Beer-Glass\" => \"iconsmind-Beer-Glass\"), \n\t\tarray(\"iconsmind-Bell2\" => \"iconsmind-Bell2\"), \n\t\tarray(\"iconsmind-Belt\" => \"iconsmind-Belt\"), \n\t\tarray(\"iconsmind-Belt-2\" => \"iconsmind-Belt-2\"), \n\t\tarray(\"iconsmind-Belt-3\" => \"iconsmind-Belt-3\"), \n\t\tarray(\"iconsmind-Berlin-Tower\" => \"iconsmind-Berlin-Tower\"), \n\t\tarray(\"iconsmind-Beta\" => \"iconsmind-Beta\"), \n\t\tarray(\"iconsmind-Big-Bang\" => \"iconsmind-Big-Bang\"), \n\t\tarray(\"iconsmind-Big-Data\" => \"iconsmind-Big-Data\"), \n\t\tarray(\"iconsmind-Bikini\" => \"iconsmind-Bikini\"), \n\t\tarray(\"iconsmind-Bilk-Bottle2\" => \"iconsmind-Bilk-Bottle2\"), \n\t\tarray(\"iconsmind-Bird\" => \"iconsmind-Bird\"), \n\t\tarray(\"iconsmind-Bird-DeliveringLetter\" => \"iconsmind-Bird-DeliveringLetter\"), \n\t\tarray(\"iconsmind-Birthday-Cake\" => \"iconsmind-Birthday-Cake\"), \n\t\tarray(\"iconsmind-Bishop\" => \"iconsmind-Bishop\"), \n\t\tarray(\"iconsmind-Blackboard\" => \"iconsmind-Blackboard\"), \n\t\tarray(\"iconsmind-Black-Cat\" => \"iconsmind-Black-Cat\"), \n\t\tarray(\"iconsmind-Block-Cloud\" => \"iconsmind-Block-Cloud\"), \n\t\tarray(\"iconsmind-Blood\" => \"iconsmind-Blood\"), \n\t\tarray(\"iconsmind-Blouse\" => \"iconsmind-Blouse\"), \n\t\tarray(\"iconsmind-Blueprint\" => \"iconsmind-Blueprint\"), \n\t\tarray(\"iconsmind-Board\" => \"iconsmind-Board\"), \n\t\tarray(\"iconsmind-Bone\" => \"iconsmind-Bone\"), \n\t\tarray(\"iconsmind-Bones\" => \"iconsmind-Bones\"), \n\t\tarray(\"iconsmind-Book\" => \"iconsmind-Book\"), \n\t\tarray(\"iconsmind-Bookmark\" => \"iconsmind-Bookmark\"), \n\t\tarray(\"iconsmind-Books\" => \"iconsmind-Books\"), \n\t\tarray(\"iconsmind-Books-2\" => \"iconsmind-Books-2\"), \n\t\tarray(\"iconsmind-Boot\" => \"iconsmind-Boot\"), \n\t\tarray(\"iconsmind-Boot-2\" => \"iconsmind-Boot-2\"), \n\t\tarray(\"iconsmind-Bottom-ToTop\" => \"iconsmind-Bottom-ToTop\"), \n\t\tarray(\"iconsmind-Bow\" => \"iconsmind-Bow\"), \n\t\tarray(\"iconsmind-Bow-2\" => \"iconsmind-Bow-2\"), \n\t\tarray(\"iconsmind-Bow-3\" => \"iconsmind-Bow-3\"), \n\t\tarray(\"iconsmind-Box-Close\" => \"iconsmind-Box-Close\"), \n\t\tarray(\"iconsmind-Box-Full\" => \"iconsmind-Box-Full\"), \n\t\tarray(\"iconsmind-Box-Open\" => \"iconsmind-Box-Open\"), \n\t\tarray(\"iconsmind-Box-withFolders\" => \"iconsmind-Box-withFolders\"), \n\t\tarray(\"iconsmind-Bra\" => \"iconsmind-Bra\"), \n\t\tarray(\"iconsmind-Brain2\" => \"iconsmind-Brain2\"), \n\t\tarray(\"iconsmind-Brain-2\" => \"iconsmind-Brain-2\"), \n\t\tarray(\"iconsmind-Brazil\" => \"iconsmind-Brazil\"), \n\t\tarray(\"iconsmind-Bread\" => \"iconsmind-Bread\"), \n\t\tarray(\"iconsmind-Bread-2\" => \"iconsmind-Bread-2\"), \n\t\tarray(\"iconsmind-Bridge\" => \"iconsmind-Bridge\"), \n\t\tarray(\"iconsmind-Broom\" => \"iconsmind-Broom\"), \n\t\tarray(\"iconsmind-Brush\" => \"iconsmind-Brush\"), \n\t\tarray(\"iconsmind-Bug\" => \"iconsmind-Bug\"), \n\t\tarray(\"iconsmind-Building\" => \"iconsmind-Building\"), \n\t\tarray(\"iconsmind-Butterfly\" => \"iconsmind-Butterfly\"), \n\t\tarray(\"iconsmind-Cake\" => \"iconsmind-Cake\"), \n\t\tarray(\"iconsmind-Calculator\" => \"iconsmind-Calculator\"), \n\t\tarray(\"iconsmind-Calculator-2\" => \"iconsmind-Calculator-2\"), \n\t\tarray(\"iconsmind-Calculator-3\" => \"iconsmind-Calculator-3\"), \n\t\tarray(\"iconsmind-Calendar\" => \"iconsmind-Calendar\"), \n\t\tarray(\"iconsmind-Calendar-2\" => \"iconsmind-Calendar-2\"), \n\t\tarray(\"iconsmind-Calendar-3\" => \"iconsmind-Calendar-3\"), \n\t\tarray(\"iconsmind-Calendar-4\" => \"iconsmind-Calendar-4\"), \n\t\tarray(\"iconsmind-Camel\" => \"iconsmind-Camel\"), \n\t\tarray(\"iconsmind-Can\" => \"iconsmind-Can\"), \n\t\tarray(\"iconsmind-Can-2\" => \"iconsmind-Can-2\"), \n\t\tarray(\"iconsmind-Canada\" => \"iconsmind-Canada\"), \n\t\tarray(\"iconsmind-Candle\" => \"iconsmind-Candle\"), \n\t\tarray(\"iconsmind-Candy\" => \"iconsmind-Candy\"), \n\t\tarray(\"iconsmind-Candy-Cane\" => \"iconsmind-Candy-Cane\"), \n\t\tarray(\"iconsmind-Cap\" => \"iconsmind-Cap\"), \n\t\tarray(\"iconsmind-Cap-2\" => \"iconsmind-Cap-2\"), \n\t\tarray(\"iconsmind-Cap-3\" => \"iconsmind-Cap-3\"), \n\t\tarray(\"iconsmind-Cardigan\" => \"iconsmind-Cardigan\"), \n\t\tarray(\"iconsmind-Cardiovascular\" => \"iconsmind-Cardiovascular\"), \n\t\tarray(\"iconsmind-Castle\" => \"iconsmind-Castle\"), \n\t\tarray(\"iconsmind-Cat\" => \"iconsmind-Cat\"), \n\t\tarray(\"iconsmind-Cathedral\" => \"iconsmind-Cathedral\"), \n\t\tarray(\"iconsmind-Cauldron\" => \"iconsmind-Cauldron\"), \n\t\tarray(\"iconsmind-CD\" => \"iconsmind-CD\"), \n\t\tarray(\"iconsmind-Charger\" => \"iconsmind-Charger\"), \n\t\tarray(\"iconsmind-Checkmate\" => \"iconsmind-Checkmate\"), \n\t\tarray(\"iconsmind-Cheese\" => \"iconsmind-Cheese\"), \n\t\tarray(\"iconsmind-Cheetah\" => \"iconsmind-Cheetah\"), \n\t\tarray(\"iconsmind-Chef-Hat\" => \"iconsmind-Chef-Hat\"), \n\t\tarray(\"iconsmind-Chef-Hat2\" => \"iconsmind-Chef-Hat2\"), \n\t\tarray(\"iconsmind-Chess-Board\" => \"iconsmind-Chess-Board\"), \n\t\tarray(\"iconsmind-Chicken\" => \"iconsmind-Chicken\"), \n\t\tarray(\"iconsmind-Chile\" => \"iconsmind-Chile\"), \n\t\tarray(\"iconsmind-Chimney\" => \"iconsmind-Chimney\"), \n\t\tarray(\"iconsmind-China\" => \"iconsmind-China\"), \n\t\tarray(\"iconsmind-Chinese-Temple\" => \"iconsmind-Chinese-Temple\"), \n\t\tarray(\"iconsmind-Chip\" => \"iconsmind-Chip\"), \n\t\tarray(\"iconsmind-Chopsticks\" => \"iconsmind-Chopsticks\"), \n\t\tarray(\"iconsmind-Chopsticks-2\" => \"iconsmind-Chopsticks-2\"), \n\t\tarray(\"iconsmind-Christmas\" => \"iconsmind-Christmas\"), \n\t\tarray(\"iconsmind-Christmas-Ball\" => \"iconsmind-Christmas-Ball\"), \n\t\tarray(\"iconsmind-Christmas-Bell\" => \"iconsmind-Christmas-Bell\"), \n\t\tarray(\"iconsmind-Christmas-Candle\" => \"iconsmind-Christmas-Candle\"), \n\t\tarray(\"iconsmind-Christmas-Hat\" => \"iconsmind-Christmas-Hat\"), \n\t\tarray(\"iconsmind-Christmas-Sleigh\" => \"iconsmind-Christmas-Sleigh\"), \n\t\tarray(\"iconsmind-Christmas-Snowman\" => \"iconsmind-Christmas-Snowman\"), \n\t\tarray(\"iconsmind-Christmas-Sock\" => \"iconsmind-Christmas-Sock\"), \n\t\tarray(\"iconsmind-Christmas-Tree\" => \"iconsmind-Christmas-Tree\"), \n\t\tarray(\"iconsmind-Chrome\" => \"iconsmind-Chrome\"), \n\t\tarray(\"iconsmind-Chrysler-Building\" => \"iconsmind-Chrysler-Building\"), \n\t\tarray(\"iconsmind-City-Hall\" => \"iconsmind-City-Hall\"), \n\t\tarray(\"iconsmind-Clamp\" => \"iconsmind-Clamp\"), \n\t\tarray(\"iconsmind-Claps\" => \"iconsmind-Claps\"), \n\t\tarray(\"iconsmind-Clothing-Store\" => \"iconsmind-Clothing-Store\"), \n\t\tarray(\"iconsmind-Cloud\" => \"iconsmind-Cloud\"), \n\t\tarray(\"iconsmind-Cloud2\" => \"iconsmind-Cloud2\"), \n\t\tarray(\"iconsmind-Cloud3\" => \"iconsmind-Cloud3\"), \n\t\tarray(\"iconsmind-Cloud-Camera\" => \"iconsmind-Cloud-Camera\"), \n\t\tarray(\"iconsmind-Cloud-Computer\" => \"iconsmind-Cloud-Computer\"), \n\t\tarray(\"iconsmind-Cloud-Email\" => \"iconsmind-Cloud-Email\"), \n\t\tarray(\"iconsmind-Cloud-Laptop\" => \"iconsmind-Cloud-Laptop\"), \n\t\tarray(\"iconsmind-Cloud-Lock\" => \"iconsmind-Cloud-Lock\"), \n\t\tarray(\"iconsmind-Cloud-Music\" => \"iconsmind-Cloud-Music\"), \n\t\tarray(\"iconsmind-Cloud-Picture\" => \"iconsmind-Cloud-Picture\"), \n\t\tarray(\"iconsmind-Cloud-Remove\" => \"iconsmind-Cloud-Remove\"), \n\t\tarray(\"iconsmind-Clouds\" => \"iconsmind-Clouds\"), \n\t\tarray(\"iconsmind-Cloud-Secure\" => \"iconsmind-Cloud-Secure\"), \n\t\tarray(\"iconsmind-Cloud-Settings\" => \"iconsmind-Cloud-Settings\"), \n\t\tarray(\"iconsmind-Cloud-Smartphone\" => \"iconsmind-Cloud-Smartphone\"), \n\t\tarray(\"iconsmind-Cloud-Tablet\" => \"iconsmind-Cloud-Tablet\"), \n\t\tarray(\"iconsmind-Cloud-Video\" => \"iconsmind-Cloud-Video\"), \n\t\tarray(\"iconsmind-Clown\" => \"iconsmind-Clown\"), \n\t\tarray(\"iconsmind-CMYK\" => \"iconsmind-CMYK\"), \n\t\tarray(\"iconsmind-Coat\" => \"iconsmind-Coat\"), \n\t\tarray(\"iconsmind-Cocktail\" => \"iconsmind-Cocktail\"), \n\t\tarray(\"iconsmind-Coconut\" => \"iconsmind-Coconut\"), \n\t\tarray(\"iconsmind-Coffee\" => \"iconsmind-Coffee\"), \n\t\tarray(\"iconsmind-Coffee-2\" => \"iconsmind-Coffee-2\"), \n\t\tarray(\"iconsmind-Coffee-Bean\" => \"iconsmind-Coffee-Bean\"), \n\t\tarray(\"iconsmind-Coffee-toGo\" => \"iconsmind-Coffee-toGo\"), \n\t\tarray(\"iconsmind-Coffin\" => \"iconsmind-Coffin\"), \n\t\tarray(\"iconsmind-Coin\" => \"iconsmind-Coin\"), \n\t\tarray(\"iconsmind-Coins\" => \"iconsmind-Coins\"), \n\t\tarray(\"iconsmind-Coins-2\" => \"iconsmind-Coins-2\"), \n\t\tarray(\"iconsmind-Coins-3\" => \"iconsmind-Coins-3\"), \n\t\tarray(\"iconsmind-Colombia\" => \"iconsmind-Colombia\"), \n\t\tarray(\"iconsmind-Colosseum\" => \"iconsmind-Colosseum\"), \n\t\tarray(\"iconsmind-Column\" => \"iconsmind-Column\"), \n\t\tarray(\"iconsmind-Column-2\" => \"iconsmind-Column-2\"), \n\t\tarray(\"iconsmind-Column-3\" => \"iconsmind-Column-3\"), \n\t\tarray(\"iconsmind-Comb\" => \"iconsmind-Comb\"), \n\t\tarray(\"iconsmind-Comb-2\" => \"iconsmind-Comb-2\"), \n\t\tarray(\"iconsmind-Communication-Tower\" => \"iconsmind-Communication-Tower\"), \n\t\tarray(\"iconsmind-Communication-Tower2\" => \"iconsmind-Communication-Tower2\"), \n\t\tarray(\"iconsmind-Compass2\" => \"iconsmind-Compass2\"), \n\t\tarray(\"iconsmind-Compass-22\" => \"iconsmind-Compass-22\"), \n\t\tarray(\"iconsmind-Computer\" => \"iconsmind-Computer\"), \n\t\tarray(\"iconsmind-Computer-2\" => \"iconsmind-Computer-2\"), \n\t\tarray(\"iconsmind-Computer-3\" => \"iconsmind-Computer-3\"), \n\t\tarray(\"iconsmind-Confused\" => \"iconsmind-Confused\"), \n\t\tarray(\"iconsmind-Contrast\" => \"iconsmind-Contrast\"), \n\t\tarray(\"iconsmind-Cookie-Man\" => \"iconsmind-Cookie-Man\"), \n\t\tarray(\"iconsmind-Cookies\" => \"iconsmind-Cookies\"), \n\t\tarray(\"iconsmind-Cool\" => \"iconsmind-Cool\"), \n\t\tarray(\"iconsmind-Costume\" => \"iconsmind-Costume\"), \n\t\tarray(\"iconsmind-Cow\" => \"iconsmind-Cow\"), \n\t\tarray(\"iconsmind-CPU\" => \"iconsmind-CPU\"), \n\t\tarray(\"iconsmind-Cranium\" => \"iconsmind-Cranium\"), \n\t\tarray(\"iconsmind-Credit-Card\" => \"iconsmind-Credit-Card\"), \n\t\tarray(\"iconsmind-Credit-Card2\" => \"iconsmind-Credit-Card2\"), \n\t\tarray(\"iconsmind-Credit-Card3\" => \"iconsmind-Credit-Card3\"), \n\t\tarray(\"iconsmind-Croissant\" => \"iconsmind-Croissant\"), \n\t\tarray(\"iconsmind-Crying\" => \"iconsmind-Crying\"), \n\t\tarray(\"iconsmind-Cupcake\" => \"iconsmind-Cupcake\"), \n\t\tarray(\"iconsmind-Danemark\" => \"iconsmind-Danemark\"), \n\t\tarray(\"iconsmind-Data\" => \"iconsmind-Data\"), \n\t\tarray(\"iconsmind-Data-Backup\" => \"iconsmind-Data-Backup\"), \n\t\tarray(\"iconsmind-Data-Block\" => \"iconsmind-Data-Block\"), \n\t\tarray(\"iconsmind-Data-Center\" => \"iconsmind-Data-Center\"), \n\t\tarray(\"iconsmind-Data-Clock\" => \"iconsmind-Data-Clock\"), \n\t\tarray(\"iconsmind-Data-Cloud\" => \"iconsmind-Data-Cloud\"), \n\t\tarray(\"iconsmind-Data-Compress\" => \"iconsmind-Data-Compress\"), \n\t\tarray(\"iconsmind-Data-Copy\" => \"iconsmind-Data-Copy\"), \n\t\tarray(\"iconsmind-Data-Download\" => \"iconsmind-Data-Download\"), \n\t\tarray(\"iconsmind-Data-Financial\" => \"iconsmind-Data-Financial\"), \n\t\tarray(\"iconsmind-Data-Key\" => \"iconsmind-Data-Key\"), \n\t\tarray(\"iconsmind-Data-Lock\" => \"iconsmind-Data-Lock\"), \n\t\tarray(\"iconsmind-Data-Network\" => \"iconsmind-Data-Network\"), \n\t\tarray(\"iconsmind-Data-Password\" => \"iconsmind-Data-Password\"), \n\t\tarray(\"iconsmind-Data-Power\" => \"iconsmind-Data-Power\"), \n\t\tarray(\"iconsmind-Data-Refresh\" => \"iconsmind-Data-Refresh\"), \n\t\tarray(\"iconsmind-Data-Save\" => \"iconsmind-Data-Save\"), \n\t\tarray(\"iconsmind-Data-Search\" => \"iconsmind-Data-Search\"), \n\t\tarray(\"iconsmind-Data-Security\" => \"iconsmind-Data-Security\"), \n\t\tarray(\"iconsmind-Data-Settings\" => \"iconsmind-Data-Settings\"), \n\t\tarray(\"iconsmind-Data-Sharing\" => \"iconsmind-Data-Sharing\"), \n\t\tarray(\"iconsmind-Data-Shield\" => \"iconsmind-Data-Shield\"), \n\t\tarray(\"iconsmind-Data-Signal\" => \"iconsmind-Data-Signal\"), \n\t\tarray(\"iconsmind-Data-Storage\" => \"iconsmind-Data-Storage\"), \n\t\tarray(\"iconsmind-Data-Stream\" => \"iconsmind-Data-Stream\"), \n\t\tarray(\"iconsmind-Data-Transfer\" => \"iconsmind-Data-Transfer\"), \n\t\tarray(\"iconsmind-Data-Unlock\" => \"iconsmind-Data-Unlock\"), \n\t\tarray(\"iconsmind-Data-Upload\" => \"iconsmind-Data-Upload\"), \n\t\tarray(\"iconsmind-Data-Yes\" => \"iconsmind-Data-Yes\"), \n\t\tarray(\"iconsmind-Death\" => \"iconsmind-Death\"), \n\t\tarray(\"iconsmind-Debian\" => \"iconsmind-Debian\"), \n\t\tarray(\"iconsmind-Dec\" => \"iconsmind-Dec\"), \n\t\tarray(\"iconsmind-Decrase-Inedit\" => \"iconsmind-Decrase-Inedit\"), \n\t\tarray(\"iconsmind-Deer\" => \"iconsmind-Deer\"), \n\t\tarray(\"iconsmind-Deer-2\" => \"iconsmind-Deer-2\"), \n\t\tarray(\"iconsmind-Delete-File\" => \"iconsmind-Delete-File\"), \n\t\tarray(\"iconsmind-Depression\" => \"iconsmind-Depression\"), \n\t\tarray(\"iconsmind-Device-SyncwithCloud\" => \"iconsmind-Device-SyncwithCloud\"), \n\t\tarray(\"iconsmind-Diamond\" => \"iconsmind-Diamond\"), \n\t\tarray(\"iconsmind-Digital-Drawing\" => \"iconsmind-Digital-Drawing\"), \n\t\tarray(\"iconsmind-Dinosaur\" => \"iconsmind-Dinosaur\"), \n\t\tarray(\"iconsmind-Diploma\" => \"iconsmind-Diploma\"), \n\t\tarray(\"iconsmind-Diploma-2\" => \"iconsmind-Diploma-2\"), \n\t\tarray(\"iconsmind-Disk\" => \"iconsmind-Disk\"), \n\t\tarray(\"iconsmind-Dog\" => \"iconsmind-Dog\"), \n\t\tarray(\"iconsmind-Dollar\" => \"iconsmind-Dollar\"), \n\t\tarray(\"iconsmind-Dollar-Sign\" => \"iconsmind-Dollar-Sign\"), \n\t\tarray(\"iconsmind-Dollar-Sign2\" => \"iconsmind-Dollar-Sign2\"), \n\t\tarray(\"iconsmind-Dolphin\" => \"iconsmind-Dolphin\"), \n\t\tarray(\"iconsmind-Door\" => \"iconsmind-Door\"), \n\t\tarray(\"iconsmind-Double-Circle\" => \"iconsmind-Double-Circle\"), \n\t\tarray(\"iconsmind-Doughnut\" => \"iconsmind-Doughnut\"), \n\t\tarray(\"iconsmind-Dove\" => \"iconsmind-Dove\"), \n\t\tarray(\"iconsmind-Down2\" => \"iconsmind-Down2\"), \n\t\tarray(\"iconsmind-Down-2\" => \"iconsmind-Down-2\"), \n\t\tarray(\"iconsmind-Down-3\" => \"iconsmind-Down-3\"), \n\t\tarray(\"iconsmind-Download2\" => \"iconsmind-Download2\"), \n\t\tarray(\"iconsmind-Download-fromCloud\" => \"iconsmind-Download-fromCloud\"), \n\t\tarray(\"iconsmind-Dress\" => \"iconsmind-Dress\"), \n\t\tarray(\"iconsmind-Duck\" => \"iconsmind-Duck\"), \n\t\tarray(\"iconsmind-DVD\" => \"iconsmind-DVD\"), \n\t\tarray(\"iconsmind-Eagle\" => \"iconsmind-Eagle\"), \n\t\tarray(\"iconsmind-Ear\" => \"iconsmind-Ear\"), \n\t\tarray(\"iconsmind-Eggs\" => \"iconsmind-Eggs\"), \n\t\tarray(\"iconsmind-Egypt\" => \"iconsmind-Egypt\"), \n\t\tarray(\"iconsmind-Eifel-Tower\" => \"iconsmind-Eifel-Tower\"), \n\t\tarray(\"iconsmind-Elbow\" => \"iconsmind-Elbow\"), \n\t\tarray(\"iconsmind-El-Castillo\" => \"iconsmind-El-Castillo\"), \n\t\tarray(\"iconsmind-Elephant\" => \"iconsmind-Elephant\"), \n\t\tarray(\"iconsmind-Embassy\" => \"iconsmind-Embassy\"), \n\t\tarray(\"iconsmind-Empire-StateBuilding\" => \"iconsmind-Empire-StateBuilding\"), \n\t\tarray(\"iconsmind-Empty-Box\" => \"iconsmind-Empty-Box\"), \n\t\tarray(\"iconsmind-End2\" => \"iconsmind-End2\"), \n\t\tarray(\"iconsmind-Envelope\" => \"iconsmind-Envelope\"), \n\t\tarray(\"iconsmind-Envelope-2\" => \"iconsmind-Envelope-2\"), \n\t\tarray(\"iconsmind-Eraser\" => \"iconsmind-Eraser\"), \n\t\tarray(\"iconsmind-Eraser-2\" => \"iconsmind-Eraser-2\"), \n\t\tarray(\"iconsmind-Eraser-3\" => \"iconsmind-Eraser-3\"), \n\t\tarray(\"iconsmind-Euro\" => \"iconsmind-Euro\"), \n\t\tarray(\"iconsmind-Euro-Sign\" => \"iconsmind-Euro-Sign\"), \n\t\tarray(\"iconsmind-Euro-Sign2\" => \"iconsmind-Euro-Sign2\"), \n\t\tarray(\"iconsmind-Evil\" => \"iconsmind-Evil\"), \n\t\tarray(\"iconsmind-Eye2\" => \"iconsmind-Eye2\"), \n\t\tarray(\"iconsmind-Eye-Blind\" => \"iconsmind-Eye-Blind\"), \n\t\tarray(\"iconsmind-Eyebrow\" => \"iconsmind-Eyebrow\"), \n\t\tarray(\"iconsmind-Eyebrow-2\" => \"iconsmind-Eyebrow-2\"), \n\t\tarray(\"iconsmind-Eyebrow-3\" => \"iconsmind-Eyebrow-3\"), \n\t\tarray(\"iconsmind-Eyeglasses-Smiley\" => \"iconsmind-Eyeglasses-Smiley\"), \n\t\tarray(\"iconsmind-Eyeglasses-Smiley2\" => \"iconsmind-Eyeglasses-Smiley2\"), \n\t\tarray(\"iconsmind-Eye-Invisible\" => \"iconsmind-Eye-Invisible\"), \n\t\tarray(\"iconsmind-Eye-Visible\" => \"iconsmind-Eye-Visible\"), \n\t\tarray(\"iconsmind-Face-Style\" => \"iconsmind-Face-Style\"), \n\t\tarray(\"iconsmind-Face-Style2\" => \"iconsmind-Face-Style2\"), \n\t\tarray(\"iconsmind-Face-Style3\" => \"iconsmind-Face-Style3\"), \n\t\tarray(\"iconsmind-Face-Style4\" => \"iconsmind-Face-Style4\"), \n\t\tarray(\"iconsmind-Face-Style5\" => \"iconsmind-Face-Style5\"), \n\t\tarray(\"iconsmind-Face-Style6\" => \"iconsmind-Face-Style6\"), \n\t\tarray(\"iconsmind-Factory2\" => \"iconsmind-Factory2\"), \n\t\tarray(\"iconsmind-Fan\" => \"iconsmind-Fan\"), \n\t\tarray(\"iconsmind-Fashion\" => \"iconsmind-Fashion\"), \n\t\tarray(\"iconsmind-Fax\" => \"iconsmind-Fax\"), \n\t\tarray(\"iconsmind-File\" => \"iconsmind-File\"), \n\t\tarray(\"iconsmind-File-Block\" => \"iconsmind-File-Block\"), \n\t\tarray(\"iconsmind-File-Bookmark\" => \"iconsmind-File-Bookmark\"), \n\t\tarray(\"iconsmind-File-Chart\" => \"iconsmind-File-Chart\"), \n\t\tarray(\"iconsmind-File-Clipboard\" => \"iconsmind-File-Clipboard\"), \n\t\tarray(\"iconsmind-File-ClipboardFileText\" => \"iconsmind-File-ClipboardFileText\"), \n\t\tarray(\"iconsmind-File-ClipboardTextImage\" => \"iconsmind-File-ClipboardTextImage\"), \n\t\tarray(\"iconsmind-File-Cloud\" => \"iconsmind-File-Cloud\"), \n\t\tarray(\"iconsmind-File-Copy\" => \"iconsmind-File-Copy\"), \n\t\tarray(\"iconsmind-File-Copy2\" => \"iconsmind-File-Copy2\"), \n\t\tarray(\"iconsmind-File-CSV\" => \"iconsmind-File-CSV\"), \n\t\tarray(\"iconsmind-File-Download\" => \"iconsmind-File-Download\"), \n\t\tarray(\"iconsmind-File-Edit\" => \"iconsmind-File-Edit\"), \n\t\tarray(\"iconsmind-File-Excel\" => \"iconsmind-File-Excel\"), \n\t\tarray(\"iconsmind-File-Favorite\" => \"iconsmind-File-Favorite\"), \n\t\tarray(\"iconsmind-File-Fire\" => \"iconsmind-File-Fire\"), \n\t\tarray(\"iconsmind-File-Graph\" => \"iconsmind-File-Graph\"), \n\t\tarray(\"iconsmind-File-Hide\" => \"iconsmind-File-Hide\"), \n\t\tarray(\"iconsmind-File-Horizontal\" => \"iconsmind-File-Horizontal\"), \n\t\tarray(\"iconsmind-File-HorizontalText\" => \"iconsmind-File-HorizontalText\"), \n\t\tarray(\"iconsmind-File-HTML\" => \"iconsmind-File-HTML\"), \n\t\tarray(\"iconsmind-File-JPG\" => \"iconsmind-File-JPG\"), \n\t\tarray(\"iconsmind-File-Link\" => \"iconsmind-File-Link\"), \n\t\tarray(\"iconsmind-File-Loading\" => \"iconsmind-File-Loading\"), \n\t\tarray(\"iconsmind-File-Lock\" => \"iconsmind-File-Lock\"), \n\t\tarray(\"iconsmind-File-Love\" => \"iconsmind-File-Love\"), \n\t\tarray(\"iconsmind-File-Music\" => \"iconsmind-File-Music\"), \n\t\tarray(\"iconsmind-File-Network\" => \"iconsmind-File-Network\"), \n\t\tarray(\"iconsmind-File-Pictures\" => \"iconsmind-File-Pictures\"), \n\t\tarray(\"iconsmind-File-Pie\" => \"iconsmind-File-Pie\"), \n\t\tarray(\"iconsmind-File-Presentation\" => \"iconsmind-File-Presentation\"), \n\t\tarray(\"iconsmind-File-Refresh\" => \"iconsmind-File-Refresh\"), \n\t\tarray(\"iconsmind-Files\" => \"iconsmind-Files\"), \n\t\tarray(\"iconsmind-File-Search\" => \"iconsmind-File-Search\"), \n\t\tarray(\"iconsmind-File-Settings\" => \"iconsmind-File-Settings\"), \n\t\tarray(\"iconsmind-File-Share\" => \"iconsmind-File-Share\"), \n\t\tarray(\"iconsmind-File-TextImage\" => \"iconsmind-File-TextImage\"), \n\t\tarray(\"iconsmind-File-Trash\" => \"iconsmind-File-Trash\"), \n\t\tarray(\"iconsmind-File-TXT\" => \"iconsmind-File-TXT\"), \n\t\tarray(\"iconsmind-File-Upload\" => \"iconsmind-File-Upload\"), \n\t\tarray(\"iconsmind-File-Video\" => \"iconsmind-File-Video\"), \n\t\tarray(\"iconsmind-File-Word\" => \"iconsmind-File-Word\"), \n\t\tarray(\"iconsmind-File-Zip\" => \"iconsmind-File-Zip\"), \n\t\tarray(\"iconsmind-Financial\" => \"iconsmind-Financial\"), \n\t\tarray(\"iconsmind-Finger\" => \"iconsmind-Finger\"), \n\t\tarray(\"iconsmind-Fingerprint\" => \"iconsmind-Fingerprint\"), \n\t\tarray(\"iconsmind-Fingerprint-2\" => \"iconsmind-Fingerprint-2\"), \n\t\tarray(\"iconsmind-Firefox\" => \"iconsmind-Firefox\"), \n\t\tarray(\"iconsmind-Fire-Staion\" => \"iconsmind-Fire-Staion\"), \n\t\tarray(\"iconsmind-Fish\" => \"iconsmind-Fish\"), \n\t\tarray(\"iconsmind-Fit-To\" => \"iconsmind-Fit-To\"), \n\t\tarray(\"iconsmind-Fit-To2\" => \"iconsmind-Fit-To2\"), \n\t\tarray(\"iconsmind-Flag2\" => \"iconsmind-Flag2\"), \n\t\tarray(\"iconsmind-Flag-22\" => \"iconsmind-Flag-22\"), \n\t\tarray(\"iconsmind-Flag-3\" => \"iconsmind-Flag-3\"), \n\t\tarray(\"iconsmind-Flag-4\" => \"iconsmind-Flag-4\"), \n\t\tarray(\"iconsmind-Flamingo\" => \"iconsmind-Flamingo\"), \n\t\tarray(\"iconsmind-Folder\" => \"iconsmind-Folder\"), \n\t\tarray(\"iconsmind-Folder-Add\" => \"iconsmind-Folder-Add\"), \n\t\tarray(\"iconsmind-Folder-Archive\" => \"iconsmind-Folder-Archive\"), \n\t\tarray(\"iconsmind-Folder-Binder\" => \"iconsmind-Folder-Binder\"), \n\t\tarray(\"iconsmind-Folder-Binder2\" => \"iconsmind-Folder-Binder2\"), \n\t\tarray(\"iconsmind-Folder-Block\" => \"iconsmind-Folder-Block\"), \n\t\tarray(\"iconsmind-Folder-Bookmark\" => \"iconsmind-Folder-Bookmark\"), \n\t\tarray(\"iconsmind-Folder-Close\" => \"iconsmind-Folder-Close\"), \n\t\tarray(\"iconsmind-Folder-Cloud\" => \"iconsmind-Folder-Cloud\"), \n\t\tarray(\"iconsmind-Folder-Delete\" => \"iconsmind-Folder-Delete\"), \n\t\tarray(\"iconsmind-Folder-Download\" => \"iconsmind-Folder-Download\"), \n\t\tarray(\"iconsmind-Folder-Edit\" => \"iconsmind-Folder-Edit\"), \n\t\tarray(\"iconsmind-Folder-Favorite\" => \"iconsmind-Folder-Favorite\"), \n\t\tarray(\"iconsmind-Folder-Fire\" => \"iconsmind-Folder-Fire\"), \n\t\tarray(\"iconsmind-Folder-Hide\" => \"iconsmind-Folder-Hide\"), \n\t\tarray(\"iconsmind-Folder-Link\" => \"iconsmind-Folder-Link\"), \n\t\tarray(\"iconsmind-Folder-Loading\" => \"iconsmind-Folder-Loading\"), \n\t\tarray(\"iconsmind-Folder-Lock\" => \"iconsmind-Folder-Lock\"), \n\t\tarray(\"iconsmind-Folder-Love\" => \"iconsmind-Folder-Love\"), \n\t\tarray(\"iconsmind-Folder-Music\" => \"iconsmind-Folder-Music\"), \n\t\tarray(\"iconsmind-Folder-Network\" => \"iconsmind-Folder-Network\"), \n\t\tarray(\"iconsmind-Folder-Open\" => \"iconsmind-Folder-Open\"), \n\t\tarray(\"iconsmind-Folder-Open2\" => \"iconsmind-Folder-Open2\"), \n\t\tarray(\"iconsmind-Folder-Organizing\" => \"iconsmind-Folder-Organizing\"), \n\t\tarray(\"iconsmind-Folder-Pictures\" => \"iconsmind-Folder-Pictures\"), \n\t\tarray(\"iconsmind-Folder-Refresh\" => \"iconsmind-Folder-Refresh\"), \n\t\tarray(\"iconsmind-Folder-Remove\" => \"iconsmind-Folder-Remove\"), \n\t\tarray(\"iconsmind-Folders\" => \"iconsmind-Folders\"), \n\t\tarray(\"iconsmind-Folder-Search\" => \"iconsmind-Folder-Search\"), \n\t\tarray(\"iconsmind-Folder-Settings\" => \"iconsmind-Folder-Settings\"), \n\t\tarray(\"iconsmind-Folder-Share\" => \"iconsmind-Folder-Share\"), \n\t\tarray(\"iconsmind-Folder-Trash\" => \"iconsmind-Folder-Trash\"), \n\t\tarray(\"iconsmind-Folder-Upload\" => \"iconsmind-Folder-Upload\"), \n\t\tarray(\"iconsmind-Folder-Video\" => \"iconsmind-Folder-Video\"), \n\t\tarray(\"iconsmind-Folder-WithDocument\" => \"iconsmind-Folder-WithDocument\"), \n\t\tarray(\"iconsmind-Folder-Zip\" => \"iconsmind-Folder-Zip\"), \n\t\tarray(\"iconsmind-Foot\" => \"iconsmind-Foot\"), \n\t\tarray(\"iconsmind-Foot-2\" => \"iconsmind-Foot-2\"), \n\t\tarray(\"iconsmind-Fork\" => \"iconsmind-Fork\"), \n\t\tarray(\"iconsmind-Formula\" => \"iconsmind-Formula\"), \n\t\tarray(\"iconsmind-Fountain-Pen\" => \"iconsmind-Fountain-Pen\"), \n\t\tarray(\"iconsmind-Fox\" => \"iconsmind-Fox\"), \n\t\tarray(\"iconsmind-Frankenstein\" => \"iconsmind-Frankenstein\"), \n\t\tarray(\"iconsmind-French-Fries\" => \"iconsmind-French-Fries\"), \n\t\tarray(\"iconsmind-Frog\" => \"iconsmind-Frog\"), \n\t\tarray(\"iconsmind-Fruits\" => \"iconsmind-Fruits\"), \n\t\tarray(\"iconsmind-Full-Screen\" => \"iconsmind-Full-Screen\"), \n\t\tarray(\"iconsmind-Full-Screen2\" => \"iconsmind-Full-Screen2\"), \n\t\tarray(\"iconsmind-Full-View\" => \"iconsmind-Full-View\"), \n\t\tarray(\"iconsmind-Full-View2\" => \"iconsmind-Full-View2\"), \n\t\tarray(\"iconsmind-Funky\" => \"iconsmind-Funky\"), \n\t\tarray(\"iconsmind-Funny-Bicycle\" => \"iconsmind-Funny-Bicycle\"), \n\t\tarray(\"iconsmind-Gamepad\" => \"iconsmind-Gamepad\"), \n\t\tarray(\"iconsmind-Gamepad-2\" => \"iconsmind-Gamepad-2\"), \n\t\tarray(\"iconsmind-Gay\" => \"iconsmind-Gay\"), \n\t\tarray(\"iconsmind-Geek2\" => \"iconsmind-Geek2\"), \n\t\tarray(\"iconsmind-Gentleman\" => \"iconsmind-Gentleman\"), \n\t\tarray(\"iconsmind-Giraffe\" => \"iconsmind-Giraffe\"), \n\t\tarray(\"iconsmind-Glasses\" => \"iconsmind-Glasses\"), \n\t\tarray(\"iconsmind-Glasses-2\" => \"iconsmind-Glasses-2\"), \n\t\tarray(\"iconsmind-Glasses-3\" => \"iconsmind-Glasses-3\"), \n\t\tarray(\"iconsmind-Glass-Water\" => \"iconsmind-Glass-Water\"), \n\t\tarray(\"iconsmind-Gloves\" => \"iconsmind-Gloves\"), \n\t\tarray(\"iconsmind-Go-Bottom\" => \"iconsmind-Go-Bottom\"), \n\t\tarray(\"iconsmind-Gorilla\" => \"iconsmind-Gorilla\"), \n\t\tarray(\"iconsmind-Go-Top\" => \"iconsmind-Go-Top\"), \n\t\tarray(\"iconsmind-Grave\" => \"iconsmind-Grave\"), \n\t\tarray(\"iconsmind-Graveyard\" => \"iconsmind-Graveyard\"), \n\t\tarray(\"iconsmind-Greece\" => \"iconsmind-Greece\"), \n\t\tarray(\"iconsmind-Hair\" => \"iconsmind-Hair\"), \n\t\tarray(\"iconsmind-Hair-2\" => \"iconsmind-Hair-2\"), \n\t\tarray(\"iconsmind-Hair-3\" => \"iconsmind-Hair-3\"), \n\t\tarray(\"iconsmind-Halloween-HalfMoon\" => \"iconsmind-Halloween-HalfMoon\"), \n\t\tarray(\"iconsmind-Halloween-Moon\" => \"iconsmind-Halloween-Moon\"), \n\t\tarray(\"iconsmind-Hamburger\" => \"iconsmind-Hamburger\"), \n\t\tarray(\"iconsmind-Hand\" => \"iconsmind-Hand\"), \n\t\tarray(\"iconsmind-Hands\" => \"iconsmind-Hands\"), \n\t\tarray(\"iconsmind-Handshake\" => \"iconsmind-Handshake\"), \n\t\tarray(\"iconsmind-Hanger\" => \"iconsmind-Hanger\"), \n\t\tarray(\"iconsmind-Happy\" => \"iconsmind-Happy\"), \n\t\tarray(\"iconsmind-Hat\" => \"iconsmind-Hat\"), \n\t\tarray(\"iconsmind-Hat-2\" => \"iconsmind-Hat-2\"), \n\t\tarray(\"iconsmind-Haunted-House\" => \"iconsmind-Haunted-House\"), \n\t\tarray(\"iconsmind-HD\" => \"iconsmind-HD\"), \n\t\tarray(\"iconsmind-HDD\" => \"iconsmind-HDD\"), \n\t\tarray(\"iconsmind-Heart2\" => \"iconsmind-Heart2\"), \n\t\tarray(\"iconsmind-Heels\" => \"iconsmind-Heels\"), \n\t\tarray(\"iconsmind-Heels-2\" => \"iconsmind-Heels-2\"), \n\t\tarray(\"iconsmind-Hello\" => \"iconsmind-Hello\"), \n\t\tarray(\"iconsmind-Hipo\" => \"iconsmind-Hipo\"), \n\t\tarray(\"iconsmind-Hipster-Glasses\" => \"iconsmind-Hipster-Glasses\"), \n\t\tarray(\"iconsmind-Hipster-Glasses2\" => \"iconsmind-Hipster-Glasses2\"), \n\t\tarray(\"iconsmind-Hipster-Glasses3\" => \"iconsmind-Hipster-Glasses3\"), \n\t\tarray(\"iconsmind-Hipster-Headphones\" => \"iconsmind-Hipster-Headphones\"), \n\t\tarray(\"iconsmind-Hipster-Men\" => \"iconsmind-Hipster-Men\"), \n\t\tarray(\"iconsmind-Hipster-Men2\" => \"iconsmind-Hipster-Men2\"), \n\t\tarray(\"iconsmind-Hipster-Men3\" => \"iconsmind-Hipster-Men3\"), \n\t\tarray(\"iconsmind-Hipster-Sunglasses\" => \"iconsmind-Hipster-Sunglasses\"), \n\t\tarray(\"iconsmind-Hipster-Sunglasses2\" => \"iconsmind-Hipster-Sunglasses2\"), \n\t\tarray(\"iconsmind-Hipster-Sunglasses3\" => \"iconsmind-Hipster-Sunglasses3\"), \n\t\tarray(\"iconsmind-Holly\" => \"iconsmind-Holly\"), \n\t\tarray(\"iconsmind-Home2\" => \"iconsmind-Home2\"), \n\t\tarray(\"iconsmind-Home-2\" => \"iconsmind-Home-2\"), \n\t\tarray(\"iconsmind-Home-3\" => \"iconsmind-Home-3\"), \n\t\tarray(\"iconsmind-Home-4\" => \"iconsmind-Home-4\"), \n\t\tarray(\"iconsmind-Honey\" => \"iconsmind-Honey\"), \n\t\tarray(\"iconsmind-Hong-Kong\" => \"iconsmind-Hong-Kong\"), \n\t\tarray(\"iconsmind-Hoodie\" => \"iconsmind-Hoodie\"), \n\t\tarray(\"iconsmind-Horror\" => \"iconsmind-Horror\"), \n\t\tarray(\"iconsmind-Horse\" => \"iconsmind-Horse\"), \n\t\tarray(\"iconsmind-Hospital2\" => \"iconsmind-Hospital2\"), \n\t\tarray(\"iconsmind-Host\" => \"iconsmind-Host\"), \n\t\tarray(\"iconsmind-Hot-Dog\" => \"iconsmind-Hot-Dog\"), \n\t\tarray(\"iconsmind-Hotel\" => \"iconsmind-Hotel\"), \n\t\tarray(\"iconsmind-Hub\" => \"iconsmind-Hub\"), \n\t\tarray(\"iconsmind-Humor\" => \"iconsmind-Humor\"), \n\t\tarray(\"iconsmind-Ice-Cream\" => \"iconsmind-Ice-Cream\"), \n\t\tarray(\"iconsmind-Idea\" => \"iconsmind-Idea\"), \n\t\tarray(\"iconsmind-Inbox\" => \"iconsmind-Inbox\"), \n\t\tarray(\"iconsmind-Inbox-Empty\" => \"iconsmind-Inbox-Empty\"), \n\t\tarray(\"iconsmind-Inbox-Forward\" => \"iconsmind-Inbox-Forward\"), \n\t\tarray(\"iconsmind-Inbox-Full\" => \"iconsmind-Inbox-Full\"), \n\t\tarray(\"iconsmind-Inbox-Into\" => \"iconsmind-Inbox-Into\"), \n\t\tarray(\"iconsmind-Inbox-Out\" => \"iconsmind-Inbox-Out\"), \n\t\tarray(\"iconsmind-Inbox-Reply\" => \"iconsmind-Inbox-Reply\"), \n\t\tarray(\"iconsmind-Increase-Inedit\" => \"iconsmind-Increase-Inedit\"), \n\t\tarray(\"iconsmind-Indent-FirstLine\" => \"iconsmind-Indent-FirstLine\"), \n\t\tarray(\"iconsmind-Indent-LeftMargin\" => \"iconsmind-Indent-LeftMargin\"), \n\t\tarray(\"iconsmind-Indent-RightMargin\" => \"iconsmind-Indent-RightMargin\"), \n\t\tarray(\"iconsmind-India\" => \"iconsmind-India\"), \n\t\tarray(\"iconsmind-Internet-Explorer\" => \"iconsmind-Internet-Explorer\"), \n\t\tarray(\"iconsmind-Internet-Smiley\" => \"iconsmind-Internet-Smiley\"), \n\t\tarray(\"iconsmind-iOS-Apple\" => \"iconsmind-iOS-Apple\"), \n\t\tarray(\"iconsmind-Israel\" => \"iconsmind-Israel\"), \n\t\tarray(\"iconsmind-Jacket\" => \"iconsmind-Jacket\"), \n\t\tarray(\"iconsmind-Jamaica\" => \"iconsmind-Jamaica\"), \n\t\tarray(\"iconsmind-Japan\" => \"iconsmind-Japan\"), \n\t\tarray(\"iconsmind-Japanese-Gate\" => \"iconsmind-Japanese-Gate\"), \n\t\tarray(\"iconsmind-Jeans\" => \"iconsmind-Jeans\"), \n\t\tarray(\"iconsmind-Joystick\" => \"iconsmind-Joystick\"), \n\t\tarray(\"iconsmind-Juice\" => \"iconsmind-Juice\"), \n\t\tarray(\"iconsmind-Kangoroo\" => \"iconsmind-Kangoroo\"), \n\t\tarray(\"iconsmind-Kenya\" => \"iconsmind-Kenya\"), \n\t\tarray(\"iconsmind-Keyboard\" => \"iconsmind-Keyboard\"), \n\t\tarray(\"iconsmind-Keypad\" => \"iconsmind-Keypad\"), \n\t\tarray(\"iconsmind-King\" => \"iconsmind-King\"), \n\t\tarray(\"iconsmind-Kiss\" => \"iconsmind-Kiss\"), \n\t\tarray(\"iconsmind-Knee\" => \"iconsmind-Knee\"), \n\t\tarray(\"iconsmind-Knife\" => \"iconsmind-Knife\"), \n\t\tarray(\"iconsmind-Knight\" => \"iconsmind-Knight\"), \n\t\tarray(\"iconsmind-Koala\" => \"iconsmind-Koala\"), \n\t\tarray(\"iconsmind-Korea\" => \"iconsmind-Korea\"), \n\t\tarray(\"iconsmind-Lantern\" => \"iconsmind-Lantern\"), \n\t\tarray(\"iconsmind-Laptop\" => \"iconsmind-Laptop\"), \n\t\tarray(\"iconsmind-Laptop-2\" => \"iconsmind-Laptop-2\"), \n\t\tarray(\"iconsmind-Laptop-3\" => \"iconsmind-Laptop-3\"), \n\t\tarray(\"iconsmind-Laptop-Phone\" => \"iconsmind-Laptop-Phone\"), \n\t\tarray(\"iconsmind-Laptop-Tablet\" => \"iconsmind-Laptop-Tablet\"), \n\t\tarray(\"iconsmind-Laughing\" => \"iconsmind-Laughing\"), \n\t\tarray(\"iconsmind-Leaning-Tower\" => \"iconsmind-Leaning-Tower\"), \n\t\tarray(\"iconsmind-Left2\" => \"iconsmind-Left2\"), \n\t\tarray(\"iconsmind-Left-2\" => \"iconsmind-Left-2\"), \n\t\tarray(\"iconsmind-Left-3\" => \"iconsmind-Left-3\"), \n\t\tarray(\"iconsmind-Left-ToRight\" => \"iconsmind-Left-ToRight\"), \n\t\tarray(\"iconsmind-Leg\" => \"iconsmind-Leg\"), \n\t\tarray(\"iconsmind-Leg-2\" => \"iconsmind-Leg-2\"), \n\t\tarray(\"iconsmind-Lemon\" => \"iconsmind-Lemon\"), \n\t\tarray(\"iconsmind-Leopard\" => \"iconsmind-Leopard\"), \n\t\tarray(\"iconsmind-Letter-Close\" => \"iconsmind-Letter-Close\"), \n\t\tarray(\"iconsmind-Letter-Open\" => \"iconsmind-Letter-Open\"), \n\t\tarray(\"iconsmind-Letter-Sent\" => \"iconsmind-Letter-Sent\"), \n\t\tarray(\"iconsmind-Library2\" => \"iconsmind-Library2\"), \n\t\tarray(\"iconsmind-Lighthouse\" => \"iconsmind-Lighthouse\"), \n\t\tarray(\"iconsmind-Line-Chart\" => \"iconsmind-Line-Chart\"), \n\t\tarray(\"iconsmind-Line-Chart2\" => \"iconsmind-Line-Chart2\"), \n\t\tarray(\"iconsmind-Line-Chart3\" => \"iconsmind-Line-Chart3\"), \n\t\tarray(\"iconsmind-Line-Chart4\" => \"iconsmind-Line-Chart4\"), \n\t\tarray(\"iconsmind-Line-Spacing\" => \"iconsmind-Line-Spacing\"), \n\t\tarray(\"iconsmind-Linux\" => \"iconsmind-Linux\"), \n\t\tarray(\"iconsmind-Lion\" => \"iconsmind-Lion\"), \n\t\tarray(\"iconsmind-Lollipop\" => \"iconsmind-Lollipop\"), \n\t\tarray(\"iconsmind-Lollipop-2\" => \"iconsmind-Lollipop-2\"), \n\t\tarray(\"iconsmind-Loop\" => \"iconsmind-Loop\"), \n\t\tarray(\"iconsmind-Love2\" => \"iconsmind-Love2\"), \n\t\tarray(\"iconsmind-Mail\" => \"iconsmind-Mail\"), \n\t\tarray(\"iconsmind-Mail-2\" => \"iconsmind-Mail-2\"), \n\t\tarray(\"iconsmind-Mail-3\" => \"iconsmind-Mail-3\"), \n\t\tarray(\"iconsmind-Mail-Add\" => \"iconsmind-Mail-Add\"), \n\t\tarray(\"iconsmind-Mail-Attachement\" => \"iconsmind-Mail-Attachement\"), \n\t\tarray(\"iconsmind-Mail-Block\" => \"iconsmind-Mail-Block\"), \n\t\tarray(\"iconsmind-Mailbox-Empty\" => \"iconsmind-Mailbox-Empty\"), \n\t\tarray(\"iconsmind-Mailbox-Full\" => \"iconsmind-Mailbox-Full\"), \n\t\tarray(\"iconsmind-Mail-Delete\" => \"iconsmind-Mail-Delete\"), \n\t\tarray(\"iconsmind-Mail-Favorite\" => \"iconsmind-Mail-Favorite\"), \n\t\tarray(\"iconsmind-Mail-Forward\" => \"iconsmind-Mail-Forward\"), \n\t\tarray(\"iconsmind-Mail-Gallery\" => \"iconsmind-Mail-Gallery\"), \n\t\tarray(\"iconsmind-Mail-Inbox\" => \"iconsmind-Mail-Inbox\"), \n\t\tarray(\"iconsmind-Mail-Link\" => \"iconsmind-Mail-Link\"), \n\t\tarray(\"iconsmind-Mail-Lock\" => \"iconsmind-Mail-Lock\"), \n\t\tarray(\"iconsmind-Mail-Love\" => \"iconsmind-Mail-Love\"), \n\t\tarray(\"iconsmind-Mail-Money\" => \"iconsmind-Mail-Money\"), \n\t\tarray(\"iconsmind-Mail-Open\" => \"iconsmind-Mail-Open\"), \n\t\tarray(\"iconsmind-Mail-Outbox\" => \"iconsmind-Mail-Outbox\"), \n\t\tarray(\"iconsmind-Mail-Password\" => \"iconsmind-Mail-Password\"), \n\t\tarray(\"iconsmind-Mail-Photo\" => \"iconsmind-Mail-Photo\"), \n\t\tarray(\"iconsmind-Mail-Read\" => \"iconsmind-Mail-Read\"), \n\t\tarray(\"iconsmind-Mail-Removex\" => \"iconsmind-Mail-Removex\"), \n\t\tarray(\"iconsmind-Mail-Reply\" => \"iconsmind-Mail-Reply\"), \n\t\tarray(\"iconsmind-Mail-ReplyAll\" => \"iconsmind-Mail-ReplyAll\"), \n\t\tarray(\"iconsmind-Mail-Search\" => \"iconsmind-Mail-Search\"), \n\t\tarray(\"iconsmind-Mail-Send\" => \"iconsmind-Mail-Send\"), \n\t\tarray(\"iconsmind-Mail-Settings\" => \"iconsmind-Mail-Settings\"), \n\t\tarray(\"iconsmind-Mail-Unread\" => \"iconsmind-Mail-Unread\"), \n\t\tarray(\"iconsmind-Mail-Video\" => \"iconsmind-Mail-Video\"), \n\t\tarray(\"iconsmind-Mail-withAtSign\" => \"iconsmind-Mail-withAtSign\"), \n\t\tarray(\"iconsmind-Mail-WithCursors\" => \"iconsmind-Mail-WithCursors\"), \n\t\tarray(\"iconsmind-Mans-Underwear\" => \"iconsmind-Mans-Underwear\"), \n\t\tarray(\"iconsmind-Mans-Underwear2\" => \"iconsmind-Mans-Underwear2\"), \n\t\tarray(\"iconsmind-Marker\" => \"iconsmind-Marker\"), \n\t\tarray(\"iconsmind-Marker-2\" => \"iconsmind-Marker-2\"), \n\t\tarray(\"iconsmind-Marker-3\" => \"iconsmind-Marker-3\"), \n\t\tarray(\"iconsmind-Martini-Glass\" => \"iconsmind-Martini-Glass\"), \n\t\tarray(\"iconsmind-Master-Card\" => \"iconsmind-Master-Card\"), \n\t\tarray(\"iconsmind-Maximize\" => \"iconsmind-Maximize\"), \n\t\tarray(\"iconsmind-Megaphone\" => \"iconsmind-Megaphone\"), \n\t\tarray(\"iconsmind-Mexico\" => \"iconsmind-Mexico\"), \n\t\tarray(\"iconsmind-Milk-Bottle\" => \"iconsmind-Milk-Bottle\"), \n\t\tarray(\"iconsmind-Minimize\" => \"iconsmind-Minimize\"), \n\t\tarray(\"iconsmind-Money\" => \"iconsmind-Money\"), \n\t\tarray(\"iconsmind-Money-2\" => \"iconsmind-Money-2\"), \n\t\tarray(\"iconsmind-Money-Bag\" => \"iconsmind-Money-Bag\"), \n\t\tarray(\"iconsmind-Monitor\" => \"iconsmind-Monitor\"), \n\t\tarray(\"iconsmind-Monitor-2\" => \"iconsmind-Monitor-2\"), \n\t\tarray(\"iconsmind-Monitor-3\" => \"iconsmind-Monitor-3\"), \n\t\tarray(\"iconsmind-Monitor-4\" => \"iconsmind-Monitor-4\"), \n\t\tarray(\"iconsmind-Monitor-5\" => \"iconsmind-Monitor-5\"), \n\t\tarray(\"iconsmind-Monitor-Laptop\" => \"iconsmind-Monitor-Laptop\"), \n\t\tarray(\"iconsmind-Monitor-phone\" => \"iconsmind-Monitor-phone\"), \n\t\tarray(\"iconsmind-Monitor-Tablet\" => \"iconsmind-Monitor-Tablet\"), \n\t\tarray(\"iconsmind-Monitor-Vertical\" => \"iconsmind-Monitor-Vertical\"), \n\t\tarray(\"iconsmind-Monkey\" => \"iconsmind-Monkey\"), \n\t\tarray(\"iconsmind-Monster\" => \"iconsmind-Monster\"), \n\t\tarray(\"iconsmind-Morocco\" => \"iconsmind-Morocco\"), \n\t\tarray(\"iconsmind-Mouse\" => \"iconsmind-Mouse\"), \n\t\tarray(\"iconsmind-Mouse-2\" => \"iconsmind-Mouse-2\"), \n\t\tarray(\"iconsmind-Mouse-3\" => \"iconsmind-Mouse-3\"), \n\t\tarray(\"iconsmind-Moustache-Smiley\" => \"iconsmind-Moustache-Smiley\"), \n\t\tarray(\"iconsmind-Museum\" => \"iconsmind-Museum\"), \n\t\tarray(\"iconsmind-Mushroom\" => \"iconsmind-Mushroom\"), \n\t\tarray(\"iconsmind-Mustache\" => \"iconsmind-Mustache\"), \n\t\tarray(\"iconsmind-Mustache-2\" => \"iconsmind-Mustache-2\"), \n\t\tarray(\"iconsmind-Mustache-3\" => \"iconsmind-Mustache-3\"), \n\t\tarray(\"iconsmind-Mustache-4\" => \"iconsmind-Mustache-4\"), \n\t\tarray(\"iconsmind-Mustache-5\" => \"iconsmind-Mustache-5\"), \n\t\tarray(\"iconsmind-Navigate-End\" => \"iconsmind-Navigate-End\"), \n\t\tarray(\"iconsmind-Navigat-Start\" => \"iconsmind-Navigat-Start\"), \n\t\tarray(\"iconsmind-Nepal\" => \"iconsmind-Nepal\"), \n\t\tarray(\"iconsmind-Netscape\" => \"iconsmind-Netscape\"), \n\t\tarray(\"iconsmind-New-Mail\" => \"iconsmind-New-Mail\"), \n\t\tarray(\"iconsmind-Newspaper\" => \"iconsmind-Newspaper\"), \n\t\tarray(\"iconsmind-Newspaper-2\" => \"iconsmind-Newspaper-2\"), \n\t\tarray(\"iconsmind-No-Battery\" => \"iconsmind-No-Battery\"), \n\t\tarray(\"iconsmind-Noose\" => \"iconsmind-Noose\"), \n\t\tarray(\"iconsmind-Note\" => \"iconsmind-Note\"), \n\t\tarray(\"iconsmind-Notepad\" => \"iconsmind-Notepad\"), \n\t\tarray(\"iconsmind-Notepad-2\" => \"iconsmind-Notepad-2\"), \n\t\tarray(\"iconsmind-Office\" => \"iconsmind-Office\"), \n\t\tarray(\"iconsmind-Old-Camera\" => \"iconsmind-Old-Camera\"), \n\t\tarray(\"iconsmind-Old-Cassette\" => \"iconsmind-Old-Cassette\"), \n\t\tarray(\"iconsmind-Old-Sticky\" => \"iconsmind-Old-Sticky\"), \n\t\tarray(\"iconsmind-Old-Sticky2\" => \"iconsmind-Old-Sticky2\"), \n\t\tarray(\"iconsmind-Old-Telephone\" => \"iconsmind-Old-Telephone\"), \n\t\tarray(\"iconsmind-Open-Banana\" => \"iconsmind-Open-Banana\"), \n\t\tarray(\"iconsmind-Open-Book\" => \"iconsmind-Open-Book\"), \n\t\tarray(\"iconsmind-Opera\" => \"iconsmind-Opera\"), \n\t\tarray(\"iconsmind-Opera-House\" => \"iconsmind-Opera-House\"), \n\t\tarray(\"iconsmind-Orientation2\" => \"iconsmind-Orientation2\"), \n\t\tarray(\"iconsmind-Orientation-2\" => \"iconsmind-Orientation-2\"), \n\t\tarray(\"iconsmind-Ornament\" => \"iconsmind-Ornament\"), \n\t\tarray(\"iconsmind-Owl\" => \"iconsmind-Owl\"), \n\t\tarray(\"iconsmind-Paintbrush\" => \"iconsmind-Paintbrush\"), \n\t\tarray(\"iconsmind-Palette\" => \"iconsmind-Palette\"), \n\t\tarray(\"iconsmind-Panda\" => \"iconsmind-Panda\"), \n\t\tarray(\"iconsmind-Pantheon\" => \"iconsmind-Pantheon\"), \n\t\tarray(\"iconsmind-Pantone\" => \"iconsmind-Pantone\"), \n\t\tarray(\"iconsmind-Pants\" => \"iconsmind-Pants\"), \n\t\tarray(\"iconsmind-Paper\" => \"iconsmind-Paper\"), \n\t\tarray(\"iconsmind-Parrot\" => \"iconsmind-Parrot\"), \n\t\tarray(\"iconsmind-Pawn\" => \"iconsmind-Pawn\"), \n\t\tarray(\"iconsmind-Pen\" => \"iconsmind-Pen\"), \n\t\tarray(\"iconsmind-Pen-2\" => \"iconsmind-Pen-2\"), \n\t\tarray(\"iconsmind-Pen-3\" => \"iconsmind-Pen-3\"), \n\t\tarray(\"iconsmind-Pen-4\" => \"iconsmind-Pen-4\"), \n\t\tarray(\"iconsmind-Pen-5\" => \"iconsmind-Pen-5\"), \n\t\tarray(\"iconsmind-Pen-6\" => \"iconsmind-Pen-6\"), \n\t\tarray(\"iconsmind-Pencil\" => \"iconsmind-Pencil\"), \n\t\tarray(\"iconsmind-Pencil-Ruler\" => \"iconsmind-Pencil-Ruler\"), \n\t\tarray(\"iconsmind-Penguin\" => \"iconsmind-Penguin\"), \n\t\tarray(\"iconsmind-Pentagon\" => \"iconsmind-Pentagon\"), \n\t\tarray(\"iconsmind-People-onCloud\" => \"iconsmind-People-onCloud\"), \n\t\tarray(\"iconsmind-Pepper\" => \"iconsmind-Pepper\"), \n\t\tarray(\"iconsmind-Pepper-withFire\" => \"iconsmind-Pepper-withFire\"), \n\t\tarray(\"iconsmind-Petronas-Tower\" => \"iconsmind-Petronas-Tower\"), \n\t\tarray(\"iconsmind-Philipines\" => \"iconsmind-Philipines\"), \n\t\tarray(\"iconsmind-Phone\" => \"iconsmind-Phone\"), \n\t\tarray(\"iconsmind-Phone-2\" => \"iconsmind-Phone-2\"), \n\t\tarray(\"iconsmind-Phone-3\" => \"iconsmind-Phone-3\"), \n\t\tarray(\"iconsmind-Phone-3G\" => \"iconsmind-Phone-3G\"), \n\t\tarray(\"iconsmind-Phone-4G\" => \"iconsmind-Phone-4G\"), \n\t\tarray(\"iconsmind-Phone-Simcard\" => \"iconsmind-Phone-Simcard\"), \n\t\tarray(\"iconsmind-Phone-SMS\" => \"iconsmind-Phone-SMS\"), \n\t\tarray(\"iconsmind-Phone-Wifi\" => \"iconsmind-Phone-Wifi\"), \n\t\tarray(\"iconsmind-Pi\" => \"iconsmind-Pi\"), \n\t\tarray(\"iconsmind-Pie-Chart\" => \"iconsmind-Pie-Chart\"), \n\t\tarray(\"iconsmind-Pie-Chart2\" => \"iconsmind-Pie-Chart2\"), \n\t\tarray(\"iconsmind-Pie-Chart3\" => \"iconsmind-Pie-Chart3\"), \n\t\tarray(\"iconsmind-Pipette\" => \"iconsmind-Pipette\"), \n\t\tarray(\"iconsmind-Piramids\" => \"iconsmind-Piramids\"), \n\t\tarray(\"iconsmind-Pizza\" => \"iconsmind-Pizza\"), \n\t\tarray(\"iconsmind-Pizza-Slice\" => \"iconsmind-Pizza-Slice\"), \n\t\tarray(\"iconsmind-Plastic-CupPhone\" => \"iconsmind-Plastic-CupPhone\"), \n\t\tarray(\"iconsmind-Plastic-CupPhone2\" => \"iconsmind-Plastic-CupPhone2\"), \n\t\tarray(\"iconsmind-Plate\" => \"iconsmind-Plate\"), \n\t\tarray(\"iconsmind-Plates\" => \"iconsmind-Plates\"), \n\t\tarray(\"iconsmind-Plug-In\" => \"iconsmind-Plug-In\"), \n\t\tarray(\"iconsmind-Plug-In2\" => \"iconsmind-Plug-In2\"), \n\t\tarray(\"iconsmind-Poland\" => \"iconsmind-Poland\"), \n\t\tarray(\"iconsmind-Police-Station\" => \"iconsmind-Police-Station\"), \n\t\tarray(\"iconsmind-Polo-Shirt\" => \"iconsmind-Polo-Shirt\"), \n\t\tarray(\"iconsmind-Portugal\" => \"iconsmind-Portugal\"), \n\t\tarray(\"iconsmind-Post-Mail\" => \"iconsmind-Post-Mail\"), \n\t\tarray(\"iconsmind-Post-Mail2\" => \"iconsmind-Post-Mail2\"), \n\t\tarray(\"iconsmind-Post-Office\" => \"iconsmind-Post-Office\"), \n\t\tarray(\"iconsmind-Pound\" => \"iconsmind-Pound\"), \n\t\tarray(\"iconsmind-Pound-Sign\" => \"iconsmind-Pound-Sign\"), \n\t\tarray(\"iconsmind-Pound-Sign2\" => \"iconsmind-Pound-Sign2\"), \n\t\tarray(\"iconsmind-Power\" => \"iconsmind-Power\"), \n\t\tarray(\"iconsmind-Power-Cable\" => \"iconsmind-Power-Cable\"), \n\t\tarray(\"iconsmind-Prater\" => \"iconsmind-Prater\"), \n\t\tarray(\"iconsmind-Present\" => \"iconsmind-Present\"), \n\t\tarray(\"iconsmind-Presents\" => \"iconsmind-Presents\"), \n\t\tarray(\"iconsmind-Printer\" => \"iconsmind-Printer\"), \n\t\tarray(\"iconsmind-Projector\" => \"iconsmind-Projector\"), \n\t\tarray(\"iconsmind-Projector-2\" => \"iconsmind-Projector-2\"), \n\t\tarray(\"iconsmind-Pumpkin\" => \"iconsmind-Pumpkin\"), \n\t\tarray(\"iconsmind-Punk\" => \"iconsmind-Punk\"), \n\t\tarray(\"iconsmind-Queen\" => \"iconsmind-Queen\"), \n\t\tarray(\"iconsmind-Quill\" => \"iconsmind-Quill\"), \n\t\tarray(\"iconsmind-Quill-2\" => \"iconsmind-Quill-2\"), \n\t\tarray(\"iconsmind-Quill-3\" => \"iconsmind-Quill-3\"), \n\t\tarray(\"iconsmind-Ram\" => \"iconsmind-Ram\"), \n\t\tarray(\"iconsmind-Redhat\" => \"iconsmind-Redhat\"), \n\t\tarray(\"iconsmind-Reload2\" => \"iconsmind-Reload2\"), \n\t\tarray(\"iconsmind-Reload-2\" => \"iconsmind-Reload-2\"), \n\t\tarray(\"iconsmind-Remote-Controll\" => \"iconsmind-Remote-Controll\"), \n\t\tarray(\"iconsmind-Remote-Controll2\" => \"iconsmind-Remote-Controll2\"), \n\t\tarray(\"iconsmind-Remove-File\" => \"iconsmind-Remove-File\"), \n\t\tarray(\"iconsmind-Repeat3\" => \"iconsmind-Repeat3\"), \n\t\tarray(\"iconsmind-Repeat-22\" => \"iconsmind-Repeat-22\"), \n\t\tarray(\"iconsmind-Repeat-3\" => \"iconsmind-Repeat-3\"), \n\t\tarray(\"iconsmind-Repeat-4\" => \"iconsmind-Repeat-4\"), \n\t\tarray(\"iconsmind-Resize\" => \"iconsmind-Resize\"), \n\t\tarray(\"iconsmind-Retro\" => \"iconsmind-Retro\"), \n\t\tarray(\"iconsmind-RGB\" => \"iconsmind-RGB\"), \n\t\tarray(\"iconsmind-Right2\" => \"iconsmind-Right2\"), \n\t\tarray(\"iconsmind-Right-2\" => \"iconsmind-Right-2\"), \n\t\tarray(\"iconsmind-Right-3\" => \"iconsmind-Right-3\"), \n\t\tarray(\"iconsmind-Right-ToLeft\" => \"iconsmind-Right-ToLeft\"), \n\t\tarray(\"iconsmind-Robot2\" => \"iconsmind-Robot2\"), \n\t\tarray(\"iconsmind-Roller\" => \"iconsmind-Roller\"), \n\t\tarray(\"iconsmind-Roof\" => \"iconsmind-Roof\"), \n\t\tarray(\"iconsmind-Rook\" => \"iconsmind-Rook\"), \n\t\tarray(\"iconsmind-Router\" => \"iconsmind-Router\"), \n\t\tarray(\"iconsmind-Router-2\" => \"iconsmind-Router-2\"), \n\t\tarray(\"iconsmind-Ruler\" => \"iconsmind-Ruler\"), \n\t\tarray(\"iconsmind-Ruler-2\" => \"iconsmind-Ruler-2\"), \n\t\tarray(\"iconsmind-Safari\" => \"iconsmind-Safari\"), \n\t\tarray(\"iconsmind-Safe-Box2\" => \"iconsmind-Safe-Box2\"), \n\t\tarray(\"iconsmind-Santa-Claus\" => \"iconsmind-Santa-Claus\"), \n\t\tarray(\"iconsmind-Santa-Claus2\" => \"iconsmind-Santa-Claus2\"), \n\t\tarray(\"iconsmind-Santa-onSled\" => \"iconsmind-Santa-onSled\"), \n\t\tarray(\"iconsmind-Scarf\" => \"iconsmind-Scarf\"), \n\t\tarray(\"iconsmind-Scissor\" => \"iconsmind-Scissor\"), \n\t\tarray(\"iconsmind-Scotland\" => \"iconsmind-Scotland\"), \n\t\tarray(\"iconsmind-Sea-Dog\" => \"iconsmind-Sea-Dog\"), \n\t\tarray(\"iconsmind-Search-onCloud\" => \"iconsmind-Search-onCloud\"), \n\t\tarray(\"iconsmind-Security-Smiley\" => \"iconsmind-Security-Smiley\"), \n\t\tarray(\"iconsmind-Serbia\" => \"iconsmind-Serbia\"), \n\t\tarray(\"iconsmind-Server\" => \"iconsmind-Server\"), \n\t\tarray(\"iconsmind-Server-2\" => \"iconsmind-Server-2\"), \n\t\tarray(\"iconsmind-Servers\" => \"iconsmind-Servers\"), \n\t\tarray(\"iconsmind-Share-onCloud\" => \"iconsmind-Share-onCloud\"), \n\t\tarray(\"iconsmind-Shark\" => \"iconsmind-Shark\"), \n\t\tarray(\"iconsmind-Sheep\" => \"iconsmind-Sheep\"), \n\t\tarray(\"iconsmind-Shirt\" => \"iconsmind-Shirt\"), \n\t\tarray(\"iconsmind-Shoes\" => \"iconsmind-Shoes\"), \n\t\tarray(\"iconsmind-Shoes-2\" => \"iconsmind-Shoes-2\"), \n\t\tarray(\"iconsmind-Short-Pants\" => \"iconsmind-Short-Pants\"), \n\t\tarray(\"iconsmind-Shuffle2\" => \"iconsmind-Shuffle2\"), \n\t\tarray(\"iconsmind-Shuffle-22\" => \"iconsmind-Shuffle-22\"), \n\t\tarray(\"iconsmind-Singapore\" => \"iconsmind-Singapore\"), \n\t\tarray(\"iconsmind-Skeleton\" => \"iconsmind-Skeleton\"), \n\t\tarray(\"iconsmind-Skirt\" => \"iconsmind-Skirt\"), \n\t\tarray(\"iconsmind-Skull\" => \"iconsmind-Skull\"), \n\t\tarray(\"iconsmind-Sled\" => \"iconsmind-Sled\"), \n\t\tarray(\"iconsmind-Sled-withGifts\" => \"iconsmind-Sled-withGifts\"), \n\t\tarray(\"iconsmind-Sleeping\" => \"iconsmind-Sleeping\"), \n\t\tarray(\"iconsmind-Slippers\" => \"iconsmind-Slippers\"), \n\t\tarray(\"iconsmind-Smart\" => \"iconsmind-Smart\"), \n\t\tarray(\"iconsmind-Smartphone\" => \"iconsmind-Smartphone\"), \n\t\tarray(\"iconsmind-Smartphone-2\" => \"iconsmind-Smartphone-2\"), \n\t\tarray(\"iconsmind-Smartphone-3\" => \"iconsmind-Smartphone-3\"), \n\t\tarray(\"iconsmind-Smartphone-4\" => \"iconsmind-Smartphone-4\"), \n\t\tarray(\"iconsmind-Smile\" => \"iconsmind-Smile\"), \n\t\tarray(\"iconsmind-Smoking-Pipe\" => \"iconsmind-Smoking-Pipe\"), \n\t\tarray(\"iconsmind-Snake\" => \"iconsmind-Snake\"), \n\t\tarray(\"iconsmind-Snow-Dome\" => \"iconsmind-Snow-Dome\"), \n\t\tarray(\"iconsmind-Snowflake2\" => \"iconsmind-Snowflake2\"), \n\t\tarray(\"iconsmind-Snowman\" => \"iconsmind-Snowman\"), \n\t\tarray(\"iconsmind-Socks\" => \"iconsmind-Socks\"), \n\t\tarray(\"iconsmind-Soup\" => \"iconsmind-Soup\"), \n\t\tarray(\"iconsmind-South-Africa\" => \"iconsmind-South-Africa\"), \n\t\tarray(\"iconsmind-Space-Needle\" => \"iconsmind-Space-Needle\"), \n\t\tarray(\"iconsmind-Spain\" => \"iconsmind-Spain\"), \n\t\tarray(\"iconsmind-Spam-Mail\" => \"iconsmind-Spam-Mail\"), \n\t\tarray(\"iconsmind-Speaker2\" => \"iconsmind-Speaker2\"), \n\t\tarray(\"iconsmind-Spell-Check\" => \"iconsmind-Spell-Check\"), \n\t\tarray(\"iconsmind-Spell-CheckABC\" => \"iconsmind-Spell-CheckABC\"), \n\t\tarray(\"iconsmind-Spider\" => \"iconsmind-Spider\"), \n\t\tarray(\"iconsmind-Spiderweb\" => \"iconsmind-Spiderweb\"), \n\t\tarray(\"iconsmind-Spoder\" => \"iconsmind-Spoder\"), \n\t\tarray(\"iconsmind-Spoon\" => \"iconsmind-Spoon\"), \n\t\tarray(\"iconsmind-Sports-Clothings1\" => \"iconsmind-Sports-Clothings1\"), \n\t\tarray(\"iconsmind-Sports-Clothings2\" => \"iconsmind-Sports-Clothings2\"), \n\t\tarray(\"iconsmind-Sports-Shirt\" => \"iconsmind-Sports-Shirt\"), \n\t\tarray(\"iconsmind-Spray\" => \"iconsmind-Spray\"), \n\t\tarray(\"iconsmind-Squirrel\" => \"iconsmind-Squirrel\"), \n\t\tarray(\"iconsmind-Stamp\" => \"iconsmind-Stamp\"), \n\t\tarray(\"iconsmind-Stamp-2\" => \"iconsmind-Stamp-2\"), \n\t\tarray(\"iconsmind-Stapler\" => \"iconsmind-Stapler\"), \n\t\tarray(\"iconsmind-Star\" => \"iconsmind-Star\"), \n\t\tarray(\"iconsmind-Starfish\" => \"iconsmind-Starfish\"), \n\t\tarray(\"iconsmind-Start2\" => \"iconsmind-Start2\"), \n\t\tarray(\"iconsmind-St-BasilsCathedral\" => \"iconsmind-St-BasilsCathedral\"), \n\t\tarray(\"iconsmind-St-PaulsCathedral\" => \"iconsmind-St-PaulsCathedral\"), \n\t\tarray(\"iconsmind-Structure\" => \"iconsmind-Structure\"), \n\t\tarray(\"iconsmind-Student-Hat\" => \"iconsmind-Student-Hat\"), \n\t\tarray(\"iconsmind-Student-Hat2\" => \"iconsmind-Student-Hat2\"), \n\t\tarray(\"iconsmind-Suit\" => \"iconsmind-Suit\"), \n\t\tarray(\"iconsmind-Sum2\" => \"iconsmind-Sum2\"), \n\t\tarray(\"iconsmind-Sunglasses\" => \"iconsmind-Sunglasses\"), \n\t\tarray(\"iconsmind-Sunglasses-2\" => \"iconsmind-Sunglasses-2\"), \n\t\tarray(\"iconsmind-Sunglasses-3\" => \"iconsmind-Sunglasses-3\"), \n\t\tarray(\"iconsmind-Sunglasses-Smiley\" => \"iconsmind-Sunglasses-Smiley\"), \n\t\tarray(\"iconsmind-Sunglasses-Smiley2\" => \"iconsmind-Sunglasses-Smiley2\"), \n\t\tarray(\"iconsmind-Sunglasses-W\" => \"iconsmind-Sunglasses-W\"), \n\t\tarray(\"iconsmind-Sunglasses-W2\" => \"iconsmind-Sunglasses-W2\"), \n\t\tarray(\"iconsmind-Sunglasses-W3\" => \"iconsmind-Sunglasses-W3\"), \n\t\tarray(\"iconsmind-Surprise\" => \"iconsmind-Surprise\"), \n\t\tarray(\"iconsmind-Sushi\" => \"iconsmind-Sushi\"), \n\t\tarray(\"iconsmind-Sweden\" => \"iconsmind-Sweden\"), \n\t\tarray(\"iconsmind-Swimming-Short\" => \"iconsmind-Swimming-Short\"), \n\t\tarray(\"iconsmind-Swimmwear\" => \"iconsmind-Swimmwear\"), \n\t\tarray(\"iconsmind-Switzerland\" => \"iconsmind-Switzerland\"), \n\t\tarray(\"iconsmind-Sync\" => \"iconsmind-Sync\"), \n\t\tarray(\"iconsmind-Sync-Cloud\" => \"iconsmind-Sync-Cloud\"), \n\t\tarray(\"iconsmind-Tablet\" => \"iconsmind-Tablet\"), \n\t\tarray(\"iconsmind-Tablet-2\" => \"iconsmind-Tablet-2\"), \n\t\tarray(\"iconsmind-Tablet-3\" => \"iconsmind-Tablet-3\"), \n\t\tarray(\"iconsmind-Tablet-Orientation\" => \"iconsmind-Tablet-Orientation\"), \n\t\tarray(\"iconsmind-Tablet-Phone\" => \"iconsmind-Tablet-Phone\"), \n\t\tarray(\"iconsmind-Tablet-Vertical\" => \"iconsmind-Tablet-Vertical\"), \n\t\tarray(\"iconsmind-Tactic\" => \"iconsmind-Tactic\"), \n\t\tarray(\"iconsmind-Taj-Mahal\" => \"iconsmind-Taj-Mahal\"), \n\t\tarray(\"iconsmind-Teapot\" => \"iconsmind-Teapot\"), \n\t\tarray(\"iconsmind-Tee-Mug\" => \"iconsmind-Tee-Mug\"), \n\t\tarray(\"iconsmind-Telephone\" => \"iconsmind-Telephone\"), \n\t\tarray(\"iconsmind-Telephone-2\" => \"iconsmind-Telephone-2\"), \n\t\tarray(\"iconsmind-Temple\" => \"iconsmind-Temple\"), \n\t\tarray(\"iconsmind-Thailand\" => \"iconsmind-Thailand\"), \n\t\tarray(\"iconsmind-The-WhiteHouse\" => \"iconsmind-The-WhiteHouse\"), \n\t\tarray(\"iconsmind-Three-ArrowFork\" => \"iconsmind-Three-ArrowFork\"), \n\t\tarray(\"iconsmind-Thumbs-DownSmiley\" => \"iconsmind-Thumbs-DownSmiley\"), \n\t\tarray(\"iconsmind-Thumbs-UpSmiley\" => \"iconsmind-Thumbs-UpSmiley\"), \n\t\tarray(\"iconsmind-Tie\" => \"iconsmind-Tie\"), \n\t\tarray(\"iconsmind-Tie-2\" => \"iconsmind-Tie-2\"), \n\t\tarray(\"iconsmind-Tie-3\" => \"iconsmind-Tie-3\"), \n\t\tarray(\"iconsmind-Tiger\" => \"iconsmind-Tiger\"), \n\t\tarray(\"iconsmind-Time-Clock\" => \"iconsmind-Time-Clock\"), \n\t\tarray(\"iconsmind-To-Bottom\" => \"iconsmind-To-Bottom\"), \n\t\tarray(\"iconsmind-To-Bottom2\" => \"iconsmind-To-Bottom2\"), \n\t\tarray(\"iconsmind-Token\" => \"iconsmind-Token\"), \n\t\tarray(\"iconsmind-To-Left\" => \"iconsmind-To-Left\"), \n\t\tarray(\"iconsmind-Tomato\" => \"iconsmind-Tomato\"), \n\t\tarray(\"iconsmind-Tongue\" => \"iconsmind-Tongue\"), \n\t\tarray(\"iconsmind-Tooth\" => \"iconsmind-Tooth\"), \n\t\tarray(\"iconsmind-Tooth-2\" => \"iconsmind-Tooth-2\"), \n\t\tarray(\"iconsmind-Top-ToBottom\" => \"iconsmind-Top-ToBottom\"), \n\t\tarray(\"iconsmind-To-Right\" => \"iconsmind-To-Right\"), \n\t\tarray(\"iconsmind-To-Top\" => \"iconsmind-To-Top\"), \n\t\tarray(\"iconsmind-To-Top2\" => \"iconsmind-To-Top2\"), \n\t\tarray(\"iconsmind-Tower\" => \"iconsmind-Tower\"), \n\t\tarray(\"iconsmind-Tower-2\" => \"iconsmind-Tower-2\"), \n\t\tarray(\"iconsmind-Tower-Bridge\" => \"iconsmind-Tower-Bridge\"), \n\t\tarray(\"iconsmind-Transform\" => \"iconsmind-Transform\"), \n\t\tarray(\"iconsmind-Transform-2\" => \"iconsmind-Transform-2\"), \n\t\tarray(\"iconsmind-Transform-3\" => \"iconsmind-Transform-3\"), \n\t\tarray(\"iconsmind-Transform-4\" => \"iconsmind-Transform-4\"), \n\t\tarray(\"iconsmind-Tree2\" => \"iconsmind-Tree2\"), \n\t\tarray(\"iconsmind-Tree-22\" => \"iconsmind-Tree-22\"), \n\t\tarray(\"iconsmind-Triangle-ArrowDown\" => \"iconsmind-Triangle-ArrowDown\"), \n\t\tarray(\"iconsmind-Triangle-ArrowLeft\" => \"iconsmind-Triangle-ArrowLeft\"), \n\t\tarray(\"iconsmind-Triangle-ArrowRight\" => \"iconsmind-Triangle-ArrowRight\"), \n\t\tarray(\"iconsmind-Triangle-ArrowUp\" => \"iconsmind-Triangle-ArrowUp\"), \n\t\tarray(\"iconsmind-T-Shirt\" => \"iconsmind-T-Shirt\"), \n\t\tarray(\"iconsmind-Turkey\" => \"iconsmind-Turkey\"), \n\t\tarray(\"iconsmind-Turn-Down\" => \"iconsmind-Turn-Down\"), \n\t\tarray(\"iconsmind-Turn-Down2\" => \"iconsmind-Turn-Down2\"), \n\t\tarray(\"iconsmind-Turn-DownFromLeft\" => \"iconsmind-Turn-DownFromLeft\"), \n\t\tarray(\"iconsmind-Turn-DownFromRight\" => \"iconsmind-Turn-DownFromRight\"), \n\t\tarray(\"iconsmind-Turn-Left\" => \"iconsmind-Turn-Left\"), \n\t\tarray(\"iconsmind-Turn-Left3\" => \"iconsmind-Turn-Left3\"), \n\t\tarray(\"iconsmind-Turn-Right\" => \"iconsmind-Turn-Right\"), \n\t\tarray(\"iconsmind-Turn-Right3\" => \"iconsmind-Turn-Right3\"), \n\t\tarray(\"iconsmind-Turn-Up\" => \"iconsmind-Turn-Up\"), \n\t\tarray(\"iconsmind-Turn-Up2\" => \"iconsmind-Turn-Up2\"), \n\t\tarray(\"iconsmind-Turtle\" => \"iconsmind-Turtle\"), \n\t\tarray(\"iconsmind-Tuxedo\" => \"iconsmind-Tuxedo\"), \n\t\tarray(\"iconsmind-Ukraine\" => \"iconsmind-Ukraine\"), \n\t\tarray(\"iconsmind-Umbrela\" => \"iconsmind-Umbrela\"), \n\t\tarray(\"iconsmind-United-Kingdom\" => \"iconsmind-United-Kingdom\"), \n\t\tarray(\"iconsmind-United-States\" => \"iconsmind-United-States\"), \n\t\tarray(\"iconsmind-University\" => \"iconsmind-University\"), \n\t\tarray(\"iconsmind-Up2\" => \"iconsmind-Up2\"), \n\t\tarray(\"iconsmind-Up-2\" => \"iconsmind-Up-2\"), \n\t\tarray(\"iconsmind-Up-3\" => \"iconsmind-Up-3\"), \n\t\tarray(\"iconsmind-Upload2\" => \"iconsmind-Upload2\"), \n\t\tarray(\"iconsmind-Upload-toCloud\" => \"iconsmind-Upload-toCloud\"), \n\t\tarray(\"iconsmind-Usb\" => \"iconsmind-Usb\"), \n\t\tarray(\"iconsmind-Usb-2\" => \"iconsmind-Usb-2\"), \n\t\tarray(\"iconsmind-Usb-Cable\" => \"iconsmind-Usb-Cable\"), \n\t\tarray(\"iconsmind-Vector\" => \"iconsmind-Vector\"), \n\t\tarray(\"iconsmind-Vector-2\" => \"iconsmind-Vector-2\"), \n\t\tarray(\"iconsmind-Vector-3\" => \"iconsmind-Vector-3\"), \n\t\tarray(\"iconsmind-Vector-4\" => \"iconsmind-Vector-4\"), \n\t\tarray(\"iconsmind-Vector-5\" => \"iconsmind-Vector-5\"), \n\t\tarray(\"iconsmind-Vest\" => \"iconsmind-Vest\"), \n\t\tarray(\"iconsmind-Vietnam\" => \"iconsmind-Vietnam\"), \n\t\tarray(\"iconsmind-View-Height\" => \"iconsmind-View-Height\"), \n\t\tarray(\"iconsmind-View-Width\" => \"iconsmind-View-Width\"), \n\t\tarray(\"iconsmind-Visa\" => \"iconsmind-Visa\"), \n\t\tarray(\"iconsmind-Voicemail\" => \"iconsmind-Voicemail\"), \n\t\tarray(\"iconsmind-VPN\" => \"iconsmind-VPN\"), \n\t\tarray(\"iconsmind-Wacom-Tablet\" => \"iconsmind-Wacom-Tablet\"), \n\t\tarray(\"iconsmind-Walkie-Talkie\" => \"iconsmind-Walkie-Talkie\"), \n\t\tarray(\"iconsmind-Wallet\" => \"iconsmind-Wallet\"), \n\t\tarray(\"iconsmind-Wallet-2\" => \"iconsmind-Wallet-2\"), \n\t\tarray(\"iconsmind-Warehouse\" => \"iconsmind-Warehouse\"), \n\t\tarray(\"iconsmind-Webcam\" => \"iconsmind-Webcam\"), \n\t\tarray(\"iconsmind-Wifi\" => \"iconsmind-Wifi\"), \n\t\tarray(\"iconsmind-Wifi-2\" => \"iconsmind-Wifi-2\"), \n\t\tarray(\"iconsmind-Wifi-Keyboard\" => \"iconsmind-Wifi-Keyboard\"), \n\t\tarray(\"iconsmind-Window\" => \"iconsmind-Window\"), \n\t\tarray(\"iconsmind-Windows\" => \"iconsmind-Windows\"), \n\t\tarray(\"iconsmind-Windows-Microsoft\" => \"iconsmind-Windows-Microsoft\"), \n\t\tarray(\"iconsmind-Wine-Bottle\" => \"iconsmind-Wine-Bottle\"), \n\t\tarray(\"iconsmind-Wine-Glass\" => \"iconsmind-Wine-Glass\"), \n\t\tarray(\"iconsmind-Wink\" => \"iconsmind-Wink\"), \n\t\tarray(\"iconsmind-Wireless\" => \"iconsmind-Wireless\"), \n\t\tarray(\"iconsmind-Witch\" => \"iconsmind-Witch\"), \n\t\tarray(\"iconsmind-Witch-Hat\" => \"iconsmind-Witch-Hat\"), \n\t\tarray(\"iconsmind-Wizard\" => \"iconsmind-Wizard\"), \n\t\tarray(\"iconsmind-Wolf\" => \"iconsmind-Wolf\"), \n\t\tarray(\"iconsmind-Womans-Underwear\" => \"iconsmind-Womans-Underwear\"), \n\t\tarray(\"iconsmind-Womans-Underwear2\" => \"iconsmind-Womans-Underwear2\"), \n\t\tarray(\"iconsmind-Worker-Clothes\" => \"iconsmind-Worker-Clothes\"), \n\t\tarray(\"iconsmind-Wreath\" => \"iconsmind-Wreath\"), \n\t\tarray(\"iconsmind-Zebra\" => \"iconsmind-Zebra\"), \n\t\tarray(\"iconsmind-Zombie\" => \"iconsmind-Zombie\")\n\t);\n\treturn array_merge( $icons, $iconsmind_icons );\n}", "public function up()\n {\n Schema::create('chkilel_icones_icons', function (Blueprint $table) {\n $table->engine = 'InnoDB';\n $table->increments('id')->unsigned();\n\n // Icon set Prefix\n $table->string('icon_set_id');\n\n //Icon name, dashed name\n $table->string('name');\n\n //Icon name, Readable name\n $table->string('readable_name');\n\n // Parent name if is Alias\n $table->string('parent')->nullable();\n\n // Icon set readable name\n $table->string('icon_set_name');\n\n // Svg body without <svg> tag\n $table->text('body');\n\n // If icon is hidden. That means icon was removed from collection for some reason,\n // but it is kept in JSON file to prevent applications that rely on old icon from breaking\n $table->boolean('hidden')->default(false);\n\n // Properties for viewBox:\n $table->integer('left'); // Relevant to Alias\n $table->integer('top'); // // Relevant to Alias\n\n // width and height are dimensions of icon. Value can be string (such as \"1em\", \"24px\" or a number).\n // - If only one dimension is set, another dimension will be set using icon's width/height ratio.\n // - If value is \"auto\", icon's original dimensions will be used.\n // - If both width and height are not set, height defaults to \"1em\".\n $table->integer('width');\n $table->integer('height');\n\n // Transformations\n $table->integer('rotate');\n $table->boolean('hFlip');\n $table->boolean('vFlip');\n\n $table->integer('inlineTop');\n $table->integer('inlineHeight');\n\n // Inline icons are aligned slightly below baseline,\n // so they look centred compared to text, like glyph fonts.\n $table->float('verticalAlign', 8, 4);\n\n $table->timestamp('created_at')->nullable();\n $table->timestamp('updated_at')->nullable();\n $table->timestamp('deleted_at')->nullable();\n });\n }", "public function modify_admin_icon() {\n\t\tglobal $post_type;\n\n\t\tif ( $this->post_type == $post_type )\n\t\t\techo '<style>#icon-edit { background: url(\"' . plugins_url( 'images/instapaper-48.png', __FILE__ ) . '\") no-repeat; background-size: 32px 32px; }</style>';\n\t}" ]
[ "0.5422267", "0.5343775", "0.53405523", "0.5324022", "0.5307902", "0.52481127", "0.5203785", "0.5186653", "0.5142042", "0.50608003", "0.5037323", "0.49941927", "0.4914554", "0.48621586", "0.48452443", "0.48435995", "0.48402342", "0.48400533", "0.48229712", "0.48205978", "0.4790792", "0.4783364", "0.47798544", "0.47750056", "0.47709405", "0.47448972", "0.47333005", "0.47304738", "0.47183934", "0.47160712" ]
0.62783265
0
Pass the npc in and use the reference to flesh out it's data, from an identity if nothing else
public static function fleshOut($identity, $npc){ $npcs_data = NpcFactory::npcsData(); if(array_key_exists($identity, $npcs_data) && !empty($npcs_data[$identity])){ NpcFactory::fleshOutFromData($npcs_data[$identity], $npc); } else { throw new InvalidNpcException('No such npc ['.$identity.'] found to create!'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function fleshOutFromData($data, $npc){\n $npc->name = @$data['name'];\n $npc->image = @$data['img'];\n $npc->short_desc = @$data['short'];\n $npc->inventory_chances = @$data['inventory'];\n $npc->traits = @$data['traits'];\n $npc->strength = (int) @$data['strength'];\n $npc->speed = (int) @$data['speed'];\n $npc->stamina = (int) @$data['stamina'];\n $npc->damage = (int) @$data['damage'];\n $npc->ki = (int) @$data['ki'];\n $npc->race = @$data['race'];\n $npc->bounty = @$data['bounty'];\n $npc->gold = @$data['gold'];\n $npc->traits_array = null;\n $npc->inventory = null; // The actual instance inventory is intitially just null;\n\t}", "public static function create($identity){\n $identity = mb_strtolower($identity);\n\t\t$npcs = NpcFactory::npcsData();\n\t\t$npc = null;\n\t\tif($identity && array_key_exists($identity, $npcs)){\n\t\t\t$npc = new Npc($npcs[$identity]);\n\t\t}\n\t\treturn $npc;\n\t}", "abstract function getOwned();", "function getIdentity(): ?IIdentity;", "private function _hook_data()\n\t{\n\t\t$obj = clone $this->member;\n\t\t$obj->session_id = $this->session_id;\n\t\t$obj->can_access_cp = $this->has_permission('can_access_cp');\n\n\t\treturn $obj;\n\t}", "private function fromUserTrophyInfo() : ?object\n {\n return isset($this->trophyInfo()->fromUser) ? $this->trophyInfo()->fromUser : null;\n }", "public static function npcsData(){\n\t\t// Npc matrix planning document: https://docs.google.com/spreadsheet/ccc?key=0AkoUgtBBP00HdGZ1eUhaekhTb1dnZVh3ZlpoRExWdGc#gid=0\n\t\t$npcs = [\n\t 'firefly'=>['name'=>'Firefly', 'strength'=>0, 'stamina'=>0, 'damage'=>0, 'race'=>'insect', 'gold'=>0], // Baseline weakest mob\n\t\t\t'fireflies'=>['name'=>'Fireflies', 'strength'=>0, 'stamina'=>1, 'damage'=>0, 'race'=>'insect'],\n\t\t\t'spider'=>['name'=>'Spider', 'img'=>'spider_icon.png', 'strength'=>1, 'stamina'=>1, 'speed'=>1, 'damage'=>10, 'gold'=>10, 'race'=>'insect', 'ki'=>1], \n\t\t\t'pig'=>['name'=>'Wild pig', 'short'=>'is bristling with tusks and wiry hair', 'stamina'=>3, 'strength'=>4, 'speed'=>10, 'damage'=>2, 'race'=>'animal'],\n\t\t\t'viper'=>['name'=>'Black Viper', 'race'=>'animal', 'strength'=>1, 'stamina'=>1, 'speed'=>1, 'ki'=>1, 'damage'=>99, 'status'=>POISON, 'gold'=>30, 'traits'=>'poisonous'],\n\t\t\t'kappa'=>['name'=>'Kappa', 'strength'=>30, 'speed'=>10, 'stamina'=>80, 'short'=>'is a reptilian creature with a scooped-out head', 'race'=>'kappa', 'img'=>'kappa.jpg', 'inventory'=>['shell'=>'.5'], 'traits'=>'armored'],\n\t\t\t'nureonna'=>['name'=>'Nureonna', 'strength'=>30, 'speed'=>50, 'stamina'=>40, 'img'=>'nureonna', 'race'=>'yokai', 'img'=>'nureonna.jpg', 'status'=>POISON, 'inventory'=>['charcoal'=>1], 'traits'=>'poisonous'],\n\t 'tengu'=>['name'=>'Tengu', 'short'=>'is a large winged demon', 'strength'=>70, 'speed'=>20, 'stamina'=>100, 'race'=>'tengu', 'inventory'=>['tetsubo'=>'.05']],\n\t\t\t'ushioni'=>['name'=>'Ushi-Oni', 'strength'=>90, 'stamina'=>130, 'speed'=>50, 'race'=>'ushioni', 'img'=>'ushioni2.jpg'],\n\t\t\t'ryu'=>['name'=>'Ryu', 'strength'=>150, 'stamina'=>200, 'speed'=>190, 'short'=>'is a serpent-dragon, with the gleam of intelligence in it\\'s eyes and the glint of death on it\\'s claws', 'img'=>'hokusai-dragon.jpg', 'race'=>'ryu', 'traits'=>'armored'],\n\t\t];\n\t\tif(defined('DEBUG') && DEBUG){\n\t\t\t$npcs += [\n\t\t\t\t'peasant2'=>['name'=>'Peasant', 'race'=>'human', 'img'=>'fighter.png', 'strength'=>5, 'stamina'=>5, 'speed'=>5, 'ki'=>1, 'damage'=>1, 'gold'=>20, 'bounty'=>1, 'traits'=>'villager,sometimes_disguised_ninja', 'inventory'=>['kunai'=>'.01', 'shuriken'=>'.01']],\n\t\t\t\t'merchant2'=>['name'=>'Merchant', 'race'=>'human', 'strength'=>10, 'stamina'=>20, 'speed'=>10, 'ki'=>1, \n\t\t\t\t\t\t'damage'=>15, 'gold'=>50, 'bounty'=>5, 'img'=>'merchant.png', 'inventory'=>['phosphor'=>'.3'], 'traits'=>'villager'],\n\t\t\t\t'guard2'=>['name'=>'Guard', 'short'=>'is a member of the ashigaru foot soldiers, hired for various tasks', 'race'=>'human', 'strength'=>'30', 'stamina'=>30, 'speed'=>12, 'ki'=>1, \n\t \t'damage'=>0, 'gold'=>50, 'bounty'=>10, 'img'=>'guard.png', 'inventory'=>['ginsengroot'=>'.2'], 'traits'=>'partial_match_strength'],\n\t\t\t\t'monk'=>['name'=>'Monk', 'strength'=>10, 'stamina'=>10, 'speed'=>10, 'ki'=>30, 'race'=>'human', 'inventory'=>['prayerwheel'=>'.2'], 'traits'=>'deflection,defensive,self_heal'],\n\t 'geisha'=>['name'=>'Geisha', 'strength'=>5, 'stamina'=>10, 'speed'=>15, 'ki'=>10, 'gold'=>20, 'bounty'=>30, 'race'=>'human', 'inventory'=>['sake'=>'.2', 'mirror'=>'.01', 'kimono'=>'.01', 'tessen'=>'.01'], 'traits'=>'packdynamic,guarded,villager'],\n\t\t 'koi'=>['name'=>'Koi', 'short'=>'swims through the water', 'img'=>'koi.jpg', 'strength'=>0, 'speed'=>5, 'stamina'=>2, 'damage'=>1, 'race'=>'fish', 'inventory'=>['sushi'=>'.5']],\n\t\t\t\t'chicken'=>['name'=>'Chicken', 'short'=>'saunters around like it owns the place', 'strength'=>1, 'speed'=>5, 'damage'=>0, 'race'=>'bird'],\n\t\t\t\t'bees'=>['name'=>'Swarm of Bees', 'short'=>'swarms and buzzes through the air', 'strength'=>13, 'speed'=>30, 'damage'=>6, 'gold'=>0, 'race'=>'insect'],\n\t\t\t\t'goat'=>['name'=>'Goat', 'short'=>'chews on anything it can get to', 'strength'=>10, 'speed'=>25, 'damage'=>3, 'race'=>'animal'],\n\t 'crow'=>['name'=>'Crow', 'short'=>'caws out it\\'s distain', 'strength'=>3, 'speed'=>25, 'damage'=>3, 'race'=>'bird'],\n\t 'kingfisher'=>['name'=>'Kingfisher', 'short'=>'flashes by on it\\'s wings', 'strength'=>3, 'speed'=>30, 'damage'=>3, 'race'=>'bird'],\n\t\t\t\t'horse'=>['name'=>'Horse', 'short'=>'', 'strength'=>10, 'speed'=>40, 'stamina'=>30, 'damage'=>10, 'race'=>'animal'],\n\t\t\t\t'ox'=>['name'=>'Ox', 'short'=>'', 'strength'=>50, 'speed'=>20, 'stamina'=>40, 'damage'=>20, 'race'=>'animal'],\n\t\t\t\t'dog'=>['name'=>'Dog', 'short'=>'barks wildly', 'strength'=>20, 'speed'=>20, 'stamina'=>10, 'damage'=>10, 'race'=>'animal'],\n\t\t\t\t'tiger'=>['name'=>'Tiger', 'short'=>'circles in for the kill', 'strength'=>60, 'speed'=>60, 'stamina'=>60, 'damage'=>60, 'race'=>'animal'],\n\t\t\t\t'basan'=>['name'=>'Basan', 'img'=>'basan.jpg', 'strength'=>1, 'stamina'=>1, 'speed'=>1], // Uses default race of: creature.\n\t\t\t\t'kamaitachi'=>['name'=>'Kama-itachi', 'img'=>'kamaitachi.jpg', 'race'=>'yokai'],\n\t\t\t\t'nuribotoke'=>['name'=>'Nuri-Botoke', 'img'=>'nuribotoke.jpg', 'race'=>'yokai'],\n\t\t\t\t'hitodama'=>['name'=>'Hitodama', 'short'=>'are spirit orbs of fire', 'img'=>'hitodama.gif', 'race'=>'kami', 'traits'=>'whispy'],\n\t\t\t\t'karakasaobake'=>['name'=>'Karakasa-obake', 'short'=>'a one-legged umbrella spirit', 'race'=>'kami'],\n\t\t\t\t'kodama'=>['name'=>'Ko-dama', 'short'=>'is a tree spirit', 'race'=>'kami'],\n\t\t\t\t'umibozu'=>['name'=>'Umi-Bozu', 'short'=>'are bulbous floating jellyfish', 'img'=>'umibozu.jpg', 'traits'=>'whispy'],\n\t\t\t\t'shojo'=>['name'=>'Shojo', 'short'=>'is a monkey man', 'race'=>'yokai'],\n\t\t\t\t'kamanari'=>['name'=>'Kamanari', 'short'=>'is a gateway spirit that inhabits an iron pot', 'race'=>'kami'],\n\t\t\t\t'furaribi'=>['name'=>'Furaribi', 'short'=>'is a flame spirit', 'race'=>'kami', 'img'=>'furaribi.jpg', 'traits'=>'whispy'],\n\t\t\t\t'jorogumo'=>['name'=>'Jorogumo', 'short'=>'spider woman', 'race'=>'yokai', 'img'=>'jorogumo.jpg'],\n\t\t\t\t'tesso'=>['name'=>'Tesso', 'short'=>'rat man', 'race'=>'yokai', 'img'=>'tesso.jpg'],\n\t\t\t\t'shoukera'=>['name'=>'Shoukera', 'short'=>'is a muscled demon that lies wait in the shadows', 'race'=>'yokai', 'img'=>'shoukera.jpg'],\n\t\t\t\t'waira'=>['name'=>'Waira', 'short'=>'is a clawed beast', 'race'=>'yokai', 'img'=>'waira.jpg'],\n\t\t\t\t'tsurebeotoshi'=>['name'=>'Tsurube-otoshi', 'short'=>'is a fire elemental', 'race'=>'kami', 'img'=>'tsurubeotoshi.jpg', 'traits'=>'whispy'],\n\t\t\t\t'kasha'=>['name'=>'Kasha', 'img'=>'kasha.jpg', 'race'=>'yokai'],\n\t\t\t\t'yanari'=>['name'=>'Yanari', 'short'=>'a group of small demons', 'img'=>'yanari.jpg', 'race'=>'yokai'],\n\t\t\t\t'aobouzu'=>['name'=>'Ao-bouzu', 'short'=>'is a one eyed monk', 'img'=>'aobouzu.jpg', 'race'=>'yokai'],\n\t\t\t\t'akashita'=>['name'=>'Akashita', 'short'=>'is a storm demon', 'img'=>'akashita.jpg', 'race'=>'kami'],\n\t\t\t\t'kamakiri'=>['name'=>'Kama-Kiri', 'short'=>'is a hair eating beast', 'img'=>'kamakiri.jpg', 'race'=>'yokai'],\n\t\t\t\t'hakutaku'=>['name'=>'Hakutaku', 'short'=>'is a winged lion demon', 'img'=>'hakutaku.jpg', 'race'=>'yokai'],\n\t\t\t\t'hainu'=>['name'=>'Hainu', 'short'=>'is a winged wolf', 'race'=>'yokai'],\n\t\t\t\t'oni'=>['name'=>'Oni', 'strength'=>25, 'stamina'=>5, 'speed'=>15, 'ki'=>10, 'short'=>'a horned demon', 'img'=>'hokusai-oni.jpg', 'race'=>'oni', 'traits'=>'demonic,stealthy,slowing,energy_vampire'],\n\t\t\t];\n\t\t}\n\t\treturn $npcs;\n\t}", "function getVictimShipExternalID()\n {\n return $this->getVictimShip()->getID();\n }", "public function refer_physician(){\n\t\t\n\t}", "public function get(Identity $identity): object;", "function druid_x ($object)\n {\n return $object;\n }", "function mag_summon ($spell, $login)\r\n {\r\n //$spell = preg_replace ('/[^a-z0-9_]/i', '', $spell);\r\n //$login = preg_replace ('/[^a-z0-9_]/i', '', $login);\r\n $id = is_player ($login);\r\n\r\n $q = do_mysql (\"SELECT cname FROM magic WHERE fullname = '\".$spell.\"';\");\r\n if (!mysql_num_rows ($q)) return 0;\r\n $fullname = mysql_result ($q, 0);\r\n if (!$fullname) return 0;\r\n\r\n // zapros na lokaciju igroka i kolichestvo priruchennyh zhivotnyh\r\n $q = do_mysql (\"SELECT location FROM players WHERE id_player = '\".$id.\"';\");\r\n if (!mysql_num_rows ($q)) return 0;\r\n $loc = mysql_result ($q, 0);\r\n\r\n $q = do_mysql (\"SELECT COUNT(*) FROM npc WHERE belongs = '\".$login.\"';\");\r\n $c = mysql_result ($q, 0);\r\n if ($c > 0) put_g_error ('у вас уже есть нпц, принадлежащие вам');\r\n\r\n // sozdaem npc:\r\n include_once ('modules/f_create_npc.php');\r\n $npc = create_npc ($fullname, (substr($loc, 0, 4)), $loc);\r\n $nid = is_npc ($npc);\r\n\r\n // izmenim imja:\r\n $q = do_mysql (\"SELECT name FROM npc WHERE id_npc = '\".$nid.\"';\");\r\n $name = mysql_result ($q, 0);\r\n $nname = 'призванный '.$name;\r\n $fullname = $npc.'.'.$login;\r\n\r\n // ataka:\r\n $q = do_mysql (\"SELECT in_battle FROM players WHERE id_player = '\".$id.\"';\");\r\n $inb = mysql_result ($q, 0);\r\n\r\n do_mysql (\"UPDATE npc SET fullname = '\".$fullname.\"', name = '\".$nname.\"', belongs = '\".$login.\"', move = '30', in_battle = '\".$inb.\"', type = 'a' WHERE id_npc = '\".$nid.\"';\");\r\n\r\n $q = do_mysql (\"SELECT name FROM players WHERE id_player = '\".$id.\"';\");\r\n $pn = mysql_result ($q, 0);\r\n add_journal ($pn.': призвал '.$name.'!', 'l.'.$loc);\r\n\r\n return 1;\r\n }", "function get_identity($telegram_user_id, $first_name, $full_name) {\n $clean_first_name = db_escape($first_name);\n $clean_full_name = db_escape($full_name);\n\n $identity = db_row_query(\"SELECT * FROM `identity` WHERE `telegram_id` = {$telegram_user_id}\");\n if($identity === null) {\n // New user\n db_perform_action(\"INSERT INTO `identity` VALUES({$telegram_user_id}, '{$clean_first_name}', '{$clean_full_name}', DEFAULT, DEFAULT, DEFAULT, DEFAULT)\");\n\n return db_row_query(\"SELECT * FROM `identity` WHERE `telegram_id` = {$telegram_user_id}\");\n }\n else {\n // Returning user\n db_perform_action(\"UPDATE `identity` SET `first_name` = '{$clean_first_name}', `full_name` = '{$clean_full_name}' WHERE `telegram_id` = {$telegram_user_id}\");\n\n return $identity;\n }\n}", "function crossref($doi)\n{\n\t$doi = strtolower($doi);\n\n\t$url = 'https://api.crossref.org/v1/works/http://dx.doi.org/' . $doi;\n\t\n\t$json = get($url);\n\t\n\t\n\tif ($json != '')\n\t{\n\t\t$obj = json_decode($json);\n\t\t\n\t\t//print_r($obj);\n\t\t\n\t\tif (isset($obj->message->reference))\n\t\t{\n\t\t\tforeach ($obj->message->reference as $cited)\n\t\t\t{\n\t\t\t\t$keys = array();\n\t\t\t\t$values = array();\n\t\t\t\t\n\t\t\t\tforeach ($cited as $k => $v)\n\t\t\t\t{\n\t\t\t\t\t$keys[] = '`' . $k . '`';\n\t\t\t\t\t$values[] = '\"' . addcslashes($v, '\"') . '\"';\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$keys[] = 'guid';\n\t\t\t\t$values[] = '\"' . $doi . '\"';\t\t\t\t\n\t\t\t\n\t\t\t\t$sql = 'REPLACE INTO cites(' . join(',', $keys) . ') values('\n\t\t\t\t\t. join(',', $values) . ');';\n\t\t\t\techo $sql . \"\\n\\n\";\n\t\t\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\n\t}\n\n}", "public function refer_patient(){\n\t\t\n\t}", "public function getEntity(string $identifier): object;", "function on(&$actor)\n\t{\n\t\t$sql = <<<SQL\n\t\t\tselect x, y, sqrt(pow(? - x, 2) + pow(? - y, 2)) as d\n\t\t\t\tfrom map_cell mc\n\t\t\tjoin tile t on mc.tile = t.tile\n\t\t\twhere t.descr = 'Graveyard' and map = ?\n\t\t\torder by d asc\n\t\t\tlimit 1\nSQL;\n\t\t$q = $this->db->query($sql, array($actor['x'], $actor['y'],\n\t\t\t$actor['map']));\n\t\t$r = $q->row_array();\n\t\t$sql = 'update actor set x = ?, y = ?, indoors = 0 where actor = ?';\n\t\t$this->db->query($sql, array($r['x'], $r['y'], $actor['actor']));\n\t}", "abstract public function GetNode( $theIdentifier, $doThrow = FALSE );", "public function getProxy(ClassMetadata $metadata, $identifier) : GhostObjectInterface;", "public function shipping(): MorphOne;", "function get_npc($id_section)\n\t{\n\t\t$sql = 'SELECT npc.id_npc, name, description \n\t\t\t\t FROM npc \n\t\t\t\t LEFT JOIN language_npc ON npc.id_npc = language_npc.id_npc \n\t\t\t\t WHERE location = ' . $id_section . ' AND id_language = 1';\n\t\t\t\t \n\t\t$query = $this->db->query($sql);\n\t\t\n\t\treturn $query->result_array();\n\t}", "public function hasNpcID(){\n return $this->_has(3);\n }", "public static function borrowMobile() \n {\n if (FALSE == self::$isLoanedOut) \n {\n //doing null check\n if (NULL == self::$mobile) \n {\n //if not null instantiating the class\n self::$mobile = new MobileSingleton();\n }\n\n self::$isLoanedOut = TRUE;\n //returning the object\n return self::$mobile;\n } \n else \n {\n //else returning null\n return NULL;\n }\n }", "function getEntity ($message, $ent_id) {\n return $message->getEntity($ent_id);\n}", "function cma_target_notebook_item($item_type, $item_id = NULL, $item_stfips = NULL)\n{\n// error_log('cma_target_notebook_item - item_type:' . $item_type . ': and item_id:' . $item_id . ': and item_stfips:' . $item_stfips . ':');\n\n // If no onetcode is passed, we create an appropriate message\n if (!isset($item_id)) {\n return \"Missing \" . ucfirst($item_type) . \" Id, nothing targeted\";\n }\n\n $output = '';\n\n $cma = vcnCma::getInstance();\n\n $cma->getCmaUserInfo();\n \n $output = $cma->targetNotebookItem($item_type,$item_id,$item_stfips);\n\n echo $output;\n die; // this prevents theming and such, returning just the results of the rest call....\n}", "function getVictimShip()\n {\n if(isset($this->victimship)) {\n return $this->victimship;\n }\n if(!isset($this->victimshipid)) {\n $this->execQuery();\n }\n //TODO: Find out how this can happen and stop it.\n if(!isset($this->victimshipid)) {\n trigger_error(\"No victim ship id set\", E_USER_ERROR);\n return \"\";\n }\n $this->victimship = Cacheable::factory('Ship', $this->victimshipid);\n return $this->victimship;\n }", "abstract protected function getTo();", "abstract function entity();", "public static function npcs($sort=null){\n\t\t$npcs_data = NpcFactory::npcsData();\n\t\t$npcs = [];\n\t\tforeach($npcs_data as $identity=>$npc_data){\n\t\t\tassert((bool)$identity);\n\t\t\t$npcs[$identity] = new Npc($npc_data);\n\t\t}\n\t\tif($sort){\n\t\t\t$npc = reset($npcs);\n\t\t\tif(is_callable([$npc, $sort])){\n\t\t\t\t// Sort the npcs by difficulty\n\t\t\t\tusort($npcs, function ($a, $b) use ($sort) {\n\t\t\t\t\t$anum = $a->$sort();\n\t\t\t\t\t$bnum = $b->$sort();\n\t\t\t\t\tif($anum == $bnum){ \n\t\t\t\t\t\treturn 0 ; \n\t\t\t\t\t}\n\t\t\t\t\treturn ($anum < $bnum) ? -1 : 1;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn $npcs;\n\t}", "public function BroRef() { return $this->BroId; }" ]
[ "0.5476775", "0.53323054", "0.47393537", "0.4714294", "0.46387202", "0.45851907", "0.4564137", "0.45546126", "0.45518658", "0.4453573", "0.44459245", "0.44221672", "0.43958154", "0.43949813", "0.4364544", "0.43520406", "0.4327927", "0.43213582", "0.43161184", "0.43158472", "0.43031546", "0.42869666", "0.4285242", "0.42707336", "0.42656782", "0.4265341", "0.42434648", "0.42426273", "0.4216912", "0.42087823" ]
0.5358844
1
Create the flesh of an npc from it's data
public static function fleshOutFromData($data, $npc){ $npc->name = @$data['name']; $npc->image = @$data['img']; $npc->short_desc = @$data['short']; $npc->inventory_chances = @$data['inventory']; $npc->traits = @$data['traits']; $npc->strength = (int) @$data['strength']; $npc->speed = (int) @$data['speed']; $npc->stamina = (int) @$data['stamina']; $npc->damage = (int) @$data['damage']; $npc->ki = (int) @$data['ki']; $npc->race = @$data['race']; $npc->bounty = @$data['bounty']; $npc->gold = @$data['gold']; $npc->traits_array = null; $npc->inventory = null; // The actual instance inventory is intitially just null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function npcsData(){\n\t\t// Npc matrix planning document: https://docs.google.com/spreadsheet/ccc?key=0AkoUgtBBP00HdGZ1eUhaekhTb1dnZVh3ZlpoRExWdGc#gid=0\n\t\t$npcs = [\n\t 'firefly'=>['name'=>'Firefly', 'strength'=>0, 'stamina'=>0, 'damage'=>0, 'race'=>'insect', 'gold'=>0], // Baseline weakest mob\n\t\t\t'fireflies'=>['name'=>'Fireflies', 'strength'=>0, 'stamina'=>1, 'damage'=>0, 'race'=>'insect'],\n\t\t\t'spider'=>['name'=>'Spider', 'img'=>'spider_icon.png', 'strength'=>1, 'stamina'=>1, 'speed'=>1, 'damage'=>10, 'gold'=>10, 'race'=>'insect', 'ki'=>1], \n\t\t\t'pig'=>['name'=>'Wild pig', 'short'=>'is bristling with tusks and wiry hair', 'stamina'=>3, 'strength'=>4, 'speed'=>10, 'damage'=>2, 'race'=>'animal'],\n\t\t\t'viper'=>['name'=>'Black Viper', 'race'=>'animal', 'strength'=>1, 'stamina'=>1, 'speed'=>1, 'ki'=>1, 'damage'=>99, 'status'=>POISON, 'gold'=>30, 'traits'=>'poisonous'],\n\t\t\t'kappa'=>['name'=>'Kappa', 'strength'=>30, 'speed'=>10, 'stamina'=>80, 'short'=>'is a reptilian creature with a scooped-out head', 'race'=>'kappa', 'img'=>'kappa.jpg', 'inventory'=>['shell'=>'.5'], 'traits'=>'armored'],\n\t\t\t'nureonna'=>['name'=>'Nureonna', 'strength'=>30, 'speed'=>50, 'stamina'=>40, 'img'=>'nureonna', 'race'=>'yokai', 'img'=>'nureonna.jpg', 'status'=>POISON, 'inventory'=>['charcoal'=>1], 'traits'=>'poisonous'],\n\t 'tengu'=>['name'=>'Tengu', 'short'=>'is a large winged demon', 'strength'=>70, 'speed'=>20, 'stamina'=>100, 'race'=>'tengu', 'inventory'=>['tetsubo'=>'.05']],\n\t\t\t'ushioni'=>['name'=>'Ushi-Oni', 'strength'=>90, 'stamina'=>130, 'speed'=>50, 'race'=>'ushioni', 'img'=>'ushioni2.jpg'],\n\t\t\t'ryu'=>['name'=>'Ryu', 'strength'=>150, 'stamina'=>200, 'speed'=>190, 'short'=>'is a serpent-dragon, with the gleam of intelligence in it\\'s eyes and the glint of death on it\\'s claws', 'img'=>'hokusai-dragon.jpg', 'race'=>'ryu', 'traits'=>'armored'],\n\t\t];\n\t\tif(defined('DEBUG') && DEBUG){\n\t\t\t$npcs += [\n\t\t\t\t'peasant2'=>['name'=>'Peasant', 'race'=>'human', 'img'=>'fighter.png', 'strength'=>5, 'stamina'=>5, 'speed'=>5, 'ki'=>1, 'damage'=>1, 'gold'=>20, 'bounty'=>1, 'traits'=>'villager,sometimes_disguised_ninja', 'inventory'=>['kunai'=>'.01', 'shuriken'=>'.01']],\n\t\t\t\t'merchant2'=>['name'=>'Merchant', 'race'=>'human', 'strength'=>10, 'stamina'=>20, 'speed'=>10, 'ki'=>1, \n\t\t\t\t\t\t'damage'=>15, 'gold'=>50, 'bounty'=>5, 'img'=>'merchant.png', 'inventory'=>['phosphor'=>'.3'], 'traits'=>'villager'],\n\t\t\t\t'guard2'=>['name'=>'Guard', 'short'=>'is a member of the ashigaru foot soldiers, hired for various tasks', 'race'=>'human', 'strength'=>'30', 'stamina'=>30, 'speed'=>12, 'ki'=>1, \n\t \t'damage'=>0, 'gold'=>50, 'bounty'=>10, 'img'=>'guard.png', 'inventory'=>['ginsengroot'=>'.2'], 'traits'=>'partial_match_strength'],\n\t\t\t\t'monk'=>['name'=>'Monk', 'strength'=>10, 'stamina'=>10, 'speed'=>10, 'ki'=>30, 'race'=>'human', 'inventory'=>['prayerwheel'=>'.2'], 'traits'=>'deflection,defensive,self_heal'],\n\t 'geisha'=>['name'=>'Geisha', 'strength'=>5, 'stamina'=>10, 'speed'=>15, 'ki'=>10, 'gold'=>20, 'bounty'=>30, 'race'=>'human', 'inventory'=>['sake'=>'.2', 'mirror'=>'.01', 'kimono'=>'.01', 'tessen'=>'.01'], 'traits'=>'packdynamic,guarded,villager'],\n\t\t 'koi'=>['name'=>'Koi', 'short'=>'swims through the water', 'img'=>'koi.jpg', 'strength'=>0, 'speed'=>5, 'stamina'=>2, 'damage'=>1, 'race'=>'fish', 'inventory'=>['sushi'=>'.5']],\n\t\t\t\t'chicken'=>['name'=>'Chicken', 'short'=>'saunters around like it owns the place', 'strength'=>1, 'speed'=>5, 'damage'=>0, 'race'=>'bird'],\n\t\t\t\t'bees'=>['name'=>'Swarm of Bees', 'short'=>'swarms and buzzes through the air', 'strength'=>13, 'speed'=>30, 'damage'=>6, 'gold'=>0, 'race'=>'insect'],\n\t\t\t\t'goat'=>['name'=>'Goat', 'short'=>'chews on anything it can get to', 'strength'=>10, 'speed'=>25, 'damage'=>3, 'race'=>'animal'],\n\t 'crow'=>['name'=>'Crow', 'short'=>'caws out it\\'s distain', 'strength'=>3, 'speed'=>25, 'damage'=>3, 'race'=>'bird'],\n\t 'kingfisher'=>['name'=>'Kingfisher', 'short'=>'flashes by on it\\'s wings', 'strength'=>3, 'speed'=>30, 'damage'=>3, 'race'=>'bird'],\n\t\t\t\t'horse'=>['name'=>'Horse', 'short'=>'', 'strength'=>10, 'speed'=>40, 'stamina'=>30, 'damage'=>10, 'race'=>'animal'],\n\t\t\t\t'ox'=>['name'=>'Ox', 'short'=>'', 'strength'=>50, 'speed'=>20, 'stamina'=>40, 'damage'=>20, 'race'=>'animal'],\n\t\t\t\t'dog'=>['name'=>'Dog', 'short'=>'barks wildly', 'strength'=>20, 'speed'=>20, 'stamina'=>10, 'damage'=>10, 'race'=>'animal'],\n\t\t\t\t'tiger'=>['name'=>'Tiger', 'short'=>'circles in for the kill', 'strength'=>60, 'speed'=>60, 'stamina'=>60, 'damage'=>60, 'race'=>'animal'],\n\t\t\t\t'basan'=>['name'=>'Basan', 'img'=>'basan.jpg', 'strength'=>1, 'stamina'=>1, 'speed'=>1], // Uses default race of: creature.\n\t\t\t\t'kamaitachi'=>['name'=>'Kama-itachi', 'img'=>'kamaitachi.jpg', 'race'=>'yokai'],\n\t\t\t\t'nuribotoke'=>['name'=>'Nuri-Botoke', 'img'=>'nuribotoke.jpg', 'race'=>'yokai'],\n\t\t\t\t'hitodama'=>['name'=>'Hitodama', 'short'=>'are spirit orbs of fire', 'img'=>'hitodama.gif', 'race'=>'kami', 'traits'=>'whispy'],\n\t\t\t\t'karakasaobake'=>['name'=>'Karakasa-obake', 'short'=>'a one-legged umbrella spirit', 'race'=>'kami'],\n\t\t\t\t'kodama'=>['name'=>'Ko-dama', 'short'=>'is a tree spirit', 'race'=>'kami'],\n\t\t\t\t'umibozu'=>['name'=>'Umi-Bozu', 'short'=>'are bulbous floating jellyfish', 'img'=>'umibozu.jpg', 'traits'=>'whispy'],\n\t\t\t\t'shojo'=>['name'=>'Shojo', 'short'=>'is a monkey man', 'race'=>'yokai'],\n\t\t\t\t'kamanari'=>['name'=>'Kamanari', 'short'=>'is a gateway spirit that inhabits an iron pot', 'race'=>'kami'],\n\t\t\t\t'furaribi'=>['name'=>'Furaribi', 'short'=>'is a flame spirit', 'race'=>'kami', 'img'=>'furaribi.jpg', 'traits'=>'whispy'],\n\t\t\t\t'jorogumo'=>['name'=>'Jorogumo', 'short'=>'spider woman', 'race'=>'yokai', 'img'=>'jorogumo.jpg'],\n\t\t\t\t'tesso'=>['name'=>'Tesso', 'short'=>'rat man', 'race'=>'yokai', 'img'=>'tesso.jpg'],\n\t\t\t\t'shoukera'=>['name'=>'Shoukera', 'short'=>'is a muscled demon that lies wait in the shadows', 'race'=>'yokai', 'img'=>'shoukera.jpg'],\n\t\t\t\t'waira'=>['name'=>'Waira', 'short'=>'is a clawed beast', 'race'=>'yokai', 'img'=>'waira.jpg'],\n\t\t\t\t'tsurebeotoshi'=>['name'=>'Tsurube-otoshi', 'short'=>'is a fire elemental', 'race'=>'kami', 'img'=>'tsurubeotoshi.jpg', 'traits'=>'whispy'],\n\t\t\t\t'kasha'=>['name'=>'Kasha', 'img'=>'kasha.jpg', 'race'=>'yokai'],\n\t\t\t\t'yanari'=>['name'=>'Yanari', 'short'=>'a group of small demons', 'img'=>'yanari.jpg', 'race'=>'yokai'],\n\t\t\t\t'aobouzu'=>['name'=>'Ao-bouzu', 'short'=>'is a one eyed monk', 'img'=>'aobouzu.jpg', 'race'=>'yokai'],\n\t\t\t\t'akashita'=>['name'=>'Akashita', 'short'=>'is a storm demon', 'img'=>'akashita.jpg', 'race'=>'kami'],\n\t\t\t\t'kamakiri'=>['name'=>'Kama-Kiri', 'short'=>'is a hair eating beast', 'img'=>'kamakiri.jpg', 'race'=>'yokai'],\n\t\t\t\t'hakutaku'=>['name'=>'Hakutaku', 'short'=>'is a winged lion demon', 'img'=>'hakutaku.jpg', 'race'=>'yokai'],\n\t\t\t\t'hainu'=>['name'=>'Hainu', 'short'=>'is a winged wolf', 'race'=>'yokai'],\n\t\t\t\t'oni'=>['name'=>'Oni', 'strength'=>25, 'stamina'=>5, 'speed'=>15, 'ki'=>10, 'short'=>'a horned demon', 'img'=>'hokusai-oni.jpg', 'race'=>'oni', 'traits'=>'demonic,stealthy,slowing,energy_vampire'],\n\t\t\t];\n\t\t}\n\t\treturn $npcs;\n\t}", "function createFlyer()\r\n {\r\n \r\n }", "function createTrophy()\r\n {\r\n \r\n }", "function spawnfood($posx, $posy, $quality=0, $name='Seed'){\n\t\tif($quality == 0){ \n\t\t\t$quality = rand(10,25);\n\t\t}\n\t\t$this->food[$this->foodcounter] = new FOOD($posx, $posy, $this->foodcounter, $quality, $name);\n\t\t$this->foodcounter++;\n\t}", "public static function fleshOut($identity, $npc){\n\t\t$npcs_data = NpcFactory::npcsData();\n\t\tif(array_key_exists($identity, $npcs_data) && !empty($npcs_data[$identity])){\n\t\t\tNpcFactory::fleshOutFromData($npcs_data[$identity], $npc);\n\t\t} else {\n\t\t\tthrow new InvalidNpcException('No such npc ['.$identity.'] found to create!');\n\t\t}\n\t}", "public function fakeNpcData($npcFields = [])\n {\n $fake = Faker::create();\n\n return array_merge([\n 'name' => $fake->word,\n 'private_name' => $fake->word,\n 'image' => $fake->word,\n 'vocation_id' => $fake->randomDigitNotNull,\n 'metatype_id' => $fake->randomDigitNotNull,\n 'background_public' => $fake->text,\n 'background_private' => $fake->text,\n 'territory_id' => $fake->randomDigitNotNull,\n 'gold' => $fake->randomDigitNotNull,\n 'iron' => $fake->randomDigitNotNull,\n 'timber' => $fake->randomDigitNotNull,\n 'stone' => $fake->randomDigitNotNull,\n 'grain' => $fake->randomDigitNotNull,\n 'action_id' => $fake->randomDigitNotNull,\n 'deceased' => $fake->date('Y-m-d H:i:s'),\n 'created_at' => $fake->date('Y-m-d H:i:s'),\n 'updated_at' => $fake->date('Y-m-d H:i:s'),\n 'deleted_at' => $fake->date('Y-m-d H:i:s')\n ], $npcFields);\n }", "public function createDish()\n {\n $entityClass = 'MU\\\\YourCityModule\\\\Entity\\\\DishEntity';\n\n $entity = new $entityClass();\n\n $this->entityInitialiser->initDish($entity);\n\n return $entity;\n }", "function __construct($id, $userid, $name, $slot){\n parent::__construct($id, $userid, $name, $slot);\n \n $this->pointCost = 750;\n $this->faction = \"Ipsha\";\n $this->phpclass = \"ShipBoltglobe\";\n //$this->imagePath = \"img/ships/IpshaBattleglobe.png\"; \n $this->imagePath = \"img/ships/IpshaBorgGlobe.png\";\n $this->shipClass = \"Boltglobe\"; \n \t$this->variantOf = \"Battleglobe\"; \n\t \t$this->occurence = 'rare';\n\t \t \n $this->shipSizeClass = 3;\n //$this->fighters = array(\"heavy\"=>6);\n\t \n\t//$this->limited = 33;\n\t$this->isd = 2252;\n\t$this->notes = 'Eethan Barony only';\t \n\t$this->notes .= '<br>EM hardened';\t \n\t$this->notes .= '<br>+3 critical roll penalty';\n\t$this->EMHardened = true; //EM Hardening - some weapons would check for this value!\n\t$this->critRollMod = -1+4; //generalbonus to critical rolls!\n\t //this ship has some serious problems by fluff - I try to show this by ading serious shipwide vulnerability to criticals\n\t //so +4 to criticals (on top of usual Ipsha -1 , giving +3 total :) )\n\t\t\n $this->forwardDefense = 18;\n $this->sideDefense = 14;\n \n $this->turncost = 1;\n $this->turndelaycost = 1;\n $this->accelcost = 1;\n $this->rollcost = 0;\n $this->pivotcost = 2;\n\t$this->gravitic = true;\n \n\t$this->iniativebonus = 0 *5; //THIS IS A CAPITAL SHIP, despite HCV arrangement!\n\t \n\t \n \n //$this->addPrimarySystem(new MagGravReactor(4, 28, 0, 60));\n\t$this->addPrimarySystem(new MagGravReactor(4, 28, 0, 45+5));\n\t$this->addPrimarySystem(new CnC(4, 20, 0, 0));\n $this->addPrimarySystem(new Scanner(4, 16, 5, 7));\n $this->addPrimarySystem(new Engine(4, 30, 0, 4, 4));\n //$this->addPrimarySystem(new Hangar(4, 6));\n\t$this->addPrimarySystem(new SparkField(4, 0, 0, 0, 360));\n $this->addPrimarySystem(new MagGraviticThruster(4, 13, 0, 99, 1));\n $this->addPrimarySystem(new MagGraviticThruster(4, 13, 0, 99, 1));\n $this->addPrimarySystem(new MagGraviticThruster(4, 13, 0, 99, 2));\n $this->addPrimarySystem(new MagGraviticThruster(4, 13, 0, 99, 2));\t \n\t \n\t$this->addLeftSystem(new EmBolter(4, 0, 0, 300, 60));\n\t$this->addLeftSystem(new EmBolter(4, 0, 0, 300, 60));\n\t$this->addLeftSystem(new EmBolter(4, 0, 0, 300, 60));\n\t$this->addLeftSystem(new EmBolter(4, 0, 0, 120, 240));\n\t$this->addLeftSystem(new EmBolter(4, 0, 0, 120, 240));\n\t$this->addLeftSystem(new EmBolter(4, 0, 0, 120, 240));\t \n\t$this->addLeftSystem(new MagGraviticThruster(4, 15, 0, 99, 3));\n\t\t\n\t$this->addRightSystem(new EmBolter(4, 0, 0, 300, 60));\n\t$this->addRightSystem(new EmBolter(4, 0, 0, 300, 60));\n\t$this->addRightSystem(new EmBolter(4, 0, 0, 300, 60));\n\t$this->addRightSystem(new EmBolter(4, 0, 0, 120, 240));\n\t$this->addRightSystem(new EmBolter(4, 0, 0, 120, 240));\n\t$this->addRightSystem(new EmBolter(4, 0, 0, 120, 240));\n $this->addRightSystem(new MagGraviticThruster(4, 15, 0, 99, 4));\n\t\t\n\t\t\n $this->addLeftSystem(new Structure(4, 60));\n $this->addRightSystem(new Structure(4, 60));\n $this->addPrimarySystem(new Structure(4, 52));\n\t\t\n\t\t\n\t\t$this->hitChart = array(\n\t\t\t0=> array(\n\t\t\t\t8 => \"Structure\",\n\t\t\t\t10 => \"Thruster\",\n\t\t\t\t12 => \"Spark Field\",\n\t\t\t\t14 => \"Scanner\",\n\t\t\t\t16 => \"Engine\",\n\t\t\t\t18 => \"Reactor\",\n\t\t\t\t20 => \"C&C\",\n\t\t\t),\n\t\t\t3=> array(\n\t\t\t\t4 => \"Thruster\",\n\t\t\t\t10 => \"EM Bolter\",\n\t\t\t\t18 => \"Structure\",\n\t\t\t\t20 => \"Primary\",\n\t\t\t),\n\t\t\t4=> array(\n\t\t\t\t4 => \"Thruster\",\n\t\t\t\t10 => \"EM Bolter\",\n\t\t\t\t18 => \"Structure\",\n\t\t\t\t20 => \"Primary\",\n\t\t\t),\n\t\t);\n }", "public static function create() {\n\t\t//Build the frank object\n\t\trequire('data/scenario.php');\n\t\tself::$frank = array();\n\t\tself::$frank['time']=$TIME;\n\n\t\tself::$frank['entry'] = new Session($home, 'frank');\n\t\tself::$frank['computers'] =& Computer::$computers;\n\t\tself::$frank['networks'] =& Network::$networks;\n\t}", "public function create($data)\n {\n $this->fishSpecies([$data]);\n }", "abstract function generateHap();", "function make_gameactions_item($rows, $lon, $lat, $alt)\r\n{\r\n\t$output = '';\r\n\t$actions = array();\r\n\t$descriptions = '';\r\n\tforeach($rows as $row)\r\n\t{\r\n\t\t$actions[] = $row['action'];\r\n\t\t$descriptions .= \r\n\t\t\t\"<b><i>Action:</i>\" . htmlspecialchars($row['action']) . \"</b><br/>\\n\" .\r\n\t\t\t\"<i>Time:</i>\" . htmlspecialchars($row['timestamp']) . \"<br/>\\n\" .\r\n\t\t\t\"<i>Member:</i>\" . htmlspecialchars($row['member']) . \"<br/>\\n\";\r\n\t}\r\n\t$name = implode(\" \", $actions);\r\n\t\r\n\tob_start();\t\r\n?>\r\n\t\t\t<Placemark>\r\n\t\t\t\t<Point>\r\n\t\t\t\t\t<altitudeMode>clampToGround</altitudeMode>\r\n\t\t\t\t\t<coordinates><?php echo(htmlspecialchars($lon) . ', ' . htmlspecialchars($lat)); ?></coordinates>\r\n\t\t\t\t\t<extrude>1</extrude>\r\n\t\t\t\t</Point>\r\n\t\t\t\t<name><?php echo(htmlspecialchars( $name . \"(\" . $row['user'] . \")\")); ?></name>\r\n\t\t\t\t<description><![CDATA[<b> Game Action for <?php echo(htmlspecialchars($row['user'])); ?></b><br/>\r\n\t\t\t\t<?php echo($descriptions); ?>\r\n\t\t\t\t ]]></description>\r\n\t\t\t\t<TimeStamp>\r\n\t\t\t\t\t<when><?php echo(htmlspecialchars($row['timestamp'])); ?></when>\r\n\t\t\t\t</TimeStamp>\r\n\t\t\t\t<styleUrl>#game_action</styleUrl>\t\r\n\t\t\t</Placemark>\r\n<?php \r\n\t$output = ob_get_clean();\r\n\treturn $output;}", "public function makeNpc($npcFields = [])\n {\n /** @var NpcRepository $npcRepo */\n $npcRepo = App::make(NpcRepository::class);\n $theme = $this->fakeNpcData($npcFields);\n return $npcRepo->create($theme);\n }", "function make_gamestates_item($rows, $lon, $lat, $alt)\r\n{\r\n\t$output = '';\r\n\t$actions = array();\r\n\t$descriptions = '';\r\n\tforeach($rows as $row)\r\n\t{\r\n\t\t$actions[] = $row['action'];\r\n\t\t$descriptions .= \r\n\t\t\t\"<b><i>Action:</i>\" . htmlspecialchars($row['action']) . \"</b><br/>\\n\" .\r\n\t\t\t\"<i>Time:</i>\" . htmlspecialchars($row['timestamp']) . \"<br/>\\n\" .\r\n\t\t\t\"<i>Value:</i>\" . htmlspecialchars($row['value']) . \"<br/>\\n\";\r\n\t}\r\n\t$name = implode(\" \", $actions);\r\n\t\r\n\tob_start();\t\r\n?>\r\n\t\t\t<Placemark>\r\n\t\t\t\t<Point>\r\n\t\t\t\t\t<altitudeMode>clampToGround</altitudeMode>\r\n\t\t\t\t\t<coordinates><?php echo(htmlspecialchars($lon) . ', ' . htmlspecialchars($lat)); ?></coordinates>\r\n\t\t\t\t\t<extrude>1</extrude>\r\n\t\t\t\t</Point>\r\n\t\t\t\t<name><?php echo(htmlspecialchars( $name . \"(\" . $row['user'] . \")\")); ?></name>\r\n\t\t\t\t<description><![CDATA[<b> Game State for <?php echo(htmlspecialchars($row['user'])); ?></b><br/>\r\n\t\t\t\t<?php echo($descriptions); ?>\r\n\t\t\t\t ]]></description>\r\n\t\t\t\t<TimeStamp>\r\n\t\t\t\t\t<when><?php echo(htmlspecialchars($row['timestamp'])); ?></when>\r\n\t\t\t\t</TimeStamp>\r\n\t\t\t\t<styleUrl>#game_state</styleUrl>\t\r\n\t\t\t</Placemark>\r\n<?php \r\n\t$output = ob_get_clean();\r\n\treturn $output;\r\n}", "function newGame(){\n\t\t$pawns = 1;\n\t\t\n\t\twhile($pawns <= 16){\n\t\t\tif($pawns <=8){\n\t\t\t\t$team = \"white\";\n\t\t\t\t$x = $pawns;\n\t\t\t\t$y = 2;\n\t\t\t\t$ql = (8*$pawns) - 7;\n\t\t\t}else{\n\t\t\t\t$team = \"black\";\n\t\t\t\t$x = $pawns - 8;\n\t\t\t\t$y = 7;\n\t\t\t\t$ql = (8*($pawns-8)) - 2;\n\t\t\t}\n\t\t\t\n\t\t\t$options = array( 'team'=>$team,\n\t\t\t\t\t\t\t 'position_x'=>$x,\n\t\t\t\t\t\t\t 'position_y'=>$y,\n\t\t\t\t\t\t\t 'position_QL'=>$ql,\n\t\t\t\t\t\t\t 'moves'=>0,\n\t\t\t\t\t\t\t 'taken'=>false,\n\t\t\t\t\t\t\t 'offboard'=>false,\n\t\t\t\t\t\t\t 'promotion'=>false\n\t\t\t\t\t\t\t);\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t$this->createPiece(\"pawn\",$team,$options);\t\n\t\t\t$pawns++;\n\t\t}\t\t\t\t\t\t\t\t\t\t\n\t}", "function createChar($name, $rootfolder){\nrequire_once(\"assets/config/database.php\");\nglobal $mysqli, $prefix;\n$init = $mysqli->query(\"SELECT `id`, `job`, `skincolor`, `hair`, `face` FROM `characters` WHERE `name` = '\".$name.\"'\");\n$field = $init->fetch_assoc();\n$getipos = $mysqli->query(\"SELECT `itemid`, `position` FROM `inventoryitems` WHERE `characterid` = '\".$field['id'].\"' AND inventorytype = '-1' ORDER BY position DESC\", 0);\n\n$job = (int) $field['job'];\n$skin = (int) $field['skincolor'] + 2000;\n$face = (int) $field['face'];\n$hair = (int) $field['hair'];\n\nwhile($gotAcc = $getipos->fetch_assoc()) {\n\tswitch($gotAcc['position']) {\n\t\tcase ($gotAcc['position'] == \"-1\" || $gotAcc['position'] == \"-101\"):\n\t\t\tif($gotAcc['itemid'] != 1002186)\n\t\t\t\t$hat = $gotAcc['itemid'];\n\t\t\telse\n\t\t\t\t$hat = NULL;\n\t\tbreak;\n\t\tcase ($gotAcc['position'] == \"-2\" || $gotAcc['position'] == \"-102\"):$mask=$gotAcc['itemid'];break;\n\t\tcase ($gotAcc['position'] == \"-3\" || $gotAcc['position'] == \"-103\"):$eyes=$gotAcc['itemid'];break;\n\t\tcase ($gotAcc['position'] == \"-4\" || $gotAcc['position'] == \"-104\"):$ears=$gotAcc['itemid'];break;\n\t\tcase ($gotAcc['position'] == \"-5\" || $gotAcc['position'] == \"-105\"):\n\t\t\tif(substr($gotAcc['itemid'], 0, 3) == 105) {\n\t\t\t\t$overAll = $gotAcc['itemid'];\n\t\t\t} else {\n\t\t\t\t$top = $gotAcc['itemid'];\n\t\t\t}\n\t\t\tif($gotAcc['position'] == \"-105\"){\n\t\t\t\t$overAll = $gotAcc['itemid'];\n\t\t\t\t$top = $gotAcc['itemid'];\n\t\t\t}\n\t\tbreak;\n\t\tcase ($gotAcc['position'] == \"-6\" || $gotAcc['position'] == \"-106\"):\n\t\t\tif(substr($gotAcc['itemid'], 0, 3) == 106) {\n\t\t\t\t$overAll = NULL;\n\t\t\t} else {\n\t\t\t\t$pants = $gotAcc['itemid'];\n\t\t\t}\n\t\t\tif($gotAcc['position'] == \"-106\"){\n\t\t\t\t$overAll = NULL;\n\t\t\t\t$pants = $gotAcc['itemid'];\n\t\t\t}\n\t\tbreak;\n\t\tcase ($gotAcc['position'] == \"-7\" || $gotAcc['position'] == \"-107\"):$shoe=$gotAcc['itemid'];break;\n\t\tcase ($gotAcc['position'] == \"-8\" || $gotAcc['position'] == \"-108\"):$glove=$gotAcc['itemid'];break;\n\t\tcase ($gotAcc['position'] == \"-9\" || $gotAcc['position'] == \"-109\"):$cape=$gotAcc['itemid'];break;\n\t\tcase ($gotAcc['position'] == \"-10\" || $gotAcc['position'] == \"-110\"):$shield=$gotAcc['itemid'];break;\n\t\tcase \"-11\":\n\t\t\t$wep = $gotAcc['itemid'];\n\t\t\t$wepType = substr($wep, 0, 3);\n\t\t\tswitch($wepType) {\n\t\t\t\tcase ($wepType >= 130 && $wepType <= 138):\n\t\t\t\tcase 145:\n\t\t\t\tcase ($wepType >= 147 && $wepType <= 149):\n\t\t\t\tcase 121:\n\t\t\t\tcase 122:\n\t\t\t\tcase 139:\n\t\t\t\tcase 152:\n\t\t\t\tcase 153:\n\t\t\t\tcase 154:\n\t\t\t\tcase 155:\n\t\t\t\t\t$stand = 1;\n\t\t\t\tbreak;\n\t\t\t\tcase ($wepType >= 140 && $wepType <= 143):\n\t\t\t\tcase 146:\n\t\t\t\t\t$stand = 2;\n\t\t\t\tbreak;\n\t\t\t\tcase 144:\n\t\t\t\t\t$location = $rootfolder.\"/GD/Weapon/0{$wep}.img/stand1.0.weapon.png\";\n\t\t\t\t\tfile_exists($location)?$stand = 1:$stand = 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\tbreak;\n\t\tcase \"-111\":\n\t\t\t$nxWep = $gotAcc['itemid'];\n\t\t\t$int = 29;\n\t\t\t$found = false;\n\t\t\twhile($int <= 46 && !$found) {\n\t\t\t\t$int++;\n\t\t\t\tif(file_exists($rootfolder.\"/GD/Weapon/0{$nxWep}.img/{$int}.stand{$stand}.0.weapon.png\")) {\n\t\t\t\t\t$found\t= true;\n\t\t\t\t\t$wepNum = $int;\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t}\n}\n\n$weapon = !$nxWep?$wep:$nxWep;\n\n$hash = md5($name.$skin.$face.$hair.$hat.$mask.$eyes.$ears.$overAll.$top.$pants.$shoe.$glove.$cape.$shield.$weapon.$bgtype);\n$shash = $mysqli->query(\"SELECT hash FROM \".$prefix.\"gdcache WHERE name = '\".$name.\"'\", 0);\nif($shash->num_rows != 0){\n\t$field = $shash->fetch_assoc();\n\tif($hash != $field['hash']){\n\t unlink($rootfolder.\"/GD/Characters/\".$field['hash'].\".png\");\n\t\t$update = $mysqli->query(\"UPDATE \".$prefix.\"gdcache SET hash = '\".$hash.\"' WHERE name = '\".$name.\"'\", 0);\n\t\t$Image = new Image;\n\t\t$Image->rootfolder = $rootfolder;\n\t\t$Image->setName($hash);\n\t\t$Image->setSkin($skin);\n\t\t$Image->setHair($hair,NULL);\n\t\t$Image->setStand(!$wep?1:$stand);\n\t\t$Image->setWepNum($wepNum);\n\t\t//$weapon = !$nxWep?$wep:$nxWep;\n\t\t$Image->setBG($bgtype);\n\t\t$Image->setWeapon($weapon,'weaponBelowBody');\n\t\t$Image->setCape($cape,'cape');\n\t\t$Image->setHat($hat,'acHat');\n\t\t$Image->setShield($shield);\n\t\t$Image->createBody('body');\n\t\t$Image->setShoes($shoe);\n\t\t$Image->setGlove($glove,'leftGlove');\n\t\t//if($wepType == 148){\n\t\t\t$Image->setKnuckler($weapon, 'weaponOverBody');\n\t\t//}\n\t\t//if($wepType == 152){\n\t\t\t$Image->setDualGun($weapon,'weaponL');\n\t\t//}\n\t\t$Image->setPants($pants);\n\t\t$Image->setTop($top,'top');\n\t\t$Image->setOverAll($overAll,'overall');\n\t\t$Image->setWeapon($weapon,'armBelowHeadOverMailChest');\n\t\t$Image->createBody('head');\n\t\t$Image->setAccessory($ears,'accessory');\n\t\t$Image->setHair($hair,'hairShade');\n\t\t$Image->setAccessory($mask,'mask');\n\t\t$Image->setFace(!$face?20000:$face);\n\t\t//$Image->setAccessory($mask,'mask');\n\t\t$Image->setAccessory($eyes,'accessory');\n\t\t$Image->setHair(!$hair?30030:$hair,'hair');\n\t\t$Image->setHat($hat,'regular');\n\t\tif($job == 2300 || $job == 2310 || $job == 2311 || $job == 2312) {\n\t\t\t$Image->createBody('mercedesEars');\n\t\t} else {\n\t\t\t$Image->createBody('');\n\t\t}\n\t\tif($stand == 2) {\n\t\t\t$Image->createBody('arm');\n\t\t\t$Image->setTop($top,'topArm');\n\t\t\t$Image->setOverAll($overAll,'overallArm');\n\t\t\t$Image->setCape($cape,'capeArm');\n\t\t\t$Image->setWeapon($weapon,'weaponOverArm');\n\t\t\t$Image->createBody('hand');\n\t\t\t$Image->setGlove($glove,'leftGlove');\n\t\t\t$Image->setGlove($glove,'rightGlove');\n\t\t\t$Image->setGlove($glove,'middleGlove');\n\t\t\t$Image->setWeapon($weapon,'weaponOverGlove');\n\t\t} else {\n\t\t\t//if($wepType == 152){\n\t\t\t\t$Image->setDualGun($weapon,'weaponR');\n\t\t\t//}\n\t\t\t$Image->setWeapon($weapon,'weapon');\n\t\t\t$Image->createBody('arm');\n\t\t\t$Image->setWeapon($weapon,'weaponOverArm');\n\t\t\t$Image->setTop($top,'topArm');\n\t\t\t$Image->setOverAll($overAll,'overallArm');\n\t\t\t$Image->setCape($cape,'capeArm');\n\t\t\t$Image->setGlove($glove,'rightGlove');\n\t\t\t$Image->setWeapon($weapon,'weaponOverGlove');\n\t\t\t$Image->setWeapon($weapon,'weaponBelowArm');\n\t\t\t$Image->setWeapon($weapon,'weaponOverHand');\n\t\t\t//if($wepType == 148){\n\t\t\t\t$Image->setKnuckler($weapon, 'weaponOverArm');\n\t\t\t//}\n\t\t}\n\t}\n} else {\n\t$mysqli->query(\"INSERT INTO \".$prefix.\"gdcache (`hash`, `name`) VALUES ('\".$hash.\"','\".$name.\"')\");\n\t$Image = new Image;\n\t$Image->rootfolder = $rootfolder;\n\t$Image->setName($hash);\n\t$Image->setSkin($skin);\n\t$Image->setHair($hair,NULL);\n\t$Image->setStand(!$wep?1:$stand);\n\t$Image->setWepNum($wepNum);\n\t//$weapon = !$nxWep?$wep:$nxWep;\n\t\n\t$Image->setWeapon($weapon,'weaponBelowBody');\n\t$Image->setCape($cape,'cape');\n\t$Image->setHat($hat,'acHat');\n\t$Image->setShield($shield);\n\t$Image->createBody('body');\n\t$Image->setShoes($shoe);\n\t$Image->setGlove($glove,'leftGlove');\n\t//if($wepType == 148){\n\t\t$Image->setKnuckler($weapon, 'weaponOverBody');\n\t//}\n\t//if($wepType == 152){\n\t\t$Image->setDualGun($weapon,'weaponL');\n\t//}\n\t$Image->setPants($pants);\n\t$Image->setTop($top,'top');\n\t$Image->setOverAll($overAll,'overall');\n\t$Image->setWeapon($weapon,'armBelowHeadOverMailChest');\n\t$Image->createBody('head');\n\t$Image->setAccessory($ears,'accessory');\n\t$Image->setHair($hair,'hairShade');\n\t$Image->setAccessory($mask,'mask');\n\t$Image->setFace(!$face?20000:$face);\n\t//$Image->setAccessory($mask,'mask');\n\t$Image->setAccessory($eyes,'accessory');\n\t$Image->setHair(!$hair?30030:$hair,'hair');\n\t$Image->setHat($hat,'regular');\n\t\tif($job == 2300 || $job == 2310 || $job == 2311 || $job == 2312) {\n\t\t\t$Image->createBody('mercedesEars');\n\t\t} else {\n\t\t\t$Image->createBody('');\n\t\t}\n\tif($stand == 2) {\n\t\t$Image->createBody('arm');\n\t\t$Image->setTop($top,'topArm');\n\t\t$Image->setOverAll($overAll,'overallArm');\n\t\t$Image->setCape($cape,'capeArm');\n\t\t$Image->setWeapon($weapon,'weaponOverArm');\n\t\t$Image->createBody('hand');\n\t\t$Image->setGlove($glove,'leftGlove');\n\t\t$Image->setGlove($glove,'rightGlove');\n\t\t$Image->setGlove($glove,'middleGlove');\n\t\t$Image->setWeapon($weapon,'weaponOverGlove');\n\t} else {\n\t\t//if($wepType == 152){\n\t\t\t$Image->setDualGun($weapon,'weaponR');\n\t\t//}\n\t\t$Image->setWeapon($weapon,'weapon');\n\t\t$Image->createBody('arm');\n\t\t$Image->setWeapon($weapon,'weaponOverArm');\n\t\t$Image->setTop($top,'topArm');\n\t\t$Image->setOverAll($overAll,'overallArm');\n\t\t$Image->setCape($cape,'capeArm');\n\t\t$Image->setGlove($glove,'rightGlove');\n\t\t$Image->setWeapon($weapon,'weaponOverGlove');\n\t\t$Image->setWeapon($weapon,'weaponBelowArm');\n\t\t$Image->setWeapon($weapon,'weaponOverHand');\n\t\t//if($wepType == 148){\n\t\t\t$Image->setKnuckler($weapon, 'weaponOverArm');\n\t\t//}\n\t}\n}\n}", "function gohome(){\n\t\t$this->drainstamina();\n\t\tif($this->isdead == 0){\n\t\t$this->appendtoturn(\"<b>\" . $this->type . \"</b>(\" . $this->stamina . \") ant moved towards home at \" . $this->world->nest[$this->type]->posx . \"-\" . $this->world->nest[$this->type]->posy);\n $this->moveto($this->world->nest[$this->type]->posx, this->world->nest[$this->type]->posy);\n\t\tif($this->world->nest[$this->type]->posy == $this->posy && $this->world->nest[$this->type]->posx == $this->posx){\n\t\t\t$this->appendtoturn(\"<b>\" . $this->type . \"</b>(\" . $this->stamina . \") ant arrived at home at \" . $this->world->nest[$this->type]->posx . \"-\" . $this->world->nest[$this->type]->posy);\n\t\t\t$this->booststamina();\n\t\t\t$this->hasfood = false;\n\t\t\t$this->world->nest[$this->type]->storedfood = $this->world->nest[$this->type]->storedfood + $this->quality;\n\t\t\t//echo \"<br>Quality:\" . $this->world->nest[$this->type]->storedfood + $this->quality . \"<br>\";\n\t\t\t$this->quality = 0;\n if($this->stamina > 180){\n $this->world->nest->[$this->type]->newwarant($this->posx, $this->posy);\n $this->isdead();\n $this->appendtoturn(\"<b>\" . $this->type . \"</b>(\" . $this->stamina . \") ant molted and became a war ant at \" . $this->world->nest[$this->type]->posx . \"-\" . $this->world->nest[$this->type]->posy);\n }\n\t\t\t$this->brain->setstate(\"findleaf\");\n\t\t}\n\t\t}\n\t}", "public function shipping(): MorphOne;", "public function createHabitablePlanet($i) {\n\t\t// we'll set the zone at between 113.92 and 236.44 times the radius.\n\t\t$d = 1.00*$this->radius*rand($this->goldilocksMin,$this->goldilocksMax);\n\t\t$this->children[$i] = new Heliosphere($this->dbconn);\n\t\t$this->children[$i]->setObjectType(3);\n\t\t$this->children[$i]->setPlayerID(-1);\t// Nobody owns newly created planets\n\t\t$this->children[$i]->setStarID($this->starID);\n\t\t$this->children[$i]->setParentID($this->hoID);\n\t\t$this->children[$i]->setApogee($d);\n\t\t$this->children[$i]->setPerigee($d);\t// For early versions of the game, we'll only worry about circular orbits.\n\t\t$this->children[$i]->setRandomName('S'.$this->starID.'P'.$i);\n\t\t$this->children[$i]->setHabitable(true);\n\t}", "public function run(Faker $faker)\n {\n\n /* Piatti ristorante 1 Pasta, Healthy */\n\n $names1 = [\"Spaghetti allo scoglio\", \"Pasta alla carbonara\", \"Salmon Salad\", \"Chicken Salad\", \"Acqua\", \"Coca cola\", \"Birra artigianale\", \"Pennete panna e salmone\", \"Taco Salad\", \"Pasta Salad\"];\n $images1 = [\"img_restaurants/spaghetti_scoglio.jpg\", \"img_restaurants/carbf.jpg\", \"img_restaurants/orange_salad.jpg\", \"img_restaurants/chicken_salad.jpg\", \"img_restaurants/acqua.jpg\", \"img_restaurants/coca.jpg\", \"img_restaurants/birraf.jpg\", \"img_restaurants/panna_salmonef.jpg\", \"img_restaurants/taco_saladf.jpg\", \"img_restaurants/healthy_pasta_saladf.jpg\"];\n $ingred1 = [\n \"Spaghetti, gamberi, cozze, arsele, pomodoro\",\n \"Spaghetti, guanciale, uova, pecorino, sale, pepe\",\n \"Salmone marinato, Menta, Avocado, Mango, Edamame, Germogli di soia\",\n \"Pollo, pomodori, mais, mozzarella\",\n \"Acqua\",\n \"Acqua, Anidride carbonica, Zucchero, Aromi naturali, Caffeina\",\n \"Malto d'orzo, luppolo, lievito, acqua\",\n \"Pennete, panna, salmone, erba cipollina\",\n \"Carne lessa, pomodori ciliegini, lattuga romana, avocado\",\n \"Fusilli, pomodori, peperoni rossi, pomodori, basilico, olio extra vergine d'oliva\",\n ];\n\n for ($i=0; $i < 10; $i++) {\n\n $newDish = new Dish;\n $newDish->name = $names1[$i];\n $newDish->img = $images1[$i];\n $newDish->description = $ingred1[$i];\n $newDish->price = number_format(rand(100, 1000) / 100, 2);\n $newDish->discount = rand(0, 1);\n $newDish->rating = rand(3, 5);\n $newDish->menu_class = \"\";\n $newDish->discount_id = \"\";\n $newDish->restaurant_id = 1;\n\n $dish = Dish::all();\n $slugs = array();\n\n foreach ($dish as $value) {\n array_push($slugs, $value->slug);\n }\n\n do {\n $numb = rand(100, 1000);\n $slug = Str::slug($newDish->name) . $newDish->restaurant_id . $numb;\n } while (in_array($slug, $slugs));\n\n $newDish->slug = $slug;\n $newDish->save();\n\n }\n\n $newDish = new Dish;\n $newDish->name = 'baby-yoda';\n $newDish->img = 'img_restaurants/baby.jpg';\n $newDish->description = 'Daje';\n $newDish->price = 999;\n $newDish->discount = 0;\n $newDish->rating = 5;\n $newDish->menu_class = \"\";\n $newDish->discount_id = \"\";\n $newDish->restaurant_id = 1;\n\n\n $newDish->slug = 'baby-yoda';\n $newDish->save();\n\n /* //Piatti ristorante 1 Pasta, Healthy //*/\n\n\n /* Piatti ristorante 2 Pizza, Ristorante */\n\n $names2 = [\"Margherita\", \"Prosciutto\", \"Funghi\", \"Wurstel e patatine\", \"Acqua\", \"Coca cola\", \"Birra artigianale\", \"Bistecca alla fiorentina\", \"Pennete panna e salmone\", \"Fritto misto\"];\n $images2 = [\"img_restaurants/margheritaf.jpg\", \"img_restaurants/prosciuttof.jpg\", \"img_restaurants/pizza_funghif.jpg\", \"img_restaurants/wurstel_e_patatinef.jpg\", \"img_restaurants/acqua.jpg\", \"img_restaurants/coca.jpg\", \"img_restaurants/birraf.jpg\", \"img_restaurants/bisteccaf.jpg\", \"img_restaurants/panna_salmonef.jpg\", \"img_restaurants/fritto_mistof.jpg\"];\n $ingred2 = [\n \"Pomodoro, mozzarella, basilico\",\n \"Pomodoro, mozzarella, prosciutto\",\n \"Pomodoro, mozzarella, funghi\",\n \"Pomodoro, mozzarella, wurstel, patatine\",\n \"Acqua\",\n \"Acqua, Anidride carbonica, Zucchero, Aromi naturali, Caffeina\",\n \"Malto d'orzo, luppolo, lievito, acqua\",\n \"Carne bovina, peppe\",\n \"Pennete, panna, salmone, erba cipollina\",\n \"Gamberetti, triglie, alici, calamari, semola, sale\",\n ];\n\n for ($i = 0; $i < 10; $i++) {\n\n $newDish = new Dish;\n $newDish->name = $names2[$i];\n $newDish->img = $images2[$i];\n $newDish->description = $ingred2[$i];\n $newDish->price = number_format(rand(100, 1000) / 100, 2);\n $newDish->discount = rand(0, 1);\n $newDish->rating = rand(3, 5);\n $newDish->menu_class = \"\";\n $newDish->discount_id = \"\";\n $newDish->restaurant_id = 2;\n\n $dish = Dish::all();\n $slugs = array();\n\n foreach ($dish as $value) {\n array_push($slugs, $value->slug);\n }\n\n do {\n $numb = rand(100, 1000);\n $slug = Str::slug($newDish->name) . $newDish->restaurant_id . $numb;\n } while (in_array($slug, $slugs));\n\n $newDish->slug = $slug;\n $newDish->save();\n }\n\n /* //Piatti ristorante 2 Pizza, Ristorante //*/\n\n\n /* Piatti ristorante 3 Giapponese, Cinese, Asiatico */\n\n $names3 = [\"Nighiri\", \"Uramaki\", \"Tempura di gamberi\", \"Involtini primavera\", \"Acqua\", \"Coca cola\", \"Birra artigianale\", \"Ravioli cinesi\", \"Ramen\", \"Onigiri\"];\n $images3 = [\"img_restaurants/nighirif.jpg\", \"img_restaurants/uramakif.jpg\", \"img_restaurants/tempuraf.jpg\", \"img_restaurants/involtini_primaveraf.jpg\", \"img_restaurants/acqua.jpg\", \"img_restaurants/coca.jpg\", \"img_restaurants/birraf.jpg\", \"img_restaurants/ravioli_cinesif.jpg\", \"img_restaurants/ramenf.jpg\", \"img_restaurants/onigirif.jpg\"];\n $ingred3 = [\n \"Riso nishiki, salmone, tonno\",\n \"Riso nishiki, alga nori, avocado, polpa di granchio\",\n \"Gamberi, farina di riso, farina\",\n \"Sfoglie per involtini, cavolo cappuccio, carote\",\n \"Acqua\",\n \"Acqua, Anidride carbonica, Zucchero, Aromi naturali, Caffeina\",\n \"Malto d'orzo, luppolo, lievito, acqua\",\n \"Maiale, cavolo, cipolla, farina, vino di riso\",\n \"Noodles, lonza di maiale, uova, cipollotto, salsa di soia, sake, naruto, aglio\",\n \"Riso, salmone, tonno, olio\",\n ];\n\n for ($i = 0; $i < 10; $i++) {\n\n $newDish = new Dish;\n $newDish->name = $names3[$i];\n $newDish->img = $images3[$i];\n $newDish->description = $ingred3[$i];\n $newDish->price = number_format(rand(100, 1000) / 100, 2);\n $newDish->discount = rand(0, 1);\n $newDish->rating = rand(3, 5);\n $newDish->menu_class = \"\";\n $newDish->discount_id = \"\";\n $newDish->restaurant_id = 3;\n\n $dish = Dish::all();\n $slugs = array();\n\n foreach ($dish as $value) {\n array_push($slugs, $value->slug);\n }\n\n do {\n $numb = rand(100, 1000);\n $slug = Str::slug($newDish->name) . $newDish->restaurant_id . $numb;\n } while (in_array($slug, $slugs));\n\n $newDish->slug = $slug;\n $newDish->save();\n }\n\n /* //Piatti ristorante 3 Giapponese, Cinese, Asiatico //*/\n\n\n /* Piatti ristorante 4 Dolci e Dessert, Gelato */\n\n $names4 = [\"Tiramisù\", \"Muffin al cioccolato\", \"Torta panna e nutella\", \"Mousse al caffè\", \"Acqua\", \"Coca cola\", \"Birra artigianale\", \"Gelato al melone\", \"Gelato al cioccolato\", \"Gelato al pistacchio\"];\n $images4 = [\"img_restaurants/tiramisuf.jpg\", \"img_restaurants/muffinf.jpg\", \"img_restaurants/nutf.jpg\", \"img_restaurants/mousecaf.jpg\", \"img_restaurants/acqua.jpg\", \"img_restaurants/coca.jpg\", \"img_restaurants/birraf.jpg\", \"img_restaurants/melonef.jpg\", \"img_restaurants/ciocf.jpg\", \"img_restaurants/pistacchiof.jpg\"];\n $ingred4 = [\n \"Savoiardi, mascarpone, uova, zucchero, caffè\",\n \"Cacao, farina, zucchero, burro, cioccolato, uova, latte, lievito\",\n \"Farina, zucchero, panna, nutella, cioccolato, uova, latte\",\n \"Uova, zucchero, panna, caffè, vaniglia\",\n \"Acqua\",\n \"Acqua, Anidride carbonica, Zucchero, Aromi naturali, Caffeina\",\n \"Malto d'orzo, luppolo, lievito, acqua\",\n \"Melone, panna, latte, zucchero, uova\",\n \"Cacao, panna, latte, zucchero, uova\",\n \"Crema al pistacchio, panna, latte, zucchero, uova\",\n ];\n\n for ($i = 0; $i < 10; $i++) {\n\n $newDish = new Dish;\n $newDish->name = $names4[$i];\n $newDish->img = $images4[$i];\n $newDish->description = $ingred4[$i];\n $newDish->price = number_format(rand(100, 1000) / 100, 2);\n $newDish->discount = rand(0, 1);\n $newDish->rating = rand(3, 5);\n $newDish->menu_class = \"\";\n $newDish->discount_id = \"\";\n $newDish->restaurant_id = 4;\n\n $dish = Dish::all();\n $slugs = array();\n\n foreach ($dish as $value) {\n array_push($slugs, $value->slug);\n }\n\n do {\n $numb = rand(100, 1000);\n $slug = Str::slug($newDish->name) . $newDish->restaurant_id . $numb;\n } while (in_array($slug, $slugs));\n\n $newDish->slug = $slug;\n $newDish->save();\n }\n\n /* //Piatti ristorante 4 Dolci e Dessert, Gelato //*/\n\n\n /* Piatti ristorante 5 Hamburger, Kebab */\n $names5 = [\"Acqua\", \"Hamburger\", \"Kebab\", \"Bistecca\", \"Chicken Burger\", \"Crispy Chicken\", \"Birra\", \"Coca-Cola\", \"Filetto di manzo\", \"Pollo grigliato\"];\n $images5 = [\"img_restaurants/acqua.jpg\", \"img_restaurants/hamburger.jpeg\", \"img_restaurants/kebab.jpeg\", \"img_restaurants/bistecca.jpeg\", \"img_restaurants/chicken-burger.jpeg\", \"img_restaurants/crispy-chicken.jpeg\", \"img_restaurants/beer.jpeg\", \"img_restaurants/coca-cola.jpeg\", \"img_restaurants/filetto-manzo.jpeg\", \"img_restaurants/pollo-grigliato.jpeg\"];\n $ingred5 = [\n \"Acqua\",\n \"Pomodori, insalata, Hamburger di Manzo, cheddar, patatine\",\n \"Kebab, piadina, insalata, pomdori, cipolle\",\n \"Bistecca di bovino, patatine\",\n \"Pollo fritto, salsa aioli, insalata, pomodori \",\n \"Pollo fritto, salsa rosa, insalata, cetrioli\",\n \"Birra\",\n \"Coca-Cola\",\n \"Filetto di manzo, verdure di stagione\",\n \"Pollo grigliato, verdure di\",\n ];\n\n for ($i = 0; $i < 10; $i++) {\n\n $newDish = new Dish;\n $newDish->name = $names5[$i];\n $newDish->img = $images5[$i];\n $newDish->description = $ingred5[$i];\n $newDish->price = number_format(rand(100, 1000) / 100, 2);\n $newDish->discount = rand(0, 1);\n $newDish->rating = rand(3, 5);\n $newDish->menu_class = \"\";\n $newDish->discount_id = \"\";\n $newDish->restaurant_id = 5;\n\n $dish = Dish::all();\n $slugs = array();\n\n foreach ($dish as $value) {\n array_push($slugs, $value->slug);\n }\n\n do {\n $numb = rand(100, 1000);\n $slug = Str::slug($newDish->name) . $newDish->restaurant_id . $numb;\n } while (in_array($slug, $slugs));\n\n $newDish->slug = $slug;\n $newDish->save();\n }\n /* //Piatti ristorante 5 Hamburger, Kebab //*/\n\n\n /* Piatti ristorante 6 Messicano, Piadina, Burrito */\n $names6 = [\"Taco\", \"Burrito\", \"Nachos Cheese\", \"Taco Steak\", \"Taco Vegetarian\", \"Nachos Sausage\", \"Birra\", \"Coca-Cola\", \"Acqua\", \"Jarritos\"];\n $images6 = [\"img_restaurants/tacos.jpeg\", \"img_restaurants/burrito.jpeg\", \"img_restaurants/nachos.jpeg\", \"img_restaurants/taco-steak.jpeg\", \"img_restaurants/burrito-vegan.jpeg\", \"img_restaurants/nachos-sausage.jpeg\", \"img_restaurants/beer.jpeg\", \"img_restaurants/coca-cola.jpeg\", \"img_restaurants/acqua.jpg\", \"img_restaurants/jarritos.jpg\"];\n $ingred6 = [\n \"Tortilla, Carne trita, cipolle rosse, tabasco, peperoni\",\n \"Tortilla, trito di manzo, salsa sour, pomodori, formaggio, fagioli messicani\",\n \"Nachos, cheddar fuso\",\n \"Tortilla, manzo, patate, insalata, pomodori, salsa sour, cheddar\",\n \"Tortilla, crauti, riso, avocado, insalata, pomodori, mais, olive, carote\",\n \"Nachos, salsiccia, bacon, jalapeno, cheddar\",\n \"Birra\",\n \"Coca-Cola\",\n \"Acqua\",\n \"Jarritos\",\n ];\n\n for ($i = 0; $i < 10; $i++) {\n\n $newDish = new Dish;\n $newDish->name = $names6[$i];\n $newDish->img = $images6[$i];\n $newDish->description = $ingred6[$i];\n $newDish->price = number_format(rand(100, 1000) / 100, 2);\n $newDish->discount = rand(0, 1);\n $newDish->rating = rand(3, 5);\n $newDish->menu_class = \"\";\n $newDish->discount_id = \"\";\n $newDish->restaurant_id = 6;\n\n $dish = Dish::all();\n $slugs = array();\n\n foreach ($dish as $value) {\n array_push($slugs, $value->slug);\n }\n\n do {\n $numb = rand(100, 1000);\n $slug = Str::slug($newDish->name) . $newDish->restaurant_id . $numb;\n } while (in_array($slug, $slugs));\n\n $newDish->slug = $slug;\n $newDish->save();\n }\n /* //Piatti ristorante 6 Messicano, Piadina, Burrito //*/\n\n\n\n /* Piatti ristorante 7 Mediterraneo, Italiano */\n $names7 = [\"Pasta con pesto di pistacchi\", \"Tagliatelle al ragù bolognese\", \"Pasta con panna e tartufo\", \"Orata sotto sale\", \"Tagliere di salumi\", \"Vino rosso della casa\", \"Birra\", \"Coca-Cola\", \"Acqua\", \"Fanta\"];\n $images7 = [\"img_restaurants/pasta-pesto-pistacchi.jpeg\", \"img_restaurants/ragu-bolognese.jpeg\", \"img_restaurants/pasta-panna.jpeg\", \"img_restaurants/pesce-sotto-sale.jpeg\", \"img_restaurants/tagliere-salumi.jpeg\", \"img_restaurants/wine-red.jpeg\", \"img_restaurants/beer.jpeg\", \"img_restaurants/coca-cola.jpeg\", \"img_restaurants/acqua.jpg\", \"img_restaurants/fanta.jpg\"];\n $ingred7 = [\n \"Pasta con pesto di pistacchi\",\n \"Tagliatelle al ragù bolognese\",\n \"Spaghetti con panna e tartufo\",\n \"Orata sotto sale, verdure di stagione\",\n \"Tagliere di salumi e formaggi\",\n \"Nachos, salsiccia, bacon, jalapeno, cheddar\",\n \"Vino rosso della casa\",\n \"Coca-Cola\",\n \"Acqua\",\n \"Fanta\",\n ];\n\n for ($i = 0; $i < 10; $i++) {\n\n $newDish = new Dish;\n $newDish->name = $names7[$i];\n $newDish->img = $images7[$i];\n $newDish->description = $ingred7[$i];\n $newDish->price = number_format(rand(100, 1000) / 100, 2);\n $newDish->discount = rand(0, 1);\n $newDish->rating = rand(3, 5);\n $newDish->menu_class = \"\";\n $newDish->discount_id = \"\";\n $newDish->restaurant_id = 7;\n\n $dish = Dish::all();\n $slugs = array();\n\n foreach ($dish as $value) {\n array_push($slugs, $value->slug);\n }\n\n do {\n $numb = rand(100, 1000);\n $slug = Str::slug($newDish->name) . $newDish->restaurant_id . $numb;\n } while (in_array($slug, $slugs));\n\n $newDish->slug = $slug;\n $newDish->save();\n }\n /* //Piatti ristorante 7 Mediterraneo, Italiano //*/\n\n\n /* Piatti ristorante 8 Americano, Hamburger */\n $names8 = [\"Hamburger Classic\", \"Patatine fritte\", \"Pancake\", \"Hot-Dog\", \"Cookies\", \"Donuts\", \"Birra\", \"Coca-Cola\", \"Acqua\", \"Fanta\"];\n $images8 = [\"img_restaurants/ham-burger.jpeg\", \"img_restaurants/fries.jpeg\", \"img_restaurants/pancake.jpeg\", \"img_restaurants/hot-dog.jpeg\", \"img_restaurants/cookies.jpeg\", \"img_restaurants/donuts.jpeg\", \"img_restaurants/beer.jpeg\", \"img_restaurants/coca-cola.jpeg\", \"img_restaurants/acqua.jpg\", \"img_restaurants/fanta.jpg\"];\n $ingred8 = [\n \"Hamburger, insalata, pomodoro, bacon, formaggio\",\n \"Porzione di patatine fritte\",\n \"Pancakes con nutella e fragole\",\n \"Hot-Dog con mayonese / ketchup / senape\",\n \"Cookies con gocce di cioccolato\",\n \"Donuts vari gusti\",\n \"Birra\",\n \"Coca-Cola\",\n \"Acqua\",\n \"Fanta\",\n ];\n\n for ($i = 0; $i < 10; $i++) {\n\n $newDish = new Dish;\n $newDish->name = $names8[$i];\n $newDish->img = $images8[$i];\n $newDish->description = $ingred8[$i];\n $newDish->price = number_format(rand(100, 1000) / 100, 2);\n $newDish->discount = rand(0, 1);\n $newDish->rating = rand(3, 5);\n $newDish->menu_class = \"\";\n $newDish->discount_id = \"\";\n $newDish->restaurant_id = 8;\n\n $dish = Dish::all();\n $slugs = array();\n\n foreach ($dish as $value) {\n array_push($slugs, $value->slug);\n }\n\n do {\n $numb = rand(100, 1000);\n $slug = Str::slug($newDish->name) . $newDish->restaurant_id . $numb;\n } while (in_array($slug, $slugs));\n\n $newDish->slug = $slug;\n $newDish->save();\n }\n /* //Piatti ristorante 8 Americano, Hamburger //*/\n\n\n /* Piatti ristorante 9 Poke, Healthy */\n $names9 = [\"Poke Classic\", \"Filetto di Salmone\", \"Egg-Salad\", \"Caesar-Salad\", \"Protein Porridge\", \"Avocado-Toast\", \"Poke-Vegetarian\", \"Coca-Cola\", \"Acqua\", \"Fanta\"];\n $images9 = [\"img_restaurants/poke.jpeg\", \"img_restaurants/salmone.jpeg\", \"img_restaurants/egg-salad.jpeg\", \"img_restaurants/caesar-salad.jpeg\", \"img_restaurants/porridge.jpeg\", \"img_restaurants/avocado-toast.jpeg\", \"img_restaurants/poke2.jpeg\", \"img_restaurants/coca-cola.jpeg\", \"img_restaurants/acqua.jpg\", \"img_restaurants/fanta.jpg\"];\n $ingred9 = [\n \"Riso, salmone, pomodori, funghi, avocado \",\n \"Filetto di salmone con verdure di stagione\",\n \"Insalata con uova e verdure di stagione\",\n \"Insalata greca con filetti di pollo grigliato e verdure di stagione\",\n \"Porridge proteico con frutta di stagione\",\n \"Avocado toast con salmone affumicato\",\n \"Poke vegetariano con tofu, zucchine, riso, carote, fagioli \",\n \"Coca-Cola\",\n \"Acqua\",\n \"Fanta\",\n ];\n\n for ($i = 0; $i < 10; $i++) {\n\n $newDish = new Dish;\n $newDish->name = $names9[$i];\n $newDish->img = $images9[$i];\n $newDish->description = $ingred9[$i];\n $newDish->price = number_format(rand(100, 1000) / 100, 2);\n $newDish->discount = rand(0, 1);\n $newDish->rating = rand(3, 5);\n $newDish->menu_class = \"\";\n $newDish->discount_id = \"\";\n $newDish->restaurant_id = 9;\n\n $dish = Dish::all();\n $slugs = array();\n\n foreach ($dish as $value) {\n array_push($slugs, $value->slug);\n }\n\n do {\n $numb = rand(100, 1000);\n $slug = Str::slug($newDish->name) . $newDish->restaurant_id . $numb;\n } while (in_array($slug, $slugs));\n\n $newDish->slug = $slug;\n $newDish->save();\n }\n /* //Piatti ristorante 9 Poke, Healthy //*/\n\n\n /* Piatti ristorante 10 Mediterraneo, Italiano */\n $names10 = [\"Acqua\", \"Vino Rosso\", \"Salmone\", \"Bistecca\", \"Polpette\", \"Filetto con verdure\", \"Birra\", \"Coca-Cola\", \"Pasta al pesto\", \"Risotto allo zafferano\"];\n $images10 = [\"img_restaurants/acqua.jpg\", \"img_restaurants/wine-red.jpeg\", \"img_restaurants/salmone.jpeg\", \"img_restaurants/bistecca.jpeg\", \"img_restaurants/polpette.jpg\", \"img_restaurants/carne_verdure.jpg\", \"img_restaurants/beer.jpeg\", \"img_restaurants/coca-cola.jpeg\", \"img_restaurants/pesto_tradiz.jpg\", \"img_restaurants/zafferano.jpg\"];\n $ingred10 = [\n \"Acqua\",\n \"Vino rosso\",\n \"Salmone con verdure\",\n \"Bistecca di bovino, patatine\",\n \"Polpette di bovino con insalata\",\n \"Filetto alla griglia con verdure\",\n \"Birra\",\n \"Coca-Cola\",\n \"Pasta al pesto, ricetta tradizionale\",\n \"Risotto allo zafferano secondo la nostra ricetta\",\n ];\n\n for ($i=0; $i < 10; $i++) {\n\n $newDish = new Dish;\n $newDish->name = $names10[$i];\n $newDish->img = $images10[$i];\n $newDish->description = $ingred10[$i];\n $newDish->price = number_format(rand(100, 1000) / 100, 2);\n $newDish->discount = rand(0, 1);\n $newDish->rating = rand(3, 5);\n $newDish->menu_class = \"\";\n $newDish->discount_id = \"\";\n $newDish->restaurant_id = 10;\n\n $dish = Dish::all();\n $slugs = array();\n\n foreach ($dish as $value) {\n array_push($slugs, $value->slug);\n }\n\n do {\n $numb = rand(100, 1000);\n $slug = Str::slug($newDish->name) . $newDish->restaurant_id . $numb;\n } while (in_array($slug, $slugs));\n\n $newDish->slug = $slug;\n $newDish->save();\n\n }\n /* //Piatti ristorante 10 Mediterraneo, Italiano //*/\n\n\n /* Piatti ristorante 11 Indiano, Asiatico */\n $names11 = [\"Acqua\", \"Vino Rosso\", \"Budino di carote\", \"Curry\", \"Chotpoti\", \"Samosa\", \"Birra\", \"Coca-Cola\", \"Pakora\", \"Biryani\"];\n $images11 = [\"img_restaurants/acqua.jpg\", \"img_restaurants/wine-red.jpeg\", \"img_restaurants/budino_carote.jpg\", \"img_restaurants/curry.jpg\", \"img_restaurants/chotpoti.jpg\", \"img_restaurants/samosa.jpg\", \"img_restaurants/beer.jpeg\", \"img_restaurants/coca-cola.jpeg\", \"img_restaurants/pakora.jpg\", \"img_restaurants/biryani.jpg\"];\n $ingred11 = [\n \"Acqua\",\n \"Vino rosso\",\n \"Budino di carote\",\n \"Curry ricetta tradizionale\",\n \"Patate, ceci, cipolle, peperoncini, uova sode grattugiate, tamarindo, foglie di coriandolo e cumino\",\n \"Impasto a base di farina avvolge un ripieno di: patate, cipolle, lenticchie, formaggio, manzo o pollo, coriandolo, peperoncino, zenzero, garam masala.\",\n \"Birra\",\n \"Coca-Cola\",\n \"Peperoncino verde, cumino, garam masala, chiodi di garofano, cipolle, funghi, fagiolini, spinaci, zucchine, peperoni, melanzane, cavolfiori.\",\n \"Riso basmati bollito a cui si aggiungono molte spezie e vari ingredienti cotti separatamente: carne, pesce, verdure.\",\n ];\n\n for ($i=0; $i < 10; $i++) {\n\n $newDish = new Dish;\n $newDish->name = $names11[$i];\n $newDish->img = $images11[$i];\n $newDish->description = $ingred11[$i];\n $newDish->price = number_format(rand(100, 1000) / 100, 2);\n $newDish->discount = rand(0, 1);\n $newDish->rating = rand(3, 5);\n $newDish->menu_class = \"\";\n $newDish->discount_id = \"\";\n $newDish->restaurant_id = 11;\n\n $dish = Dish::all();\n $slugs = array();\n\n foreach ($dish as $value) {\n array_push($slugs, $value->slug);\n }\n\n do {\n $numb = rand(100, 1000);\n $slug = Str::slug($newDish->name) . $newDish->restaurant_id . $numb;\n } while (in_array($slug, $slugs));\n\n $newDish->slug = $slug;\n $newDish->save();\n\n }\n /* //Piatti ristorante 11 Indiano, Asiatico //*/\n\n\n\n /* Piatti ristorante 12 Thailandese, Asiatico */\n $names12 = [\"Acqua\", \"Vino Rosso\", \"Pad Thai\", \"Khao Pad\", \"Yam Nua\", \"Laap\", \"Birra\", \"Coca-Cola\", \"Som Tam\", \"Khao Soi\"];\n $images12 = [\"img_restaurants/acqua.jpg\", \"img_restaurants/wine-red.jpeg\", \"img_restaurants/pad_thai.jpg\", \"img_restaurants/khao_pad.jpg\", \"img_restaurants/yam_nua.jpg\", \"img_restaurants/laap.jpg\", \"img_restaurants/beer.jpeg\", \"img_restaurants/coca-cola.jpeg\", \"img_restaurants/som_tam.jpg\", \"img_restaurants/khao_soi.jpg\"];\n $ingred12 = [\n \"Acqua\",\n \"Vino rosso\",\n \"Cucinato con uova e tofu, insaporito con polpa di tamarindo, salsa di pesce, gamberi, aglio, peperoncino e zucchero di palma.\",\n \"Riso Jasmine accompagnato da carne, pollo, gamberetti e granchio, uovo, cipolla, aglio ed occasionalmente pomodoro.\",\n \"Insalata servita con manzo grigliato tagliato a fette e servito con lemon grass, verdure grigliate e cipolle croccanti.\",\n \"Insalata con carne macinata, cucinata con pollo, manzo, anatra, pesce, maiale o funghi.\",\n \"Birra\",\n \"Coca-Cola\",\n \"Insalata piccante di papaya, composta da papaya sminuzzata, pasta di gamberetti, gamberi, aglio, chili e melanzane crude.\",\n \"Zuppa di noodles servita con maiale, pomodori, fagioli di soia fermentati, germogli di fagioli e scalogno.\",\n ];\n\n for ($i=0; $i < 10; $i++) {\n\n $newDish = new Dish;\n $newDish->name = $names12[$i];\n $newDish->img = $images12[$i];\n $newDish->description = $ingred12[$i];\n $newDish->price = number_format(rand(100, 1000) / 100, 2);\n $newDish->discount = rand(0, 1);\n $newDish->rating = rand(3, 5);\n $newDish->menu_class = \"\";\n $newDish->discount_id = \"\";\n $newDish->restaurant_id = 12;\n\n $dish = Dish::all();\n $slugs = array();\n\n foreach ($dish as $value) {\n array_push($slugs, $value->slug);\n }\n\n do {\n $numb = rand(100, 1000);\n $slug = Str::slug($newDish->name) . $newDish->restaurant_id . $numb;\n } while (in_array($slug, $slugs));\n\n $newDish->slug = $slug;\n $newDish->save();\n\n }\n /* //Piatti ristorante 12 Thailandese, Asiatico //*/\n }", "public function run()\n {\n Township::create([\n \t'name' => 'ခ်မ္းျမသာစည္ ျမိဳ႕နယ္',\n 'state_id' => 9\n ]);\n\n Township::create([\n \t'name' => 'ခ်မ္းေအးသာဇံ ျမိဳ႕နယ္',\n 'state_id' => 9\n ]);\n\n Township::create([\n \t'name' => 'မဟာေအာင္ေျမ ျမိဳ႕နယ္',\n 'state_id' => 9\n ]);\n\n Township::create([\n \t'name' => 'အမရပူရ ျမိဳ႕နယ္',\n 'state_id' => 9\n ]);\n\n Township::create([\n \t'name' => 'ကမာရြတ္ ျမိဳ႕နယ္',\n 'state_id' => 3\n ]);\n Township::create([\n 'name' => 'တာေမြ ျမိဳ႕နယ္',\n 'state_id' => 3\n ]);\n Township::create([\n 'name' => 'အင္းစိန္ ျမိဳ႕နယ္',\n 'state_id' => 3\n ]);\n\n\n Township::create([\n 'name' => 'ဖားကန္႕ ျမိဳ႕နယ္',\n 'state_id' => 12\n ]);\n Township::create([\n 'name' => 'ကန္႕ဘလူ ျမိဳ႕နယ္',\n 'state_id' => 12\n ]);\n Township::create([\n 'name' => 'မုံရြာ ျမိဳ႕နယ္',\n 'state_id' => 12\n ]);\n }", "public function run()\n {\n $this->name = 'Faroe Islands';\n $this->official_name = 'Faroe Islands';\n $this->iso_alpha_2 = 'FO';\n $this->iso_alpha_3 = 'FRO';\n $this->iso_numeric = '234';\n $this->international_phone = '298';\n \n $this->languages = ['fo'];\n $this->tld = ['.fo'];\n $this->wmo = 'FA';\n $this->geoname_id = '2622320';\n \n $this->emoji = [\n 'img' => '🇫🇴',\n 'uCode' => 'U+1F1EB U+1F1F4',\n ];\n $this->color = [\n 'hex' => [\n ],\n 'rgb' => [\n ],\n ];\n $this->coordinates = [\n 'latitude' => [\n 'classic' => '62 00 N',\n 'desc' => '62.009559631347656',\n ],\n 'longitude' => [\n 'classic' => '7 00 W',\n 'desc' => '-6.818255424499512',\n ],\n ];\n $this->coordinates_limit = [\n 'latitude' => [\n 'max' => '62.4',\n 'min' => '61.333333',\n ],\n 'longitude' => [\n 'max' => '-6.25',\n 'min' => '-7.8',\n ],\n ];\n \n $this->geographical = json_decode($this->geographical(), true);\n \n Builder::country($this);\n }", "public function createShip($data)\n {\n return $this->insert($data);\n }", "public function run()\n {\n $map = Map::where('name', '东海龙宫')->first();\n $npc = Npc::where('name', '龙王敖广')->first();\n\n $items = [\n [\n \"level\" => 0,\n \"open_level\" => 10,\n \"type\" => \"normal\",\n \"cost\" => \"战斗外使用需当前气血≥气血上限的40%;战斗中使用需要当前气血≥10且当前魔法≥10\",\n \"description\" => \"平时使用后可以瞬间回到自己的门派,战斗中使用有一定机率失败。\",\n \"name\" => \"龙游四海\"\n ],\n [\n \"level\" => 0,\n \"open_level\" => 10,\n \"type\" => \"normal\",\n \"cost\" => \"人物等级 * 2.2点魔法值\",\n \"description\" => \"使用水系法术攻击单个目标,减少30%的伤害效果,同时在一定回合内增加自身的物理躲避率和法术躲避率\",\n \"name\" => \"游龙步\"\n ],\n [\n \"level\" => 0,\n \"open_level\" => 10,\n \"type\" => \"normal\",\n \"cost\" => \"消耗人物等级 * 2点魔法值\",\n \"description\" => \"使用水系法术攻击对方多个目标(技能25级以上作用2个目标、50级以上作用3个目标、75级以上作用4个目标、100级以上作用5个目标)\",\n \"name\" => \"疾风骤雨\"\n ],\n [\n \"level\" => 0,\n \"open_level\" => 10,\n \"type\" => \"normal\",\n \"cost\" => \"人物等级 * 2.6点魔法值\",\n \"description\" => \"使用雷系法术攻击敌人,可攻击隐身的怪物和宠物,同时能将其打出隐身状态。\",\n \"name\" => \"飞龙在天\"\n ],\n [\n \"level\" => 0,\n \"open_level\" => 10,\n \"type\" => \"normal\",\n \"cost\" => \"人物等级 * 2.5点魔法值\",\n \"description\" => \"减少敌方全体队员一定的气血和魔法值\",\n \"name\" => \"龙啸\"\n ],\n [\n \"level\" => 0,\n \"open_level\" => 10,\n \"type\" => \"normal\",\n \"cost\" => \"技能等级 / 2的活力\",\n \"description\" => \"暂时为武器附加攻击效果,持续24小时\",\n \"name\" => \"龙威\"\n ],\n [\n \"level\" => 0,\n \"open_level\" => 10,\n \"type\" => \"normal\",\n \"cost\" => \"人物等级 * 2点魔法值\",\n \"description\" => \"使用水系法术攻击单个目标\",\n \"name\" => \"升龙\"\n ],\n [\n \"level\" => 0,\n \"open_level\" => 10,\n \"type\" => \"normal\",\n \"cost\" => \"人物等级 * 2.4点魔法值\",\n \"description\" => \"为自己附加魔法反击效果,受普通物理攻击则以升龙反击对手,伤害为正常的 80%\",\n \"name\" => \"神龙回首\"\n ],\n [\n \"level\" => 0,\n \"open_level\" => 10,\n \"type\" => \"normal\",\n \"cost\" => \"人物等级 * 2.2点魔法值\",\n \"description\" => \"使用水系法术攻击单个目标,减少30%的伤害结果,同时在一定回合内增加自己的武器攻击力\",\n \"name\" => \"蛟龙出海\"\n ],\n [\n \"level\" => 0,\n \"open_level\" => 10,\n \"type\" => \"normal\",\n \"cost\" => \"人物等级 * 2.7魔法值\",\n \"description\" => \"使用火系法术攻击两个目标\",\n \"name\" => \"双龙戏珠\"\n ],\n [\n \"level\" => 0,\n \"open_level\" => 10,\n \"type\" => \"normal\",\n \"cost\" => \"人物等级 * 2.5点魔法值\",\n \"description\" => \"解除自己或队友所中的毒状态,同时附加“抗毒”状态3回合\",\n \"name\" => \"龙涎\"\n ],\n ];\n\n $items = collect($items)->map(function ($item) use ($map, $npc) {\n return array_merge($item, [\n \"map_id\" => $map[\"id\"],\n \"npc_id\" => $npc[\"id\"],\n \"created_at\" => Carbon::now(),\n \"updated_at\" => Carbon::now(),\n ]);\n })\n ->toArray();\n\n Skill::insert($items);\n }", "public function run()\n {\n Dish::factory()\n ->count(70)\n ->create();\n }", "private function fukushoku_create() {\n // $fukushokushikui = $fukushokushikui->shuffle();\n // $fukushokustakai = Fukushoku::where('display', true)->where('bunrui' , '1')->where('kakaku' , '1')->get();\n // $fukushokustakai = $fukushokustakai->shuffle();\n \n // $this->create_shoku_data('App\\Tyuu', $fukushokushikui, $fukushokustakai);\n \n }", "private function fukushoku_create2() {\n // $fukushokushikui = $fukushokushikui->shuffle();\n // $fukushokustakai = Fukushoku::where('display', true)->where('bunrui' , '2')->where('kakaku' , '1')->get();\n // $fukushokustakai = $fukushokustakai->shuffle();\n // $this->create_shoku_data('App\\Tyuu', $fukushokushikui, $fukushokustakai);\n }", "private function shushoku_create2() {\n // $shushokushikui = $shushokushikui->shuffle();\n // $shushokustakai = Shushoku::where('display', true)->where('bunrui' , '2')->where('kakaku' , '2')->get();\n // $shushokustakai = $shushokustakai->shuffle();\n\n // $this->create_shoku_data('App\\Dai', $shushokushikui, $shushokustakai);\n }", "function runturn(){\t\tif(count($this->nest) >= 1){\n\t\t$this->absturn++;//increment the absolute turn\n\t\tforeach($this->nest as $key => $nest){\n\t\t\t$this->nest[$key]->update();//run every nest's FSM\n\t\t\tif(count($this->nest[$key]->ant) < 1){//if a nest looses all workers, it crumbles.\n\t\t\t\t$this->turnoutput .= \"<b>Nest ran out of workers and crumbled at \" . $this->nest[$key]->posx . \"-\" . $this->nest[$key]->posy . \"</b><br>\";\n\t\t\t\t$this->nest[$key]->isdead = 1;\n\t\t\t\t$this->spawnfood($this->nest[$key]->posx, $this->nest[$key]->posy, 10, \"Crumbled<br>Nest\");\n\t\t\t\t$this->spawnfood($this->nest[$key]->posx, $this->nest[$key]->posy, 10, \"Crumbled<br>Nest\");\n\t\t\t}\n\t\t}\n\t\tif($this->turn >= 4 && $this->foodcounter < 25){//if the food is under 25, and the turn is over 4, spawn new food.\n\t\t\t$this->turn = 0;\n\t\t\t$this->spawnfood(rand(1,19), rand(1,19));\n\t\t} else {\n\t\t\t$this->turn++;\n\t\t}\n\t\tif(count($this->food) <= 1){//aleways make sure 2 food items are availible on the stage\n\t\t\t$this->food[$this->foodcounter] = new FOOD(rand(1,19), rand(1,19), $this->foodcounter);\n\t\t\t$this->foodcounter++;\n\t\t}\n\t\t$objectlocation = array();\n\t\tforeach($this->nest as $keya => $nest){\n\t\t\tif($this->nest[$keya]->ant[0] != null){\n\t\t\t\tforeach($nest->ant as $keyb => $ant){//run the actions for each ant.\n\t\t\t\t\t$this->nest[$keya]->ant[$keyb]->update();\n\t\t\t\t\tarray_unshift($objectlocation, \"<td width='50' height='50' style='background-color:\" . $this->nest[$keya]->ant[$keyb]->type . \";'><b style='color:white;'>\". $this->nest[$keya]->ant[$keyb]->name .\"<b/></td>\", $this->nest[$keya]->ant[$keyb]->posx, $this->nest[$keya]->ant[$keyb]->posy);\n\t\t\t\t}\n\t\t\t}\n\t\t\tarray_unshift($objectlocation, \"<td width='50' height='50'><b><i>nest</i></b></td>\", $this->nest[$keya]->posx, $this->nest[$keya]->posy);\n\t\t}\n\t\tforeach($this->food as $keyc => $food){\n\t\t\tarray_unshift($objectlocation, \"<td width='50' height='50' style='background-color:pink;'><i>\" . $this->food[$keyc]->name() . \"</i></td>\", $this->food[$keyc]->posx, $this->food[$keyc]->posy);\n\t\t}\n\t\tfor( $i = 0; $i <= 19; $i++){\n\t\t\tfor( $j = 0; $j <= 19; $j++){\n\t\t\t\t$playfield[$i][$j] = \"<td width='50' height='50'>grass</td>\";\n\t\t\t}\n\t\t}\n\t\tfor( $i = 0; $i < count($objectlocation); $i){//place each object on the playfield grid\n\t\t\t$playfield[$objectlocation[$i + 1] - 1][$objectlocation[$i + 2] - 1] = $objectlocation[$i];\n\t\t\t$i += 3;\n\t\t}\n\t\t$output = \"<table border='1' style='text-align:center;'>\";\n\t\tfor($i = 0; $i <= 19; $i++){\n\t\t\t$output .= '<tr>';\n\t\t\tfor($j = 0; $j <= 19; $j++){\n\t\t\t\t$output .= \"\" . $playfield[$i][$j] . '';\n\t\t\t}\n\t\t\t$output .= '</tr>';\n\t\t}\n\t\t$output .= '</table>';\n\t\techo $output . \",\" . \"Turn \" . $this->absturn . \":<br>\" . $this->turnoutput;\n\t\t$this->savetocsv();\n\t\t} else {\n\t\techo \"Everyone died...<br>It's game over man! Game over!<br> The world lasted \" . $this->absturn . \" turns.\";\n\t\t}\n\t}", "public function run()\n {\n $map = Map::where('name', '天魔里')->first();\n $npc = Npc::where('name', '袁飞')->first();\n\n $items = [\n [\n \"level\" => 1,\n \"type\" => \"super\",\n \"open_level\" => 10,\n \"name\" => \"星穹之力\",\n \"description\" => \"暗器伤害效果增加;使用暗器有5%概率出现暗器暴击\"\n ],\n [\n \"level\" => 2,\n \"type\" => \"super\",\n \"open_level\" => 30,\n \"name\" => \"青冥·Ⅰ\",\n \"description\" => \"封印持续的回合数+1(仅在非玩家战斗中有效)\"\n ],\n [\n \"level\" => 2,\n \"type\" => \"super\",\n \"open_level\" => 30,\n \"name\" => \"青冥·Ⅱ\",\n \"description\" => \"封印的基础命中率和命中率上限+5%(仅在非玩家战斗中有效)\"\n ],\n [\n \"level\" => 2,\n \"type\" => \"super\",\n \"open_level\" => 30,\n \"name\" => \"青冥·Ⅲ\",\n \"description\" => \"雨露千本和镰鼬斩的暴击率增加15%(仅在非玩家战斗中有效)\"\n ],\n [\n \"level\" => 3,\n \"type\" => \"super\",\n \"open_level\" => 60,\n \"name\" => \"蓝玉·Ⅰ\",\n \"description\" => \"进入潜行状态的当回合受到攻击有20%几率使伤害结果降低15%\"\n ],\n [\n \"level\" => 3,\n \"type\" => \"super\",\n \"open_level\" => 60,\n \"name\" => \"蓝玉·Ⅱ\",\n \"description\" => \"空蝉状态下不再降低防御力,但受到的伤害结果增加30%\"\n ],\n [\n \"level\" => 3,\n \"type\" => \"super\",\n \"open_level\" => 60,\n \"name\" => \"蓝玉·Ⅲ\",\n \"description\" => \"受到携带毒状态的目标攻击时,伤害减少6%\"\n ],\n [\n \"level\" => 4,\n \"type\" => \"super\",\n \"open_level\" => 80,\n \"name\" => \"橙光·Ⅰ\",\n \"description\" => \"单体封印法术失败时,有13%几率返还此次技能的消耗\"\n ],\n [\n \"level\" => 4,\n \"type\" => \"super\",\n \"open_level\" => 80,\n \"name\" => \"橙光·Ⅱ\",\n \"description\" => \"击倒目标后,有10%几率回复自身5%的最大生命值\"\n ],\n [\n \"level\" => 4,\n \"type\" => \"super\",\n \"open_level\" => 80,\n \"name\" => \"橙光·Ⅲ\",\n \"description\" => \"每回合结束时,有13%几率清除自身的减速类状态\"\n ],\n [\n \"level\" => 5,\n \"type\" => \"super\",\n \"open_level\" => 90,\n \"name\" => \"星爆\",\n \"description\" => \"成功出手后(除防御、保护、逃跑外),自身进入3回合的潜行状态 \"\n ],\n [\n \"level\" => 6,\n \"type\" => \"super\",\n \"open_level\" => 100,\n \"name\" => \"紫电·Ⅰ\",\n \"description\" => \"单体封印法术的基础命中率提升3%\"\n ],\n [\n \"level\" => 6,\n \"type\" => \"super\",\n \"open_level\" => 100,\n \"name\" => \"紫电·Ⅱ\",\n \"description\" => \"当敌方没有任何单位被封印时,单体封印法术增加3%的封印基础命中率和最高命中率\"\n ],\n [\n \"level\" => 6,\n \"type\" => \"super\",\n \"open_level\" => 100,\n \"name\" => \"紫电·Ⅲ\",\n \"description\" => \"单体封印法术失败时,下次单体封印法术的基础命中率和最高命中率均提升3%(与行者·阴共存时,该效果减半)\"\n ],\n [\n \"level\" => 7,\n \"type\" => \"super\",\n \"open_level\" => 120,\n \"name\" => \"赤霄·Ⅰ\",\n \"description\" => \"每场战斗前3次施放特技的愤怒值消耗减少6%,与愤怒腰带共存时,效果减半\"\n ],\n [\n \"level\" => 7,\n \"type\" => \"super\",\n \"open_level\" => 120,\n \"name\" => \"赤霄·Ⅱ\",\n \"description\" => \"攻击气血低于上限20%的目标时,10%几率使本次伤害增加攻击目标2%最大生命的伤害值\"\n ],\n [\n \"level\" => 7,\n \"type\" => \"super\",\n \"open_level\" => 120,\n \"name\" => \"赤霄·Ⅲ\",\n \"description\" => \"瞒天过海封印失败时,自身的瞒天过海状态有20%几率增加1回合\"\n ]\n ];\n\n $items = collect($items)->map(function ($item) use ($map, $npc) {\n return array_merge($item, [\n \"map_id\" => $map[\"id\"],\n \"npc_id\" => $npc[\"id\"],\n \"created_at\" => Carbon::now(),\n \"updated_at\" => Carbon::now(),\n ]);\n })\n ->toArray();\n\n Skill::insert($items);\n }" ]
[ "0.5774133", "0.5486554", "0.5412624", "0.5289124", "0.52768457", "0.51136494", "0.4959079", "0.4921841", "0.48808077", "0.48676798", "0.485417", "0.48392138", "0.48190516", "0.48134214", "0.48023784", "0.4787263", "0.4783449", "0.47658864", "0.4732356", "0.4703778", "0.4668897", "0.4628358", "0.46278742", "0.46224308", "0.45893824", "0.4569319", "0.45668998", "0.4562089", "0.45485374", "0.45467702" ]
0.6583358
0
Convenience function to get npcs by difficulty
public static function allSortedByDifficulty(){ return NpcFactory::npcs($sort='difficulty'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function npcs($sort=null){\n\t\t$npcs_data = NpcFactory::npcsData();\n\t\t$npcs = [];\n\t\tforeach($npcs_data as $identity=>$npc_data){\n\t\t\tassert((bool)$identity);\n\t\t\t$npcs[$identity] = new Npc($npc_data);\n\t\t}\n\t\tif($sort){\n\t\t\t$npc = reset($npcs);\n\t\t\tif(is_callable([$npc, $sort])){\n\t\t\t\t// Sort the npcs by difficulty\n\t\t\t\tusort($npcs, function ($a, $b) use ($sort) {\n\t\t\t\t\t$anum = $a->$sort();\n\t\t\t\t\t$bnum = $b->$sort();\n\t\t\t\t\tif($anum == $bnum){ \n\t\t\t\t\t\treturn 0 ; \n\t\t\t\t\t}\n\t\t\t\t\treturn ($anum < $bnum) ? -1 : 1;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn $npcs;\n\t}", "function get_npc($id_section)\n\t{\n\t\t$sql = 'SELECT npc.id_npc, name, description \n\t\t\t\t FROM npc \n\t\t\t\t LEFT JOIN language_npc ON npc.id_npc = language_npc.id_npc \n\t\t\t\t WHERE location = ' . $id_section . ' AND id_language = 1';\n\t\t\t\t \n\t\t$query = $this->db->query($sql);\n\t\t\n\t\treturn $query->result_array();\n\t}", "public function quests()\n\t{\n\t\treturn $this->has_many_and_belongs_to('Quest', 'npc_quests', 'npc_id');\n\t}", "public function getKillmonsterList(){\n return $this->_get(3);\n }", "private function randomQuest(): array\n {\n return array_random($this->possibleQuests);\n }", "public function getQuestsList(){\n return $this->_get(11);\n }", "public static function npcsData(){\n\t\t// Npc matrix planning document: https://docs.google.com/spreadsheet/ccc?key=0AkoUgtBBP00HdGZ1eUhaekhTb1dnZVh3ZlpoRExWdGc#gid=0\n\t\t$npcs = [\n\t 'firefly'=>['name'=>'Firefly', 'strength'=>0, 'stamina'=>0, 'damage'=>0, 'race'=>'insect', 'gold'=>0], // Baseline weakest mob\n\t\t\t'fireflies'=>['name'=>'Fireflies', 'strength'=>0, 'stamina'=>1, 'damage'=>0, 'race'=>'insect'],\n\t\t\t'spider'=>['name'=>'Spider', 'img'=>'spider_icon.png', 'strength'=>1, 'stamina'=>1, 'speed'=>1, 'damage'=>10, 'gold'=>10, 'race'=>'insect', 'ki'=>1], \n\t\t\t'pig'=>['name'=>'Wild pig', 'short'=>'is bristling with tusks and wiry hair', 'stamina'=>3, 'strength'=>4, 'speed'=>10, 'damage'=>2, 'race'=>'animal'],\n\t\t\t'viper'=>['name'=>'Black Viper', 'race'=>'animal', 'strength'=>1, 'stamina'=>1, 'speed'=>1, 'ki'=>1, 'damage'=>99, 'status'=>POISON, 'gold'=>30, 'traits'=>'poisonous'],\n\t\t\t'kappa'=>['name'=>'Kappa', 'strength'=>30, 'speed'=>10, 'stamina'=>80, 'short'=>'is a reptilian creature with a scooped-out head', 'race'=>'kappa', 'img'=>'kappa.jpg', 'inventory'=>['shell'=>'.5'], 'traits'=>'armored'],\n\t\t\t'nureonna'=>['name'=>'Nureonna', 'strength'=>30, 'speed'=>50, 'stamina'=>40, 'img'=>'nureonna', 'race'=>'yokai', 'img'=>'nureonna.jpg', 'status'=>POISON, 'inventory'=>['charcoal'=>1], 'traits'=>'poisonous'],\n\t 'tengu'=>['name'=>'Tengu', 'short'=>'is a large winged demon', 'strength'=>70, 'speed'=>20, 'stamina'=>100, 'race'=>'tengu', 'inventory'=>['tetsubo'=>'.05']],\n\t\t\t'ushioni'=>['name'=>'Ushi-Oni', 'strength'=>90, 'stamina'=>130, 'speed'=>50, 'race'=>'ushioni', 'img'=>'ushioni2.jpg'],\n\t\t\t'ryu'=>['name'=>'Ryu', 'strength'=>150, 'stamina'=>200, 'speed'=>190, 'short'=>'is a serpent-dragon, with the gleam of intelligence in it\\'s eyes and the glint of death on it\\'s claws', 'img'=>'hokusai-dragon.jpg', 'race'=>'ryu', 'traits'=>'armored'],\n\t\t];\n\t\tif(defined('DEBUG') && DEBUG){\n\t\t\t$npcs += [\n\t\t\t\t'peasant2'=>['name'=>'Peasant', 'race'=>'human', 'img'=>'fighter.png', 'strength'=>5, 'stamina'=>5, 'speed'=>5, 'ki'=>1, 'damage'=>1, 'gold'=>20, 'bounty'=>1, 'traits'=>'villager,sometimes_disguised_ninja', 'inventory'=>['kunai'=>'.01', 'shuriken'=>'.01']],\n\t\t\t\t'merchant2'=>['name'=>'Merchant', 'race'=>'human', 'strength'=>10, 'stamina'=>20, 'speed'=>10, 'ki'=>1, \n\t\t\t\t\t\t'damage'=>15, 'gold'=>50, 'bounty'=>5, 'img'=>'merchant.png', 'inventory'=>['phosphor'=>'.3'], 'traits'=>'villager'],\n\t\t\t\t'guard2'=>['name'=>'Guard', 'short'=>'is a member of the ashigaru foot soldiers, hired for various tasks', 'race'=>'human', 'strength'=>'30', 'stamina'=>30, 'speed'=>12, 'ki'=>1, \n\t \t'damage'=>0, 'gold'=>50, 'bounty'=>10, 'img'=>'guard.png', 'inventory'=>['ginsengroot'=>'.2'], 'traits'=>'partial_match_strength'],\n\t\t\t\t'monk'=>['name'=>'Monk', 'strength'=>10, 'stamina'=>10, 'speed'=>10, 'ki'=>30, 'race'=>'human', 'inventory'=>['prayerwheel'=>'.2'], 'traits'=>'deflection,defensive,self_heal'],\n\t 'geisha'=>['name'=>'Geisha', 'strength'=>5, 'stamina'=>10, 'speed'=>15, 'ki'=>10, 'gold'=>20, 'bounty'=>30, 'race'=>'human', 'inventory'=>['sake'=>'.2', 'mirror'=>'.01', 'kimono'=>'.01', 'tessen'=>'.01'], 'traits'=>'packdynamic,guarded,villager'],\n\t\t 'koi'=>['name'=>'Koi', 'short'=>'swims through the water', 'img'=>'koi.jpg', 'strength'=>0, 'speed'=>5, 'stamina'=>2, 'damage'=>1, 'race'=>'fish', 'inventory'=>['sushi'=>'.5']],\n\t\t\t\t'chicken'=>['name'=>'Chicken', 'short'=>'saunters around like it owns the place', 'strength'=>1, 'speed'=>5, 'damage'=>0, 'race'=>'bird'],\n\t\t\t\t'bees'=>['name'=>'Swarm of Bees', 'short'=>'swarms and buzzes through the air', 'strength'=>13, 'speed'=>30, 'damage'=>6, 'gold'=>0, 'race'=>'insect'],\n\t\t\t\t'goat'=>['name'=>'Goat', 'short'=>'chews on anything it can get to', 'strength'=>10, 'speed'=>25, 'damage'=>3, 'race'=>'animal'],\n\t 'crow'=>['name'=>'Crow', 'short'=>'caws out it\\'s distain', 'strength'=>3, 'speed'=>25, 'damage'=>3, 'race'=>'bird'],\n\t 'kingfisher'=>['name'=>'Kingfisher', 'short'=>'flashes by on it\\'s wings', 'strength'=>3, 'speed'=>30, 'damage'=>3, 'race'=>'bird'],\n\t\t\t\t'horse'=>['name'=>'Horse', 'short'=>'', 'strength'=>10, 'speed'=>40, 'stamina'=>30, 'damage'=>10, 'race'=>'animal'],\n\t\t\t\t'ox'=>['name'=>'Ox', 'short'=>'', 'strength'=>50, 'speed'=>20, 'stamina'=>40, 'damage'=>20, 'race'=>'animal'],\n\t\t\t\t'dog'=>['name'=>'Dog', 'short'=>'barks wildly', 'strength'=>20, 'speed'=>20, 'stamina'=>10, 'damage'=>10, 'race'=>'animal'],\n\t\t\t\t'tiger'=>['name'=>'Tiger', 'short'=>'circles in for the kill', 'strength'=>60, 'speed'=>60, 'stamina'=>60, 'damage'=>60, 'race'=>'animal'],\n\t\t\t\t'basan'=>['name'=>'Basan', 'img'=>'basan.jpg', 'strength'=>1, 'stamina'=>1, 'speed'=>1], // Uses default race of: creature.\n\t\t\t\t'kamaitachi'=>['name'=>'Kama-itachi', 'img'=>'kamaitachi.jpg', 'race'=>'yokai'],\n\t\t\t\t'nuribotoke'=>['name'=>'Nuri-Botoke', 'img'=>'nuribotoke.jpg', 'race'=>'yokai'],\n\t\t\t\t'hitodama'=>['name'=>'Hitodama', 'short'=>'are spirit orbs of fire', 'img'=>'hitodama.gif', 'race'=>'kami', 'traits'=>'whispy'],\n\t\t\t\t'karakasaobake'=>['name'=>'Karakasa-obake', 'short'=>'a one-legged umbrella spirit', 'race'=>'kami'],\n\t\t\t\t'kodama'=>['name'=>'Ko-dama', 'short'=>'is a tree spirit', 'race'=>'kami'],\n\t\t\t\t'umibozu'=>['name'=>'Umi-Bozu', 'short'=>'are bulbous floating jellyfish', 'img'=>'umibozu.jpg', 'traits'=>'whispy'],\n\t\t\t\t'shojo'=>['name'=>'Shojo', 'short'=>'is a monkey man', 'race'=>'yokai'],\n\t\t\t\t'kamanari'=>['name'=>'Kamanari', 'short'=>'is a gateway spirit that inhabits an iron pot', 'race'=>'kami'],\n\t\t\t\t'furaribi'=>['name'=>'Furaribi', 'short'=>'is a flame spirit', 'race'=>'kami', 'img'=>'furaribi.jpg', 'traits'=>'whispy'],\n\t\t\t\t'jorogumo'=>['name'=>'Jorogumo', 'short'=>'spider woman', 'race'=>'yokai', 'img'=>'jorogumo.jpg'],\n\t\t\t\t'tesso'=>['name'=>'Tesso', 'short'=>'rat man', 'race'=>'yokai', 'img'=>'tesso.jpg'],\n\t\t\t\t'shoukera'=>['name'=>'Shoukera', 'short'=>'is a muscled demon that lies wait in the shadows', 'race'=>'yokai', 'img'=>'shoukera.jpg'],\n\t\t\t\t'waira'=>['name'=>'Waira', 'short'=>'is a clawed beast', 'race'=>'yokai', 'img'=>'waira.jpg'],\n\t\t\t\t'tsurebeotoshi'=>['name'=>'Tsurube-otoshi', 'short'=>'is a fire elemental', 'race'=>'kami', 'img'=>'tsurubeotoshi.jpg', 'traits'=>'whispy'],\n\t\t\t\t'kasha'=>['name'=>'Kasha', 'img'=>'kasha.jpg', 'race'=>'yokai'],\n\t\t\t\t'yanari'=>['name'=>'Yanari', 'short'=>'a group of small demons', 'img'=>'yanari.jpg', 'race'=>'yokai'],\n\t\t\t\t'aobouzu'=>['name'=>'Ao-bouzu', 'short'=>'is a one eyed monk', 'img'=>'aobouzu.jpg', 'race'=>'yokai'],\n\t\t\t\t'akashita'=>['name'=>'Akashita', 'short'=>'is a storm demon', 'img'=>'akashita.jpg', 'race'=>'kami'],\n\t\t\t\t'kamakiri'=>['name'=>'Kama-Kiri', 'short'=>'is a hair eating beast', 'img'=>'kamakiri.jpg', 'race'=>'yokai'],\n\t\t\t\t'hakutaku'=>['name'=>'Hakutaku', 'short'=>'is a winged lion demon', 'img'=>'hakutaku.jpg', 'race'=>'yokai'],\n\t\t\t\t'hainu'=>['name'=>'Hainu', 'short'=>'is a winged wolf', 'race'=>'yokai'],\n\t\t\t\t'oni'=>['name'=>'Oni', 'strength'=>25, 'stamina'=>5, 'speed'=>15, 'ki'=>10, 'short'=>'a horned demon', 'img'=>'hokusai-oni.jpg', 'race'=>'oni', 'traits'=>'demonic,stealthy,slowing,energy_vampire'],\n\t\t\t];\n\t\t}\n\t\treturn $npcs;\n\t}", "function game_fetch_visible_quest_groups($game_user) {\n $data = $data2 = [];\n $sql = 'SELECT qg.*, q.required_level FROM `quest_groups` qg\n left join quests q on q.group = qg.id\n where q.required_level <= %d\n group by qg.id';\n $result = db_query($sql, $game_user->level);\n while ($item = db_fetch_object($result)) {\n $data[] = $item;\n }\n\n foreach ($data as $item) {\n // FIXME: create hook to allow altering data.\n if ($item->highlight_in_hood == $game_user->fkey_neighborhoods_id) {\n $data2[] = $item;\n }\n }\n\n return $data2;\n}", "function getHeroes() {\n\t\t$stmt = $this->con->prepare( \"SELECT columna1g, columna2u, columna3s, columna4t, columna5a, columna6v, columna7o, id FROM najera\" );\n\t\t$stmt->execute();\n\t\t$stmt->bind_result( $col1, $col2, $col3, $col4, $col5, $col6, $col7, $id );\n\t\t$heroes = array();\n\t\twhile ( $stmt->fetch() ) {\n\t\t\t$hero = array();\n\t\t\t$hero[ 'columna1g' ] = $col1;\n\t\t\t$hero[ 'columna2u' ] = $col2;\n\t\t\t$hero[ 'columna3s' ] = $col3;\n\t\t\t$hero[ 'columna4t' ] = $col4;\n\t\t\t$hero[ 'columna5a' ] = $col5;\n\t\t\t$hero[ 'columna6v' ] = $col6;\n\t\t\t$hero[ 'columna7o' ] = $col7;\n\t\t\t$hero[ 'id' ] = $id;\n\t\t\tarray_push( $heroes, $hero );\n\t\t}\n\t\treturn $heroes;\n\t}", "function get_monster($id_section)\n\t{\n\t\t$sql = 'SELECT monster.id_monster, name, description \n\t\t\t\t FROM monster\n\t\t\t\t LEFT JOIN atlas_section_monster ON monster.id_monster = atlas_section_monster.id_monster\n\t\t\t\t LEFT JOIN language_monster ON monster.id_monster = language_monster.id_monster \n\t\t\t\t WHERE id_section = ' . $id_section . ' AND id_language = 1';\n\t\t\t \n\t\t$query = $this->db->query($sql);\n\t\t\n\t\treturn $query->result_array();\n\t}", "function mag_summon ($spell, $login)\r\n {\r\n //$spell = preg_replace ('/[^a-z0-9_]/i', '', $spell);\r\n //$login = preg_replace ('/[^a-z0-9_]/i', '', $login);\r\n $id = is_player ($login);\r\n\r\n $q = do_mysql (\"SELECT cname FROM magic WHERE fullname = '\".$spell.\"';\");\r\n if (!mysql_num_rows ($q)) return 0;\r\n $fullname = mysql_result ($q, 0);\r\n if (!$fullname) return 0;\r\n\r\n // zapros na lokaciju igroka i kolichestvo priruchennyh zhivotnyh\r\n $q = do_mysql (\"SELECT location FROM players WHERE id_player = '\".$id.\"';\");\r\n if (!mysql_num_rows ($q)) return 0;\r\n $loc = mysql_result ($q, 0);\r\n\r\n $q = do_mysql (\"SELECT COUNT(*) FROM npc WHERE belongs = '\".$login.\"';\");\r\n $c = mysql_result ($q, 0);\r\n if ($c > 0) put_g_error ('у вас уже есть нпц, принадлежащие вам');\r\n\r\n // sozdaem npc:\r\n include_once ('modules/f_create_npc.php');\r\n $npc = create_npc ($fullname, (substr($loc, 0, 4)), $loc);\r\n $nid = is_npc ($npc);\r\n\r\n // izmenim imja:\r\n $q = do_mysql (\"SELECT name FROM npc WHERE id_npc = '\".$nid.\"';\");\r\n $name = mysql_result ($q, 0);\r\n $nname = 'призванный '.$name;\r\n $fullname = $npc.'.'.$login;\r\n\r\n // ataka:\r\n $q = do_mysql (\"SELECT in_battle FROM players WHERE id_player = '\".$id.\"';\");\r\n $inb = mysql_result ($q, 0);\r\n\r\n do_mysql (\"UPDATE npc SET fullname = '\".$fullname.\"', name = '\".$nname.\"', belongs = '\".$login.\"', move = '30', in_battle = '\".$inb.\"', type = 'a' WHERE id_npc = '\".$nid.\"';\");\r\n\r\n $q = do_mysql (\"SELECT name FROM players WHERE id_player = '\".$id.\"';\");\r\n $pn = mysql_result ($q, 0);\r\n add_journal ($pn.': призвал '.$name.'!', 'l.'.$loc);\r\n\r\n return 1;\r\n }", "public function getGameInfo($gameId): GameObject;", "public function getdifficulty() {\n\n $args = $this->args;\n $args[ \"method\" ] = __FUNCTION__;\n\n $res = $this->call($args);\n if ($res)\n return $res[ \"result\" ];\n }", "function game_fetch_visible_equip($game_user) {\n if ($game_user->meta == 'admin') {\n $sql_to_add = 'WHERE equipment.id > 0';\n }\n else {\n $sql_to_add = 'WHERE (((\n fkey_neighborhoods_id = 0\n OR fkey_neighborhoods_id = %d\n )\n \n AND\n \n (\n fkey_values_id = 0\n OR fkey_values_id = %d\n ))\n \n AND required_level <= %d\n AND active = 1\n AND is_loot = 0\n )\n \n OR equipment_ownership.quantity > 0 ';\n }\n\n $data = [];\n $sql = 'SELECT equipment.*, equipment_ownership.quantity\n FROM equipment\n\n LEFT OUTER JOIN equipment_ownership ON equipment_ownership.fkey_equipment_id = equipment.id\n AND equipment_ownership.fkey_users_id = %d\n\n ' . $sql_to_add . '\n ORDER BY required_level ASC';\n $result = db_query($sql, $game_user->id, $game_user->fkey_neighborhoods_id,\n $game_user->fkey_values_id, $game_user->level);\n\n while ($item = db_fetch_object($result)) {\n $data[] = $item;\n }\n return $data;\n}", "function get_difficulty_for_question($qid, $eid){\n\t$data = array();\n\t$result = mysql_query(\" select `difficulty_level` from `mock_exam_student_result` where `exam_id` = '$eid' and `question_id` = '$qid';\");\n\twhile ($row = mysql_fetch_assoc($result)) {\n\t $data [] = $row;\n\t}\n\treturn $data;\n}", "public function get_myhealth_detail($oid)\n {\n return $this->db->get_where(\"pethealth_order\", array('sorder_id'=> $oid));\n }", "function get_difficulty($ssid, $uid, $eid, $qid){\n\t$data = array();\n\t$result = mysql_query(\"SELECT `difficulty_level` FROM `mock_exam_student_result` WHERE `user_id` = '$uid' AND `exam_id` = '$eid' AND `question_id` = '$qid' AND `student_summary_id` = '$ssid'\");\n\twhile ($row = mysql_fetch_assoc($result)) {\n\t $data [] = $row;\n\t}\n\treturn $data[0];\n}", "public function getbydifficulty($diff=1){\n\t\t\n\t\t$result = $this->Questions->findAllByDifficulty($diff)\n ->order('rand()')\n ->first(); \n\n $this->set('question', $result);\n $this->render('debugquestion');\n }", "public function getTrophies($type) {\r\n\t\t$trophies = array();\r\n\t\t$response = $this->request(\"trophies/\", \"achieved=\" . strtolower($type));\r\n\t\t\r\n\t\t$lines = explode(\"\\n\", $response);\r\n\t\t$t = new Trophy();\r\n\t\tfor ($i = 1; $i < count($lines); $i++) {\r\n\t\t\t$key = substr($lines[$i], 0, strpos($lines[$i], \":\")); // from start until colon.\r\n\t\t\t$value = substr($lines[$i], strpos($lines[$i], \":\")+2, strrpos($lines[$i], '\"')); // after colon and inverted comma until last inverted comma\r\n\t\t\tif ($key == \"id\") {\r\n\t\t\t\t$t = new Trophy();\r\n\t\t\t}\r\n\t\t\t$t->addProperty($key, $value);\r\n\t\t\tif ($key == \"achieved\") {\r\n\t\t\t\t$trophies[] = $t;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $trophies;\r\n\t}", "function statGame($ht, $at, $md) {\n $exp = \"fixtures[?homeTeamName == `$ht` && awayTeamName == `$at` && matchday == `$md` ].status | []\";\n $res = JmesPath\\search($exp, $GLOBALS['fixtures']);\n\n return $res[0];\n }", "public function getQuest(): Quest\n {\n return $this->quest;\n }", "public function getPlayerShips(Game $game, Player $player): array\n {\n return $this->findBy(['game' => $game, 'player' => $player]); \n }", "public static function allTrivialNpcs(){\n\t\t$npcs = NpcFactory::allSortedByDifficulty();\n\t\t$trivials = array_filter($npcs, function($npc){\n\t\t\t\treturn (bool) ($npc->difficulty() < 1);\n\t\t\t});\n\t\treturn $trivials;\n\t}", "function getTiesList($roundId, $tieId, $type)\r\n\t{\r\n\t\t$ut = new utils();\r\n\t\t// Compter le nombre de match a valider par rencontre\r\n\t\t$fields = array('tie_id', \"count('mtch_id') as nb\");\r\n\t\t$tables = array('ties', 'matchs');\r\n\t\t$where = \"tie_roundId = $roundId\".\r\n\t\" AND tie_id = mtch_tieId\".\r\n\t\" AND tie_id != $tieId\";\r\n\t\tif ($type == 0)\r\n\t\t$where .=\" AND mtch_status =\".WBS_MATCH_ENDED;\r\n\t\tif ($type == 1)\r\n\t\t$where .=\" AND mtch_status <\".WBS_MATCH_ENDED;\r\n\t\t$where .=\t\" GROUP BY tie_id\";\r\n\t\t$res = $this->_select($tables, $fields, $where);\r\n\r\n\t\t// Trouver les equipes de chaque rencontre\r\n\t\t$ties = array();\r\n\t\twhile ($tie = $res->fetchRow(DB_FETCHMODE_ASSOC))\r\n\t\t{\r\n\t if (!$tie['nb'] && $type!=2) continue;\r\n\t if ($tie['nb'] && $type==2) continue;\r\n\t $fields = array('team_name', 'team_stamp');\r\n\t $tables = array('teams', 't2t');\r\n\t $where = \"t2t_tieId = {$tie['tie_id']}\".\r\n\t \" AND t2t_teamId = team_id\";\r\n\t $order = 't2t_posTie';\r\n\t $res2 = $this->_select($tables, $fields, $where, $order);\r\n\t $name = '';\r\n\t while ($team = $res2->fetchRow(DB_FETCHMODE_ASSOC))\r\n\t $name .= \"{$team['team_name']} ({$team['team_stamp']}) -- \";\r\n\t $ties[$tie['tie_id']] = $name;\r\n\t\t}\r\n\t\t//print_r($ties);\r\n\t\treturn $ties;\r\n\t}", "public function findBy($champ,$data='') {\n\t\t// creation d'un objet de base de la classe\n\t\t$object = new Montest();\n\t\t$resultat = array();\n\t\tfor ($i = 0; $i < sizeof($this -> _aListeMontest); $i++) {\n\t\t\t$object = $this -> _aListeMontest[$i];\n\t\t\tif ($object -> {'_'.strtolower($champ)} == $data) {\n\t\t\t\t$resultat[] = $object;\n\t\t\t}\n\t\t}\n\t\tif (sizeof($resultat) > 0) {\n\t\t\t//existe\n\t\t\treturn $resultat;\n\t\t} else {\n\t\t\t//n'existe pas\n\t\t\treturn \"Pas de Montest de \".strtolower($champ).\" '\".$data.\"'\";\n\t\t}\n\t}", "public function get_game($pid = \"a\") {\n if( $pid === \"a\" )\n $pid = $this->pid;\n if( $this->pid === Null && $this->set_pid($pid) === Null)\n return array();\n return $game_data = $this->database->find($_GET['pid'], 'pid');\n }", "function global_minuit()\n{ \n try\n {\n $parties = get_all_id_games();\n \n $resultats = array();\n foreach ($parties as $value) \n {\n \n // Teams has 100 battle score at the begining.\n $score_equipe_1 = 100;\n $score_equipe_2 = 100;\n \n // get id of the game.\n $id_partie = $value->id_partie;\n \n // Get number of players in town for each team.\n $joueurs_equipe_1 = get_players_in_city($id_partie, 1);\n $joueurs_equipe_2 = get_players_in_city($id_partie, 2);\n \n // Get content of chest.\n $coffre_equipe1 = loot_get_coffre_ville_return(1, $id_partie);\n $coffre_equipe2 = loot_get_coffre_ville_return(2, $id_partie);\n \n // récupérer le level de l'armurerie\n $level_armurerie_equipe1 = get_level_buildings($id_partie, 1, 1);\n $level_armurerie_equipe2 = get_level_buildings($id_partie, 2, 1);\n \n // calcul of rapidity score.\n $scores_rapidity = give_bonus_rapidity_score($id_partie, $coffre_equipe1, $coffre_equipe2);\n \n // calcul of battle score.\n $score_equipe_1 += get_combat_score($id_partie, 1, $joueurs_equipe_1, $coffre_equipe1, $level_armurerie_equipe1);\n $score_equipe_2 += get_combat_score($id_partie, 2, $joueurs_equipe_2, $coffre_equipe2, $level_armurerie_equipe2);\n \n // calcul of victory points.\n $victory_points = get_victory_points($scores_rapidity, $score_equipe_1, $score_equipe_2);\n \n \n // Save result in data base.\n $resultat = enregistrement_bataille($id_partie, $joueurs_equipe_1, $joueurs_equipe_2, $scores_rapidity, $level_armurerie_equipe1, $level_armurerie_equipe2, $score_equipe_1, $score_equipe_2, $victory_points); \n\n \n //Add \"resultat\" to \"resultats\".\n array_push($resultats, $resultat);\n \n }\n return $resultats;\n }\n catch (Exception $e)\n {\n error_log($e->getMessage());\n }\n}", "function getRandomPokemon() {\n $randomPokemonId = Pokemon::with(['evolvesFrom', 'evolvesTo'])->inRandomOrder()->first()->pokemon_id;\n\n return $this->getPokemon($randomPokemonId);\n }", "public function fakeNpcData($npcFields = [])\n {\n $fake = Faker::create();\n\n return array_merge([\n 'name' => $fake->word,\n 'private_name' => $fake->word,\n 'image' => $fake->word,\n 'vocation_id' => $fake->randomDigitNotNull,\n 'metatype_id' => $fake->randomDigitNotNull,\n 'background_public' => $fake->text,\n 'background_private' => $fake->text,\n 'territory_id' => $fake->randomDigitNotNull,\n 'gold' => $fake->randomDigitNotNull,\n 'iron' => $fake->randomDigitNotNull,\n 'timber' => $fake->randomDigitNotNull,\n 'stone' => $fake->randomDigitNotNull,\n 'grain' => $fake->randomDigitNotNull,\n 'action_id' => $fake->randomDigitNotNull,\n 'deceased' => $fake->date('Y-m-d H:i:s'),\n 'created_at' => $fake->date('Y-m-d H:i:s'),\n 'updated_at' => $fake->date('Y-m-d H:i:s'),\n 'deleted_at' => $fake->date('Y-m-d H:i:s')\n ], $npcFields);\n }", "public function getPokemon()\n {\n return Pokemon::get(['dex_id', 'name', 'tier', 'min_cp', 'max_cp', 'boosted_min_cp', 'boosted_max_cp']);\n }" ]
[ "0.6416331", "0.64113677", "0.532903", "0.52113736", "0.51258624", "0.5079208", "0.49557474", "0.49302197", "0.48707083", "0.48145807", "0.4784234", "0.47787377", "0.4756847", "0.47478402", "0.4721716", "0.46715277", "0.4654186", "0.46074787", "0.4588857", "0.45742947", "0.45562923", "0.45519015", "0.4527972", "0.45251206", "0.45045307", "0.4495701", "0.44783768", "0.44678128", "0.4467786", "0.4456013" ]
0.6448673
0
Get npcs excluding zerodifficulty npcs
public static function allNonTrivialNpcs(){ $npcs = NpcFactory::allSortedByDifficulty(); $nontrivials = array_filter($npcs, function($npc){ return (bool) ($npc->difficulty() > 0); }); return $nontrivials; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function allSortedByDifficulty(){\n\t\treturn NpcFactory::npcs($sort='difficulty');\n\t}", "public static function allTrivialNpcs(){\n\t\t$npcs = NpcFactory::allSortedByDifficulty();\n\t\t$trivials = array_filter($npcs, function($npc){\n\t\t\t\treturn (bool) ($npc->difficulty() < 1);\n\t\t\t});\n\t\treturn $trivials;\n\t}", "public function getExcludes();", "private function getNeiNoti() {\n\t\t$sql = 'SELECT u.uid, u.firstname, u.lastname, u.photo FROM neighbor n, user u, join_block jb1, join_block jb2 WHERE n.uid = jb1.uid AND n.neighbor_uid = jb2.uid AND jb1.is_approved = 1 AND jb2.is_approved = 1 AND jb1.bid = jb2.bid AND n.uid = u.uid AND n.neighbor_uid = ' . $this->uid . ' AND n.uid NOT IN (SELECT neighbor_uid AS uid FROM neighbor WHERE uid = ' . $this->uid . ');';\n\n\t\t$query = mysqli_query($this->conn, $sql);\n\t\t$data = mysqli_fetch_all($query, MYSQLI_ASSOC);\n\n\t\treturn $data;\n\t}", "public static function npcs($sort=null){\n\t\t$npcs_data = NpcFactory::npcsData();\n\t\t$npcs = [];\n\t\tforeach($npcs_data as $identity=>$npc_data){\n\t\t\tassert((bool)$identity);\n\t\t\t$npcs[$identity] = new Npc($npc_data);\n\t\t}\n\t\tif($sort){\n\t\t\t$npc = reset($npcs);\n\t\t\tif(is_callable([$npc, $sort])){\n\t\t\t\t// Sort the npcs by difficulty\n\t\t\t\tusort($npcs, function ($a, $b) use ($sort) {\n\t\t\t\t\t$anum = $a->$sort();\n\t\t\t\t\t$bnum = $b->$sort();\n\t\t\t\t\tif($anum == $bnum){ \n\t\t\t\t\t\treturn 0 ; \n\t\t\t\t\t}\n\t\t\t\t\treturn ($anum < $bnum) ? -1 : 1;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn $npcs;\n\t}", "public function getKillmonsterList(){\n return $this->_get(3);\n }", "public function all_non_employee()\n {\n $n_menu = 'non kci';\n $type_people = 'non employee';\n // call function\n $this->get_json($type_people, $n_menu);\n }", "public function get_all_exclude_id(){\n $data = get_object_vars($this);\n unset($data[\"id\"]);\n return $data;\n }", "private function getExcludedPages()\n {\n $page404 = $this->wire('pages')->get($this->wire('config')->http404PageID);\n\n $excluded = (new PageArray())\n ->add($page404);\n\n // Allow to exclude additional pages by hooking SeoMaestro::sitemapAlwaysExclude().\n return $this->wire('modules')->get('SeoMaestro')\n ->sitemapAlwaysExclude($excluded);\n }", "public function allnotdeleted()\n {\n return SgpRegion::find()->where([\"=\", \"is_deleted\",0])->all();\n \n }", "public static function getNoZoneObjectObjects() \n\t{\n\t\t$collection = new \\Illuminate\\Database\\Eloquent\\Collection;\n foreach (Object::all() as $object) {\n \tif(!isset($object->zoneobject->id) && !isset($object->zone->id))\n \t\t$collection->add($object);\n }\n \n return $collection;\n\t}", "public function getExclude(): array;", "function getUnknowns () {\r\n\t\t\treturn $this->_unknowns;\r\n\t\t}", "public static function getOnlineRestaurantsWithoutMenu() {\n $db = Zend_Registry::get('dbAdapter');\n\n $sql = \"SELECT r.id, r.name, r.street, r.hausnr, r.plz FROM restaurants r LEFT JOIN meal_categories mc ON mc.restaurantId=r.id WHERE r.isOnline AND r.deleted=0 AND mc.id IS NULL\";\n $result = $db->query($sql)->fetchAll();\n\n return $result;\n }", "private function getChildTrackersWithoutRemainingEffort() {\n return array_filter($this->getChildTrackers(),\n array($this, 'missesRemainingEffort'));\n }", "function findCocktailsWithout( $noparts ) {\n\t$result=array();\n\t$num=0;\n\t$allcock=getCocktails();\n\tforeach( $allcock as $cocktail ) {\n\t\t$parts=getCocktailParts( $cocktail['id'] );\n\t\t$in=0;\n\t\tforeach( $parts as $cpart ) {\n\t\t\tforeach( $noparts as $part ) {\n\t\t\t\tif( $cpart['part'] == $part ) $in=1;\n\t\t\t}\n\t\t}\n\t\tif( $in == 0 ) {\n\t\t\t$result[]=$cocktail;\n\t\t\t$num++;\n\t\t}\n\t}\n\treturn $result;\n}", "public function listExcludedIngredients() \n {\n return Response::json('OK', 200);\n }", "function elgg_get_ignore_access() {\n\treturn elgg_get_access_object()->getIgnoreAccess();\n}", "public function getExclusions();", "public function non_shippable_items()\n\t{\n\t\t$items = array();\n\t\t\n\t\tforeach ($this->items as $item)\n\t\t{\n\t\t\tif ( ! $item->is_shippable())\n\t\t\t{\n\t\t\t\t$items[$item->row_id()] = $item;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $items;\n\t}", "public function getUtentiWpNonAssegnati(){\n //ottengo l'array degli utenti già assegnati\n $wpAssegnati = $this->aDAO->getUtentiWpAssegnati();\n //ottengo tutti gli utenti\n $args = array('fields' => 'all', 'orderby' => 'display_name', 'order' => 'ASC'); \n $usersWp = get_users($args);\n \n $results = array(); \n \n for($i=0; $i < count($usersWp); $i++){ \n for($j=0; $j < count($wpAssegnati); $j++){\n if($usersWp[$i]->ID == $wpAssegnati[$j]){\n $usersWp[$i]->ID = false; \n }\n }\n }\n \n for($i=0; $i < count($usersWp); $i++){\n $temp = array();\n if($usersWp[$i]->ID != false){\n $results[$usersWp[$i]->ID] = $usersWp[$i]->user_firstname.' '.$usersWp[$i]->user_lastname; \n }\n }\n \n return $results;\n \n }", "public function get_non_dropped_participants($id){\n\n\t\t$event = Event::find($id);\n\t\tif($event->event_type === 'multifacility' || $event->event_type === 'ladder'){\n\t\t\treturn Event::with(array(\n\t\t\t\t'users' => function($query){\n\t\t\t\t\t$query->wherePivot('confirmed', '=', 1);\n\t\t\t\t}\n\t\t\t))->find($id);\n\t\t}\n\t\telse{\n\t\t\treturn Event::with(array(\n\t\t\t\t'users' => function($query){\n\t\t\t\t\t$query->wherePivot('rsvped', '!=', null)->wherePivot('unavailable','=',0);\n\t\t\t\t}\n\t\t\t))->find($id);\n\t\t}\n\n\t}", "function ihc_return_all_cpt( $excluded=array() ){\n\t$args = array('public' => true, '_builtin' => false);\n\t$data = get_post_types($args);\n\tif(count($excluded)>0){\n\t\tforeach($excluded as $e){\n\t\t\tif(in_array($e, $data)) $data = array_diff($data, array($e) );\n\t\t}\n\t}\n\treturn $data;\n}", "public static function getOnlineRestaurantsWithoutDeliverPlz() {\n $db = Zend_Registry::get('dbAdapter');\n\n $sql = \"SELECT r.id, r.name, r.street, r.hausnr, r.plz FROM restaurants r LEFT JOIN restaurant_plz rp ON rp.restaurantId=r.id WHERE r.isOnline AND r.deleted=0 AND rp.id IS NULL\";\n $result = $db->query($sql)->fetchAll();\n\n return $result;\n }", "public static function getZonesWithUnpublishedKeys(){\n return array_filter(self::$zones, function($z){\n // Known in ISP but no full data match in INWX\n // not relevant if there is a corrupt, orphan or no key at all\n // key must be republished anyway\n return DNS_KEY_KNOWN === ($z->zonestatus & DNS_KEY_KNOWN)\n && DNS_KEY_DATA_OK !== ($z->zonestatus & DNS_KEY_DATA_OK);\n });\n }", "public function dislikes()\n {\n return $this->has_many('Vote')\n ->where('like', '=', 0);\n }", "public function findExcludeByPlz($plz) {\n\n $sql = \"select * from restaurants r, restaurant_servicetype rs where r.id= rs.restaurantId and rs.servicetypeId = 1 and r.deleted = 0 and r.exclude = '1' and r.plz = '\" . $plz . \"'\";\n return $this->getAdapter()\n ->query($sql)\n ->fetchAll();\n }", "function get_npc($id_section)\n\t{\n\t\t$sql = 'SELECT npc.id_npc, name, description \n\t\t\t\t FROM npc \n\t\t\t\t LEFT JOIN language_npc ON npc.id_npc = language_npc.id_npc \n\t\t\t\t WHERE location = ' . $id_section . ' AND id_language = 1';\n\t\t\t\t \n\t\t$query = $this->db->query($sql);\n\t\t\n\t\treturn $query->result_array();\n\t}", "public function getExcludedSniffs()\n {\n return array();\n }", "public function getAllNotDeletedReminders(): array\n {\n $queryBuilder = $this->_em->createQueryBuilder();\n $queryBuilder->select(\"mschr\")\n ->from(MyScheduleReminder::class, \"mschr\")\n ->where(\"mschr.deleted = 0\");\n\n $results = $queryBuilder->getQuery()->execute();\n return $results;\n }" ]
[ "0.600866", "0.5853704", "0.5631153", "0.55769134", "0.5519689", "0.5513426", "0.5483218", "0.540759", "0.53891057", "0.5373189", "0.53727096", "0.533702", "0.53058803", "0.5296203", "0.52928144", "0.52854896", "0.5273186", "0.524089", "0.523476", "0.52296734", "0.5219021", "0.52082074", "0.51930743", "0.51863027", "0.51561236", "0.5153665", "0.5137466", "0.51037306", "0.50952756", "0.50798744" ]
0.6335106
0
Npcs that have essentially nothing interesting or useful defined about them yet.
public static function allTrivialNpcs(){ $npcs = NpcFactory::allSortedByDifficulty(); $trivials = array_filter($npcs, function($npc){ return (bool) ($npc->difficulty() < 1); }); return $trivials; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function allNonTrivialNpcs(){\n\t\t$npcs = NpcFactory::allSortedByDifficulty();\n\t\t$nontrivials = array_filter($npcs, function($npc){ \n\t\t\t\treturn (bool) ($npc->difficulty() > 0);\n\t\t\t});\n\t\treturn $nontrivials;\n\t}", "public function phpcs(SymfonyStyle $io){\n\n\t\t$io->newLine();\n\t\t$io->section(\"Check possible code styling errors\");\n\n\t\treturn $this->taskExec('./vendor/bin/phpcs')\n\t\t\t->option('extensions', 'php', '=')\n\t\t\t->option('standard', './rules/phpcs.xml', '=')\n\t\t\t->run();\n\t}", "function ignoreAll(){\n\t\t$this->loadDefinitions($this->classes);\n\t\t$this->installed = $this->versions;\n\t\t$this->saveInstalled();\n\t}", "protected function taskPhpcs() {\n return $this->task(PhpcsTask::class);\n }", "public function testProhibited() {\r\n\t\t$phpcheckstyle = $GLOBALS['PHPCheckstyle'];\r\n\r\n\t\t$phpcheckstyle->processFiles(array(\r\n\t\t\t'./test/sample/bad_prohibited.php'\r\n\t\t));\r\n\r\n\t\t$errorCounts = $phpcheckstyle->getErrorCounts();\r\n\r\n\t\t$this->assertEquals(0, $errorCounts['error'], 'We expect 0 errors of naming');\r\n\t\t$this->assertEquals(0, $errorCounts['ignore'], 'We expect 0 ignored checks');\r\n\t\t$this->assertEquals(0, $errorCounts['info'], 'We expect 0 info');\r\n\t\t$this->assertEquals(2, $errorCounts['warning'], 'We expect 2 warnings');\r\n\t}", "public function cleanExpiredNpcs()\n\t{\n\t\t$constants=Constants::model()->findbyPk(1);\n\t\tif($constants!==null){\t\t\t\t\t\n\t\t\t$criteria = new CDbCriteria;\n\t\t\t$criteria->condition = \"roundId = \".$constants->roundId.\" AND expire < UNIX_TIMESTAMP()\";\n\n\t\t\t// herrings\n\t\t\t$agents = NpcHerring::model()->findAll($criteria);\n\t\t\tforeach($agents as $agent)\n\t\t\t\t$agent->delete();\n\n\t\t\t// ambushes\n\t\t\t$agents = NpcAmbush::model()->findAll($criteria);\n\t\t\tforeach($agents as $agent)\n\t\t\t\t$agent->delete();\n\n\t\t\t// securities\n\t\t\t$agents = NpcSecurity::model()->findAll($criteria);\n\t\t\tforeach($agents as $agent)\n\t\t\t\t$agent->delete();\n\t\t}\n\t}", "public function getIncludedSniffs()\n {\n return array(\n 'PEAR',\n //'Squiz',\n );\n\n }", "public function initialize() : void\n {\n foreach(glob(\"{$this->cssDir}/*.css\") as $file) {\n $filename = basename($file);\n $url = \"{$this->cssUrl}/$filename\";\n $content = file_get_contents($file);\n $comment = strstr($content, \"*/\", true);\n $comment = preg_replace([\"#\\/\\*!#\", \"#\\*#\"], \"\", $comment);\n $comment = preg_replace(\"#@#\", \"<br>@\", $comment);\n $first = strpos($comment, \".\");\n $short = substr($comment, 0, $first + 1);\n $long = substr($comment, $first + 1);\n $this->styles[$url] = [\n \"shortDescription\" => $short,\n \"longDescription\" => $long,\n ];\n }\n\n foreach ($this->styles as $key => $value) {\n $isMinified = strstr($key, \".min.css\", true);\n if ($isMinified) {\n unset($this->styles[\"$isMinified.css\"]);\n }\n }\n }", "public function remove_unwanted_css(){\n }", "static function nix_styles() {\n\t\t\n\t\t// get all styles data\n\t\tglobal $wp_styles;\n\n\t\t// create an array of stylesheet \"handles\" to allow to remain\n\t\t$styles_to_keep = array( 'bpthm' );\n\t\t\n\t\t// loop over all of the registered scripts\n\t\tforeach ( $wp_styles->registered as $handle => $data ) {\n\t\t\t\n\t\t\t// if we want to keep it, skip it\n\t\t\tif ( in_array( $handle, $styles_to_keep ) ) continue;\n\t\t\t\n\t\t\t\t// otherwise remove it\n\t\t\t\twp_deregister_style( $handle );\n\t\t\t\twp_dequeue_style( $handle );\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function withPhpcsConfiguration()\n {\n return $this->phpcsConfiguration;\n }", "public function testCodingStandardOption()\n {\n $command = $this->getPhpCsExecutable() . ' --extensions=php,inc --standard=myStandard --report=checkstyle ' . getcwd();\n $this->assertEquals(\n $command,\n $this->taskPhpCs(null, 'myStandard')->getCommand()\n );\n }", "private function nerverUsed()\n {\n new Tag();\n new Service();\n }", "public function getWarnings();", "function warning_style() {\n\t?>\n\t\t<style type=\"text/css\">#wp-admin-bar-show-git-branch .ab-item { background: #c00; }</style>\n\t<?php\n\n}", "private function confirmConstants()\n\t{\n\t\tif(!defined('CLASSOVERRIDER_NS')) {\n\t\t\tthrow new \\UnexpectedValueException('Base namespace CLASSOVERRIDER_NS is not defined.');\n\t\t}\n\n\t\tif(!defined('CLASSOVERRIDER_BASE_NS')) {\n\t\t\tthrow new \\UnexpectedValueException('Base namespace CLASSOVERRIDER_BASE_NS is not defined.');\n\t\t}\n\n\t\tif(!defined('CLASSOVERRIDER_PATH')) {\n\t\t\tthrow new \\UnexpectedValueException('Overrides directory CLASSOVERRIDER_PATH is not defined.');\n\t\t}\n\n\t\tif(!is_dir(CLASSOVERRIDER_PATH)) {\n\t\t\tthrow new \\UnexpectedValueException('Overrides directory \\'' . CLASSOVERRIDER_PATH . '\\' does not exist.');\n\t\t}\n\t}", "public function composer_additional_styles() {}", "public function codingStandard(array $options = array()): array\n {\n if ($this->suppressCodingConvention) {\n return array();\n }\n\n $phpcs = $this->binFinder->getCS();\n $command = sprintf(\"%s -q --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 --report=json --standard=PSR2 %s 2>&1\", $phpcs, $this->file);\n\n exec($command, $output, $exitCode);\n\n if ($exitCode !== 0 ) {\n throw new \\Exception($output[0]);\n }\n\n $snifferOutput = json_decode($output[0], true);\n\n $violations = array();\n\n foreach ($snifferOutput['files'] as $file) {\n foreach ($file['messages'] as $message) {\n if (!$this->skipMessage($message, $options)) {\n $violations[] = array(\n 'message' => $message['message'],\n 'line' => $message['line'],\n 'column' => $message['column']\n );\n }\n }\n }\n\n return $violations; \n }", "function rocket_extract_excluded_css_files() {\n\t_deprecated_function( __FUNCTION__, '2.11' );\n\n\treturn false;\n}", "public function testGetReservedCoupons()\n {\n }", "public function testConstsHaveMessages()\n\t{\n\t\t$msg = EHttpStatus::$messages;\n\t\tforeach($this->getConsts() as $code)\n\t\t{\n\t\t\t$this->assertTrue(isset($msg[$code]));\n\t\t}\n\t}", "public function test_gc_register_style() {\n\t\t$this->assertTrue( gc_register_style( 'duplicate-handler', 'http://example.com' ) );\n\t\t$this->assertFalse( gc_register_style( 'duplicate-handler', 'http://example.com' ) );\n\t}", "function fakeClasses($fName)\n{\n // @codingStandardsIgnoreStart\n if($fName != 'cache.php' && ! class_exists('JCache'))\n {\n class JCache{}\n }\n\n if($fName != 'storage.php' && ! class_exists('JCacheStorage'))\n {\n class JCacheStorage{}\n }\n // @codingStandardsIgnoreEnd\n}", "function checkFile($_filename)\n\t{\n\t\tsystem(\"../vendor/bin/phpcs --standard=../ --report=full $_filename\");\n\t}", "public function initializeCssClassModifiers(): void\n {\n }", "public function getIncludedSniffs()\n {\n return array(\n 'Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php',\n 'Generic/Sniffs/Classes/DuplicateClassNameSniff.php',\n 'Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php', // no short PHP tags\n 'Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php', // only spaces for indents\n 'Squiz/Sniffs/Classes/ClassFileNameSniff.php',\n 'Squiz/Sniffs/Classes/ValidClassNameSniff.php',\n 'Zend/Sniffs/Files/ClosingTagSniff.php',// no ending PHP_EOF tags\n 'Zikula/Sniffs/ControlStructures/ControlSignatureSniff.php',\n 'Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php',\n 'Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php',\n 'Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php',\n );\n\n\n }", "public function nonsupport() {\n\t}", "protected static function getChecks() {\n return [\n // Code conflicts resulting from Git merge.\n '<<<<<<<',\n '>>>>>>>',\n ];\n }", "public function getExcludedSniffs()\n {\n return array(\n 'PEAR/Sniffs/Commenting/FileCommentSniff.php',\n 'PEAR/Sniffs/Commenting/ClassCommentSniff.php',\n 'PEAR/Sniffs/Classes/ClassDeclarationSniff.php',\n 'PEAR/Sniffs/Functions/FunctionDeclarationSniff.php',\n 'PEAR/Sniffs/Files/IncludingFileSniff.php',\n );\n }", "public function test_unnecessary_style_tags() {\n\n\t\t$expected = \"<link rel='stylesheet' id='handle-css' href='http://example.com?ver=1' type='text/css' media='all' />\\n\";\n\n\t\tgc_enqueue_style( 'handle', 'http://example.com', array(), 1 );\n\n\t\t$this->assertSame( $expected, get_echo( 'gc_print_styles' ) );\n\n\t}" ]
[ "0.59627473", "0.5676701", "0.5169249", "0.49130496", "0.48786962", "0.48610875", "0.4826293", "0.47941688", "0.47894728", "0.47836688", "0.47608072", "0.47386304", "0.47246915", "0.47142044", "0.47136185", "0.4696708", "0.46650058", "0.46607804", "0.46472633", "0.46358582", "0.4632886", "0.46245372", "0.45876095", "0.4571696", "0.45495045", "0.4538564", "0.45345542", "0.45214477", "0.450823", "0.4504832" ]
0.5691337
1
/ $plugin_array['paralax'] = get_bloginfo('template_url').'/js/mybuttons.js';
function addplugin($plugin_array) { $plugin_array['paralax'] = plugins_url ('/js/mybuttons.js', __FILE__ ); return $plugin_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_plugin_hopeButton($plugin_array) {\n $plugin_array['hopeButton'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function pu_add_buttons( $plugin_array )\n{\n global $wp_version;\n if ( $wp_version >= 3.8 ) {\n $jsfile = 'picatic-shortcode/inc/js/shortcode-tinymce-button-3.9.js';\n } else {\n $jsfile = 'picatic-shortcode/inc/js/shortcode-tinymce-button.js';\n }\n $plugin_array['pushortcodes'] = plugin_dir_url( __FILE__ ) . $jsfile;\n\n return $plugin_array;\n}", "function add_plugin_staffProfile($plugin_array) {\n $plugin_array['staffProfile'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function add_plugin_container($plugin_array) {\n $plugin_array['container'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function add_plugin_socialGroup($plugin_array) {\n $plugin_array['socialGroup'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function add_plugin_singlepost($plugin_array) {\n $plugin_array['singlepost'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function add_plugin_socialIcon($plugin_array) {\n $plugin_array['socialIcon'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function add_plugin_staffItems($plugin_array) {\n $plugin_array['staffItems'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function add_plugin_imagePanel($plugin_array) {\n $plugin_array['imagePanel'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function wishdd_tinymce_plugin( $plugin_array ) {\n \n $plugin_array['wishdd_mce_button'] = plugin_dir_url( __FILE__ ) . '/js/wishdd-custom.js';\n return $plugin_array;\n}", "function add_plugin_postItems($plugin_array) {\n $plugin_array['postItems'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function zp_add_rich_plugins( $plugin_array )\n\t{\n\t\t$plugin_array['zp_button'] = get_stylesheet_directory_uri() . '/include/shortcode/plugin.js';\n\t\treturn $plugin_array;\n\t}", "function add_plugin_youtubeVideo($plugin_array) {\n $plugin_array['youtubeVideo'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function add_plugin_eventPost($plugin_array) {\n $plugin_array['eventPost'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function add_plugin_column($plugin_array) {\n $plugin_array['column'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function add_plugin_testimonials($plugin_array) {\n $plugin_array['testimonials'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function add_plugin_vimeoVideo($plugin_array) {\n $plugin_array['vimeoVideo'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function wpshop_enqueue_plugin_scripts( $plugin_array ) {\n $plugin_array[\"blockquote_button_plugin\"] = get_template_directory_uri() . '/js/tinymce-plugin.js';\n return $plugin_array;\n}", "function add_plugin_sponsorsCarousel($plugin_array) {\n $plugin_array['sponsorsCarousel'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function add_plugin_panelHeader($plugin_array) {\n $plugin_array['panelHeader'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function add_plugin_eventItems($plugin_array) {\n $plugin_array['eventItems'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function my_add_tinymce_plugin( $plugin_array ) {\n\n $plugin_array['my_mce_button'] = get_template_directory_uri() .'/symple-shortcodes/includes/mce/js/symple_shortcodes_tinymceq.js';\n\n return $plugin_array;\n\n}", "function add_plugin_alert($plugin_array) {\n $plugin_array['alert'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function my_add_tinymce_plugin( $plugin_array ) {\n\n $plugin_array['my_mce_button'] = plugins_url( '/assets/js/mce-button.js', __FILE__ );\n\n return $plugin_array;\n}", "function addScriptTinymce($plugin_array) {\n $plugin_array['mybutton'] = MTMCE_URL. 'inc/ressources/tinymce.js';\n return $plugin_array;\n }", "function add_plugin_contactForm($plugin_array) {\n $plugin_array['contactForm'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function caritas_add_tinymce_js( $plugin_array ) {\n $plugin_array['caritas_button'] = CARITAS_JS .'/mce-button.js';\n return $plugin_array;\n}", "function add_plugin_googleMap($plugin_array) {\n $plugin_array['googleMap'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function add_plugin_featureBox($plugin_array) {\n $plugin_array['featureBox'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}", "function add_plugin_tabGroup($plugin_array) {\n $plugin_array['tabGroup'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}" ]
[ "0.81480837", "0.81303823", "0.77467394", "0.766161", "0.7648842", "0.7642441", "0.76230633", "0.76164114", "0.7590409", "0.7578484", "0.75458604", "0.75362724", "0.749421", "0.74844253", "0.74670273", "0.74553263", "0.74122447", "0.7385061", "0.73279107", "0.73224205", "0.72903776", "0.7286928", "0.72342116", "0.72145164", "0.7209238", "0.7184852", "0.71425885", "0.7127707", "0.7115369", "0.7111112" ]
0.88810676
0
Constructs and returns the Informix PDO DSN.
private function constructPdoDsn(array $params) { if ( empty($params['host']) ) { throw new Exception("Missing 'host' in configuration for informix driver"); } if ( empty($params['protocol']) ) { throw new Exception("Missing 'protocol' in configuration for informix driver"); } if ( empty($params['server']) ) { throw new Exception("Missing 'server' in configuration for informix driver"); } $dsn = 'informix:' . 'host=' . $params['host'] . ';' . 'server=' . $params['server'] . ';'; if ( ! empty($params['dbname']) ) { $dsn .= 'database=' . $params['dbname'] . ';'; } else { $dsn .= 'CONNECTDATABASE=NO;'; } $dsn .= 'protocol=' . $params['protocol'] . ';'; if ( ! empty($params['port']) ) { $dsn .= 'service=' . $params['port'] . ';'; } return $dsn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _dsn()\n {\n // baseline of DSN parts\n $dsn = $this->_config;\n\n if (isset($dsn['host'])) {\n $tns = 'dbname=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)' .\n '(HOST=' . $dsn['host'] . ')';\n\n if (isset($dsn['port'])) {\n $tns .= '(PORT=' . $dsn['port'] . ')';\n } else {\n $tns .= '(PORT=1521)';\n }\n\n $tns .= '))(CONNECT_DATA=(SID=' . $dsn['dbname'] . ')))';\n } else {\n $tns = 'dbname=' . $dsn['dbname'];\n }\n\n if (isset($dsn['charset'])) {\n $tns .= ';charset=' . $dsn['charset'];\n }\n\n return $this->_pdoType . ':' . $tns;\n }", "protected function createDSN()\n {\n $dsn = 'mysql:';\n\n if (empty($this->options['unix_socket'])) {\n $dsn .= 'host=' . $this->options['host'] . ';port=' . $this->options['port'];\n } else {\n $dsn .= 'unix_socket=' . $this->options['unix_socket'];\n }\n\n $dsn .= ';dbname=' . $this->options['database'];\n\n return $dsn;\n }", "protected function _dsn()\n {\n // baseline of DSN parts\n $dsn = $this->_config;\n\n // don't pass the username, password, charset, persistent and driver_options in the DSN\n unset($dsn['username']);\n unset($dsn['password']);\n unset($dsn['options']);\n unset($dsn['charset']);\n unset($dsn['persistent']);\n unset($dsn['driver_options']);\n\n // use all remaining parts in the DSN\n foreach ($dsn as $key => $val) {\n $dsn[$key] = \"$key=$val\";\n }\n\n $dsn = implode(';', $dsn);\n\n if (isset($this->_config['charset'])) {\n $dsn .= ';charset=' . (string)$this->_config['charset'];\n }\n\n return $this->_pdoType . ':' . $dsn;\n }", "public function dsn()\n {\n $dsn = \"$this->sTipo_Bd:dbname=$this->sDb;user=$this->sUser;password=$this->sPasswd;host=$this->sHost\";\n return $dsn;\n }", "private function _constructPdoDsn(array $params)\n {\n $dsn = 'ibm:';\n if (isset($params['host'])) {\n $dsn .= 'HOSTNAME=' . $params['host'] . ';';\n }\n\n if (isset($params['port'])) {\n $dsn .= 'PORT=' . $params['port'] . ';';\n }\n\n $dsn .= 'PROTOCOL=TCPIP;';\n if (isset($params['dbname'])) {\n $dsn .= 'DATABASE=' . $params['dbname'] . ';';\n }\n\n return $dsn;\n }", "protected function _getDsn() : string {\n $dsn = parent::_getDsn();\n $Database = $this->_database ?: static::$_DefaultDatabase;\n if ($Database === NULL) {\n throw new \\Exception('No Database provided!');\n }\n $dsn .= 'dbname=' . $Database;\n\n if ($this->_charSet !== NULL) {\n $dsn .= ';charset=' . $this->_charSet;\n }\n\n return $dsn;\n }", "private function dsn() {\n return 'mysql:dbname=' . self::$config['db_name'] .\n ';host=' . self::$config['db_host'];\n }", "public function dsn() {\n if ($this->_config['dsn']) {\n return $this->_config['dsn'];\n }\n if (!$this->_config['database']) {\n throw new DatabaseException('Error, no database name has been configured.');\n }\n if ($this->_config['socket']) {\n return sprintf($this->_protocol . \":unix_socket=%s;dbname=%s\", $this->_config['socket'], $this->_config['database']);\n }\n\n $host = $this->_config['host'];\n list($host, $port) = explode(':', $host) + [1 => $this->_config['port']];\n return sprintf($this->_protocol . \":host=%s;port=%s;dbname=%s\", $host, $port, $this->_config['database']);\n }", "protected function dsn() {\n\t\t// Builds DSN :\n\t\t$dsn = 'pgsql:host=' . $this->host . ';port=' . $this->port . ';dbname=' . $this->dbname;\n\n\t\t// Unset connection parameters to make sure no forgotten debug message\n\t\t// displays them unintentionaly to a user :\n\t\t$this->host = null;\n\t\t$this->port = null;\n\t\t$this->dbname = null;\n\n\t\treturn $dsn;\n\t}", "protected function getDSN():string{\n\n\t\tif(empty($this->options->database)){\n\t\t\tthrow new DriverException('no database given');\n\t\t}\n\n\t\t$dsn = 'pgsql';\n\n\t\tif($this->options->socket){\n\t\t\t$dsn .= ':unix_socket='.$this->options->socket;\n\t\t}\n\t\telse{\n\n\t\t\tif(empty($this->options->host)){\n\t\t\t\tthrow new DriverException('no host given');\n\t\t\t}\n\n\t\t\t$dsn .= ':host='.$this->options->host;\n\n\t\t\tif(is_numeric($this->options->port)){\n\t\t\t\t$dsn .= ';port='.$this->options->port;\n\t\t\t}\n\n\t\t}\n\n\t\t$dsn .= ';dbname='.$this->options->database;\n\n\t\treturn $dsn;\n\t}", "private function _constructPdoDsn(array $params) {\n\t\t$dsn = 'mysql:';\n\t\tif (isset ( $params ['host'] ) && $params ['host'] != '') {\n\t\t\t$dsn .= 'host=' . $params ['host'] . ';';\n\t\t}\n\t\tif (isset ( $params ['port'] )) {\n\t\t\t$dsn .= 'port=' . $params ['port'] . ';';\n\t\t}\n\t\tif (isset ( $params ['dbname'] )) {\n\t\t\t$dsn .= 'dbname=' . $params ['dbname'] . ';';\n\t\t}\n\t\tif (isset ( $params ['unix_socket'] )) {\n\t\t\t$dsn .= 'unix_socket=' . $params ['unix_socket'] . ';';\n\t\t}\n\t\t\n\t\treturn $dsn;\n\t}", "public function getDsn(): string\n {\n/*\n # File connection\n $connection = new PDO('sqlite:<filename>', null, null\n array(PDO::ATTR_PERSISTENT => true)\n );\n\n # Memory connection\n $connection = new PDO('sqlite::memory:', null, null\n array(PDO::ATTR_PERSISTENT => true)\n );\n*/\n # Build the DSN\n $_dsn = $this->getDriver().':'.$this->getFilename();\n\n # Set it\n $this->setDsn($_dsn);\n\n return $_dsn;\n }", "protected function _dsn()\n {\n return $this->getDatabaseHelper()->dsn();\n }", "public static function create(array $config)\n {\n // Build DSN connection string for PDO\n $dsn = new self($config['driver']);\n\n if (isset($config['unix_socket'])) {\n $dsn['unix_socket'] = $config['unix_socket'];\n } else {\n if (isset($config['host'])) {\n $dsn['host'] = $config['host'];\n }\n if (isset($config['port'])) {\n $dsn['port'] = $config['port'];\n }\n }\n\n foreach (array('database', 'dbname') as $key) {\n if (isset($config[$key])) {\n $dsn['dbname'] = $config[$key];\n break;\n }\n }\n\n if (isset($config['charset'])) {\n $dsn['charset'] = $config['charset'];\n }\n\n\n return $dsn;\n }", "private function _constructPdoDsn(array $params)\n {\n if (stristr(PHP_OS, 'WIN') && PHP_OS != 'Darwin')\n {\n // use for testing on Win\n $dsn = 'sqlsrv:server=';\n\n if (isset($params['host'])) {\n $dsn .= $params['host'];\n }\n\n if (isset($params['port']) && !empty($params['port'])) {\n // $dsn .= ',' . $params['port'];\n }\n\n if (isset($params['dbname'])) {\n $dsn .= ';Database=' . $params['dbname'];\n }\n return $dsn;\n\n } else {\n\n $dsn = 'dblib:';\n if (isset($params['host'])) {\n $dsn .= 'host=' . $params['host'] . ';';\n }\n if (isset($params['port'])) {\n //$dsn .= 'port=' . $params['port'] . ';';\n }\n if (isset($params['dbname'])) {\n $dsn .= 'dbname=' . $params['dbname'] . ';';\n }\n // Support charset config\n if(isset($params['charset'])) {\n $dsn .= 'charset=' . $params['charset'] .';';\n }\n\n return $dsn;\n }\n }", "private function _prepareDsnString() : string\n {\n return sprintf(\n \"%s:host=%s;dbname=%s;charset=%s\",\n $this->_config['driver'],\n $this->_config['host'],\n $this->_config['database'],\n $this->_config['charset']\n );\n }", "public function getDsn(): string\n {\n return 'sqlite:' . $this->database;\n }", "protected function constructPdoDsn(array $params)\n {\n $dsn = 'mysql:';\n if (isset($params['host']) && $params['host'] !== '') {\n $dsn .= 'host=' . $params['host'] . ';';\n }\n\n if (isset($params['port'])) {\n $dsn .= 'port=' . $params['port'] . ';';\n }\n\n if (isset($params['dbname'])) {\n $dsn .= 'dbname=' . $params['dbname'] . ';';\n }\n\n if (isset($params['unix_socket'])) {\n $dsn .= 'unix_socket=' . $params['unix_socket'] . ';';\n }\n\n if (isset($params['charset'])) {\n $dsn .= 'charset=' . $params['charset'] . ';';\n }\n\n return $dsn;\n }", "public function buildDsn(): void\n {\n if ($this->dsn == 'mysql') {\n $this->dsn = 'mysql:dbname=' . $this->dbname . ';host=' . $this->host;\n } elseif ($this->dsn == 'sqlite' && $this->host == 'memory') {\n $this->dsn = 'sqlite::memory:';\n }\n }", "protected function connect(): PDO\n {\n if (is_null($this->conn)) {\n if (!is_array($this->dsn)) {\n throw new \\RuntimeException(\"database not configured\");\n }\n\n $this->conn = new PDO($this->dsn[\"dsn\"], $this->dsn[\"user\"] ?? null, $this->dsn[\"password\"] ?? null);\n $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $this->conn->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);\n $this->conn->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);\n\n if (0 === strpos($this->dsn['dsn'], 'mysql:')) {\n $this->conn->query('SET NAMES utf8');\n }\n\n // Perform initialization stuff, like SET NAMES utf8.\n if (!empty($this->dsn[\"bootstrap\"])) {\n foreach ($this->dsn[\"bootstrap\"] as $query) {\n $this->conn->query($query);\n }\n }\n }\n\n return $this->conn;\n }", "protected function createPdoInstance () {\r\n $pdoClass = 'PDO';\r\n if (($pos = strpos( \r\n $this->connectionString , \r\n ':' )) !== false) {\r\n $driver = strtolower( \r\n substr( \r\n $this->connectionString , \r\n 0 , \r\n $pos ) );\r\n if ($driver === 'mssql' || $driver === 'dblib') $pdoClass = 'CMssqlPdoAdapter';\r\n }\r\n return new $pdoClass( \r\n $this->connectionString , \r\n $this->username , \r\n $this->password , \r\n $this->_attributes );\r\n }", "private function getPDOConnection() {\n if ($this->dbc == NULL) {\n $dsn = \"\" .\n $this->_config['driver'] .\n \":host=\" . $this->_config['host'] .\n \";dbname=\" . $this->_config['dbname'];\n try {\n $this->dbc = new PDO( $dsn, $this->_config[ 'username' ], $this->_config[ 'password' ] );\n } catch( PDOException $e ) {\n echo __LINE__.$e->getMessage();\n }\n }\n }", "protected function constructPdoDsn(array $params, $username = null, $password = null)\n {\n $dsn = '';\n\n if (isset($params['host']) && $params['host'] != '') {\n $dsn .= 'host=' . $params['host'] . ';';\n }\n if (isset($params['port'])) {\n $dsn .= 'port=' . $params['port'] . ';';\n }\n if (isset($params['dbname'])) {\n $dsn .= 'dbname=' . $params['dbname'] . ';';\n }\n if (isset($params['unix_socket'])) {\n $dsn .= 'unix_socket=' . $params['unix_socket'] . ';';\n }\n if (isset($params['charset'])) {\n $dsn .= 'charset=' . $params['charset'] . ';';\n }\n\n if ($username) {\n $dsn .= 'user=' . $username . ';';\n }\n\n if ($password) {\n $dsn .= 'password=' . $password . ';';\n }\n\n return trim($dsn, ';');\n }", "function dsn_connect($dsn)\n {\n // Use persistent connections if available\n $db_options = array(\n 'persistent' => $this->db_pconn,\n 'emulate_prepared' => $this->debug_mode,\n 'debug' => $this->debug_mode,\n 'debug_handler' => 'mdb2_debug_handler',\n 'portability' => MDB2_PORTABILITY_ALL ^ MDB2_PORTABILITY_EMPTY_TO_NULL);\n\n if ($this->db_provider == 'pgsql') {\n $db_options['disable_smart_seqname'] = true;\n $db_options['seqname_format'] = '%s';\n }\n\n $dbh = MDB2::connect($dsn, $db_options);\n\n if (MDB2::isError($dbh))\n {\n $this->db_error = TRUE;\n $this->db_error_msg = $dbh->getMessage();\n \n raise_error(array('code' => 500, 'type' => 'db', 'line' => __LINE__,\n 'file' => __FILE__, 'message' => $dbh->getUserInfo()), TRUE, FALSE);\n }\n else if ($this->db_provider=='sqlite')\n {\n $dsn_array = MDB2::parseDSN($dsn);\n if (!filesize($dsn_array['database']) && !empty($this->sqlite_initials))\n $this->_sqlite_create_database($dbh, $this->sqlite_initials);\n }\n else if ($this->db_provider!='mssql' && $this->db_provider!='sqlsrv')\n $dbh->setCharset('utf8');\n\n return $dbh;\n }", "private function constructPdoDsn(array $params): string\n {\n $dsn = 'sqlite:';\n if (isset($params['path'])) {\n $dsn .= $params['path'];\n } elseif (isset($params['memory'])) {\n $dsn .= ':memory:';\n }\n\n return $dsn;\n }", "private function createPdo()\n {\n if ($this->username && $this->password && $this->options) {\n $this->db = new PDO($this->dsn, $this->username, $this->password, $this->options);\n } elseif ($this->username && $this->password) {\n $this->db = new PDO($this->dsn, $this->username, $this->password);\n } else {\n $this->db = new PDO($this->dsn);\n }\n }", "protected function connect() {\r\n $this->dbServerName = $_ENV['dbServerName'];\r\n $this->dbUsername = $_ENV['dbUsername'];\r\n $this->dbPassword = $_ENV['dbPassword'];\r\n $this->dbName = $_ENV['dbName'];\r\n $this->charset = $_ENV['charset'];\r\n\r\n $dsn = \"mysql:host=\" . $this->dbServerName . \";dbname=\" . $this->dbName . \";charset=\" . $this->charset;\r\n try {\r\n $dbh = new \\PDO($dsn, $this->dbUsername, $this->dbPassword);\r\n $dbh->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\r\n } catch (\\PDOException $e) {\r\n throw $e;\r\n }\r\n\r\n return $dbh;\r\n }", "private function dbConnect(): PDO\n {\n return new PDO(\"mysql:host=\" . DB_HOST . \":\" . DB_PORT . \";dbname=\" . DB_NAME, DB_USER, DB_PASSWORD, []);\n }", "private static function connect()\n {\n $pdo = new \\PDO(self::$database . \":host=\" . self::$hostname . \";port=\" . self::$port . \";dbname=\" . self::$dbName . \";charset=\" . self::$charset, self::$username, self::$password);\n $pdo->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n $pdo->setAttribute(\\PDO::ATTR_DEFAULT_FETCH_MODE, \\PDO::FETCH_OBJ);\n return $pdo;\n }", "abstract protected function dsn();" ]
[ "0.7296468", "0.7273818", "0.7178456", "0.7079534", "0.70776045", "0.6901641", "0.68622375", "0.68535256", "0.6776746", "0.66748816", "0.65829396", "0.6563225", "0.64960045", "0.64895356", "0.64534163", "0.63580775", "0.6330052", "0.62478626", "0.6219648", "0.61982775", "0.6180248", "0.6126718", "0.6119469", "0.6098572", "0.6045919", "0.6045262", "0.6038156", "0.60206574", "0.6018986", "0.60177463" ]
0.7305842
0
Tente d'effectuer une hospitalisation
public function hospitalisation() { // Recupere la position du batiment $position = $this->_route->get('position'); // Recupere le personnage en session $personnage = Session::get('personnage'); // Recuperation de la langue $language = Locale::getLanguage(); // Hospitalisation du personnage $this->_service->hospitalisation($position, $personnage); // Gestion des erreurs if ($this->_service->getValidator()->hasErrors()) { // Log foreach ($this->_service->getValidator()->getErrors() as $error) { $this->_logger->notice($error, array('user' => Session::get('user'))); } // Feedback utilisateur $flash = Flash::getInstance(); $flash->addErrorList($this->_service->getValidator()->getErrors()); // Construction de la reponse $content['feedback'] = $this->_feedbackUtils->createFeedbackFromFlash($flash); // Le flash ne doit donc pas etre affiche $flash->remove(); // Reponse JSON return $this->json($content); } // Mise a jour du domaine en session $map = Session::get('map'); $map->setDomaineAndRefresh($personnage->getDomaine()); Session::set('map', $map); // Mise à jour du personnage en session Session::set("personnage", $personnage); // Récupération du bandeau pour refresh $content['bandeau'] = $this->createZone('bandeauPersonnage')->execute()->render(); // Recupere la case de la position concernee $case = $map->getCaseByPosition($position); // Recupere le batiment de la case $batiment = $case->getBatiment(); $returnHospitalisation = new stdClass(); $returnHospitalisation->dureeRestante = $batiment->getDureeHospitalisation(); $returnHospitalisation->position = $batiment->getPosition(); $content['hospitalisation'] = $returnHospitalisation; return $this->json($content); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHospitalList(){\r\n\t\t\r\n\t}", "public function cancelHospitalisation() {\r\n // Recupere la position du batiment a annuler\r\n $position = $this->_route->get('position');\r\n\r\n // Recupere le personnage en session\r\n $personnage = Session::get('personnage');\r\n\r\n // Recuperation de la langue\r\n $language = Locale::getLanguage();\r\n\r\n // Annulation de l'hospitalisation en cours\r\n $this->_service->cancelHospitalisationForPersonnage($position, $personnage, $language);\r\n\r\n // Gestion des erreurs\r\n if ($this->_service->getValidator()->hasErrors()) {\r\n // Log\r\n foreach ($this->_service->getValidator()->getErrors() as $error) {\r\n $this->_logger->notice($error, array('user' => Session::get('user')));\r\n }\r\n }\r\n\r\n // Mise a jour de la map en session\r\n $map = Session::get('map');\r\n $map->setDomaineAndRefresh($personnage->getDomaine());\r\n Session::set('map', $map);\r\n\r\n // Mise à jour du personnage en session\r\n Session::set(\"personnage\", $personnage);\r\n\r\n // Récupération du bandeau pour refresh\r\n $content['bandeau'] = $this->createZone('bandeauPersonnage')->execute()->render();\r\n\r\n // Recupere la case de la position donnee\r\n $case = $map->getCaseByPosition($position);\r\n\r\n // Recupere le batiment de la case\r\n $batiment = $case->getBatiment();\r\n\r\n $caseBatiment = new stdClass();\r\n $caseBatiment->x = $case->getX();\r\n $caseBatiment->y = $case->getY();\r\n $caseBatiment->image = $this->getApp()->getAppConfiguration()->getWebroot().'/images/domaine/map/' . $batiment->getImage();\r\n\r\n $content['caseBatiment'] = $caseBatiment;\r\n return $this->json($content);\r\n }", "public function refreshEtatHospitalisation() {\r\n // Recupere la position donnee\r\n $position = $this->_route->get('position');\r\n\r\n // Recuperation du personnage en session\r\n $personnage = Session::get('personnage');\r\n\r\n // Tentative de mise a jour de l'etat d'hospitalisation\r\n $this->_service->updateEtatHospitalisation($position, $personnage);\r\n\r\n // Gestion des erreurs\r\n if ($this->_service->getValidator()->hasErrors()) {\r\n // Log\r\n foreach ($this->_service->getValidator()->getErrors() as $error) {\r\n $this->_logger->notice($error, array('user' => Session::get('user')));\r\n }\r\n }\r\n\r\n // Mise a jour de la map en session\r\n $map = Session::get('map');\r\n $map->setDomaineAndRefresh($personnage->getDomaine());\r\n Session::set('map', $map);\r\n\r\n // Mise à jour du personnage en session\r\n Session::set(\"personnage\", $personnage);\r\n\r\n // Recupere le batiment de la position indiquee\r\n $batiment = $personnage->getDomaine()->getBatimentAtPosition($position);\r\n\r\n // Récupération du bandeau pour refresh\r\n $content['bandeau'] = $this->createZone('bandeauPersonnage')->execute()->render();\r\n\r\n // Recupere la case du batiment a la position donnee\r\n $caseBatiment = $map->getCaseByPosition($batiment->getPosition());\r\n\r\n // Case du batiment\r\n $returnCaseBatiment = new stdClass();\r\n $returnCaseBatiment->x = $caseBatiment->getX();\r\n $returnCaseBatiment->y = $caseBatiment->getY();\r\n $returnCaseBatiment->image = $this->getApp()->getAppConfiguration()->getWebroot().'/images/domaine/map/' . $batiment->getStatefulImage();\r\n\r\n $content['caseBatiment'] = $returnCaseBatiment;\r\n\r\n return $this->json($content);\r\n }", "function hospitals(){\n\t$headers = array(\n\t\t'mhid',\n\t\t'state', // \"State\",\n\t\t'name', //\"Hospname\" ,\n\t\t'wait',\n\t\t'id', // \"Establishment ID\",\n\t\t'parent_id', //\"Parent Id\",\n\t\t'use_default_wait_time',\n\t\t'wait_state_avg',\n\t\t'unit', //\"Unit\",\n\t\t'medicare', //\"Medicare Prov Number\",\n\t\t'address_line_1', //\"Address Line 1\",\n\t\t'address_line_2', //\"Address Line 2\",\n\t\t'lat',\n\t\t'long',\n\t\t'aus',\n\t\t'full_address',\n\t\t'remoteness_area_code', // \"Remoteness area (code)\",\n\t\t'remoteness_area', //\"Remoteness area \",\n\t\t'num_beds', //\"Number of available beds\",\n\t\t'peer_group_code', //\"2012-13 Peer Group code\",\n\t\t'peer_group_name', //\"2012-13 Peer Group Name\",\n\t\t'admissions', //\"Admissions reported\",\n\t\t'emergency', //\"Emergency department\",\n\t\t'elective_surgery', // \"Elective surgery reported\",\n\t\t'outpatient', //\"Outpatient clinics\",\n\t\t'peer_group_code_2012', //\"2011-12 Peer Group code\",\n\t\t'peer_group_name_2012', //\"2011-12 Peer Group Name\"\n\t\t'category', //App category\n\t);\n\n\n\t// If co-ordinates are given\n\tif (isset($_GET['latlong'])){\n\t\tlist($lat, $long) = explode(',', $_GET['latlong']);\n\t}\n\telse {\n\t\t$hospList = explode(PHP_EOL, file_get_contents('data/hosp.csv'));\n\t\t$all = array();\n\t\tarray_shift($hospList);\n\t\tforeach ($hospList as $hosp){\n\t\t\t$cols = str_getcsv($hosp);\n\t\t\tif (sizeof($headers) == sizeof($cols)){\n\t\t\t\t$all[] = array_combine($headers, $cols);\n\t\t\t}\n\t\t}\n\n\n\t\techo json_encode($all);\n\t\texit;\n\t}\n}", "function processPetition() \r\n\t{\r\n $institution_id = -1;\r\n //Primero comprueba si estamos identificados y si no es asi entonces vamos a ver si es una peticion de autenticacion\r\n $user_id = $this->getSessionElement( 'userinfo', 'user_id' );\r\n if ( isset($user_id) && $user_id != '' ) { \r\n if ( $this->issetViewVariable('institution_id') ) {\r\n $institution_id = $this->getViewVariable('institution_id');\r\n } else {\r\n $institution_id = -1;\r\n }\r\n if ( $this->issetViewVariable('faculty_id') ) {\r\n $faculty_id = $this->getViewVariable('faculty_id');\r\n } else {\r\n $institution_id = -1;\r\n }\r\n if ( $this->issetViewVariable('department_id') ) {\r\n $department_id = $this->getViewVariable('department_id');\r\n } else {\r\n $institution_id = -1;\r\n }\r\n if ( $this->issetViewVariable('area_id') ) {\r\n $area_id = $this->getViewVariable('area_id');\r\n } else {\r\n $institution_id = -1;\r\n }\r\n } else {\r\n header('Location:' . Util::format_URLPath('main/index.php') );\r\n } \r\n\r\n if ( $institution_id >= 0 ) { \r\n $this->setViewVariable('arr_courses', $this->obj_data->getCourse( $user_id, $institution_id, $faculty_id, $department_id, $area_id ) );\r\n \r\n //Perfil superior al alumno, debería de ser una comprobación ACL\r\n $profile_id = $this->getSessionElement( 'userinfo', 'profile_id' );\r\n if ( $profile_id < 4 ) {\r\n \t$navinfo = array( \"institution_id\" => $institution_id,\r\n \t \"faculty_id\" => $faculty_id,\r\n \t \"department_id\" => $department_id,\r\n \t \"area_id\" => $area_id);\r\n \t$this->setSessionArray('navinfo', $navinfo);\r\n }\r\n\r\n $this->addNavElement(Util::format_URLPath('listCourses/index.php','institution_id=' . $institution_id . '&faculty_id=' . $faculty_id . '&department_id=' . $department_id . '&area_id=' . $area_id), agt('miguel_CourseList') );\r\n $this->setCacheFile(\"miguel_VMain_ListaCursos_\" . $this->getSessionElement(\"userinfo\", \"user_id\"));\r\n $this->setMessage( agt('miguel_CourseList') );\r\n $this->setPageTitle( 'miguel_CourseList' );\r\n \r\n $this->setCacheFlag(true);\r\n $this->setHelp(\"EducContent\");\r\n } else { //category_id\r\n header('Location:' . Util::format_URLPath('main/index.php') );\r\n }\r\n\t}", "function mostrarHorarioEstudiante() {\r\n $codEstudiante = $_REQUEST['codEstudiante'];\r\n $registroEstudiante=$this->consultarDatosEstudiante($codEstudiante);\r\n if (isset($registroEstudiante)) {\r\n $this->datosEstudiante($registroEstudiante);\r\n $variablesInscritos = array('codEstudiante' => $codEstudiante,\r\n 'ano' => $this->ano,\r\n 'periodo' => $this->periodo,\r\n 'codProyecto' => $_REQUEST['codProyecto'],\r\n 'planEstudio' => $_REQUEST['planEstudio'],\r\n 'codProyectoEstudiante' => $registroEstudiante[0]['CODIGO_CARRERA'],\r\n 'planEstudioEstudiante' => $registroEstudiante[0]['PLAN_ESTUDIO']);\r\n $registroEstudiante = array_merge($registroEstudiante[0], $variablesInscritos);\r\n $resultadoInscritos=$this->consultaEspaciosInscritos($variablesInscritos);\r\n //verifica permisos de adicion, cancelacion, consulta\r\n $registro_permisos = $this->fechas->validar_fechas_estudiante_coordinador($this->configuracion, $registroEstudiante['CODIGO']);\r\n switch ($registro_permisos) {\r\n case 'adicion':\r\n $permiso = 1;\r\n break;\r\n\r\n case 'cancelacion':\r\n $permiso = 2;\r\n break;\r\n\r\n case 'consulta':\r\n $permiso = 0;\r\n break;\r\n\r\n default:\r\n $permiso = 0;\r\n break;\r\n }\r\n //valida si el estado del estudiante permite adicionar\r\n $estado = $this->validacion->validarEstadoEstudiante($_REQUEST);\r\n if ($estado != 'ok')\r\n {\r\n $permiso = 0;\r\n }\r\n //permite adicionar si hay fechas habilitadas\r\n if ($permiso == 1)\r\n {\r\n $this->registroAgil($registroEstudiante);\r\n }\r\n //muestra el horario del estudiante\r\n $this->horarioEstudianteConsulta($resultadoInscritos, $registroEstudiante, $permiso);\r\n //calcula creditos inscritos\r\n?>\r\n <br><table class=\"cuadro_plano\" align='center' width='70%' cellspacing='0' cellpadding='2' >\r\n <?\r\n $creditos = $this->calcularInscritos($variablesInscritos);\r\n //permite adicionar si hay fechas habilitadas\r\n if ($permiso == 1)\r\n {\r\n $this->adicionar($registroEstudiante, $creditos);\r\n }\r\n //muestra pie de pagina\r\n $this->finTabla($creditos);\r\n ?>\r\n </table>\r\n<?\r\n }\r\n else {\r\n echo \"El código de estudiante: <strong>\" . $codEstudiante . \"</strong> no está inscrito en Créditos.\";\r\n }\r\n }", "function verificar_existencia_de_espacio (){\n \n $anio_lectivo=date('Y', strtotime($this->s__fecha_consulta));\n $this->s__dia_consulta=$this->obtener_dia(date('N', strtotime($this->s__fecha_consulta)));\n //Debemos usar la fecha seleccionada por el usuario. Necesitamos brindar una respuesta concreta\n //segun los espacios ocupados en ese dia.\n $periodo=$this->dep('datos')->tabla('periodo')->get_periodo_calendario(date('Y-m-d', strtotime($this->s__fecha_consulta)), $anio_lectivo, $this->s__id_sede);\n \n //Obtenemos las aulas del establecimiento.\n $aulas_ua=$this->dep('datos')->tabla('aula')->get_aulas_por_sede($this->s__id_sede);\n \n //Obtenemos las asignaciones para la fecha solicitada. En este caso necesitamos traer las \n //asignaciones para todas las aulas del establecimiento.\n $asignaciones=$this->procesar_periodo($periodo, 'hd');\n \n //Obtenemos todas las aulas que actualmente estan siendo usadas. \n $aulas=$this->obtener_aulas($asignaciones);\n \n //Guardamos el id_sede en sesion, para utilizar dentro de la clase HorariosDisponibles en la \n //operacion agregar_capacidad.\n toba::memoria()->set_dato_instancia(0, $this->s__id_sede);\n \n $horarios_disponibles=new HorariosDisponibles();\n \n $this->s__horarios_disponibles=$horarios_disponibles->calcular_horarios_disponibles($aulas, $aulas_ua, $asignaciones);\n \n //Obtenemos los horarios que coinciden con el requerimiento registrado.\n $horarios=$this->calcular_horarios_disponibles_segun_req();\n \n //Si existe al menos 1 horario libre que coincide con el requerimiento, lo mostramos en el \n //cuadro_espacio_ocupado :D, -_-\n if(count($horarios) > 0){\n $this->s__horarios_libres=$horarios; //contiene los horarios que conciden con el requerimiento\n }else{\n toba::notificacion()->agregar(\"No existen horarios disponibles alternativos\", 'info');\n return ;\n }\n \n }", "function habilidadeForte();", "public function getHospitalDetails() {\n $query = \"SELECT * FROM hospital_tab\";\n $result = $this->db->query($query);\n if ($result->num_rows() <= 0) {\n $response = array(\n 'status' => 500,\n 'status_message' => 'No data found.');\n } else {\n $response = array(\n 'status' => 200,\n 'status_message' => $result->result_array());\n }\n return $response;\n }", "public function action_hospital_details()\r\n {\r\n\r\n $view = View::forge(\"components/template.php\", array(\r\n \"titlepage\" => \"Hospital details\",\r\n \"main_body\" => View::forge(\"hospitalviews/hospital_details.php\")\r\n ));\r\n return Response::forge($view);\r\n }", "public function select_one_hospital()\n {\n if (!$this->input->is_ajax_request()) {\n show_404();\n exit;\n }\n $data = $this->ajax_model->select_one_hospital();\n if($data)\n {\n echo $data;\n }\n else\n {\n echo 'Err';\n }\n }", "public function listHospital()\n {\n\n $isUserAdmin = auth()->user()->isAdmin;\n\n if ($isUserAdmin) {\n\n $hospitals = Hospital::all();\n\n return response()->json([\n \"status\" => 1,\n \"data\" => $hospitals\n ]);\n } else {\n\n return response()->json([\n \"status\" => 0,\n \"message\" => \"Only Admins are allowed to do this operation!\"\n ], 401);\n }\n }", "public function patientInformationSteptenAction(){\n\t\t\t\t\t\n\t\t\t\t\t$request = $this->getRequest();\n\t\t\t\t\t$options = $request->getPost();\n\t\t\t\t\t$usersNs = new Zend_Session_Namespace(\"members\");\n\t\t\t\t\t$allergic_subtances = new Application_Model_AllergicSubstances();\n\t\t\t\t\t$allergic_subtances = $allergic_subtances->fetchRow(\"patient_id='{$usersNs->userId}'\");\n\t\t\t\t\t$this->view->allergic_subtances=$allergic_subtances;\n\t\t\t\t\t\n\t\t\t\tif ($request->isPost()) {\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$authNamespace = new Zend_Session_Namespace('nine');\n\t\t\t\t\t$authNamespace->pHistoryNine=$options;\n\t\t\t\t\t\n\t\t\t\t\tif($allergic_subtances){\n\t\t\t\t\n\t\t\t\t\t\t\t$ids=$allergic_subtances->id;\n\t\t\t\t\t\t\t$idArray = explode(',', $ids);\n\t\t\t\t\t\t\t\t$model = new Application_Model_AllergicSubstances();\n\t\t\t\t\t\t\t\t\tforeach ($idArray as $id) {\n\t\t\t\t\t\t\t\t\t$object = $model->fetchRow(\"id={$id}\");\n\t\t\t\t\t\t\t\tif($object){\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$object->setCurrentWeight($options['weight']);\n\t\t\t\t\t\t\t\t\t$object->setHeight($options['height']);\n\t\t\t\t\t\t\t\t\t$object->setLeastWeighed($options['weighed']);\n\t\t\t\t\t\t\t\t\t$object->setMostWeighed($options['most_weighed']);\n\t\t\t\t\t\t\t\t\t$object->setWeightGain($options['gain']);\n\t\t\t\t\t\t\t\t\t$object->setWeightLoss($options['loss']);\n\t\t\t\t\t\t\t\t\t$object->setSleepTime($options['average']);\n\t\t\t\t\t\t\t\t\t$object->setFrequentlyTired($options['tired']);\n\t\t\t\t\t\t\t\t\t$object->setTroubleSleeping($options['sleeping']);\n\t\t\t\t\t\t\t\t\t$object->setYesExplain($options['explain']);\n\t\t\t\t\t\t\t\t\t$object->setRecentFevers($options['condition']);\n\t\t\t\t\t\t\t\t\t$object->setUseAutomobile($options['automobiles']);\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$object->save();\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}\n\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}", "function displayHospital($poi) {\n \techo '<div data-name=\"Hospital\" class=\"Poi';\n \t\n \t//if this place has been visited before, make it gray\n \tif ($poi->is_visited()) {\n \t\techo ' visited';\n \t}\n \t\n \techo '\" id=\"';\n echo ($poi->what_name());\n echo '\">';\n echo '<a onclick=\"addToPath(\\'hp\\')\" href=\"hospital.php\"></a></div>';\n}", "public function edit_one_hospital_opu()\n {\n if (!$this->input->is_ajax_request()) {\n show_404();\n exit;\n }\n if($this->userauthentication_model->is_opu())\n {\n echo $this->ajax_model->edit_one_hospital_opu();\n }\n else\n {\n exit;\n }\n }", "public function create()\n {\n //\n $hospitales = Hospital::all();\n if (count($hospitales) == 0) {\n return view(\"hospital.create\");\n } else {\n return redirect(route(\"hospital.index\"))->with(\"error\",\"Ya existe un hospital\");\n }\n \n }", "public function getPatientHospital(){\n $patient_id = '';\n if(isset($_POST['patient_id'])){\n $patient_id = $_POST['patient_id'];\n }\n if( !$hospital = $this->patient_model->getHospitalDetails($patient_id) ){\n echo json_encode(array( 'No hospital details are found for '. $patient_id ));\n }else{\n echo $this->sendResponse($hospital);\n }\n\n /*$this->form_validation->set_rules('patient_id', display('patient_id'),'required');\n if ( $this->form_validation->run() === true ){ die('asdasdasd');\n\n \n\n }else{\n $this->fieldError();\n }*/\n }", "function emission() {\n $level = $this->session->userdata('level');\n /////////////////////////////////////////////////\n $load['Title'] = \"Emission Plant Gresik\";\n $load['li_active'] = $this->plant_link->plant_emission('gresik', 'emission');\n $load['OnOff'] = $this->Mplant_gresik->data_Plg();\n $this->template->load('plant_information/administrator_index', 'plant_information/gresik/emission', $load);\n // if ($level == 1) {\n // $this->template->load('plant_information/administrator_index', 'plant_information/gresik/emission', $load);\n // } elseif ($level == 2) {\n // $this->template->load('plant_information/operator_index', 'plant_information/gresik/emission', $load);\n // } elseif ($level == 3) {\n // $this->template->load('plant_information/home_index', 'plant_information/gresik/emission', $load);\n // }\n }", "public function ajaxCrearHospitalizacionAislamiento()\t{\n\n\t\t$tabla = \"hospitalizaciones_aislamientos\";\n\n\t\t$datos = array( \"fecha_aislamiento\"\t => $this->fecha_aislamiento, \n\t\t\t\t\t\t\"lugar_aislamiento\" \t => strtoupper($this->lugar_aislamiento),\n\t\t\t\t\t\t\"fecha_internacion\" \t => $this->fecha_internacion,\n\t\t\t\t\t\t\"establecimiento_internacion\" => strtoupper($this->establecimiento_internacion),\n\t\t\t\t\t\t\"ventilacion_mecanica\" => $this->ventilacion_mecanica,\n\t\t\t\t\t\t\"terapia_intensiva\" \t => $this->terapia_intensiva,\n\t\t\t\t\t\t\"fecha_ingreso_UTI\" \t => $this->fecha_ingreso_UTI,\n\t\t\t\t\t\t\"id_ficha\" \t\t\t\t => $this->id_ficha,\n\t\t\t\t\t\t);\t\n\n\t\t$respuesta = ModeloHospitalizacionesAislamientos::mdlIngresarHospitalizacionAislamiento($tabla, $datos);\n\n\t\t// var_dump($datos);\n\n\t\techo $respuesta;\n\n\t}", "function emission() {\n $level = $this->session->userdata('level');\n /////////////////////////////////////////////////\n $load['Title'] = \"Emission Plant Tonasa\";\n $load['li_active'] = $this->plant_link->plant_emission('tonasa', 'emission');\n $this->template->load('plant_information/administrator_index', 'plant_information/tonasa/emission', $load);\n // if ($level == 1) {\n // $this->template->load('plant_information/administrator_index', 'plant_information/tonasa/emission', $load);\n // }elseif($level == 2){\n // $this->template->load('plant_information/operator_index', 'plant_information/tonasa/emission', $load);\n // }elseif($level == 3){\n // $this->template->load('plant_information/home_index', 'plant_information/tonasa/emission', $load);\n // }\n \n }", "static public function AsignacionFacilitadores($idcarga,$id_esc,$ciclo,$clave,$seccion,$aula,$dia,$hi,$hf,$carga_esc){\n\n\t\t$idf = Conexion::conectar()->prepare(\"SELECT * FROM `compfacili` WHERE `clave_comp`=?\");\n $idf ->execute(array($clave));\n $idfs = $idf->fetchAll(PDO::FETCH_ASSOC);\n $totalRows_idfs = count($idfs);\n $row_idfs = array_shift($idfs);\n $p = \"\";\n $msj =\"\";\n\n //consultamos los facilitadores que pueden dar esa asignatura\n do{\n \tif ($totalRows_idfs > 0) {\n \t\t\n \t\t//facilitador que tiene esa clave\n\t \t$id_faci = $row_idfs['id_faci'];\n\n\t \t$horario = Conexion::conectar()->prepare(\"SELECT * FROM `facilihorario` WHERE `id_faci`=? AND `dia`=?\");\n\t\t $horario ->execute(array($id_faci,$dia));\n\t\t $horarios = $horario->fetchAll(PDO::FETCH_ASSOC);\n\t\t $totalRows_horarioss = count($horarios);\n\t\t $row_horarioss = array_shift($horarios);\n\n\n\t\t do {\n\n\t\t \t if ($totalRows_horarioss > 0) {\n\n\n\t\t \t\t\t\t//pregunto si el facilitador esta disponible a la hora de la materia\n\t\t \t\t\t\tif (($row_horarioss['hi'] <= $hi) and ($row_horarioss['hf'] >= $hf) ) {\n\t\t \t\t\t\t\t\n\n\t\t \t\t\t\t\t$id_faci = $row_horarioss['id_faci'];\n\n\t\t \t\t\t\t\n\t\t \t\t\t\t\t//SELECT * FROM `reporte` WHERE `id_faci`= 3 AND `dia`=1 AND (`hi` BETWEEN '12:00:00' AND '14:00:00') AND (`hf` BETWEEN '12:00:00' AND '14:00:00')\n\n\t\t\t\t\t\t\t\t\t$ConsulReport = Conexion::conectar()->prepare(\"SELECT * FROM `reporte` WHERE `ciclo`=? AND `dia`=? AND (`hi` BETWEEN ? AND ?) AND (`hf` BETWEEN ? AND ?) AND `id_faci` =?\");\n\t\t\t\t\t\t\t\t\t$ConsulReport ->execute(array($ciclo,$dia,$hi,$hf,$hi,$hf,$id_faci));\n\t\t\t\t\t\t\t\t\t$ConsulReportes = $ConsulReport->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\t\t\t\t\t\t$totalRows_ConsulReportes = count($ConsulReportes);\n\t\t\t\t\t\t\t\t\t$row_ConsulReportes = array_shift($ConsulReportes);\n\n\t\t\t\t\t\t\t\t\tif (($totalRows_ConsulReportes == 0) AND ($row_ConsulReportes['id_faci'] != $id_faci)) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\tif (ConsultarAulas($ciclo,$dia,$hi,$hf,$aula) == 1) {\n\n\t\t\t\t\t\t\t\t\t\t $msj =\"<label class='label label-info'>Aula no Disponible</label>\";//Aula no Disponible\n\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t//inserto si esta disponible el facilitador \n\t\t\t\t\t\t\t\t\t\t\tInsertarRegistos($idcarga,$id_esc,$ciclo,$clave,$seccion,$aula,$dia,$hi,$hf,$carga_esc,$id_faci,$pdo);\n\t\t\t\t\t\t\t\t\t\t\t$msj =\"<label class='label label-success'>Facilitador Asignado</label>\";\n\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\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t\t\t$msj =\"<label class='label label-info'>Facilitador No Disponible</label>\";//si el facilitador no esta disponible ese dia\n\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\n\t\t \t\t\t\t\t\n\t\t \t\t\t\t\t\n\t\t \t\t\t\t} else {\n\t\t \t\t\t\t\t$msj = \"<label class='label label-info'>Hora No Disponible</label>\";//hora no disponible\n\t\t \t\t\t\t}\n\t\t \t\t\t\t\n\t\t \t\t\t\t\n\t\t \t\t//http://www.forosdelweb.com/f86/between-entre-dos-horas-702893/\n\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t$msj =\"<label class='label label-info'>Facilitador No Disponible</label>\";//si el facilitador no esta disponible ese dia\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\n\t\t \t} while ( $row_horarioss = array_shift($horarios));\n\t\t \n\n\t } else {\n \t\t $msj = \"<label class='label label-info'>Facilitador No Disponible</label>\";//si el facilitador no tiene la clave\n \t}\n\n }while ($row_idfs = array_shift($idfs));\n \n\n return ($msj) ;\n \n\t}", "public function edit(Hospital $hospital)\n {\n //\n }", "public function edit(Hospital $hospital)\n {\n //\n }", "public function addHospital(Request $request)\n {\n //validate\n $request->validate(\n [\n \"name\" => \"required\",\n \"address\" => \"required\",\n \"hours_opened\" => \"required\",\n \"hasICU\" => \"required | boolean\",\n \"hasVentilator\" => \"required | boolean\",\n \"hasEmergency\" => \"required | boolean\",\n ],\n [\n 'hasICU.required' => 'the hasICU field is required',\n ]\n );\n\n $isUserAdmin = auth()->user()->isAdmin;\n\n if ($isUserAdmin) {\n\n //create hospital\n $hospital = new Hospital();\n\n $hospital->name = $request->name;\n $hospital->address = $request->address;\n $hospital->hours_opened = $request->hours_opened;\n $hospital->hasICU = $request->hasICU;\n $hospital->hasVentilator = $request->hasVentilator;\n $hospital->hasEmergency = $request->hasEmergency;\n\n $hospital->save();\n\n //send response\n return response()->json([\n \"status\" => 1,\n \"message\" => \"Hospital added succesfully!\"\n ]);\n } else {\n\n return response()->json([\n \"status\" => 0,\n \"message\" => \"Only Admins are allowed to do this operation!\"\n ], 401);\n }\n }", "function modificarHorasPiloto(){\n\t\t$this->procedimiento='oip.ft_horas_piloto_ime';\n\t\t$this->transaccion='OIP_HOPILO_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_horas_piloto','id_horas_piloto','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('gestion','gestion','int4');\n\t\t$this->setParametro('mes','mes','int4');\n\t\t$this->setParametro('ci','ci','varchar');\n\t\t$this->setParametro('id_funcionario','id_funcionario','int4');\n\t\t$this->setParametro('tipo_flota','tipo_flota','varchar');\n\t\t$this->setParametro('horas_vuelo','horas_vuelo','int4');\n\t\t$this->setParametro('horas_simulador_full','horas_simulador_full','int4');\n\t\t$this->setParametro('horas_simulador_fix','horas_simulador_fix','int4');\n\t\t$this->setParametro('estado','estado','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function patientInformationStepseventeenAction() {\n\t\t\t\n\t\t\t$request = $this->getRequest();\n\t\t\t$options = $request->getPost();\t\n\t\t\t$usersNs = new Zend_Session_Namespace(\"members\");\n\t\t\t$family_medical_history = new Application_Model_FamilyMedicalHistory();\n\t\t\t$family_medical_history = $family_medical_history->fetchRow(\"patient_id='{$usersNs->userId}'\");\n\t\t\t$this->view->family_medical_history=$family_medical_history;\n\t\t\t\t\t\n\t\t\n\t\t\t\n\t\tif($request->isPost()) {\t\t\t\n\t\t\t$authNamespace = new zend_Session_Namespace('sixteen');\n\t\t\t$authNamespace->pHistorySixteen=$options;\n\n\t\t if($family_medical_history)\n\t\t\t\t\t{\n\t\t\t\t\t\t$ids=$family_medical_history->id;\n\t\t\t\t\t\t$idArray = explode(',', $ids);\n\t\t\t\t\t\t$model = new Application_Model_FamilyMedicalHistory();\n\t\t\t\t\t\t\tforeach ($idArray as $id) {\n\t\t\t\t\t\t\t$object = $model->fetchRow(\"id={$id}\");\n\t\t\t\t\t\t\tif($object){\t\t\t\t\t\n\t\t\t\t\t\t\t$object->setTestedChickenPox($options['Chicken_Pox']);\n\t\t\t\t\t\t\t$object->setTestedTuberculosis($options['Tuberculosis']);\n\t\t\t\t\t\t\t$object->setTestedHiv($options['HIV']);\n\t\t\t\t\t\t\t$object->setTestedHepatitis($options['Hepatitis']);\n\t\t\t\t\t\t\t$object->setTestedVenereal($options['Venereal']);\n\t\t\t\t\t\t\t$object->setType($options['type']);\n\t\t\t\t\t\t\t$object->setSpecify($options['Specify']);\n\t\t\t\t\t\t\t$object->save();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\n\t\t\t}\n\t }", "public function horario_ciclo_actual_alumno()\n {\n $codigo = $_COOKIE[$this->services->get_fuzzy_name(\"Codigo\")];\n $this->services->set_cookie(\"Codigo\",$codigo, time() + (1800), \"/\");\n $tagdata = $this->EE->TMPL->tagdata;\n $modalidad_survey = ee()->TMPL->fetch_param('modalidad_survey');\n $enable_survey = trim(ee()->TMPL->fetch_param('habilitar_survey'));\n $url_base_survey = trim(ee()->TMPL->fetch_param('url_base')); \n $id_survey = trim(ee()->TMPL->fetch_param('id_survey')); \n if($modalidad_survey !== $this->get_modalidad_alumno()){\n return;\n }\n ee()->db->select('*');\n ee()->db->where('codigo',$codigo);\n $query_modelo_result = ee()->db->get('exp_user_upc_data');\n\n foreach($query_modelo_result->result() as $row){\n $token = $row->token;\n }\n \n $url = 'Horario/?CodAlumno='.$codigo.'&Token='.$token;\n\n $site_url = ee()->config->item('site_url');\n\n $result=$this->services->curl_url($url);\n $json = json_decode($result, true);\n \n $error = $json['CodError'];\n $error_mensaje = $json['MsgError']; \n // traer data de encuestas \n $quiz_enabled = false;\n $quiz_horarios = null;\n $codlinea = $_COOKIE[$this->services->get_fuzzy_name(\"CodLinea\")];\n $codmodal = $_COOKIE[$this->services->get_fuzzy_name(\"CodModal\")];\n $periodo = $_COOKIE[$this->services->get_fuzzy_name(\"Ciclo\")];\n $quiz_service = ee()->config->item('quiz_services_url');\n $quiz_services_url = $quiz_service;\n $quiz_services_url .= $codlinea;\n $quiz_services_url .= '/'.$codmodal;\n $quiz_services_url .= '/'.$periodo;\n\n if($codigo[0] == 'U' || $codigo[0] =='u'){\n $quiz_services_url .= '/'.substr($codigo,1);\n }else{\n $quiz_services_url .= '/'.$codigo;\n }\n $day = date('w');\n $week_start = date('Y-m-d', strtotime('-'.$day.' days'));\n $week_end = date('Y-m-d', strtotime('+'.(6-$day).' days'));\n $quiz_services_url .= '/'.$week_start.'T00:00:00Z';\n $quiz_services_url .= '/'.$week_end.'T00:00:00Z';\n $quiz_enabled = false;\n $quiz_result = $this->services->curl_full_url($quiz_services_url, ee()->config->item('quiz_user'), ee()->config->item('quiz_pwd'));\n $quiz_json = json_decode($quiz_result, true);\n if($quiz_json['DTOHeader']['CodigoRetorno'] == 'Correcto')\n {\n $quiz_enabled = true;\n $quiz_horarios = $quiz_json['ListaDTOHorarioAlumno'];\n }\n // END : traer data de encuestas \n //limpio la variable para reutilizarla\n $result = '';\n $horario_empty;\n if(strlen($enable_survey) !== 0 && $quiz_enabled == true){\n $horario_empty = $this->_get_subtag_data('horario_survey',$tagdata);\n }else{\n $horario_empty = $this->_get_subtag_data('horario',$tagdata);\n }\n \n //genera el tamano del array\n $tamano = count($json['HorarioDia']); \n \n for ($i=0; $i<$tamano; $i++) \n {\n $horario = $horario_empty;\n $week_day = '';\n if ($json['HorarioDia'][$i]['CodDia'] == 1) {\n $week_day = 'Lunes';\n }\n if ($json['HorarioDia'][$i]['CodDia'] == 2) {\n $week_day = 'Martes';\n }\n if ($json['HorarioDia'][$i]['CodDia'] == 3) {\n $week_day = 'Miércoles';\n }\n if ($json['HorarioDia'][$i]['CodDia'] == 4) {\n $week_day = 'Jueves';\n } \n if ($json['HorarioDia'][$i]['CodDia'] == 5) {\n $week_day = 'Viernes';\n }\n if ($json['HorarioDia'][$i]['CodDia'] == 6) {\n $week_day = 'Sábado';\n }\n\n $horario = $this->_replace_subtag_data('week_day', $horario, $week_day); \n\n //genera el tamano del array\n $tamano_int = count($json['HorarioDia'][$i]['Clases']); \n $clases = '';\n $horario_dia_empty = $this->_get_subtag_data('horario_dia', $horario);\n\n for ($b=0; $b<$tamano_int; $b++) {\n\n $horario_dia = $horario_dia_empty;\n $HoraInicio = substr($json['HorarioDia'][$i]['Clases'][$b]['HoraInicio'], 0, 2);\n $HoraInicio = ltrim($HoraInicio,'0');\n $horario_dia = $this->_replace_subtag_data('hora_inicio', $horario_dia, $HoraInicio.':00');\n $HoraFin = substr($json['HorarioDia'][$i]['Clases'][$b]['HoraFin'], 0, 2);\n $HoraFin = ltrim($HoraFin,'0');\n $horario_dia = $this->_replace_subtag_data('hora_fin', $horario_dia, $HoraFin.':00');\n \n $horario_dia = $this->_replace_subtag_data('curso_nombre', $horario_dia, $json['HorarioDia'][$i]['Clases'][$b]['CursoNombre']);\n $horario_dia = $this->_replace_subtag_data('clase_sede', $horario_dia, $json['HorarioDia'][$i]['Clases'][$b]['Sede']);\n $horario_dia = $this->_replace_subtag_data('curso_seccion', $horario_dia, $json['HorarioDia'][$i]['Clases'][$b]['Seccion']);\n $horario_dia = $this->_replace_subtag_data('clase_salon', $horario_dia, $json['HorarioDia'][$i]['Clases'][$b]['Salon']); \n\n\n if(strlen($enable_survey) !== 0 && $quiz_enabled == true){\n for($q = 0 ; $q<count($quiz_horarios); $q++){\n \n if($json['HorarioDia'][$i]['CodDia'] == date('N', strtotime($quiz_horarios[$q]['SesionFECHA_SESION'])) && $quiz_horarios[$q]['SesionCOD_CURSO'] == $json['HorarioDia'][$i]['Clases'][$b]['CodCurso'] && $quiz_horarios[$q]['SesionSECCION'] == $json['HorarioDia'][$i]['Clases'][$b]['Seccion']){\n $date = new DateTime(date(\"Y-m-d H:i:s\"), new DateTimeZone('America/Lima'));\n $strDate = $date->format('YmdH');\n\n $class_date = $json['HorarioDia'][$i]['Clases'][$b]['Fecha'].$HoraInicio;\n $class_end_date = $json['HorarioDia'][$i]['Clases'][$b]['Fecha'].$HoraFin;\n if(intval($strDate) >= intval($class_date) && intval($strDate) <= intval($class_end_date))\n // if(true)\n {\n \n $horario_dia = $this->_replace_subtag_data('survey_is_active', $horario_dia, 'active');\n $horario_dia = $this->_replace_subtag_data('survey_image_icon', $horario_dia, $site_url.'assets/img/btn-encuesta-ingresar.jpg');\n $codclase = (string)$json['HorarioDia'][$i]['Clases'][$b]['CodClase'];\n $codcurso = (string)$json['HorarioDia'][$i]['Clases'][$b]['CodCurso'];\n $grupo = (string)$quiz_horarios[$q][\"SesionGRUPO\"];\n $coddocente = (string)$quiz_horarios[$q][\"DocenteSeccionCOD_DOCENTE\"];\n \n $quiz_gen = $url_base_survey;\n $quiz_gen .='?'.'c_un='.$codlinea;\n $quiz_gen .= \"&c_modalidad=\".$codmodal;\n $quiz_gen .= \"&c_direccion=\".'CU';\n $quiz_gen .= \"&c_periodo=\".$periodo;\n $quiz_gen .= \"&c_curso=\".$codcurso;\n $quiz_gen .= \"&seccion=\".$quiz_horarios[$q]['SesionSECCION'];\n $quiz_gen .= \"&grupo=\".$quiz_horarios[$q][\"SesionGRUPO\"];\n $quiz_gen .= '&aula='.$quiz_horarios[$q][\"SesionCOD_AULA\"];\n $quiz_gen .= '&c_profesor='.$coddocente;\n $quiz_gen .= '&c_sede='. $quiz_horarios[$q][\"AlumnoCOD_SEDE\"];\n $quiz_gen .= '&c_alumno='.$codigo;\n $horario_dia = $this->_replace_subtag_data('survey_url_generated', $horario_dia, $quiz_gen);\n\n }\n else\n {\n $horario_dia = $this->_replace_subtag_data('survey_is_active', $horario_dia, 'inactive');\n $horario_dia = $this->_replace_subtag_data('survey_image_icon', $horario_dia, $site_url.'assets/img/btn-encuesta-no-disponible.jpg');\n $horario_dia = $this->_replace_subtag_data('survey_url_generated', $horario_dia, '#');\n }\n }\n \n }\n\n }\n $clases .= $horario_dia;\n } \n\n $horario = $this->_replace_pair_subtag_data('horario_dia', $horario, $clases);\n\n $result .= $horario; \n }\n\n //Control de errores\n $error_result = $this->error_eval($error);\n if ($error_result === '1') \n {\n $result = '';\n $result .= '<div>';\n $result .= '<div class=\"panel-body mb-35\">';\n $result .= '<div class=\"panel-table red-line\">';\n $result .= '<ul class=\"tr mis-cursos-row\">';\n $result .= '<li class=\"col-sm-2 col-xs-12\">';\n $result .= '<img src=\"{site_url}assets/img/brain.png\" class=\"img-center\">';\n $result .= '</li>'; \n $result .= '<li class=\"col-sm-10 col-xs-12\">';\n $result .= '<span class=\"block zizou-bold-18\">Tiempo de Innovar</span>';\n if (strpos($error_mensaje,\"Ud. no tiene clases programadas para esta semana.\") !== false) {\n $result .= '<span class=\"helvetica-16\">No tienes ningún curso</span>';\n } else {\n $result .= '<span class=\"helvetica-16\">'.$error_mensaje.'</span>';\n }\n $result .= '</li>'; \n $result .= '</ul>'; \n $result .= '</div>';\n $result .= '</div>'; \n $result .= '</div>'; \n }elseif ($error_result != '0') {\n $site_url = ee()->config->item('site_url');\n $this->EE->functions->redirect($site_url.\"general/session-expired\");\n return;\n }\n \n return $result; \n }", "public function viewHospital(Hospital $hospital){\n return view('admin.single_hospital')->with('hospital', $hospital);\n }", "public function patient()\n {\n //\n }", "public function patientInformationSteptwelveAction(){\n\t\t\t\t\t\n\t\t\t\t\t$request = $this->getRequest();\n\t\t\t\t\t$options = $request->getPost();\n\t\t\t\t\t$usersNs = new Zend_Session_Namespace(\"members\");\n\t\t\t\t\t$allergic_subtances = new Application_Model_AllergicSubstances();\n\t\t\t\t\t$allergic_subtances = $allergic_subtances->fetchRow(\"patient_id='{$usersNs->userId}'\");\n\t\t\t\t\t$this->view->allergic_subtances=$allergic_subtances;\n\t\t\t\t\t\n\t\t\t\tif ($request->isPost()) {\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$authNamespace = new Zend_Session_Namespace('ten');\n\t\t\t\t\t$authNamespace->pHistoryTen=$options;\n\t\t\t\t\t foreach($options['Condition'] as $Condition)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($Condition){\n\t\t\t\t\t\t\t\t\t$RCondition.=$Condition.',';\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\tforeach($options['Year'] as $Year)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($Year){\n\t\t\t\t\t\t\t\t\t$RYear.=$Year.',';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tforeach($options['Where_Treated'] as $Where_Treated)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($Where_Treated){\n\t\t\t\t\t\t\t\t\t$RWhere_Treated.=$Where_Treated.',';\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\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \tif($allergic_subtances){\n\t\t\t\t\t\t\t$ids=$allergic_subtances->id;\n\t\t\t\t\t\t\t$idArray = explode(',', $ids);\n\t\t\t\t\t\t\t\t$model = new Application_Model_AllergicSubstances();\n\t\t\t\t\t\t\t\t\tforeach ($idArray as $id) {\n\t\t\t\t\t\t\t\t\t$object = $model->fetchRow(\"id={$id}\");\n\t\t\t\t\t\t\t\t\tif($object){\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$object->setMajorIllness($options['surgeries']);\n\t\t\t\t\t\t\t\t\t$object->setIllnessCondition($RCondition);\n\t\t\t\t\t\t\t\t\t$object->setIllnessYear($RYear);\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$object->setIllnessWhereTreated($RWhere_Treated);\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$object->save();\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}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}" ]
[ "0.6396858", "0.6269476", "0.62424123", "0.59611565", "0.5936679", "0.58507615", "0.5824684", "0.5710715", "0.5628165", "0.55738807", "0.5533911", "0.55198544", "0.55191004", "0.55115485", "0.55009425", "0.5490728", "0.54619235", "0.5455441", "0.5448665", "0.5426375", "0.5405038", "0.5394927", "0.5394927", "0.5382673", "0.537262", "0.53388", "0.53237945", "0.5322655", "0.53214383", "0.5321138" ]
0.7127746
0
Annule une hospitalisation en cours
public function cancelHospitalisation() { // Recupere la position du batiment a annuler $position = $this->_route->get('position'); // Recupere le personnage en session $personnage = Session::get('personnage'); // Recuperation de la langue $language = Locale::getLanguage(); // Annulation de l'hospitalisation en cours $this->_service->cancelHospitalisationForPersonnage($position, $personnage, $language); // Gestion des erreurs if ($this->_service->getValidator()->hasErrors()) { // Log foreach ($this->_service->getValidator()->getErrors() as $error) { $this->_logger->notice($error, array('user' => Session::get('user'))); } } // Mise a jour de la map en session $map = Session::get('map'); $map->setDomaineAndRefresh($personnage->getDomaine()); Session::set('map', $map); // Mise à jour du personnage en session Session::set("personnage", $personnage); // Récupération du bandeau pour refresh $content['bandeau'] = $this->createZone('bandeauPersonnage')->execute()->render(); // Recupere la case de la position donnee $case = $map->getCaseByPosition($position); // Recupere le batiment de la case $batiment = $case->getBatiment(); $caseBatiment = new stdClass(); $caseBatiment->x = $case->getX(); $caseBatiment->y = $case->getY(); $caseBatiment->image = $this->getApp()->getAppConfiguration()->getWebroot().'/images/domaine/map/' . $batiment->getImage(); $content['caseBatiment'] = $caseBatiment; return $this->json($content); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function afficher() {\n if(date(\"H\") < 18) { //s'il est plus tôt que 18h\n $retour = \"Bonjour, je m'appelle \" . $this->prenom . \" \" . $this->nom .\",\n je viens de \" . $this->ville . \" et j'ai \" . $this->age . \" ans. </br>\";\n }\n else {\n $retour = \"Bonsoir, je m'appelle \" . $this->prenom . \" \" . $this->nom .\",\n je viens de \" . $this->ville . \" et j'ai \" . $this->age . \" ans. </br>\";\n }\n echo $retour;\n }", "public function corteCaja()\n {\n //----------------Estimar totales de venta del dia ---------------\n date_default_timezone_set('America/mexico_city'); \n $hora_real=date(\"H:i:s\");\n\n $hrs = \"14\";\n $min = \"00\";\n $hora_base = date(\"H:i:s\",mktime($hrs,$min,0));\n\n if($hora_real>$hora_base){ //si pasa de las 4 pm\n $hoy = date('Y-m-d');\n $d=date('d', strtotime($hoy));\n $m=date('m', strtotime($hoy));\n $y=date('Y', strtotime($hoy));\n $dia = date(\"Y-m-d H:i:s\",mktime($hrs,$min,0,$m,$d,$y));\n }\n else{\n $hoy = date('Y-m-d');\n $ayer = strtotime ('-1 day' , strtotime($hoy)) ;\n $ayer = date ('Y-m-d', $ayer);\n $d=date('d', strtotime($ayer));\n $m=date('m', strtotime($ayer));\n $y=date('Y', strtotime($ayer));\n $dia = date(\"Y-m-d H:i:s\",mktime($hrs,$min,0,$m,$d,$y));\n }\n $this->conectar();\n $cerrar=1;\n $sql = \"SELECT * FROM venta WHERE Fecha_Apertura>'\".$dia.\"'\";\n $result = $this->con->query($sql);\n if ($result->num_rows > 0) {\n while($row = $result->fetch_assoc()) {\n $this->subtotal+=$row['Total_Cierre'];\n if($row['Estado']==\"Cortesia\"){\n $this->cortesias+=$row['Total_Cierre'];\n }\n $this->total=$this->subtotal-$this->cortesias;\n if($row['Fecha_Cierre']==NULL){$cerrar=0;}\n }\n }\n if($cerrar>0){\n //----------------Registrar totales de venta del dia ---------------\n $sql = \"UPDATE corte SET Subtotal='\".$this->subtotal.\"', Cortesias='\".$this->cortesias.\"', Total='\".$this->total.\"' WHERE Fecha>'\".$dia.\"'\";\n\n $result = $this->con->query($sql);\n if($this->con->affected_rows){\n echo \"Se registró corte\";\n }\n }\n else{\n echo \"Cuentas pendientes, cerrar antes de realizar corte\";\n }\n $this->con->close();\n }", "public function llegadaSugeridaPersonalNoche(){\n if($this->horaCierre=='00:00:00')\n return '00:00:00';\n else{\n if($this->idCliente==4){\n // en CID, el equipo debe llegar 00:30hrs antes del cierre del local\n return date('H:i:s', strtotime($this->horaCierre)-1800); // 3600 = 30min * 60seg\n }else{\n // en los otros clientes, el equipo debe llegar 01:00hrs antes\n return date('H:i:s', strtotime($this->horaCierre)-3600); // 3600 = 60min * 60seg\n }\n }\n }", "public function economia_institucional_nacional(){\n $suma_grupo_partida=$this->model_certificacion->suma_grupo_partida_programado_institucional(4,10000); /// Partidas por defecto\n $monto_grupo_partida=0;\n if(count($suma_grupo_partida)!=0){\n $monto_grupo_partida=$suma_grupo_partida[0]['suma_partida'];\n }\n\n $suma_ppto_certificado=$this->model_certificacion->suma_monto_certificado_institucional(4); //// Presupuesto Certificado\n $monto_ppto_certificado=0;\n if(count($suma_ppto_certificado)!=0){\n $monto_ppto_certificado=$suma_ppto_certificado[0]['ppto_certificado'];\n }\n\n $suma_ppto_asignado=$this->model_evalinstitucional->monto_total_programado_trimestre_institucional(4); //// Presupuesto Asignado POA\n $monto_ppto_asignado=0;\n if(count($suma_ppto_asignado)!=0){\n $monto_ppto_asignado=$suma_ppto_asignado[0]['ppto_programado'];\n }\n\n $datos[1]=$monto_grupo_partida+$monto_ppto_certificado; /// Total Certificado\n $datos[2]=$monto_ppto_asignado; /// Total Asignado\n $datos[3]=0; /// % Eficiencia\n if($datos[2]!=0){\n $datos[3]=round((($datos[1]/$datos[2])*100),2);\n }\n\n return $datos;\n }", "public function getDateAnniversaire() {\n return $this->dateAnniversaire;\n }", "public function getCaStatAnnuel() {\n return $this->caStatAnnuel;\n }", "public function hospitalisation() {\r\n // Recupere la position du batiment\r\n $position = $this->_route->get('position');\r\n\r\n // Recupere le personnage en session\r\n $personnage = Session::get('personnage');\r\n\r\n // Recuperation de la langue\r\n $language = Locale::getLanguage();\r\n\r\n // Hospitalisation du personnage\r\n $this->_service->hospitalisation($position, $personnage);\r\n\r\n // Gestion des erreurs\r\n if ($this->_service->getValidator()->hasErrors()) {\r\n\r\n // Log\r\n foreach ($this->_service->getValidator()->getErrors() as $error) {\r\n $this->_logger->notice($error, array('user' => Session::get('user')));\r\n }\r\n\r\n // Feedback utilisateur\r\n $flash = Flash::getInstance();\r\n $flash->addErrorList($this->_service->getValidator()->getErrors());\r\n\r\n // Construction de la reponse\r\n $content['feedback'] = $this->_feedbackUtils->createFeedbackFromFlash($flash);\r\n\r\n // Le flash ne doit donc pas etre affiche\r\n $flash->remove();\r\n\r\n // Reponse JSON\r\n return $this->json($content);\r\n }\r\n\r\n // Mise a jour du domaine en session\r\n $map = Session::get('map');\r\n $map->setDomaineAndRefresh($personnage->getDomaine());\r\n Session::set('map', $map);\r\n\r\n // Mise à jour du personnage en session\r\n Session::set(\"personnage\", $personnage);\r\n\r\n // Récupération du bandeau pour refresh\r\n $content['bandeau'] = $this->createZone('bandeauPersonnage')->execute()->render();\r\n\r\n // Recupere la case de la position concernee\r\n $case = $map->getCaseByPosition($position);\r\n\r\n // Recupere le batiment de la case\r\n $batiment = $case->getBatiment();\r\n\r\n $returnHospitalisation = new stdClass();\r\n $returnHospitalisation->dureeRestante = $batiment->getDureeHospitalisation();\r\n $returnHospitalisation->position = $batiment->getPosition();\r\n\r\n $content['hospitalisation'] = $returnHospitalisation;\r\n\r\n return $this->json($content);\r\n }", "function calcular_hd_en_aula_seleccionada (){\n $anio_lectivo=date('Y', strtotime($this->s__fecha_consulta));\n //Configuramos el dia de consulta para que este disponible en la funcion procesar_periodo.\n $this->s__dia_consulta=$this->obtener_dia(date('N', strtotime($this->s__fecha_consulta)));\n \n //Obtenemos los periodos que pueden contener a la fecha de solicitud.\n $periodo=$this->dep('datos')->tabla('periodo')->get_periodo_calendario($this->s__fecha_consulta, $anio_lectivo, $this->s__id_sede);\n //Usamos la cadena 'au' para extraer las asignaciones pertenecientes a un aula en particular. \n //Es una condicion mas dentro de la funcion procesar_periodo.\n $asignaciones=$this->procesar_periodo($periodo, 'au');\n \n //Creamos una estructura para el aula seleccionada. Esto se debe a que la funcion calcular_horarios_\n //disponibles de la clase HorariosDisponibes recibe un arreglo de aulas_ua, cuyo formato es\n //(id_aula, aula). Si no usamos esta estructura array ( array() ), vemos una disponibilidad total\n //que no esta asociada a ningun aula, esto ultimo no debe ocurrir.\n $aulas_ua=array(\n array(\n 'id_aula' => $this->s__datos_solcitud['id_aula'],\n 'aula' => $this->s__datos_solcitud['aula']\n )\n );\n \n //Guardamos en sesion el id_sede para agregar la capacidad de cada aula a un horario disponible.\n toba::memoria()->set_dato_instancia(0, $this->s__id_sede);\n \n $hd=new HorariosDisponibles();\n //El primer parametro se corresponde con las aulas que actualmente estan siendo usadas. Como \n //necesitamos hacer un calculo de hd especifico, usamos el aula seleccionada. Estas aulas se obtienen\n //a partir de las asignaciones y se utilzan para que el sistema pueda inferir disponibilidad total.\n \n $this->s__horarios_disponibles=$hd->calcular_horarios_disponibles($aulas_ua, $aulas_ua, $asignaciones);\n \n return $this->existe_espacio_disponible();\n }", "public function refreshEtatHospitalisation() {\r\n // Recupere la position donnee\r\n $position = $this->_route->get('position');\r\n\r\n // Recuperation du personnage en session\r\n $personnage = Session::get('personnage');\r\n\r\n // Tentative de mise a jour de l'etat d'hospitalisation\r\n $this->_service->updateEtatHospitalisation($position, $personnage);\r\n\r\n // Gestion des erreurs\r\n if ($this->_service->getValidator()->hasErrors()) {\r\n // Log\r\n foreach ($this->_service->getValidator()->getErrors() as $error) {\r\n $this->_logger->notice($error, array('user' => Session::get('user')));\r\n }\r\n }\r\n\r\n // Mise a jour de la map en session\r\n $map = Session::get('map');\r\n $map->setDomaineAndRefresh($personnage->getDomaine());\r\n Session::set('map', $map);\r\n\r\n // Mise à jour du personnage en session\r\n Session::set(\"personnage\", $personnage);\r\n\r\n // Recupere le batiment de la position indiquee\r\n $batiment = $personnage->getDomaine()->getBatimentAtPosition($position);\r\n\r\n // Récupération du bandeau pour refresh\r\n $content['bandeau'] = $this->createZone('bandeauPersonnage')->execute()->render();\r\n\r\n // Recupere la case du batiment a la position donnee\r\n $caseBatiment = $map->getCaseByPosition($batiment->getPosition());\r\n\r\n // Case du batiment\r\n $returnCaseBatiment = new stdClass();\r\n $returnCaseBatiment->x = $caseBatiment->getX();\r\n $returnCaseBatiment->y = $caseBatiment->getY();\r\n $returnCaseBatiment->image = $this->getApp()->getAppConfiguration()->getWebroot().'/images/domaine/map/' . $batiment->getStatefulImage();\r\n\r\n $content['caseBatiment'] = $returnCaseBatiment;\r\n\r\n return $this->json($content);\r\n }", "public function getAttendance();", "public function officeattendancetimeAction(){\n\t\tlist($officeAdapter, $officeSql) = $this->createOfficeAdapter();\n\n\t\t$dbAdapter = $this->getServiceLocator()->get('dbAdapter');\n\t\t$dbSql = $this->getServiceLocator()->get('dbSql');\n\n\t\t// lấy ra danh sách check máy chấm công bên offiec\n\t\t// lấy dánh sách employeeId dựa trên employeeCode\n\t\t// insert vào bảng employee bên minh\n\n\n\t}", "function formataHora($hrEntrada, $mnEntrada) {\n $hrSaida;\n $mnSaida;\n\n switch ($hrEntrada) {\n case \"0\": $hrSaida = \"00\";\n break;\n case \"1\": $hrSaida = \"01\";\n break;\n case \"2\": $hrSaida = \"02\";\n break;\n case \"3\": $hrSaida = \"03\";\n break;\n case \"4\": $hrSaida = \"04\";\n break;\n case \"5\": $hrSaida = \"05\";\n break;\n case \"6\": $hrSaida = \"06\";\n break;\n case \"7\": $hrSaida = \"07\";\n break;\n case \"8\": $hrSaida = \"08\";\n break;\n case \"9\": $hrSaida = \"09\";\n break;\n case \"10\": $hrSaida = \"10\";\n break;\n case \"11\": $hrSaida = \"11\";\n break;\n case \"12\": $hrSaida = \"12\";\n break;\n case \"13\": $hrSaida = \"13\";\n break;\n case \"14\": $hrSaida = \"14\";\n break;\n case \"15\": $hrSaida = \"15\";\n break;\n case \"16\": $hrSaida = \"16\";\n break;\n case \"17\": $hrSaida = \"17\";\n break;\n case \"18\": $hrSaida = \"18\";\n break;\n case \"19\": $hrSaida = \"19\";\n break;\n case \"20\": $hrSaida = \"20\";\n break;\n case \"21\": $hrSaida = \"21\";\n break;\n case \"22\": $hrSaida = \"22\";\n break;\n case \"23\": $hrSaida = \"23\";\n break;\n }\n\n switch ($mnEntrada) {\n case \"00\": $mnSaida = \":00:00\";\n break;\n case \"10\": $mnSaida = \":10:00\";\n break;\n case \"15\": $mnSaida = \":15:00\";\n break;\n case \"20\": $mnSaida = \":20:00\";\n break;\n case \"25\": $mnSaida = \":25:00\";\n break;\n case \"30\": $mnSaida = \":30:00\";\n break;\n case \"35\": $mnSaida = \":35:00\";\n break;\n case \"40\": $mnSaida = \":40:00\";\n break;\n case \"45\": $mnSaida = \":45:00\";\n break;\n case \"50\": $mnSaida = \":50:00\";\n break;\n case \"55\": $mnSaida = \":55:00\";\n break;\n case \"59\": $mnSaida = \":59:59\";\n break;\n }\n\n\n return $hrSaida . $mnSaida;\n }", "public function llegadaSugeridaPersonalDia(){\n if($this->horaApertura=='00:00:00')\n return '00:00:00';\n else{\n if($this->idCliente==4){\n // en CID, el equipo debe llegar 01:00hrs antes de la apertura del local (junto con el lider)\n return date('H:i:s', strtotime($this->horaApertura)-3600); // 3600 = 60min * 60seg\n }else{\n // en los otros clientes, el equipo debe llegar 01:00hrs antes\n return date('H:i:s', strtotime($this->horaApertura)-5400); // 5400 = 90min * 60seg\n }\n }\n }", "public function imprimeCaracteristicas()\n\t{\n\t\techo \"<br />--------------------------------\\n\";\n\t\techo \"<br />Pelicula en VHS:\\n\";\n\t\t//ejecutamos la funciona \"imprimeCaracteristicas()\" de la clase\n\t\t// extendida \"soporte\"\n\t\tparent::imprimeCaracteristicas();\n\t\techo \"<br />Duracion: \".$this->duracion.\"\\n\";\n\t\techo \"<br />--------------------------------\\n\";\n\t}", "function showCalendar($periode) {\r\n $leCalendrier = \"\";\r\n // Tableau des valeurs possibles pour un numéro \r\n //de jour dans la semaine\r\n $tableau = Array(\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"0\");\r\n\r\n $nb_jour = Date(\"t\", mktime(0, 0, 0, getMonth($periode), \r\n 1, getYear($periode)));\r\n $pas = 0;\r\n $indexe = 1;\r\n\r\n \r\n\r\n \r\n // Tant que l'on n'a pas affecté tous les jours du mois traité\r\n\twhile ($pas < $nb_jour) {\r\n\t\t$a=\"\";\r\n\t$malade=$_SESSION[\"malade\"];\r\n $a2= Date(\"Y-m-d\", mktime(0, 0, 0, getMonth($periode),\r\n 1 + $pas, getYear($periode)));\r\n\t\t $con=mysqli_connect(\"localhost\",\"root\",\"\",\"hopital\");\r\n\t\t $req=mysqli_query($con,\"select * from rendezvous where idMalade='${malade}'and rendezVous='${a2}' \");\r\n\t\t $res=mysqli_fetch_array($req);\r\n\t\t $a=$res[\"rendezVous\"];\r\n if ($indexe == 1) $leCalendrier .= \r\n \"\\n\\t<ul class=\\\"days\\\">\";\r\n\r\n // Si le jour calendrier == jour de la semaine en cours\r\n if (Date(\"w\", mktime(0, 0, 0, getMonth($periode), \r\n 1 + $pas, getYear($periode))) == $tableau[$indexe]) {\r\n // Si jour calendrier == aujourd'hui\r\n $afficheJour = Date(\"j\", mktime(0, 0, 0, \r\n getMonth($periode), 1 + $pas, getYear($periode)));\r\n\t\t \r\n if (Date(\"Y-m-d\", mktime(0, 0, 0, getMonth($periode),\r\n 1 + $pas, getYear($periode))) == Date(\"Y-m-d\")) {\r\n $class = \" class=\\\"itemCurrentItem\\\"\";\r\n\t\t\t\t\r\n\r\n }\r\n else {\r\n // 1 est toujours vrai => on affiche \r\n //un lien à chaque fois\r\n // A vous de faire les tests \r\n //nécessaire si vous gérer un agenda par exemple\r\n\t\t\t\tif (Date(\"Y-m-d\", mktime(0, 0, 0, getMonth($periode),\r\n 1 + $pas, getYear($periode))) == Date($a)) {\r\n\t\t\t \r\n $class = \" class=\\\"fas\\\"\";\r\n\t\t $afficheJour =\"&#xf0f0;\";\r\n\r\n\r\n\t\t }\r\n else {\r\n $class = \" class=\\\"itemExistingItem\\\"\";\r\n $afficheJour = Date(\"j\",\r\n mktime(0, 0, 0, getMonth($periode), 1 + \r\n $pas, getYear($periode)));\r\n\r\n }\r\n \r\n }\r\n // Ajout de la case avec la date\r\n $leCalendrier .= \"\\n\\t\\t<li$class>\r\n $afficheJour</li>\";\r\n $pas++;\r\n }\r\n //\r\n else {\r\n\r\n // Ajout d'une case vide\r\n $leCalendrier .= \"\\n\\t\\t<li>&nbsp;</li>\";\r\n }\r\n if ($indexe == 7 && $pas < $nb_jour) \r\n { $leCalendrier \r\n .= \"\\n\\t</ul>\"; $indexe = 1;} else {$indexe++;}\r\n }\r\n\r\n // Ajustement du tableau\r\n for ($i = $indexe; $i <= 7; $i++) {\r\n $leCalendrier .= \"\\n\\t\\t<li>&nbsp;</li>\";\r\n }\r\n $leCalendrier .= \"\\n\\t</ul>\\n\";\r\n\r\n // Retour de la chaine contenant le Calendrier\r\n return $leCalendrier;\r\n\r\n }", "private function hitungUmur()\n {\n // atribut ada tandanya $this\n $hasil = date('Y') - ($this->tahunlahir); //$hasil bukan atribut, krn masuk di lokal\n return $hasil;\n }", "public function calificacionesPendientes(){\n //enviar mail a propietario y arrendatario informando\n }", "function actualizarAsistencia(){\n\t\t\t\t if($this->_biometrico->getBiometrico()[ count($this->_biometrico->getBiometrico())-1 ][ 'fecha' ] != date('d-m-Y') || $this->_biometrico->getBiometrico()==null){\t\t\t\t\n\t\t\t\t \t\n\t\t\t\t \t//$this->imprimirArreglo($this->_biometrico->getBiometrico()[count($this->_biometrico->getBiometrico())-1]['fecha']);\n\t\t\t\t\t\t$this->guardarHorarioDiario();\n\t\t\t\t\t\t$this->guardarHorarioFinal();\n\t\t\t\t\t\t$horario = $this->_biometrico->getBiometrico();\n\t\t\t\t\t\t$personas = $this->_personas->getPersonal();\n\t\t\t\t\t\t$fecha = $horario[0]['fecha'];\t\t\t\n\t\t\t\t\t\t$aux=array();\n\t\t\t\t\t\t$k=0;\n\n\t\t\t\t\t\tfor($i=0; $i<count($horario); $i++){\n\t\t\t\t\t\t\tfor($j=0; $j<count($personas); $j++){\n\t\t\t\t\t\t\t\t\tif($personas[$j]['cedula']==$horario[$i]['cedula']){\n\t\t\t\t\t\t\t\t\t\t$aux[$k] = $j;\n\t\t\t\t\t\t\t\t\t\t$k++;\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}\n\n\t\t\t\t\t\tfor($i=0; $i<count($aux);$i++){\t\t\t\t\n\t\t\t\t\t\t\tunset($personas[$aux[$i]]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor($j=0; $j<count(array_keys($personas)); $j++){\t\t\t\t\t\n\t\t\t\t\t\t\t$this->_biometrico->insertInasistencia($personas[array_keys($personas)[$j]]['id_persona_empleada'],$fecha);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->_view->redirect('biometrico/index');\n\t\t\t\t}else{\n\t\t\t\t\t\t$this->_view->redirect('biometrico/index');\n\t\t\t\t}\n\n\t\t}", "public function horaCierreF(){\n $carbon = Carbon::parse($this->horaCierre);\n $minutes = $carbon->minute < 10? \"0$carbon->minute\" : $carbon->minute;\n return \"$carbon->hour:$minutes hrs.\";\n }", "function cree_calendrier($mois,$annee,$joursTravail,$dateIndisp)\n {\n $joursSemaine = array('Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi');\n // recupere le 1 er jour de mois\n $premierJourMois = mktime(0,0,0,$mois,1,$annee);\n // nombre de jours dans mois \n $nombreJour = date('t',$premierJourMois);\n // qlq info sur 1jr de mois\n $dateInfo = getdate($premierJourMois);\n // le nom de ce mois actuelle et le formater en francais\n $Mois = $dateInfo['month'];\n $nomMois = utf8_encode(strftime(\"%B\",strtotime(\"$Mois\")));\n \n // returne index 0-6 de 1pr jr du ce mois \n $jourSemaine = $dateInfo['wday'];\n\n // date actuelle\n $dateAct = date('Y-m-d-l');\n \n\n \n \n \n\n // mois et annee précédent\n $mois_prec = date('m',mktime(0,0,0,$mois-1,1,$annee)); \n $annee_prec = date('Y',mktime(0,0,0,$mois-1,1,$annee));\n // mois suivant\n $mois_suiv = date('m',mktime(0,0,0,$mois+1,1,$annee)); \n $annee_suiv = date('Y',mktime(0,0,0,$mois+1,1,$annee));\n \n \n \n // table \n $calendrier =\"<table>\";\n $calendrier.=\"<div class='calendar-row'>\";\n $calendrier.=\"<div class='date-col' ><h2>$nomMois $annee </h2> </div>\";\n $calendrier.= \"<div class='btn-col' ><a class='btn-mois' href='?mois=\".$mois_prec.\"&annee=\".$annee_prec.\"'><i class='fas fa-chevron-left'></i>Précédent</a>\";\n $calendrier.= \"<a class='btn-mois' href='?mois=\".date('m').\"&annee=\".date('Y').\"'> Mois actuel </a>\";\n $calendrier.= \"<a class='btn-mois' href='?mois=\".$mois_suiv.\"&annee=\".$annee_suiv.\"'> Suivant<i class='fas fa-chevron-right'></i></a></div>\";\n $calendrier.=\"</div>\";\n $calendrier.=\"<tr>\";\n\n // calendrier header\n foreach( (array)$joursSemaine as $jour)\n {\n $calendrier.=\"<th> <span class='jour'>$jour</span></th>\";\n }\n\n $calendrier.=\"</tr><tr>\";\n\n // jours de semaine va avoir 7 colonnes \n if($jourSemaine > 0)\n {\n for($j=0;$j<$jourSemaine;$j++)\n {\n $calendrier.=\"<td class='empty'></td>\";\n }\n }\n\n // initialisatin compteur jours // variable jour actuelle \n $jourAct = 1;\n // nombre des mois \n $mois = str_pad($mois,2,\"0\",STR_PAD_LEFT);\n \n while($jourAct <= $nombreJour)\n {\n\n // si 7 colounes atteinte lancer une nouvelle row \n if($jourSemaine == 7)\n {\n $jourSemaine = 0;\n $calendrier.=\"</tr><tr>\";\n }\n\n $jourActRef = str_pad($jourAct,2,\"0\",STR_PAD_LEFT);\n\n $date =\"$annee-$mois-$jourActRef\";\n\n // date('l') L minuscule\n $nomJour = strtolower(date('l',strtotime($date)));\n // les non de semaine en francais avec ucword() met la 1 lettre en MAJ\n $nomjourfr = ucwords(strftime(\"%A\",strtotime(\"$nomJour\")));\n\n $evenNum =0;\n $today = $date == date('Y-m-d').\" ? 'today' : \";\n // si la date est deja passe alors N/A sinon réservée ou reserve\n if($date < date('Y-m-d') OR in_array($date,$dateIndisp))\n {\n $calendrier.=\"<td class='N-A'><span class='numjour'>$jourAct</span><a class='indisponible'>Indisponible</a>\";\n }\n else if(in_array($nomjourfr,$joursTravail) )\n {\n \n $calendrier.=\"<td class='$today'><span class='numjour'>$jourAct</span><a href='reserve.php?date=\".$date.\"&jour=\".$nomjourfr.\"' class='btn-reserve'>Disponible</a>\";\n } \n else \n {\n $calendrier.=\"<td class='N-A'><span class='numjour'>$jourAct</span><a class='indisponible'>Indisponible</a>\";\n }\n \n\n $calendrier.=\" </td>\";\n\n //incrementer compteur\n $jourAct++;\n $jourSemaine++;\n } \n \n\n\n // completer le row de la semaine derniere de mois si nécessaire\n if($jourSemaine != 7)\n {\n $jourRestant = 7-$jourSemaine;\n for($i=0;$i<$jourRestant;$i++)\n {\n $calendrier.=\"<td class='empty'></td>\";\n } \n }\n\n $calendrier.=\"</tr>\";\n $calendrier.=\"</table>\";\n\n \n \n return $calendrier; \n \n\n\n }", "public static function statistique(){\n \t$stats = new Statistique();\n \t// Vérification si un utilisateur de la même adresse IP a visité la même page\n \t// Si non - ajout dans la base de données\n\t if($stats->populate(['ip' => $_SERVER['REMOTE_ADDR'], 'page_courante' => $_SERVER[\"REQUEST_URI\"]]) === false){\n\t $stats->setId();\n\t $stats->setIp();\n\t $stats->setPageCourante();\n\t $stats->setDateCourante();\n\t $stats->setNavigateur();\n\t $stats->save();\n\t }else{\n\t \t// Si oui - vérifier si la visite date de plus de 1h\n\t \t// Si oui - ajout dans la base de données\n\t $stats = $stats->getallBy(['ip' => $_SERVER['REMOTE_ADDR'], 'page_courante' => $_SERVER[\"REQUEST_URI\"]]);\n\t $stats = end($stats);\n\t $date = new DateTime($stats['date_courante']);\n\t $datenow = new DateTime();\n\t if($date->diff($datenow)->format('%h') > 0){\n\t $stats = new Statistique();\n\t $stats->setId();\n\t $stats->setIp();\n\t $stats->setPageCourante();\n\t $stats->setDateCourante();\n\t $stats->setNavigateur();\n\t $stats->save();\n\t }\n\t }\n }", "function calcula_idade($data_nascimento, $data_calcula){\r\n \r\n //conversão das datas para o formato de tempo linux\r\n $data_nascimento = strtotime($data_nascimento.\" 00:00:00\");\r\n $data_calcula = strtotime($data_calcula.\" 00:00:00\");\r\n \r\n //cálculo da idade fazendo a diferença entre as duas datas\r\n $idade = floor(abs($data_calcula-$data_nascimento)/60/60/24/365);\r\n \r\n return($idade);\r\n}", "function calculo($inicio, $fin, $bultos) {\n\tglobal $hoy;\n\tif ($fin == '0000-00-00') {\n\t\t$dias = round ( (strtotime ( $hoy ) - strtotime ( $inicio )) / (24 * 60 * 60), 0 );\n\t\t$total = $bultos * $dias * importeAlmacen ();\n\t\t$total = 'En Almacen';\n\t} else {\n\t\t$dias = round ( (strtotime ( $fin ) - strtotime ( $inicio )) / (24 * 60 * 60), 0 );\n\t\t$total = $bultos * $dias * importeAlmacen ();\n\t\t$total = round ( $total, 2 );\n\t\t$total = $total . \"&euro;\";\n\t}\n\treturn $total;\n}", "function verificar_existencia_de_espacio (){\n \n $anio_lectivo=date('Y', strtotime($this->s__fecha_consulta));\n $this->s__dia_consulta=$this->obtener_dia(date('N', strtotime($this->s__fecha_consulta)));\n //Debemos usar la fecha seleccionada por el usuario. Necesitamos brindar una respuesta concreta\n //segun los espacios ocupados en ese dia.\n $periodo=$this->dep('datos')->tabla('periodo')->get_periodo_calendario(date('Y-m-d', strtotime($this->s__fecha_consulta)), $anio_lectivo, $this->s__id_sede);\n \n //Obtenemos las aulas del establecimiento.\n $aulas_ua=$this->dep('datos')->tabla('aula')->get_aulas_por_sede($this->s__id_sede);\n \n //Obtenemos las asignaciones para la fecha solicitada. En este caso necesitamos traer las \n //asignaciones para todas las aulas del establecimiento.\n $asignaciones=$this->procesar_periodo($periodo, 'hd');\n \n //Obtenemos todas las aulas que actualmente estan siendo usadas. \n $aulas=$this->obtener_aulas($asignaciones);\n \n //Guardamos el id_sede en sesion, para utilizar dentro de la clase HorariosDisponibles en la \n //operacion agregar_capacidad.\n toba::memoria()->set_dato_instancia(0, $this->s__id_sede);\n \n $horarios_disponibles=new HorariosDisponibles();\n \n $this->s__horarios_disponibles=$horarios_disponibles->calcular_horarios_disponibles($aulas, $aulas_ua, $asignaciones);\n \n //Obtenemos los horarios que coinciden con el requerimiento registrado.\n $horarios=$this->calcular_horarios_disponibles_segun_req();\n \n //Si existe al menos 1 horario libre que coincide con el requerimiento, lo mostramos en el \n //cuadro_espacio_ocupado :D, -_-\n if(count($horarios) > 0){\n $this->s__horarios_libres=$horarios; //contiene los horarios que conciden con el requerimiento\n }else{\n toba::notificacion()->agregar(\"No existen horarios disponibles alternativos\", 'info');\n return ;\n }\n \n }", "function reportar_tiempo()\r\n\t{\r\n\t\t\r\n\t\t$this->ver_sesion_m->no_clientes();\r\n\t\t\r\n\t\t$this->load->model('pedidos/hoja_tiempo_consumo_m', 'consumo');\r\n\t\t$reportar = $this->consumo->reportar_venta();\r\n\t\t\r\n\t\tif($reportar != '')\r\n\t\t{\r\n\t\t\theader(\"location: /pedidos/hoja_tiempo_consumo/index/$reportar\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\theader(\"location: /pedidos/hoja_tiempo_consumo/\");\r\n\t\t}\r\n\t\t\r\n\t}", "function Calcularedad($nacimiento) {\n list($ano, $mes, $dia) = explode(\"-\", $nacimiento);\n $anodif = date(\"Y\") - $ano;\n $mesdif = date(\"m\") - $mes;\n $diadif = date(\"d\") - $dia;\n\n if (($diadif < 0) or ($mesdif < 0)) {\n $anodif = $anodif - 1;\n }\n\n if ($nacimiento == '') { $anodif = ''; }\n\n return $anodif;\n\n}", "public function contaDia()\n\t{\n\t\t$this->diasUteis = 0;\n\t\t\t// cal_days_in_month = (CALENDARIO, MES, ANO);\n\t\t$this->totalDiasMes = cal_days_in_month(CAL_GREGORIAN, $this->mes, $this->ano);\n\t\t\t// Pega todos os dias do mes e ano digitados\n\n\t\t\t// Pega somente os dias uteis (Seg. a Sex.)\n\t\tfor ($this->dia = 1; $this->dia <= $this->totalDiasMes; $this->dia++) {\n\t\t\t$timeStamp = mktime(0, 0, 0, $this->mes, $this->dia, $this->ano);\n\t\t\t$this->diaSemana = date('N', $timeStamp);\n\t\t\tif ($this->diaSemana < 6) $this->diasUteis++;\n\t\t}\n\t\treturn $this->diasUteis;\n\t}", "public function getStatusAtt(){\n $id = session()->get('nik');\n \n $query = $this->db->query(\"SELECT id_attendance, YEARWEEK(clock_in) AS tahun_minggu,SUM(nik=$id) AS jumlah FROM log_attendance WHERE YEARWEEK(clock_in)=YEARWEEK(NOW() ) GROUP BY YEARWEEK(clock_in) \");\n //return $query->getResult();\n\n if($query){\n foreach($query->getResult() as $data){\n $dataAttendance[] = $data;\n }\n if(!empty($dataAttendance)){\n return $dataAttendance;\n } return false;\n \n }\n }", "function horario_propiedad($id_propiedad,$fecha_visita,$id_vendedor,$id_cliente) {\n\tglobal $mysqli;\n\t$options = '';\n\t$horas = array(); $horas_ocupadas = array();\n\t\n\t$horas = MostrarIntervalo(array('hora'=>9,'min'=>'00'), array('hora'=>18,'min'=>'00'), 30);\n\t\n\t//Consulta de horarios de la propiedad\n\t$sql = \"SELECT TIME_FORMAT(hora_in, '%H:%i') AS hora_in, TIME_FORMAT(hora_out, '%H:%i') AS hora_out FROM agenda_visitas\n\t\t\tWHERE id_propiedad=\".$id_propiedad.\" AND fecha_visita='\".$fecha_visita.\"'\";\n\t$result = $mysqli->query($sql) or die('Error: '.$mysqli->error);\n\twhile ($row = $result->fetch_assoc()) {\n\t\t$horas_ocupadas[] = $row['hora_in'];\n\t\t$horas_ocupadas[] = $row['hora_out'];\n\t}\n\t//Consulta de horarios del vendedor\n\tif ( !empty($id_vendedor) ) {\n\t\t$sql = \"SELECT TIME_FORMAT(hora_in, '%H:%i') AS hora_in, TIME_FORMAT(hora_out, '%H:%i') AS hora_out FROM agenda_visitas\n\t\t\t\tWHERE id_vendedor=\".$id_vendedor.\" AND fecha_visita='\".$fecha_visita.\"'\";\n\t\t$result = $mysqli->query($sql) or die('Error: '.$mysqli->error);\n\t\twhile ($row = $result->fetch_assoc()) {\n\t\t\t$horas_ocupadas[] = $row['hora_in'];\n\t\t\t$horas_ocupadas[] = $row['hora_out'];\n\t\t}\n\t}\n\t//Consulta de horarios del cliente\n\tif ( !empty($id_cliente) ) {\n\t\t$sql = \"SELECT TIME_FORMAT(hora_in, '%H:%i') AS hora_in, TIME_FORMAT(hora_out, '%H:%i') AS hora_out FROM agenda_visitas\n\t\t\t\tWHERE id_cliente=\".$id_cliente.\" AND fecha_visita='\".$fecha_visita.\"'\";\n\t\t$result = $mysqli->query($sql) or die('Error: '.$mysqli->error);\n\t\twhile ($row = $result->fetch_assoc()) {\n\t\t\t$horas_ocupadas[] = $row['hora_in'];\n\t\t\t$horas_ocupadas[] = $row['hora_out'];\n\t\t}\n\t}\n\t$horas_ocupadas = array_unique($horas_ocupadas); //Elimina valores duplicados de un array\n\t//$horas_ocupadas = array_values(array_unique($horas_ocupadas)); //Elimina valores duplicados de un array y ordena los indices secuencialmente\n\t\n\tif ( !empty($horas_ocupadas) ) {\n\t\tforeach ($horas as $key => $hora) {\n\t\t\tif ( !in_array($hora, $horas_ocupadas) ) {\n\t\t\t\t$options .= '<option value=\"'.$hora.'\">'.$hora.'</option>';\n\t\t\t} else {\n\t\t\t\t$options .= '<option value=\"'.$hora.'\" disabled=\"disabled\">'.$hora.'</option>';\n\t\t\t}\n\t\t}\n\t} else {\n\t\tforeach ($horas as $key => $hora) {\n\t\t\t$options .= '<option value=\"'.$hora.'\">'.$hora.'</option>';\n\t\t}\n\t}\n\t\n\treturn '<select name=\"horarios[]\" id=\"horario-'.$id_propiedad.'\" class=\"horarios\">\n\t\t\t<option value=\"\">00:00</option>'.$options.'\n\t\t\t</select>';\n}", "function vene($hora){\n\t$hora_original = $hora;\n\t$huso_original = new DateTimeZone('America/Los_Angeles');\n\t\n\t$horas = new DateTime($hora_original, $huso_original);\n\t$huso_local = new DateTimeZone('America/Caracas');\n\t$horas->setTimeZone($huso_local);\n\t\n\t$hora_nueva24 = $horas->format('H:i');\n\t\n\t$hora_nueva12 = date(\"g:i a\", strtotime($hora_nueva24));\n\t\n\treturn $hora_nueva12;\n}" ]
[ "0.586002", "0.5705005", "0.5615164", "0.5492729", "0.5452644", "0.54142463", "0.5398233", "0.53918356", "0.5349564", "0.5317832", "0.52885455", "0.5250989", "0.524858", "0.5243222", "0.52359354", "0.5218969", "0.519428", "0.51878035", "0.5184975", "0.5183319", "0.51756924", "0.5171436", "0.5128687", "0.5128575", "0.5098474", "0.50782907", "0.5078064", "0.5066138", "0.50597733", "0.5057079" ]
0.5722235
1
creates an array of POs that need to be acknowledged
public function listPOsToAcknowledge() { $orders_result= $this->ListReleasedOrders(); $po_array = array(); // get total number of results $total_reults = $orders_result['list']['meta']['totalCount']; if($total_reults){ // start at root of order array tree $orders_result = $orders_result['list']['elements']; if($total_reults <'2'){ $po_array[] = $orders_result['order']['purchaseOrderId']; }else{ foreach($orders_result['order'] AS $order) { $po_array[] = $order['purchaseOrderId']; } } } // return result return $po_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listPOsToShip()\n {\n\n $orders_result= $this->ListOrders('&status=Acknowledged');\n //print_r($orders_result);\n\n $po_array = array();\n // get total number of results\n $total_reults = $orders_result['list']['meta']['totalCount'];\n\n if($total_reults){\n // start at root of order array tree\n $orders_result = $orders_result['list']['elements'];\n\n if($total_reults <'2'){\n $po_array[] = $orders_result['order']['purchaseOrderId'];\n }else{\n foreach($orders_result['order'] AS $order) {\n $po_array[] = $order['purchaseOrderId'];\n }\n }\n }\n // return result\n return $po_array;\n\n }", "private function pushOrders()\n {\n return [];\n }", "private function reservePendingOrders()\n { \n // 1\n $pending_order_products = \\App\\Models\\OrderProduct::with('order')->pending()->get()\n ->sortByDesc(function($pending_order_product){\n return $pending_order_product->order->created;\n });\n\n $order_reservations = collect([]);\n\n foreach ($pending_order_products as $pending_order_product) {\n $order_reservations->push(Order::reserveProduct($pending_order_product));\n }\n\n return $order_reservations;\n }", "function makePO()\n{\n global $auth, $PurchaseOrder, $itemID, $apiToken, $apiServer;\n\n echo \"<h1>MAKEPO</h1>\";\n\n // get current time for PO DateOfPurchase\n $currentTime = $auth->GetServerUTCTime();\n\n // prams for PO\n // need to get all item parameters make functions\n $createParameters = array(\n 'fkSupplierId' => '5d1f3893-dad8-4653-befc-a982d21c07b4', // test supplier\n 'fkLocationId' => '00000000-0000-0000-0000-000000000000', //default location\n 'ExternalInvoiceNumber' => 'sample string 3',\n 'Currency' => 'GBP',\n 'SupplierReferenceNumber' => 'sample string 9',\n 'DateOfPurchase' => $currentTime,\n 'QuotedDeliveryDate' => '2018-01-24T15:47:17.0730815Z',\n 'PostagePaid' => 3.0,\n 'ShippingTaxRate' => 4.0,\n 'ConversionRate' => 5.0\n );\n\n // create PO, returns PO id\n $po = $PurchaseOrder->Create_PurchaseOrder_Initial($createParameters,$apiToken, $apiServer);\n echo \"po: \"; echo \"<pre>\"; print_r($po); echo \"</pre>\";\n\n // Prams for item\n // need to get all item parameters make functions??\n // min qty, pack size to make valid order??\n $addItemParameter = array(\n \"pkPurchaseId\" => $po,\n \"fkStockItemId\" => $itemID,\n \"Qty\" => 10,\n \"PackQuantity\" => 1,\n \"PackSize\" => 1,\n \"Cost\" => 1.0,\n \"TaxRate\" => 0.0\n );\n\n // add item to PO\n $addItem = $PurchaseOrder->Add_PurchaseOrderItem($addItemParameter,$apiToken, $apiServer);\n echo \"additem: \"; echo \"<pre>\"; print_r($addItem); echo \"</pre>\";\n\n // prams for PO status change\n $changeStatusParameter = array(\n \"pkPurchaseId\" => $po,\n \"status\" => OPEN\n );\n\n // set PO to open once all items have been added\n // this will update item count and remove it from low stock\n $poOpen = $PurchaseOrder->Change_PurchaseOrderStatus($changeStatusParameter,$apiToken, $apiServer);\n echo \"statusPO: \"; echo \"<pre>\"; print_r($poOpen); echo \"</pre>\";\n\n}", "public function getPending(): array;", "public function get_all_approval_repair_items() {\n $result = db_select('repair_orders', 'r')\n ->fields('r')\n ->condition('approved', 'FALSE')\n ->condition('completed', 'FALSE')\n ->orderBy('timestamp','DESC')\n ->execute();\n\n $order_arr = array();\n\n while($order = $result->fetchAssoc()) {\n $order_arr[] = $order;\n }\n return $order_arr;\n }", "function getNewOrder_ws() {\n\t$array = array();\n\t$db = new dbConn;\n\t$array = $db->getNewOrder();\n\t\n\treturn $array;\n}", "protected function _purchases() {\n\t MongoCursor::$timeout = -1;\n\t\t$this->log('Generating Purchase Orders');\n\t\t$orderCollection = Order::collection();\n\t\t$event_count = count($this->poEvents);\n\t\t$ecount = 0;\n\t\tforeach ($this->poEvents as $eventId) {\n\t\t\t$purchaseHeading = ProcessedOrder::$_purchaseHeading;\n\t\t\t$total = array('sum' => 0, 'quantity' => 0);\n\t\t\t$event = Event::find('first', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'_id' => $eventId\n\t\t\t)));\n\t\t\t$eventItems = $this->_getOrderItems($eventId);\n\t\t\t$vendorName = preg_replace('/[^(\\x20-\\x7F)]*/','', substr(String::asciiClean($event->name), 0, 3));\n\t\t\t$time = date('ymdis', $event->_id->getTimestamp());\n\t\t\t$poNumber = 'TOT'.'-'.$vendorName.$time;\n\t\t\t$filename = 'TOTitpo'.$vendorName.$time.'.csv';\n\t\t\t$handle = $this->tmp.$filename;\n\t\t\t$this->log(\"Opening PO file $handle\");\n\t\t\t$fp = fopen($handle, 'w');\n\t\t\t$this->summary['purchase_orders'][] = $filename;\n\t\t\t\n\t\t\t$purchaseOrder = array();\n\t\t\t$inc = 0;\n\t\t\tforeach ($eventItems as $eventItem) {\n\t\t\t\tforeach ($eventItem['details'] as $key => $value) {\n\t\t\t\t\t$this->log(\"{$eventItem['_id']} size {$key} value {$value}\");\n\t\t\t\t\t$orders = $orderCollection->find( array(\n\t\t\t\t\t\t'items.item_id' => (string) $eventItem['_id'],\n\t\t\t\t\t\t'items.size' => (string) $key,\n\t\t\t\t\t\t'items.status' => array('$ne' => 'Order Canceled'),\n\t\t\t\t\t\t'cancel' => array('$ne' => true))\n\t\t\t\t\t);\n\t\t\t\t\tif ($orders) {\n\t\t\t\t\t\tforeach ($orders as $order) {\n\t\t\t\t\t\t\t$items = $order['items'];\n\t\t\t\t\t\t\t$date_created = $order['date_created'];\n\t\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\t\t$active = (empty($item['cancel']) || $item['cancel'] != true) ? true : false;\n\t\t\t\t\t\t\t\t$itemValid = ($item['item_id'] == $eventItem['_id']) ? true : false;\n\t\t\t\t\t\t\t\tif ($itemValid && ((string) $key == $item['size']) && $active){\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Supplier'] = $eventItem['vendor'];\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['PO # / RMA #'] = $poNumber;\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['SKU'] = $eventItem['sku_details'][$item['size']];\n\t\t\t\t\t\t\t\t\tif (empty($eventItem['sku_details'][$item['size']])) {\n\t\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['SKU'] = Item::getUniqueSku($eventItem['vendor'], $eventItem['vendor_style'], (string)$item['size'], $item['color']);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (empty($purchaseOrder[$inc]['Qty'])) {\n\t\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Qty'] = $item['quantity'];\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Qty'] += $item['quantity'];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t//new additions\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Vendor Style'] = $eventItem['vendor_style'];\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Vendor Name'] = $vendorName;\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Item Color'] = $item['color'];\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Item Size'] = $item['size'];\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Item Description'] = $eventItem['description'];\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Order Creation Date'] = date(\"m/d/Y\", str_replace(\"0.00000000 \", \"\", $order['date_created']));\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Promised Ship-by Date'] = date(\"m/d/Y\", str_replace(\"0.00000000 \", \"\", $order['ship_date']));\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Event Name'] = $event->name;\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Event End Date'] = date(\"m/d/Y\", str_replace(\"0.00000000 \", \"\", $event->end_date));\n\n\n\t\t\t\t\t\t\t$purchaseOrder[$inc]['WhsInsValue (Cost)'] = number_format($eventItem['sale_whol'], 2);\n\t\t\t\t\t\t\t$purchaseOrder[$inc]['Description for Customs'] = (!empty($eventItem['category']) ? $eventItem['category'] : \"\");\n\t\t\t\t\t\t\t$purchaseOrder[$inc]['ShipInsValue'] = number_format($eventItem['orig_whol'], 2);\n\t\t\t\t\t\t\t$purchaseOrder[$inc]['Ref1'] = $eventItem['_id'];\n\t\t\t\t\t\t\t$purchaseOrder[$inc]['Ref2'] = $key;\n\t\t\t\t\t\t\t$purchaseOrder[$inc]['Ref3'] = $eventItem['color'];\n\n\n\t\t\t\t\t\t\tif ((int) $eventItem['product_weight'] > 0) {\n\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['UOM1_Weight'] = number_format($eventItem['product_weight'],2);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc] = $this->sortArrayByArray($purchaseOrder[$inc], $purchaseHeading);\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 (!empty($purchaseOrder[$inc])) {\n\t\t\t\t\t\t\tfputcsv($fp, array_merge($purchaseHeading, $purchaseOrder[$inc]));\n\t\t\t\t\t\t\tif ($this->test != 'true') {\n\t\t\t\t\t\t\t\t$po = PurchaseOrder::create();\n\t\t\t\t\t\t\t\t$po->save(array_merge($purchaseHeading, $purchaseOrder[$inc]) + $this->batchId);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t++$inc;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t++$ecount;\n\t\t\tif ($event_count != 0) {\n $this->queue->percent = (float)number_format((($ecount/$event_count) * 100), 2);\n $this->queue->save();\n }\n\t\t\tfclose($fp);\n\t\t\trename($handle, $this->pending.$filename);\n\t\t}\n\t}", "function getCollection( array $raw ) {\n \n $shipBrokerCountCollection = array();\n foreach($raw as $row) {\n array_push($shipBrokerCountCollection, $this->doCreateObject($row));\n }\n \n return $shipBrokerCountCollection;\n }", "public function getOrders(){\n $orders = Models\\Checkout::where('status','2' );\t\t\t\t\t\t \n\t\t\t\t\t\t \n\n\t\t$orders = (object) array(\n\t\t\t'orders' => $orders,\n\t\t);\n\n\t\treturn $orders;\n\t\t\t\n }", "public function batch_generate()\n {\n return $this->getService()->generateInvoicesForExpiringOrders();\n }", "function WinnubCart(){\n \n $prodotti=array();\n \n \n return $prodotti;\n}", "public function notifications()\n {\n $bookings = \\App\\Reservations::where('is_seen', '0')->where('date_start', '>=', date('Y-m-d'))->orderBy('created_at', 'desc')->get();\n $arrivals = \\App\\Reservations::whereBetween('date_start', [date('Y-m-d'),date('Y-m-d',strtotime(\"+1 month\"))])\n ->orderBy('date_start', 'asc')\n ->get();\n $transactions = \\App\\Transactions::where('date_paid', '<=', date('Y-m-d H:i:s'))->orderBy('date_paid', 'desc')->orderBy('date_due', 'desc')->get();\n return $array = (object) array(\n 'bookings' => $bookings,\n 'arrivals' => $arrivals,\n 'transactions' => $transactions\n );\n }", "public function cronJobXeroInvoiceApiSender(){\n\t\t$orders = Mage::getModel(\"sales/order\")->getCollection()->addFieldToFilter('xero_status','0');\n\t\tif(count($orders) > 0 ){\n\t\t\tforeach ($orders as $order){\n\t\t\t\t$data = json_decode($order->getXeroData(), True);\n\t\t\t\t$data['admin'] = 1 ;\n\t\t\t\t$data['redirect'] = 0;\n\t\t\t\t// print_r($data);exit();\n\t\t\t\tMage::helper('xeroapi/data')->sendSalesInvoiceWithSplitOrderToXero($data);\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\n\t\t\n\t}", "public function ObtprecioActivos()\n\t{\n\t\t$sql = \"SELECT * FROM precio WHERE estatus = 1\";\n\t\t$resp = $this->db->consulta($sql);\n\t\t$cont = $this->db->num_rows($resp);\n\n\n\n\t\t$array=array();\n\t\t$contador=0;\n\n\t\tif ($cont>0) {\n\n\t\t\t\n\t\t\twhile ($objeto=$this->db->fetch_object($resp)) {\n\n\t\t\t\t$array[$contador]=$objeto;\n\t\t\t\t$contador++;\n\t\t\t} \n\t\t}\n\t\treturn $array;\n\t}", "public function get_all_open_repair_items() {\n $result = db_select('repair_orders', 'r')\n ->fields('r')\n ->condition('approved', 'Approved')\n ->condition('completed', 'FALSE')\n ->orderBy('timestamp','DESC')\n ->execute();\n\n $open_repairs = array();\n\n while($order = $result->fetchAssoc()) {\n $open_repairs[] = $order;\n }\n return $open_repairs;\n }", "function initialInvoicesListForSync()\n\t{\n\t\t$sql=\"select * from `invoice_group` where `status`!='3' and `moved_to_xero`='1' order by `date` DESC limit 50\";\n\t\t$query=$this->db->query($sql);\n\t\t$invoices=$query->result_array();\n\t\treturn $invoices;\n\t}", "function make_booking_request_printable($request)\n{\n $out = array();\n\n foreach ($request as $_part) {\n $start = mktime(0, 0, 0, $_part['start_month'], $_part['start_day'], $_part['start_year']);\n $end = mktime(0, 0, 0, $_part['end_month'], $_part['end_day'], $_part['end_year']);\n\n $bookable_row = $GLOBALS['SITE_DB']->query_select('bookable', array('*'), array('id' => $_part['bookable_id']), '', 1);\n\n $part = array(\n 'BOOKABLE_TITLE' => get_translated_tempcode('bookable', $bookable_row[0], 'title'),\n 'PRICE' => float_format($bookable_row[0]['price']),\n 'CATEGORISATION' => get_translated_text($bookable_row[0]['categorisation']),\n 'DESCRIPTION' => get_translated_tempcode('bookable', $bookable_row[0], 'description'),\n 'QUANTITY' => integer_format($_part['quantity']),\n '_QUANTITY' => strval($_part['quantity']),\n 'START' => get_timezoned_date($start, false, true, false, true),\n 'END' => ($start == $end) ? '' : get_timezoned_date($end, false, true, false, true),\n '_START' => strval($start),\n '_END' => strval($end),\n 'NOTES' => $_part['notes'],\n 'SUPPLEMENTS' => array(),\n );\n foreach ($_part['supplements'] as $supplement_id => $supplement) {\n $supplement_row = $GLOBALS['SITE_DB']->query_select('bookable_supplement', array('*'), array('id' => $supplement_id), '', 1);\n\n $part['SUPPLEMENTS'][] = array(\n 'SUPPLEMENT_TITLE' => get_translated_tempcode('bookable_supplement', $supplement_row[0], 'title'),\n 'SUPPLEMENT_PRICE' => float_format($supplement_row[0]['price']),\n 'SUPPLEMENT_PRICE_IS_PER_PERIOD' => $supplement_row[0]['price_is_per_period'] == 1,\n 'SUPPLEMENT_QUANTITY' => integer_format($supplement['quantity']),\n '_SUPPLEMENT_QUANTITY' => strval($supplement['quantity']),\n 'SUPPLEMENT_NOTES' => $supplement['notes'],\n );\n }\n\n $out[] = $part;\n }\n return $out;\n}", "static private function ReturnObjectsArray(PDOStatement $exchanges)\n {\n $exchanges = $exchanges->fetchAll(PDO::FETCH_ASSOC);\n $o = array();\n foreach ($exchanges as $exch) {\n $exchange = new Exchange($exch['exchange_id']);\n array_push($o, $exchange);\n }\n return $o;\n }", "public function getAllProcessingOrders (){\n $collecion = $this->salesOrderCollectionFactory->create();\n $collecion->addFieldToFilter(\n 'status', \n array('in' => array(SELF::ORDER_STATUS_PROCESSING,SELF::STATUS_PENDING,SELF::STATUS_INVOICED))\n );\n return $collecion;\n }", "private function pushConsignments()\n {\n }", "public function manage_pledge_queue()\n {\n $relation = array(\n \"fields\" => \"*\",\n \"conditions\" => \"is_confirmed = 'N' AND is_active = 'N'\",\n \"ORDER_BY\" => array(\n 'field' => 'crm_wants_to_donate_queue.pledge_date',\n 'order' => 'ASC'),\n );\n $wants_pledge_array = $this->WantsToDonateQueue_m->get_relation('', $relation, false);\n // echo \"<pre>\";\n // print_r($wants_pledge_array);\n $relation = array(\n \"fields\" => \"*\",\n \"conditions\" => \"is_deleted = 'N' AND is_confirmed = 'N' AND is_active='N'\",\n \"ORDER_BY\" => array(\n 'field' => 'crm_donetores_queue.created',\n 'order' => 'ASC'),\n );\n $donatores_pledge_array = $this->DonatoresQueue_m->get_relation('', $relation, false);\n // echo \"Donatores\";\n // echo \"<pre>\";\n // print_r($donatores_pledge_array);\n $count = 0;\n $loop_index = 1;\n $loop_count = floor(count($wants_pledge_array) / 2);\n $new_array = array();\n if (count($donatores_pledge_array) > 0)\n {\n if (count($wants_pledge_array) > 0)\n { \n for ($i=0; $i<count($donatores_pledge_array); $i++)\n {\n /*echo(\"donatores---\".$donatores_pledge_array[$i]['user_id']);\n echo \"<br>\";*/\n $wants_index = 0;\n $output = array();\n for ($j=0;$j<count($wants_pledge_array);$j++)\n {\n if ($wants_index < 2)\n {\n if (!in_array($j, $new_array))\n {\n if ($wants_pledge_array[$j]['user_id'] != $donatores_pledge_array[$i]['user_id'])\n {\n /* echo \"wants-----\".$wants_pledge_array[$j]['user_id'];*/\n array_push($new_array,$j);\n $wants_index++;\n array_push($output,$j);\n }\n }\n }\n else\n {\n break;\n }\n }\n if (count($output) == 2)\n {\n for ($k = 0; $k < 2; $k++)\n {\n $new_count = $output[$k];\n $pledge_log_array['investor_id'] = $donatores_pledge_array[$i]['user_id'];\n $pledge_log_array['borrower_id'] = $wants_pledge_array[$new_count]['user_id'];\n $pledge_log_array['start_date'] = date('Y:m:d H:i:s') ;\n $add_hours = time() + (1 * 24 * 60 * 60);\n $pledge_log_array['end_date'] = date('Y:m:d H:i:s',$add_hours);\n $pledge_log_array['wants_to_donate_id'] = $wants_pledge_array[$new_count]['id'];\n $pledge_log_array['donetores_queue_id'] = $donatores_pledge_array[$i]['id'];\n $this->PledgeLog_m->save($pledge_log_array);\n //update the status of donatores queue to is_active to 'Y'\n $query = \"UPDATE crm_donetores_queue set is_active ='Y' where id = \". $donatores_pledge_array[$i]['id'];\n $this->db->query($query);\n $query1 = \"UPDATE crm_wants_to_donate_queue set is_active ='Y' where id = \". $wants_pledge_array[$new_count]['id'];\n $this->db->query($query1);\n $this->notification_insertion_to($donatores_pledge_array[$i]['user_id'], $wants_pledge_array[$new_count]['user_id']); // to ma from nu user_id\n $this->notification_insertion_from($donatores_pledge_array[$i]['user_id'], $wants_pledge_array[$new_count]['user_id']); // from ma to nu \n }\n } \n }\n }\n }\n }", "public function System_GetPaidProducts()\n\t{\n\t\tdefined('cart_product_consolidation_app') or define('cart_product_consolidation_app', 1);\n\t\tdefined('cart_product_repayment_app') or define('cart_product_repayment_app', 2);\n\t\tdefined('cart_product_recertification_app') or define('cart_product_recertification_app', 4);\n\t\tdefined('cart_product_pslf_app') or define('cart_product_pslf_app', 8);\n\t\tdefined('cart_product_forebearance_app') or define('cart_product_forebearance_app', 16);\n\n\t\t$clientdetails = $this->GetClientFromSession(true);\n\n\t\t// get what they have previously ordered to prevent them from ordering it again\n\t\t$paid_products = array(\n\t\t\t'consolidation_app' => ($clientdetails->TProperties->products_already_purchased & cart_product_consolidation_app ? true : false),\n\t\t\t'repayment_app' => ($clientdetails->TProperties->products_already_purchased & cart_product_repayment_app ? true : false),\n\t\t\t'recertification_app' => ($clientdetails->TProperties->products_already_purchased & cart_product_recertification_app ? true : false),\n\t\t\t'pslf_app' => ($clientdetails->TProperties->products_already_purchased & cart_product_pslf_app ? true : false),\n\t\t\t'forebearance_app' => ($clientdetails->TProperties->products_already_purchased & cart_product_forebearance_app ? true : false),\n\t\t);\n\n\t\treturn $paid_products;\n\n\t}", "public function definition(): array\n {\n $status = OrderStatus::inRandomOrder()->first();\n $delivered = $status->name === 'delivered';\n $delivering = $status->name === 'delivering';\n\n return [\n 'description' => $this->faker->realText(50),\n 'coordinates' => rand(0, 100) . '.532071:' . rand(0, 100) . '.441036',\n 'price' => rand(1000, 20000),\n 'order_status_id' => $status->id,\n 'courier_id' => $delivered || $delivering ? OrderStatus::inRandomOrder()->first()->id : null,\n 'accepted_at' => $this->faker->dateTimeBetween('-1 month'),\n 'delivered_at' => $delivered ? $this->faker->dateTimeBetween('-1 week') : null,\n ];\n }", "public static function outstandingQuote($pool)\n {\n $manyQuote = ORM::for_table('sales_inte_online', 'ksi')->\n where('status', 0);\n $total = $manyQuote->count();\n\n $manyQuote2 = $manyQuote->limit(50)->order_by_asc('contactno')->order_by_asc('email')->order_by_asc('id')->find_many();\n\n $quoteOrmAr = [];\n foreach ($manyQuote2 as $quoteOrm) {\n $quoteOrmAr[] = new \\Ksi\\QuoteLayout($quoteOrm,$pool);\n }\n\n $numberListed = count($quoteOrmAr);\n\n return [$total,\n $quoteOrmAr,\n $numberListed,\n ];\n }", "public function new_order($data)\n {\n $orderpeople = is_array($data['ticketdetails']) ? $data['ticketdetails'] : null;\n $billing = is_array($data['billingdetails']) ? $data['billingdetails'] : null;\n $cart = is_array($data['cart']) ? $data['cart'] : null;\n $orderId = $this->generate_order_reference();\n $total = $data['total'];\n\n $attendees = array();\n\n foreach ($orderpeople as $person) {\n $person['orderID'] = $orderId;\n $pid = $this->add_person($person);\n array_push($attendees, $pid);\n }\n\n $order_details = array(\n 'name' => $billing['name'],\n 'surname' => $billing['surname'],\n 'company' => $billing['company'],\n 'address1' => $billing['address1'],\n 'address2' => $billing['address2'],\n 'town' => $billing['town'],\n 'postcode' => $billing['postcode'],\n 'country' => $billing['country'],\n 'number' => $billing['number'],\n 'email' => $billing['email'],\n 'vatno' => $billing['vatno'],\n 'orderID' => $orderId,\n 'invoiceid' => 'CF' . date('jmY', strtotime(\"now\")), // Add invoice incrementing function\n 'status' => 'UNPAID',\n 'total' => $total,\n 'totalvat' => $this->plugin->cart->get_total_vat($total),\n 'totalvat' => 0,\n 'currency' => 'GBP',\n 'cartitems' => serialize($cart),\n 'attendees' => implode(',', $attendees),\n /* 'currency' => $this->checkcurrencycode(),\n 'source' => home_url(),\n 'user_rawstring' => $user_environment['browser_name'],\n 'user_browser' => $user_environment['Browser'],\n 'user_device_type' => $user_environment['Device_Type'],\n 'user_os' => $user_environment['Platform'],\n 'user_browserversion' => $user_environment['Version'],\n 'user_ismobile' => $mobiledevice,\n 'user_isTablet' => $tabletdevice */\n );\n\n $post_arr = array(\n 'post_title' => 'Order: ' . $_SESSION['orderID'] . ' - ' . $billing['name'],\n 'post_content' => 'mmm',\n 'post_status' => 'publish',\n 'post_type' => 'conf_ticket_order',\n 'post_author' => get_current_user_id(),\n 'meta_input' => $order_details\n );\n\n $neworder = wp_insert_post($post_arr, true);\n\n if (is_wp_error($neworder)) {\n $errors = $neworder->get_error_messages();\n foreach ($errors as $error) {\n echo $error;\n }\n die();\n } else {\n $this->set_order_id($orderId);\n\n return $this->get_order_id();\n }\n }", "static function getNewStatusArray() {\n return [self::INCOMING];\n }", "public static function createForManyOrder($customerId,$orders)\n {\n $invoice = new Invoice();\n $invoice->invoiceNo = AutoNumber::generate(self::getNumberFormat());\n $invoice->invoiceDate = new Expression(\"NOW()\");\n $dueDate = new DateTime();\n $dueDate->add(new DateInterval('P14D'));\n\n $invoice->dueDate = $dueDate->format('Y/m/d h:i'); \n $invoice->totalAmount=0;\n $invoice->customerId = $customerId;\n //find all orders for this invoice\n /*$orders = BanquetOrder::find()\n ->where(['orderId' => $orderIds])\n ->all();\n */\n\n $transaction = Yii::$app->db->beginTransaction();\n\n\n try\n {\n $invoice->save();\n foreach ($orders as $order)\n {\n //find all order details\n $orderDetails = BanquetOrderDetail::find()\n ->where(['orderId' => $order->orderId])\n ->andWhere(['orderStatus' => BanquetOrder::ORDER_STATUS_COMPLETED])\n ->orderBy(['orderDateTime' => SORT_ASC])\n ->all();\n\n foreach ($orderDetails as $orderDetail)\n {\n $invoiceDetail = new InvoiceDetail();\n $invoiceDetail->invoiceId = $invoice->id;\n $invoiceDetail->invoiceNumber = $invoice->invoiceNo;\n $invoiceDetail->itemDescription = $order->orderPurpose;\n $invoiceDetail->orderDetailId = $orderDetail->id;\n $invoiceDetail->itemDescription2 = $orderDetail->getFormattedTimeString();\n $invoiceDetail->quantity = $orderDetail->paxCount;\n $invoiceDetail->unitPrice = $orderDetail->pricePerPax;\n $invoiceDetail->totalAmount = $invoiceDetail->quantity * $invoiceDetail->unitPrice ;\n $invoiceDetail->itemDate = $orderDetail->orderDateTime;\n $invoiceDetail->orderId = $order->orderId;\n $invoiceDetail->save();\n $invoice->totalAmount = $invoice->totalAmount + $invoiceDetail->totalAmount;\n $orderDetail->orderStatus = BanquetOrder::ORDER_STATUS_INVOICED;\n\n $orderDetail->save();\n\n\n }\n \n\n }\n //set order to invoiced status\n $order->orderStatus = BanquetOrder::ORDER_STATUS_INVOICED;\n $prder->invoiceNumber = $invoice->invoiceNo;\n $orderStatus = AppHelper::newOrderStatus($order->orderId,BanquetOrder::ORDER_STATUS_INVOICED);\n $orderStatus->save();\n $invoice->save();\n $transaction->commit();\n\n }catch (Exception $e)\n {\n Yii::error($e);\n $transaction->rollBack();\n return null;\n } \n\n return $invoice;\n\n }", "function ciniki_sapos_sapos_objectList($ciniki, $tnid) {\n\n $objects = array(\n //\n // this object should only be added to carts\n //\n 'ciniki.sapos.donationpackage' => array(\n 'name' => 'Donation Package',\n ),\n 'ciniki.sapos.cartdonation' => array(\n 'name' => 'Cart Donation',\n ),\n );\n\n return array('stat'=>'ok', 'objects'=>$objects);\n}", "private function prepTickets()\r\n {\r\n // 2) indicating what step the ticket is on to ease processing.\r\n foreach ($this->activeTicketSet as $ticket) {\r\n if (!isset($ticket['ReadyDate'])) {\r\n $ticket['ReadyDate'] = \"{$this->dateObject->format('Y-m-d')} {$ticket['pTime']}\";\r\n }\r\n $readyObj = new \\dateTime($ticket['ReadyDate']);\r\n if ($ticket['pTimeStamp'] === $this->tTest) {\r\n $ticket['locationTest'] =\r\n \"{$ticket['pClient']}{$ticket['pDepartment']}{$ticket['pAddress1']}{$readyObj->format('Y-m-dH:ia')}\";\r\n $ticket['step'] = 'pickedUp';\r\n } elseif ($ticket['pTimeStamp'] !== $this->tTest && $ticket['dTimeStamp'] === $this->tTest) {\r\n $dTimeArray = explode(':', $ticket['dTime']);\r\n $readyObj->setTime($dTimeArray[0], $dTimeArray[1], $dTimeArray[2]);\r\n if ($ticket['pTime'] > $ticket['dTime']) {\r\n $readyObj->modify('+ 1 day');\r\n }\r\n $ticket['locationTest'] =\r\n \"{$ticket['dClient']}{$ticket['dDepartment']}{$ticket['dAddress1']}{$readyObj->format('Y-m-dH:ia')}\";\r\n $ticket['step'] = 'delivered';\r\n } elseif ($ticket['pTimeStamp'] !== $this->tTest && $ticket['dTimeStamp'] !== $this->tTest) {\r\n // Non round trip tickets with dTimeStamp !== $tTest will not have been returned from the database.\r\n // No need to test the charge code.\r\n $d2TimeArray = explode(':', $ticket['d2Time']);\r\n $readyObj->setTime($d2TimeArray[0], $d2TimeArray[1], $d2TimeArray[2]);\r\n if ($ticket['dTime'] > $ticket['d2Time']) {\r\n $readyObj->modify('+ 1 day');\r\n }\r\n $ticket['locationTest'] =\r\n \"{$ticket['pClient']}{$ticket['pDepartment']}{$ticket['pAddress1']}{$readyObj->format('Y-m-dH:ia')}\";\r\n $ticket['step'] = 'returned';\r\n }\r\n self::sortTickets($ticket);\r\n }\r\n foreach ($this->ticketSet as $ticket) {\r\n if (!array_key_exists($ticket['locationTest'], $this->multiLocation)) {\r\n $this->singleLocation[] = $ticket;\r\n }\r\n }\r\n }" ]
[ "0.6281126", "0.56115055", "0.5595963", "0.54940736", "0.548016", "0.5402662", "0.5402304", "0.538901", "0.53066635", "0.5234944", "0.5209877", "0.5161053", "0.5147266", "0.5122976", "0.51070166", "0.50901115", "0.5076086", "0.5046384", "0.503802", "0.5028607", "0.5022306", "0.5016533", "0.50157", "0.49984637", "0.4975959", "0.49738386", "0.4972674", "0.49465185", "0.49390548", "0.49370825" ]
0.68994236
0
creates an array of POs that need to be shipped ()
public function listPOsToShip() { $orders_result= $this->ListOrders('&status=Acknowledged'); //print_r($orders_result); $po_array = array(); // get total number of results $total_reults = $orders_result['list']['meta']['totalCount']; if($total_reults){ // start at root of order array tree $orders_result = $orders_result['list']['elements']; if($total_reults <'2'){ $po_array[] = $orders_result['order']['purchaseOrderId']; }else{ foreach($orders_result['order'] AS $order) { $po_array[] = $order['purchaseOrderId']; } } } // return result return $po_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function shippable_items()\n\t{\n\t\t$items = array();\n\t\t\n\t\tforeach ($this->items as $item)\n\t\t{\n\t\t\tif ($item->is_shippable())\n\t\t\t{\n\t\t\t\t$items[$item->row_id()] = $item;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $items;\n\t}", "private function reservePendingOrders()\n { \n // 1\n $pending_order_products = \\App\\Models\\OrderProduct::with('order')->pending()->get()\n ->sortByDesc(function($pending_order_product){\n return $pending_order_product->order->created;\n });\n\n $order_reservations = collect([]);\n\n foreach ($pending_order_products as $pending_order_product) {\n $order_reservations->push(Order::reserveProduct($pending_order_product));\n }\n\n return $order_reservations;\n }", "function makePO()\n{\n global $auth, $PurchaseOrder, $itemID, $apiToken, $apiServer;\n\n echo \"<h1>MAKEPO</h1>\";\n\n // get current time for PO DateOfPurchase\n $currentTime = $auth->GetServerUTCTime();\n\n // prams for PO\n // need to get all item parameters make functions\n $createParameters = array(\n 'fkSupplierId' => '5d1f3893-dad8-4653-befc-a982d21c07b4', // test supplier\n 'fkLocationId' => '00000000-0000-0000-0000-000000000000', //default location\n 'ExternalInvoiceNumber' => 'sample string 3',\n 'Currency' => 'GBP',\n 'SupplierReferenceNumber' => 'sample string 9',\n 'DateOfPurchase' => $currentTime,\n 'QuotedDeliveryDate' => '2018-01-24T15:47:17.0730815Z',\n 'PostagePaid' => 3.0,\n 'ShippingTaxRate' => 4.0,\n 'ConversionRate' => 5.0\n );\n\n // create PO, returns PO id\n $po = $PurchaseOrder->Create_PurchaseOrder_Initial($createParameters,$apiToken, $apiServer);\n echo \"po: \"; echo \"<pre>\"; print_r($po); echo \"</pre>\";\n\n // Prams for item\n // need to get all item parameters make functions??\n // min qty, pack size to make valid order??\n $addItemParameter = array(\n \"pkPurchaseId\" => $po,\n \"fkStockItemId\" => $itemID,\n \"Qty\" => 10,\n \"PackQuantity\" => 1,\n \"PackSize\" => 1,\n \"Cost\" => 1.0,\n \"TaxRate\" => 0.0\n );\n\n // add item to PO\n $addItem = $PurchaseOrder->Add_PurchaseOrderItem($addItemParameter,$apiToken, $apiServer);\n echo \"additem: \"; echo \"<pre>\"; print_r($addItem); echo \"</pre>\";\n\n // prams for PO status change\n $changeStatusParameter = array(\n \"pkPurchaseId\" => $po,\n \"status\" => OPEN\n );\n\n // set PO to open once all items have been added\n // this will update item count and remove it from low stock\n $poOpen = $PurchaseOrder->Change_PurchaseOrderStatus($changeStatusParameter,$apiToken, $apiServer);\n echo \"statusPO: \"; echo \"<pre>\"; print_r($poOpen); echo \"</pre>\";\n\n}", "public function shipments()\n {\n $shipments = DB::select()\n ->from('orders_ordershipments')\n ->where('order_id', '=', $this->id)\n ->order_by('created', 'DESC')\n ->execute()\n ->as_array();\n if (!$shipments)\n {\n return $shipments;\n }\n\n // get items information for each shipment record\n foreach ($shipments as &$shipment)\n {\n $shipment['items'] = DB::select()\n ->from('orders_ordershipmentitems')\n ->where('shipment_id', '=', $shipment['id'])\n ->execute()\n ->as_array();\n }\n\n return $shipments;\n }", "public function getShippedOrder()\n {\n $collection = $this->salesOrderCollectionFactory->create();\n $orders = $collection->addFieldToFilter('status', SELF::ORDER_STATUS_SHIPPED);\n\n return $orders;\n }", "private function emptyShipment()\n {\n $shipments = new \\stdClass();\n\n $shipments->shipments = [];\n $shipments->total = 0;\n $shipments->page = 1;\n $shipments->pages = 0;\n\n return $shipments;\n }", "public function shipmentPush($shipments)\n {\n $this->_requestParams = $shipments;\n\n $fullResult = array();\n $fullResult['records'] = array();\n if (isset($shipments['records'])) {\n $shipments = $shipments['records'];\n }\n foreach ($shipments as $shipmentData) {\n $result = array();\n try{\n $shipment = new Varien_Object($shipmentData);\n\n Mage::dispatchEvent(\n 'retailops_shipment_process_before',\n array('record' => $shipment)\n );\n\n $result['order_increment_id'] = $shipment->getOrderIncrementId();\n\n $orderIncrementId = $shipment->getOrderIncrementId();\n $shipmentInfo = $shipment->getShipment();\n $trackInfo = isset($shipmentInfo['track']) ? $shipmentInfo['track'] : array();\n $invoiceInfo = isset($shipmentInfo['invoice']) ? $shipmentInfo['invoice'] : array();\n $shipmentResult = array();\n $shipmentIncrementId = null;\n\n /** @var Mage_Sales_Model_Order $order */\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId($orderIncrementId);\n if (!$order->getId()) {\n throw new Exception('Order is not found');\n }\n\n // create shipment\n try {\n // Try to locate existing shipment\n $orderShipments = $order->getShipmentsCollection();\n if (count($orderShipments)) {\n foreach ($orderShipments as $orderShipment) {\n $retailopsShipmentId = $orderShipment->getRetailopsShipmentId();\n if ($retailopsShipmentId && $shipmentInfo['retailops_shipment_id']\n && $retailopsShipmentId == $shipmentInfo['retailops_shipment_id']) {\n $shipmentIncrementId = $orderShipment->getIncrementId();\n\n break;\n }\n\n $shipmentComments = $orderShipment->getCommentsCollection();\n foreach ($shipmentComments as $shipmentComment) {\n if ($shipmentComment->getComment() == $shipmentInfo['comment']) {\n $shipmentIncrementId = $orderShipment->getIncrementId();\n\n break;\n }\n }\n\n if ($shipmentIncrementId) {\n break;\n }\n }\n }\n\n // Create a new shipment if we didn't find an existing one\n // Only adding shipment to result if it was created\n if (!$shipmentIncrementId && $order->canShip()) {\n $shipmentIncrementId = $this->create($orderIncrementId,\n $shipmentInfo['qtys'],\n $shipmentInfo['comment'],\n $shipmentInfo['email'],\n $shipmentInfo['include_comment'],\n $shipmentInfo['retailops_shipment_id']\n );\n\n if ($shipmentIncrementId) {\n $shipmentResult['status'] = RetailOps_Api_Helper_Data::API_STATUS_SUCCESS;\n $shipmentResult['shipment_increment_id'] = $shipmentIncrementId;\n } else {\n $shipmentResult['status'] = RetailOps_Api_Helper_Data::API_STATUS_FAIL;\n $shipmentResult['message'] = Mage::helper('retailops_api')->__('Can not create shipment');\n }\n }\n\n // We should have found or created a shipment by now\n if (!$shipmentIncrementId) {\n $shipmentResult['status'] = RetailOps_Api_Helper_Data::API_STATUS_FAIL;\n $shipmentResult['message'] = Mage::helper('retailops_api')->__('Shipment not found');\n }\n } catch (Mage_Core_Exception $e) {\n $shipmentResult['status'] = RetailOps_Api_Helper_Data::API_STATUS_FAIL;\n $shipmentResult['message'] = $e->getCustomMessage() ? $e->getCustomMessage() : $e->getMessage();\n $shipmentResult['stack_trace'] = $e->getTraceAsString();\n $shipmentResult['request_params'] = $this->_requestParams;\n }\n $result['shipment_result'] = $shipmentResult ? array($shipmentResult) : array();\n\n if ($shipmentIncrementId && is_bool($shipmentIncrementId) === false) {\n if ($trackInfo) {\n $existingShipmentInfo = Mage::getModel('sales/order_shipment_api')->info($shipmentIncrementId);\n if ($existingShipmentInfo && is_bool($existingShipmentInfo) === false) {\n $result['track_result'] = array();\n foreach ($trackInfo as $track) {\n // add shipment track\n try {\n $trackResult = array();\n $track = new Varien_Object($track);\n\n $trackId = null;\n foreach ($existingShipmentInfo['tracks'] as $existingTrack) {\n if ($existingTrack['track_number'] == $track->getData('track_number')) {\n $trackId = $existingTrack['track_id'];\n\n break;\n }\n }\n\n if ($trackId) {\n continue;\n }\n\n Mage::dispatchEvent(\n 'retailops_shipment_add_track_before',\n array('record' => $track)\n );\n $trackResult['track_number'] = $track->getData('track_number');\n\n $trackId = $this->addTrack($shipmentIncrementId,\n $track->getData('carrier'),\n $track->getData('title'),\n $track->getData('track_number')\n );\n\n $trackResult['status'] = RetailOps_Api_Helper_Data::API_STATUS_SUCCESS;\n $trackResult['track_id'] = $trackId;\n } catch (Mage_Core_Exception $e) {\n $trackResult['status'] = RetailOps_Api_Helper_Data::API_STATUS_FAIL;\n $trackResult['message'] = $e->getMessage();\n $trackResult['stack_trace'] = $e->getTraceAsString();\n $trackResult['request_params'] = $this->_requestParams;\n }\n $result['track_result'][] = $trackResult;\n }\n }\n }\n\n // create invoice\n /** @var Mage_Sales_Model_Order $order */\n // Note that this does need to be loaded again. The item data may be stale if a shipment\n // was submitted above.\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId($orderIncrementId);\n $isFullyShipped = $this->_checkAllItemsShipped($order);\n $invoices = $order->getInvoiceCollection();\n $invoiceResult = array();\n if ($order->canInvoice()) {\n $itemsToInvoice = array();\n if ($order->getPayment()->canCapturePartial()) {\n /**\n * If payment allows partial capture, trying to create invoice with shipped items only and capture it\n */\n $itemsToInvoice = $shipmentInfo['qtys'];\n }\n if (($itemsToInvoice || $isFullyShipped) && $invoiceInfo) {\n\n $invoice = new Varien_Object($invoiceInfo);\n $invoice->setData('items_to_invoice', $itemsToInvoice);\n\n Mage::dispatchEvent(\n 'retailops_shipment_invoice_before',\n array('record' => $invoice)\n );\n\n $invoiceResult = $this->_createInvoiceAndCapture(\n $order,\n $invoice->getItemsToInvoice(),\n $invoice->getCapturedOffline(),\n $invoice->getComment(),\n $invoice->getEmail(),\n $invoice->getIncludeComment()\n );\n\n $invoiceResult = array($invoiceResult);\n }\n } else {\n if ($isFullyShipped) {\n /**\n * Capturing all available invoices if all order items are shipped\n */\n $invoiceResult = $this->_captureInvoices($invoices);\n }\n }\n $result['invoice_result'] = $invoiceResult;\n }\n } catch (Exception $e) {\n $result['status'] = RetailOps_Api_Helper_Data::API_STATUS_FAIL;\n $result['message'] = $e->getMessage();\n $result['stack_trace'] = $e->getTraceAsString();\n $result['request_params'] = $this->_requestParams;\n }\n $fullResult['records'][] = $result;\n }\n\n return $fullResult;\n }", "private function pushOrders()\n {\n return [];\n }", "protected function getUnmarkedShippedOrders()\n {\n $aOrders = [];\n\n $sMinSendDate = date('Y-m-d H:i:s', time() - (60 * 60 * 24)); // only look at orders in the last 24 hours\n\n $sQuery = \" SELECT \n oxid \n FROM \n oxorder \n WHERE \n oxpaymenttype LIKE '%mollie%' AND\n oxtransid LIKE '%ord_%' AND\n oxsenddate >= ? AND\n mollieshipmenthasbeenmarked = 0\";\n $aParams = [$sMinSendDate];\n if ($this->getShopId() !== false) {\n $sQuery .= \" AND oxshopid = ? \";\n $aParams[] = $this->getShopId();\n }\n $aResult = DatabaseProvider::getDb()->getAll($sQuery, $aParams);\n foreach ($aResult as $aRow) {\n $aOrders[] = $aRow[0];\n }\n\n return $aOrders;\n }", "public function addShip(array $grid, int $shipLength): array\n {\n $horizontalAlignment = rand(0, 1);\n\n $randomCoords = $this->getRandomCoords($grid, $horizontalAlignment, $shipLength);\n\n while (! $this->checkForEmptyCells($grid, $randomCoords, $horizontalAlignment, $shipLength)) {\n $horizontalAlignment = rand(0, 1);\n\n $randomCoords = $this->getRandomCoords($grid, $horizontalAlignment, $shipLength);\n }\n\n return $this->fillShipCells($grid, $shipLength, $horizontalAlignment, $randomCoords);\n }", "function add_toppings_to_orders($db, $orders) {\n for ($i=0; $i<count($orders);$i++) {\n $toppings = get_order_toppings($db, $orders[$i]['id']);\n $orders[$i]['toppings'] = $toppings; // add toppings to order \n } \n return $orders;\n}", "function ship_order ()\n {\n $this->load->helper('fedex');\n $this->orderid = $this->uri->segment(3);\n $this->userid = $this->uri->segment(4);\n $this->gen_contents['shipdetails'] = $this->admin_user_model->select_single_order_details($this->orderid);\n\n $shipdetails = $this->admin_user_model->select_single_order_details($this->orderid);\n\n\n /*$aryOrder = array(\n 'TotalPackages' => 1,\n 'PackageType' => 'YOUR_PACKAGING', //FEDEX_10KG_BOX, FEDEX_25KG_BOX, FEDEX_BOX, FEDEX_ENVELOPE, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING\n 'ServiceType' => 'FEDEX_GROUND',\n 'TermsOfSaleType' => \"DDU\", # DDU/DDP\n 'DropoffType' => 'REGULAR_PICKUP' // BUSINESS_SERVICE_CENTER, DROP_BOX, REGULAR_PICKUP, REQUEST_COURIER, STATION\n );*/\n\n $aryOrder = get_fedex_order_array($this->admin_user_model->get_course_ordered_book_count($this->orderid));\n $aryRecipient = array(\n 'Contact' => array(\n 'PersonName' => $shipdetails['firstname'] . \" \" . $shipdetails['lastname'],\n //'CompanyName' => 'Company Name',\n 'PhoneNumber' => $shipdetails['phone']\n ),\n 'Address' => array(\n 'StreetLines' => $shipdetails['s_address'].\", \".$shipdetails['unit_number'],\n 'City' => $shipdetails['s_city'],\n 'StateOrProvinceCode' => $shipdetails['s_state'],\n 'PostalCode' => $shipdetails['s_zipcode'],\n 'CountryCode' => $shipdetails['s_country'],\n 'Residential' => false)\n );\n\n $courseDetails = $this->admin_user_model->get_course_details($this->orderid);\n $course_weight = $courseDetails['course_weight'];\n $course_amount = $courseDetails['course_amount'];\n $arrCourseDetails = $courseDetails['arrCourseDetails'];\n\n $package_weight = $courseDetails['course_weight'];\n $est_amount = $courseDetails['course_amount'];\n $arrCourseDetails = $courseDetails['arrCourseDetails'];\n\n $order_id = $this->orderid;\n\n $packetDescription = \"FEDEX Package for order \" . $order_id;\n $packageDetails = array(\n 0 => array(\n 'weight' => $package_weight,\n 'ItemDescription' => $packetDescription\n )\n );\n $packageDetails[0] = array_merge($packageDetails[0], get_fedex_packaging_dimension($aryOrder['PackageType']));\n //echo '<pre>';print_r($packageDetails);exit;\n $cnt = 0;\n foreach ($arrCourseDetails as $courseDetails)\n {\n $aryPackageItems[$cnt]['item_qty'] = 1;\n $aryPackageItems[$cnt]['item_price'] = $courseDetails['amount'];\n $aryPackageItems[$cnt]['item_name'] = $courseDetails['course_name'];\n $aryPackageItems[$cnt]['item_weight'] = $courseDetails['wieght'];\n\n $cnt++;\n }\n\n $realPackages = array(\n 0 => array(\n 'packageDetails' => $packageDetails,\n 'aryPackageItems' => $aryPackageItems,\n 'package_amount' => $est_amount\n )\n );\n\n\n $ship = setShipment($aryOrder, $aryRecipient, $realPackages, $course_amount, $course_weight);\n\n //$this->gen_contents['admindetails'] = $this->admin_user_model->get_admin_details();\n //$course_weight=$this->admin_user_model->get_courseweight($this->orderid);\n //$ship = $this->admin_user_model->shiporder($this->gen_contents['shipdetails'],$course_weight,$this->gen_contents['admindetails']);\n\n if ($ship != 'error')\n {\n $this->admin_user_model->update_orderdetails($this->orderid, $ship['trackingno'], $ship['label']);\n $this->gen_contents[\"userdetails\"] = $this->admin_user_model->select_single_userdetails($this->userid);\n $this->gen_contents['orderdetails'] = $this->admin_user_model->select_single_order_details($this->orderid);\n //$this->admin_user_model->mail_touser($this->gen_contents[\"userdetails\"], $this->gen_contents['orderdetails']);\n $this->_mail_touser($this->gen_contents[\"userdetails\"], $this->gen_contents['orderdetails']);\n $this->session->set_flashdata('success', 'Order shipped successfully');\n redirect('admin_user/view_order_details/' . $this->gen_contents['shipdetails']['id']);\n }\n else\n {\n\n $this->session->set_flashdata('error', 'Request Failed');\n redirect('admin_user/view_order_details/' . $this->gen_contents['shipdetails']['id']);\n }\n }", "public function getDeliverySlipsCollection(){\n $db = JFactory::getDBO();\n\n $query = \"SELECT * FROM \" . $db->quoteName('#__jeproshop_order_invoice') . \" WHERE order_id = \" . (int)$this->order_id;\n $query .= \" AND delivery_number != 0\";\n\n $db->setQuery($query);\n return $db->loadObjectList();\n }", "public function persistShiporder($shiporders){\n\n foreach ( $shiporders[\"shiporder\"] as $shipordersItem){\n $em = $this->getDoctrine()->getManager();\n\n\n $shiporder = new Shiporder();\n $shiporder->setOrderid($shipordersItem[\"orderid\"]);\n $shiporder->setOrderperson($shipordersItem[\"orderperson\"]);\n\n\n $this->persistShipto($shipordersItem[\"shipto\"],$shipordersItem[\"orderid\"]);\n $this->persistItems($shipordersItem[\"items\"],$shipordersItem[\"orderid\"]);\n\n $em->persist($shiporder);\n $em->flush();\n\n\n\n }\n\n\n }", "public function listPOsToAcknowledge()\n {\n\n $orders_result= $this->ListReleasedOrders();\n $po_array = array();\n // get total number of results\n $total_reults = $orders_result['list']['meta']['totalCount'];\n\n if($total_reults){\n // start at root of order array tree\n $orders_result = $orders_result['list']['elements'];\n\n if($total_reults <'2'){\n $po_array[] = $orders_result['order']['purchaseOrderId'];\n }else{\n foreach($orders_result['order'] AS $order) {\n $po_array[] = $order['purchaseOrderId'];\n }\n }\n }\n // return result\n return $po_array;\n\n }", "public function getShipments() {\n\t\t$results = Shipment::where('company_id', Auth::user()->company_id)->get();\n\t\treturn json_decode(json_encode($results), true);\n\t}", "public function get_avaliable_ship_array() {\n return $this->AVAILABLE_SHIPS;\n }", "protected function _purchases() {\n\t MongoCursor::$timeout = -1;\n\t\t$this->log('Generating Purchase Orders');\n\t\t$orderCollection = Order::collection();\n\t\t$event_count = count($this->poEvents);\n\t\t$ecount = 0;\n\t\tforeach ($this->poEvents as $eventId) {\n\t\t\t$purchaseHeading = ProcessedOrder::$_purchaseHeading;\n\t\t\t$total = array('sum' => 0, 'quantity' => 0);\n\t\t\t$event = Event::find('first', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'_id' => $eventId\n\t\t\t)));\n\t\t\t$eventItems = $this->_getOrderItems($eventId);\n\t\t\t$vendorName = preg_replace('/[^(\\x20-\\x7F)]*/','', substr(String::asciiClean($event->name), 0, 3));\n\t\t\t$time = date('ymdis', $event->_id->getTimestamp());\n\t\t\t$poNumber = 'TOT'.'-'.$vendorName.$time;\n\t\t\t$filename = 'TOTitpo'.$vendorName.$time.'.csv';\n\t\t\t$handle = $this->tmp.$filename;\n\t\t\t$this->log(\"Opening PO file $handle\");\n\t\t\t$fp = fopen($handle, 'w');\n\t\t\t$this->summary['purchase_orders'][] = $filename;\n\t\t\t\n\t\t\t$purchaseOrder = array();\n\t\t\t$inc = 0;\n\t\t\tforeach ($eventItems as $eventItem) {\n\t\t\t\tforeach ($eventItem['details'] as $key => $value) {\n\t\t\t\t\t$this->log(\"{$eventItem['_id']} size {$key} value {$value}\");\n\t\t\t\t\t$orders = $orderCollection->find( array(\n\t\t\t\t\t\t'items.item_id' => (string) $eventItem['_id'],\n\t\t\t\t\t\t'items.size' => (string) $key,\n\t\t\t\t\t\t'items.status' => array('$ne' => 'Order Canceled'),\n\t\t\t\t\t\t'cancel' => array('$ne' => true))\n\t\t\t\t\t);\n\t\t\t\t\tif ($orders) {\n\t\t\t\t\t\tforeach ($orders as $order) {\n\t\t\t\t\t\t\t$items = $order['items'];\n\t\t\t\t\t\t\t$date_created = $order['date_created'];\n\t\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\t\t$active = (empty($item['cancel']) || $item['cancel'] != true) ? true : false;\n\t\t\t\t\t\t\t\t$itemValid = ($item['item_id'] == $eventItem['_id']) ? true : false;\n\t\t\t\t\t\t\t\tif ($itemValid && ((string) $key == $item['size']) && $active){\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Supplier'] = $eventItem['vendor'];\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['PO # / RMA #'] = $poNumber;\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['SKU'] = $eventItem['sku_details'][$item['size']];\n\t\t\t\t\t\t\t\t\tif (empty($eventItem['sku_details'][$item['size']])) {\n\t\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['SKU'] = Item::getUniqueSku($eventItem['vendor'], $eventItem['vendor_style'], (string)$item['size'], $item['color']);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (empty($purchaseOrder[$inc]['Qty'])) {\n\t\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Qty'] = $item['quantity'];\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Qty'] += $item['quantity'];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t//new additions\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Vendor Style'] = $eventItem['vendor_style'];\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Vendor Name'] = $vendorName;\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Item Color'] = $item['color'];\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Item Size'] = $item['size'];\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Item Description'] = $eventItem['description'];\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Order Creation Date'] = date(\"m/d/Y\", str_replace(\"0.00000000 \", \"\", $order['date_created']));\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Promised Ship-by Date'] = date(\"m/d/Y\", str_replace(\"0.00000000 \", \"\", $order['ship_date']));\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Event Name'] = $event->name;\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Event End Date'] = date(\"m/d/Y\", str_replace(\"0.00000000 \", \"\", $event->end_date));\n\n\n\t\t\t\t\t\t\t$purchaseOrder[$inc]['WhsInsValue (Cost)'] = number_format($eventItem['sale_whol'], 2);\n\t\t\t\t\t\t\t$purchaseOrder[$inc]['Description for Customs'] = (!empty($eventItem['category']) ? $eventItem['category'] : \"\");\n\t\t\t\t\t\t\t$purchaseOrder[$inc]['ShipInsValue'] = number_format($eventItem['orig_whol'], 2);\n\t\t\t\t\t\t\t$purchaseOrder[$inc]['Ref1'] = $eventItem['_id'];\n\t\t\t\t\t\t\t$purchaseOrder[$inc]['Ref2'] = $key;\n\t\t\t\t\t\t\t$purchaseOrder[$inc]['Ref3'] = $eventItem['color'];\n\n\n\t\t\t\t\t\t\tif ((int) $eventItem['product_weight'] > 0) {\n\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['UOM1_Weight'] = number_format($eventItem['product_weight'],2);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc] = $this->sortArrayByArray($purchaseOrder[$inc], $purchaseHeading);\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 (!empty($purchaseOrder[$inc])) {\n\t\t\t\t\t\t\tfputcsv($fp, array_merge($purchaseHeading, $purchaseOrder[$inc]));\n\t\t\t\t\t\t\tif ($this->test != 'true') {\n\t\t\t\t\t\t\t\t$po = PurchaseOrder::create();\n\t\t\t\t\t\t\t\t$po->save(array_merge($purchaseHeading, $purchaseOrder[$inc]) + $this->batchId);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t++$inc;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t++$ecount;\n\t\t\tif ($event_count != 0) {\n $this->queue->percent = (float)number_format((($ecount/$event_count) * 100), 2);\n $this->queue->save();\n }\n\t\t\tfclose($fp);\n\t\t\trename($handle, $this->pending.$filename);\n\t\t}\n\t}", "function getNewOrder_ws() {\n\t$array = array();\n\t$db = new dbConn;\n\t$array = $db->getNewOrder();\n\t\n\treturn $array;\n}", "public function getOrders(){\n $orders = Models\\Checkout::where('status','2' );\t\t\t\t\t\t \n\t\t\t\t\t\t \n\n\t\t$orders = (object) array(\n\t\t\t'orders' => $orders,\n\t\t);\n\n\t\treturn $orders;\n\t\t\t\n }", "public function getShips()\n {\n $shipsFromDatabase = $this->shipStorage->fetchAllShipsData();\n\n $ships = array();\n\n foreach ($shipsFromDatabase as $ship)\n {\n $ships[] = $this->getShipFromData($ship);\n }\n\n return $ships;\n\n }", "public function shippings()\n {\n return $this->hasManyThrough('App\\Shipping', 'App\\Customer');\n }", "function WinnubCart(){\n \n $prodotti=array();\n \n \n return $prodotti;\n}", "public function createShipmentAndGetWaybill();", "public function CopyShipToCust() {\n\t$sShip = $this->RecipFields()->AsString();\n\t$oFlds = $this->BuyerFields();\n\t$oFlds->AsString($sShip);\t// set the shipping fields\n\t$oFlds->SaveCartData();\t\t// write to database\n }", "public function batch_generate()\n {\n return $this->getService()->generateInvoicesForExpiringOrders();\n }", "function uc_ups_shipment_request($packages, $origin, $destination, $ups_service) {\n $store['name'] = variable_get('uc_store_name', NULL);\n $store['owner'] = variable_get('uc_store_owner', NULL);\n $store['email'] = uc_store_email();\n $store['email_from'] = uc_store_email();\n $store['phone'] = variable_get('uc_store_phone', NULL);\n $store['fax'] = variable_get('uc_store_fax', NULL);\n $store['street1'] = variable_get('uc_store_street1', NULL);\n $store['street2'] = variable_get('uc_store_street2', NULL);\n $store['city'] = variable_get('uc_store_city', NULL);\n $store['zone'] = variable_get('uc_store_zone', NULL);\n $store['postal_code'] = variable_get('uc_store_postal_code', NULL);\n $store['country'] = variable_get('uc_store_country', 840);\n\n $account = variable_get('uc_ups_shipper_number', '');\n $ua = explode(' ', $_SERVER['HTTP_USER_AGENT']);\n $user_agent = $ua[0];\n\n $services = _uc_ups_service_list();\n $service = array('code' => $ups_service, 'description' => $services[$ups_service]);\n\n $pkg_types = _uc_ups_pkg_types();\n\n $shipper_zone = uc_get_zone_code($store['zone']);\n $shipper_country = uc_get_country_data(array('country_id' => $store['country']));\n $shipper_country = $shipper_country[0]['country_iso_code_2'];\n $shipper_zip = $store['postal_code'];\n $shipto_zone = uc_get_zone_code($destination->zone);\n $shipto_country = uc_get_country_data(array('country_id' => $destination->country));\n $shipto_country = $shipto_country[0]['country_iso_code_2'];\n $shipto_zip = $destination->postal_code;\n $shipfrom_zone = uc_get_zone_code($origin->zone);\n $shipfrom_country = uc_get_country_data(array('country_id' => $origin->country));\n $shipfrom_country = $shipfrom_country[0]['country_iso_code_2'];\n $shipfrom_zip = $origin->postal_code;\n\n $ups_units = variable_get('uc_ups_unit_system', variable_get('uc_length_unit', 'in'));\n\n $package_schema = '';\n foreach ($packages as $package) {\n // Determine length conversion factor and weight conversion factor\n // for this shipment\n $length_factor = uc_length_conversion($package->length_units, variable_get('uc_ups_unit_system', variable_get('uc_length_unit', 'in')));\n switch ($ups_units) {\n case 'in':\n $weight_factor = uc_weight_conversion($package->weight_units, 'lb');\n break;\n case 'cm':\n $weight_factor = uc_weight_conversion($package->weight_units, 'kg');\n break;\n }\n\n $qty = $package->qty;\n for ($i = 0; $i < $qty; $i++) {\n $package_type = array('code' => $package->pkg_type, 'description' => $pkg_types[$package->pkg_type]);\n $package_schema .= \"<Package>\";\n $package_schema .= \"<PackagingType>\";\n $package_schema .= \"<Code>\" . $package_type['code'] . \"</Code>\";\n $package_schema .= \"</PackagingType>\";\n if ($package->pkg_type == '02' && $package->length && $package->width && $package->height) {\n if ($package->length < $package->width) {\n list($package->length, $package->width) = array($package->width, $package->length);\n }\n $package_schema .= \"<Dimensions>\";\n $package_schema .= \"<UnitOfMeasurement>\";\n $package_schema .= \"<Code>\" . strtoupper(variable_get('uc_ups_unit_system', variable_get('uc_length_unit', 'in'))) . \"</Code>\";\n $package_schema .= \"</UnitOfMeasurement>\";\n $package_schema .= \"<Length>\" . (floor($package->length * $length_factor) + 1) . \"</Length>\";\n $package_schema .= \"<Width>\" . (floor($package->width * $length_factor) + 1) . \"</Width>\";\n $package_schema .= \"<Height>\" . (floor($package->height * $length_factor) + 1) . \"</Height>\";\n $package_schema .= \"</Dimensions>\";\n }\n $size = $package->length * $length_factor + 2 * $length_factor * ($package->width + $package->height);\n $weight = max(1, $package->weight * $weight_factor);\n $package_schema .= \"<PackageWeight>\";\n $package_schema .= \"<UnitOfMeasurement>\";\n $package_schema .= \"<Code>\" . $units . \"</Code>\";\n $package_schema .= \"<Description>\" . $unit_name . \"</Description>\";\n $package_schema .= \"</UnitOfMeasurement>\";\n $package_schema .= \"<Weight>\" . number_format($weight, 1, '.', '') . \"</Weight>\";\n $package_schema .= \"</PackageWeight>\";\n if ($size > 130 && $size <= 165) {\n $package_schema .= \"<LargePackageIndicator/>\";\n }\n $package_schema .= \"<PackageServiceOptions>\";\n $package_schema .= \"<InsuredValue>\";\n $package_schema .= \"<CurrencyCode>\" . variable_get('uc_currency_code', 'USD') . \"</CurrencyCode>\";\n $package_schema .= \"<MonetaryValue>\" . number_format($package->value, 2, '.', '') . \"</MonetaryValue>\";\n $package_schema .= \"</InsuredValue>\";\n $package_schema .= \"</PackageServiceOptions>\";\n $package_schema .= \"</Package>\";\n }\n }\n\n $schema = uc_ups_access_request() . \"\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\n<ShipmentConfirmRequest xml:lang=\\\"en-US\\\">\n <Request>\n <TransactionReference>\n <CustomerContext>Complex Rate Request</CustomerContext>\n <XpciVersion>1.0001</XpciVersion>\n </TransactionReference>\n <RequestAction>ShipConfirm</RequestAction>\n <RequestOption>validate</RequestOption>\n </Request>\n <Shipment>\";\n $schema .= \"<Shipper>\";\n $schema .= \"<Name>\". $store['name'] .\"</Name>\";\n $schema .= \"<ShipperNumber>\". variable_get('uc_ups_shipper_number', '') .\"</ShipperNumber>\";\n if ($store['phone']) {\n $schema .= \"<PhoneNumber>\". $store['phone'] .\"</PhoneNumber>\";\n }\n if ($store['fax']) {\n $schema .= \"<FaxNumber>\". $store['fax'] .\"</FaxNumber>\";\n }\n if ($store['email']) {\n $schema .= \"<EMailAddress>\". $store['email'] .\"</EMailAddress>\";\n }\n $schema .= \"<Address>\";\n $schema .= \"<AddressLine1>\". $store['street1'] .\"</AddressLine1>\";\n if ($store['street2']) {\n $schema .= \"<AddressLine2>\". $store['street2'] .\"</AddressLine2>\";\n }\n $schema .= \"<City>\". $store['city'] .\"</City>\";\n $schema .= \"<StateProvinceCode>$shipper_zone</StateProvinceCode>\";\n $schema .= \"<PostalCode>$shipper_zip</PostalCode>\";\n $schema .= \"<CountryCode>$shipper_country</CountryCode>\";\n $schema .= \"</Address>\";\n $schema .= \"</Shipper>\";\n $schema .= \"<ShipTo>\";\n $schema .= \"<CompanyName>\". $destination->company .\"</CompanyName>\";\n $schema .= \"<AttentionName>\". $destination->first_name .' '. $destination->last_name .\"</AttentionName>\";\n $schema .= \"<PhoneNumber>\". $destination->phone .\"</PhoneNumber>\";\n $schema .= \"<EMailAddress>\". $destination->email .\"</EMailAddress>\";\n $schema .= \"<Address>\";\n $schema .= \"<AddressLine1>\". $destination->street1 .\"</AddressLine1>\";\n if ($destination->street2) {\n $schema .= \"<AddressLine2>\". $destination->street2 .\"</AddressLine2>\";\n }\n $schema .= \"<City>\". $destination->city .\"</City>\";\n $schema .= \"<StateProvinceCode>$shipto_zone</StateProvinceCode>\";\n $schema .= \"<PostalCode>$shipto_zip</PostalCode>\";\n $schema .= \"<CountryCode>$shipto_country</CountryCode>\";\n if ($destination->residential) {\n $schema .= \"<ResidentialAddressIndicator/>\";\n }\n $schema .= \"</Address>\";\n $schema .= \"</ShipTo>\";\n $schema .= \"<ShipFrom>\";\n $schema .= \"<CompanyName>\". $origin->company .\"</CompanyName>\";\n $schema .= \"<AttentionName>\". $origin->first_name .' '. $origin->last_name .\"</AttentionName>\";\n $schema .= \"<PhoneNumber>\". $origin->phone .\"</PhoneNumber>\";\n $schema .= \"<EMailAddress>\". $origin->email .\"</EMailAddress>\";\n $schema .= \"<Address>\";\n $schema .= \"<AddressLine1>\". $origin->street1 .\"</AddressLine1>\";\n if ($origin->street2) {\n $schema .= \"<AddressLine2>\". $origin->street2 .\"</AddressLine2>\";\n }\n $schema .= \"<City>\". $origin->city .\"</City>\";\n $schema .= \"<StateProvinceCode>$shipfrom_zone</StateProvinceCode>\";\n $schema .= \"<PostalCode>$shipfrom_zip</PostalCode>\";\n $schema .= \"<CountryCode>$shipfrom_country</CountryCode>\";\n $schema .= \"</Address>\";\n $schema .= \"</ShipFrom>\";\n $schema .= \"<PaymentInformation>\";\n $schema .= \"<Prepaid>\";\n $schema .= \"<BillShipper>\";\n $schema .= \"<AccountNumber>$account</AccountNumber>\";\n $schema .= \"</BillShipper>\";\n $schema .= \"</Prepaid>\";\n $schema .= \"</PaymentInformation>\";\n if (variable_get('uc_ups_negotiated_rates', FALSE)) {\n $schema .= \"<RateInformation><NegotiatedRatesIndicator/></RateInformation>\";\n }\n $schema .= \"<Service>\";\n $schema .= \"<Code>{$service['code']}</Code>\";\n $schema .= \"<Description>{$service['description']}</Description>\";\n $schema .= \"</Service>\";\n $schema .= $package_schema;\n $schema .= \"</Shipment>\";\n $schema .= \"<LabelSpecification>\";\n $schema .= \"<LabelPrintMethod>\";\n $schema .= \"<Code>GIF</Code>\";\n $schema .= \"</LabelPrintMethod>\";\n $schema .= \"<LabelImageFormat>\";\n $schema .= \"<Code>GIF</Code>\";\n $schema .= \"</LabelImageFormat>\";\n $schema .= \"</LabelSpecification>\";\n $schema .= \"</ShipmentConfirmRequest>\";\n\n return $schema;\n}", "public function buildBasketContent()\n {\n $orders = $this->getOrder();\n $basketArray = [];\n\n foreach($orders as $order){\n $portionId = $order['portionId'];\n $portion = Portion::where('id',$portionId)->get();\n $basketArray[] = [['portion'=>$portion], ['units'=> $order['unit']]];\n }\n return $basketArray;\n }", "public function performShippifyTaskCreation($id_shippify_order)\n {\n // Get configurations\n $api_token = Configuration::get('SHPY_API_TOKEN', '');\n $id_warehouse = Configuration::get('SHPY_WAREHOUSE_ID', '');\n $sender_support_email = Configuration::get('SHPY_SUPPORT_EMAIL', '');\n $sender_support_phone = Configuration::get('SHPY_SUPPORT_PHONE', '');\n $compact_products = Configuration::get('SHPY_COMPACT_PRODUCTS', '');\n $anonimize_products = Configuration::get('SHPY_ANONIMIZE_PRODUCTS', '');\n // If one of them is empty, dont do nothing\n if (empty($api_token)) return FALSE;\n if (empty($id_warehouse)) return FALSE;\n if (empty($sender_support_email)) return FALSE;\n\n // Get the order info from the database\n $order_sql = 'SELECT *, ords.id_order AS id, ords.reference AS ref, shps.status AS shippify_order_status, ords.total_paid, CONCAT(cuts.firstname, \\' \\', cuts.lastname) AS customer_name, cuts.email AS customer_email, adrs.phone AS customer_phone, adrs.phone_mobile AS customer_mobile, adrs.address1, adrs.address2, adrs.postcode, adrs.city, adrs.other FROM `' . _DB_PREFIX_ . 'shippify_order` shps INNER JOIN `' . _DB_PREFIX_ . 'orders` ords ON shps.id_order = ords.id_order INNER JOIN `' . _DB_PREFIX_ . 'customer` cuts ON ords.id_customer = cuts.id_customer INNER JOIN `' . _DB_PREFIX_ . 'address` adrs ON ords.id_address_delivery = adrs.id_address WHERE shps.id_shippify_order = ' . $id_shippify_order;\n $order = Db::getInstance()->getRow($order_sql);\n\n // If the order has already been shipped\n if ($order['shippify_order_status'] == 1) return TRUE;\n\n if ($anonimize_products === 'SI'){\n // Private Product Name Query\n $products_sql = 'SELECT dets.`product_id` AS id, dets.`product_id` AS name, dets.`product_quantity` AS qty, prds.height, prds.width, prds.depth, 3 as size FROM `' . _DB_PREFIX_ . 'shippify_order` shps INNER JOIN `' . _DB_PREFIX_ . 'order_detail` dets ON shps.id_order = dets.id_order INNER JOIN `' . _DB_PREFIX_ . 'product` prds ON dets.product_id = prds.id_product WHERE shps.`id_shippify_order` = ' . $id_shippify_order;\n } else {\n // Non Private Product Name Query\n $products_sql = 'SELECT dets.`product_id` AS id, dets.`product_name` AS name, dets.`product_quantity` AS qty, prds.height, prds.width, prds.depth, 3 as size FROM `' . _DB_PREFIX_ . 'shippify_order` shps INNER JOIN `' . _DB_PREFIX_ . 'order_detail` dets ON shps.id_order = dets.id_order INNER JOIN `' . _DB_PREFIX_ . 'product` prds ON dets.product_id = prds.id_product WHERE shps.`id_shippify_order` = ' . $id_shippify_order;\n }\n\n $products_array = Db::getInstance()->executeS($products_sql);\n\n if ($compact_products === 'SI'){\n $get_products_name = function($product){\n return $product[\"name\"];\n };\n $products_name_array = array_map($get_products_name, $products_array);\n $products_array = array (\n array(\n \"name\" => implode(\" | \", $products_name_array),\n \"qty\" => 1,\n \"size\" => 3\n )\n );\n }\n\n $address2 = $order['address1'] . ', ' . $order['address2'] . ', ' . $order['city'] . ', ' . $order['other'];\n $address = $order['address1'] . ', ' . $order['city']; \n \n if (isset($order['numero_house'])) {\n $address2 = $address2 . ' ' . $order['numero_house'];\n $address = $address . ' ' . $order['numero_house'];\n }\n\n if(isset($order['dpto_house'])) {\n $address2 = $address . ' ' . $order['dpto_house'];\n $address = $address . ' ' . $order['dpto_house'];\n }\n \n $address = $address . ', ' . $order['city']; \n\n // Prepare the request\n $post_data = array(\n 'deliveries' => array(\n array(\n 'pickup' => array(\n 'contact' => array(\n 'email' => $sender_support_email,\n 'phone' => $sender_support_phone\n ),\n 'location' => array(\n 'warehouse' => $id_warehouse\n )\n ),\n 'dropoff' => array(\n 'contact' => array(\n 'name' => $order['customer_name'],\n 'email' => $order['customer_email'],\n 'phonenumber' => (!empty($order['customer_phone']) ? $order['customer_phone'] : $order['customer_mobile']),\n ),\n 'location' => array(\n 'address' => $address,\n 'instructions' => $address2\n )\n ),\n 'packages' => $products_array,\n 'total_amount' => $order['total_paid'],\n 'referenceId' => $order['id'], \n 'tags' => array(\n 'PRESTASHOP'\n )\n )\n )\n );\n // Authentication\n $context = stream_context_create(array(\n 'http' => array(\n 'method' => 'POST',\n 'header' => \"Authorization: Basic {$api_token}\\r\\n\" .\n \"Content-Type: application/json\\r\\n\",\n 'content' => json_encode($post_data)\n )\n ));\n\n // Do the request\n $response = @file_get_contents('https://api.shippify.co/v1/deliveries', FALSE, $context);\n\n // If error, nothing happens\n if ($response === FALSE) return FALSE;\n $response_data = json_decode($response, TRUE);\n // Order has been created, status is set to 1\n $sql = 'UPDATE `' . _DB_PREFIX_ . 'shippify_order` SET `status` = 1, `task_id` = \\'' . $response_data['payload'][0]['id'] . '\\' WHERE `id_shippify_order` = ' . $id_shippify_order;\n // Update confirmed orders if SQL is successful\n if (Db::getInstance()->execute($sql)) {\n $this->confirmed_orders_by_id[$id_shippify_order] = $response_data['payload'][0]['id'];\n\n // Change order status to Shipped\n $objOrder = new Order((int)$order['id']);\n $history = new OrderHistory();\n $history->id_order = (int)$objOrder->id;\n $history->changeIdOrderState(4, (int)($objOrder->id));\n return TRUE;\n }\n return FALSE;\n }", "public function non_shippable_items()\n\t{\n\t\t$items = array();\n\t\t\n\t\tforeach ($this->items as $item)\n\t\t{\n\t\t\tif ( ! $item->is_shippable())\n\t\t\t{\n\t\t\t\t$items[$item->row_id()] = $item;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $items;\n\t}" ]
[ "0.6288748", "0.59761757", "0.5840327", "0.5838977", "0.58189315", "0.581576", "0.5786134", "0.5712308", "0.56016123", "0.55544347", "0.5501916", "0.5487975", "0.5458186", "0.5452246", "0.5449238", "0.544459", "0.5426835", "0.54119885", "0.54075485", "0.53923094", "0.53860205", "0.5371197", "0.5361953", "0.5356178", "0.5343736", "0.5316324", "0.52950376", "0.5285502", "0.52824545", "0.52754426" ]
0.7265692
0
Check ShareFile credentials in config file.
protected function checkCredentials() { if ($this->mEmpty(HOSTNAME, CLIENT_ID, CLIENT_SECRET, USERNAME, PASSWORD)) { $this->markTestSkipped('No ShareFile credentials are found. Fill in your ShareFile credentials under section <PHP> in the file phpunit.xml.dist in the project root folder.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_Logged($credentials_file_path){\r\n\r\n// Test if config file present\r\n $file_is_present=file_exists($credentials_file_path);\r\n// if file present i include it\r\n if ($file_is_present){\r\n include($credentials_file_path);\r\n }\r\n\r\n\r\n return($file_is_present); \r\n}", "static function get_filesystem_credentials() {\r\n\t\t$url = wp_nonce_url( add_query_arg( array( 'page' => 'health-check', 'tab' => 'troubleshoot' ), admin_url() ) );\r\n\t\t$creds = request_filesystem_credentials( $url, '', false, WP_CONTENT_DIR, array( 'health-check-troubleshoot-mode-confirmed', 'health-check-troubleshoot-mode', 'action' ) );\r\n\t\tif ( false === $creds ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif ( ! WP_Filesystem( $creds ) ) {\r\n\t\t\trequest_filesystem_credentials( $url, '', true, WPMU_PLUGIN_DIR, array( 'health-check-troubleshoot-mode-confirmed', 'health-check-troubleshoot-mode', 'action' ) );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "private static function configHasCredentials(array $config): bool\n {\n return Arr::has($config, ['key', 'secret'])\n && Arr::get($config, 'key')\n && Arr::get($config, 'secret');\n }", "protected function checkConfig() {\n\t\t$public_ssl_key = $this->config->getSetting('public_ssl_key');\n\t\t$this->debug(\"configcheck public_ssl_key\", !empty($public_ssl_key));\n\t\tif (empty($public_ssl_key)) {\n\t\t\treturn $this->throwError(\"sslkey_missingconf\");\n\t\t}\n\t\t$this->debug(\"try to open '\".$this->config->getSetting('public_ssl_key').\"'\", file_exists($this->config->getSetting('public_ssl_key')));\n\t\tif (!file_exists($this->config->getSetting('public_ssl_key'))) {\n\t\t\treturn $this->throwError(\"sslkey_missingfile\");\n\t\t}\n\t\t$tokensfile = $this->config->getSetting('tokensfile');\n\t\t$this->debug(\"configcheck tokensfile\", !empty($tokensfile));\n\t\tif (empty($tokensfile)) {\n\t\t\treturn $this->throwError(\"usedtokens_missingconf\");\n\t\t}\n\t\t$loglevel = $this->config->getSetting('loglevel');\n\t\tif ((int)$this->config->getSetting('loglevel') == 0) {\n\t\t\t$this->debug(\"Logging is disabled\", true);\n\t\t}\n\t\telse {\n\t\t\t$logfile = $this->config->getSetting('logfile');\n\t\t\t$this->debug(\"configcheck logfile\", !empty($logfile));\n\t\t\tif (empty($logfile)) {\n\t\t\t\treturn $this->throwError(\"logfile_missingconf\");\n\t\t\t}\n\t\t}\n\t\tif ((boolean)$this->config->getSetting('externalOpenssl') && (!(boolean)$this->config->getSetting('tmp_signature_dir'))) {\t\n\t\t\treturn $this->throwError(\"tmp_signature_dir_missingconf\");\n\t\t}\n\t\tif (self::DEBUG) {\n\t\t\t$this->config->getErrorhandler()->debugErrorMessages();\n\t\t}\n\t\treturn true;\n\t}", "public function validateCredentials($credentials)\r\n {\r\n if (empty($credentials['handle'])) {\r\n return false;\r\n }\r\n if (empty($credentials['passwd'])) {\r\n return false;\r\n }\r\n $handle = $credentials['handle'];\r\n $passwd = $credentials['passwd'];\r\n \r\n // force the full, real path to the file\r\n $file = realpath($this->_config['file']);\r\n \r\n // does the file exist?\r\n if (! file_exists($file)) {\r\n throw $this->_exception('ERR_FILE_NOT_FOUND', array(\r\n 'file' => $file,\r\n ));\r\n }\r\n \r\n // open the file\r\n $fp = @fopen($file, 'r');\r\n if (! $fp) {\r\n throw $this->_exception('ERR_FILE_NOT_READABLE', array(\r\n 'file' => $file,\r\n ));\r\n }\r\n \r\n // find the user's line in the file\r\n $len = strlen($handle) + 1;\r\n $ok = false;\r\n while ($line = fgets($fp)) {\r\n if (substr($line, 0, $len) == \"{$handle}:\") {\r\n // found the line, leave the loop\r\n $ok = true;\r\n break;\r\n }\r\n }\r\n \r\n // close the file\r\n fclose($fp);\r\n \r\n // did we find the username?\r\n if (! $ok) {\r\n // username not in the file\r\n return false;\r\n }\r\n \r\n // break up the pieces: 0 = handle, 1 = encrypted (hashed)\r\n // passwd. may be more than that but we don't care.\r\n $tmp = explode(':', trim($line));\r\n $stored_hash = $tmp[1];\r\n \r\n // what kind of encryption hash are we using? look at the first\r\n // few characters of the hash to find out.\r\n if (substr($stored_hash, 0, 6) == '$apr1$') {\r\n \r\n // use the apache-specific MD5 encryption\r\n $computed_hash = self::_apr1($passwd, $stored_hash);\r\n \r\n } elseif (substr($stored_hash, 0, 5) == '{SHA}') {\r\n \r\n // use SHA1 encryption. pack SHA binary into hexadecimal,\r\n // then encode into characters using base64. this is per\r\n // Tomas V. V. Cox.\r\n $hex = pack('H40', sha1($passwd));\r\n $computed_hash = '{SHA}' . base64_encode($hex);\r\n \r\n } else {\r\n \r\n // use DES encryption (the default).\r\n // \r\n // Note that crypt() will only check up to the first 8\r\n // characters of a password; chars after 8 are ignored. This\r\n // means that if the real password is \"atecharsnine\", the\r\n // word \"atechars\" would be valid. This is bad. As a\r\n // workaround, if the password provided by the user is\r\n // longer than 8 characters, this method will *not* validate\r\n // it.\r\n //\r\n // is the password longer than 8 characters?\r\n if (strlen($passwd) > 8) {\r\n // automatically reject\r\n return false;\r\n } else {\r\n $computed_hash = crypt($passwd, $stored_hash);\r\n }\r\n }\r\n \r\n // did the hashes match?\r\n if ($stored_hash == $computed_hash) {\r\n return array('handle' => $handle);\r\n } else {\r\n return false;\r\n }\r\n }", "private function _checkConfigFile()\n {\n return !!file_exists(App::pluginPath('Gallery') . 'Config' . DS . 'config.php');\n }", "protected function _authenticate()\n {\n $enabled = (int)Mage::getStoreConfig('eyehubspot/settings/active');\n $key1 = Mage::getStoreConfig('eyehubspot/settings/userkey');\n $key2 = Mage::getStoreConfig('eyehubspot/settings/passcode');\n\n if (!$enabled) {\n $this->_outputError(\n self::ERROR_CODE_SYSTEM_CONFIG_DISABLED,\n 'Magento System Configuration has disabled access to this resource.\n To re-enable, please go to Magento Admin > System > Configuration >\n Services > HubSpot Integration.'\n );\n return false;\n\n } elseif ($enabled && !empty($key1) && !empty($key2)) {\n if ((strcasecmp($key1, $this->getRequest()->getParam('ukey')) == 0)\n && (strcasecmp($key2, $this->getRequest()->getParam('code')) == 0)\n ) {\n return true;\n }\n }\n\n $this->_outputError(self::ERROR_CODE_INVALID_CREDENTIALS, 'Invalid user key and/or access code');\n\n return false;\n }", "public function read_credentials() {\n\n\t\t$slack = $this->get_api();\n\n\t\ttry {\n\t\t\t$access_token = $slack->get_access_token();\n\t\t\t$this->set_credentials( array(\n\t\t\t\t'token' => $access_token,\n\t\t\t) );\n\t\t} catch ( Exception $e ) {\n\t\t\t$this->error( $e->getMessage() );\n\n\t\t\treturn false;\n\t\t}\n\n\t\t$result = $this->test_connection();\n\n\t\tif ( $result !== true ) {\n\t\t\t$this->error( sprintf( __( 'Could not test Slack connection: %s', 'thrive-dash' ), $result ) );\n\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->save();\n\n\t\treturn true;\n\t}", "private function hasAPICredentials()\n\t\t{\n\t\t\treturn (Configuration::get(self::CONF_API_USER_ID) != '' && Configuration::get(self::CONF_API_PASS) != '' &&\n\t\t\tConfiguration::get(self::CONF_API_HMAC_KEY) != '' && Configuration::get(self::CONF_API_COUNTRY) != '');\n\t\t}", "function hasAccessToken(){\n\t\tif(is_file($this->access_token_filepath)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function Get_Credentials()\n {\n Global $accessFilePath;\n\n $accessFilePath = \"../private_html/access.json\";\n \n try\n {\n $myfile = fopen($accessFilePath, \"r\") or die(\"Unable to open file!\");\n $fileContent = fread($myfile,filesize($accessFilePath));\n fclose($myfile);\n\n return json_decode($fileContent, true);\n }\n catch (Exeptiopn $e)\n {\n echo \"Error: $e\";\n return false;\n }\n }", "private function loadCredentials(){\r\n $data = file($_SESSION[\"path\"].'/conf/dataBase.conf');\r\n $campo =0;\r\n for($i=0;$i<count($data);$i++){\r\n if(substr($data[$i],0,1)!='#'){\r\n $data[$i] = trim($data[$i]);\r\n switch($campo){\r\n case 0:\r\n $this->server = $data[$i];\r\n break;\r\n case 1:\r\n $this->user = $data[$i];\r\n break;\r\n case 2:\r\n $this->pwd = $data[$i];\r\n break;\r\n case 3:\r\n $this->dbname = $data[$i];\r\n break;\r\n case 4:\r\n $this->engine = $data[$i];\r\n break;\r\n }\r\n $campo++;\r\n }\r\n }\r\n }", "protected function getSftpCreds()\n {\n return include 'data/sftpcreds.config.php';\n }", "function _checkConfig(){\n $this->bConfigExists = file_exists(DIR_PLUGINS.\"{$this->sName}/config.php\");\n if(!$this->bConfigExists){\n $this->bConfigWritable = false;\n }else if(is_writable(DIR_PLUGINS.\"{$this->sName}/config.php\")){\n $this->bConfigWritable = true;\n }else{\n @chmod(DIR_PLUGINS.\"{$this->sName}/config.php\",0644);\n if(is_writable(DIR_PLUGINS.\"{$this->sName}/config.php\")){\n $this->bConfigWritable = true;\n }else{\n $this->bConfigWritable = false;\n }\n }\n }", "private function mod_get_credentials(){\r\n $cnf = parse_ini_file(\"/data/project/orwell01/replica.my.cnf\");\r\n $this->mod_dbuser = $cnf[\"user\"];\r\n $this->mod_dbpass = $cnf[\"password\"];\r\n }", "public function hasCFCredentials()\n {\n if (!getenv('TRAVIS') && (!defined('CLOUDFLARE_AUTH_EMAIL') || !defined('CLOUDFLARE_AUTH_KEY'))) {\n return false;\n }\n\n return true;\n }", "public function testSecretExistTest(): void\n {\n $file = parse_ini_file('.env', true, INI_SCANNER_RAW);\n $this->assertNotNull($file['APP_KEY']);\n }", "public function checkCredentials(array $credentials) {\n $this->checkCredentialsParameters($credentials);\n\n try {\n return $this->getProfile();\n } catch(\\Exception $e) {\n throw new ConnectorConfigException(\"Invalid credentials set'\");\n }\n }", "function _get_shares($type)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if ($this->shares === NULL) {\n $shares = array();\n\n $folder = new Folder(self::PATH_CONFIGLET);\n $configlets = $folder->get_recursive_listing();\n\n $configs = array(self::FILE_CONFIG);\n\n foreach ($configlets as $configlet) {\n if (preg_match('/\\.conf$/', $configlet))\n $configs[] = self::PATH_CONFIGLET . '/' . $configlet;\n }\n\n foreach ($configs as $config_file) {\n $file = new File($config_file);\n\n if (!$file->exists())\n continue;\n\n $lines = $file->get_contents_as_array();\n\n $match = array();\n\n foreach ($lines as $line) {\n if (preg_match(self::REGEX_OPEN, $line, $match)) {\n $share['Name'] = $match[1];\n } elseif (preg_match(\"/^\\s*([[:alpha:]]+)\\s*=\\s*(.*$)/i\", $line, $match)) {\n $share[$match[1]] = $match[2];\n } elseif (preg_match(self::REGEX_CLOSE, $line)) {\n // ShareConfig and ShareOwner are implied fields\n if ($share['ShareInternal'] == 2)\n $share['ShareOwner'] = self::CONSTANT_WEB_APP_USERNAME;\n else if (clearos_app_installed('web_server'))\n $share['ShareOwner'] = self::CONSTANT_WEB_SITE_USERNAME;\n else\n $share['ShareOwner'] = self::CONSTANT_FILES_USERNAME;\n\n $share['ShareConfig'] = $config_file;\n $share['WebDefaultSite'] = ($share['ShareDir'] == '/var/www/html') ? 1 : 0;\n\n // Legacy web server configuration\n if ($share['ShareInternal'] == 1) {\n if (empty($share['WebDefaultSite']))\n $vhost_filename = 'virtual.' . $share['Name'] . '.conf';\n else\n $vhost_filename = 'clearos.default.conf';\n\n $file = new File(self::WEB_VIRTUAL_HOST_PATH . '/' . $vhost_filename);\n\n if ($file->exists())\n $share['WebCustomConfiguration'] = TRUE;\n else\n $share['WebCustomConfiguration'] = FALSE;\n }\n\n if (empty($share['ShareSystemPermissions']))\n $share['ShareSystemPermissions'] = self::DEFAULT_SYSTEM_PERMISSIONS;\n\n $shares[$share['Name']] = $share;\n\n $share = array('WebEnabled' => 0, 'FtpEnabled' => 0, 'FileEnabled' => 0, 'EmailEnabled' => 0);\n }\n }\n }\n\n $this->shares = $shares;\n }\n\n if ($type === self::TYPE_ALL) {\n return $this->shares;\n } else {\n $shares = array();\n\n foreach ($this->shares as $name => $details) {\n if ((($type === self::TYPE_FILE_SHARE) && empty($details['ShareInternal']))\n || (($type === self::TYPE_WEB_SITE) && ($details['ShareInternal'] == 1))\n || (($type === self::TYPE_WEB_APP) && ($details['ShareInternal'] == 2))\n )\n $shares[$name] = $details;\n }\n } \n\n return $shares;\n }", "function request_filesystem_credentials() {\n $GLOBALS['wp_functions']['request_filesystem_credentials'] = true;\n return true;\n }", "public function hasSharedSecret()\n {\n return $this->shared_secret !== null;\n }", "public function isAuthenticated()\n {\n $result = $this->conn->query('select * from config where code = :code limit 1', [\n ':code' => 'twitter_access_token'\n ]);\n\n $row = $result->fetchAll();\n\n if(count($row) > 0)\n {\n $this->accessToken = $row[0]['value'];\n return true;\n }\n else\n {\n return false;\n }\n }", "private function checkTokenConfigs() {\n\t\tif(!empty($this->prefix) && !empty($this->secret)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function flo_config_permission()\n {\n $configFileName = \"wp-config.php\";\n $config_file_name = 'wp-config.php';\n\t\tif ( file_exists( ABSPATH . $configFileName) ) {\n\t\t\t$config = ABSPATH . $configFileName;\n\t\t} else {\n\t\t\t$config = dirname(ABSPATH) . '/'.$configFileName;\n\t\t}\n $result = array();\n\n //check if file exists\n if ( file_exists($config) ) {\n\n //check if writable\n $configWrite = is_writable($config);\n //result return\n if($configWrite == false){\n $result[\"response\"] = false;\n $result[\"message\"] = \"The wp-config.php file is not writable. Please make the file writable in order to be able to proceed further.\";\n } else {\n $result[\"response\"] = true;\n $result[\"message\"] = \"Writable.\";\n }\n\n } else {\n $result[\"response\"] = false;\n $result[\"message\"] = \"The config file was not found.\";\n }\n\n $initActions = new FLO_LAUNCH_ACTIONS();\n $initActions->logMessage('Clone Status :: ' . json_encode($result));\n echo json_encode($result);\n\n die();\n }", "protected function getDropboxCreds()\n {\n return include 'data/dropboxcreds.config.php';\n }", "public function credentials_test($posted_settings) {\n\n\t\t$server = $posted_settings['server'];\n\t\t$login = $posted_settings['login'];\n\t\t$pass = $posted_settings['pass'];\n\t\t$path = $posted_settings['path'];\n\t\t$nossl = $posted_settings['nossl'];\n\t\t$passive = empty($posted_settings['passive']) ? false : true;\n\t\t\n\t\t$disable_verify = $posted_settings['disableverify'];\n\t\t$use_server_certs = $posted_settings['useservercerts'];\n\n\t\tif (empty($server)) {\n\t\t\t_e('Failure: No server details were given.', 'updraftplus');\n\t\t\treturn;\n\t\t}\n\t\tif (empty($login)) {\n\t\t\tprintf(__('Failure: No %s was given.', 'updraftplus'), __('login', 'updraftplus'));\n\t\t\treturn;\n\t\t}\n\t\tif (empty($pass)) {\n\t\t\tprintf(__('Failure: No %s was given.', 'updraftplus'), __('password', 'updraftplus'));\n\t\t\treturn;\n\t\t}\n\n\t\tif (preg_match('#ftp(es|s)?://(.*)#i', $server, $matches)) $server = untrailingslashit($matches[2]);\n\n\t\t// $ftp = $this->getFTP($server, $login, $pass, $nossl, $disable_verify, $use_server_certs);\n\t\t$ftp = $this->getFTP($server, $login, $pass, $nossl, $disable_verify, $use_server_certs, $passive);\n\n\t\tif (!$ftp->connect()) {\n\t\t\t_e('Failure: we did not successfully log in with those credentials.', 'updraftplus');\n\t\t\treturn;\n\t\t}\n\t\t// $ftp->make_dir(); we may need to recursively create dirs? TODO\n\n\t\t$file = md5(rand(0, 99999999)).'.tmp';\n\t\t$fullpath = trailingslashit($path).$file;\n\t\t\n\t\tif ($ftp->put(ABSPATH.WPINC.'/version.php', $fullpath, FTP_BINARY, false, true)) {\n\t\t\techo __(\"Success: we successfully logged in, and confirmed our ability to create a file in the given directory (login type:\", 'updraftplus').\" \".$ftp->login_type.')';\n\t\t\t@$ftp->delete($fullpath);// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged\n\t\t} else {\n\t\t\t_e('Failure: we successfully logged in, but were not able to create a file in the given directory.', 'updraftplus');\n\t\t\tif (!empty($ftp->ssl)) {\n\t\t\t\techo ' '.__('This is sometimes caused by a firewall - try turning off SSL in the expert settings, and testing again.', 'updraftplus');\n\t\t\t}\n\t\t}\n\n\t}", "public function credentials_available() {\n\n\t\t$ok_to_continue = true;\n\n\t\t// check to make sure that a public ssh key is available.\n\t\tif ( $ok_to_continue ) {\n\t\t\tif ( empty( wpcd_get_early_option( 'vpn_' . $this->get_provider_slug() . '_sshkey_id' ) ) ) {\n\t\t\t\t$ok_to_continue = false;\n\t\t\t}\n\t\t}\n\n\t\t// check to make sure that we have a private key to match the public key.\n\t\tif ( $ok_to_continue ) {\n\t\t\tif ( empty( wpcd_get_early_option( 'vpn_' . $this->get_provider_slug() . '_sshkey' ) ) ) {\n\t\t\t\t$ok_to_continue = false;\n\t\t\t}\n\t\t}\n\t\tif ( $ok_to_continue ) {\n\t\t\tif ( empty( $this->get_api_key() ) ) {\n\t\t\t\t$ok_to_continue = false;\n\t\t\t}\n\t\t}\n\n\t\treturn $ok_to_continue;\n\n\t}", "private function loadFileSystemCredentials() {\n $this->fileSystemCredentials = [];\n\n $searchPaths = $this->fileResolver->getSearchPaths();\n foreach ($searchPaths as $searchPath) {\n $credentialDir = $searchPath . \"/Config/credentials\";\n if (file_exists($credentialDir)) {\n $fileCredentials = scandir($credentialDir);\n foreach ($fileCredentials as $fileCredential) {\n if (strpos($fileCredential, \".json\")) {\n $splitFilename = explode(\".\", $fileCredential);\n $instance = $this->jsonToObjectConverter->convert(file_get_contents($credentialDir . \"/\" . $fileCredential), AuthenticationCredentialsInstance::class);\n $instance->setKey($splitFilename[0]);\n $this->fileSystemCredentials[$splitFilename[0]] = $instance;\n }\n }\n }\n }\n\n\n }", "function verify() {\n parent::verify();\n if ($this->context->type == 'site') {\n // Create the configuration file directory.\n provision_file()->create_dir($this->server->cdn_config_path, dt(\"NginX CDN\"), 0700);\n // Sync the directory to the remote server if needed.\n $this->sync($this->server->cdn_config_path);\n }\n }", "private function checkAccessToken() {\n if (!$token = file_get_contents(urlencode($this->tokenFile))) {\n $accessToken = $this->getAccessToken();\n $this->driveClient->setAccessToken($accessToken);\n } else {\n $localToken = json_decode(unserialize($token));\n $accessToken = $localToken->refresh_token;\n $this->driveClient->refreshToken($accessToken);\n }\n }" ]
[ "0.6490243", "0.58031803", "0.57886684", "0.5782781", "0.5744084", "0.57102007", "0.56756693", "0.566802", "0.5598252", "0.5534784", "0.550677", "0.5453278", "0.544653", "0.5418583", "0.5416598", "0.5406824", "0.5377544", "0.5360352", "0.53390086", "0.53250027", "0.5235724", "0.5230729", "0.52243173", "0.5220086", "0.5209573", "0.52031875", "0.5197217", "0.5191659", "0.5185634", "0.5172184" ]
0.7098232
0
Fetches all attribute relation from the database that are assigned to a product specified through pUid. It can also fetch information about the attribute and a list of attribute values if the attribute has a valuelist.
function getAttributesForProduct($pUid, $separateCT1 = false, $addAttributeData = false, $getValueListData = false) { if (!$pUid) { return false; } // get all attributes for the product $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( 'distinct *', 'tx_commerce_products_attributes_mm', 'uid_local=' .intval($pUid), '', 'sorting, uid_foreign DESC, uid_correlationtype ASC' ); if ($GLOBALS['TYPO3_DB']->sql_num_rows($res) ==0){ return false; } $result = array(); while ($relData = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { if ($addAttributeData) { // fetch the data from the attribute table $aRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery( '*', 'tx_commerce_attributes', 'uid=' .intval($relData['uid_foreign']) .$this->enableFields('tx_commerce_attributes'), '', 'uid' ); $aData = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($aRes); $relData['attributeData'] = $aData; if ($aData['has_valuelist'] && $getValueListData) { // fetch values for this valuelist entry $vlRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery( '*', 'tx_commerce_attribute_values', 'attributes_uid=' .intval($aData['uid']) .$this->enableFields('tx_commerce_attribute_values'), '', 'uid' ); $vlData = array(); while ($vlEntry = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($vlRes)) { $vlData[$vlEntry['uid']] = $vlEntry; } $relData['valueList'] = $vlData; } if ($aData['has_valuelist']) { $relData['has_valuelist'] = '1'; }else { $relData['has_valuelist'] = '0'; } } if (empty($relData)) continue; if ($separateCT1) { if ($relData['uid_correlationtype'] == 1 && $relData['attributeData']['has_valuelist'] == 1) { $result['ct1'][] = $relData; } else { $result['rest'][] = $relData; } } else { $result[] = $relData; } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAttributeData($aUid, $select = '*')\t{\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select, 'tx_commerce_attributes', 'uid=' .intval($aUid));\n\t\treturn $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\n\t}", "public function getAllAttrForProduct($iProductId)\n {\n return \\Model::factory('attr')\n ->select('attr.*' )\n ->join('attr2pizza', ['attr.id', '=', 'attr2pizza.attr_id'])\n\t\t\t->where('attr2pizza.pizza_id', $iProductId)\n ->order_by_asc('attr.name')\n ->find_many();\n }", "function getAttributeValue($pUid, $aUid, $relationTable, $relationData = NULL, $attributeData = NULL)\t{\n\t\tif ($relationData == NULL || $attributeData == NULL) {\n\t\t\t\t// data from database if one of the arguments is NULL. This nesccessary\n\t\t\t\t// to keep the data consistant\n\t\t\t$relRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t'uid_valuelist,default_value,value_char',\n\t\t\t\t$relationTable,\n\t\t\t\t'uid_local=' .intval($pUid) .' AND uid_foreign=' .intval($aUid)\n\t\t\t);\n\t\t\t$relationData = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($relRes);\n\n\t\t\t$attributeData = $this->getAttributeData($aUid, 'has_valuelist,unit');\n\t\t}\n\t\tif ($attributeData['has_valuelist'] == '1')\t{\n\t\t\tif ($attributeData['multiple'] == 1)\t{\n\t\t\t\t$result = array();\n\t\t\t\tif (is_array($relationData))\t{\n\t\t\t\t\tforeach ($relationData as $relation)\t{\n\t\t\t\t\t\t$valueRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t\t\t'value',\n\t\t\t\t\t\t\t'tx_commerce_attribute_values',\n\t\t\t\t\t\t\t'uid=' .intval($relation['uid_valuelist']) .$this->enableFields('tx_commerce_attribute_values')\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$value = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($valueRes);\n\t\t\t\t\t\t$result[] = $value['value'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn '<ul><li>' .implode('</li><li>', $result) .'</li></ul>';\n\n\t\t\t} else {\n\t\t\t\t\t// fetch data from attribute values table\n\t\t\t\t$valueRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t'value',\n\t\t\t\t\t'tx_commerce_attribute_values',\n\t\t\t\t\t'uid=' .intval($relationData['uid_valuelist']) .$this->enableFields('tx_commerce_attribute_values')\n\t\t\t\t);\n\t\t\t\t$value = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($valueRes);\n\t\t\t\treturn $value['value'];\n\t\t\t}\n\t\t} elseif (!empty($relationData['value_char']))\t{\n\t\t\t\t// the value is in field default_value\n\t\t\treturn $relationData['value_char'] .' ' .$attributeData['unit'];\n\t\t} else {\n\t\t\treturn $relationData['default_value'] .' ' .$attributeData['unit'];\n\t\t}\n\t}", "function attributeList()\n\t{\n\t\t$sql= \"SELECT attrib_name, attrib_value \n\t\tFROM `attribute_value_table` av, attribute_table at\n\t\tWHERE av.attrib_id = at.attrib_id AND av.attrib_value_id IN (SELECT attrib_value_id \n\t\tFROM product_attrib_values_table\n\t\tWHERE product_id =\".(int)$_GET['prodid'].')';\n\t\t\n\t\t$query = new Bin_Query();\n\t\tif($query->executeQuery($sql))\n\t\t{\t\t\n\t\t\treturn Display_DProductDetail::attributeList($query->records);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//return \"Not Found\";\n\t\t}\n\t}", "function getAttributeDetails($argPId = 0)\n {\n $varQuery2 = \"SELECT pkAttributeId,AttributeLabel,AttributeInputType,GROUP_CONCAT(OptionTitle) as OptionTitle, GROUP_CONCAT(pkOptionID) as pkOptionID, AttributeOptionValue FROM \" . TABLE_PRODUCT_TO_OPTION . \" LEFT JOIN \" . TABLE_ATTRIBUTE . \" ON fkAttributeId = pkAttributeId LEFT JOIN \" . TABLE_ATTRIBUTE_OPTION . \" ON fkAttributeOptionId = pkOptionId WHERE fkProductId = '\" . $argPId . \"' AND `AttributeVisible`='yes' GROUP BY pkAttributeId ASC\";\n $arrRes = $this->getArrayResult($varQuery2);\n return $arrRes;\n }", "public function allAttributes()\n {\n $id = $this->id;\n if (empty($id)) {\n $id = 0;\n }\n $b = DB::raw('SELECT * FROM product_attributes LEFT JOIN ( SELECT product_product_attribute.`product_id`, product_product_attribute.`attr_value`, product_product_attribute.`product_attribute_id` FROM product_product_attribute LEFT JOIN products ON product_product_attribute.`product_id` = products.id WHERE `product_id` = ' . $id . ') as a ON a.`product_attribute_id` = product_attributes.id ORDER BY id');\n return DB::select($b);\n //TODO переделать в норм запрос\n }", "public function attributes()\n\t{\n\t\treturn $this->hasMany(ProductAttributes::class, 'product_id');\n\t}", "public function getProductAttributesData() {\n try {\n $query = $this->connection->select('paragraphs_item_field_data', 'pifd');\n $query->addField('pfv', 'field_value_value', 'p_value');\n $query->addField('pfk', 'field_key_value', 'p_key');\n $query->addJoin('left', 'paragraph__field_key',\n 'pfk', 'pfk.entity_id = pifd.id');\n $query->addJoin('left', 'paragraph__field_value', 'pfv',\n 'pfv.entity_id = pifd.id');\n $query->condition('pifd.type', 'product_attributes', '=');\n $query->condition('pifd.id', $this->paragraphId, 'IN');\n $result = $query->distinct()->execute()->fetchAll();\n\n $product_attributes = [];\n if (!empty($result)) {\n foreach ($result as $value) {\n $product_attributes[$value->p_key] = $value->p_value;\n }\n }\n\n return $product_attributes;\n }\n catch (\\Exception $e) {\n $logger = $this->getLogger('developer-portal-paragraph');\n $logger->error($e->getMessage());\n }\n }", "public function getProductAttribute()\n {\n return $this->hasOne(ProductAttribute::className(), ['id' => 'product_attribute_id']);\n }", "function getAttributesForArticle($aUid, $ct = NULL, $excludeAttributes = NULL)\t{\n\t\t\t// build the basic query\n\t\t$where = 'uid_local=' .$aUid;\n\n\t\tif ($ct != NULL)\t{\n\t\t\t$pUid = $this->getProductOfArticle($aUid, 'uid');\n\t\t\t\n\t\t\t$productAttributes = $this->getAttributesForProduct($pUid['uid']);\n\t\t\t$ctAttributes = array();\n\t\t\tif (is_array($productAttributes))\t{\n\t\t\t\tforeach ($productAttributes as $productAttribute)\t{\n\t\t\t\t\tif ($productAttribute['uid_correlationtype'] == $ct)\t{\n\t\t\t\t\t\t$ctAttributes[] = $productAttribute['uid_foreign'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (count($ctAttributes) > 0)\t{\n\t\t\t\t\t$where .= ' AND uid_foreign IN (' .implode(',', $ctAttributes) .')';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t\t// should we exclude some attributes\n\t\tif (is_array($excludeAttributes) && count($excludeAttributes) > 0)\t{\n\t\t\t$eAttributes = array();\n\t\t\tforeach ($excludeAttributes as $eAttribute) $eAttributes[] = (int)$eAttribute['uid_foreign'];\n\t\t\t$where .= ' AND uid_foreign NOT IN (' .implode(',', $eAttributes) .')';\n\t\t}\n\n\t\t\t// execute the query\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t'*',\n\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t\t\t$where\n\t\t);\n\n\t\t\t// build the result and return it...\n\t\t$result = array();\n\t\twhile ($attribute = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))\t{\n\t\t\t$result[] = $attribute;\n\t\t}\n\t\treturn $result;\n\t}", "private function fetch_data()\n {\n $AttributeGroupGet = $this->CoreModel('AttributeGroupGet');\n\n $params = array('id_group' => $this->id_group );\n\n $result = $AttributeGroupGet->run( $params );\n\n $this->view->attribute_group_name = $result['title'];\n\n $AttributeGet = $this->CoreModel('AttributeGet');\n\n $params = array('id_attribute' => $this->id_attribute,\n 'system_serial' => true) ;\n\n $result = $AttributeGet->run( $params );\n\n $this->view->attribute_result = $result;\n }", "function getAttributesForCategory($cUid, $ct = NULL, $excludeAttributes = NULL, $uidField = 'uid')\t{\n\t\t\t// build the basic query\n\t\t$where = 'uid_local=' .$cUid;\n\n\t\t\t// select only for a special correlation type?\n\t\t($ct == NULL) ? '' : $where .= ' AND uid_correlationtype=' .intval($ct);\n\n\t\t\t// should we exclude some attributes\n\t\tif (is_array($excludeAttributes) && count($excludeAttributes) > 0)\t{\n\t\t\t$eAttributes = array();\n\t\t\tforeach ($excludeAttributes as $eAttribute) $eAttributes[] = (int)$eAttribute['uid_foreign'];\n\t\t\t$where .= ' AND uid_foreign NOT IN (' .implode(',', $eAttributes) .')';\n\t\t}\n\n\t\t\t// execute the query\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t'*',\n\t\t\t'tx_commerce_categories_attributes_mm',\n\t\t\t$where,\n\t\t\t'', 'sorting'\n\t\t);\n\n\t\t\t// build the result and return it...\n\t\t$result = array();\n\t\twhile ($attribute = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))\t{\n\t\t\t$result[] = $attribute;\n\t\t}\n\t\treturn $result;\n\t}", "public function product_attributes()\n {\n \treturn $this->hasMany(Product_attribute::class, 'variant_id');\n }", "function getCategoriesForProductFromDB($pUid)\t{\n\t\t\t// get categories that are directly stored in the product dataset\n\t\t$pCategories = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid_foreign', 'tx_commerce_products_categories_mm', 'uid_local=' .intval($pUid));\n\t\t$result = array();\n\t\twhile ($cUid = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($pCategories))\t{\n\t\t\t$this->getParentCategories($cUid['uid_foreign'], $result);\n\t\t}\n\t\treturn $result;\n\t}", "function getCtForAttributeOfProduct($aUid, $pUid)\t{\n\t\t$ctRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t'uid_correlationtype',\n\t\t\t'tx_commerce_products_attributes_mm',\n\t\t\t'uid_local=' .intval($pUid) .' AND uid_foreign=' .intval($aUid)\n\t\t);\n\t\t$uidCT = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($ctRes);\n\t\treturn $uidCT['uid_correlationtype'];\n\t}", "public function productattributevalue()\n {\n return $this->hasMany(ProductAttribute::class,'products_attributes_values');\n\n }", "public function attributes()\n {\n $this->prepare($this->adapter->attributes($this->table));\n $this->execute();\n return $this->statement->fetchAll(PDO::FETCH_OBJ);\n }", "public function getAttributeOptions(\\Magento\\Eav\\Model\\Entity\\Attribute\\AbstractAttribute $attribute, $productId);", "public function getproductinfoAction() {\r\r\n\t\t$productid = '385'; // test sentence\r\r\n\t\t$product = Mage::getModel ( 'catalog/product' )->load ( $productid );\r\r\n\t\t//$product = Mage::getModel ( 'catalog/product' )->getCollection ()->getFirstItem ();//test sentence\r\r\n\t\tforeach ( $product->getAttributes () as $att ) {\r\r\n\t\t\t$group_id = $att->getData ( 'attribute_group_id' );\r\r\n\t\t\t$group = Mage::getModel ( 'eav/entity_attribute_group' )->load ( $group_id );\r\r\n\t\t\tvar_dump ( $group );\r\r\n\t\t}\r\r\n\t\t$attrSetName = 'my_custom_attribute';\r\r\n\t\t$attributeSetId = Mage::getModel ( 'eav/entity_attribute_set' )->load ( $attrSetName, 'attribute_set_name' )->getAttributeSetId ();\r\r\n\t\t// get a drop down lists options for a mulit-select attribute\r\r\n\t\t$attribute = Mage::getModel ( 'eav/config' )->getAttribute ( 'catalog_product', 'attribute_id' );\r\r\n\t\tforeach ( $attribute->getSource ()->getAllOptions ( true, true ) as $option ) {\r\r\n\t\t\t$attributeArray [$option ['value']] = $option ['label'];\r\r\n\t\t}\r\r\n\t\tvar_dump ( $$attributeArray );\r\r\n\t\t// 获取产品属性集\r\r\n\t\t$sets = Mage::getResourceModel ( 'eav/entity_attribute_set_collection' )->setEntityTypeFilter ( Mage::getModel ( 'catalog/product' )->getResource ()->getTypeId () )->load ()->toOptionHash ();\r\r\n\t}", "public function FetchAttributes()\n {\n if ($this->attributes)\n return $this->attributes;\n\n $this->attributes = array();\n $stmt = Bugdar::$db->Prepare(\"SELECT * from \" . TABLE_PREFIX . \"bug_attributes WHERE bug_id = ?\");\n $stmt->Execute(array($this->bug_id));\n while ($attr = $stmt->FetchObject()) {\n $this->attributes[] = $attr;\n }\n return $this->attributes;\n }", "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 getProductAttributes($orderId) {\n /**\n * To create instance for object manager\n */\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ();\n /**\n * Assign attribute datas\n */\n $attributeDatas = array ();\n /**\n * Get order details\n */\n $orderDetails = $objectManager->get ( 'Magento\\Sales\\Model\\Order' );\n $orderData = $orderDetails->load ( $orderId );\n /**\n * Get all item from order data\n */\n $orderItems = $orderData->getAllItems ();\n /**\n * Iterate the order items\n */\n foreach ( $orderItems as $item ) {\n /**\n * Get product id from item\n */\n $marketplaceproductId = $item->getProductId ();\n /**\n * Get product data\n */\n $marketplaceProduct = $objectManager->get ( 'Magento\\Catalog\\Model\\Product' )->load ( $marketplaceproductId );\n /**\n * Get type id\n */\n $typeId = $marketplaceProduct->getTypeId ();\n /**\n * Checking for product type equal to configurable\n */\n if ($typeId == \"configurable\") {\n /**\n * Set custom options\n */\n $customOptions = $item->getProductOptions ();\n /**\n * Assign attribute data\n */\n $attributeDatas [$marketplaceproductId] = $customOptions ['attributes_info'];\n }\n }\n /**\n * To return attribute datas\n */\n return $attributeDatas;\n }", "public function getAttributes()\n {\n if ($this->getData('attributes') == null) {\n\n $attributes = array();\n $collection = Mage::getResourceModel('catalog/product_attribute_collection')\n ->setEntityTypeFilter(Mage_Catalog_Model_Product::ENTITY)\n ->addFieldToFilter('is_displayed_in_autocomplete', 1);\n\n foreach ($collection as $attribute) {\n $attributes[] = $attribute->getAttributeCode();\n $this->_attributesByCode[$attribute->getAttributeCode()] = $attribute;\n }\n\n $this->setAttributes($attributes);\n }\n\n return $this->getData('attributes');\n }", "public function fetchAll($attribute)\r\n {\r\n \t$this->attribute = $attribute;\r\n \t\r\n \t// get from mem if available\r\n \t$memcache = new \\Memcached();\r\n \t$memcache->addServer('localhost', 11211);\r\n \t$key = md5('OptionList::fetchAll' . $attribute);\r\n \t$cache_data = $memcache->get($key);\r\n \tif ($cache_data) {\r\n \t\t$this->data = $cache_data;\r\n \t} else {\r\n\t\t\t$this->data = $this->client->catalogProductAttributeOptions($this->sessionid, $attribute);\r\n\t\t\t$result = $memcache->set($key, $this->data, 60*10);\r\n\t\t\tif ($result === false) {\r\n\t\t\t $this->log->addInfo('cache not set', array(\"result\" => $memcache->getResultCode()));\r\n\t\t\t}\r\n \t}\r\n }", "private function loadAttributes() {\n\n\t\t// if parameter is wrong or GET is blocked\n\t\tif (!RESTClient::setRequestMethod(HTTPRequestMethod::GET)) {\n\t\t\treturn;\n\t\t}\n\n\t\t$content = RESTClient::send(self::RESTPATH . \"/\" . $this->productID . \"/\" . self::RESTPATH_ATTRIBUTES);\n\n\t\t// if respond is empty\n\t\tif (InputValidator::isEmpty($content)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// if there are items\n\t\tif (InputValidator::isEmptyArrayKey($content, \"items\")) {\n\t\t Logger::error(\"Respond for \" . self::RESTPATH . \"/\" . $this->productID . \"/\" . self::RESTPATH_ATTRIBUTES . \"can not be interpreted.\");\n\t\t\treturn;\n\t\t}\n\n\t\t// is there any attribute found: load the attribute.\n\t\tforeach ($content['items'] as $number => $attribute) {\n\n\t\t\t// parse every attribute\n\t\t\t$this->attributes[$number] = new ProductAttribute($attribute);\n\t\t}\n\n\t\t// update timestamp when make the next request\n\t\t$timestamp = (int) (microtime(true) * 1000);\n\t\t$this->NEXT_REQUEST_TIMESTAMP = $timestamp + RESTClient::$NEXT_RESPONSE_WAIT_TIME;\n\t}", "public function getAttributes()\n\t{\n\t\t$AttrList=\\DB::table('prod_attributes')->select('Attrb_ID','Attrb_Name')\n\t\t->get();\n\t\t$AttrResp=array($AttrList);\n\t\treturn $AttrResp;\n\t}", "protected function fetch() {\n global $cookie;\n\n $this->query->leftJoin('attribute_lang', 'al', 'a.id_attribute = al.id_attribute');\n $this->query->select('a.id_attribute, al.name');\n //don't know why doens't allow $query->where('al.id_lang', $cookie->id_lang)\n $this->query->where('al.id_lang = ' . pSQL($cookie->id_lang));\n \n return $this->query('a');\n }", "protected function _getAttributesCollection()\n {\n if (!$this->_attributesCollection) {\n $this->_attributesCollection = Mage::getResourceModel('catalog/product_attribute_collection')\n ->load();\n\n foreach ($this->_attributesCollection as $attribute) {\n $attribute->setEntity($this->getEntity());\n }\n }\n return $this->_attributesCollection;\n }", "public function get_product_data()\n {\n $query = \"\n SELECT\n prd_id,\n prd_product,\n prd_price + (1000 - MOD(prd_price,1000)) AS prd_price,\n prd_atlas,\n prd_type\n FROM bc_product\n\n INNER JOIN\n (\n SELECT\n mpr_product,\n SUM(mtr_price) AS prd_price\n FROM bc_material_product\n\n INNER JOIN bc_material\n ON mpr_material = mtr_id\n\n GROUP BY mpr_product\n ) product_price\n ON prd_id = mpr_product\n \";\n\n $result = $this->ManualQuery($query);\n if ($result && $this->CountRow() > 0) {\n return $this->FetchData();\n } else {\n return [];\n }\n }", "public function getAllAttributes()\n {\n $query = $this->pdo->prepare(\"SELECT id,name,created_at,updated_at from attribute\");\n $query->execute();\n $row = $query->fetchALL(PDO::FETCH_ASSOC);\n $attributes= [];\n foreach ($row as $r) {\n array_push($attributes, $this->mapArrayToAttributes($r));\n }\n return $attributes;\n }" ]
[ "0.63147324", "0.6136002", "0.602912", "0.59513795", "0.5861901", "0.5771379", "0.5764533", "0.5702455", "0.5698424", "0.5688425", "0.5547842", "0.5416989", "0.5377822", "0.53339195", "0.53154767", "0.53135085", "0.5309509", "0.5305424", "0.529554", "0.5287092", "0.5252892", "0.52383834", "0.52136385", "0.5213283", "0.5172471", "0.51281697", "0.50452226", "0.50355154", "0.50009364", "0.49942628" ]
0.70855004
0
Get all parent categories for a list of given categories. This method calls the "getParentCategories" method. That one will work recursive. The result will be written into the argument cUidList.
function getParentCategoriesFromList(&$cUidList) { if(is_array($cUidList)){ foreach ($cUidList as $cUid) { $this->getParentCategories($cUid, $cUidList); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllParentCategories() {\n $rootId = Mage::app()->getWebsite(true)->getDefaultStore()->getRootCategoryId();\n $categories = Mage::getModel('catalog/category')->load($rootId)->getChildrenCategories();\n foreach($categories as $category) {\n \t$category->load($category->getId());\n $this->categories_parent[$category->getId()] = array(\n 'value' => $category->getId(),\n 'attribute_id' => $category->getVesAttributeSet(),\n 'label' => $category->getName(),\n 'level' => $category->getLevel(),\n\t\t\t\t'style' => \"\",\n );\n\t\t\t\n\t\t\tif($category->hasChildren()) {\n\t\t\t\t$children = Mage::getModel('catalog/category')->getCategories($category->entity_id);\n\t\t\t\t$this->getAllChildCategorys($children, \" --> \");\n }\n }\n return $this->categories_parent;\n }", "function getParentCategories($cUid, &$cUidList, $dontAdd = 0, $excludeUid = 0, $recursive = true)\t{\n\t\tif (strlen((string)$cUid) == 0) return;\n\n\t\t\t// add the submitted uid to the list if it is bigger than 0 and not already in the list\n\t\tif ($cUid > 0 && $cUid != $excludeUid)\t{\n\t\t\tif (!in_array($cUid, $cUidList) && $cUid != $dontAdd) $cUidList[] = $cUid;\n\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t'uid_foreign',\n\t\t\t\t'tx_commerce_categories_parent_category_mm',\n\t\t\t\t'uid_local=' .intval($cUid),\n\t\t\t\t'', 'uid_foreign'\n\t\t\t);\n\n\t\t\twhile ($relData = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))\t{\n\t\t\t\tif ($recursive)\t{\n\t\t\t\t\t$this->getParentCategories($relData['uid_foreign'], $cUidList, $cUid, $excludeUid);\n\t\t\t\t} else {\n\t\t\t\t\t$cUid = $relData['uid_foreign'];\n\t\t\t\t\tif (!in_array($cUid, $cUidList) && $cUid != $dontAdd) $cUidList[] = $cUid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}", "public function getParentCategories()\n {\n $rootCategoryId = $this->storeManager->getStore(1)->getRootCategoryId();\n $rootCategory = $this->categoryRepository->get($rootCategoryId);\n $subCategoryIds = $rootCategory->getChildren();\n $subCategoryIds = explode(',',$subCategoryIds);\n $limit = 6;\n $data = [];\n $i = 0;\n foreach ($subCategoryIds as $subCategory) {\n\n try {\n $category = $this->categoryRepository->get($subCategory);\n } catch (NoSuchEntityException $e) {\n $category = false;\n }\n\n if ($category) {\n if ($category->getIncludeInMenu()) {\n $i++;\n $data[] = [\n 'id' => $category->getId(),\n 'name' => ucwords($category->getName()),\n 'url' => $category->getUrl()\n ];\n if ($i >= $limit) {\n break;\n }\n }\n }\n\n }\n return $data;\n }", "public function getAllParentCategories()\n {\n $parents = array($this);\n $p = $this;\n while ($p->parent_id) {\n $p = $p->parent;\n $parents[] = $p;\n }\n return array_reverse($parents);\n }", "function getChildCategories($cUid, &$cUidList, $dontAdd = 0, $excludeUid = 0, $recursive = true)\t{\n\t\tif (strlen((string)$cUid) == 0) return;\n\n\t\t\t// add the submitted uid to the list if it is bigger than 0 and not already in the list\n\t\tif ($cUid > 0 && $cUid != $excludeUid)\t{\n\t\t\tif (!in_array($cUid, $cUidList) && $cUid != $dontAdd) $cUidList[] = $cUid;\n\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t'uid_local',\n\t\t\t\t'tx_commerce_categories_parent_category_mm',\n\t\t\t\t'uid_foreign=' .intval($cUid),\n\t\t\t\t'',\n\t\t\t\t'uid_local'\n\t\t\t);\n\t\t\t\n\t\t\tif (!$res)\t{\n\t\t\t\t// $GLOBALS['TYPO3_DB']->sql_num_rows($res) == 0)\t{\n\t\t\t\treturn array();\n\t\t\t}\n\n\t\t\twhile ($relData = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))\t{\n\t\t\t\tif ($recursive)\t{\n\t\t\t\t\t$this->getChildCategories($relData['uid_local'], $cUidList, $cUid, $excludeUid);\n\t\t\t\t} else {\n\t\t\t\t\t$cUid = $relData['uid_local'];\n\t\t\t\t\tif (!in_array($cUid, $cUidList) && $cUid != $dontAdd) $cUidList[] = $cUid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}", "public function getAllParentCategory()\n {\n $select = $this->select()\n ->from($this->info('name'), array(\"category_id\", \"category_name\", \"cat_order\"))\n ->where(\"cat_dependency = 0 AND subcat_dependency = 0\");\n \n return $this->fetchAll($select);\n }", "function prj_recursiveCatList($cid=0,$selectlist='') {\r\n global $_TABLES;\r\n $query = DB_QUERY(\"SELECT cid,pid,name FROM {$_TABLES['nxfile_categories']} WHERE pid = $cid ORDER BY cid\");\r\n $selectlist[] = $cid;\r\n while ( list($cid,$pid,$name) = DB_fetchArray($query)) {\r\n // Check and see if this category has any sub categories - where a category record has this cid as it's parent\r\n if (DB_COUNT($_TABLES['nxfile_categories'], 'pid', $cid) > 0) {\r\n $selectlist[] = $cid;\r\n $selectlist = prj_recursiveCatList($cid,$selectlist);\r\n } else {\r\n $selectlist[] = $cid;\r\n }\r\n }\r\n return $selectlist;\r\n}", "function getAllParentCats() {\n\t\t\tApp::import('model','Category');\n\t\t $this->Category = new Category();\n\t\t\t$catlist = $this->Category->find('list',array('conditions'=>array('Category.publish'=>'yes'),'fields'=>array('Category.id'),'order'=>array('Category.order,Category.categoryname')));\n\t\t\treturn array_values($catlist);\n\t}", "public static function getAllParents($online_only = false)\n {\n $query = 'SELECT category_id FROM '. rex::getTablePrefix() .'d2u_courses_categories AS cats'\n .' WHERE parent_category_id <= 0 ';\n if ($online_only) {\n $query = 'SELECT url_cat.category_id FROM '. rex::getTablePrefix() .'d2u_courses_url_categories AS url_cat '\n .'LEFT JOIN '. rex::getTablePrefix() .'d2u_courses_categories AS cats '\n .'ON url_cat.category_id = cats.category_id '\n .' WHERE url_cat.parent_category_id <= 0 ';\n }\n if ('priority' === rex_addon::get('d2u_courses')->getConfig('default_category_sort', 'name')) {\n $query .= 'ORDER BY cats.priority';\n } else {\n $query .= 'ORDER BY cats.name';\n }\n $result = rex_sql::factory();\n $result->setQuery($query);\n $num_rows = $result->getRows();\n\n $categories = [];\n for ($i = 0; $i < $num_rows; ++$i) {\n $categories[(int) $result->getValue('category_id')] = new self((int) $result->getValue('category_id'));\n $result->next();\n }\n\n return $categories;\n }", "public function getCategoriesParentId()\n {\n global $allCateIdParent;\n if (isset($allCateIdParent)) {\n return $allCateIdParent;\n }\n\n $keyCategoryAll = Constants::CACHE_CATEGORY_ALL_SLUG_CHILD;\n $cacheService = CacheProvider::createInstance($this->request, Constants::SERVER_CACHE_ARTICLE, $this->cacheParams);\n $allCateIdParent = $cacheService->get($keyCategoryAll);\n if ($allCateIdParent === false) {\n $em = $this->doctrine->getManager();\n $cates = $em->getRepository(Categories::class)->getAllCategories();\n foreach ($cates as $cate) {\n if ($cate['parentId'] == 0) {\n $allCateIdParent[$cate['cateId']][] = $cate['cateId'];\n } else {\n $allCateIdParent[$cate['parentId']][] = $cate['cateId'];\n }\n }\n $cacheService->set($keyCategoryAll, $allCateIdParent, self::CATEGORY_CACHE_TIME);\n }\n\n return $allCateIdParent;\n }", "public function getParentsIds($categoryId)\n\t{\n\t\t$parent = [];\n\t\t$recordCategory = $categoryId;\n\t\tif (\\is_array($this->parentsId) && false !== $this->rootCategory) {\n\t\t\tdo {\n\t\t\t\tif (!empty($this->parentsId[$recordCategory]) && $this->rootCategory !== $this->parentsId[$recordCategory]) {\n\t\t\t\t\t$parent[] = $this->mapCategoryYF[$this->parentsId[$recordCategory]];\n\t\t\t\t\t$recordCategory = $this->parentsId[$recordCategory];\n\t\t\t\t} elseif (!empty($this->parentsId[$recordCategory])) {\n\t\t\t\t\t$recordCategory = $this->parentsId[$recordCategory];\n\t\t\t\t}\n\t\t\t} while (!($this->rootCategory === $recordCategory));\n\t\t}\n\t\t$parent = array_reverse($parent);\n\t\t$parent[] = $this->mapCategoryYF[$categoryId];\n\t\treturn $parent;\n\t}", "protected function getCategoryList()\n {\n $select = $this->connection->select()->from(\n $this->getTable('catalog_category_entity'),\n ['entity_id', 'path']\n )->order(\n 'level ASC'\n );\n\n return $this->connection->fetchPairs($select);\n }", "public function getCategories($parent_id = 0) {\n\t\t$query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"category c LEFT JOIN \" . DB_PREFIX . \"category_description cd ON (c.category_id = cd.category_id) LEFT JOIN \" . DB_PREFIX . \"category_to_store c2s ON (c.category_id = c2s.category_id) WHERE cd.language_id = '\" . (int)$this->config->get('config_language_id') . \"' AND c2s.store_id = '\" . (int)$this->config->get('config_store_id') . \"' AND c.status = '1' ORDER BY c.sort_order, LCASE(cd.name)\");\n\n\t\treturn $query->rows;\n\t}", "public function test_question_categorylist_parents() {\n $this->resetAfterTest();\n $generator = $this->getDataGenerator();\n $questiongenerator = $generator->get_plugin_generator('core_question');\n $category = $generator->create_category();\n $context = context_coursecat::instance($category->id);\n // Create a top category.\n $cat0 = question_get_top_category($context->id, true);\n // Add sub-categories.\n $cat1 = $questiongenerator->create_question_category(['parent' => $cat0->id]);\n $cat2 = $questiongenerator->create_question_category(['parent' => $cat1->id]);\n // Test the 'get parents' function.\n $parentcategories = question_categorylist_parents($cat2->id);\n $this->assertEquals($cat0->id, $parentcategories[0]);\n $this->assertEquals($cat1->id, $parentcategories[1]);\n $this->assertCount(2, $parentcategories);\n }", "public static final function getCategoriesByParent($parentCategoryId, $returnArray = true)\r\n {\r\n if (false === $returnArray) {\r\n $product->_dataAccessInterface->setFetchType(\\PDO::FETCH_CLASS, __CLASS__);\r\n }\r\n\r\n return ($product->_dataAccessInterface->getAll('\r\n SELECT a.*\r\n FROM `listing_category` a\r\n INNER JOIN `listing_category_parent` b\r\n ON b.categoryId = a.id\r\n WHERE b.parentCategoryId = :categoryId\r\n GROUP BY b.categoryId\r\n ORDER BY a.name_en ASC, a.name_fr ASC;\r\n ', array('productId' => (int) $parentCategoryId)));\r\n }", "public static function getAllNotParents()\n {\n $query = 'SELECT CONCAT_WS(\" → \", parent.name, child.name) AS name, child.category_id FROM ' . rex::getTablePrefix() . 'd2u_courses_categories AS child '\n .'LEFT JOIN ' . rex::getTablePrefix() . 'd2u_courses_categories AS parent '\n .'ON child.parent_category_id = parent.category_id '\n .'LEFT JOIN ' . rex::getTablePrefix() . 'd2u_courses_categories AS grand_parent '\n .'ON parent.parent_category_id = grand_parent.category_id '\n .'WHERE (child.name, child.category_id) NOT IN '\n .'(SELECT parent_not.name, parent_not.category_id FROM ' . rex::getTablePrefix() . 'd2u_courses_categories AS child_not '\n .'LEFT JOIN ' .rex::getTablePrefix() . 'd2u_courses_categories AS parent_not '\n .'ON child_not.parent_category_id = parent_not.category_id '\n .'WHERE parent_not.category_id > 0 '\n .'GROUP BY child_not.parent_category_id) ';\n if ('priority' === rex_addon::get('d2u_courses')->getConfig('default_category_sort', 'name')) {\n $query .= 'ORDER BY child.priority';\n } else {\n $query .= 'ORDER BY child.name';\n }\n $result = rex_sql::factory();\n $result->setQuery($query);\n $num_rows = $result->getRows();\n\n $categories = [];\n for ($i = 0; $i < $num_rows; ++$i) {\n $categories[] = new self((int) $result->getValue('category_id'));\n $result->next();\n }\n\n return $categories;\n }", "private function getCategories() {\n\n //find out if a chap is associated with this CP\n $userModel = new Model_User();\n $currentCp = $userModel->find($this->_getCpId())->current();\n //var_dump($currentCp->chap_id);die();\n $categories = new Model_Category();\n /*get categories in french */\n $chapId = Zend_Auth::getInstance()->getIdentity()->id;\n if(in_array($chapId, array('585474','585480'))){\n return $categories->getCategorylistByLanguage(2);// get categories in french\n }\n /**/\n if(($currentCp->chap_id == 4348) || !($currentCp->chap_id)){\n return $categories->getCategorylist();\n } else {\n $chapCategoryModel = new Pbo_Model_ChapCategories();\n $result = $chapCategoryModel->getAllChapCategories($currentCp->chap_id);\n\n $chapCategories = array();\n foreach ($result as $row) {\n $chapCategories[$row->parent_id][$row->id] = $row->name;\n }\n return $chapCategories;\n }\n }", "public function getCategories() {\r\n $datas = CategorieIncident::model()->findAllByAttributes(array('fk_parent' => NULL));\r\n $listCategorie = array();\r\n foreach ($datas as $data) {\r\n array_push($listCategorie, $data);\r\n }\r\n return $listCategorie;\r\n }", "public function getParentCategories() {\r\n if (is_null($this->_parentCategories)) {\r\n $item = $this->getItem();\r\n if ($item && $item->getId()) {\r\n $collection = $item->getParentCategories();\r\n $this->_parentCategories = $collection;\r\n }\r\n }\r\n return $this->_parentCategories;\r\n }", "public function getParentCategories(){\n\t\ttry {\n\t\t\tparent::SetDatabaseConnection();\t\t\n\t\t\t$query = \"call SPcategorylistparent()\";\n\t\t\t//exit;\n\t\t\treturn Application_Model_Db::getResult($query);\n\t\t\t\n\t\t} catch(Exception $e) {\n\t\t\tApplication_Model_Logging::lwrite($e->getMessage());\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\t}", "public function getParentIds($categoryId = false)\n {\n if ($this->_category) {\n return $this->_category->getParentIds();\n } else {\n return $this->getCategory($categoryId)->getParentIds();\n } \n }", "public function getCategories($options = array()) {\r\n $result = array();\r\n $categoryDao = Admin_Model_DAO_Category::factory();\r\n try {\r\n $categories = $categoryDao->getCategories($options);\r\n foreach ($categories as $category) {\r\n if(!$result[$category['parent_id']]) {\r\n $tempArr = array('id' => $category['parent_id'],\r\n 'name' => $category['parent_name'],\r\n 'childs' => array(),);\r\n if($category['child_id']) {\r\n $tempArr['childs'][] = array('id' => $category['child_id'], 'name' => $category['child_name']);\r\n }\r\n $result[$category['parent_id']] = $tempArr;\r\n } else {\r\n $result[$category['parent_id']]['childs'][] = array('id' => $category['child_id'], 'name' => $category['child_name']);\r\n }\r\n }\r\n } catch (Exception $exc) {\r\n prBinh($exc);\r\n Utils_Global::storeLog($exc, __FILE__, __LINE__);\r\n }\r\n \r\n return $result;\r\n }", "function getParentCategoryList($param = array()) {\r\n $parentid = 0;\r\n if (isset($param['parentid'])) {\r\n $parentid = $param['parentid'];\r\n }\r\n $sql = \"select * from category_field where category_parent_id = {$parentid} \";\r\n $query = $this->db->query($sql);\r\n return $query->result();\r\n }", "public static function listCategoryParent($catId) {\n $item = array();\n $rs = Yii::app()->cache->get('ext_listCategoryParent_' . $catId);\n if ($rs === false) {\n $sql = 'SELECT `id`, `name`, `parentId` FROM `tbl_category` WHERE `isHidden` = 0 AND `parentId` = 0 ORDER BY `order` DESC, `name` ASC ';\n $command = Yii::app()->db->createCommand($sql);\n $rs = $command->queryAll();\n Yii::app()->cache->set('ext_listCategoryParent_' . $catId, $rs, 600);\n }\n if (is_array($rs)) {\n foreach ($rs as $key => $value) {\n// build new url category\n if ($catId && $catId == $value['id']) {\n $item[] = array('label' => $value['name'], 'url' => 'javascript:void(0)', 'itemOptions' => array('class' => 'active'), 'linkOptions' => array('onclick' => 'getParentCategory(\"' . $value['id'] . '\");'));\n } else {\n $item[] = array('label' => $value['name'], 'url' => 'javascript:void(0)', 'linkOptions' => array('onclick' => 'getParentCategory(\"' . $value['id'] . '\");', 'id' => 'cat' . $value['id']));\n }\n }\n }\n return array('items' => $item);\n }", "public function getCategories() {\n\t\t$db = $this->_db;\n\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select($db->quoteName(array('a.id', 'a.parent_id', 'a.name')));\n\t\t$query->from($db->quoteName('#__gtpihpssurvey_ref_categories', 'a'));\n\t\t\n\t\t$query->where($db->quoteName('a.published') . ' = 1');\n\t\t\n\t\t$db->setQuery($query);\n\t\t$raw = $db->loadObjectList();\n\t\t$data = array();\n\t\tforeach ($raw as $item) {\n\t\t\t$data[$item->parent_id][$item->id] = $item->name;\n\t\t}\n\t\treturn $data;\n\t}", "function getParentCategories($cId)\n\t{\n\t\t$sql = \"SELECT parent_id, 1 FROM `\".$this->mPrefix.\"flat_structure`\";\n\t\t$sql .= \"WHERE category_id = '\".$cId.\"' AND parent_id <> '\".$cId.\"'\";\n\n\t\treturn $this->getKeyValue($sql);\n\t}", "public static final function getParentCategories($returnArray = true)\r\n {\r\n\t\treturn \\Core\\Hybernate\\Listings\\Listing_Category::getMultiInstance(array('parentId' => 0), \r\n\t\t\t(bool) $returnArray, array('order_by' => 'a.orderIndex ASC, a.name_en ASC'));\t\r\n\t}", "public static function loadAllCategories(){\n $categories = \\Drupal::entityManager()->getStorage('library_category')->loadByProperties(['parent_id'=>0]);\n\n $clist = [];\n foreach( $categories as $category ){\n $sub_category = Category::loadAllChildren( $category->id() );\n $clist[ $category->id() ]['entity'] = $category;\n $clist[ $category->id() ]['child_no'] = count( $sub_category );\n\n foreach( $sub_category as $sc ){\n $clist[ $category->id() ]['child'][ $sc['entity']->id() ] = $sc;\n }\n }\n\n return $clist;\n }", "public static function get_all_child_category_ids($parent_category = 0)\n\t\t{\n\t\t\tif(is_numeric($parent_category) && $parent_category && is_array($child_categories = get_categories('child_of='.$parent_category.'&hide_empty=0')))\n\t\t\t\tforeach($child_categories as $child_category) // Go through child Categories.\n\t\t\t\t\t$child_category_ids[] = (int)$child_category->term_id;\n\n\t\t\treturn (!empty($child_category_ids) && is_array($child_category_ids)) ? array_unique($child_category_ids) : array();\n\t\t}", "function zen_get_parent_categories(&$categories, $categories_id) {\r\n global $db;\r\n $parent_categories_query = \"select parent_id\r\n from \" . TABLE_CATEGORIES . \"\r\n where categories_id = '\" . (int)$categories_id . \"'\";\r\n\r\n $parent_categories = $db->Execute($parent_categories_query);\r\n\r\n while (!$parent_categories->EOF) {\r\n if ($parent_categories->fields['parent_id'] == 0) return true;\r\n $categories[sizeof($categories)] = $parent_categories->fields['parent_id'];\r\n if ($parent_categories->fields['parent_id'] != $categories_id) {\r\n zen_get_parent_categories($categories, $parent_categories->fields['parent_id']);\r\n }\r\n $parent_categories->MoveNext();\r\n }\r\n }" ]
[ "0.6787756", "0.6701694", "0.6695365", "0.6670321", "0.66070616", "0.6572004", "0.62940115", "0.6249041", "0.6199145", "0.6031347", "0.60201716", "0.6014695", "0.59962285", "0.59922236", "0.59918296", "0.59830517", "0.59751546", "0.59402233", "0.59399265", "0.59386265", "0.59213597", "0.59042", "0.59016675", "0.58977365", "0.58871174", "0.58818364", "0.5871686", "0.5861357", "0.58382833", "0.5832555" ]
0.75645435
0
Returns all attributes for a list of categories.
function getAttributesForCategoryList($catList, $ct = NULL, $uidField = 'uid', $excludeAttributes = array()) { $result = array(); if (!is_array($catList)) return $result; foreach ($catList as $catUid) { $attributes = $this->getAttributesForCategory($catUid, $ct, $excludeAttributes, $uidField); if(is_array($attributes)){ foreach ($attributes as $attribute) { $result[] = $attribute; $excludeAttributes[] = $attribute; } } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllAttributes(): array\n {\n if (!empty(self::$allAttributes)) {\n return self::$allAttributes;\n }\n\n /** @var Category $category */\n foreach ($this->category ?? [] as $category) {\n /** @var Attribute[] $attributes */\n $attributes = $category->allAttributes(function (HasMany $builder): array {\n return $builder\n ->select(['attributes.*', 'advert_attribute.value AS value'])\n ->leftJoin('advert_attribute', function (JoinClause $join) {\n return $join->on('advert_attribute.attribute_id', 'attributes.id')\n ->where('advert_attribute.advert_id', $this->id);\n })\n ->groupBy('attributes.id', 'advert_attribute.value')\n ->getModels();\n });\n\n foreach ($attributes as $attribute) {\n if (!array_key_exists($attribute->id, self::$allAttributes)) {\n self::$allAttributes[$attribute->id] = $attribute;\n }\n }\n }\n\n return self::$allAttributes;\n }", "public static function getAllAttributesByCategory($categoryId) {\n $condition = '';\n if ($categoryId) {\n $condition = ' `categoryId` = ' . $categoryId;\n $rs = Yii::app()->cache->get('ext_getAllAttributesByCategory_' . $categoryId);\n if ($rs === false) {\n $sql = 'SELECT `id`, `name` FROM `tbl_attributes` WHERE ' . $condition;\n $command = Yii::app()->db->createCommand($sql);\n $rs = $command->queryAll();\n Yii::app()->cache->set('ext_getAllAttributesByCategory_' . $categoryId, $rs, 600);\n }\n $listAttributes = array('0' => ' -- Chọn nhóm thuộc tính --');\n if (is_array($rs)) {\n foreach ($rs as $key => $value) {\n $listAttributes[$value['id']] = $value['name'];\n }\n }\n return $listAttributes;\n }\n }", "public function getAllAttributes();", "public function getCategoryListAttribute()\n {\n return $this->categories->pluck('id')->all();\n }", "public static function getAttributesByCategory($categoryId) {\n $condition = '';\n if ($categoryId)\n $condition = ' AND `categoryId` = ' . $categoryId;\n $rs = Yii::app()->cache->get('ext_getAttributesByCategory_' . $categoryId);\n if ($rs === false) {\n $sql = 'SELECT `id`, `name` FROM `tbl_attributes` WHERE `group` = 0' . $condition;\n $command = Yii::app()->db->createCommand($sql);\n $rs = $command->queryAll();\n Yii::app()->cache->set('ext_getAttributesByCategory_' . $categoryId, $rs, 600);\n }\n $listAttributes = array('0' => ' -- Chọn nhóm thuộc tính --');\n if (is_array($rs)) {\n foreach ($rs as $key => $value) {\n $listAttributes[$value['id']] = $value['name'];\n }\n }\n return $listAttributes;\n }", "public function all_attr_cat()\n\t{\n\t\t\n\t\t$all_cat=$this->db->get_where('att_category' ,array(\"att_cat_deleted\"=>'0'));\n\t\tif($all_cat->num_rows()>0)\n\t\t{\n\t\t\treturn $all_cat;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t\t\n\t\t}\n\t}", "public function getAllAttributes()\n {\n $query = $this->pdo->prepare(\"SELECT id,name,created_at,updated_at from attribute\");\n $query->execute();\n $row = $query->fetchALL(PDO::FETCH_ASSOC);\n $attributes= [];\n foreach ($row as $r) {\n array_push($attributes, $this->mapArrayToAttributes($r));\n }\n return $attributes;\n }", "public static function get_all_attributes() \n {\n return Attribute::select('id', 'name')->get();\n }", "private function getAllCategories()\n {\n return Category::find()->all();\n }", "public function getAllAttributes()\n {\n $result = array();\n $groupArray = $this->getAllGroups();\n\n foreach ($groupArray as $key => $group) {\n $result[$group['name']] = $this->getAttributeOfGroup($group['id']);\n }\n\n return $result;\n }", "public function getCategoriesAlldataAttribute()\n {\n if (empty($this->categories)) {\n return [];\n }\n\n $resp = [];\n foreach ($this->categories as $catg) {\n $vendors_in = $this->listVendorsByCategory($catg);\n $vendors_avail = collect(VendorCategory::find($catg->id)->vendors_list)\n ->diffKeys($vendors_in)\n ->all();\n $slots_free = ($catg->pivot->slots - count($vendors_in)) >= 0\n ? $catg->pivot->slots - count($vendors_in)\n : 0;\n $resp[$catg->id] = [ \n 'name' => $catg->name,\n 'slots' => $catg->pivot->slots,\n 'slots_free' => $slots_free,\n 'vendors_in' => $vendors_in,\n 'vendors_avail' => $vendors_avail,\n ];\n }\n\n return $resp;\n }", "public function getAllCategories()\n\t{\n\t\t$db = new DB();\n\t\t$table = \"category\";\n\t\t$result = $db->selectAll($table);\n\t\treturn $result;\n\n\t}", "public function getCategoriesArray() {\n\t\t$text = Loader::helper('text');\n\t\t$categories = array();\n\t\tforeach (AttributeKeyCategory::getList() as $category) {\n\t\t\t$handle = $category->getAttributeKeyCategoryHandle();\n\t\t\t$categories[$handle] = $text->unhandle($handle);\n\t\t}\n\t\treturn $categories;\n\t}", "public function allCat()\n {\n $allcat = $this->pdo->Select(\"Select * from category\");\n\n return $allcat;\n }", "public function getAttributes(int $categoryId)\n {\n //get category\n try {\n $category = App\\Category::findOrFail($categoryId);\n } catch (ModelNotFoundException $e) {\n $response = [\n 'status' => 'error',\n 'message' => $e->getMessage(),\n ];\n return response()->json($response);\n }\n\n $attributes = $category->attributes;\n\n // **** \n // sort incorrectly for string of number\n // desc will correctly sort myopia attribute but cause other to sort desc\n // while asc will correcly sort other attribute but cuase myopia sort incorrectly \n // *****\n $attributesWithChildren = $attributes->load('attributeValues'); // old code without sort\n // $attributesWithChildren = $attributes->load(['attributeValues' => function($attributeValue) {\n // $attributeValue->orderBy('attribute_value', 'desc');\n // }]);\n\n\n if ($attributes->count() == 0) {\n $response = [\n 'Content-type' => 'application/json',\n 'status' => 'error',\n 'message' => 'No Attribute In Product',\n ];\n } else {\n $response = [\n 'Content-type' => 'application/json',\n 'status' => 'success',\n 'message' => $attributesWithChildren,\n ];\n }\n return response()->json($response);\n }", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAllCategory()\n {\n return $this->getCategoryRepository()->findAll();\n }", "public function getCategories()\n {\n return $this->categories->findAll();\n }", "public function attributes() {\n return ArrayHelper::merge(parent::attributes(), ['_keywords', 'listorder', 'cat_name']);\n }", "public function getAllCategories() {\r\n return $this->categoryDao->findAllNames();\r\n }", "public function all()\n {\n $rolesGroup = $this->getPerBundle();\n\n $attr = [];\n foreach ($rolesGroup as $bundle => $attributes) {\n foreach ($attributes as $key => $value) {\n $attr[$key] = $value;\n }\n }\n\n return $attr;\n }", "public function get_all_attributes() {\n\t\t$attributes = $this->attributes->get_all_attributes();\n\t\treturn $attributes;\n\t}", "public function getAllCustomAttributes()\n {\n return $this->customAttributes;\n }", "public static function getHomeAttributes($categoryId) {\n if ($categoryId) {\n $rs = Yii::app()->cache->get('exc_getHomeAttributes' . $categoryId);\n if ($rs === false) {\n $sql = 'SELECT `id`, `name`, `group` FROM `tbl_attributes` WHERE `categoryId` = ' . $categoryId;\n $command = Yii::app()->db->createCommand($sql);\n $rs = $command->queryAll();\n Yii::app()->cache->set('exc_getHomeAttributes' . $categoryId, $rs, 600);\n }\n $i = $j = $k = 0;\n $listAttr = array();\n if (is_array($rs)) {\n foreach ($rs as $key => $value) {\n if ($value['group'] == 0) {\n $listChirlAttr = array();\n $listAttr[$k]['name'] = $value['name'];\n $listAttr[$k]['id'] = $value['id'];\n foreach ($rs as $key2 => $val) {\n if ($val['group'] == $value['id']) {\n $listChirlAttr[$j]['name'] = $val['name'];\n $listChirlAttr[$j]['id'] = $val['id'];\n $j++;\n }\n }\n $listAttr[$k]['items'] = $listChirlAttr;\n $j = 0;\n $i++;\n $k++;\n }\n }\n }\n\n\n return $listAttr;\n } else {\n return false;\n }\n }", "public function allAttributes()\n {\n $id = $this->id;\n if (empty($id)) {\n $id = 0;\n }\n $b = DB::raw('SELECT * FROM product_attributes LEFT JOIN ( SELECT product_product_attribute.`product_id`, product_product_attribute.`attr_value`, product_product_attribute.`product_attribute_id` FROM product_product_attribute LEFT JOIN products ON product_product_attribute.`product_id` = products.id WHERE `product_id` = ' . $id . ') as a ON a.`product_attribute_id` = product_attributes.id ORDER BY id');\n return DB::select($b);\n //TODO переделать в норм запрос\n }", "public function getAllCategory()\n {\n\n $url = $this->clover_url.'/categories/';\n return json_decode($this->curlPost($url), TRUE);\n }", "function getAttributesForCategory($cUid, $ct = NULL, $excludeAttributes = NULL, $uidField = 'uid')\t{\n\t\t\t// build the basic query\n\t\t$where = 'uid_local=' .$cUid;\n\n\t\t\t// select only for a special correlation type?\n\t\t($ct == NULL) ? '' : $where .= ' AND uid_correlationtype=' .intval($ct);\n\n\t\t\t// should we exclude some attributes\n\t\tif (is_array($excludeAttributes) && count($excludeAttributes) > 0)\t{\n\t\t\t$eAttributes = array();\n\t\t\tforeach ($excludeAttributes as $eAttribute) $eAttributes[] = (int)$eAttribute['uid_foreign'];\n\t\t\t$where .= ' AND uid_foreign NOT IN (' .implode(',', $eAttributes) .')';\n\t\t}\n\n\t\t\t// execute the query\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t'*',\n\t\t\t'tx_commerce_categories_attributes_mm',\n\t\t\t$where,\n\t\t\t'', 'sorting'\n\t\t);\n\n\t\t\t// build the result and return it...\n\t\t$result = array();\n\t\twhile ($attribute = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))\t{\n\t\t\t$result[] = $attribute;\n\t\t}\n\t\treturn $result;\n\t}" ]
[ "0.74568605", "0.7018776", "0.6769143", "0.67033213", "0.6672768", "0.6659417", "0.65733504", "0.65374714", "0.6528737", "0.6445443", "0.6320154", "0.6319137", "0.628999", "0.62702787", "0.6222961", "0.61864305", "0.61864305", "0.61864305", "0.61864305", "0.6175769", "0.6170408", "0.61666566", "0.6122699", "0.611893", "0.6118137", "0.60944635", "0.6092979", "0.605698", "0.6029067", "0.60257864" ]
0.7321487
1
Returns a list of Titles for a list of attributes.
function getAttributeTitles($attributeList, $uidField = 'uid') { $result = array(); if (is_array($attributeList) && count($attributeList) > 0) { foreach ($attributeList as $attribute) { $result[] = $this->getAttributeTitle($attribute[$uidField]); } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function attributeNames();", "public function setTitle($title, array $attributes)\n {\n if ( ! isset($attributes['title'])) {\n $attributes['title'] = $this->getQualifiedTitle($title);\n }\n\n return $attributes;\n }", "public function getAttributes(array $attributes);", "public function attributes($attributes)\n {\n $html = [];\n\n foreach ((array) $attributes as $key => $value) {\n $element = $this->attributeElement($key, $value);\n\n !is_null($element) && $html[] = $element;\n }\n\n return count($html) > 0 ? ' ' . implode(' ', $html) : '';\n }", "public static function attributes($attributes)\n\t{\n\t\t$html = array();\n\n\t\tforeach ($attributes as $key => $value)\n\t\t{\n\t\t\t// -------------------------------------------------------\n\t\t\t// If the value is null, skip it.\n\t\t\t// -------------------------------------------------------\n\t\t\tif (is_null($value))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// -------------------------------------------------------\n\t\t\t// Add the HTML attribute to the array of attributes.\n\t\t\t// -------------------------------------------------------\n\t\t\t$html[] = $key.'=\"'.Str::entities($value).'\"';\n\t\t}\n\n\t\t// -------------------------------------------------------\n\t\t// Concatenate all of the attributes together.\n\t\t// -------------------------------------------------------\n\t\tif (count($html) > 0)\n\t\t{\n\t\t\treturn ' '.implode(' ', $html);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t}", "function custom_attributes_content( $attributes ) {\n\n\t$attributes['id'] = sanitize_title_with_dashes( get_the_title() );\n\n\treturn $attributes;\n}", "public function attributes($attributes)\n\t{\n\t\t$html = array();\n\n\t\tforeach ($attributes as $key => $value)\n\t\t{\n\t\t\t// Assume numeric-keyed attributes to have the same key and value.\n\t\t\t// Example: required=\"required\", autofocus=\"autofocus\", etc.\n\t\t\tif (is_numeric($key)) $key = $value;\n\n\t\t\tif ( ! is_null($value))\n\t\t\t{\n\t\t\t\t$html[] = $key.'=\"'.$this->entities($value).'\"';\n\t\t\t}\n\t\t}\n\n\t\treturn (count($html) > 0) ? ' '.implode(' ', $html) : '';\n\t}", "public function attributeLabels()\r\n\t {\r\n\t return [\r\n\t ];\r\n\t }", "public function getAttributeList();", "public function attributes($attributes)\n\t{\n\t\t$html = array();\n\n\t\tforeach ((array) $attributes as $key => $value) {\n\t\t\t// For numeric keys, we will assume that the key and the value are the\n\t\t\t// same, as this will convert HTML attributes such as \"required\" that\n\t\t\t// may be specified as required=\"required\", etc.\n\t\t\tif (is_numeric($key)) {\n\t\t\t\t$key = $value;\n\t\t\t}\n\n\t\t\tif (!is_null($value)) {\n\t\t\t\t$html[] = $key.'=\"'.$value.'\"';\n\t\t\t} else {\n\t\t\t\t$html[] = $key;\n\t\t\t}\n\t\t}\n\n\t\treturn (count($html) > 0) ? ' '.implode(' ', $html) : '';\n\t}", "function html_attrs(array $attributes)\n {\n $string = '';\n\n foreach ($attributes as $name => $value) {\n $string .= \" {$name}={$value}\";\n }\n\n return $string;\n }", "public function attributes($attributes)\n {\n $html = array();\n\n // For numeric keys we will assume that the key and the value are the same\n // as this will convert HTML attributes such as \"required\" to a correct\n // form like required=\"required\" instead of using incorrect numerics.\n foreach ((array)$attributes as $key => $value) {\n $element = $this->attributeElement($key, $value);\n if (!is_null($element)) $html[] = $element;\n }\n\n return count($html) > 0 ? ' ' . implode(' ', $html) : '';\n }", "public function getAttributesList(): array;", "public function attrib_title($data) {\n return $this->process($data, function(\\SimpleXMLElement $obj) : string {\n return (string) $obj->attributes()['title'];\n });\n }", "public function getAttributeNames()\n {\n return array_map( function($value) { return $value->getName(); }, $this->getAttributes() );\n }", "protected function getAttributs() {\n $attributs = \"\";\n if (is_array($this->attributs)){\n foreach($this->attributs as $key=>$val) {\n $attributs .= \" \" . $key. \"=\\\"\" . $val . \"\\\"\";\n }\n }\n return $attributs;\n }", "function listAttributes()\n {\n return $this->attributes;\n }", "public function attributes(): array\n {\n return [\n 'name' => 'Название',\n 'subject' => 'Субъект',\n 'resource' => 'Ресурс',\n 'properties' => 'Атрибуты',\n 'action' => 'Действие',\n 'algorithm' => 'Алгоритм',\n 'rules' => 'Правила',\n ];\n }", "function getTitles() {\n \n $i = 1;\n foreach ($this->_getDecodedTitles() as $key => $val) {\n $row = new stdClass;\n $row->filename = $key;\n\n foreach ($val as $k => $v) {\n $row->$k = $v;\n }\n $result[$i] = $row;\n $i++;\n }\n\n return $result;\n }", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getTitles() {\n\n # First, build the index\n $this->buildIndex();\n\n # Return an array of titles\n return $this->titles;\n }", "private function getArticlesAttributes()\n {\n $attributes = Attributes::getAttributesColumnNames();\n\n $data = [];\n foreach ($attributes as $attribute) {\n $data[] = [\n 'name' => $attribute,\n 'label' => $this->getAttributeLabel($attribute)\n ];\n }\n\n return $data;\n }", "public static function listAllByAttributes($className,$attributes)\n\t{\n\t $lang = Yii::app()->language;\n $models = $className::model()->findAllByAttributes($attributes);\n $pk = $className::model()->tableSchema->primaryKey;\n // format models resulting using listData \n $list = CHtml::listData($models, $pk, 'name_'.$lang);\n return $list;\n\t}", "public function attributes()\n {\n $names = [];\n foreach ($this->keys as $attribute => $values) {\n $names[] = $attribute;\n }\n\n return $names;\n }", "public function getAttributesTranslation($attributes)\n {\n $result = [];\n\n foreach ($attributes as $attribute) {\n $attr = $this->getUsableAttribute($attribute);\n $label = $attr->label();\n $result[] = $label;\n }\n\n return $result;\n }", "public function attributes()\n {\n return [\n 'title' => __('main.title'),\n 'title_ar' => __('main.title_ar'),\n 'description' => __('main.description'),\n 'description_ar' => __('main.description_ar'),\n 'status' => __('main.status'),\n 'type' => __('main.type'),\n 'categories' => __('main.categories'),\n 'image' => __('main.image'),\n ];\n }", "public function attributes(array $attributes);" ]
[ "0.64711714", "0.62061936", "0.6087759", "0.60238034", "0.6022886", "0.6022548", "0.60111666", "0.59571785", "0.59224844", "0.591414", "0.5901251", "0.5896028", "0.58884084", "0.5878519", "0.58774614", "0.58697855", "0.58645433", "0.5864365", "0.58472836", "0.5840358", "0.5840358", "0.5840358", "0.5840358", "0.583956", "0.5825636", "0.5823754", "0.58157825", "0.5814417", "0.5803946", "0.58014864" ]
0.74433404
0
This fetches the value for an attribute. It fetches the "default_value" from the table if the attribute has no valuelist, otherwise it fetches the title from the attribute_values table. You can submit only an attribute uid, then the mehod fetches the data from the databse itself, or you submit the data from the relation table and the data from the attribute table if this data is already present.
function getAttributeValue($pUid, $aUid, $relationTable, $relationData = NULL, $attributeData = NULL) { if ($relationData == NULL || $attributeData == NULL) { // data from database if one of the arguments is NULL. This nesccessary // to keep the data consistant $relRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery( 'uid_valuelist,default_value,value_char', $relationTable, 'uid_local=' .intval($pUid) .' AND uid_foreign=' .intval($aUid) ); $relationData = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($relRes); $attributeData = $this->getAttributeData($aUid, 'has_valuelist,unit'); } if ($attributeData['has_valuelist'] == '1') { if ($attributeData['multiple'] == 1) { $result = array(); if (is_array($relationData)) { foreach ($relationData as $relation) { $valueRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery( 'value', 'tx_commerce_attribute_values', 'uid=' .intval($relation['uid_valuelist']) .$this->enableFields('tx_commerce_attribute_values') ); $value = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($valueRes); $result[] = $value['value']; } } return '<ul><li>' .implode('</li><li>', $result) .'</li></ul>'; } else { // fetch data from attribute values table $valueRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery( 'value', 'tx_commerce_attribute_values', 'uid=' .intval($relationData['uid_valuelist']) .$this->enableFields('tx_commerce_attribute_values') ); $value = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($valueRes); return $value['value']; } } elseif (!empty($relationData['value_char'])) { // the value is in field default_value return $relationData['value_char'] .' ' .$attributeData['unit']; } else { return $relationData['default_value'] .' ' .$attributeData['unit']; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getValueAttribute($name, $value = null);", "public function attributeValue()\n\t{\n\t\treturn $this->hasOne('AttributeValue', 'id')->where('soft_deleted', 0);\n\t}", "public function __get($attribute)\n {\n // resolve has many relationship\n if (array_key_exists($attribute, $this->hasMany)) {\n return $this->getHasManyValue($attribute);\n }\n\n // resolve has one relationship\n if (array_key_exists($attribute, $this->hasOne)) {\n return $this->getHasOneValue($attribute);\n }\n\n // return if it was accessed before\n if (array_key_exists($attribute, $this->attributeValues)) {\n return $this->attributeValues[$attribute];\n }\n\n if (array_key_exists($attribute, $this->data)) {\n return $this->attributeValues[$attribute] = $this->castValue($attribute, $this->data[$attribute]);\n }\n\n if (array_key_exists($attribute, $this->getDefaults())) {\n return $this->attributeValues[$attribute] = $this->castValue($attribute, $this->getDefaults()[$attribute]);\n }\n\n return $this->attributeValues[$attribute] = null;\n }", "public function getCustomAttributesValueAttribute()\n {\n $typeValue = ucfirst($this->type_value);\n $methodAttribute = \"productValue{$typeValue}Attribute\";\n switch ($this->type_value) {\n case CustomAttributeConfig::REFERENCE_CUSTOM_ATTRIBUTE_TYPE_VALUE_STRING:\n return (!empty($this->$methodAttribute()) ? $this->$methodAttribute() : null);\n break;\n case CustomAttributeConfig::REFERENCE_CUSTOM_ATTRIBUTE_TYPE_VALUE_NUMBER:\n return null;\n break;\n case CustomAttributeConfig::REFERENCE_CUSTOM_ATTRIBUTE_TYPE_VALUE_DATE:\n return null;\n break;\n case CustomAttributeConfig::REFERENCE_CUSTOM_ATTRIBUTE_TYPE_VALUE_OPTION:\n return null;\n break;\n }\n }", "function GetAttributeValue($attribute_name,$OrderBy)\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$strSQLFeaturedQuery = (!empty($attribute_name))?(\" where a.attribute_name='\".$attribute_name.\"' and v.Status=1 and locationID=\".$_SESSION['locationID']):(\"\");\r\n\r\n\t\t\t$OrderSql = (!empty($OrderBy))?(\" order by v.\".$OrderBy.\" asc\"):(\" order by v.value_id asc\");\r\n\r\n\t\t\t$strSQLQuery = \"select v.* from inv_attribute_value v inner join inv_attribute a on v.attribute_id = a.attribute_id \".$strSQLFeaturedQuery.$OrderSql;\r\n\r\n\t\t\treturn $this->query($strSQLQuery, 1);\r\n\t\t}", "protected function getValue()\n {\n return $this->getModel()->getRelation($this->attribute);\n }", "function get_value()\n\t{\n\t\tglobal $openldap_overlay_module,$openldap_backend_module,$ldap_server,$short_date_time_format;\n\n\t\tif($this->attribute == \"sortableName\")\n\t\t{\n\t\t\t// sortableName is an internal \"synthesised\"\n\t\t\t// attribute rather than retrieved from\n\t\t\t// the LDAP server itself.\n\n\t\t\tif(!empty($this->ldap_entry[\"sn\"][0]))\n\t\t\t\t $attrib_value = $this->ldap_entry[\"sn\"][0];\n\t\t\telse if(!empty($this->ldap_entry[\"displayname\"][0]))\n\t\t\t\t$attrib_value = $this->ldap_entry[\"displayname\"][0];\n\t\t\telse if(isset($this->ldap_entry[\"cn\"][0]))\n\t\t\t\t$attrib_value = $this->ldap_entry[\"cn\"][0];\n\t\t\telse\n\t\t\t\t$attrib_value = \"\";\n\n\t\t\tif(!empty($this->ldap_entry[\"givenname\"][0]))\n\t\t\t\t$attrib_value .= \", \"\n\t\t\t\t\t. $this->ldap_entry[\"givenname\"][0];\n\n\t\t\tif(trim($attrib_value) == \"\")\n\t\t\t{\n\t\t\t\t$dn_elements=ldap_explode_dn2($this->ldap_entry[\"dn\"]);\n\n\t\t\t\t$data_type = $ldap_server->get_attribute_schema_setting(\n\t\t\t\t\t$dn_elements[0][\"attrib\"],\"data_type\",\"text\");\n\n\t\t\t\tswitch($data_type)\n\t\t\t\t{\n\t\t\t\t\tcase \"date_time\":\n\t\t\t\t\t\tif(empty($short_date_time_format))\n\t\t\t\t\t\t\t$short_date_time_format=\"%d %b %Y %H:%M:%S\";\n\n\t\t\t\t\t\t$date = mktime(\n\t\t\t\t\t\t\tsubstr($dn_elements[0][\"value\"],8,2),\t// hour\n\t\t\t\t\t\t\tsubstr($dn_elements[0][\"value\"],10,2),\t// minute\n\t\t\t\t\t\t\tsubstr($dn_elements[0][\"value\"],12,2),\t// second\n\t\t\t\t\t\t\tsubstr($dn_elements[0][\"value\"],4,2),\t// month\n\t\t\t\t\t\t\tsubstr($dn_elements[0][\"value\"],6,2),\t// day\n\t\t\t\t\t\t\tsubstr($dn_elements[0][\"value\"],0,4)\t// year\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$attrib_value = strftime($short_date_time_format,$date);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$attrib_value = $dn_elements[0][\"value\"];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Append OpenLDAP database naming context\n\t\t\tif(!empty($this->ldap_entry[\"olcsuffix\"][0]))\n\t\t\t\t$attrib_value .= \" \" . sprintf(gettext(\"for '%s'\"),$this->ldap_entry[\"olcsuffix\"][0]);\n\n\t\t\t// Append OpenLDAP database directory location\n\t\t\tif(!empty($this->ldap_entry[\"olcdbdirectory\"][0]))\n\t\t\t\t$attrib_value .= \" \" . sprintf(gettext(\"at '%s'\"),$this->ldap_entry[\"olcdbdirectory\"][0]);\n\n\t\t\t// Append OpenLDAP database URI\n\t\t\tif(!empty($this->ldap_entry[\"olcdburi\"][0]))\n\t\t\t\t$attrib_value .= \" \" . sprintf(gettext(\"from '%s'\"),$this->ldap_entry[\"olcdburi\"][0]);\n\n\t\t\t// Append OpenLDAP module names to be loaded\n\t\t\tif(!empty($this->ldap_entry[\"olcmoduleload\"][0]))\n\t\t\t{\n\t\t\t\t$attrib_value .= \" - \";\n\t\t\t\t$first_value = true;\n\t\t\t\tfor($i=0;$i<$this->ldap_entry[\"olcmoduleload\"][\"count\"];$i++)\n\t\t\t\t{\n\t\t\t\t\t$module_name = explode(\"}\",$this->ldap_entry[\"olcmoduleload\"][$i]);\n\t\t\t\t\t$module_name = $module_name[1];\n\n\t\t\t\t\tif(isset($openldap_overlay_module[$module_name]))\n\t\t\t\t\t\t$module_name = $openldap_overlay_module[$module_name];\n\t\t\t\t\telse if(isset($openldap_backend_module[$module_name]))\n\t\t\t\t\t\t$module_name = $openldap_backend_module[$module_name];\n\n\t\t\t\t\tif(!$first_value) $attrib_value .= \", \";\n\t\t\t\t\t\t$first_value = false;\n\n\t\t\t\t\t$attrib_value .= $module_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$attribute = strtolower($this->attribute);\n\n\t\t\tif(!empty($this->ldap_entry[$attribute][0]))\n\t\t\t\t/** @todo\n\t\t\t\t\tCurrently only returns the first value of the\n\t\t\t\t\tattribute. Should iterate over multi-valued\n\t\t\t\t\tattributes.\n\t\t\t\t*/\n\t\t\t\t$attrib_value = $this->ldap_entry[$attribute][0];\n\t\t\telse\n\t\t\t\t$attrib_value = \"\";\n\t\t}\n\n\t\treturn $attrib_value;\n\t}", "function attributeValueExists($arg_attribute, $arg_value)\n {\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 foreach($options as $option)\n {\n \t\n if ($option['label'] == $arg_value)\n {\n return $option['value'];\n }\n }\n\n return \"\";\n }", "function getattr($attribute)\n {\n return isset($this->_attributeValues[$attribute]) ?\n $this->_attributeValues[$attribute] :\n null;\n }", "public function getValue()\n\t{\n\t\treturn $this->_model->{$this->_modelAttributeNamePath};\n\t}", "public function getValueAttribute()\n {\n return null;\n }", "function tx_commerce_db_attribute_value()\n \t {\n \t \t\n \t\t$this->database_table= 'tx_commerce_attribute_values';\t\n \t\t#parent::tx_commerce_db_alib();\n \t }", "function getFieldValue($row_report, $attribute_name)\n\t {\n\t return NULL;\n\t }", "protected function _getCustomValue($attributeName, $query, $loadMap = false)\n {\n $def = $this->model_attributes[$attributeName];\n $result = $this->_getRelation($attributeName, $query, $loadMap); //$this->_getAttributeData($attributeName, $query, $loadMap);\n\n if (!$result) {\n $result = $query->fetch();\n }\n \n return $result;\n }", "public function value(){\n \treturn $this->hasMany('App\\Models\\AttributeValue','att_id');\n }", "function game_get_value($game_user, $key, $default = NULL) {\n $sql = 'SELECT `value` FROM {user_attributes}\n WHERE `fkey_users_id` = %d AND `key` = \"%s\";';\n $result = db_query($sql, (int) $game_user->id, $key);\n $item = db_fetch_object($result);\n firep($item, 'user_attributes value for key ' . $key);\n\n return !empty($item->value) ? $item->value : $default;\n}", "public function getAttribute() \n {\n return $this->_fields['Attribute']['FieldValue'];\n }", "public function value()\n {\n return $this->_attribute->value();\n }", "public function getValue()\n {\n if ($this->isNull($this->value)) {\n $query = [\n $this->relatedAttribute => $this->entity->getId()->getValue()\n ];\n\n $query = array_merge($query, $this->filter);\n\n $callable = [\n $this->entityClass,\n 'find'\n ];\n $this->value = call_user_func_array($callable, [$query]);\n }\n\n return $this->value;\n }", "public function fetchValue($value, $attribute, $options)\n {\n $value->value = intval($value->value);\n if (empty($value->value)) {\n return $value;\n }\n \n $file = $this->fileModel->get_by_ids($value->value, true);\n\n if (!$file) {\n $value->value = null;\n return $value;\n }\n\n $value->value = $file;\n return $value;\n }", "public function getAttributeValue()\n {\n return $this->attributeValue;\n }", "public function getAttributeEditField(array $aData, array &$config, $fetchFromDatabase = true, $onlyDisplay = false)\n {\n // first of all, fetch data from attribute table\n if ($fetchFromDatabase) {\n $aData = $this->belib->getAttributeData(\n $aData['row']['uid_foreign'],\n 'uid, title, has_valuelist, multiple, unit, deleted'\n );\n }\n\n if ($aData['deleted'] == 1) {\n return array();\n }\n\n /*\n * Try to detect article UID since there is currently no way to get the\n * data from the method and get language_uid from article\n */\n $sysLanguageUid = 0;\n $getPostedit = GeneralUtility::_GPmerged('edit');\n if (is_array($getPostedit['tx_commerce_articles'])) {\n $articleUid = array_keys($getPostedit['tx_commerce_articles']);\n if ($articleUid[0] > 0) {\n $temporaryData = BackendUtility::getRecord('tx_commerce_articles', $articleUid[0], 'sys_language_uid');\n $sysLanguageUid = (int) $temporaryData['sys_language_uid'];\n }\n } elseif (is_array($getPostedit['tx_commerce_products'])) {\n $articleUid = array_keys($getPostedit['tx_commerce_products']);\n if ($articleUid[0] > 0) {\n $temporaryData = BackendUtility::getRecord('tx_commerce_products', $articleUid[0], 'sys_language_uid');\n $sysLanguageUid = (int) $temporaryData['sys_language_uid'];\n }\n }\n\n // set label and name\n $config['label'] = $aData['title'];\n $config['name'] = 'attribute_' . $aData['uid'];\n\n // get the value\n if ($onlyDisplay) {\n $config['config']['type'] = 'user';\n $config['config']['userFunc'] = 'tx_commerce_attributeEditor->displayAttributeValue';\n $config['config']['aUid'] = $aData['uid'];\n\n return $config;\n }\n\n /*\n * Get PID to select only the Attribute Values in the correct PID\n */\n FolderUtility::initFolders();\n $modPid = current(FolderRepository::initFolders('Commerce', 'commerce'));\n FolderRepository::initFolders('Products', 'commerce', $modPid);\n $attrPid = current(FolderRepository::initFolders('Attributes', 'commerce', $modPid));\n\n if ($aData['has_valuelist'] == 1) {\n $config['config'] = array(\n 'type' => 'select',\n 'foreign_table' => 'tx_commerce_attribute_values',\n 'foreign_table_where' => ' AND attributes_uid = ' . (int) $aData['uid'] .\n ' AND tx_commerce_attribute_values.pid = '. (int) $attrPid . ' ORDER BY value',\n 'size' => 1,\n 'minitems' => 0,\n 'maxitems' => 1,\n 'items' => array(\n array('', 0),\n ),\n );\n\n if ((int) $aData['multiple'] == 1) {\n // create a selectbox for multiple selection\n $config['config']['multiple'] = 1;\n $config['config']['size'] = 5;\n $config['config']['maxitems'] = 100;\n unset($config['config']['items']);\n }\n } else {\n // the field should be a simple input field\n if ($aData['unit'] != '') {\n $config['label'] .= ' (' . $aData['unit'] . ')';\n }\n $config['config'] = array('type' => 'input');\n }\n\n // Dont display in lokalised version Attributes with valuelist\n if (($aData['has_valuelist'] == 1) && ($sysLanguageUid != 0)) {\n $config['config']['type'] = '';\n\n return false;\n }\n\n return $config;\n }", "public function attribute($attribute, $value = null)\r\n\t{\r\n\t\treturn $this->option($attribute, $value);\r\n\t}", "public function _getAttributeValue($attributename, $allFields, $value, &$importerrors, $counter, $rec)\n {\n $updatekey1 = $this->m_postvars['updatekey1'];\n $attr = $this->getUsableAttribute($attributename);\n\n if (method_exists($attr, 'createDestination') && $attr->createDestination() && !in_array($attributename, $allFields)) {\n $primaryKeyAttr = $attr->m_destInstance->getAttribute($attr->m_destInstance->primaryKeyField());\n $isNumeric = $attr->hasFlag(Attribute::AF_AUTO_INCREMENT) || is_a($primaryKeyAttr, 'NumberAttribute');\n\n $relationselect = [];\n\n // this check only works if either the primary key column is non-numeric or the given value is numeric\n if (!$isNumeric || is_numeric($value)) {\n $db = $attr->m_destInstance->getDb();\n $relationselect = $attr->m_destInstance->select($attr->m_destInstance->m_table.'.'.$attr->m_destInstance->primaryKeyField().' = \\''.$db->escapeSQL($value).\"'\")->getAllRows();\n }\n\n if (Tools::count($relationselect) == 0 || Tools::count($relationselect) > 1) {\n static $searchresults = [];\n if (!array_key_exists($attributename, $searchresults) || (array_key_exists($attributename, $searchresults) && !array_key_exists($value,\n $searchresults[$attributename]))\n ) {\n Tools::atkdebug(\"Caching attributeValue result for $attributename ($value)\");\n $searchresults[$attributename][$value] = $attr->m_destInstance->searchDb($value);\n }\n\n if (Tools::count($searchresults[$attributename][$value]) == 1) {\n $value = array($attr->m_destInstance->primaryKeyField() => $searchresults[$attributename][$value][0][$attr->m_destInstance->primaryKeyField()]);\n } else {\n $relation = $this->isRelationAttribute($attributename);\n\n if ($relation) {\n $rec[$relation][$attributename] = $value;\n } else {\n $rec[$attributename] = $value;\n }\n\n $importerrors[$counter][] = array(\n 'msg' => Tools::atktext('error_formdataerror'),\n 'spec' => sprintf(Tools::atktext('import_nonunique_identifier'), $this->getValueFromRecord($rec, $attributename)),\n );\n }\n }\n } else {\n if (is_object($attr) && method_exists($attr, 'parseStringValue')) {\n $value = $attr->parseStringValue($value);\n } else {\n $value = trim($value);\n }\n }\n\n return $value;\n }", "public function getValue($name)\n {\n // load the attribute code of the actual EAV attribute\n $attributeCode = $this->getSubject()->getValue(ColumnKeys::ATTRIBUTE_CODE);\n\n // load the value of the main row as fallback, if available\n $mainRowValue = isset($this->mainRowValues[$attributeCode]) ? $this->mainRowValues[$attributeCode] : null;\n\n // return the value of the passed colmn name\n return $this->getSubject()->getValue($name, $mainRowValue);\n }", "abstract public function get_value();", "public function _getSampleValue($attributename, $value)\n {\n $attr = $this->getUsableAttribute($attributename);\n\n if (method_exists($attr, 'parseTime')) {\n $newval = $attr->parseTime($value);\n } else {\n $newval = $attr->parseStringValue($value);\n }\n\n if (method_exists($attr, 'createDestination')) {\n $attr->createDestination();\n\n // If we can create a destination, then we can be reasonably sure it's a relation\n // and importing in a relation is a different matter altogether\n $searchresults = $attr->m_destInstance->searchDb($newval);\n if (Tools::count($searchresults) == 1) {\n $atkval = array($attributename => array($attr->m_destInstance->primaryKeyField() => $searchresults[0][$attr->m_destInstance->primaryKeyField()]));\n }\n } else {\n $atkval = array($attributename => $newval);\n }\n\n return $attr->display($atkval, '');\n }", "public function getValue($value, $attribute, $options)\n {\n $value->value = intval($value->value);\n if (empty($value->value)) {\n return $value;\n }\n \n $file = $this->fileModel->get_by_ids($value->value, true);\n\n if (!$file) {\n $value->value = null;\n return $value;\n }\n\n $value->value = $file;\n return $value;\n }", "public function getValueAttribute()\n {\n $page = $this->relationSingle;\n\n $domain = substr($page->guid, 0, strpos($page->guid, '?'));\n\n if (empty($page->post_name)) {\n return $page->guid;\n }\n\n return \"{$domain}{$page->post_name}/\";\n }", "public function getValueAttribute($value): mixed\n {\n if (blank($this->cast)) {\n return $value;\n }\n\n // We'll now manually add the cast and attempt to cast the attribute.\n\n $this->casts = ['value' => $this->cast];\n\n return $this->castAttribute('value', $value);\n }" ]
[ "0.6596643", "0.65910906", "0.6256486", "0.61782783", "0.6176275", "0.6153776", "0.61513484", "0.60032594", "0.59150755", "0.5902394", "0.58882195", "0.58809876", "0.57887566", "0.5774308", "0.57706004", "0.57271695", "0.5722666", "0.5683173", "0.5679888", "0.5666133", "0.56102824", "0.5602094", "0.5582592", "0.55712163", "0.5571177", "0.5566951", "0.55654556", "0.5542436", "0.5511584", "0.5499003" ]
0.6995902
0
Returns the correlationtype of a special attribute inside a product.
function getCtForAttributeOfProduct($aUid, $pUid) { $ctRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery( 'uid_correlationtype', 'tx_commerce_products_attributes_mm', 'uid_local=' .intval($pUid) .' AND uid_foreign=' .intval($aUid) ); $uidCT = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($ctRes); return $uidCT['uid_correlationtype']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function customAttributeType()\n {\n return $this->hasOneThrough(MagentoCustomAttributeType::class, MagentoConfigurableProductOption::class, 'id', 'attribute_id', 'magento_configurable_product_option_id', 'attribute_type_id');\n }", "public function getAttributeType($attribute);", "public function getProductCustomAttribute1()\n {\n return $this->product_custom_attribute1;\n }", "function getAllCorrelationTypes()\t{\n\t\t$ctRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'tx_commerce_attribute_correlationtypes', '1');\n\t\t$result = array();\n\t\twhile ($ct = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($ctRes))\t{\n\t\t\t$result[] = $ct;\n\t\t}\n\t\treturn $result;\n\t}", "function getProductType()\n {\n if(!modApiFunc('Catalog', 'isCorrectProductTypeId', $this->product_type_id))\n $this->product_type_id = 1;\n\n \t$product_type = modApiFunc('Catalog', 'getProductType', $this->product_type_id);\n \t$this->product_type = $product_type['attr'];\n\n $arr = array();\n foreach ($this->product_type as $view_tag => $attr)\n {\n \t$grp_id = $attr['group']['id'];\n \tif (!key_exists($grp_id, $arr))\n \t{\n \t\t$arr[$grp_id] = $attr['group'];\n \t}\n \t$arr[$grp_id]['attr'][] = $attr;\n }\n\n usort($arr, array(\"Catalog_ProdInfo_Base\", \"cmp\"));\n foreach ($arr as $key => $attr)\n {\n \tusort($attr['attr'], array(\"Catalog_ProdInfo_Base\", \"cmp\"));\n \t$arr[$key] = $attr;\n }\n\n return $arr;\n }", "protected function getTypeAttribute(): ?string\n {\n /** @var BaseCollection<int, string> */\n $productTypeNames = $this->productTypes->pluck('term.name');\n\n return $productTypeNames->first();\n }", "protected function getProductTaxCode() {\n $category = $this->getMainCategory();\n $categorySpecificCategory = MLModul::gi()->getConfig('b2b.tax_code_category');\n $aProductTaxCodeMatching = null;\n if (is_array($categorySpecificCategory)) {\n $key = array_search($category, $categorySpecificCategory);\n if ($key !== false) {\n $categorySpecificTaxMatching = MLModul::gi()->getConfig('b2b.tax_code_specific');\n $aProductTaxCodeMatching = $categorySpecificTaxMatching[$key];\n }\n }\n\n $aProductTaxCodeMatching = $aProductTaxCodeMatching ? : MLModul::gi()->getConfig('b2b.tax_code');\n $sProductTaxCode = $aProductTaxCodeMatching[$this->oCurrentProduct->getTaxClassId()];\n\n if (!isset($sProductTaxCode) || empty($sProductTaxCode)) {\n $sProductTaxCode = 'A_GEN_NOTAX';\n }\n\n return $sProductTaxCode;\n }", "public function getType()\n\t{\n\t\tif( isset( $this->values['product.type'] ) ) {\n\t\t\treturn (string) $this->values['product.type'];\n\t\t}\n\t}", "public function type($attribute) {\n\t\t$rules = $this->rules();\n\t\treturn $rules[$attribute][self::RULE_TYPE];\n\t}", "public function getProductReferenceType()\n {\n return $this->product_reference->getType();\n }", "public function getCtype() {}", "public function getCustomAttributeValue($attribute)\n {\n if (! $attribute) {\n return;\n }\n\n $attributeValue = $this->attribute_values()->where('tutor_agreement_attribute_id', $attribute->id)->first();\n\n\n return $attributeValue[TutorAgreementAttributeValue::$attributeTypeFields[$attribute->type]] ?? null;\n }", "public function getTypeProduit()\n {\n return $this->Type_produit;\n }", "function get_property_attribute_type_id()\n {\n return $this->get_default_property(self :: PROPERTY_PROPERTY_ATTRIBUTE_TYPE_ID);\n }", "public function getType() {\n return $this->attributes()->getValue('type');\n }", "public function getTypeCompte()\n {\n return $this->typeCompte;\n }", "protected function getClass()\n {\n return $this->definition[static::RELATION_TYPE];\n }", "function getType()\n {\n return $this->getAttribute(\"type\");\n }", "function getType()\n {\n return $this->getAttribute(\"type\");\n }", "public function getTypeAttribute()\n {\n return $this->getType();\n }", "public function getProductCustomAttribute3()\n {\n return $this->product_custom_attribute3;\n }", "public function getCreditTypeAttribute()\n {\n $type = @$this->attributes[\"credit_type\"] > 0 ? \"Payant\" : \"Gratuit\";\n return $type;\n }", "public function getProductCustomAttribute0()\n {\n return $this->product_custom_attribute0;\n }", "function type() \r\n{\r\n\treturn $adtocart['type'];\r\n}", "abstract protected function getVariationType();", "public function getType()\n {\n return $this->getAttribute('type');\n }", "public function getProductType()\n {\n return $this->registry->registry('current_product')->getTypeId();\n }", "public function getTaxType(){\n return $this->getParameter('tax_type');\n }", "public function getMagentoAttributesByType();", "public function getXsiTypeName() {\n return \"ProductCondition\";\n }" ]
[ "0.6115028", "0.59075445", "0.58100647", "0.5781625", "0.5699059", "0.55735326", "0.5535892", "0.55328876", "0.5530122", "0.5527358", "0.5507455", "0.55054075", "0.5456064", "0.54375464", "0.5424741", "0.5404829", "0.5398341", "0.53895605", "0.53895605", "0.5375854", "0.53734255", "0.53644717", "0.5360538", "0.53580755", "0.5356158", "0.5354883", "0.5317493", "0.5310403", "0.5303873", "0.5282518" ]
0.6673537
0
ARTICLES Return all articles that where created from a given product.
function getArticlesOfProduct($pUid, $additionalWhere = '', $orderBy = '') { $where = 'uid_product=' .intval($pUid); $where .= ' AND deleted=0'; if ($additionalWhere != '') { $where .= ' AND ' .$additionalWhere; } $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_commerce_articles', $where, '', $orderBy); if ($res && $GLOBALS['TYPO3_DB']->sql_num_rows($res) > 0) { $result = array(); while ($article = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $result[] = $article; } return $result; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function articles()\n {\n \treturn $this->morphedByMany(Article::class, 'categoriable');\n }", "public function index()\n {\n //\n $data = $this->productModel->getAll();\n\n return ArticleResource::collection($data);\n }", "public function getArticles()\n {\n return $this->hasMany(Article::className(), ['id' => 'article_id'])\n ->viaTable('article_tag', ['tag_id' => 'id']);\n }", "public function articles()\n\t{\n\t\treturn Article::all();\n\t}", "public function articles()\n {\n return $this->hasMany(\n config('core.acl.knowledge_base_article_model'),\n 'category_id'\n );\n }", "public function setArticles()\n {\n $return = $this->database\n ->table($this->articleTable);\n\n if (!is_null($this->fulltext)) {\n $return->where(\"name LIKE ?\", \"%$this->fulltext%\");\n }\n\n if (!is_null($this->public)) {\n $return->where('is_public', $this->public);\n }\n\n if (!is_null($this->delete)) {\n $return->where('is_delete', $this->delete);\n }\n\n if ($this->whiteList !== null) {\n $return->where('article.id_article', (array)$this->whiteList);\n if (count($this->whiteList) > 0) {\n $return->order('FIELD(article.id_article, ?)', (array)$this->whiteList);\n }\n }\n\n if ($this->blackList) {\n $return->where('id_article NOT', (array)$this->blackList);\n }\n\n if ($this->category) {\n $return->where(':category_has_article.id_category', $this->category);\n }\n\n if ($this->manufacturer) {\n $return->where('id_manufacturer', $this->manufacturer);\n }\n\n if ($this->priceRange) {\n $return->where('(end_price >= ? AND end_price <= ?)', $this->priceRange[0], $this->priceRange[1]);\n }\n\n if ($this->limit || $this->offset) {\n $return->limit($this->limit, $this->offset);\n }\n\n $return->order($this->order);\n\n $return->group('id_article');\n\n $this->articleList = $return;\n }", "public function articles() {\n return $this->hasMany('App\\Product','category_id');\n }", "public function findSpotlightArticles()\n {\n return $this->createQueryBuilder('a')\n ->andWhere('a.spotlight = :true')\n ->setParameter('true', true)\n ->getQuery()\n ->getResult();\n }", "protected function getArticles()\r\n\t{\r\n//\t\t$query = '\r\n//\t\t\tAND `statusId` = ?d\r\n//\t\t\tAND `categoryId` IN (?s)\r\n//\t\t\tAND `categoryId` IN (\r\n//\t\t\t\tSELECT\r\n//\t\t\t\t\t`id`\r\n//\t\t\t\tFROM\r\n//\t\t\t\t\t`'.$articles->getCategories()->mainTable().'`\r\n//\t\t\t\tWHERE\r\n//\t\t\t\t\t`domainAlias` = \"?s\"\r\n//\t\t\t)';\r\n//\t\treturn $articles->setSubquery($query, \\modules\\articles\\lib\\ArticleConfig::ACTIVE_STATUS_ID, '57,82,59,83', $this->getCurrentDomainAlias());\r\n\r\n\t\treturn (new \\modules\\articles\\lib\\Articles())->setSubquery(\r\n\t\t\t' AND `statusId` = ?d', \\modules\\articles\\lib\\ArticleConfig::ACTIVE_STATUS_ID\r\n\t\t);\r\n\t}", "public function getArticlesAction()\n {\n $articles = $this\n ->getDoctrine()\n ->getRepository('AppBundle:Article')\n ->findAll();\n\n return $articles;\n }", "public function findAllByArticle(Article $article) \n {\n // et peut s'utiliser comme PDO pour écrire les requetes SQL à la main\n // surtout si elles sont complexes\n // $cnx = $this->getEntityManager()->getConnection();\n // $cnx->\n \n $qb = $this->createQueryBuilder('c');\n \n $qb\n ->where('IDENTITY(c.article) = ' . $article->getId())\n ->orderBy('c.date', 'DESC')\n ;\n \n return $qb->getQuery()->getResult();\n }", "public function getAllArticleItems()\n {\n return $this->articles;\n }", "public function getAll(): array {\n $articles = [];\n $request = DB::getInstance()->prepare(\"SELECT * FROM article\");\n $result = $request->execute();\n if($result) {\n $data = $request->fetchAll();\n foreach ($data as $article_data) {\n $user = UserManager::getManager()->getById($article_data['user_fk']);\n if($user->getId()) {\n $articles[] = new Article($article_data['content'], $user, $article_data['id']);\n }\n }\n }\n return $articles;\n }", "public function returnAllArticles()\n {\n $filter = [\n '_id' => ['$exists' => true],\n ];\n $entities = self::getArticleEntities(\n $this->_database,\n $filter\n );\n\n $response = ['articles' => $entities];\n\n Http::sendJsonResponse($response);\n }", "public static function getAllArticles()\n\t{\n\t\t$db_articles = new Articles();\n\n\t\t$db_articles->Connect();\n\n\t\t$articles = $db_articles->selectAll();\n\n\t\treturn $articles;\n\t}", "public function articles()\n {\n return $this->hasMany('App\\Models\\Article', 'author_id', 'id');\n }", "public function products()\n {\n return $this->morphedByMany('Product', 'assetable');\n }", "public function getMyArticles() {\n\n $allArticles = Article::findAll();\n\n $myArticles = array();\n\n if($allArticles == null) return $myArticles;\n\n for($i = 0; $i < count($allArticles); $i++) {\n\n $article = $allArticles[$i];\n\n if($article->getAuthorId() == $this->id) {\n\n array_push($myArticles, $article);\n\n }\n\n }\n\n return $myArticles;\n\n }", "public function getAilments($product);", "public function getArticlesWithAutoImportedCategories()\n {\n $statement = $this->manager->getConnection()->prepare(\n 'SELECT b.article_id, b.category, b.shop_id\n FROM s_plugin_connect_items b\n LEFT JOIN s_plugin_connect_product_to_categories a ON b.article_id = a.articleID\n WHERE b.shop_id > 0 AND a.connect_category_id IS NULL GROUP BY b.article_id'\n );\n $statement->execute();\n\n $remoteItems = [];\n foreach ($statement->fetchAll(\\PDO::FETCH_ASSOC) as $item) {\n $categories = json_decode($item['category'], true);\n if (is_array($categories) && count($categories) > 0) {\n $product = new Product();\n $product->shopId = $item['shop_id'];\n $product->categories = $categories;\n $remoteItems[$item['article_id']] = $product;\n }\n }\n\n return $remoteItems;\n }", "public function getArticles()\n {\n return NewsArticle::get()->filter('ParentID', $this->ID);\n }", "public function articles()\n {\n return $this->hasMany(Article::class);\n }", "public function articles()\n\t{\n\t\treturn $this->hasMany(Article::class);\n\t}", "public function articles()\n {\n return $this->hasMany('App\\Article', 'author_id');\n }", "public function getProducts()\n {\n return $this->hasMany(Product::class, ['id' => 'product_id'])\n ->viaTable('product_category', ['category_id' => 'id']);\n }", "public function getArticles() {\n\t\t$this->plxMotor = plxMotor::getInstance();\n\t\t$art = array();\n\t\t\n\t\t$plxGlob_arts = clone $this->plxMotor->plxGlob_arts;\n\t\tif($files = $plxGlob_arts->query('/^[0-9]{4}.[home|'.$this->plxMotor->activeCats.',]*.[0-9]{3}.[0-9]{12}.[a-z0-9-]+.xml$/','art','sort',0,false,'before')) {\n\t\t\tforeach($files as $filename) {\n\t\t\t\tif(preg_match('/[0-9]{4}.([home|'.$this->plxMotor->activeCats.',]*).[0-9]{3}.[0-9]{12}.[a-z0-9-]+.xml$/',$filename,$capture)){\n\t\t\t\t\t$catIds=explode(',',$capture[1]);\n\t\t\t\t\t$activeCats=explode(',',$this->plxMotor->activeCats);\n\t\t\t\t\tforeach($catIds as $catId) {\n\t\t\t\t\t\tif(in_array($catId, $activeCats)) {\n\t\t\t\t\t\t\t$tmp = $this->plxMotor->parseArticle(PLX_ROOT.$this->plxMotor->aConf['racine_articles'].$filename);\n\t\t\t\t\t\t\t$y = substr($tmp['date'], 0,4);\n\t\t\t\t\t\t\t$m = substr($tmp['date'],4,2);\n\t\t\t\t\t\t\t$d = substr($tmp['date'],6,2);\n\t\t\t\t\t\t\t$art[$y][$y.$m.$d] = array(\n\t\t\t\t\t\t\t\t'month'\t=> $m,\n\t\t\t\t\t\t\t\t'day'\t=> $d,\n\t\t\t\t\t\t\t\t'url' \t=> $this->plxMotor->urlRewrite('?archives/'.$y.'/'.$m.'/'.$d),\n\t\t\t\t\t\t\t\t'title'\t=> $tmp['title']\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}\n\t\treturn $art;\n\t}", "public function findAll(): array\n {\n $sql = \"SELECT * FROM article\";\n $stmt = $this->dbConnexion->prepare($sql);\n $stmt->execute();\n $articlesDb = $stmt->fetchAll();\n\n $articlesFactory = new ArticleFactory();\n $articlesDb = $articlesFactory->createArticlesFromDb($articlesDb);\n\n return $articlesDb;\n }", "public function index()\n {\n $articles = collect();\n\n $articleType = ContentType::whereLabel(self::LABEL_ARTICLE)->first();\n\n $contents = Content::with('contentType')->whereContentType($articleType->id)->get();\n\n foreach ($contents as $content) {\n $article = $this->articleTransformer($content);\n\n $articles->push($article);\n }\n\n return $articles;\n }", "function getArticlesInformation(){\n\t\t\t/*$this->equipment=$this->em->getRepository('models\\Entities\\E_Cakes')\n\t\t\t ->findAll( array());*/\n\t\t\t \n\t\t\t \n\t /*using DQL*/\n\t $query = $this->em->createQuery('SELECT a.title AS TITLE,a.dates AS DATE,a.articleBody AS BODY,a.tags AS TAG FROM models\\Entities\\entities_cakesDelights\\E_Articles a');\n \n $this->articles = $query->getResult();\n\t\t\t\t\t\t\n\t\t return $this->articles;\n\t\t\n\t}", "function getArticlesOfProductAsUidList($pUid, $additionalWhere = '', $orderBy = '')\t{\n\t\t$where = 'uid_product=' .$pUid;\n\n\t\t$where .= ' AND deleted=0';\n\n\t\tif ($additionalWhere != '') {\n\t\t\t$where .= ' AND ' .$additionalWhere;\n\t\t}\n\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'tx_commerce_articles', $where, '', $orderBy);\n\t\tif ($res && $GLOBALS['TYPO3_DB']->sql_num_rows($res) > 0)\t{\n\t\t\t$result = array();\n\t\t\twhile ($article = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))\t{\n\t\t\t\t$result[] = $article['uid'];\n\t\t\t}\n\t\t\treturn $result;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}" ]
[ "0.64699316", "0.615712", "0.6104361", "0.60345066", "0.6023263", "0.59673965", "0.59403336", "0.5911769", "0.5907198", "0.58983636", "0.5879504", "0.587723", "0.58693975", "0.58081895", "0.57882786", "0.5777367", "0.5744102", "0.5741132", "0.57320815", "0.56819", "0.5654734", "0.56339425", "0.56292546", "0.56252575", "0.5618578", "0.56154454", "0.5613176", "0.5607657", "0.56024253", "0.55786324" ]
0.6600969
0
Updates an article and recalculates the hash value for the assigned attributes.
function updateArticleHash($aUid, $fullAttributeList = NULL) { if ($fullAttributeList == NULL) { $fullAttributeList = array(); $articleAttributes = $this->getAttributesForArticle($aUid, 1); if (count($articleAttributes) > 0) { foreach ($articleAttributes as $articleAttribute) { $fullAttributeList[] = $articleAttribute['uid_foreign']; } } } $hash = $this->getArticleHash($aUid, $fullAttributeList); // update the article $GLOBALS['TYPO3_DB']->exec_UPDATEquery( 'tx_commerce_articles', 'uid='.$aUid, array ('attribute_hash' => $hash) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updated(Article $article)\n {\n }", "public function update_article($article_id, $article) {\n//this is the id of updated row and $article containing all complete updeted row see admin.php\n\t\t\t$this->db->where('id', $article_id);\n\t\t\t$query = $this->db->update('articles', $article);\n\n\t\t\treturn $query;\n\n\t\t}", "public function update() {\n\n\t// Does the Article object have an ID?\n if ( is_null( $this->id ) ) trigger_error ( \"Article::update(): Attempt to update an Article object that does not have its ID property set.\", E_USER_ERROR );\n\n\t\t// Update the Article\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"UPDATE articles SET publicationDate=FROM_UNIXTIME(:publicationDate), title=:title, headline=:headline, pageId=:pageId, content=:content WHERE id = :id\";\n $st = $conn->prepare ( $sql );\n $st->bindValue( \":publicationDate\", $this->publicationDate, PDO::PARAM_INT );\n $st->bindValue( \":title\", $this->title, PDO::PARAM_STR );\n $st->bindValue( \":headline\", $this->headline, PDO::PARAM_STR );\n $st->bindValue( \":content\", $this->content, PDO::PARAM_STR );\n $st->bindValue( \":pageId\", $this->pageId, PDO::PARAM_INT );\n $st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\n $st->execute();\n\n $conn = null;\n}", "public function update() {\n\n // Does the Article object have an ID?\n if ( is_null( $this->id ) ) trigger_error ( \"Article::update(): Attempt to update an Article object that does not have its ID property set.\", E_USER_ERROR );\n \n // Update the Article\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"UPDATE articles SET publicationDate=FROM_UNIXTIME(:publDate), title=:title, outline=:outline, content=:content WHERE id = :id\";\n $stmt = $conn->prepare ( $sql );\n $stmt->bindValue( \":publDate\", $this->publicationDate, PDO::PARAM_INT );\n $stmt->bindValue( \":title\", $this->title, PDO::PARAM_STR );\n $stmt->bindValue( \":outline\", $this->outline, PDO::PARAM_STR );\n $stmt->bindValue( \":content\", $this->content, PDO::PARAM_STR );\n $stmt->bindValue( \":id\", $this->id, PDO::PARAM_INT );\n $stmt->execute();\n $conn = null;\n }", "public function actionUpdate(){\n\t\t$request = Yii::$app -> request;\n\t\t$articleInfo = $request -> post();\n\t\t$id = $articleInfo['id'];\n\t\t$data = array(\n\t\t\t'articleInfo' => $articleInfo\n\t\t);\n\t\t$article = Article::find() -> where('id=:id',[':id' => $id]) -> one();\n\t\t$article -> title = $articleInfo['title'];\n\t\t$article -> content = $articleInfo['content'];\n\t\t$article -> status = $articleInfo['status'];\n\t\t$article -> keyword = $articleInfo['keyword'];\n\t\t$article -> update_time = date('Y-m-d H:i:s');\n\n\t\t$result = $article -> save();\n\t\t// make a response for frentend\n\t\t$res = array();\n\t\tif( $result ){\n\t\t\t$res['result'] = 'success';\n\t\t}\n\t\telse {\n\t\t\t$res['result'] = 'error';\n\t\t}\n\t\techo json_encode($res);\n\t}", "public function update($wikiArticleforobject);", "function updateArticle(&$article) {\n\t\t$article->stampModified();\n\t\t$this->update(\n\t\t\tsprintf('UPDATE articles\n\t\t\t\tSET\tlocale = ?,\n\t\t\t\t\tuser_id = ?,\n\t\t\t\t\tsection_id = ?,\n\t\t\t\t\tlanguage = ?,\n\t\t\t\t\tcomments_to_ed = ?,\n\t\t\t\t\tcitations = ?,\n\t\t\t\t\tdate_submitted = %s,\n\t\t\t\t\tdate_status_modified = %s,\n\t\t\t\t\tlast_modified = %s,\n\t\t\t\t\tstatus = ?,\n\t\t\t\t\tsubmission_progress = ?,\n\t\t\t\t\tcurrent_round = ?,\n\t\t\t\t\tsubmission_file_id = ?,\n\t\t\t\t\trevised_file_id = ?,\n\t\t\t\t\treview_file_id = ?,\n\t\t\t\t\teditor_file_id = ?,\n\t\t\t\t\tpages = ?,\n\t\t\t\t\tfast_tracked = ?,\n\t\t\t\t\thide_author = ?,\n\t\t\t\t\tcomments_status = ?\n\t\t\t\tWHERE article_id = ?',\n\t\t\t\t$this->datetimeToDB($article->getDateSubmitted()), $this->datetimeToDB($article->getDateStatusModified()), $this->datetimeToDB($article->getLastModified())),\n\t\t\tarray(\n\t\t\t\t$article->getLocale(),\n\t\t\t\t(int) $article->getUserId(),\n\t\t\t\t(int) $article->getSectionId(),\n\t\t\t\t$article->getLanguage(),\n\t\t\t\t$article->getCommentsToEditor(),\n\t\t\t\t$article->getCitations(),\n\t\t\t\t(int) $article->getStatus(),\n\t\t\t\t(int) $article->getSubmissionProgress(),\n\t\t\t\t(int) $article->getCurrentRound(),\n\t\t\t\t$this->nullOrInt($article->getSubmissionFileId()),\n\t\t\t\t$this->nullOrInt($article->getRevisedFileId()),\n\t\t\t\t$this->nullOrInt($article->getReviewFileId()),\n\t\t\t\t$this->nullOrInt($article->getEditorFileId()),\n\t\t\t\t$article->getPages(),\n\t\t\t\t(int) $article->getFastTracked(),\n\t\t\t\t(int) $article->getHideAuthor(),\n\t\t\t\t(int) $article->getCommentsStatus(),\n\t\t\t\t$article->getId()\n\t\t\t)\n\t\t);\n\n\t\t$this->updateLocaleFields($article);\n\n\t\t// update authors for this article\n\t\t$authors =& $article->getAuthors();\n\t\tfor ($i=0, $count=count($authors); $i < $count; $i++) {\n\t\t\tif ($authors[$i]->getId() > 0) {\n\t\t\t\t$this->authorDao->updateAuthor($authors[$i]);\n\t\t\t} else {\n\t\t\t\t$this->authorDao->insertAuthor($authors[$i]);\n\t\t\t}\n\t\t}\n\n\t\t// Update author sequence numbers\n\t\t$this->authorDao->resequenceAuthors($article->getId());\n\n\t\t$this->flushCache();\n\t}", "public function update_article($article_id, $article)\n {\n $time = time();\n $cur_time = date('d m y @ H:i:s', $time);\n return $this->db->update('articles', $article, \"id=$article_id\");\n // return $this->db->update('articles', $article, ['id'=>$article_id, 'created_at'=>$cur_time]);\n }", "public function update(Article $article){\n\n //Validation rules\n $article->update($this->validateArticle());\n return redirect($article->path());\n }", "public function modifier(AbstractDocument $article)\n {\n $requete = \"UPDATE \" . self::TABLE_NAME . \" \" . $this->partieRequete() . \" WHERE id_article=:idArticle\";\n $data = $this->partieData($article);\n $data[\"idArticle\"] = $article->getId();\n return parent::requete($requete, false, $data);\n }", "public function updateHash()\n {\n $defaultContext = new \\MetaDataContextDefault();\n $this->mdmHash = $this->mdm->getCachedMetadataHash($defaultContext);\n\n // If the metadata manager cache is enabled but hash is not calculated, force the hash to be calculated\n if ($this->mdm->cacheEnabled() && empty($this->mdmHash)) {\n $this->mdm->getMetadata(array(), $defaultContext);\n $this->mdmHash = $this->mdm->getCachedMetadataHash($defaultContext);\n }\n\n // Make sure we have a hash available, if not lets temporarily disable\n // our cache backend.\n if (empty($this->mdmHash)) {\n $this->disableCache(true);\n $this->logger->warning(\"MetaDataHelper: No MetaDataHelper hash value available.\");\n } else {\n $this->logger->debug(\"MetaDataHelper: Using hash \" . $this->mdmHash);\n }\n }", "public function update(StoreArticle $request)\n {\n\n //get request\n $param = $request->toArray();\n\n //format article key => value\n $param['views'] = $param['views'] == null ? rand(100, 500) : $param['views'];\n $param['sort'] = $param['sort'] == null ? 50 : $param['sort'];\n $param['photo'] = $param['photo'] == null ? \"/static/boot/img/no_img.jpg\" : $param['photo'];\n $param['status'] = empty($param['status']) ? 0 : 1;\n $param['tips'] = 'aslkdjflsakdjfk';\n\n //create article key => value\n $article = Article::find($param['id']);\n\n //save article\n if ($article->update($param)) {\n\n return response()->json(['success' => true, 'url' => route('article-index')]);\n }\n }", "public function updateArticle(int $articleId)\n {\n $payload = Helpers::getPayload();\n\n $timestamp = $this->_database->getNewTimestamp(\n $this->_articles,\n $articleId,\n $payload['timestamp']\n );\n\n // Update only if the article was not updated since this cached update.\n if ($timestamp === false) {\n Http::sendNoContent();\n }\n\n $currentArticle = $this->_articles->findOne(\n ['_id' => $articleId],\n ['projection' => ['category' => 1, 'position' => 1]]\n );\n\n $inventoried = $this->_getInventoriedStatus();\n\n if ($currentArticle['category'] != $payload['category']) {\n $articlePosition = $this->_getNextPositionInCategory($payload['category']);\n } else {\n $articlePosition = $currentArticle['position'];\n }\n\n $updateFields = [\n 'category' => $payload['category'],\n 'name' => $payload['name'],\n 'size' => $payload['size'],\n 'unit' => $payload['unit'],\n 'gtins' => $payload['gtins'],\n 'inventoried' => $inventoried,\n 'position' => $articlePosition,\n 'timestamp' => $timestamp,\n ];\n $this->_articles->updateOne(\n ['_id' => $articleId],\n ['$set' => $updateFields]\n );\n\n if (isset($payload['lots'])) {\n $this->_database->lots->deleteMany(\n ['article' => $articleId]\n );\n\n $this->_insertLots($articleId, $payload['lots']);\n }\n\n Http::sendNoContent();\n }", "public static function updateArt() {\n\t\tif(isset($_POST['update'])) {\n\t\t\tif (isset($_POST['designation_new'], $_POST['title_desc_new'], $_POST['desc_art_new'])) {\n\t\t\t\t\n\t\t\t\t$newArticle = new Article([\n\t\t\t\t\t'designation' => htmlspecialchars($_POST['designation_new']),\n\t\t\t\t\t'title_desc' => htmlspecialchars($_POST['title_desc_new']),\n\t\t\t\t\t'description_art' => htmlspecialchars($_POST['desc_art_new']),\n\t\t\t\t\t'id' => htmlspecialchars($_GET['id'])\n\t\t\t\t]);\n\n\t\t\t\t$newArtManager = new ArticleManager();\n\t\t\t\t$updateArticle = $newArtManager->update($newArticle);\n\t\t\t\theader('Location: admin.php?page=adminArticlesView');\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t}", "public function update($attributes);", "public function update(StoreOrUpdateArticle $request, Article $article)\n {\n // Get the validated data from request validator\n $data = $request->validated();\n\n // Make slug readable\n $data['slug'] = $this->slugify($data['slug']);\n\n // Change published_at date\n if($data['published_at'] != \"\") {\n $data['published_at'] = Carbon::parse($data['published_at'])->format(\"Y-m-d H:i:s\");\n }\n\n // Change offline_at date\n if($data['offline_at'] != \"\") {\n $data['offline_at'] = Carbon::parse($data['offline_at'])->format(\"Y-m-d H:i:s\");\n }\n\n // Make from multiple keywords 1\n $data['keywords'] = @$this->implodeOrEmptyString($data['keywords']);\n\n // Save the updates\n $article->update($data);\n\n return Redirect::to('/admin/news');\n }", "public function update(UpdateArticle $request, Article $article)\n {\n// $articleModel = $this->articleRepository->findEditData(auth()->user()->id, $id);\n// dd($articleModel);\n $this->articleRepository->update($article, $request->all());\n return responseJson();\n }", "function updateArticleXML($articleRelations, $add = false, $articleUid = NULL, $productUid = NULL)\t{\n\t $xmlData = array();\n\t if ($add && is_numeric($articleUid))\t{\n\t\t\t$xmlData = $GLOBALS['TYPO3_DB']->exec_SELECTquery('attributesedit', 'tx_commerce_articles', 'uid=' .intval($articleUid));\n\t\t\t$xmlData = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($xmlData);\n\t\t\t$xmlData = t3lib_div::xml2array($xmlData['attributesedit']);\n\t\t}\n\t\t\n\t\t\n\t\t$relationData= array();\n\t\t/**\n\t\t * Build Relation Data\n\t\t */\n\t\tif ($productUid) {\n\t\t\t$resRelationData = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tx_commerce_articles_article_attributes_mm.*','tx_commerce_articles, tx_commerce_articles_article_attributes_mm',' tx_commerce_articles.uid = tx_commerce_articles_article_attributes_mm.uid_local and tx_commerce_articles.uid_product = '.intval($productUid));\n\t\t}\n\t\tif ($articleUid) {\n\t\t\t$resRelationData = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tx_commerce_articles_article_attributes_mm.*','tx_commerce_articles, tx_commerce_articles_article_attributes_mm',' tx_commerce_articles.uid = tx_commerce_articles_article_attributes_mm.uid_local and tx_commerce_articles.uid = '.intval($articleUid));\n\t\t}\n\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($resRelationData)>0) {\n\t\t\t\n\t\t\twhile($relationRows = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resRelationData)) {\n\t\t\t\t$relationData[]=$relationRows;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tif(is_array($relationData)){\n\t\t foreach ($articleRelations as $articleRelation)\t{\n\t\t\t\tif ($articleRelation['uid_valuelist'] != 0)\t{\n\t\t\t\t\t$value = $articleRelation['uid_valuelist'];\n\t\t\t\t} elseif (!empty($articleRelation['value_char']))\t{\n\t\t\t\t\t$value = $articleRelation['value_char'];\n\t\t\t\t} else {\n\t\t\t\t\tif ($articleRelation['default_value'] <> 0) {\n\t\t\t\t\t\t$value = $articleRelation['default_value'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$value = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$xmlData['data']['sDEF']['lDEF']['attribute_' .$articleRelation['uid_foreign']] = array('vDEF' => $value);\n\t\t }\n\t\t}\n\t\t\n\t\t$xmlData = t3lib_div::array2xml($xmlData, '', 0, 'T3FlexForms');\n\t\n\t\tif ($articleUid) {\n\t\t\t$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_commerce_articles', 'uid=' .$articleUid .' AND deleted=0', array('attributesedit' => $xmlData));\n\t\t} elseif ($productUid) {\n\t\t\t$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_commerce_articles', 'uid_product=' .$productUid .' AND deleted=0', array('attributesedit' => $xmlData));\n\t\t}\n\t}", "public function update(Article $article, ArticleRequest $request){\n //public function update( $id, ArticleRequest $request ){\n //$article = Article::findOrFail($id);\n\n $article->update( $request->all() );\n\n //-> Update tags \"pivot table\"\n $article->tags()->sync( $request->input('tag_list') );\n\n return redirect('articles');\n }", "public function update(Request $request, Article $article)\n {\n $request->validate([\n 'name' => 'required|string|unique:articles',\n 'description' => 'required|string|min:20',\n 'content' => 'required|string',\n 'active' => 'boolean',\n ]);\n\n $article->update($request->all());\n\n return response()->json($article);\n }", "public function enhanceArticle ($article)\n {\n $keywords = explode(\",\", $article->keywords);\n //fetch articles with these keywords by latest\n $likes = [];\n foreach ($keywords as $id => $keyword) {\n $likes[] = \"instr(keywords, '\".trim($keyword).\"')\";\n }\n $filter = \"id != {$article->id} and ( \".join(\" or \", $likes).\" )\";\n $related = (new Article())->select(\"id,title,description,slug,image,author,published_date\", 4)->where($filter)->orderBy(\"published_date desc\");\n $article->relatedArticles = $related->asObject();\n $article->url = \"/content/article/\".$this->getSlug($article->title);\n foreach ( $article->relatedArticles as $id => $articleData) {\n $article->relatedArticles[$id]->url = \"/content/article/\".$this->getSlug($article->title);\n if (!file_exists(\"./cache/article-\".md5($articleData->id).\".png\")) {\n if (!empty($articleData->image)) {\n file_put_contents(\"./cache/article-\".md5($articleData->id).\".png\", base64_decode($article->image));\n $article->relatedArticles[$id]->image = \"/cache/article-\".md5($articleData->id).\".png\";\n } else {\n $article->relatedArticles[$id]->image = null;\n }\n } else {\n $article->relatedArticles[$id]->image = \"/cache/article-\".md5($articleData->id).\".png\";\n }\n }\n\n $article->categories = $this->DBA->fetch(\"select * from article_category ac join article_article_category acc on acc.article_category_id = ac.id where acc.article_id = {$article->id}\", 10)->asArray();\n }", "public function update(Request $request, Article $article)\n {\n //\n }", "public function update(Request $request, Article $article)\n {\n //\n }", "public function update(Request $request, Article $article)\n {\n //\n }", "public function update(Request $request, Article $article)\n {\n //\n }", "public function update(Request $request, Article $article)\n {\n //\n }", "public function update(Request $request, Article $article)\n {\n //\n }", "public function update($entitie);", "public function update(Request $request, Article $article)\n {\n// $colorAssings = [];\n// foreach ($request->input('color_id') as $color_id){\n// $data = [\n// 'article_id' => $article->id,\n// 'color_id' => $color_id,\n// 'quantity' => 1,\n// 'created_at' => date(\"Y-m-d H:i:s\"),\n// 'updated_at' => date(\"Y-m-d H:i:s\"),\n// ];\n// array_push($colorAssings,$data);\n// }\n// DB::table('color_articles')->update($colorAssings);\n\n// $quantity_color = DB::table('color_articles')\n// ->where('color_articles.article_id','=',$article->id)\n// ->select(DB::raw(\"SUM(color_articles.quantity) as sum_quantity\"))->first();\n//\n// DB::table('articles')\n// ->where('id',$article->id)\n// ->update(['stock' => $quantity_color->sum_quantity]);\n $article->sub_category_id = $request->sub_category_id;\n $article->maker_id = $request->maker_id;\n $article->title = $request->title;\n $article->description = $request->description;\n $article->stock = $request->stock;\n $article->update();\n\n DB::table('price_articles')\n ->where('article_id','=',$article->id)\n ->update(['is_current' => 0]);\n\n $price_articles = new PriceArticle();\n $price_articles->article_id = $article->id;\n $price_articles->price = $request->price_new;\n $price_articles->is_current = 1;\n $price_articles->save();\n\n return back();\n }", "public function saveArticle(\\Yadeo\\Core\\Article $article)\n {\n }" ]
[ "0.6347578", "0.5861318", "0.5720556", "0.5685181", "0.5628769", "0.56235826", "0.5617206", "0.5616168", "0.5517974", "0.549023", "0.54827756", "0.5445993", "0.54437596", "0.54338115", "0.53848946", "0.53396475", "0.52547157", "0.51774275", "0.5169574", "0.51691246", "0.5141515", "0.51331633", "0.51331633", "0.51331633", "0.51331633", "0.51331633", "0.51331633", "0.5121271", "0.5118488", "0.51085895" ]
0.68022895
0
DIV proofs if there are non numeric chars in it
function isNumber($data) { $charArray = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 0, '.'); return strlen(str_replace($charArray,array(),$data)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function containsNumbers($string){\n\treturn ctype_digit($string); \n}", "function numeric ( $str )\n\t{\n\t\treturn ( ! preg_match ( \"/^[0-9\\.]+$/\", $str ) ) ? FALSE : TRUE;\n\t}", "function isNumber($var)\n{\n if(strlen($var)==0) {\n return false;\n }\n for ($i=0;$i<strlen($var);$i++) {\n if ( substr_count (\"0123456789\", substr ($var, $i, 1) ) == 0 ) {\n return false;\n }\n }\n return true;\n}", "function is_chaine_numeric($chaine){\r\n for ($i=0; $i < long_chaine($chaine) ; $i++) { \r\n if (!is_car_numeric($chaine[$i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "function validaAlfaNum ($Cad) {\n // prueba si la entrada es una cadena alfanumerica\n return preg_match(\"/^[a-zñÑ0-9]*$/i\", $Cad );\n}", "function fun_esfloat($num){\n\t\t$numero=true;\n\t\n\t\t$num=(string)$num;\n\t\t\n\t\tfor($i=0;$i<strlen($num) and $numero;$i++){\n\t\t\n\t\t\tif(ctype_digit($num[$i]) || $num[$i]==\".\" || $num[$i]==\"-\"){\n\t\t\t\t$numero=true;\n\t\t\t}else{\n\t\t\t\t$numero=false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $numero;\n\t}", "function is_number($nombre){\n for ($i=0; $i < my_strlen($nombre); $i++) { \n if (!(is_entier($nombre[$i]))) {\n return false;\n }\n }\n return ($nombre>0); \n}", "function verifyNumeric ($testString) {\n\treturn (is_numeric ($testString));\n}", "private static function IsNumerical(string $theString) {\n\t\t// An empty string isn't a number :P\n\t\t$len = strlen($theString);\n\t\tif ($len == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t// Few options, either it begins with &h, &ho, &b\n\t\t// Since any of the &_ combinations require at least\n\t\t// two characters, we'll check for that first\n\t\tif ($len >= 6) {\n\t\t\t// Next, check to see if it starts with an &\n\t\t\tif (substr($theString, 0, 5) == '&amp;') {\n\t\t\t\t// Finally, check for the 3 known numerical types\n\t\t\t\t$secondChar = substr($theString, 5, 1);\n\t\t\t\tif ($secondChar == 'h' || $secondChar == 'o' || $secondChar == 'b') {\n\t\t\t\t\t// All these are always considered integers\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\t// If we started with an &, but weren't of any of the above types\n\t\t\t\t// we know we aren't numerical\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Now, we start out assuming we're an integer\n\t\t$type = 1;\n\t\n\t\n\t\n\t\tfor ($pos = 0; $pos < $len; $pos++) {\n\t\t\t$char = substr($theString, $pos, 1);\n\t\t\t\n\t\t\t// If we're between 0 and 9, we don't modify the type\n\t\t\tif ($char >= '0' && $char <= '9') {\n\t\t\t\t\n\t\t\t} else if ($char == '.') {\n\t\t\t\t// If we are a decimal, we now assume double\n\t\t\t\t$type = 2;\n\t\t\t} else {\n\t\t\t\t// We failed to be numerical. Return 0\n\t\t\t\t//echo \"Failed at \" . $char . \"<br />\";\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// TODO: Check the value with MAXINT and change type to a double if needed\n\t\t\n\t\tif ($type == 1) {\n\t\t\tif ($len == 10) { // \n\t\t\t\tif (((float)$theString) > 2147483647.0) {\n\t\t\t\t\t$type = 2;\n\t\t\t\t}\n\t\t\t} else if ($len > 10) {\n\t\t\t\t$type = 2;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// return the type\n\t\treturn $type;\n\t}", "function isStrongsNumber(string $strNum): bool\n{\n $matchesPattern = preg_match('/^([HG])\\d{1,4}$/u', $strNum) !== false;\n if (!$matchesPattern) {\n return false;\n }\n $num = intval(utf8_substr($strNum, 1));\n if (utf8_substr($strNum, 0, 1) === 'H') {\n $matchesNumbers = ($num >= 1) && ($num <= 8674);\n } else {\n // Greek Strong's numbers 2717 and 3203-3302 do not exist\n $matchesNumbers = ($num >= 1) && ($num <= 5624) && ($num !== 2717) && (($num < 3203) || ($num > 3302));\n }\n return $matchesNumbers;\n}", "function isDigits($element) {\r\n\treturn !preg_match (\"/[^0-9.]/\", $element) ;\r\n}", "function programmedresp_is_numeric($response) {\n\n if (!preg_match('/^-?[0-9]$/', $response) && !preg_match('/^-?[0-9]+\\.[0-9]+$/', $response)) {\n return false;\n }\n\n return true;\n}", "public static function isNum($var) {\r\n $coincidencias = preg_match( \"/^[0-9]+$/\", trim($var) ); // false on error\r\n if( $coincidencias===false || $coincidencias === 0 ) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "function is_entier($char) {\n return ($char>='0' && $char <='9');\n \n}", "function notAlfaNumeric(& $incomingData)\n{\n $text_regex = \"/^[a-zA-Z0-9 .\\-]+$/i\";//tambien permite expacios y guiones\n $out_message = \"solo caracteres alfanumericos, guiones,espacios y puntos\";\n if(!preg_match($text_regex, $incomingData['name']))\n {\n $incomingData['nameError'] = $out_message;\n return true;\n }\n if(!preg_match($text_regex, $incomingData['asesor_name']))\n {\n $incomingData['asesor_nameError'] = $out_message;\n return true;\n }\n if(!preg_match($text_regex, $incomingData['supervisor_name']))\n {\n $incomingData['supervisor_nameError'] = $out_message;\n return true;\n }\n return false;\n}", "function is_digits($element) {\n\n return !preg_match(\"/[^0-9]/\", $element);\n}", "function is_numeric ($var) {}", "public function check_numbers($string) {\r\n return !preg_match(\"/[^0-9]/\", stripslashes($string));\r\n }", "function numeric($value)\r\n{\r\n return !empty($value) && ctype_digit(str_replace(array('-', '(', ')', ' '), '', $value));\r\n}", "function verification_caractere_alphanumerique($chaine){\n $taille=taille_chaine($chaine);\n for ($j=0; $j < $taille; $j++) { \n $i = 1;\n for( $x = \"0\"; $i <= 10; $x++ ) {\n if ($chaine[$j]==$x) {\n $resultat=1;\n }\n $i++;\n }\n }\n return $resultat;\n }", "function alpha_numeric ( $str )\n\t{\n\t\treturn ( ! preg_match ( \"/^([-a-z0-9])+$/i\", $str ) ) ? FALSE : TRUE;\n\t}", "static function somenteNumeros($str) {\r\n return preg_replace(\"/[^0-9]/\", \"\", $str);\r\n }", "function onlyDigits($string)\n{\n if (ereg_replace(\"[^0-9]\", \"\", $string) === $string) {\n return 1;\n }\n\n return 0;\n}", "function isNumber($num) {\r\n\treturn preg_match(\"/^[0-9]+$/\", $num);\r\n}", "function onlyAlphaNumeric($element) {\r\n\treturn !preg_match (\"/[^A-z0-9]/\", $element);\r\n}", "function validate_no_numbers_or_symbols($field_value, &$field){\n if(preg_match('#[^a-z]+$#i', $field_value)) {\n $field['error'] = \"Lauke negali būti skaičių ir simbolių\";\n $field_value = \"\";\n }else{\n return true;\n }\n}", "function isAlphaNumeric($element) {\r\n\treturn !preg_match (\"/[^A-z0-9-_.]/\", $element);\r\n}", "function estEntierPositif($valeur) {\r\n\treturn preg_match(\"/[^0-9]/\", $valeur) == 0;\r\n\r\n}", "public static function isAlnum($var) {\r\n $coincidencias = preg_match( \"/^[[:alnum:]]+$/i\", trim($var) ); // false on error\r\n if( $coincidencias===false || $coincidencias === 0 ) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "function isNumber($input) {\n if (preg_match(\"#^[+-]?[0-9]+(\\.[0-9]+)?([eE][+-]?[0-9]*)?$#\", $input)){\n return true;\n }\n return false;\n}" ]
[ "0.6204938", "0.61830217", "0.61700976", "0.61158645", "0.6022731", "0.6004726", "0.599044", "0.5988037", "0.59357536", "0.5925216", "0.587858", "0.5873024", "0.5830769", "0.5827632", "0.58221686", "0.5800417", "0.5799138", "0.5792092", "0.57790846", "0.57771045", "0.57619137", "0.5749011", "0.5744941", "0.57429934", "0.5728597", "0.5712719", "0.57120204", "0.5695883", "0.56956285", "0.5689819" ]
0.6193887
1
This method returns the last part of a string. It splits up the string at the underscores. If the key doesn't contain any underscores, it returns the intval of the key.
function getUidFromKey($key, &$keyData) { if (strpos($key, '_') === false) { return intval($key); } else { $keyData = @explode('_', $key); if (is_array($keyData)) { return intval($keyData[(count($keyData) -1)]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLastKey()\n {\n $this->db->select_max($this->key);\n $this->db->from($this->table);\n $eks = $this->db->get()->row_array()[$this->key];\n $noUrut = (int) substr($eks, -3, 3);\n $noUrut++;\n return $this->keyString . '_' . sprintf(\"%03s\", $noUrut);\n }", "function parseKey($key, & $userID, & $role)\n{\n $i1 = strpos($key, '_');\n $rem = '';\n if ($i1 > 0)\n {\n $userID = substr($key, 0, $i1);\n $role = substr($key, ($i1 +1));\n }\n //debug('parseKey: key=' . $key . ', i1=' . $i1 . ', userID=' . $userID . ', role=' . $role);\n}", "private function _getKey(string $key): string\n\t{\n\t\treturn strtolower(str_replace('_', '-', $key));\n\t}", "protected function extractKey($areaKey)\n {\n\n Debug::console('extract area resource key '.$areaKey);\n\n if (!$areaKey) {\n ///TODO better error message\n $trace = Debug::backtrace();\n Log::error('Got empty area key '.$trace);\n return null;\n }\n\n $modKey = explode('-',$areaKey,2);\n $modKey = explode('_',$modKey[1],2);\n return $modKey[0];\n\n }", "function gogreen_string_to_underscore_name( $string )\n{\n $string = preg_replace('/[\\'\"]/', '', $string);\n $string = preg_replace('/[^a-zA-Z0-9]+/', '_', $string);\n $string = trim($string, '_');\n $string = strtolower($string);\n \n return $string;\n}", "public function toNumeric($key)\n {\n $numericKey = \"\";\n $keySplited = str_split($key);\n uasort($keySplited, array($this, 'compare'));\n foreach ($keySplited as $key => $item) {\n $numericKey .= $key + 1;\n }\n return $numericKey;\n }", "public function getLastSegment() {\n\t\t\t\t$tokens = preg_split('/[\\\\\\\\_]+/', $this->value);\n\t\t\t\t$tokens = array_filter($tokens, 'trim');\n\t\t\t\t$segment = array_pop($tokens);\n\t\t\t\treturn $segment;\n\t\t}", "static function clean_key($key) {\r\n if ($key == \"\") {\r\n return \"\";\r\n }\r\n\r\n $key = htmlspecialchars(urldecode($key));\r\n $key = preg_replace(\"/\\.\\./\", \"\", $key);\r\n $key = preg_replace(\"/\\_\\_(.+?)\\_\\_/\", \"\", $key);\r\n $key = preg_replace(\"/^([\\w\\.\\-\\_]+)$/\", \"$1\", $key);\r\n return $key;\r\n }", "function underscore($str){\r\n return strtolower(preg_replace('/(.)([A-Z])/', '$1_$2', $str));\r\n }", "private function __keyPreProcess($key)\n {\n if (strpos($key, '/') === 0) {\n $key = substr($key, 1);\n }\n\n return $key;\n }", "function key_from_url($url) {\r\n preg_match( \"/\\/d\\/(.*)\\//i\", $url, $r );\r\n if( !is_array($r) ) return( false );\r\n if( empty($r) ) return( false );\r\n if( !isset($r[1]) ) return( false );\r\n\r\n return( $r[1] );\r\n}", "function last_word($str, $delimiter = ' ')\n {\n return array_last(explode($delimiter, $str));\n }", "static function clean_key($key){\n\t\tif ($key == \"\"){\n\t\t\treturn \"\";\n\t\t}\n\n\t\t$key = htmlspecialchars(urldecode($key));\n\t\t$key = preg_replace( \"/\\.\\./\" , \"\" , $key );\n\t\t$key = preg_replace( \"/\\_\\_(.+?)\\_\\_/\" , \"\" , $key );\n\t\t$key = preg_replace( \"/^([\\w\\.\\-\\_]+)$/\", \"$1\", $key );\n\t\treturn $key;\n\t}", "private function extractIndexFromKey()\n {\n $hasKey = preg_match('/^([[:alnum:]]+)\\[([0-9]+)\\]$/', $this->key, $matches);\n\n if ($hasKey) {\n $this->key = $matches[1];\n $this->index = $matches[2];\n } else {\n $this->index = false;\n }\n }", "public static function getlaststring($str)\n {\n $strparts = array();\n if (preg_match(\"/\\\\\\\\/\", $str)) {\n $strparts = explode(\"\\\\\", $str);\n }\n if (preg_match(\"/\\//\", $str)) {\n $strparts = explode(\"/\", $str);\n }\n if (count($strparts) > 0) {\n return $strparts[count($strparts)-1];\n } else {\n return $str;\n }\n }", "public static function normalizeCacheKey(string $key): string\n {\n return str_replace(['/', '\\\\', '.'], '_', $key);\n }", "private function _parseKey($str)\n {\n $str = strtolower(trim((string) $str));\n\n preg_match('/([a-zA-Z_]+)\\.?(.*)?/', $str, $matches);\n\n if (isset($matches[2]) && !empty($matches[2])) {\n $section = $matches[1];\n $key = $matches[2];\n } else {\n $section = \"general\";\n $key = $matches[1];\n }\n\n return array($section, $key);\n }", "public static function underscore($str)\n\t{\n\t\treturn preg_replace('/\\s+/', '_', trim($str));\n\t}", "protected function convertToDbKey($key)\n {\n return str_replace($this->_inputPrefix . '_', '', $key);\n }", "public function get_meta_key( $key ) {\n\t\t$key = preg_replace( '/^(.*)_\\\\d+$/', '$1', $key );\n\n\t\treturn $key . '_meta';\n\t}", "public function formatUrlKey($str)\n {\n\t\t$str = Mage::helper('fixurlcategory')->format($str); //new, like for product\n //$str = Mage::helper('core')->removeAccents($str); //old\n $urlKey = preg_replace('#[^0-9a-z]+#i', '-', $str);\n $urlKey = strtolower($urlKey);\n $urlKey = trim($urlKey, '-');\n return $urlKey;\n }", "protected function cleanString($tableKey)\n {\n return trim(preg_replace('/[^a-z0-9]+/', '_', strtolower($tableKey)), '_');\n }", "public static function toUnderscoreSeparated($input)\n\t{\n\t // Convert spaces and dashes to underscores.\n\t return static::separate($input, '_');\n\t}", "public function magicGet($key_str)\n {\n if (strpos($key_str, \"*\") === false) return $this->get($key_str);\n $value_arr = $this->_arrayToValueArr($this->storage);\n $key_str_regex = str_replace(\"*\", '[^\\.]*', $key_str);\n $key_arr_flip = array();\n foreach($value_arr AS $key_str => $value) {\n if (!preg_match_all(\"#^($key_str_regex)#\", $key_str, $matches)) continue;\n $key_arr_flip[] = $matches[1][0];\n }\n return $this->getMulti(array_unique($key_arr_flip));\n }", "public static function normalizeKey($key)\n {\n $key = str_replace(array(' ', '-', '\\\\'), '_', strtolower($key));\n return preg_replace('/[^A-Za-z0-9_]/', '', $key);\n }", "private function parseValue(string $key)\n {\n preg_match(\"/([\\w\\_\\d]+)\\(([\\w\\W]*)\\)/\", $key, $matches);\n return $matches;\n }", "function file_name($key) {\r\n\t$key=strrev(substr(strstr(strrev($key), \".\"), 1));\r\n\treturn($key);\r\n}", "public static function underscored(string $string) : string\n {\n return static::delimit($string, '_');\n }", "function KeyToInt($key){ \n $intKey = StringToInt($key); \n return $intKey;\n }", "function underscoreToCamelCase($str) {\n $parts = explode('_', $this->real_field);\n foreach ($parts as &$part) {\n $part = ucfirst($part);\n }\n return lcfirst(join(\"\", $parts));\n }" ]
[ "0.6028701", "0.58277214", "0.5805428", "0.551819", "0.55159545", "0.5488539", "0.54490286", "0.5426827", "0.5406822", "0.533589", "0.53251886", "0.5312399", "0.5299506", "0.52764076", "0.52691764", "0.52648705", "0.5251978", "0.5229306", "0.52189976", "0.521714", "0.52116287", "0.5211534", "0.51987475", "0.51828617", "0.5182175", "0.517864", "0.5153868", "0.5099542", "0.5084162", "0.50737226" ]
0.61828655
0
Returns a list of UID from a list of strings that contains UIDs.
function getUidListFromList($list) { $result = array(); if(is_array($list)){ foreach ($list as $item) { $uid = $this->getUidFromKey($item, $keyData); if ($uid > 0) $result[] = $uid; } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _parse_uids($uids, $mailbox)\n {\n if ($uids === '*' || $uids === '1:*') {\n if (empty($this->search_set)) {\n $uids = '1:*';\n $all = true;\n }\n // get UIDs from current search set\n // @TODO: skip fetchUIDs() and work with IDs instead of UIDs (?)\n else {\n if ($this->search_threads)\n $uids = $this->conn->fetchUIDs($mailbox, array_keys($this->search_set['depth']));\n else\n $uids = $this->conn->fetchUIDs($mailbox, $this->search_set);\n \n // save ID-to-UID mapping in local cache\n if (is_array($uids))\n foreach ($uids as $id => $uid)\n $this->uid_id_map[$mailbox][$uid] = $id;\n\n $uids = join(',', $uids);\n }\n }\n else {\n if (is_array($uids))\n $uids = join(',', $uids);\n\n if (preg_match('/[^0-9,]/', $uids))\n $uids = '';\n }\n\n return array($uids, (bool) $all);\n }", "public function extractIds(string $string): array;", "function getRecordsIdList($uid_list,$depth=0,$beginLevel=0,$where=' ')\t{\r\n\r\n\t\t$uid_list_prepend = $uid_list;\r\n\t\t$uid_list=$this->getSubRecordsIdList($uid_list,$depth,$beginLevel,$where);\r\n\r\n\t\treturn str_replace(',,','',$uid_list_prepend.','.$uid_list);\r\n\t}", "function getSubRecordsIdList($uid_list,$depth=1,$beginLevel=0,$where=' ')\t{\r\n\t\t$depth = t3lib_div::intInRange($depth,0);\r\n\r\n\t\t$uid_list_arr = array_unique(t3lib_div::trimExplode(',',$uid_list,1));\r\n\t\t$uid_list='';\r\n\t\treset($uid_list_arr);\r\n\t\t\r\n\t\twhile(list(,$val)=each($uid_list_arr))\t{\r\n\t\t\t$val = t3lib_div::intInRange($val,0);\r\n\t\t\t$subids = $this->getTreeList($val,$depth,$beginLevel,$where);\r\n\t\t\t$uid_list.=$subids.',';\r\n\t\t}\r\n\t\t$uid_list = preg_replace('/,+$/','',$uid_list); \r\n\t\treturn $uid_list;\r\n\t}", "public static function cleanList($list, $userData, $template = null)\n {\n global $PPHP;\n $db = $PPHP['db'];\n\n $list = array_map('strtolower', $list);\n\n $db->begin();\n\n $out = array();\n foreach ($list as $id) {\n if (is_numeric($id)) {\n $cleanId = $db->selectAtom('SELECT id FROM users WHERE id=?', array($id));\n if ($cleanId !== false) {\n $out[] = $cleanId;\n };\n } elseif (preg_match('/^[^@ ]+@[^@ .]+\\.[^@ ]+$/', $id) == 1) {\n $cleanId = $db->selectAtom('SELECT id FROM users WHERE email=?', array($id));\n if ($cleanId !== false) {\n $out[] = $cleanId;\n } else {\n if (isset($userData[$id])) {\n $cols = $userData[$id];\n } else {\n $cols = array();\n };\n $cols['email'] = $id;\n $newbie = self::create($cols);\n if ($newbie !== false) {\n $out[] = $newbie[0];\n if ($template !== null) {\n trigger('send_invite', $template, $newbie[0]);\n };\n };\n };\n };\n };\n\n $db->commit();\n\n return $out;\n }", "public function getIdList(array $list)\n {\n return array_map(function($element) {\n if($element instanceof \\MongoId) {\n return $element;\n }\n\n if($element instanceof Model) {\n return $element->getMongoId();\n }\n\n return new \\MongoId($element);\n }, $list);\n }", "public function listIds(array $aListIds );", "public function listIds( array $aListIds );", "function make_inlist_from_list($list){\n\tif (empty($list) )return false;\n\t$qlist = array_map(function ($c) {return \"'$c'\";},$list);\n\n\t$inlist = join(',',$qlist);\n\treturn $inlist;\n}", "function getUUIDsForType($aliastList, $type){\n $sql = \"select ns.user_id, ns.app_type_id from notification_settings ns where ns.user_id in ($aliastList) and app_type_id=$type\";\n $rs = $this->query($sql);\n \n $ipadAliasList = array();\n if(is_array($rs)){\n foreach($rs as $i => $values){\n $ipadAliasList[] = \"\".$rs[$i]['ns']['user_id'];\n }\n }\n \n return $ipadAliasList;\n }", "public function getUidList()\n {\n if ( $this->isSkippedCache() ){\n return $this->queryUidList();\n }\n\n $key = $this->getCacheKey('uidList', func_get_args());\n $minutes = $this->getCacheMinutes();\n $value = $this->getCacheRepository()->remember($key, $minutes, function() {\n return $this->queryUidList();\n });\n\n return $value;\n }", "public function queryUidList()\n {\n $this->applyCriteria();\n $this->applyScope();\n $model = $this->model->lists('uid');\n $this->resetModel();\n\n return $this->parserResult($model);\n }", "static function parseUid(string $uid, int $type): array\n {\n $expectedComponentCount = $type + 1;\n\n return explode(':', $uid, $expectedComponentCount) + array_fill(0, $expectedComponentCount, '');\n }", "function bbp_get_user_ids_from_nicenames($user_nicenames = array())\n{\n}", "function convert_organisation_list_to_id_list($organisation_list) {\n\t\t$return_array = array();\n\n\t\tforeach ($organisation_list as $value) {\n\t\t\t$return_array[] = $value['id'];\n\t\t}\n\t\treturn $return_array;\n\t}", "public function concatenateByUids(array $uids);", "public function getMentionedUsersIDs($htmlString)\n {\n $dom = HtmlDomParser::str_get_html($htmlString);\n $dataUsersIDs = [];\n $tags = $dom->find('span[data-id]');\n if (!empty($tags)) {\n foreach ($tags as $tag) {\n $dataUsersIDs[] = $tag->attr['data-id'];\n }\n $dataUsersIDs = array_unique($dataUsersIDs);\n }\n return $dataUsersIDs;\n }", "function labels_collection_names_to_ids($user, $names_array) {\n\tif (!is_array($names_array)) {\n\t\treturn false;\n\t}\n\n\t$collections = get_user_access_collections($user->guid);\n\n\t$ids = array();\n\tforeach ($collections as $c) {\n\t\tif (in_array($c->name, $names_array)) {\n\t\t\t$ids[] = $c->id;\n\t\t}\n\t}\n\n\treturn $ids;\n}", "public static function listToArray($listRaw) {\n if (is_array($listRaw)) {\n $list = array_combine(array_values($listRaw), array_values($listRaw));\n } else {\n if (strstr($listRaw, ',')) {\n $list = array_map('trim', explode(',', $listRaw));\n } else {\n $list = [$listRaw];\n }\n $list = array_combine($list, $list);\n }\n return empty($listRaw) ? [] : $list;\n }", "public function getCategoriesUidList()\n {\n $categoriesUids = [];\n\n /** @var Category $category */\n foreach ($this->getCategories() as $category) {\n $categoriesUids[] = $category->getUid();\n }\n\n return implode(',', $categoriesUids);\n }", "function bbp_get_user_nicenames_from_ids($user_ids = array())\n{\n}", "public function stringToArrayId($str);", "function cleanIDs($IDs)\n {\n //Define the pattern to search for\n $pattern = array(\n '`(,)+`', //Multiple commas\n '`^(,)`', //Comma on first position\n '`(,)$`' //Comma on last position\n );\n\n //Define replacement parameters\n $replace = array(\n ',',\n '',\n '');\n\n //Clean startID (all chars except commas and numbers are removed)\n $IDs = preg_replace($pattern, $replace, $IDs);\n\n return $IDs;\n }", "public function findByUids($uidList){\n $uids = GeneralUtility::intExplode(',', $uidList, true);\n if ($uidList === '' || count($uids) === 0) {\n return [];\n }\n\n /** @var QueryBuilder $queryBuilder */\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_showcase_domain_model_project');\n $rows = $queryBuilder\n ->select('*')\n ->from('tx_showcase_domain_model_project')\n ->where($queryBuilder->expr()->in('uid', $uids))\n ->add('orderBy', 'FIELD(tx_showcase_domain_model_project.uid,' . implode(',', $uids) . ')')\n ->execute()\n ->fetchAll();\n return $this->dataMapper->map(Project::class, $rows);\n }", "abstract public function initIdsList();", "public static function getUsernameListRegex($usernames) {\n return '(^|, )(' . implode('|', $usernames) . ')($|, )';\n }", "function getUserIDsv5($users)\n {\n $return = array();\n foreach ($this->getUsersv5($users) as $i) {\n $return[] = $i->id();\n }\n\n return $return;\n }", "private function get_proper_user_ids_array($array){\n\t\t\t$out = array();\n\t\t\tforeach ($array as $item) {\n\t\t\t\t$out[] = (int) $item['user_id'];\n\t\t\t}\n\t\t\treturn array_unique($out);\n\t\t}", "public static function getMentionUserIdFromText($text){\n\n $ids = [];\n $occurrence = '>@';\n $count = substr_count($text, $occurrence);\n $text = $text;\n\n // loop for each occurrence found within the text\n for ($i = 0; $i < $count; $i++) {\n\n $pos = strpos($text, $occurrence);\n\n if ($pos !== false) {\n $newStr = substr($text, 0, $pos);\n\n $text = substr($text, $pos + 3);\n $pos2 = strrpos($newStr, '<a href=\"');\n\n $newStr2 = substr($newStr, $pos2 + 9);\n $posF = strpos($newStr2, '\"');\n\n $link = substr($newStr2, 0, $posF);\n $parseUrl = parse_url($link);\n if (!empty($parseUrl) && !empty($parseUrl['query'])) {\n $kv = explode('=', $parseUrl['query']);\n if (!empty($kv[0]) && $kv[0] == 'id' && !empty($kv[1])) {\n $ids[] = $kv[1];\n }\n }\n }\n }\n \n return $ids;\n }", "function _loadUUIDList($tableName) {\n\n $list = array();\n $tableName = mysql_real_escape_string($tableName);\n\n $querystatement = \"\n SELECT\n `uuid`\n FROM\n `\".$tableName.\"`\n \";\n\n $queryresult = $this->db->query($querystatement);\n\n while($therecord = $this->db->fetchArray($queryresult))\n $list[] = $therecord[\"uuid\"];\n\n return $list;\n\n }" ]
[ "0.63171315", "0.5886883", "0.5882473", "0.5871972", "0.58058953", "0.5644715", "0.5623956", "0.5617993", "0.5605183", "0.5563703", "0.55615526", "0.5478087", "0.53940964", "0.5388544", "0.5370425", "0.533067", "0.53046536", "0.5217133", "0.51648605", "0.513272", "0.5104291", "0.50820494", "0.5080907", "0.5078055", "0.50584435", "0.5054293", "0.5047573", "0.5042846", "0.5035804", "0.50342065" ]
0.70851606
0
Get all existing correlation types.
function getAllCorrelationTypes() { $ctRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'tx_commerce_attribute_correlationtypes', '1'); $result = array(); while ($ct = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($ctRes)) { $result[] = $ct; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllType() {\n try {\n $this->openDb();\n $res = $this->contactsGateway->selectAllType();\n $this->closeDb();\n return $res;\n } catch (Exception $e) {\n $this->closeDb();\n throw $e;\n }\n }", "public function getCompanyTypes()\n {\n return CompanyType::all();\n }", "public function getTypes();", "public function types() {\n\t\treturn $this->getEntity($this->invokeGet(\"_types\"));\n\t}", "public static function findAll() {\r\n\t\treturn Doctrine::getTable ( 'ContactsTypes' )->findAll ();\r\n\t}", "public static function getTypes();", "public function getAllTypes() {\n if (empty($this->_data)) {\n $this->_load();\n }\n\n return $this->_data;\n }", "function get_subscription_types() {\n return array_unique($this->invoke_all('subscription types'));\n }", "public function getAllTypes () : array\n {\n return $this->typeRegistry->getAll();\n }", "public static function get_rafco_types() {\n\n\t\t// fetch any custom post types and merge with the built in\n\t\t$custom = self::get_rafco_option( 'typ' );\n\t\t$built = array( 'post' => 'post', 'page' => 'page' );\n\n\t\t// return the full array\n\t\treturn ! empty( $custom ) ? array_merge( $custom, $built ) : $built;\n\t}", "public function getTypes(): array;", "public static function getTypes(): array;", "abstract public function getTypes();", "public function getRelationshipTypes()\n {\n return $this->relationship_types;\n }", "protected function get_types() {\r\n\t\treturn $this->types;\r\n\t}", "public function getTypes()\n {\n return $this->types;\n }", "public function getTypes()\n {\n return $this->types;\n }", "public static function get_types() {\n\t\t$terms = get_terms(self::$tax_type->get_id(), array(\n\t\t\t'hide_empty' => FALSE,\n\t\t));\n\t\t// TODO: sort\n\t\treturn $terms;\n\t}", "public function GetCommonTypeNames()\n {\n return $this->commTypeNames;\n }", "protected function _getAll()\n\t{\n\t\treturn $this->call(\"ticket.type.getAll\");\n\t}", "public function getTypes() {\n\t\treturn $this->types;\n\t}", "public function getTypes(): array\n\t{\n return $this->types;\n }", "public static function getTypes()\n {\n return [\n static::ENQUIRY,\n static::COMPLAINT,\n ];\n }", "public static function get_types() {\n\t return self::$types;\n\t}", "public function getCcTypes()\n {\n $_types = Mage::getConfig()->getNode('global/datatrans_hm/cc/types')->asArray();\n\n uasort($_types, array('Mage_Payment_Model_Config', 'compareCcTypes'));\n\n $types = array();\n foreach ($_types as $data) {\n $types[$data['code']] = $data['name'];\n }\n return $types;\n }", "public static function allTypes(): array\n {\n return [\n static::RELATED_TO,\n static::EXACT_MATCH_OF,\n static::PART_OF,\n static::REPLACED_BY,\n static::PRECEDES,\n static::SKILL_LEVEL,\n static::IS_PEER_OF,\n static::EXEMPLAR,\n\n static::CHILD_OF,\n ];\n }", "public function getTypes() {\n\t\treturn array_keys($this->tca['types']);\n\t}", "public function getCcAvailableTypes() {\n $types = $this->_getConfig()->getCcTypes();\n if ($method = $this->getMethod()) {\n $availableTypes = $method->getConfigData('cctypes');\n if ($availableTypes) {\n $availableTypes = explode(',', $availableTypes);\n foreach ($types as $code => $name) {\n if (!in_array($code, $availableTypes)) {\n unset($types[$code]);\n }\n }\n }\n }\n return $types;\n }", "public function getAll()\n {\n return\n DB::table('lov_types')\n ->select('code', 'name')\n ->get();\n }", "public function getOrderTypes();" ]
[ "0.6714626", "0.6480988", "0.6379098", "0.62787837", "0.6265337", "0.61915666", "0.6190959", "0.61908686", "0.61612576", "0.6149274", "0.6146955", "0.6094212", "0.60875976", "0.60534924", "0.60189825", "0.59881955", "0.59881955", "0.59584314", "0.59192365", "0.59056425", "0.5897757", "0.58917147", "0.5887692", "0.5871814", "0.58708906", "0.5851875", "0.5847915", "0.58414644", "0.583794", "0.58175373" ]
0.8011612
0
Updates the XML of an article. This is neccessary because if we change anything in a category we also change all related products and articles. This has to be done in two steps. At first we have to update the relations in the database. But if we do so, the user won't recognize the changes in the backend because of the usage of flexforms. So this method, updates all the flexform value data in the database for the articles we change.
function updateArticleXML($articleRelations, $add = false, $articleUid = NULL, $productUid = NULL) { $xmlData = array(); if ($add && is_numeric($articleUid)) { $xmlData = $GLOBALS['TYPO3_DB']->exec_SELECTquery('attributesedit', 'tx_commerce_articles', 'uid=' .intval($articleUid)); $xmlData = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($xmlData); $xmlData = t3lib_div::xml2array($xmlData['attributesedit']); } $relationData= array(); /** * Build Relation Data */ if ($productUid) { $resRelationData = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tx_commerce_articles_article_attributes_mm.*','tx_commerce_articles, tx_commerce_articles_article_attributes_mm',' tx_commerce_articles.uid = tx_commerce_articles_article_attributes_mm.uid_local and tx_commerce_articles.uid_product = '.intval($productUid)); } if ($articleUid) { $resRelationData = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tx_commerce_articles_article_attributes_mm.*','tx_commerce_articles, tx_commerce_articles_article_attributes_mm',' tx_commerce_articles.uid = tx_commerce_articles_article_attributes_mm.uid_local and tx_commerce_articles.uid = '.intval($articleUid)); } if ($GLOBALS['TYPO3_DB']->sql_num_rows($resRelationData)>0) { while($relationRows = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resRelationData)) { $relationData[]=$relationRows; } } if(is_array($relationData)){ foreach ($articleRelations as $articleRelation) { if ($articleRelation['uid_valuelist'] != 0) { $value = $articleRelation['uid_valuelist']; } elseif (!empty($articleRelation['value_char'])) { $value = $articleRelation['value_char']; } else { if ($articleRelation['default_value'] <> 0) { $value = $articleRelation['default_value']; } else { $value = ''; } } $xmlData['data']['sDEF']['lDEF']['attribute_' .$articleRelation['uid_foreign']] = array('vDEF' => $value); } } $xmlData = t3lib_div::array2xml($xmlData, '', 0, 'T3FlexForms'); if ($articleUid) { $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_commerce_articles', 'uid=' .$articleUid .' AND deleted=0', array('attributesedit' => $xmlData)); } elseif ($productUid) { $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_commerce_articles', 'uid_product=' .$productUid .' AND deleted=0', array('attributesedit' => $xmlData)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function updateArt() {\n\t\tif(isset($_POST['update'])) {\n\t\t\tif (isset($_POST['designation_new'], $_POST['title_desc_new'], $_POST['desc_art_new'])) {\n\t\t\t\t\n\t\t\t\t$newArticle = new Article([\n\t\t\t\t\t'designation' => htmlspecialchars($_POST['designation_new']),\n\t\t\t\t\t'title_desc' => htmlspecialchars($_POST['title_desc_new']),\n\t\t\t\t\t'description_art' => htmlspecialchars($_POST['desc_art_new']),\n\t\t\t\t\t'id' => htmlspecialchars($_GET['id'])\n\t\t\t\t]);\n\n\t\t\t\t$newArtManager = new ArticleManager();\n\t\t\t\t$updateArticle = $newArtManager->update($newArticle);\n\t\t\t\theader('Location: admin.php?page=adminArticlesView');\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t}", "public function actionUpdate(){\n\t\t$request = Yii::$app -> request;\n\t\t$articleInfo = $request -> post();\n\t\t$id = $articleInfo['id'];\n\t\t$data = array(\n\t\t\t'articleInfo' => $articleInfo\n\t\t);\n\t\t$article = Article::find() -> where('id=:id',[':id' => $id]) -> one();\n\t\t$article -> title = $articleInfo['title'];\n\t\t$article -> content = $articleInfo['content'];\n\t\t$article -> status = $articleInfo['status'];\n\t\t$article -> keyword = $articleInfo['keyword'];\n\t\t$article -> update_time = date('Y-m-d H:i:s');\n\n\t\t$result = $article -> save();\n\t\t// make a response for frentend\n\t\t$res = array();\n\t\tif( $result ){\n\t\t\t$res['result'] = 'success';\n\t\t}\n\t\telse {\n\t\t\t$res['result'] = 'error';\n\t\t}\n\t\techo json_encode($res);\n\t}", "public function update(){\n \n $xml = $this->getXml();\n \n if($xml){\n \n foreach($xml->children() as $product){\n \n if($product->attributes()->action == 'modified'){\n //if($product->attributes()->action == 'unmodified'){\n \n $productxml = $this->getProductXml((string)$product->attributes()->id);\n \n if($productxml){\n foreach($productxml->children() as $productdetail){\n $this->updateProduct($productdetail);\n }\n }\n \n }\n }\n }\n }", "public function updated(Article $article)\n {\n }", "public function update_article($article_id, $article) {\n//this is the id of updated row and $article containing all complete updeted row see admin.php\n\t\t\t$this->db->where('id', $article_id);\n\t\t\t$query = $this->db->update('articles', $article);\n\n\t\t\treturn $query;\n\n\t\t}", "public function modifier(AbstractDocument $article)\n {\n $requete = \"UPDATE \" . self::TABLE_NAME . \" \" . $this->partieRequete() . \" WHERE id_article=:idArticle\";\n $data = $this->partieData($article);\n $data[\"idArticle\"] = $article->getId();\n return parent::requete($requete, false, $data);\n }", "public function update(Request $request, Article $article)\n {\n echo 'articles edit';\n $article->update($request->except('slug'));\n\n // Categories\n $article->categories()->detach();\n if ($request->input('categories')) :\n $article->categories()->attach($request->input('categories'));\n endif;\n\n return redirect()->route('admin.article.index');\n }", "public function update(ArticleRequest $request, article $article)\n {\n\n $article->name = $request->name;\n $article->price = $request->price;\n $article->description = $request->description;\n\n if ($request->img) {\n $article->img = $request->file('img')->store('public/img');\n }\n\n $article->save();\n\n\n \n if ($article->categories) {\n \n if (count($article->categories) > 0) {\n $article->categories()->detach(); \n }\n\n foreach ($request->categories as $category) {\n $article->categories()->attach($category);\n };\n }\n\n return redirect(route('article.index'));\n }", "public function update(Article $article, ArticleRequest $request){\n //public function update( $id, ArticleRequest $request ){\n //$article = Article::findOrFail($id);\n\n $article->update( $request->all() );\n\n //-> Update tags \"pivot table\"\n $article->tags()->sync( $request->input('tag_list') );\n\n return redirect('articles');\n }", "function updateArticle(&$article) {\n\t\t$article->stampModified();\n\t\t$this->update(\n\t\t\tsprintf('UPDATE articles\n\t\t\t\tSET\tlocale = ?,\n\t\t\t\t\tuser_id = ?,\n\t\t\t\t\tsection_id = ?,\n\t\t\t\t\tlanguage = ?,\n\t\t\t\t\tcomments_to_ed = ?,\n\t\t\t\t\tcitations = ?,\n\t\t\t\t\tdate_submitted = %s,\n\t\t\t\t\tdate_status_modified = %s,\n\t\t\t\t\tlast_modified = %s,\n\t\t\t\t\tstatus = ?,\n\t\t\t\t\tsubmission_progress = ?,\n\t\t\t\t\tcurrent_round = ?,\n\t\t\t\t\tsubmission_file_id = ?,\n\t\t\t\t\trevised_file_id = ?,\n\t\t\t\t\treview_file_id = ?,\n\t\t\t\t\teditor_file_id = ?,\n\t\t\t\t\tpages = ?,\n\t\t\t\t\tfast_tracked = ?,\n\t\t\t\t\thide_author = ?,\n\t\t\t\t\tcomments_status = ?\n\t\t\t\tWHERE article_id = ?',\n\t\t\t\t$this->datetimeToDB($article->getDateSubmitted()), $this->datetimeToDB($article->getDateStatusModified()), $this->datetimeToDB($article->getLastModified())),\n\t\t\tarray(\n\t\t\t\t$article->getLocale(),\n\t\t\t\t(int) $article->getUserId(),\n\t\t\t\t(int) $article->getSectionId(),\n\t\t\t\t$article->getLanguage(),\n\t\t\t\t$article->getCommentsToEditor(),\n\t\t\t\t$article->getCitations(),\n\t\t\t\t(int) $article->getStatus(),\n\t\t\t\t(int) $article->getSubmissionProgress(),\n\t\t\t\t(int) $article->getCurrentRound(),\n\t\t\t\t$this->nullOrInt($article->getSubmissionFileId()),\n\t\t\t\t$this->nullOrInt($article->getRevisedFileId()),\n\t\t\t\t$this->nullOrInt($article->getReviewFileId()),\n\t\t\t\t$this->nullOrInt($article->getEditorFileId()),\n\t\t\t\t$article->getPages(),\n\t\t\t\t(int) $article->getFastTracked(),\n\t\t\t\t(int) $article->getHideAuthor(),\n\t\t\t\t(int) $article->getCommentsStatus(),\n\t\t\t\t$article->getId()\n\t\t\t)\n\t\t);\n\n\t\t$this->updateLocaleFields($article);\n\n\t\t// update authors for this article\n\t\t$authors =& $article->getAuthors();\n\t\tfor ($i=0, $count=count($authors); $i < $count; $i++) {\n\t\t\tif ($authors[$i]->getId() > 0) {\n\t\t\t\t$this->authorDao->updateAuthor($authors[$i]);\n\t\t\t} else {\n\t\t\t\t$this->authorDao->insertAuthor($authors[$i]);\n\t\t\t}\n\t\t}\n\n\t\t// Update author sequence numbers\n\t\t$this->authorDao->resequenceAuthors($article->getId());\n\n\t\t$this->flushCache();\n\t}", "public function mdl_update_article( $value ){\n\n $date = explode(\"-\",$value['publish_date']);\n //$value['publish_date'] = $date[2].\"-\".$date[1].\"-\".$date[0]; \n $data = array(\n 'Headline'=>$value['article_tittle'], \n 'ArticleType'=>$value['article_type'],\n 'ArticleTag'=>$value['article_tage'],\n 'Abstract01'=>$value['content1'],\n 'MainText01'=>$value['content2'],\n 'MainText02'=>$value['content3'],\n 'PublishedDate'=>$value['publish_date']\n );\n \n $where = \"ArticleId =\".$value['id'] ; // article id\n $result = $this->db->update( $data, TBL_ARTICLE, $where );\n return $result;\n }", "public function importArticle($xmlArticle)\n\t{\n\t\t$form \t\t\t= new Form2ContentModelForm(array('ignore_request' => true));\n\t\t$rules\t\t\t= array();\n\t\t$data \t\t\t= array();\n\t\t$fieldData \t\t= array();\n\t\t\n\t\t$xmlArticle->registerXPathNamespace('f', $this->namespace);\n\t\t\n\t\t// Resolve the Content Type\n\t\t$contentTypeId = $this->dicContentTypesByName[(string)$xmlArticle->contenttype];\n\t\t\n\t\tif(!$contentTypeId)\n\t\t{\n\t\t\tthrow new Exception(sprintf(JText::_('COM_FORM2CONTENT_ERROR_CONTENTTYPE_NOT_RESOLVED'), (string)$xmlArticle->contenttype));\n\t\t}\n\t\t\n\t\t$contentType \t= F2cFactory::getContentType($contentTypeId);\n\t\t$articleId \t\t= $this->getArticleId($xmlArticle->id, $contentTypeId);\n\t\t$state \t\t\t= $this->getState($contentType, $xmlArticle);\n\n\t\tif($state == 'trashed' || $state == 'deleted')\n\t\t{\n\t\t\t$pks = array((int)$articleId);\n\n\t\t\tif($state == 'trashed')\n\t\t\t{\n\t\t\t\t$form->publish($pks, F2C_STATE_TRASH, true);\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$form->delete($pks, true);\n\t\t\t}\n\t\t\t\n\t\t\t// stop further processing\n\t\t\treturn $state;\n\t\t}\n\t\t\n\t\t// Load the existing form\n\t\t$existingForm \t\t\t\t= $form->getItem($articleId);\n\t\t$existingFieldData \t\t\t= $existingForm->fields;\n\t\t\n\t\t$data['id'] \t\t\t\t= $articleId;\n\t\t$data['projectid'] \t\t\t= $contentTypeId;\n\t\t$data['attribs'] \t\t\t= $xmlArticle->attribs->toArray();\n\t\t$data['metadata'] \t\t\t= $xmlArticle->metadata->toArray();\n\t\t\n\t\tforeach($contentType->fields as $field)\n\t\t{\n\t\t\t$field->reset();\n\t\t\t$fieldData[$field->fieldname] = $field;\n\t\t}\n\t\t\n\t\tif(count($xmlArticle->fields->children()))\n\t\t{\n\t\t\tforeach($xmlArticle->fields->children() as $xmlField)\n\t\t\t{\n\t\t\t\t$f2cField =& $fieldData[(string)$xmlField->fieldname];\n\t\t\t\t\n\t\t\t\tif($f2cField == null)\n\t\t\t\t{\n\t\t\t\t\t// Field is present in import XML, but not part of Content Type to which it should be imported\n\t\t\t\t\tthrow new Exception(sprintf(JText::_('COM_FORM2CONTENT_ERROR_FIELD_NOT_PART_OF_CONTENTTYPE'), (string)$xmlField->fieldname, (string)$xmlArticle->contenttype));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(array_key_exists($f2cField->fieldname, $existingForm->fields))\n\t\t\t\t{\n\t\t\t\t\t$existingInternalData = $existingForm->fields[$f2cField->fieldname]->internal;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$existingInternalData = null;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$f2cField->import($xmlField, $existingInternalData, $data);\n\t\t\t\t}\n\t\t\t\tcatch(Exception $e)\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception('Error for article #'.$data['id'].' ('.$data['title'].'): ' . $e->getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$data['preparedFieldData'] \t= $fieldData;\n\t\t\t$data['isCron'] \t\t\t= true;\n\t\t\t\n\t\t\tif(!$form->saveCron($data))\n\t\t\t{\n\t\t\t\tthrow new Exception('Error for article #'.$data['id'].' ('.$data['title'].'): ' . $form->getError());\n\t\t\t}\n\t\t\t\n\t\t\treturn $articleId ? 'updated' : 'inserted';\n\t\t}\n\t}", "function updateLocaleFields(&$article) {\n\t\t$this->updateDataObjectSettings('article_settings', $article, array(\n\t\t\t'article_id' => $article->getId()\n\t\t));\n\t}", "function updatePriceXMLFromDatabase( $articleUid) {\n $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n '*',\n 'tx_commerce_article_prices',\n 'deleted=0 AND uid_article=' .intval($articleUid)\n );\n $data = array('data' => array('sDEF' => array('lDEF')));\n while($priceDataArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){\n $priceUid=$priceDataArray[\"uid\"];\n $data['data']['sDEF']['lDEF']['price_net_' .$priceUid] = array('vDEF' => sprintf('%.2f', ($priceDataArray['price_net'] /100)));\n $data['data']['sDEF']['lDEF']['price_gross_' .$priceUid] = array('vDEF' => sprintf('%.2f', ($priceDataArray['price_gross'] /100)));\n $data['data']['sDEF']['lDEF']['hidden_' .$priceUid] = array('vDEF' => $priceDataArray['hidden']);\n $data['data']['sDEF']['lDEF']['starttime_' .$priceUid] = array('vDEF' => $priceDataArray['starttime']);\n $data['data']['sDEF']['lDEF']['endtime_' .$priceUid] = array('vDEF' => $priceDataArray['endtime']);\n $data['data']['sDEF']['lDEF']['fe_group_' .$priceUid] = array('vDEF' => $priceDataArray['fe_group']);\n $data['data']['sDEF']['lDEF']['purchase_price_' .$priceUid] = array('vDEF' => sprintf('%.2f', ($priceDataArray['purchase_price'] /100)));\n $data['data']['sDEF']['lDEF']['price_scale_amount_start_' .$priceUid] = array('vDEF' => $priceDataArray['price_scale_amount_start']);\n $data['data']['sDEF']['lDEF']['price_scale_amount_end_' .$priceUid] = array('vDEF' => $priceDataArray['price_scale_amount_end']); \n }\n\n $xml = t3lib_div::array2xml($data, '', 0, 'T3FlexForms');\n\n $res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery(\n 'tx_commerce_articles',\n 'uid=' .$articleUid,\n array('prices' => $xml)\n );\n\n return (bool)$res;\n }", "public function update(Request $request, articles $articles)\n {\n //\n }", "public function update(Article $article, ArticleRequest $request)\n {\n //$article = Article::findOrFail($id);\n //var_dump($article);\n \n $article->update($request->all());\n $this->syncTags($article, $request->input('tag_list'));\n //$article->tags()->attach($request->input('tag_list')); -- adds new rows to the table\n // $article->tags()->detach($request->input('tag_list')); --delete rows from the table\n // $article->tags()->sync($request->input('tag_list')); --remove the old row and add the new (updated)\n return redirect('articles');\n }", "function doArticleUpdate($import,$export,$importDaten)\n{\n\t$shop_data\t\t= $export->sSettings();\n\t$taxes\t\t\t= $shop_data['tax'];\n\t\n\t// prüfen ob eine Artikel schon vorhanden ist\n\t$update_check\t= $import->sGetArticleID($importDaten['products_ean']);\n\t$doPictures\t\t= (int) $importDaten[\"setProductImages\"];\n\t$article_id\t\t= false;\n\t\n\t// array mit den artikel daten\n\t$article_array = array(\n\t\t'name'\t\t\t\t=> mysql_escape_string(html_entity_decode($importDaten['products_name'])),\n\t\t'ordernumber'\t\t=> $importDaten['products_ean'],\n\t\t'supplierID'\t\t=> $importDaten['manufacturers_id'],\n\t\t'instock'\t\t\t=> $importDaten['products_quantity'],\n\t\t'weight'\t\t\t=> $importDaten['products_weight'],\n\t\t'description_long'\t=> mysql_escape_string(html_entity_decode($importDaten['products_description'])),\n\t\t'description'\t\t=> mysql_escape_string(html_entity_decode($importDaten['products_short_description'])),\n\t\t'shippingtime'\t\t=> $importDaten['products_shippingtime'],\n\t\t'added'\t\t\t\t=> $importDaten['products_date_added'],\n\t\t'taxID'\t\t\t\t=> $importDaten['products_tax_class_id']\n\t);\n\t\n\t// wenn der Artikel vorhanden ist häng die id an für ein update\n\tif($update_check !== false)\n\t{\n\t\t$message\t\t\t\t\t= 'upgedatet';\n\t\t$article_array['articleID']\t= $update_check;\n\t\t$article_id\t\t\t\t\t= $update_check;\n\t}\n\telse\n\t{\n\t\t$message\t\t\t\t\t= 'Neu angelegt';\n\t}\n\t\n\t$sArticleResponse = $import->sArticle($article_array);\n\t\n\tif(is_array($sArticleResponse))\n\t{\n\t\t// wenn der Artikel noch nicht existierte setzt die Artikel id\n\t\tif($update_check == false)\n\t\t{\n\t\t\t$article_id = $sArticleResponse['articleID'];\n\t\t}\n\t\t\n\t\t// berechnen des Netto Preises\n\t\t$tax_rate\t\t= ($taxes[$importDaten['products_tax_class_id']]['tax']/100)+1;\n\t\t$netto_price\t= $importDaten['products_price']/ $tax_rate;\n\t\t// setzen des Preises\n\t\t$price_state\t= $import->sArticlePrice(array('articleID' => $article_id, 'price' => $netto_price));\n\t\t// setzen der Kategorie\n\t\t$category_state\t= $import->sArticleCategory($article_id, $importDaten['products_categorie']);\n\t\t$image_state\t= false;\n\t\t\n\t\t// aktualisiere das Produktbild\n\t\tif($doPictures == 1 && $article_id !== false)\n\t\t{\n\t\t\tif($import->sDeleteArticleImages(array('articleID' => $article_id)))\n\t\t\t{\n\t\t\t\t$image_state = $import->sArticleImage(array('articleID' => $article_id, 'image' => $importDaten['products_image'], 'main' => 1));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$image_state = true;\n\t\t}\n\t\t\n\t\tif($image_state !== false && $price_state !== false && $category_state !== false)\n\t\t{\n\t\t\techo '<ItemResponse>\n\t\t\t\t<Success>true</Success>\n\t\t\t\t<Price></Price>\n\t\t\t\t<AuctionID>'.$importDaten['products_ean'].'</AuctionID>\n\t\t\t\t<Fault></Fault>\n\t\t\t\t<Message>'.$message.'</Message>\n\t\t\t\t</ItemResponse>';\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo '<ItemResponse>\n\t\t\t\t<Success>false</Success>\n\t\t\t\t<Price></Price>\n\t\t\t\t<AuctionID>'.$importDaten['products_ean'].'</AuctionID>\n\t\t\t\t<Fault></Fault>\n\t\t\t\t<Message></Message>\n\t\t\t\t</ItemResponse>';\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\t}\n\telse\n\t{\n\t\techo '<ItemResponse>\n\t\t\t\t<Success>false</Success>\n\t\t\t\t<Price></Price>\n\t\t\t\t<AuctionID>'.$importDaten['products_ean'].'</AuctionID>\n\t\t\t\t<Fault></Fault>\n\t\t\t\t<Message></Message>\n\t\t\t\t</ItemResponse>';\n\t\t\n\t\treturn false;\n\t}\n}", "public function update() {\n\n\t// Does the Article object have an ID?\n if ( is_null( $this->id ) ) trigger_error ( \"Article::update(): Attempt to update an Article object that does not have its ID property set.\", E_USER_ERROR );\n\n\t\t// Update the Article\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"UPDATE articles SET publicationDate=FROM_UNIXTIME(:publicationDate), title=:title, headline=:headline, pageId=:pageId, content=:content WHERE id = :id\";\n $st = $conn->prepare ( $sql );\n $st->bindValue( \":publicationDate\", $this->publicationDate, PDO::PARAM_INT );\n $st->bindValue( \":title\", $this->title, PDO::PARAM_STR );\n $st->bindValue( \":headline\", $this->headline, PDO::PARAM_STR );\n $st->bindValue( \":content\", $this->content, PDO::PARAM_STR );\n $st->bindValue( \":pageId\", $this->pageId, PDO::PARAM_INT );\n $st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\n $st->execute();\n\n $conn = null;\n}", "public function update(Article $article){\n\n //Validation rules\n $article->update($this->validateArticle());\n return redirect($article->path());\n }", "public function updateArticle(int $articleId)\n {\n $payload = Helpers::getPayload();\n\n $timestamp = $this->_database->getNewTimestamp(\n $this->_articles,\n $articleId,\n $payload['timestamp']\n );\n\n // Update only if the article was not updated since this cached update.\n if ($timestamp === false) {\n Http::sendNoContent();\n }\n\n $currentArticle = $this->_articles->findOne(\n ['_id' => $articleId],\n ['projection' => ['category' => 1, 'position' => 1]]\n );\n\n $inventoried = $this->_getInventoriedStatus();\n\n if ($currentArticle['category'] != $payload['category']) {\n $articlePosition = $this->_getNextPositionInCategory($payload['category']);\n } else {\n $articlePosition = $currentArticle['position'];\n }\n\n $updateFields = [\n 'category' => $payload['category'],\n 'name' => $payload['name'],\n 'size' => $payload['size'],\n 'unit' => $payload['unit'],\n 'gtins' => $payload['gtins'],\n 'inventoried' => $inventoried,\n 'position' => $articlePosition,\n 'timestamp' => $timestamp,\n ];\n $this->_articles->updateOne(\n ['_id' => $articleId],\n ['$set' => $updateFields]\n );\n\n if (isset($payload['lots'])) {\n $this->_database->lots->deleteMany(\n ['article' => $articleId]\n );\n\n $this->_insertLots($articleId, $payload['lots']);\n }\n\n Http::sendNoContent();\n }", "public function update() {\n\n // Does the Article object have an ID?\n if ( is_null( $this->id ) ) trigger_error ( \"Article::update(): Attempt to update an Article object that does not have its ID property set.\", E_USER_ERROR );\n \n // Update the Article\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"UPDATE articles SET publicationDate=FROM_UNIXTIME(:publDate), title=:title, outline=:outline, content=:content WHERE id = :id\";\n $stmt = $conn->prepare ( $sql );\n $stmt->bindValue( \":publDate\", $this->publicationDate, PDO::PARAM_INT );\n $stmt->bindValue( \":title\", $this->title, PDO::PARAM_STR );\n $stmt->bindValue( \":outline\", $this->outline, PDO::PARAM_STR );\n $stmt->bindValue( \":content\", $this->content, PDO::PARAM_STR );\n $stmt->bindValue( \":id\", $this->id, PDO::PARAM_INT );\n $stmt->execute();\n $conn = null;\n }", "public function updateArticle(){\r\r\n\t\t$updatingControls = array();\r\r\n\t\t$newControls = array();\r\r\n\t\t$numControlsInserted = 0;\r\r\n\t\t$numControlsUpdated = 0;\r\r\n\t\t$numControlsInArticle = 0;\r\r\n\t\t$numControlsRemoved = 0;\r\r\n\t\t$articleId = $_POST['articleId'];\r\r\n\t\t\r\r\n\t\t//get the list of existing controls in the given article.\r\r\n\t\t$existingControl = $this->create_and_edit_model->existingTagId($articleId);\r\r\n\t\t$updatingControls = $existingControl;\r\r\n\t\t\r\r\n\t\t//get the list of controls from this article edit request.\r\r\n\t\tfor($i=0; $i<count($_POST['data']); $i++){\r\r\n\t\t\t$newControls[] = $_POST['data'][$i][1];\r\r\n\t\t}\r\r\n\t\t$numControlsInArticle = count($newControls);\r\r\n\t\t\r\r\n\t\t/*Remove the controls from the updatingControls which does not exist in the \r\r\n\t\tnewControls array , so we left with only those controls which have to be updated.\r\r\n\t\tRemove the controls newControls array which does not exist in th list of \r\r\n\t\texistingControls, So we left with only new controls added in this article edit request.*/\r\r\n\t\tfor($j=0; $j<count($updatingControls);$j++){\r\r\n\t\t\tfor($k=0; $k<count($newControls);$k++){\r\r\n\t\t\t\tif($updatingControls[$j]['tagId'] == $newControls[$k]){\r\r\n\t\t\t\t\t$newControls[$k] = null;\r\r\n\t\t\t\t\tbreak;\r\r\n\t\t\t\t}\r\r\n\t\t\t\telse if($updatingControls[$j]['tagId'] != $newControls[$k] && $k == count($newControls)-1)\r\r\n\t\t\t\t\t$updatingControls[$j] = null;\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\t//resetting the index of arrays\r\r\n\t\t$removedControls = array_keys($updatingControls, null);\r\r\n\t\t$updatingControls = array_values(array_filter($updatingControls));\r\r\n\t\t$newControls = array_values(array_filter($newControls));\r\r\n\t\t\r\r\n\t\t//Add new controls under the given article Id\r\r\n\t\tfor($i=0; $i<count($newControls); $i++){\r\r\n\t\t\tfor($j=0; $j<count($_POST['data']); $j++){\r\r\n\t\t\t\tif($newControls[$i] == $_POST['data'][$j][1]){\r\r\n\t\t\t\t\t$controlId = $this -> savingControlInfo($_POST['data'][$j], $articleId);\r\r\n\t\t\t\t\t\r\r\n\t\t\t\t\t$tagAndTableData = $this -> constructTagArray($_POST['data'][$j][0], $controlId, $_POST['data'][$j] );\r\r\n\t\t\t\t\t$table = $tagAndTableData['table'];\r\r\n\t\t\t\t\t$tagData = array_slice($tagAndTableData, 0, count($tagAndTableData)-1, true);\r\r\n\t\t\t\t\t\r\r\n\t\t\t\t\tif($table != \"\" && $this->create_and_edit_model->saveTagInfo($tagData, $table) == 1)\r\r\n\t\t\t\t\t\t$numControlsInserted++;\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\t//Update the existing controls\r\r\n\t\tfor($i=0; $i<count($updatingControls); $i++){\r\r\n\t\t\tfor($j=0; $j<count($_POST['data']); $j++){\r\r\n\t\t\t\tif($updatingControls[$i]['tagId'] == $_POST['data'][$j][1]){\r\r\n\t\t\t\t\t$controlId = $this -> savingControlInfo($_POST['data'][$j], $articleId, $updatingControls[$i]['id']);\r\r\n\t\t\t\t\t\r\r\n\t\t\t\t\t$tagAndTableData = $this -> constructTagArray($_POST['data'][$j][0], $controlId, $_POST['data'][$j], \"update\" );\r\r\n\t\t\t\t\t$table = $tagAndTableData['table'];\r\r\n\t\t\t\t\t$tagData = array_slice($tagAndTableData, 0, count($tagAndTableData)-1, true);\r\r\n\t\t\t\t\t\r\r\n\t\t\t\t\tif($table != \"\" && $this->create_and_edit_model->updateTagInfo($tagData, $table) == 1)\r\r\n\t\t\t\t\t\t$numControlsUpdated++;\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\t//Disable the controls which are removed in this edit article request.\r\r\n\t\tfor($i=0; $i<count($removedControls); $i++){\r\r\n\t\t\t$numControlsRemoved += $this->create_and_edit_model\r\r\n\t\t\t\t->updateControlStatus($existingControl[$removedControls[$i]]['id']);\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\t$message = \"fail\";\r\r\n\t\tif($numControlsInArticle == $numControlsUpdated+$numControlsInserted \r\r\n\t\t\t\t&& count($existingControl) == $numControlsRemoved+$numControlsUpdated)\r\r\n\t\t\t$message = \"success\";\r\r\n\t\t\t\r\r\n\t\techo json_encode(array(\"msg\"=>$message,\"articleId\"=>$articleId));\r\r\n\t\t\r\r\n\t}", "public function update(Request $request, Article $article)\n {\n $this->authorize('update', $article);\n\n $request->validate([\n 'content' => 'required|string|max:255',\n 'category_id' => 'required|exists:categories,id',\n 'title' => 'reduired|string|max:255',\n ]);\n $article->update([\n 'description' => $request->title,\n 'categogy_id' => $request->category_id,\n 'content' => $request->article,\n ]);\n return back()->with('ok', __(\"L'article a bien été modifié\"));\n }", "public function update(Request $request, Article $article)\n {\n $validator = Validator::make($request->all(), [\n 'title' => ['required', 'string', 'max:255'],\n 'body' => ['required', 'string', 'max:1000'],\n 'topic_id' => 'required|exists:topics,id',\n 'tags' => 'required|exists:tags,id',\n ]);\n\n if ($validator->fails()) {\n return $this->error($validator->errors(), Response::HTTP_UNPROCESSABLE_ENTITY);\n }\n\n try\n {\n $this->service->article = $article;\n $this->service->handleUpdate();\n }\n catch (Exception $ex) {\n logger($ex);\n return $this->error('', Response::HTTP_INTERNAL_SERVER_ERROR);\n }\n\n $response['data'] = new ArticleResource($article);\n\n return $this->success($response, 'Article updated', Response::HTTP_CREATED);\n }", "public function update($wikiArticleforobject);", "function updateArticleText(&$articleText) {\n\t\t$returner = $this->update(\n\t\t\t'UPDATE article_text\n\t\t\tSET\t\n\t\t\t\tarticle_id = ?,\n\t\t\t\tlocale = ?,\n\t\t\t\tscientific_title = ?, \n\t\t\t\tpublic_title = ?,\n\t\t\t\tdescription = ?,\n key_inclusion_criteria = ?,\n key_exclusion_criteria = ?,\n recruitment_info = ?\n\t\t\tWHERE\tarticle_text_id = ?',\n\t\t\tarray(\n\t\t\t\t(int) $articleText->getArticleId(),\n\t\t\t\t$articleText->getLocale(),\n\t\t\t\t$articleText->getScientificTitle(),\n\t\t\t\t$articleText->getPublicTitle(),\n\t\t\t\t$articleText->getDescription(),\n\t\t\t\t$articleText->getKeyInclusionCriteria(),\n\t\t\t\t$articleText->getKeyExclusionCriteria(),\n\t\t\t\t$articleText->getRecruitmentInfo(),\n $articleText->getId()\n\t\t\t)\n\t\t);\n\t\treturn true;\n\t}", "public function update(Request $request, Articles $articles)\n {\n //\n }", "public function update(Article $article, ArticleRequest $request){\n\n $article->update($request->all());\n\n return redirect('articles');\n }", "public function update(StoreOrUpdateArticle $request, Article $article)\n {\n // Get the validated data from request validator\n $data = $request->validated();\n\n // Make slug readable\n $data['slug'] = $this->slugify($data['slug']);\n\n // Change published_at date\n if($data['published_at'] != \"\") {\n $data['published_at'] = Carbon::parse($data['published_at'])->format(\"Y-m-d H:i:s\");\n }\n\n // Change offline_at date\n if($data['offline_at'] != \"\") {\n $data['offline_at'] = Carbon::parse($data['offline_at'])->format(\"Y-m-d H:i:s\");\n }\n\n // Make from multiple keywords 1\n $data['keywords'] = @$this->implodeOrEmptyString($data['keywords']);\n\n // Save the updates\n $article->update($data);\n\n return Redirect::to('/admin/news');\n }", "public function update( Article $article, ArticleRequest $request )\n {\n $article->update( $request->all() );\n $this->syncTags( $article, $request->input( 'tag_list' ) );\n\n flash( 'Article <strong>\"' . $article->title . '\"</strong> successfully updated' );\n return redirect( 'articles' )->with( [ 'flashMessage' => 'updated' ] );\n }" ]
[ "0.63806283", "0.6232339", "0.6132638", "0.608994", "0.6012778", "0.5973307", "0.59707844", "0.59138364", "0.5866101", "0.58572185", "0.58470947", "0.5837104", "0.57783467", "0.5764082", "0.57272273", "0.5704406", "0.5690637", "0.56793565", "0.56680495", "0.5660328", "0.56534725", "0.5602107", "0.5581381", "0.5574791", "0.5573483", "0.5569393", "0.5568934", "0.5554503", "0.55504256", "0.55464566" ]
0.6364758
1
Updates the XML of an FlexForm value field. This is almost the same as "updateArticleXML" but more general.
function updateXML($xmlField, $table, $uid, $type, $ctList, $rebuild = false) { $xmlData = $GLOBALS['TYPO3_DB']->exec_SELECTquery($xmlField, $table, 'uid=' .intval($uid)); $xmlData = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($xmlData); $xmlData = t3lib_div::xml2array($xmlData[$xmlField]); if (!is_array($xmlData)) { $xmlData = array(); } switch (strtolower($type)) { case 'category': $relList = $this->getAttributesForCategory($uid); break; case 'product': $relList = $this->getAttributesForProduct($uid); break; } $cTypes = array(); // write the data if (is_array($ctList)) { foreach ($ctList as $ct) { $value = array(); if (is_array($relList)) { foreach ($relList as $relation) { if ($relation['uid_correlationtype'] == (int)$ct['uid']) { // add ctype to checklist in case we need to rebuild if(!in_array($ct['uid'], $cTypes)) { $cTypes[] = (int)$ct['uid']; } $value[] = $relation['uid_foreign']; } } } if (count($value) > 0) { $xmlData['data']['sDEF']['lDEF']['ct_' .(string)$ct['uid']] = array('vDEF' => (string)implode(',', $value)); } } } // rebuild if($rebuild && 0 < count($cTypes) && is_array($ctList)) { foreach ($ctList as $ct) { if (!in_array($ct['uid'], $cTypes)) { $xmlData['data']['sDEF']['lDEF']['ct_' .(string)$ct['uid']] = array('vDEF' => ''); } } } // build new XML if (is_array($xmlData)) { // Dump Quickfix $xmlData = t3lib_div::array2xml($xmlData, '', 0, 'T3FlexForms'); }else{ $xmlData = ''; } // update database entry $GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, 'uid=' .$uid, array($xmlField => $xmlData)); return array($xmlField => $xmlData); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update()\n\t{\n\t\t$form = $this->initForm(true);\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$properties = array(\n\t\t\t\t\"value_1\" => $form->getInput(\"val1\"),\n\t\t\t\t\"value_2\" => $form->getInput(\"val2\")\n\t\t\t);\n\t\t\tif ($this->updateElement($properties))\n\t\t\t{\n\t\t\t\tilUtil::sendSuccess($this->lng->txt(\"msg_obj_modified\"), true);\n\t\t\t\t$this->returnToParent();\n\t\t\t}\n\n\t\t}\n\n\t\t$form->setValuesByPost();\n\t\t$this->tpl->setContent($form->getHtml());\n\n\t}", "private function updateFlexForm()\n {\n $msg = null;\n if (count($this->contentElements) > 0 && count($this->sheet_mapping) > 0) {\n foreach ($this->contentElements as $content_id => $contentElement) {\n foreach ($this->sheet_mapping as $sheet_old => $sheet_new) {\n $old_values = $contentElement['ff_parsed']['data'][$sheet_old]['lDEF'];\n if (count($old_values) > 0) {\n foreach ($old_values as $key => $val) {\n $contentElement['ff_parsed']['data'][$sheet_new]['lDEF'][$key] = $val;\n }\n }\n unset($contentElement['ff_parsed']['data'][$sheet_old]);\n }\n // Update the content\n $table = 'tt_content';\n $where = 'uid=' . $content_id;\n $fields_values = array(\n 'pi_flexform' => $this->flexObj->flexArray2Xml($contentElement['ff_parsed'], 1)\n );\n if ($GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, $where, $fields_values)) {\n $msg[] = 'Updated contentElement uid: ' . $content_id . ', pid: ' . $this->contentElements[$content_id]['pid'];\n }\n }\n }\n return implode('<br/>', $msg);\n }", "public function updateFieldAction()\n\t{\n\t\t// get ajax data\n\t\t$field = $this->_getParam('field');\n\t\t$id = intval($this->_getParam('id'));\n\t\t$value = $this->_getParam('value');\n\t\t\n\t\t// condition : if bool, translate\n\t\tif ($value == \"true\" || $value == \"false\") {\n\t\t\t$value = ('true' == $value) ? 1 : 0;\n\t\t}\n\n\t\t$model = new $this->_primaryModel;\n\t\t$row = $model->find($id)->current();\n\t\t$row->$field = $value;\n\t\t$row->save();\n\t\t\n\t\t$this->logInteraction($this->_primaryModel, $id, $field, $value);\n\t\t\n\t\t// condition : if we've just shown an idea, send a confirmation email\n\t\tif ($this->_primaryModel == 'Default_Model_Ideas' && $field == 'is_hidden' && $value == 0) {\n\t\t\t$model->sendVisibleIdeaEmail($id);\n\t\t}\n\t\t\n\n\t\t// use json helper to display view render\n\t\t$this->_helper->json(Zend_Json::encode(array(\n\t\t\t'value' => $value,\n\t\t\t'id' => $id,\n\t\t\t'field' => $field,\n\t\t\t'success' => true\n\t\t)));\n\t}", "public static function xml_value( $value, $field ) {\n\t\tif ( $field->type === 'signature' ) {\n\t\t\t$value = self::get_final_signature_value( $value, array( 'use_html' => false ) );\n\t\t}\n\n\t\treturn $value;\n\t}", "public function updateAction($value);", "function setValue($xp, $value, $append = false)\n{\n\tglobal $xpath, $errorEncountered, $DEBUG;\n\t$nodeset = $xpath->query($xp);\n\tif($nodeset->length > 0)\n\t{\n\t\tif($append)\n\t\t\t$value = $nodeset->item(0)->nodeValue.' '.$value;\n\t\t$nodeset->item(0)->nodeValue = $value;\n\t\tif($DEBUG) echo '<br/>set value: '.$xp.' = '.$value;\n\t}\n\telse\n\t{\n\t\tif($DEBUG) echo '<br/>Error: unable to set value';\n\t\t$errorEncountered = 'yes';\n\t}\n}", "abstract protected function setValue( $entity, $languageCode, $value );", "function update_value( $value, $post_id, $field )\r\n\t{\r\n\t\t// vars\r\n\t\t$sub_fields = array();\r\n\t\t\r\n\t\tforeach( $field['layouts'] as $layout )\r\n\t\t{\r\n\t\t\tforeach( $layout['sub_fields'] as $sub_field )\r\n\t\t\t{\r\n\t\t\t\t$sub_fields[ $sub_field['key'] ] = $sub_field;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$total = array();\r\n\t\t\r\n\t\tif( $value )\r\n\t\t{\r\n\t\t\t// remove dummy field\r\n\t\t\tunset( $value['acfcloneindex'] );\r\n\t\t\t\r\n\t\t\t$i = -1;\r\n\t\t\t\r\n\t\t\t// loop through rows\r\n\t\t\tforeach($value as $row)\r\n\t\t\t{\t\r\n\t\t\t\t$i++;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// increase total\r\n\t\t\t\t$total[] = $row['acf_fc_layout'];\r\n\t\t\t\tunset( $row['acf_fc_layout'] );\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// loop through sub fields\r\n\t\t\t\tforeach($row as $field_key => $v)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sub_field = $sub_fields[ $field_key ];\r\n\r\n\t\t\t\t\t// update full name\r\n\t\t\t\t\t$sub_field['name'] = $field['name'] . '_' . $i . '_' . $sub_field['name'];\r\n\t\t\t\t\t\r\n\t\t\t\t\t// save sub field value\r\n\t\t\t\t\tdo_action('acf/update_value', $v, $post_id, $sub_field );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t/*\r\n\t\t* Remove Old Data\r\n\t\t*\r\n\t\t* @credit: http://support.advancedcustomfields.com/discussion/1994/deleting-single-repeater-fields-does-not-remove-entry-from-database\r\n\t\t*/\r\n\t\t\r\n\t\t$old_total = apply_filters('acf/load_value', 0, $post_id, $field);\r\n\t\t$old_total = count( $old_total );\r\n\t\t$new_total = count( $total );\r\n\r\n\t\tif( $old_total > $new_total )\r\n\t\t{\r\n\t\t\tforeach( $sub_fields as $sub_field )\r\n\t\t\t{\r\n\t\t\t\tfor ( $j = $new_total; $j < $old_total; $j++ )\r\n\t\t\t\t{ \r\n\t\t\t\t\tdo_action('acf/delete_value', $post_id, $field['name'] . '_' . $j . '_' . $sub_field['name'] );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t// update $value and return to allow for the normal save function to run\r\n\t\t$value = $total;\r\n\t\t\r\n\t\treturn $value;\r\n\t}", "public function addValueReplacement($field,$form);", "public function setValue($field_value) { \n $this->value = $field_value;\n \n $this->setAttribute('value', $field_value);\n }", "public function mdl_update_article( $value ){\n\n $date = explode(\"-\",$value['publish_date']);\n //$value['publish_date'] = $date[2].\"-\".$date[1].\"-\".$date[0]; \n $data = array(\n 'Headline'=>$value['article_tittle'], \n 'ArticleType'=>$value['article_type'],\n 'ArticleTag'=>$value['article_tage'],\n 'Abstract01'=>$value['content1'],\n 'MainText01'=>$value['content2'],\n 'MainText02'=>$value['content3'],\n 'PublishedDate'=>$value['publish_date']\n );\n \n $where = \"ArticleId =\".$value['id'] ; // article id\n $result = $this->db->update( $data, TBL_ARTICLE, $where );\n return $result;\n }", "public function updateField($fieldName, $value, $id);", "function update_value($post_id, $field, $value)\n\t{\n\t\t// do stuff with value\n\t\t\n\t\t// save value\n\t\tparent::update_value($post_id, $field, $value);\n\t}", "function addxmltablefield($databasename, $tablename, $field, $path = \".\", $force = true)\n{\n if (!isset($field['name']))\n return null;\n if (is_array($tablename))\n return;\n $values = $field;\n $pvalue = $field['name'];\n $pkey = \"name\";\n $old = \"$path/$databasename/$tablename.php\";\n if (!file_exists($old))\n return null;\n $readok = false;\n for ($i = 0; $i < _MAXTENTATIVIDIACCESSO; $i++)\n {\n $oldfilestring = file_get_contents($old);\n if (strpos($oldfilestring, \"</tables>\") !== false)\n {\n $readok = true;\n break;\n }\n }\n if (!$readok)\n {\n die(\"error update\");\n }\n $oldfilestring = xmldb_removexmlcomments($oldfilestring);\n $oldvalues = $newvalues = getxmltablefield($databasename, $tablename, $field['name'], $path);\n foreach ($values as $key => $value)\n {\n $newvalues[$key] = $value;\n }\n //compongo il nuovo xml per il record da aggiornare\n $strnew = \"<field>\";\n foreach ($newvalues as $key => $value)\n {\n $strnew .= \"\\n\\t\\t<$key>\" . xmlenc($value) . \"</$key>\";\n }\n $strnew .= \"\\n\\t</field>\";\n\n if ($oldvalues)\n {\n $pvalue = xmlenc($pvalue);\n $pvalue = xmldb_encode_preg($pvalue);\n $strnew = str_replace('$', '\\\\$', $strnew);\n $newfilestring = preg_replace('/<field>([^(field)]*)<' . $pkey . '>' . $pvalue . '<\\/' . $pkey . '>(.*?)<\\/field>/s', $strnew, $oldfilestring);\n if (!is_writable($old))\n {\n echo (\"$old is readonly,I can't update\");\n return (\"$old is readonly,I can't update\");\n }\n if ($oldfilestring != $newfilestring && $force)\n {\n $handle = fopen($old, \"w\");\n fwrite($handle, $newfilestring);\n xmldb_readDatabase($old, 'field', false, false); //aggiorna la cache\n }\n return $newvalues;\n }\n else // new field\n {\n for ($i = 0; $i < _MAXTENTATIVIDIACCESSO; $i++)\n {\n $oldfilestring = file_get_contents(\"$path/$databasename/$tablename.php\");\n if (strpos($oldfilestring, \"</tables>\") !== false)\n {\n $readok = true;\n break;\n }\n }\n if (!$readok)\n {\n return \"error insert field\";\n }\n $strnew = xmldb_encode_preg_replace2nd($strnew);\n $newfilestring = preg_replace('/<\\/tables>$/s', xmldb_encode_preg_replace2nd($strnew) . \"\\n</tables>\", trim($oldfilestring)) . \"\\n\";\n $handle = fopen(\"$path/$databasename/$tablename.php\", \"w\");\n fwrite($handle, $newfilestring);\n fclose($handle);\n xmldb_readDatabase($old, 'field', false, false); //aggiorna la cache\n return $newvalues;\n }\n}", "function update_field() {\n $id = $this->input->post('edit_id');\n $field = $this->input->post('field_name');\n $value = $this->input->post($field) ? $this->input->post($field) : $this->input->post('value');\n\n $team = new Page_model();\n $team = $team->get_from_id($id);\n $team->$field = $value;\n $team->save(null);\n \n echo $value;\n }", "function update_value($post_id, $field, $value)\n\t{\n\t\t// do stuff with value\n\n\t\tparent::update_value($post_id, $field, $value);\n\t}", "public function setup(SimpleXMLElement $element, $value, $group = null)\n\t{\n\t\t$return = parent::setup($element, $value, $group);\n\n\t\t// Onchange must always be the change context function\n\t\t$this->onchange = 'fieldsChangeContext(jQuery(this).val());';\n\n\t\treturn $return;\n\t}", "public function testUpdateNodeContent()\n {\n }", "public function update( $name, $value );", "public function UpdateXMLFile(){\n\t\t\n\t\t// get the value of the XMLSitemap page\n\t\t$xml = $this->GetXMLValue();\n\n\t\t// get link to xml file to be created/updated in site root\n\t\tif (Director::publicDir()) {\n\t\t\t$base_path = Director::publicFolder();\n\t\t} else {\n\t\t\t$base_path = Director::baseFolder();\n\t\t}\n\t\t$file = $base_path . '/sitemap.xml';\n\t\t$fp = fopen($file, \"w\");\n\t\t// prepend xml tag to result (gets excluded from curl)\n\t\t/*$output = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n\t\t$output .= $xml;*/\n\t\t\n\t\t// write xml file\n\t\tfwrite($fp, $xml);\n\t}", "private function setValue($field, $value) {\n $sql = \"UPDATE webform_submission_data\n SET value = '{$value}'\n where sid = \".t($this->sid)\n .\" and webform_id = 'icrp_partnership_applicaion_form'\n and name = '{$field}'\";\n //drupal_set_message($sql);\n $data = $this->connection->query($sql);\n //dump($data);\n return;\n\n }", "public function update() {\n $_SESSION['forena_report_editor'][$this->report_name] =\n $this->doc_prefix . $this->dom->saveXML($this->dom->documentElement);\n }", "function updatePriceXMLFromDatabase( $articleUid) {\n $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n '*',\n 'tx_commerce_article_prices',\n 'deleted=0 AND uid_article=' .intval($articleUid)\n );\n $data = array('data' => array('sDEF' => array('lDEF')));\n while($priceDataArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){\n $priceUid=$priceDataArray[\"uid\"];\n $data['data']['sDEF']['lDEF']['price_net_' .$priceUid] = array('vDEF' => sprintf('%.2f', ($priceDataArray['price_net'] /100)));\n $data['data']['sDEF']['lDEF']['price_gross_' .$priceUid] = array('vDEF' => sprintf('%.2f', ($priceDataArray['price_gross'] /100)));\n $data['data']['sDEF']['lDEF']['hidden_' .$priceUid] = array('vDEF' => $priceDataArray['hidden']);\n $data['data']['sDEF']['lDEF']['starttime_' .$priceUid] = array('vDEF' => $priceDataArray['starttime']);\n $data['data']['sDEF']['lDEF']['endtime_' .$priceUid] = array('vDEF' => $priceDataArray['endtime']);\n $data['data']['sDEF']['lDEF']['fe_group_' .$priceUid] = array('vDEF' => $priceDataArray['fe_group']);\n $data['data']['sDEF']['lDEF']['purchase_price_' .$priceUid] = array('vDEF' => sprintf('%.2f', ($priceDataArray['purchase_price'] /100)));\n $data['data']['sDEF']['lDEF']['price_scale_amount_start_' .$priceUid] = array('vDEF' => $priceDataArray['price_scale_amount_start']);\n $data['data']['sDEF']['lDEF']['price_scale_amount_end_' .$priceUid] = array('vDEF' => $priceDataArray['price_scale_amount_end']); \n }\n\n $xml = t3lib_div::array2xml($data, '', 0, 'T3FlexForms');\n\n $res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery(\n 'tx_commerce_articles',\n 'uid=' .$articleUid,\n array('prices' => $xml)\n );\n\n return (bool)$res;\n }", "function valueToXML() {\n\t\treturn parent::valueToXML().$this->value;\n\t}", "public function setValue($value) {\n $this->node->textContent= $value;\n }", "protected function updateValue()\r\n {\r\n $name = $this->getName();\r\n /* @var $ds HTML_QuickForm2_DataSource_NullAware */\r\n foreach ($this->getDataSources() as $ds) {\r\n if (null !== ($value = $ds->getValue($name))\r\n || $ds instanceof HTML_QuickForm2_DataSource_NullAware && $ds->hasValue($name)\r\n ) {\r\n $this->setValue($value);\r\n return;\r\n }\r\n }\r\n }", "function updateArticleXML($articleRelations, $add = false, $articleUid = NULL, $productUid = NULL)\t{\n\t $xmlData = array();\n\t if ($add && is_numeric($articleUid))\t{\n\t\t\t$xmlData = $GLOBALS['TYPO3_DB']->exec_SELECTquery('attributesedit', 'tx_commerce_articles', 'uid=' .intval($articleUid));\n\t\t\t$xmlData = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($xmlData);\n\t\t\t$xmlData = t3lib_div::xml2array($xmlData['attributesedit']);\n\t\t}\n\t\t\n\t\t\n\t\t$relationData= array();\n\t\t/**\n\t\t * Build Relation Data\n\t\t */\n\t\tif ($productUid) {\n\t\t\t$resRelationData = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tx_commerce_articles_article_attributes_mm.*','tx_commerce_articles, tx_commerce_articles_article_attributes_mm',' tx_commerce_articles.uid = tx_commerce_articles_article_attributes_mm.uid_local and tx_commerce_articles.uid_product = '.intval($productUid));\n\t\t}\n\t\tif ($articleUid) {\n\t\t\t$resRelationData = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tx_commerce_articles_article_attributes_mm.*','tx_commerce_articles, tx_commerce_articles_article_attributes_mm',' tx_commerce_articles.uid = tx_commerce_articles_article_attributes_mm.uid_local and tx_commerce_articles.uid = '.intval($articleUid));\n\t\t}\n\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($resRelationData)>0) {\n\t\t\t\n\t\t\twhile($relationRows = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resRelationData)) {\n\t\t\t\t$relationData[]=$relationRows;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tif(is_array($relationData)){\n\t\t foreach ($articleRelations as $articleRelation)\t{\n\t\t\t\tif ($articleRelation['uid_valuelist'] != 0)\t{\n\t\t\t\t\t$value = $articleRelation['uid_valuelist'];\n\t\t\t\t} elseif (!empty($articleRelation['value_char']))\t{\n\t\t\t\t\t$value = $articleRelation['value_char'];\n\t\t\t\t} else {\n\t\t\t\t\tif ($articleRelation['default_value'] <> 0) {\n\t\t\t\t\t\t$value = $articleRelation['default_value'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$value = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$xmlData['data']['sDEF']['lDEF']['attribute_' .$articleRelation['uid_foreign']] = array('vDEF' => $value);\n\t\t }\n\t\t}\n\t\t\n\t\t$xmlData = t3lib_div::array2xml($xmlData, '', 0, 'T3FlexForms');\n\t\n\t\tif ($articleUid) {\n\t\t\t$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_commerce_articles', 'uid=' .$articleUid .' AND deleted=0', array('attributesedit' => $xmlData));\n\t\t} elseif ($productUid) {\n\t\t\t$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_commerce_articles', 'uid_product=' .$productUid .' AND deleted=0', array('attributesedit' => $xmlData));\n\t\t}\n\t}", "abstract public function setValue($value);", "abstract function setValue($value);", "protected function persistFlexForm(array &$valueArray)\n {\n foreach ($valueArray as $key => $value) {\n if ($key === 'el') {\n foreach ($value as $idx => $v) {\n if ($v && substr($idx, 0, 3) === 'ID-') {\n $valueArray[$key][substr($idx, 3)] = $v;\n unset($valueArray[$key][$idx]);\n }\n }\n } elseif (isset($valueArray[$key])) {\n $this->persistFlexForm($valueArray[$key]);\n }\n }\n }" ]
[ "0.5773659", "0.5553773", "0.547123", "0.54518163", "0.54483074", "0.5423383", "0.5325286", "0.5282408", "0.5270726", "0.51505053", "0.51386696", "0.51093763", "0.50970936", "0.50305283", "0.49971396", "0.49954697", "0.49924144", "0.4991304", "0.49861294", "0.4936653", "0.4927857", "0.4922683", "0.49218112", "0.49198923", "0.4919134", "0.4899638", "0.48468426", "0.4842768", "0.48380238", "0.48314536" ]
0.5591745
1
Extracts a fieldvalue from an associative array.
function extractFieldArray($array, $field, $makeArray = false, $extraFields = array()) { $result = array(); if(is_array($array)){ foreach ($array as $data) { if (!is_array($data) || (is_array($data) && !array_key_exists($field, $data))) { $item[$field] = $data; } else { $item = $data; } if ($makeArray) { $newItem = array($field => $item[$field]); if (count($extraFields > 0)) { foreach ($extraFields as $extraFieldName) { $newItem[$extraFieldName] = $item[$extraFieldName]; } } } else { $newItem = $item[$field]; } if (!in_array($newItem, $result)) $result[] = $newItem; } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getValueFromSheetArray(array $sheetArray, array $fieldNameArr, $value)\t{\n\n\t\t$tempArr = $sheetArray;\n\t\tforeach($fieldNameArr as $k => $v)\t{\n\t\t\tif (t3lib_div::testInt($v))\t{\n\t\t\t\tif (is_array($tempArr))\t{\n\t\t\t\t\t$c=0;\n\t\t\t\t\tforeach($tempArr as $values)\t{\n\t\t\t\t\t\tif ($c==$v)\t{\n\t\t\t\t\t\t\t#debug($values);\n\t\t\t\t\t\t\t$tempArr=$values;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$c++;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrow new tx_pttools_exceptionInternal('No array found!');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$tempArr = $tempArr[$v];\n\t\t\t}\n\t\t}\n\t\tif (!array_key_exists($value, $tempArr)) {\n\t\t\tthrow new tx_pttools_exceptionInternal('Key not found!');\n\t\t}\n\t\treturn $tempArr[$value];\n\t}", "public function getValue($field);", "function value($field) {\n return $this->Fields[$field];\n}", "public function getFieldValue($field);", "public function getValue($arr)\n\t{\n\t\tglobal $varsRequest;\n\n\t\t$array = $arr['vars'];\n\t\t$formValue = $varsRequest['query']['jsonValue']['vars'];\n\n\t\tforeach ($array as $key => $value) {\n\t\t\t$str = $array[$key]['id'];\n\t\t\t$data = $formValue[$str];\n\n\t\t\tif\t(is_null($data) && $array[$key]['flagMustUse']) {\n\t\t\t\tif (FLAG_TEST) {\n\t\t\t\t\tvar_dump($varsRequest['query']);\n\t\t\t\t\tvar_dump(__CLASS__ . '/' .__FUNCTION__ . '/' .__LINE__);\n\t\t\t\t\tvar_dump($value);\n\t\t\t\t}\n\t\t\t\texit;\n\t\t\t}\n\t\t\t$array[$key]['value'] = $data;\n\t\t}\n\n\t\treturn $array;\n\t}", "function getValue($arr)\n\t{\n\t\t$count=count($arr);\n\t\t$counter=0;\n\t\tforeach ($arr as $key => $value) {\n\t\t //$field.=$key;\n\t\t\t $value1.=\"'\".trim($value).\"'\";\n\t\t\t if($counter<$count-1) \n\t\t\t {\n\t\t\t \t//$field.=\",\";\n\t\t\t\t$value1.=\",\";\n\t\t\t }\n\t\t\t $counter++;\n\t\t}\n\t\treturn $value1;\n\t}", "public function extract($value);", "protected function _decodeArrayFieldValue(array $value)\n {\n $result = array();\n unset($value['__empty']);\n foreach ($value as $_id => $row) {\n\n if (\n !is_array($row)\n || !array_key_exists('installment_boundary', $row)\n || !array_key_exists('installment_frequency', $row)\n ) {\n continue;\n }\n\n $boundary = $row['installment_boundary'];\n $frequency = $row['installment_frequency'];\n $result[] = array($boundary, $frequency);\n }\n\n return $result;\n }", "protected function _convertField($field, $value)\n {\n if (ctype_upper($field)) {\n $field = strtolower($field);\n }\n if (ctype_upper(substr($field, -1, 1))) {\n $stringLength = strlen($field);\n $start = substr($field, 0, $stringLength - 1);\n $end = strtolower(substr($field, -1, 1));\n $field = $start . $end;\n }\n\n $field = lcfirst($field);\n\n if ($field === 'totalCostWithVAt') {\n $field = 'totalCostWithVat';\n }\n\n if (is_array($value)) {\n $newValue = array();\n foreach ($value as $k => $v) {\n $k = $this->_convertField($k, $v);\n if ($k['field'] == '_') {\n $k['field'] = 'value';\n }\n $newValue[$k['field']] = $v;\n }\n $objValue = new Varien_Object();\n $objValue->setData($newValue);\n $value = $objValue;\n }\n\n $field = preg_replace_callback(\n '/[A-Z]/',\n create_function(\n '$args',\n 'return \\'_\\' . strtolower($args[0]);'\n ),\n $field\n );\n\n return array('field' => $field, 'value' => $value);\n }", "static function get_value( $name, $value ) {\n\t\tforeach ( (array) $name as $key ) {\n\t\t\tif ( !isset( $value[ $key ] ) )\n\t\t\t\treturn null;\n\n\t\t\t$value = $value[$key];\n\t\t}\n\n\t\treturn $value;\n\t}", "public function value($field);", "function getFieldValue($row_report, $attribute_name)\n\t {\n\t return NULL;\n\t }", "public function getField( $field ) {\n\t\tif ( isset( $this->data[$field]['value'] ) ) {\n\t\t\t$value = $this->data[$field]['value'];\n\n\t\t\tif ( !is_array( $value ) ) {\n\t\t\t\t$value = (string)$value;\n\t\t\t}\n\n\t\t\treturn $value;\n\t\t}\n\n\t\treturn null;\n\t}", "abstract public function mapFieldValue($value);", "public function offsetGet($field)\n\t{\n\t\treturn $this->getValue($field);\n\t}", "protected function processDatabaseFieldValue(array $row, $fieldName)\n {\n $currentDatabaseValues = array_key_exists($fieldName, $row)\n ? $row[$fieldName]\n : '';\n if (!is_array($currentDatabaseValues)) {\n $currentDatabaseValues = GeneralUtility::trimExplode(',', $currentDatabaseValues, true);\n }\n return $currentDatabaseValues;\n }", "function ExtractField($line) {\n\t//Extract the information out of the line\n\t$key = trim(substr($line, 0, strpos($line, \"=\")));\n\t$value = stripcslashes(trim(substr($line, strpos($line, \"=\") + 1, strlen($line))));\n\n\t//Sometimes people do this\n\t//Replaces '$usermods @ \"/', '\"marble/', and '\"platinum/' with '\"~/' so we can\n\t// parse them correctly\n\t$value = preg_replace('/(\\$usermods\\s*@\\s*\"\\/)|(\"(marble|platinum(beta)?)\\/)/i', '\"~/', $value);\n\n\t$keyLen = strlen($key);\n\t$valueLen = strlen($value);\n\n\tif ($keyLen > 0) {\n\t\tif ($key[$keyLen - 1] === '\"') {\n\t\t\t$key = substr($key, 0, $keyLen - 1);\n\t\t}\n\t\tif ($key[0] === '\"') {\n\t\t\t$key = substr($key, 1);\n\t\t}\n\t}\n\tif ($valueLen > 0) {\n\t\tif ($value[$valueLen - 1] === ';') {\n\t\t\t$value = substr($value, 0, $valueLen - 1);\n\t\t\t$valueLen --;\n\t\t}\n\t\tif ($value[$valueLen - 1] === '\"') {\n\t\t\t$value = substr($value, 0, $valueLen - 1);\n\t\t}\n\t\tif ($value[0] === '\"') {\n\t\t\t$value = substr($value, 1);\n\t\t}\n\t}\n\n\treturn [$key, $value];\n}", "function fieldvalue($field=\"field_condition_id\",$id=\"\",$condition=\"\",$order=\"\")\n\t{\n\t\t$rs=$this->fetchrecordset($id, $condition, $order);\n\t\t$ret=0;\n\t\twhile($rw=mysql_fetch_assoc($rs))\n\t\t{\n\t\t\t$ret=$rw[$field];\n\t\t}\n\t\treturn $ret;\n\t}", "public function getArrayValue($array)\n {\n foreach ($array as &$row)\n {\n if (is_array($row))\n $row = $this->getArrayValue($row);\n else\n $row = stripslashes(urldecode(preg_replace('/((\\%5C0+)|(\\%00+))/i', '', urlencode($row))));\n }\n return $array;\n }", "function elgg_extract($key, array $array, $default = null, $strict = true) {\n\tif (!is_array($array)) {\n\t\treturn $default;\n\t}\n\n\tif ($strict) {\n\t\treturn (isset($array[$key])) ? $array[$key] : $default;\n\t} else {\n\t\treturn (isset($array[$key]) && !empty($array[$key])) ? $array[$key] : $default;\n\t}\n}", "public function get_array_value( $key, $array ) {\n return ( gettype( $array ) === 'array' && array_key_exists( $key, $array ) ) ? $array[ $key ] : '';\n }", "function array_pluck($array, $value, $key = null)\n {\n $results = array();\n\n foreach ($array as $item) {\n $itemValue = data_get($item, $value);\n\n // If the key is \"null\", we will just append the value to the array and keep\n // looping. Otherwise we will key the array using the value of the key we\n // received from the developer. Then we'll return the final array form.\n if (is_null($key)) {\n $results[] = $itemValue;\n } else {\n $itemKey = data_get($item, $key);\n\n $results[$itemKey] = $itemValue;\n }\n }\n\n return $results;\n }", "function array_pluck($array, $value, $key = null)\n {\n $results = array();\n\n foreach ($array as $item)\n {\n $itemValue = data_get($item, $value);\n\n // If the key is \"null\", we will just append the value to the array and keep\n // looping. Otherwise we will key the array using the value of the key we\n // received from the developer. Then we'll return the final array form.\n if (is_null($key))\n {\n $results[] = $itemValue;\n }\n else\n {\n $itemKey = data_get($item, $key);\n\n $results[$itemKey] = $itemValue;\n }\n }\n\n return $results;\n }", "public function getValue($field) {\n if (is_array($this->values)) {\n return isset($this->values[$field]) ? $this->values[$field] : null;\n }\n if (is_object($this->values)) {\n return $this->values->$field;\n }\n return null;\n }", "protected function getValue($name, $array){\n\t\tif (is_array($array)){\n\t\t\tif (array_key_exists($name, $array)){\n\t\t\t\treturn $array[$name];\n\t\t\t}\n\t\t\t$dotPos = strpos($name, \".\");\n\t\t\tif ($dotPos !== false){\n\t\t\t\t$rest = substr($name, $dotPos + 1);\n\t\t\t\t$name = substr($name, 0, $dotPos);\n\t\t\t\tif (array_key_exists($name, $array)){\n\t\t\t\t\treturn $this->getValue($rest, $array[$name]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telseif (is_object($array)){\n\t\t\tif (property_exists($array, $name)){\n\t\t\t\treturn $array->${$name};\n\t\t\t}\n\t\t\t$dotPos = strpos($name, \".\");\n\t\t\tif ($dotPos !== false){\n\t\t\t\t$rest = substr($name, $dotPos + 1);\n\t\t\t\t$name = substr($name, 0, $dotPos);\n\t\t\t\tif (property_exists($array, $name)){\n\t\t\t\t\treturn $this->getValue($rest, $array->${$name});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public function get_profile_value($field_value, $field_data);", "function getValues() {\n $temp = array();\n foreach ($this->_fields_array as $n) {\n if (isset($this->{$n})) {\n $temp[$n] = $this->{$n};\n }\n }\n return $temp;\n }", "public function offsetGet($field) {\n if (isset($this->values[$field]) || $this->load($field)) {\n return $this->values[$field];\n }\n\n return NULL;\n }", "function getFieldValue($tblname,$fieldname,$value,$getfield)\n\t\t{\n\n\t\t\t$query = \"select \".$getfield.\" from \".$tblname.\" where \".$fieldname.\"='\".$value.\"'\";\n\t\t\t//myLog($query);\n\t\t $rs=mysql_query($query) or die(errorCatch(mysql_error()));\n\t\t $res=mysql_fetch_array($rs);\t\t\t\n\n\t\treturn $res[$getfield];\n\t\t}", "public function arrayColumn($array,$field) {\r\n $result = array();\r\n foreach($array as $key => $_array) {\r\n if(is_array($_array)) $result[] = $_array[$field];\r\n else if(is_object($_array)) {\r\n $result[] = $_array->getData($field);\r\n }\r\n }\r\n return $result;\r\n }" ]
[ "0.6279506", "0.609967", "0.6086352", "0.6045974", "0.59975094", "0.59292", "0.5916083", "0.57765645", "0.5774913", "0.57144004", "0.5695269", "0.56903213", "0.56815535", "0.56701094", "0.5628891", "0.56147856", "0.56113905", "0.5593393", "0.55753183", "0.5573081", "0.55707246", "0.55387187", "0.553456", "0.5520934", "0.55159193", "0.5515374", "0.5483653", "0.5479423", "0.5462287", "0.54583025" ]
0.6189038
1
Removed with irre implementation. Stub left for api compatibility save PriceFlexform with given ArticleUID
function savePriceFlexformWithArticle( $priceUid , $articleUid, $priceDataArray) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fix_articles_price($article_uid=0){\n \t\tif($article_uid==0){\n \t\t\treturn ;\n \t\t}\n \t\t\n\t\treturn updatePriceXMLFromDatabase($article_uid);\n }", "function updatePriceXMLFromDatabase( $articleUid) {\n $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n '*',\n 'tx_commerce_article_prices',\n 'deleted=0 AND uid_article=' .intval($articleUid)\n );\n $data = array('data' => array('sDEF' => array('lDEF')));\n while($priceDataArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){\n $priceUid=$priceDataArray[\"uid\"];\n $data['data']['sDEF']['lDEF']['price_net_' .$priceUid] = array('vDEF' => sprintf('%.2f', ($priceDataArray['price_net'] /100)));\n $data['data']['sDEF']['lDEF']['price_gross_' .$priceUid] = array('vDEF' => sprintf('%.2f', ($priceDataArray['price_gross'] /100)));\n $data['data']['sDEF']['lDEF']['hidden_' .$priceUid] = array('vDEF' => $priceDataArray['hidden']);\n $data['data']['sDEF']['lDEF']['starttime_' .$priceUid] = array('vDEF' => $priceDataArray['starttime']);\n $data['data']['sDEF']['lDEF']['endtime_' .$priceUid] = array('vDEF' => $priceDataArray['endtime']);\n $data['data']['sDEF']['lDEF']['fe_group_' .$priceUid] = array('vDEF' => $priceDataArray['fe_group']);\n $data['data']['sDEF']['lDEF']['purchase_price_' .$priceUid] = array('vDEF' => sprintf('%.2f', ($priceDataArray['purchase_price'] /100)));\n $data['data']['sDEF']['lDEF']['price_scale_amount_start_' .$priceUid] = array('vDEF' => $priceDataArray['price_scale_amount_start']);\n $data['data']['sDEF']['lDEF']['price_scale_amount_end_' .$priceUid] = array('vDEF' => $priceDataArray['price_scale_amount_end']); \n }\n\n $xml = t3lib_div::array2xml($data, '', 0, 'T3FlexForms');\n\n $res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery(\n 'tx_commerce_articles',\n 'uid=' .$articleUid,\n array('prices' => $xml)\n );\n\n return (bool)$res;\n }", "public function saveArticle(\\Yadeo\\Core\\Article $article)\n {\n }", "function fix_product_atributte($product_uid=0){\n \tif($product_uid==0){\n \t\t\treturn ;\n \t\t}\n \t\t$fieldSelected='*';\n \t\t$mm_table='tx_commerce_products_attributes_mm';\n \t\t$where='uid_local= '.intval($product_uid);\n \t$rs=$GLOBALS['TYPO3_DB']->exec_SELECTquery('uid_correlationtype,uid_foreign',$mm_table,$where,$groupBy='',$orderBy='',$limit='');\n \t#$GLOBALS['TYPO3_DB']->debug('exec_SELECTquery');\n\t\t$xmlArray=array();\n\t\t while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($rs)){\n \t\t\tif(empty($xmlArray['data']['sDEF']['lDEF']['ct_'.$row['uid_correlationtype']]['vDEF']))\n \t\t\t\t$xmlArray['data']['sDEF']['lDEF']['ct_'.$row['uid_correlationtype']]['vDEF']=$row['uid_foreign'];\n \t\t\telse\n \t\t\t\t$xmlArray['data']['sDEF']['lDEF']['ct_'.$row['uid_correlationtype']]['vDEF'].=','.$row['uid_foreign'];\n\t\t }\n\t\t$arrayToSave=array();\n\t\t$xmlText=t3lib_div::array2xml_cs ($xmlArray, 'T3FlexForms', $options=array(), $charset='');\n\t\t$arrayToSave['attributes']=$xmlText;\n\n\t\t$rs=$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_commerce_products','uid='.$product_uid,$arrayToSave,$no_quote_fields=false);\n\t#\t$GLOBALS['TYPO3_DB']->debug('exec_UPDATEquery');\n\n }", "public function saveArticle(){\r\r\n\t\t$categoryId;\r\r\n\t\t$numControlsInserted = 0;\r\r\n $articleData = array();\r\r\n\t\t$message = \"fail\";\r\r\n\t\t$articleId=0;\r\r\n\t\t\r\r\n\t\t//creating under category\r\r\n\t\tif(trim($_POST['articleInfo']['sub-category']) == \"none\" || trim($_POST['articleInfo']['sub-category']) == \"\"){\r\r\n\t\t\t$articleData['connectedTo'] = 1;\r\r\n\t\t\t$articleData['categoryId'] = $this->create_and_edit_model->getId($_POST['articleInfo']['category'], \"category\");\r\r\n\t\t}\r\r\n\t\t//creating under sub category\r\r\n\t\telse{\r\r\n\t\t\t$articleData['connectedTo'] = 0;\r\r\n\t\t\t$articleData['subCategoryId'] = $this->create_and_edit_model->getId($_POST['articleInfo']['sub-category'], \"subcategory\");\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\t$articleData['articleName'] = removeSpecialChar(trim($_POST['articleInfo']['articleName']));\r\r\n\t\t$articleData['articleKeyword'] = trim($_POST['articleInfo']['articleKeyword']);\r\r\n\t\t$articleData['articleTitle'] = trim($_POST['articleInfo']['articleTitle']);\r\r\n\t\t\r\r\n\t\tdate_default_timezone_set('America/New_York');\r\r\n\t\t$articleData['creationDate'] = date(\"Y-m-d\");\r\r\n\t\t$articleData['havePdfVersion'] = false;\r\r\n\t\t$articleData['setToEmail'] = false;\r\r\n\t\t$articleData['isItForm'] = false;\r\r\n\t\t$articleData['status'] = true;\r\r\n\t\t\r\r\n\t\t//check if article with same name already exist\r\r\n\t\tif($this->create_and_edit_model->nameExist($articleData['articleName'], \"articleName\", \"articleinfo\") == 0){\r\r\n\t\t\r\r\n\t\t\t$articleId = $this->create_and_edit_model->saveArticleInfo($articleData);\r\r\n\t\t\t\r\r\n\t\t\tfor($i=0; $i<count($_POST['data']); $i++){\r\r\n\t\t\t\t$controlId = $this -> savingControlInfo($_POST['data'][$i], $articleId);\r\r\n\t\t\t\t\r\r\n\t\t\t\t$tagAndTableData = $this -> constructTagArray($_POST['data'][$i][0], $controlId, $_POST['data'][$i] );\r\r\n\t\t\t\t$table = $tagAndTableData['table'];\r\r\n\t\t\t\t$tagData = array_slice($tagAndTableData, 0, count($tagAndTableData)-1, true);\r\r\n\t\t\t\t\r\r\n\t\t\t\tif($table != \"\" && $this->create_and_edit_model->saveTagInfo($tagData, $table) == 1)\r\r\n\t\t\t\t\t$numControlsInserted++;\r\r\n\t\t\t}\r\r\n\t\t} else $message = \"exist\";\r\r\n\t\t\r\r\n\t\t\r\r\n\t\tif($numControlsInserted == count($_POST['data']))\r\r\n\t\t\t$message = \"success\";\r\r\n\t\t\t\r\r\n\t\techo json_encode(array(\"msg\"=>$message,\"articleId\"=>$articleId));\r\r\n\t}", "function updateProductPart($data, $id)\n {\n }", "protected function checkArticleEdit() {\n global $dbOfferArticles;\n global $kitTools;\n\n $id = isset($_REQUEST[dbOfferArticles::FIELD_ID]) ? $_REQUEST[dbOfferArticles::FIELD_ID] : -1;\n $checked = true;\n $article = array();\n $message = '';\n foreach ($dbOfferArticles->getFields() as $key => $value) {\n switch ($key):\n case dbOfferArticles::FIELD_NUMBER:\n // if no article number is set, use the ID\n $article[$key] = (isset($_REQUEST[$key]) && !empty($_REQUEST[$key])) ? $_REQUEST[$key] : $id;\n break;\n case dbOfferArticles::FIELD_LONG_DESCRIPTION:\n case dbOfferArticles::FIELD_SHORT_DESCRIPTION:\n if (!isset($_REQUEST[$key]) || empty($_REQUEST[$key])) {\n $checked = false;\n $field = $this->lang->I18n($key);\n $message .= $this->lang->I18n('<p>The field <b>{{ field }}</b> must contain a value!</p>', array('field' => $field));\n }\n else {\n $article[$key] = $this->sanitizeVariable($_REQUEST[$key]);\n }\n break;\n case dbOfferArticles::FIELD_NAME:\n if (!isset($_REQUEST[$key]) || empty($_REQUEST[$key])) {\n $checked = false;\n $field = $this->lang->I18n($key);\n $message .= $this->lang->I18n('<p>The field <b>{{ field }}</b> must contain a value!</p>', array('field' => $field));\n }\n else {\n $article[$key] = trim($_REQUEST[$key]);\n }\n break;\n case dbOfferArticles::FIELD_PRICE:\n if (!isset($_REQUEST[$key])) {\n $checked = false;\n $field = $this->lang->I18n($key);\n $message .= $this->lang->I18n('<p>The field <b>{{ field }}</b> must contain a value!</p>', array('field' => $field));\n }\n else {\n // convert to float\n $article[$key] = $kitTools->str2float($_REQUEST[$key], CFG_THOUSAND_SEPARATOR, CFG_DECIMAL_SEPARATOR);\n }\n break;\n case dbOfferArticles::FIELD_IN_STOCK:\n if (!isset($_REQUEST[$key])) {\n $checked = false;\n $field = $this->lang->I18n($key);\n $message .= $this->lang->I18n('<p>The field <b>{{ field }}</b> must contain a value!</p>', array('field' => $field));\n }\n else {\n // convert to integer\n $article[$key] = $kitTools->str2int($_REQUEST[$key], CFG_THOUSAND_SEPARATOR, CFG_DECIMAL_SEPARATOR);\n }\n break;\n case dbOfferArticles::FIELD_STATUS:\n case dbOfferArticles::FIELD_ID:\n case dbOfferArticles::FIELD_IMAGES:\n case dbOfferArticles::FIELD_GROUP:\n default:\n // nothing to do...\n break;\n endswitch;\n }\n\n if ($checked) {\n if ($id > 0) {\n // update existing article\n $where = array(\n dbOfferArticles::FIELD_ID => $id\n );\n if (!$dbOfferArticles->sqlUpdateRecord($article, $where)) {\n $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbOfferArticles->getError()));\n return false;\n }\n $message .= $this->lang->I18n('<p>The article with the ID {{ id }} was successfull updated.</p>', array('id' => $id));\n }\n else {\n // ad a new article\n if (!$dbOfferArticles->sqlInsertRecord($article, $id)) {\n $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbOfferArticles->getError()));\n return false;\n }\n if (($article[dbOfferArticles::FIELD_NUMBER] == -1) || empty($article[dbOfferArticles::FIELD_NUMBER])) {\n // set article number to article ID\n $article_number = sprintf('%05d', $id);\n $where = array(\n dbOfferArticles::FIELD_ID => $id\n );\n $data = array(\n dbOfferArticles::FIELD_NUMBER => $article_number\n );\n if (!$dbOfferArticles->sqlUpdateRecord($data, $where)) {\n $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbOfferArticles->getError()));\n return false;\n }\n $message .= $this->lang->I18n('<p>kitOffer has changed the article number to {{ number }}.</p>', array('number' => $article_number));\n }\n $message .= $this->lang->I18n('<p>The article with the ID {{ id }} was successfull added.</p>', array('id' => $id));\n }\n // unset $_REQUEST's\n foreach ($dbOfferArticles->getFields() as $key => $value) {\n unset($_REQUEST[$key]);\n }\n // set ID\n $_REQUEST[dbOfferArticles::FIELD_ID] = $id;\n }\n $this->setMessage($message);\n return $this->dlgArticleEdit();\n }", "public function save($uid, $pid, $comment) {\n $field_values = '*'; \n $where = 'pid = '.$this->s($pid).' AND uid = '.$this->s($uid);\n $query = $GLOBALS['TYPO3_DB']->exec_SELECTquery($field_values,$this->table,$where);\n if($query){\n while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($query)){\n foreach($row as $key => $value){\n $insertArray[$key] = $value; \n }\n } \n } else {\n throw new Exception ('Can not get article from database');\n }\n $insertArray['article_uid'] = $insertArray['uid'];\n $insertArray['uid'] = ''; \n $insertArray['tstamp'] = time();\n $insertArray['comment'] = $comment;\n\n $status = $GLOBALS['TYPO3_DB']->exec_INSERTquery($this->tableForVersions,$insertArray);\n\n if(! $status){\n throw new Exception ('Can not write article version into database');\n }\n\n }", "function set_faq_article_data() {\n\n // Get codeigniter object instance\n $CI = &get_instance();\n\n // Verify if article's ID is numeric\n if ( is_numeric( $CI->input->get('article', true) ) ) {\n\n // Get article\n $article = $CI->faq_model->get_faq_article($CI->input->get('article', true));\n\n // If article exists will be added article in the queue if no, user will see empty create article composer\n if ( $article ) {\n\n // Add the article in the queue\n md_set_component_variable('support_faq_article', $article);\n\n }\n\n }\n \n }", "protected function dlgArticleEdit() {\n global $dbOfferArticles;\n global $kitTools;\n\n $id = (isset($_REQUEST[dbOfferArticles::FIELD_ID])) ? $_REQUEST[dbOfferArticles::FIELD_ID] : -1;\n\n if ($id > 0) {\n $article = array();\n $SQL = sprintf(\"SELECT * FROM %s WHERE `%s`='%d'\",\n $dbOfferArticles->getTableName(),\n dbOfferArticles::FIELD_ID,\n $id);\n if (!$dbOfferArticles->sqlExec($SQL, $article)) {\n $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbOfferArticles->getError()));\n return false;\n }\n if (count($article) < 1) {\n $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__,\n $this->lang->I18n('The article with the <b>ID {{ id }}</b> does not exists!', array('id' => $id))));\n return false;\n }\n $article = $article[0];\n }\n else {\n $article = $dbOfferArticles->getFields();\n $article[dbOfferArticles::FIELD_PRICE] = number_format(0, 2, CFG_DECIMAL_SEPARATOR, CFG_THOUSAND_SEPARATOR);\n $article[dbOfferArticles::FIELD_IN_STOCK] = -1;\n $article[dbOfferArticles::FIELD_ID] = $id;\n }\n\n foreach ($dbOfferArticles->getFields() as $key => $value) {\n if (isset($_REQUEST[$key])) {\n switch ($key) {\n case dbOfferArticles::FIELD_PRICE:\n $article[$key] = $kitTools->str2float($_REQUEST[$key], CFG_THOUSAND_SEPARATOR, CFG_DECIMAL_SEPARATOR);\n break;\n default:\n $article[$key] = $_REQUEST[$key];\n break;\n }\n }\n }\n\n $article_array = array();\n foreach ($article as $key => $value) {\n switch ($key) {\n case dbOfferArticles::FIELD_LONG_DESCRIPTION:\n case dbOfferArticles::FIELD_SHORT_DESCRIPTION:\n $article_array[$key] = array(\n 'name' => $key,\n 'value' => $this->unsanitizeText($value)\n );\n break;\n case dbOfferArticles::FIELD_PRICE:\n $article_array[$key] = array(\n 'name' => $key,\n 'value' => $value,\n 'formatted' => sprintf(CFG_CURRENCY, number_format($value, 2, CFG_DECIMAL_SEPARATOR, CFG_THOUSAND_SEPARATOR))\n );\n break;\n default:\n $article_array[$key] = array(\n 'name' => $key,\n 'value' => $value\n );\n break;\n }\n }\n\n $data = array(\n 'form' => array(\n 'name' => 'article_edit',\n 'action' => $this->page_link\n ),\n 'action' => array(\n 'name' => self::REQUEST_ACTION,\n 'value' => self::ACTION_ARTICLES\n ),\n 'sub_action' => array(\n 'name' => self::REQUEST_SUB_ACTION,\n 'value' => self::ACTION_SUB_ARTICLE_CHECK,\n ),\n 'message' => array(\n 'active' => (int) $this->isMessage(),\n 'text' => $this->isMessage() ? $this->getMessage() : ''\n ),\n 'fields' => $article_array,\n 'IMG_URL' => $this->img_url\n );\n return $this->getTemplate('article.edit.lte', $data);\n }", "public function action_setprice()\n\t{\n\t\t$this->auto_render = FALSE;\n\t\t\n\t\t$result = array(\n\t\t\t'success' => FALSE\n\t\t);\n\t\t\n\t\t$data = Arr::extract($_POST, array(\n\t\t\t'item',\n\t\t\t'price',\n\t\t\t'effective_date'\n\t\t));\n\t\t\n\t\tif ($data['item'])\n\t\t{\n\t\t\t$old_price = Sprig::factory('price')->load_price($data['item']);\n\t\t\t\n\t\t\t// If the target price record already exists\n\t\t\t// and the effective date is the same as the one set\n\t\t\tif ($old_price->loaded() && $data['effective_date'] == $old_price->verbose('effective_date'))\n\t\t\t{\n\t\t\t\t// Then simply update the price\n\t\t\t\t$old_price->price = $data['price'];\n\t\t\t\t\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$old_price->update();\n\t\t\t\t\t\n\t\t\t\t\t$result['success'] = 1;\n\t\t\t\t}\n\t\t\t\tcatch (Validate_Exception $e)\n\t\t\t\t{\n\t\t\t\t\t$result['message'] = implode(\"\\n\", $e->array->errors('price'));\n\t\t\t\t}\n\t\t\t\tcatch (Exception $e)\n\t\t\t\t{\n\t\t\t\t\t$result['message'] = $e->getMessage(); //'An error occured while setting price';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t// All other transaction will just create new price entry\n\t\t\t\t$new_price = Sprig::factory('price')->values($data);\n\t\t\t\t\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$new_price->create();\n\t\t\t\t\t\n\t\t\t\t\t$result['success'] = 1;\n\t\t\t\t}\n\t\t\t\tcatch (Validate_Exception $e)\n\t\t\t\t{\n\t\t\t\t\t$result['message'] = implode(\"\\n\", $e->array->errors('price'));\n\t\t\t\t}\n\t\t\t\tcatch (Exception $e)\n\t\t\t\t{\n\t\t\t\t\t$result['message'] = 'NEW: '.$e->getMessage().\"\\n\".var_export($data, TRUE); //'An error occured while setting price';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->request->headers['Content-type'] = 'application/json';\n\t\t$this->request->response = json_encode($result);\n\t}", "public function updatePrice($skuId, $price, $specialPrice);", "public static function updateArt() {\n\t\tif(isset($_POST['update'])) {\n\t\t\tif (isset($_POST['designation_new'], $_POST['title_desc_new'], $_POST['desc_art_new'])) {\n\t\t\t\t\n\t\t\t\t$newArticle = new Article([\n\t\t\t\t\t'designation' => htmlspecialchars($_POST['designation_new']),\n\t\t\t\t\t'title_desc' => htmlspecialchars($_POST['title_desc_new']),\n\t\t\t\t\t'description_art' => htmlspecialchars($_POST['desc_art_new']),\n\t\t\t\t\t'id' => htmlspecialchars($_GET['id'])\n\t\t\t\t]);\n\n\t\t\t\t$newArtManager = new ArticleManager();\n\t\t\t\t$updateArticle = $newArtManager->update($newArticle);\n\t\t\t\theader('Location: admin.php?page=adminArticlesView');\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t}", "function setPrice($price);", "private function _saveFlubitProductData($product) {\n\n try {\n\n if ($product->getSku() == '') {\n\n Mage::log($product->getId() . ' no sku', null, 'hum.txt');\n\n return;\n\n }\n\n Mage::log('SKU : ' . $product->getSku() . ' ID '. $product->getId(), null, 'hum.txt');\n\n $flubit = Mage::getModel('flubit/flubit')->load($product->getSku(), 'sku');\n\n\n\n $flubitObj = Mage::getModel('flubit/flubit');\n\n //$flubitPrice = (number_format($flubitObj->getFlubitPrice($product), 2, '.', ''));\n\n \n\n $qty = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty();//$flubitObj->getQty();\n\n //Mage::log(print_r($qty, TRUE), null, 'hum.txt');\n\n Mage::log('Quantity = ' . $qty, null, 'hum.txt');\n\n if ($flubit->getId() == '') {\n\n $flubit = Mage::getModel('flubit/flubit');\n\n $flubit->setName($product->getName())\n\n ->setSku($product->getSku())\n\n ->setPrice(0)\n\n ->setQty($qty)\n\n ->setStatus('1')\n\n ->setNew('1')\n\n ->save();\n\n } else {\n\n if (($this->checkEanValidation($product) && $this->checkImageValidation($product))) {\n\n $flubit->setName($product->getName())\n\n ->setSku($product->getSku())\n\n ->setPrice(0)\n\n ->setQty($qty)\n\n ->setStatus('1')\n\n ->save();\n\n }\n\n }\n\n } catch (Exception $e) {\n\n Mage::log(__LINE__ . '_saveFlubitProductData ' . $e, null, Flubit_Flubit_Helper_Data::FLUBIT_EXCEPTIONS);\n\n }\n\n try {\n\n if (is_object($flubit)) {\n\n $flubitPrice = (number_format($flubitObj->getFlubitPrice($product), 2, '.', ''));\n\n $flubit->setPrice($flubitPrice)\n\n ->save();\n\n }\n\n } catch (Exception $e) {\n\n Mage::log(__LINE__ . '_saveFlubitProductData ' . $e, null, Flubit_Flubit_Helper_Data::FLUBIT_EXCEPTIONS);\n\n }\n\n }", "function easy_save_article()\n\t{\n\t\t// Soll gespeichert werden\n\t\tif ( ( !empty( $this->checked->easysave ) ) ) {\n\t\t\t// Zuerst die Links ersetzen\n\t\t\t$this->easy_replace_links();\n\n\n\t\t\t$this->timestamp = date( \"j.n.Y G:i:s\" );\n\t\t\t// Tabelle repore speichern\n\t\t\t$sql = sprintf( \"UPDATE %s SET\n\t\t\tteaser_bild='%s',\n\t\t\tteaser_bild_lr='%s',\n\t\t\tdokuser='%d',\n\t\t\tstamptime='%d',\n\t\t\ttimestamp='%s',\n\t\t\tteaser_bild_html='%s'\n\t\t\tWHERE reporeID='%d' LIMIT 1\",\n\t\t\t\t$this->cms->tbname['papoo_repore'],\n\t\t\t\t$this->db->escape( $this->checked->teaser_bild ),\n\t\t\t\t$this->db->escape( $this->checked->teaser_bild_lr ),\n\t\t\t\t$this->user->userid,\n\t\t\t\ttime(),\n\t\t\t\t$this->timestamp,\n\t\t\t\t$this->db->escape( $this->teaserbild_in ),\n\t\t\t\t$this->db->escape( $this->checked->reporeid )\n\t\t\t);\n\t\t\t$this->db->query( $sql );\n\t\t\t// Sprachdaten speichern\n\t\t\t// Daten ersetzen\n\t\t\t$artikel = $this->replace->do_replace( $this->checked->lan_article_sans );\n\t\t\t$artikel = str_ireplace( \"ppmenuidpp\", $this->checked->menuid, $artikel );\n\t\t\t// HTML bereinigen\n\t\t\t$artikel = $this->html->do_tidy( $artikel );\n\t\t\t$this->checked->lan_article_sans = str_ireplace( \"\\./image\", \"../image\", $this->checked->lan_article_sans );\n\t\t\t$url_header = $this->menu->replace_uml( strtolower( $this->checked->header ) );\n\n\t\t\t$sql = sprintf( \"UPDATE %s SET\n\t\t\t\t\theader='%s',\n\t\t\t\t\tlan_teaser='%s',\n\t\t\t\t\tlan_article_sans='%s',\n\t\t\t\t\tlan_article='%s'\n\t\t\t\t\tWHERE lan_repore_id='%d' AND lang_id='%d' LIMIT 1\",\n\t\t\t\t$this->cms->tbname['papoo_language_article'],\n\t\t\t\t$this->db->escape( $this->checked->header ),\n\t\t\t\t$this->db->escape( $this->checked->lan_teaser ),\n\t\t\t\t$this->db->escape( $this->checked->lan_article_sans ),\n\t\t\t\t$this->db->escape( $artikel ),\n\t\t\t\t$this->db->escape( $this->checked->reporeid ),\n\t\t\t\t$this->cms->lang_id\n\t\t\t);\n\t\t\t$this->db->query( $sql );\n\t\t\tglobal $template;\n\t\t\t$location_url = \"./index.php?menuid=\" . $this->checked->menuid . \"&reporeid=\" . $this->checked->reporeid . \"&easyedit&getlang=\".$this->content->template['lang_short'];\n\n\t\t\tif ( $_SESSION['debug_stopallredirect'] ) {\n\t\t\t\techo '<a href=\"' . $location_url . '\">Weiter</a>';\n\t\t\t}\n\t\t\telse {\n\t\t\t\theader( \"Location: $location_url\" );\n\t\t\t}\n\t\t\texit;\n\t\t}\n\t\t// Soll gel�scht werden?\n\t\tif ( ( !empty( $this->checked->easydel ) ) ) {\n\t\t\t/**\n\t\t\t * Damit das l�schen nicht zu einfach ist\n\t\t\t * werdendie Artikel nur auf nicht ver�ffentlicht gesetzt\n\t\t\t * Richtig gel�scht werden kann nur in der Admin\n\t\t\t */\n\t\t\t$sql = sprintf( \"UPDATE %s SET\n\t\t\tpublish_yn='0'\n\t\t\tWHERE reporeID='%d' LIMIT 1\",\n\t\t\t\t$this->cms->tbname['papoo_repore'],\n\t\t\t\t$this->db->escape( $this->checked->reporeid )\n\t\t\t);\n\t\t\t$this->db->query( $sql );\n\t\t\t$location_url = \"./index.php?menuid=\" . $this->checked->menuid;\n\n\t\t\tif ( $_SESSION['debug_stopallredirect'] ) {\n\t\t\t\techo '<a href=\"' . $location_url . '\">Weiter</a>';\n\t\t\t}\n\t\t\telse {\n\t\t\t\theader( \"Location: $location_url\" );\n\t\t\t}\n\t\t\texit;\n\t\t}\n\t}", "public function modifier(AbstractDocument $article)\n {\n $requete = \"UPDATE \" . self::TABLE_NAME . \" \" . $this->partieRequete() . \" WHERE id_article=:idArticle\";\n $data = $this->partieData($article);\n $data[\"idArticle\"] = $article->getId();\n return parent::requete($requete, false, $data);\n }", "public function service_article( )\n {\n\n $view = $this->getView();\n $request = $this->getRequest();\n \n /* @var $model ShopFront_Model */\n $model = $this->loadModel( 'ShopFront' );\n \n $storeId = $request->param( 'store', Validator::EID );\n \n if( $storeId )\n $model->setStoreId( $storeId );\n else \n $storeId = $model->getDefStoreId();\n \n $body = new ShopFront_Article_Body();\n $body->articleId = $request->param( 'id', Validator::EID );\n $body->setModel( $model );\n \n $frontend = new ShopFront_Frontend();\n $frontend->setModel( $model );\n \n $frontend->render( $view, $body );\n\n }", "public function saveRecord($uid, $amount){\n if(!$uid || !$amount)\n return false;\n\n $res = Money::find()\n ->where(['uid' => $uid])\n ->one();\n\n if(!empty($res)){\n $res->amount = $amount;\n }else{\n $res = new Money();\n $res->uid = $uid;\n $res->amount = $amount;\n }\n\n if($res->save())\n return true;\n\n return false;\n }", "static function updateOffer($params){\n $con = $params['dbconnection'];\n $outlet_id = '';\n $title = '';\n $SKU = '';\n $search_tags = '';\n $description = '';\n $rules_of_purchase = '';\n $price = '';\n $special_price = '';\n $approx_saving = '';\n $image = '';\n $start_datetime = '';\n $end_datetime = '';\n $valid_for = '';\n $special = '';\n $special_type = '';\n $renew = '';\n $redemptions = '';\n if($offertexist = DbMethods::checkOffer($params) == 'offertexist'){\n return 'offertexist';\n }\n if($params['start_datetime'] != \"\"){\n $params['start_datetime'] = date_format(date_create($params['start_datetime']), \"Y-m-d H:i:s\");\n }\n if($params['end_datetime'] != \"\"){\n $params['end_datetime'] = date_format(date_create($params['end_datetime']), \"Y-m-d H:i:s\");\n }\n if($params['outlet_id'] != \"\"){\n $outlet_id = \" `outlet_id`='{$params['outlet_id']}' ,\";\n }\n if($params['title'] != \"\"){\n $title = \" `title`='{$params['title']}' ,\";\n }\n if($params['SKU'] != \"\"){\n $SKU = \" `SKU`='{$params['SKU']}' ,\";\n }\n if($params['search_tags'] != \"\"){\n $search_tags = \" `search_tags`='{$params['search_tags']}' ,\";\n }\n if($params['image'] != \"\"){\n $image = \" `image`='{$params['image']}' ,\";\n }\n if($params['start_datetime'] != \"\"){\n $start_datetime = \" `start_datetime`='{$params['start_datetime']}' ,\";\n }\n if($params['end_datetime'] != \"\"){\n $end_datetime = \" `end_datetime`='{$params['end_datetime']}' ,\";\n }\n if($params['price'] != \"\"){\n $price = \" `price`='{$params['price']}' ,\";\n }\n if($params['special_price'] != \"\"){\n $special_price = \" `special_price`='{$params['special_price']}' ,\";\n }\n if($params['approx_saving'] != \"\"){\n $approx_saving = \" `approx_saving`='{$params['approx_saving']}' ,\";\n }\n if($params['valid_for'] != \"\"){\n $valid_for = \" `valid_for`='{$params['valid_for']}' ,\";\n }\n if($params['special'] != \"\"){\n $special = \" `special`='{$params['special']}' ,\";\n }\n if($params['special_type'] != \"\"){\n $special_type = \" `special_type`='{$params['special_type']}' ,\";\n }\n if($params['renew'] != \"\"){\n $renew = \" `renew`='{$params['renew']}' ,\";\n }\n if($params['redemptions'] != \"\"){\n $redemptions = \" `redemptions`='{$params['redemptions']}' ,\";\n }\n if($params['description'] != \"\"){\n $description = \" `description`='{$params['description']}' ,\";\n }\n if($params['rules_of_purchase'] != \"\"){\n $rules_of_purchase = \" `rules_of_purchase`='{$params['rules_of_purchase']}' ,\";\n }\n $query = \"UPDATE `offers` SET\n\t\t\".$outlet_id.\"\n\t\t\".$title.\"\n\t\t\".$SKU.\"\n\t\t\".$search_tags.\"\n\t\t\".$description.\"\n\t\t\".$rules_of_purchase.\"\n\t\t\".$image.\"\n\t\t\".$start_datetime.\"\n\t\t\".$end_datetime.\"\n\t\t\".$price.\"\n\t\t\".$special_price.\"\n\t\t\".$approx_saving.\"\n\t\t\".$valid_for.\"\n\t\t\".$special.\"\n\t\t\".$special_type.\"\n\t\t\".$renew.\"\n\t\t\".$redemptions.\"\n\t\t`id`='{$params['id']}'\n\t\tWHERE `id`='{$params['id']}'\";\n mysqli_query($con, $query);\n if(mysqli_error($con) != ''){\n return \"mysql_Error:-\".mysqli_error($con);\n }\n $params['table_name'] = 'offers';\n $params['table_id'] = $params['id'];\n $params['admin_logstype'] = 'update';\n DbMethods::logs($params);\n return 'updated';\n }", "public function insertScreeningItem( $obj=null, $id=null ) {\n \n //Add the item to the database\n $item = new AudienceCrud( $this -> order -> context );\n $vars = array(\"fk_user_id\"=>$this-> order -> orderuser -> getUserId(),\"fk_payment_id\"=>$this -> order -> crud -> Payment -> getPaymentId(),\"fk_screening_unique_key\"=>$obj[\"data\"][0][\"screening_unique_key\"] );\n $item -> checkUnique( $vars );\n $item -> setFkScreeningId( $obj[\"data\"][0][\"screening_id\"] );\n $item -> setFkScreeningUniqueKey( $obj[\"data\"][0][\"screening_unique_key\"] );\n $item -> setFkUserId( $this -> order -> orderuser -> getUserId() );\n $item -> setAudienceTicketPrice( 0 );\n $item -> setFkPaymentId( $this -> order -> crud -> Payment -> getPaymentId() );\n $item -> setAudiencePaidStatus( 2 );\n $item -> setAudienceIpAddr( REMOTE_ADDR() );\n $item -> setAudienceCreatedAt( now() );\n $item -> setAudienceStatus( 0 );\n if ($this -> order -> orderuser -> getUserUsername() != '') {\n $item -> setAudienceUsername( $this -> order -> orderuser -> getUserUsername() );\n } else {\n $item -> setAudienceUsername( $this -> sessionVar(\"user_username\") );\n }\n $code = setUserOrderTicket();\n $item -> setAudienceInviteCode( $code );\n $item -> setAudienceShortUrl( '/theater/' . $obj[\"data\"][0][\"screening_unique_key\"] . '/' . $code );\n //$item -> setAudiencePaidStatus( 2 );\n \n $item -> save(); \n \n $solr = new SolrManager_PageWidget(null, null, $this -> context);\n $solr -> execute(\"add\",\"audience\",$item -> Audience -> getAudienceId());\n \n //Cross reference the item in the payment\n $this -> order -> crud -> setPaymentStatus( 2 );\n $this -> order -> crud -> setFkScreeningId( $obj[\"data\"][0][\"screening_id\"] );\n $this -> order -> crud -> setFkScreeningName( $obj[\"data\"][0][\"screening_name\"] );\n $this -> order -> crud -> setFkAudienceId( $item -> Audience -> getAudienceId() );\n $this -> order -> crud -> save();\n \n if (forTesting()) {\n //dump($item -> UserOrderProduct);\n }\n \n $this -> order -> ordertotal = str_replace(\"$\",\"\",$this -> postVar(\"ticket_price\"));\n $this -> order -> orderskus[] = $obj;\n $this -> order -> orderitems[] = $item;\n \treturn $item; \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 produits_article_update($id_article){\r\n\t$query = \"DELETE FROM spip_produits_articles WHERE id_article=\" . _q($id_article);\r\n\t$result = spip_query($query);\r\n\r\n\t$query = \"DELETE FROM spip_rubriquesthelia_articles WHERE id_article=\" . _q($id_article);\r\n\t$result = spip_query($query);\r\n\r\n\t//ajouter les associations produits-articles de cet article\r\n\tforeach ($_POST as $clef => $valeur){\r\n\t\tif (strpos($clef, \"produit-\")===0){\r\n\t\t\t$id_produit = substr($clef, 8);\r\n\t\t\tspip_query(\"INSERT INTO spip_produits_articles (id_article,id_produit) VALUES (\" . _q($id_article) . \",\" . _q($id_produit) . \")\");\r\n\t\t}\r\n\t}\r\n\r\n\t//ajouter les associations rubriquesthelia-articles de cet article\r\n\tforeach ($_POST as $clef => $valeur){\r\n\t\tif (strpos($clef, \"rubriquethelia-\")===0){\r\n\t\t\t$id_rubriquethelia = substr($clef, 15);\r\n\t\t\tspip_query(\"INSERT INTO spip_rubriquesthelia_articles (id_article,id_rubriquethelia) VALUES (\" . _q($id_article) . \",\" . _q($id_rubriquethelia) . \")\");\r\n\t\t}\r\n\t}\r\n\r\n\treturn array($id_article);\r\n}", "public function postScreeningItem( $obj=null, $id=null ) {\n $item = new AudienceCrud( $this -> order -> context );\n $vars = array(\"fk_user_id\"=>$this-> order -> orderuser -> getUserId(),\"fk_payment_id\"=>$this -> order -> crud -> Payment -> getPaymentId(),\"fk_screening_unique_key\"=>$obj[\"data\"][0][\"screening_unique_key\"] );\n $item -> checkUnique( $vars );\n $item -> setFkScreeningUniqueKey( $obj[\"data\"][0][\"screening_unique_key\"] );\n $item -> setFkScreeningId( $obj[\"data\"][0][\"screening_id\"] );\n $item -> setFkUserId( $this -> order -> orderuser -> getUserId() );\n $item -> setAudienceTicketPrice( $this -> postVar(\"ticket_price\") );\n $item -> setFkPaymentId( $this -> order -> crud -> Payment -> getPaymentId() );\n $item -> setAudiencePaidStatus( 0 );\n $item -> setAudienceIpAddr( REMOTE_ADDR() );\n $item -> setAudienceCreatedAt( now() );\n $item -> setAudienceStatus( 0 );\n if ($this -> order -> orderuser -> getUserUsername() != '') {\n $item -> setAudienceUsername( $this -> order -> orderuser -> getUserUsername() );\n } else {\n $item -> setAudienceUsername( $this -> sessionVar(\"user_username\") );\n }\n $code = setUserOrderTicket();\n $item -> setAudienceInviteCode( $code );\n $item -> setAudienceShortUrl( '/theater/' . $obj[\"data\"][0][\"screening_unique_key\"] . '/' . $code );\n //$item -> setAudiencePaidStatus( 2 );\n \n $item -> save(); \n \n $solr = new SolrManager_PageWidget(null, null, $this -> context);\n $solr -> execute(\"add\",\"audience\",$item -> Audience -> getAudienceId());\n \n //Cross reference the item in the payment\n $this -> order -> crud -> setFkAudienceId( $item -> Audience -> getAudienceId() );\n $this -> order -> crud -> save();\n \n if (forTesting()) {\n //dump($item -> UserOrderProduct);\n }\n \n $this -> order -> ordertotal = str_replace(\"$\",\"\",$this -> postVar(\"ticket_price\"));\n $this -> order -> orderskus[] = $obj;\n $this -> order -> orderitems[0] = $item;\n }", "public function __construct($id, $priceCategory=1, $customerId=0, $quantity=1, $date='', $imageFlag=0) {\n \n trace('***** Creating new '.__CLASS__.' object. *****');\n \n parent::__construct($id, $priceCategory, $customerId, $quantity, $date, $imageFlag);\n \n // set empty componentArticleCollection - this has to be re-set manually with setter method\n $this->componentArtCollObj = new tx_ptgsashop_componentArticleCollection;\n \n \n // TODO: this has to be changed to bcmath functions!!\n \n \n // if no retail prices are found in GSA compound article: set compound article retail price 1 as addition of component article prices \n if ($this->basicRetailPriceCategory1 == 0 && $this->basicRetailPriceCategory2 == 0 && $this->basicRetailPriceCategory3 == 0 \n && $this->basicRetailPriceCategory4 == 0 && $this->basicRetailPriceCategory5 == 0) {\n $this->basicRetailPriceCategory1 = 0.00;\n foreach ($this->componentArtCollObj as $componentArtObj) {\n // float operations may lead to precision problems (see www.php.net/float), using bcmath instead: this requires PHP to be configured with '--enable-bcmath'\n $this->basicRetailPriceCategory1 = (double)bcadd($this->basicRetailPriceCategory1, $componentArtObj->getItemSubtotal(1), 4); // single component net price multiplied with component quantity\n // original calculation: $this->basicRetailPriceCategory1 += $componentArtObj->getItemSubtotal(1); \n }\n $this->grossPriceFlag = 0; // important to know that current price is a net price\n }\n \n // if inland tax code not set in GSA compound article: set tax code to code of highest tax rate of component articles #### TODO: prüfen, ob in aktueller GSA-Version Ust-Code oder -Satz im Artikel gespeichert wird!!\n if (empty($this->taxCodeInland) || $this->taxCodeInland = '00') {\n $maxTaxRateInland = 0;\n $this->taxCodeInland = '00';\n foreach ($this->componentArtCollObj as $componentArtObj) {\n $compTaxRateInland = tx_ptgsashop_lib::getTaxRate($componentArtObj->get_taxCodeInland(), $this->date);\n if ($compTaxRateInland > $maxTaxRateInland) {\n $maxTaxRateInland = $compTaxRateInland;\n $this->taxCodeInland = $componentArtObj->get_taxCodeInland();\n }\n }\n }\n \n // if abroad tax code not set in GSA compound article: set tax code to code of highest tax rate of component articles #### TODO: prüfen, ob in aktueller GSA-Version Ust-Code oder -Satz im Artikel gespeichert wird!!\n if (empty($this->taxCodeAbroad) || $this->taxCodeAbroad = '00') {\n $maxTaxRateAbroad = 0;\n $this->taxCodeAbroad = '00';\n foreach ($this->componentArtCollObj as $componentArtObj) {\n $compTaxRateAbroad = tx_ptgsashop_lib::getTaxRate($componentArtObj->get_taxCodeAbroad(), $this->date);\n if ($compTaxRateAbroad > $maxTaxRateAbroad) {\n $maxTaxRateAbroad = $compTaxRateAbroad;\n $this->taxCodeAbroad = $componentArtObj->get_taxCodeAbroad();\n }\n }\n }\n \n }", "protected function _afterSave()\r\n {\r\n if($this->getPromoRule()['product_ids']){\r\n $productIds = explode('&', $this->getPromoRule()['product_ids']);\r\n $website = Mage::getModel('core/website')->load($this->getWebsiteId());\r\n $storeIds = $website->getStoreIds();\r\n $storeId = 0;\r\n foreach($storeIds as $_storeId){\r\n $storeId = $_storeId;\r\n }\r\n $listSku = array();\r\n foreach($productIds as $_productId) {\r\n $_product = Mage::getModel('catalog/product')->setStoreId($storeId)->load($_productId);\r\n if($_product->getId()){\r\n $listSku[] = $_product->getSku();\r\n $price = $_product->getPrice() * (float)(($this->defaultPercent - $this->getPercent())/$this->defaultPercent);\r\n $_product->setSpecialPrice($price);\r\n $_product->setSpecialFromDate(false);\r\n $_product->setSpecialFromDateIsFormated(true);\r\n //To stop Magento regenerating url-key for store, set following,\r\n $_product->setUrlKey(false);\r\n $_product->setRuleId($this->getRuleId());\r\n $_product->save();\r\n }\r\n }\r\n $this->insertSkuByRuleId($this->getRuleId(), $listSku);\r\n }\r\n return $this;\r\n }", "function setPrice($price){\n $this->price = $price;\n }", "function store()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n if( is_a( $this->Form, \"eZForm\" ) )\r\n {\r\n $FormID = $this->Form->id();\r\n }\r\n\r\n if( is_a( $this->Article, \"eZArticle\" ) )\r\n {\r\n $ArticleID = $this->Article->id();\r\n }\r\n\r\n $setValues = \"\r\n FormID='$FormID',\r\n ArticleID='$ArticleID'\r\n \";\r\n\r\n if ( empty( $this->ID ) )\r\n {\r\n $db->query( \"INSERT INTO eZArticle_ArticleFormDict SET $setValues\" );\r\n\r\n\t\t\t$this->ID = $db->insertID();\r\n }\r\n elseif ( is_numeric( $this->ID ) )\r\n {\r\n $db->query( \"UPDATE eZArticle_ArticleFormDict SET $setValues WHERE ID='$this->ID'\" );\r\n }\r\n return true;\r\n }", "public function createEditAuction(){\n\t\t\n\t\t$auction = null;\n\t\t$isValid = true;\n\t\t$errors = 'Los siguientes campos presentan errores: <ul>';\n\t\t$totalQuantity = 0;\n\t\t\n\t\tif(isset($_POST['entityQuantityId']) && isset($_POST['entytiesQuantity'])){\t\n\t\t\t\t\t\t\n\t\t\t$arrayEntities = $_POST['entityQuantityId'];\n\t\t\t$arrayQuantities = $_POST['entytiesQuantity'];\n\t\t\t\n\t\t\tforEach ($arrayQuantities as $curQuantity){\n\t\t\t\t\n\t\t\t\t$totalQuantity += $curQuantity;\n\t\t\t}\n\t\n\t\t}else{\n\t\t\t$errors.= \"<li> Debe de agregar almenos una entidad agregada </li>\";\n\t\t\t$isValid = false;\n\t\t}\n\t\t\n\t\tif ((sizeof($arrayEntities)>0) && (sizeof($arrayEntities) == sizeof($arrayQuantities))){\n\t\t\t$countAuctionEntities = sizeof($arrayEntities)-1;\n\t\t}else{\n\t\t\t$errors.= \"<li> Debe de agregar almenos una entidad agregada </li>\";\n\t\t\t$isValid = false;\n\t\t}\n\t\t\n\t\tif (isset($_POST['id']) && strcmp(\"\", $_POST['id']) != 0 ){\n\t\t\t$auction = \\Models\\Auction::findById($_POST['id']);\n\t\t}\n\t\n\t\tif (!isset($auction)){\n\t\t\t$auction = new \\Models\\Auction();\n\t\t}\n\t\t\n\t\t$auction->setRememberStart(false);\n\t\t$auction->setOpenPrice(trim($_POST['openPrice']));\n\t\n\t\tif (isset($_POST['title']) && strcmp(\"\", $_POST['title']) != 0){\n\t\t\t$auction->setAuctionName(trim($_POST['title']));\n\t\t}else{\n\t\t\t$errors.= \"<li> Debe de establecer un título a la subasta</li>\";\n\t\t\t$isValid = false;\n\t\t}\n\t\n\t\tif (isset($_POST['product']) && strcmp(\"\", $_POST['product']) != 0){\n\t\t\t$auction->setIdProduct(trim($_POST['product']));\n\t\t}else{\n\t\t\t$errors.= \"<li> debe de seleccionar un producto</li>\";\n\t\t\t$isValid = false;\n\t\t}\n\t\n\t\tif (isset($_POST['auctionType']) && strcmp(\"\", $_POST['auctionType']) != 0){\n\t\t\t$auction->setIdAuctionType(trim($_POST['auctionType']));\n\t\t}else{\n\t\t\t$errors.= \"<li> title </li>\";\n\t\t\t$isValid = false;\n\t\t}\n\t\n\t\tif (isset($_POST['currency']) && strcmp(\"\", $_POST['currency']) != 0 ){\n\t\t\t$auction->setIdCurrency(trim($_POST['currency']));\n\t\t}else{\n\t\t\t$errors.= \"<li> nombre no debe ser nulo </li>\";\n\t\t\t$isValid = false;\n\t\t}\n\t\t\n\t\tif (isset($_POST['uom']) && strcmp(\"\", $_POST['uom']) != 0 ){\n\t\t\t$auction->setIdUnitMeasure(trim($_POST['uom']));\n\t\t}else{\n\t\t\t$errors.= \"<li> Debe seleccionar una unidad de medida </li>\";\n\t\t\t$isValid = false;\n\t\t}\n\t\t\n\t\tif (isset($_POST['startDate']) && strcmp(\"\", $_POST['startDate']) != 0){\n\t\t\t$auction->setStartDate(trim($_POST['startDate']));\n\t\t}else{\n\t\t\t$errors.= \"<li> Debe de seleccionar una fecha de inicio</li>\";\n\t\t\t$isValid = false;\n\t\t}\n\t\n\t\tif (isset($_POST['endDate']) && strcmp(\"\", $_POST['endDate']) != 0){\n\t\t\t$auction->setEndDate(trim($_POST['endDate']));\n\t\t}else{\n\t\t\t$errors.= \"<li>Debe de seleccionar una fecha de finalización</li>\";\n\t\t\t$isValid = false;\n\t\t}\n\t\n\t\tif (isset($_POST['confirmExpirationDate']) && strcmp(\"\", $_POST['confirmExpirationDate']) != 0){\n\t\t\t$auction->setConfirmExpirationDate(trim($_POST['confirmExpirationDate']));\n\t\t}else{\n\t\t\t$errors.= \"<li>\tDebe de seleccionar una fecha de expiración para la confirmacion</li>\";\n\t\t\t$isValid = false;\n\t\t}\n\t\t\t\n\t\tif (isset($_POST['productStartDeliveryDate']) && strcmp(\"\", $_POST['productStartDeliveryDate']) != 0){\n\t\t\t$auction->setProductStartDeliveryDate(trim($_POST['productStartDeliveryDate']));\n\t\t}else{\n\t\t\t$errors.= \"<li>\tDebe de seleccionar una fecha de inicio de entrega</li>\";\n\t\t\t$isValid = false;\n\t\t}\n\t\t\n\t\tif (isset($_POST['productEndDeliveryDate']) && strcmp(\"\", $_POST['productEndDeliveryDate']) != 0){\n\t\t\t$auction->setProductEndDeliveryDate(trim($_POST['productEndDeliveryDate']));\n\t\t}else{\n\t\t\t$isValid = false;\n\t\t}\n\t\t\n\t\t//se agrega el documento de bases\n\t\tif(isset($_POST['upload']) && $_FILES['basis']['size'] > 0) {\n\t\t\t$fileName = $_FILES['basis']['name'];\n\t\t\t$fileSize = $_FILES['basis']['size'];\n\t\t\t$fileType = $_FILES['basis']['type'];\n\t\t\t$fp = fopen($_FILES['basis']['tmp_name'], 'r');\n\t\t\t$content = fread($fp, filesize(($_FILES['basis']['tmp_name'])));\n\t\t\tfclose($fp);\n\t\t\t$fileController = new \\Controllers\\FileController();\n\t\t\t$addFile = $fileController->addFile($content, $fileName, $fileSize, $fileType);\n\t\t\t\n\t\t\tif($addFile) {\n\t\t\t\n\t\t\t\t$idBasisFile = $addFile->getId();\n\t\t\t\t\t\t\t\n\t\t\t\t$auction->setIdFile($idBasisFile);\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\n\t\t}else{\n\t\t\t$errors.= \"<li>\tDebe de seleccionar un documento de bases</li>\";\n\t\t\t$isValid = false;\n\t\t}\n\t\t\t\n\t\t//inicializa las subastas a estado no disponible\n\t\t$auction->setIdStatus(2);\n\t\n\t\t$curDate = date('Y-m-d H:i:s');\n\t\tif (date('Y-m-d H:i:s',strtotime($auction->getStartDate())) <= date('Y-m-d H:i:s',strtotime($curDate))){\n\t\t\t$errors.= \"<li>\tLa fecha de inicio debe de ser Mayor a la fecha actual</li>\";\n\t\t\t$isValid = false;\n\t\t}\n\t\n\t\tif(strtotime($auction->getEndDate()) <= strtotime($auction->getStartdate())){\n\t\t\t$errors .= \"<li> La fecha de fin de subasta no puede ser menor que la fecha de inicio de subasta</li>\";\n\t\t\t$isValid = false;\n\t\t}\n\t\t \n\t\tif(strtotime($auction->getEndDate()) >= strtotime($auction->getProductStartDeliveryDate())){\n\t\t\t$errors .= \"<li> El plazo de entrega no puede ser menor a la fecha de finalización de la subasta</li>\";\n\t\t\t$isValid = false;\n\t\t}\n\t\t\n\t\tif(strtotime($auction->getProductStartDeliveryDate()) >= strtotime($auction->getProductEndDeliveryDate())){\n\t\t\t$errors .= \"<li> El plazo de fin de entrega no puede ser menor a la fecha de inicio de entrega del producto</li>\";\n\t\t\t\n\t\t\t$isValid = false;\n\t\t}\n\t\t\n\t\t$parameters = array();\n\t\t\n\t\t$sd = $auction->getStartDate();\n\t\t$ed = $auction->getEndDate();\n\t\t\n\t\t$parameters['idStatus'] = array(2,'<=');\n\t\t\n\t\t$auc = \\Models\\Auction::find($parameters);\t\t\n\t\t\n\t\tforeach ($auc as $curAuc){\n\t\t\t$curAucStDate = $curAuc->getStartDate();\n\t\t\t$curAucEndDate = $curAuc->getEndDate();\n\t\t\tif ( (strtotime($sd) >= strtotime($curAucStDate) && strtotime($sd) <= strtotime($curAucEndDate)) || (strtotime($curAucStDate) >= strtotime($sd) && strtotime($curAucStDate) <= strtotime($ed)) ){\n\t\t\t\n\t\t\t\t$isValid = false;\n\t\t\t\t$errors .= \"<li> Existe una subasta en estado disponible o no disponible en el rango de fechas dado</li>\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t$productController= new \\Controllers\\ProductController();\n\t\t$curProduct= $productController->getProductById($_POST['product']);\n\t\t\n\t\t//$curProduct = \\Models\\Product::findById($_POST['product']);\n\t\t$acKey = \"LIC\";\n\t\t$acKey .= date('YmdHis',strtotime($auction->getStartDate())); \n\t\t$acKey .= $curProduct->getKeyProduct();\n\t\t\n\t\t$auction->setAuctionKey($acKey);\n\t\t$auction->setQuantity($totalQuantity);\n\t\t\n\t\tif ($isValid){\n\t\t\t\n\t\t\t$response = $auction->saveOrUpdate();\n\t\t\t\n\t\t\t\tfor ($i=0; $i<=$countAuctionEntities ; $i++){\n\t\t\t\t\n\t\t\t\t\t$requestedQuantityController = null;\t\t\t\t\t\n\t\t\t\t\t$requestedQuantityController= new \\Controllers\\RequestedQuantityController();\n\t\t\t\t\t$requestedQuantity= $requestedQuantityController->addRequestedQuantity($arrayEntities[$i],$auction->getId(),$arrayQuantities[$i]);\n\t\t\t\t\t\t\t\t\n\t\t\t\t} \n\t\t\tif ( $response === true || $response == 1){\n\t\t\t\t\n\t\t\t\t$keyU = $auction->getAuctionKey();\n\t\t\t\t$uriCancel = \\App\\Route::getForNameRoute(\\App\\Route::GET, 'auctions');\n\t\n\t\t\t\t$msg = \"¡Subasta $keyU creada correctamente! <br><br/>\n\t\t\t\t<a class='btn btn-danger' href='$uriCancel' >Regresar a búsqueda</a> \";\n\t\t\t\treturn json_encode(array('msgDefault'=> $msg));\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\treturn json_encode(array('msgError'=>$response));\n\t\t\t}\n\t\t}else{\n\t\t\t\n\t\t\t$errors.= '</ul>';\n\t\t\treturn json_encode(array('msgError'=>$errors));\n\t\t}\n\t\n\t}", "function add_new_record_post()\n {\n\n //Product info\n $code = $this->post('code');\n $barcode = $this->post('barcode');\n $title = $this->post('title');\n $short_description = $this->post('short_description');\n $description = $this->post('description');\n $price = str_replace(',', '', $this->post('price'));\n $sale_price = str_replace(',', '', $this->post('sale_price'));\n $is_featured = !empty($this->post('is_featured')) ? 1 : 0 ;\n $is_active = !empty($this->post('is_active')) ? 1 : 0 ;\n $category_id = $this->post('category_id');\n $rating = str_replace(',', '', $this->post('rating'));\n $point_elv= !empty($this->post('point_elv')) ? $this->post('point_elv') : 0 ;\n\n $check_verify_params = checkVerifyParams(array(\n $title,\n ));\n if(!empty($check_verify_params)){\n $this->response(RestBadRequest(MISMATCH_PARAMS_MSG), BAD_REQUEST_CODE);\n }\n /* $value_isset=$this->post('point_elv');*/\n /*if (isset($value_isset)) {\n if ($point_elv < 1 || $point_elv > 5) {\n $this->response(RestBadRequest(POINT_CHECK_MSG), BAD_REQUEST_CODE);\n }\n }else{\n dump('test',true);\n }*/\n //Check sale price if larger than price\n if($sale_price > $price){\n $sale_price = $price;\n }\n if($rating > $sale_price){\n $rating = $sale_price;\n }\n\n //Check sale price is empty\n if(empty($sale_price)){\n $sale_price = $price;\n }\n\n $data_upload = array(\n 'code' => $code,\n 'barcode' => $barcode,\n 'title' => $title,\n 'plain_title' => skipVN($title, true),\n '_description' => $description,\n 'short_description' => $short_description,\n 'plain_description' => skipVN(removeHTMLTagsAndSpecialChar($description), true),\n '_key' => generateKeyTranslation(),\n 'price' => $price,\n 'sale_price' => $sale_price,\n 'wholesale_price' => $rating,\n 'is_featured' => $is_featured,\n 'point_evaluation'=>$point_elv,\n 'is_active' => $is_active,\n 'create_time' => CURRENT_TIME,\n 'update_time' => CURRENT_TIME,\n 'create_time_mi' => CURRENT_MILLISECONDS\n );\n\n if(!empty($_FILES['img_src']['name'])){\n $upload_dir = FOLDER_FILE_UPLOAD_RECORD;\n if (!is_dir($upload_dir)) {\n mkdir($upload_dir, 0777, TRUE);\n }\n //upload img_src\n $img_path = $_FILES['img_src']['name'];\n $img_path_ext = pathinfo($img_path, PATHINFO_EXTENSION);\n $config['upload_path'] = './public/upload/img/record';\n $config['allowed_types'] = 'jpg|jpeg|png';\n $config['file_name'] = strtotime('now') .'.'. $img_path_ext;\n\n //Load upload library and initialize configuration\n $this->load->library('upload', $config);\n $this->upload->initialize($config);\n\n if ($this->upload->do_upload('img_src')) {\n $data_upload['img_src'] = 'public/upload/img/record/'. $config['file_name'];\n }\n else{\n $this->response(RestServerError(), SERVER_ERROR_CODE);\n }\n }\n\n //insert account tb\n $this->record_model->create($data_upload);\n\n $record_id = $this->db->insert_id();\n //dump($category_id,true);\n //insert category_has_record tb\n\n if (!empty($category_id)) {\n foreach ($category_id as $value) {\n $this->category_has_record_model->create(array(\n 'category_id' => $value,\n 'record_id' => $record_id,\n ));\n }\n }\n $this->response(RestSuccess(), SUCCESS_CODE);\n }" ]
[ "0.61402595", "0.60301036", "0.5655185", "0.54047674", "0.5257919", "0.5198468", "0.51500434", "0.5116239", "0.50994074", "0.50871193", "0.5055504", "0.5051164", "0.5044252", "0.50382847", "0.5029648", "0.5025444", "0.49804848", "0.48971766", "0.48884115", "0.48859766", "0.48759374", "0.4862865", "0.48627785", "0.4861777", "0.4840454", "0.48337716", "0.48269433", "0.48238224", "0.4820771", "0.48204657" ]
0.7788612
0
Copies the Prices of a Article
function copyPrices($uidFrom, $uidTo) { global $BE_USER; // select all existing prices of the article $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'tx_commerce_article_prices', 'deleted = 0 AND uid_article = '.$uidFrom, ''); while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { // copy them to the new article $tce = t3lib_div::makeInstance('t3lib_TCEmain'); $tce->stripslashes_values = 0; $TCAdefaultOverride = $GLOBALS['BE_USER']->getTSConfigProp('TCAdefaults'); if (is_array($TCAdefaultOverride)) { $tce->setDefaultsFromUserTS($TCAdefaultOverride); } //start $tce->start(array(), array()); //invoke the copy manually so we can actually override the uid_product field $overrideArray = array('uid_article' => $uidTo); $BE_USER->uc['txcommerce_copyProcess'] = 1; $BE_USER->writeUC(); $newUid = $tce->copyRecord('tx_commerce_article_prices', $row['uid'], -$row['uid'], 1, $overrideArray); //copying done, clear session $BE_USER->uc['txcommerce_copyProcess'] = 0; $BE_USER->writeUC(); } if(!is_numeric($newUid)) return false; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function prpArticle() {\n\t\t$prp=['classes'=>['std'=>'article'],'attributes'=>[],\n\t\t\t'data_att'=>[]];\n\t\treturn $prp;\n\t}", "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 }", "public function updateProductsPrices()\n {\n $user = $this->invoice->userCart->user;\n\n $this->invoice->invoiceProduct->each(function (InvoiceProduct $invoiceProduct) use ($user){\n $product = $invoiceProduct->product;\n\n $invoiceProduct->price = $this->productPrice->getUserPriceByProductModel($product, $user);\n });\n }", "public function getInvoicePricing();", "function setPrice($price);", "public function getPricedCoverages()\n {\n return $this->pricedCoverages;\n }", "abstract function getPrice();", "public static function getPrice($pid=0 , $discount=false){\n if($discount){\n\n }\n else{\n\n }\n\n }", "protected function addCompoundPrice() {\n $this->meta = $this->arrayManager->merge(\n 'advanced_pricing_modal/children/advanced-pricing/children',\n $this->meta,\n $this->getCompoundPriceStructure()\n );\n }", "public function testGetDiscountProductsPrice()\n {\n foreach ( $this->aDiscounts as $oDiscount )\n $oDiscount->delete();\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 $oPrice = $oBasket->getDiscountProductsPrice();\n $this->assertEquals( 20 * 19, $oPrice->getBruttoSum() );\n }", "public function publierArticle($ref_Article)\n\t{\n\t\t$this->changeEtat('publier', $ref_Article);\n\t}", "function produits_article_update($id_article){\r\n\t$query = \"DELETE FROM spip_produits_articles WHERE id_article=\" . _q($id_article);\r\n\t$result = spip_query($query);\r\n\r\n\t$query = \"DELETE FROM spip_rubriquesthelia_articles WHERE id_article=\" . _q($id_article);\r\n\t$result = spip_query($query);\r\n\r\n\t//ajouter les associations produits-articles de cet article\r\n\tforeach ($_POST as $clef => $valeur){\r\n\t\tif (strpos($clef, \"produit-\")===0){\r\n\t\t\t$id_produit = substr($clef, 8);\r\n\t\t\tspip_query(\"INSERT INTO spip_produits_articles (id_article,id_produit) VALUES (\" . _q($id_article) . \",\" . _q($id_produit) . \")\");\r\n\t\t}\r\n\t}\r\n\r\n\t//ajouter les associations rubriquesthelia-articles de cet article\r\n\tforeach ($_POST as $clef => $valeur){\r\n\t\tif (strpos($clef, \"rubriquethelia-\")===0){\r\n\t\t\t$id_rubriquethelia = substr($clef, 15);\r\n\t\t\tspip_query(\"INSERT INTO spip_rubriquesthelia_articles (id_article,id_rubriquethelia) VALUES (\" . _q($id_article) . \",\" . _q($id_rubriquethelia) . \")\");\r\n\t\t}\r\n\t}\r\n\r\n\treturn array($id_article);\r\n}", "public function getPrepareData()\n {\n if (!empty($this->products)) {\n foreach ($this->products as $product) {\n $this->amount += $product->quantity;\n $this->price += $product->price * $product->quantity;\n }\n\n if ($this->amount >= 3) {\n $this->discount += 10;\n }\n\n if (!empty($this->bonus)) {\n $this->discount += $this->bonus->discount;\n }\n\n if ($this->discount) {\n $this->price = $this->price * (1 - $this->discount / 100);\n }\n }\n }", "function setPrice($price){\n $this->price = $price;\n }", "public function calculatePricePT()\n {\n//\t\tvar_dump($this->Price_pT_Base_override).\"<br>\";\n\t\tif(isset($this->Price_pT_Base_override) && $this->Price_pT_Base_override != \"\")\n\t\t\t{\n//\t\t\techo \"Price over ride<br>\";\n\t\t\t$this->Price_Sub_Total = $this->Price_pT_Base_override + $this->Price_production_pT + $this->Price_transport_pT;\t\n\t\t\t}\n\t\telse{\n\t\t\t//First calculate the price per ton, which is the sum of the ingedients->product price per tom\n\t \t\t$sum = 0;\n\t\t\tforeach($this->ingredients as $ingredientItem)\n\t\t\t\t{\n\t\t\t\t$sum += $ingredientItem->weightedCost;\n\t\t\t\t}\n\t\t\t$this->Price_pT_Base = $sum;\n\t\t\t$this->Price_Sub_Total = $this->Price_pT_Base + $this->Price_production_pT + $this->Price_transport_pT;\n\t\t}\n\t\t\n\n\t\t\n }", "function addCopies ($quantity)\n {\n for ($currentCopy = 1; $currentCopy <= $quantity; $currentCopy++) {\n $GLOBALS['DB']->exec(\"INSERT INTO copies (book_id) VALUES ({$this->getId()});\");\n }\n }", "public function assign_remaining() {\n\t\t$additionals = [];\n\t\tforeach ( $this->attributes as $key => $attrib ) {\n\t\t\tif ( $attrib['is_visible'] && ! $attrib['is_variation'] ) {\n\t\t\t\t$additionals[] = [\n\t\t\t\t\t'@type' => 'PropertyValue',\n\t\t\t\t\t'name' => $key,\n\t\t\t\t\t'value' => $this->product->get_attribute( $key ),\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\n\t\t$this->set_property( 'additionalProperty', $additionals );\n\t}", "public function createVariation(ProductInterface $product, $copyDependencies = true);", "public function __clone()\n\t{\n\t\tforeach( $this->products as $key => $value ) {\n\t\t\t$this->products[$key] = $value;\n\t\t}\n\n\t\tforeach( $this->addresses as $key => $value ) {\n\t\t\t$this->addresses[$key] = $value;\n\t\t}\n\n\t\tforeach( $this->services as $key => $value ) {\n\t\t\t$this->services[$key] = $value;\n\t\t}\n\n\t\tforeach( $this->coupons as $key => $value ) {\n\t\t\t$this->coupons[$key] = $value;\n\t\t}\n\t}", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function setPrice($price);", "public function setcustomcatalog($entity_id,$copy_writeinfo,$vpn);", "protected function _loadFromDb()\n {\n $sArticleId = $this->getArticle()->getId();\n\n if (!$this->isAdmin() && $this->getConfig()->getConfigParam('blVariantInheritAmountPrice') && $this->getArticle()->getParentId()) {\n $sArticleId = $this->getArticle()->getParentId();\n }\n\n if ($this->getConfig()->getConfigParam('blMallInterchangeArticles')) {\n $sShopSelect = '1';\n } else {\n $sShopSelect = \" `oxshopid` = \" . oxDb::getDb()->quote($this->getConfig()->getShopId()) . \" \";\n }\n\n $sSql = \"SELECT * FROM `oxprice2article` WHERE `oxartid` = \" . oxDb::getDb()->quote($sArticleId) . \" AND $sShopSelect ORDER BY `oxamount` \";\n\n $aData = oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->getAll($sSql);\n\n return $aData;\n }", "function generateCatalogue()\n{\n $articles = array(\n\n array(\n 'id' => \"1\",\n 'nom' => 'App shield power ! ',\n 'prix' => 599,\n 'url' => 'assets/icon-shield-orange.svg',\n 'desc' => 'lorem ipsum',\n 'descFull' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Reprehenderit laudantium repellat soluta pariatur modi suscipit obcaecati ducimus dolorem accusamus quasi minus, officia incidunt sit vitae asperiores facilis est vero? In.',\n 'qts' => '1'),\n array(\n 'id' => \"2\",\n 'nom' => \"App hub Green \",\n 'prix' => 15,\n 'url' => 'assets/icon-hub-green.svg',\n 'desc' => \"App hub Green \",\n 'descFull' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Reprehenderit laudantium repellat soluta pariatur modi suscipit obcaecati ducimus dolorem accusamus quasi minus, officia incidunt sit vitae asperiores facilis est vero? In.',\n 'qts' => '1'),\n array(\n 'id' => \"3\",\n 'nom' => \"App hub blue\",\n 'prix' => 75,\n 'url' => 'assets/icon-hub-blue.svg',\n 'desc' => \"Modèle emblématique\",\n 'descFull' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Reprehenderit laudantium repellat soluta pariatur modi suscipit obcaecati ducimus dolorem accusamus quasi minus, officia incidunt sit vitae asperiores facilis est vero? In.',\n 'qts' => '1'),\n array(\n 'id' => \"4\",\n 'nom' => \"App Gps gLue\",\n 'prix' => 90,\n 'url' => 'assets/icon-direction-blue.svg',\n 'desc' => \"Modèle emblématique \",\n 'descFull' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Reprehenderit laudantium repellat soluta pariatur modi suscipit obcaecati ducimus dolorem accusamus quasi minus, officia incidunt sit vitae asperiores facilis est vero? In.',\n 'qts' => '1'),\n );\n\n return $articles;\n\n}", "public function prices(): Prices\n {\n $query = $this->newRelatedInstance(Price::class)->newQuery();\n\n [$type, $id] = $this->getMorphs('metable', null, null);\n\n return new Prices($query, $this, $query->qualifyColumn($type), $query->qualifyColumn($id), $this->getKeyName());\n }", "public function resetCartPrices()\n {\n $cart = \\Cart::content();\n\n foreach($cart as $item)\n {\n $product = $this->product->find($item->id);\n\n if($product)\n {\n \\Cart::update($item->rowid, array('price' => $product->price_cents));\n }\n }\n }" ]
[ "0.5454907", "0.51076114", "0.50477576", "0.50346595", "0.5010359", "0.49716714", "0.49422967", "0.490533", "0.48978895", "0.4897097", "0.48944256", "0.48420367", "0.48410934", "0.48378742", "0.4813473", "0.4803921", "0.47992688", "0.47943047", "0.4777651", "0.47705236", "0.47705236", "0.47705236", "0.47705236", "0.47705236", "0.47699234", "0.47677907", "0.4745753", "0.47385445", "0.4736825", "0.47266573" ]
0.6028637
0
Copies the article attributes from one article to the next Used when we copy an article To copy from locale to locale, just insert the uids of the localized records; note that this function deletes the existing attributes
function overwriteArticleAttributes($uidFrom, $uidTo, $loc = 0) { // delete existing attributes $table = 'tx_commerce_articles_article_attributes_mm'; if($loc != 0) { // we want to overwrite the attributes of the locale // replace $uidFrom and $uidTo with their localized versions $uids = $uidFrom.','.$uidTo; $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid, l18n_parent', 'tx_commerce_articles', 'sys_language_uid = '.$loc.' AND l18n_parent IN ('.$uids.')'); $newFrom = $uidFrom; $newTo = $uidTo; // get uids while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { if($row['l18n_parent'] == $uidFrom) { $newFrom = $row['uid']; } else if($row['l18n_parent'] == $uidTo) { $newTo = $row['uid']; } } // abort if we didn't find the locale for any of the articles if($newFrom == $uidFrom || $newTo == $uidTo) { return false; } // replace uids $uidFrom = $newFrom; $uidTo = $newTo; } $GLOBALS['TYPO3_DB']->exec_DELETEquery( $table, 'uid_local='.$uidTo ); // copy the attributes $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $table, 'uid_local=' .$uidFrom .' AND uid_valuelist = 0'); while ($origRelation = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $origRelation['uid_local'] = $uidTo; $GLOBALS['TYPO3_DB']->exec_INSERTquery($table, $origRelation); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateArticleXML($articleRelations, $add = false, $articleUid = NULL, $productUid = NULL)\t{\n\t $xmlData = array();\n\t if ($add && is_numeric($articleUid))\t{\n\t\t\t$xmlData = $GLOBALS['TYPO3_DB']->exec_SELECTquery('attributesedit', 'tx_commerce_articles', 'uid=' .intval($articleUid));\n\t\t\t$xmlData = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($xmlData);\n\t\t\t$xmlData = t3lib_div::xml2array($xmlData['attributesedit']);\n\t\t}\n\t\t\n\t\t\n\t\t$relationData= array();\n\t\t/**\n\t\t * Build Relation Data\n\t\t */\n\t\tif ($productUid) {\n\t\t\t$resRelationData = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tx_commerce_articles_article_attributes_mm.*','tx_commerce_articles, tx_commerce_articles_article_attributes_mm',' tx_commerce_articles.uid = tx_commerce_articles_article_attributes_mm.uid_local and tx_commerce_articles.uid_product = '.intval($productUid));\n\t\t}\n\t\tif ($articleUid) {\n\t\t\t$resRelationData = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tx_commerce_articles_article_attributes_mm.*','tx_commerce_articles, tx_commerce_articles_article_attributes_mm',' tx_commerce_articles.uid = tx_commerce_articles_article_attributes_mm.uid_local and tx_commerce_articles.uid = '.intval($articleUid));\n\t\t}\n\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($resRelationData)>0) {\n\t\t\t\n\t\t\twhile($relationRows = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resRelationData)) {\n\t\t\t\t$relationData[]=$relationRows;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tif(is_array($relationData)){\n\t\t foreach ($articleRelations as $articleRelation)\t{\n\t\t\t\tif ($articleRelation['uid_valuelist'] != 0)\t{\n\t\t\t\t\t$value = $articleRelation['uid_valuelist'];\n\t\t\t\t} elseif (!empty($articleRelation['value_char']))\t{\n\t\t\t\t\t$value = $articleRelation['value_char'];\n\t\t\t\t} else {\n\t\t\t\t\tif ($articleRelation['default_value'] <> 0) {\n\t\t\t\t\t\t$value = $articleRelation['default_value'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$value = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$xmlData['data']['sDEF']['lDEF']['attribute_' .$articleRelation['uid_foreign']] = array('vDEF' => $value);\n\t\t }\n\t\t}\n\t\t\n\t\t$xmlData = t3lib_div::array2xml($xmlData, '', 0, 'T3FlexForms');\n\t\n\t\tif ($articleUid) {\n\t\t\t$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_commerce_articles', 'uid=' .$articleUid .' AND deleted=0', array('attributesedit' => $xmlData));\n\t\t} elseif ($productUid) {\n\t\t\t$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_commerce_articles', 'uid_product=' .$productUid .' AND deleted=0', array('attributesedit' => $xmlData));\n\t\t}\n\t}", "public static function seedLocaleData()\n {\n $existingLocale = Locale::find(1);\n $existingLocale->code = 'de';\n $existingLocale->name = 'German';\n $existingLocale->save();\n\n $additionalLocales = [\n 'fr' => 'French',\n 'it' => 'Italian',\n ];\n\n foreach ($additionalLocales as $code => $name) {\n $locale = new Locale();\n $locale->code = $code;\n $locale->name = $name;\n $locale->is_enabled = true;\n $locale->save();\n }\n }", "function updateLocaleFields(&$article) {\n\t\t$this->updateDataObjectSettings('article_settings', $article, array(\n\t\t\t'article_id' => $article->getId()\n\t\t));\n\t}", "public function prepareElements()\n {\n if ( false === $this->isMultiLanguage() )\n {\n $this->remove( 'all' );\n }\n }", "private function unarchiveUniqueLessons() {\n $result = eF_getTableData(\"lessons\", \"*\", \"originating_course=\".$this -> course['id']);\n foreach ($result as $value) {\n $value = new EfrontLesson($value);\n $value -> unarchive();\n }\n }", "public function postImport()\n {\n $obj_list = CategoryQuery::create()->orderById()->find();\n\n foreach ($obj_list as $obj) {\n $t1_parent = $obj->getParent() - 1000000;\n\n if ($t1_parent > 0) $obj->setParent($this->cat_corresp->getT2($t1_parent))->save();\n }\n }", "public function fillTranslated($locale, $attributes)\n {\n $this->{$this->locale_field} = $locale;\n\n foreach ($this->fillable as $fillable) {\n $key = $fillable.$this->locale_delimiter.$locale;\n\n $value = array_key_exists($key, $attributes)\n ? $attributes[$key]\n : null;\n\n if ($value !== null) {\n $this->{$fillable} = $value;\n }\n }\n\n return $this;\n }", "public function afterSave()\n {\n if (post(\"RLTranslate\")) {\n foreach (post(\"RLTranslate\") as $locale => $value) {\n $this->updateTranslateAttributes($value, $locale);\n\n $optionedAttributes = $this->getTranslatableAttributesWithOptions();\n if (!count($optionedAttributes)) {\n continue;\n }\n\n foreach ($value as $field => $field_value) {\n $translatableOptionedAttribute = array_get($optionedAttributes, $field);\n if (!array_get($translatableOptionedAttribute, 'index', false)) {\n continue;\n }\n\n $this->updateTranslateIndexes($field, $field_value, $locale);\n }\n }\n }\n }", "protected function moveTranslatedToNormalAttributes()\n {\n foreach ($this->translatedSwaps as $table => $columns) {\n\n foreach ($columns as $column) {\n\n $this->context->output['models'][ $table ][ 'translated_fillable' ] = array_diff(\n $this->context->output['models'][ $table ][ 'translated_fillable' ],\n [ $column ]\n );\n $this->context->output['models'][ $table ][ 'translated_attributes' ] = array_diff(\n $this->context->output['models'][ $table ][ 'translated_attributes' ],\n [ $column ]\n );\n\n $this->context->output['models'][ $table ][ 'normal_attributes' ][] = $column;\n $this->context->output['models'][ $table ][ 'normal_fillable' ][] = $column;\n\n if ( isset($this->context->output['models'][ $table ]['casts'][ $column ]) ) {\n\n if ( ! isset($this->context->output['models'][ $table ]['casts_translated'])) {\n $this->context->output['models'][ $table ]['casts_translated'] = [];\n }\n\n $this->context->output['models'][ $table ]['casts_translated'][ $column ] = $this->context->output['models'][ $table ]['casts'][ $column ];\n }\n }\n }\n }", "function duplicate(){\n\t\tglobal $wpdb;\n\t\t$editionObj = $wpdb->get_row(\"select * from \".$wpdb->prefix.\"prog_edition where id = $_GET[id]\");\n\t\t$id_post = $editionObj->wp_post_id;\n\t\t$title_original = $editionObj->title;\n\t\t$args_wpml_original_post = array('element_id' => $editionObj->wp_post_id, 'element_type' => 'edition' );\n\t\t$original_edition_language_info = apply_filters( 'wpml_element_language_details', null, $args_wpml_original_post );\n\t\t//print_r('------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------');\n\t\t//print_r($id_post);\n\t\t//do_action( 'wpml_admin_make_post_duplicates', $id_post);\n\t\t//do_action( 'wpml_make_post_duplicates', $id_post );\n\t\t//$my_duplications = apply_filters( 'wpml_post_duplicates', $id_post );\n\t\t//print_r($my_duplications);\n\t\t//print_r($_POST['lang_duplicate']);\n\t\t//print_r($title_original);\t\n\n\t\t$wpdb->insert( \n\t\t\t\t$wpdb->prefix.'prog_edition', \n\t\t\t\tarray( \n\t\t\t\t\t'title' => $editionObj->title, \n\t\t\t\t\t'description' => $editionObj->description,\n\t\t\t\t\t'lang_code' => $_POST['lang_duplicate']\t\t\t\t\n\t\t\t\t), \n\t\t\t\tarray( \n\t\t\t\t\t'%s', \n\t\t\t\t\t'%s',\n\t\t\t\t\t'%s' \n\t\t\t\t) \n\t\t);\n\n\t\t$new_translated_edition_id = $wpdb->insert_id;\n\n\t\t//print_r($new_translated_edition_id);\n\t\t//$title_formated = wp_strip_all_tags( $edition_obj->title );\n\n\t\t$my_translated_post = array(\n\t\t\t\t'post_title' => $title_original,\n\t\t\t\t'post_content' => ' ',\n\t\t\t\t'post_status' => 'publish',\n\t\t\t\t'post_author' => 1,\n\t\t\t\t'post_parent' \t=> 0,\n\t\t\t\t'post_type'\t\t=> 'edition',\n\t\t);\n\n\t\t$translated_postid = wp_insert_post( $my_translated_post, true );\n\n\t\t//print_r($translated_postid);\n\t\t//print_r($original_edition_language_info);\n\n\t\t$set_translated_language_args = array(\n 'element_id' => $translated_postid,\n 'element_type' => 'post_edition',\n 'trid' => $original_edition_language_info->trid,\n 'language_code' => $_POST['lang_duplicate'],\n 'source_language_code' => $original_edition_language_info->language_code\n );\n \n do_action( 'wpml_set_element_language_details', $set_translated_language_args );\n\t\t\n\t\t//print_r($postid);\n\n\t\t$wpdb->update( \n\t\t\t\t$wpdb->prefix.'prog_edition', \n\t\t\t\tarray( \n\t\t\t\t\t'wp_post_id' => $translated_postid \n\t\t\t\t),\n\t\t\t\tarray( 'id' => $new_translated_edition_id ), \n\t\t\t\tarray( \n\t\t\t\t\t'%d'\n\t\t\t\t),\n\t\t\t\tarray( '%d' ) \n\t\t);\n\t\t\n\t\treload();\n\t}", "protected static function cloneEntity($args, $auth, &$attributes) {\n // First modify the sample attribute information in the $attributes array.\n // Set the sample attribute fieldnames as for a new record\n foreach($attributes as $attributeKey => $attributeValue){\n if ($attributeValue['multi_value'] == 't') {\n // Set the attribute fieldname to the attribute id plus brackets for multi-value attributes\n $attributes[$attributeKey]['fieldname'] = $attributeValue['id'] . '[]';\n foreach($attributeValue['default'] as $defaultKey => $defaultValue) {\n $attributes[$attributeKey]['default'][$defaultKey]['fieldname']=null;\n }\n } else {\n // Set the attribute fieldname to the attribute id for single values\n $attributes[$attributeKey]['fieldname'] = $attributeValue['id'];\n }\n }\n //New for Earthworm Watch, only bring accross the location related fields for pit 2.\n if (!empty($args['auto_fill_attrs_for_survey_two']))\n $idsToBringAcross = explode(',',trim($args['auto_fill_attrs_for_survey_two']));\n foreach($attributes as $attributeKey => &$attributeProperties) {\n if (isset($attributeProperties['attributeId'])\n //Only ever bring across the specified attributes from pit 1. Not this does not apply to location_name\n //which comes across regardless\n && (empty($idsToBringAcross)||(!in_array($attributeProperties['attributeId'],$idsToBringAcross)))) {\n $attributeProperties['default']='';\n }\n }\n data_entry_helper::$javascript .= \"\";\n // Unset the sample and occurrence id from entitiy_to_load as for a new record.\n if (isset(data_entry_helper::$entity_to_load['sample:id']))\n unset(data_entry_helper::$entity_to_load['sample:id']);\n if (isset(data_entry_helper::$entity_to_load['occurrence:id']))\n unset(data_entry_helper::$entity_to_load['occurrence:id']);\n }", "public function copyPage($locale = '')\n {\n \t$em = $this->getContainer()->get('doctrine')->getManager(); \t\n \tif (empty($locale)) {\n \t\t$locale = $this->getContainer()->get('request')->getLocale();\n \t}\n \t// we get the current page.\n \t$page = $this->getCurrentPage();\n \t$id = $page->getId();\n \tif (!is_null($page) && !is_null($this->translations[$id])) { \n \t\t$eventManager = $em->getEventManager();\n \t\t$eventManager->removeEventListener(\n \t\t\t\tarray('prePersist'),\n \t\t\t\t$this->getContainer()->get('pi_app_admin.prepersist_listener')\n \t\t);\n \t\t$eventManager->removeEventListener(\n \t\t\t\tarray('postPersist'),\n \t\t\t\t$this->getContainer()->get('pi_app_admin.postpersist_listener')\n \t\t);\n \t\t$eventManager->removeEventListener(\n \t\t\t\tarray('preUpdate'),\n \t\t\t\t$this->getContainer()->get('pi_app_admin.preupdate_listener')\n \t\t);\n \t\t$eventManager->removeEventListener(\n \t\t\t\tarray('postUpdate'),\n \t\t\t\t$this->getContainer()->get('pi_app_admin.postupdate_listener')\n \t\t);\n\t\t\t// \t\t\n \t\t$new_page = clone($page);\n \t\t$new_page->setId(null);\n \t\t// we copy all translations.\n \t\tforeach ($this->translations[$id] as $translation) {\n \t\t\t$new_translation = clone($translation);\n \t\t\t$new_translation->setId(null);\n \t\t\t$new_page->addTranslation($new_translation);\n \t\t}\n\t\t\t// we clone all blocks and all widgets. \t\t\n \t\tif (isset($this->blocks[$id]) && !empty($this->blocks[$id])) {\n \t\t\t$all_blocks = $this->blocks[$id];\n \t\t\tforeach ($all_blocks as $block) {\n \t\t\t\t$new_block = clone($block);\n \t\t\t\t$new_block->setId(null);\n \t\t\t\t// if the block is not disabled.\n \t\t\t\tif ($block->getEnabled()) { \t\n \t\t\t\t\t// we set all widget of the block\n \t\t\t\t\tif (isset($this->widgets[$id][$block->getId()]) && !empty($this->widgets[$id][$block->getId()])){\n \t\t\t\t\t\t$all_widgets = $this->widgets[$id][$block->getId()];\n \t\t\t\t\t\tforeach ($all_widgets as $widget) {\n \t\t\t\t\t\t\tif ($widget->getEnabled()) {\n \t\t\t\t\t\t\t\t$new_widget = clone($widget);\n \t\t\t\t\t\t\t\t$new_widget->setId(null);\n \t\t\t\t\t\t\t\t$new_block->addWidget($new_widget);\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$new_page->addBlock($new_block);\n \t\t\t}\n \t\t}\n \t\t// we change the route name of the new page.\n \t\t$randome = new \\DateTime();\n \t\t$new_page->setRouteName($page->getRouteName() . '_copy_' . $randome->getTimeStamp());\n \t\t$new_page->setUrl($page->getUrl() . '/copy/' . $randome->getTimeStamp());\n \t\t// we persist.\n \t\t$em->persist($new_page);\n \t\t$em->flush();\n \t\t// we register the new page in the route cache manager.\n \t\t$routeCacheManager = $this->getContainer()->get('bootstrap.route_cache');\n \t\t$routeCacheManager->setGenerator();\n \t\t$routeCacheManager->setMatcher();\n \t\t// we set the new url in the locale.\n \t\t$entity_translate_page = $this->translations[$id][$locale];\n \t\tif (\n \t\t\t($entity_translate_page instanceof \\PiApp\\AdminBundle\\Entity\\TranslationPage)\n \t\t\t&&\n \t\t\t($entity_translate_page->getSlug() != \"\")\n \t\t) {\n \t\t\t$new_url = $new_page->getUrl() . '/' . $entity_translate_page->getSlug();\n \t\t} else {\n \t\t\t$new_url = $new_page->getUrl();\n \t\t}\n \t\t$new_url = str_replace(\"//\", \"/\", $new_url);\n \t\t$new_url = preg_replace(\"/{[a-zA-Z0-9]+}/i\", 'testValue', $new_url);\n \t\t\n \t\treturn $new_url;\n \t}\n \t\n \treturn $this->getContainer()->get('bootstrap.RouteTranslator.factory')->getRoute('home_page', array('locale' => $locale));\n }", "function produits_article_update($id_article){\r\n\t$query = \"DELETE FROM spip_produits_articles WHERE id_article=\" . _q($id_article);\r\n\t$result = spip_query($query);\r\n\r\n\t$query = \"DELETE FROM spip_rubriquesthelia_articles WHERE id_article=\" . _q($id_article);\r\n\t$result = spip_query($query);\r\n\r\n\t//ajouter les associations produits-articles de cet article\r\n\tforeach ($_POST as $clef => $valeur){\r\n\t\tif (strpos($clef, \"produit-\")===0){\r\n\t\t\t$id_produit = substr($clef, 8);\r\n\t\t\tspip_query(\"INSERT INTO spip_produits_articles (id_article,id_produit) VALUES (\" . _q($id_article) . \",\" . _q($id_produit) . \")\");\r\n\t\t}\r\n\t}\r\n\r\n\t//ajouter les associations rubriquesthelia-articles de cet article\r\n\tforeach ($_POST as $clef => $valeur){\r\n\t\tif (strpos($clef, \"rubriquethelia-\")===0){\r\n\t\t\t$id_rubriquethelia = substr($clef, 15);\r\n\t\t\tspip_query(\"INSERT INTO spip_rubriquesthelia_articles (id_article,id_rubriquethelia) VALUES (\" . _q($id_article) . \",\" . _q($id_rubriquethelia) . \")\");\r\n\t\t}\r\n\t}\r\n\r\n\treturn array($id_article);\r\n}", "private function prepareData(){\n if(!empty($this->aData['custom_data'])){\n $aCustomData = @unserialize($this->aData['custom_data']);\n if(is_array($aCustomData)){\n $this->aData += $aCustomData;\n }\n }\n $this->aData = array_diff_key($this->aData, array_flip($this->oTable->getSystemFields()));\n unset($this->aData['custom_data'], $this->aData['date_timestamp']);\n }", "private function bulkUpdateProductLanguage(){\n $this->aq = new ArchiveQuery($this->entityQuery);\n $all_products = $this->aq->getProducts();\n $products = $this->entityTypeManager->getStorage('node')->loadMultiple($all_products);\n $count = 0;\n foreach ($products as $key => $product) {\n $lang_code = $product->get('langcode')->value;\n if ($lang_code !== 'zxx'){\n $count++;\n $product->set('langcode', 'zxx');\n if ($count < 50){\n //$product->save();\n }\n }\n }\n if ($count){\n kint($count, 'Prodotti modificati'); \n } else {\n kint('Tutti a posto');\n }\n \n\n // Test su un prodotto\n // $test = $this->entityTypeManager->getStorage('node')->load(1538);\n // $lang_code = $test->get('langcode')->value;\n // if ($lang_code !== 'zxx'){\n // $test->set('langcode', 'zxx');\n // $test->save();\n // }\n // kint($test->get('langcode')->value,'update');\n }", "public function prepareCloneAfterPersist()\n {\n $relations = $this->getRelations();\n\n $relationArray = [];\n foreach ($relations as $key => $relation) {\n $relationArray[] = $key;\n }\n \n $this->cloneAfter = $this->load($relationArray);\n }", "private function populateTranslations()\n {\n //translations\n $aRelated = $this->getRelatedRecords();\n if (isset($aRelated[$this->relation]) && $aRelated[$this->relation] != null) \n {\n if (is_array($aRelated[$this->relation])) \n {\n foreach ($aRelated[$this->relation] as $model) \n {\n $this->_models[$model->getAttribute($this->localeField)] = $model;\n }\n } \n else \n {\n $model = $aRelated[$this->relation];\n $this->_models[$model->getAttribute($this->localeField)] = $model;\n }\n }\n }", "function setContentObjectAttributes(&$attributes, $version, $language)\n {\n $this->ContentObjectAttributes[$version][$language] = $attributes;\n }", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_repeticion('');\n $this->setRepeticion('');\n $this->setTemporada('');\n $this->setTipo('');\n $this->setPrimary_key($aPK);\n }", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_schema('');\n $this->setId_item('');\n $this->setId_nom('');\n $this->setF_traslado('');\n $this->setTipo_cmb('');\n $this->setId_ctr_origen('');\n $this->setCtr_origen('');\n $this->setId_ctr_destino('');\n $this->setCtr_destino('');\n $this->setObserv('');\n $this->setPrimary_key($aPK);\n }", "public function unpackAll(){\n\t\t$owner = $this->getOwner();\n\t\tforeach($this->hasOptions ? \n array_keys($this->transformAttributes) : $this->transformAttributes as $name){\n\t\t\t $owner->$name = $this->unpackAttribute($name);\n\t\t}\n\t}", "private function CopyTempImport() {\r\n //ImportMappingRecord::finder()->deleteAll('ima_name = ?',$this->MappingName->Text);\r\n $AllTempImportedRecords = TempImportRecord::finder()->findAll('ti_name = ?',$this->MappingName->Text);\r\n foreach($AllTempImportedRecords AS $EXRecord) {\r\n $sqlin = \"\";\r\n for($i=1;$i<$this->NumberID->Text;$i++) {\r\n $sqlin .= \"ima_id\".$i.\"='\".$EXRecord->{\"ti_id\".$i}.\"' AND \";\r\n }\r\n $sqlin .= \"ima_id\".$i.\"='\".$EXRecord->{\"ti_id\".$i}.\"' AND ima_name='\".$this->MappingName->Text.\"'\";\r\n $sql = \"SELECT * FROM tm_importmapping WHERE \".$sqlin;\r\n $RecordToCheck = ImportMappingRecord::finder()->findBySQL($sql);\r\n if(count($RecordToCheck)==1) {\r\n $RecordToSave = $RecordToCheck;\r\n }else {\r\n $RecordToSave = new ImportMappingRecord();\r\n }\r\n $RecordToSave->ima_name = $EXRecord->ti_name;\r\n for($ii=1;$ii<=10;$ii++) {\r\n $RecordToSave->{\"ima_id\".$ii} = $EXRecord->{\"ti_id\".$ii};\r\n }\r\n $RecordToSave->Save();\r\n }\r\n $this->bindListImportMapping();\r\n }", "private function moveI18nl10nLanguageSettings()\n {\n\n $arrLanguages = deserialize($this->Config->get('i18nl10n_languages'));\n\n if (!empty($arrLanguages)) {\n\n // Get first root page\n $objRootPage = $this->Database\n ->query('SELECT * FROM tl_page WHERE type = \"root\" ORDER BY id LIMIT 0,1');\n\n\n if($objRootPage->first() && !$this->Database->fieldExists('i18nl10n_localizations', 'tl_page')) {\n\n // Remove root language from languages\n foreach ($arrLanguages as $key => $strLanguage) {\n if ($objRootPage->language === $strLanguage) {\n unset($arrLanguages[$key]);\n }\n }\n\n $arrMappedLanguages = array();\n\n // Map to db format\n foreach ($arrLanguages as $language) {\n $arrMappedLanguages[] = array\n (\n 'language' => $language\n );\n }\n\n // Add new field\n $this->Database->query('ALTER TABLE tl_page ADD i18nl10n_localizations BLOB NULL');\n\n // Set localizations\n $this->Database\n ->prepare('UPDATE tl_page SET i18nl10n_localizations = ? WHERE type = \"root\" ORDER BY id')\n ->limit(1)\n ->execute(serialize($arrMappedLanguages));\n }\n }\n\n }", "protected function _afterLoadData()\n {\n foreach ($this->getItems() as $item) {\n $this->getResource()->unserializeFields($item);\n $item->setDataChanges(false);\n }\n return parent::_afterLoadData();\n }", "private function archiveUniqueLessons() {\n $result = eF_getTableData(\"lessons\", \"*\", \"originating_course=\".$this -> course['id']);\n foreach ($result as $value) {\n $value = new EfrontLesson($value);\n $value -> archive();\n }\n }", "public function restoreResourceTemplates(){\n\t\t$this->modx->log(modX::LOG_LEVEL_INFO,\"Restoring resource/template relationships \");\n\t\tforeach( $this->resTplMap as $alias => $tplName ){\n\t\t\t$this->modx->log(modX::LOG_LEVEL_INFO,\"Tying res [$alias] to tpl[$tplName] \");\n\t\t\t$res = $this->modx->getObject('modResource',array('alias'=>$alias));\n\t\t\t$resID = $res->get('id');\n\t\t\t$tplID = $this->modx->getObject('modTemplate',array('templatename'=>$tplName))->get('id');\n\t\t\t$res->set('template',$tplID);\n\t\t\t$this->modx->log(modX::LOG_LEVEL_INFO,\"Saving res #$resID to tpl[$tplName] \");\n\t\t\t$res->save();\n\t\t\t$this->modx->log(modX::LOG_LEVEL_INFO,\"Saved res #$resID to tpl[$tplName] \");\n\t\t};\n\t}", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_schema('');\n $this->setId_activ('');\n $this->setId_nom('');\n $this->setPropio('');\n $this->setEst_ok('');\n $this->setCfi('');\n $this->setCfi_con('');\n $this->setFalta('');\n $this->setEncargo('');\n $this->setDl_responsable('');\n $this->setObserv('');\n $this->setObserv_est('');\n $this->setPlazaSinComprobar('');\n $this->setPropietario('');\n $this->setId_tabla('');\n $this->setPrimary_key($aPK);\n }", "private function updateTranslatedEntries($abbr)\n {\n // Update Translated Models entries\n foreach($this->translatedModels as $name => $relations) {\n // Fix models without relations\n if (is_numeric($name) && is_string($relations)) {\n $name = $relations;\n }\n $model = $this->namespace . $name;\n \n // Get new \"translation_of\" value with old entries\n $tmpEntries = $model::where('translation_lang', strtolower($abbr))->get();\n $newTid = [];\n if ($tmpEntries->count() > 0) {\n foreach($tmpEntries as $tmp) {\n $newTid[$tmp->translation_of] = $tmp->id;\n }\n }\n \n // Change \"translation_of\" value with new Default Language\n $entries = $model::all();\n if ($entries->count() > 0) {\n foreach($entries as $entry) {\n if (isset($newTid[$entry->translation_of])) {\n $entry->translation_of = $newTid[$entry->translation_of];\n $entry->save();\n }\n }\n }\n \n // If relation exists, change its foreign key value\n if (isset($relations) && is_array($relations) && !empty($relations)) {\n foreach($relations as $relation) {\n if (!isset($relation) || !isset($relation['key']) || !isset($relation['name'])) {\n continue;\n }\n $relModel = $this->namespace . $relation['name'];\n $relEntries = $relModel::all();\n if ($relEntries->count() > 0) {\n foreach($relEntries as $relEntry) {\n if (isset($newTid[$relEntry->{$relation['key']}])) {\n // Update the relation entry\n $relEntry->{$relation['key']} = $newTid[$relEntry->{$relation['key']}];\n $relEntry->save();\n }\n }\n }\n }\n }\n }\n }", "function setAttributes($attributes) {\n if(is_array($attributes)) {\n if ($this->rich_text_fields) {\n foreach($this->rich_text_fields as $rich_text_field) {\n if (isset($attributes[$rich_text_field]) && $attributes[$rich_text_field]) {\n $attributes[$rich_text_field] = HTML::cleanUpHtml($attributes[$rich_text_field]);\n } // if\n } // foreach\n } // if\n \n // Attachments\n if($this instanceof IAttachments) {\n if(isset($attributes['embeded_objects']['attachments']['add']) && $attributes['embeded_objects']['attachments']['add']) {\n \t $this->attachments()->addPendingParent($attributes['embeded_objects']['attachments']['add']);\n \t } // if\n \t \n \t if(isset($attributes['embeded_objects']['attachments']['delete']) && $attributes['embeded_objects']['attachments']['delete']) {\n \t $this->attachments()->addPendingDeletion($attributes['embeded_objects']['attachments']['delete']);\n \t } // if\n \t \n if(isset($attributes['attachments']) && isset($attributes['attachments']['pending_parent']) && $attributes['attachments']['pending_parent']) {\n \t $this->attachments()->addPendingParent($attributes['attachments']['pending_parent']);\n \t } // if\n \t \n \t if(isset($attributes['attachments']) && isset($attributes['attachments']['delete']) && $attributes['attachments']['delete']) {\n \t $this->attachments()->addPendingDeletion($attributes['attachments']['delete']);\n \t } // if\n } // if\n \n // Code snippets\n if($this instanceof ICodeSnippets) {\n if(isset($attributes['embeded_objects']['code_snippets']['add']) && $attributes['embeded_objects']['code_snippets']['add']) {\n \t $this->code_snippets()->addPendingParent($attributes['embeded_objects']['code_snippets']['add']);\n \t } // if\n \t \n \t if(isset($attributes['embeded_objects']['code_snippets']['delete']) && $attributes['embeded_objects']['code_snippets']['delete']) {\n \t $this->code_snippets()->addPendingDeletion($attributes['embeded_objects']['code_snippets']['delete']);\n \t } // if\n } // if\n \n // Assignees\n if($this instanceof IAssignees) {\n if(isset($attributes['assignee_id']) && ($this->isNew() || $this->getAssigneeId() != $attributes['assignee_id'])) {\n if($attributes['assignee_id']) {\n $assignee = Users::findById($attributes['assignee_id']);\n \n if(!($assignee instanceof User)) {\n $assignee = null;\n } // if\n } else {\n $assignee = null;\n } // if\n \n $this->assignees()->setAssignee($assignee, Authentication::getLoggedUser(), false);\n } // if\n \n if(isset($attributes['assignee_id'])) {\n unset($attributes['assignee_id']); // Unset!\n } // if\n \n if(isset($attributes['other_assignees'])) {\n $this->assignees()->setPending($attributes['other_assignees']);\n } // if\n } // if\n \n } // if\n \n\t parent::setAttributes($attributes);\n }", "public function __construct($crawledArticle)\n {\n $this->article = array_combine($this->attributes,$crawledArticle);\n }" ]
[ "0.53007096", "0.51901424", "0.5158426", "0.5130395", "0.5057893", "0.50432134", "0.501157", "0.49889368", "0.49827245", "0.49518296", "0.49294215", "0.49005133", "0.48964056", "0.4864163", "0.4833281", "0.48134232", "0.4810767", "0.4755128", "0.47530478", "0.473356", "0.4712428", "0.4711857", "0.46938297", "0.4662746", "0.46555877", "0.46435156", "0.4643275", "0.46326256", "0.4619494", "0.4602543" ]
0.63730943
0
This makes the Xml for the categoryt Attributes Call thos function if you have imported data to the database and havn't updated the Flexform
function fix_category_atributte($category_uid=0){ if($category_uid==0){ return ; } $fieldSelected='*'; $mm_table='tx_commerce_categories_attributes_mm'; $where='uid_local= '.intval($category_uid); $rs=$GLOBALS['TYPO3_DB']->exec_SELECTquery('uid_correlationtype,uid_foreign',$mm_table,$where,$groupBy='',$orderBy='',$limit=''); #$GLOBALS['TYPO3_DB']->debug('exec_SELECTquery'); $xmlArray=array(); while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($rs)){ if(empty($xmlArray['data']['sDEF']['lDEF']['ct_'.$row['uid_correlationtype']]['vDEF'])) $xmlArray['data']['sDEF']['lDEF']['ct_'.$row['uid_correlationtype']]['vDEF']=$row['uid_foreign']; else $xmlArray['data']['sDEF']['lDEF']['ct_'.$row['uid_correlationtype']]['vDEF'].=','.$row['uid_foreign']; } $arrayToSave=array(); $xmlText=t3lib_div::array2xml_cs ($xmlArray, 'T3FlexForms', $options=array(), $charset=''); $arrayToSave['attributes']=$xmlText; $rs=$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_commerce_categories','uid='.$category_uid,$arrayToSave,$no_quote_fields=false); #$GLOBALS['TYPO3_DB']->debug('exec_UPDATEquery'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function generateXML() {\n\t\t$string = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" ?>\\n\";\n\t\t$string .= \"<data>\\n\";\n\t\t\n\t\t// category data\n\t\tif (count($this->categoryData)) {\n\t\t\tforeach($this->categoryData as $key => $category) {\n\t\t\t\t$string .= \"\\t<linkListCategory>\\n\";\n\t\t\t\t$string .= \"\\t\\t<categoryID>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $category['categoryID']) : $category['categoryID'])).\"</categoryID>\\n\";\n\t\t\t\t$string .= \"\\t\\t<parentID>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $category['parentID']) : $category['parentID'])).\"</parentID>\\n\";\n\t\t\t\t$string .= \"\\t\\t<categoryType>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $category['categoryType']) : $category['categoryType'])).\"</categoryType>\\n\";\n\t\t\t\t$string .= \"\\t\\t<title><![CDATA[\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $category['title']) : $category['title'])).\"]]></title>\\n\";\n\t\t\t\t$string .= \"\\t\\t<description><![CDATA[\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $category['description']) : $category['description'])).\"]]></description>\\n\";\n\t\t\t\t$string .= \"\\t\\t<allowDescriptionHtml>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $category['allowDescriptionHtml']) : $category['allowDescriptionHtml'])).\"</allowDescriptionHtml>\\n\";\n\t\t\t\t$string .= \"\\t\\t<image><![CDATA[\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $category['image']) : $category['image'])).\"]]></image>\\n\";\n\t\t\t\t$string .= \"\\t</linkListCategory>\\n\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t// category structure data\n\t\tif (count($this->categoryStructureData)) {\n\t\t\tforeach($this->categoryStructureData as $key => $categoryStructure) {\n\t\t\t\t$string .= \"\\t<linkListCategoryStructure>\\n\";\n\t\t\t\t$string .= \"\\t\\t<parentID>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $categoryStructure['parentID']) : $categoryStructure['parentID'])).\"</parentID>\\n\";\n\t\t\t\t$string .= \"\\t\\t<categoryID>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $categoryStructure['categoryID']) : $categoryStructure['categoryID'])).\"</categoryID>\\n\";\n\t\t\t\t$string .= \"\\t\\t<position>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $categoryStructure['position']) : $categoryStructure['position'])).\"</position>\\n\";\n\t\t\t\t$string .= \"\\t</linkListCategoryStructure>\\n\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t// link data\n\t\tif (count($this->linkData)) {\n\t\t\tforeach($this->linkData as $key => $link) {\n\t\t\t\t$string .= \"\\t<linkListLink>\\n\";\n\t\t\t\t$string .= \"\\t\\t<linkID>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['linkID']) : $link['linkID'])).\"</linkID>\\n\";\n\t\t\t\t$string .= \"\\t\\t<categoryID>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['categoryID']) : $link['categoryID'])).\"</categoryID>\\n\";\n\t\t\t\t$string .= \"\\t\\t<subject><![CDATA[\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['subject']) : $link['subject'])).\"]]></subject>\\n\";\n\t\t\t\t$string .= \"\\t\\t<shortDescription><![CDATA[\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['shortDescription']) : $link['shortDescription'])).\"]]></shortDescription>\\n\";\n\t\t\t\t$string .= \"\\t\\t<message><![CDATA[\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['message']) : $link['message'])).\"]]></message>\\n\";\n\t\t\t\t$string .= \"\\t\\t<isDisabled>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['isDisabled']) : $link['isDisabled'])).\"</isDisabled>\\n\";\n\t\t\t\t$string .= \"\\t\\t<isDeleted>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['isDeleted']) : $link['isDeleted'])).\"</isDeleted>\\n\";\n\t\t\t\t$string .= \"\\t\\t<isClosed>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['isClosed']) : $link['isClosed'])).\"</isClosed>\\n\";\n\t\t\t\t$string .= \"\\t\\t<isSticky>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['isSticky']) : $link['isSticky'])).\"</isSticky>\\n\";\n\t\t\t\t$string .= \"\\t\\t<userID>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['userID']) : $link['userID'])).\"</userID>\\n\";\n\t\t\t\t$string .= \"\\t\\t<username><![CDATA[\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['username']) : $link['username'])).\"]]></username>\\n\";\n\t\t\t\t$string .= \"\\t\\t<url><![CDATA[\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['url']) : $link['url'])).\"]]></url>\\n\";\n\t\t\t\t$string .= \"\\t\\t<time>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['time']) : $link['time'])).\"</time>\\n\";\n\t\t\t\t$string .= \"\\t\\t<lastChangeTime>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['lastChangeTime']) : $link['lastChangeTime'])).\"</lastChangeTime>\\n\";\n\t\t\t\t$string .= \"\\t\\t<visits>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['visits']) : $link['visits'])).\"</visits>\\n\";\n\t\t\t\t$string .= \"\\t\\t<lastVisitorID>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['lastVisitorID']) : $link['lastVisitorID'])).\"</lastVisitorID>\\n\";\n\t\t\t\t$string .= \"\\t\\t<lastVisitorName><![CDATA[\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['lastVisitorName']) : $link['lastVisitorName'])).\"]]></lastVisitorName>\\n\";\n\t\t\t\t$string .= \"\\t\\t<lastVisitTime>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['lastVisitTime']) : $link['lastVisitTime'])).\"</lastVisitTime>\\n\";\n\t\t\t\t$string .= \"\\t\\t<enableSmilies>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['enableSmilies']) : $link['enableSmilies'])).\"</enableSmilies>\\n\";\n\t\t\t\t$string .= \"\\t\\t<enableHtml>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['enableHtml']) : $link['enableHtml'])).\"</enableHtml>\\n\";\n\t\t\t\t$string .= \"\\t\\t<enableBBCodes>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['enableBBCodes']) : $link['enableBBCodes'])).\"</enableBBCodes>\\n\";\n\t\t\t\t$string .= \"\\t\\t<ipAddress><![CDATA[\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $link['ipAddress']) : $link['ipAddress'])).\"]]></ipAddress>\\n\";\n\t\t\t\t$string .= \"\\t</linkListLink>\\n\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t// comment data\n\t\tif (count($this->commentData)) {\n\t\t\tforeach($this->commentData as $key => $comment) {\n\t\t\t\t$string .= \"\\t<linkListLinkComment>\\n\";\n\t\t\t\t$string .= \"\\t\\t<commentID>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $comment['commentID']) : $comment['commentID'])).\"</commentID>\\n\";\n\t\t\t\t$string .= \"\\t\\t<linkID>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $comment['linkID']) : $comment['linkID'])).\"</linkID>\\n\";\n\t\t\t\t$string .= \"\\t\\t<categoryID>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $comment['categoryID']) : $comment['categoryID'])).\"</categoryID>\\n\";\n\t\t\t\t$string .= \"\\t\\t<userID>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $comment['userID']) : $comment['userID'])).\"</userID>\\n\";\n\t\t\t\t$string .= \"\\t\\t<username><![CDATA[\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $comment['username']) : $comment['username'])).\"]]></username>\\n\";\n\t\t\t\t$string .= \"\\t\\t<message><![CDATA[\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $comment['message']) : $comment['message'])).\"]]></message>\\n\";\n\t\t\t\t$string .= \"\\t\\t<time>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $comment['time']) : $comment['time'])).\"</time>\\n\";\n\t\t\t\t$string .= \"\\t\\t<enableSmilies>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $comment['enableSmilies']) : $comment['enableSmilies'])).\"</enableSmilies>\\n\";\n\t\t\t\t$string .= \"\\t\\t<enableHtml>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $comment['enableHtml']) : $comment['enableHtml'])).\"</enableHtml>\\n\";\n\t\t\t\t$string .= \"\\t\\t<enableBBCodes>\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $comment['enableBBCodes']) : $comment['enableBBCodes'])).\"</enableBBCodes>\\n\";\n\t\t\t\t$string .= \"\\t\\t<ipAddress><![CDATA[\".StringUtil::escapeCDATA((CHARSET != 'UTF-8' ? StringUtil::convertEncoding(CHARSET, 'UTF-8', $comment['ipAddress']) : $comment['ipAddress'])).\"]]></ipAddress>\\n\";\n\t\t\t\t$string .= \"\\t</linkListLinkComment>\\n\";\n\t\t\t}\n\t\t}\n\t\t// ending tag\n\t\t$string .= \"</data>\";\n\t\t\n\t\t$this->xmlContent = $string;\n\t\t\n\t\t// write the xml file with all this data\n\t\trequire_once(WCF_DIR.'lib/system/io/File.class.php');\n\t\t$xml = new File(WCF_DIR.'lib/data/linkList/tmp/linkListData.xml');\n\t\t$xml->write($this->xmlContent);\n\t\t$xml->close();\n\t}", "public function createCategoryAttributes($setup){\n //$setup->removeAttribute(\\Magento\\Catalog\\Model\\Category::ENTITY, 'redirect_url');\n /*$setup->addAttribute(\n \\Magento\\Catalog\\Model\\Category::ENTITY,\n 'redirect_url',\n [\n 'type' => 'varchar',\n 'group' => 'General',\n 'label' => 'Redirect to another URL',\n 'input' => 'text',\n 'required' => false,\n 'sort_order' => 2,\n 'global' => \\Magento\\Eav\\Model\\Entity\\Attribute\\ScopedAttributeInterface::SCOPE_STORE,\n 'is_used_in_grid' => true,\n 'is_visible_in_grid' => false,\n 'is_filterable_in_grid' => true,\n 'visible_on_front' => true,\n ]\n );*/\n }", "private function _getCategoriesField()\n\t{\n\t\t$catListOptions = JHtml::_('category.options', 'com_content');\n\t\t$options = '';\n\t\tforeach ($catListOptions as $cat)\n\t\t{\n\t\t\t// need to apply htmlspecialchars twice, as SimpleXMLElement does an\n\t\t\t// htmlentitydecode in the constructor, which then causes\n\t\t\t// an error downstream when this data is injected in the form\n\t\t\t$t = htmlspecialchars($cat->text, ENT_COMPAT, 'UTF-8');\n\t\t\t$options .= '<option value=\"' . $cat->value . '\">' . htmlspecialchars($t, ENT_COMPAT, 'UTF-8') . '</option>';\n\t\t}\n\t\t$xml = '';\n\t\t$xml .= '<fieldset name=\"joomla\" label=\"Joomla\" description=\"\" groupname=\"COM_SH404SEF_CONFIG_EXT\">';\n\t\t$xml .= '<field menu=\"hide\" name=\"shInsertContentArticleIdCatList\" type=\"list\" multiple=\"true\" default=\"\" label=\"COM_SH404SEF_INSERT_NUMERICAL_ID_CAT_LIST\" description=\"COM_SH404SEF_TT_INSERT_NUMERICAL_ID_CAT_LIST\">';\n\t\t$xml .= '<option value=\"\">COM_SH404SEF_INSERT_NUMERICAL_ID_ALL_CAT</option>';\n\t\t$xml .= $options;\n\t\t$xml .= '</field>';\n\t\t$xml .= '<field menu=\"hide\" name=\"shInsertNumericalIdCatList\" type=\"list\" multiple=\"true\" default=\"\" label=\"COM_SH404SEF_INSERT_NUMERICAL_ID_CAT_LIST\" description=\"COM_SH404SEF_TT_INSERT_NUMERICAL_ID_CAT_LIST\">';\n\t\t$xml .= '<option value=\"\">COM_SH404SEF_INSERT_NUMERICAL_ID_ALL_CAT</option>';\n\t\t$xml .= $options;\n\t\t$xml .= '</field>';\n\t\t$xml .= '<field menu=\"hide\" name=\"insertDateCatList\" type=\"list\" multiple=\"true\" default=\"\" label=\"COM_SH404SEF_INSERT_DATE_CAT_LIST\" description=\"COM_SH404SEF_TT_INSERT_DATE_CAT_LIST\">';\n\t\t$xml .= '<option value=\"\">COM_SH404SEF_INSERT_NUMERICAL_ID_ALL_CAT</option>';\n\t\t$xml .= $options;\n\t\t$xml .= '</field>';\n\t\t$xml .= '</fieldset>';\n\t\t$element = new SimpleXMLElement($xml);\n\t\treturn $element;\n\t}", "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}", "public function add_attr_cat()\n\t{\n\t\t\n\t\t$cat_name=$this->input->post('cat_name');\n\t\t$query=$this->db->insert(\"att_category\",array(\"att_cat_name\"=>$cat_name));\n\t\t\n\t\tif($query)\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}", "private function __buildAdvancedMetaData()\n\t{\n\t \tinclude_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');\n\t \tilAdvancedMDValues::_appendXMLByObjId($this,$this->course_obj->getId());\n\t}", "private function _convertLayerMeta() {\n if (Mage::registry('current_category')==null || Mage::registry('current_product')!=null) return false;\n\n $helper = Mage::helper('seosuite');\n $request = Mage::app()->getRequest();\n\n $hideAttributes = Mage::getStoreConfigFlag('mageworx_seo/seosuite/layered_hide_attributes');\n $layeredFriendlyUrls = Mage::getStoreConfigFlag('mageworx_seo/seosuite/layered_friendly_urls');\n\n\n $params = Mage::app()->getRequest()->getParams();\n\n if (Mage::registry('current_category') != null) {\n\n // get meta title\n $metaTitle = Mage::registry('current_category')->getMetaTitle();\n if (!$metaTitle) $metaTitle = Mage::registry('current_category')->getName();\n if (!Mage::getStoreConfigFlag('mageworx_seo/seosuite/enable_dynamic_meta_title')) {\n $metaTitle = $this->__compile($metaTitle);\n }\n $this->_data['title'] = $metaTitle;\n\n // get meta description\n $metaDescription = Mage::registry('current_category')->getMetaDescription();\n if (!$metaDescription) $metaDescription = Mage::registry('current_category')->getDescription();\n if (!Mage::getStoreConfigFlag('mageworx_seo/seosuite/enable_dynamic_meta_desc')) {\n $metaDescription = $this->__compile($metaDescription);\n }\n $this->_data['description'] = $metaDescription;\n }\n\n if ($layeredFriendlyUrls) {\n $suffix = Mage::getStoreConfig('catalog/seo/category_url_suffix');\n $identifier = trim(str_replace($suffix, '', $request->getOriginalPathInfo()), '/');\n $urlSplit = explode('/l/', $identifier, 2);\n if (!isset($urlSplit[1])) return false;\n Varien_Autoload::registerScope('catalog');\n $productUrl = Mage::getModel('catalog/product_url');\n list($cat, $params) = $urlSplit;\n $layerParams = explode('/', $params);\n $_params = array();\n\n $descParts = array();\n\n // from registry\n $attr = $helper->_getFilterableAttributes();\n\n $titleParts = array(trim($this->_data['title']));\n if (isset($this->_data['description']) && trim($this->_data['description'])) {\n $descParts = array(trim($this->_data['description']));\n }\n if (count($layerParams)) {\n foreach ($layerParams as $params) {\n $param = explode($helper->getAttributeParamDelimiter(), $params, 2);\n if (count($param) == 1) {\n $cat = Mage::getModel('seosuite/catalog_category')\n ->setStoreId(Mage::app()->getStore()->getId())\n ->loadByAttribute('url_key', $productUrl->formatUrlKey($param[0]));\n if ($cat && $cat->getId()) {\n $titleParts[0] .= ' - ' . $cat->getName();\n continue;\n }\n foreach ($attr as $attribute) {\n if (isset($attribute['options'][current($param)])) {\n $titleParts[] = $descParts[] = $attribute['options'][current($param)];\n break;\n }\n }\n } else {\n $code = str_replace('-', '_', $param[0]); // attrCode is only = [a-z0-9_]\n if (isset($attr[$code])) {\n if ($code == 'price') {\n $multipliers = explode(',', $param[1]);\n $frontendLabel = $hideAttributes ? '' : (isset($attr[$code]['frontend_label'])?$attr[$code]['frontend_label']:'');\n if (isset($multipliers[1])) {\n $titleParts[] = $descParts[] = $frontendLabel . ' ' . Mage::app()->getStore()->formatPrice($multipliers[0] * $multipliers[1] - $multipliers[1], false) . ' - ' . Mage::app()->getStore()->formatPrice($multipliers[0] * $multipliers[1], false);\n }\n continue;\n }\n if (isset($attr[$code]['frontend_label']) && isset($attr[$code]['options'][$param[1]])) $titleParts[] = $descParts[] = $attr[$code]['frontend_label'] . ' - ' . $attr[$code]['options'][$param[1]];\n }\n }\n }\n }\n if (Mage::getStoreConfigFlag('mageworx_seo/seosuite/enable_dynamic_meta_title')) {\n $this->_data['title'] = implode(', ', $titleParts);\n }\n\n if (Mage::getStoreConfigFlag('mageworx_seo/seosuite/enable_dynamic_meta_desc')) {\n $this->_data['description'] = implode(', ', $descParts);\n }\n }\n }", "function buildCategories ( $result, $labelField ) {\n $strXML = \"\";\n if ($result) {\n $strXML = \"<categories>\";\n while($ors = mysql_fetch_array($result)) {\n $strXML .= \"<category label='\" . $ors[$labelField]. \"'/>\";\n }\n $strXML .= \"</categories>\";\n }\n return $strXML;\n }", "public function actionEditdata()\n {\n $this->layout = 'main2';\n $productId = trim(Yii::$app->request->post('id'));\n $merchant_id = trim(Yii::$app->request->post('merchant_id'));\n\n $model = WalmartProduct::find()->joinWith('jet_product')->where(['walmart_product.id' => $productId])->one();\n\n $parent_category = $model->parent_category;\n $child_category = $model->category;\n $category_path = $parent_category . '->' . $child_category;\n\n $_requiredAttributes = [];\n $_unitAttributes = [];\n $_variantAttributes = [];\n $_conditionalAttributes = [];\n $_advancedAttributes = [];\n $_attributeOptions = [];\n\n //Prepare Required Attributes\n $requiredSubCategoryAttributes = Category::getSubCategoryAttributes($parent_category, $child_category, true);\n foreach ($requiredSubCategoryAttributes as $value) {\n $attributeCode = Category::getAttributeCode($value);\n\n foreach ($attributeCode as $item) {\n $_requiredAttributes[] = $item;\n }\n\n $options = Category::getAttributeOptions($value);\n $_attributeOptions = array_merge($_attributeOptions, $options);\n }\n\n //Prepare Unit Attributes\n $categoryAttributes = Category::getCategoryAttributes($parent_category, false);\n foreach ($categoryAttributes as $categoryAttribute) \n {\n if(isset($categoryAttribute['child']))\n {\n foreach ($categoryAttribute['child'] as $childAttribute) \n {\n if ($childAttribute['name'] == 'unit') {\n $_unitAttributes[$categoryAttribute['name']] = $categoryAttribute['name'] . AttributeMap::ATTRIBUTE_PATH_SEPERATOR . $childAttribute['name'];\n \n $options = Category::getAttributeOptions($categoryAttribute);\n $_attributeOptions = array_merge($_attributeOptions, $options);\n }\n }\n }\n }\n\n //Prepare Variant Attributes\n $categoryVariantAttributes = Category::getCategoryVariantAttributes($parent_category);\n foreach ($categoryVariantAttributes as $values) \n {\n if (array_key_exists($values, $categoryAttributes)) \n {\n $attribute_codes = Category::getAttributeCode($categoryAttributes[$values]);\n $name = $categoryAttributes[$values]['name'];\n foreach ($attribute_codes as $attrCode) {\n if(!in_array($attrCode, $_unitAttributes)) {\n $_variantAttributes[$name] = $attrCode;\n }\n }\n\n $attributeOptions = Category::getAttributeOptions($categoryAttributes[$values]);\n $_attributeOptions = array_merge($_attributeOptions, $attributeOptions);\n }\n }\n\n //Prepare Conditionally Required Attributes\n $requiredLevel = Category::REQUIREDLEVEL_CONDITIONALLY_REQUIRED;\n $conditionallyRequiredAttributes = Category::getFilteredViaRequiredLevelAttrs($parent_category, $child_category, $requiredLevel);\n foreach ($conditionallyRequiredAttributes as $attrCode => $attrStructure) \n {\n $flag = false;\n $attributeCode = Category::getAttributeCode($attrStructure);\n foreach ($attributeCode as $code) \n {\n if(isset($attrStructure['conditionalAttributes']))\n {\n $conditions = [];\n foreach ($attrStructure['conditionalAttributes'] as $condition) \n {\n $name = $condition['name'];\n //get structure of the condition attribute to prepare the attribute code\n //$contionAttrStructure = Category::getAttributeStructure($parent_category, $child_category, $name);\n if(isset($requiredSubCategoryAttributes[$name])) \n {\n $contionAttrStructure = $requiredSubCategoryAttributes[$name];\n $attrcodes = Category::getAttributeCode($contionAttrStructure);\n $attrcode = current($attrcodes);\n\n $conditions[] = ['attribute' => $attrcode, 'value' => $condition['value']];\n }\n }\n\n if(count($conditions)) {\n $_conditionalAttributes[$code] = [\"code\" => $code, \"conditions\" => $conditions];\n $flag = true;\n }\n }\n }\n\n if($flag) {\n $options = Category::getAttributeOptions($attrStructure);\n $_attributeOptions = array_merge($_attributeOptions, $options);\n }\n }\n\n\n //Prepare Optional and Recommended Attributes\n $requiredLevel = [Category::REQUIREDLEVEL_OPTIONAL, Category::REQUIREDLEVEL_RECOMMENDED];\n $conditionallyRequiredAttributes = Category::getFilteredViaRequiredLevelAttrs($parent_category, $child_category, $requiredLevel);\n foreach ($conditionallyRequiredAttributes as $attrCode => $attrStructure) \n {\n $attributeCode = Category::getAttributeCode($attrStructure);\n\n foreach ($attributeCode as $item) {\n $_advancedAttributes[] = $item;\n }\n\n $options = Category::getAttributeOptions($attrStructure);\n $_attributeOptions = array_merge($_attributeOptions, $options);\n }\n\n //print_r($_advancedAttributes);die;\n /*print_r($_requiredAttributes);\n print_r($_unitAttributes);\n print_r($_variantAttributes);\n print_r($_conditionalAttributes);\n print_r($_attributeOptions);die;*/\n $session = Yii::$app->session;\n $productData = [\n 'model' => $model,\n 'category_path' => $category_path,\n 'requiredAttributes' => $_requiredAttributes,\n 'unitAttributes' => $_unitAttributes, \n 'variantAttributes' => $_variantAttributes, \n 'conditionalAttributes' => $_conditionalAttributes, \n 'advancedAttributes' => $_advancedAttributes,\n 'attributeOptions' => $_attributeOptions,\n 'merchant_id' => $merchant_id\n ];\n\n $session_key = 'product' . $productId;\n $session->set($session_key, $productData);\n $session->close();\n\n $html = $this->render('editdata', ['id' => $productId, 'model' => $model], true);\n \n return $html;\n }", "protected function beforeValidate() {\n if (!empty($this->category) && (is_array($this->category) || is_numeric($this->category))) {\n if (is_numeric($this->category)) $this->category = array($this->category);\n //print_r($this->category);\n //cause we used the refid's value as the dropdown values.\n //$categories = Types::model()->actived()->bytype('category')->findAllByPk(array_values($this->category));\n $categories = Types::model()->actived()->bytype('category')\n ->findAllByAttributes(array('refid' => array_values($this->category)));\n //print_r($categories);\n $data = array();\n if ($categories) {\n //$data = CHtml::listData($categories, 'id', 'typename');\n $data = CHtml::listData($categories, 'refid', 'typename');\n if (!empty($data)) $this->category_str = implode(\", \", array_values($data));\n }\n $this->category = \"|\".implode(\"|\", array_values($this->category)).\"|\";\n }\n\n #################8/21/2012 start ###################\n if (!empty($this->awis_category) && is_numeric($this->awis_category)) {\n $categories = Types::model()->actived()->bytype('awis')\n ->findAllByAttributes(array('refid' => $this->awis_category));\n if ($categories) {\n $this->awis_category_str = $categories->typename;\n }\n }\n\n if (!empty($this->technorati_category) && is_numeric($this->technorati_category)) {\n $categories = Types::model()->actived()->bytype('technorati')\n ->findAllByAttributes(array('refid' => $this->technorati_category));\n if ($categories) {\n $this->technorati_category_str = $categories->typename;\n }\n }\n \n if (empty($this->rootdomain)) {\n Yii::import('application.vendors.*');\n $this->rootdomain = SeoUtils::getDomain($this->domain);\n }\n\n /*\n if (!empty($this->awis_category) && (is_array($this->awis_category) || is_numeric($this->awis_category))) {\n if (is_numeric($this->awis_category)) $this->awis_category = array($this->awis_category);\n $categories = Types::model()->actived()->bytype('awis')\n ->findAllByAttributes(array('refid' => array_values($this->awis_category)));\n //print_r($categories);\n $data = array();\n if ($categories) {\n //$data = CHtml::listData($categories, 'id', 'typename');\n $data = CHtml::listData($categories, 'refid', 'typename');\n if (!empty($data)) $this->awis_category_str = implode(\", \", array_values($data));\n }\n $this->awis_category = \"|\".implode(\"|\", array_values($this->awis_category)).\"|\";\n }\n\n if (!empty($this->technorati_category) && (is_array($this->technorati_category) || is_numeric($this->technorati_category))) {\n if (is_numeric($this->technorati_category)) $this->technorati_category = array($this->technorati_category);\n $categories = Types::model()->actived()->bytype('technorati')\n ->findAllByAttributes(array('refid' => array_values($this->technorati_category)));\n //print_r($categories);\n $data = array();\n if ($categories) {\n //$data = CHtml::listData($categories, 'id', 'typename');\n $data = CHtml::listData($categories, 'refid', 'typename');\n if (!empty($data)) $this->technorati_category_str = implode(\", \", array_values($data));\n }\n $this->technorati_category = \"|\".implode(\"|\", array_values($this->technorati_category)).\"|\";\n }\n */\n #################8/21/2012 end #########################\n\n if ($this->isNewRecord) {\n // set the create date, last updated date, then the user doing the creating\n // $this->created = $this->modified = new CDbExpression('NOW()');\n $this->created = $this->modified = date('Y-m-d H:i:s');\n $this->created_by = $this->modified_by = Yii::app()->user->id;\n //$this->salt = $this->generateSalt();\n } else {\n //not a new record, so just set the last updated time and last updated user id\n //$this->update_time = new CDbExpression('NOW()');\n $this->modified = date('Y-m-d H:i:s');\n $this->modified_by = Yii::app()->user->id;\n //if (empty($this->password)) unset($this->password);\n }\n\n return parent::beforeValidate();\n }", "public function _buildCustomCategories() {\n $gId = $this->addCustomGrouping();\n $cId1 = $this->addCustomCategory('Custom Level 1', $gId);\n $cId2 = $this->addCustomCategory('Custom Level 2', $cId1);\n $cId3 = $this->addCustomCategory('Custom Level 3', $cId2);\n }", "public function createCategories()\n\t{\n\t\t// instance of the Kohana_Category class\n\t\t// this instance will be need to set data at options\n\t\t$category = Category::getInstance();\n\t\t$rows = $this->getRows();\n\t\t\n\t\tif( count($rows) > 0 )\n\t\t{\n\t\t\tforeach( $rows as $key => $row )\n\t\t\t{\n\t\t\t\tif( !empty( $row ) )\n\t\t\t\t{\n\t\t\t\t\t$category_name = $row[2]->text();\n\t\t\t\t\t$clear_name = preg_replace('/[^\\w+]/', '', $category_name);\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'auto'\t=> $row[1]->text(),\n\t\t\t\t\t\t'name'\t=> $category_name,\n\t\t\t\t\t\t'link'\t=> pq($row[2])->find('a')->attr('href'),\n\t\t\t\t\t\t'fluent'=> trim($row[4]->html()),\n\t\t\t\t\t\t'cilinder'\t=> (int)$row[5]->text(),\n\t\t\t\t\t\t'clapan_per_cilinder'\t=> (int)$row[6]->text(),\n\t\t\t\t\t\t'diametr_porshen'\t=> floatval($row[7]->text()),\n\t\t\t\t\t\t'hod_porshen'\t=> floatval($row[8]->text()),\n\t\t\t\t\t\t'work_obiem'\t=> (int)$row[9]->text(),\n\t\t\t\t\t\t'param'\t=> 'parts',\n\t\t\t\t\t\t'date_create'\t=> new MongoDate(),\n 'clear_name' => strtolower($clear_name)\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$this->_data[] = $data;\n\t\t\t\t\t$category->offsetSet($key, $data);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "function csv_category() {\n\t\t$csvilog = JRequest::getVar('csvilog');\n\t\t\n\t\t/* New: Get all categories in this field, delimited with | */\n\t\t$categories = explode(\"|\", $this->product_details->category_path);\n\t\tforeach( $categories as $line ) {\n\t\t\t/* Explode slash delimited category tree into array */\n\t\t\t$category_list = explode(\"/\", $line);\n\t\t\t$category_count = count($category_list);\n\n\t\t\t$db = JFactory::getDBO();\n\t\t\t$category_parent_id = '0';\n\n\t\t\t/* For each category in array */\n\t\t\tfor($i = 0; $i < $category_count; $i++) {\n\t\t\t\t/* See if this category exists with it's parent in xref */\n\t\t\t\t$q = \"SELECT #__vm_category.category_id FROM #__vm_category,#__vm_category_xref \";\n\t\t\t\t$q .= \"WHERE #__vm_category.category_name='\" . $db->getEscaped($category_list[$i]) . \"' \";\n\t\t\t\t$q .= \"AND #__vm_category_xref.category_child_id=#__vm_category.category_id \";\n\t\t\t\t$q .= \"AND #__vm_category_xref.category_parent_id='$category_parent_id'\";\n\t\t\t\t$db->setQuery($q);\n\t\t\t\t/* If it does not exist, create it */\n\t\t\t\t/* Category exists */\n\t\t\t\tif ($db->getAffectedRows() > 0) {\n\t\t\t\t\t$category_id = $db->loadResult();\n\t\t\t\t}\n\t\t\t\t/* Category does not exist - create it */\n\t\t\t\telse { \n\t\t\t\t\t$timestamp = time();\n\t\t\t\t\t\n\t\t\t\t\t/* Let's find out the last category in */\n\t\t\t\t\t/* the level of the new category */\n\t\t\t\t\t$q = \"SELECT MAX(list_order) AS list_order FROM #__vm_category_xref,#__vm_category \";\n\t\t\t\t\t$q .= \"WHERE category_parent_id='\".$category_parent_id.\"' \";\n\t\t\t\t\t$q .= \"AND category_child_id=category_id \";\n\t\t\t\t\t$db->setQuery( $q );\n\t\t\t\t\t\n\t\t\t\t\t$list_order = intval($db->loadResult())+1;\n\t\t\t\t\t\n\t\t\t\t\t/* Add category */\n\t\t\t\t\t$q = \"INSERT INTO #__vm_category \";\n\t\t\t\t\t$q .= \"(vendor_id,category_name, category_publish,cdate,mdate,list_order) \";\n\t\t\t\t\t$q .= \"VALUES ('1', '\";\n\t\t\t\t\t$q .= $db->getEscaped($category_list[$i]) . \"', '\";\n\t\t\t\t\t$q .= \"Y', '\";\n\t\t\t\t\t$q .= $timestamp . \"', '\";\n\t\t\t\t\t$q .= $timestamp . \"', '$list_order')\";\n\t\t\t\t\t$csvilog->AddMessage('debug', JTEXT::_('DEBUG_ADD NEW CATEGORY'), true);\n\t\t\t\t\t$db->setQuery($q);\n\t\t\t\t\tif (!$db->query()) $csvilog->AddMessage('debug', JTEXT::_('DEBUG_ERROR_STORING_NEW_CATEGORY'), true);\n\n\t\t\t\t\t$category_id = $db->insertid();\n\n\t\t\t\t\t/* Create xref with parent */\n\t\t\t\t\t$q = \"INSERT INTO #__vm_category_xref \";\n\t\t\t\t\t$q .= \"(category_parent_id, category_child_id) \";\n\t\t\t\t\t$q .= \"VALUES ('\";\n\t\t\t\t\t$q .= $category_parent_id . \"', '\";\n\t\t\t\t\t$q .= $category_id . \"')\";\n\t\t\t\t\t$csvilog->AddMessage('debug', JTEXT::_('DEBUG_ADD_NEW_CATEGORY_XREF'), true);\n\t\t\t\t\t$db->setQuery($q);\n\t\t\t\t\tif (!$db->query()) $csvilog->AddMessage('debug', JTEXT::_('DEBUG_ERROR_ADD_NEW_CATEGORY_XREF'), true);\n\t\t\t\t}\n\t\t\t\t/* Set this category as parent of next in line */\n\t\t\t\t$category_parent_id = $category_id;\n\t\t\t} /* end for */\n\t\t\t$category[] = $category_id;\n\t\t}\n\t\t/* Return an array with the last category_ids which is where the product goes */\n\t\treturn $category;\n\t}", "public function Create()\n\t\t{\n\t\t\tWrite::WholeFile($this->CategoryFilename, self::DEFAULT_CATEGORY_CONTENTS);\n\t\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}", "private function _createUpdateCategories() {\n $cat_by_ids = (array) $this->_getOptionValuesById();\n $cat_by_name = (array) $this->_getOptionValuesByName();\n $cat_names = array_merge($cat_by_name,$cat_by_ids);\n $filtered_cats = $this->_filterCats($cat_names);\n if(isset($filtered_cats['new'])) {\n $this->_addCategory($filtered_cats['new']);\n }\n if(isset($filtered_cats['old'])) {\n $this->_updateCategory($filtered_cats['old']);\n }\n }", "public function create_category ()\n\t{\n\t\tupdate_option(self::option_string($_POST['tag-name']), isset($_POST['is_secure']));\n\t}", "function makeCategory($row) {\n\t\t$id = $row['id'];\n\t\t$caption = stripslashes($row['caption']);\n\t\t$def_name = stripslashes($row['def_name']);\n\t\tif (empty($def_name)) $def_name = \"&lt;Ingen verdi&gt;\";\n\t\t$def_time = stripslashes($row['def_time']);\n\t\t$def_responsible = stripslashes($row['def_responsible']);\n\t\tif (empty($def_responsible)) $def_responsible = \"&lt;Ingen verdi&gt;\";\n\t\tif (empty($def_time)) {\n\t\t\t$def_time = \"&lt;Ingen verdi&gt;\";\n\t\t} else {\n\t\t\t$def_time = explode(\"-\",$def_time);\n\t\t\t$dt_start = date(\"H:i\",$def_time[0]);\n\t\t\t$dt_end = date(\"H:i\",$def_time[1]);\n\t\t\tif ($dt_start == \"00:01\") $dt_start = \"?\";\n\t\t\tif ($dt_end == \"00:01\") $dt_end = \"?\";\n\t\t\t$def_time = \"$dt_start - $dt_end\";\n\t\t}\n\t\t$def_loc = stripslashes($row['def_loc']);\n\t\tif (empty($def_loc)) $def_loc = \"&lt;Ingen verdi&gt;\";\n\t\t\n\t\t$url_edit = $this->generateURL(array(\"action=ajaxEditCategory\",\"categoryId=$id\"));\n\t\t$url_edit_js = $this->generateURL(array(\"action=ajaxEditCategory\",\"categoryId=$id\"),true);\n\t\t$url_edit_js = \"AjaxRequestData(\\\"category_$id\\\",\\\"$url_edit_js\\\"); return false;\";\n\t\t\n\t\treturn \"<strong>$caption</strong> [<a href=\\\"$url_edit\\\" onclick='$url_edit_js'>Rediger</a>]<br />\n\t\t\t\t<table style='font-size:10px; color: #666666; margin-bottom: 10px;'>\n\t\t\t\t\t<tr><td style='text-align:right;'>Default name: </td><td>$def_name</td></tr>\n\t\t\t\t\t<tr><td style='text-align:right;'>Default time: </td><td>$def_time</td></tr>\n\t\t\t\t\t<tr><td style='text-align:right;'>Default location: </td><td>$def_loc</td></tr>\n\t\t\t\t\t<tr><td style='text-align:right;'>Default responsible: </td><td>$def_responsible</td></tr>\n\t\t\t\t</table>\n\t\t\";\n\t}", "public function categoryMapping()\n {\n $xml = file_get_contents('php://input');\n $feed = $this->sc['VbDataTransferCategoryMapping']->startProcess($xml);\n unset($xml);\n print $feed;\n }", "public function createCategory()\n {\n $pdo = DBConfig::openConnection();\n $query = $pdo->prepare('INSERT INTO Categories (instantiated, Name, Description, imgURL, date_memory)\n VALUES (:instantiated,:Name, :Description, :imgURL, :date)');\n $query->bindValue(':instantiated', $this->instantiated, PDO::PARAM_STR);\n $query->bindValue(':Name', $this->name, PDO::PARAM_STR);\n $query->bindValue(':Description', $this->description, PDO::PARAM_STR);\n $query->bindValue(':imgURL', $this->imgURL, PDO::PARAM_STR);\n $query->bindValue(':date', $this->date, PDO::PARAM_STR);\n $query->execute();\n $query->CloseCursor();\n DBConfig::closeConnection($pdo);\n }", "private static function _addAttribute()\n {\n DAL::executeQuery('Configuration', 'addAttribute');\n\n }", "function tx_damfrontend_catTreeView() {\n\n\t\t$this->treeID = 1;\n\t\t$this->title = 'categorytree';\n \t\t$this->treeName = 'txdamCat';\n\t\t$this->domIdPrefix = $this->treeName;\n\t\t$this->table = 'tx_dam_cat';\n\t\t$this->parentField = $GLOBALS['TCA'][$this->table]['ctrl']['treeParentField'];\n\t\t$this->parentField = 'parent_id';\n\t\t$this->typeField = $GLOBALS['TCA'][$this->table]['ctrl']['type'];\n\n\t\t$this->renderer; // keeps the reference to the frontend renderer\n\n\n\t\t$this->fieldArray = array('uid','title');\n\t\tif($this->parentField) $this->fieldArray[] = $this->parentField;\n\t\tif($this->typeField) $this->fieldArray[] = $this->typeField;\n\t\t$this->defaultList = 'uid,pid,tstamp,sorting';\n\n\t\t$this->clause = ' AND deleted=0';\n\t\t$this->orderByFields = 'sorting,title';\n\n\t\t$conf = tx_dam::config_getValue('setup.selections.'.$this->treeName);\n\t\t$this->TSconfig = $conf['properties'];\n\t\t$this->mediaFolder = tx_dam_db::getPid();\n \t}", "public function createSeoTextAttributes(Varien_Event_Observer $event)\n {\n $_helper = Mage::helper('loewenstark_seo/categoryAttributes');\n $setup = Mage::getModel('catalog/resource_setup', 'core/resource');\n $setup->startSetup();\n\n //get attributes from config and validate\n $config = $_helper->getSeoTextAttributeCodes();\n\n //delete old attributes\n $_helper->deleteAttributesFromCategory( $setup, $config );\n\n //create not existing attributes\n $_helper->addAttributesToCategory( $setup, $config );\n\n $setup->endSetup();\n\n }", "public function importCategory()\n {\n $yaml_format = array();\n $yaml_content = '';\n\n if ( !file_exists($this->template_category) ) {\n\n $this->setVerbose('error', sprintf(\"Template for category not found --> %s\", $this->template_category));\n\n } else {\n\n $template_category = file_get_contents($this->template_category);\n }\n\n foreach ($this->_data as $item) {\n $yaml_format[(string)$item->category] = (string)$item->category->attributes()->nicename;\n }\n\n asort($yaml_format);\n\n foreach ($yaml_format as $label => $slug) {\n\n $yaml_content .= sprintf($this->template_yaml, $label, $slug);\n\n $this->writeFile($this->categ_path . '/' . $slug . $this->output_ext, vsprintf($template_category, array($label, $slug)));\n }\n\n $this->writeFile($this->data_path . '/categories.yml', trim($yaml_content,\"\\n\\n\"));\n }", "public function AddAttrProcess()\n\t{\n\t\t$rules = array(\n\t\t\tarray('field' => 'CName', 'label' => 'CName', 'rules' => 'required')\n\t\t);\n\n\t\t$this->form_validation->set_rules($rules);\n\t\tif ($this->form_validation->run() == false) {\n\t\t\techo validation_errors();\n\t\t\t$Msg = array('Msg' => validation_errors(), 'Type' => 'danger');\n\t\t\t$this->session->set_flashdata($Msg);\n\t\t\tredirect(base_url('admin/AddAttr'));\n\t\t} else {\n\n\t\t\t$CName = $this->lib->validate($this->input->post('CName'));\n\n\t\t\t$CAbout = $this->lib->validate($this->input->post('CAbout'));\n\n\t\t\t$count = $this->lib_model->Counter('m_attribute', array('name' => $CName));\n\t\t\tif ($count == 0) {\n\t\t\t\t$f = array(\n\t\t\t\t\t'name' => $CName,\n\t\t\t\t\t'about' => $CAbout,\n\t\t\t\t\t'status' => 0,\n\t\t\t\t\t'created' => date('Y-m-d H:i:s'),\n\t\t\t\t\t'createdip' => $this->input->ip_address(),\n\t\t\t\t\t'createdby' => 'Admin'\n\n\t\t\t\t);\n\n\n\t\t\t\t$this->lib_model->Insert('m_attribute', $f);\n\t\t\t\t$Msg = array('Msg' => 'Attribute Add Successfully', 'Type' => 'success');\n\t\t\t\t$this->session->set_flashdata($Msg);\n\t\t\t\tredirect(base_url('admin/AddAttr'));\n\t\t\t} else {\n\t\t\t\t$Msg = array('Msg' => 'Attribute Already Exist in Database', 'Type' => 'danger');\n\t\t\t\t$this->session->set_flashdata($Msg);\n\t\t\t\tredirect(base_url('admin/AddAttr'));\n\t\t\t}\n\n\n\t\t}\n\t}", "function sanitizeProductXml() {\n\t\t$xmlParse = new XmlParser($this -> xmlFile);\n\t\t$data = $xmlParse -> returnArray();\n\t\t$data = $this -> getLevelData($data);\n\t\t$this -> data = array();\n\t\tforeach ($data AS $key => $product) {\n\t\t\tif (isset($product['attributes'])) {\n\t\t\t\t$prod = $product['attributes'];\n\t\t\t\tif (isset($product['children']) && count($product['children']) > 0) {\n\t\t\t\t\tfor ($i = 0, $il = count($product['children']); $i < $il; $i++) {\n\t\t\t\t\t\t$tmp = $product['children'][$i];\n\t\t\t\t\t\tif(!isset($prod[$tmp['name']])){\n\t\t\t\t\t\t\t$prod[$tmp['name']] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($tmp['Value'] != ''){\n\t\t\t\t\t\t\t$prod[$tmp['name']][] = $tmp['Value'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($tmp['Value'] == '' && isset($tmp['children'])){\n\t\t\t\t\t\t\tforeach($tmp['children'] AS $cKey=>$cData){\n\t\t\t\t\t\t\t\t$prod[$tmp['name']][] = $cData['attributes']['Value'];\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\tif (!isset($this -> data[$product['attributes']['Catid']])) {\n\t\t\t\t\t$this -> data[$product['attributes']['Catid']] = array();\n\t\t\t\t}\n\t\t\t\t$this -> data[$product['attributes']['Catid']][$product['attributes']['Product_ID']] = $prod;\n\t\t\t}\n\t\t}\n\t}", "public function render()\n {\n parent::render();\n\n $myConfig = $this->getConfig();\n\n $oAttr = oxNew(\"oxattribute\");\n $soxId = $this->_aViewData[\"oxid\"] = $this->getEditObjectId();\n\n // copy this tree for our article choose\n if ($soxId != \"-1\" && isset($soxId)) {\n // generating category tree for select list\n $this->_createCategoryTree(\"artcattree\", $soxId);\n // load object\n $oAttr->loadInLang($this->_iEditLang, $soxId);\n\n\n $oOtherLang = $oAttr->getAvailableInLangs();\n if (!isset($oOtherLang[$this->_iEditLang])) {\n // echo \"language entry doesn't exist! using: \".key($oOtherLang);\n $oAttr->loadInLang(key($oOtherLang), $soxId);\n }\n\n // remove already created languages\n $aLang = array_diff(oxRegistry::getLang()->getLanguageNames(), $oOtherLang);\n if (count($aLang)) {\n $this->_aViewData[\"posslang\"] = $aLang;\n }\n\n foreach ($oOtherLang as $id => $language) {\n $oLang = new stdClass();\n $oLang->sLangDesc = $language;\n $oLang->selected = ($id == $this->_iEditLang);\n $this->_aViewData[\"otherlang\"][$id] = clone $oLang;\n }\n }\n\n $this->_aViewData[\"edit\"] = $oAttr;\n\n if ($myConfig->getRequestParameter(\"aoc\")) {\n $oAttributeMainAjax = oxNew('attribute_main_ajax');\n $this->_aViewData['oxajax'] = $oAttributeMainAjax->getColumns();\n\n return \"popups/attribute_main.tpl\";\n }\n\n return \"attribute_main.tpl\";\n }", "public function attributeconfigAction() {\n\t\ttry{\n\t\t\t$this->view->title = \"Attribute Group Config\";\n\t\t\t$params = $this->_getAllParams();\n\t\t\tif(isset($params['attributeId']) && trim($params['attributeId'])!=''){$this->view->attributeId = $params['attributeId'];}\n\t\t\t\t\t\t\t\t\n\t\t\t$request = $this->getRequest();\n\t\t\t$Request_Values = $request->getPost();\n\t\t\tif ($request->isGet() && isset($params['gid']) && $params['gid']!='') {\n\t\t\t\t$this->_helper->viewRenderer->setNoRender(true);\n\t\t\t\t$this->_helper->layout->disableLayout();\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//echo $params['table_content'];\n\t\t\t\t//echo \"<br>\";\n\t\t\t\t//echo $params['tp_values'];\n\t\t\t\t//exit;\n\t\t\t\t//$str1_replace = str_replace('p[]=','',$params['table_content']);\n\t\t\t\t$str1_explode = explode('@',$params['table_content']);\n\t\t\t\tforeach($str1_explode as $key=>$value){\n\t\t\t\t\t$str1_array = explode('_',$value);\t\n\t\t\t\t\t$str1_array_org[$str1_array['0']] = $str1_array['1'];\t\n\t\t\t\t}\n\n\t\t\t\t//echo \"<pre>\";\n\t\t\t\t//print_r($str1_array_org);\n\n\n\t\t\t\t$str2_explode = explode(',',substr($params['tp_values'],0,-1));\n\t\t\t\tforeach($str2_explode as $key=>$value){\n\t\t\t\t\t$str2_array = explode('_',$value);\n\t\t\t\t\t$str2_array_org[$str2_array['0']] = $str2_array['1'];\n\t\t\t\t}\n\n\n\t\t\t\t$str_one = '';\n\t\t\t\tforeach($str2_array_org as $key=>$value){\n\t\t\t\t\t$str_one .= $value.\"#\";\n\t\t\t\t\tforeach($str1_array_org as $key1=>$value1){\n\t\t\t\t\t\tif($key==$value1){\n\t\t\t\t\t\t\t$str_one .= $key1.',';\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$str_one .= \"#-\";\n\t\t\t\t}\n\t\t\t\t//echo $str_one;\t\t\t\t\n\t\t\t\t$result = $this->attributesgroupsdb->saveAttributeGroupMap($params['gid'],$str_one);\n\t\t\t\techo $result['@omessage'];\t\t\t\t\n\t\t\t}else{\t\t\t\n\t\t\t\t$this->view->AttributeGroupDetails = $this->attributesgroupsdb->getAttributeGroupDetails($params['attributeId']);\n\t\t\t\t$this->view->ActiveAttributesList = $this->attributesgroupsdb->getActiveAttributesList($params['attributeId']);\n\t\t\t\t//$this->view->ActiveAttributesGroupsList = $this->attributesgroupsdb->getActiveAttributesGroupsList();\n\t\t\t\t$this->view->ActiveAttributesSetsList = $this->attributesgroupsdb->getActiveAttributesSetsList($params['attributeId']);\n\t\t\t\t\n\t\t\t\t$this->view->ActiveAttributesSetsMapList = $this->attributesgroupsdb->getActiveAttributesSetsMapList($params['attributeId']);\n\t\t\t\t}\n\t\t\t\n\t\t} catch(Exception $e) {\n\t\t\tApplication_Model_Logging::lwrite($e->getMessage());\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\t}", "public function attributes() {\n return ArrayHelper::merge(parent::attributes(), ['_keywords', 'listorder', 'cat_name']);\n }", "public function category()\n {\n $xml = file_get_contents('php://input');\n $feed = $this->sc['VbDataTransferCategory']->startProcess($xml);\n unset($xml);\n print $feed;\n }" ]
[ "0.6325504", "0.6319294", "0.6236693", "0.5929955", "0.5910456", "0.5900958", "0.58101755", "0.57679975", "0.57378703", "0.57123756", "0.5707238", "0.5704216", "0.5699426", "0.56543857", "0.562137", "0.56091684", "0.55939806", "0.55845964", "0.5541418", "0.55259615", "0.552018", "0.5512489", "0.5509271", "0.5506584", "0.5501743", "0.54863036", "0.5483402", "0.5482636", "0.54743356", "0.54695" ]
0.65141016
0
Returns a WHEREclause for the tx_commerce_categoriestable where user permissions according to input argument, $perms, is validated. $perms is the "mask" used to select. Fx. if $perms is 1 then you'll get all categories that a user can actually see! 2^0 = show (1) 2^1 = edit (2) 2^2 = delete (4) 2^3 = new (8) If the user is 'admin' " 1=1" is returned (no effect) If the user is not set at all (>user is not an array), then " 1=0" is returned (will cause no selection results at all) The 95% use of this function is ">getCategoryPermsClause(1)" which will return WHERE clauses for selecting categories in backend listings in other words this will check read permissions.
function getCategoryPermsClause($perms) { global $TYPO3_CONF_VARS; if (is_array($GLOBALS['BE_USER']->user)) { if ($GLOBALS['BE_USER']->isAdmin()) { return ' 1=1'; } $perms = intval($perms); // Make sure it's integer. $str= ' ('. '(perms_everybody & '.$perms.' = '.$perms.')'. // Everybody 'OR(perms_userid = '.$GLOBALS['BE_USER']->user['uid'].' AND perms_user & '.$perms.' = '.$perms.')'; // User if ($GLOBALS['BE_USER']->groupList) { $str.= 'OR(perms_groupid in ('.$GLOBALS['BE_USER']->groupList.') AND perms_group & '.$perms.' = '.$perms.')'; // Group (if any is set) } $str.=')'; return $str; } else { return ' 1=0'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readCategoryAccess($id, $perms_clause) {\n\t\tif ((string)$id!='') {\n\t\t\t$id = intval($id);\n\t\t\tif (!$id) {\n\t\t\t\tif ($GLOBALS['BE_USER']->isAdmin()) {\n\t\t\t\t\t$path = '/';\n\t\t\t\t\t$pageinfo['_thePath'] = $path;\n\t\t\t\t\treturn $pageinfo;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$pageinfo = t3lib_BEfunc::getRecord('tx_commerce_categories', $id, '*', ($perms_clause ? ' AND '.$perms_clause : ''));\n\t\t\t\tif ($pageinfo['uid'] /*&& $GLOBALS['BE_USER']->isInWebMount($id, $perms_clause)*/) {\n\t\t\t\t\t//t3lib_BEfunc::workspaceOL('pages', $pageinfo);\n\t\t\t\t\tif (is_array($pageinfo)) {\n\t\t\t\t\t\t//t3lib_BEfunc::fixVersioningPid('pages', $pageinfo);\n\t\t\t\t\t\t//list($pageinfo['_thePath'], $pageinfo['_thePathFull']) = t3lib_BEfunc::getRecordPath(intval($pageinfo['uid']), $perms_clause, 15, 1000);\n\t\t\t\t\t\treturn $pageinfo;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "protected function getCategoriesQuery()\n {\n $user = sfContext::getInstance()->getUser();\n $admin = $user->hasCredential(aMediaTools::getOption('admin_credential'));\n return Doctrine::getTable('aCategory')->createQuery('c')->where('0 <> 0');\n }", "protected function getRecursiveSelect($id, $perms_clause)\n {\n $getLevels = 10000;\n // Finding tree and offer setting of values recursively.\n $tree = GeneralUtility::makeInstance(PageTreeView::class);\n $tree->init('AND ' . $perms_clause);\n $tree->makeHTML = 0;\n $tree->setRecs = 0;\n $tree->getTree($id, $getLevels, '');\n\n return $tree->ids;\n }", "public static function perms(string $file, ?int $perms = null): string\n {\n if ($perms === null) {\n if (!\\file_exists($file)) {\n return '';\n }\n\n /** @noinspection CallableParameterUseCaseInTypeContextInspection */\n $perms = \\fileperms($file);\n }\n\n /** @codeCoverageIgnoreStart */\n $info = 'u'; // undefined\n if (($perms & self::TYPE_SOCKET) === self::TYPE_SOCKET) {\n $info = 's';\n } elseif (($perms & self::TYPE_SYMLINK) === self::TYPE_SYMLINK) {\n $info = 'l';\n } elseif (($perms & self::TYPE_REGULAR) === self::TYPE_REGULAR) {\n $info = '-';\n } elseif (($perms & self::TYPE_BLOCK) === self::TYPE_BLOCK) {\n $info = 'b';\n } elseif (($perms & self::TYPE_DIR) === self::TYPE_DIR) {\n $info = 'd';\n } elseif (($perms & self::TYPE_CHARACTER) === self::TYPE_CHARACTER) {\n $info = 'c';\n } elseif (($perms & self::TYPE_FIFO) === self::TYPE_FIFO) {\n $info = 'p';\n }\n // @codeCoverageIgnoreEnd\n\n // Owner\n $info .= (($perms & self::PERM_OWNER_READ) > 0 ? 'r' : '-');\n $info .= (($perms & self::PERM_OWNER_WRITE) > 0 ? 'w' : '-');\n\n /** @noinspection NestedTernaryOperatorInspection */\n $info .= (($perms & self::PERM_OWNER_EXEC) > 0\n ? (($perms & self::PERM_OWNER_EXEC_STICKY) > 0 ? 's' : 'x')\n : (($perms & self::PERM_OWNER_EXEC_STICKY) > 0 ? 'S' : '-'));\n\n // Group\n $info .= (($perms & self::PERM_GROUP_READ) > 0 ? 'r' : '-');\n $info .= (($perms & self::PERM_GROUP_WRITE) > 0 ? 'w' : '-');\n\n /** @noinspection NestedTernaryOperatorInspection */\n $info .= (($perms & self::PERM_GROUP_EXEC) > 0\n ? (($perms & self::PERM_GROUP_EXEC_STICKY) > 0 ? 's' : 'x')\n : (($perms & self::PERM_GROUP_EXEC_STICKY) > 0 ? 'S' : '-'));\n\n // All\n $info .= (($perms & self::PERM_ALL_READ) > 0 ? 'r' : '-');\n $info .= (($perms & self::PERM_ALL_WRITE) > 0 ? 'w' : '-');\n\n /** @noinspection NestedTernaryOperatorInspection */\n $info .= (($perms & self::PERM_ALL_EXEC) > 0\n ? (($perms & self::PERM_ALL_EXEC_STICKY) > 0 ? 't' : 'x')\n : (($perms & self::PERM_ALL_EXEC_STICKY) > 0 ? 'T' : '-'));\n\n return $info;\n }", "function qry_all_grant_category()\n {\n $user_id = Session::get('user_id');\n $granted_group = Session::get('arr_all_grant_group_code');\n $arr_super_group = array('ADMINISTRATORS');\n $arr_i = array_intersect($arr_super_group, $granted_group);\n if (!empty($arr_i))\n {\n $detect = new Mobile_Detect();\n if ($detect->isMobile())\n {\n //Mobile thi lay tat ca\n $sql = ' Select PK_CATEGORY From t_ps_category';\n }\n else\n {\n $sql = ' Select PK_CATEGORY From t_ps_category Where FK_WEBSITE = ' . Session::get('session_website_id');\n }\n \n }\n else\n {\n $sql = 'Select FK_CATEGORY From t_ps_user_category Where FK_USER = ' . $user_id;\n if (!empty($granted_group))\n {\n $granted_group = \"'\" . implode(\" ', '\", $granted_group) . \"'\";\n $sql .= ' Union(Select GC.FK_CATEGORY \n From t_ps_group_category GC\n Inner Join t_cores_group G \n On G.PK_GROUP = GC.FK_GROUP\n Where G.C_CODE In (' . $granted_group . ')\n )';\n }\n }\n $arr = $this->db->getCol($sql);\n if (!empty($arr))\n {\n return $arr;\n }\n else\n {\n return array();\n }\n }", "private function _buildQuery()\n {\n $user =& JFactory::getUser();\n $aid = $user->get('aid', 0);\n\n //-- Query to retrieve all categories that belong under the joominaFS section\n //-- and that are published.\n $query = 'SELECT cc.*, COUNT(a.id) AS numitems,'\n .' cc.id as slug'\n .' FROM #__categories AS cc'\n .' LEFT JOIN #__joominafs AS a ON a.catid = cc.id'\n// .' WHERE a.published = 1'\n .' WHERE section = \\'com_joominafs\\''\n .' AND cc.published = 1'\n .' AND cc.access <= '.(int)$aid\n .' GROUP BY cc.id'\n .' ORDER BY cc.ordering';\n\n return $query;\n }", "function sql_perm()\n{\n\tif(!in_group('admin'))\n\t{\n\t\t$str_where_perm = \"(\".PREFIX.\"first_lev_album.groups LIKE '%;public;%'\";\n\t\tif(isset($_SESSION[\"user_groups\"]))\n\t\t{\n\t\t\t$str_groups = substr($_SESSION[\"user_groups\"],0,strlen($_SESSION[\"user_groups\"])-1);\t// remove last ';'\n\t\t\t$group_member_of=explode(\";\",$str_groups);\n\t\t\t$group_member_of = addslashes_array($group_member_of);\n\t\t\t\n\t\t\t$str_perm = implode(\";%' OR \".PREFIX.\"first_lev_album.groups LIKE '%;\",$group_member_of);\n\t\t\t$str_perm = PREFIX.\"first_lev_album.groups LIKE '%;\".$str_perm.\";%'\";\n\t\t\t\n\t\t\t$str_where_perm .= \" OR \".$str_perm;\n\t\t}\n\t\t$str_where_perm .= \")\";\n\t}\n\telse\n\t{\n\t\t$str_where_perm = \"1=1\";\n\t}\n\t\n\treturn $str_where_perm;\n}", "function getCategorysQuery(Query $q = null) {\n\t\treturn $this->getForeignObjectsQuery('category', 'userId','id', $q);\n\t}", "private function _create_default_category_sql()\n\t{\n\t\t// \n\t\t// Check for the category parameter\n\t\t//\n\n\t\t$category_sql = \"\";\n\t\tif ( isset($_GET['c']) AND !is_array($_GET['c']) AND intval($_GET['c']) > 0)\n\t\t{\n\t\t\t//just one category, so AND has no effect, so just return an empty string\n\t\t\treturn \"\";\n\t\t}\n\t\telseif (isset($_GET['c']) AND is_array($_GET['c']))\n\t\t{\n\t\t\t// Sanitize each of the category ids\n\t\t\t$category_ids = array();\n\t\t\tforeach ($_GET['c'] as $c_id)\n\t\t\t{\n\t\t\t\tif (intval($c_id) > 0)\n\t\t\t\t{\n\t\t\t\t\t$category_ids[] = intval($c_id);\n\t\t\t\t}\n\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$category_ids = implode(\",\", $category_ids);\n\t\t\t\n\t\t\t\t$category_sql = '(c.id IN ('.$category_ids.') OR c.parent_id IN ('.$category_ids.'))';\n\t\t\t}\n\t\t}\n\t\treturn $category_sql;\n\t}", "function _generate_mysql_query_for_category($use_limit, $cat_id) {\n $mysql_query = \"SELECT DISTINCT si.id, si.item_url, si.item_price, si.item_title, si.was_price\n FROM store_items si\n JOIN store_cat_assign sca ON si.id = item_id\n JOIN store_categories sc ON sca.cat_id = sc.id\n WHERE sc.id = $cat_id\";\n if ($use_limit == true) {\n $limit = $this->get_pagination_limit(\"main\");\n $offset = $this->_get_pagination_offset();\n $mysql_query.= \" LIMIT \".$offset.\", \".$limit;\n }\n return $mysql_query;\n }", "public function filterByPermissions($permissions, $comparison = null)\n {\n $key = $this->getAliasedColName(UserLicensePeer::PERMISSIONS);\n // Criteria::CONTAINS_ALL, Criteria::CONTAINS_SOME, Criteria::CONTAINS_NONE\n // ... and other operators should be handled by PostgresArrayCriterion\n $this->addUsingOperator(new PostgresArrayCriterion($this, $key, $permissions, $comparison ?: Criteria::CONTAINS_ALL));\n\n return $this;\n }", "function getActiveUserCategories($check_permission = false) {\n $array = array();\n ## Load config and store\n $CFG = $this->config->item('user_category_configure');\n\n $where[] = array($CFG['table_name'] . '.' . $CFG['possible_where']['is_trashed'], 0);\n if ($check_permission) {\n $vp = viewPermission($CFG[\"sector\"][\"view_all\"], $CFG[\"sector\"][\"view_child\"]);\n if ($vp == 2)\n $where[] = viewScope($CFG['table_name'] . '.' . $CFG['possible_where']['creator_id'], $CFG[\"sector\"][\"view_all\"], $CFG[\"sector\"][\"view_child\"]);\n elseif (!$vp)\n $where[] = array($CFG['table_name'] . '.' . $CFG['possible_where']['creator_id'], -1); // if not access \n }\n $records = $this->ucat->getRecords($where);\n foreach ($records as $record)\n $array[$record->ai_user_category_id] = $record->user_category;\n return $array;\n }", "public static function categoryPermissions($escape = false, $forceRefresh = false) {\n if (is_null(self::$categoryPermissions) || $forceRefresh) {\n $session = Gdn::session();\n\n if ((is_object($session->User) && $session->User->Admin)) {\n self::$categoryPermissions = true;\n } elseif (c('Garden.Permissions.Disabled.Category')) {\n if ($session->checkPermission('Vanilla.Discussions.View')) {\n self::$categoryPermissions = true;\n } else {\n self::$categoryPermissions = []; // no permission\n }\n } else {\n $categories = CategoryModel::categories();\n $iDs = [];\n\n foreach ($categories as $iD => $category) {\n if ($category['PermsDiscussionsView']) {\n $iDs[] = $iD;\n }\n }\n\n // Check to see if the user has permission to all categories. This is for speed.\n $categoryCount = count($categories);\n\n if (count($iDs) == $categoryCount) {\n self::$categoryPermissions = true;\n } else {\n self::$categoryPermissions = [];\n foreach ($iDs as $iD) {\n self::$categoryPermissions[] = ($escape ? '@' : '').$iD;\n }\n }\n }\n }\n\n return self::$categoryPermissions;\n }", "public function scopePermission(Builder $query, $permissions): Builder\n {\n $permissions = $this->convertToPermissionModels($permissions);\n\n $groupsWithPermissions = array_unique(array_reduce($permissions, function ($result, $permission) {\n return array_merge($result, $permission->groups->all());\n }, []));\n\n return $query->where(function ($query) use ($permissions, $groupsWithPermissions) {\n $query->whereHas('permissions', function ($query) use ($permissions) {\n $query->where(function ($query) use ($permissions) {\n foreach ($permissions as $permission) {\n $query->orWhere(config('acl.tables.permissions').'.id', $permission->id);\n }\n });\n });\n if (count($groupsWithPermissions) > 0) {\n $query->orWhereHas('groups', function ($query) use ($groupsWithPermissions) {\n $query->where(function ($query) use ($groupsWithPermissions) {\n foreach ($groupsWithPermissions as $groupsWithPermission) {\n $query->orWhere(config('acl.tables.groups').'.id', $groupsWithPermission->id);\n }\n });\n });\n }\n });\n }", "public function perms();", "public function get_categories($select = array(), $where = array(), $order_by = 'channel_id', $sort = 'DESC', $limit = FALSE, $offset = 0)\n\t{\t\t\t\n\t\t$this->convert_params($select, $where, $order_by, $sort, $limit, $offset);\n\t\t\n\t\treturn $this->EE->db->get('categories');\n\t}", "public static function get_categories($_categories = null, $_limit = 0, $_offset = 0)\n\t{\n\t\t$_query = \\DB::select('id', 'name')->from('categories');\n\n\t\tif ($_categories !== null) {\n\t\t\t$_query->where('id', 'IN', $_categories);\n\t\t}\n\n\t\tif ((int)$_limit > 0) {\n\t\t\t$_query->limit((int)$_limit);\n\t\t}\n\n\t\tif ((int)$_offset > 0) {\n\t\t\t$_query->offset((int)$_offset);\n\t\t}\n\n\t\t$_query = $_query->as_object()->execute();\n\n\t\treturn $_query;\n\t}", "protected function get_filter_sql_permissions() {\n global $USER;\n $ctxlevel = 'cluster';\n $perm = 'local/elisprogram:userset_edit';\n $additionalfilters = array();\n $additionalparams = array();\n $associatectxs = pm_context_set::for_user_with_capability($ctxlevel, $perm, $USER->id);\n $associatectxsfilerobject = $associatectxs->get_filter('id', $ctxlevel);\n $associatefilter = $associatectxsfilerobject->get_sql(false, 'element', SQL_PARAMS_QM);\n if (isset($associatefilter['where'])) {\n $additionalfilters[] = $associatefilter['where'];\n $additionalparams = array_merge($additionalparams, $associatefilter['where_parameters']);\n }\n return array($additionalfilters, $additionalparams);\n }", "public function getPermissions()\n {\n return $this->hasMany(Permissions::className(), ['oper_user_id' => 'id']);\n }", "public function buildWherePermission( array $ids, $field='', $incStarCheck=true )\n {\n /* Just use a LIKE chain for items without a specific implementation */\n $where = '(' . $this->buildLikeChain( $field, $ids ) . ')';\n \n if ( $incStarCheck === true )\n {\n $where .= ' OR ( ' . $field . '=\\'*\\' )';\n }\n \n return \"( \" . $where . \" )\";\n }", "protected function get_where($cols, $vals, $custom_where = '') {\r\n if (!empty($cols)) {\r\n $cases = array();\r\n for ($i = 0; $i < count($cols); $i++) {\r\n $cases[] = \"$cols[$i] LIKE '%\" . str_replace(' ', '%', $vals[$i]) . \"%'\";\r\n }\r\n $where = 'WHERE (' . implode(' AND ', $cases) . ')';\r\n if ($custom_where)\r\n $where.=\" AND ( $custom_where )\";\r\n }\r\n else if (!empty($custom_where)) {\r\n $where = \"WHERE $custom_where\";\r\n } else {\r\n $where = '';\r\n }\r\n return $where;\r\n }", "protected function get_filter_sql_permissions() {\n global $USER;\n $ctxlevel = 'cluster';\n $perm = 'local/elisprogram:userset_view';\n $additionalfilters = array();\n $additionalparams = array();\n $associatectxs = pm_context_set::for_user_with_capability($ctxlevel, $perm, $USER->id);\n $associatectxsfilerobject = $associatectxs->get_filter('id', $ctxlevel);\n $associatefilter = $associatectxsfilerobject->get_sql(false, 'element', SQL_PARAMS_QM);\n if (isset($associatefilter['where'])) {\n $additionalfilters[] = $associatefilter['where'];\n $additionalparams = array_merge($additionalparams, $associatefilter['where_parameters']);\n }\n return array($additionalfilters, $additionalparams);\n }", "public function getWhereSQL()\n {\n $operation = trim($this->field_row->operation);\n \n if (strlen($operation) == 0) {\n return \"\";\n }\n \n $crit = $this->field_row->criteria;\n if ($crit == \"[ME]\")\n {\n $crit = Auth::user()->id;\n }\n\n if ($this->field_row->sys_name == \"bool\") {\n $crit = ($this->field_row->criteria == \"'\" . trans('fields.yes') . \"'\") ? 1 : 0;\n } \n \n return \" AND \" . $this->field_where_name . \" \" . $operation . \" \" . $crit;\n \n }", "public function getCategories($shopId, $blacklist, $limit = null, $offset = null, array $uids = array())\n {\n $params = array();\n /** @noinspection PhpParamsInspection */\n $result = $this->db->GetOne(\n 'SHOW COLUMNS FROM ' . TABLE_CATEGORIES_DESCRIPTION . ' LIKE \\'categories_store_id\\''\n );\n\n if (empty($result)) {\n $catStoreId = '';\n } else {\n $catStoreId = ' AND cd.categories_store_id = ?';\n $params[] = $shopId;\n }\n $params[] = 'shop_' . $shopId;\n $params[] = $this->language->code;\n\n /** @noinspection SqlDialectInspection */\n $qry = '\n SELECT\n DISTINCT c.categories_id,\n c.parent_id,\n cd.categories_name,\n c.sort_order,\n c.categories_status,\n c.categories_image\n FROM ' . TABLE_CATEGORIES . ' c\n JOIN ' . TABLE_CATEGORIES_DESCRIPTION . ' cd ON (c.categories_id = cd.categories_id' . $catStoreId . ')\n LEFT JOIN ' . TABLE_CATEGORIES_PERMISSION . ' cm ON (cm.pid = c.categories_id AND cm.pgroup = ?)\n WHERE cd.language_code = ?\n ';\n\n $qry .= ($blacklist)\n ? ' AND (cm.permission IS NULL OR cm.permission = 0)'\n : ' AND (cm.permission IS NOT NULL AND cm.permission = 1)';\n\n if (!empty($uids)) {\n $placeholders = array();\n foreach ($uids as $uid) {\n $placeholders[] = '?';\n $params[] = $uid;\n }\n $qry .= ' AND c.categories_id IN (' . implode(', ', $placeholders) . ')';\n }\n\n $qry .= ' ORDER BY categories_id';\n\n if (($offset !== null) && ($limit !== null)) {\n $qry .= ' LIMIT ?, ?';\n $params[] = $offset;\n $params[] = $limit;\n }\n\n $qry .= ';';\n\n $this->log(\n 'Fetching categories. SQL statement: ' . $qry . '\\nParameters: ' . implode(', ', $params),\n ShopgateLogger::LOGTYPE_DEBUG\n );\n\n $stmt = $this->db->Prepare($qry);\n\n return $this->db->Execute($stmt, $params);\n }", "function build_permissions()\n {\n\t\tif ( $this->ipsclass->member['g_is_supmod'] )\n\t\t{\n\t\t\t$this->can_edit_topics = 1;\n\t\t\t$this->can_close_topics = 1;\n\t\t\t$this->can_open_topics = 1;\n\t\t}\n\t\telse if ( isset($this->ipsclass->member['_moderator'][ $this->forum['id'] ]) AND is_array( $this->ipsclass->member['_moderator'][ $this->forum['id'] ] ) )\n\t\t{\n\t\t\tif ( $this->ipsclass->member['_moderator'][ $this->forum['id'] ]['edit_topic'] )\n\t\t\t{\n\t\t\t\t$this->can_edit_topics = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif ( $this->ipsclass->member['_moderator'][ $this->forum['id'] ]['close_topic'] )\n\t\t\t{\n\t\t\t\t$this->can_close_topics = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif ( $this->ipsclass->member['_moderator'][ $this->forum['id'] ]['open_topic'] )\n\t\t\t{\n\t\t\t\t$this->can_open_topics = 1;\n\t\t\t}\n\t\t}\n\t}", "function permissions_edit($perms) {\n return 'foo';\n $perms = json_decode($permsJson, true);\n if(!$perms || !is_array($perms)) return '';\n $ar = [];\n foreach($perms as $k => $v) {\n $ar[]= ucfirst($v).\" {$k}\";\n }\n return implode(', ', $ar);\n}", "function acl_filter_where($where){\n global $wpdb;\n\n $current_user_id = get_current_user_id();\n\n //Берем из настроек нужные типы постов\n $post_types=get_post_types_for_acl_s();\n foreach($post_types as &$post_type){\n $post_type=\"'\".$post_type.\"'\";\n }\n $string_for_query=implode(',',$post_types);\n\n //Если это администратор, редактор или кто то с правом доступа, то отменяем контроль\n if (user_can($current_user_id, 'full_access_to_posts') or user_can($current_user_id, 'editor') or user_can($current_user_id, 'administrator')) return $where;\n\n $where .= \" AND\n if(\" . $wpdb->posts . \".post_type IN (\".$string_for_query.\"),\n if(\" . $wpdb->posts . \".ID IN (\n SELECT post_id\n FROM \" . $wpdb->postmeta .\"\n WHERE\n \" . $wpdb->postmeta .\".meta_key = 'acl_s_true'\n AND \" . $wpdb->postmeta .\".post_id = \" . $wpdb->posts . \".ID\n ),\n if(\" . $wpdb->posts . \".ID IN (\n SELECT post_id\n FROM \" . $wpdb->postmeta .\"\n WHERE\n \" . $wpdb->postmeta .\".meta_key = 'acl_users_s'\n AND \" . $wpdb->postmeta .\".post_id = \" . $wpdb->posts . \".ID\n AND \" . $wpdb->postmeta .\".meta_value = \" . $current_user_id .\"\n )\n ,1,0),1),\n 1)=1\";\n\n return $where;\n}", "protected function insertCategoryPermissions(): void\n {\n Registry::get('Permissions')\n ->buildCategories(TableRegistry::getTableLocator()->get('Categories'));\n }", "public function getSql(): string\n\t{\n\t\t$cat = trim($this->getValue());\n\t\tif($cat)\n\t\t{\n\t\t\t$not = \"\";\n\t\t\tif($this->getQueryOperator() == self::OPERATOR_NOT_EQUALS)\n\t\t\t{\n\t\t\t\t$not = \"NOT \";\n\t\t\t}\n\n\t\t\t$catParam = $this->addParam($cat);\n\t\t\treturn $this->getOperator() . \" \" . $not . \"EXISTS(\n\tSELECT\n\t\t1 \n\tFROM\n\t\tdj.dream_to_dream_category dream2cat\n\tWHERE\n\t\tdream2cat.dream_id = dream.id\n\t\tAND dream2cat.category_id = {$catParam}\n)\n\t\t\t\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t}", "function should_add_customperms($perms, $perm, $value)\n{\n\tif(substr($perm, -6) == \"_value\")\n\t{\n\t\tif(!empty($value))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\t// if this is the option to choose whether to use a numerical value, store it as enabled if it's set to 1 and the actual value isn't empty\n\telseif(array_key_exists($perm . \"_value\", $perms))\n\t{\n\t\tif($value == 1 && !empty($perms[$perm . \"_value\"]))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\t// else it's just a standard option, if it's not set to inherit, store it\n\telseif($value != -1)\n\t{\n\t\treturn true;\n\t}\n\t// don't store it, it's set to inherit\n\telse\n\t{\n\t\treturn false;\n\t}\n}" ]
[ "0.57339996", "0.57254195", "0.51239693", "0.49114588", "0.48744637", "0.4731117", "0.454038", "0.45061672", "0.44595295", "0.44143957", "0.43950525", "0.43824774", "0.43639803", "0.43519863", "0.43391168", "0.43179175", "0.43116045", "0.43026656", "0.42996785", "0.42948774", "0.42908123", "0.42789018", "0.42677626", "0.426184", "0.42503673", "0.42485502", "0.42469773", "0.42465153", "0.42409936", "0.4239205" ]
0.8107094
0
Returns a category record (of category with $id) with an extra field "_thePath" set to the record path IF the WHERE clause, $perms_clause, selects the record. Thus is works as an access check that returns a category record if access was granted, otherwise not. If $id is zero a pseudo rootpage with "_thePath" set is returned IF the current BE_USER is admin. In any case >isInWebMount must return true for the user (regardless of $perms_clause) Usage: 21
function readCategoryAccess($id, $perms_clause) { if ((string)$id!='') { $id = intval($id); if (!$id) { if ($GLOBALS['BE_USER']->isAdmin()) { $path = '/'; $pageinfo['_thePath'] = $path; return $pageinfo; } } else { $pageinfo = t3lib_BEfunc::getRecord('tx_commerce_categories', $id, '*', ($perms_clause ? ' AND '.$perms_clause : '')); if ($pageinfo['uid'] /*&& $GLOBALS['BE_USER']->isInWebMount($id, $perms_clause)*/) { //t3lib_BEfunc::workspaceOL('pages', $pageinfo); if (is_array($pageinfo)) { //t3lib_BEfunc::fixVersioningPid('pages', $pageinfo); //list($pageinfo['_thePath'], $pageinfo['_thePathFull']) = t3lib_BEfunc::getRecordPath(intval($pageinfo['uid']), $perms_clause, 15, 1000); return $pageinfo; } } } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get( $id = -1 )\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n if ( $id != \"\" )\r\n {\r\n $db->array_query( $category_array, \"SELECT * FROM eZFileManager_Folder WHERE ID='$id'\" );\r\n if ( count( $category_array ) > 1 )\r\n {\r\n die( \"Error: Category's with the same ID was found in the database. This shouldent happen.\" );\r\n }\r\n else if ( count( $category_array ) == 1 )\r\n {\r\n $this->ID =& $category_array[0][$db->fieldName( \"ID\" )];\r\n $this->Name =& $category_array[0][$db->fieldName( \"Name\" )];\r\n $this->Description =& $category_array[0][$db->fieldName( \"Description\" )];\r\n $this->ParentID =& $category_array[0][$db->fieldName( \"ParentID\" )];\r\n $this->UserID =& $category_array[0][$db->fieldName( \"UserID\" )];\r\n $this->SectionID =& $category_array[0][$db->fieldName( \"SectionID\" )];\r\n }\r\n }\r\n }", "public function getAcl( $id );", "public function check_access($id) {\n global $DB, $USER;\n\n if (isguestuser()) {\n return \\core_search\\manager::ACCESS_DENIED;\n }\n\n $now = time();\n\n $sql = \"SELECT dr.*, d.*\n FROM {data_records} dr\n JOIN {data} d ON d.id = dr.dataid\n WHERE dr.id = ?\";\n\n $entry = $DB->get_record_sql($sql, array( $id ), IGNORE_MISSING);\n\n if (!$entry) {\n return \\core_search\\manager::ACCESS_DELETED;\n }\n\n if (($entry->timeviewfrom && $now < $entry->timeviewfrom) || ($entry->timeviewto && $now > $entry->timeviewto)) {\n return \\core_search\\manager::ACCESS_DENIED;\n }\n\n $cm = $this->get_cm('data', $entry->dataid, $entry->course);\n $context = \\context_module::instance($cm->id);\n\n $canmanageentries = has_capability('mod/data:manageentries', $context);\n\n if (!has_capability('mod/data:viewentry', $context)) {\n return \\core_search\\manager::ACCESS_DENIED;\n }\n\n $numberofentriesindb = $DB->count_records('data_records', array('dataid' => $entry->dataid));\n $requiredentriestoview = $entry->requiredentriestoview;\n\n if ($requiredentriestoview && ($requiredentriestoview > $numberofentriesindb) &&\n ($USER->id != $entry->userid) && !$canmanageentries) {\n return \\core_search\\manager::ACCESS_DENIED;\n }\n\n if ($entry->approval && !$entry->approved && ($entry->userid != $USER->id) && !$canmanageentries) {\n return \\core_search\\manager::ACCESS_DENIED;\n }\n\n $currentgroup = groups_get_activity_group($cm, true);\n $groupmode = groups_get_activity_groupmode($cm);\n\n if (($groupmode == 1) && ($entry->groupid != $currentgroup) && !$canmanageentries) {\n return \\core_search\\manager::ACCESS_DENIED;\n }\n\n return \\core_search\\manager::ACCESS_GRANTED;\n }", "public function check_access($id) {\n global $USER;\n\n try {\n $entry = $this->get_entry($id);\n $cminfo = $this->get_cm('glossary', $entry->glossaryid, $entry->course);\n } catch (\\dml_missing_record_exception $ex) {\n return \\core_search\\manager::ACCESS_DELETED;\n } catch (\\dml_exception $ex) {\n return \\core_search\\manager::ACCESS_DENIED;\n }\n\n if (!glossary_can_view_entry($entry, $cminfo)) {\n return \\core_search\\manager::ACCESS_DENIED;\n }\n\n return \\core_search\\manager::ACCESS_GRANTED;\n }", "private function categoryIsProtected($id, $type=\"frontend\")\n {\n if ($id == 0) {\n // top category\n return 0;\n }\n\n global $objDatabase;\n $query = \" SELECT \".$type.\"Protected as protected,\n \".$type.\"_access_id as access_id\n FROM \".DBPREFIX.\"module_gallery_categories\n WHERE id = \".$id;\n $objRs = $objDatabase->Execute($query);\n if ($objRs) {\n if ($objRs->fields['protected']) {\n return $objRs->fields['access_id'];\n } else {\n return 0;\n }\n } else {\n // the check didn't work. hide\n return 0;\n }\n\n }", "public function getSinglePath($id) {\n\t\treturn dbquery(\"\n\t\t\tSELECT \".$this->_getSelectFields(\"parent\").\" FROM \".$this->catTable.\" AS node,\n\t\t\t\".$this->catTable.\" AS parent\n\t\t\tWHERE node.\".$this->catLeft.\" BETWEEN parent.\".$this->catLeft.\" AND parent.\".$this->catRight.\"\n\t\t\tAND node.\".$this->catId.\"='\".$id.\"'\n\t\t\tORDER BY parent.\".$this->catLeft.\"\n\t\t\");\n\t}", "protected function getRecursiveSelect($id, $perms_clause)\n {\n $getLevels = 10000;\n // Finding tree and offer setting of values recursively.\n $tree = GeneralUtility::makeInstance(PageTreeView::class);\n $tree->init('AND ' . $perms_clause);\n $tree->makeHTML = 0;\n $tree->setRecs = 0;\n $tree->getTree($id, $getLevels, '');\n\n return $tree->ids;\n }", "function loadCateg($id) {\n unset($this->categ);\n $sql = \"SELECT linkcateg_id,\n linkcateg_title,\n linkcateg_parent_id,\n linkcateg_description,\n linkcateg_path\n FROM %s\n WHERE linkcateg_id = %d\n ORDER BY linkcateg_title\";\n $params = array($this->tableLinkdbCateg, $id);\n\n if ($res = $this->databaseQueryFmt($sql, $params)) {\n while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $this->categ = $row;\n }\n return TRUE;\n }\n return FALSE;\n }", "public function run($id, $connection)\n {\n if (addon_installed('content_privacy')) {\n require_code('content_privacy');\n if (!has_privacy_access('catalogue_entry', strval($id))) {\n return false;\n }\n }\n\n $info = $connection->query_select('catalogue_entries', array('c_name', 'cc_id'), array('id' => intval($id)), '', 1);\n if (!array_key_exists(0, $info)) {\n return false;\n }\n\n if (!has_category_access(get_member(), 'catalogues_catalogue', $info[0]['c_name'])) {\n return false;\n }\n\n return ((get_value('disable_cat_cat_perms') === '1') || (has_category_access(get_member(), 'catalogues_category', strval($info[0]['cc_id']))));\n }", "function checkAuth($id)\n {\n global $objDatabase;\n\n if ($id == 0) {\n return true;\n }\n\n $objFWUser = \\FWUser::getFWUserObject();\n if ($objFWUser->objUser->login() && $objFWUser->objUser->getAdminStatus()) {\n return true;\n }\n\n $query = \" SELECT protected\n FROM \".DBPREFIX.\"module_gallery_categories\n WHERE id = \".$id;\n $objRs = $objDatabase->Execute($query);\n if ($objRs === false) {\n return false;\n }\n if (intval($objRs->fields['protected']) === 1) {\n // it's a protected category. check auth\n if ($objFWUser->objUser->login()) {\n $userGroups = $objFWUser->objUser->getAssociatedGroupIds();\n } else {\n return false;\n }\n\n $query = \" SELECT groupid\n FROM \".DBPREFIX.\"module_gallery_categories_access\n WHERE catid = \".$id;\n $objRs = $objDatabase->Execute($query);\n if ($objRs === false) {\n return false;\n }\n while (!$objRs->EOF) {\n if (array_search($objRs->fields['groupid'], $userGroups) !== false) {\n return true;\n }\n $objRs->MoveNext();\n }\n } else {\n return true;\n }\n return false;\n }", "public function check_access($id) {\n global $DB;\n\n try {\n $page = $DB->get_record('wiki_pages', array('id' => $id), '*', MUST_EXIST);\n if (!isset($this->wikiscache[$page->subwikiid])) {\n $sql = 'SELECT w.*\n FROM {wiki_subwikis} s\n JOIN {wiki} w ON w.id = s.wikiid\n WHERE s.id = ?';\n $this->wikiscache[$page->subwikiid] = $DB->get_record_sql($sql, array('id' => $page->subwikiid), MUST_EXIST);\n }\n $wiki = $this->wikiscache[$page->subwikiid];\n $cminfo = $this->get_cm('wiki', $wiki->id, $wiki->course);\n } catch (\\dml_missing_record_exception $ex) {\n return \\core_search\\manager::ACCESS_DELETED;\n } catch (\\dml_exception $ex) {\n return \\core_search\\manager::ACCESS_DENIED;\n }\n\n // Recheck uservisible although it should have already been checked in core_search.\n if ($cminfo->uservisible === false) {\n return \\core_search\\manager::ACCESS_DENIED;\n }\n\n $context = \\context_module::instance($cminfo->id);\n\n if (!has_capability('mod/wiki:viewpage', $context)) {\n return \\core_search\\manager::ACCESS_DENIED;\n }\n\n return \\core_search\\manager::ACCESS_GRANTED;\n }", "private function getPermissionById($id)\n {\n return $this->permissions()->getRelated()->where('id', $id)->first();\n }", "function getCategoryPermsClause($perms) {\n\t\tglobal $TYPO3_CONF_VARS;\n\t\tif (is_array($GLOBALS['BE_USER']->user))\t{\n\t\t\tif ($GLOBALS['BE_USER']->isAdmin())\t{\n\t\t\t\treturn ' 1=1';\n\t\t\t}\n\t\t\n\t\t\t$perms = intval($perms);\t// Make sure it's integer.\n\t\t\t$str= ' ('.\n\t\t\t\t'(perms_everybody & '.$perms.' = '.$perms.')'.\t// Everybody\n\t\t\t\t'OR(perms_userid = '.$GLOBALS['BE_USER']->user['uid'].' AND perms_user & '.$perms.' = '.$perms.')';\t// User\n\t\t\tif ($GLOBALS['BE_USER']->groupList)\t{\n\t\t\t\t$str.= 'OR(perms_groupid in ('.$GLOBALS['BE_USER']->groupList.') AND perms_group & '.$perms.' = '.$perms.')';\t// Group (if any is set)\n\t\t\t}\n\t\t\t$str.=')';\n\n\t\t\treturn $str;\n\t\t} else {\n\t\t\treturn ' 1=0';\n\t\t}\n\t}", "private function fetchById( $id ) {\n $this->id = $id;\n $namestatement = DBSlave::getInstance()\n ->prepare( 'SELECT permission_name\n FROM permissions\n WHERE permission_id = :permid' );\n $namestatement->execute( array( ':permid' => $id ) );\n if ( $namerow = $namestatement->fetch() ) {\n $this->name = $namerow['permission_name'];\n return true;\n }\n unset( $this->id, $this->name );\n return false;\n }", "function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = \"\")\n\t{\n\t\tglobal $ilUser, $lng, $rbacsystem, $ilAccess;\n\n\t\tif ($a_user_id == \"\")\n\t\t{\n\t\t\t$a_user_id = $ilUser->getId();\n\t\t}\n\n\t\tswitch ($a_cmd)\n\t\t{\n\t\t\tcase \"view\":\n\n\t\t\t\tif(!ilObjContentObjectAccess::_lookupOnline($a_obj_id)\n\t\t\t\t\t&& !$rbacsystem->checkAccessOfUser($a_user_id,'write',$a_ref_id))\n\t\t\t\t{\n\t\t\t\t\t$ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt(\"offline\"));\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"continue\":\n\t\t\t\n\t\t\t\t// no continue command for anonymous user\n\t\t\t\tif ($ilUser->getId() == ANONYMOUS_USER_ID)\n\t\t\t\t{\n\t\t\t\t\t$ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt(\"lm_no_continue_for_anonym\"));\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif(!ilObjContentObjectAccess::_lookupOnline($a_obj_id)\n\t\t\t\t\t&& !$rbacsystem->checkAccessOfUser($a_user_id,'write',$a_ref_id))\n\t\t\t\t{\n\t\t\t\t\t$ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt(\"offline\"));\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (ilObjContentObjectAccess::_getLastAccessedPage($a_ref_id,$a_user_id) <= 0)\n\t\t\t\t{\n\t\t\t\t\t$ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt(\"not_accessed_yet\"));\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t// for permission query feature\n\t\t\tcase \"info\":\n\t\t\t\tif(!ilObjContentObjectAccess::_lookupOnline($a_obj_id))\n\t\t\t\t{\n\t\t\t\t\t$ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt(\"offline\"));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt(\"online\"));\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\tswitch ($a_permission)\n\t\t{\n\t\t\tcase \"read\":\n\t\t\tcase \"visible\":\n\t\t\t\tif (!ilObjContentObjectAccess::_lookupOnline($a_obj_id) &&\n\t\t\t\t\t(!$rbacsystem->checkAccessOfUser($a_user_id,'write', $a_ref_id)))\n\t\t\t\t{\n\t\t\t\t\t$ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt(\"offline\"));\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\n\t\treturn true;\n\t}", "function file_access($id,$check,$rel_path,$user=null)\n\t{\n\t\tunset($rel_path);\t// not used, but required by function signature\n\n\t\treturn $this->check_perms($check,$id,0,'ts',null,$user);\n\t}", "public function checkPermission()\n\t{\n\t\tif ($this->User->isAdmin)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$session = $this->Session->getData();\n\n\t\t// Set the default page user and group\n\t\t$GLOBALS['TL_DCA']['tl_page']['fields']['cuser']['default'] = intval(Config::get('defaultUser') ?: $this->User->id);\n\t\t$GLOBALS['TL_DCA']['tl_page']['fields']['cgroup']['default'] = intval(Config::get('defaultGroup') ?: $this->User->groups[0]);\n\n\t\t// Restrict the page tree\n\t\t$GLOBALS['TL_DCA']['tl_page']['list']['sorting']['root'] = $this->User->pagemounts;\n\n\t\t// Set allowed page IDs (edit multiple)\n\t\tif (is_array($session['CURRENT']['IDS']))\n\t\t{\n\t\t\t$edit_all = array();\n\t\t\t$delete_all = array();\n\n\t\t\tforeach ($session['CURRENT']['IDS'] as $id)\n\t\t\t{\n\t\t\t\t$objPage = $this->Database->prepare(\"SELECT id, pid, type, includeChmod, chmod, cuser, cgroup FROM tl_page WHERE id=?\")\n\t\t\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t\t\t ->execute($id);\n\n\t\t\t\tif ($objPage->numRows < 1 || !$this->User->hasAccess($objPage->type, 'alpty'))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$row = $objPage->row();\n\n\t\t\t\tif ($this->User->isAllowed(BackendUser::CAN_EDIT_PAGE, $row))\n\t\t\t\t{\n\t\t\t\t\t$edit_all[] = $id;\n\t\t\t\t}\n\n\t\t\t\t// Mounted pages cannot be deleted\n\t\t\t\tif ($this->User->isAllowed(BackendUser::CAN_DELETE_PAGE, $row) && !$this->User->hasAccess($id, 'pagemounts'))\n\t\t\t\t{\n\t\t\t\t\t$delete_all[] = $id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$session['CURRENT']['IDS'] = (Input::get('act') == 'deleteAll') ? $delete_all : $edit_all;\n\t\t}\n\n\t\t// Set allowed clipboard IDs\n\t\tif (isset($session['CLIPBOARD']['tl_page']) && is_array($session['CLIPBOARD']['tl_page']['id']))\n\t\t{\n\t\t\t$clipboard = array();\n\n\t\t\tforeach ($session['CLIPBOARD']['tl_page']['id'] as $id)\n\t\t\t{\n\t\t\t\t$objPage = $this->Database->prepare(\"SELECT id, pid, type, includeChmod, chmod, cuser, cgroup FROM tl_page WHERE id=?\")\n\t\t\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t\t\t ->execute($id);\n\n\t\t\t\tif ($objPage->numRows < 1 || !$this->User->hasAccess($objPage->type, 'alpty'))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ($this->User->isAllowed(BackendUser::CAN_EDIT_PAGE_HIERARCHY, $objPage->row()))\n\t\t\t\t{\n\t\t\t\t\t$clipboard[] = $id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$session['CLIPBOARD']['tl_page']['id'] = $clipboard;\n\t\t}\n\n\t\t// Overwrite session\n\t\t$this->Session->setData($session);\n\n\t\t// Check permissions to save and create new\n\t\tif (Input::get('act') == 'edit')\n\t\t{\n\t\t\t$objPage = $this->Database->prepare(\"SELECT * FROM tl_page WHERE id=(SELECT pid FROM tl_page WHERE id=?)\")\n\t\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t\t ->execute(Input::get('id'));\n\n\t\t\tif ($objPage->numRows && !$this->User->isAllowed(BackendUser::CAN_EDIT_PAGE_HIERARCHY, $objPage->row()))\n\t\t\t{\n\t\t\t\t$GLOBALS['TL_DCA']['tl_page']['config']['closed'] = true;\n\t\t\t}\n\t\t}\n\n\t\t// Check current action\n\t\tif (Input::get('act') && Input::get('act') != 'paste')\n\t\t{\n\t\t\t$permission = 0;\n\t\t\t$cid = CURRENT_ID ?: Input::get('id');\n\t\t\t$ids = ($cid != '') ? array($cid) : array();\n\n\t\t\t// Set permission\n\t\t\tswitch (Input::get('act'))\n\t\t\t{\n\t\t\t\tcase 'edit':\n\t\t\t\tcase 'toggle':\n\t\t\t\t\t$permission = BackendUser::CAN_EDIT_PAGE;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'move':\n\t\t\t\t\t$permission = BackendUser::CAN_EDIT_PAGE_HIERARCHY;\n\t\t\t\t\t$ids[] = Input::get('sid');\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'create':\n\t\t\t\tcase 'copy':\n\t\t\t\tcase 'copyAll':\n\t\t\t\tcase 'cut':\n\t\t\t\tcase 'cutAll':\n\t\t\t\t\t$permission = BackendUser::CAN_EDIT_PAGE_HIERARCHY;\n\n\t\t\t\t\t// Check the parent page in \"paste into\" mode\n\t\t\t\t\tif (Input::get('mode') == 2)\n\t\t\t\t\t{\n\t\t\t\t\t\t$ids[] = Input::get('pid');\n\t\t\t\t\t}\n\t\t\t\t\t// Check the parent's parent page in \"paste after\" mode\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$objPage = $this->Database->prepare(\"SELECT pid FROM tl_page WHERE id=?\")\n\t\t\t\t\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t\t\t\t\t ->execute(Input::get('pid'));\n\n\t\t\t\t\t\t$ids[] = $objPage->pid;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'delete':\n\t\t\t\t\t$permission = BackendUser::CAN_DELETE_PAGE;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Check user permissions\n\t\t\tif (Input::get('act') != 'show')\n\t\t\t{\n\t\t\t\t$pagemounts = array();\n\n\t\t\t\t// Get all allowed pages for the current user\n\t\t\t\tforeach ($this->User->pagemounts as $root)\n\t\t\t\t{\n\t\t\t\t\tif (Input::get('act') != 'delete')\n\t\t\t\t\t{\n\t\t\t\t\t\t$pagemounts[] = $root;\n\t\t\t\t\t}\n\n\t\t\t\t\t$pagemounts = array_merge($pagemounts, $this->Database->getChildRecords($root, 'tl_page'));\n\t\t\t\t}\n\n\t\t\t\t$error = false;\n\t\t\t\t$pagemounts = array_unique($pagemounts);\n\n\t\t\t\t// Do not allow to paste after pages on the root level (pagemounts)\n\t\t\t\tif ((Input::get('act') == 'cut' || Input::get('act') == 'cutAll') && Input::get('mode') == 1 && in_array(Input::get('pid'), $this->eliminateNestedPages($this->User->pagemounts)))\n\t\t\t\t{\n\t\t\t\t\t$this->log('Not enough permissions to paste page ID '. Input::get('id') .' after mounted page ID '. Input::get('pid') .' (root level)', __METHOD__, TL_ERROR);\n\t\t\t\t\t$this->redirect('contao/main.php?act=error');\n\t\t\t\t}\n\n\t\t\t\t// Check each page\n\t\t\t\tforeach ($ids as $i=>$id)\n\t\t\t\t{\n\t\t\t\t\tif (!in_array($id, $pagemounts))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->log('Page ID '. $id .' was not mounted', __METHOD__, TL_ERROR);\n\n\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Get the page object\n\t\t\t\t\t$objPage = $this->Database->prepare(\"SELECT * FROM tl_page WHERE id=?\")\n\t\t\t\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t\t\t\t ->execute($id);\n\n\t\t\t\t\tif ($objPage->numRows < 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check whether the current user is allowed to access the current page\n\t\t\t\t\tif (!$this->User->isAllowed($permission, $objPage->row()))\n\t\t\t\t\t{\n\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check the type of the first page (not the following parent pages)\n\t\t\t\t\t// In \"edit multiple\" mode, $ids contains only the parent ID, therefore check $id != $_GET['pid'] (see #5620)\n\t\t\t\t\tif ($i == 0 && $id != Input::get('pid') && Input::get('act') != 'create' && !$this->User->hasAccess($objPage->type, 'alpty'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->log('Not enough permissions to '. Input::get('act') .' '. $objPage->type .' pages', __METHOD__, TL_ERROR);\n\n\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Redirect if there is an error\n\t\t\t\tif ($error)\n\t\t\t\t{\n\t\t\t\t\t$this->log('Not enough permissions to '. Input::get('act') .' page ID '. $cid .' or paste after/into page ID '. Input::get('pid'), __METHOD__, TL_ERROR);\n\t\t\t\t\t$this->redirect('contao/main.php?act=error');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function accessPermission($userTypeId, $menuId, $actionType){\n\t\t \n\t\t $sql = \"SELECT $actionType as permission\n FROM user_access as UA RIGHT JOIN \n\t\t\t\tuser_access_permission as UAP ON\n\t\t\t\tUA.user_access_id = UAP.user_access_id \n WHERE \n\t\t\t\tUA.access_level_id = \" . $userTypeId . \" AND\n\t\t\t\tUAP.menu_id = \" . $menuId . \" \n \";\n\t\t \n\t\t//echo $sql;\n\t\t//die;\n\t\t$query = $this->db->query($sql);\n\t\t$rws = $query->row_array(); \n \n\t\treturn $rws['permission'];\n\t}", "public static function byID($id)\r\n {\r\n \t$id = (int)$id;\r\n \t\r\n \tif($id < 1)\r\n \t\treturn false;\r\n \t\t\r\n \t$sql = self::getSelect() . 'WHERE S.Subcategory_ID=?';\r\n \t\r\n $params = array('i',$id);\r\n \r\n return self::queryDB(get_class(),$sql,$params,true); // SubCategory object(s) if sucessful\r\n\t}", "function ol_get_category_by_id_db( $id ) {\n\tglobal $ol_dbh;\n\n\t$stmt = $ol_dbh->prepare( 'SELECT * FROM mstore_category WHERE id = :id' );\n\t$stmt->bindParam( ':id', $id );\n\t$stmt->execute();\n\n\treturn $stmt->fetch();\n}", "public function getCategory($id);", "public static function getAccessShortCut() {\t\n\t\t$db=self::__instance();\t\n\t\t$user_id=$_SESSION['user_info']['user_id'];\n\t\t$sql=\"select a.page_id from access a inner join users b \n\t\ton b.user_group=a.group_id \n\t\twhere b.user_id=\".$user_id;\n\t\t$result=$db->query($sql)->fetchAll();\n\t\t$ans=array();\n\t\tif($result){\n\t\t\t$data=$result;\n\t\t\tfor ($i=0;$i<count($data);$i++){\n\t\t\t\t$id=$data[$i];\n\t\t\t\t$where=array('id'=>$id);\n\t\t\t\t$page=$db->select('pages',array('url','page_name','icon'),$where);\n\t\t\t\tif($page){\n\t\t\t\t\t$ans[]=array();\n\t\t\t\t\t$ans[$i]['url']=$page[0]['url'];\n\t\t\t\t\t$ans[$i]['page_name']=$page[0]['page_name'];\n\t\t\t\t\t$ans[$i]['icon']=$page[0]['icon'];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $ans;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public static function find_by_id($id=0) {\n $result_array = static::find_by_sql(\"SELECT * FROM category WHERE id={$id} LIMIT 1\");\n return !empty($result_array) ? array_shift($result_array) : false;\n }", "function get_category($id)\n{\n global $myquery;\n return $myquery->get_category($id);\n}", "function may_view_content_behind($member_id, $content_type, $content_id, $type_has = 'content_type')\n{\n $permission_type_code = convert_composr_type_codes($type_has, $content_type, 'permissions_type_code');\n\n $module = convert_composr_type_codes($type_has, $content_type, 'module');\n if ($module == '') {\n $module = $content_id;\n }\n\n $category_id = mixed();\n $content_type = convert_composr_type_codes($type_has, $content_type, 'content_type');\n if ($content_type != '') {\n $content_type_ob = get_content_object($content_type);\n $info = $content_type_ob->info();\n if (isset($info['category_field'])) {\n list(, , , $content) = content_get_details($content_type, $content_id);\n if (!is_null($content)) {\n $category_field = $info['category_field'];\n if (is_array($category_field)) {\n $category_field = array_pop($category_field);\n $category_id = is_integer($content[$category_field]) ? strval($content[$category_field]) : $content[$category_field];\n if ($content_type == 'catalogue_entry') {\n $catalogue_name = $GLOBALS['SITE_DB']->query_select_value('catalogue_categories', 'c_name', array('id' => $category_id));\n if (!has_category_access($member_id, 'catalogues_catalogue', $catalogue_name)) {\n return false;\n }\n }\n } else {\n $category_id = is_integer($content[$category_field]) ? strval($content[$category_field]) : $content[$category_field];\n }\n }\n }\n }\n\n // FUDGE: Extra check for private topics\n $topic_id = null;\n if (($content_type == 'post') && (get_forum_type() == 'cns')) {\n $post_rows = $GLOBALS['FORUM_DB']->query_select('f_posts', array('p_topic_id', 'p_intended_solely_for', 'p_poster'), array('id' => intval($content_id)), '', 1);\n if (!array_key_exists(0, $post_rows)) {\n return false;\n }\n if ($post_rows[0]['p_intended_solely_for'] !== null && ($post_rows[0]['p_intended_solely_for'] != $member_id && $post_rows[0]['p_poster'] != $member_id || is_guest($member_id))) {\n return false;\n }\n $topic_id = $post_rows[0]['p_topic_id'];\n }\n if (($content_type == 'topic') && (get_forum_type() == 'cns')) {\n $topic_id = intval($content_id);\n }\n if (!is_null($topic_id)) {\n $topic_rows = $GLOBALS['FORUM_DB']->query_select('f_topics', array('t_forum_id', 't_pt_from', 't_pt_to'), array('id' => $topic_id), '', 1);\n if (!array_key_exists(0, $topic_rows)) {\n return false;\n }\n require_code('cns_topics');\n if ($topic_rows[0]['t_forum_id'] === null && ($topic_rows[0]['t_pt_from'] != $member_id && $topic_rows[0]['t_pt_to'] != $member_id && !cns_has_special_pt_access($topic_id, $member_id) || is_guest($member_id))) {\n return false;\n }\n }\n\n return ((has_actual_page_access($member_id, $module)) && (($permission_type_code == '') || (is_null($category_id)) || (has_category_access($member_id, $permission_type_code, $category_id))));\n}", "function GetProfilePermission($perm_id, $user_id)\n\t{\n\t\t$conn = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD);\n\t\t$selected = mysqli_select_db($conn, DB_NAME); \n\t\tmysqli_set_charset($conn,\"utf8\");\n\t\t$profile='P0';\n\t\n\t\t$query=\"SELECT PROFILE FROM tUsrs WHERE USR_ID='\" . $user_id . \"'\";\n\t\t$result=mysqli_query($conn, $query);\n\t\t\n\t\twhile($row=mysqli_fetch_array($result))\n\t\t{\n\t\t\t$profile='P' . $row['PROFILE'];\n\t\t}\n\t\t\n\t\tif($profile!='P0')\n\t\t{\n\t\t\t$query_p=\"SELECT \" . $profile . \" AS p FROM tProfilePermissions WHERE PERM_ID='\" . $perm_id . \"'\";\n\t\t\t$result_p=mysqli_query($conn,$query_p);\n\t\t\t\n\t\t\twhile($row_p=mysqli_fetch_array($result_p))\n\t\t\t{\n\t\t\t\t$permission=$row_p['p'];\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$permission=0;\n\t\t}\n\t\t\n\t\treturn $permission;\n\t}", "public function getById($id)\n {\n\n $sql = \"SELECT * FROM file_category WHERE id = {$id}\";\n\n return $this->query($sql);\n }", "function ismod ( $id )\n\t{\n\t\tglobal $db;\n\t\t\n\t\t$query = \"SELECT `Level_access` FROM `\" . DBPREFIX . \"users` WHERE `ID` = \" . $db->qstr ( $id );\n\t\t\n\t\tif ( $db->RecordCount ( $query ) == 1 )\n\t\t{\n\t\t\t$row = $db->getRow ( $query );\n\t\t\t\n\t\t\tif ( $row->Level_access == 2 )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function getCategory($id){\n\t\t$this->db->where('id_cat', $id);\n\t\t$query = $this->db->get('categorias');\n\t\tif($query->num_rows() > 0) return $query;\n\t\telse return NULL;\n\t}", "public function getCategory($id)\n\t{\n\t\t//$id = self::$getRequest->getQuery(\"id\",0);\n\t\t$id = (int) $id;\n\t\t$url = self::$getRequest->getQuery(\"item\",\"\");\n\t\tif ($id >0) {\n\t\t//\t\tprint \"tudy \" . $id;\n\n\t\t//\t$model = new models_Category();\n\t\t\t$detail = self::$model->getDetailById($id);\n\n\t\t//\tprint self::$model->getLastQuery();\n\t\t} elseif (!empty($url)) {\n\t\t\t//$model = new models_Category();\n\t\t\t$detail = self::$model->getPublishByUrl($url);\n\t\t} else {\n\t\t//\tprint \"{CategoryController} nebyl specifkován požadavek!\";\n\t\t\treturn false;\n\t\t}\n \n\n\t\tif ($detail) {\n \n if (strpos($detail->serial_cat_url,\"|secret|\") !== false) {\n return false;\n }\n\n\t\t\t$detail->pagetitle = !empty($detail->pagetitle) ? $detail->pagetitle : $detail->title;\n\t\t\t//$detail->pagekeywords = !empty($detail->pagekeywords) ? $detail->pagekeywords : $detail->titulek;\n\n\t\t\t// RP - lepší je nechat pagedescription prázdné\n\t\t\t//$detail->pagedescription = !empty($detail->pagedescription) ? $detail->pagedescription : $detail->description;\n\t\t\treturn $detail;\n\t\t}\n\n\t}" ]
[ "0.57030624", "0.5544567", "0.5395795", "0.53248906", "0.5309174", "0.52563345", "0.5221641", "0.5195489", "0.5144474", "0.5137231", "0.5023168", "0.50086343", "0.5003859", "0.4996507", "0.49938205", "0.49515775", "0.49343362", "0.49304295", "0.48685056", "0.48467588", "0.48259258", "0.48161584", "0.4774743", "0.47637215", "0.47353813", "0.4718376", "0.4717666", "0.46969652", "0.46960744", "0.46951374" ]
0.7823972
0
lay ra post cu hon (time not null) va moi hon (time null) theo id id: id post hien tai typeId: id type main / related cua post hien tai. ids: danh sach id da lay ra (tranh trung lap)
private function getPostTypeQuery($id, $ids, $typeId, $time = null) { $data = DB::table('posts') ->join('post_type_relations', 'posts.id', '=', 'post_type_relations.post_id') ->select('posts.id', 'posts.name', 'posts.slug', 'posts.image', 'posts.summary', 'posts.created_at') ->where('post_type_relations.type_id', $typeId) ->where('posts.status', ACTIVE) ->where('posts.start_date', '<=', date('Y-m-d H:i:s')); if($time == null) { $data = $data->where('posts.id', '>', $id); } else { $data = $data->where('posts.id', '<', $id); } $data = $data->whereNotIn('post_type_relations.post_id', $ids) ->orderBy('posts.id', 'desc') ->take(PAGINATE_RELATED); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function general_post_data($type, $id = null){\r\r\n\t\t// 1 Insert, 2 Update, 3 Delete / Non Aktif\r\r\n\t\t$arrDate = explode('/', $this->input->post('penerimaan_barang_tanggal', TRUE));\r\r\n\t\t$arrDate2 = explode('/', $this->input->post('penerimaan_barang_tanggal_terima', TRUE));\r\r\n\t\t$where['data'][] = array(\r\r\n\t\t\t'column' => 'penerimaan_barang_id',\r\r\n\t\t\t'param'\t => $id\r\r\n\t\t);\r\r\n\t\t$queryRevised = $this->mod->select('penerimaan_barang_status, penerimaan_barang_revised', $this->tbl, NULL, $where);\r\r\n\t\tif ($queryRevised) {\r\r\n\t\t\t$revised = $queryRevised->row_array();\r\r\n\t\t\t$rev = $revised['penerimaan_barang_revised'] + 1;\r\r\n\t\t\t$status = $revised['penerimaan_barang_status'];\r\r\n\t\t}\r\r\n\t\tif ($type == 1) {\r\r\n\t\t\tif($this->input->post('penerimaan_barang_jenis', TRUE) == 0)\r\r\n\t\t\t{\r\r\n\t\t\t\t$penerimaan_barang_nomor = $this->get_kode_transaksi($arrDate[1]);\r\r\n\t\t\t}\r\r\n\t\t\telse if($this->input->post('penerimaan_barang_jenis', TRUE) == 1)\r\r\n\t\t\t{\r\r\n\t\t\t\t$penerimaan_barang_nomor = $this->get_kode_transaksi2($arrDate[1]);\r\r\n\t\t\t}\r\r\n\t\t\t$data = array(\r\r\n\t\t\t\t'm_cabang_id' \t\t\t\t\t\t\t=> $this->session->userdata('cabang_id'),\r\r\n\t\t\t\t'penerimaan_barang_nomor' \t\t\t\t=> $penerimaan_barang_nomor,\r\r\n\t\t\t\t'penerimaan_barang_tanggal'\t\t\t\t=> $arrDate[2].\"-\".$arrDate[1].\"-\".$arrDate[0],\r\r\n\t\t\t\t'penerimaan_barang_tanggal_terima'\t\t=> $arrDate2[2].\"-\".$arrDate2[1].\"-\".$arrDate2[0],\r\r\n\t\t\t\t'penerimaan_barang_sj' \t\t\t\t\t=> $this->input->post('penerimaan_barang_sj', TRUE),\r\r\n\t\t\t\t't_order_id'\t\t\t\t\t\t\t=> $this->input->post('t_order_id', TRUE),\r\r\n\t\t\t\t'penerimaan_barang_pemeriksa' \t\t\t=> $this->input->post('penerimaan_barang_pemeriksa', TRUE),\r\r\n\t\t\t\t'penerimaan_barang_penyetuju'\t\t\t=> $this->input->post('penerimaan_barang_penyetuju', TRUE),\r\r\n\t\t\t\t'penerimaan_barang_jenis'\t\t\t\t=> $this->input->post('penerimaan_barang_jenis', TRUE),\r\r\n\t\t\t\t'm_gudang_id'\t\t\t\t\t\t\t=> $this->input->post('m_gudang_id', TRUE),\r\r\n\t\t\t\t'penerimaan_barang_catatan'\t\t\t\t=> $this->input->post('penerimaan_barang_catatan', TRUE),\r\r\n\t\t\t\t'penerimaan_barang_status' \t\t\t\t=> 1,\r\r\n\t\t\t\t'penerimaan_barang_status_date'\t\t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'penerimaan_barang_created_date'\t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'penerimaan_barang_update_date'\t\t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'penerimaan_barang_created_by'\t\t\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t'penerimaan_barang_revised' \t\t\t=> 0,\r\r\n\t\t\t);\r\r\n\t\t} else if ($type == 2) {\r\r\n\t\t\t$data = array(\r\r\n\t\t\t\t'penerimaan_barang_status' \t\t=> 3,\r\r\n\t\t\t\t'penerimaan_barang_subtotal'\t=> $this->input->post('penerimaan_barang_subtotal', TRUE),\r\r\n\t\t\t\t'penerimaan_barang_ppn' \t\t=> $this->input->post('penerimaan_barang_ppn', TRUE),\r\r\n\t\t\t\t'penerimaan_barang_total' \t\t=> $this->input->post('penerimaan_barang_total', TRUE),\r\r\n\t\t\t\t'penerimaan_barang_update_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'penerimaan_barang_update_by'\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t'penerimaan_barang_revised' \t=> $rev,\r\r\n\t\t\t);\r\r\n\t\t} else if ($type == 3) {\r\r\n\t\t\t$data = array(\r\r\n\t\t\t\t'penerimaan_barang_status'\t\t=> 2,\r\r\n\t\t\t\t'penerimaan_barang_status_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'penerimaan_barang_update_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'penerimaan_barang_update_by'\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t'penerimaan_barang_revised' \t=> $rev,\r\r\n\t\t\t);\r\r\n\t\t}\r\r\n\r\r\n\t\treturn $data;\r\r\n\t}", "private function getPostRelated($id, $ids, $typeId, $asuna = null)\n {\n //lay danh sach posts\n if($asuna == null) {\n //post moi hon\n $post1Query = $this->getPostTypeQuery($id, $ids, $typeId);\n $post1 = $post1Query->get();\n //post cu hon\n $post2Query = $this->getPostTypeQuery($id, $ids, $typeId, 1);\n $post2 = $post2Query->get();\n $posts = array_merge($post1, $post2);\n return $posts;\n }\n //lay danh sach id posts\n else {\n //post moi hon\n $post1Query = $this->getPostTypeQuery($id, $ids, $typeId);\n $post1 = $post1Query->pluck('id');\n //post cu hon\n $post2Query = $this->getPostTypeQuery($id, $ids, $typeId, 1);\n $post2 = $post2Query->pluck('id');\n $posts = array_merge($post1, $post2);\n return $posts;\n }\n }", "function get_post($id=0){\r\n if(!$id AND !$id=segment(2)){ //ak nemam ziadne id a zaroven sa nam nepodari zistit id z druheho segmetnu\r\n return false;\r\n }\r\n\r\n global $database;\r\n\r\n $dotaz=$database->prepare(\"SELECT vysledky.vysledok_1kolo, vysledky.vysledok_semi, vysledky.vysledok_finale FROM vysledky JOIN turnaje ON vysledky.turnaje_id=turnaje.turnaje_id WHERE turnaje.turnaje_id= ?\");\r\n\r\n $dotaz->execute([$id]);\r\n\r\n $data=$dotaz->fetchAll(PDO::FETCH_ASSOC);\r\n return $data;\r\n }", "function general_post_data($type, $id = null){\r\r\n\t\t// 1 Insert, 2 Update, 3 Delete / Non Aktif\r\r\n\t\t$arrDate = explode('/', $this->input->post('keluar_barang_tanggal', TRUE));\r\r\n\t\t$where['data'][] = array(\r\r\n\t\t\t'column' => 'keluar_barang_id',\r\r\n\t\t\t'param'\t => $id\r\r\n\t\t);\r\r\n\t\t$queryRevised = $this->mod->select('keluar_barang_status, keluar_barang_revised', $this->tbl, NULL, $where);\r\r\n\t\tif ($queryRevised) {\r\r\n\t\t\t$revised = $queryRevised->row_array();\r\r\n\t\t\t$rev = $revised['keluar_barang_revised'] + 1;\r\r\n\t\t\t$status = $revised['keluar_barang_status'];\r\r\n\t\t}\r\r\n\t\tif ($type == 1) {\r\r\n\t\t\t$keluar_barang_nomor = $this->get_kode_transaksi();\r\r\n\t\t\t$data = array(\r\r\n\t\t\t\t'm_cabang_id' \t\t\t\t\t=> $this->session->userdata('cabang_id'),\r\r\n\t\t\t\t'keluar_barang_pembuat'\t\t\t=> $this->session->userdata('karyawan_id'),\r\r\n\t\t\t\t'keluar_barang_nomor' \t\t\t=> $keluar_barang_nomor,\r\r\n\t\t\t\t'keluar_barang_tanggal'\t\t\t=> $arrDate[2].\"-\".$arrDate[1].\"-\".$arrDate[0],\r\r\n\t\t\t\t'keluar_barang_jenis' \t\t\t=> $this->input->post('keluar_barang_jenis', TRUE),\r\r\n\t\t\t\t'm_departemen_id' \t\t\t\t=> $this->input->post('m_departemen_id', TRUE),\r\r\n\t\t\t\t'm_gudang_id_permintaan' \t\t=> $this->input->post('m_gudang_id_permintaan', TRUE),\r\r\n\t\t\t\t'm_gudang_id_tujuan'\t\t\t=> $this->input->post('m_gudang_id_tujuan', TRUE),\r\r\n\t\t\t\t'keluar_barang_status' \t\t\t=> 1,\r\r\n\t\t\t\t'keluar_barang_status_date'\t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'keluar_barang_created_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'keluar_barang_update_date'\t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'keluar_barang_created_by'\t\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t'keluar_barang_revised' \t\t=> 0,\r\r\n\t\t\t);\r\r\n\t\t} else if ($type == 2) {\r\r\n\t\t\tif ($status == $this->input->post('keluar_barang_status', TRUE)) {\r\r\n\t\t\t\tif ($this->input->post('m_karyawan_id_penyerah', TRUE)) {\r\r\n\t\t\t\t\t$data = array(\r\r\n\t\t\t\t\t\t'keluar_barang_penyerah' \t\t=> $this->input->post('m_karyawan_id_penyerah', TRUE),\r\r\n\t\t\t\t\t\t'keluar_barang_update_date'\t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t\t'keluar_barang_update_by'\t\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t\t\t'keluar_barang_revised' \t\t=> $rev,\r\r\n\t\t\t\t\t);\r\r\n\t\t\t\t} else if ($this->input->post('m_karyawan_id_penerima', TRUE)) {\r\r\n\t\t\t\t\t$data = array(\r\r\n\t\t\t\t\t\t'keluar_barang_penerima' \t\t=> $this->input->post('m_karyawan_id_penerima', TRUE),\r\r\n\t\t\t\t\t\t'keluar_barang_update_date'\t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t\t'keluar_barang_update_by'\t\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t\t\t'keluar_barang_revised' \t\t=> $rev,\r\r\n\t\t\t\t\t);\r\r\n\t\t\t\t} else {\r\r\n\t\t\t\t\t$data = array(\r\r\n\t\t\t\t\t\t'keluar_barang_update_date'\t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t\t'keluar_barang_update_by'\t\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t\t\t'keluar_barang_revised' \t\t=> $rev,\r\r\n\t\t\t\t\t);\t\r\r\n\t\t\t\t}\r\r\n\t\t\t} else {\r\r\n\t\t\t\tif ($this->input->post('m_karyawan_id_penyerah', TRUE)) {\r\r\n\t\t\t\t\t$data = array(\r\r\n\t\t\t\t\t\t'keluar_barang_penyerah' \t\t=> $this->input->post('m_karyawan_id_penyerah', TRUE),\r\r\n\t\t\t\t\t\t'keluar_barang_status' \t\t\t=> $this->input->post('keluar_barang_status', TRUE),\r\r\n\t\t\t\t\t\t'keluar_barang_update_date'\t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t\t'keluar_barang_update_by'\t\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t\t\t'keluar_barang_revised' \t\t=> $rev,\r\r\n\t\t\t\t\t);\r\r\n\t\t\t\t} else if ($this->input->post('m_karyawan_id_penerima', TRUE)) {\r\r\n\t\t\t\t\t$data = array(\r\r\n\t\t\t\t\t\t'keluar_barang_status' \t\t\t=> $this->input->post('keluar_barang_status', TRUE),\r\r\n\t\t\t\t\t\t'keluar_barang_penerima' \t\t=> $this->input->post('m_karyawan_id_penerima', TRUE),\r\r\n\t\t\t\t\t\t'keluar_barang_update_date'\t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t\t'keluar_barang_update_by'\t\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t\t\t'keluar_barang_revised' \t\t=> $rev,\r\r\n\t\t\t\t\t);\r\r\n\t\t\t\t} else {\r\r\n\t\t\t\t\t$data = array(\r\r\n\t\t\t\t\t\t'keluar_barang_status' \t\t\t=> $this->input->post('keluar_barang_status', TRUE),\r\r\n\t\t\t\t\t\t'keluar_barang_status_date'\t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t\t'keluar_barang_update_date'\t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t\t'keluar_barang_update_by'\t\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t\t\t'keluar_barang_revised' \t\t=> $rev,\r\r\n\t\t\t\t\t);\t\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\t\t} else if ($type == 3) {\r\r\n\t\t\t$data = array(\r\r\n\t\t\t\t'keluar_barang_status'\t\t=> 2,\r\r\n\t\t\t\t'keluar_barang_status_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'keluar_barang_update_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'keluar_barang_update_by'\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t'keluar_barang_revised'\t\t=> $rev,\r\r\n\t\t\t);\r\r\n\t\t} \r\r\n\r\r\n\t\treturn $data;\r\r\n\t}", "function general_post_data2($type, $idHdr, $seq, $id = null){\r\r\n\t\t$where['data'][] = array(\r\r\n\t\t\t'column' => 'penerimaan_barangdet_id',\r\r\n\t\t\t'param'\t => $id\r\r\n\t\t);\r\r\n\t\t$queryRevised = $this->mod->select('penerimaan_barangdet_revised', 't_penerimaan_barangdet', NULL, $where);\r\r\n\t\tif ($queryRevised) {\r\r\n\t\t\t$revised = $queryRevised->row_array();\r\r\n\t\t\t$rev = $revised['penerimaan_barangdet_revised'] + 1;\r\r\n\t\t}\r\r\n\t\tif ($type == 1) {\r\r\n\t\t\t$data = array(\r\r\n\t\t\t\t't_penerimaan_barang_id' \t\t\t=> $idHdr,\r\r\n\t\t\t\t'm_barang_id' \t\t\t\t\t\t=> $this->input->post('m_barang_id', TRUE)[$seq],\r\r\n\t\t\t\t'penerimaan_barang_no_seri'\t\t\t=> '',\r\r\n\t\t\t\t'penerimaan_barangdet_qty_no_seri'\t\t\t=> '',\r\r\n\t\t\t\t'penerimaan_barangdet_qty' \t\t\t=> $this->input->post('penerimaan_barangdet_qty', TRUE)[$seq],\r\r\n\t\t\t\t'penerimaan_barangdet_status'\t\t=> 1,\r\r\n\t\t\t\t'penerimaan_barangdet_status_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'penerimaan_barangdet_created_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'penerimaan_barangdet_created_by'\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t'penerimaan_barangdet_update_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'penerimaan_barangdet_revised' \t\t=> 0,\r\r\n\t\t\t);\r\r\n\t\t} else if ($type == 2) {\r\r\n\t\t\tif ($this->input->post('penerimaan_barangdet_verifikasi', TRUE)[$seq]) {\r\r\n\t\t\t\t$verifikasi = 1;\r\r\n\t\t\t} else {\r\r\n\t\t\t\t$verifikasi = 0;\r\r\n\t\t\t}\r\r\n\t\t\t$data = array(\r\r\n\t\t\t\t't_penerimaan_barang_id' \t\t\t=> $idHdr,\r\r\n\t\t\t\t'm_barang_id' \t\t\t\t\t\t=> $this->input->post('m_barang_id', TRUE)[$seq],\r\r\n\t\t\t\t'penerimaan_barangdet_verifikasi'\t=> $verifikasi,\r\r\n\t\t\t\t'penerimaan_barangdet_harga_satuan' => $this->input->post('penerimaan_barangdet_harga_satuan', TRUE)[$seq],\r\r\n\t\t\t\t'penerimaan_barangdet_potongan' \t=> $this->input->post('penerimaan_barangdet_potongan', TRUE)[$seq],\r\r\n\t\t\t\t'penerimaan_barangdet_total'\t\t=> $this->input->post('penerimaan_barangdet_total', TRUE)[$seq],\r\r\n\t\t\t\t'penerimaan_barangdet_keterangan'\t=> $this->input->post('penerimaan_barangdet_keterangan', TRUE)[$seq],\r\r\n\t\t\t\t'penerimaan_barangdet_update_by'\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t'penerimaan_barangdet_update_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'penerimaan_barangdet_revised' \t\t=> $rev,\r\r\n\t\t\t);\r\r\n\t\t}\r\r\n\r\r\n\t\treturn $data;\r\r\n\t}", "public function getAnalisuoByType($type, $id)\n {\n // berdasarkan idAnalisuo\n if ($type == 'id_analisuo') {\n $this->db->select('tb_analis_soaluo.*, tb_soal.*, tb_dist_jwbpg.*')\n ->from('tb_analis_soaluo')\n ->where(['id_analisuo' => $id])\n ->join('tb_soal.id_soal = tb_analis_soaluo.id_soal, tb_analis_soaluo.id_uraian = tb_dist_jwbpg.id_uraian');\n return $this->db->get()->row_array();\n }\n\n // berdasarkan id_uraian\n if ($type == 'id_uraian') {\n $this->db->select('tb_analis_soaluo.*, tb_soal.*, tb_dist_jwbpg.*')\n ->from('tb_analis_soaluo')\n ->where(['id_uraian' => $id])\n ->join('tb_soal.id_soal = tb_analis_soaluo.id_soal, tb_analis_soaluo.id_uraian = tb_dist_jwbpg.id_uraian');\n return $this->db->get()->row_array();\n }\n // berdasarkan id_soal\n if ($type == 'id_soal') {\n $this->db->select('tb_analis_soaluo.*, tb_soal.*, tb_dist_jwbpg.*')\n ->from('tb_analis_soaluo')\n ->where(['id_soal' => $id])\n ->join('tb_soal.id_soal = tb_analis_soaluo.id_soal, tb_analis_soaluo.id_uraian = tb_dist_jwbpg.id_uraian');\n return $this->db->get()->row_array();\n }\n }", "public function recruiter_post($id){ //echo \"falguni\"; die();\n $this->data['userid'] = $userid = $this->session->userdata('aileenuser');\n\n \n\n $this->data['recdata'] = $this->common->select_data_by_id('recruiter','user_id', $id, $data = '*', $join_str = array());\n\n $contition_array = array('post_id' => $id , 'is_delete' => 0);\n $this->data['postdata'] = $this->common->select_data_by_condition('rec_post', $contition_array, $data = '*', $sortby = 'post_id', $orderby = 'desc', $limit = '', $offset = '', $join_str = array(), $groupby = '');\n\n \n $this->load->view('notification/rec_post' , $this->data); \n }", "public function getId_poste($id_poste=null)\n {\n if ($id_poste != null && is_array($this->poste) && count($this->poste)!=0) {\n $table_name = strtolower(get_class($this));\n $query = \"SELECT * FROM $table_name WHERE id_poste = ?\";\n $req = Manager::bdd()->prepare($query);\n $req->execute([$id_poste]);\n $data = \"\";\n if ($data = $req->fetchAll(PDO::FETCH_ASSOC)) {\n$d=$data[0];\n$this->setId_poste($d['id_poste']);\n$this->setBureau($d['bureau']);\n$this->setMembre($d['membre']);\n$this->setLibelle($d['libelle']);\n$this->poste =$data; \n return $this;\n }\n \n } else {\n return $this->id_poste;\n }\n \n }", "public function ubah_timteknis($id_tim_teknis)\n {\n $data_title['title'] = 'Ubah Tim Teknis';\n $data['admin'] = $this->db->get_where('admin', ['id_admin' =>\n $this->session->userdata('id_admin')])->row_array();\n $data['total_notif'] = $this->m_admin->jml_notif()->result();\n\n $data_detail['detail_timteknis'] = $this->m_admin->get_data_timteknis($id_tim_teknis, 'tim_teknis')->result();\n\n $this->load->view('header', $data_title);\n $this->load->view('admin/sidebar');\n $this->load->view('topbar', $data);\n $this->load->view('admin/timteknis/form_ubah', $data_detail);\n $this->load->view('footer');\n }", "function general_post_data2($type, $idHdr, $seq, $id = null){\r\r\n\t\t$where['data'][] = array(\r\r\n\t\t\t'column' => 'keluar_barangdet_id',\r\r\n\t\t\t'param'\t => $id\r\r\n\t\t);\r\r\n\t\t$queryRevised = $this->mod->select('keluar_barangdet_status, keluar_barangdet_revised', 't_keluar_barangdet', NULL, $where);\r\r\n\t\tif ($queryRevised) {\r\r\n\t\t\t$revised = $queryRevised->row_array();\r\r\n\t\t\t$rev = $revised['keluar_barangdet_revised'] + 1;\r\r\n\t\t\t$status = $revised['keluar_barangdet_status'];\r\r\n\t\t}\r\r\n\t\tif ($type == 1) {\r\r\n\t\t\t$data = array(\r\r\n\t\t\t\t't_keluar_barang_id' \t\t\t=> $idHdr,\r\r\n\t\t\t\t'm_barang_id' \t\t\t\t\t=> $this->input->post('m_barang_id', TRUE)[$seq],\r\r\n\t\t\t\t'keluar_barangdet_qty' \t\t\t=> $this->input->post('keluar_barangdet_qty', TRUE)[$seq],\r\r\n\t\t\t\t'keluar_barangdet_keterangan'\t=> $this->input->post('keluar_barangdet_keterangan', TRUE)[$seq],\r\r\n\t\t\t\t'keluar_barangdet_status'\t\t=> 0,\r\r\n\t\t\t\t'keluar_barangdet_status_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'keluar_barangdet_create_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'keluar_barangdet_create_by'\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t'keluar_barangdet_update_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'keluar_barangdet_revised' \t\t=> 0,\r\r\n\t\t\t);\r\r\n\t\t} else if ($type == 2) {\r\r\n\t\t\tif ($status == $this->input->post('keluar_barangdet_status', TRUE)[$seq]) {\r\r\n\t\t\t\t$data = array(\r\r\n\t\t\t\t\t'keluar_barangdet_qty_realisasi'\t=> ($this->input->post('keluar_barangdet_qty_realisasi', TRUE)[$seq] + $this->input->post('keluar_barangdet_qty_kirim', TRUE)[$seq]),\r\r\n\t\t\t\t\t'keluar_barangdet_update_date'\t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t'keluar_barangdet_update_by'\t\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t\t'keluar_barangdet_revised' \t\t\t=> $rev,\r\r\n\t\t\t\t);\t\r\r\n\t\t\t} else {\r\r\n\t\t\t\t$data = array(\r\r\n\t\t\t\t\t'keluar_barangdet_qty_realisasi'\t=> ($this->input->post('keluar_barangdet_qty_realisasi', TRUE)[$seq] + $this->input->post('keluar_barangdet_qty_kirim', TRUE)[$seq]),\r\r\n\t\t\t\t\t'keluar_barangdet_status' \t\t\t=> $this->input->post('keluar_barangdet_status', TRUE)[$seq],\r\r\n\t\t\t\t\t'keluar_barangdet_status_date'\t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t'keluar_barangdet_update_date'\t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t'keluar_barangdet_update_by'\t\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t\t'keluar_barangdet_revised' \t\t\t=> $rev,\r\r\n\t\t\t\t);\t\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\r\r\n\t\treturn $data;\r\r\n\t}", "public function renderVypis($id = null)\n {\n $this->template->id = $id;\n switch ($id) {\n case 1: // nemovitosti cekajici na spusteni aukce\n $this->template->nemovitosti = $this->database->findAll('nemovitost')\n ->where('NOW() < datum_zacatek')->where('mod = 1')->where('is_public', 1)->order('public_date DESC')->order('id DESC');\n break;\n case 2: // nemovitosti u kterych aukce jiz probehla\n $this->template->nemovitosti = $this->database->findAll('nemovitost')\n ->where('NOW() > datum_konec')->where('mod = 1')->where('is_public', 1)->order('public_date DESC')->order('id DESC');\n break;\n case 4: // nemovitosti urcene k prodeji (bez aukce)\n $this->template->nemovitosti = $this->database->findAll('nemovitost')\n ->where('mod = 2')->where('is_public', 1)->order('public_date DESC')->order('id DESC');\n break;\n case 5: // nemovitosti u ktere se prodali (bez aukce)\n $this->template->nemovitosti = $this->database->findAll('nemovitost')\n ->where('mod = 3')->where('is_public', 1)->order('public_date DESC')->order('id DESC');\n break;\n default: // nemovitosti u kterych probiha aukce (jedna se o case 3, ale zobecnil jsem to)\n $this->template->nemovitosti = $this->database->findAll('nemovitost')\n ->where('NOW() BETWEEN datum_zacatek AND datum_konec')->where('mod = 1')->where('is_public', 1)->order('public_date DESC')->order('id DESC');\n break;\n }\n }", "public function actionThanhToan($cpt = null)\n {\n $theMttx = Mtt::find()\n ->where(['status'=>'draft', 'created_by'=>USER_ID])\n ->with([\n 'cpt',\n 'cpt.tour'=>function($q) {\n return $q->select(['id', 'code']);\n },\n 'cpt.venue'=>function($query) {\n return $query->select(['id', 'name']);\n },\n 'cpt.company'=>function($query) {\n return $query->select(['id', 'name']);\n },\n 'cpt.viaCompany'=>function($query) {\n return $query->select(['id', 'name']);\n },\n ])\n ->orderBy('created_dt')\n ->asArray()\n ->all();\n if (empty($theMttx)) {\n Yii::$app->session->setFlash('danger', 'Chưa chọn mục nào để thanh toán');\n return $this->redirect('/cpt');\n }\n\n $theMtt = new Mtt;\n $theMtt->payment_dt = date('Y-m-d');\n $theMtt->paid_in_full = 'yes';\n $theMtt->status = 'on';\n if ($theMtt->load(Yii::$app->request->post()) && $theMtt->validate()) {\n foreach ($theMttx as $mtt) {\n if ($mtt['payment_dt'] == '0000-00-00 00:00:00') {\n $mtt['payment_dt'] = $theMtt['payment_dt'];\n }\n if ($mtt['tkgn'] == '') {\n $mtt['tkgn'] = $theMtt['tkgn'];\n }\n if ($mtt['mp'] == '') {\n $mtt['mp'] = $theMtt['mp'];\n }\n if ($theMtt['amount'] != '100') {\n $mtt['amount'] = $mtt['amount'] * ($theMtt['amount'] / 100);\n }\n\n // Loai tien va ti gia bat buoc giong nhau\n if ($mtt['currency'] != $theMtt['currency']) {\n $mtt['currency'] = $theMtt['currency'];\n $mtt['xrate'] = $theMtt['xrate'];\n }\n if ($mtt['paid_in_full'] == '') {\n $mtt['paid_in_full'] = $theMtt['paid_in_full'];\n }\n if ($mtt['note'] == '') {\n $mtt['note'] = $theMtt['note'];\n }\n $sql = 'UPDATE at_mtt SET updated_by=:me, updated_dt=:now, status=\"on\", payment_dt=:dt, amount=:amt, currency=:currency, xrate=:xrate, tkgn=:tk, mp=:mp, paid_in_full=:pif WHERE status=\"draft\" AND created_by=:me AND id=:id';\n Yii::$app->db->createCommand($sql, [\n ':now'=>NOW,\n ':id'=>$mtt['id'],\n ':tk'=>$mtt['tkgn'],\n ':mp'=>$mtt['mp'],\n ':dt'=>$mtt['payment_dt'],\n ':currency'=>$mtt['currency'],\n ':pif'=>$mtt['paid_in_full'],\n ':amt'=>$mtt['amount'],\n ':xrate'=>$mtt['xrate'],\n ':me'=>USER_ID,\n ])->execute();\n if ($mtt['paid_in_full'] == 'yes') {\n $sql = 'UPDATE cpt SET c3=:c3 WHERE dvtour_id=:id LIMIT 1';\n Yii::$app->db->createCommand($sql, [\n ':c3'=>'on,'.USER_ID.','.NOW,\n ':id'=>$mtt['cpt_id'],\n ])->execute();\n } else {\n $sql = 'UPDATE cpt SET c1=:c1 WHERE dvtour_id=:id LIMIT 1';\n Yii::$app->db->createCommand($sql, [\n ':c1'=>'on,'.USER_ID.','.NOW,\n ':id'=>$mtt['cpt_id'],\n ])->execute();\n }\n }\n\n return $this->redirect('@web/cpt');\n }\n return $this->render('cpt_thanh-toan', [\n 'theMtt'=>$theMtt,\n 'theMttx'=>$theMttx,\n ]);\n }", "function ajouterMoyenHumain($id_bp_moyen_humain,$id_bp,$type_moyen,$salaire,$nombre_debut,$nombre_a1,$nombre_a2,$nombre_a3)\r\n\t{\r\n\t\t$db = Zend_Registry::get('dbAdapter');\r\n\t\t$data = array('id_bp'=>$id_bp,\"type_moyen\"=>$type_moyen,\"salaire_brut_mensuel\"=>$salaire,\"nombre_debut_activite\"=>$nombre_debut,\r\n\t\t\"nombre_annee1\"=>$nombre_a1,\"nombre_annee2\"=>$nombre_a2,\"nombre_annee3\"=>$nombre_a3);\r\n\r\n\t\t\r\n\t\tif($id_bp_moyen_humain=='')\r\n\t\t{\r\n\t\t$db->insert('egw_bp_moyen_humain',$data);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t\r\n\t\t$db->update('egw_bp_moyen_humain',$data,'id_bp_moyen_humain='.$id_bp_moyen_humain);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public function postDiemsinhvien($thongtin = array()){\n\t\t$table =\tstrtolower($this->classname);\n\t\t// kiem tra mssv va ten mon co ton tai hay chua\n\t\t$check = \"SELECT id from `$table` where mssv = ? and tenmon = ?\";\n\t\t$this->db->setQuery($check);\n\t\t$query_check =$this->db->loadRecord(array($thongtin[0],$thongtin[2]));\n\n\t\tif($query_check == null){\n\t\t\t$sql = \"INSERT INTO `$table` (mssv,diem,tenmon,diemchu) VALUES(?,?,?,?)\";\n\t\t\t$this->db->setQuery($sql);\n\t\t\t$result = $this->db->execute($thongtin);\n\t\t\treturn true;\t\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t}", "public function ubah_sandi_timteknis($id_tim_teknis)\n {\n $data_title['title'] = 'Ubah Sandi Tim Teknis';\n $data['admin'] = $this->db->get_where('admin', ['id_admin' =>\n $this->session->userdata('id_admin')])->row_array();\n $data['total_notif'] = $this->m_admin->jml_notif()->result();\n\n $data_detail['detail_timteknis'] = $this->m_admin->get_data_timteknis($id_tim_teknis, 'tim_teknis')->result();\n\n $this->load->view('header', $data_title);\n $this->load->view('admin/sidebar');\n $this->load->view('topbar', $data);\n $this->load->view('admin/timteknis/form_ubah_sandi', $data_detail);\n $this->load->view('footer');\n }", "public function detail_data_timteknis($id_tim_teknis)\n {\n $data_title['title'] = 'Detail Tim Teknis';\n $data['admin'] = $this->db->get_where('admin', ['id_admin' =>\n $this->session->userdata('id_admin')])->row_array();\n $data['total_notif'] = $this->m_admin->jml_notif()->result();\n\n $data_detail['detail_timteknis'] = $this->m_admin->get_data_timteknis($id_tim_teknis, 'tim_teknis')->result();\n\n $this->load->view('header', $data_title);\n $this->load->view('admin/sidebar');\n $this->load->view('topbar', $data);\n $this->load->view('admin/timteknis/detail', $data_detail);\n $this->load->view('footer');\n }", "public static function getTblhorasByTblProveedor($idtblcolonia,$idtbltipodeservicio,$fechapedido){\n \n date_default_timezone_set(\"America/Monterrey\");\n $activado=1;\n $fechapedidoingresada = new DateTime($fechapedido);\n $fechahoy = new DateTime(date(\"d-m-Y\"));\n $interval= $fechahoy->diff($fechapedidoingresada);\n \t\t$diasMinimos= $interval->format('%d');\n \t\t\n \t\t$diasemana= $fechapedidoingresada->format('l');\n \t\t\n \t\t$tipopedidoCompleto=3;\n $tipodeservicioCompleto=3;\n \n $timefinal = date(\"H:i:s\");\n\t $nuevotime = strtotime('+1 hour', strtotime($timefinal));\n\t\t$nuevotime = date(\"H:i:s\", $nuevotime);\n \n \n if($fechapedidoingresada == $fechahoy){ \n $tipodepedido= 1; //pedidoparahoy\n $stock=1;\n \t}else{\n \t\t$tipodepedido= 2; //pedidoparaotrodia\n \t\t$stock=0;\n \t}\n\n \t\n \t\n \tif($idtbltipodeservicio==1){ //Entrega en Pasteleria \n \t\n \t if($tipodepedido==1){ // Caso para hoy (Regresa las horas entre el horario de las pastelerias mayores a la hora actual)\n \t \n \t $consulta = \" SELECT THs.* FROM tblhora THs , tblproveedor TP \n \t\t INNER JOIN tblhrsprovtienda TTP ON TTP.tblproveedor_idtblproveedor = TP.idtblproveedor\t\n \t\t INNER JOIN tblhraabre TA ON TTP.tblhraabre_idtblhraabre = TA.idtblhraabre\n INNER JOIN tblhracierra TC ON TTP.tblhracierra_idtblhracierra = TC.idtblhracierra\n INNER JOIN tblcolonia TCL ON TP.tblcolonia_idtblcolonia = TCL.idtblcolonia \n \t\t INNER JOIN tblproducto TPR ON TPR.tblproveedor_idtblproveedor = TP.idtblproveedor \n \t\t INNER JOIN tblproductdetalle TPRD ON TPR.idtblproducto = TPRD.tblproducto_idtblproducto\n INNER JOIN tbldiaprovservicio TDP ON TDP.tblproveedor_idtblproveedor = TP.idtblproveedor\n INNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDP.tbldiasemana_idtbldiasemana\n INNER JOIN tblhora THa ON THa.idtblhora = TA.tblhora_idtblhora\n INNER JOIN tblhora THc ON THc.idtblhora = TC.tblhora_idtblhora \n WHERE THs.tblhora_hora > CAST( ? AS TIME)\n AND THs.tblhora_hora BETWEEN THa.tblhora_hora AND THc.tblhora_hora\n AND TCL.idtblcolonia = ? \n\t\t AND TP.tblproveedor_activado = ?\n\t\t AND TPR.tblproducto_activado = ? \n\t AND TPRD.tblproductdetalle_activado = ?\t\t \n\t\t AND TPRD.tblproductdetalle_stock >= ?\n\t\t AND TPRD.tblproductdetalle_diaselaboracion <= ?\n\t\t AND TDS.tbldiasemana_dia = ?\n GROUP BY THs.tblhora_hora ASC\";\n try{\n \t\t\t $resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n \t\t\t $resultado->bindParam(1,$nuevotime,PDO::PARAM_STR);\n \t\t\t $resultado->bindParam(2,$idtblcolonia,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(3,$activado,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(4,$activado,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(5,$activado,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(6,$stock,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(7,$diasMinimos,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(8,$diasemana,PDO::PARAM_STR);\n \t\t\t $resultado->execute();\n \t\t\t return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n\t\t\t } catch(PDOException $e){\n\t\t\t return false; \n \t }\n \n \t \n \t \n \t }else {// Caso para otro día (Regresa las horas entre el horario de las pastelerias)\n \t \n \t $consulta = \" SELECT THs.* FROM tblhora THs , tblproveedor TP \n\t \t\t INNER JOIN tblhrsprovtienda TTP ON TTP.tblproveedor_idtblproveedor = TP.idtblproveedor\n\t \t\t INNER JOIN tblhraabre TA ON TTP.tblhraabre_idtblhraabre = TA.idtblhraabre\n\t INNER JOIN tblhracierra TC ON TTP.tblhracierra_idtblhracierra = TC.idtblhracierra\n\t INNER JOIN tblcolonia TCL ON TP.tblcolonia_idtblcolonia = TCL.idtblcolonia \n\t \t\t INNER JOIN tblproducto TPR ON TPR.tblproveedor_idtblproveedor = TP.idtblproveedor \n\t \t\t INNER JOIN tblproductdetalle TPRD ON TPR.idtblproducto = TPRD.tblproducto_idtblproducto\n\t INNER JOIN tbldiaprovservicio TDP ON TDP.tblproveedor_idtblproveedor = TP.idtblproveedor\n\t INNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDP.tbldiasemana_idtbldiasemana\n \t INNER JOIN tblhora THa ON THa.idtblhora = TA.tblhora_idtblhora\n \t INNER JOIN tblhora THc ON THc.idtblhora = TC.tblhora_idtblhora \n\t WHERE TCL.idtblcolonia = ? \n\t\t\t AND TP.tblproveedor_activado = ?\n\t\t\t AND TPR.tblproducto_activado = ? \n\t\t\t AND TPRD.tblproductdetalle_activado = ?\n\t\t\t AND TPRD.tblproductdetalle_stock >= ?\n\t\t\t AND TPRD.tblproductdetalle_diaselaboracion <= ?\n\t\t\t AND TDS.tbldiasemana_dia = ?\n\t\t\t AND THs.tblhora_hora BETWEEN THa.tblhora_hora AND THc.tblhora_hora\n\t GROUP BY THs.tblhora_hora ASC\";\n try{\n \t\t\t $resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n \t\t\t $resultado->bindParam(1,$idtblcolonia,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(2,$activado,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(3,$activado,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(4,$activado,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(5,$stock,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(6,$diasMinimos,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(7,$diasemana,PDO::PARAM_STR);\n \t\t\t $resultado->execute();\n \t\t\t return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n\t\t\t } catch(PDOException $e){\n\t\t\t return false; \n \t }\n \t }\n \t\n \t}\n else {//Entrega en Domicilio \n \n if($tipodepedido==1){ // Caso para hoy (Regresa las horas de servicio a domicilio mayores a la hora actual)\n \n \n $consulta= \"SELECT THs.* FROM tblhora THs \n\t \t\t\t INNER JOIN tblhrsprovdom THPS ON THs.idtblhora = THPS.tblhora_idtblhora\n\t INNER JOIN tblproveedor TP ON THPS.tblproveedor_idtblproveedor = TP.idtblproveedor\n\t INNER JOIN tblcoloniaprovservicio TCPS ON TCPS.tblproveedor_idtblproveedor = TP.idtblproveedor\n\t INNER JOIN tblproducto TPR ON TPR.tblproveedor_idtblproveedor = TP.idtblproveedor \n\t \t\t\t INNER JOIN tblproductdetalle TPRD ON TPR.idtblproducto = TPRD.tblproducto_idtblproducto\n\t INNER JOIN tbldiaprovservicio TDP ON TDP.tblproveedor_idtblproveedor = TP.idtblproveedor\n\t INNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDP.tbldiasemana_idtbldiasemana \n\t WHERE THs.tblhora_hora > CAST(? AS TIME)\n\t AND TCPS.tblcolonia_idtblcolonia = ?\n\t\t AND TP.tblproveedor_activado = ?\n\t\t AND TPR.tblproducto_activado = ? \n\t\t AND TPRD.tblproductdetalle_activado = ?\n\t\t AND TPRD.tblproductdetalle_stock >= ?\n\t\t AND TPRD.tblproductdetalle_diaselaboracion <= ?\n\t\t AND TDS.tbldiasemana_dia = ?\n\t GROUP BY THs.tblhora_hora ASC \";\n\t\t\t try{\n \t\t\t $resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n \t\t\t $resultado->bindParam(1,$nuevotime,PDO::PARAM_STR);\n \t\t\t $resultado->bindParam(2,$idtblcolonia,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(3,$activado,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(4,$activado,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(5,$activado,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(6,$stock,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(7,$diasMinimos,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(8,$diasemana,PDO::PARAM_STR);\n \t\t\t $resultado->execute();\n \t\t\t return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n\t\t\t } catch(PDOException $e){\n\t\t\t return false; \n \t }\n \n \n }else { // Caso para otro dia (Regresa las horas de servicio a domicilio)\n \n $consulta= \"SELECT THs.* FROM tblhora THs \n \t\t\t INNER JOIN tblhrsprovdom THPS ON THs.idtblhora = THPS.tblhora_idtblhora\n INNER JOIN tblproveedor TP ON THPS.tblproveedor_idtblproveedor = TP.idtblproveedor\n INNER JOIN tblcoloniaprovservicio TCPS ON TCPS.tblproveedor_idtblproveedor = TP.idtblproveedor\n INNER JOIN tblproducto TPR ON TPR.tblproveedor_idtblproveedor = TP.idtblproveedor \n \t\t\t INNER JOIN tblproductdetalle TPRD ON TPR.idtblproducto = TPRD.tblproducto_idtblproducto\n INNER JOIN tbldiaprovservicio TDP ON TDP.tblproveedor_idtblproveedor = TP.idtblproveedor\n INNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDP.tbldiasemana_idtbldiasemana \n WHERE TCPS.tblcolonia_idtblcolonia = ?\n \t\t\t\t AND TP.tblproveedor_activado = ?\n \t\t\t\t AND TPR.tblproducto_activado = ?\n \t\t\t\t AND TPRD.tblproductdetalle_activado = ?\n \t\t\t\t AND TPRD.tblproductdetalle_stock >= ?\n \t\t\t\t AND TPRD.tblproductdetalle_diaselaboracion <= ?\n \t\t\t\t AND TDS.tbldiasemana_dia = ?\n\t\t\t GROUP BY THs.tblhora_hora\";\n\t\t\t try{\n \t\t\t $resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n \t\t\t $resultado->bindParam(1,$idtblcolonia,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(2,$activado,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(3,$activado,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(4,$activado,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(5,$stock,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(6,$diasMinimos,PDO::PARAM_INT);\n \t\t\t $resultado->bindParam(7,$diasemana,PDO::PARAM_STR);\n \t\t\t $resultado->execute();\n \t\t\t return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n\t\t\t } catch(PDOException $e){\n\t\t\t return false; \n \t }\n \n }\n \n }\n \n }", "public static function updateWH($id){\n BaseController::debug($id);\n\n $url = 'http://www.websro.com.br/detalhes.php?P_COD_UNI=';\n $html = file_get_contents($url . $id);\n $msgEntrega = [\n 'entregue',\n 'entrega efetuada',\n 'objeto entregue ao destinatário'\n ];\n $sendEmail = false;\n\n //Verifica se o objeto ainda não foi postado\n\t\tif(strstr($html, '<table class=\"table table-bordered\">') !== false){\n\n //Limpa o codigo html\n $html = preg_replace(\"@\\r|\\t|\\n| +@\", ' ', $html);\n $html = str_replace('</tr>', \"</tr>\\n\", $html);\n\n //Pega as linhas com o rastreamento\n if(preg_match_all('@<tr>(.*)</tr>@', $html, $mat, PREG_SET_ORDER)){\n\n $temp = null;\n $track = [];\n $mat = array_reverse($mat);\n unset($mat[count($mat) - 1]);\n\n //Formata as linhas e gera um array\n foreach($mat as $item){\n $item[0] = preg_replace(\"@\\r|\\t|\\n| +@\", ' ', $item[0]);\n\n preg_match(\"@<td valign='top'>(.*)</td> <td>@\", $item[0], $dateRaw);\n $dateRaw = explode('<label>', str_replace('<br>', ' ',$dateRaw[1]));\n\n //Date\n $date = $dateRaw[0];\n $dateSQL = preg_replace('@([0-9]{2})/([0-9]{2})/([0-9]{4}) ([0-9]{2}):([0-9]{2})@', '$3-$2-$1 $4:$5:00', strip_tags($date));\n\n //Local\n preg_match(\"@</strong><br>(.*)</td>@\", $item[0], $local);\n\n if(strstr($local[1], ' para ')){\n $local = explode(' para ', $local[1]);\n $from = explode(' de ', $local[0]);\n\n if(array_key_exists(1, $from)){\n $from = trim($from[1]);\n }else{\n $from = '';\n }\n $to = trim($local[1]);\n } else {\n $from = '';\n }\n\n $to = trim($local[1]);\n\n //Action\n preg_match(\"@<strong>(.*)</strong>@\", $item[0], $action);\n $action = trim($action[1]);\n\n //Cria uma linha de track\n $tmp = [\n 'data' => $date,\n 'data_sql' => $dateSQL,\n 'local' => $from,\n 'acao' => $action,\n 'detalhes' => strip_tags($to),\n 'hash' => hash('md5', $date . $action)\n ];\n $track[] = $tmp;\n //BaseController::debug($track);\n }\n\n\n //////////////////////////////////////////////////\n //// GRAVA AS INFORMAÇOES ////////////////////////\n //////////////////////////////////////////////////\n //BaseController::debug($track, true);\n\n foreach($track as $info){\n\n $record = TrackingHistory::where('rastreio_historico.rastreio_id', '=', $id)\n ->where('rastreio_historico.hash', '=', $info['hash'])\n ->orderBy('rastreio_historico.created_at', 'DESC')\n ->orderBy('rastreio_historico.id', 'DESC')\n ->first();\n\n //COMPARA OS HASHES\n $recordHash = ($record) ? $record->hash : null;\n if($recordHash != $info['hash']) {\n\n BaseController::debug(\"HASH: \" . $info['hash']);\n BaseController::debug($info);\n\n //ICONE\n $icone = CorreiosController::setIcon(mb_strtolower(trim($info['acao'])));\n\n //GRAVA O REGISTRO\n $rastreio = new TrackingHistory();\n $rastreio->rastreio_id = $id;\n $rastreio->data = $info['data'];\n $rastreio->data_sql = $info['data_sql'];\n $rastreio->local = trim($info['local']);\n $rastreio->acao = trim($info['acao']);\n $rastreio->detalhes = isset($info['detalhes']) ? trim($info['detalhes']) : '';\n $rastreio->hash = $info['hash'];\n $rastreio->save();\n\n Tracking::where('numero', '=', $id)->update(array(\n 'status' => trim($info['acao']),\n 'data_status' => $info['data_sql'],\n 'novo_status' => 1,\n 'icone' => $icone\n )\n );\n\n if(in_array(mb_strtolower($info['acao']), $msgEntrega) !== false){\n Tracking::where('numero', '=', $id)->update(array('atualiza_status' => 0));\n }\n /////ENVIO DO EMAIL //////////////////\n $sendEmail = true;\n\n }\n }\n\n //////////////////////////////////////\n /////ENVIO DO EMAIL //////////////////\n //////////////////////////////////////\n if($sendEmail){\n\n $dados = Tracking::where('numero', '=', $id)->first();\n $user = User::where('id', '=', $dados->usuario_id)->first();\n\n $data = array(\n 'cod_rastreio' => $id,\n 'description' => $dados->descricao,\n 'detail'\t => $info['acao'] . ((strlen($info['detalhes']) > 0) ? ' - ' . $info['detalhes'] : '')\n );\n\n $rcpto = explode(';', $user->email);\n if(! is_array($rcpto))\n $rcpto = array($rcpto);\n\n #Mail::send('emails.rastreio', $data, function($message) use ($user, $rcpto){\n # $message->from('[email protected]', 'Rastreio - Cooltracker');\n # $message->to($rcpto)->subject('Novidades sobre sua encomenda!! ' . date('d/m/Y H:i:s'));\n #});\n\n //ENVIO DA NOTIFICACAO///////////////\n BaseController::debug('Notificacao');\n //if($user->id <= 2){\n $fcmTopic = $user->id;\n $titulo = 'Novidades sobre sua encomenda!!!';\n $mensagem = \"A sua encomenda {$id} recebeu uma atualização de status. Clique aqui para ver!\";\n\n echo '<pre>';\n CorreiosController::sendNotification($titulo, $mensagem, $fcmTopic);\n echo '</pre>';\n //}\n\n BaseController::debug('Atualizou');\n BaseController::debug('============================================');\n\n return true;\n\n } else {\n BaseController::debug('Nenhuma novidade. Nao foi atualizado');\n BaseController::debug('============================================');\n }\n ////////////////////////////////////////////\n ///FIM ENVIO EMAIL\n ////////////////////////////////////////////\n\n } else {\n BaseController::debug('Nao rastreavel. Nao foi atualizado. Cod 2');\n BaseController::debug('============================================');\n return true;\n }\n } else {\n BaseController::debug('Nao rastreavel. Nao foi atualizado. Cod 1');\n BaseController::debug('============================================');\n return true;\n }\n\n }", "function inicioTareas($id_OT){\n\t\t$fechaInicio = date(\"Y-m-d H:i:s\");\n\t\t$estado = 'C';\n\t\t$this->db->where('id_orden', $id_OT);\n\t\t$result = $this->db->update('orden_trabajo',array('fecha_inicio'=>$fechaInicio));\n\t\treturn $result;\n\t}", "public function actionDetailTask($id, $nik) {\n// ->select('dt.id_status_perbaikan as IdStatusPerbaikan, dt.flag_data_instalasi as FlagDataInstalasi, dt.diameter_antena as DiameterAntena, dt.polarisasi_arah_antena as PolarisasiArahAntena, dt.elevasi_arah_antena as EvlevasiArahAtena, dt.azimuth_arah_antena as AzimuthArahAntena, '\n// . 'dt.kvaups as KVAUPS, dt.ip_management as IPManagement, dt.receive_symbole_rate as ReceiveSymboleRate, dt.phase_netral_pln as PhaseNetralPLN, '\n// . 'dt.phase_netral_ups as PhaseNetralUPS, dt.phase_netral_genset as PhaseNetralGenset, dt.phase_ground_pln as PhaseGroundPLN, dt.phase_ground_ups as PhaseGroundUPS, '\n// . 'dt.phase_ground_genset as PhaseGroundGenset, dt.netral_ground_pln as NetralGroundPLN, dt.netral_ground_ups as NetralGroundUPS, dt.netral_ground_genset as NetralGroundGenset, '\n// . 'dt.satelite_longitude as SateliteLongitude, dt.iplan1 as IPLAN1, dt.subnetmask1, dt.iplan2 as IPLAN2, dt.subnetmask2, dt.hasil_test_alamat1 as HasilTestALamat1, dt.success_test1 as SuccessTest1, '\n// . 'dt.loss_test1 as LossTest1, dt.keterangan_test1 as KeteranganTest1, dt.hasil_test_alamat2 as HasilTestAlamat2, dt.success_test2 as SuccessTest2, dt.loss_test2 as LossTest2, dt.keterangan_test2 as KeteranganTest2, '\n// . 'dt.hasil_test_alamat3 as HasilTestAlamat3, dt.success_test3 as SuccessTest3, dt.loss_test3 as LossTest3, dt.keterangan_test3 as KeteranganTest3')\n// ->from('detail_task dt')\n// ->leftJoin('task t', 'dt.task_id = t.id')\n// ->where(['t.id' => $id])\n// ->all();\n $model = Yii::$app->db->createCommand(\"SELECT IFNULL(l.flag_data_lokasi, 'false') as FlagDataLokasi, gi.IPLAN, l.laporan_pengaduan as LaporanPengaduan, \n gi.tgl_berangkat as TglBerangkat, gi.tgl_selesai_kerjaan as TglSelesaiKerjaan, gi.tgl_pulang as TglPulang, gi.tgl_status_perbaikan as TglStatusPerbaikan, \n l.catatan as CatatanKoordinator, t.id_status_kordinator as IdStatusKoordinator , gi.atm_id as IdATM ,IFNULL(gi.flag_general_info, 'false') as FlagGeneralInfo, \n IFNULL(dt.flag_data_teknis, 'false') as FlagDataTeknis, IFNULL(s.flag_data_survey, 'false') as FlagDataSurvey, IFNULL(f.flag_upload_foto, 'false') as FlagUploadFoto, \n t.sid as SID,IFNULL(dtsk.flag_data_instalasi, 'false') as FlagDataInstalasi, IFNULL(b.flag_data_barang, 'false') as FlagDataBarang, jt.deskripsi as idJenisTask1, \n dtsk.id_status_perbaikan as IdStatusPerbaikan, l.alamat_sekarang as alamatSekarang, t.vid as VID1, t.nama_remote as NAMAREMOTE, l.alamat_install as ALAMAT,\n l.kanwil as KANWIL, l.kanca_induk as KANCAINDUK, l.nama_pic as NoHpPic, l.no_hp_pic as PIC, l.kota as KOTA, l.jarkom_id as IdJarkom, l.satelite_id as IdSatelite, \n l.latitude as Latitude, l.longitude as Longitude, t.no_task as NoTask, l.catatan as Catatan, l.hub as Hub, l.provinsi as Provinsi,\n dt.fail_hw as FAIL_HW, dt.sqf as SQF, dt.initial_esno as INITIAL_ESNO, dt.carrier_to_noice as CARRIER_TO_NOICE, dt.hasil_xpoll as HasilXPOLL, \n dt.operator_satelite as OperatorSatelite, dt.operator_helpdesk as OperatorHelpDesk, dt.out_pln as OutPLN, dt.out_ups as OutUPS, dt.ups_for_backup as UPSforBackup,\n dt.suhu_ruangan as SuhuRuangan, dt.type_mounting as TypeMounting, dt.panjang_kabel as PanjangKabel, dt.letak_antena as LetakAntena, \n dt.letak_modem as LetakModem, dt.kondisi_bangunan as KondisiBangungan, dt.analisa_problem as AnalisaProblem, dt.aktifitas_solusi as AktifitasSolusi, dt.cpi as CPI,\n dtsk.flag_data_instalasi as FlagDataInstallasi, s.alamat_pengiriman_survey as AlamatPengirimanSurvey,\n s.nama_pic_survey as NamaPICSurvey, s.kontsk_pic_survey as KontakPICSurvey, s.penempatan_grounding_survey as PenempatanGroundingSurvey, \n s.ukuran_antena_survey as UkuranAntenaSurvey, s.tempat_antena_survey as TempatAntenaSurvey, s.kekuatan_roof_survey as KekuatanRoofSurvey,\n s.jenis_mounting_survey as JenisMountingSurvey, s.latitude_survey as LatitudeSurvey, s.longitude_survey as LongitudeSurvey, s.listrik_awal_survey as ListrikAwalSurvey, \n s.sarpen_aci_indoor as SarpenACIndoorSurvey, s.sarpen_ups_survey as SarpenUPSSurvey, s.panjang_kabel_survey as PanjangKabelSurvey,\n s.type_kabel_survey as TypeKabelSurvey, s.arah_antena_survey as ArahAntenaSurvey, s.keterangan_survey as KeteranganSurvey,\n dtsk.diameter_antena as DiameterAntena, dtsk.polarisasi_arah_antena as PolarisasiArahAntena, dtsk.elevasi_arah_antena as ElevasiArahAntena, \n dtsk.azimuth_arah_antena as AzimuthArahAntena, dtsk.kvaups as KVAUPS, dtsk.ip_management as IPManagement, dtsk.receive_symbole_rate as ReceiveSymboleRate,\n dtsk.phase_netral_pln as PhaseNetralPLN, dtsk.phase_netral_ups as PhaseNetralUPS, dtsk.phase_netral_genset as PhaseNetralGenset, dtsk.phase_ground_pln as PhaseGroundPLN, \n dtsk.phase_ground_ups as PhaseGroundUPS, dtsk.phase_ground_genset as PhaseGroundGenset, dtsk.netral_ground_pln as NetralGroundPLN, dtsk.netral_ground_ups as NetralGroundUPS, \n dtsk.netral_ground_genset as NetralGroundGenset, dtsk.satelite_longitude as SateliteLongitude, dtsk.iplan1 as IPLAN1, dtsk.subnetmask1 as subnetmask1, \n dtsk.iplan2 as IPLAN2, dtsk.subnetmask2 as subnetmask2, dtsk.hasil_test_alamat1 as HasilTestAlamat1, dtsk.success_test1 as SuccessTest1, \n dtsk.loss_test1 as LossTest1, dtsk.keterangan_test1 as KeteranganTest1, dtsk.hasil_test_alamat2 as HasilTestAlamat2, dtsk.success_test2 as SuccessTest2,\n dtsk.loss_test2 as LossTest2, dtsk.keterangan_test2 as KeteranganTest2, dtsk.hasil_test_alamat3 as HasilTestAlamat3, dtsk.success_test3 as SuccessTest3, \n dtsk.loss_test3 as LossTest3, dtsk.keterangan_test3 as KeteranganTest3, s.tempat_penyimpanan_survey as TempatPenyimpananSurvey, s.status_hasil_survey as StatusHasilSurvey, dtsk.source_listrik as SourceListrik,\n dtsk.kabel_roll as KabelRoll, dtsk.perangkat_ke_ups as PerangkatkeUPS, dtsk.frequency_band_modulation as FrequencyBandModulation\n\nFROM lokasi l\nLEFT JOIN task t on t.id = l.task_id\nLEFT JOIN barang b on b.task_id = t.id\nLEFT JOIN general_info gi on gi.task_id = t.id\nLEFT JOIN data_teknisi dt on dt.task_id = t.id\nLEFT JOIN survey s on s.task_id = t.id\nLEFT JOIN foto f on f.task_id = t.id\nLEFT JOIN detail_task dtsk ON dtsk.task_id = t.id\nLEFT JOIN user u on u.id = t.user_id\nLEFT JOIN jenis_task jt on jt.id = t.id_jenis_task\nWHERE l.task_id = t.id and t.id = \" . $id . \" and u.nik = '\" . $nik . \"'\")->queryAll();\n// \\yii\\helpers\\VarDumper::dump($model);die;\n $respon = \\Yii::$app->getResponse();\n\n if ($model != null) {\n $respon->setStatusCode(200);\n return [\n 'Result' => \"True\",\n 'Raw' => $model\n ];\n } else {\n $respon->setStatusCode(200);\n return [\n 'Result' => \"False\",\n 'Data1' => ''\n ];\n }\n }", "public static function caricaElencoPost($id_discussione){\n //connessione al database\n $db = Database::caricaDatabase();\n $client = $db->connetti();\n if(!isset($client)){ //se $client è null significa che si è verificato un errore in fase di connessione al database\n error_log(\"[caricaElencoPost] Errore di connessione al database\");\n return null;\n }\n \n $statement = $client->stmt_init(); //inizializza il prepared statement\n \n //stringa che rappresenta la query da eseguire\n $query = \"SELECT post.id, DATE_FORMAT(post.data, '%d/%m/%Y %H:%i') as data_it, post.testo, utenti.username \";\n $query .= \"FROM post \";\n $query .= \"JOIN utenti ON utenti.id = post.creatore_id \";\n $query .= \"JOIN discussioni ON discussioni.id = post.discussione_id \";\n $query .= \"WHERE discussioni.id = ? \";\n $query .= \"ORDER BY post.data\";\n \n $statement->prepare($query); //prepara lo statement per l'esecuzione\n if(!$statement){\n error_log(\"[caricaElencoPost] Errore d'inizializzazione dello statement\");\n $client->close(); //rilascia la connessione con il database\n return null;\n }\n \n if(!$statement->bind_param(\"i\", $id_discussione)){ //collega i parametri con il loro tipo\n error_log(\"[caricaElencoPost] Errore nel binding dei parametri nella query\");\n $client->close(); //rilascia la connessione con il database\n return null;\n }\n \n if(!$statement->execute()){ //esegue la query\n error_log(\"[caricaElencoPost] Errore nell'esecuzione della query\");\n $client->close(); //rilascia la connessione con il database\n return null;\n }\n \n $risultato = array(); //crea un array in cui verrà salvato il risultato della ricerca\n \n //collega i risultati della query con i parametri espliciti passati al metodo\n if(!$statement->bind_result($risultato['id'], $risultato['data'], $risultato['post'], $risultato['nome_utente'])){ \n error_log(\"[caricaElencoPost] Errore nel binding dei risultati\");\n $client->close(); //rilascia la connessione con il database\n return null;\n }\n \n if($statement->fetch()){ /*se il metodo fetch() rende true significa che la query ha generato dei risultati, quindi con essi creo\n un'istanza della classe Post*/\n do{\n $post = Post::creaPostDaArray($risultato); //dai risultati della query creo istanza di tipo Post\n $listaPost[] = $post; //aggiungo l'istanza creata in fondo all'array $listaPost\n } while($statement->fetch()); //continuo finchè il metodo fetch() rende true e quindi ci sono risultati da leggere\n \n $statement->close(); //libera le risorse dello statement\n $client->close(); //rilascia la connessione con il database\n return $listaPost;\n } else{ //se il metodo fetch() richiamato nell'if sopra rende false, significa che la query non ha generato risultati\n $statement->close(); //libera le risorse dello statement\n $client->close(); //rilascia la connessione con il database\n return false;\n }\n }", "public function show($id) {\n $hoi_thi = new Hoi_thi();\n $ma_hoi_thi = $hoi_thi->get_mahoithi($id);\n if ($ma_hoi_thi == 'TM') {\n $tiet_muc = DB::table('tiet_muc_du_this')\n ->select('vong_this.ten_vong_thi', 'phieu_dang_kies.ma_phieu_dang_ky', 'tiet_muc_du_this.ms_tiet_muc', 'tiet_muc_du_this.ten_tiet_muc', 'tiet_muc_du_this.trinh_bay', 'tiet_muc_du_this.the_loai_tiet_muc', 'hinh_thuc_du_this.ten_hinh_thuc', 'bai_hats.ten_bai_hat', 'tiet_muc_du_this.id', 'tiet_muc_du_this.ghi_chu')\n ->leftJoin('phieu_dang_kies', 'tiet_muc_du_this.PhieuDangKys_Id', '=', 'phieu_dang_kies.id')\n ->leftJoin('hinh_thuc_du_this', 'tiet_muc_du_this.HinhThucDuThis_Id', '=', 'hinh_thuc_du_this.id')\n ->leftJoin('bai_hats', 'tiet_muc_du_this.BaiHats_Id', '=', 'bai_hats.id')\n ->join('vong_this', function($join) {\n $join->on('vong_this.HinhThucDuThis_Id', '=', 'hinh_thuc_du_this.id')\n ->on('tiet_muc_du_this.VongThis_Id', '=', 'vong_this.id');\n })\n ->where('phieu_dang_kies.id', $id)->get();\n } else if ($ma_hoi_thi == 'CT') {\n $tiet_muc = DB::table('tiet_muc_du_this')\n ->select('phieu_dang_kies.ma_phieu_dang_ky', 'tiet_muc_du_this.ms_tiet_muc', 'tiet_muc_du_this.ten_tiet_muc', 'tiet_muc_du_this.trinh_bay', 'tiet_muc_du_this.the_loai_tiet_muc', 'hinh_thuc_du_this.ten_hinh_thuc', 'bai_hats.ten_bai_hat', 'tiet_muc_du_this.id', 'tiet_muc_du_this.ghi_chu')\n ->leftJoin('phieu_dang_kies', 'tiet_muc_du_this.PhieuDangKys_Id', '=', 'phieu_dang_kies.id')\n ->leftJoin('hinh_thuc_du_this', 'tiet_muc_du_this.HinhThucDuThis_Id', '=', 'hinh_thuc_du_this.id')\n ->leftJoin('bai_hats', 'tiet_muc_du_this.BaiHats_Id', '=', 'bai_hats.id')\n ->where('phieu_dang_kies.id', $id)->get();\n } else {\n return 'Không Tồn Tại Hội Thi';\n }\n\n\n return View::make('quantriphieudangky.show', compact(array('phieu_dang_ky', 'tiet_muc')))->with('ma_hoi_thi',$ma_hoi_thi);\n }", "public function realisasi_indikator_kegiatan_triwulan($renja_id,$triwulan,$kegiatan_id,$indikator_kegiatan_id){ \n\n\n //Cari pelaksanan ny dulu\n $jabatan_id_data = Kegiatan::WHERE('id','=',$kegiatan_id)->SELECT('jabatan_id')->first();\n if ($jabatan_id_data){\n $jabatan_id = $jabatan_id_data->jabatan_id;\n }else{\n $jabatan_id = 0 ;\n }\n \n\n //cari capaian trieulan ID nya dulu\n $dt_tw = CapaianTriwulan:: \n rightjoin('db_pare_2018.skp_tahunan AS skp_tahunan', function($join) use($renja_id){ \n $join ->on('skp_tahunan.id','=','capaian_triwulan.skp_tahunan_id');\n $join ->where('skp_tahunan.renja_id','=',$renja_id);\n })\n //PEJABAT YANG DINILAI\n ->rightjoin('demo_asn.tb_history_jabatan AS pejabat', function($join) use($jabatan_id){\n $join ->on('skp_tahunan.u_jabatan_id','=','pejabat.id');\n $join ->where('pejabat.id_jabatan','=',$jabatan_id);\n }) \n ->SELECT( 'capaian_triwulan.id AS capaian_triwulan_id',\n 'pejabat.id_jabatan'\n )\n ->WHERE('capaian_triwulan.triwulan','=',$triwulan)\n ->first();\n \n if ( $dt_tw ){\n $data = RealisasiIndikatorKegiatanTriwulan::WHERE('capaian_id','=', $dt_tw->capaian_triwulan_id)\n ->WHERE('indikator_kegiatan_id','=',$indikator_kegiatan_id)\n ->first();\n if ( $data ){\n return $data->realisasi_quantity.' '.$data->satuan;\n }else{\n return \"-\";\n }\n }else{\n return \"-\";\n } \n }", "public function getPostulacionbyId($id) {\r\n\t\t$aux = array(); \r\n\t\t$postulacion = $this->findFirst(\"id='$id'\");\r\n\t\tif ($postulacion){\r\n\t\t\t$aux['id']=$postulacion->getId();\r\n\t\t\t$aux['ofertaId']=$postulacion->getOferta_id();\r\n\t\t\t$aux['pasanteId']=$postulacion->getPasante_id();\r\n\t\t\t$aux['fchPostulacion']=Util::cambiarFechaMDY($postulacion->getFchPostulacion_at());\r\n\t\t\t$aux['estatus']=$postulacion->getEstatus();\r\n\t\t}\r\n\t\treturn $aux;\r\n\t}", "function general_post_data2($type, $idHdr, $seq, $id = null){\r\r\n\t\t$where['data'][] = array(\r\r\n\t\t\t'column' => 'permintaan_jasadet_id',\r\r\n\t\t\t'param'\t => $id\r\r\n\t\t);\r\r\n\t\t$queryRevised = $this->mod->select('permintaan_jasadet_revised', 't_permintaan_jasadet', NULL, $where);\r\r\n\t\tif ($queryRevised) {\r\r\n\t\t\t$revised = $queryRevised->row_array();\r\r\n\t\t\t$rev = $revised['permintaan_jasadet_revised'] + 1;\r\r\n\t\t}\r\r\n\t\tif ($type == 1) {\r\r\n\t\t\t$data = array(\r\r\n\t\t\t\t't_permintaan_jasa_id' \t\t\t\t=> $idHdr,\r\r\n\t\t\t\t'm_barang_id' \t\t\t\t\t\t=> $this->input->post('m_barang_id', TRUE)[$seq],\r\r\n\t\t\t\t'permintaan_jasadet_qty' \t\t\t=> $this->input->post('permintaan_jasadet_qty', TRUE)[$seq],\r\r\n\t\t\t\t'permintaan_jasadet_keterangan'\t\t=> $this->input->post('permintaan_jasadet_keterangan', TRUE)[$seq],\r\r\n\t\t\t\t'permintaan_jasadet_create_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'permintaan_jasadet_create_by'\t\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t'permintaan_jasadet_update_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'permintaan_jasadet_revised' \t\t=> 0,\r\r\n\t\t\t);\r\r\n\t\t} else if ($type == 2) {\r\r\n\t\t\tif ($status == $this->input->post('permintaan_jasadet_status', TRUE)[$seq]) {\r\r\n\t\t\t\t$data = array(\r\r\n\t\t\t\t\t'permintaan_jasadet_qty_realisasi'\t=> ($this->input->post('permintaan_jasadet_qty_realisasi', TRUE)[$seq] + $this->input->post('permintaan_jasadet_qty_kirim', TRUE)[$seq]),\r\r\n\t\t\t\t\t'permintaan_jasadet_update_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t'permintaan_jasadet_update_by'\t\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t\t'permintaan_jasadet_revised' \t\t=> $rev,\r\r\n\t\t\t\t);\t\r\r\n\t\t\t} else {\r\r\n\t\t\t\t$data = array(\r\r\n\t\t\t\t\t'permintaan_jasadet_qty_realisasi'\t\t=> ($this->input->post('permintaan_jasadet_qty_realisasi', TRUE)[$seq] + $this->input->post('permintaan_jasadet_qty_kirim', TRUE)[$seq]),\r\r\n\t\t\t\t\t'permintaan_jasadet_status' \t\t\t=> $this->input->post('permintaan_jasadet_status', TRUE)[$seq],\r\r\n\t\t\t\t\t'permintaan_jasadet_status_date'\t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t'permintaan_jasadet_update_date'\t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t'permintaan_jasadet_update_by'\t\t\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t\t'permintaan_jasadet_revised' \t\t\t=> $rev,\r\r\n\t\t\t\t);\t\r\r\n\t\t\t}\r\r\n\t\t} else if ($type == 3) {\r\r\n\t\t\t$data = array(\r\r\n\t\t\t\t'm_barang_id' \t\t\t\t\t\t=> $this->input->post('m_barang_id', TRUE)[$seq],\r\r\n\t\t\t\t'permintaan_jasadet_update_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t'permintaan_jasadet_update_by'\t\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t'permintaan_jasadet_revised' \t\t=> $rev,\r\r\n\t\t\t);\t\r\r\n\t\t}\r\r\n\r\r\n\t\treturn $data;\r\r\n\t}", "public function getCapNhatThongTin($id)\n {\n if(Auth::check() && $this::isIDSinhVien($id))\n {\n if(UserController::isGroupNoneId((env('GROUP_QUANTRIHETHONG'))) || UserController::isGroupNoneId(env('GROUP_CHUYENVIENHETHONG')))\n {\n\n $LyLich = LyLich::where('sinhvien_id', '=', $id)->orderBy('id', 'desc')->first();\n $SV = SinhVien::find($id);\n if($LyLich)\n {\n $DanhSach_AnhChiEm = $LyLich->anhchiem;\n }\n else\n {\n $DanhSach_AnhChiEm = AnhChiEm::where('id', '=', 0)->get();\n }\n\n $DanhSach_DanToc = DanToc::all();\n $DanhSach_TonGiao = TonGiao::all();\n $DanhSach_Tinh = Tinh::all()->sortBy('tentinh');\n\n $DanhSach_MoiQuanHe = MoiQuanHe::all();\n $DanhSach_GioiTinh = GioiTinh::all()->sortBy('tengioitinh');\n $DanhSach_Lop = Lop::all()->sortBy('tenlop');\n\n $DanhSach_LyLich = LyLich::where('sinhvien_id', '=', $id)->orderBy('id', 'ASC')->get();\n\n \n return view('admin.sinhvien_thongtin_capnhat', ['SV'=>$SV, 'LyLich'=>$LyLich, 'DanhSach_AnhChiEm'=>$DanhSach_AnhChiEm, 'DanhSach_DanToc'=>$DanhSach_DanToc, 'DanhSach_TonGiao'=>$DanhSach_TonGiao, 'DanhSach_Tinh'=>$DanhSach_Tinh, 'DanhSach_MoiQuanHe'=>$DanhSach_MoiQuanHe, 'DanhSach_GioiTinh'=>$DanhSach_GioiTinh, 'DanhSach_Lop'=>$DanhSach_Lop, 'DanhSach_LyLich'=>$DanhSach_LyLich]);\n }\n else\n {\n return redirect()->route('home');\n }\n }\n else\n {\n return redirect()->route('home');\n }\n }", "public function postData($type){\r\r\n\t\t$id = $this->input->post('kode');\r\r\n\t\t// echo $id;\r\r\n\t\t$response['test'] = $type;\r\r\n\t\tif (strlen($id)>0) {\r\r\n\t\t\tif ($type == 2) {\r\r\n\t\t\t\t//UPDATE\r\r\n\t\t\t\t$data = $this->general_post_data(2, $id);\r\r\n\t\t\t\t$where['data'][] = array(\r\r\n\t\t\t\t\t'column' => 'penerimaan_barang_id',\r\r\n\t\t\t\t\t'param'\t => $id\r\r\n\t\t\t\t);\r\r\n\t\t\t\t$update = $this->mod->update_data_table($this->tbl, $where, $data);\r\r\n\t\t\t\tif($update->status) {\r\r\n\t\t\t\t\t$response['status'] = '200';\r\r\n\t\t\t\t\t// INSERT DETAIL\r\r\n\t\t\t\t\tfor ($i = 0; $i < sizeof($this->input->post('penerimaan_barangdet_id', TRUE)); $i++) {\r\r\n\t\t\t\t\t\t$data_det = $this->general_post_data2(2, $id, $i, $this->input->post('penerimaan_barangdet_id', TRUE)[$i]);\r\r\n\t\t\t\t\t\tif (@$where_det['data']) {\r\r\n\t\t\t\t\t\t\tunset($where_det['data']);\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t$where_det['data'][] = array(\r\r\n\t\t\t\t\t\t\t'column' => 'penerimaan_barangdet_id',\r\r\n\t\t\t\t\t\t\t'param'\t => $this->input->post('penerimaan_barangdet_id', TRUE)[$i]\r\r\n\t\t\t\t\t\t);\r\r\n\t\t\t\t\t\t$update_det = $this->mod->update_data_table('t_penerimaan_barangdet', $where_det, $data_det);\r\r\n\t\t\t\t\t\tif($update_det->status) {\r\r\n\t\t\t\t\t\t\t$response['status'] = '200';\r\r\n\t\t\t\t\t\t} else {\r\r\n\t\t\t\t\t\t\t$response['status'] = '204';\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t} else {\r\r\n\t\t\t\t\t$response['status'] = '204';\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\t\t} else {\r\r\n\t\t\t//INSERT\r\r\n\t\t\t$ulang = 0;\r\r\n\t\t\t$ulang2 = 0;\r\r\n\t\t\t$ulang3 = 0;\r\r\n\t\t\t$data = $this->general_post_data(1);\r\r\n\t\t\t$insert = $this->mod->insert_data_table($this->tbl, NULL, $data);\r\r\n\t\t\tif($insert->status) {\r\r\n\t\t\t\t$response['status'] = '200';\r\r\n\t\t\t\t// INSERT DETAIL\r\r\n\t\t\t\tfor ($i = 0; $i < sizeof($this->input->post('m_barang_id', TRUE)); $i++) {\r\r\n\t\t\t\t\t$response['m_barang_id'][] = $this->input->post('m_barang_id', TRUE)[$i];\r\r\n\t\t\t\t\t$noSeri = array();\r\r\n\t\t\t\t\t$qtyNoSeri = array();\r\r\n\t\t\t\t\t$data_det = $this->general_post_data2(1, $insert->output, $i);\r\r\n\t\t\t\t\t$insert_det = $this->mod->insert_data_table('t_penerimaan_barangdet', NULL, $data_det);\r\r\n\t\t\t\t\tif($insert_det->status) {\r\r\n\t\t\t\t\t\t$response['status'] = '200';\r\r\n\t\t\t\t\t\t// $noSeri = '';\r\r\n\t\t\t\t\t\t// $qtyNoSeri = '';\r\r\n\t\t\t\t\t\t// $response['qtyNoSeri'][] = $qtyNoSeri;\r\r\n\t\t\t\t\t\t// $response['testSeri'][] = '';\r\r\n\t\t\t\t\t\t// $response['qty'][] = sizeof($noSeri);\r\r\n\t\t\t\t\t\t// for($j = 0; $j < sizeof($noSeri); $j++)\r\r\n\t\t\t\t\t\tfor($j = 0; $j < 1; $j++)\r\r\n\t\t\t\t\t\t{\r\r\n\t\t\t\t\t\t\t// if($noSeri[$j] != '')\r\r\n\t\t\t\t\t\t\t// {\r\r\n\t\t\t\t\t\t\t\t// STOK GUDANG DAN KARTU STOK\r\r\n\t\t\t\t\t\t\t\tif (@$where_gudang2['data']) {\r\r\n\t\t\t\t\t\t\t\t\tunset($where_gudang2['data']);\r\r\n\t\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\t\tif (@$order['data']) {\r\r\n\t\t\t\t\t\t\t\t\tunset($order['data']);\r\r\n\t\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\t\t// PENAMBAHAN STOK GUDANG\r\r\n\t\t\t\t\t\t\t\t$where_gudang2['data'][] = array(\r\r\n\t\t\t\t\t\t\t\t\t'column' => 'm_barang_id',\r\r\n\t\t\t\t\t\t\t\t\t'param'\t => $this->input->post('m_barang_id', TRUE)[$i]\r\r\n\t\t\t\t\t\t\t\t);\r\r\n\t\t\t\t\t\t\t\t$where_gudang2['data'][] = array(\r\r\n\t\t\t\t\t\t\t\t\t'column' => 'm_gudang_id',\r\r\n\t\t\t\t\t\t\t\t\t'param'\t => $data['m_gudang_id']\r\r\n\t\t\t\t\t\t\t\t);\r\r\n\t\t\t\t\t\t\t\t$order['data'][] = array(\r\r\n\t\t\t\t\t\t\t\t\t'column' => 'kartu_stok_id',\r\r\n\t\t\t\t\t\t\t\t\t'type'\t => 'DESC'\r\r\n\t\t\t\t\t\t\t\t);\r\r\n\t\t\t\t\t\t\t\t$limit = array(\r\r\n\t\t\t\t\t\t\t\t\t'start' => 0,\r\r\n\t\t\t\t\t\t\t\t\t'finish' => 1\r\r\n\t\t\t\t\t\t\t\t);\r\r\n\t\t\t\t\t\t\t\t$query_gudang2 = $this->mod->select('*', 't_kartu_stok', NULL, $where_gudang2, null, null, $order, $limit);\r\r\n\t\t\t\t\t\t\t\tif($query_gudang2)\r\r\n\t\t\t\t\t\t\t\t{\r\r\n\t\t\t\t\t\t\t\t\t// JIKA DATA BARANG SUDAH ADA DI STOK GUDANG\r\r\n\t\t\t\t\t\t\t\t\tforeach ($query_gudang2->result() as $rowStok) {\r\r\n\t\t\t\t\t\t\t\t\t\t// $response['gudang'][] = $rowStok->kartu_stok_saldo;\r\r\n\t\t\t\t\t\t\t\t\t\t// if(!isset($qtyNoSeri[$j]))\r\r\n\t\t\t\t\t\t\t\t\t\t// {\r\r\n\t\t\t\t\t\t\t\t\t\t// \t$qtyNoSeri[$j] = 0;\r\r\n\t\t\t\t\t\t\t\t\t\t// }\r\r\n\t\t\t\t\t\t\t\t\t\t// $response['noSeri'][] = $noSeri[$j];\r\r\n\t\t\t\t\t\t\t\t\t\t// $response['qtyNoSeri'][] = $qtyNoSeri[$j];\r\r\n\t\t\t\t\t\t\t\t\t\t// PENAMBAHAN KARTU STOK\r\r\n\t\t\t\t\t\t\t\t\t\t$dataKStok2 = array(\r\r\n\t\t\t\t\t\t\t\t\t\t\t'm_gudang_id' \t\t\t\t=> $rowStok->m_gudang_id,\r\r\n\t\t\t\t\t\t\t\t\t\t\t'm_barang_id' \t\t\t\t=> $this->input->post('m_barang_id', TRUE)[$i],\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_tanggal' \t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_referensi' \t\t=> $data['penerimaan_barang_nomor'],\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_saldo' \t\t\t=> $rowStok->kartu_stok_saldo+$rowStok->kartu_stok_masuk-$rowStok->kartu_stok_keluar,\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_masuk' \t\t\t=> $data_det['penerimaan_barangdet_qty'],\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_keluar' \t\t=> 0,\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_penyesuaian'\t=> 0,\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_keterangan' \t=> \"Penerimaan Barang\",\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_created_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_created_by' \t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_revised' \t\t=> 0,\r\r\n\t\t\t\t\t\t\t\t\t\t);\r\r\n\t\t\t\t\t\t\t\t\t\t// END PENAMBAHAN KARTU STOK\r\r\n\t\t\t\t\t\t\t\t\t\t$insertKStok2 = $this->mod->insert_data_table('t_kartu_stok', NULL, $dataKStok2);\r\r\n\t\t\t\t\t\t\t\t\t\t$dataStok2 = array(\r\r\n\t\t\t\t\t\t\t\t\t\t\t'm_gudang_id' \t\t\t\t=> $rowStok->m_gudang_id,\r\r\n\t\t\t\t\t\t\t\t\t\t\t'm_barang_id' \t\t\t\t=> $this->input->post('m_barang_id', TRUE)[$i],\r\r\n\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_jumlah' \t\t=> $data_det['penerimaan_barangdet_qty'],\r\r\n\t\t\t\t\t\t\t\t\t\t\t// 'stok_gudang_no_seri' \t\t=> $noSeri[$j],\r\r\n\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_no_seri' \t\t=> '',\r\r\n\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_created_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_created_by'\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_revised' \t\t=> 0,\r\r\n\t\t\t\t\t\t\t\t\t\t);\r\r\n\r\r\n\t\t\t\t\t\t\t\t\t\t// CHECK STOK GUDANG\r\r\n\t\t\t\t\t\t\t\t\t\t// QUERY\r\r\n\t\t\t\t\t\t\t\t\t\tif (@$where_stok_gudang['data']) {\r\r\n\t\t\t\t\t\t\t\t\t\t\tunset($where_stok_gudang['data']);\r\r\n\t\t\t\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\t\t\t\t$where_stok_gudang['data'][] = array(\r\r\n\t\t\t\t\t\t\t\t\t\t\t'column' => 'm_gudang_id',\r\r\n\t\t\t\t\t\t\t\t\t\t\t'param'\t => $dataStok2['m_gudang_id']\r\r\n\t\t\t\t\t\t\t\t\t\t);\r\r\n\t\t\t\t\t\t\t\t\t\t$where_stok_gudang['data'][] = array(\r\r\n\t\t\t\t\t\t\t\t\t\t\t'column' => 'm_barang_id',\r\r\n\t\t\t\t\t\t\t\t\t\t\t'param'\t => $dataStok2['m_barang_id']\r\r\n\t\t\t\t\t\t\t\t\t\t);\r\r\n\t\t\t\t\t\t\t\t\t\t$select_stok_gudang = $this->mod->select('*', 't_stok_gudang', NULL, $where_stok_gudang);\r\r\n\r\r\n\t\t\t\t\t\t\t\t\t\tif ($select_stok_gudang) {\r\r\n\t\t\t\t\t\t\t\t\t\t\tforeach ($select_stok_gudang->result() as $value) {\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t// UPDATE\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t$dataStok2 = array(\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'm_gudang_id' \t\t\t\t=> $value->m_gudang_id,\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'm_barang_id' \t\t\t\t=> $this->input->post('m_barang_id', TRUE)[$i],\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_jumlah' \t\t=> $data_det['penerimaan_barangdet_qty'] + $value->stok_gudang_jumlah,\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// 'stok_gudang_no_seri' \t\t=> $noSeri[$j],\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_no_seri' \t\t=> '',\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_created_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_created_by'\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_revised' \t\t=> 0,\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t);\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t$this->mod->update_data_table('t_stok_gudang', $where_stok_gudang, $dataStok2);\r\n\r\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\r\n\t\t\t\t\t\t\t\t\t\t\t// INSERT\r\r\n\t\t\t\t\t\t\t\t\t\t\t$this->mod->insert_data_table('t_stok_gudang', null, $dataStok2);\r\r\n\t\t\t\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\t\t\t\t// END CHECK STOK GUDANG\r\r\n\t\t\t\t\t\t\t\t\t\t// $ulang++;\r\r\n\t\t\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\t\telse\r\r\n\t\t\t\t\t\t\t\t{\r\r\n\t\t\t\t\t\t\t\t\t// JIKA DATA BARANG TIDAK ADA DI STOK GUDANG\r\r\n\t\t\t\t\t\t\t\t\t// if($noSeri[$j] != '')\r\r\n\t\t\t\t\t\t\t\t\t// {\r\r\n\t\t\t\t\t\t\t\t\t\t// if(!isset($qtyNoSeri[$j]))\r\r\n\t\t\t\t\t\t\t\t\t\t// {\r\r\n\t\t\t\t\t\t\t\t\t\t// \t$qtyNoSeri[$j] = 0;\r\r\n\t\t\t\t\t\t\t\t\t\t// }\r\r\n\t\t\t\t\t\t\t\t\t\t// $response['belumada'][] = 'belumada';\r\r\n\t\t\t\t\t\t\t\t\t\t// $response['noSeri'][] = $noSeri[$j];\r\r\n\t\t\t\t\t\t\t\t\t\t// $response['qtyNoSeri'][] = $qtyNoSeri[$j];\r\r\n\t\t\t\t\t\t\t\t\t\t// PENAMBAHAN KARTU STOK\r\r\n\t\t\t\t\t\t\t\t\t\t$dataKStok2 = array(\r\r\n\t\t\t\t\t\t\t\t\t\t\t'm_gudang_id' \t\t\t\t=> $data['m_gudang_id'],\r\r\n\t\t\t\t\t\t\t\t\t\t\t'm_barang_id' \t\t\t\t=> $this->input->post('m_barang_id', TRUE)[$i],\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_tanggal' \t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_referensi' \t\t=> $data['penerimaan_barang_nomor'],\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_saldo' \t\t\t=> 0,\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_masuk' \t\t\t=> $data_det['penerimaan_barangdet_qty'],\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_keluar' \t\t=> 0,\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_penyesuaian'\t=> 0,\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_keterangan' \t=> \"Penerimaan Barang\",\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_created_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_created_by' \t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t\t\t\t\t\t\t\t'kartu_stok_revised' \t\t=> 0,\r\r\n\t\t\t\t\t\t\t\t\t\t);\r\r\n\t\t\t\t\t\t\t\t\t\t// END PENAMBAHAN KARTU STOK\r\r\n\t\t\t\t\t\t\t\t\t\t$insertKStok2 = $this->mod->insert_data_table('t_kartu_stok', NULL, $dataKStok2);\r\r\n\t\t\t\t\t\t\t\t\t\t$dataStok2 = array(\r\r\n\t\t\t\t\t\t\t\t\t\t\t'm_gudang_id' \t\t\t\t=> $data['m_gudang_id'],\r\r\n\t\t\t\t\t\t\t\t\t\t\t'm_barang_id' \t\t\t\t=> $this->input->post('m_barang_id', TRUE)[$i],\r\r\n\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_jumlah' \t\t=> $data_det['penerimaan_barangdet_qty'],\r\r\n\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_no_seri' \t\t=> '',\r\r\n\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_created_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_created_by'\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_revised' \t\t=> 0,\r\r\n\t\t\t\t\t\t\t\t\t\t);\r\r\n\r\r\n\r\r\n\t\t\t\t\t\t\t\t\t\t// CHECK STOK GUDANG\r\r\n\t\t\t\t\t\t\t\t\t\t// QUERY\r\r\n\t\t\t\t\t\t\t\t\t\tif (@$where_stok_gudang['data']) {\r\r\n\t\t\t\t\t\t\t\t\t\t\tunset($where_stok_gudang['data']);\r\r\n\t\t\t\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\t\t\t\t$where_stok_gudang['data'][] = array(\r\r\n\t\t\t\t\t\t\t\t\t\t\t'column' => 'm_gudang_id',\r\r\n\t\t\t\t\t\t\t\t\t\t\t'param'\t => $dataStok2['m_gudang_id']\r\r\n\t\t\t\t\t\t\t\t\t\t);\r\r\n\t\t\t\t\t\t\t\t\t\t$where_stok_gudang['data'][] = array(\r\r\n\t\t\t\t\t\t\t\t\t\t\t'column' => 'm_barang_id',\r\r\n\t\t\t\t\t\t\t\t\t\t\t'param'\t => $dataStok2['m_barang_id']\r\r\n\t\t\t\t\t\t\t\t\t\t);\r\r\n\t\t\t\t\t\t\t\t\t\t$select_stok_gudang = $this->mod->select('*', 't_stok_gudang', NULL, $where_stok_gudang);\r\r\n\r\r\n\t\t\t\t\t\t\t\t\t\tif ($select_stok_gudang) {\r\r\n\t\t\t\t\t\t\t\t\t\t\t// UPDATE\r\r\n\t\t\t\t\t\t\t\t\t\t\tforeach ($select_stok_gudang->result() as $value) {\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t$dataStok2 = array(\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'm_gudang_id' \t\t\t\t=> $value->m_gudang_id,\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'm_barang_id' \t\t\t\t=> $this->input->post('m_barang_id', TRUE)[$i],\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_jumlah' \t\t=> $data_det['penerimaan_barangdet_qty'] + $value->stok_gudang_jumlah,\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// 'stok_gudang_no_seri' \t\t=> $noSeri[$j],\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_no_seri' \t\t=> '',\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_created_date'\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_created_by'\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'stok_gudang_revised' \t\t=> 0,\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t);\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t$insertStok2 = $this->mod->update_data_table('t_stok_gudang', $where_stok_gudang, $dataStok2);\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t// echo \"string1\";\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t// print_r($dataStok2);\r\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\r\n\t\t\t\t\t\t\t\t\t\t\t// INSERT\r\r\n\t\t\t\t\t\t\t\t\t\t\t$insertStok2 = $this->mod->insert_data_table('t_stok_gudang', null, $dataStok2);\r\r\n\t\t\t\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\t\t\t\t// END CHECK STOK GUDANG\r\r\n\t\t\t\t\t\t\t\t\t// }\r\r\n\t\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\t\t// END PENAMBAHAN STOK GUDANG\r\r\n\t\t\t\t\t\t\t\t// END STOK GUDANG DAN KARTU STOK\r\r\n\t\t\t\t\t\t\t\t// $ulang2++;\r\r\n\t\t\t\t\t\t\t// }\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t// $ulang3++;\r\r\n\t\t\t\t\t\t// $response['ulang'] = $ulang;\r\r\n\t\t\t\t\t\t// $response['ulang2'] = $ulang2;\r\r\n\t\t\t\t\t\t// $response['ulang3'] = $ulang3;\r\r\n\t\t\t\t\t\t// PO\r\r\n\t\t\t\t\t\tif (@$where_po2['data']) {\r\r\n\t\t\t\t\t\t\tunset($where_po2['data']);\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t$where_po2['data'][] = array(\r\r\n\t\t\t\t\t\t\t'column' => 'orderdet_id',\r\r\n\t\t\t\t\t\t\t'param'\t => $this->input->post('orderdet_id', TRUE)[$i]\r\r\n\t\t\t\t\t\t);\r\r\n\t\t\t\t\t\t$query_po2 = $this->mod->select('*', 't_orderdet', NULL, $where_po2);\r\r\n\t\t\t\t\t\tif ($query_po2) {\r\r\n\t\t\t\t\t\t\tforeach ($query_po2->result() as $row) {\r\r\n\t\t\t\t\t\t\t\t$data_po2 = array(\r\r\n\t\t\t\t\t\t\t\t\t// 'orderdet_status'\t\t\t=> $data_det['penerimaan_barangdet_verifikasi'],\r\r\n\t\t\t\t\t\t\t\t\t'orderdet_qty_realisasi' \t=> $this->input->post('orderdet_qty_realisasi', TRUE)[$i],\r\r\n\t\t\t\t\t\t\t\t\t'orderdet_update_by'\t\t=> $this->session->userdata('user_username'),\r\r\n\t\t\t\t\t\t\t\t\t'orderdet_update_date'\t\t=> date('Y-m-d H:i:s'),\r\r\n\t\t\t\t\t\t\t\t\t'orderdet_revised' \t\t\t=> $row->orderdet_revised + 1,\r\r\n\t\t\t\t\t\t\t\t);\r\r\n\t\t\t\t\t\t\t\t$update_po2 = $this->mod->update_data_table('t_orderdet', $where_po2, $data_po2);\r\r\n\t\t\t\t\t\t\t\t// echo \"string2\";\r\r\n\t\t\t\t\t\t\t\t// print_r($data_po2);\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t// END PO\r\r\n\t\t\t\t\t} else {\r\r\n\t\t\t\t\t\t$response['status'] = '204';\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}\r\r\n\t\t\t} else {\r\r\n\t\t\t\t$response['status'] = '204';\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t\t// print_r($this->db->last_query());\r\r\n\t\techo json_encode($response);\r\r\n\t}", "public function Penyetujuan_daltu_dalnis($id) //parameter id berisikan id detail_spt \"proses acc daltu dalnis\"\n {\n $find_spt_id = DetailSpt::find($id);\n // get data anggota tim untuk di update statusnya\n $get_data_anggota = DetailSpt::where('spt_id',$find_spt_id->spt_id)->where('peran','Anggota Tim');\n // select detail by spt\n $get_peran = DetailSpt::where('spt_id',$find_spt_id->spt_id);\n\n foreach ($get_data_anggota->get() as $status_data_anggota)\n {\n $id_ketua_tim = json_encode($status_data_anggota->status['KetuaTim']);\n }\n // kondisi pengecekkan apakah pengendali teknis sudah mengisikan apa belum \" note : digunakan bila mana button tidak dihilangkan jika dihilangkan maka ini tidak berfungsi\"\n if ($status_data_anggota->status['PengendaliTeknis'] == null && $get_peran->where('user_id',auth()->user()->id)->get()[0]->peran == 'Pengendali Teknis') { //agar tidak mengupload double //Pengendali Teknis acc\n if ($id_ketua_tim != null) {\n\n // berisikan id ketua tim\n $status['KetuaTim'] = json_decode($id_ketua_tim);\n // berisikan id pengendali teknis\n $status['PengendaliTeknis'] = auth()->user()->id;\n\n $status['PengendaliMutu'] = null;\n $status['PenanggungJawab'] = null;\n // update detail spt\n $update = $get_data_anggota->update(['status'=>json_encode($status)]);\n return redirect('admin');\n }\n }else if($status_data_anggota->status['KetuaTim'] != null && $status_data_anggota->status['PengendaliTeknis'] != null && $get_peran->where('user_id',auth()->user()->id)->get()[0]->peran != 'Pengendali Teknis' && $get_peran->where('user_id',auth()->user()->id)->get()[0]->peran == 'Pengendali Mutu'){ \n //kondisi acc pengendali mutu\n // array status berisikan data2 yg meng acc kka\n $status['KetuaTim'] = json_decode($id_ketua_tim);\n $status['PengendaliTeknis'] = json_decode(json_encode($status_data_anggota->status['PengendaliTeknis']));\n $status['PengendaliMutu'] = auth()->user()->id;\n $status['PenanggungJawab'] = null;\n\n if ($status_data_anggota->status['PengendaliMutu'] == null) {//agar tidak mengupload double\n $update = $get_data_anggota->update(['status'=>json_encode($status)]);\n return redirect('admin');\n }else{\n return redirect()->back()->with('alert', 'Anda sudah menyetujui KKA tersebut');\n }\n }else{\n return redirect()->back()->with('alert', 'Anda sudah menyetujui KKA tersebut');\n }\n }", "function minutoAMinuto($id = FALSE)\n {\n $this->load->module('partidos');\n $this->load->module('alineaciones');\n $this->load->module('goles');\n $this->load->module('cambios');\n $this->load->module('tarjetas');\n $this->load->module('equipos');\n $this->load->module('cambios');\n $partidos = $this->mdl_partidos->getAllByToday();\n// $partidos = ($partidos) ? $partidos : $this->mdl_partidos->getLastGames(5);\n $data = array();\n /*\n foreach ($partidos as $partido) {\n $alineacion_local = $this->alineaciones->getAlineacionByPartidoAndEquipo($partido->id, $partido->local->id);\n $alineacion_visitante = $this->alineaciones->getAlineacionByPartidoAndEquipo($partido->id, $partido->visitante->id);\n $eventos = array();\n $cambios_local = $this->cambios->getCambiosByPartidoAndEquipo($partido->id, $partido->local->id);\n foreach ($cambios_local as $row) { // Agrego los eventos (Cambios) a la alineacion al equipo Local\n $ayuda = 1000 - $row->minuto;\n $alineacion_local[$row->entra_id]->eventos[$ayuda . 'a'] = array('accion' => 1, 'minuto' => $row->minuto, 'corto' => $row->corto_sale, 'tipo' => 1);\n $alineacion_local[$row->sale_id]->eventos[$ayuda . 'a'] = array('accion' => 1, 'minuto' => $row->minuto, 'corto' => $row->corto_entra, 'tipo' => 2);\n }\n $eventos = array_merge($eventos, $cambios_local);\n $cambios_visitante = $this->cambios->getCambiosByPartidoAndEquipo($partido->id, $partido->visitante->id);\n foreach ($cambios_visitante as $row) { // Agrego los eventos (Cambios) a la alineacion al equipo Visitante\n $alineacion_visitante[$row->entra_id]->eventos[$row->minuto . 'c'] = array('accion' => 1, 'minuto' => $row->minuto, 'corto' => $row->corto_sale, 'tipo' => 1);\n $alineacion_visitante[$row->sale_id]->eventos[$row->minuto . 'c'] = array('accion' => 1, 'minuto' => $row->minuto, 'corto' => $row->corto_entra, 'tipo' => 2);\n }\n $eventos = array_merge($eventos, $cambios_visitante);\n $goles_local = $this->goles->getGolesByPartidoAndEquipo($partido->id, $partido->local->id);\n foreach ($goles_local as $row) {\n if ($row->tipo == 0) {\n $ayuda = 1000 - $row->minuto;\n $alineacion_local[$row->jugadores_id]->eventos[$ayuda . 'c'] = array('accion' => 2, 'minuto' => $row->minuto, 'tipo' => $row->tipo, 'fallado' => $row->fallado);\n }\n if ($row->tipo == 2) {\n $alineacion_visitante[$row->jugadores_id]->eventos[$row->minuto . 'a'] = array('accion' => 2, 'minuto' => $row->minuto, 'tipo' => $row->tipo, 'fallado' => $row->fallado);\n }\n }\n $eventos = array_merge($eventos, $goles_local);\n $goles_visitante = $this->goles->getGolesByPartidoAndEquipo($partido->id, $partido->visitante->id);\n foreach ($goles_visitante as $row) {\n if ($row->tipo == 0) {\n $alineacion_visitante[$row->jugadores_id]->eventos[$row->minuto . 'a'] = array('accion' => 2, 'minuto' => $row->minuto, 'tipo' => $row->tipo, 'fallado' => $row->fallado);\n }\n if ($row->tipo == 2) {\n $ayuda = 1000 - $row->minuto;\n $alineacion_local[$row->jugador_id]->eventos[$ayuda . 'c'] = array('accion' => 2, 'minuto' => $row->minuto, 'tipo' => $row->tipo, 'fallado' => $row->fallado);\n }\n }\n $eventos = array_merge($eventos, $goles_visitante);\n $tarjetas_local = $this->tarjetas->getTarjetasByPartidoAndEquipo($partido->id, $partido->local->id);\n foreach ($tarjetas_local as $row) {\n $ayuda = 1000 - $row->minuto;\n $alineacion_local[$row->jugadores_id]->eventos[$ayuda . 'b'] = array('accion' => 3, 'minuto' => $row->minuto, 'tipo' => $row->tipo);\n }\n $eventos = array_merge($eventos, $tarjetas_local);\n $tarjetas_visitante = $this->tarjetas->getTarjetasByPartidoAndEquipo($partido->id, $partido->visitante->id);\n foreach ($tarjetas_visitante as $row) {\n $alineacion_visitante[$row->jugadores_id]->eventos[$row->minuto . 'b'] = array('accion' => 3, 'minuto' => $row->minuto, 'tipo' => $row->tipo);\n }\n $eventos = array_merge($eventos, $tarjetas_visitante);\n $minutos = array();\n foreach ($eventos as $evento) {\n array_push($minutos, $evento->minuto);\n }\n array_multisort($minutos, SORT_DESC, $eventos);\n $gameDetails = array('alineacion_local' => $alineacion_local, 'alineacion_visitante' => $alineacion_visitante, 'partidoResumen' => $partido, 'eventos' => $eventos);\n array_push($data, $gameDetails);\n }\n */\n //return $this->load->view('minutoAminuto', array('partidos' => $data, 'partidoOpen' => ($id) ? $id : FALSE), TRUE);\n return $this->load->view('minutoAminuto', array('partidos' => $partidos, 'partidoOpen' => ($id) ? $id : FALSE), TRUE);\n }", "public function pushantrian($id){\n\t\t\n\t///////////////////////////////hapuss antrian///////////////////////\n\t\tif ($_POST['hapus']==true){ ///hapuss\n\t\t\t$sql=\"update antrian set status='Batal' where id_antrian='\".$_POST['id'].\"'\";\n\t\t\t$query = $this->sendserver_m->CRUD($sql);\n\t\t\t}\n\t\n\t////////////////////////put pasien to antrian///////////////////////\n\t\telse {\n\t\t\tif ($_POST['id']!=null){\n\t\t\t\t$idantrian=$this->uuid->v4();\n\t\t\t\t$sql=\"insert into antrian (id_antrian,id_pasien,nomer_antrian,tanggal,status) select '\".$idantrian.\"','\".$_POST['id'].\"',Count(nomer_antrian)+1,'\".date('Y-m-d').\"','Antri' from antrian where tanggal='\".date('Y-m-d').\"' limit 1 \" ;\n\t\t\t\t$this->sendserver_m->CRUD($sql);\n\t\t\t\t}\n\t\t\t\t\n\t////////////////////put karyawan on antrian and rekam medik//////////\n\t\t\telse {\n\t\t\t\tif ($_POST['status']=='Antri'){\n\t\t\t\t\t\t$sql=\"update antrian set status='On Progress' where id_antrian='\".$_POST['id_antrian'].\"'\";\n\t\t\t\t\t\t$query = $this->sendserver_m->CRUD($sql);\n\t\t\t\t\t\t$sql1=\"select * from pasien where id_pasien=(select id_pasien from antrian where id_antrian='\".$_POST['id_antrian'].\"')\";\n\t\t\t\t\t\t$q = $this->db->query($sql1);\n\t\t\t\t\t\t$idrekam=$this->uuid->v4();\n\t\t\t\t\t\tforeach ($q->result() as $row){\n\t\t\t\t\t\t\t$sql2=\"insert into rekam_medik values('$idrekam','\".$row->id_pasien.\"','\".$row->nama.\"','\".$_POST['id_antrian'].\"','','\".date('Y-m-d').\"','','','','','')\";\n\t\t\t\t\t\t\t$this->sendserver_m->CRUD($sql2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->karyawantorekammedik($_POST['karyawan'],$idrekam);\n\t\t\t\t\t\treturn $idrekam;\n\t\t\t\t\t\t//table karyawan_to_rekammedik\n\t\t\t\t}\n\t\n\t\n\t///////////////////put obat, resep, diagnosa, tindakan to rekam medik//\n\t\t\t\telseif ($_POST['status']=='On Progress'){\n\t\t\t\t\t$sql=\"update antrian set status='Selesai_ditangani' where id_antrian='\".$_POST['id_antrian'].\"'\";\n\t\t\t\t\t$this->sendserver_m->CRUD($sql);\n\t\t\t\t\tif ($_POST['foto']!=null) {\n\t\t\t\t\t\t$sql1=\"update rekam_medik set galeri='\".$_POST['foto'].\"' where id_rekam_medik='\".$_POST['id_rekam_medik'].\"'\";\n\t\t\t\t\t\t$query = $this->sendserver_m->CRUD($sql1);}\n\t\t\t\t\t$idresep=$this->uuid->v4();\n\t\t\t\t\t$this->reseptorekammedik($_POST['obat'],$_POST['jumlahobat'],$_POST['resep'],$idresep,$_POST['hargaobat']);\t//table reseep////////////////////////////////\n\t\t\t\t\t$this->tindakantorekammedik($_POST['tindakan'],$_POST['id_rekam_medik'],$_POST['hargatindakan']);\t\t\t\t//table tindakan//////////////////////////////\n\t\t\t\t\t$this->diagnosatorekammedik($_POST['diagnosa'],$_POST['id_rekam_medik']);\t\t\t\t//table diagnosa//////////////////////////////\n\t\t\t\t\t$this->rekammediktobiaya($idresep,$_POST['id_rekam_medik']);\t\t\t\t\t\t\t//update rekam medik dan biaya//////////////////////// \n\t\t\t\t}\n\t\t\t\t\n\t///////////////////update rekam medik pembayaran and update stok obat//////////////\n\t\t\t\telse {\n\t\t\t\t\t$time=date(\"Y-m-d H:i:s\");\n\t\t\t\t\t$sql=\"update antrian set status='Selesai' where id_antrian='\".$_POST['id_antrian'].\"'\";\n\t\t\t\t\t$this->sendserver_m->CRUD($sql);\n\t\t\t\t\t$jumlah=$_POST['jumlahkredit'];\n\t\t\t\t\t\n\t\t\t\t\tif ($_POST['pembayaran']!='Kredit'){\n\t\t\t\t\t\t$sqli=\"select biaya from rekam_medik where id_rekam_medik='\".$_POST['id_rekam_medik'].\"'\";\n\t\t\t\t\t\t$query=$this->db->query($sqli)->result();\n\t\t\t\t\t\t$jumlah=$query[0]->biaya;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$sql1=\"update rekam_medik set jenis_pembayaran='\".$_POST['pembayaran'].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t jumlah_pembayaran='\".$jumlah.\"',\n\t\t\t\t\t\t\t\t\t\t\t\t keterangan_pembayaran='\".$_POST['keterangankredit'].\"' where id_rekam_medik='\".$_POST['id_rekam_medik'].\"'\";\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t$this->sendserver_m->CRUD($sql1);\n\t\t\t\t\t$sql2=\"select a.id_obat, a.jumlah from resep_to_obat a\n\t\t\t\t\t\tinner join resep b on a.id_resep=b.id_resep\n\t\t\t\t\t\tinner join rekam_medik c on b.id_resep=c.id_resep\n\t\t\t\t\t\twhere c.id_rekam_medik='\".$_POST['id_rekam_medik'].\"'\";\n\t\t\t\t\tforeach ($this->db->query($sql2)->result() as $q){\n\t\t\t\t\t\t$idlapobat=$this->uuid->v4();\n\t\t\t\t\t\t$sqllaporanobat=\"insert into laporan_obat select '$idlapobat','\".$q->id_obat.\"', nama,'\".$time.\"', stok, stok-\".$q->jumlah.\", '', '', 'Pengobatan', 'Pengobatan oleh pasien dengan id rekam medik \".$_POST['id_rekam_medik'].\"' \n\t\t\t\t\t\t\t\t\t\t from obat where id_obat='\".$q->id_obat.\"'\";\n\t\t\t\t\t\t$this->sendserver_m->CRUD($sqllaporanobat);\t\t\n\t\t\t\t\t\t$sql3=\"update obat set stok=stok-\".$q->jumlah.\" where id_obat='\".$q->id_obat.\"'\"; \n\t\t\t\t\t\t$this->sendserver_m->CRUD($sql3);\n\t\t\t\t\t}\n\t\t\t\t\t$id=\"PEM\".$this->uuid->v4();\n\t\t\t\t\t$sql4=\"insert into pemasukan select '\".$id.\"','\".$time.\"', jumlah_pembayaran, id_rekam_medik from rekam_medik where id_rekam_medik='\".$_POST['id_rekam_medik'].\"'\";\n\t\t\t\t\t$this->sendserver_m->CRUD($sql4);\n\t\t\t\t\t$idlaporankeuangan=$this->uuid->v4();\n\t\t\t\t\t$sql5=\"insert into laporan_keuangan values('$idlaporankeuangan','\".$id.\"','','\".$time.\"')\"; \n\t\t\t\t\t$this->sendserver_m->CRUD($sql5);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.58225197", "0.57860976", "0.5754398", "0.5719145", "0.56161475", "0.55995744", "0.5598499", "0.55638975", "0.555725", "0.5488478", "0.54485226", "0.5445246", "0.544125", "0.5406399", "0.53997713", "0.5392106", "0.5359364", "0.53492314", "0.53261214", "0.5311636", "0.5303996", "0.5301005", "0.53007627", "0.529165", "0.5281401", "0.5275997", "0.5254312", "0.5229152", "0.5227033", "0.5215582" ]
0.5921851
0
Get the http client config.
private function getHttpClientConfig() { $config = [ 'base_uri' => 'http://ip-api.com/', 'headers' => [ 'User-Agent' => 'Laravel-GeoIP', ], 'query' => [ 'fields' => 16895, ], ]; // Using the Pro service if ($this->getOption('key')) { $config['base_uri'] = $this->isSecure() ? 'https://pro.ip-api.com/' : 'http://pro.ip-api.com/'; $config['query']['key'] = $this->getOption('key'); } return $config; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClientConfig()\n {\n return $this->client_config;\n }", "public function getClientConfig();", "public static function getConfig()\n {\n /** @var \\Bugsnag\\Client $instance */\n return $instance->getConfig();\n }", "public function getConfig(){\n return $this->getClient()->getConfig();\n }", "public function getClientConfig()\n {\n // Allows the section name to be overridden in config\n $name = $this->config()->get('section_name');\n $url = trim($this->Link() ?? '', '/');\n\n if (!$name) {\n $name = static::class;\n }\n\n $clientConfig = [\n // Trim leading/trailing slash to make it easier to concatenate URL\n // and use in routing definitions.\n 'name' => $name,\n 'url' => $url,\n 'reactRoutePath' => preg_replace('/^' . preg_quote(AdminRootController::admin_url(), '/') . '/', '', $url),\n 'form' => [\n 'EditorExternalLink' => [\n 'schemaUrl' => $this->Link('methodSchema/Modals/EditorExternalLink'),\n ],\n 'EditorEmailLink' => [\n 'schemaUrl' => $this->Link('methodSchema/Modals/EditorEmailLink'),\n ],\n ],\n ];\n\n $this->extend('updateClientConfig', $clientConfig);\n\n return $clientConfig;\n }", "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 }", "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 http()\n {\n return $this->client;\n }", "protected function http()\n {\n if(!$this->client)\n $this->client = new Client($this->getHttpSettings());\n\n return $this->client;\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 }", "public function getHttpClient()\n {\n return $this->_http;\n }", "public function getHttpClient()\n {\n return $this->client;\n }", "protected function httpClient()\n {\n return $this->http ?: $this->http = new Client();\n }", "protected function getDefaultClientConfig()\n {\n return [\n 'base_uri' => 'https://api.creads-partners.com/v1/',\n ];\n }", "protected function getHttpClient()\n {\n return $this->httpClient;\n }", "public static function getConfig()\n {\n return self::$_config;\n }", "protected function getConfig()\n {\n return C::get(C::JSON_API);\n }", "public function getHttpClient()\n {\n return $this->httpClient;\n }", "public function getHttpClient()\n {\n return $this->httpClient;\n }", "public function getHttpClient()\n {\n return $this->httpClient;\n }", "public function getHttpClient()\n {\n return $this->httpClient;\n }", "public static function getConfig() {\n return self::$_config;\n }", "public function getClient()\n {\n return $this->httpClient;\n }", "public function getHttpClientOptions();", "private function get_client() {\n\t\treturn $this->client;\n\t}", "private function get_client() {\n\t\treturn $this->client;\n\t}", "public function get()\n {\n return $this->client;\n }", "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 }", "public function getHttpClient()\n {\n return $this->_httpClient;\n }", "protected function getConfig() {\n return $this->config;\n }" ]
[ "0.7474356", "0.7415138", "0.7325955", "0.6977761", "0.68804604", "0.6851565", "0.6767537", "0.67507666", "0.6659293", "0.65993506", "0.6586881", "0.6571708", "0.65346366", "0.6528611", "0.65051556", "0.6460786", "0.64524406", "0.644706", "0.644706", "0.644706", "0.644706", "0.64447063", "0.6444229", "0.6436786", "0.6436098", "0.6436098", "0.64261484", "0.642198", "0.6408052", "0.63884187" ]
0.7662264
0
Import the shop purchase
public function purchaseimport() { $handler = $this->container->get('monolog.logger.purchased_cards_log'); $applane_service = $this->container->get('appalne_integration.callapplaneservice'); $applane_service->writeAllLogs($handler, 'Entering into class [ExportManagement\ExportManagementBundle\Services\PurchaseService] and function [purchaseimport]', array()); //write log // FIX: Need to fix the implementation for reduce the memory consumption set_time_limit(0); ini_set('memory_limit', '512M'); //getting the entity manager object. $em = $this->container->get('doctrine')->getManager(); //finding the transactions ids of transaction get done yesterday(manually)/ Today(recuuring) $transaction_ids = $this->getTransactionIds(); $today = new \DateTime('now'); $today_date = $today->format('Y-m-d'); // if (!count($transaction_ids)) { // $applane_service->writeAllLogs($handler, 'NO Transaction ids. ', array()); //write log // exit('NO_DATA'); // } //get data to be imported $purchase_data = array(); $res_data = array(); $data['transaction_ids'] = $transaction_ids; //get transaction data $import_purchase_data = $applane_service->getpurchasetransactiondata($data); //get data from applane of previous day. $purchased = $this->toArray($import_purchase_data); $applane_service->writeAllLogs($handler, 'Data for import today: ' . $this->convertToJson($purchased), array()); //write log if ($import_purchase_data->code == 200) { $purchase_data = $import_purchase_data->response->result; } //check if we have some records for import if (count($purchase_data)) { //import the data. $result = $this->importPurchase($purchase_data); } $this->importConnectTypePurchase(); //import connect type transactions if (!empty($result)) { $applane_service->writeAllLogs($handler, 'DATA is imported on date: ' . $today_date, array()); //write log $data = array('code' => 101, 'message' => 'SUCCESS', 'data' => array()); } else { $applane_service->writeAllLogs($handler, 'No data is for import on date: ' . $today_date, array()); //write log $data = array('code' => 100, 'message' => 'NO_DATA', 'data' => array()); } echo json_encode($data); exit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function import() {\n\t\tglobal $woocommerce, $wpdb;\n if (!defined('XA_INVENTORY_STOCK_STATUS')) {\n define('XA_INVENTORY_STOCK_STATUS', get_option('woocommerce_manage_stock'));\n }\n if (!defined('XA_INVENTORY_STOCK_THRESHOLD')) {\n define('XA_INVENTORY_STOCK_THRESHOLD', get_option('woocommerce_notify_no_stock_amount'));\n }\n\n\t\twp_suspend_cache_invalidation( true );\n\n\t\t$this->hf_log_data_change( 'csv-import', '---' );\n\t\t$this->hf_log_data_change( 'csv-import', __( 'Processing products.', 'product-import-export-for-woo' ) );\n\n\t\tforeach ( $this->parsed_data as $key => &$item ) {\n\n\t\t\t$product = $this->parser->parse_product( $item, $this->merge_empty_cells );\n\t\t\tif ( ! is_wp_error( $product ) ){\n\t\t\t\t$this->process_product( $product );\n }else{\n\t\t\t\t$this->add_import_result( 'failed', $product->get_error_message(), 'Not parsed', json_encode( $item ), '-' ); \n }\n\t\t\tunset( $item, $product );\n\t\t}\n\t\t$this->hf_log_data_change( 'csv-import', __( 'Finished processing products.', 'product-import-export-for-woo' ) );\n\t\twp_suspend_cache_invalidation( false );\n\t}", "public function importConnectTypePurchase() {\n $em = $this->em;\n $connect_app_service = $this->container->get('sixth_continent_connect.connect_app');\n $handler = $this->container->get('monolog.logger.purchased_cards_log');\n $applane_service = $this->container->get('appalne_integration.callapplaneservice');\n $applane_service->writeAllLogs($handler, 'Entering into class [ExportManagement\\ExportManagementBundle\\Services\\PurchaseService] and function [importConnectTypePurchase]', array()); //write log\n $counter = $this->findCounter();\n $counter = $counter + 1;\n $ci_transaction_data = $em->getRepository('SixthContinentConnectBundle:SixthcontinentconnectPaymentTransaction')\n ->getCiTransactions();\n //constants\n $causale = ApplaneConstentInterface::CONNECT_TRANSACTION_CAUSALE;\n $code = ApplaneConstentInterface::CONNECT_PURCHASE_TRANSACTION_CODICE;\n $tipo_quantaza = ApplaneConstentInterface::SIX_TIPO_QUIETANZA;\n $time = new \\DateTime('now');\n foreach ($ci_transaction_data as $transaction) {\n $id = $transaction->getId();\n $applane_service->writeAllLogs($handler, 'Connect CI transaction of table [paypaltransactionrecords] with id: '.$id, array()); //write log\n $purchase = new Purchase();\n $date = $transaction->getDate();\n $formated_date = $date->format('Y-m-d');\n \n $app_id = $transaction->getAppId();\n $citizen_id = $transaction->getUserId();\n $amount = $connect_app_service->changeRoundAmountCurrency($transaction->getCiUsed());\n $paypal_id = $transaction->getPaypalId();\n $paypal_id_object = Utility::decodeData($paypal_id);\n $paypal_reciver_id = isset($paypal_id_object[0]->receiver) ? $paypal_id_object[0]->receiver : '';\n \n $current_date = date(DATE_RFC3339, strtotime($formated_date)); //change it according to application time zone\n\n $format_date_object = new \\DateTime($current_date);\n $format_date = $format_date_object->format('Y-m-d');\n $purchase_year = date('y', strtotime($format_date));\n $purchase_month = date('m', strtotime($format_date));\n $purchase_day = date('d', strtotime($format_date));\n $counter_value = str_pad($counter, 2, \"0\", STR_PAD_LEFT); //add 0 in the beginning from 1-9\n $numero_quietanza = $purchase_year . $purchase_month . $purchase_day . $counter_value;\n $description = $paypal_reciver_id;\n $purchase->setDate($date);\n $purchase->setNumeroQuietanza($numero_quietanza);\n $purchase->setTipoQuietanza($tipo_quantaza);\n $purchase->setCausale($causale);\n $purchase->setCode($code);\n $purchase->setDescription($description);\n $purchase->setAmount($amount);\n $purchase->setShopId($app_id);\n $purchase->setCitizenId($citizen_id);\n $purchase->setCreatedAt($time);\n $em->persist($purchase); //persist the data\n $counter++;\n }\n try {\n $em->flush();\n $applane_service->writeAllLogs($handler, 'Data saved successfully', array()); //write log\n } catch (\\Exception $ex) {\n $applane_service->writeAllLogs($handler, 'Exiting from class [ExportManagement\\ExportManagementBundle\\Services\\PurchaseService] and function [importConnectTypePurchase] wiith error: '.$ex->getMessage(), array()); //write log\n }\n $applane_service->writeAllLogs($handler, 'Exiting from class [ExportManagement\\ExportManagementBundle\\Services\\PurchaseService] and function [importConnectTypePurchase]', array()); //write log\n return true;\n }", "public function importPurchase($purchase_data) {\n //getting the entity manager object.\n $em = $this->container->get('doctrine')->getManager();\n $applane_service = $this->container->get('appalne_integration.callapplaneservice');\n $time = new \\DateTime('now');\n $counter = 1;\n foreach ($purchase_data as $data) {\n $purchase = new Purchase();\n $date_data = (isset($data->date) ? $data->date : null);\n $current_date = date(DATE_RFC3339, strtotime($date_data)); //change it according to application time zone\n $code = (isset($data->card_code) ? $data->card_code : '');\n $description = (isset($data->card_no) ? $data->card_no : '');\n $amount = (isset($data->credit) ? $data->credit : 0);\n $shop_id = (isset($data->shop_id->_id) ? $data->shop_id->_id : 0);\n $citizen_id = (isset($data->citizen_id->_id) ? $data->citizen_id->_id : 0);\n\n $format_date_object = new \\DateTime($current_date);\n $format_date = $format_date_object->format('Y-m-d');\n $purchase_year = date('y', strtotime($format_date));\n $purchase_month = date('m', strtotime($format_date));\n $purchase_day = date('d', strtotime($format_date));\n $counter_value = str_pad($counter, 2, \"0\", STR_PAD_LEFT); //add 0 in the beginning from 1-9\n $numero_quietanza = $purchase_year . $purchase_month . $purchase_day . $counter_value;\n\n $purchase->setDate(new \\DateTime($date_data));\n $purchase->setNumeroQuietanza($numero_quietanza);\n $purchase->setTipoQuietanza(ApplaneConstentInterface::SIX_TIPO_QUIETANZA);\n $purchase->setCausale(ApplaneConstentInterface::SIX_CAUSALE);\n $purchase->setCode($code);\n $purchase->setDescription($description);\n $purchase->setAmount($amount);\n $purchase->setShopId($shop_id);\n $purchase->setCitizenId($citizen_id);\n $purchase->setCreatedAt($time);\n $em->persist($purchase); //persist the data\n $counter++;\n }\n try {\n $em->flush(); //flush the data \n $applane_service->writeTransactionLogs('Purchase Data to be import: ' . json_encode($purchase_data), 'purchase imported data successfully'); //write log\n return 1;\n } catch (\\Exception $ex) {\n $applane_service->writeTransactionLogs('Purchase Data to be import: ' . json_encode($purchase_data), 'purchase imported data failure'); //write log\n return 0;\n }\n }", "public function importAction ()\n {\n $this->model->import_provider_products ();\n $this->_redirect ('/produkte/index/index');\n }", "function import() {\n\t\t// vyprazdnim tabulku\n\t\t$this->truncate();\n\t\t$condition = null;\n\t\t$snProducts = $this->findAllSn();\n\t\tforeach ($snProducts as $snProduct) {\n\t\t\tif ($product = $this->transformSn($snProduct)) {\n\t\t\t\t$this->create();\n\t\t\t\tif (!$this->save($product)) {\n\t\t\t\t\tdebug($product);\n\t\t\t\t\tdebug($this->validationErrors);\n\t\t\t\t\t$this->save($product, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function importProduct($data) {\n if (count($data)) {\n Mage::getModel('admin/session')->setData('receipt_product_import', $data);\n }\n }", "function importProducts($file)\n {\n $this->addToLog('-- Products import start');\n $imported = 0;\n\n // Read products file\n if ($products_file = fopen($file, 'r')) {\n $this->addToLog('-- Read file ' . $file);\n fgetcsv($products_file);\n\n while (($row = fgetcsv($products_file, 4000, ';')) !== false) {\n $reference = (int)$row[0];\n $name = $row[1];\n $price = $row[3];\n $quantity = (int)$row[4];\n\n // Find product by reference\n $sql = 'SELECT p.id_product FROM `'._DB_PREFIX_.'product` p\n WHERE p.reference = '.$reference;\n $product_id = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);\n\n $sql = 'SELECT pa.id_product_attribute FROM `'._DB_PREFIX_.'product_attribute` pa\n WHERE pa.reference = ' . $reference;\n $combination_id = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);\n\n if ($product_id and !$combination_id) {\n $product = new Product($product_id);\n $product->price = $price;\n $product->update();\n\n StockAvailable::setQuantity(\n $product_id,\n 0,\n $quantity\n );\n $imported++;\n\n } else {\n // Try to find combination by reference id\n if ($combination_id) {\n // Update combination price and quantity\n $combination = new Combination($combination_id);\n $combination->price = $price;\n $combination->wholesale_price = $price;\n $combination->update();\n\n // Set combination product price to 0\n $product = new Product($combination->id_product);\n $product->price = 0;\n $product->update();\n\n StockAvailable::setQuantity(\n $combination->id_product,\n $combination->id,\n $quantity\n );\n $imported++;\n }\n }\n }\n\n fclose($products_file);\n } else {\n $this->addToLog('ERROR: Could no open file ' . $file);\n }\n $this->addToLog('-- Products import end. Updated ' . $imported . ' products');\n }", "public function store(Request $request)\n {\n $inputs = $request->all();\n if($inputs){\n $purchase_settings = PurchaseSettings::where('type','=','MAIN')->first();\n $purchaseOrderLastId = DB::table('purchase_transactions')->latest('id')->first() !== null ? DB::table('purchase_transactions')->latest('id')->first()->id +1 : 1 ;\n $purchase = new PurchaseTransactions();\n $purchase->branch_id = 1;\n $purchase->supplier_id = $inputs['supplier_id'];\n $purchase->employee_id = 1;\n $purchase->reference = $purchase_settings->prefix_order.'_'.$purchase_settings->sequence_number.$purchaseOrderLastId;\n $purchase->type = 'Purchase_Order';\n $purchase->invoice_no = $inputs['invoice_no'];\n $purchase->invoice_type = $inputs['invoice_type'];\n $purchase->issued_date = $inputs['issued_date'];\n $purchase->due_date = $inputs['due_date'];\n $purchase->total_tax_amount = $inputs['total_tax_amount'];\n $purchase->total_discount_amount = $inputs['discount_value'];\n $purchase->subtotal = $inputs['subtotal'];\n $purchase->total_amount = $inputs['total_amount'];\n $purchase->total_balance = $inputs['total_amount'];\n $purchase->total_items = count($inputs['items']);\n $purchase->total_qty = $inputs['total_qty'];\n $purchase->total_due = $inputs['total_due'];\n $purchase->outstanding_balance = ($inputs['total_amount'] - $inputs['total_due'] ) ;\n $purchase->status = 'IN-PROGRESS';\n if ($purchase->outstanding_balance === 0){\n $purchase->status = 'COMPLETE';\n }\n $purchase->save();\n $directory = 'resources/core_data/Purchases/orders/'.$purchase->id;\n if (! File::exists($directory)) {\n File::makeDirectory($directory,0777,true);\n }\n// dd($inputs['items']);\n if(is_array($inputs['items']) && !empty($inputs['items'])){\n foreach ($inputs['items'] as $value){\n $purchase_items = new PurchaseTransactionDetails();\n $purchase_items->purchase_transactions_id = $purchase->id;\n $purchase_items->product_id = Product::with('product_images','category')->where('sku','=',$value['sku'])->first()->id;\n $purchase_items->supplier_id = $inputs['supplier_id'];\n $purchase_items->employee_id = 1;\n $purchase_items->qty = $value['qty'];\n $purchase_items->price = $value['price'];\n $purchase_items->discount_value = $value['discount_value'];\n $purchase_items->subtotal = $value['subtotal'];\n $purchase_items->tax_value = $value['total_tax_amount'];\n $purchase_items->total = $value['total_amount'];\n $purchase_items->save();\n }\n }\n if(is_array($inputs['payments']) && !empty($inputs['payments'])){\n foreach ($inputs['payments'] as $value){\n $purchase_payments = new PurchasePayments();\n $purchase_payments->purchase_transactions_id = $purchase->id;\n $purchase_payments->employee_id = 1;\n $purchase_payments->supplier_id = $inputs['supplier_id'];\n $purchase_payments->payment_method = $value['payment_method'];\n $value['payment_method'] === 'CASH' ? $purchase_payments->payment_account = 'CASH_ACCOUNT' : $purchase_payments->payment_account = 'BANK_ACCOUNT';\n $reference = DB::table('purchase_payments')->latest('id')->first() !== null ? DB::table('purchase_payments')->latest('id')->first()->id +1 : 1 ;\n $purchase_payments->reference = 'PYT-'.$reference;\n $purchase_payments->amount = $value['amount'];\n $purchase_payments->outstanding_balance = $value['outstanding_balance'];\n $purchase_payments->date = $value['date'];\n $purchase_payments->status = $value['status'];\n $purchase_payments->save();\n }\n }\n\n if(is_array($inputs['documents']) && !empty($inputs['documents'])){\n foreach ($inputs['documents'] as $value){\n $purchase_documents = new PurchaseDocuments();\n if($value['file']){\n $fileName = 'PurchaseOrderFile_'.$purchase->id.'.'.$value['file']->getClientOriginalExtension();\n $value['file']->move($directory.'/'.$purchase->id, $fileName);\n }\n $purchase_documents->purchase_transactions_id = $purchase->id;\n $purchase_documents->employee_id = 1;\n $purchase_documents->type = $value['type'];\n $purchase_documents->name = $value['name'];\n $purchase_documents->file = $fileName;\n $purchase_documents->remarks = $value['remarks'];\n $purchase_documents->save();\n }\n }\n return response()->json(['status' => 'success', 'data' => $purchase]);\n }\n }", "function erp_acct_convert_order_to_purchase( $purchase_data, $purchase_id ) {\n global $wpdb;\n\n $user_id = get_current_user_id();\n\n try {\n $wpdb->query( 'START TRANSACTION' );\n\n $purchase_data = erp_acct_get_formatted_purchase_data( $purchase_data, $purchase_id );\n\n // erp_acct_purchase\n $wpdb->update(\n $wpdb->prefix . 'erp_acct_purchase',\n [\n 'vendor_id' => $purchase_data['vendor_id'],\n 'vendor_name' => $purchase_data['vendor_name'],\n 'trn_date' => $purchase_data['trn_date'],\n 'due_date' => $purchase_data['due_date'],\n 'amount' => $purchase_data['amount'],\n 'ref' => $purchase_data['ref'],\n 'status' => 2,\n 'purchase_order' => false,\n 'attachments' => $purchase_data['attachments'],\n 'particulars' => $purchase_data['particulars'],\n 'created_at' => $purchase_data['created_at'],\n 'created_by' => $purchase_data['created_by'],\n 'updated_at' => $purchase_data['updated_at'],\n 'updated_by' => $purchase_data['updated_by'],\n ],\n [ 'voucher_no' => $purchase_id ]\n );\n\n // remove data from erp_acct_purchase_details\n $wpdb->delete( $wpdb->prefix . 'erp_acct_purchase_details', [ 'trn_no' => $purchase_id ] );\n\n foreach ( $purchase_data['line_items'] as $item ) {\n $wpdb->insert( $wpdb->prefix . 'erp_acct_purchase_details', array(\n 'trn_no' => $purchase_id,\n 'product_id' => $item['product_id'],\n 'qty' => $item['qty'],\n 'price' => $item['unit_price'],\n 'amount' => (float) $item['qty'] * (float) $item['unit_price'],\n 'updated_at' => date( 'Y-m-d' ),\n 'updated_by' => $user_id\n ) );\n }\n\n $wpdb->insert( $wpdb->prefix . 'erp_acct_purchase_account_details', array(\n 'purchase_no' => $purchase_id,\n 'trn_no' => $purchase_id,\n 'trn_date' => $purchase_data['trn_date'],\n 'particulars' => $purchase_data['particulars'],\n 'credit' => $purchase_data['amount'],\n 'updated_at' => date( 'Y-m-d' ),\n 'updated_by' => $user_id\n ) );\n\n erp_acct_insert_purchase_data_into_ledger( $purchase_data );\n\n $data['dr'] = 0;\n $data['cr'] = $purchase_data['amount'];\n $data['vendor_id'] = $purchase_data['vendor_id'];\n erp_acct_insert_data_into_people_trn_details( $data, $purchase_id );\n\n $wpdb->query( 'COMMIT' );\n\n } catch ( Exception $e ) {\n $wpdb->query( 'ROLLBACK' );\n return new WP_error( 'purchase-exception', $e->getMessage() );\n }\n\n $purchase = erp_acct_get_purchase( $purchase_id );\n\n $purchase['email'] = erp_get_people_email( $purchase['vendor_id'] );\n\n do_action( 'erp_acct_new_transaction_purchase', $purchase_id, $purchase );\n\n return $purchase;\n}", "public function csvImport()\n {\n $sourcePath = getcwd() . '\\src\\Console\\src\\stock.csv';\n //set path to report.csv file\n $destPath = getcwd() . '\\src\\Console\\src\\report.csv';\n\n //object to read csv file\n $csvHandlerRead = new CsvHandler($sourcePath);\n\n //object to write the report.csv file\n $csvHandlerWrite = new CsvHandler($destPath, 'w');\n\n //get the headers of the stock.csv file\n $header = $csvHandlerRead->getHeader();\n\n //set headers\n $csvHandlerWrite->setHeader($header);\n $csvHandlerWrite->writeHeaderLine();\n\n //parse csv file associatively\n while ($data = $csvHandlerRead->readAssocNextRecord()) {\n //proudcts that will be inserted to db\n $product = [];\n\n $valid = true;\n $discounted = false;\n if ($data['Cost in GBP'] < 5 && $data['Stock'] < 10) {\n $valid = false;\n } elseif ($data['Cost in GBP'] > 1000) {\n $valid = false;\n }\n if (strtolower($data['Discontinued']) == 'yes') {\n $valid = true;\n $discounted = true;\n }\n if ($valid == true) {\n $product = [\n 'name' => $data['Product Name'],\n 'description' => $data['Product Description'],\n 'code' => $data['Product Code'],\n 'stock' => $data['Stock'],\n 'price' => $data['Cost in GBP']\n ];\n\n //create new product entity\n $import = new QuizEntity();\n\n $import->setName($product['name']);\n $import->setDescription($product['description']);\n $import->setCode($product['code']);\n $import->setStock($product['stock']);\n $import->setPrice($product['price']);\n\n $date = date('Y-m-d H:i:s');\n\n if ($discounted == true) {\n //@TODO fix this!!!\n $import->setDiscontinuedAt($date);\n }\n\n $this->service->import($import);\n } else {\n $csvHandlerWrite->writeCsvLine($data);\n }\n }\n echo 'see items that were skipped in src\\Console\\src\\report.csv';\n }", "public function store(ProductImportRequest $request)\n {\n \n if($request->status=='Hoàn thành'){\n Product::updateQuantity($request);\n }\n $receiptStock=ReceiptStock::store($request);\n $request->merge([\"document_code\"=>$receiptStock[0]]);\n $request->merge([\"document_date\"=>$receiptStock[1]]);\n $request->merge([\"date\"=>$receiptStock[1]]);\n ReceiptStockDetail::store($request);\n Supplier::updateDeal($request);\n Cashflow::storeCashflow($request);\n if($request->debt>0){\n $request->merge([\"debit\"=>$request->debt]);\n $category='CNPC';\n Debt::store($request,$category);\n }\n return response()->json(true);\n \n }", "public function addPurchaseBulk()\r\n {\r\n if (!auth()->user()->can('purchase.create')) {\r\n abort(403, 'Unauthorized action.');\r\n }\r\n\r\n $business_id = request()->session()->get('user.business_id');\r\n\r\n //Check if subscribed or not\r\n if (!$this->moduleUtil->isSubscribed($business_id)) {\r\n return $this->moduleUtil->expiredResponse();\r\n }\r\n\r\n $taxes = TaxRate::where('business_id', $business_id)\r\n ->get();\r\n $orderStatuses = $this->productUtil->orderStatuses();\r\n $business_locations = BusinessLocation::forDropdown($business_id);\r\n\r\n $currency_details = $this->transactionUtil->purchaseCurrencyDetails($business_id);\r\n\r\n $default_purchase_status = null;\r\n if (request()->session()->get('business.enable_purchase_status') != 1) {\r\n $default_purchase_status = 'received';\r\n }\r\n\r\n $types = [];\r\n if (auth()->user()->can('supplier.create')) {\r\n $types['supplier'] = __('report.supplier');\r\n }\r\n if (auth()->user()->can('customer.create')) {\r\n $types['customer'] = __('report.customer');\r\n }\r\n if (auth()->user()->can('supplier.create') && auth()->user()->can('customer.create')) {\r\n $types['both'] = __('lang_v1.both_supplier_customer');\r\n }\r\n $customer_groups = ContactGroup::forDropdown($business_id);\r\n\r\n $business_details = $this->businessUtil->getDetails($business_id);\r\n $shortcuts = json_decode($business_details->keyboard_shortcuts, true);\r\n\r\n $payment_line = $this->dummyPaymentLine;\r\n $payment_types = $this->productUtil->payment_types(null, true, true);\r\n // no need thease methods in purchase page\r\n unset($payment_types['card']);\r\n unset($payment_types['credit_sale']);\r\n //Accounts\r\n $accounts = $this->moduleUtil->accountsDropdown($business_id, true);\r\n\r\n $contact_id = $this->businessUtil->check_customer_code($business_id, 1);\r\n\r\n $temp_data = DB::table('temp_data')->where('business_id', $business_id)->select('pos_create_data')->first();\r\n if (!empty($temp_data)) {\r\n $temp_data = json_decode($temp_data->pos_create_data); //name by mistake it is purchase\r\n }\r\n if (!request()->session()->get('business.popup_load_save_data')) {\r\n $temp_data = [];\r\n }\r\n\r\n\r\n $tanks = FuelTank::where('business_id', $business_id)->pluck('fuel_tank_number', 'id');\r\n $is_petro_enable = $this->moduleUtil->hasThePermissionInSubscription($business_id, 'enable_petro_module');\r\n\r\n $purchase_no = $this->businessUtil->getFormNumber('purchase');\r\n\r\n $bank_group_accounts = Account::leftjoin('account_groups', 'accounts.asset_type', 'account_groups.id')\r\n ->where('accounts.business_id', $business_id)\r\n ->where('account_groups.name', 'Bank Account')\r\n ->pluck('accounts.name', 'accounts.id');\r\n\r\n return view('purchase.add_purchase_bulk')\r\n ->with(compact('purchase_no', 'is_petro_enable', 'tanks', 'contact_id', 'temp_data', 'taxes', 'orderStatuses', 'business_locations', 'currency_details', 'default_purchase_status', 'customer_groups', 'types', 'shortcuts', 'payment_line', 'payment_types', 'accounts', 'bank_group_accounts'));\r\n }", "public function store(Request $request)\r\n {\r\n if (!auth()->user()->can('purchase.create')) {\r\n abort(403, 'Unauthorized action.');\r\n }\r\n\r\n try {\r\n $business_id = request()->session()->get('user.business_id');\r\n DB::table('temp_data')->where('business_id', $business_id)->update(['pos_create_data' => '']);\r\n\r\n $business_id = $request->session()->get('user.business_id');\r\n\r\n //Check if subscribed or not\r\n if (!$this->moduleUtil->isSubscribed($business_id)) {\r\n return $this->moduleUtil->expiredResponse(action('PurchaseController@index'));\r\n }\r\n $store_id = $request->input('store_id');\r\n $transaction_data = $request->only(['invoice_no', 'ref_no', 'status', 'contact_id', 'transaction_date', 'total_before_tax', 'location_id', 'discount_type', 'discount_amount', 'tax_id', 'tax_amount', 'shipping_details', 'shipping_charges', 'final_total', 'additional_notes', 'exchange_rate', 'pay_term_number', 'pay_term_type']);\r\n\r\n $exchange_rate = $transaction_data['exchange_rate'];\r\n\r\n //Adding temporary fix by validating\r\n $request->validate([\r\n 'status' => 'required',\r\n 'contact_id' => 'required',\r\n 'transaction_date' => 'required',\r\n 'total_before_tax' => 'required',\r\n 'location_id' => 'required',\r\n 'final_total' => 'required',\r\n 'store_id' => 'required',\r\n 'document' => 'file|max:' . (config('constants.document_size_limit') / 1000)\r\n ]);\r\n\r\n $user_id = $request->session()->get('user.id');\r\n $enable_product_editing = $request->session()->get('business.enable_editing_product_from_purchase');\r\n\r\n //Update business exchange rate.\r\n Business::update_business($business_id, ['p_exchange_rate' => ($transaction_data['exchange_rate'])]);\r\n\r\n $currency_details = $this->transactionUtil->purchaseCurrencyDetails($business_id);\r\n\r\n //unformat input values\r\n $transaction_data['total_before_tax'] = $this->productUtil->num_uf($transaction_data['total_before_tax'], $currency_details) * $exchange_rate;\r\n\r\n // If discount type is fixed them multiply by exchange rate, else don't\r\n if ($transaction_data['discount_type'] == 'fixed') {\r\n $transaction_data['discount_amount'] = $this->productUtil->num_uf($transaction_data['discount_amount'], $currency_details) * $exchange_rate;\r\n } elseif ($transaction_data['discount_type'] == 'percentage') {\r\n $transaction_data['discount_amount'] = $this->productUtil->num_uf($transaction_data['discount_amount'], $currency_details);\r\n } else {\r\n $transaction_data['discount_amount'] = 0;\r\n }\r\n\r\n $transaction_data['tax_amount'] = $this->productUtil->num_uf($transaction_data['tax_amount'], $currency_details) * $exchange_rate;\r\n $transaction_data['shipping_charges'] = $this->productUtil->num_uf($transaction_data['shipping_charges'], $currency_details) * $exchange_rate;\r\n $transaction_data['final_total'] = $this->productUtil->num_uf($transaction_data['final_total'], $currency_details) * $exchange_rate;\r\n\r\n $transaction_data['business_id'] = $business_id;\r\n $transaction_data['created_by'] = $user_id;\r\n $transaction_data['type'] = 'purchase';\r\n $transaction_data['payment_status'] = 'due';\r\n $transaction_data['store_id'] = $request->input('store_id');\r\n $transaction_data['transaction_date'] = $this->productUtil->uf_date($transaction_data['transaction_date'], true);\r\n\r\n //upload document\r\n $transaction_data['document'] = $this->transactionUtil->uploadFile($request, 'document', 'documents');\r\n\r\n DB::beginTransaction();\r\n\r\n //Update reference count\r\n $ref_count = $this->productUtil->setAndGetReferenceCount($transaction_data['type']);\r\n //Generate reference number\r\n if (empty($transaction_data['ref_no'])) {\r\n $transaction_data['ref_no'] = $this->productUtil->generateReferenceNumber($transaction_data['type'], $ref_count);\r\n }\r\n\r\n $transaction = Transaction::create($transaction_data);\r\n\r\n $purchase_lines = [];\r\n $purchases = $request->input('purchases');\r\n\r\n $this->productUtil->createOrUpdatePurchaseLines($transaction, $purchases, $currency_details, $enable_product_editing, $store_id);\r\n //Add qty to sepcific tank if fuel category tank\r\n if (!empty($request->tanks)) {\r\n foreach ($request->tanks as $key => $tank) {\r\n if (!empty($tank['qty'])) {\r\n FuelTank::where('id', $key)->increment('current_balance', !empty($tank['qty']) ? $tank['qty'] : 0);\r\n $product_id = FuelTank::where('id', $key)->first()->product_id;\r\n TankPurchaseLine::create([\r\n 'business_id' => $business_id,\r\n 'transaction_id' => $transaction->id,\r\n 'tank_id' => $key,\r\n 'product_id' => $product_id,\r\n 'quantity' => !empty($tank['qty']) ? $tank['qty'] : 0,\r\n 'instock_qty' => !empty($tank['instock_qty']) ? $tank['instock_qty'] : 0,\r\n ]);\r\n }\r\n }\r\n }\r\n $payments = $request->input('payment');\r\n $due_remaining = 0;\r\n $total_paying = 0;\r\n foreach ($payments as $payment_arr) {\r\n $total_paying += $payment_arr['amount'];\r\n }\r\n if ($total_paying < $transaction->final_total) { // paying amount less then transaction total then pay by advance \r\n $due_remaining = $this->transactionUtil->adjustAdvancePayments($transaction, $payments[0]['amount'], $business_id); //paid by advance amounts\r\n }\r\n if ($due_remaining > 0) {\r\n //set paid amount paid by advances and by user paying \r\n $payments[0]['amount'] = $transaction->final_total - $due_remaining; // reduce due amount from transaction total amount\r\n }\r\n //Add Purchase payments\r\n $this->transactionUtil->createOrUpdatePaymentLines($transaction, $payments);\r\n\r\n //add stock account transactions\r\n $this->transactionUtil->manageStockAccount($transaction, [], 'debit', $transaction->final_total);\r\n\r\n //update payment status\r\n $this->transactionUtil->updatePaymentStatus($transaction->id, $transaction->final_total);\r\n\r\n //Adjust stock over selling if found\r\n $this->productUtil->adjustStockOverSelling($transaction);\r\n\r\n DB::commit();\r\n\r\n $output = [\r\n 'success' => 1,\r\n 'msg' => __('purchase.purchase_add_success')\r\n ];\r\n } catch (\\Exception $e) {\r\n DB::rollBack();\r\n Log::emergency(\"File:\" . $e->getFile() . \"Line:\" . $e->getLine() . \"Message:\" . $e->getMessage());\r\n\r\n $output = [\r\n 'success' => 0,\r\n 'msg' => __('messages.something_went_wrong')\r\n ];\r\n }\r\n\r\n return redirect('purchases')->with('status', $output);\r\n }", "public function import()\n {\n $queryHelper = new PISGoodsImportQueryHelper();\n $insertRows = [];\n $lastSerNo = NULL;\n\n $this\n ->odbcFetchArray($queryHelper->genSelectQuery(), $this->getInsertFunc(), $insertRows)\n ->odbcFetchArray($queryHelper->genFetchLastSerNoQuery(), $this->getLastFunc(), $lastSerNo)\n ;\n\n $this->displayAllQuery($queryHelper, $insertRows, $lastSerNo);\n\n return;\n }", "public function store(Request $request)\n {\n try {\n\n $this->validate($request, [\n 'vendor' => 'required',\n 'invoice_number' => 'required|unique:tbl_purchase',\n 'invoice_date' => 'required',\n 'due_date' => 'required',\n ]);\n\n \n $invoice_date = Carbon::createFromFormat('m/d/Y', $request->input('invoice_date'))->toDateString();\n $due_date = Carbon::createFromFormat('m/d/Y', $request->input('due_date'))->toDateString();\n $invoice_number = $request->input('invoice_number');\n $create_by = Auth::guard('auth')->user()->id;\n\n $sale = new Purchase;\n $sale->invoice_number = $invoice_number;\n $sale->reference = $request->input('reference');\n $sale->vendor_id = $request->input('vendor');\n $sale->invoice_date = $invoice_date;\n $sale->due_date = $due_date;\n $sale->sub_total = $this->custom->intCurrency($request->input('sub_total'));\n\n $unitAmount = $request->input('line_unit_price');\n $discount = $request->input('discount');\n $discount1 = $request->input('discount1');\n //$this->custom->intCurrency($request->input('discount'))\n $qty_dis = $this->custom->intCurrency($unitAmount[0] * $discount);\n $total_dis= $this->custom->intCurrency($qty_dis + $discount1);\n $sale->discount = $total_dis;\n $sale->total = $this->custom->intCurrency($request->input('total'));\n $sale->note = $request->input('note');\n $sale->status = '0';\n $sale->paid_status = '3';\n $sale->added_by = $create_by;\n\n\n\n\n\n $sale->save();\n \n if(count($request->input('line_qty')) > 0)\n {\n\n $title = $request->input('title');\n $line_qty = $request->input('line_qty');\n $line_unit_price = $request->input('line_unit_price');\n $product = $request->input('truck_product');\n \n \n $line_total = $request->input('line_total');\n\n $sale_details = [];\n for($i=0; $i < count($line_qty); $i++)\n {\n $sale_details[] = [\n 'sale_id' => $sale->id,\n 'title' => $title[$i],\n// 'description' => $line_desc[$i],\n 'product' => $product[$i],\n 'qty' => $line_qty[$i],\n 'unit_price' => $this->custom->intCurrency($line_unit_price[$i]),\n 'amount' => $this->custom->intCurrency($line_total[$i]),\n 'origin' => $request->input('origin'),\n 'destination' => $request->input('destination')\n ];\n }\n\n\n\n DB::table('tbl_purchase_detail')->insert($sale_details);\n $updateQuantity = $line_qty[0];\n $currentQuantity = DB::table('tbl_truck_detail')->select('quantity')->where([\n ['product_id','=', $product[0]],\n ['truck_id','=', $title[0]],\n ])->first();\n \n $temp = $updateQuantity + $currentQuantity->quantity;\n DB::table('tbl_truck_detail')->where([\n ['product_id', $product[0]],\n ['truck_id', $title[0]],\n ])->update(['quantity' => $temp]);\n }\n\n $request->session()->flash('msg', __('admin/entries.sales_added'));\n return redirect('accounting/purchase/add');\n \n } catch (ModelNotFoundException $e) {\n return redirect('accounting/purchase');\n }\n }", "private function import($data){\n $data['orderid'] = I(\"get.id\");\n foreach($data as $key=>$val) {\n $this->assign($key, $val);\n }\n $html = $this->fetch(\"Warehouse:import\");\n echo $html;\n }", "public function store(Request $request)\n {\n\n $request->validate([\n 'date' => 'required',\n 'requisition_date' => 'required',\n 'vendor_confirm_date' => 'required',\n 'shipping_date' => 'required',\n 'reference' => 'required',\n 'location_id' => 'required',\n ]);\n\n $req = new Purchase();\n $file_name = '';\n\n if($request->file('document') != null){\n $fileName = time().'.'.$request->document->extension(); \n \n $request->document->move(public_path('uploads/purchase_document'), $fileName);\n $file_name = 'uploads/purchase_document/'.$fileName;\n }\n \n\n $req->date = $request->date;\n $req->requisition_date = $request->requisition_date;\n $req->vendor_confirm_date = $request->vendor_confirm_date;\n $req->shipping_date = $request->shipping_date;\n $req->reference = $request->reference;\n $req->location_id = $request->location_id;\n $req->status = $request->status;\n $req->document_file = $file_name;\n $req->is_foc = $request->is_foc;\n $req->vendor_id = $request->vendor_id;\n $req->discount = $request->discount;\n $req->tax = $request->tax;\n $req->note = $request->note;\n $req->user_id = \\Auth::id();\n if (isset($request->foc_items)) {\n $req->is_foc = true;\n }else{\n $req->is_foc = false;\n }\n if($req->save()){\n $items = $request->purchase_order_items;\n foreach ($items as $item) {\n $req_item = new PurchaseOrderWiseItem();\n $req_item->purchase_id = $req->id;\n $req_item->item_id = $item['id'];\n $req_item->location_id = $request->location_id;\n $req_item->quantity = $item['quantity'];\n $req_item->cost = $item['cost'];\n $req_item->discount = $item['discount'];\n $req_item->save();\n }\n if(isset($request->foc_items)){\n $items = $request->foc_items;\n foreach ($items as $item) {\n $req_item = new FOCItems();\n $req_item->purchase_id = $req->id;//May Cause Error\n $req_item->item_id = $item['id'];\n $req_item->quantity = $item['quantity'];\n $req_item->save();\n\n }\n }\n return redirect()->back()->with('success', 'Added Successfully!');\n }\n }", "function erp_acct_insert_purchase_data_into_ledger( $purchase_data ) {\n global $wpdb;\n\n $ledger_map = \\WeDevs\\ERP\\Accounting\\Includes\\Classes\\Ledger_Map::get_instance();\n $ledger_id = $ledger_map->get_ledger_id_by_slug( 'purchase' );\n\n if ( ! $ledger_id ) {\n return new WP_Error( 505, 'Ledger ID not found for purchase', $purchase_data );\n }\n // Insert amount in ledger_details\n $wpdb->insert(\n $wpdb->prefix . 'erp_acct_ledger_details',\n array(\n\t\t\t'ledger_id' => $ledger_id,\n\t\t\t'trn_no' => $purchase_data['voucher_no'],\n\t\t\t'particulars' => $purchase_data['particulars'],\n\t\t\t'debit' => $purchase_data['amount'],\n\t\t\t'credit' => 0,\n\t\t\t'trn_date' => $purchase_data['trn_date'],\n\t\t\t'created_at' => $purchase_data['created_at'],\n\t\t\t'created_by' => $purchase_data['created_by'],\n\t\t\t'updated_at' => $purchase_data['updated_at'],\n\t\t\t'updated_by' => $purchase_data['updated_by'],\n )\n );\n\n}", "public function store(Request $request)\n {\n if (!auth()->user()->can('purchase.create')) {\n abort(403, 'Unauthorized action.');\n }\n\n try {\n $business_id = $request->session()->get('user.business_id');\n\n //Check if subscribed or not\n if (!$this->moduleUtil->isSubscribed($business_id)) {\n return $this->moduleUtil->expiredResponse(action('PurchaseController@index'));\n }\n\n// $transaction_data = $request->only([ 'ref_no', 'status', 'contact_id', 'bank_id', 'transaction_date', 'total_before_tax', 'location_id','discount_type', 'discount_amount','tax_id', 'tax_amount', 'shipping_details', 'shipping_charges', 'final_total', 'additional_notes', 'exchange_rate']);\n $transaction_data = $request->only([ 'ref_no', 'status', 'contact_id', 'bank_id', 'transaction_date', 'total_before_tax', 'location_id', 'shipping_details', 'shipping_charges', 'final_total', 'additional_notes', 'exchange_rate']);\n $transaction_data['discount_type'] = null;\n $transaction_data['discount_amount'] = 0;\n $transaction_data['tax_amount'] = 0;\n\n $exchange_rate = $transaction_data['exchange_rate'];\n\n //Reverse exchange rate and save it.\n //$transaction_data['exchange_rate'] = $transaction_data['exchange_rate'];\n\n //TODO: Check for \"Undefined index: total_before_tax\" issue\n //Adding temporary fix by validating\n $request->validate([\n 'status' => 'required',\n 'contact_id' => 'required',\n 'transaction_date' => 'required',\n 'total_before_tax' => 'required',\n 'location_id' => 'required',\n 'final_total' => 'required',\n 'document' => 'file|max:'. (config('constants.document_size_limit') / 1000)\n ]);\n\n $user_id = $request->session()->get('user.id');\n $enable_product_editing = $request->session()->get('business.enable_editing_product_from_purchase');\n\n //Update business exchange rate.\n Business::update_business($business_id, ['p_exchange_rate' => ($transaction_data['exchange_rate'])]);\n\n $currency_details = $this->transactionUtil->purchaseCurrencyDetails($business_id);\n\n //unformat input values\n $transaction_data['total_before_tax'] = $this->productUtil->num_uf($transaction_data['total_before_tax'], $currency_details)*$exchange_rate;\n\n // If discount type is fixed them multiply by exchange rate, else don't\n if ($transaction_data['discount_type'] == 'fixed') {\n $transaction_data['discount_amount'] = $this->productUtil->num_uf($transaction_data['discount_amount'], $currency_details)*$exchange_rate;\n } elseif ($transaction_data['discount_type'] == 'percentage') {\n $transaction_data['discount_amount'] = $this->productUtil->num_uf($transaction_data['discount_amount'], $currency_details);\n } else {\n $transaction_data['discount_amount'] = 0;\n }\n\n $transaction_data['tax_amount'] = $this->productUtil->num_uf($transaction_data['tax_amount'], $currency_details)*$exchange_rate;\n $transaction_data['shipping_charges'] = $this->productUtil->num_uf($transaction_data['shipping_charges'], $currency_details)*$exchange_rate;\n $transaction_data['final_total'] = $this->productUtil->num_uf($transaction_data['final_total'], $currency_details)*$exchange_rate;\n\n $transaction_data['business_id'] = $business_id;\n $transaction_data['created_by'] = $user_id;\n $transaction_data['type'] = 'purchase';\n $transaction_data['payment_status'] = 'due';\n $transaction_data['transaction_date'] = $this->productUtil->uf_date($transaction_data['transaction_date']);\n\n //upload document\n if ($request->hasFile('document') && $request->file('document')->isValid()) {\n if ($request->document->getSize() <= config('constants.document_size_limit')) {\n $new_file_name = time() . '_' . $request->document->getClientOriginalName();\n $path = $request->document->storeAs('public/documents', $new_file_name);\n $transaction_data['document'] = str_replace('public/documents/', '', $path);\n }\n }\n\n DB::beginTransaction();\n\n //Update reference count\n $ref_count = $this->productUtil->setAndGetReferenceCount($transaction_data['type']);\n //Generate reference number\n if (empty($transaction_data['ref_no'])) {\n $transaction_data['ref_no'] = $this->productUtil->generateReferenceNumber($transaction_data['type'], $ref_count);\n }\n\n $transaction = Transaction::create($transaction_data);\n \n $purchase_lines = [];\n $purchases = $request->input('purchases');\n foreach ($purchases as $purchase) {\n $new_purchase_line = [\n 'product_id' => $purchase['product_id'],\n 'variation_id' => $purchase['variation_id'],\n 'quantity'=> $this->productUtil->num_uf($purchase['quantity'], $currency_details),\n 'pp_without_discount' => $this->productUtil->num_uf($purchase['pp_without_discount'], $currency_details)*$exchange_rate,\n 'discount_percent' => $this->productUtil->num_uf($purchase['discount_percent'], $currency_details),\n 'purchase_price' => $this->productUtil->num_uf($purchase['purchase_price'], $currency_details)*$exchange_rate,\n 'item_tax'=>$this->productUtil->num_uf($purchase['item_tax'], $currency_details)*$exchange_rate,\n 'tax_id' => $purchase['purchase_line_tax_id'],\n 'purchase_price_inc_tax' => $this->productUtil->num_uf($purchase['purchase_price_inc_tax'], $currency_details)*$exchange_rate,\n 'lot_number' => !empty($purchase['lot_number']) ? $purchase['lot_number'] : null\n ];\n\n if (!empty($purchase['mfg_date'])) {\n $new_purchase_line['mfg_date'] = $this->productUtil->uf_date($purchase['mfg_date']);\n }\n if (!empty($purchase['exp_date'])) {\n $new_purchase_line['exp_date'] =$this->productUtil->uf_date($purchase['exp_date']);\n }\n\n $purchase_lines[] = $new_purchase_line;\n\n //Edit product price\n if ($enable_product_editing == 1) {\n //Default selling price is in base currency so no need to multiply with exchange rate.\n $new_purchase_line['default_sell_price'] = $this->productUtil->num_uf($purchase['default_sell_price'], $currency_details);\n $this->productUtil->updateProductFromPurchase($new_purchase_line);\n }\n\n // Update quantity only if status is \"received\"\n if ($transaction_data['status'] == 'received') {\n $this->productUtil->updateProductQuantity($transaction_data['location_id'], $purchase['product_id'], $purchase['variation_id'], $purchase['quantity']);\n }\n\n //Add Purchase payments\n\t $result = $this->transactionUtil->createOrUpdatePaymentLines($transaction, $request->input('payment'));\n\n //update payment status\n $this->transactionUtil->updatePaymentStatus($transaction->id, $transaction->final_total);\n\n }\n\n if (!empty($purchase_lines)) {\n $transaction->purchase_lines()->createMany($purchase_lines);\n }\n \n DB::commit();\n \n $output = ['success' => 1,\n 'msg' => __('purchase.purchase_add_success')\n ];\n } catch (\\Exception $e) {\n DB::rollBack();\n \\Log::emergency(\"File:\" . $e->getFile(). \"Line:\" . $e->getLine(). \"Message:\" . $e->getMessage());\n \n $output = ['success' => 0,\n 'msg' => __('messages.something_went_wrong')\n ];\n }\n\n return redirect('purchases')->with('status', $output);\n }", "function mymcshop_import_content() {\n // Fixes problems when the CSV files used for importing have been created\n // on a Mac, by forcing PHP to detect the appropriate line endings.\n ini_set(\"auto_detect_line_endings\", TRUE);\n\r\n $operations[] = array('_mymcshop_setup_userpoint', array(t('Setup userpoint.')));\n\n // Run all available migrations.\n $migrations = migrate_migrations();\n foreach ($migrations as $machine_name => $migration) {\n $operations[] = array('_mymcshop_import', array($machine_name, t('Importing content.')));\n }\n // Perform post-import tasks.\n $operations[] = array('_mymcshop_post_import', array(t('Completing setup.')));\n \n $batch = array(\n 'title' => t('Importing content'),\n 'operations' => $operations,\n 'file' => drupal_get_path('profile', 'mymcshop') . '/mymcshop.install_callbacks.inc',\n );\n\n return $batch;\n}", "function importSpecific( $tmpTable, $record)\n\t{\n\t\t// if not record goes with current user\n\t\tif( strlen($record['user_id']) == 0 || $GLOBALS['appshore']->rbac->checkPermissionOnUser($this->appRole, $record['user_id']) == false )\n\t\t\t$record['user_id'] = $GLOBALS['appshore_data']['current_user']['user_id'];\n\t\t\n\t\t// check if product exist within the same account\n\t\t$product = getOneAssocArray( 'select * from products where lower(product_name) like \"%'.strtolower($record['product_name']).'%\"');\n\t\t\t\n\t\tif( !isset($product['product_id']) )\n\t\t{\t\t\t\n\t\t\t// we create a new product\n\t\t\tif( ($product['product_id'] = insertRow( 'products', 'product_id', $record, false)) == NULL )\n\t\t\t\t$this->specific['Products']['rejected']++;\n\t\t\telse\n\t\t\t\t$this->specific['Products']['created']++;\n\t\t}\t\n\t\telse\n\t\t\t$this->specific['Products']['rejected']++;\n\t\t\t\t\n\t}", "public function purchaseexport() {\n // FIX: Need to fix the implementation for reduce the memory consumption\n set_time_limit(0);\n ini_set('memory_limit', '512M');\n //getting the entity manager object.\n $em = $this->container->get('doctrine')->getManager();\n\n //get data to be exported\n $purchase_data = array();\n //get purchase records to be export\n $purchase_data = $em->getRepository('ExportManagementBundle:Purchase')\n ->getPurchaseTransaction();\n\n //check if we have some records for export\n // if (count($purchase_data)) {\n //exporting the data.\n $result = $this->exportPurchasecsv($purchase_data);\n // }\n if (!empty($result)) {\n $data = array('code' => 101, 'message' => 'SUCCESS', 'data' => array('link' => $result));\n } else {\n $data = array('code' => 100, 'message' => 'NO_DATA', 'data' => array());\n }\n echo json_encode($data);\n exit;\n }", "public function importOrderFromApi()\n {\n $this->modelOrder->importOrderFromApi();\n }", "public function backupImport()\n {\n DB::statement('DROP TABLE IF EXISTS ecom_products');\n\n DB::statement('CREATE TABLE ecom_products LIKE ecom_products_copy');\n\n DB::statement('INSERT INTO ecom_products SELECT * FROM ecom_products_copy');\n\n return true;\n }", "public function store()\n\t{\n\n\t\t$inventory = Input::except('pid','qty');\n\t\t\n\t\t$total_cost = $this->totalCost();\n\n\t\t$inventory['total_cost'] = $total_cost;\n\t\t$inv = Inventory::create($inventory);\n\n\t\t$this->setTransaction($inv);\n\n\t\treturn Redirect::route('purchases.index')->with('alert.success', Alert::text('saddpo'));\n\n\t}", "public function import(Request $request) {\n\t\tif ($request->file('shipment')) {\n\t\t\t// var_dump('woooooooo');\n\t\t\t$path = $request->file('shipment')->getRealPath();\n\t\t\t$data = Excel::load($path, function ($reader) {\n\n\t\t\t})->get();\n\n\t\t\tif (!empty($data) && $data->count()) {\n\t\t\t\tforeach ($data->toArray() as $row) {\n\t\t\t\t\tif (!empty($row)) {\n\t\t\t\t\t\t$dataArray[] =\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'client_name' => $row['name'],\n\t\t\t\t\t\t\t'client_email' => $row['email'],\n\t\t\t\t\t\t\t'client_phone' => $row['phone'],\n\t\t\t\t\t\t\t'client_address' => $row['address'],\n\t\t\t\t\t\t\t'client_city' => $row['city'],\n\t\t\t\t\t\t\t'amount_ordered' => $row['quantity'],\n\t\t\t\t\t\t\t'client_postal_code' => $row['postal_code'],\n\t\t\t\t\t\t\t'client_region' => $row['region'],\n\t\t\t\t\t\t\t'booking_date' => $row['booking_date'],\n\t\t\t\t\t\t\t'user_id' => Auth::id(),\n\t\t\t\t\t\t\t'created_at' => new DateTime(),\n\t\t\t\t\t\t\t'updated_at' => new DateTime(),\n\t\t\t\t\t\t\t'shipment_id' => random_int(1000000, 9999999),\n\t\t\t\t\t\t\t'sender_name' => Auth::user()->name,\n\t\t\t\t\t\t\t'sender_email' => Auth::user()->email,\n\t\t\t\t\t\t\t'sender_phone' => Auth::user()->phone,\n\t\t\t\t\t\t\t'sender_address' => Auth::user()->address,\n\t\t\t\t\t\t\t'sender_city' => Auth::user()->city,\n\t\t\t\t\t\t\t'user_id' => Auth::id(),\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!empty($dataArray)) {\n\t\t\t\t\tShipment::insert($dataArray);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function purchase_page() {\n require_once(__DIR__ . '/includes/SPAY_alipay_SDK/index.php');\n }", "public function add_product(Request $request)\n {\n if ($request->isMethod('post')) {\n\n switch ($request->vendor_id) {\n // If the vendor is ORS Nasco\n case 1:\n // First, we load the csv file and store it to a variable\n $init_file = file('test_import.csv');\n // We then, count the number of rows in the csv file and store it in a variable\n $csv_rows = count($init_file);\n // Open the CSV file with fopen(), read it with fgetcsv() and pass in the \n // variable declaring the number of rows from the CSV file\n if (($handle = fopen(public_path() . 'test_import.csv', 'r')) !== false) {\n // we then loop through the csv file and grab the data, row by row\n while (($data = fgetcsv($handle, $csv_rows, ',')) !== false) {\n // we then create a new OrsNasco object and assign the data to the row\n // by using the array positioning format \n $ors_nasco = new OrsNasco;\n $ors_nasco->ors_products_id = $data[0];\n $ors_nasco->vendor_id = $data[1];\n $ors_nasco->category_id = $data[2];\n $ors_nasco->subcategories_id = $data[3];\n $ors_nasco->brands_id = $data[4];\n $ors_nasco->part_number = $data[5];\n $ors_nasco->prefix = $data[6];\n $ors_nasco->item_description = $data[7];\n $ors_nasco->minimum_order_quantity = $data[8];\n $ors_nasco->minimum_selling_quantity = $data[9];\n $ors_nasco->standard_unit_measure = $data[10];\n $ors_nasco->std_package_quantity = $data[11];\n $ors_nasco->price_unit = $data[12];\n $ors_nasco->list_price = $data[13];\n $ors_nasco->your_ors_nasco_cost = $data[14];\n $ors_nasco->your_promo_cost = $data[15];\n $ors_nasco->promo_start_date = $data[16];\n $ors_nasco->promo_end_date = $data[17];\n $ors_nasco->item_weight = $data[18];\n $ors_nasco->item_height = $data[19];\n $ors_nasco->item_width = $data[20];\n $ors_nasco->item_length = $data[21];\n $ors_nasco->item_cube = $data[22];\n $ors_nasco->upc_code = $data[23];\n $ors_nasco->unspsc_code = $data[24];\n $ors_nasco->hazmat_Item = $data[25];\n $ors_nasco->orm_item = $data[26];\n $ors_nasco->ansi_stock_uom_code = $data[27];\n $ors_nasco->ansi_pricing_or_selling_uom_code = $data[28];\n $ors_nasco->ansi_std_pkg_uom_code = $data[29];\n $ors_nasco->country_of_origin = $data[30];\n $ors_nasco->Stocked_Birmingham_AL = $data[31];\n $ors_nasco->Stocked_Chicago_IL = $data[32];\n $ors_nasco->Stocked_Charlotte_NC = $data[33];\n $ors_nasco->Stocked_Cincinnati_OH = $data[34];\n $ors_nasco->Stocked_Dallas_TX = $data[35];\n $ors_nasco->Stocked_Denver_CO = $data[36];\n $ors_nasco->Stocked_Harrisburg_PA = $data[37];\n $ors_nasco->Stocked_Houston_TX = $data[38];\n $ors_nasco->Stocked_St_Paul_MN = $data[39];\n $ors_nasco->Stocked_Muskogee_OK = $data[40];\n $ors_nasco->Stocked_Orlando_FL = $data[41];\n $ors_nasco->Stocked_Portland_OR = $data[42];\n $ors_nasco->Stocked_Bakersfield_CA = $data[43];\n $ors_nasco->image_url = $data[44];\n\n // We then validate/modify the datatypes to match the database\n\n $validated_data = $request->validate([\n 'vendor_id' => 'required|integer|min:1',\n 'category_id' => 'required|integer',\n 'subcategories_id' => 'required|integer|min:1',\n 'brands_id' => 'required|integer|min:1',\n 'part_number' => 'required|min:1',\n 'prefix' => 'required|min:1|max:3',\n 'item_description' => 'required|min:3|max:255',\n 'minimum_order_quantity' => 'required|integer|min:1',\n 'minimum_selling_quantity' => 'required|integer|min:1',\n 'standard_unit_measure' => 'required|min:1',\n 'std_package_quantity' => 'required|integer',\n 'price_unit' => 'required|string',\n 'list_price' => 'required|numeric',\n 'your_ors_nasco_cost' => 'required|numeric',\n 'your_promo_cost' => 'nullable|numeric',\n 'promo_start_date' => 'nullable|date',\n 'promo_end_date' => 'nullable|date',\n 'item_weight' => 'required|numeric',\n 'item_height' => 'required|numeric',\n 'item_width' => 'required|numeric',\n 'item_length' => 'required|numeric',\n 'item_cube' => 'nullable|numeric',\n 'upc_code' => 'required|integer',\n 'unspsc_code' => 'required|',\n 'hazmat_Item' => 'nullable',\n 'orm_item' => 'required|',\n 'ansi_stock_uom_code' => 'required|',\n 'ansi_pricing_or_selling_uom_code' => 'required|',\n 'ansi_std_pkg_uom_code' => 'required|',\n 'country_of_origin' => 'nullable|string',\n 'Stocked_Birmingham_AL' => 'required|string|max:1',\n 'Stocked_Chicago_IL' => 'required|string|max:1',\n 'Stocked_Charlotte_NC' => 'required|string|max:1',\n 'Stocked_Cincinnati_OH' => 'required|string|max:1',\n 'Stocked_Dallas_TX' => 'required|string|max:1',\n 'Stocked_Denver_CO' => 'required|string|max:1',\n 'Stocked_Harrisburg_PA' => 'required|string|max:1',\n 'Stocked_Houston_TX' => 'required|string|max:1',\n 'Stocked_St_Paul_MN' => 'required|string|max:1',\n 'Stocked_Muskogee_OK' => 'required|string|max:1',\n 'Stocked_Orlando_FL' => 'required|string|max:1',\n 'Stocked_Portland_OR' => 'required|string|max:1',\n 'Stocked_Bakersfield_CA' => 'required|string|max:1',\n 'image_url' => 'required|string'\n ]);\n\n\n\n\n\n // we then save the record/row\n $ors_nasco->save();\n }\n fclose($handle);\n }\n }\n }\n\n return view('admin.add-product');\n }", "function sales_Backlog($file=\"\")\r\n {\r\n\tglobal $wpdb;\r\n\t\r\n\techo \"In sales<br>\";\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t $csv_file = get_option( 'wp_import_csv');\r\n\t\r\n if($csv_file !=\"\"){\r\n\t\r\n $table_name = $wpdb->prefix . 'sales_backlog';\r\n\t\r\n\t\r\n //Update All open_quantity set 0 for all records\t\r\n\t\t\r\n\t$results_backlog = $wpdb->get_results( \"SELECT id FROM $table_name\", OBJECT );\r\n\t//echo \"<pre>\";\r\n\t//print_r($results_backlog);\r\n\t\r\n\tfor($kk = 0 ; $kk< count($results_backlog); $kk++){\r\n\t\t\r\n\t $db_openQty['open_quantity'] = 0;\r\n\t $ids = $results_backlog[$kk]->id;\r\n\t \r\n\t $wpdb->update($table_name, $db_openQty, array('id'=>$ids));\r\n\t}\r\n\t\r\n\t\r\n \r\n\t //skip line\r\n\t $impCsv_Opt = get_option ( WPCSV_PREFIX );\r\n\t \r\n\t if($impCsv_Opt['salesBacklog'] == \"\" || $impCsv_Opt['salesBacklog'] < 0){\r\n\t\t $skipLine = 12;\r\n\t }else{\r\n\t\t $skipLine = $impCsv_Opt['salesBacklog'];\r\n\t }\r\n \t\r\n\t$csv = readCSV($csv_file, $skipLineNumber = $skipLine);\r\n //echo '<pre>'; print_r($csv);\r\n\t \r\n\t$count_csv_colm = $csv; \r\n\t for($i = 0 ; $i<count($csv); $i++){\r\n\t \r\n\t if( count($count_csv_colm[0])== 15 || count($count_csv_colm[0])==14 ){\r\n\t\t \r\n\t\t if(count($count_csv_colm[0])== 15){\r\n\t\t\r\n\t\t$db['product'] = $csv[$i][0];\r\n\t\t$db['account'] = $csv[$i][1]; \r\n\t\t$db['company'] = $csv[$i][2];\r\n\t\t$db['external_reference'] = $csv[$i][3];\r\n\t\t$db['sales_order'] = $csv[$i][4];\r\n\t\t$db['sales_order_item'] = $csv[$i][5];\r\n\t\t$db['cancellation_status'] = $csv[$i][6];\r\n\t\t$db['requested_date'] = $csv[$i][7];\r\n\t\t$db['created_on'] = $csv[$i][8];\r\n\t\t$db['customer_requested_date'] = $csv[$i][9];\r\n\t\t$db['revised_ship_date'] = $csv[$i][10];\r\n\t\t\r\n\t\t$each_cost = str_replace('USD/ea',\"\",$csv[$i][11]);\r\n\t\t$db['each_cost'] = trim($each_cost);\r\n\t\t\r\n\t\t$requested_quantity = str_replace('ea',\"\",$csv[$i][12]);\r\n\t\t$db['requested_quantity'] = trim($requested_quantity);\r\n\t\t\r\n\t\t$open_quantity = str_replace('ea',\"\",$csv[$i][13]);\r\n\t\t$db['open_quantity'] = trim($open_quantity);\r\n\t\t\r\n\t\t$total_open_usd = str_replace('USD',\"\",$csv[$i][14]);\r\n\t\t$db['total_open_usd'] = trim($total_open_usd);\r\n\t\t\r\n\t\t $db['salesID_itemID'] = $csv[$i][4].'-'.$csv[$i][5];\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\t$db['product'] = $csv[$i][0];\r\n\t\t$db['account'] = $csv[$i][1]; \r\n\t\t$db['company'] = $csv[$i][2];\r\n\t\t$db['external_reference'] = $csv[$i][3];\r\n\t\t$db['sales_order'] = $csv[$i][4];\r\n\t\t$db['sales_order_item'] = $csv[$i][5];\r\n\t\t$db['cancellation_status'] = \"\";\r\n\t\t$db['requested_date'] = $csv[$i][6];\r\n\t\t$db['created_on'] = $csv[$i][7];\r\n\t\t$db['customer_requested_date'] = $csv[$i][8];\r\n\t\t$db['revised_ship_date'] = $csv[$i][9];\r\n\t\t\r\n\t\t$each_cost = str_replace('USD/ea',\"\",$csv[$i][10]);\r\n\t\t$db['each_cost'] = trim($each_cost);\r\n\t\t\r\n\t\t$requested_quantity = str_replace('ea',\"\",$csv[$i][11]);\r\n\t\t$db['requested_quantity'] = trim($requested_quantity);\r\n\t\t\r\n\t\t$open_quantity = str_replace('ea',\"\",$csv[$i][12]);\r\n\t\t$db['open_quantity'] = trim($open_quantity);\r\n\t\t\r\n\t\t$total_open_usd = str_replace('USD',\"\",$csv[$i][13]);\r\n\t\t$db['total_open_usd'] = trim($total_open_usd);\r\n\t\t\r\n\t\t $db['salesID_itemID'] = $csv[$i][4].'-'.$csv[$i][5];\r\n\t\t}\r\n\t\t \r\n\t date_default_timezone_set(get_option('timezone_string')); // CDT\r\n\t\t\t\t\r\n\t\t\t\t//InsertInto DB\r\n\t\t\t\t$salesID_itemID = $db['salesID_itemID'];\r\n\t\t\t\t$results = $wpdb->get_results( \"SELECT id FROM $table_name WHERE salesID_itemID = '$salesID_itemID'\", OBJECT );\r\n\r\n if($results[0]->id ==\"\"){ //Insert\r\n\t\t\t\t\t//echo \"Insert<br>\";\r\n\t\t\t\t\t$db['createded_on']= date('m-d-Y H:i:s');\r\n\t\t\t\t\t$db['updated_on']= date('m-d-Y H:i:s');\r\n\t\t\t\t $insertID = $wpdb->insert( $table_name, $db );\r\n\t\t\t\t\t\r\n\t\t\t\t}else{ //Update\r\n\t\t\t\t\t//echo \"Update<br>\";\r\n\t\t\t\t\t$db['updated_on']= date('m-d-Y H:i:s');\r\n\t\t\t\t $id = $results[0]->id; //added stripslashes_deep\r\n\t\t\t\t $wpdb->update($table_name, $db, array('id'=>$id));\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t//print_r($db);\t\r\n\t\t\t\r\n\t }//ccount col 13 14\r\n\t\t\t\t\r\n\t }//for\t\r\n\t\t\t\t\t\r\n\t\t echo '<h2 class=\"success\">Data imported successfully!</h2>';\r\n\t\t \r\n\t\t //Copy another dir after impoert Data\tand del\r\n\t\t \r\n\t\t del_copy_after_import($csv_file);\r\n\t\t update_option( 'wp_import_csv', \"\", 'yes' );\r\n\t\t \r\n\t\t create_logs_imprtCsv($csv_file); //update log file\r\n\t \r\n\t\t\r\n\t\t\r\n\t}else{\r\n\t\techo '<h3 class=\"error SalesBacklog\">No file to import!</h3>';\t\r\n\t}\t\r\n\t\r\n\t \r\n }", "function recordPurchase(){\n\t\tdate_default_timezone_set(\"Australia/Melbourne\"); // set timezone\n\n\t\t// Condition 1: Check whether the cart is empty\n\t\t// CASE 1: Cart is empty\n\t\tif(!isset($_SESSION[\"cart\"]) || empty($_SESSION[\"cart\"]) ){\n\t\t\techo \"<p class='errMsgBox'><strong>Error:</strong> <span class='errMsg'> Cart is Empty. Unable to Save Purchases. </span> </p>\";\n\t\t} \n\t\telse { // CASE 2: Cart is not empty\n\n\t\t\t// Extract the Cart where key is \"itemid\" and value is \"qty ordered by customer\"\n\t\t\t$cart = $_SESSION[\"cart\"];\n\n\t\t\t$custId = $_SESSION[\"cLogin\"]; // Extract Customer ID\n\t\t\t$xmlPath = $GLOBALS['xmlPurchasePath']; // XML file location\n\t\t\t$dom = new DomDocument(\"1.0\"); // Create XML Dom Object\n\t\t\t$dom->preserveWhiteSpace = FALSE; // ignore existing white spaces in XML\n\t\t\t$count = 0; // number of purchase transactions in <purchases> root element\n\n\t\t\t// Check whether the purchases.xml file exists with <purchases> root element\n\t\t\t// Case 1: purchases.xml does exist\n\t\t\tif(file_exists($xmlPath)){\n\n\t\t\t\t// Load xml file containing items\n\t\t\t\t$loadSuccess = $dom->load($xmlPath);\n\n\t\t\t\t// Get reference to root element <purchases>\n\t\t\t\t$purchases = $dom->getElementsByTagName(\"purchases\")->item(0);\n\n\t\t\t\t// count number of existing <purchase> within the <purchases> root element\n\t\t\t\t$count = $purchases->getElementsByTagName(\"purchase\")->length;\n\n\t\t\t} // Case 2: File doesn't exist. Insert Root Element <purchases> into XML DOM\n\t\t\telse {\n\t\t\t\t// Create new <purchases> root element\n\t\t\t\t$purchases = $dom->appendChild($dom->createElement(\"purchases\"));\n\t\t\t}\n\n\t\t\tksort($cart); // Sort the $cart storing the customer's purchases using $itemid as key\n\n\t\t\t// Create <purchase> element within the <purchases> element\n\t\t\t$purchase = $purchases->appendChild($dom->createElement(\"purchase\"));\n\t\t\t\n\t\t\t// Create <transactionid> within <purchase>\n\t\t\t$transactionId = $purchase->appendChild($dom->createElement(\"transactionid\"));\n\t\t\t$transactionIdVal = $transactionId->appendChild($dom->createTextNode($count +1));\n\n\t\t\t// Create <timestamp> within <purchase>\n\t\t\t$temp = date(\"d/m/Y H:i:s\"); \n\t\t\t$timestamp = $purchase->appendChild($dom->createElement(\"timestamp\"));\n\t\t\t$timestampVal = $timestamp->appendChild($dom->createTextNode($temp));\n\n\t\t\t// Create <custid> within <purchase>\n\t\t\t$customerId = $purchase->appendChild($dom->createElement(\"customerid\"));\n\t\t\t$customerIdVal = $customerId->appendChild($dom->createTextNode(\"$custId\"));\n\n\t\t\t$total = 0; // total dollar value of the purchase (cart)\n\n\t\t\t// Traverse items in the $cart\n\t\t\tforeach($cart as $id => $qty){\n\n\t\t\t\t// Get Details about the $itemid\n\t\t\t\t$itemDetails = getItemDetails($id);\n\t\t\t\t// Extract releveant details about the item\n\t\t\t\t$itemName = $itemDetails['name'];\n\t\t\t\t$itemPrice = $itemDetails['price'];\n\n\t\t\t\t// Calculate prices\n\t\t\t\t$subtotal = $qty * $itemPrice;\n\t\t\t\t$total = $total + $subtotal;\n\n\t\t\t\t// Create <item> element in <purchase>\n\t\t\t\t$item = $purchase->appendChild($dom->createElement(\"item\"));\n\n\t\t\t\t// Create <itemid> within <item>\n\t\t\t\t$itemid = $item->appendChild($dom->createElement(\"itemid\"));\n\t\t\t\t$itemidval = $itemid->appendChild($dom->createTextNode($id));\n\n\t\t\t\t// Create <name> within <item>\n\t\t\t\t$itemname = $item->appendChild($dom->createElement(\"itemname\"));\n\t\t\t\t$itemnameval = $itemname->appendChild($dom->createTextNode($itemName));\n\n\t\t\t\t// Create <unitprice> within <item>\n\t\t\t\t$itemprice = $item->appendChild($dom->createElement(\"unitprice\"));\n\t\t\t\t$itempriceval = $itemprice->appendChild($dom->createTextNode($itemPrice));\n\n\t\t\t\t// Create <qtyordered> within <item>\n\t\t\t\t$itemqty = $item->appendChild($dom->createElement(\"qtyordered\"));\n\t\t\t\t$itemqtyval = $itemqty->appendChild($dom->createTextNode($qty));\n\t\t\t}\n\n\t\t\t// Create <total> price within <purchase>\n\t\t\t$totalprice = $purchase->appendChild($dom->createElement(\"totalprice\"));\n\t\t\t$totalpriceval = $totalprice->appendChild($dom->createTextNode($total));\n\n\t\t\t// Create <paidStatus> within <purchase>\n\t\t\t$paidstatus = $purchase->appendChild($dom->createElement(\"paidstatus\"));\n\t\t\t$paidstatusval = $paidstatus->appendChild($dom->createTextNode(\"UNPAID\"));\n\n\t\t\t// Save DOM to File\n\t\t\t$dom->formatOutput = true;\n\t\t\t$saveResult = $dom->save($xmlPath);\n\n\n\t\t\t// Condition: Check whether the file was saved? purchases.xml\n\t\t\t// Case: Unable to write to \"purchases.xml\" file due to file permission\n\t\t\tif($saveResult == false ){\n\t\t\t\t$errMsg = \"<strong>Warning:</strong> <span class='errMsg'> Purchase was not saved to purchases.xml file <br/>\"\n\t\t\t\t\t\t\t. \"<strong>Reason:</strong> Unable to write to purchases.xml file due file permission issue</span><br/>\\r\\n\";\n\t\t\t\techo $errMsg;\n\n\t\t\t}\n\n\n\n\t\t}\n\t}" ]
[ "0.66932905", "0.6657487", "0.66389036", "0.6271143", "0.6178542", "0.5967543", "0.5922314", "0.59161913", "0.5877746", "0.5768024", "0.5760243", "0.5744093", "0.57389146", "0.5736698", "0.5732621", "0.5687191", "0.5678477", "0.5648061", "0.56384546", "0.5638291", "0.56338286", "0.56304383", "0.5619317", "0.5596757", "0.55553406", "0.5547721", "0.5535314", "0.55323", "0.55321527", "0.553021" ]
0.701605
0
getting the purchase daily filename with date
public function getPurchasecardExportFileNameWithdate() { $file_name = date('Ymd') . $this->purchase_export . ".csv"; return $file_name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function filename()\n {\n return 'Product_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Product_' . date('YmdHis');\n }", "protected function filename()\n { $day = Carbon::Today()->toDateString();\n $file_name = 'day_stationar_'.$day;\n return $file_name;\n }", "protected function filename()\n {\n return 'internet_refundhistory_' . Carbon::now('Asia/Dhaka');\n }", "protected function filename()\n {\n return 'Item_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Orders_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Orders_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Vendor_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'analog_digital_customers_billcollectionlist_datatable_' . Carbon::now('Asia/Dhaka');\n }", "protected function filename()\n {\n return 'Transactions_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'CardExpireyReport_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Store_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'internet_customers_datatable_' . Carbon::now('Asia/Dhaka');\n }", "protected function filename()\n {\n return 'subscription_plans_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Instrument_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'ShippingCompany_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'DailyJob_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Distributors2_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Medias_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'ParalegalCaseField_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Ventas_Facturas_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Advertisement_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'product_category_list_' . date('Y_m_d_H_i_s');\n }", "protected function filename()\n {\n return 'Coupon_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'stock_movements_datatable_' . time();\n }", "protected function filename()\n {\n return 'Articles_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'ClientReservation_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'article_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Infractions_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'subscriber_' . date('YmdHis');\n }" ]
[ "0.713817", "0.71265906", "0.7073044", "0.70449483", "0.7008099", "0.69211686", "0.69211686", "0.6915267", "0.69152635", "0.690773", "0.6893403", "0.67571026", "0.674581", "0.6719901", "0.67084956", "0.6669954", "0.66598266", "0.6640763", "0.6617023", "0.661555", "0.6578924", "0.65615475", "0.651847", "0.65113854", "0.650578", "0.64853096", "0.64760685", "0.6467042", "0.646671", "0.64531314" ]
0.73548603
0
get shop file sheet name
public function getPurchaseFileSheetName() { return $this->purchase_export_sheet_name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNameOfPrintedSheet(): string\n {\n return $this->printedSheet->name;\n }", "protected function filename()\n { $day = Carbon::Today()->toDateString();\n $file_name = 'day_stationar_'.$day;\n return $file_name;\n }", "function f_DefaultFileName()\n\t{\n\t\tif ($this->TemplateFileName === '') {\n\t\t\treturn 'worksheet.xls';\n\t\t} else {\n\t\t\t$File = $this->TemplateFileName;\n\t\t\t// Keep only the file name\n\t\t\t$Pos = strrpos($File, '/');\n\t\t\tif ($Pos === false) {\n\t\t\t\t$Pos = strrpos($File, '\\\\');\n\t\t\t}\n\t\t\tif ($Pos !== false) {\n\t\t\t\t$File = substr($File, $Pos + 1);\n\t\t\t}\n\t\t\t// Change extention from .xml to .xls in order to have a proper opening file with Explorer\n\t\t\t$Len = strlen($File);\n\t\t\tif ($Len > 4) {\n\t\t\t\t$Ext = substr($File, $Len - 4, 4);\n\t\t\t\tif (strtolower($Ext) == '.xml') {\n\t\t\t\t\t$File = substr($File, 0, $Len - 4) . '.xls';\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $File;\n\t\t}\n\t}", "public function getSheet($sheet_number = 0)\n\t{\n\t}", "protected function filename()\n {\n return 'Store_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'ShippingCompany_' . date('YmdHis');\n }", "function getFileName() {\n\t\treturn $this->getData('fileName');\t\n\t}", "protected function filename()\n {\n return 'Item_' . date('YmdHis');\n }", "public function getFileName() {}", "public function getfilename():string { return FOLDER.$this->nameOfFile.\".xml\"; }", "protected function filename()\n {\n return 'Product_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Incassation_'.date('YmdHis');\n }", "protected function filename()\n {\n return 'Product_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'workorderHistories';\n }", "protected function filename()\n {\n return 'BookCategory_' . date('YmdHis');\n }", "public function getFilename () {}", "public function getDefaultExportFilename(){\n\t\treturn 'file.xlsx';\n\t}", "protected function filename()\n {\n return 'clientes';\n }", "function getFileName(){\n return $this->name;\n }", "protected function filename()\n {\n return 'OverallExport_' . time();\n }", "function getFileName() {\n\t\tif ($this->_codename == 'default') {\n\t\t\treturn 'sitemap.xml';\n\t\t} else {\n\t\t\treturn 'sitemap_'.$this->_codename.'.xml';\n\t\t}\n\t}", "public function getShopName();", "public function getFilename();", "public function getFilename();", "public function getFilename();", "public abstract function getFileName();", "function getFilename();", "function getStoreName() \n {\n $opts = HTML_FlexyFramework::get()->Pman;\n $fn = preg_replace('/[^a-z0-9_\\.]+/i', '_', $this->filename);\n return implode( '/', array(\n $opts['storedir'], '_images_', date('Y/m', strtotime($this->created)), $this->id . '-'. $fn\n ));\n \n }", "protected function filename()\n {\n return 'stock_movements_datatable_' . time();\n }", "protected function filename()\n {\n return 'analog_digital_customers_billcollectionlist_datatable_' . Carbon::now('Asia/Dhaka');\n }" ]
[ "0.6485445", "0.6153849", "0.6104512", "0.6033018", "0.6027725", "0.5971713", "0.59485054", "0.5924527", "0.5921394", "0.59197867", "0.5894096", "0.58603007", "0.5849177", "0.5833813", "0.58204377", "0.5817692", "0.5801016", "0.5794129", "0.5778786", "0.57648456", "0.5761863", "0.5759387", "0.57510257", "0.57510257", "0.57510257", "0.5749647", "0.5749314", "0.5744106", "0.5739488", "0.5726579" ]
0.7708105
0
Exporting the shop purchase
public function purchaseexport() { // FIX: Need to fix the implementation for reduce the memory consumption set_time_limit(0); ini_set('memory_limit', '512M'); //getting the entity manager object. $em = $this->container->get('doctrine')->getManager(); //get data to be exported $purchase_data = array(); //get purchase records to be export $purchase_data = $em->getRepository('ExportManagementBundle:Purchase') ->getPurchaseTransaction(); //check if we have some records for export // if (count($purchase_data)) { //exporting the data. $result = $this->exportPurchasecsv($purchase_data); // } if (!empty($result)) { $data = array('code' => 101, 'message' => 'SUCCESS', 'data' => array('link' => $result)); } else { $data = array('code' => 100, 'message' => 'NO_DATA', 'data' => array()); } echo json_encode($data); exit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function csv_purchases()\r\n\t{\r\n\t\t// Create data for CSV with headers\r\n\t\t$data = $this->csv_format('ID');\r\n\t\t$data .= $this->csv_format('User');\r\n\t\t$data .= $this->csv_format('Asset');\r\n\t\t$data .= $this->csv_format('Price');\r\n\t\t$data .= $this->csv_format('Site Fee');\r\n\t\t$data .= $this->csv_format('Coinbase Code');\r\n\t\t$data .= $this->csv_format('Payout Date');\r\n\t\t$data .= $this->csv_format('Created');\r\n\t\t$data .= $this->_newline;\r\n\r\n\t\t// Get items\r\n\t\t$purchases = $this->stats_model->get_purchases();\r\n\r\n\t\tforeach ($purchases as $purchase)\r\n\t\t{\r\n\t\t\t$data .= $this->csv_format($purchase->purchase_id);\r\n\t\t\t$data .= $this->csv_format($purchase->display_name ? $purchase->display_name : 'User # ' . $purchase->user_id);\r\n\t\t\tif ($purchase->asset_id != 0)\r\n {\r\n $data .= $this->csv_format($purchase->asset_id);\r\n }\r\n else\r\n {\r\n $data .= $this->csv_format($purchase->photoset_id);\r\n }\r\n\t\t\t$data .= $this->csv_format($purchase->purchase_price_btc > 0 ? 'B' . round($purchase->purchase_price_btc, 6) : '$' . number_format($purchase->purchase_price_usd, 2));\r\n\t\t\t$data .= $this->csv_format('$' . number_format($purchase->site_usd, 2));\r\n\t\t\t$data .= $this->csv_format($purchase->cb_code);\r\n\t\t\t$data .= $this->csv_format($purchase->payout_date ? date('Y-m-d H:i:s', $purchase->payout_date) : '');\r\n\t\t\t$data .= $this->csv_format(date('Y-m-d H:i:s', $purchase->created));\r\n\t\t\t$data .= $this->_newline;\r\n\t\t}\r\n\r\n\t\tforce_download('purchases-' . time() . '.csv', $data);\r\n\t}", "public function exportAction ()\n {\n /* get the orders */\n $orderIds = $this->getRequest()->getPost('order_ids');\n \n if (isset($orderIds) && ($orderIds[0] != \"\")) {\n \n $collection = Mage::getResourceModel('sales/order_collection');\n $collection->addAttributeToFilter('entity_id', $orderIds);\n \n $export = Mage::getModel('gls/export');\n $export->export($collection);\n \n /* download the file */\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Orders have been exported'));\n $this->_redirect('*/*/');\n } else {\n $this->_getSession()->addError($this->__('No Order has been selected'));\n $this->_redirect('*/*/');\n }\n }", "public function exportDetail()\n {\n $type = request('type');\n $order_id = request('order_id') ?? 0;\n $order = ShopProviderOrder::with(['details', 'orderTotal'])->find($order_id);\n if ($order) {\n $data = array();\n $data['name'] = $order['first_name'] . ' ' . $order['last_name'];\n $data['address'] = $order['address1'] . ', ' . $order['address2'] . ', ' . $order['country'];\n $data['phone'] = $order['phone'];\n $data['email'] = $order['email'];\n $data['comment'] = $order['comment'];\n $data['payment_method'] = $order['payment_method'];\n $data['shipping_method'] = $order['shipping_method'];\n $data['created_at'] = $order['created_at'];\n $data['currency'] = $order['currency'];\n $data['exchange_rate'] = $order['exchange_rate'];\n $data['subtotal'] = $order['subtotal'];\n $data['tax'] = $order['tax'];\n $data['shipping'] = $order['shipping'];\n $data['discount'] = $order['discount'];\n $data['total'] = $order['total'];\n $data['received'] = $order['received'];\n $data['balance'] = $order['balance'];\n $data['id'] = $order->id;\n $data['details'] = [];\n\n $attributesGroup = ShopAttributeGroup::pluck('name', 'id')->all();\n\n if ($order->details) {\n foreach ($order->details as $key => $detail) {\n $arrAtt = json_decode($detail->attribute, true);\n if ($arrAtt) {\n $htmlAtt = '';\n foreach ($arrAtt as $groupAtt => $att) {\n $htmlAtt .= $attributesGroup[$groupAtt] . ':' . sc_render_option_price($att, $order['currency'], $order['exchange_rate']);\n }\n $name = $detail->name . '(' . strip_tags($htmlAtt) . ')';\n } else {\n $name = $detail->name;\n }\n $data['details'][] = [\n $key + 1, $detail->sku, $name, $detail->qty, $detail->price, $detail->total_price,\n ];\n }\n }\n $options = ['filename' => 'Order ' . $order_id];\n return \\Export::export($type, $data, $options);\n\n }\n }", "public function export()\n\t{\n\t\tArtisan::call('export:sales');\n\t\treturn Redirect::route('customermaster.index')\n\t\t\t\t->with('class', 'alert-success')\n\t\t\t->with('message', 'Export successfuly created');\n\n\t}", "public function get_order_export() {\n\n\t\t$user_id = auth()->guard('store')->user()->id;\n\n\t\t$week_data = request()->date;\n\n\t\t$daily_payout = Payout::userId([$user_id])\n\n\t\t\t->whereDate('created_at', $week_data)\n\t\t\t->get()\n\t\t\t->groupBy('order_id');\n\n\t\t$count = 0;\n\t\t$week = [];\n\t\t//dd($daily_payout, $user_id);\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$i = 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\t$notes = $payout->order->store_notes;\n\t\t\t\t$status_text = $payout->status_text;\n\n\t\t\t\t$tax = (float) $payout->order->tax;\n\t\t\t\t$count = $payout->order->id;\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$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$order_data[$i] = $payout;\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\n\t\t\t$week[] = ['Date' => $format_date,\n\t\t\t\t'OrderId' => $count,\n\t\t\t\t'Sale' => $subtotal,\n\t\t\t\t'Tax' => $tax,\n\t\t\t\t'Total' => $order_total,\n\t\t\t\t'Gofer Fee' => $gofer_fee,\n\t\t\t\t'Net Payout' => $total,\n\t\t\t\t'Payout Status' => $status_text,\n\t\t\t\t'Penalty' => $total_penalty,\n\t\t\t\t'Paid penalty' => $paid_penalty,\n\t\t\t\t'Notes' => $notes];\n\n\t\t}\n\t\t//dd($week);\n\t\t$width = array(\n\t\t\t'A' => '2',\n\t\t\t'B' => '2',\n\t\t\t'C' => '2',\n\t\t\t'D' => '2',\n\t\t\t'E' => '2',\n\t\t\t'F' => '2',\n\t\t\t'G' => '2',\n\t\t\t'H' => '2',\n\t\t\t'i' => '2',\n\t\t\t'j' => '6',\n\n\t\t);\n\n\t\t//return $data->download('download.pdf');\n\t\t$data = $week;\n\t\t$filename = 'Payout_' . time();\n\t\t$download_format = 'csv';\n\n\t\tif ($download_format == 'csv') {\n\t\t\treturn buildExcelFile($filename, @$week, $width)->download($download_format);\n\t\t}\n\t\treturn back();\n\t}", "public function exportCsv() {\n\t\t$fileName = $this->user->info->ID_ACCOUNT . \"_InventorySalvager\" . date( 'Y-m-d' ) . \".csv\";\n\t\t$this->load->helper( 'download' );\n\t\tif ( ! file_exists( \"Downloads\" ) ) {\n\t\t\tmkdir( \"Downloads\" );\n\t\t}\n\t\terror_reporting( 0 );\n\t\t$fp = fopen( \"Downloads/\" . $fileName, \"w\" );\n\t\tif ( isset( $this->user->info->admin ) && ! empty( $this->user->info->admin ) ) {\n\t\t\t$head = array(\n\t\t\t\t\"User Name\",\n\t\t\t\t\"Product Name\",\n\t\t\t\t\"Reimbursement ID\",\n\t\t\t\t\"FNSKU\",\n\t\t\t\t\"Transaction Item Id\",\n\t\t\t\t\"Field\",\n\t\t\t\t\"Status\",\n\t\t\t\t\"Case Id\",\n\t\t\t\t\"Quantity Damage/Loss\",\n\t\t\t\t\"Case Reimbursed\"\n\t\t\t);\n\t\t\tfputcsv( $fp, $head );\n\t\t\t$write_info = array();\n\t\t\t$userDetails = $this->user_model->getAllUsers();\n\t\t\tforeach ( $userDetails as $key => $user ) {\n\t\t\t\t$inventoryDetails[ $key ] = $this->inventory_salvager_model->getInventoryCaseByAccountId( $user['ID_ACCOUNT'] );\n\t\t\t\t$result = $this->groupSortFNSKUArray( $inventoryDetails[ $key ] );\n\t\t\t\tforeach ( $result as $index => $case ) {\n\t\t\t\t\t$write_info['username'] = $user['username'];\n\t\t\t\t\t$write_info['productname'] = $case['productname'];\n\t\t\t\t\t$write_info['reimburse_id'] = $case['reimburse_id'];\n\t\t\t\t\t$write_info['fnsku'] = $case['fnsku'];\n\t\t\t\t\t$write_info['transaction_item_id'] = $case['transaction_item_id'];\n\t\t\t\t\t$write_info['date'] = date( 'Y/m/d', strtotime( $case['date'] ) );\n\t\t\t\t\t$write_info['status'] = ( ( $case['status'] == 1 ) ? 'Pending' : ( ( $case['status'] == 2 ) ? 'Success' : '' ) );\n\t\t\t\t\t$write_info['caseId'] = $case['caseId'];\n\t\t\t\t\t$write_info['quantity'] = $case['quantity'];\n\t\t\t\t\t$write_info['amount_total'] = ( ! empty( $caseDetials['amount_total'] ) ) ? \"$\" . $caseDetials['amount_total'] : '';\n\t\t\t\t\tfputcsv( $fp, $write_info );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$days = 0;\n\t\t\t$result = $this->inventory_salvager_model->getInventoryCaseByAccountId( $this->user->info->ID_ACCOUNT );\n\t\t\t$invenDetails = $this->groupSortFNSKUArray( $result );\n\t\t\t$head = array(\n\t\t\t\t\"Product Name\",\n\t\t\t\t\"Reimbursement ID\",\n\t\t\t\t\"FNSKU\",\n\t\t\t\t\"Transaction Item Id\",\n\t\t\t\t\"Field\",\n\t\t\t\t\"Status\",\n\t\t\t\t\"Case Id\",\n\t\t\t\t\"Quantity Damage/Loss\",\n\t\t\t\t\"Case Reimbursed\"\n\t\t\t);\n\t\t\tfputcsv( $fp, $head );\n\t\t\t$write_info = array();\n\t\t\tforeach ( $invenDetails as $key => $case ) {\n\t\t\t\t$write_info['productname'] = $case['productname'];\n\t\t\t\t$write_info['reimburse_id'] = $case['reimburse_id'];\n\t\t\t\t$write_info['fnsku'] = $case['fnsku'];\n\t\t\t\t$write_info['transaction_item_id'] = $case['transaction_item_id'];\n\t\t\t\t$write_info['date'] = date( 'Y/m/d', strtotime( $case['date'] ) );\n\t\t\t\t$write_info['status'] = ( ( $case['status'] == 1 ) ? 'Pending' : ( ( $case['status'] == 2 ) ? 'Success' : '' ) );\n\t\t\t\t$write_info['caseId'] = $case['caseId'];\n\t\t\t\t$write_info['quantity'] = $case['quantity'];\n\t\t\t\t$write_info['amount_total'] = ( ! empty( $caseDetials['amount_total'] ) ) ? \"$\" . $caseDetials['amount_total'] : '';\n\t\t\t\tfputcsv( $fp, $write_info );\n\t\t\t}\n\t\t}\n\t\tfclose( $fp );\n\t\techo $url = base_url() . 'Downloads/' . $fileName;\n\t\texit;\n\t}", "public function dumpSku();", "protected function _generateFile(){\r\n\t\tif(!is_dir($this->getExportDirectory())){\r\n\t\t\tmkdir($this->getExportDirectory());\r\n\t\t}\r\n\t\t$fp = fopen($this->getCsvFilePath(), 'w');\r\n\t\tforeach ($this->_productData as $data) {\r\n\t\t\t$this->fputcsv($fp, $data);\r\n\t\t}\r\n\t\tfclose($fp);\r\n\t}", "public function export(){\n $products = $this->Paginator->paginate($this->Products->find());\n\n $this->autoRender = false;\n $this->layout = false;\n $fileName = \"bookreport_\".date(\"d-m-y:h:s\").\".xls\";\n\n $headerRow = array(\"ID\", \"Title\", \"Type\", \"Description\", \"Price\", \"Rating\");\n $data = array();\n foreach ($products as $product) {\n array_push($data, array($product->id, $product->description, $product->title, $product->price, $product->rating));\n }\n //debug($data);\n ini_set('max_execution_time', 1600); //increase max_execution_time to 10 min if data set is very large\n $fileContent = implode(\"\\t \", $headerRow).\"\\n\";\n foreach($data as $result) {\n $fileContent .= implode(\"\\t \", $result).\"\\n\";\n }\n header('Content-type: application/ms-excel'); /// you can set csv format\n header('Content-Disposition: attachment; filename='.$fileName);\n echo $fileContent;\n }", "public function generateExport()\n {\n }", "function export()\n\t{\n\t\t$zip = $this->buildExportFile();\n\t\t\n\t ilUtil::deliverFile($zip, $this->object->getTitle().\".zip\", '', false, true);\n\t}", "public function exportOrder(Varien_Event_Observer $observer)\n {\n $order = $observer->getEvent()->getOrder();\n $items = $order->getAllItems();\n $shipping = $order->getShippingAddress()->getData();\n $billing = $order->getBillingAddress()->getData();\n \n $data=Mage::app()->getFrontController()->getRequest()->getPost('payment', false);\n \n Mage::getModel('OLX_Checkout/export')->exportOrder($order,$items,$shipping,$billing,$data);\n \n return true;\n \n }", "public function exportDetailedAction(){\n $fileName = 'facturas-detalladas-' . gmdate('Y_m_d-H_i_s') . '.csv';\n $grid = $this->getLayout()->createBlock('adminhtml/sales_invoice_grid');\n $this->_prepareDownloadResponse($fileName, $grid->getDetailedFile());\n }", "public function downloadAction ()\n {\n /* get the orders */\n $orderIds = $this->getRequest()->getPost('order_ids');\n \n if (isset($orderIds) && ($orderIds[0] != \"\")) {\n \n $collection = Mage::getResourceModel('sales/order_collection');\n $collection->addAttributeToFilter('entity_id', $orderIds);\n \n $export = Mage::getModel('gls/export');\n $csvData = $export->export($collection,true);\n \n /* download the file */\n $this->_prepareDownloadResponse('GlsCmd_'.date('Ymdhis').'.csv', $csvData, 'text/csv');\n \n } else {\n $this->_getSession()->addError($this->__('No Order has been selected'));\n $this->_redirect('*/*/');\n }\n }", "public function exportPdf()\n {\n $shop = $this->user->shop;\n $products = $shop->products()\n ->orderByRaw('CHAR_LENGTH(clave)')\n ->orderBy('clave')\n ->get();\n\n $hour = $this->getHour();\n $date = $this->getDate();\n if ($shop->image) {\n $shop->image = $this->getS3URL($shop->image);\n }\n\n $pdf = PDF::loadview(\n 'product.pdf',\n compact('date', 'hour', 'products', 'shop')\n );\n return $pdf->stream('Productos.pdf');\n }", "public function exportAction()\n {\n $_EXPORT_TYPE = \"ordersexport\";\n $config = Mage::getModel('dataexport/config');\n \n if( ! $config->getIsEnabled()) {\n Mage::throwException($this->__('Module Disabled!'));\n }\n \n if($this->getRequest()->isPost()) { \n try {\n //$post = $this->getRequest()->getPost();\n $exporter = Mage::getModel('dataexport/exporter');\n /* @var $exporter Advertise_Dataexport_Model_Exporter */\n \n // Set export type for uploaded filename\n $exporter->setExportType($_EXPORT_TYPE);\n \n /**\n * Add Order Export\n */\n if($config->isOrderExportEnabled()) {\n $toDate = $this->getRequest()->getParam('date_to', NULL);\n $fromDate = $this->getRequest()->getParam('date_from', NULL);\n \n $exportAdapter = Mage::getModel('dataexport/exporter_order');\n $exportAdapter->setDateRange($fromDate, $toDate);\n $exporter->addExporter($exportAdapter);\n }\n /**\n * Add Customer Export\n */\n if($config->isCustomerExportEnabled()) {\n $exportAdapter = Mage::getModel('dataexport/exporter_customer');\n $exporter->addExporter($exportAdapter);\n }\n /**\n * Add Cart Export\n */\n if($config->isCartExportEnabled()) {\n $exportAdapter = Mage::getModel('dataexport/exporter_cart');\n $exporter->addExporter($exportAdapter);\n }\n \n /**\n * Do it!\n */\n $totalItems = $exporter->export();\n \n $message = $this->__('Your form has been submitted successfully.');\n Mage::getSingleton('adminhtml/session')->addSuccess($message);\n Mage::getSingleton('adminhtml/session')->addSuccess(\"{$totalItems} Items successfully Exported.\");\n } \n catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n }\n\n $this->_redirect('*/*');\n }\n else {\n Mage::throwException($this->__('Invalid form data.'));\n }\n }", "public function exportCsvCurrentAction()\n {\n $path = Mage::getBaseDir('export');\n $fileName = $path . DS . 'Kronosav' . '.csv';\n\n $file = fopen($fileName, 'w');\n\n /** @var Mage_Core_Model_Mysql4_Collection_Abstract $products */\n $products = Mage::getModel('scrappagescheme/scrap')->getCollection();\n\n //make header\n $data = array(\n 'id',\n 'name',\n 'sku',\n 'discount_percentage',\n );\n fputcsv($file, $data);\n\n $i = 1;\n /** @var Mage_Catalog_Model_Product $product */\n foreach ($products as $product) {\n $data = array(\n $i++,\n $product->getName(),\n $product->getSku(),\n $product->getData('percentage'), //discount percentage\n );\n\n fputcsv($file, $data);\n }\n\n fclose($file);\n\n $this->_prepareDownloadResponse('scrappagescheme.csv',\n array(\n 'type' => 'filename',\n 'value' => $fileName,\n 'rm' => true,\n )\n );\n }", "public function purchase_page() {\n require_once(__DIR__ . '/includes/SPAY_alipay_SDK/index.php');\n }", "public function get_export() {\n\n\t\t$user_id = auth()->guard('store')->user()->id;\n\n\t\t$week_data = request()->week;\n\n\t\t$start_end = explode(',', $week_data);\n\n\t\t$daily_payout = Payout::userId([$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\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 = 0;\n\t\t\t$paid_penalty = 0;\n\t\t\t$penalty = 0;\n\t\t\t$i = 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\t$status_text = $payout->status_text;\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$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$order_data[$i] = $payout;\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\n\t\t\t$week[] = ['Date' => $format_date,\n\t\t\t\t'Orders' => $count,\n\t\t\t\t'Sale' => $subtotal,\n\t\t\t\t'Tax' => $tax,\n\t\t\t\t'Total' => $order_total,\n\t\t\t\t'GoferGrocery Fee' => $gofer_fee,\n\t\t\t\t'Net Payout' => $total,\n\t\t\t\t'Payout Status' => $status_text,\n\t\t\t\t'Penalty' => $total_penalty,\n\t\t\t\t'Paid penalty' => $paid_penalty];\n\n\t\t}\n\t\t//dd($week);\n\t\t$width = array(\n\t\t\t'A' => '2',\n\t\t\t'B' => '2',\n\t\t\t'C' => '2',\n\t\t\t'D' => '2',\n\t\t\t'E' => '2',\n\t\t\t'F' => '2',\n\t\t\t'G' => '2',\n\t\t\t'H' => '2',\n\t\t\t'i' => '2',\n\n\t\t);\n\n\t\t//return $data->download('download.pdf');\n\t\t$data = $week;\n\t\t$filename = 'Payout_' . time();\n\t\t$download_format = 'csv';\n\n\t\tif ($download_format == 'csv') {\n\t\t\treturn buildExcelFile($filename, $week, $width)->download($download_format);\n\t\t}\n\t\treturn back();\n\t}", "public function exportCsvEmptyAction()\n {\n $path = Mage::getBaseDir('export');\n $fileName = $path . DS . 'Kronosav' . '.csv';\n\n $file = fopen($fileName, 'w');\n\n /** @var Mage_Core_Model_Mysql4_Collection_Abstract $products */\n $products = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('name');\n\n //make header\n $data = array(\n 'id',\n 'name',\n 'sku',\n 'discount_percentage',\n );\n fputcsv($file, $data);\n\n $i = 1;\n /** @var Mage_Catalog_Model_Product $product */\n foreach ($products as $product) {\n $data = array(\n $i++,\n $product->getName(),\n $product->getSku(),\n 0, //discount percentage\n );\n\n fputcsv($file, $data);\n }\n\n fclose($file);\n\n $this->_prepareDownloadResponse('scrappagescheme.csv',\n array(\n 'type' => 'filename',\n 'value' => $fileName,\n 'rm' => true,\n )\n );\n }", "public function getInformationByStore($shop)\n {\n $lengowExport = new LengowExport(array('shop_id' => $shop->id));\n $lastExportDate = LengowConfiguration::get('LENGOW_LAST_EXPORT', null, null, $shop->id);\n if ($lastExportDate !== null && $lastExportDate !== '') {\n $lastExport = LengowMain::getDateInCorrectFormat(strtotime($lastExportDate), true);\n } else {\n $lastExport = $this->locale->t('toolbox.index.last_import_none');\n }\n $checklist = array();\n $checklist[] = array(\n 'header' => $shop->name . ' (' . $shop->id . ')' . ' - http://' . $shop->domain,\n );\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.shop_active'),\n 'state' => (int)LengowConfiguration::shopIsActive($shop->id),\n );\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.shop_catalogs_id'),\n 'message' => LengowConfiguration::get('LENGOW_CATALOG_ID', null, null, $shop->id),\n );\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.shop_product_total'),\n 'message' => $lengowExport->getTotalProduct(),\n );\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.shop_product_exported'),\n 'message' => $lengowExport->getTotalExportProduct(),\n );\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.export_variation_enabled'),\n 'state' => (int)LengowConfiguration::get('LENGOW_EXPORT_VARIATION_ENABLED', null, null, $shop->id),\n );\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.export_out_stock_enabled'),\n 'state' => (int)LengowConfiguration::get('LENGOW_EXPORT_OUT_STOCK', null, null, $shop->id),\n );\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.export_selection_enabled'),\n 'state' => (int)LengowConfiguration::get('LENGOW_EXPORT_SELECTION_ENABLED', null, null, $shop->id),\n );\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.shop_export_token'),\n 'message' => LengowConfiguration::get('LENGOW_SHOP_TOKEN', null, null, $shop->id),\n );\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.url_export'),\n 'message' => LengowMain::getExportUrl($shop->id),\n );\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.shop_last_export'),\n 'message' => $lastExport,\n );\n return $this->getAdminContent($checklist);\n }", "public function ProcPurchase() {\n\t\tglobal $SPFunctions;\n\t\t$gateway = $this->SWIFT4->Settings->getKey(\"settings\",\"sp_gateway\");\n\t\t$gwPath = null;\n\t\t\n\t\tswitch ($gateway) {\n\t\t\tcase SP_PROCESSOR_WORLDPAY:\n\t\t\t\t$gwPath = \"worldpay\";\n\t\t\t\tbreak;\n\t\t\tcase SP_PROCESSOR_PAYPAL:\n\t\t\t\t$gwPath = \"paypal\";\n\t\t\t\tbreak;\n\t\t\tcase SP_PROCESSOR_AUTHORIZE:\n\t\t\t\t$gwPath = \"authnet\";\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tif (!empty($gwPath)) {\n\t\t\t/* Create the semi-permanent cart record. */\n\t\t\t\n\t\t\tif (!empty($_SESSION[\"items\"])) {\n\t\t\t\t\n\t\t\t\t$_SESSION[\"cart_id\"] = $SPFunctions->encodeCartData(\n\t\t\t\t\t$this->SWIFT4->User->GetUserID(),$_SESSION[\"items\"],$gateway);\n\n\t\t\t\tinclude (SWIFT_MODULESDIRECTORY.\"/supportpay/client/\".$gwPath.\"/procpurchase.php\");\n\t\t\t} else {\n\t\t\t\tSWIFT::Error(\"SupportPay\",$this->SWIFT4->Language->Get('sp_noitemsselected'));\n\t\t\t\t$this->UserInterface->Header('sp_uw_master');\n\t\t\t\t$this->UserInterface->Footer();\n\t\t\t}\n\t\t} else {\n\t\t\tSWIFT::Error(\"SupportPay\",$this->SWIFT4->Language->Get('sp_unknown_payment_type'));\n\t\t\t$this->UserInterface->Header('sp_uw_master');\n\t\t\t$this->UserInterface->Footer();\n\t\t}\n\t}", "public function export() \n {\n $data = Transaction::where('status','>=',3)->with(['detail','user'])->get();\n $countTotal = Transaction::where('status','>=',3)->with(['detail','user'])->sum('total');\n \n view()->share(['data' => $data,'countTotal' => $countTotal]);\n $pdf = PDF::loadView('pdf.report');\n return $pdf->download('report.pdf');\n }", "public function export (){\n $type = I('type',1,'intval');\n // 工厂内\n if($type == 1){\n $product_list = M('product')->where(['is_where'=>1])->select();\n $header = [\"箱子属性\",\"箱子编号\",\"入库时间\"];\n $data = [];\n foreach($product_list as $product){\n $data[] = [$product['cate_name'],$product['name'],date(\"Y-m-d H:i\", $product['update_time'])];\n }\n return $this->exportCsv($header, $data,date(\"Y-m-d-\").\"工厂内\");\n }\n\n if($type == 2){\n $product_list = M('product')->where(['is_where'=>2])->order(\"cate_name, client_id\")->select();\n $header = [\"箱子属性\",\"箱子编号\",\"客户代码\",\"出库时间\"];\n $data = [];\n foreach($product_list as $product){\n $data[] = [$product['cate_name'], $product['name'],$product['client_name'],date(\"Y-m-d H:i\", $product['update_time'])];\n }\n return $this->exportCsv($header, $data,date(\"Y-m-d-\").\"工厂外\");\n }\n }", "public function store()\n\t{\n\n\t\t$inventory = Input::except('pid','qty');\n\t\t\n\t\t$total_cost = $this->totalCost();\n\n\t\t$inventory['total_cost'] = $total_cost;\n\t\t$inv = Inventory::create($inventory);\n\n\t\t$this->setTransaction($inv);\n\n\t\treturn Redirect::route('purchases.index')->with('alert.success', Alert::text('saddpo'));\n\n\t}", "function ExportData() {\n global $avance_producto;\n $sCsvStr = \"\";\n\n // Default export style\n $sExportStyle = \"h\";\n\n // Load recordset\n $rs = $this->LoadRecordset();\n $this->lTotalRecs = $rs->RecordCount();\n $this->lStartRec = 1;\n\n // Export all\n if ($avance_producto->ExportAll) {\n $this->lStopRec = $this->lTotalRecs;\n } else { // Export 1 page only\n $this->SetUpStartRec(); // Set up start record position\n\n // Set the last record to display\n if ($this->lDisplayRecs < 0) {\n $this->lStopRec = $this->lTotalRecs;\n } else {\n $this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;\n }\n }\n if ($avance_producto->Export == \"xml\") {\n $XmlDoc = new cXMLDocument();\n } else {\n echo ew_ExportHeader($avance_producto->Export);\n\n // Horizontal format, write header\n if ($sExportStyle <> \"v\" || $avance_producto->Export == \"csv\") {\n $sExportStr = \"\";\n ew_ExportAddValue($sExportStr, 'idConsultoria', $avance_producto->Export);\n ew_ExportAddValue($sExportStr, 'idCronograma', $avance_producto->Export);\n echo ew_ExportLine($sExportStr, $avance_producto->Export);\n }\n }\n\n // Move to first record\n $this->lRecCnt = $this->lStartRec - 1;\n if (!$rs->EOF) {\n $rs->MoveFirst();\n $rs->Move($this->lStartRec - 1);\n }\n while (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {\n $this->lRecCnt++;\n if (intval($this->lRecCnt) >= intval($this->lStartRec)) {\n $this->LoadRowValues($rs);\n\n // Render row for display\n $avance_producto->RowType = EW_ROWTYPE_VIEW; // Render view\n $this->RenderRow();\n if ($avance_producto->Export == \"xml\") {\n $XmlDoc->BeginRow();\n $XmlDoc->AddField('idConsultoria', $avance_producto->idConsultoria->CurrentValue);\n $XmlDoc->AddField('idCronograma', $avance_producto->idCronograma->CurrentValue);\n $XmlDoc->EndRow();\n } else {\n if ($sExportStyle == \"v\" && $avance_producto->Export <> \"csv\") { // Vertical format\n echo ew_ExportField('idConsultoria', $avance_producto->idConsultoria->ExportValue($avance_producto->Export, $avance_producto->ExportOriginalValue), $avance_producto->Export);\n echo ew_ExportField('idCronograma', $avance_producto->idCronograma->ExportValue($avance_producto->Export, $avance_producto->ExportOriginalValue), $avance_producto->Export);\n }\telse { // Horizontal format\n $sExportStr = \"\";\n ew_ExportAddValue($sExportStr, $avance_producto->idConsultoria->ExportValue($avance_producto->Export, $avance_producto->ExportOriginalValue), $avance_producto->Export);\n ew_ExportAddValue($sExportStr, $avance_producto->idCronograma->ExportValue($avance_producto->Export, $avance_producto->ExportOriginalValue), $avance_producto->Export);\n echo ew_ExportLine($sExportStr, $avance_producto->Export);\n }\n }\n }\n $rs->MoveNext();\n }\n\n // Close recordset\n $rs->Close();\n if ($avance_producto->Export == \"xml\") {\n header(\"Content-Type: text/xml\");\n echo $XmlDoc->XML();\n } else {\n echo ew_ExportFooter($avance_producto->Export);\n }\n }", "public function ExportVoucherCodes()\n {\n $sReturn = '';\n\n if ($this->AllowExportingVoucherCodes()) {\n $oVouchers = TdbShopVoucherList::GetList(\"SELECT * FROM `shop_voucher` WHERE `shop_voucher_series_id`='\".MySqlLegacySupport::getInstance()->real_escape_string($this->sId).\"'\");\n $oVouchers->GoToStart();\n $count = 0;\n while ($oVoucher = $oVouchers->Next()) {\n $aCsvVouchers[$count][0] = str_replace('\"', '\"\"', $oVoucher->fieldCode);\n if ('0000-00-00 00:00:00' != $oVoucher->fieldDatecreated) {\n $aCsvVouchers[$count][1] = date('d.m.Y H:i', strtotime($oVoucher->fieldDatecreated));\n } else {\n $aCsvVouchers[$count][3] = '';\n }\n $aCsvVouchers[$count][2] = $oVoucher->fieldIsUsedUp;\n if ('0000-00-00 00:00:00' != $oVoucher->fieldDateUsedUp) {\n $aCsvVouchers[$count][3] = date('d.m.Y H:i', strtotime($oVoucher->fieldDateUsedUp));\n } else {\n $aCsvVouchers[$count][3] = '';\n }\n ++$count;\n }\n\n $sCsv = '';\n for ($i = 0; $i < count($aCsvVouchers); ++$i) {\n $sCsv .= '\"'.implode('\";\"', $aCsvVouchers[$i]).\"\\\"\\n\";\n }\n $sCsv = '\"'.TGlobal::OutHTML(TGlobal::Translate('chameleon_system_shop.voucher.export_column_code')).'\";\"'.TGlobal::OutHTML(TGlobal::Translate('chameleon_system_shop.voucher.export_column_created')).'\";\"'.TGlobal::OutHTML(TGlobal::Translate('chameleon_system_shop.voucher.export_column_spent')).'\";\"'.TGlobal::OutHTML(TGlobal::Translate('chameleon_system_shop.voucher.export_column_spent_date')).\"\\\"\\n\".$sCsv;\n\n while (@ob_end_clean()) {\n }\n header('Cache-Control: must-revalidate');\n header('Pragma: must-revalidate');\n header('Content-type: application/csv');\n header('Content-disposition: attachment; filename=ShopVouchers.csv');\n\n echo $sCsv;\n\n exit(0);\n } else {\n echo 'Keine Berechtigung';\n }\n }", "public function save() {\n while ($this->number == 0) {\n // pick random 3 digit #\n $test = rand(100,999);\n // use this if the file doesn't exist\n if (!file_exists('../data/order'.$test.'.xml'))\n $this->number = $test;\n }\n // and establish the checkout time\n $this->datetime = date(DATE_ATOM);\n\n // start empty\n $xml = new SimpleXMLElement('<order/>');\n // add the main properties\n $xml->addChild('number',$this->number);\n $xml->addChild('datetime',$this->datetime);\n foreach ($this->items as $key => $value) {\n $lineitem = $xml->addChild('item');\n $lineitem->addChild('code',$key);\n $lineitem->addChild('quantity',$value);\n }\n\n // save it\n $xml->asXML('../data/order' . $this->number . '.xml');\n }", "protected function _purchases() {\n\t MongoCursor::$timeout = -1;\n\t\t$this->log('Generating Purchase Orders');\n\t\t$orderCollection = Order::collection();\n\t\t$event_count = count($this->poEvents);\n\t\t$ecount = 0;\n\t\tforeach ($this->poEvents as $eventId) {\n\t\t\t$purchaseHeading = ProcessedOrder::$_purchaseHeading;\n\t\t\t$total = array('sum' => 0, 'quantity' => 0);\n\t\t\t$event = Event::find('first', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'_id' => $eventId\n\t\t\t)));\n\t\t\t$eventItems = $this->_getOrderItems($eventId);\n\t\t\t$vendorName = preg_replace('/[^(\\x20-\\x7F)]*/','', substr(String::asciiClean($event->name), 0, 3));\n\t\t\t$time = date('ymdis', $event->_id->getTimestamp());\n\t\t\t$poNumber = 'TOT'.'-'.$vendorName.$time;\n\t\t\t$filename = 'TOTitpo'.$vendorName.$time.'.csv';\n\t\t\t$handle = $this->tmp.$filename;\n\t\t\t$this->log(\"Opening PO file $handle\");\n\t\t\t$fp = fopen($handle, 'w');\n\t\t\t$this->summary['purchase_orders'][] = $filename;\n\t\t\t\n\t\t\t$purchaseOrder = array();\n\t\t\t$inc = 0;\n\t\t\tforeach ($eventItems as $eventItem) {\n\t\t\t\tforeach ($eventItem['details'] as $key => $value) {\n\t\t\t\t\t$this->log(\"{$eventItem['_id']} size {$key} value {$value}\");\n\t\t\t\t\t$orders = $orderCollection->find( array(\n\t\t\t\t\t\t'items.item_id' => (string) $eventItem['_id'],\n\t\t\t\t\t\t'items.size' => (string) $key,\n\t\t\t\t\t\t'items.status' => array('$ne' => 'Order Canceled'),\n\t\t\t\t\t\t'cancel' => array('$ne' => true))\n\t\t\t\t\t);\n\t\t\t\t\tif ($orders) {\n\t\t\t\t\t\tforeach ($orders as $order) {\n\t\t\t\t\t\t\t$items = $order['items'];\n\t\t\t\t\t\t\t$date_created = $order['date_created'];\n\t\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\t\t$active = (empty($item['cancel']) || $item['cancel'] != true) ? true : false;\n\t\t\t\t\t\t\t\t$itemValid = ($item['item_id'] == $eventItem['_id']) ? true : false;\n\t\t\t\t\t\t\t\tif ($itemValid && ((string) $key == $item['size']) && $active){\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Supplier'] = $eventItem['vendor'];\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['PO # / RMA #'] = $poNumber;\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['SKU'] = $eventItem['sku_details'][$item['size']];\n\t\t\t\t\t\t\t\t\tif (empty($eventItem['sku_details'][$item['size']])) {\n\t\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['SKU'] = Item::getUniqueSku($eventItem['vendor'], $eventItem['vendor_style'], (string)$item['size'], $item['color']);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (empty($purchaseOrder[$inc]['Qty'])) {\n\t\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Qty'] = $item['quantity'];\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Qty'] += $item['quantity'];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t//new additions\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Vendor Style'] = $eventItem['vendor_style'];\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Vendor Name'] = $vendorName;\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Item Color'] = $item['color'];\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Item Size'] = $item['size'];\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Item Description'] = $eventItem['description'];\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Order Creation Date'] = date(\"m/d/Y\", str_replace(\"0.00000000 \", \"\", $order['date_created']));\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Promised Ship-by Date'] = date(\"m/d/Y\", str_replace(\"0.00000000 \", \"\", $order['ship_date']));\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Event Name'] = $event->name;\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['Event End Date'] = date(\"m/d/Y\", str_replace(\"0.00000000 \", \"\", $event->end_date));\n\n\n\t\t\t\t\t\t\t$purchaseOrder[$inc]['WhsInsValue (Cost)'] = number_format($eventItem['sale_whol'], 2);\n\t\t\t\t\t\t\t$purchaseOrder[$inc]['Description for Customs'] = (!empty($eventItem['category']) ? $eventItem['category'] : \"\");\n\t\t\t\t\t\t\t$purchaseOrder[$inc]['ShipInsValue'] = number_format($eventItem['orig_whol'], 2);\n\t\t\t\t\t\t\t$purchaseOrder[$inc]['Ref1'] = $eventItem['_id'];\n\t\t\t\t\t\t\t$purchaseOrder[$inc]['Ref2'] = $key;\n\t\t\t\t\t\t\t$purchaseOrder[$inc]['Ref3'] = $eventItem['color'];\n\n\n\t\t\t\t\t\t\tif ((int) $eventItem['product_weight'] > 0) {\n\t\t\t\t\t\t\t\t$purchaseOrder[$inc]['UOM1_Weight'] = number_format($eventItem['product_weight'],2);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$purchaseOrder[$inc] = $this->sortArrayByArray($purchaseOrder[$inc], $purchaseHeading);\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 (!empty($purchaseOrder[$inc])) {\n\t\t\t\t\t\t\tfputcsv($fp, array_merge($purchaseHeading, $purchaseOrder[$inc]));\n\t\t\t\t\t\t\tif ($this->test != 'true') {\n\t\t\t\t\t\t\t\t$po = PurchaseOrder::create();\n\t\t\t\t\t\t\t\t$po->save(array_merge($purchaseHeading, $purchaseOrder[$inc]) + $this->batchId);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t++$inc;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t++$ecount;\n\t\t\tif ($event_count != 0) {\n $this->queue->percent = (float)number_format((($ecount/$event_count) * 100), 2);\n $this->queue->save();\n }\n\t\t\tfclose($fp);\n\t\t\trename($handle, $this->pending.$filename);\n\t\t}\n\t}", "public function exportCsv(){\n $data = array(\n array(\"Viande\", \"Morceau\", \"label\", \"Colisage\", \"Qté\")\n );\n foreach ($this->cumulated_products as $product){\n $row = array(\n $product['category'],\n $product['product_name'],\n $product['label_name'],\n $product['description_short'],\n $product['quantity']\n );\n $data[] = $row;\n }\n //Tools::testVar($data);\n //download\n Tools::downloadCsv($data);\n }" ]
[ "0.6490344", "0.64375186", "0.63737744", "0.637098", "0.6315227", "0.63119715", "0.62617666", "0.6149656", "0.61280763", "0.6116723", "0.61126685", "0.6073886", "0.6070326", "0.6051671", "0.60505956", "0.6041576", "0.60393226", "0.6036399", "0.6018944", "0.59378964", "0.5937084", "0.59280676", "0.592777", "0.59156066", "0.59109056", "0.5859414", "0.58593357", "0.5852545", "0.58501995", "0.5837554" ]
0.7507618
0
import the connect type purchase
public function importConnectTypePurchase() { $em = $this->em; $connect_app_service = $this->container->get('sixth_continent_connect.connect_app'); $handler = $this->container->get('monolog.logger.purchased_cards_log'); $applane_service = $this->container->get('appalne_integration.callapplaneservice'); $applane_service->writeAllLogs($handler, 'Entering into class [ExportManagement\ExportManagementBundle\Services\PurchaseService] and function [importConnectTypePurchase]', array()); //write log $counter = $this->findCounter(); $counter = $counter + 1; $ci_transaction_data = $em->getRepository('SixthContinentConnectBundle:SixthcontinentconnectPaymentTransaction') ->getCiTransactions(); //constants $causale = ApplaneConstentInterface::CONNECT_TRANSACTION_CAUSALE; $code = ApplaneConstentInterface::CONNECT_PURCHASE_TRANSACTION_CODICE; $tipo_quantaza = ApplaneConstentInterface::SIX_TIPO_QUIETANZA; $time = new \DateTime('now'); foreach ($ci_transaction_data as $transaction) { $id = $transaction->getId(); $applane_service->writeAllLogs($handler, 'Connect CI transaction of table [paypaltransactionrecords] with id: '.$id, array()); //write log $purchase = new Purchase(); $date = $transaction->getDate(); $formated_date = $date->format('Y-m-d'); $app_id = $transaction->getAppId(); $citizen_id = $transaction->getUserId(); $amount = $connect_app_service->changeRoundAmountCurrency($transaction->getCiUsed()); $paypal_id = $transaction->getPaypalId(); $paypal_id_object = Utility::decodeData($paypal_id); $paypal_reciver_id = isset($paypal_id_object[0]->receiver) ? $paypal_id_object[0]->receiver : ''; $current_date = date(DATE_RFC3339, strtotime($formated_date)); //change it according to application time zone $format_date_object = new \DateTime($current_date); $format_date = $format_date_object->format('Y-m-d'); $purchase_year = date('y', strtotime($format_date)); $purchase_month = date('m', strtotime($format_date)); $purchase_day = date('d', strtotime($format_date)); $counter_value = str_pad($counter, 2, "0", STR_PAD_LEFT); //add 0 in the beginning from 1-9 $numero_quietanza = $purchase_year . $purchase_month . $purchase_day . $counter_value; $description = $paypal_reciver_id; $purchase->setDate($date); $purchase->setNumeroQuietanza($numero_quietanza); $purchase->setTipoQuietanza($tipo_quantaza); $purchase->setCausale($causale); $purchase->setCode($code); $purchase->setDescription($description); $purchase->setAmount($amount); $purchase->setShopId($app_id); $purchase->setCitizenId($citizen_id); $purchase->setCreatedAt($time); $em->persist($purchase); //persist the data $counter++; } try { $em->flush(); $applane_service->writeAllLogs($handler, 'Data saved successfully', array()); //write log } catch (\Exception $ex) { $applane_service->writeAllLogs($handler, 'Exiting from class [ExportManagement\ExportManagementBundle\Services\PurchaseService] and function [importConnectTypePurchase] wiith error: '.$ex->getMessage(), array()); //write log } $applane_service->writeAllLogs($handler, 'Exiting from class [ExportManagement\ExportManagementBundle\Services\PurchaseService] and function [importConnectTypePurchase]', array()); //write log return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pc_register_product_type() {\n\t\trequire_once( pc_pcalculator_invoices_dir.'/Include/pc-product-type.php' );\t\n\t}", "function eurobanklib_activate()\n{\n\n defineGatewayField(\"eurobanklib\", \"text\", \"gatewaymerchantid\", \"\", \"MerchantId\", \"20\", \"\");\n defineGatewayField(\"eurobanklib\", \"text\", \"gatewaymerchantpassword\", \"\", \"Shared Secret\", \"20\", \"\");\n defineGatewayField(\"eurobanklib\", \"text\", \"gatewaycurrency\", \"\", \"Currency\", \"20\",\n \"ISO 4217 alphabetic code (EUR, USD)\");\n defineGatewayField(\"eurobanklib\", \"text\", \"gatewaylang\", \"\", \"Language\", \"20\", \"Type GR\");\n defineGatewayField(\"eurobanklib\", \"yesno\", \"testmode\", \"\", \"Test Mode\", \"\",\n \"Enable testing mode. CAUTION: DO NOT USE IN PRODUCTION!\");\n}", "public function purchase_page() {\n require_once(__DIR__ . '/includes/SPAY_alipay_SDK/index.php');\n }", "public function testCreateProductMerchant()\n {\n\n }", "function GetCoffeeTypes(){\n\t\t\trequire 'Credentials.php';\n\t\t}", "function instant_to_cryptox($mtgox_code, $amount) {\n$request = bitinstant_req('GetQuote', 'mtgoxcoupon', $amount, 'cryptoxchange', 'cryptox_account_number_goes_here');\n\n$quoteid = $request->QuoteID;\n\n$request = bitinstant_req('NewOrder', 'mtgoxcoupon', '', 'cryptoxchange', '', '', $quoteid, array(\"code\"=>\"$mtgox_code\", \"mtgoxusername\"=>\"mtgox_username_goes_here\"), '', '');\nreturn $request->OrderID;\n}", "public function testCreateMerchant()\n {\n\n }", "function openPaymentGateway($purchaseType_HD1,$productID_HD2,$userID_HD3){\n \n\n // findign user information\n $users_data = DB::table('users')\n ->select('name', 'email','phoneno')\n ->where('id', '=', $userID_HD3)\n ->first();\n if ($users_data == null) {\n echo \"Invalid User\";\n return;\n }\n // findign product information\n $product_data = null ;\n\n if ($purchaseType_HD1 == 'package') {\n $product_data = DB::table('package_tab')\n ->select('subcat_name as productinfo', 'package_price as amount')\n ->where('package_id', '=', $productID_HD2)\n ->first();\n }else if($purchaseType_HD1 == 'test'){\n $product_data = DB::table('test_info_tab')\n ->select('test_name as productinfo', 'test_price as amount')\n ->where('test_info_id', '=', $productID_HD2)\n ->first();\n }else{\n echo \"Somthing goes wrong\";\n return;\n }\n \n if ($product_data == null) {\n echo \"Invalid Product\";\n return;\n }\n\n $firstname = $users_data->name;\n $email = $users_data->email;\n $phoneno = $users_data->phoneno;\n $productinfo = $product_data->productinfo;\n $amount = $product_data->amount;\n\n $txnid = substr($purchaseType_HD1, 0,4).\"-\".$productID_HD2.\"-\".$userID_HD3.\"-\".time();\n\n\n // making entry in payment table \n DB::table('payment_tab')->insert([\n 'product_id' => $productID_HD2,\n 'user_id' => $userID_HD3,\n 'transaction_id' => $txnid,\n 'product_type' => $purchaseType_HD1,\n 'amount' => $amount,\n ]);\n\n\n // echo \"$purchaseType_HD1-$productID_HD2-$userID_HD3\";\n // echo \"_________________________\";\n // echo \"$email-$phoneno-$firstname\";\n // echo \"_________________________\";\n // echo \"$productinfo-$amount\";\n // echo \"_________________________\";\n // echo \"$txnid\";\n\n // return;\n \n\n\n\n\n $MERCHANT_KEY = env('MERCHANT_KEY', 'ds24jgkM');\n $SALT = env('SALT', 's5P8PrWezj');\n\n \n // $MERCHANT_KEY = \"QrJSX8h2\";\n // $SALT = \"J3G8tzrUnt\";\n // Merchant Key and Salt as provided by Payu.\n\n // $PAYU_BASE_URL = \"https://sandboxsecure.payu.in\"; // For Sandbox Mode\n $PAYU_BASE_URL = \"https://secure.payu.in\"; // For Production Mode\n\n\n\n\n\n //initilizing post aaray to sending request to the payment gateway\n\n $_POST['surl'] = url('/').\"/payment_success\";\n $_POST['furl'] = url('/').\"/payment_failed\";\n $_POST['key'] = env(\"MERCHANT_KEY\",$MERCHANT_KEY);\n $_POST['service_provider'] = env(\"PAYMENT_GATEWAY_PROVIDER\",\"payu\");\n\n\n $_POST['firstname'] = $firstname;\n $_POST['email'] = $email;\n $_POST['phone'] = $phoneno;\n \n $_POST['amount'] = $amount;\n $_POST['productinfo'] = $productinfo;\n $_POST['txnid'] = $txnid;\n \n\n\n\n\n\n\n\n\n\n\n\n\n \n\n $action = '';\n // $geting data form post and pusheing to posted named variable \n $posted = array();\n if(!empty($_POST)) {\n //print_r($_POST);\n foreach($_POST as $key => $value) { \n $posted[$key] = $value; \n \n }\n }\n\n $formError = 0;\n\n // if transaction id is empty \n if(empty($posted['txnid'])) {\n // Generate random transaction id\n $txnid = substr(hash('sha256', mt_rand() . microtime()), 0, 20);\n } else {\n $txnid = $posted['txnid'];\n }\n\n\n /* making hash */ \n $hash = '';\n // Hash Sequence\n $hashSequence = \"key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5|udf6|udf7|udf8|udf9|udf10\";\n if(empty($posted['hash']) && sizeof($posted) > 0) {\n if(\n empty($posted['key'])\n || empty($posted['txnid'])\n || empty($posted['amount'])\n || empty($posted['firstname'])\n || empty($posted['email'])\n || empty($posted['phone'])\n || empty($posted['productinfo'])\n || empty($posted['surl'])\n || empty($posted['furl'])\n || empty($posted['service_provider'])\n ) {\n $formError = 1;\n } else {\n //$posted['productinfo'] = json_encode(json_decode('[{\"name\":\"tutionfee\",\"description\":\"\",\"value\":\"500\",\"isRequired\":\"false\"},{\"name\":\"developmentfee\",\"description\":\"monthly tution fee\",\"value\":\"1500\",\"isRequired\":\"false\"}]'));\n\n\n // extracting hashed detailes form $hasvarseq and pushin into anothe array name $hasstring \n $hashVarsSeq = explode('|', $hashSequence);\n $hash_string = ''; \n foreach($hashVarsSeq as $hash_var) {\n $hash_string .= isset($posted[$hash_var]) ? $posted[$hash_var] : '';\n $hash_string .= '|';\n }\n\n $hash_string .= $SALT;\n\n\n $hash = strtolower(hash('sha512', $hash_string));\n $action = $PAYU_BASE_URL . '/_payment';\n }\n\n }\n\n\n\n\n /* ending making hash */\n\n if($formError == 1){\n echo \"Form Submitation Error\";\n }else{\n return view('payment.PayGo',[\n \"PAYU_BASE_URL\"=>$action,\n \"MERCHANT_KEY\"=>$MERCHANT_KEY,\n \"hash\"=>$hash,\n 'txnid'=>$txnid,\n 'firstname'=>$_POST['firstname'],\n 'amount'=>$_POST['amount'],\n 'email'=>$_POST['email'],\n 'phone'=>$_POST['phone'],\n 'productinfo'=>$_POST['productinfo'] ,\n 'surl'=>$_POST['surl'],\n 'furl'=>$_POST['furl']\n ]\n );\n }\n\n\n }", "function checkout () {\r\n\t\tif( version_compare(SHOPP_VERSION, '1.1.9', '<=')){\r\n\t\t\t$this->Order->Billing->cardtype = \"BillmateBank\";\r\n\t\t\t$this->Order->confirm = true;\r\n\t\t} else {\r\n\t\t\t$Order = ShoppOrder();\r\n\t\t\t$Order->Billing->cardtype = 'BillmateBank';\r\n\t\t\t$Order->confirm = true;\r\n\t\t}\r\n\t}", "public function __construct(){\n parent::__construct();\n $this->types = 'ZHpaywx';\n }", "function Mco_producpromoManager()\n {\n $this->gateway = Application::getDataGateway(\"mco_producpromo\");\n }", "protected function _getCheckout()\n {\n return Mage::getSingleton('ketai/type_checkout');\n }", "public function purchaseimport() {\n $handler = $this->container->get('monolog.logger.purchased_cards_log');\n $applane_service = $this->container->get('appalne_integration.callapplaneservice');\n $applane_service->writeAllLogs($handler, 'Entering into class [ExportManagement\\ExportManagementBundle\\Services\\PurchaseService] and function [purchaseimport]', array()); //write log\n // FIX: Need to fix the implementation for reduce the memory consumption\n set_time_limit(0);\n ini_set('memory_limit', '512M');\n //getting the entity manager object.\n $em = $this->container->get('doctrine')->getManager();\n\n //finding the transactions ids of transaction get done yesterday(manually)/ Today(recuuring)\n $transaction_ids = $this->getTransactionIds();\n $today = new \\DateTime('now');\n $today_date = $today->format('Y-m-d');\n\n// if (!count($transaction_ids)) {\n// $applane_service->writeAllLogs($handler, 'NO Transaction ids. ', array()); //write log\n// exit('NO_DATA');\n// }\n //get data to be imported\n $purchase_data = array();\n $res_data = array();\n $data['transaction_ids'] = $transaction_ids;\n //get transaction data\n $import_purchase_data = $applane_service->getpurchasetransactiondata($data); //get data from applane of previous day.\n $purchased = $this->toArray($import_purchase_data);\n\n $applane_service->writeAllLogs($handler, 'Data for import today: ' . $this->convertToJson($purchased), array()); //write log\n if ($import_purchase_data->code == 200) {\n $purchase_data = $import_purchase_data->response->result;\n }\n //check if we have some records for import\n if (count($purchase_data)) {\n //import the data.\n $result = $this->importPurchase($purchase_data);\n }\n $this->importConnectTypePurchase(); //import connect type transactions\n if (!empty($result)) {\n $applane_service->writeAllLogs($handler, 'DATA is imported on date: ' . $today_date, array()); //write log\n $data = array('code' => 101, 'message' => 'SUCCESS', 'data' => array());\n } else {\n $applane_service->writeAllLogs($handler, 'No data is for import on date: ' . $today_date, array()); //write log\n $data = array('code' => 100, 'message' => 'NO_DATA', 'data' => array());\n }\n echo json_encode($data);\n exit;\n }", "function buy() {\r\n\t\t$to_buy = array(\r\n\t\t\t'desc' => 'Purchase from ACME Store', \r\n\t\t\t'currency' => $this->currency, \r\n\t\t\t'type' => $this->ec_action, \r\n\t\t\t'return_URL' => site_url('event/test/back'), \r\n\t\t\t// see below have a function for this -- function back()\r\n\t\t\t// whatever you use, make sure the URL is live and can process\r\n\t\t\t// the next steps\r\n\t\t\t'cancel_URL' => site_url('event/test'), // this goes to this controllers index()\r\n\t\t\t'shipping_amount' => 5.00, \r\n\t\t\t'get_shipping' => true);\r\n\t\t// I am just iterating through $this->product from defined\r\n\t\t// above. In a live case, you could be iterating through\r\n\t\t// the content of your shopping cart.\r\n\t\tforeach($this->product as $p) {\r\n\t\t\t$temp_product = array(\r\n\t\t\t\t'name' => $p['name'], \r\n\t\t\t\t'desc' => $p['desc'], \r\n\t\t\t\t'number' => $p['code'], \r\n\t\t\t\t'quantity' => 1, // simple example -- fixed to 1\r\n\t\t\t\t'amount' => $p['price']);\r\n\t\t\t\t\r\n\t\t\t// add product to main $to_buy array\r\n\t\t\t$to_buy['products'][] = $temp_product;\r\n\t\t}\r\n \r\n $discount_product = array(\r\n\t\t\t\t'name' => 'coupon code', \r\n\t\t\t\t'desc' => 'description', \r\n\t\t\t\t'number' => '87965', \r\n\t\t\t\t'quantity' => 1, // simple example -- fixed to 1\r\n\t\t\t\t'amount' => 5);\r\n $to_buy['products'][] = $discount_product; \r\n\t\t// enquire Paypal API for token\r\n\t\t$set_ec_return = $this->paypal_ec->set_ec($to_buy);\r\n\t\tif (isset($set_ec_return['ec_status']) && ($set_ec_return['ec_status'] === true)) {\r\n\t\t\t// redirect to Paypal\r\n\t\t\t$this->paypal_ec->redirect_to_paypal($set_ec_return['TOKEN']);\r\n\t\t\t// You could detect your visitor's browser and redirect to Paypal's mobile checkout\r\n\t\t\t// if they are on a mobile device. Just add a true as the last parameter. It defaults\r\n\t\t\t// to false\r\n\t\t\t// $this->paypal_ec->redirect_to_paypal( $set_ec_return['TOKEN'], true);\r\n\t\t} else {\r\n\t\t\t$this->_error($set_ec_return);\r\n\t\t}\r\n\t}", "public function connectBigcommerce( Request $request ) {\n\n $merchantForIntegration = null;\n if (! $request->get('new-user') && Auth::user()) {\n $user = Auth::user();\n $merchant_id = intval($request->get('merchant_id'));\n if (! $merchant_id) {\n return abort(422, 'Lootly merchant ID is not valid.');\n }\n try {\n $merchant = $this->merchants->find($merchant_id);\n } catch (\\Exception $e) {\n\n }\n if (! isset($merchant) || ! $merchant ) {\n return abort(422, 'Lootly merchant ID is not valid.');\n }\n if ($user->roleOn($merchant) != 'owner' && ! $user->ownsTeam($merchant)) {\n return abort(403, 'You are not allowed to perform this action.');\n }\n $merchantForIntegration = $merchant;\n }\n\n session()->forget([\n 'redirect_queue'\n ]);\n\n // Create BigCommerce integration record\n return $this->createIntegration( $request->get('context'), $request->get('access_token'), $this->getStoreHash($request), $merchantForIntegration );\n }", "public function testCreateCouponMerchant()\n {\n\n }", "function brand_connection_types() {\n p2p_register_connection_type( array(\n 'name' => 'prod_2_brands',\n 'from' => 'prodotti',\n 'to' => 'brand',\n 'reciprocal' => true,\n 'admin_box' => array(\n 'show' => 'any',\n 'context' => 'advanced'\n )\n ) );\n}", "public function buy(){\n\n\n }", "public function functionconnect()\n {\n $action = $_GET['function'];\n switch ($action) {\n case 'addOrUpdateVendor':\n $this->addOrUpdateVendor();\n break;\n case 'removeVendor':\n $this->removeVendor();\n break;\n case 'retrieveVendor':\n $this->retrieveVendor();\n break;\n case 'retrieveEntityDeptAssoc':\n $this->retrieveEntityDeptAssoc();\n break;\n case 'saveEntityDeptAssoc':\n $this->saveEntityDeptAssoc();\n break;\n case 'retrieveEntityStatus':\n $this->retrieveEntityStatus();\n break;\n \n \n \n \n }\n }", "public function initializePurchase(CartInterface $quote);", "public function install()\r\n { \r\n if ((int)Configuration::get('payco') == 1 ) {\r\n $this->_errors[] = $this->l('El modulo ePayco actualmente ya esta instado');\r\n return false;\r\n }\r\n\r\n if (extension_loaded('curl') == false)\r\n {\r\n $this->_errors[] = $this->l('You have to enable the cURL extension on your server to install this module');\r\n return false;\r\n }\r\n\r\n Configuration::updateValue('P_TITULO', 'Checkout ePayco, (Tarjetas de crédito,debito,efectivo.)');\r\n Configuration::updateValue('P_CUST_ID_CLIENTE', '');\r\n Configuration::updateValue('P_KEY', '');\r\n Configuration::updateValue('PUBLIC_KEY', '');\r\n Configuration::updateValue('P_TEST_REQUEST', false);\r\n Configuration::updateValue('LENGUAJE', false);\r\n Configuration::updateValue('P_STATE_END_TRANSACTION', '');\r\n Configuration::updateValue('P_REDUCE_STOCK_PENDING', true); \r\n Configuration::updateValue('P_URL_RESPONSE', Context::getContext()->link->getModuleLink('payco', 'response'));\r\n Configuration::updateValue('P_URL_CONFIRMATION', Context::getContext()->link->getModuleLink('payco', 'confirmation'));\r\n //Set up our currencies and issuers\r\n CreditCard_OrderState::remove();\r\n CreditCard_OrderState::setup();\r\n //CreditCard_Issuer::setup();\r\n CreditCard_Order::setup();\r\n EpaycoOrder::remove();\r\n EpaycoOrder::setup();\r\n\r\n Configuration::updateValue('payco', true);\r\n return parent::install() &&\r\n $this->registerHook('header') &&\r\n $this->registerHook('displayBackOfficeHeader') &&\r\n $this->registerHook('payment') &&\r\n $this->registerHook('paymentReturn') &&\r\n $this->registerHook('paymentOptions');\r\n }", "function SAPConnection()\n {\n parent::SAP();\n }", "public function installCurrency()\n {\n $currency = new Currency();\n $currency_rand_id = $currency->getIdByIsoCode('ZAR');\n\n if (is_null($currency_rand_id)) {\n $currency->name = \"South African Rand\";\n $currency->iso_code = \"ZAR\";\n $currency->sign = \"R\";\n $currency->format = 1;\n $currency->blank = 1;\n $currency->decimals = 1;\n $currency->deleted = 0;\n // set it to an arbitrary value, also you can update currency rates to set correct value\n $currency->conversion_rate = 0.45;\n $currency->add();\n $currency->refreshCurrencies();\n }\n\n return true;\n }", "public function reasonForBuying();", "public function install() {\n\t\t// Ensure that the system has support for the JSON extension\n\t\tif (!function_exists(\"json_decode\")) {\n\t\t\t$this->Input->setErrors(array(\n\t\t\t\t'json' => array(\n\t\t\t\t\t'required' => Language::_(\"Stripe_plus_gateway.!error.json_required\", true)\n\t\t\t\t)\n\t\t\t));\n\t\t}\n\n\t\tif (!isset($this->Record))\n\t\t\tLoader::loadComponents($this, array(\"Record\"));\n\n\t\ttry {\n\t\t\t$this->Record->\n\t\t\t\tsetField(\"id\", array('type'=>\"int\", 'size'=>10, 'unsigned'=>true, 'auto_increment'=>true))->\n\t\t\t\tsetField(\"contact_id\", array('type'=>\"int\", 'size'=>10, 'unsigned'=>true))->\n\t\t\t\tsetField(\"stripe_id\", array('type'=>\"varchar\", 'size'=>24))->\n\t\t\t\tsetKey(array(\"id\"), \"primary\")->\n\t\t\t\tsetKey(array(\"contact_id\"), \"unique\")->\n\t\t\t\tsetKey(array(\"stripe_id\"), \"unique\")->\n\t\t\t\tcreate(\"stripe_plus_meta\", true);\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t$this->Input->setErrors(array('db'=> array('create'=>$e->getMessage())));\n\t\t\treturn;\n\t\t}\n\t}", "function __construct(){\n\n $this->PayFlowProClient = new buzz;\n\n }", "public function ProcPurchase() {\n\t\tglobal $SPFunctions;\n\t\t$gateway = $this->SWIFT4->Settings->getKey(\"settings\",\"sp_gateway\");\n\t\t$gwPath = null;\n\t\t\n\t\tswitch ($gateway) {\n\t\t\tcase SP_PROCESSOR_WORLDPAY:\n\t\t\t\t$gwPath = \"worldpay\";\n\t\t\t\tbreak;\n\t\t\tcase SP_PROCESSOR_PAYPAL:\n\t\t\t\t$gwPath = \"paypal\";\n\t\t\t\tbreak;\n\t\t\tcase SP_PROCESSOR_AUTHORIZE:\n\t\t\t\t$gwPath = \"authnet\";\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tif (!empty($gwPath)) {\n\t\t\t/* Create the semi-permanent cart record. */\n\t\t\t\n\t\t\tif (!empty($_SESSION[\"items\"])) {\n\t\t\t\t\n\t\t\t\t$_SESSION[\"cart_id\"] = $SPFunctions->encodeCartData(\n\t\t\t\t\t$this->SWIFT4->User->GetUserID(),$_SESSION[\"items\"],$gateway);\n\n\t\t\t\tinclude (SWIFT_MODULESDIRECTORY.\"/supportpay/client/\".$gwPath.\"/procpurchase.php\");\n\t\t\t} else {\n\t\t\t\tSWIFT::Error(\"SupportPay\",$this->SWIFT4->Language->Get('sp_noitemsselected'));\n\t\t\t\t$this->UserInterface->Header('sp_uw_master');\n\t\t\t\t$this->UserInterface->Footer();\n\t\t\t}\n\t\t} else {\n\t\t\tSWIFT::Error(\"SupportPay\",$this->SWIFT4->Language->Get('sp_unknown_payment_type'));\n\t\t\t$this->UserInterface->Header('sp_uw_master');\n\t\t\t$this->UserInterface->Footer();\n\t\t}\n\t}", "function install() {\n global $db;\n\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable this Payment Module', 'MODULE_PAYMENT_PAYPALWPP_STATUS', 'True', 'Do you want to enable this payment module?', '6', '25', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Direct Payment', 'MODULE_PAYMENT_PAYPALWPP_DIRECT_ENABLED', 'False', 'Would you like to enable credit card payments through PayPal DIRECTLY on your website? <br />(<strong>NOTE:</strong> You need to be subscribed to Website Payments Pro or Payflow Pro to use this feature.)', '6', '25', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Live or Sandbox', 'MODULE_PAYMENT_PAYPALWPP_SERVER', 'live', '<strong>Live: </strong> Used to process Live transactions<br><strong>Sandbox: </strong>For developers and testing', '6', '25', 'zen_cfg_select_option(array(\\'live\\', \\'sandbox\\'), ', now())\");\n\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Express Checkout: Require Confirmed Address', 'MODULE_PAYMENT_PAYPALWPP_CONFIRMED_ADDRESS', 'No', 'Do you want to require that your customers use a *confirmed* address when choosing their shipping address in PayPal?', '6', '25', 'zen_cfg_select_option(array(\\'Yes\\', \\'No\\'), ', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Express Checkout: Select Cheapest Shipping Automatically', 'MODULE_PAYMENT_PAYPALWPP_AUTOSELECT_CHEAPEST_SHIPPING', 'Yes', 'When customer returns from PayPal, do we want to automatically select the Cheapest shipping method and skip the shipping page? (making it more *express*)<br />Note: enabling this means the customer does *not* have easy access to select an alternate shipping method (without going back to the Checkout-Step-1 page)', '6', '25', 'zen_cfg_select_option(array(\\'Yes\\', \\'No\\'), ', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Express Checkout: Skip Payment Page', 'MODULE_PAYMENT_PAYPALWPP_SKIP_PAYMENT_PAGE', 'Yes', 'If the customer is checking out with Express Checkout, do you want to skip the checkout payment page, making things more *express*? <br /><strong>(NOTE: The Payment Page will auto-display regardless of this setting if you have Coupons or Gift Certificates enabled in your store.)</strong>', '6', '25', 'zen_cfg_select_option(array(\\'Yes\\', \\'No\\'), ', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Express Checkout: Automatic Account Creation', 'MODULE_PAYMENT_PAYPALWPP_NEW_ACCT_NOTIFY', 'Yes', 'If a visitor is not an existing customer, a Zen Cart account is created for them. Would you like make it a permanent account and send them an email containing their login information?<br />NOTE: Permanent accounts are auto-created if the customer purchases downloads or gift certificates, regardless of this setting.', '6', '25', 'zen_cfg_select_option(array(\\'Yes\\', \\'No\\'), ', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PAYPALWPP_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '25', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_PAYPALWPP_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '25', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_PAYPALWPP_ORDER_STATUS_ID', '2', 'Set the status of orders paid with this payment module to this value. <br /><strong>Recommended: Processing[2]</strong>', '6', '25', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Unpaid Order Status', 'MODULE_PAYMENT_PAYPALWPP_ORDER_PENDING_STATUS_ID', '1', 'Set the status of unpaid orders made with this payment module to this value. <br /><strong>Recommended: Pending[1]</strong>', '6', '25', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Refund Order Status', 'MODULE_PAYMENT_PAYPALWPP_REFUNDED_STATUS_ID', '1', 'Set the status of refunded orders to this value. <br /><strong>Recommended: Pending[1]</strong>', '6', '25', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PayPal Page Style', 'MODULE_PAYMENT_PAYPALWPP_PAGE_STYLE', 'Primary', 'The page-layout style you want customers to see when they visit the PayPal site. You can configure your <strong>Custom Page Styles</strong> in your PayPal Profile settings. This value is case-sensitive.', '6', '25', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Payment Action', 'MODULE_PAYMENT_PAYPALWPP_TRANSACTION_MODE', 'Final Sale', 'How do you want to obtain payment?<br /><strong>Default: Final Sale</strong>', '6', '25', 'zen_cfg_select_option(array(\\'Auth Only\\', \\'Final Sale\\'), ', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Currency', 'MODULE_PAYMENT_PAYPALWPP_CURRENCY', 'Selected Currency', 'Which currency should the order be sent to PayPal as? <br />NOTE: if an unsupported currency is sent to PayPal, it will be auto-converted to USD (or GBP if using UK account)<br /><strong>Default: Selected Currency</strong>', '6', '25', 'zen_cfg_select_option(array(\\'Selected Currency\\', \\'Only USD\\', \\'Only AUD\\', \\'Only CAD\\', \\'Only EUR\\', \\'Only GBP\\', \\'Only CHF\\', \\'Only CZK\\', \\'Only DKK\\', \\'Only HKD\\', \\'Only HUF\\', \\'Only JPY\\', \\'Only NOK\\', \\'Only NZD\\', \\'Only PLN\\', \\'Only SEK\\', \\'Only SGD\\', \\'Only THB\\'), ', now())\");\n\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('API Signature -- Username', 'MODULE_PAYMENT_PAYPALWPP_APIUSERNAME', '', 'The API Username from your PayPal API Signature settings under *API Access*. This value typically looks like an email address and is case-sensitive.', '6', '25', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, set_function, use_function) values ('API Signature -- Password', 'MODULE_PAYMENT_PAYPALWPP_APIPASSWORD', '', 'The API Password from your PayPal API Signature settings under *API Access*. This value is a 16-character code and is case-sensitive.', '6', '25', now(), 'zen_cfg_password_input(', 'zen_cfg_password_display')\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('API Signature -- Signature Code', 'MODULE_PAYMENT_PAYPALWPP_APISIGNATURE', '', 'The API Signature from your PayPal API Signature settings under *API Access*. This value is a 56-character code, and is case-sensitive.', '6', '25', now())\");\n\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PAYFLOW: User', 'MODULE_PAYMENT_PAYPALWPP_PFUSER', '', 'If you set up one or more additional users on the account, this value is the ID of the user authorized to process transactions. Otherwise it should be the same value as VENDOR. This value is case-sensitive.', '6', '25', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PAYFLOW: Partner', 'MODULE_PAYMENT_PAYPALWPP_PFPARTNER', 'ZenCart', 'Your Payflow Partner linked to your Payflow account. This value is case-sensitive.<br />Typical values: <strong>PayPal</strong> or <strong>ZenCart</strong>', '6', '25', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PAYFLOW: Vendor', 'MODULE_PAYMENT_PAYPALWPP_PFVENDOR', '', 'Your merchant login ID that you created when you registered for the Payflow Pro account. This value is case-sensitive.', '6', '25', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, set_function, use_function) values ('PAYFLOW: Password', 'MODULE_PAYMENT_PAYPALWPP_PFPASSWORD', '', 'The 6- to 32-character password that you defined while registering for the account. This value is case-sensitive.', '6', '25', now(), 'zen_cfg_password_input(', 'zen_cfg_password_display')\");\n\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('PayPal Mode', 'MODULE_PAYMENT_PAYPALWPP_MODULE_MODE', 'PayPal', 'Which PayPal API system should be used for processing? <br /><u>Choices:</u><br /><font color=green>For choice #1, you need to supply <strong>API Settings</strong> above.</font><br /><strong>1. PayPal</strong> = Express Checkout with a regular PayPal account<br />or<br /><font color=green>for choices 2 &amp; 3 you need to supply <strong>PAYFLOW settings</strong>, below (and have a Payflow account)</font><br /><strong>2. Payflow-UK</strong> = Website Payments Pro UK Payflow Edition<br /><strong>3. Payflow-US</strong> = Payflow Pro Gateway only<!--<br /><strong>4. PayflowUS+EC</strong> = Payflow Pro with Express Checkout-->', '6', '25', 'zen_cfg_select_option(array(\\'PayPal\\', \\'Payflow-UK\\', \\'Payflow-US\\'), ', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Debug Mode', 'MODULE_PAYMENT_PAYPALWPP_DEBUGGING', 'Off', 'Would you like to enable debug mode? A complete detailed log of failed transactions will be emailed to the store owner.', '6', '25', 'zen_cfg_select_option(array(\\'Off\\', \\'Alerts Only\\', \\'Log File\\', \\'Log and Email\\'), ', now())\");\n\n $this->notify('NOTIFY_PAYMENT_PAYPALWPP_INSTALLED');\n }", "function wauc_add_auction_product( $types ){\n // Key should be exactly the same as in the class\n $types[ 'auction' ] = __( 'Auction Product' );\n return $types;\n }", "public function wallet();" ]
[ "0.567134", "0.5670012", "0.5506446", "0.54222435", "0.5418156", "0.53244704", "0.5257729", "0.5254111", "0.5247267", "0.5223476", "0.5205186", "0.5202104", "0.51074874", "0.50970703", "0.509174", "0.5087352", "0.50730675", "0.5043884", "0.5042534", "0.501703", "0.50130546", "0.49802294", "0.49711806", "0.49711332", "0.4965646", "0.49622697", "0.49578536", "0.4948829", "0.49470735", "0.4938628" ]
0.7002051
0
return the counter of the purchase
public function findCounter() { $em = $this->em; $counter = $em->getRepository('ExportManagementBundle:Purchase')->getPurchaseCounter(); return $counter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCounter() { return $this->data['counter']; }", "protected function counter()\n {\n return $this->counter++;\n }", "function count()\n {\n return $this->cart->instance(\\Auth::id())->count();\n }", "public function getCounter(): int;", "public function getCounter()\n {\n return $this->counter;\n }", "public function getCounter()\n {\n return $this->counter;\n }", "public function incrementCount() {\n $this->set('count', $this->getCount()+1);\n $this->save();\n return $this->get('count')->value;\n }", "public function getCounter() {\r\n\treturn $this->counter;\r\n }", "function getCounter()\n {\n // in order to get back the actual value of the counter\n return $this->getVariable('counter');\n }", "public function count(){\n\t\t\t\t$count = 0;\n\n\t\t\t\tforeach ($this->items as $item) {\n\t\t\t\t\t$count += $item['qty'];\n\t\t\t\t}\n\n\t\t\t\treturn $count;\n\t\t\t}", "function calculateIssuedCounter($open_stock_store,$new_stock,$closing_balance_store){\n\t$issued_counter = ($open_stock_store+$new_stock)-$closing_balance_store;\n\treturn $issued_counter;\n}", "public function getCounter()\n\t{\n\t\treturn $this->counter;\n\t}", "private function zz_quantity( )\n {\n $quantity = 0;\n\n foreach( ( array ) $this->products as $product )\n {\n $quantity = $quantity\n + $product['qty']\n ;\n }\n\n return $quantity;\n }", "public function getPurchasedCourseCount(){\n $sql = \"SELECT * FROM transaction WHERE user = $this->user\";\n if(!empty($this->user)){\n $result = $this->dbObj->query($sql);\n $totalData = mysqli_num_rows($result);\n if($result !== false){ $json = array(\"status\" => 1, \"count\" => $totalData); }\n else{ $json = array(\"status\" => 2, \"msg\" => \"Error fetching book count! \". mysqli_error($this->dbObj->connection)); }\n }\n else{ $json = array(\"status\" => 3, \"msg\" => \"Request method not accepted.\"); }\n $this->dbObj->close();\n header('Content-type: application/json');\n return json_encode($json);\n }", "public function getUserTotalPurchases(): int\n {\n if (auth()->guest()) {\n return 0;\n }\n\n static $purchases = null;\n\n if ($purchases === null) {\n $purchases = ShopUser::ofUser(auth()->user())\n ->items()\n ->where('shop_payments.status', 'completed')\n ->where('shop_payment_items.buyable_type', 'shop.packages')\n ->get()\n ->countBy('buyable_id');\n }\n\n return $purchases->get($this->id, 0);\n }", "public function getTransactionCounter()\n {\n return $this->transactionCounter;\n }", "public function getCount(){\r\n return $this->_count;\r\n }", "public function getNumber()\n {\n return $this->count;\n }", "public function count()\n {\n return ++$this->count;\n }", "public function count()\n {\n return ++$this->count;\n }", "public function count()\n {\n return ++$this->count;\n }", "public function getCustomerCount();", "public function getQuantity(): int\n {\n return $this->quantity;\n }", "public static function counterVenues()\n {\n include ($_SERVER[\"DOCUMENT_ROOT\"] . \"/venue/venue-finder/config/db_config.php\");\n $query = \"SELECT COUNT(*) FROM venue\";\n $result = mysqli_query($mysqli,$query);\n $rows = mysqli_fetch_row($result);\n\n // Debug increase value.\n $rows[0] = $rows[0] * 1;\n\n // Simplify the number if over 1000.\n if ($rows[0] > 1000) {\n // If over 1000.\n $rows[0] = number_format((float)$rows[0] / 1000, 2, '.', '') . \"K\";\n }\n\n return $rows[0];\n }", "public function CoinCount() : int\n {\n return count($this->coin);\n }", "public function getProductCount();", "public function actionCount()\n {\n $session = Yii::$app->session;\n $count = $session->get(\"counter\");\n $count = $count ? $count + 1 : 1;\n $session->set( \"counter\", $count );\n return $count;\n }", "abstract public function get_Count();", "public function count() {\n return $this->total;\n }", "function getCount() {\n\t\treturn $this->count;\n\t}" ]
[ "0.67412853", "0.66136146", "0.6575699", "0.65627533", "0.64585125", "0.64585125", "0.6449718", "0.64445007", "0.64270097", "0.63784295", "0.63651824", "0.63509077", "0.63085324", "0.63006437", "0.6295671", "0.6294617", "0.6278668", "0.62774444", "0.62719953", "0.62719953", "0.62719953", "0.62471825", "0.62418175", "0.62406546", "0.6235449", "0.6227751", "0.6215546", "0.62106633", "0.6202413", "0.6190649" ]
0.77493405
0
Get the value of lineItemId
public function getLineItemId() { return $this->lineItemId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLineItemId()\n {\n return $this->getParameter('lineItemId');\n }", "public function getLineItemKey()\n {\n return $this->lineItemKey;\n }", "public function getItemId()\n {\n return $this->getProperty(\"ItemId\");\n }", "public function getItemId(): string\n {\n return $this->itemId;\n }", "public function getItemId()\n {\n return $this->itemId;\n }", "public function getWebOrderLineItemId() {\n return $this->webOrderLineItemId;\n }", "public final function getItemId() { return $this->itemId; }", "public function getItemId()\n {\n return $this->item_id;\n }", "public function getItemId()\n {\n return $this->item_id;\n }", "public function getItemId()\n {\n return $this->item_id;\n }", "public function getItemId()\n {\n return $this->item_id;\n }", "public function getItemId()\n {\n return $this->get('itemId') ?: 0;\n }", "public function getOrderItemId()\n {\n return $this->_fields['OrderItemId']['FieldValue'];\n }", "public function getOrderLineItemID()\n {\n return $this->orderLineItemID;\n }", "public function getOrderLineItemID()\n {\n return $this->orderLineItemID;\n }", "public function getItemId()\n {\n return $this->getItem()->getData('product_id');\n }", "public function getInvoiceItemId()\n {\n return $this->invoiceItemId;\n }", "public function getItemId();", "public function setLineItemId($value)\n {\n return $this->setParameter('lineItemId', $value);\n }", "public function getItemId()\n {\n $value = $this->get(self::ITEM_ID);\n return $value === null ? (integer)$value : $value;\n }", "public function getLineItem() {\n return $this->lineItem;\n }", "protected function getItemId()\n\t{\n\t\treturn (int) $this->form->getValue('extension_id');\n\t}", "public function getItemId(): ?string\n {\n if (count($this->itemId) == 0) {\n return null;\n }\n return $this->itemId['value'];\n }", "public function getId() {\n\t\treturn $this->get('item_id');\n\t}", "private function getLineItem(int $cartItemId): array\n {\n $boldCheckoutData = $this->checkoutSession->getBoldCheckoutData();\n $lineItems = $boldCheckoutData['data']['application_state']['line_items'] ?? [];\n foreach ($lineItems as $lineItem) {\n $lineItemKey = $lineItem['product_data']['line_item_key'] ?? null;\n if ((string)$cartItemId === $lineItemKey) {\n return $lineItem;\n }\n }\n throw new LocalizedException(__('There is no line item with key: %1', $cartItemId));\n }", "public function get_id() {\n\t\treturn AMVE_Item::get_id( $this->item );\n\t}", "public function getProductItemId()\n {\n return $this->product_item_id;\n }", "public function get_item_id() {\n\t\treturn $this->item_id;\n\t}", "public function getCreatedItemId(): ?string;", "public function getItemID()\n {\n return $this->itemID;\n }" ]
[ "0.86350125", "0.75034577", "0.72737694", "0.72187024", "0.71004", "0.70985925", "0.7095959", "0.70131356", "0.70131356", "0.70131356", "0.70131356", "0.698529", "0.6896669", "0.68857914", "0.68857914", "0.683937", "0.6797739", "0.6774847", "0.6759036", "0.6626214", "0.6587488", "0.65360713", "0.64700973", "0.63636535", "0.6351607", "0.63135785", "0.6286697", "0.6281341", "0.62594295", "0.62373215" ]
0.86486804
1
Get the value of itemDescription
public function getItemDescription() { return $this->itemDescription; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parse_store_description() { return $this->item['item_description']; }", "function parse_single_description($inv_item=array()) { return $this->item['item_description']; }", "public function getFeedItemDescription()\n {\n return $this->getSummary();\n }", "function getDescription() {\n\t\treturn $this->data_array['description'];\n\t}", "public function getDescription() \n {\n return $this->_fields['Description']['FieldValue'];\n }", "public function getDescription () {\n\t$preValue = $this->preGetValue(\"description\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"description\")->preGetData($this);\n\treturn $data;\n}", "public function getDescription()\n {\n return $this->getValue('description');\n }", "public function getDescription()\n {\n return $this->getRawValue('description');\n }", "function getDesc()\n\t{\n\t\treturn $this->description;\n\t}", "public function getDescription() {\r\n\t\treturn $this->getProperty(\"description\");\r\n\t}", "function getDesc()\r\n {\r\n return $this->description;\r\n }", "public function getDescription()\n {\n return $this->getProperty(\"Description\");\n }", "public function getDescription()\n {\n return $this->getProperty(\"Description\");\n }", "function getDesc()\n {\n return $this->description;\n }", "function getDescription() {\n\t\treturn $this->m_description;\n\t}", "public function getDescription()\n {\n $value = $this->get(self::description);\n return $value === null ? (string)$value : $value;\n }", "public function getDescription() {\n \t$val = $this->cacheGetPlain('description');\n \tif (is_null($val))\n \t\treturn $this->cacheSetPlain('description', $this->getOffering()->getDescription());\n \telse\n \t\treturn $val;\n\t}", "public function ListItem_Text() {\n\treturn $this->NameLong();\n }", "public function getItemTitle()\n {\n return $this->itemTitle;\n }", "public function getDescription() {\n return $this->_Description;\n }", "public function getProductDescription(): string {\n\t\treturn ($this->productDescription);\n\t}", "public function getDescription()\n {\n return $this->get(self::DESCRIPTION);\n }", "public function getDescription()\r\n {\r\n return $this->_description;\r\n }", "public function getDescription(){\r\n\t\treturn $this->description;\r\n\t}", "public function getDescr()\n {\n return $this->descr;\n }", "public function getItem()\n {\n return $this->get(self::ITEM);\n }", "public function getDescription(){\n return $this->customDescription;\n }", "public function getDescription()\n {\n return (string)$this->description;\n }", "public function getDescription()\n\t{\n\t\treturn $this->description;\t\n\t}", "public function getDescription() {\n return isset($this->attributes['description']) ? $this->attributes['description'] : '';\n }" ]
[ "0.73933923", "0.7209138", "0.70897526", "0.7050031", "0.70362306", "0.6918163", "0.68568623", "0.6829113", "0.68250614", "0.68004864", "0.6786728", "0.67430687", "0.67430687", "0.6737837", "0.6718224", "0.6677661", "0.66389173", "0.6629522", "0.66290045", "0.66243047", "0.6591381", "0.65713", "0.6545476", "0.65367043", "0.6536307", "0.65360546", "0.6535958", "0.65307665", "0.6527703", "0.65242153" ]
0.81567574
0
Get the value of memberDiscount
public function getMemberDiscount() { return $this->memberDiscount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDiscountAmount();", "public function getDiscountableValue();", "public function getDiscountValue()\n {\n return $this->discountValue;\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 }", "public function getDiscounted();", "public function getDiscounted();", "public function getDiscount(): int;", "public function getPromotionDiscount()\n {\n return $this->_fields['PromotionDiscount']['FieldValue'];\n }", "public function getDiscountPercent();", "public function getTotalDiscount()\n {\n return $this->totalDiscount;\n }", "public function discount()\n {\n return number($this->deals->sum('discount'));\n }", "public function getUserDiscount() {\n $auth = Auth::getInstance();\n if ( $auth->hasIdentity() ) {\n $email = $auth->getStorage()->identity;\n $dis = $this->db()->query()\n ->addSql('select usr_discount as discount')\n ->addSql('from users_tbl')\n ->addSql('where usr_email=$1')\n ->addParam($email)\n ->fetchRow(0, false);\n $discount = abs(1 - $dis['discount']/100);\n\n return $discount;\n }\n\n\n return 1;\n }", "public function getShippingDiscountAmount();", "public function getCODFeeDiscount()\n {\n return $this->_fields['CODFeeDiscount']['FieldValue'];\n }", "public function getDiscountAttribute() {\n $presetDiscount = HrEmployeePresetsDiscount::where('hr_employee_id', $this->id)->where('flag_delete', false)->first();\n if ( !$presetDiscount ) {\n return 0;\n }\n return floatval($presetDiscount['discount_percentage']);\n }", "public function getDiscountAttribute()\n {\n return $this->discount()->get();\n }", "public function getDiscount(): ?float\n {\n return $this->discount;\n }", "public function getDiscount(): ?float\n {\n return $this->discount;\n }", "public function getDiscountPriceInfo()\n {\n return $this->discountPriceInfo;\n }", "public function getAmount()\n\t{\n\t\tswitch($this->type){\n\t\t\tcase 1: return floatval($this->discount).'%';\n\t\t\tcase 0:\n\t\t\tdefault: return $this->app->zoocart->currency->format($this->discount);\n\t\t}\n\t}", "public function getShippingDiscount()\n {\n return $this->_fields['ShippingDiscount']['FieldValue'];\n }", "public function getDiscount()\n {\n return $this->discount instanceof ProductDiscountReferenceBuilder ? $this->discount->build() : $this->discount;\n }", "private function getCartValueDiscount($promo){\n\t}", "public function contractorsDiscount()\n {\n return $this->discount()->forContractors();\n }", "public function getItemDiscountTotal()\n {\n return $this->itemDiscountTotal;\n }", "public function getFormattedDiscountAttribute(): string\n {\n return $this->formattedDiscount();\n }", "public function getBaseShippingDiscountAmount();", "public static function selfDiscount() {\n $connection = Yii::app()->db;\n $command = $connection->createCommand(\"SELECT SUM(discount_amount) FROM `payments`\");\n $amount = $command->queryScalar();\n return !empty($amount) ? AppHelper::getFloat($amount) : 0.00;\n }" ]
[ "0.8060281", "0.8007003", "0.7872186", "0.7814299", "0.7814299", "0.7814299", "0.77056164", "0.77056164", "0.76878476", "0.739107", "0.73793966", "0.7355226", "0.7297192", "0.72520584", "0.7217607", "0.7193575", "0.7177393", "0.7127699", "0.7084372", "0.7084372", "0.7039717", "0.69900626", "0.6985479", "0.6948144", "0.69056904", "0.6903874", "0.6889795", "0.688404", "0.68540865", "0.68087924" ]
0.8609852
0
Get the carauction that owns this reserve.
public function carauction() { return $this->BelongsTo('App\Carauction'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function carauctionbid()\n\t{\n\t\treturn $this->BelongsTo('App\\Carauctionbid');\n\t}", "public function carauctionpurchase()\n {\n return $this->hasOne('App\\Carauctionpurchase');\n }", "public function getReservasOwner() {\r\n $q = \"SELECT r.id FROM reserve r, car c WHERE c.id=r.car_id and c.user_id=\" . $this->getId();\r\n $query = Doctrine_Query::create()->query($q);\r\n $reserve = $query->toArray();\r\n $reservasRecibidas = null;\r\n\r\n foreach ($reserve as $i => $reserva) {\r\n $reserva = Doctrine_Core::getTable('reserve')->findOneById($reserva['id']);\r\n\r\n if ($reserva->getVisibleOwner()) {\r\n $reservasRecibidas[$i] = $reserva;\r\n }\r\n }\r\n\r\n return $reservasRecibidas;\r\n }", "public function getReserveID()\n {\n return $this->ReserveID;\n }", "public function getReservePrice()\n {\n return $this->reservePrice;\n }", "public function getReservation()\n {\n return $this->reservation;\n }", "public function getVehicle()\n {\n return $this->bike;\n }", "public function getHotelReservation()\n {\n return $this->hotelReservation;\n }", "abstract function getOwned();", "public function getBidCost() {\n return $this->bid ? $this->bid->bid : null;\n }", "function getBid(){\n\t\tif($this->bid==\"\") {\n\t\t\t$this->obtainBid();\n\t\t}\n\t\treturn $this->bid;\n\t}", "public function getBeneficieCice() {\n return $this->beneficieCice;\n }", "public function getBorrower()\n {\n return $this->_borrower;\n }", "public function getBid()\n {\n return $this->bid;\n }", "public function getReservering()\n {\n return $this->hasOne(Reservering::className(), ['id' => 'reservering_id']);\n }", "public function getBought() {\n return $this->bought;\n }", "public function getBuyer() {\n\t\treturn $this->buyer;\n\t}", "public function getVehicle(): Vehicle\n {\n return $this->car;\n }", "public function getAccommodation() {\n return $this->findParentRow('My_Model_Table_Accommodation');\n }", "public function getCar()\n {\n return $this->car;\n }", "public function getAuctionApi()\r\n {\r\n if (!$this->apis->has('auction')) {\r\n $this->apis->set('auction', new Auction($this));\r\n }\r\n\r\n return $this->apis->get('auction');\r\n }", "public function getBuyerCustomerParty()\n {\n return $this->buyerCustomerParty;\n }", "public function getCarving()\n {\n return $this->carving;\n }", "public function getOwnerPrice()\n {\n return $this->_getTotalPriceElement(substr(__FUNCTION__, 3));\n }", "public function getVehicle()\n {\n return $this->vehicle;\n }", "public function getBrood() {\n\t\treturn $this->getMinistryObjectives();\n\t}", "public function getSuperCarbu() {\n return $this->superCarbu;\n }", "protected function getContractAttribute()\n {\n return $this->nomination->latest_contract;\n }", "public function getOwnerParty()\n {\n return $this->ownerParty;\n }", "private function _getMinimumPriceForBidding()\r\n {\r\n $results = TransactionTable::getInstance()->getBiddingsForAuction($this->Auction);\r\n \r\n if (count($results) === 0 )\r\n return $this->price;\r\n\r\n $itemsLeft = (int) TransactionTable::getInstance()->getNumberOfItemsLeftForAuctionAndTransactionTypeName($this->Auction);\r\n $itemsCount = 0;\r\n\r\n foreach ($results as $result)\r\n {\r\n if (($itemsCount += $result->number_of_items) === $itemsLeft)\r\n return $result->price;\r\n }\r\n \r\n return $this->price;\r\n }" ]
[ "0.62831026", "0.5926016", "0.5911341", "0.5894947", "0.589423", "0.58587724", "0.58462757", "0.5551673", "0.55515337", "0.55478215", "0.55439085", "0.5542139", "0.5419718", "0.541149", "0.53924984", "0.5351521", "0.5313878", "0.53036165", "0.52824444", "0.5271243", "0.5263914", "0.5260771", "0.525085", "0.524503", "0.52393264", "0.5222944", "0.52138036", "0.5196318", "0.5176327", "0.5169526" ]
0.65895766
0
Resets the _entity and _relationship_entities properties.
public function resetEntityData() { $this->_entity = NULL; $this->_relationship_entities = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reset()\n {\n $this->values[self::ENTITY] = null;\n $this->values[self::INVITATION_STATUS] = null;\n }", "public function reInitializeEntitys()\n {\n foreach ($this->entity_references_by_guid as $entity) {\n $entity->reInitialize();\n }\n }", "public function reset()\n {\n $this->values[self::ENTITYID] = null;\n $this->values[self::CREATIONTIMESTAMP] = null;\n $this->values[self::CONTENT] = null;\n }", "public function initialize(): void\n {\n $this->resetEntityManagers();\n }", "public function reset()\n {\n $this->values[self::PRIMARY_KEY_COLUMNS] = array();\n $this->values[self::ATTRIBUTE_COLUMNS] = array();\n }", "public function detachAll()\n {\n $this->entitiesChanged = [];\n $this->entitiesShouldBePersisted = [];\n $this->entities = [];\n }", "public function reset()\n {\n $this->values[self::RESPONSE_HEADER] = null;\n $this->values[self::ENTITY] = array();\n }", "protected function reset()\n {\n $this->collectionLoaded = false;\n $this->uowAttach = array();\n $this->uowDetach = array();\n $this->collection = array();\n \n }", "public function reset()\n {\n unset($this->entity);\n unset($this->entities);\n $this->started = false;\n $this->index = -1;\n $this->total_record = 0;\n $this->entity = null;\n $this->entities = [];\n $this->page = 0;\n $this->total_page = 0;\n\n return $this;\n }", "public function reset()\n {\n $this->isNew = true;\n $this->nodesMap = array();\n $this->relationshipsMap = array();\n $this->nodesByLabel = array();\n $this->result = new Result();\n }", "final public function setEntity($entity) {\n $this->entity = $entity;\n }", "public function reset() {\n\t\t$associations = elgg_get_entities(array(\n\t\t\t'type' => 'object',\n\t\t\t'subtype' => 'openid_client::association',\n\t\t\t'limit' => 0,\n\t\t));\n\t\tforeach ($associations as $association) {\n\t\t\t$association->delete();\n\t\t}\n\n\t\t$nonces = elgg_get_entities(array(\n\t\t\t'type' => 'object',\n\t\t\t'subtype' => 'openid_client::nonce',\n\t\t\t'limit' => 0,\n\t\t));\n\n\t\tforeach ($nonces as $nonce) {\n\t\t\t$nonce->delete();\n\t\t}\n\t}", "public function reset()\n {\n $this->values[self::PERSONS] = array();\n }", "public function flush(): void\n {\n $this->impersonate = null;\n $this->status = null;\n $this->user = null;\n }", "private function reset()\n {\n foreach ($this->properties as $prop) {\n $this->$prop = [];\n }\n }", "public function setOff($entity) \n {\n $entity->setOff(true);\n $this->manager->flush();\n }", "public function reset()\r\n {\r\n $this->values[self::_CHECKID] = null;\r\n $this->values[self::_USERID] = null;\r\n $this->values[self::_OPPO_USERID] = null;\r\n $this->values[self::_SELF_HEROES] = array();\r\n $this->values[self::_OPPO_HEROES] = array();\r\n $this->values[self::_SELF_OPERATION] = array();\r\n $this->values[self::_OPPO_OPERATION] = array();\r\n $this->values[self::_RESULT] = null;\r\n $this->values[self::_RSEED] = null;\r\n }", "public function reset()\n {\n $this->values[self::PRODUCT] = null;\n $this->values[self::ORIGINALVALUES] = null;\n $this->values[self::CORRECTEDVALUES] = null;\n $this->values[self::AMOUNTSINC] = null;\n $this->values[self::AMOUNTSDEC] = null;\n $this->values[self::ITEMACCOUNTDEBIT] = null;\n $this->values[self::ITEMACCOUNTCREDIT] = null;\n $this->values[self::ADDITIONALINFO] = array();\n }", "protected function reset()\n {\n $this->acl = null;\n $this->loaded = false;\n }", "public function reset()\n {\n $this->values[self::PHONE_NUMBER] = null;\n $this->values[self::GOOGLE_VOICE] = null;\n $this->values[self::VERIFICATION_STATUS] = null;\n $this->values[self::DISCOVERABLE] = null;\n $this->values[self::DISCOVERABILITY_STATUS] = null;\n $this->values[self::PRIMARY] = null;\n }", "public function reset()\n {\n $this->category = null;\n $this->manufacturer = null;\n $this->priceRange = null;\n $this->whiteList = null;\n $this->blackList = null;\n $this->fulltext = null;\n $this->offset = self::DEFAULT_OFFSET;\n }", "public function reset()\n {\n $this->values[self::DOCUMENTCREATOR] = null;\n $this->values[self::DOCUMENTCREATORBASE] = null;\n $this->values[self::OPERATIONCODE] = null;\n $this->values[self::OPERATIONCONTENT] = null;\n $this->values[self::ACCEPTANCEDATE] = null;\n $this->values[self::EMPLOYEE] = null;\n $this->values[self::OTHERISSUER] = null;\n $this->values[self::ADDITIONALINFOID] = null;\n $this->values[self::SIGNERS] = array();\n }", "public function reset()\n {\n $this->values[self::ROOMID] = null;\n $this->values[self::S] = null;\n $this->values[self::T] = null;\n $this->values[self::N] = null;\n $this->values[self::TRANSIENT] = null;\n $this->values[self::ROOMPEERIDS] = array();\n $this->values[self::BYPEERID] = null;\n }", "public function reset()\n {\n $this->values[self::CONSUMED] = null;\n $this->values[self::ROW] = null;\n }", "public function reset()\n {\n $this->values[self::INITIATIVE] = null;\n $this->values[self::TYPE] = null;\n $this->values[self::DATA] = null;\n }", "public function clear()\n {\n $query = clone $this->query;\n $query->clear($this->relation->entity())\n ->execute();\n }", "public function reset()\r\n\t\t{\r\n\t\t\t$this->resetId();\r\n\t\t\t$this->objValidate \t= NULL;\r\n\t\t}", "public function reset()\n {\n $this->values[self::CONVERSATION_ID] = null;\n $this->values[self::LEVEL] = null;\n $this->values[self::TIMESTAMP] = null;\n }", "public function clear(Entity $entity = null): void;", "public function reset() {\n $this->values[self::RESOURCE_ID] = null;\n }" ]
[ "0.6927768", "0.6765924", "0.6695344", "0.61765695", "0.60547423", "0.60493046", "0.6038332", "0.6005375", "0.5980165", "0.5958758", "0.59570414", "0.5942759", "0.59268814", "0.5910993", "0.58693045", "0.58279604", "0.58202004", "0.58085585", "0.57957834", "0.5790515", "0.57825935", "0.57814527", "0.5773932", "0.574911", "0.5748318", "0.57414025", "0.57373226", "0.57239914", "0.57161343", "0.57102597" ]
0.8735898
0
HttpClient. Automatically load Guzzle when available
public function getHttpClient() { // @codeCoverageIgnoreStart if (!$this->httpClient) { if (interface_exists(GuzzleClientInterface::class) && ((defined(GuzzleClientInterface::class.'::VERSION') && Util::compareGuzzleVersion( constant(GuzzleClientInterface::class.'::VERSION'), '6.0.0' ) >= 0) || (defined(GuzzleClientInterface::class.'::MAJOR_VERSION') && Util::compareGuzzleVersion( constant(GuzzleClientInterface::class.'::MAJOR_VERSION'), '7.0.0' ) >= 0)) ) { $this->httpClient = new GuzzleClient(); } if (!$this->httpClient && class_exists(HttpAsyncClientDiscovery::class)) { try { // Detect PHP HTTPlug async HTTP client support if (HttpAsyncClientDiscovery::find()) { $this->httpClient = new HTTPlugClient(); } } catch (\Http\Discovery\Exception\NotFoundException $e) { } catch (NoCandidateFoundException $e) { } catch (DiscoveryFailedException $e) { } catch (ClassInstantiationFailedException $e) { } } if (!$this->httpClient && class_exists(Psr18ClientDiscovery::class)) { try { // Detect PHP HTTPlug PSR-18 HTTP client support if (Psr18ClientDiscovery::find()) { $this->httpClient = new HTTPlugClient(); } } catch (\Http\Discovery\Exception\NotFoundException $e) { } catch (NoCandidateFoundException $e) { } catch (DiscoveryFailedException $e) { } catch (ClassInstantiationFailedException $e) { } } if (!$this->httpClient && class_exists(HttpClientDiscovery::class)) { try { // Detect PHP HTTPlug HTTP client support if (HttpClientDiscovery::find()) { $this->httpClient = new HTTPlugClient(); } } catch (\Http\Discovery\Exception\NotFoundException $e) { } catch (NoCandidateFoundException $e) { } catch (DiscoveryFailedException $e) { } catch (ClassInstantiationFailedException $e) { } } if (!$this->httpClient) { $this->httpClient = new CurlClient(); } $this->httpClient->setLogger($this->getLogger()); $this->httpClient->setVerify($this->verifySslCerts); } // @codeCoverageIgnoreEnd $this->httpClient->setRequestFactory($this->getRequestFactory()); $this->httpClient->setResponseFactory($this->getResponseFactory()); $this->httpClient->setStreamFactory($this->getStreamFactory()); return $this->httpClient; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getGuzzle() {\n return self::container()->get('http');\n }", "public function getHttpClient();", "public function getHttpClient();", "public function getHttpClient();", "private function guzzleClient(): GuzzleClient\n {\n if (is_null($this->guzzle_client)) {\n $this->guzzle_client = new GuzzleClient(array(\n 'verify' => false,\n ));\n }\n\n return $this->guzzle_client;\n }", "private function prepareHttpClient() {\n $clientsetup = [];\n $headers = [];\n // Set the API key header for the request.\n $headers['Authorization'] = 'Bearer' . ' ' . $this->apiKey;\n\n // Using http proxy\n if (isset($this->options['proxy'])) {\n $clientsetup['request.options'] = [\n 'proxy' => $this->options['proxy'],\n ];\n }\n $headers['User-Agent'] = 'sendgrid/' . $this->version . ';php';\n // Create an empty stack for error processing.\n // Guzzlehttp will choose the most appropriate handler based on the system.\n if (empty($this->options['handler'])) {\n $stack = HandlerStack::create();\n }\n else {\n $stack = $this->options['handler'];\n }\n $clientsetup['base_uri'] = $this->url;\n $clientsetup['handler'] = $stack;\n $clientsetup['headers'] = $headers;\n\n return new \\GuzzleHttp\\Client($clientsetup);\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 }", "public function getGuzzleClient()\n {\n return $this->guzzle;\n }", "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 }", "abstract protected function createHttpClient();", "public function getGuzzleClient()\n {\n return $this->guzzleClient;\n }", "public function getHttpClient(): HttpClient;", "public function getGuzzleClient()\n {\n return $this->client;\n }", "public function createDefaultGuzzleClient(): Client\n {\n return new Client(Config::getInstance()->get('guzzle', []));\n }", "public function setHttpClient(\\GuzzleHttp\\Client $httpClient);", "protected function getHttpClient()\n {\n if (!$this->httpClient) {\n $this->httpClient = new \\Guzzle\\Http\\Client();\n }\n return $this->httpClient;\n }", "protected function newGuzzleClient()\n {\n $baseUrl = sprintf(self::BASE_URL, $this->hostname);\n\n return new GuzzleClient([\n 'base_uri' => $baseUrl,\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 }", "private function getClient()\n {\n if(!$this->client){\n $this->client = new GuzzleHttpClient();\n }\n return $this->client;\n }", "public function __construct()\n {\n $this->client = new GuzzleClient(['base_uri' => $this->guzzle_http_dns]);\n }", "public function testGuzzleClientOverrideConstructor()\n {\n if (class_exists('\\GuzzleHttp\\Client') == true) {\n $baseUrl = \"http://www.foo2.com\";\n $client = new \\GuzzleHttp\\Client(['base_uri' => $baseUrl]);\n $telemetryChannel = new \\ApplicationInsights\\Channel\\Telemetry_Channel('/what', $client);\n $telemetryClient = new \\ApplicationInsights\\Telemetry_Client(null, $telemetryChannel);\n $this->assertEquals($telemetryClient->getChannel()->GetClient(), new \\GuzzleHttp\\Client(['base_uri' => $baseUrl]));\n }\n else\n {\n $this->markTestSkipped(\"\\GuzzleHttp\\Client does not exist\");\n }\n }", "private function createHttpClient()\n {\n if (version_compare(ClientInterface::VERSION, '6') === 1) {\n return new Client([\n 'exceptions' => false,\n 'headers' => [\n 'Accept' => 'application/json',\n ],\n //'debug' => true,\n ]);\n } else {\n $client = new Client();\n $client->setDefaultOption('exceptions', false);\n\n return $client;\n }\n }", "public function setUpHttpClient()\n {\n $response = $this->getMock(\n 'Phergie_Plugin_Http_Response', array('getContent')\n );\n $response\n ->expects($this->any())\n ->method('getContent')\n ->will($this->returnValue($this->chayism));\n\n $plugin = $this->requirePlugin('Http');\n $plugin\n ->expects($this->any())\n ->method('get')\n ->will($this->returnValue($response));\n }", "public function getGuzzle()\n {\n return $this->guzzle;\n }", "function GuzzleTester()\n{\n\treturn new GuzzleHttp\\Client\n\t([\n\t\t'base_url' => 'http://127.0.0.1:'.RoboFile::$serverPort,\n\t\t'defaults' => ['cookies' => true]\n\t]);\n}", "public function __construct() \n {\n $this->httpClient = new Client([\n 'base_url' => $this->baseUrl\n ]);\n }", "public static function makeGuzzle($base = null, $options = [])\n {\n return \\Bugsnag\\Client::makeGuzzle($base, $options);\n }", "protected function httpClient()\n {\n return new HttpClient();\n }", "public function testDefaultHttpClientCanBeLoaded()\n {\n $this->assertInstanceOf('\\Cyclos\\Client', $this->getClient());\n }", "public function __construct(Guzzle $httpClient = null) {\r\n $this->httpClient = $httpClient ?: $this->getDefaultHttpClient();\r\n $this->initialize();\r\n }" ]
[ "0.75579166", "0.7318613", "0.7318613", "0.7318613", "0.7224586", "0.71580726", "0.71374893", "0.70381165", "0.7025806", "0.6978838", "0.69733953", "0.6921725", "0.69196916", "0.6889563", "0.688855", "0.6882729", "0.6873184", "0.6849367", "0.6833945", "0.68172365", "0.6766305", "0.6731305", "0.6670242", "0.66488934", "0.66465753", "0.66183853", "0.66165626", "0.6610184", "0.66022044", "0.66015565" ]
0.77695024
0
Get PSR7 Request factory.
public function getRequestFactory() { if (!$this->requestFactory) { $this->requestFactory = new GuzzleRequestFactory(); } return $this->requestFactory; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getRequestFactory()\n {\n if (null === $this->requestFactory) {\n $this->requestFactory = new RequestFactory();\n }\n\n return $this->requestFactory;\n }", "function drewlabs_create_psr7_request(Request $request = null)\n {\n $request = $request ?? ServerRequest::createFromServerGlobals();\n $psr17Factory = new Psr17Factory();\n $psrHttpFactory = new PsrRequestFactory($psr17Factory, $psr17Factory, $psr17Factory);\n return $psrHttpFactory->create($request);\n }", "public function getRequestFactory()\n {\n return $this->di['request_factory'];\n }", "public function getRequestFactory(): RequestFactoryInterface\n {\n return $this->requestFactory;\n }", "protected function getRequestAdapter(Request $request): RequestInterface\n {\n return new IlluminateRequestToPsr7($request);\n }", "private function request(): Request\n {\n return call_user_func($this->requestResolver);\n }", "public static function factory()\n\t{\n\t\t$o = new HttpRequest();\n\t\t$o->getRequestUri();\n\t\treturn $o;\n\t}", "protected function _requestFactory($request)\n\t{\n\t\t$class = 'QuickBooks_Request_' . ucfirst(strtolower($request));\n\t\t$file = 'QuickBooks/Request/' . ucfirst(strtolower($request)) . '.php';\n\t\t\n\t\tif (class_exists($class))\n\t\t{\n\t\t\treturn new $class();\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "private function getFactory( $request )\n\t{\n\t\treturn new Factory($request);\n\t}", "protected function createServerRequest(): ServerRequestInterface\n {\n return (new Psr7Factory())->createRequest($this->app->get('request'));\n }", "private static function createFromRequestFactory(\n\t\tarray $query = [], \n\t\tarray $request = [],\n\t\tarray $attributes = [] ,\n\t\tarray $cookies = [], \n\t\tarray $files = [], \n\t\tarray $server = []\n\t): static {\n\t\tif (self::$requestURI) {\n\t\t\t$request = (self::$requestURI)($query, $request, [], $cookies, $files, $server);\n\n\t\t\tif ( ! $request instanceof self) {\n\t\t\t\tthrow new LogicException('The Request active must return an instance of Syscodes\\Components\\Http\\Request');\n\t\t\t}\n\n\t\t\treturn $request;\n\t\t}\n\n\t\treturn new static($query, $request, $attributes, $cookies, $files, $server);\n\t}", "public static function createFromGlobals()\n {\n $request = new Request();\n $request->query = $_SERVER[\"QUERY_STRING\"];\n $request->queryArray = $_REQUEST;\n $request->method = strtoupper($_SERVER[\"REQUEST_METHOD\"]);\n $request->uri = $_SERVER[\"REQUEST_URI\"];\n $request->path = strtolower(rtrim(parse_url($request->uri, PHP_URL_PATH), \"/\"));\n $request->pathArray = explode(\"/\", trim($request->path, \"/\"));\n $request->body = file_get_contents('php://input');\n $request->post = $_POST;\n $request->files = $_FILES;\n\n return $request;\n }", "function get_request(): ServerRequestInterface\n{\n $request = Container::get('request');\n\n if (is_null($request)) {\n $request = HttpFactory::createRequest();\n Container::set('request', $request);\n }\n\n return $request;\n}", "protected function httpRequestFactory(): PendingRequest\n {\n return Http::asJson();\n }", "public function resolve()\n {\n if (isset($_SERVER['REQUEST_METHOD'])) {\n if (strtoupper($_SERVER['REQUEST_METHOD']) === 'GET') {\n $params = static::getInputParams($_SERVER, $_GET, false);\n } else {\n $params = static::getInputParams($_SERVER, $_POST, true);\n }\n\n return new PhpRequest(\n $_SERVER,\n empty($_SESSION) ? [] : $_SESSION,\n empty($_COOKIE) ? [] : $_COOKIE,\n static::getRequestHeaders($_SERVER),\n $params\n );\n }\n\n if (PHP_SAPI === 'cli' && isset($_SERVER['argv'])) {\n return new ConsoleRequest($_SERVER['argv']);\n }\n\n return new NullRequest();\n }", "public static function make(){\n\n\t\treturn static::createFromBase(SymfonyRequest::createFromGlobals());\n\t}", "public function buildHttpFactory(): HttpFactory\n {\n return $this->httpFactory = $this->httpFactory ?? new HttpFactory();\n }", "public function getRequestFactory(string $sClassName): ?RequestFactory\n {\n return $this->di->getRequestFactory($this->checkCallableObject($sClassName));\n }", "public static function fromGlobals(): Request\n {\n $method = $_SERVER['REQUEST_METHOD'] ?? 'GET';\n $headers = getallheaders();\n $uri = self::getUriFromGlobals();\n $body = new LazyOpenStream('php://input', 'r+');\n $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1';\n\n $serverRequest = new self($method, $uri, $headers, $body, $protocol, $_SERVER);\n\n return $serverRequest\n ->withCookieParams($_COOKIE)\n ->withQueryParams($_GET)\n ->withParsedBody($_POST)\n ->withUploadedFiles(self::normalizeFiles($_FILES));\n }", "protected function getValidationFactory()\n {\n return app(Factory::class);\n }", "public function toRequest(): Request\n {\n // Create URI\n $uri = new Uri(sprintf($this->uriTemplate, $this->credentials->getShop()));\n\n // Create request\n return new Request(\n $this->httpMethod,\n $uri,\n $this->headers\n );\n }", "public function request()\n {\n return Net\\Request::getInstance();\n }", "public function getStreamFactory()\n {\n if (!$this->streamFactory) {\n $this->streamFactory = new GuzzleStreamFactory();\n }\n\n return $this->streamFactory;\n }", "function request($newRequest=null) {\n static $request;\n if (!isset($request) || isset($newRequest))\n $request = $newRequest ?: new Request();\n return $request;\n}", "public static function fromUserRequest() {\n $url = explode('?', $_SERVER['REQUEST_URI'])[0];\n return new Request($url, $_GET, $_POST, $_FILES);\n }", "public static function fromServer(): RequestInterface\r\n {\r\n return new Request($_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI'], $_GET, $_POST);\r\n }", "public static function fromRequest()\n {\n $ip = (array_key_exists('REMOTE_ADDR', $_SERVER)) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0';\n $class = get_called_class();\n $instance = new $class($ip);\n return $instance;\n }", "protected function createRequest () {\n \treturn new HTTP_Request2();\n }", "public static function httpRequestFactory(): ?object;", "protected function validationFactory()\n {\n return app(Factory::class);\n }" ]
[ "0.7816572", "0.7759441", "0.77224505", "0.75072443", "0.6976604", "0.6890003", "0.67439836", "0.663106", "0.6589201", "0.64918035", "0.6297566", "0.6249343", "0.6246105", "0.6234037", "0.6204824", "0.61642903", "0.6149742", "0.6111045", "0.6104694", "0.60816246", "0.60623896", "0.6054242", "0.6035982", "0.6024577", "0.6022795", "0.6006517", "0.5998086", "0.5979265", "0.5962963", "0.5949346" ]
0.7784443
1