query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
this function returns all indexer configurations found in DB independant of PID | public function getConfigurations() {
$fields = '*';
$table = 'tx_kesearch_indexerconfig';
$where = '1=1 ';
if (TYPO3_VERSION_INTEGER >= 7000000) {
$where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table);
$where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table);
} else {
$where .= t3lib_befunc::BEenableFields($table);
$where .= t3lib_befunc::deleteClause($table);
}
return $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($fields, $table, $where);
} | [
"public function getSettings($indexes = []);",
"public function getIndexConfig(): IndexConfig;",
"public function getConfiguratorList(): array;",
"function get_config_array($query, $idx = false)\n {\n // var_dump($query);\n // var_dump($idx);\n $result = $this->configDB->query($query);\n $data = $this->get_associative_array($result, $idx);\n $result->freeResult();\n return $data;\n }",
"public function getIndexSettings(): array\n {\n // Les settings générés\n $index = [];\n\n // Détermine la liste des analyseurs docalist utilisés dans les mappings\n $analyzers = $this->getAnalyzers();\n\n // Détermine l'ordre et la liste des différents composants utilisés dans les analyseurs docalist trouvés\n $sections = [\n 'char_filter' => $this->getCharFilters($analyzers),\n 'tokenizer' => $this->getTokenizers($analyzers),\n 'filter' => $this->getTokenFilters($analyzers),\n 'analyzer' => $analyzers,\n ];\n\n // Génère la section \"analysis\" des settings\n $analysis = [];\n foreach ($sections as $section => $components) {\n ksort($components);\n foreach ($components as $name => $component) { /** @var Component $component */\n $analysis[$section][$name] = $component->getDefinition();\n }\n }\n !empty($analysis) && $index['settings']['analysis'] = $analysis;\n\n // Génère les mappings\n $mappings = $this->mapping->getMapping($this->options);\n\n // Avant la version 7 de elasticsearch, il faut inclure le nom du mapping\n if (!version_compare($this->options->getVersion(), '6.99', '>')) { // tient compte des versions alpha, rc...\n $mappings = [$this->mapping->getName() => $mappings];\n }\n\n // Stocke les mappings dans les settings de l'index\n $index['mappings'] = $mappings;\n\n // Ok\n return $index;\n }",
"private function collectConfigIndexes()\n {\n foreach (Arr::get($this->config, 'generator.additional_indexes', []) as $name => $params) {\n $index = new IndexSection($this->config);\n $index->setName($name)\n ->setParams($params);\n\n $this->sections[] = $index;\n }\n }",
"public function get_export_configurations()\n {\n $mapping = [\n 'isys_monitoring_export_config__id AS id',\n 'isys_monitoring_export_config__title AS title',\n 'isys_monitoring_export_config__path AS path',\n 'isys_monitoring_export_config__address AS address',\n 'isys_monitoring_export_config__type AS type',\n 'isys_monitoring_export_config__options AS options'\n ];\n\n return $this->retrieve('SELECT ' . implode(',', $mapping) . ' FROM isys_monitoring_export_config WHERE isys_monitoring_export_config__type = \"check_mk\";');\n }",
"public function configIds();",
"private function getProcessList(){\n $slowQueryRows = array();\n $status_array = array();\n list($server_array) = $this->serversDefinitions('host');\n $config = $this->config;\n foreach($server_array as $alias => $server)\n {\n list($domain, $port) = explode(':', $server);\n $ip = gethostbyname($domain);\n $status_array[$alias]['server'] = $domain;\n $status_array[$alias]['IP'] = $ip;\n \n $config['host'] = $server;\n \n $db = new DB($config);\n $slowQueryRows[] = array('dbhost' => $alias, 'queries' => $db->getRowList('SHOW FULL PROCESSLIST'));\n }\n return $slowQueryRows;\n }",
"public function getConfigList ()\n {\n return $this->getBasicIdSelectList('cms_config_data');\n }",
"public function configuration(): ElasticsearchIndexConfigurationInterface;",
"public function get_all_settings(){\n $db = Database::newInstance();\n $query = \"SELECT * FROM tbl_settings\";\n\n return $db->read_db($query);\n }",
"function get_configs()\r\r\n\t{\r\r\n\t\tglobal $db;\r\r\n\t\t$results = $db->select(tbl($this->tbl),\"*\");\r\r\n\t\tforeach($results as $result)\r\r\n\t\t{\r\r\n\t\t\t$this->configs[$result['hd_config_name']] = $result['hd_config_value'];\r\r\n\t\t}\r\r\n\t\t//Setting up plugin vars\r\r\n\t\t$vars = $this->configs['custom_variables'];\r\r\n\t\t$this->configs['custom_vars'] = json_decode($vars,true);\r\r\n\t\t\r\r\n\t\treturn $this->configs;\r\r\n\t}",
"public function getStoreIndexSettings($store = null)\n {\n $store = Mage::app()->getStore($store);\n $cacheId = 'elasticsearch_index_settings_' . $store->getId();\n if (Mage::app()->useCache('config')) {\n $indexSettings = Mage::app()->loadCache($cacheId);\n if ($indexSettings) {\n return unserialize($indexSettings);\n }\n }\n\n $config = $this->getEngineConfigData($store);\n $indexSettings = array();\n $indexSettings['number_of_replicas'] = (int) $config['number_of_replicas'];\n $indexSettings['number_of_shards'] = (int) $config['number_of_shards'];\n $indexSettings['analysis']['char_filter'] = array(\n \"normalizeCodeFilter\" => array(\n \"pattern\" => \"[^A-Za-z0-9а-яА-Я]\",\n \"type\" =>\"pattern_replace\",\n \"replacement\" => \"\"\n ),\n \"yo_filter\" => array(\n \"type\" => \"mapping\",\n \"mappings\" => array(\n \"ё => е\",\n \"Ё => Е\"\n )\n )\n );\n $indexSettings['analysis']['analyzer'] = array(\n 'std' => array( // Will allow query 'shoes' to match better than 'shoe' which the stemmed version\n 'tokenizer' => 'standard',\n 'char_filter' => 'html_strip', // strip html tags\n 'filter' => array('standard', 'elision', 'asciifolding', 'lowercase', 'stop', 'length'),\n ),\n 'brand' => array(\n 'tokenizer' => 'standard',\n 'char_filter' => array('html_strip', 'yo_filter'), // strip html tags\n 'filter' => array('standard', 'asciifolding', 'lowercase', 'stop', 'length', 'latinTransform'),\n ),\n 'keyword' => array(\n 'tokenizer' => 'keyword',\n 'char_filter' => 'normalizeCodeFilter',\n 'filter' => array('asciifolding', 'lowercase'),\n ),\n 'keyword_prefix' => array(\n 'tokenizer' => 'keyword',\n 'char_filter' => 'normalizeCodeFilter',\n 'filter' => array('asciifolding', 'lowercase', 'edge_ngram_front'),\n ),\n 'keyword_suffix' => array(\n 'tokenizer' => 'keyword',\n 'char_filter' => 'normalizeCodeFilter',\n 'filter' => array('asciifolding', 'lowercase', 'edge_ngram_back'),\n ),\n 'text_prefix' => array(\n 'tokenizer' => 'standard',\n 'char_filter' => 'html_strip', // strip html tags\n 'filter' => array('standard', 'elision', 'asciifolding', 'lowercase', 'stop', 'edge_ngram_front'),\n ),\n 'text_suffix' => array(\n 'tokenizer' => 'standard',\n 'char_filter' => 'html_strip', // strip html tags\n 'filter' => array('standard', 'elision', 'asciifolding', 'lowercase', 'stop', 'edge_ngram_back'),\n ),\n );\n $indexSettings['analysis']['filter'] = array(\n 'edge_ngram_front' => array(\n 'type' => 'edgeNGram',\n 'min_gram' => 2,\n 'max_gram' => 10,\n 'side' => 'front',\n ),\n 'edge_ngram_back' => array(\n 'type' => 'edgeNGram',\n 'min_gram' => 2,\n 'max_gram' => 10,\n 'side' => 'back',\n ),\n 'strip_spaces' => array(\n 'type' => 'pattern_replace',\n 'pattern' => '\\s',\n 'replacement' => '',\n ),\n 'strip_dots' => array(\n 'type' => 'pattern_replace',\n 'pattern' => '\\.',\n 'replacement' => '',\n ),\n 'strip_hyphens' => array(\n 'type' => 'pattern_replace',\n 'pattern' => '-',\n 'replacement' => '',\n ),\n 'stop' => array(\n 'type' => 'stop',\n 'stopwords' => '_none_',\n ),\n 'length' => array(\n 'type' => 'length',\n 'min' => 2,\n ),\n \"latinTransform\" => array(\n \"type\" => \"icu_transform\",\n \"id\" => \"Any-Latin; NFD; [:Nonspacing Mark:] Remove; NFC\"\n )\n );\n /** @var $store Mage_Core_Model_Store */\n $languageCode = $this->getLanguageCodeByStore($store);\n $language = Zend_Locale_Data::getContent('en_GB', 'language', $languageCode);\n $languageExists = true;\n if (!in_array($language, $this->_snowballLanguages)) {\n $parts = explode(' ', $language); // try with potential first string\n $language = $parts[0];\n if (!in_array($language, $this->_snowballLanguages)) {\n $languageExists = false; // language not present by default in elasticsearch\n }\n }\n if ($languageExists) {\n $languageFilters = array(\n 'standard', 'elision', 'asciifolding', 'lowercase', 'stop'\n );\n\n if (($language == 'Russian'\n || $language == 'Ukrainian')\n && $this->hasPlugin('elasticsearch-analysis-morphology')) {\n // Define russian_morphology filter according to current language\n $filter = 'my_stopwords';\n $uaStopwords = ['а', 'аби', 'абиде', 'абиким', 'абикого', 'абиколи', 'абикому', 'абикуди', 'абихто', 'абичий', 'абичийого', 'абичийому', 'абичим', 'абичию', 'абичия', 'абичиє', 'абичиєму', 'абичиєю', 'абичиєї', 'абичиї', 'абичиїй', 'абичиїм', 'абичиїми', 'абичиїх', 'абичого', 'абичому', 'абищо', 'абияка', 'абияке', 'абиякий', 'абияким', 'абиякими', 'абияких', 'абиякого', 'абиякому', 'абиякою', 'абиякої', 'абияку', 'абиякі', 'абиякій', 'абиякім', 'або', 'абощо', 'авжеж', 'авось', 'ага', 'ад', 'адже', 'аж', 'ажень', 'аз', 'ай', 'але', 'ало', 'амінь', 'ант', 'ану', 'ані', 'аніде', 'аніж', 'анізащо', 'аніким', 'анікого', 'анікогісінько', 'аніколи', 'анікому', 'аніскільки', 'аніхто', 'анічим', 'анічого', 'анічогісінько', 'анічому', 'аніщо', 'аніяка', 'аніяке', 'аніякий', 'аніяким', 'аніякими', 'аніяких', 'аніякого', 'аніякому', 'аніякою', 'аніякої', 'аніяку', 'аніякі', 'аніякій', 'аніякім', 'аніякісенька', 'аніякісеньке', 'аніякісенький', 'аніякісеньким', 'аніякісенькими', 'аніякісеньких', 'аніякісенького', 'аніякісенькому', 'аніякісенькою', 'аніякісенької', 'аніякісеньку', 'аніякісенькі', 'аніякісенькій', 'аніякісенькім', 'аніякісінька', 'аніякісіньке', 'аніякісінький', 'аніякісіньким', 'аніякісінькими', 'аніякісіньких', 'аніякісінького', 'аніякісінькому', 'аніякісінькою', 'аніякісінької', 'аніякісіньку', 'аніякісінькі', 'аніякісінькій', 'аніякісінькім', 'ат', 'ато', 'атож', 'ау', 'ах', 'ач', 'ачей', 'аякже', 'б', 'ба', 'багато', 'багатьма', 'багатьом', 'багатьох', 'баз', 'бай', 'бат', 'бах', 'бац', 'баш', 'бе', 'беж', 'без', 'безперервно', 'бел', 'бер', 'би', 'бир', 'бич', 'близько', 'близько від', 'бо', 'бов', 'бод', 'бодай', 'боз', 'бош', 'був', 'буває', 'буде', 'будем', 'будемо', 'будете', 'будеш', 'буду', 'будуть', 'будь', 'будь ласка', 'будьмо', 'будьте', 'була', 'були', 'було', 'бути', 'бух', 'буц', 'буцім', 'буцімто', 'бі', 'біб', 'більш', 'більше', 'біля', 'в', 'в бік', 'в залежності від', 'в міру', 'в напрямі до', 'в порівнянні з', 'в процесі', 'в результаті', 'в ролі', 'в силу', 'в сторону', 'в супроводі', 'в ході', \"в ім'я\", 'в інтересах', 'вад', 'важлива', 'важливе', 'важливий', 'важливі', 'вак', 'вам', 'вами', 'ван', 'вас', 'ват', 'ваш', 'ваша', 'ваше', 'вашим', 'вашими', 'ваших', 'вашого', 'вашому', 'вашою', 'вашої', 'вашу', 'ваші', 'вашій', 'вашім', 'ввесь', 'вві', 'вгору', 'вдалині', 'вед', 'верх', 'весь', 'вех', 'вже', 'вздовж', 'ви', 'виз', 'вис', 'височині', 'вище ', 'вйо', 'власне', 'властиво', 'вміти', 'внаслідок', 'вниз', 'внизу', 'во', 'вон', 'вона', 'вони', 'воно', 'восьмий', 'вперед', 'вподовж', 'впоперек', 'впритиск', 'впритул', 'впродовж', 'впрост', 'все', 'всередині', 'всею', 'вслід', 'всупереч', 'всього', 'всьому', 'всю', 'всюди', 'вся', 'всяк', 'всяка', 'всяке', 'всякий', 'всяким', 'всякими', 'всяких', 'всякого', 'всякому', 'всякою', 'всякої', 'всяку', 'всякі', 'всякій', 'всякім', 'всі', 'всій', 'всіляка', 'всіляке', 'всілякий', 'всіляким', 'всілякими', 'всіляких', 'всілякого', 'всілякому', 'всілякою', 'всілякої', 'всіляку', 'всілякі', 'всілякій', 'всілякім', 'всім', 'всіма', 'всіх', 'всією', 'всієї', 'втім', 'ві', 'віг', 'від', 'від імені', 'віддалік від', 'відколи', 'відносно', 'відповідно', 'відповідно до', 'відсотків', 'відтепер', 'відтоді', 'він', 'вісім', 'вісімнадцятий', 'вісімнадцять', 'віт', 'віф', 'віх', 'віц', 'віщо', 'віщось', 'г', 'га', 'гав', 'гаразд', 'ге', 'гез', 'гем', 'геп', 'гет', 'геть', 'гех', 'ги', 'гик', 'гир', 'гич', 'гм', 'го', 'говорив', 'гог', 'гоп', 'гоц', 'гу', 'гуп', 'д', 'да', 'давай', 'давати', 'давно', 'далеко', 'далеко від', 'далі', 'даром', 'два', 'двадцятий', 'двадцять', 'дванадцятий', 'дванадцять', 'двох', 'дві', 'де', \"дев'ятий\", \"дев'ятнадцятий\", \"дев'ятнадцять\", \"дев'ять\", 'дедалі', 'деким', 'декого', 'деколи', 'декому', 'декотра', 'декотре', 'декотрий', 'декотрим', 'декотрими', 'декотрих', 'декотрого', 'декотрому', 'декотрою', 'декотрої', 'декотру', 'декотрі', 'декотрій', 'декотрім', 'декілька', 'декільком', 'декількома', 'декількох', 'декім', 'десь', 'десятий', 'десять', 'дехто', 'дечий', 'дечийого', 'дечийому', 'дечим', 'дечию', 'дечия', 'дечиє', 'дечиєму', 'дечиєю', 'дечиєї', 'дечиї', 'дечиїй', 'дечиїм', 'дечиїми', 'дечиїх', 'дечого', 'дечому', 'дечім', 'дещо', 'деяка', 'деяке', 'деякий', 'деяким', 'деякими', 'деяких', 'деякого', 'деякому', 'деякою', 'деякої', 'деяку', 'деякі', 'деякій', 'деякім', 'деінде', 'для', 'до', 'добре', 'довго', 'довкола', 'довкіл', 'дог', 'доки', 'допоки', 'допіру', 'досить', 'досі', 'дотепер', 'доти', 'другий', 'друго', 'дуже', 'дякую', 'дійсно', 'діл', 'е', 'еге', 'еж', 'ей', 'ерг', 'ест', 'ет', 'ех', 'еч', 'ж', 'же', 'жоден', 'жодна', 'жодне', 'жодний', 'жодним', 'жодними', 'жодних', 'жодного', 'жодному', 'жодною', 'жодної', 'жодну', 'жодні', 'жодній', 'жоднім', 'жоднісінька', 'жоднісіньке', 'жоднісінький', 'жоднісіньким', 'жоднісінькими', 'жоднісіньких', 'жоднісінького', 'жоднісінькому', 'жоднісінькою', 'жоднісінької', 'жоднісіньку', 'жоднісінькі', 'жоднісінькій', 'жоднісінькім', 'жуз', 'з', 'з метою', 'з нагоди', 'з приводу', 'з розрахунку на', 'з-за', 'з-над', 'з-перед', 'з-поза', 'з-поміж', 'з-понад', 'з-поперед', 'з-посеред', 'з-проміж', 'з-під', 'з-серед', 'за', 'за винятком', 'за допомогою', 'за посередництвом', 'за рахунок', 'завгодно', 'завдяки', 'завжди', 'завше', 'задля', 'зазвичай', 'зайнята', 'зайнятий', 'зайнято', 'зайняті', 'залежно', 'залежно від', 'замість', 'занадто', 'заради', 'зараз', 'зас', 'зате', 'збоку', 'збоку від', 'зважаючи на', 'зверх ', 'зверху', 'звичайно', 'звиш', 'звідки', 'звідкилясь', 'звідкись', 'звідкіль', 'звідкіля', 'звідкілясь', 'звідси', 'звідсіль', 'звідсіля', 'звідти', 'звідтіль', 'звідтіля', 'звідусюди', 'звідусіль', 'звідціля', 'згідно з', 'здається', 'здовж', 'зем', 'зет', 'ззаду', 'зиз', 'зик', 'значить', 'знову', 'зо', 'зовсім', 'зсередини', 'зух', 'зі', 'зіс', 'и', 'ич', 'й', 'ймовірно', 'йно', 'йо', 'його', 'йой', 'йол', 'йому', 'йор', 'йот', 'йох', 'к', 'каже', 'каз', 'кар', 'каф', 'ках', 'ке', 'кед', 'кет', 'кеш', 'кив', 'кий', 'кил', 'ким', 'кимось', 'кимсь', 'ких', 'киш', 'коб', 'коби', 'кого', 'когось', 'кожен', 'кожна', 'кожне', 'кожний', 'кожним', 'кожними', 'кожних', 'кожного', 'кожному', 'кожною', 'кожної', 'кожну', 'кожні', 'кожній', 'кожнім', 'кожнісінька', 'кожнісіньке', 'кожнісінький', 'кожнісіньким', 'кожнісінькими', 'кожнісіньких', 'кожнісінького', 'кожнісінькому', 'кожнісінькою', 'кожнісінької', 'кожнісіньку', 'кожнісінькі', 'кожнісінькій', 'кожнісінькім', 'коли', 'колись', 'коло', 'кому', 'комусь', 'котра', 'котрась', 'котре', 'котресь', 'котрий', 'котрийсь', 'котрим', 'котрими', 'котримись', 'котримось', 'котримсь', 'котрих', 'котрихось', 'котрихсь', 'котрого', 'котрогось', 'котрому', 'котромусь', 'котрою', 'котроюсь', 'котрої', 'котроїсь', 'котру', 'котрусь', 'котрі', 'котрій', 'котрійсь', 'котрім', 'котрімсь', 'котрісь', 'коц', 'коч', 'коштом', 'край', 'краще', 'кру', 'круг', 'кругом', 'крю', 'кря', 'крізь', 'крім', 'куди', 'кудись', 'кудою', 'кілька', 'кільком', 'кількома', 'кількох', 'кім', 'кімось', 'кімсь', 'кінець', 'л', 'лаж', 'лап', 'лас', 'лат', 'ле', 'ледве', 'ледь', 'лет', 'лиш', 'лише', 'лишень', 'лум', 'луп', 'лут', 'льє', 'люди', 'людина', 'ля', 'лі', 'ліворуч від', 'лік', 'лім', 'м', 'мабуть', 'майже', 'мало', 'мати', 'мац', 'ме', 'меж', 'мене', 'менше', 'мені', 'мерсі', 'мет', 'мжа', 'ми', 'мимо ', 'миру', 'мит', 'мною', 'мо', 'мов', 'мовби', 'мовбито', 'могла', 'могли', 'могло', 'мого', 'могти', 'мож', 'може', 'можем', 'можемо', 'можете', 'можеш', 'можна', 'можу', 'можуть', 'можіть', 'мой', 'мол', 'мою', 'моя', 'моє', 'моєму', 'моєю', 'моєї', 'мої', 'моїй', 'моїм', 'моїми', 'моїх', 'му', 'мі', 'міг', 'між', 'мій', 'мільйонів', 'н', 'на', 'на адресу', 'на базі', 'на благо', 'на випадок', 'на відміну від', 'на засадах', 'на знак', 'на зразок', 'на користь', 'на кшталт', 'на межі', 'на основі', 'на противагу', 'на підставі', 'на честь', 'на чолі', 'на ґрунті', 'навколо', 'навкруг', 'навкруги ', 'навкіл', 'навпаки', 'навперейми', 'навпроти', 'навіть', 'навіщо', 'навіщось', 'нагорі', 'над', 'надо', 'надовкола', 'надокола', 'наді', 'назавжди', 'назад', 'назустріч', 'най', 'найбільш', 'нам', 'нами', 'наоколо ', 'наокруг ', 'наокруги ', 'наокіл', 'наперед', 'напередодні', 'напереді', 'наперекір', 'напереріз', 'наприкінці', 'напроти', 'нарешті', 'нарівні з', 'нас', 'насеред', 'насподі', 'наспід', 'настрічу', 'насупроти', 'насупротив ', 'нате', 'наче', 'начеб', 'начебто', 'наш', 'наша', 'наше', 'нашим', 'нашими', 'наших', 'нашого', 'нашому', 'нашою', 'нашої', 'нашу', 'наші', 'нашій', 'нашім', 'не', 'не до', 'не можна', 'неабичим', 'неабичого', 'неабичому', 'неабищо', 'небагато', 'небагатьма', 'небагатьом', 'небагатьох', 'небудь', 'невважаючи', 'невже', 'недалеко', 'недалеко від', 'неж', 'незалежно від', 'незважаючи', 'незважаючи на', 'ней', 'немає', 'немов', 'немовби', 'немовбито', 'неначе', 'неначебто', 'неподалеку', 'неподалеку від', 'неподалечку', 'неподалечку від', 'неподалік', 'неподалік від', 'нерідко', 'нех', 'нехай', 'нещодавно', 'нею', 'неї', 'нижче', 'низько', 'ник', 'ним', 'ними', 'них', 'нич', 'но', 'ну', 'нуг', 'нуд', 'нум', 'нумо', 'нумте', 'ньо', 'нього', 'ньому', 'ню', 'нюх', 'ня', 'няв', 'ні', 'ніби', 'ніби-то', 'нібито', 'ніде', 'ніж', 'нізащо', 'нізвідки', 'нізвідкіля', 'ній', 'ніким', 'нікого', 'нікогісінько', 'ніколи', 'нікому', 'нікотра', 'нікотре', 'нікотрий', 'нікотрим', 'нікотрими', 'нікотрих', 'нікотрого', 'нікотрому', 'нікотрою', 'нікотрої', 'нікотру', 'нікотрі', 'нікотрій', 'нікотрім', 'нікуди', 'нім', 'нінащо', 'ніскільки', 'ніт', 'ніхто', 'нічий', 'нічийна', 'нічийне', 'нічийний', 'нічийним', 'нічийними', 'нічийних', 'нічийного', 'нічийному', 'нічийною', 'нічийної', 'нічийну', 'нічийні', 'нічийній', 'нічийнім', 'нічийого', 'нічийому', 'нічим', 'нічию', 'нічия', 'нічиє', 'нічиєму', 'нічиєю', 'нічиєї', 'нічиї', 'нічиїй', 'нічиїм', 'нічиїми', 'нічиїх', 'нічого', 'нічому', 'ніщо', 'ніяк', 'ніяка', 'ніяке', 'ніякий', 'ніяким', 'ніякими', 'ніяких', 'ніякого', 'ніякому', 'ніякою', 'ніякої', 'ніяку', 'ніякі', 'ніякій', 'ніякім', 'ніякісінька', 'ніякісіньке', 'ніякісінький', 'ніякісіньким', 'ніякісінькими', 'ніякісіньких', 'ніякісінького', 'ніякісінькому', 'ніякісінькою', 'ніякісінької', 'ніякісіньку', 'ніякісінькі', 'ніякісінькій', 'ніякісінькім', 'о', 'об', 'обабіч', 'обаполи', 'обидва', 'обр', 'обік', 'обіруч', 'обіч', 'ов', 'од', 'один', 'одинадцятий', 'одинадцять', 'одна', 'однак', 'одначе', 'одне', 'одним', 'одними', 'одних', 'одно', 'одного', 'одного разу', 'одному', 'одною', 'одної', 'одну', 'одні', 'одній', 'однім', 'однією', 'однієї', 'ож', 'ой', 'окрай', 'окроме', 'округ', 'округи', 'окрім', 'окіл', 'ом', 'он', 'онде', 'онно', 'оно', 'оподаль', 'оподаль від', 'оподалік', 'оподалік від', 'опостін', 'опостінь', 'опроче', 'опріч', 'опріче', 'опісля', 'осе', 'оскільки', 'особливо', 'осторонь', 'ось', 'осісьо', 'от', 'ота', 'отак', 'отака', 'отаке', 'отакий', 'отаким', 'отакими', 'отаких', 'отакого', 'отакому', 'отакою', 'отакої', 'отаку', 'отакі', 'отакій', 'отакім', 'отакісінька', 'отакісіньке', 'отакісінький', 'отакісіньким', 'отакісінькими', 'отакісіньких', 'отакісінького', 'отакісінькому', 'отакісінькою', 'отакісінької', 'отакісіньку', 'отакісінькі', 'отакісінькій', 'отакісінькім', 'отам', 'оте', 'отже', 'отим', 'отими', 'отих', 'ото', 'отого', 'отож', 'отой', 'отому', 'отою', 'отої', 'отсе', 'оттак', 'отто', 'оту', 'отут', 'оті', 'отій', 'отім', 'отією', 'отієї', 'ох', 'оце', 'оцей', 'оцим', 'оцими', 'оцих', 'оцього', 'оцьому', 'оцю', 'оця', 'оці', 'оцій', 'оцім', 'оцією', 'оцієї', 'п', \"п'я\", \"п'ятий\", \"п'ятнадцятий\", \"п'ятнадцять\", \"п'ять\", 'па', 'пад', 'пак', 'пек', 'перед', 'передо', 'переді', 'перетака', 'перетаке', 'перетакий', 'перетаким', 'перетакими', 'перетаких', 'перетакого', 'перетакому', 'перетакою', 'перетакої', 'перетаку', 'перетакі', 'перетакій', 'перетакім', 'перший', 'пиж', 'плі', 'по', 'поблизу', 'побік', 'побіля', 'побіч', 'поверх', 'повз', 'повздовж', 'повинно', 'повище', 'повсюди', 'повсюдно', 'подаль від', 'подалі від', 'подекуди', 'подеяка', 'подеяке', 'подеякий', 'подеяким', 'подеякими', 'подеяких', 'подеякого', 'подеякому', 'подеякою', 'подеякої', 'подеяку', 'подеякі', 'подеякій', 'подеякім', 'подовж', 'подібно до', 'поз', 'поза', 'позад', 'позаду', 'позата', 'позате', 'позатим', 'позатими', 'позатих', 'позатого', 'позатой', 'позатому', 'позатою', 'позатої', 'позату', 'позаті', 'позатій', 'позатім', 'позатією', 'позатієї', 'позаяк', 'поздовж', 'поки', 'покрай', 'покіль', 'помежи', 'помимо', 'поміж', 'помість', 'понад', 'понадо', 'понаді', 'понижче', 'пообіч', 'поодаль від', 'поодалік від', 'поперед', 'попереду', 'поперек', 'попліч', 'попри', 'попросту', 'попід', 'пора', 'поруч', 'поряд', 'поряд з', 'порівняно з', 'посеред', 'посередині', 'потрібно', 'потім', 'поуз', 'початку', 'почерез', 'праворуч від', 'пред', 'предо', 'преді', 'прекрасно', 'прецінь', 'при', 'притому', 'причому', 'причім', 'про', 'проз', 'промеж', 'проміж', 'просто', 'проте', 'проти', 'против', 'противно', 'протягом', 'пря', 'пріч', 'пхе', 'пху', 'пі', 'пів', 'півперек', 'під', 'під знаком', 'під приводом', 'під час', 'підо', 'пізніше', 'пім', 'пір', 'після', 'р', 'ради', 'раз', 'разом з', 'разу', 'рано', 'раніш', 'раніш від', 'раніше', 'раніше від', 'раптом', 'ре', 'рет', 'риж', 'рим', 'рип', 'роб', 'року', 'років', 'рос', 'рох', 'році', 'рус', 'рух', 'руч', 'рік', 'с', 'саж', 'саз', 'сак', 'сам', 'сама', 'саме', 'сами', 'самий', 'самим', 'самими', 'самих', 'само', 'самого', 'самому', 'самою', 'самої', 'саму', 'самі', 'самій', 'самім', 'сап', 'сас', 'свого', 'свою', 'своя', 'своє', 'своєму', 'своєю', 'своєї', 'свої', 'своїй', 'своїм', 'своїми', 'своїх', 'свій', 'се', 'себе', 'себто', 'сей', 'сен', 'серед', 'середи', 'середу', 'сеч', 'си', 'сив', 'сиг', 'сиз', 'сик', 'сиріч', 'сих', 'сказав', 'сказала', 'сказати', 'скрізь', 'скільки', 'скільки-то', 'скількись', 'скільком', 'скількома', 'скількомась', 'скількомось', 'скількомсь', 'скількох', 'скількохось', 'скількохсь', 'сли', 'слідом за', 'соб', 'собою', 'собі', 'соп', 'спасибі', 'спереду', 'спочатку', 'справ', 'справді', 'став', 'стосовно', 'стільки', 'стільком', 'стількома', 'стількох', 'су', 'судячи з', 'супроти', 'супротив', 'суть', 'суч', 'суш', 'сьогодні', 'сьомий', 'сюди', 'ся', 'сяг', 'сяк', 'сяка', 'сяке', 'сякий', 'сяким', 'сякими', 'сяких', 'сякого', 'сякому', 'сякою', 'сякої', 'сяку', 'сякі', 'сякій', 'сякім', 'сям', 'сі', 'сім', 'сімнадцятий', 'сімнадцять', 'сіп', 'т', 'та', 'таж', 'так', 'така', 'таке', 'такенна', 'такенне', 'такенний', 'такенним', 'такенними', 'такенних', 'такенного', 'такенному', 'такенною', 'такенної', 'такенну', 'такенні', 'такенній', 'такеннім', 'таки', 'такий', 'таким', 'такими', 'таких', 'такого', 'також', 'такому', 'такою', 'такої', 'таку', 'такі', 'такій', 'такім', 'такісінька', 'такісіньке', 'такісінький', 'такісіньким', 'такісінькими', 'такісіньких', 'такісінького', 'такісінькому', 'такісінькою', 'такісінької', 'такісіньку', 'такісінькі', 'такісінькій', 'такісінькім', 'тал', 'там', 'тамки', 'тамта', 'тамте', 'тамтим', 'тамтими', 'тамтих', 'тамтого', 'тамтой', 'тамтому', 'тамтою', 'тамтої', 'тамту', 'тамті', 'тамтій', 'тамтім', 'тамтією', 'тамтієї', 'тар', 'тат', 'таш', 'тва', 'твого', 'твою', 'твоя', 'твоє', 'твоєму', 'твоєю', 'твоєї', 'твої', 'твоїй', 'твоїм', 'твоїми', 'твоїх', 'твій', 'те', 'тебе', 'тег', 'теж', 'тем', 'тепер', 'теперечки', 'тес', 'теф', 'теє', 'ти', 'тик', 'тил', 'тим', 'тими', 'тисяч', 'тих', 'то', 'тобою', 'тобто', 'тобі', 'того', 'тоді', 'тож', 'той', 'тол', 'тому', 'тому що', 'тот', 'тощо', 'тою', 'тої', 'тра', 'тре', 'треба', 'третій', 'три', 'тринадцятий', 'тринадцять', 'трохи', 'тс', 'тсс', 'ту', 'туди', 'тудою', 'туп', 'тут', 'тутеньки', 'тутечки', 'тутки', 'туф', 'туц', 'тю', 'тюг', 'тюп', 'тяг', 'тяж', 'тям', 'тяп', 'ті', 'тій', 'тільки', 'тім', 'тією', 'у', 'у бік', 'у вигляді', 'у випадку', 'у відповідності до', 'у відповідь на', 'у залежності від', \"у зв'язку з\", 'у міру', 'у напрямі до', 'у порівнянні з', 'у процесі', 'у результаті', 'у ролі', 'у силу', 'у сторону', 'у супроводі', 'у ході', 'ув', 'увесь', 'уві', 'угу', 'уже', 'узбіч', 'уздовж', 'укр', 'ум', 'унаслідок', 'униз', 'унизу', 'унт', 'уперед', 'уподовж', 'упоперек', 'упритиск до', 'упритул до', 'упродовж', 'упрост', 'ус', 'усе', 'усередині', 'услід', 'услід за', 'усупереч', 'усього', 'усьому', 'усю', 'усюди', 'уся', 'усяк', 'усяка', 'усяке', 'усякий', 'усяким', 'усякими', 'усяких', 'усякого', 'усякому', 'усякою', 'усякої', 'усяку', 'усякі', 'усякій', 'усякім', 'усі', 'усій', 'усіляка', 'усіляке', 'усілякий', 'усіляким', 'усілякими', 'усіляких', 'усілякого', 'усілякому', 'усілякою', 'усілякої', 'усіляку', 'усілякі', 'усілякій', 'усілякім', 'усім', 'усіма', 'усіх', 'усією', 'усієї', 'утім', 'ух', 'ф', \"ф'ю\", 'фа', 'фаг', 'фай', 'фат', 'фе', 'фед', 'фез', 'фес', 'фет', 'фзн', 'фоб', 'фот', 'фра', 'фру', 'фу', 'фук', 'фур', 'фус', 'фіш', 'х', 'ха', 'хаз', 'хай', 'хап', 'хат', 'хащ', 'хе', 'хет', 'хи', 'хиб', 'хм', 'хо', 'хов', 'хол', 'хон', 'хоп', 'хор', 'хотіти', 'хоч', 'хоча', 'хочеш', 'хро', 'хрю', 'хто', 'хтось', 'ху', 'хуз', 'хук', 'хух', 'хху', 'хіба', 'ц', 'це', 'цебто', 'цей', 'цеп', 'ци', 'цим', 'цими', 'цир', 'цих', 'цло', 'цоб', 'цок', 'цоп', 'цор', 'цс', 'цсс', 'цуг', 'цур', 'цуц', 'цього', 'цьому', 'цю', 'цюк', 'ця', 'цяв', 'цяп', 'ці', 'цід', 'цій', 'цім', 'ціною', 'цією', 'цієї', 'ч', 'чал', 'чар', 'час', 'часто', 'частіше', 'часу', 'чах', 'чей', 'чень', 'через', 'четвертий', 'чи', 'чий', 'чийого', 'чийогось', 'чийому', 'чийомусь', 'чийсь', 'чик', 'чим', 'чимось', 'чимсь', 'чир', 'численна', 'численне', 'численний', 'численним', 'численними', 'численних', 'численні', 'чию', 'чиюсь', 'чия', 'чиясь', 'чиє', 'чиєму', 'чиємусь', 'чиєсь', 'чиєю', 'чиєюсь', 'чиєї', 'чиєїсь', 'чиї', 'чиїй', 'чиїйсь', 'чиїм', 'чиїми', 'чиїмись', 'чиїмось', 'чиїмсь', 'чиїсь', 'чиїх', 'чиїхось', 'чиїхсь', 'чля', 'чого', 'чогось', 'чом', 'чому', 'чомусь', 'чон', 'чоп', 'чортзна', 'чос', 'чотири', 'чотирнадцятий', 'чотирнадцять', 'чу', 'чум', 'чур', 'чш', 'чім', 'чімось', 'чімсь', 'чіт', 'ш', 'ша', 'шаг', 'шал', 'шам', 'шво', 'шед', 'шен', 'шиз', 'шир', 'шляхом', 'шостий', 'шістнадцятий', 'шістнадцять', 'шість', 'щ', 'ще', 'щем', 'щеп', 'щип', 'щир', 'що', 'щоб', 'щоби', 'щодо', 'щойно', 'щоправда', 'щось', 'щі', 'ь', 'ю', 'юз', 'юн', 'юнь', 'юс', 'ют', 'юхт', 'я', 'яв', 'яд', 'яз', 'язь', 'як', 'яка', 'якась', 'якби', 'яке', 'якесь', 'який', 'якийсь', 'яким', 'якими', 'якимись', 'якимось', 'якимсь', 'яких', 'якихось', 'якихсь', 'якого', 'якогось', 'якому', 'якомусь', 'якось', 'якою', 'якоюсь', 'якої', 'якоїсь', 'якраз', 'яку', 'якусь', 'якщо', 'які', 'якій', 'якійсь', 'якім', 'якімсь', 'якісь', 'ял', 'ям', 'ян', 'янь', 'яо', 'яп', 'ярл', 'ясь', 'ять', 'є', 'єр', 'єси', 'і', 'ібн', 'ід', 'із', 'із-за', 'із-під', 'іззаду', 'ізм', 'ізсередини', 'ік', 'ікс', 'ікт', \"ім'я\", 'імовірно', 'інакша', 'інакше', 'інакший', 'інакшим', 'інакшими', 'інакших', 'інакшого', 'інакшому', 'інакшою', 'інакшої', 'інакшу', 'інакші', 'інакшій', 'інакшім', 'інколи', 'іноді', 'інша', 'інше', 'інший', 'іншим', 'іншими', 'інших', 'іншого', 'іншому', 'іншою', 'іншої', 'іншу', 'інші', 'іншій', 'іншім', 'інь', 'іч', 'іще', 'ї', 'їдь', 'їй', 'їм', 'їх', 'їхнього', 'їхньому', 'їхньою', 'їхньої', 'їхню', 'їхня', 'їхнє', 'їхні', 'їхній', 'їхнім', 'їхніми', 'їхніх', 'її', 'ґ'];\n $stopwords = explode(',', 'а,без,более,бы,был,была,были,было,быть,в,вам,вас,весь,во,вот,все,всего,всех,вы,где,да,даже,для,до,его,ее,если,есть,еще,же,за,здесь,и,из,или,им,их,к,как,ко,когда,кто,ли,либо,мне,может,мы,на,надо,наш,не,него,нее,нет,ни,них,но,ну,о,об,однако,он,она,они,оно,от,очень,по,под,при,с,со,так,также,такой,там,те,тем,то,того,тоже,той,только,том,ты,у,уже,хотя,чего,чей,чем,что,чтобы,чье,чья,эта,эти,это,я,a,an,and,are,as,at,be,but,by,for,if,in,into,is,it,no,not,of,on,or,such,that,the,their,then,there,these,they,this,to,was,will,with');\n $stopwords = array_unique(array_merge($uaStopwords, $stopwords));\n $indexSettings['analysis']['filter'][$filter] = array(\n 'type' => 'stop',\n 'stopwords' => implode(',', $stopwords),\n );\n $stemmer = array('russian_morphology', 'english_morphology', 'my_stopwords');\n } elseif ($language == 'English') {\n $stemmer = 'kstem'; // less agressive than snowball\n } else {\n // Define snowball filter according to current language\n $stemmer = 'snowball';\n $indexSettings['analysis']['filter'][$stemmer] = array(\n 'type' => 'snowball',\n 'language' => $language,\n );\n }\n\n if (is_array($stemmer)){\n $languageFilters = array_merge($languageFilters, $stemmer);\n } else {\n $languageFilters []= $stemmer;\n }\n $languageFilters []= 'length';\n // Define a custom analyzer adapted to the store language\n $indexSettings['analysis']['analyzer']['language'] = array(\n 'type' => 'custom',\n 'tokenizer' => 'standard',\n 'char_filter' => 'html_strip', // strip html tags\n 'filter' => $languageFilters,\n );\n\n // Define stop words filter according to current language if possible\n $stopwords = strtolower($language);\n if (in_array($stopwords, $this->_stopLanguages)) {\n $indexSettings['analysis']['filter']['stop']['stopwords'] = '_' . $stopwords . '_';\n }\n }\n\n// foreach ($indexSettings['analysis']['analyzer'] as &$analyzer) {\n// array_unshift($analyzer['filter'], 'icu_folding');\n// }\n// unset($analyzer);\n\n $indexSettings = new Varien_Object($indexSettings);\n\n Mage::dispatchEvent('clean_elasticsearch_index_settings', array(\n 'client' => $this,\n 'store' => $store,\n 'settings' => $indexSettings,\n ));\n\n $indexSettings = $indexSettings->getData();\n\n if (Mage::app()->useCache('config')) {\n $lifetime = $this->getCacheLifetime();\n Mage::app()->saveCache(serialize($indexSettings), $cacheId, array('config'), $lifetime);\n }\n\n return $indexSettings;\n }",
"public function getAll()\n {\n return $this->mongoDbInstances;\n }",
"function db_get_all_index(){\n\n\t$db_request = db_exec(\"SELECT * FROM 'Index'\");\n\treturn db_json($db_request->fetchAll(PDO::FETCH_ASSOC)); \n}",
"public function getConfig()\n {\n return $this->retrieve(\n 'SELECT isys_nagios_config__key AS \"key\", isys_nagios_config__value AS \"value\" FROM isys_nagios_config WHERE isys_nagios_config__configfile_id = 1;'\n );\n }",
"public function getNodeBalancerConfigs()\n {\n return $this->apiSearch($this->endpoint.'/configs', ['class' => 'Node\\Balancer\\Config', 'parameters' => ['id']]);\n }",
"public function all() {\n\n\t\t// Create new database connection.\n\t\t$db = new Database;\n\n\t\t// Prepare the query statement.\n\t\t$query = $db->connection->prepare( 'SELECT * FROM ' . $db->prefix . 'settings' );\n\n\t\t// Execute the query.\n\t\t$query->execute();\n\n\t\treturn $query->fetchAll();\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Modificar datos de Paciente | public function modificar() {
$objDatos = new clsDatos();
$sql = "UPDATE paciente
SET id_geo = '$this->id_geo',
id_per = '$this->id_per',
oex_pac = '$this->oex_pac',
fre_pac = '$this->fre_pac',
cas_pac = '$this->cas_pac',
dir_pac = '$this->dir_pac',
ref_pac = '$this->ref_pac',
ofi_pac = '$this->ofi_pac',
dof_pac = '$this->dof_pac',
emi_pac = '$this->emi_pac',
fat_pac = '$this->fat_pac',
fis_pac = '$this->fis_pac',
est_pac = '$this->est_pac';";
$objDatos->ejecutar($sql);
$objDatos->crerrarconexion();
} | [
"public function modificar() {\n $objDatos = new clsDatos();\n $sql = \"UPDATE paciente_representante\n SET id_pre = '$this->id_pre',\n id_pac = '$this->id_pac',\n id_rep = '$this->id_rep',\n est_pre = '$this->est_pre'\n WHERE id_pre = '$this->id_pre';\";\n $objDatos->ejecutar($sql);\n $objDatos->crerrarconexion();\n }",
"public function modificar() {\n $objDatos = new clsDatos();\n $sql = \"UPDATE asigna_caso\n SET id_aca = '$this->id_aca',\n id_pac = '$this->id_pac',\n id_usu = '$this->id_usu',\n tip_aca = '$this->tip_aca',\n est_aca = '$this->est_aca';\";\n $objDatos->ejecutar($sql);\n $objDatos->crerrarconexion();\n }",
"public function modificar(){\n\t\t$objDatos = new clsDatos();\n\t\t$sql = \"UPDATE usuario SET(id_per='$this->id_per',id_car='$this->id_car',fot_usu='$this->fot_usu',nus_usu='$this->nus_usu',con_usu='$this->con_usu',ema_usu='$this->ema_usu',ffc_usu='$this->ffc_usu',est_usu='$this->est_usu')\";\n\t\t$objDatos->ejecutar($sql);\n\t\t$objDatos->crerrarconexion();\n\t}",
"public function modificar()\n\t{\n\t\t$personasModelo = new PersonasModelo();\t\n\t\t$personasModelo->ModificarPersona($this->personaID, $this->nombre, $this->apellido, $this->usuario,$this->password, $this->telefono, $this->email, $this->direccion, $this->direccionCoordenadas, $this->direccionDefault, $this->direccionTipo, $this->estado, $this->rolID, $this->documento, $this->agenciaID);\n\t\techo \" La persona con ID: \", $this->personaID . \" es la persona actualizada\";\t\t\n\t}",
"public function modificar()\n\t{\n\t\t$viajesModelo = new ViajesModelo();\n\t\t$viajesModelo->ModificarViaje($this->viajeID, $this->choferID, $this->vehiculoID, $this->tarifaID, $this->turnoID, $this->agenciaID, $this->personaID , $this->fechaEmision , $this->fechaSalida , $this->viajeTipo , $this->origenCoordenadas , $this->destinoCoordenadas , $this->origenDireccion , $this->destinoDireccion, $this->comentario, $this->importeTotal, $this->distancia, $this->estado);\n\t\techo \" El viaje con ID: \", $this->viajeID . \" ha sido actualizado. \";\n\t}",
"public function modificar(){\n\t\t$objDatos = new clsDatos();\n\t\t$sql = \"UPDATE usuario SET(id_car='$this->id_car',ced_usu='$this->ced_usu',pno_usu='$this->pno_usu',sno_usu='$this->sno_usu',pap_usu='$this->pap_usu',sap_usu='$this->sap_usu',fna_usu='$this->fna_usu',cel_usu='$this->cel_usu',tel_usu='$this->tel_usu',fot_usu='$this->fot_usu',nus_usu='$this->nus_usu',con_usu='$this->con_usu',ema_usu='$this->ema_usu',ffc_usu='$this->ffc_usu',est_usu='$this->est_usu')\";\n\t\t$objDatos->ejecutar($sql);\n\t\t$objDatos->crerrarconexion();\n\t}",
"public function modificar()\n\t{\n\t\t$agenciaModelo = new AgenciaModelo();\n\t\t$agenciaModelo->ModificarAgencia($this->agenciaID, $this->nombre, $this->direccion, $this->direccionCoordenadas, $this->telefono, $this->email, $this->estado);\n\t\techo \" La agencia con ID: \", $this->agenciaID . \" ha sido actualizada. \";\n\t}",
"final protected function modificarArticulo(){\n\t\tif($this->articulo != null){\n\t\t\tthrow new Exception('Articulo sin datos');\n\t\t}\n\t\tDataAccess::update($this->articulo);\t\n\t}",
"function modificarProveedor(){\n\n\t$ced=$this->objProveedor->getCedula();\n\t$nom=$this->objProveedor->getNombre();\n\t$tipo=$this->objProveedor->getTipoProveedor();\n\t$fechaReg=$this->objProveedor->getFechaRegistro();\n\t$fechaIn=$this->objProveedor->getFechaInactivo(); \n\t$image=$this->objProveedor->getImagen();\n\t$email=$this->objProveedor->getEmail();\n\t$tel=$this->objProveedor->getTelefono();\n\t$estado=$this->objProveedor->getEstado();\n\t$usuario=$this->objProveedor->getUsuario();\n\t$contrasena=$this->objProveedor->getContrasena();\n\t$nomTmp=$this->objProveedor->getNombreTmp();\n\t$imagenTmp=$this->objProveedor->getImagenTmp();\n\t$emailTmp=$this->objProveedor->getEmailTmp();\n\t$telTmp=$this->objProveedor->getTelefonoTmp();\n\n\t\n\t$objConexion = new ControlConexion();\n\t$objConexion->abrirBd($GLOBALS['serv'],$GLOBALS['usua'],$GLOBALS['pass'],$GLOBALS['bdat']);\n\t$comandoSql=\"UPDATE PROVEEDOR SET NOMBRE_TMP='\".$nomTmp.\"', TIPOPROVEEDOR='\".$tipo.\"',FECHAREGISTRO='\".$fechaRe.\"',IMAGEN_TMP='\".$imagenTmp.\"',\n\tEMAIL_TMP='\".$emailTmp.\"',TELEFONO_TMP='\".$telTmp.\"', CONTRASENA='\".$contrasena.\"' WHERE CEDULA='\".$ced.\"'\";\n\t\n\t$objConexion->ejecutarComandoSql($comandoSql);\n\t$objConexion->cerrarBd();\n}",
"public function modificar() {\n $objDatos = new clsDatos();\n $sql = \"UPDATE cronograma\n SET id_cro = '$objDatos->id_cro',\n fe1_cro = '$objDatos->fe1_cro',\n fe2_cro = '$objDatos->fe2_cro',\n fe3_cro = '$objDatos->fe3_cro',\n maq_cro = '$objDatos->maq_cro',\n cqu_cro = '$objDatos->cqu_cro',\n bar_cro = '$objDatos->bar_cro',\n est_cro = '$objDatos->est_cro'\";\n $objDatos->ejecutar($sql);\n $objDatos->crerrarconexion();\n }",
"public function modificar()\n\t{\n\t\t$vehiculoModelo = new VehiculosModelo();\n\t\t$vehiculoModelo->ModificarVehiculo($this->vehiculoID, $this->matricula, $this->modelo, $this->marca, $this->estado, $this->fechaAlta, $this->fechaBaja , $this->agenciaID);\n\t\techo \" El vehiculo con ID: \", $this->vehiculoID . \" ha sido actualizado. \";\n\t}",
"final public function modificarSeccion() {\n if ($this -> seccion == null) {\n throw new Exception('Seccion sin datos');\n }\n DataAccess::update($this -> seccion);\n }",
"public function modificar()\n {\n if ($this->id && $this->fecha && $this->hora && $this->estado) {\n $idAula = ($this->aula) ? $this->aula->getId() : \"NULL\";\n $consulta = \"UPDATE llamado SET fecha = '{$this->fecha}', hora = '{$this->hora}', \"\n . \"idAula = {$idAula}, estado = '{$this->estado}', fechaEdicion = NOW() \"\n . \"WHERE id = {$this->id}\";\n return Conexion::getInstancia()->modificar($consulta);\n }\n Log::guardar(\"INF\", \"LLAMADO --> MODIFICAR : CAMPOS INVALIDOS\");\n return array(0, \"Los campos no cumplen con el formato requerido\");\n }",
"public function modificar()\n\t{\n\t\t$tarifaModelo = new TarifasModelo();\n\t\t$tarifaModelo->ModificarTarifa($this->tarifaID, $this->comision, $this->agenciaID, $this->viajeMinimo, $this->kmMinimo, $this->precioKM, $this->estado);\n\t\techo \" La tarifa con ID: \", $this->tarifaID . \" ha sido actualizada. \";\n\t}",
"function modificarCreditosEspacio() {\n $this->crearArregloDatosEspacio();\n $resultadoPeriodo=$this->consultarPeriodoActivo();\n $ano=$resultadoPeriodo[0][0];\n $periodo=$resultadoPeriodo[0][1];\n\n $espacio=$this->buscarEspacio();\n if (is_array($espacio)&&$espacio[0][0]>0)\n {\n $this->actualizarCreditosEspacio();\n $creditos=$this->actualizarCreditosPlanEspacio();\n $this->actualizarCreditosAcpen();\n }else\n {\n $this->errorConexion();\n }\n\n $planOriginal=$this->datosEspacio['planEstudio'];\n $resultado_proyectos=$this->consultarPlanesEspacio();\n foreach ($resultado_proyectos as $key => $value) {\n $this->datosEspacio['planEstudio']=$value['PLAN'];\n\n $datosRegistro=array(usuario=>$this->usuario,\n evento=>'19',\n descripcion=>'Modifica Creditos Espacio Asesor',\n registro=>$ano.'-'.$periodo.', '.$this->datosEspacio['codEspacio'].', 0, 0, '.$this->datosEspacio['planEstudio'],\n afectado=>$this->datosEspacio['planEstudio']);\n\n $this->procedimientos->registrarEvento($datosRegistro);\n }\n $this->datosEspacio['planEstudio']=$planOriginal;\n\n $this->datosEspacio['pagina']=\"adminAprobarEspacioPlan\";\n $this->datosEspacio['opcion']=\"mostrar\";\n unset ($this->datosEspacio['action']);\n echo \"<script>alert('Los cr\\u00E9ditos y distribuci\\u00F3n horaria del Espacio Acad\\u00E9mico \".$this->datosEspacio['nombreEspacio'].\" se han modificado')</script>\";\n $retorno=$this->generarRetorno($this->datosEspacio);\n $this->retornar($retorno);\n }",
"public function modificar()\r\n {\r\n if ($this->id && $this->nombre && $this->sector) {\r\n $consulta = \"UPDATE aula SET nombre='{$this->nombre}', sector='{$this->sector}' WHERE id = {$this->id}\";\r\n return Conexion::getInstancia()->modificar($consulta);\r\n }\r\n Log::guardar(\"INF\", \"AULA --> MODIFICAR :CAMPOS INVALIDOS\");\r\n return array(0, \"Los campos recibidos para modificar el aula no cumplen con el formato requerido\");\r\n }",
"public function modificar_datos_propiedad(){\n $nombre= $_POST['nombre'];\n\t\t\t\t\t$lugar= $_POST['lugar'];\n $monto_normal = 0;\n\t\t\t\t\t$id= $_GET['id'];\n\t\t\t\t\t$chequear_nombre_repetido = false;\n\t\t\t\t\t$propiedad_actual = self::getInstance()-> buscar_propiedad_by_id($id);\n\t\t\t\t\t$nombre_propiedad_actual = $propiedad_actual->getNombre();\n\t\t\t\t\tif(!($nombre_propiedad_actual == $nombre)){\n\t\t\t\t\t\t$chequear_nombre_repetido = self::getInstance()-> nombre_repetido($nombre);\n\t\t\t\t\t}\n\t\t\t\t\tif($chequear_nombre_repetido){\n\t\t\t\t\t\t$mensaje = \"Se produjo un error y no se pudo agregar la propiedad. El nombre elegido ya esta en uso\";\n\t echo \"<script>\";\n\t echo \"alert('$mensaje');\";\n\t echo \"</script>\";\n\t return false;\n\t\t\t\t\t}\n\t\t\t\t\t$tieneFoto = 0;\n\t\t\t\t\tif(!empty($_FILES[\"imagen\"][\"name\"])){\n\t $archivo = $_FILES['imagen']['tmp_name'];\n\t $destino = \"img_propiedades/\". $_FILES['imagen']['name'];\n\t move_uploaded_file($archivo,$destino);\n\t\t\t\t\t\t\t$tieneFoto = 1;\n\t }\n\t\t\t\t\t\tif($tieneFoto == 1){\n\t\t\t\t\t\t\t\tself::getInstance() -> queryAll(\"INSERT INTO foto_propiedad (id_propiedad,destino) VALUES ('{$id}', '{$destino}')\");\n\t\t\t\t\t\t\t\t$mensaje = \"Foto agregada exitosamente\";\n\t\t\t\t\t\t\t}\n\n\n self::getInstance()->queryAll(\"UPDATE propiedad SET nombre='{$nombre}', monto_normal='{$monto_normal}', lugar='{$lugar}' WHERE id = '{$id}'\");\n $mensaje = \"La operacion ha sido realizada con exito.\";\n echo \"<script>\";\n echo \"alert('$mensaje');\";\n echo \"</script>\";\n\n }",
"public function alterarPrato(){\n $conexao = new conexao;\n\n if(isset($_POST['id'], $_POST['nome'], $_POST['preco'], $_POST['descricao'])){\n $id = $_POST['id'];\n $nome = $_POST['nome'];\n $preco = $_POST['preco'];\n $descricao = $_POST['descricao'];\n\n\n try {\n\n $sql = \"UPDATE cardapio SET nome = '{$nome}', \n preco = '{$preco}', \n descricao = '{$descricao}' \n WHERE id = '{$id}'\";\n \n\n $stmt = $this->pdo->prepare($sql);\n $stmt->execute(); \n\n echo \"<br><br><br><p>Dados do prato atualizados com sucesso </p>\";\n }\n catch(PDOException $e) {\n echo '<p> Error </p>: ' . $e->getMessage();\n }\n }else{\n echo \"<p> Algum dado está faltando. TENTE NOVAMENTE </p>\";\n }\n }",
"public function editarComent(){\n\t\t \n$sql=\"Update usuarios set id_usuario=$this->id_usuario,observaciones='$this->observaciones' where id_usuario=\".$this->id_usuario;\n\t\t $this->con->query($sql);\n\t\t \n\t\t \n\t\t }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for sspsVendorsGet All Vendors for current ssp user. Only For Admins. | public function testSspsVendorsGet()
{
} | [
"public function getVendors()\n {\n $this->db->select(\"*\")\n ->where(\"role_id\", 2)\n ->order_by(\"user_id\",\"DESC\")\n ->from(\"users\");\n\n $query = $this->db->get();\n\n $result = $query->result();\n\n return $result;\n }",
"public function getAllVendors()\n { \n $vendors = $this->vendor::where('is_deleted',0)->get();\n return $vendors;\n }",
"public function vendorsList($user)\n {\n return User::whereSlug($user)->first()->vendors_list;\n }",
"public function getVendorList(){\n $vendors = [];\n $this->_buildLimit();\n $vendorIds = $this->_request->getParam(self::VENDOR_IDS);\n $postData = $this->_request->getContent();\n if ($postData) {\n $postData = json_decode($postData, true);\n if (isset($postData[self::VENDOR_IDS]) && $postData[self::VENDOR_IDS]) {\n $vendorIds = $postData[self::VENDOR_IDS];\n }\n }\n if ($this->_collection) {\n if ($vendorIds) {\n $vendor_ids = explode(',', $vendorIds);\n if (count($vendor_ids)) {\n $this->_collection->addFieldToFilter('entity_id', array('FINSET', $vendor_ids));\n }\n }\n // $this->_collection->getSelect()->joinLeft(\n // ['vendor_config' => $this->_collection->getTable('ves_vendor_config')],\n // 'vendor_config.vendor_id = e.entity_id AND vendor_config.store_id = 0 AND vendor_config.path = \"general/store_information/logo\"',\n // ['vendor_config.value AS logo']\n // );\n foreach ($this->_collection as $vendor) {\n $vendorData = $vendor->toArray();\n $vendorData['logo'] = $this->getLogoUrl($vendor->getId());\n $vendorData['profile'] = $this->vendorHelper->getProfile($vendor->getId());\n $vendors[] = $vendorData;\n }\n }\n if (!count($vendors)) {\n return false;\n }\n return $vendors;\n }",
"public function testDestiny2GetPublicVendors()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function actionVendors() \n {\n //check if products should be added to cart\n if(isset($_POST['addToCart']) && is_numeric($_POST['addToCart']))\n {\n $this->addToCart($_POST['addToCart']);\n }\n\n //fetch all vendors from database\n $vendors = Vendor::find('', 'vendorName ASC');\n\n //fetch three random products for each vendor\n $vendorProducts = [];\n $db = $GLOBALS['database'];\n foreach($vendors as $key => $vendor)\n {\n $vendorProducts[$key] = Product::findRange(0,3,'vendorsID = ' . $db->quote($vendor->id) . ' AND isHidden=0', 'RAND()');\n \n }\n\n $this->setParam('vendors', $vendors);\n $this->setParam('vendorProducts', $vendorProducts);\n $this->setPositionIndicator(Controller::POSITION_PRODUCTS);\n }",
"function queryViewAllVendors(){\n#\t$query = \"select * from vendor_vendor vv, country_country cc where vv.vc_id = cc.vc_id and vv.vs_id = 1 order by v_name;\";\n\t$query = \"select * from vendor_vendor where vs_id = 1 order by v_name;\";\n\n\treturn $query;\n}",
"public function sspsVendorsGet()\n {\n list($response) = $this->sspsVendorsGetWithHttpInfo();\n return $response;\n }",
"public static function get_all_vendor_data( $user_id = null ) {\n\t\t// if param not passed use current user\n\t\tif ( null === $user_id ) {\n\t\t\t$current_user = wp_get_current_user();\n\n\t\t\t$user_id = $current_user->ID;\n\t\t}\n\n\t\t$terms = get_terms( WC_PRODUCT_VENDORS_TAXONOMY, array( 'hide_empty' => false ) );\n\n\t\t$vendor_data = array();\n\n\t\t$vendors = array();\n\n\t\tif ( ! is_array( $terms ) ) {\n\t\t\treturn $vendors;\n\t\t}\n\n\t\t// loop through to see which one has assigned passed in user\n\t\tforeach ( $terms as $term ) {\n\t\t\t$vendor_data = get_term_meta( $term->term_id, 'vendor_data', true );\n\n\t\t\tif ( ! empty( $vendor_data['admins'] ) ) {\n\t\t\t\tif ( version_compare( WC_VERSION, '3.0.0', '>=' ) && is_array( $vendor_data['admins'] ) ) {\n\t\t\t\t\t$admin_ids = array_map( 'absint', $vendor_data['admins'] );\n\t\t\t\t} else {\n\t\t\t\t\tif ( is_array( $vendor_data['admins'] ) ) {\n\t\t\t\t\t\t$admin_ids = array_filter( array_map( 'absint', $vendor_data['admins'] ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$admin_ids = array_filter( array_map( 'absint', explode( ',', $vendor_data['admins'] ) ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( in_array( $user_id, $admin_ids ) ) {\n\t\t\t\t\t$vendor_data['term_id'] = $term->term_id;\n\t\t\t\t\t$vendor_data['name'] = $term->name;\n\t\t\t\t\t$vendor_data['slug'] = $term->slug;\n\t\t\t\t\t$vendor_data['term_group'] = $term->term_group;\n\t\t\t\t\t$vendor_data['term_taxonomy_id'] = $term->term_taxonomy_id;\n\t\t\t\t\t$vendor_data['taxonomy'] = $term->taxonomy;\n\t\t\t\t\t$vendor_data['description'] = $term->description;\n\t\t\t\t\t$vendor_data['parent'] = $term->parent;\n\t\t\t\t\t$vendor_data['count'] = $term->count;\n\n\t\t\t\t\t$vendors[ $term->term_id ] = $vendor_data;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $vendors;\n\t}",
"function _vendorCompanyList(){\n $this->resetResponse();\n if ($this->ci->session->userdata('user_id') != null) {\n $archived = $this->ci->input->post('archived', true);\n\n $result = $this->model->getVendorCompany('*', array(\"person_type\" => Globals::PERSON_TYPE_VENDOR))->result();\n if ($result) {\n $this->_status = true;\n $this->_message = '';\n $this->_rdata = $result;\n\n } else {\n $this->_status = false;\n $this->_message = $this->ci->lang->line('no_records_found');\n }\n \n } else {\n $this->_status = false;\n $this->_message = $this->ci->lang->line('invalid_user');\n \n }\n\n return $this->getResponse();\n }",
"public function getVendors()\n {\n return Vendor::find()->hasOrder($this->owner)->all();\n }",
"function canViewVendors()\n{\n return isUser() || isSuper() || isTrans() || isAdmin();\n}",
"public function vendors(){\n $data = array();\n $query = $this->db->query(\"SELECT id,company_name,cp_name FROM vendors\");\n foreach ($query->result_array() as $row){\n $data[] = $row;\n }\n return $data;\n }",
"public function actionTestVendors()\n {\n $searchModel = new TestVendorsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('test-vendors', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function get_vendors() {\n // Connect to database\n $database = new db;\n $db = $database->connect();\n $sql = 'SELECT id, vendor FROM vendors ORDER BY vendor ASC';\n $query = $db->prepare($sql);\n $query->execute();\n $results = $query->fetchAll(PDO::FETCH_ASSOC);\n $db = NULL;\n return $results;\n }",
"public function getAllSuppliers()\n {\n $qbo = $this->container->get(\"numa.quickbooks\")->init();\n\n $VendorService = new \\QuickBooks_IPP_Service_Vendor();\n\n $qbVendors = $VendorService->query($qbo->getContext(), $qbo->getRealm(), \"SELECT * FROM Vendor ORDER BY CompanyName \");\n\n return $qbVendors;\n }",
"public function UpdateVendors()\n\t{\n\t\t$data = array();\n\t\t$query = \"\n\t\t\tSELECT vendorid, vendorname, vendorfriendlyname, vendorshipping\n\t\t\tFROM [|PREFIX|]vendors\n\t\t\";\n\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\twhile($vendor = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t$data[$vendor['vendorid']] = $vendor;\n\t\t}\n\n\t\treturn $this->Save('Vendors', $data);\n\t}",
"public function index(){\n\n //get all vendors form database \n $vendors = Vendor::selection()->paginate(PAGINATION_COUNT);\n\n // go to view 'admin.vendors.index' and send all vendors\n return view('admin.vendors.index',compact('vendors'));\n }",
"function dokan_get_all_vendor_staffs( $args ) {\n $defaults = array(\n 'number' => 10,\n 'offset' => 0,\n 'vendor_id' => get_current_user_id(),\n 'orderby' => 'registered',\n 'order' => 'desc',\n );\n\n $args = wp_parse_args( $args, $defaults );\n\n $args['role'] = 'vendor_staff';\n $args['meta_query'] = array(\n array(\n 'key' => '_vendor_id',\n 'value' => $args['vendor_id'],\n 'compare' => '=',\n ),\n );\n\n $user_search = new WP_User_Query( $args );\n $staffs = $user_search->get_results();\n return array(\n 'total_users' => $user_search->total_users,\n 'staffs' => $staffs,\n );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetchs some information about the given object's child concepts. | function si_exhibition_get_child_concept_info(FedoraObject $object) {
$repo = si_exhibition_get_repo();
$query = si_exhibition_generate_child_concept_query($object->id);
$results = $repo->ri->itqlQuery($query);
$children = array_map(function($o) { return array('pid' => $o['o']['value'], 'label' => $o['t']['value'], 'count' => $o['k0']['value']); }, $results);
// @todo replace the checks for each objects existance once we have the appropriate information in the rels to determine if its accessible.
return array_filter($children, 'si_exhibition_check_object_info_accessible');
} | [
"function si_exhibition_get_child_concept_info(FedoraObject $object) {\n return si_exhibition_get_child_concept_info_by_id($object->id);\n}",
"function sidora_get_child_concepts(AbstractObject $object) {\n $out = array();\n $child_concepts = 'count(select $child from <#ri> where\n $concept <fedora-rels-ext:hasConcept> $child and\n $child <fedora-model:state> <fedora-model:Active>)';\n $child_resources = 'count(select $child from <#ri> where\n $concept <fedora-rels-ext:hasResource> $child and\n $child <fedora-model:state> <fedora-model:Active>)';\n $count = $child_concepts . ' ' . $child_resources;\n $query = 'select $concept $label $model $created ' . $count . ' from <#ri> where\n <info:fedora/' . $object->id . '> <fedora-rels-ext:hasConcept> $concept and\n $concept <fedora-model:state> <fedora-model:Active> and\n $concept <fedora-model:label> $label and\n $concept <fedora-model:createdDate> $created and\n $concept <fedora-model:hasModel> $model\n minus $model <mulgara:is> <info:fedora/si:conceptCModel>\n minus $model <mulgara:is> <info:fedora/fedora-system:FedoraObject-3.0>';\n $results = $object->repository->ri->query($query, 'itql');\n foreach ($results as $result) {\n $pid = $result['concept']['value'];\n $out[$pid]['pid'] = $pid;\n $out[$pid]['label'] = $result['label']['value'];\n $out[$pid]['num_concepts'] = (int) $result['k0']['value'];\n $out[$pid]['num_resources'] = (int) $result['k1']['value'];\n $out[$pid]['num_children'] = (int) $result['k0']['value'] + $result['k1']['value'];\n $out[$pid]['models'][] = $result['model']['value'];\n }\n return $out;\n}",
"function si_exhibition_get_child_concept_info_by_id($object_id) {\n //Start cache check for return\n $cache_name = 'child_concept_info';\n $cache_index = $object_id;\n $to_return = si_exhibition_cache($cache_name,$cache_index);\n if (!empty($to_return)){ return $to_return; }\n si_exhibition_cron_cache(__FUNCTION__, func_get_args());\n //End cache\n\n $repo = tuque_wrapper_get_repository_instance();\n si_exhibition_debug('repo from si_exhibition_get_child_concept_info');\n $query = si_exhibition_generate_child_concept_query($object_id);\n $results = $repo->ri->sparqlQuery($query);\n $children = array_map(function($o) { return array('pid' => $o['o']['value'], 'label' => $o['t']['value'], 'count' => $o['k0']['value']); }, $results);\n // @todo replace the checks for each objects existance once we have the appropriate information in the rels to determine if its accessible.\n if (variable_get('si_exhibition_anonymous_only', FALSE)){\n $children = array_filter($children, function($elem){\n return si_exhibition_check_view_permission($elem['pid']);\n });\n }\n $children = array_filter($children, 'si_exhibition_check_object_info_accessible');\n\n $to_return = $children;\n return si_exhibition_cache($cache_name, $cache_index, $to_return);\n}",
"function si_exhibition_get_child_resource_info(FedoraObject $object, $type = 'all', $sort = 'asc', $limit = NULL, $offset = NULL) {\n $resource_types = array(\n 'all' => array(),\n 'images' => array('si:imageCModel', 'si:generalImageCModel'),\n 'pdf' => array('si:fieldbookCModel'),\n 'csv' => array('si:datasetCModel'),\n 'text' => FALSE,\n 'video' => FALSE\n );\n $resource_types = isset($resource_types[$type]) ? $resource_types[$type] : FALSE;\n if ($resource_types !== FALSE) {\n $repo = si_exhibition_get_repo();\n $query = si_exhibition_generate_child_resource_query($object->id, $resource_types, $sort, $limit, $offset);\n $results = $repo->ri->itqlQuery($query);\n $resources = array_map(function($o) { return array('pid' => $o['o']['value'], 'label' => $o['t']['value']); }, $results);\n // @todo replace the checks for each objects existance once we have the appropriate information in the rels to determine if its accessible.\n $resources = array_filter($resources, 'si_exhibition_check_object_info_accessible');\n foreach ($resources as $key => &$resource) { // Add additional info\n $object = $repo->getObject($resource['pid']); // We know it exists from the previous filter call.\n $resource['models'] = $object->models;\n try {\n foreach ($object as $dsid => $datatream) {\n $resource['datastreams'][] = $dsid;\n }\n } catch(Exception $e) { unset($resources[$key]); } // Ignore when we can't access a resources datastream.\n }\n return $resources;\n }\n return array();\n}",
"function si_exhibition_get_child_resource_info(FedoraObject $object, $type = 'all', $sort = 'asc', $limit = NULL, $offset = NULL) {\n return si_exhibition_get_child_resource_info_by_id($object->id, $type, $sort, $limit, $offset);\n}",
"public function getConcepts();",
"public function getSubConcept($id)\n {\n }",
"function metrodora_compound_child_metadata(AbstractObject $object) {\n module_load_include('inc', 'islandora', 'includes/metadata');\n $children = islandora_compound_object_get_parts($object);\n $pid = (!empty($children)) ? $children[0] : $object->id;\n $compound_object = islandora_object_load($pid);\n return array(\n 'metadata' => array(\n '#markup' => islandora_retrieve_metadata_markup($compound_object, TRUE),\n ),\n );\n}",
"function si_exhibition_generate_child_concept_query($pid) {\n $count = 'count(select $c from <#ri> where\n $o <fedora-rels-ext:hasConcept> $c and\n $c <fedora-model:state> <fedora-model:Active>)';\n return 'select $o $t ' . $count . ' from <#ri> where\n $o <fedora-model:state> <fedora-model:Active> and\n $o <fedora-model:label> $t and\n <info:fedora/' . $pid . '> <fedora-rels-ext:hasConcept> $o\n order by $t';\n}",
"function sidora_get_child_resources(AbstractObject $object, array $params = array(), &$count = NULL) {\n $out = array();\n $default_params = array(\n 'filter' => '',\n 'start' => 0,\n 'limit' => NULL,\n 'sort' => 'pid',\n 'dir' => 'ASC',\n );\n $params = array_merge($default_params, $params);\n $limit = isset($params['limit']) ? \"LIMIT {$params['limit']}\" : '';\n $order = '';\n if (!empty($params['sort'])) {\n $order = \"ORDER BY {$params['dir']}(?{$params['sort']})\";\n }\n $filter = '';\n if (!empty($params['filter'])) {\n foreach ($params['filter'] as $properties) {\n $field = $properties['field'];\n switch ($properties['type']) {\n case 'string':\n $value = preg_quote($properties['value'], '/');\n $filter .= \"FILTER(regex(?{$field}, '^.*{$value}.*', 'i'))\\n\";\n break;\n\n case 'datetime':\n $op = $properties['comparison'];\n $value = explode(' ', $properties['value']);\n $date = $value[0];\n $time = $value[1];\n $filter .= \"FILTER(?{$field} {$op} xsd:dateTime('{$date}T{$time}Z'))\\n\";\n break;\n }\n }\n }\n $query = \"SELECT ?pid ?label ?model ?created FROM <#ri> WHERE {\n <info:fedora/{$object->id}> <fedora-rels-ext:hasResource> ?pid .\n ?pid <fedora-model:state> <fedora-model:Active>;\n <fedora-model:label> ?label;\n <fedora-model:hasModel> ?model;\n <fedora-model:createdDate> ?created.\n {$filter}\n FILTER(!sameTerm(?model, <info:fedora/fedora-system:FedoraObject-3.0>) &&\n !sameTerm(?model, <info:fedora/si:resourceCModel>))\n }\n {$order}\n OFFSET {$params['start']}\n {$limit}\";\n $results = $object->repository->ri->query($query, 'sparql');\n if ($count === NULL) {\n $count = $object->repository->ri->countQuery($query, 'sparql');\n }\n foreach ($results as $result) {\n $pid = $result['pid']['value'];\n $out[$pid]['pid'] = $pid;\n $out[$pid]['label'] = $result['label']['value'];\n $out[$pid]['created'] = $result['created']['value'];\n $out[$pid]['models'][] = $result['model']['value'];\n }\n return $out;\n}",
"public function getConcept()\n {\n return $this->concept;\n }",
"public function getRelationshipsInclusionMeta();",
"public function getConcepts()\n {\n return $this->concepts;\n }",
"function loadConcepts()\n{\n\t$q = Doctrine_Query::create()\n\t\t->select('e.id, e.name')\n\t\t->from('Concept e')\n\t\t->where('e.run_id = ?', $_SESSION['run_id']);\n\t\n\t$theConcepts = $q->fetchArray();\n\t\n\t// adjust the concepts from db \n\tforeach($theConcepts as $concept)\n\t{\n\t\t$theConceptsF[$concept['id']] = $concept['name'];\n\t}\n\t\n\treturn $theConceptsF;\n}",
"public function getChildren(SeaMistObject $object);",
"public function getChildHobbies();",
"function getSuperAndSubclasses($OntologyConcept = '') {\r\n\t\t$conceptid = $OntologyConcept->getId();\r\n\t\tif(!is_numeric($conceptid) || empty($conceptid))\r\n\t\t\treturn false;\r\n\t\t\r\n\t\t//Get properties on both sides\r\n\t\t$getRelatedQuery = \"SELECT * FROM subclassof WHERE subclass = $conceptid OR superclass = $conceptid\";\r\n\t\t\r\n\t\r\n\t\t$result = mysql_query($getRelatedQuery);\r\n\t\twhile($assoc = mysql_fetch_assoc($result)) {\r\n\t\t\t\tif($conceptid == $assoc['subclass']) {\r\n\t\t\t\t\t$ontconcept = $this->getConceptByID($assoc['superclass']);\r\n\t\t\t\t\t$superClasses[] = $ontconcept;\r\n\t\t\t\t}\r\n\t\t\t\telseif($conceptid == $assoc['superclass']) {\r\n\t\t\t\t\t$ontconcept = $this->getConceptByID($assoc['subclass']);\r\n\t\t\t\t\t$subClasses[] = $ontconcept;\r\n\t\t\t\t} \r\n\t\t}\r\n\t\t$return['subclasses'] = $subClasses;\r\n\t\t$return['superclasses'] = $superClasses;\r\n\t\treturn $return;\r\n\t}",
"public function concepts()\n {\n return $this->belongsToMany('C2Y\\Concept', 'concepts_lessons');\n }",
"function conceptos($id) {\n\t\t$this->Convenio->contain(array('Concepto'));\n\t\t$this->data = $this->Convenio->read(null, $id);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ $sql="SELECT m.id, m.idpagina, m.titulo, m.descripcion, c.id idp, c.texto, c.nombre FROM public.contenido c INNER JOIN public.pagina m ON c.idpagina=m.id WHERE m.titulo=:titulo"; $content = DB::select($sql, ["titulo"=>$texto])>get(); | public static function getPageMenu($texto) {
$content = DB::table('contenido')->select('pagina.*', 'contenido.*')
->join('pagina', 'pagina.id', '=', 'contenido.idpagina')
->where('pagina.descripcion', $texto)
//->where('albums.status',1)
->first();
return $content;
} | [
"public function select($convenio);",
"public function ListaAsiganciondeBusModelo(){\n $stmt = Conexion::Conectar()->prepare(\"SELECT asignarbus.idAsignacion,conductor.ci,conductor.nom,conductor.ape_pater,bus.placa FROM asignarbus INNER JOIN conductor ON asignarbus.idConductor=conductor.idConductor INNER JOIN bus ON asignarbus.idBus=bus.idBus\");\n $stmt -> execute();\n return $stmt -> fetchAll();\n $stmt -> close();\n $stmt = null;\n\n}",
"public function procedura($query){\n $treno=Treno::where(\"ID\",$query)->first(); \n return Carrozza::where(\"Codice_carrozza\",$treno->Cabina_montata)->get(); \n \n /*Carrozza::select(\"Carrozza.Nome\")->join(\"Treno\",\"Codice_carrozza\",\"=\",\"Cabina_montata\")->where(\"Treno.ID=$query)->get()*/\n }",
"public function mostrarPagos()\n {\n //FROM detalles_pagos \n //JOIN pagos, motociclistas, productos\n //WHERE detalles_pagos.id_pago = pagos.id_pago\n //AND pagos.id_motociclista = motociclistas.id_motociclista\n //AND detalles_pagos.id_producto = productos.id_producto\n //GROUP by detalles_pagos.id_pago\n //ORDER by detalles_pagos.id_pago');\n\n $pagos = DB::table('pagos')\n ->join('detalles_pagos', 'detalles_pagos.id_pago', '=', 'pagos.id_pago')\n ->join('motociclistas', 'pagos.id_motociclista', '=', 'motociclistas.id_motociclista')\n ->join('modo_pagos', 'pagos.id_modopago','=','modo_pagos.id_modopago')\n ->select('detalles_pagos.id_detalle', 'detalles_pagos.id_pago','pagos.fecha', 'modo_pagos.name as modopago', 'motociclistas.name', 'motociclistas.ap', 'motociclistas.am')\n ->GROUPby('detalles_pagos.id_pago')\n ->ORDERby('detalles_pagos.id_pago')\n ->get();\n\n return view(\"admin.Pagos\",compact('pagos'));\n }",
"public function select($movimiento);",
"public function returneazaContinut(){\n $pagina = ORM::factory(\"Pagina\")\n //->where('meniu', '=', '4')\n ->where('cheie', '=' , $this->cheie)\n ->find();\n return $pagina; \n }",
"public function EjemplaresUno($conn,$id_libro,$ejemplar){\n$sql=\"select e.*,l.titulo \nfrom biblio.ejemplares e\ninner join biblio.libro l on l.id_libro = e.id_libro \nwhere l.id_libro=$id_libro and codigo = $ejemplar\";\n$result = pg_exec($conn,$sql);\n\t\t\n\t\treturn $result;\n}",
"function select_carte()\n {\n $requete = $this->db->query(\"\n select carte.*, metier.metier as nom_metier\n from carte\n join metier on carte.id_metier = metier.id\n order by description asc\n \");\n return $requete->result();\n }",
"public function SelectConteudo()\n\t{\n\t\treturn TableFactory::getInstance('Dicas')->SelectDicas();\n\t}",
"public function juegosInteractuados($alias){\n $juegos = DB::table(\"juego\")\n ->select('juego.id','titulo','caratula','tipo','descripcion','flanzamiento')\n ->leftJoin('valoracion', 'juego.id', '=', 'valoracion.idjuego', 'left outer')\n ->leftJoin('comentario', 'juego.id', '=', 'comentario.idjuego', 'left outer')\n ->rightJoin('usuario', function($join){\n $join->on('usuario.id','=','valoracion.idusuario');\n $join->orOn('usuario.id','=','comentario.idusuario');\n })\n ->groupBy('juego.id')\n ->where('usuario.alias',$alias)\n ->get();\n \n \n return response()->json($juegos,200);\n }",
"function getnotatag($busqueda)\n\n{\n\n $this->db->limit(4,1);\n $query = $this->db->query(\"select n.titulo,e.texto from nota n,nota_etiqueta ne,etiqueta e where n.id_libreta = $busqueda and n.id_nota = ne.fk_nota and ne.fk_etiqueta = e.id_etiqueta;\");\n return $query->result();\n \n }",
"function buscar(){\n $sql=\"SELECT id_venta,fecha,cliente,dni,total, CONCAT(usuario.nombre_us,' ',usuario.apellidos_us) as vendedor FROM venta join usuario on vendedor=id_usuario\";\n $query = $this->acceso->prepare($sql);\n $query->execute();\n $this->objetos=$query->fetchall();\n return $this->objetos;\n }",
"function SqlDetailSelect() { // Select\n\t\treturn \"SELECT * FROM `trabajos`\";\n\t}",
"function obter_projetos_por_area_turno_categoria($dados){\n global $DB; \n \n $projeto = $DB->get_records_sql(\"\n SELECT \n sp.id_projeto,\n sp.cod_projeto,\n sp.titulo,\n sp.resumo,\n sp.email,\n sp.tags,\n sp.cod_periodo,\n sp.turno,\n sp.aloca_mesa \n FROM mdl_sepex_projeto sp \n WHERE sp.area_curso = ? AND sp.turno = ? AND sp.cod_categoria = ?\", array($dados->area_curso, $dados->turno, $dados->cod_categoria));\n return $projeto;\n}",
"public function consulta()\n\t{\n\n\t\t//$users = $orders_this_month;\n\n\t\t//$fecha_entrada = strtotime(\"19-11-2008 21:00:00\")\n\t\t$nuevafecha = '2015-08-07';\n\n\t\t//dd($nuevafecha);\n\n\t\t//$pagos = \\DB::table('pagos')\n // ->whereBetween('fecha_actual_del_pago', array($nuevafecha, $nuevafecha))->get();\n\n\n $pagos = \\DB::table('users')\n ->join('pagos', 'users.id', '=', 'pagos.id_usuario')\n ->select('pagos.id','pagos.monto','users.nombre','users.apellido1','users.imagen')\n ->whereBetween('pagos.fecha_actual_del_pago', array($nuevafecha, $nuevafecha))\n ->get();\n\t\t\t\t\n\n\t\treturn $pagos;\n\t}",
"function afficheMedia($idMedia, $bdd){\n $conditions = \"WHERE `m`.`id` = :idMedia\";\n $sql = \"SELECT\n `m`.`id`,`m`.`utilisateur_id`, `m`.`titre`, `m`.`dateCreate`, `m`.`resume`, \n CONCAT(`a`.`prenom`, ' ', `a`.`nom`) AS `prenomNom`, `a`.`id` AS `idAuteur`\n \n FROM \n `media` `m` LEFT JOIN \n `auteur_media` `am` ON `m`.`id` = `am`.`idmedia` LEFT JOIN \n `auteur` `a` ON `am`.`idauteur` = `a`.`id` \" . $conditions;\n $response = $bdd->prepare( $sql);\n $response->execute(array( \"idMedia\" => htmlspecialchars( addslashes( $idMedia) ) ) );\n return $response;\n}",
"public function listarRecibidos()\n\n {\n\n \n\n $listar = $this->db->prepare(\"select inventario.id,inventario.consecutivo_acta,inventario.fecha_acta,pa_juzgado.nombre,inventario.responsable,inventario.enero,\ninventario.febrero,inventario.marzo,inventario.abril,inventario.mayo,inventario.junio,inventario.julio,inventario.agosto,\ninventario.septiembre,inventario.octubre,inventario.noviembre,inventario.diciembre, inventario.ano_archivar, inventario.cantidad_expedientes, inventario.cantidad_cajas,inventario.nombre_entrega,inventario.nombre_recibe, inventario.idestado_acta\nfrom inventario \ninner join pa_juzgado ON (inventario.idjuzgado=pa_juzgado.id)\nWhere inventario.idtipoinventario=1\");\n\n $listar->execute();\n\n return $listar;\n\n \n\n }",
"function select_messages_envoyes($select, $expediteur) {\n $req = Database::get()->prepare_execute(\"SELECT :select FROM message WHERE expediteur = :expediteur\",\n array(\n 'select' => $select,\n 'expediteur' => $expediteur\n ));\n return $req;\n}",
"function buscarContratosConServicio($idServicio)\n{\n $util = new util();\n return $util->selectWhere3('contratos,contratos_lineas',\n array(\"contratos_lineas.id,contratos_lineas.id_contrato\"),\n \"contratos_lineas.estado=1 AND contratos.id=contratos_lineas.id_contrato AND contratos.id_empresa=\".$_SESSION['REVENDEDOR'].\" AND contratos_lineas.id_tipo=2 AND contratos_lineas.id_asociado=\".$idServicio);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests if course offering administrative service is supported. | public function supportsCourseOfferingAdmin() {
return $this->manager->supportsCourseOfferingAdmin();
} | [
"public function supportsCourseOfferingSearch() {\n \treturn $this->manager->supportsCourseOfferingSearch();\n\t}",
"public function supportsCourseOfferingLookup() {\n \treturn $this->manager->supportsCourseOfferingLookup();\n\t}",
"public function supportsCourseOfferingCatalog() {\n \treturn $this->manager->supportsCourseOfferingCatalog();\n\t}",
"public function supportsCourseCatalogAdmin() {\n \treturn $this->manager->supportsCourseCatalogAdmin();\n\t}",
"public function isAdminSupported();",
"public function supportsCourseOfferingCatalogAssignment() {\n \treturn $this->manager->supportsCourseOfferingCatalogAssignment();\n\t}",
"public function supportsCourseOfferingQuery() {\n \treturn false;\n }",
"function api_is_course_admin() {\n if (api_is_platform_admin()) {\n return true;\n }\n return Session::read('is_courseAdmin');\n}",
"public function isAdministrative()\n {\n return $this->isadministrative == 1;\n }",
"public function supportsCourseOfferingNotification() {\n \treturn $this->manager->supportsCourseOfferingNotification();\n\t}",
"public function hasAdministrativePrivileges() {\n return $this->hasRole( Roles::UT_ADMINISTRATIVE );\n }",
"public function hasGuestSupport();",
"protected function should_show_wc_admin()\n {\n }",
"public function supportsCourseOfferingHierarchy() {\n \treturn $this->manager->supportsCourseOfferingHierarchy();\n\t}",
"public static function is_admin()\n {\n return current_user_can(RP_WCDPD::get_admin_capability());\n }",
"public function isAvailableInFrontend();",
"function bp_is_course_admin_page() {\n\tif ( bp_is_course_single_item() && bp_is_course_component() && bp_is_current_action( 'admin' ) )\n\t\treturn true;\n\n\treturn false;\n}",
"public function isAdministrativeUser()\r\n\t{\r\n\t\treturn $this->hasPrivilege(Auth::RESTRICTED_USER_EDIT) ||\r\n\t\t\t$this->hasPrivilege(Auth::PROCESS_MANAGE);\r\n\t}",
"public function supportsCourseOfferingHierarchyDesign() {\n \treturn $this->manager->supportsCourseOfferingHierarchyDesign();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Defined by FilterInterface Decompresses the content $value with the defined settings | public function filter($value)
{
if (! is_string($value) && $value !== null) {
return $value;
}
return $this->getAdapter()->decompress($value);
} | [
"public function filter($value)\n {\n $value = $this->getReplacer()->replace($value, false);\n\n return $value;\n }",
"protected function _sanitize($value, $filter){ }",
"public function filter($value);",
"public function reverseTransform($value)\n {\n }",
"public function _compress($value) {}",
"public function decompress($value);",
"public function filterValue($value, $filter);",
"public function sanitize($value, $filters, $noRecursive=false) {}",
"abstract function applyFilter($value);",
"public function sanitize($value, $filters, $noRecursive=null){ }",
"protected function applyOutputFilter($value)\n {\n $filter = $this->getFormFilter();\n if ($filter) {\n $value = $filter->outputFilter($value);\n }\n \n return $value;\n }",
"public function filter($value)\n {\n return parent::filter($value) ? $value : null;\n }",
"private function pruneValue($value){\n $value = strtolower($value);\n $value = trim($value);\n \n // Replace tabs, line return etc\n $order = array(\"\\r\\n\", \"\\n\", \"\\r\", \"\\t\");\n $replace = '';\n $value = str_replace($order, $replace, $value);\n \n $value = iconv(\"ISO-8859-1//IGNORE\", \"UTF-8\", $value);\n return $value;\n }",
"public function filter($value)\r\r\n {\r\r\n // Formats are applied exclusively and supersed filters\r\r\n if ($this->format) {\r\r\n return SchemaFormatter::format($this->format, $value);\r\r\n }\r\r\n\r\r\n // Convert Boolean values\r\r\n if ($this->type == 'boolean' && !is_bool($value)) {\r\r\n $value = filter_var($value, FILTER_VALIDATE_BOOLEAN);\r\r\n }\r\r\n\r\r\n // Apply filters to the value\r\r\n if ($this->filters) {\r\r\n foreach ($this->filters as $filter) {\r\r\n if (is_array($filter)) {\r\r\n // Convert complex filters that hold value place holders\r\r\n foreach ($filter['args'] as &$data) {\r\r\n if ($data == '@value') {\r\r\n $data = $value;\r\r\n } elseif ($data == '@api') {\r\r\n $data = $this;\r\r\n }\r\r\n }\r\r\n $value = call_user_func_array($filter['method'], $filter['args']);\r\r\n } else {\r\r\n $value = call_user_func($filter, $value);\r\r\n }\r\r\n }\r\r\n }\r\r\n\r\r\n return $value;\r\r\n }",
"private function apply_filter(&$value, $filter){\r\n }",
"public function filter($value)\n {\n // we do this because commonly the filter is used with an array validator\n // and form inputs with no value often end up as empty strings on post\n $value = $value === '' || $value === null ? array() : $value;\n\n // if value is an array, return it, throwing away any provided keys\n // otherwise, return the original value\n return is_array($value) ? array_values($value) : $value;\n }",
"public function reverseTransform($serviceValue);",
"public function removeFilter($key, $value = '') {\n\t\tif ($key && isset($this->pgFilter[$key])) {\n\t\t\tunset($this->pgFilter[$key]);\n\t\t} elseif ($value) {\n\t\t\t// TODO: unset value\n\t\t}\n\t}",
"public function filter($value)\n {\n if (!is_scalar($value) AND ! is_array($value)) {\n return $value;\n }\n return str_replace([\"\\n\", \"\\r\"], '', $value);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a JsonArray and descend into the builder | public function addArrayValue(JSONArrayBuilder $oValue)
{
return $this->add($oValue);
} | [
"function add_json($json, $array)\n{\n\t// convert to array\n\t$json = json_decode($json, TRUE);\n\t// add to array\n\t$json = add_array($json, $array);\n\t// convert to json string\t\n\treturn json_encode($json);\n}",
"public function addAll(JsonArray $jsonArray): void\n {\n foreach ($jsonArray as $jsonElement) {\n $this->addJsonElement($jsonElement);\n }\n }",
"public function appendArray($array){\n \t$this->body = array_merge($this->body, $array);\n }",
"public function append ($array)\n {\n $this->__nativeArray = array_merge($this->__nativeArray, $array->__nativeArray);\n return $this;\n }",
"public static function buildFromJsonArray($jsonArray) {\n \n if (empty($jsonArray['items']) || !is_array($jsonArray['items'])) {\n throw new \\InvalidArgumentException(\"json array argument must be an array with items index\");\n }\n \n $order = new Order();\n\n foreach ($jsonArray['items'] as $item) {\n\n $product = new Product();\n $product->initialize($item);\n\n $orderItem = new OrderItem();\n $orderItem->setProductAndQuantity($product, $item['quantity']);\n\n $order->addOrderItem($orderItem);\n }\n\n return $order;\n }",
"function add_array($objArray) {\r\n foreach ($objArray as $key => $value) {\r\n if(!is_array($this->$key)){\r\n if(isset($this->$key)){\r\n $singleVal = $this->$key;\r\n $this->$key = array($singleVal);\r\n }else{\r\n $this->$key = array();\r\n }\r\n }\r\n array_push($this->$key, $value);\r\n }\r\n }",
"public function addJson($value)\n {\n $this->json[] = $value;\n }",
"public function addToParams($array)\n\t{\n\t\tif (empty($this->params)) {\n\t\t\t$this->params = array();\n\t\t}\n\t\tif (is_string($this->params)) {\n\t\t\t$this->params = (array) json_decode($this->params);\n\t\t}\n\t\tif (is_object($this->params)) {\n\t\t\t$this->params = (array) $this->params;\n\t\t}\n\n\t\t$this->params = json_encode(array_merge($this->params, $array));\n\t\treturn $this->params;\n\t}",
"public function testArraySerialization()\n {\n $request = new JsonRequestWithArray();\n\n $jsonWalker = new Json();\n $serilizer = new Serializer();\n $serilizer->setVisitor($jsonWalker);\n\n $serilizedData = $jsonWalker->visit($request, $serilizer);\n\n $this->assertJson($serilizedData, \"Walker did not return json\");\n $this->assertJsonStringEqualsJsonString(\n $serilizedData,\n '{\"test\":1,\"test2\":2,\"arrayValue\":[{\"test\":1,\"test2\":2},{\"test\":1,\"test2\":2}]}'\n );\n }",
"public function add_json($json) {\n if ($json) {\n $json_index = json_decode($json, true);\n $this->_index = $this->merge($this->_index, $json_index);\n }\n }",
"public function withArrayValue(): self\n {\n return new self($this->typedArray->withArrayValue());\n }",
"public static function create()\n {\n return new JsonBuilder(array());\n }",
"public function add($jsonPath, $value, $field=null)\n {\n list($result, $_) = JsonPath::get($this->jsonObject, $jsonPath, true);\n foreach ($result as &$element) {\n if (is_array($element)) {\n if ($field == null) {\n $element[] = $value;\n }\n else {\n $element[$field] = $value;\n }\n }\n }\n return $this;\n }",
"public function addJsonElement(JsonElement $jsonElement)\n {\n $this->values[] = $jsonElement;\n }",
"public final function addToArray( array &$array )\n {\n\n if ( ! \\is_null( $this->Label ) && '' != $this->Label )\n {\n $array[ 'Label' ] = $this->Label;\n }\n\n if ( ! \\is_null( $this->Title ) && '' != $this->Title )\n {\n $array[ 'Title' ] = $this->Title;\n }\n\n if ( ! \\is_null( $this->ObjectName ) && '' != $this->ObjectName )\n {\n $array[ 'Object-Name' ] = $this->ObjectName;\n }\n\n }",
"function addArray ($array) {\n foreach ($array as $k => $v):\n $this->addRow ($v);\n endforeach;\n\n }",
"public function appendArray(array $data) {\n\t\tforeach($data as $key => $item) {\n\t\t\t$this->$key = $item;\n\t\t}\n\t}",
"function add_array($arr, $index=0)\n {\n if ($this->is_habtm == false)\n {\n $child_class= $this->child_class;\n $parent_id_field= $this->parent_class.PK_SEPARATOR.PRIMARY_KEY;\n \n $obj= new $child_class();\n $obj->populate_from($arr, $index);\n $obj->$parent_id_field= $this->parent->id;\n $obj->store();\n \n $this->objects[]= $obj;\n }\n else\n $this->add_habtm($obj, $arr);\n\n\t\treturn $obj;\n }",
"public function setArray(array $data) {\n\n\t\tforeach($data as $key => $value) {\n\n\t\t\tif($key == 'children' && is_array($value)) {\n\n\t\t\t\tforeach($value as $name => $childData) {\n\t\t\t\t\t// convert each child in $value from array to object\n\t\t\t\t\t$child = new FormBuilderField();\t\n\t\t\t\t\t$child->name = $name; \n\t\t\t\t\t$child->setArray($childData); \n\t\t\t\t\t$this->add($child); \n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t$this->set($key, $value); \n\t\t\t}\n\t\t}\t\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Applies this object to a given source code segment. | public function apply(\baladi\source\ISource $source); | [
"function apply($source);",
"public function mergeSegment(Segment $segment)\n\t\t{\n\t\t\tif (! array_key_exists($segment->getName(), $this->segments)) {\n\t\t\t\tthrow new OdfException($segment->getName() . 'cannot be parsed, has it been set yet ?');\n\t\t\t}\n\t\t\t$string = $segment->getName();\n\t\t\t// $reg = '@<text:p[^>]*>\\[!--\\sBEGIN\\s' . $string . '\\s--\\](.*)\\[!--.+END\\s' . $string . '\\s--\\]<\\/text:p>@smU';\n\t\t\t$reg = '@\\[!--\\sBEGIN\\s' . $string . '\\s--\\](.*)\\[!--.+END\\s' . $string . '\\s--\\]@smU';\n\t\t\t$this->contentXml = preg_replace($reg, $segment->getXmlParsed(), $this->contentXml);\n\t\t\treturn $this;\n\t\t}",
"function parse()\n {\n $this->wiki->source = preg_replace_callback(\n $this->regex,\n array(&$this, 'process'),\n $this->wiki->source\n );\n }",
"public function process()\n {\n $tokens = $this->initializeTokens($this->contents, $this->filename);\n $this->parseTokenizer($tokens);\n }",
"public function execute() {\n\t\t$this->_compileTokens(\n\t\t\t$this->_tokenizeInput( $this->_codeInput ) );\n\t}",
"public function apply()\n {\n self::getPropertyAccessor()->setValue($this->target, $this->targetProperty, $this->sourceValue);\n }",
"public function visitCode()\n {\n if ($this->mv != null) {\n $this->mv->visitCode();\n }\n }",
"function interpret($segment) {\n\t\tif( $segment[0] != self::SEGMENT_TYPE )\n\t\t\tthrow new Exception(\"Message segment must start with \".self::SEGMENT_TYPE);\n\t\twhile( count($segment) < 51 ) {\n\t\t\t$segment[] = null;\n\t\t}\n\t\t$this->facility = HL7Message::interpretPL( $segment[ 3], $this->room );\n\t\t$this->alternate_id\t= HL7Message::interpretCX( $segment[50] );\n\t\tHL7Message::interpretXCN($segment[7], $this->attending_doctor_last, $this->attending_doctor_first);\n\t\tHL7Message::interpretXCN($segment[8], $this->referring_doctor_last, $this->referring_doctor_first);\n\t}",
"public function apply()\n {\n }",
"public function interpret( $segment ) {\n\t\tif( $segment[0] != self::SEGMENT_TYPE )\n\t\t\tthrow new Exception( \"Message segment must start with \".self::SEGMENT_TYPE );\n\t\twhile( count($segment) < 27 ) {\n\t\t\t$segment[] = null;\n\t\t}\n\t\t$dummy1 = $dummy2 = null;\n\t\tHL7Message::interpretDR( $segment[ 4], $this->start, $this->end );\n\t\t$this->posting_date = HL7Message::interpretTS( $segment[ 5] );\n\t\tHL7Message::interpretPairedTable( $segment[19], $this->diagnosis_code, $this->diagnosis_desc );\n\t\tHL7Message::interpretXCN( $segment[20], $this->performed_by_last, $this->performed_by_first, $dummy1, $dummy2, $this->performed_by_id );\n\t\tHL7Message::interpretPairedTable( $segment[25], $this->procedure_code, $this->procedure_desc );\n\t\tHL7Message::interpretPairedTable( $segment[26], $this->modifier_code, $this->modifier_desc );\n\t\t$this->units\t\t= $segment[10];\n\t\t$this->unit_cost\t= $segment[22];\n\t}",
"function parse()\n {\n $lines = explode(\"\\n\", $this->wiki->source);\n\n $this->wiki->source = '';\n\n foreach ($lines as $line) {\n $this->wiki->source .= $this->process($line) . \"\\n\";\n }\n $this->wiki->source = substr($this->wiki->source, 0, -1);\n }",
"function interpret( $segment ) {\n\t\tif( $segment[0] != self::SEGMENT_TYPE )\n\t\t\tthrow new Exception(\"Message segment must start with \".self::SEGMENT_TYPE);\n\t\twhile( count($segment) < 11 ) {\n\t\t\t$segment[] = null;\n\t\t}\n\t\t$middle_name = $suffix = null;\n\t\tHL7Message::interpretXCN( $segment[3], $this->last_name, $this->first_name, $middle_name, $suffix, $this->their_id );\n\t\t$this->start_time \t= HL7Message::interpretTS( $segment[6] );\n\t\t$this->duration \t= HL7Message::interpretDuration( $this->start_time, $this->end_time, $segment[9], HL7Message::interpretCE( $segment[10] ));\n\t\t\n\t\t// Save their_id as custom_provider_id in user_account table for this provider\n\t\t$mn \t\t= 'UserAccount';\n\t\t$user_model = ClassRegistry::init( $mn );\n\t\t$conditions\t= array( \"$mn.lastname\" => $this->last_name, \"$mn.firstname\" => $this->first_name );\n\t\t$get \t\t= $user_model->find( 'first', array( 'conditions' => $conditions ));\n\t\tif( false !== $get ) {\n\t\t\t$this->provider_id = $get[$mn]['user_id'];\n\t\t\tif( !is_null( $this->their_id ) && $get[$mn]['custom_provider_id'] != $this->their_id ) {\n\t\t\t\t$get[$mn]['custom_provider_id'] = $this->their_id;\n\t\t\t\t$user_model->save( $get );\n\t\t\t}\n\t\t}\n\t}",
"public function attachSegment($segment);",
"public function update(SegmentCodeRequest $request,$segment_code_id)\n {\n try {\n ModelFactory::getInstance('SegmentCode')->where('id','=',$segment_code_id)->update($request->only(['segment_code','description','abbreviation'])\n );\n return response()->json(['success'=> true]);\n } catch (Exception $e) {\n return response()->json(['success'=> false]);\n }\n }",
"protected function parseSegments() {\n\t\t$options = $this->options();\n\n\t\tarray_walk($this->segments, function(&$segment) use ($options) {\n\t\t\t$segment = Segment::getInstance($options, $segment);\n\t\t});\n\t}",
"public function injectAtCurrentScope( $asLineNumber, $line ) {\n $line = str_repeat( \" \", $this->context->Scope->WhitespaceDepth ) . $line;\n $this->internalParse( $asLineNumber, $line );\n }",
"function interpret($segment) {\n\t\tif( $segment[0] != self::SEGMENT_TYPE )\n\t\t\tthrow new Exception(\"Message segment must start with \".self::SEGMENT_TYPE);\n\t\t$this->event_type = $segment[1];\n\t\t$this->recorded_datetime = HL7Message::interpretTS($segment[2]);\n\t}",
"public function apply(): void\n {\n }",
"protected function _parse() {\n\t\t$methods = get_class_methods($this);\n\t\tforeach ($methods as $method) {\n\t\t\tif (substr($method, 0, 8) === \"_compile\") {\n\t\t\t\t$this->{$method}();\n\t\t\t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Called after foreach(x as key=>value) to make key an Aspis again. Taint should be found in the third element of $taint | function restoreTaint(&$obj,&$taint) {
$ret=array($obj);
if (isset ($taint[2])) {
$ret[1]=$taint[2];
}
else $ret[1]=false;
$obj=$ret;
} | [
"function cfgTaintAnalysis($cfg, $signature, $cfgInfoMap, $functionSignatures) {\n\n\t print \"Starting Taint Analysis.\\n\";\n\n\t // WARNING: Imposing a bound to avoid infinite loops.\n\t $steps = 0;\n\t $bound = 10000;\n\n\t // Map that contains the set of tainted variables \n\t // per CFG node.\n\t $user_tainted_variables_map = new SplObjectStorage();\n\t $secret_tainted_variables_map = new SplObjectStorage();\n\n\t $cfg_taint_map = new CFGTaintMap($user_tainted_variables_map, $secret_tainted_variables_map);\n\n\t // Forward flow-sensitive taint-analysis.\n\t $entry_node = $cfg->entry;\n\t $q = new SplQueue();\n\t $q->enqueue($entry_node);\n\n\t while (count($q) && $steps < $bound) {\n\t \n\t $current_node = $q->dequeue();\n\n\t $steps++;\n\n\t if (!$user_tainted_variables_map->contains($current_node)) {\n\n\t \t $user_tainted_variables_map[$current_node] = new TaintedVariables();\n\t }\n\n\t if (!$secret_tainted_variables_map->contains($current_node)) {\n\n\t \t $secret_tainted_variables_map[$current_node] = new TaintedVariables();\n\t }\n\n\t print \"Started processing node: \\n\";\n\t $current_node->printCFGNode();\n\n\t $initial_user_tainted_size = $user_tainted_variables_map[$current_node]->count();\n\t $initial_secret_tainted_size = $secret_tainted_variables_map[$current_node]->count();\n\n\t // Add the taint sets of the parents.\n\t foreach($current_node->parents as $parent) {\n\t \t\t\n\t\t\tif ($user_tainted_variables_map->contains($parent)) {\n\n\t\t\t $user_tainted_variables_map[$current_node]->addAll($user_tainted_variables_map[$parent]);\n\t\t\t}\n\n\t\t\tif ($secret_tainted_variables_map->contains($parent)) {\n\n\t\t\t $secret_tainted_variables_map[$current_node]->addAll($secret_tainted_variables_map[$parent]);\n\t\t\t}\n\t }\n\n\t // Process taint for the current node.\n\t processTaint($current_node, $user_tainted_variables_map, $secret_tainted_variables_map, $cfg_taint_map);\n\n\t $changed = $initial_user_tainted_size != $user_tainted_variables_map[$current_node]->count() \n\t \t\t || $initial_secret_tainted_size != $secret_tainted_variables_map[$current_node]->count() ;\n\n\t print \"Finished processing node: \\n\";\n\t $current_node->printCFGNode();\n\n\t print \"User tainted variables:\\n\";\n\t $user_tainted_variables_map[$current_node]->printTaintedVariables();\n\t print \"Secret tainted variables:\\n\";\n\t $secret_tainted_variables_map[$current_node]->printTaintedVariables();\n\t print \"\\n\";\n\n\t // Add the successors of the current node to the queue, if the tainted set has changed or the successor hasn't been visited.\n\n\t foreach ($current_node->successors as $successor) {\n\n\t \t if ($changed || !$user_tainted_variables_map->contains($successor) \n\t\t || !$secret_tainted_variables_map->contains($successor)) {\n\n\t\t\t $q->enqueue($successor);\n\t\t }\n\t }\n\t}\n\n\tprint \"==============================\\n\";\n\tprint \"The user tainted variables at the exit node are:\\n\";\n\t$user_tainted_variables_map[$cfg->exit]->printTaintedVariables();\n\tprint \"\\n\";\n\tprint \"==============================\\n\";\n\tprint \"==============================\\n\";\n\tprint \"The secret tainted variables at the exit node are:\\n\";\n\t$secret_tainted_variables_map[$cfg->exit]->printTaintedVariables();\n\tprint \"\\n\";\n\tprint \"==============================\\n\";\n\t\n\treturn $cfg_taint_map;\n}",
"public function isTainted() {\n foreach ($this->data as $key => $value) {\n if ($value->isTainted()) {\n return TRUE;\n }\n }\n return FALSE;\n }",
"public function testSetKeyPairTtlInvalidTypeArray(): void\n {\n $ttl = array(3,4,5);\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->set('foo', 'bar', $ttl);\n }",
"function is_it_tainted($value,$key,$stack)\n{\n global $debug;\n global $taintedvariables;\n\n # check user input, save tainted var if Expr_Assign, test sink and sanitize\n $inputArr = UserInput::getUserInput();\n if (in_array($value,$inputArr) or in_array($value,$taintedvariables))\n {\n {\n echo \"TAINT SOURCE FOUND: a taint source (taint) $value was found. \\n\";\n print \"The stack to this source is: \\n\";\n print_r($stack);\n # testing\n print(\"The PHPParser Node type is (important to understand the synthax tree): \");\n print($stack[0]->getType());\n print(\"\\n\");\n if ($stack[0]->getType()==\"Expr_Assign\")\n {\n print(\"Storing the tainted variable for later use because it is assigned:\");\n print($stack[0]->var->name);\n array_push($taintedvariables,$stack[0]->var->name);\n print(\"\\n\");\n }\n # debug\n if ($debug == true){ print \"[DEBUG] full stack \\n\"; var_dump($stack);}\n\n# VULN SCAN starts here\n$sink=false;\n$sink = is_dangerous_sink($stack,$value);\n# TODO need to double check this logic test\n if (($sink) and !(is_sanitized($stack,$value)))\n {\n print \"VULNERABILITY FOUND: the tainted input $value goes to a dangerous sink function $sink without sanitization \\n\";\n # need to output the source code based on the object start line number to end line number\n print \"Vulnerability path: \\n\";\n print_r(array_values($stack));\n }\n # clean the stack\n unset($stack);\n# vuln scan stops here\n }\n }\n}",
"public function testReverseTransformDuplicateDetected()\n {\n $this->setExpectedException(\n 'Symfony\\\\Component\\\\Form\\\\Exception\\\\TransformationFailedException',\n 'Duplicate silvestra_key key detected!'\n );\n\n $this->transformer->reverseTransform(array_merge($this->getKeyValues(), $this->getKeyValues()));\n }",
"function apcu_cas($key, $old, $new){}",
"function is_sanitized($stacktowalk,$taintsource)\n{\n\n\nforeach ($stacktowalk as $key => $item)\n{\n # TODO add sanitized function based on config or pre-scan\n if ($item == \"escapeshellarg\")\n {\n print \"SANITIZER FOUND: a sanitizer function (san) $item sanitized user input $taintsource . \\n\";\n }\n}\n}",
"function validateStress($taint) {\n\t$clean = NULL;\n\tif ($taint == '1') {\n\t\t$clean = true;\n\t}\n\telse if ($taint == '0') {\n\t\t$clean = false;\n\t}\n\treturn $clean;\n}",
"private function unsetTripeKey()\n {\n unset($this->tripleKey);\n }",
"function getAllPurified() {\n\t\tforeach ($this->valuemap as $key => $value) {\n\t\t\t$sanitizedMap[$key] = $this->get($key);\n\t\t}\n\t\treturn $sanitizedMap;\n\t}",
"function correct_keys($array) {\n\t\t\t// after the key replacement phase to correct\n\t\t\t// conditional logic is complete\n\t\t\t$new_array = array();\n\t\t\tif (count($array)) {\n\t\t\t\tforeach ($array as $key => $value) {\n\t\t\t\t\tif (is_array($value)) {\n\t\t\t\t\t\t$new_array[$key] = $this->correct_keys($value);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (substr($value, 0, 6) == 'field_') {\n\t\t\t\t\t\t\t$value = preg_replace('/\\_\\[[0-9]+\\]\\_/', '', $value);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$new_array[$key] = $value;\n\t\t\t\t\t} // end if array else\n\t\t\t\t} // end foreach\n\t\t\t} // end if count\n\t\t\treturn $new_array;\n\t\t}",
"abstract protected function keyToTags($key);",
"protected function clearIndexIfAllKeysValid(): void\n {\n if (is_null($this->index) || $this->lazyTail->valid()) {\n return;\n }\n\n $allKeysValid = true;\n\n foreach ($this->index as $safeKey => $unsafeKey) {\n if ($safeKey !== $unsafeKey) {\n $allKeysValid = false;\n break;\n }\n }\n\n if ($allKeysValid) {\n // this causes $this->areAllKeysValid() to start returning true\n $this->index = null;\n }\n }",
"function sanitise(array $data) :array {\n\n foreach ($data as $key=>$item) {\n $sanitisedData[$key] = filter_var($data[$key], FILTER_SANITIZE_STRING);\n }\n return $sanitisedData;\n}",
"public function hexists($key)\n {\n }",
"public function testSetKeyPairTtlInvalidTypeBoolean(): void\n {\n $ttl = true;\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->set('foo', 'bar', $ttl);\n }",
"public function testCacheKeyInvalidTypeObject(): void\n {\n $value = '99 bottles of beer on the wall';\n $key = new \\stdClass;\n $key->key = 'foo';\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->set($key, $value);\n }",
"private function hashHashable()\n {\n $hasher = new BcryptHasher;\n $filtered = array_filter($this->attributes);\n\n foreach ($filtered as $key => $value)\n {\n if (in_array($key, $this->hashable) && $value != $this->getOriginal($key))\n {\n $this->attributes[$key] = $hasher->make($value);\n }\n }\n }",
"public function trust(): void\n {\n $this->isTrusted = true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create the table gathering the dirty tables | public function createDirtyTableCollector(): void
{
$temporary = $this->isInTempMode() ? 'TEMPORARY' : '';
$dirtyTable = self::DIRTY_TABLE_COLLECTOR;
$this->getConnection()->execute("
CREATE {$temporary} TABLE IF NOT EXISTS {$dirtyTable} (
table_name VARCHAR(128) PRIMARY KEY
);
");
} | [
"public function createTables();",
"protected function afterTableCreation()\n {\n \n }",
"private function createDummyTable() {}",
"abstract protected function _autoCreateTable();",
"public static function create_tables() {\n Site::create_table();\n Membership_Area::create_table();\n Restricted_Content::create_table();\n User::create_table();\n }",
"function create_table()\n {\n }",
"function _createTableList()\n {\n $this->_connect();\n\n\n $__DB= &$GLOBALS['_DB_DATAOBJECT']['CONNECTIONS'][$this->_database_dsn_md5];\n\n $this->tables = $__DB->getListOf('tables');\n\n foreach($this->tables as $table) {\n $defs = $__DB->tableInfo($table);\n \n // cast all definitions to objects - as we deal with that better.\n foreach($defs as $def) {\n if (is_array($def)) {\n $this->_definitions[$table][] = (object) $def;\n }\n }\n }\n //print_r($this->_definitions);\n }",
"private function setupAndCleanTempTable()\n {\n // Ensure the table exists\n $this->em->getConnection()->exec('CREATE TABLE IF NOT EXISTS mtotaccttmp LIKE mtotacct');\n\n // Truncate the table\n $this->em->getConnection()->exec('TRUNCATE mtotaccttmp');\n }",
"public function wpbooklist_customautofill_create_tables() {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\t\t\tglobal $wpdb;\n\t\t\tglobal $charset_collate;\n\n\t\t\t/*\n\t\t\t// Call this manually as we may have missed the init hook.\n\t\t\t$this->wpbooklist_customautofill_register_table_name();\n\n\t\t\t$sql_create_table1 = \"CREATE TABLE {$wpdb->wpbooklist_customautofill}\n\t\t\t(\n\t\t\t\tID bigint(190) auto_increment,\n\t\t\t\tgetstories bigint(255),\n\t\t\t\tcreatepost bigint(255),\n\t\t\t\tcreatepage bigint(255),\n\t\t\t\tstorypersist bigint(255),\n\t\t\t\tdeletedefault bigint(255),\n\t\t\t\tnotifydismiss bigint(255) NOT NULL DEFAULT 1,\n\t\t\t\tnewnotify bigint(255) NOT NULL DEFAULT 1,\n\t\t\t\tnotifymessage MEDIUMTEXT,\n\t\t\t\tstorytimestylepak varchar(255) NOT NULL DEFAULT 'default',\n\t\t\t\tPRIMARY KEY (ID),\n\t\t\t\tKEY getstories (getstories)\n\t\t\t) $charset_collate; \";\n\t\t\tdbDelta( $sql_create_table1 );\n\t\t\t*/\n\t\t}",
"private function create_tables() {\n\t\tglobal $psts;\n\n\t\t$table = self::$table;\n\n\t\t// Stripe table schema.\n\t\t$table = \"CREATE TABLE $table (\n\t\t blog_id bigint(20) NOT NULL,\n\t\t\tcustomer_id char(20) NOT NULL,\n\t\t\tsubscription_id char(22) NULL,\n\t\t\tPRIMARY KEY (blog_id),\n\t\t\tUNIQUE KEY ix_subscription_id (subscription_id)\n\t\t) DEFAULT CHARSET=utf8;\";\n\n\t\t// We can continue only if upgrade is not disabled.\n\t\tif ( ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) || ! DO_NOT_UPGRADE_GLOBAL_TABLES ) {\n\t\t\t// Make sure we have dbDelta function.\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\n\t\t\t// Using dbDelta we won't break anything.\n\t\t\tdbDelta( $table );\n\n\t\t\t// Modify stripe customers table, if we have latest version.\n\t\t\tif ( version_compare( $psts->version, '3.5.9.3', '>=' ) ) {\n\t\t\t\t// Handle failed upgrades.\n\t\t\t\t$this->upgrade_table_indexes();\n\t\t\t}\n\t\t}\n\t}",
"abstract protected function buildTable();",
"private function initVersionTable() {\n $this->db->execute('create table \"' . self::VERSION_TABLE . '\" (\n id integer primary key not null,\n name varchar not null,\n creationTime datetime not null\n )');\n }",
"public function fillTables()\n {\n $status = $this->checkDb();\n \n if ($status['brand_table_count'] < 1) {\n $this->addBrands();\n }\n $status = $this->checkDb();\n if ($status['brand_table_count'] > 0) {\n $this->brandCount = $status['brand_table_count'];\n $this->addEntries();\n }\n }",
"protected function createCacheTables() {}",
"public function mk_file_manager_create_tables() {\n global $wpdb; \n $table_name = $wpdb->prefix . 'wpfm_backup';\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n if($wpdb->get_var(\"SHOW TABLES LIKE '$table_name'\") != $table_name) {\n $charset_collate = $wpdb->get_charset_collate(); \n $sql = \"CREATE TABLE \".$table_name.\" (\n id int(11) NOT NULL AUTO_INCREMENT,\n backup_name text NULL,\n backup_date text NULL,\n PRIMARY KEY (id)\n ) $charset_collate;\"; \n dbDelta( $sql );\n }\n }",
"protected function buildTable(): void {\r\n\r\n if(null !== $this -> table) {\r\n $this -> query[] = $this -> table;\r\n }\r\n }",
"private function create_tables() {\n global $wpdb;\n\n include_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\n $collate = $wpdb->get_charset_collate();\n\n $table = \"CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}dokan_delivery_time` (\n `id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n `order_id` int(11) NOT NULL,\n `vendor_id` int(11) NOT NULL,\n `date` varchar(25) NOT NULL DEFAULT '',\n `slot` varchar(25) NOT NULL DEFAULT '',\n `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`id`),\n KEY `key_vendor_id_date` (`vendor_id`,`date`),\n KEY `key_slot` (`slot`)\n ) ENGINE=InnoDB {$collate}\";\n\n dbDelta( $table );\n }",
"public function build_tables ( ) {\n\n // Pull the event names\n $sql = \"SELECT name FROM tracked_events WHERE active = 1\";\n\n $tracked_events = $this->query( $sql );\n\n // Iterate over the tracked events\n foreach ($tracked_events as $event) {\n\n // Create a new table for each event\n $sql = \"CREATE TABLE IF NOT EXISTS `\" . $event['name'] . \"` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `date` datetime NOT NULL,\n `value` int(11) NOT NULL,\n `active` int(11) NOT NULL,\n UNIQUE KEY `id` (`id`)\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8\";\n\n $this->query( $sql );\n\n }\n\n }",
"public function createModelTable(){\n $this->dbc->drop_table_by_name($this->model['table']);\n $this->dbc->create_table_by_model($this->model);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return data from "frontspec" JSON file | public static function get_frontspec_json_file( $data = false, $merge_backspec = true ) {
$front_spec = json_decode ( file_get_contents( self::get_fontspec_path() ), true );
if( $merge_backspec ) {
$back_spec = self::get_backspec_json_file();
$front_spec = array_replace_recursive( $front_spec, $back_spec);
}
if ( $data ) {
if( array_key_exists($data, $front_spec) )
return $front_spec[$data];
else
return null;
}
else
return $front_spec;
} | [
"function mf_get_maker_json() {\n\t$json = file_get_contents( 'makers.json' );\n\t$makers = json_decode( $json );\n\treturn $makers;\n}",
"private function readRecipeData() {\n $data = file_get_contents(__DIR__ . '/../../../src/app/Recipe/data.json'); \n $arr_data = json_decode($data);\n\n return $arr_data; \n }",
"private static function getFactsFromJSON() {\n $file = dirname(__FILE__) . '/chuck.json';\n \n return json_decode(file_get_contents($file));\n }",
"function phb_get_data_from_json($filename)\n{\n $path = \"{$GLOBALS['base_dir']}/$filename.json\";\n\n if (!file_exists($path)) {\n return false;\n }\n\n return json_decode(file_get_contents($path), true);\n}",
"protected function fetchData() {\n try {\n $uri = $this->config('uri');\n $response = $this->getContentFromUri($uri);\n }\n catch (\\Exception $e) {\n $this->messenger()->addError('Unable to read JSON');\n $this->logger->error($this->t('Error reading JSON file :error',\n [':error' => $e->getMessage()]));\n $response = NULL;\n }\n\n $data = '{}';\n\n if ($response) {\n if (!$this->dvfHelpers->validateJson($response)) {\n $this->messenger()->addError('Invalid JSON file provided');\n $this->logger->error($this->t('Unable to parse this json file :url',\n [':url' => $uri]));\n }\n $data = $response;\n }\n\n return $data;\n }",
"protected function getData(){ //\n $data = file_get_contents(__DIR__.\"/../data/data.json\");\n return json_decode($data);\n }",
"function getDataFromJsonFile($nameFile) {\n return json_decode(file_get_contents($nameFile));\n }",
"protected function loadData()\n\t{\n\t\t$jsonPath = $this->getPath() . 'module.json';\n\t\t$contents = $this->app['files']->get($jsonPath);\n\n\t\treturn json_decode($contents);\n\t}",
"function recupererData()\n {\n $data = json_decode(file_get_contents(__ROOT__.'/src/data/data.json'), true);\n if($data){\n return $data;\n }else{\n return null;\n }\n\n }",
"public function get_result() {\n $file = $this->jsonFile;\n $result = json_decode(file_get_contents($file), true);\n\t\treturn $result;\n\t}",
"function getProfiles()\n{\n $json = file_get_contents('phone_book.json');\n $profiles = json_decode($json, true);\n return $profiles;\n}",
"protected function buildProfileJSON()\n {\n return file_get_contents(__DIR__.'/demoprofile.json');\n }",
"function get_the_json() {\r\n # get the request.\r\n $req = Flight::request();\r\n \r\n # get the request JSON and decode it and return it.\r\n return json_decode($req->body);\r\n}",
"function json_read($filename){\n return json_decode(file_get_contents($filename));\n}",
"public static function read()\n {\n return json_decode(file_get_contents(self::getPath()));\n }",
"function getUserData(){\n//\t$file_content = file_get_contents(\"'user.json', $pathtojson\" );\n\t$file_content = file_get_contents(\"../data/user.json\");\n\t\n\techo $file_content . '<br>';\n\tvar_dump(json_decode($file_content, true));\n}",
"private function getData() {\n $file = file_get_contents($this->projectDir . 'assets/webpack-stats.json');\n $data = json_decode($file);\n\n return $data;\n }",
"function getProductsFromJson(){\n\t$sAllProducts = file_get_contents(\"allProducts.json\");\n\techo $sAllProducts;\n}",
"function extractJSONDataBatches(){\n $jsonFile = getJSONFileBatches();\n error_log($jsonFile);\n $dir = realpath(\"downloads/batches/\") . '/' .$jsonFile;\n $str = file_get_contents($dir);\n error_log('This is str ' . $str);\n $json = json_decode($str,true);\n return $json;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
tries to add a user with the admin token and returns the output of the operation | public function addUserWithAdminToken()
{
ControllerUser::addUser(TUI_TEST_ADMIN_TOKEN);
$stringOutput = ob_get_contents();
TestUtilLogging::getInstance()->debug('stringOutput: ' . $stringOutput);
$stringArray = json_decode($stringOutput, true);
//check that a userId is returned
$this->assertTrue(array_key_exists('userId', $stringArray), "returned no userId when making a valid add_user");
//check that the userId is valid
$userId = $stringArray["userId"];
$this->assertTrue(strlen($userId) == TUI_ADMIN_LENGTH, "invalid userId length. It is " . strlen($userId) . " and should be " . TUI_ADMIN_LENGTH);
//check that the user was written in the db
$user = $this->_usersCollection->findOne(array("userId" => $userId));
TestUtilLogging::getInstance()->debug('Querying users for userId: [' . $userId . ']');
$this->assertTrue($user != NULL, "user not saved in the database");
//check that the email in the db is correct
//$this->assertTrue(strcmp($_REQUEST["email"],$user['email']) == 0, "incorrect e-mail stored in database");
$this->assertEquals($_REQUEST["email"], $user['email']);
//clean the buffer for next test
ob_clean();
} | [
"public function createAdminUserAndGetToken(){\n $this->post('api/users', $this->adminUser);\n $this->assertResponseStatus(201);\n $this->post('/api/auth',['email' => 'hardikpatel.hardik36@gmail.com', 'password' => 'testing', 'authType' => 'custom']);\n $this->assertResponseStatus(200);\n $this->assertArrayHasKey('access_token', $this->lastResponse()['data']);\n return $this->lastResponse()['data']['access_token'];\n }",
"public function addAdminUserAction()\n {\n $form = $this->getForm('admin_user');\n $result = $this->handleAdminRequest($form);\n if ($result !== null) {\n return $result;\n }\n return $this->renderTemplate('admin/users/add.twig', ['form' => $form->getForm()->createView()]);\n }",
"public function adminAddUser() {\n\n }",
"function if_admin_add_user() {\n $this->load->model('Model_admin');\n return $this->Model_admin->if_admin_add_user();\n }",
"private function adduser()\n {\n $name = $this->getParameter('name');\n $password = $this->getParameter('password');\n $realname = $this->getParameter('realname');\n $email = $this->getParameter('email');\n\n $success = vpAutocreateUsers::addToDatabase($name, $password, $realname, $email);\n\n $apiResult = $this->getResult();\n if( $success )\n $apiResult->addValue( array(), 'success', array() );\n else\n $apiResult->addValue( array(), 'error', array('title' => 'username null or user already exists') );\n }",
"public function add() {\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['password'] = AuthComponent::password($this->request->data['User']['password']);\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('The user has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t} else {\n\t\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t\t$lookupSupported = isset($queryURL) && \"\" <> $queryURL;\r\n\t\t\t$this->set('lookupSupported', $lookupSupported);\n\t\t\t$this->set('userType', $user['User']['type']);\n\t\t}\n\t}",
"function adminUser(){\n\t\trequire_once(\"classes/AES.php\");\n\t\t$admin = $this->adminUser;\n\t\t$aes = new AES($this->AESkey);\n\t\t$ePass = $aes->encrypt($this->adminPass);\n\t\t$this->conn->exec(\"INSERT INTO users\n\t\t\t\t\t\t\t \t SET username \t='\".$admin.\"',\n\t\t\t\t\t\t\t \t fname\t\t='Adminstrator',\n\t\t\t\t\t\t\t \t \t password \t='\".$ePass.\"',\n\t\t\t\t\t\t\t \t authorized \t='1'\");\n\t\treturn $this->displayError();\n\t}",
"public function addUser() \n {\n $data = array(\n 'email' => $this->_email,\n 'password' => $this->_password,\n 'title' => $this->_title,\n 'first_name' => $this->_fname,\n 'last_name' => $this->_lname,\n 'initials' => $this->_initials,\n 'bday' => $this->_bday,\n 'tel_no' => $this->_telno,\n 'address1' => $this->_address1,\n 'address2' => $this->_address2,\n 'city' => $this->_city,\n 'country' => $this->_country,\n 'role_id' => $this->_roleId,\n 'create_on' => $this->_createOn,\n 'create_by' => $this->_createBy,\n 'change_on' => $this->_changeOn,\n 'change_by' => $this->_changeBy\n );\n\n return $this->insert($data);\n }",
"function add_admin(){\n\t\t$name = $_POST[\"nama_admin\"];\n\t\t$username = $_POST[\"id_admin\"];\n\t\t$password = password_hash($_POST[\"password_admin\"], PASSWORD_DEFAULT);\n\t\t$role = \"Administrator\";\n\n\t\t$auth = new Auth();\n\t\t$sql = \"INSERT INTO `user_section_admin` (`admin_id`, `admin_username`, `admin_password`, `nama`, `role`, `tanggal bergabung`, is_active) VALUES (NULL, '$username', '$password', '$name', '$role', CURRENT_DATE, 1)\";\n\t\t$data = $auth->runQuery($sql);\n\n\t\tif ($data) {\n\t\t\t$_SESSION[\"add_msg\"] = \"Admin baru telah ditambahkan.\";\n\t\t\theader(\"location: users.php\");\n\t\t\texit();\n\t\t}\n\t}",
"public function postAddUser() {\n\n $post = $this->getPost();\n\n if (!$this->validatePost('name', 'user', 'pass'))\n return RestServer::throwError(Language::CANNOT_BE_BLANK('Name, User and Pass'), 400);\n\n\n $userData = array(\n 'name' => $post['name'],\n 'username' => $post['user'],\n 'passwd' => CR::encrypt($post['pass']),\n 'email' => $post['email']\n );\n\n $this->newModel('auth');\n $this->model('auth')->insertUser($userData);\n\n if (!$this->model('auth')->queryOk()) {\n if ($this->model('auth')->getErrorCode() == 23000)\n return RestServer::throwError(Language::USER_ALREADY_TAKEN(), 400);\n else\n return RestServer::throwError(Language::QUERY_ERROR(), 500);\n }\n\n return RestServer::response(array(\n 'status' => 200,\n 'uid' => $this->model('auth')->getLastInsertId(),\n 'message' => 'User created!'\n ), 200);\n }",
"public function add ( ) {\r\n try { \r\n \r\n if ( $this->vars['response_type'] == 'json' ) {\r\n $new_user_id = $this->user->makeUser( $this->vars );\r\n $output = array( \"user_id\"=>$new_user_id );\r\n } else {\r\n //echo 'gethtml output via ajax';\r\n $output = $this->load->controller('module/ami/settings/adduser', $this->vars );\r\n }\r\n \r\n $this->render( $this->vars['response_type'], $output );\r\n \r\n } catch (Exception $ex) {\r\n echo $this->renderError( $this->vars['response_type'], $ex->getMessage() );\r\n }\r\n \r\n \r\n }",
"public function admin_add()\n\t{\n\t\tif ( !empty( $this->request->data ) ) {\n\t\t\t$this->User->create();\n\t\t\tif ( $this->User->save( $this->request->data ) ) {\n\t\t\t\t$this->Session->setFlash(__d('users', 'User saved.'), 'flash_success', array('plugin' => 'Pukis'));\n\t\t\t\t$this->ajaxRedirect('/admin/users/users/index');\n\t\t\t}\n\t\t}\n\t\t$roles = $this->Role->find('list', array('conditions' => \"Role.id >= '\". $this->Auth->user('role_id') .\"'\"));\n\t\t$this->set(compact('roles'));\n\t}",
"public function add()\n\t{\n\t\tif (!is_admin())\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$data['page_title'] = lang('add_user');\n\t\t$data['action'] = 'user/add_submit';\n\t\t$data['new_user'] = TRUE;\n\t\t$data['referrer'] = $this->agent->referrer();\n\t\t$data = add_fields($data, 'user');\n\n\t\t$this->load->view('templates/header', $data);\n\t\t$this->load->view('user_edit_view', $data);\n\t\t$this->load->view('templates/footer');\n\t}",
"function addUser($accessKey, $secret)\n\t{ \n\t\t$output = shell_exec(\"../min/mc admin user add {$this->alias}/ {$accessKey} {$secret} 2>&1\"); \n\t\techo $output;\n\t}",
"public function createAdminToken();",
"function Add() {\n $values = array(\n 'username' => $this->username,\n 'first_Name' => $this->first_name,\n 'last_name' => $this->last_name,\n 'mail' => $this->mail,\n 'password' => $this->password,\n 'gender' => $this->gender,\n 'birth_date' => $this->birth_date,\n 'weight' => $this->weight,\n 'fb_uid' => $this->fb_uid\n );\n //Adds to the databank\n $this->user_id = PublicApp::getDB()->insert('users', $values);\n return $this->user_id;\n }",
"function insertAdminUser() {\n // Insert Admin info;\n $userController = new UserController;\n $this->db->exec(\n \"INSERT INTO users (username, password) VALUES (?, ?)\",\n [\n 1 => $this->formValues['adminUsername'],\n 2 => $userController->cryptPassword($this->formValues['adminPassword_1']),\n ]\n );\n }",
"private static function _addUser(Api\\Bracket $bracket) {\r\n $retVal = null;\r\n $user = Lib\\Url::Post('username');\r\n if ($user) {\r\n $user = preg_replace('/^\\/?u\\//i', '', $user);\r\n $user = Api\\User::getByName($user);\r\n if ($user) {\r\n if ($bracket->addUser($user)) {\r\n $retVal = parent::_createMessage('success', 'User /u/' . $user->name . ' has been added as an admin of ' . $bracket->name . '!');\r\n } else {\r\n $retVal = parent::_createMessage('error', 'There was an error adding /u/' . $user->name . ' as an admin.');\r\n }\r\n } else {\r\n $retVal = parent::_createMessage('error', '/u/' . $user . ' was not found in the system. Maybe they haven\\'t logged into AnimeBracket?');\r\n }\r\n } else {\r\n $retVal = parent::_createMessage('error', 'You must provide a user to add');\r\n }\r\n return $retVal;\r\n }",
"function addDefaultAdminUser() {\n $sql = \"SELECT COUNT(*)\n FROM %s\";\n $params = array($this->tableAuthUser);\n if ($res = $this->databaseQueryFmt($sql, $params)) {\n list($userCount) = $res->fetchRow();\n if ($userCount == 0) {\n $userId = $this->createId();\n $data = array(\n 'user_id' => $userId,\n 'username' => 'admin',\n 'givenname' => 'Default',\n 'surname' => $this->_gt('Administrator'),\n 'group_id' => -1,\n 'active' => TRUE,\n 'start_node' => 0,\n 'sub_level' => 0,\n 'user_password' => $this->getPasswordHash('')\n );\n if (FALSE !== $this->databaseInsertRecord($this->tableAuthUser, NULL, $data)) {\n $this->addMsg(MSG_INFO, $this->_gt('New user created.'));\n $this->params['uid'] = $userId;\n //ok now we change all resourcen to this user - because it is the only one.\n $data = array(\n 'author_id' => $userId,\n 'author_group' => -1\n );\n $this->databaseUpdateRecord(PAPAYA_DB_TBL_TOPICS, $data, array(1 => 1));\n $this->databaseUpdateRecord(PAPAYA_DB_TBL_TOPICS_PUBLIC, $data, array(1 => 1));\n $data = array(\n 'version_author_id' => $userId\n );\n $this->databaseUpdateRecord(PAPAYA_DB_TBL_TOPICS_VERSIONS, $data, array(1 => 1));\n return TRUE;\n }\n }\n }\n return FALSE;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if default section exists. | function admin_has_default_section(string $section)
{
return app('admin.sections')->hasDefaultSection($section);
} | [
"public function getDefaultSection()\n {\n return $this->_config->DefaultSection;\n }",
"public function hasDefaultConfigLoader();",
"protected function get_settings_for_default_section()\n {\n }",
"public function section_exists($section)\n\t{\n\t\tif (isset($this->config[$section]))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function defaultableSections($section = NULL);",
"function defaultable_sections(&$sections, $section = NULL) { }",
"public function if_default_template_exists() {\n\t\tglobal $wpdb;\n\n\t\t/* @noinspection SqlNoDataSourceInspection */\n\n\t\t/* @noinspection SqlResolve */\n\t\treturn (bool) $wpdb->get_var( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type = %s\", array(\n\t\t\t'Sermon Manager',\n\t\t\t$this->post_type,\n\t\t) ) );\n\t}",
"public function makeDefault()\n\t{\n\t\tif (!$this->exists() || !$this->get('offering_id'))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t$sections = $this->_tbl->find(array('offering_id' => $this->get('offering_id')));\n\t\tforeach ($sections as $section)\n\t\t{\n\t\t\t$section = new Section($section);\n\t\t\t$section->set('is_default', 0);\n\t\t\t$section->store(false);\n\t\t}\n\n\t\t$this->set('is_default', 1);\n\n\t\treturn $this->store(false);\n\t}",
"public function hasConfiguredDefaultNode(): bool\n {\n return $this->defaultNode !== null;\n }",
"public function hasDefaultConfigLoader() {\n return !is_null($this->getDefaultConfigLoader());\n }",
"public function defaultableSections(&$sections, $section = NULL) {}",
"function sectionIDexists($sectionID) {\n return isset($this->varList[$sectionID]);\n }",
"public function hasDefaultRoute()\n {\n return !empty($this->default_route['uri']);\n }",
"public function defaultableSections(&$sections, $section = NULL)\n {\n }",
"private function isDefaultPart($part){\n\t\treturn in_array($part, array('module', 'controller', 'action'));\n\t}",
"public function hasSection($name){\n return isset(self::$section[$name]);\n }",
"public function _is_default( $key ) {\n return $this->settings[ $key ] === $this->default_settings[ $key ];\n }",
"public function isDefault() : bool\n {\n return $this->route['default'];\n }",
"public function is_default_layout() {\n\t\t// typecast as string because \"foo\" == 0, which isn't what we want to see\n\t\treturn $this->tabs('welcome')->wp_id == (string)self::DEFAULT_LAYOUT_WPID;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to send data in format "ticket:price". | function sendMessage($id, $ticket, $price) {
echo "id: $id\n";
echo "data: $ticket:$price\n\n";
ob_flush();
flush();
} | [
"public static function sendOrderInfo($cust_cntc,$prod_name,$ord_id,$amount,$date,$slot) {\n\t// Authorisation details.\n\t$username = \"info@clairvoyantbizinfo.com\";\n\t$hash = \"79956da845dcb3a2da236fbe528defd65ab43107ad215160d73fe0a473e5dc0f\";\n\n\t// Config variables. Consult http://api.textlocal.in/docs for more info.\n\t$test = \"1\";\n\n\t// Data for text message. This is the text message data.\n\t$sender = \"HOMBIZ\"; // This is who the message appears to be from.\n//\t$numbers = \"910000000000\"; // A single number or a comma-seperated list of numbers\n//\t$message = \"This is a test message from the PHP API script.\";\n\t$numbers = $cust_cntc; //\"910000000000\"; // A single number or a comma-seperated list of numbers\n//\t$message = $this->message; //\"This is a test message from the PHP API script.\";\n\t// 612 chars or less\n\t// A single number or a comma-seperated list of numbers\n $message=\"\";\n \n echo \"Order #$ord_id confirmed for $prod_name amounting to INR $amount/- would be delivered on $date between $slot.%nRegards,%nTeam HomeBiz365.\";\n $message = rawurlencode(\"Order #$ord_id confirmed for $prod_name amounting to INR $amount/- would be delivered on $date between $slot.%nRegards,%nTeam HomeBiz365.\");\n// if($message!=\"\") {\n\t$data = \"username=\".$username.\"&hash=\".$hash.\"&message=\".$message.\"&sender=\".$sender.\"&numbers=\".$numbers.\"&test=\".$test;\n\t$ch = curl_init('http://api.textlocal.in/send/?');\n\tcurl_setopt($ch, CURLOPT_POST, true);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t$result = curl_exec($ch); // This is the result from the API\n\tcurl_close($ch);\n echo \"res \".$result;\n return true;\n// }\n}",
"function purchase_ticket()\n\t{\n\n $r = $this->ipsclass->DB->build_and_exec_query( array( 'select' => \t\t\t'MAX(round) as round',\n\t\t\t'from' => 'lotto_champs'\n) );\n$new_round = $r['round'] + 1;\n\n\t\t\t$count = $this->ipsclass->DB->build_and_exec_query( array( \t\t\t'select' => 'COUNT(round) AS total',\n\t\t\t'from' => 'lotto',\n\t\t\t'where' => 'm_id='.$this->ipsclass->member['id'].' AND round='.$new_round,\n\t\t\t) );\n\n if($count['total'] >= $this->ipsclass->vars['lotto_limit'])\n\t\t{\n\t\t\t$this->ipsclass->Error(array(LEVEL => 1, MSG => 'error_max_tickets'));\n\t\t}\n\n if($this->ipsclass->vars['lotto_price'] > $this->ipsclass->member['points'])\n\t\t{\n\t\t\t$this->ipsclass->Error(array(LEVEL => 1, MSG => 'error_not_enough_for_ticket'));\n\t\t}\n\t\t\t\t\t \n\t\t$this->output .= $this->ipsclass->compiled_templates['skin_points']->buy_tickets();\t\n\t\t\n\t\t$this->page_title = $this->ipsclass->lang['buy_ticket'];\n\t\t$this->nav[] = $this->ipsclass->lang['navigation'];\n\t}",
"function sendTickets() {\n\n\t\t\t\n\t\t\t$db = JFactory::getDBO();\n\t\t\t\n\t\t\t## Selecting tickets to create. LIMIT = 10 (otherwise the server will overload)\n\t\t\t## Sometimes it will be better to run an extra cronjob.\n\t\t\t$sql='SELECT ordercode FROM #__ticketmaster_orders\n\t\t\t\t WHERE pdfcreated = 1 \n\t\t\t\t AND paid = 1 \n\t\t\t\t AND pdfsent = 0 \n\t\t\t\t GROUP BY ordercode \n\t\t\t\t LIMIT 0, 10'; \n\n\t\t\t$db->setQuery($sql);\n\t\t\t$data = $db->loadObjectList();\t\t\t\t \n\n\n\t\t\t$k = 0;\n\t \t\tfor ($i = 0, $n = count($data); $i < $n; $i++ ){\n\n\t\t\t\t$row = &$data[$i];\n\n\t\t\t\t## Include the confirmation class to sent the tickets. \n\t\t\t\t$path_include = JPATH_ADMINISTRATOR.DS.'components'.DS.'com_ticketmaster'.DS.'classes'.DS.'sendonpayment.class.php';\n\t\t\t\tinclude_once( $path_include );\n\t\t\t\t\n\t\t\t\t## Sending the ticket immediatly to the client.\n\t\t\t\t$creator = new sendonpayment( (int)$row->ordercode ); \n\t\t\t\t$creator->send();\n\n\t\t\t\t$k=1 - $k;\n\t\t\t\t\n\t\t\t}\n\t\t\n\t}",
"function get_ticket() {\n $params = $this->parameters; //get post data back\n\t $p = explode('#',$params);\n\t $trid = $p[1]; \n\t //echo '>'.$trid;\n\t \n $ticket = GetGlobal('controller')->calldpc_method(\"shtransactions.getTransactionStoreData use type1+\".$trid);\t \n\t \n\t return ($ticket);\n }",
"function grab_ticket_num_ext_post()\n {\n\t\t$fparam = $this->input->post('fparam', TRUE);\n\t\t$fdigits = $this->input->post('fdigits', TRUE);\n\t\t\n // $result = $this->MOutgoing->get_key_data($fparam, $fcode);\n $result = $this->MOutgoing->get_key_data_ext($fparam, $fdigits);\n $ranstring = $this->common->randomString();\n \n\t\t$arrWhere = array('outgoing_num'=>$result);\n $count_exist = $this->MOutgoing->check_data_exists($arrWhere);\n\n if($count_exist > 0)\n {\n\t\t\t// $result2 = $this->MOutgoing->get_key_data($fparam, $fcode);\n\t\t\t$result2 = $this->MOutgoing->get_key_data_ext($fparam, $fdigits);\n\t\t\t$result = $result2;\n }\n else\n {\n\t\t\t$result = $result;\n }\n\t\t\n $this->response([\n 'status' => TRUE,\n 'result' => $result\n ], REST_Controller::HTTP_OK);\n }",
"function grab_ticket_num_ext_post()\n {\n\t\t$fparam = $this->input->post('fparam', TRUE);\n\t\t$fdigits = $this->input->post('fdigits', TRUE);\n\t\t\n // $result = $this->MIncoming->get_key_data($fparam, $fcode);\n $result = $this->MIncoming->get_key_data_ext($fparam, $fdigits);\n $ranstring = $this->common->randomString();\n \n\t\t$arrWhere = array('incoming_num'=>$result);\n $count_exist = $this->MIncoming->check_data_exists($arrWhere);\n\n if($count_exist > 0)\n {\n\t\t\t// $result2 = $this->MIncoming->get_key_data($fparam, $fcode);\n\t\t\t$result2 = $this->MIncoming->get_key_data_ext($fparam, $fdigits);\n\t\t\t$result = $result2;\n }\n else\n {\n\t\t\t$result = $result;\n }\n\t\t\n $this->response([\n 'status' => TRUE,\n 'result' => $result\n ], REST_Controller::HTTP_OK);\n }",
"function submitTicket($data, $token){\n\t\t$url = $this->conn->tokenGrab(x);\n\t\t$headers = array(\n\t\t\t\"Authorization: Bearer $token\",\n\t\t\t\"Content-Type: application/json\"\n\t\t);\n\t\t$data_string = json_encode($data);\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\n\t\t$results = curl_exec($ch);\n\n\t\treturn $results;\n\t}",
"function osa_mail_ticket(&$message, $params) {\n\n $commerce_order = $params['commerce_order'];\n\n $message['subject'] = \"Your eTicket(s) from The Oakville Suzuki Association for order #{$commerce_order->order_id}\";\n $message['body'][] = <<<EOD\nThis email contains your <strong>eTicket(s)</strong> for order #{$commerce_order->order_id}.<br />\n<br />\n<span style=\"font-size: 150%;\"><strong><em>Please print this email and bring it to the concert.</em></strong></span><br />\n<br />\n<br />\nEOD;\n\n $order_wrapper = entity_metadata_wrapper('commerce_order', $commerce_order);\n foreach ($order_wrapper->commerce_line_items as $line_item_wrapper) {\n $line_item = $line_item_wrapper->value();\n $quantity = 0;\n\n if (($line_item->type == 'civi_event') && ($line_item->data['contributionTypeID'] == OSA_FINTYPE_CONCERT_TICKET)) {\n $quantity = $line_item->quantity;\n $event_id = $line_item_wrapper->civicrm_commerce_event_id->value();\n }\n elseif (($line_item->type == 'product') && ($line_item_wrapper->commerce_product->type->value() == 'commerce_ticket')) {\n $quantity = $line_item->quantity;\n $product = $line_item_wrapper->commerce_product->value();\n $event_id = $product->field_event[LANGUAGE_NONE][0]['civicrm_reference_id'];\n }\n for ($i = 1; $i <= $quantity; $i++) {\n $message['body'][] = _osa_create_ticket($event_id, $line_item->line_item_id, $i);\n }\n }\n\n/*\n require_once 'CRM/Utils/PDF/Utils.php';\n $message['params']['attachments'][] = array(\n 'filecontent' => CRM_Utils_PDF_Utils::html2pdf($tickets_html, 'eTicket.pdf', TRUE),\n 'filename' => 'eTicket.pdf',\n 'filemime' => 'application/pdf',\n );\n*/\n\n $message['body'][] = <<<EOD\n<br />\n<br />\nThank you for supporting The Oakville Suzuki Association.<br />\n<br />\n<br />\n<strong>The Oakville Suzuki Association</strong><br />\n<em>\"Music exists for the purpose of growing an admirable heart.\" - Shinichi Suzuki</em><br />\nhttp://oakvillesuzuki.org<br />\nadmin@oakvillesuzuki.org<br />\nEOD;\n\n}",
"function grab_ticket_num_post()\n {\n\t\t$fparam = $this->input->post('fparam', TRUE);\n\t\t\n $result = $this->MOutgoing->get_key_data_sql($fparam, 5);\n $ranstring = $this->common->randomString();\n \n\t\t$arrWhere = array('outgoing_num'=>$result);\n $count_exist = $this->MOutgoing->check_data_exists($arrWhere);\n\n if($count_exist > 0)\n {\n\t\t\t$result2 = $this->MOutgoing->get_key_data_sql($fparam, 5);\n\t\t\t$result = $result2;\n }\n else\n {\n\t\t\t$result = $result;\n }\n\t\t\n $this->response([\n 'status' => TRUE,\n 'result' => $result\n ], REST_Controller::HTTP_OK);\n }",
"private function eetSend($price, $receiptNumber, $premiseId, $cashregister){\n $companies = new Companies();\n $company = $companies->findOrFail(session('selectedCompany'));\n $crypto = new CryptographyService(DIR_CERT . session('selectedCompany').'/private.key', DIR_CERT . session('selectedCompany').'/public.pub');\n $configuration = new Configuration(\n $company->dic,\n $premiseId,\n $cashregister,\n new EvidenceEnvironment(EvidenceEnvironment::PLAYGROUND),\n false\n );\n\n $client = new Client($crypto, $configuration, new GuzzleSoapClientDriver(new \\GuzzleHttp\\Client()));\n\n $receipt = new Receipt(\n true,\n null,\n $receiptNumber,\n new \\DateTimeImmutable('now'),\n $price\n );\n\n try {\n $response = $client->send($receipt);\n return ['fik' => $response->getFik(), 'bkp' => $response->getBkp()];\n }\n catch (\\SlevomatEET\\FailedRequestException $e) {\n echo $e->getRequest()->getPkpCode(); // if request fails you need to print the PKP and BKP codes to receipt\n return ['fik' => 'error', 'bkp' => $e->getRequest()->getBkpCode()];\n } catch (\\SlevomatEET\\InvalidResponseReceivedException $e) {\n echo $e->getResponse()->getRequest()->getBkpCode(); // on invalid response you need to print the PKP and BKP too\n return ['fik' => 'error', 'bkp' => $e->getResponse()->getRequest()->getBkpCode()];\n }\n }",
"function escposticket ($detalleRecibo,$sede,$dirSede,$printer,$turno,$nitRecibo){\n \n log_message(\"DEBUG\", \"-----------------------------------\");\n log_message(\"DEBUG\", \"TICKET Impresion\");\n log_message(\"DEBUG\", \"Turno: \".$turno);\n log_message(\"DEBUG\", \"Impresora: \".$printer);\n \n try {\n \n /*Conexion a la Impresora*/\n $nombre_impresora = $printer; \n $connector = new WindowsPrintConnector($nombre_impresora);\n $printer = new Printer($connector);\n\n /* Impresion de Logo */\n /*$logo = EscposImage::load(APPPATH.'third_party/tickets/logo.png', false);\n $printer -> setJustification(Printer::JUSTIFY_CENTER);\n $printer -> graphics($logo);*/\n\n /* Nombre del Restaurante (sede) */\n $printer -> setJustification(Printer::JUSTIFY_CENTER);\n $printer -> selectPrintMode(Printer::MODE_DOUBLE_WIDTH);\n $printer -> text($sede.\"\\n\");\n $printer -> selectPrintMode();\n $printer -> text($dirSede.\"\\n\");\n /*Valida si el parametro de NIT esta habilitado, se muestra en Ticket*/\n if ($nitRecibo != NULL){\n $printer -> setTextSize(1, 1);\n $printer -> text($nitRecibo.\"\\n\");\n }\n $printer -> feed();\n\n /* Turno */\n $printer -> setEmphasis(true);\n //$printer -> setTextSize(2, 2);\n $printer -> text(\"Detalle de Venta #\".$detalleRecibo['general']->nroRecibo.\"\\n\");\n $printer -> text(\"Lugar: \".$detalleRecibo['general']->nombreMesa.\"\\n\");\n $printer -> setEmphasis(false);\n $printer -> feed();\n \n /* Cliente */\n $printer -> setEmphasis(true);\n $printer -> setJustification(Printer::JUSTIFY_LEFT);\n $printer -> text(\"Cliente: \".$detalleRecibo['general']->personaCliente.\"\\n\");\n $printer -> text(\"NIT/CC: \".$detalleRecibo['general']->idUsuarioCliente.\"\\n\");\n $printer -> setEmphasis(false);\n\n /* Items */\n $printer -> selectPrintMode();\n $printer -> setJustification(Printer::JUSTIFY_LEFT);\n $printer -> setEmphasis(true);\n $printer -> text(new item('', '$'));\n $printer -> setEmphasis(false);\n /*Servicios*/\n if ($detalleRecibo['servicios'] != NULL){\n foreach ($detalleRecibo['servicios'] as $valueServ){\n //log_message(\"DEBUG\", $value['descServicio'].'('.$value['cantidad'].') -> '.$value['valor']);\n $printer -> text(new item(\"(\".$valueServ['cantidad'].\") \".$valueServ['descServicio'],$valueServ['valor']));\n }\n }\n /*Productos*/\n if ($detalleRecibo['productos'] != NULL){\n foreach ($detalleRecibo['productos'] as $valueProd){\n //log_message(\"DEBUG\", $value['descServicio'].'('.$value['cantidad'].') -> '.$value['valor']);\n $printer -> text(new item(\"(\".$valueProd['cantidad'].\") \".$valueProd['descProducto'],$valueProd['valor']));\n }\n }\n /*Adicionales*/\n if ($detalleRecibo['adicional'] != NULL){\n foreach ($detalleRecibo['adicional'] as $valueAdc){\n //log_message(\"DEBUG\", $value['descServicio'].'('.$value['cantidad'].') -> '.$value['valor']);\n $printer -> text(new item($valueAdc['cargoEspecial'],$valueAdc['valor']));\n }\n }\n /*SubTotal 1*/\n $printer -> setEmphasis(true);\n $printer -> text(new item('Subtotal 1',number_format($detalleRecibo['general']->valorTotalVenta,0,',','.')));\n $printer -> text(new item('Descuento('.($detalleRecibo['general']->porcenDescuento*100).'%)','-'.number_format(($detalleRecibo['general']->valorTotalVenta-$detalleRecibo['general']->valorLiquida),0,',','.')));\n $printer -> text(new item('Subtotal 2',number_format($detalleRecibo['general']->valorLiquida,0,',','.')));\n $printer -> text(new item('Servicio('.($detalleRecibo['atencion']).'%)',number_format(($detalleRecibo['general']->valorLiquida*$detalleRecibo['atencion']/100),0,',','.')));\n $printer -> setEmphasis(false);\n $printer -> feed();\n \n /* Total */\n $printer -> selectPrintMode(Printer::MODE_DOUBLE_WIDTH);\n $printer -> text(new item('Total a Pagar', number_format($detalleRecibo['general']->valorLiquida+($detalleRecibo['general']->valorLiquida*$detalleRecibo['atencion']/100),0,',','.'), true));\n $printer -> selectPrintMode();\n if($detalleRecibo['impuesto'] == 1){\n $printer -> text(new item('Impoconsumo', number_format(($detalleRecibo['general']->valorLiquida+($detalleRecibo['general']->valorLiquida*$detalleRecibo['atencion']/100))*$detalleRecibo['general']->impoconsumo,0,',','.')));\n }\n $printer -> selectPrintMode();\n\n /* Pie de Pagina */\n $printer -> feed(2);\n $printer -> setJustification(Printer::JUSTIFY_CENTER);\n $printer -> text(\"Gracias por Preferirnos!!\\n\");\n $printer -> feed(2);\n $printer -> text(\"Freya Software - Amadeus Soluciones\\n\");\n $printer -> text(date('d/m/Y h:i:s') . \"\\n\");\n\n /* Corta el Papel y Finaliza */\n $printer -> cut();\n $printer -> close();\n \n } catch (Exception $e){\n \n log_message(\"DEBUG\", \"TICKET ERROR -> \".$e);\n \n }\n}",
"function grab_ticket_num_post()\n {\n\t\t$fparam = $this->input->post('fparam', TRUE);\n\t\t\n $result = $this->MIncoming->get_key_data_sql($fparam, 5);\n $ranstring = $this->common->randomString();\n \n\t\t$arrWhere = array('incoming_num'=>$result);\n $count_exist = $this->MIncoming->check_data_exists($arrWhere);\n\n if($count_exist > 0)\n {\n\t\t\t$result2 = $this->MIncoming->get_key_data_sql($fparam, 5);\n\t\t\t$result = $result2;\n }\n else\n {\n\t\t\t$result = $result;\n }\n\t\t\n $this->response([\n 'status' => TRUE,\n 'result' => $result\n ], REST_Controller::HTTP_OK);\n }",
"public function generateTicket($email, $trainDesignation, $validation, $origin, $destination, $departureTime, $arrivalTime, $price) {\n $uuid4 = Uuid::uuid4();\n $userID = $this->getUserByEmail($email);\n if($userID==NULL){\n return -1;\n }\n $stmt = $this->conn->prepare(\"INSERT INTO ticket(id,userID,trainDesignation,validation,origin,destination,departureTime,arrivalTime,price) VALUES(?,?,?,?,?,?,?,?,?)\");\n $stmt->bind_param(\"sisissssd\", $uuid4, $userID, $trainDesignation, $validation, $origin, $destination, $departureTime, $arrivalTime, $price);\n $result = $stmt->execute();\n\n $stmt->close();\n $i=0;\n $hash = hash('sha256',$uuid4);\n for($i=0;$i<998;$i++){\n $hash=hash('sha256',$hash);\n }\n $encrypted_signature = null;\n if ($result) {\n $sql = \"SELECT private FROM `encryption_keys`;\";\n $result = $this->conn->query($sql);\n if ($result->num_rows > 0) {\n $row = $result->fetch_assoc();\n $key=$row['private'];\n $key = wordwrap($key, 65, \"\\n\", true);\n $key = <<<EOF\n-----BEGIN RSA PRIVATE KEY-----\n$key\n-----END RSA PRIVATE KEY-----\nEOF;\n \n openssl_private_encrypt($hash, $encrypted_signature, openssl_pkey_get_private($key)); \n } else {\n $response[\"error\"] = true;\n $response[\"message\"] = \"Oops! An error occurred while purchasing ticket! Database may be down\";\n return $response;\n }\n $signature=base64_encode($encrypted_signature);\n $response = array(\n 'id' => $uuid4,\n 'userID' => $userID,\n 'trainDesignation' => $trainDesignation,\n 'validation' => $validation,\n 'origin' => $origin,\n 'destination' => $destination,\n 'departureTime' => $departureTime,\n 'arrivalTime' => $arrivalTime,\n 'price' => $price,\n 'signature' => $hash\n );\n $response[\"error\"] = 0;\n return $response;\n } else {\n $response[\"error\"] = -1;\n $response[\"message\"] = \"Oops! An error occurred while purchasing ticket\";\n return $response;\n }\n }",
"public function sendData($data);",
"function email_ticket($customer_data, $ticket) {\r\n //find an available ticket for that batch\r\n //send to customer \r\n $status = $this->email_ticket_customer($customer_data, $ticket);\r\n // if ($status) {\r\n // echo \"status of sent email \" . --$status;\r\n $this->update_ticket_status($ticket_data['Ticket']['id'], 'ticket_email_message_status', '1');\r\n // } else {\r\n // }\r\n return true;\r\n ///ticket data will be apppended to show whom the tickt was sent to \r\n //text messagin component will be used here\r\n }",
"function create_ticket_from_message($input) {\n // process the input data and return results\n $success = true;\n global $zen;\n global $egate_user;\n global $egate_default_options;\n global $egate_create_fields;\n global $egate_create_overrides;\n\n // decode the data\n $params = decode_contents($input);\n \n // validate the data\n if( !validate_params($params) ) { egate_log_write(); return false; }\n\n // create the body elements\n $body = $egate_default_options;\n $body[\"title\"] = $params->headers[\"subject\"];\n $body[\"details\"] = trim($params->body);\n $body[\"creator_id\"] = $egate_user[\"user_id\"];\n\n // add in overrides, if the user has specified any by putting\n // 'field:value' entries at the top of the message body\n if( $egate_create_overrides == 1 && count($egate_create_fields) > 0 ) {\n $i=0;\n $match = '/^ *('.join('|',$egate_create_fields).') *: *(.+)/i';\n while( preg_match( $match, $body['details'], $matches) && $i < 1000 ) {\n\t$body[\"{$matches[1]}\"] = trim($matches[2]);\n\t$body['details'] = trim(preg_replace($match, '', $body['details']));\n\t$i++;\n }\n }\n\n // determine who sent the email and make sure it has\n // a return address\n list($name,$email) = get_name_and_email($params);\n $user_id = find_user_id($name,$email);\n\n // don't process tickets with no return address\n if( !$email ) {\n egate_log(\"No return email address\",2);\n $success = false;\n } \n \n // create the ticket\n if( $success ) { \n $id = create_new_ticket($user_id,$name,$email,$body);\n }\n\n // todo: send a reply email\n $rec = array(array(\"name\"=>$name,\"email\"=>$email));\n $rep = send_reply_mail( $rec, $id, $success, \"new ticket\" );\n if( !$rep ) {\n egate_log(\"reply email failed to $name <$email>\",2);\n }\n\n // close up shop\n egate_log_write();\n return $success;\n }",
"public function getSendData();",
"private function sendPriceList($param)\n {\n\n if (file_exists($param[\"PATH_FULL\"])) {\n\t\theader('HTTP/1.1 200');\n\t\theader (\"Content-Type: application/octet-stream\"); \n\t\theader (\"Accept-Ranges: bytes\"); \n\t\theader (\"Content-Length: \".filesize($param[\"PATH_FULL\"])); \n\t\theader (\"Content-Disposition: attachment; filename=\".$param[\"FILE\"]); \n\t\techo file_get_contents ($param[\"PATH_FULL\"]);\n\t\treturn \"\";\n\t\t//readfile($pathFull); \n\t}\n\n return Request::get();\n }",
"public abstract function sendData($data);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ void dump($variable) Facilitates debugging by dumping contents of variable to browser. | function dump($variable)
{
// dump variable using some quick and dirty (albeit invalid) XHTML
if (!$variable && !is_numeric($variable))
print("Variable is empty, null, or not even set.");
else
print("<pre>" . print_r($variable, true) . "</pre>");
// exit immediately so that we can see what we printed
exit;
} | [
"function dump($variable)\n {\n // dump variable with some quick and dirty HTML\n require(\"dump.php\");\n\n // exit immediately so that we can see what we printed\n exit;\n }",
"function debug($variable){\n echo '<pre>' . print_r($variable, true) . '</pre>';\n }",
"function wdf_dump($variable,$label=null,$class=null,$force=false){\n if(!DEBUG && !$force){return false;}\n echo \"\\n<!-- dump -->\\n\";\n echo \"<pre class='debug \".$class.\"'>\\n\";\n if($label<>null){echo \"<b>\".$label.\"</b>\\n\";}\n if(is_string($variable)){$variable=str_replace(array(\"<\",\">\"),array(\"<\",\">\"),$variable);}\n print_r($variable);\n echo \"</pre>\\n<!-- /dump -->\\n\";\n}",
"function my_var_dump( $var_name, $variable )\n{\n\techo \" VAR_DUMP OF $var_name\";\n\techo \"<pre>\";\n\tvar_dump( $variable );\n\techo \"</pre>\";\n}",
"function dvar_dump($var, $varname = null)\n{\n if (EXECUTION_MODE == 'LIVE') return;\n global $debug_output;\n\n ob_start();\n var_dump($var);\n if ($varname == null)\n {\n $out = \"\\n<!-- \" . ob_get_clean() . \" -->\\n\";\n }\n else\n {\n $out = \"\\n<!-- ${varname}: \\n\" . ob_get_clean() . \" -->\\n\";\n }\n\n $debug_output .= $out;\n}",
"function beautifiedVarDump($var) {\n echo '<pre>';\n var_dump($var);\n echo '</pre>';\n}",
"function dump_var()\n\t{\n\t\tob_start();\n\n\t\tcall_user_func_array('var_dump', func_get_args());\n\n\t\techo '<pre>' . ob_get_clean() . '</pre>';\n\t}",
"function d($a_var) {\n global $xdebug_on;\n\tif (!$xdebug_on) {\n echo(\"<pre>\");\n\t\tob_start();\n\t\tvar_dump($a_var);\n\t\t$a = ob_get_contents();\n\t\tob_end_clean();\n\t\techo htmlspecialchars($a, ENT_QUOTES);\n\t\techo(\"</pre>\");\n\t} else {\n\t var_dump($a_var);\n\t}\n}",
"function dumpX($var)\n{\n dump($var);\n exit;\n}",
"public static function dumpVar() : void {\n foreach (func_get_args() as $arg) {\n if (is_array($arg)) {\n self::dumpArray($arg, 1);\n } elseif (is_object($arg)) {\n self::dumpObject($arg, 1);\n } else {\n if (is_null($arg)) {\n echo(\"<strong>NULL</strong>\".self::EOL);\n } elseif (is_string($arg)) {\n echo(\n gettype($arg).\" (\".strlen($arg).\"): <strong>\".(empty($arg)?\"EMPTY\":$arg).\"</strong>\".self::EOL\n );\n } else {\n echo(gettype($arg).\": <strong>\".self::specialToString($arg).\"</strong>\".self::EOL);\n }\n }\n }\n }",
"function dump($var)\n{\n var_dump($var);\n return $var;\n}",
"protected function evalVarDump($variable)\n {\n $dumper = new HtmlDumper;\n $cloner = new VarCloner;\n\n $output = '<div style=\"display:none\">';\n $output .= $dumper->dump($cloner->cloneVar($variable), true);\n $output .= '</div>';\n\n return $output;\n }",
"function pre_var_dump($var) {\n print \"<pre style=\\\"text-align: left\\\">\\n\";\n \n ob_start();\n var_dump($var);\n print clean(ob_get_clean());\n \n print \"</pre>\\n\";\n }",
"function dump($value){\n die(var_dump($value));\n}",
"function _var_dump($var) \n{\n\tif (is_dev()) // display info only to developers\n\t{\n\t\techo \"\\n\".'<pre style=\"border:1px dotted blue; color:#000;background:#fff;text-align:left\">'.\"\\n\";\n\t\tvar_dump($var);\n\t\techo \"\\n\".'</pre>';\n\t}\n}",
"public static function dd(...$variable): void\n {\n $GLOBALS['_DIE'][__METHOD__] = true;\n\n self::dump(...$variable);\n die;\n }",
"public function dump()\n {\n foreach (func_get_args() as $var) {\n $this->debug->push($var);\n }\n }",
"function get_var_dump_output($var)\n {\n startLayoutCapture();\n $myfunc = \"var_dump\";\n $myfunc($var);\n return endLayoutCapture();\n }",
"static function sdump($var,$format = true){\n\t\tif(current_user_can(\"manage_options\") || isset($_GET['wbf_debug'])){\n\t\t\tif($format){\n\t\t\t\tself::predump($var);\n\t\t\t}else{\n\t\t\t\tvar_dump($var);\n\t\t\t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends response to client builds response packet, serializes it and output it | public function sendResponse() {
$serializer = new Serializer();
$packet = new Packet();
foreach($this->amfRequest->getMessages() as $index => $message) {
$packet->messages[] =
(object) ['targetUri' => $message['response'].'/onResult', 'responseUri' => null,'data' => $this->responses[$index]];
}
$rawOutput = $serializer->serialize($packet);
echo $rawOutput;
} | [
"private function sendResponse(){\n\t\tif(!isset($this->rpcRequest->id)){ return; } // never respond to Notifications\n\n\t\t$response = new stdClass();\n\t\t$response->jsonrpc = \"2.0\";\n\t\t$response->id = $this->rpcRequest->id;\n\n\t\tif($this->responseError){\n\t\t\t$response->error = $this->responseError; // error response\n\t\t}else{\n\t\t\t$response->result = $this->responseResult; // normal response\n\t\t}\n\n\t\tif($this->rpcDebugLevel != self::LOG_NONE){\n\t\t\t$response->log = array();\n\t\t\tforeach($this->log as $msg){\n\t\t\t\tif($msg[\"level\"] <= $this->rpcDebugLevel){\n\t\t\t\t\t$response->log[] = $msg[\"message\"];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\techo $this->toJson($response);\n\t}",
"function sendResponse($response)\n {\n $encodedResponse = $this->_responseEncoder->encodeResponse($response);\n $contentType = $this->_responseEncoder->getContentType();\n\n @header('Content-Type: '.$contentType.'; charset='.get_pwg_charset());\n print_r($encodedResponse);\n trigger_notify('sendResponse', $encodedResponse );\n }",
"protected function send_response() {\n $this->send_headers();\n $xml = '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>'.\"\\n\";\n $xml .= '<RESPONSE>'.\"\\n\";\n $xml .= self::xmlize_result($this->returns, $this->function->returns_desc);\n $xml .= '</RESPONSE>'.\"\\n\";\n echo $xml;\n }",
"public function sendResponse(ResponseInterface $response)\n {\n $this->socketReadEvent->stop();\n $encoder = new Encoder();\n $stream = $encoder->encode($response);\n $buffer = $stream->getContents();\n $this->socketWriteEvent = new EvIo($this->connection->getSocket(), Ev::WRITE, function () use (&$buffer) {\n echo $length = $this->connection->write($buffer, strlen($buffer));\n Aurora::debug('write => size ' . $length . \" bytes\");\n if ($length === false) {\n Aurora::error('socket error');\n\n return;\n }\n $buffer = substr($buffer, $length);\n if (empty($buffer)) {\n $this->close();\n }\n });\n }",
"private function sendResponse(): void\n {\n header('Content-Type: application/json');\n http_response_code($this->statusCode);\n echo $this->response->generateJson();\n }",
"private static function send_response($response)\n {\n header(\"Content-type: text/xml\");\n header(\"Content-Transfer-Encoding: 8bit\");\n echo $response;\n }",
"function send()\n\t{\n\t\tif (NULL != $this->objResponse) {\n\t\t\tforeach ($this->aDebugMessages as $sMessage)\n\t\t\t\t$this->objResponse->debug($sMessage);\n\t\t\t$this->aDebugMessages = array();\n\t\t\t$this->objResponse->printOutput();\n\t\t}\n\t}",
"static function respond_with($response){\n\t\tignore_user_abort(true); # Set whether a client disconnect should abort script execution\n\t\tset_time_limit(0); # allow script to run forever\n\n\t\tob_start();\n\t\techo $response;\n\t\theader('Connection: close');\n\t\theader(\"Content-Encoding: none\"); # if compressed, content size will be smaller, and requester will continue waiting\n\t\theader('Content-Length: '.ob_get_length());\n\t\tob_end_flush(); # flush inner layer\n\t\tob_flush(); # flush all layers\n\t\tflush(); # push to browser\n\t}",
"private function echoServerResponse() {\n echo json_encode($this->serverResponse);\n exit();\n }",
"public function send(){\n $stringResponse = \"HTTP/1.0 {$this->response['status_code']} {$this->response['status_text']}\";\n\n header($stringResponse);\n if(array_key_exists('headers',$this->response)){\n foreach ($this->response['headers'] as $header){\n header($header);\n }\n }\n echo $this->response['data'];\n\n }",
"public function send()\n {\n echo $this->response;die;\n }",
"protected function respond()\n {\n $statusCode = $this->response->getStatusCode();\n\n //Don't resend headers if they've already been sent\n if (!headers_sent()) {\n header(sprintf(\n 'HTTP/%s %s %s',\n $this->response\n ->getProtocolVersion(),\n $statusCode,\n $this->response\n ->getReasonPhrase()\n ), true, $statusCode);\n\n $headers = $this->response\n ->getHeaders();\n\n //Set each individual header of the response if any exists.\n if (!empty($headers)) {\n foreach ($this->response->getHeaders() as $key => $values) {\n foreach ($values as $value) {\n header(sprintf(\n '%s: %s',\n $key,\n $value\n ), false);\n }\n }\n }\n }\n\n $responseSize = $this->response\n ->getBody()\n ->getSize();\n\n if ($responseSize !== null) {\n $response = $this->response\n ->withHeader('Content-Length', $responseSize.'');\n\n $body = $this->response\n ->getBody();\n\n if ($body->isSeekable()) {\n $body->rewind();\n }\n\n /*\n Notice that print and echo writes to the output stream and so there's no \n point in opening the stream to write the contents myself.\n */\n while (!$body->eof()) {\n echo $body->read(Stream::CHUNK_SIZE);\n\n /*\n If the connection status to the client is anythin but normal then stop \n writing data to the output stream\n */\n if (connection_status() != CONNECTION_NORMAL) {\n break;\n }\n }\n }\n }",
"function _voiptwilio_send_response($response) {\r\n $output .= '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>';\r\n $output .= '<Response>';\r\n $output .= $response;\r\n $output .= '</Response>';\r\n\r\n drupal_set_header('Content-Type: text/xml; charset=utf-8');\r\n print $output;\r\n\r\n return TRUE;\r\n}",
"function _sendResponse($response)\n {\n if(is_object($response) && is_a($response, 'HTML_AJAX_Response')) {\n $output = $response->getPayload();\n $content = $response->getContentType();\n } else {\n $serializer = $this->_getSerializer($this->serializer);\n $output = $serializer->serialize($response);\n if (isset($this->contentTypeMap[$this->serializer])) {\n //remember that IE is stupid and wants a capital T\n $content = $this->contentTypeMap[$this->serializer];\n }\n }\n // headers to force things not to be cached:\n $headers = array();\n //OPERA IS STUPID FIX\n if(isset($_SERVER['HTTP_X_CONTENT_TYPE']))\n {\n $headers['X-Content-Type'] = $content;\n $content = 'text/plain';\n }\n if ($this->_sendContentLength()) {\n $headers['Content-Length'] = strlen($output);\n }\n $headers['Expires'] = 'Mon, 26 Jul 1997 05:00:00 GMT';\n $headers['Last-Modified'] = gmdate( \"D, d M Y H:i:s\" ) . 'GMT';\n $headers['Cache-Control'] = 'no-cache, must-revalidate';\n $headers['Pragma'] = 'no-cache';\n $headers['Content-Type'] = $content.'; charset=utf-8';\n\n //intercept to wrap iframe return data\n if($this->_iframe)\n {\n $output = $this->_iframeWrapper($this->_iframe, $output, $headers);\n $headers['Content-Type'] = 'text/html; charset=utf-8';\n }\n $this->_sendHeaders($headers);\n echo $output;\n }",
"protected function sendResponse()\n {\n $this->getResponse()->representJson(\n $this->getMessageBlockJson()\n );\n }",
"public function send() {\n\t\t// set response header contact type to json utf-8\n\t\theader('Content-type:application/json;charset=utf-8');\n\t\t\n\t\t// if response is cacheable then add http cache-control header with a timeout of 60 seconds\n\t\t// else set no cache\n\t\tif($this->_toCache == true) {\n\t\t\theader('Cache-Control: max-age=60');\n\t\t}\n\t\telse {\n\t\t\theader('Cache-Control: no-cache, no-store');\n\t\t}\n\n\t\t// if response is not set up correctly, e.g. not numeric in status code or success not true or false\n\t\t// send a error response\n\t\tif(!is_numeric($this->_httpStatusCode) || ($this->_success !== false && $this->_success !== true )) {\n\t\t\t// set http status code in response header\n\t\t\thttp_response_code(500);\n\t\t\t// set statusCode in json response\n\t\t\t$this->_responseData['statusCode'] = 500;\n\t\t\t// set success flag in json response\n\t\t\t$this->_responseData['success'] = false;\n\t\t\t// set custom error message\n\t\t\t$this->addMessage(\"Response creation error\");\n\t\t\t// set messages in json response\n\t\t\t$this->_responseData['messages'] = $this->_messages;\n\t\t}\n\t\telse {\n\t\t\t// set http status code in response header\n\t\t\thttp_response_code($this->_httpStatusCode);\n\t\t\t// set statusCode in json response\n\t\t\t$this->_responseData['statusCode'] = $this->_httpStatusCode;\n\t\t\t// set success flag in json response\n\t\t\t$this->_responseData['success'] = $this->_success;\n\t\t\t// set messages in json response\n\t\t\t$this->_responseData['messages'] = $this->_messages;\n\t\t\t// set data array in json response\n\t\t\t$this->_responseData['data'] = $this->_data;\n\t\t}\n\n\t\t// encode the responseData array to json response output\n\t\techo json_encode($this->_responseData);\n\t}",
"public function print_response()\n {\n //Encode the response\n $this->response = json_encode($this->response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);\n\n //Output response\n print($this->response);\n }",
"public function send() {\n\t\tswitch($this->response_type) {\n\t\t\tcase API_MIME['application/json']:\n\t\t\t\tif ($this->response === NULL) {\n\t\t\t\t\t$this->response = [];\n\t\t\t\t}\n\t\t\t\tif (!isset($this->response['error'])) {\n\t\t\t\t\t// Make sure the error value exists.\n\t\t\t\t\t$this->response['error'] = API_E_OK;\n\t\t\t\t}\n\t\t\t\t$resp_str = json_encode($this->response);\n\t\t\t\tif (\n\t\t\t\t\t$resp_str === FALSE\n\t\t\t\t\t&& json_last_error() !== JSON_ERROR_NONE\n\t\t\t\t) {\n\t\t\t\t\tthrow new APIException(\n\t\t\t\t\t\tAPI_E_INTERNAL,\n\t\t\t\t\t\t\"Failed to encode response JSON.\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\techo $resp_str;\n\t\t\t\texit(0);\n\t\t\tcase API_MIME['libresignage/passthrough']:\n\t\t\t\tif (\n\t\t\t\t\t$this->response !== NULL\n\t\t\t\t\t&& is_resource($this->response)\n\t\t\t\t\t&& get_resource_type($this->response) == 'stream'\n\t\t\t\t\t&& stream_get_meta_data(\n\t\t\t\t\t\t$this->response\n\t\t\t\t\t)['stream_type'] == 'STDIO'\n\t\t\t\t) {\n\t\t\t\t\tfpassthru($this->response);\n\t\t\t\t\tfclose($this->response);\n\t\t\t\t}\n\t\t\t\texit(0);\n\t\t\tcase API_MIME['text/plain']:\n\t\t\t\tif ($this->response !== NULL) {\n\t\t\t\t\techo $this->response;\n\t\t\t\t}\n\t\t\t\texit(0);\n\t\t\tdefault:\n\t\t\t\texit(1);\n\t\t}\n\t}",
"private function response() {\n\t\t/*\n\t\tIn RESP, the type of some data depends on the first byte:\n\t\t \n\t For Simple Strings the first byte of the reply is \"+\"\n\t For Errors the first byte of the reply is \"-\"\n\t For Integers the first byte of the reply is \":\"\n\t For Bulk Strings the first byte of the reply is \"$\"\n\t For Arrays the first byte of the reply is \"*\"\n\n\t\t */\n\t\t$response = false;\n\t\t$respond = fgets($this->__redis, 512);\n\t\t//echo substr($response, 1);\n\t\tswitch ($respond[0]) {\n\t\t\tcase '+':\n\t\t\t\tif(substr($respond, 1) == 'OK')\n\t\t\t\t\t$response = true;\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\tthrow new Exception($respond, 1);\n\t\t\t\tbreak;\n\t\t\tcase '$':\n\t\t\t\t$countResp = intval(substr($respond,1));\n\t\t\t\tif($countResp == -1) {\n\t\t\t\t\t//Null bulk \n\t\t\t\t\t$response = NULL;\n\t\t\t\t} else {\n\t\t\t\t\t$resp = fread($this->__redis, $countResp+2);//+2 for \\r\\n\n\t\t\t\t\tif(!$resp)\n\t\t\t\t\t\tthrow new Exception(\"Response error \".$response, 1);\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $resp;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\t$countResp = intval(substr($respond,1));\n\t\t\t\t$response = array();\n\t\t\t\tfor ($i=0; $i < $countResp; $i++) { \n\t\t\t\t\t$response[] = $this->response();\n\t\t\t\t}\n\t\t\t\tbreak;\t\n\t\t\tdefault:\n\t\t\t\tthrow new \\Exception(\"Unknow response...\", 1);\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $response;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetches a fresh OAuth 2.0 access token by using a refresh token. | public function fetchAccessTokenWithRefreshToken( $refresh_token = null ) {
if ( null === $refresh_token ) {
if ( ! isset( $this->token['refresh_token'] ) ) {
throw new LogicException( 'refresh token must be passed in or set as part of setAccessToken' );
}
$refresh_token = $this->token['refresh_token'];
}
$this->getLogger()->info( 'OAuth2 access token refresh' );
$auth = $this->getOAuth2Service();
$auth->setRefreshToken( $refresh_token );
$http_handler = HttpHandlerFactory::build( $this->getHttpClient() );
$creds = $this->fetchAuthToken( $auth, $http_handler );
if ( $creds && isset( $creds['access_token'] ) ) {
$creds['created'] = time();
if ( ! isset( $creds['refresh_token'] ) ) {
$creds['refresh_token'] = $refresh_token;
}
$this->setAccessToken( $creds );
}
return $creds;
} | [
"function generate_access_token_from_refresh_token($oauth_details)\n{\n $config = get_config();\n $oauth_config = array(\n 'grant_type' => 'refresh_token',\n 'refresh_token' => $oauth_details['refresh_token'],\n 'client_id' => $config['client_id'],\n 'client_secret' => $config['client_secret']\n );\n $response = (array)json_decode(make_curl_request($config['access_token_endpoint'], $oauth_config), true);\n if($response['status'] != \"OK\"){\n return $response;\n }\n $result = $response['result']['data'];\n\n $oauth_details['access_token'] = $result['access_token'];\n $oauth_details['refresh_token'] = $result['refresh_token'];\n $oauth_details['scope'] = $result['scope'];\n\n return $oauth_details;\n}",
"public function refresh_token() {\n\t\t$refresh_token = $this->get_refresh_token();\n\t\tif ( empty( $refresh_token ) ) {\n\t\t\t$this->delete_token();\n\t\t\t$this->user_options->set( self::OPTION_ERROR_CODE, 'refresh_token_not_exist' );\n\t\t\treturn;\n\t\t}\n\n\t\t// Stop if google_client not initialized yet.\n\t\tif ( ! $this->google_client instanceof Google_Site_Kit_Client ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\t$token_response = $this->google_client->fetchAccessTokenWithRefreshToken( $refresh_token );\n\t\t} catch ( \\Exception $e ) {\n\t\t\t$this->handle_fetch_token_exception( $e );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! isset( $token_response['access_token'] ) ) {\n\t\t\t$this->user_options->set( self::OPTION_ERROR_CODE, 'access_token_not_received' );\n\t\t\treturn;\n\t\t}\n\n\t\t$this->set_access_token(\n\t\t\t$token_response['access_token'],\n\t\t\tisset( $token_response['expires_in'] ) ? $token_response['expires_in'] : '',\n\t\t\tisset( $token_response['created'] ) ? $token_response['created'] : 0\n\t\t);\n\t}",
"protected function requestNewAccessToken()\n {\n if ($this->refreshTokenGrantType && $this->rawToken && $this->rawToken->getRefreshToken()) {\n try {\n // Get an access token using the stored refresh token.\n $rawData = $this->refreshTokenGrantType->getRawData(\n $this->clientCredentialsSigner,\n $this->rawToken->getRefreshToken()\n );\n\n $this->rawToken = $this->tokenFactory($rawData, $this->rawToken);\n\n return;\n } catch (BadResponseException $e) {\n // If the refresh token is invalid, then clear the entire token information.\n $this->rawToken = null;\n }\n }\n\n if ($this->grantType === null) {\n throw new Exception\\ReauthorizationException('You must specify a grantType class to request an access token');\n }\n\n try {\n // Request an access token using the main grant type.\n $rawData = $this->grantType->getRawData($this->clientCredentialsSigner);\n\n $this->rawToken = $this->tokenFactory($rawData);\n } catch (BadResponseException $e) {\n throw new Exception\\AccessTokenRequestException('Unable to request a new access token', $e);\n }\n }",
"function oAuthRefreshToken() {\n\t\t\t$r = json_decode(BigTree::cURL($this->TokenURL,array(\n\t\t\t\t\"client_id\" => $this->Settings[\"key\"],\n\t\t\t\t\"client_secret\" => $this->Settings[\"secret\"],\n\t\t\t\t\"refresh_token\" => $this->Settings[\"refresh_token\"],\n\t\t\t\t\"grant_type\" => \"refresh_token\"\n\t\t\t)));\n\t\t\tif ($r->access_token) {\n\t\t\t\t$this->Settings[\"token\"] = $r->access_token;\n\t\t\t\t$this->Settings[\"expires\"] = strtotime(\"+\".$r->expires_in.\" seconds\");\n\t\t\t}\n\t\t}",
"private function get_access_token(){\n\t\t\n\t\t//if no code or refresh token, then this is first run. Login link will be displayed in view file\n\t\tif(@!$_REQUEST['code'] && !$this->refresh_token)\n\t\t\treturn false;\n\t\t\n\t\t//vars\n\t\t$ch = curl_init();\n\t\t$params = array();\n\t\t\n\t\t//first access\n\t\tif(@$_REQUEST['code'])\n\t\t\t$params = array(\n\t\t\t\t'code' => $_REQUEST['code'],\n\t\t\t\t'client_id' => $this->client_id,\n\t\t\t\t'client_secret' => $this->client_secret,\n\t\t\t\t'scope' => $this->scope,\n\t\t\t\t'redirect_uri' => $this->redirect_uri,\n\t\t\t\t'grant_type' => 'authorization_code'\n\t\t\t);\n\t\t//using refresh token\n\t\tif($this->refresh_token)\n\t\t\t$params = array(\n\t\t\t\t'refresh_token' => $this->refresh_token,\n\t\t\t\t'client_id' => $this->client_id,\n\t\t\t\t'client_secret' => $this->client_secret,\n\t\t\t\t'grant_type' => \"refresh_token\"\n\t\t\t);\n\t\t\n\t\t//curl connect\n\t\tcurl_setopt($ch, CURLOPT_URL, \"https://accounts.google.com/o/oauth2/token\");\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $params);\n\t\t$res = json_decode(curl_exec($ch));\n\t\t\n\t\tif(@$res->error){\n\t\t\t$this->set_refresh_token(false);\n\t\t\tprint \"<div class=\\\"error\\\">{$res->error}</div>\\n\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//set params and return\n\t\tif(@$res->refresh_token) $this->set_refresh_token( $res->refresh_token );\n\t\treturn $res->access_token;\t\t\n\t}",
"public function refresh_token() {\n $info = array(\n 'refresh_token' => $this->api_config['refresh_token'],\n 'grant_type' => 'refresh_token',\n 'client_id' => $this->api_config['client_id'],\n 'client_secret' => $this->api_config['client_secret']\n );\n\n // Get returned CURL request\n $request = $this->make_request(self::OAUTH2_TOKEN_URI, 'POST', 'normal', $info);\n\n if( isset($request->access_token) ) {\n // Push the new token into the api_config\n $this->api_config['access_token'] = $request->access_token;\n\n // Push the new token into the settings\n $this->token['access_token'] = $request->access_token;\n\n if( $this->provider_id === 0 ) {\n $this->update_gcal_option('ga_appointments_gcal_token', $this->token );\n } else {\n $this->update_gcal_option('ga_provider_gcal_token', $this->token );\n }\n\n // Return the token\n return $request;\n } else {\n return false;\n }\n }",
"public static function createOAuthRefresh()\n {\n return static::create(static::OAUTH_ACCESS_TOKEN, static::API_OAUTH);\n }",
"function getAccessTokenByRefreshToken($refresh_token, $scope)\n\t{\n\t\t$data = array(\n\t\t\t\t'grant_type' => \"refresh_token\",\n\t\t\t\t'refresh_token' => $refresh_token,\n\t\t\t\t'client_id' => $this->_clientId,\n\t\t\t\t'client_secret' => $this->_clientSecret,\n\t\t\t\t'scope' => $scope,\n\t\t);\n\t\t$request = $this->call('get', $this->_accessTokenURL, $data);\n\t\treturn $request;\n\t}",
"public function getRefreshToken($refresh_token);",
"public function refreshAccessToken()\n {\n if ($this->checkCredentials()) {\n $accessToken = json_decode(file_get_contents($this->CREDENTIALS_PATH), true);\n\n $this->client->setAccessToken($accessToken);\n\n // Refresh the token if it's expired.\n if ($this->client->isAccessTokenExpired()) {\n $this->client->fetchAccessTokenWithRefreshToken($this->client->getRefreshToken());\n file_put_contents($this->CREDENTIALS_PATH, json_encode($this->client->getAccessToken()));\n }\n }\n }",
"private function refreshToken() {\n\n $body = array(\"refresh\" => $this->authtokens[\"refresh\"]); \n $ch = curl_init($this->endpoints[\"refresh\"]);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Otherwise reponse=1\n curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 7); //Timeout after 7 seconds\n curl_setopt($ch, CURLINFO_HEADER_OUT, false);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));\n curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers);\n\n $result = curl_exec($ch);\n $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n if ($statusCode != 200) {\n $this->logError(sprintf(\"Unable to refresh auth token %s:\\n%s\\n\", $statusCode, $result));\n } else {\n $respObj = json_decode($result);\n if ($respObj->access != null) {\n $this->authtokens[\"access\"] = $respObj->access;\n }\n }\n }",
"private function refreshToken()\n {\n try {\n $tokens = $this->getLastToken();\n\n // Create a new GuzzleHTTP Client and define scopes\n $client = new Client();\n\n // Use the authorization code to fetch an access token\n $tokenQuery = array(\n \"grant_type\" => \"refresh_token\",\n \"refresh_token\" => $tokens[\"refresh_token\"]\n );\n\n $tokenUrl = $this->token_url.\"?\".http_build_query($tokenQuery);\n $response = $client->post(\n $tokenUrl, \n [\n 'auth' => [$this->client_id, $this->client_secret],\n 'curl' => array(CURLOPT_SSL_VERIFYPEER => false),\n 'verify' => false\n ]\n );\n\n // Insert in DB the new access token of Aweber\n $body = $response->getBody();\n $creds = json_decode($body, true);\n\n $qry = \"INSERT INTO tokens (access_token, refresh_token, token_type) VALUES (?, ?, ?);\";\n $this->_execQuery($qry, array($creds['access_token'], $creds['refresh_token'], $creds['token_type']));\n } catch (ClientException $e) {\n $response = $e->getResponse();\n error_log($response->getBody()->getContents());\n }\n }",
"public function refresh_oauth_tokens() {\n\n\t\t$this->request_uri = 'https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer';\n\n\t\t$request = $this->get_new_request( array(\n\t\t\t'type' => 'oauth2',\n\t\t) );\n\n\t\t$request->set_refresh_data( $this->get_gateway()->get_refresh_token() );\n\n\t\treturn $this->perform_request( $request );\n\t}",
"function refresh_token()\n {\n $url = self::API_ROOT_URL . \"/oauth/token\";\n\n $headers = array();\n $headers[] = 'Host: api.cronofy.com';\n $headers[] = 'Content-Type: application/json; charset=utf-8';\n\n $postfields = array(\n 'client_id' => $this->client_id,\n 'client_secret' => $this->client_secret,\n 'grant_type' => 'refresh_token',\n 'refresh_token' => $this->refresh_token\n );\n\n $result = $this->http_post($url, $postfields, $headers);\n\n $tokens = json_decode($result);\n if (!empty($tokens->access_token)) {\n $this->access_token = $tokens->access_token;\n $this->refresh_token = $tokens->refresh_token;\n return true;\n } else {\n return $tokens->error;\n }\n }",
"abstract protected function refreshAccessToken();",
"public function getRefreshToken();",
"public function authenticateByRefreshToken($clientId, $secret, $refreshToken);",
"private function fetchAccessToken()\n {\n $this->validateFetchTokenRequiredValues();\n //this section determines which grantType to use for authentication\n $usePasswordGrantType = ($this->userName && $this->password);\n $grantType = $usePasswordGrantType ? ServerData::$PASSWORD_GRANT_TYPE : ServerData::$DEFAULT_GRANT_TYPE;\n $this->log->info(\"Grant type for fetchAccessToken: \".$grantType);\n $response = RequestBuilder::getAuthenticationRequestBuilder($this->env)\n ->addClientId($this->clientId)\n ->addClientSecret($this->clientSecret)\n ->addGrantType($grantType)\n ->addUserName($this->userName)\n ->addPassword($this->password)\n ->build();\n $this->setRefreshToken($response['refresh_token']);\n $this->setAccessToken($response['access_token']);\n $this->setAccessTokenExpirationTimeInSeconds($response['expires_in']);\n }",
"public function refreshAccessToken()\n {\n return ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send a HTML response with $code and $body content. | function responseHtml(string $body='', int $code=200, array $headers=[])
{
global $app;
$headers = \array_merge(['Content-Type'=>'text/html'],$headers);
return \response($body,$code,$headers);
} | [
"public function send($code, $body = '')\n {\n if (!isset($this->codes[$code])) {\n $statusCode = 500;\n $body = 'API attempted to return an unknown HTTP status.';\n }\n // if the body wasn't defined, default to the inbuilt response\n if (!$body) $body = $this->codes[$code];\n header('HTTP/1.1 ' . $code . ' ' . $this->codes[$code]);\n header('Content-type: application/json');\n echo json_encode($body);\n exit;\n }",
"function sendResponse($status = 200, $body = '', $content_type = 'text/html')\n{\n $status_header = 'HTTP/1.1 ' . $status . ' ' . getStatusCodeMessage($status);\n header($status_header);\n header('Content-type: ' . $content_type);\n echo $body;\n}",
"function respond($code, $message, $content = null) {\n $response = new Response($code, $message, $content);\n header('Content-Type: application/json');\n header(\"X-PHP-Response-Code: $code\", true, $code);\n echo $response->serialize();\n die();\n}",
"protected function sendTextResponse($text='',$code=IResponse::S200_OK){\n $response=new Response();\n $response->code=$code;\n $httpResponse=$this->getHttpResponse();\n $httpResponse->setContentType('text/plain','UTF-8');\n $this->sendResponse(new TextResponse($text));\n }",
"private function sendResponseCode(): void\n {\n\n $http = sprintf(\n 'HTTP/%s %s %s',\n $this->versionProtocol,\n $this->responseCode,\n $this->httpCodeText[$this->responseCode]\n );\n\n header($http, true);\n http_response_code($this->responseCode);\n\n }",
"protected function sendResponseCode(): void\n {\n http_response_code($this->getCode());\n }",
"public function sendResponse($msg, $httpRespCode){\n http_response_code($httpRespCode); \n echo \"{$msg}\\n\";\n }",
"function respond($code, $message) {\n header('Content-Type: application/json');\n header(\"X-PHP-Response-Code: $code\", true, $code);\n echo '{\"message\": \"' . $message . '\"}';\n die();\n}",
"public function send(){\n\t\thttp_response_code($this->getStatusCode());\n\n\t\tforeach ($this->getHeaders() as $name => $val){\n\t\t\theader(\"$name: $val\");\n\t\t}\n\n\t\techo $this->getContent();\n\t}",
"function sendResponse($status = 200, $body = '', $content_type = 'text/html')\r\n{\r\n $status_header = 'HTTP/1.1 ' . $status . ' ' . getStatusCodeMessage($status);\r\n echo $body;\r\n}",
"public function sendResponse($msg, $httpRespCode){\n http_response_code($httpRespCode);\n echo \"{$msg}\\n\";\n }",
"public static function send_status($code) {\n\tif (!isset(static::$status_messages[$code])) {\n\t\t$code = self::STATUS_INTERNAL_SERVER_ERROR;\n\t}\n\t\n\thttp_response_code($code);\n}",
"function output() {\n if (isset($this->status)) {\n $this->send_header(sprintf('HTTP/1.1 %d %s',\n $this->status, $this->reason),\n TRUE,\n $this->status);\n }\n\n foreach ($this->headers as $k => $v) {\n $this->send_header(\"$k: $v\");\n }\n\n echo $this->body;\n }",
"private function sendResponse(): void\n {\n header('Content-Type: application/json');\n http_response_code($this->statusCode);\n echo $this->response->generateJson();\n }",
"protected function sendHtml()\n {\n if ($this->jsonData->has('redirectUrl')) {\n $redirect = new RedirectResponse($this->jsonData->get('redirectUrl'), $this->getStatusCode());\n return $redirect->send();\n } else {\n $this->headers->set('Content-Type', 'text/html');\n $this->setCharset('utf-8');\n return parent::send();\n }\n }",
"public function renderMessage($content, &$responseCode, array &$responseHeaders);",
"public function send(){\n $stringResponse = \"HTTP/1.0 {$this->response['status_code']} {$this->response['status_text']}\";\n\n header($stringResponse);\n if(array_key_exists('headers',$this->response)){\n foreach ($this->response['headers'] as $header){\n header($header);\n }\n }\n echo $this->response['data'];\n\n }",
"public function output()\n {\n if (isset($this->status)) {\n $this->send_header(sprintf('HTTP/1.1 %d %s',\n $this->status, $this->reason),\n true,\n $this->status);\n }\n\n foreach ($this->headers as $k => $v) {\n $this->send_header(\"$k: $v\");\n }\n\n echo $this->body;\n }",
"public function render() {\n\t\t$code = null;\n\n\t\tif (isset($this->headers['location']) || isset($this->headers['Location'])) {\n\t\t\tif ($this->status['code'] === 200) {\n\t\t\t\t$this->status(302);\n\t\t\t}\n\t\t\t$code = $this->status['code'];\n\t\t}\n\t\tif ($cookies = $this->_cookies()) {\n\t\t\t$this->headers('Set-Cookie', $cookies);\n\t\t}\n\t\t$this->_writeHeaders($this->status() ?: $this->status(500));\n\t\t$this->_writeHeaders($this->headers(), $code);\n\n\t\tif ($this->status['code'] === 302 || $this->status['code'] === 204) {\n\t\t\treturn;\n\t\t}\n\t\tforeach ($this->body(null, $this->_config) as $chunk) {\n\t\t\techo $chunk;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests warning (implicit flush no html) | public function testWarningStringImplicitFlushNoHtml()
{
$this->notHtml = true;
$this->stringTest('warning');
$this->notHtml = false;
} | [
"public function testFlashDirectWarningNoImplicitFlushNoHtml()\n {\n $this->notHtml = true;\n $this->notImplicit = true;\n $this->stringTest('warning');\n $this->notHtml = false;\n $this->notImplicit = false;\n }",
"public function testFlashDirectNoticeImplicitFlushHtml()\n {\n $this->stringTest('notice');\n }",
"public function testDisplayWarning()\n {\n ob_start();\n $this->_object->displayWarning('There is something amiss');\n $result = ob_get_contents();\n ob_end_clean();\n\n $expected = \"\\033[31mThere is something amiss\\n\\033[39;49m\";\n $this->assertEquals($expected, $result);\n }",
"public function testWarningArrayImplicitFlushHtml()\n {\n $this->arrayTest('warning');\n }",
"public function testFlashDirectNoticeNoImplicitFlushNoHtml()\n {\n $this->notHtml = true;\n $this->notImplicit = true;\n $this->stringTest('notice');\n $this->notHtml = false;\n $this->notImplicit = false;\n }",
"public function testWarningArrayNoImplicitFlushNoHtml()\n {\n $this->notHtml = true;\n $this->notImplicit = true;\n $this->arrayTest('warning');\n $this->notHtml = false;\n $this->notImplicit = false;\n }",
"public function testNoticeStringNoImplicitFlushNoHtml()\n {\n $this->notHtml = true;\n $this->notImplicit = true;\n $this->stringTest('notice');\n $this->notHtml = false;\n $this->notImplicit = false;\n }",
"private function _warning($text){\n echo '[# WARNING] ' . $text . PHP_EOL;\n }",
"public function testWarning(\\unittest\\TestWarning $warning) {\n $this->writeFailure($warning);\n $this->stats['warned']++;\n }",
"public function testWarning(\\unittest\\TestWarning $warning) {\n $this->status= false;\n $this->stats['warned']++;\n $this->writeFailure($warning);\n }",
"protected function _renderWarnings(){\n \n return null;\n \n }",
"public function testInternetExplorerWarning() {\n $page = $this->getSession()->getPage();\n $assert_session = $this->assertSession();\n $warning_text = 'CKEditor 5 is not compatible with Internet Explorer. Text fields using CKEditor 5 will fall back to plain HTML editing without CKEditor for users of Internet Explorer.';\n $this->createNewTextFormat($page, $assert_session);\n $assert_session->waitForText($warning_text);\n $page->selectFieldOption('editor[editor]', 'None');\n $this->getSession()->getDriver()->executeScript(\"document.querySelector('#drupal-live-announce').innerHTML = ''\");\n $assert_session->assertNoElementAfterWait('css', '.messages--warning');\n $assert_session->pageTextNotContains($warning_text);\n }",
"public function testWritingSingleMessageWithNoNewLine()\n {\n ob_start();\n $this->response->write('foo');\n $this->assertEquals('foo', ob_get_clean());\n }",
"public function testWarning(\\unittest\\TestWarning $warning) {\n // Empty\n }",
"function clearWarnings(){\r\n\t\tdie('Not implemented');\r\n\t}",
"public function ReStartOutputChecking()\r\n {\r\n ob_flush();\r\n }",
"public function testWritingStyledMessageWithStylingDisabled()\n {\n ob_start();\n $this->response->setStyled(false);\n $this->response->write('<b>foo</b>');\n $this->assertEquals('foo', ob_get_clean());\n }",
"function showWarnings($warnings)\n{\n if (!empty($warnings)) {\n out('Some settings on your machine may cause stability issues with QA Tools.', 'error');\n out('If you encounter issues, try to change the following:', 'error');\n outputIssues($warnings);\n }\n}",
"public function testWarning() {\n $this->expectException(Warning::class);\n trigger_error('Test warning', E_USER_WARNING);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scan the string stack and extract any tags and chunks of text that were detected. | protected function _extractChunks($string) {
$strPos = 0;
$strLength = mb_strlen($string);
$openBracket = $this->getConfig('open');
$closeBracket = $this->getConfig('close');
$hasList = isset($this->_filters['List']);
$starOpen = false;
$chunks = [];
while ($strPos < $strLength) {
$tag = [];
$possibleLiteral = false;
$isLiteral = false;
// Find opening tag
$openPos = mb_strpos($string, $openBracket, $strPos);
if ($openPos === false) {
$openPos = $strLength;
}
if ($openPos + 1 > $strLength) {
$nextOpenPos = $strLength;
} else {
$nextOpenPos = mb_strpos($string, $openBracket, $openPos + 1);
if ($nextOpenPos === false) {
$nextOpenPos = $strLength;
}
$possibleLiteral = ($openPos + 1 === $nextOpenPos);
}
// Find closing tag
$closePos = mb_strpos($string, $closeBracket, $strPos);
if ($closePos === false) {
$closePos = $strLength + 1;
}
if ($possibleLiteral) {
$isLiteral = (isset($string[$closePos + 1]) && $string[$closePos + 1] === $closeBracket);
}
// Literal tag found, do not parse
if ($isLiteral) {
$newPos = $closePos + 2;
$tag['text'] = mb_substr($string, $openPos + 1, ($closePos - $openPos));
$tag['type'] = self::TAG_NONE;
// Possible tag found, lets look
} else if ($openPos === $strPos) {
// Child open tag before closing tag
if ($nextOpenPos < $closePos) {
$newPos = $nextOpenPos;
$tag['text'] = mb_substr($string, $strPos, ($nextOpenPos - $strPos));
$tag['type'] = self::TAG_NONE;
// Tag?
} else {
$newPos = $closePos + 1;
$newTag = $this->_buildTag(mb_substr($string, $strPos, (($closePos - $strPos) + 1)));
// Valid tag
if ($newTag) {
$tag = $newTag;
// Special handling for star list items
if ($hasList) {
if ($tag['type'] === self::TAG_OPEN) {
// A new star item opened
if ($tag['tag'] === '*' && !$starOpen) {
$starOpen = true;
// Another star item appeared, so close the previous
} else if ($starOpen && $tag['tag'] === '*') {
$chunks[] = [
'tag' => '*',
'type' => self::TAG_CLOSE,
'text' => '[/*]',
'attributes' => [],
];
}
} else if ($tag['type'] === self::TAG_CLOSE) {
if ($starOpen && in_array($tag['tag'], ['list', 'olist', 'ol', 'ul'], true)) {
$starOpen = false;
$chunks[] = [
'tag' => '*',
'type' => self::TAG_CLOSE,
'text' => '[/*]',
'attributes' => [],
];
} else if ($tag['tag'] === '*') {
$starOpen = false;
}
}
}
// Not a valid tag
} else {
$tag['text'] = mb_substr($string, $strPos, $closePos - $strPos + 1);
$tag['type'] = self::TAG_NONE;
}
}
// No tag, just text
} else {
$newPos = $openPos;
$tag['text'] = mb_substr($string, $strPos, ($openPos - $strPos));
$tag['type'] = self::TAG_NONE;
}
// Join consecutive text elements
if ($tag['type'] === self::TAG_NONE && isset($prev) && $prev['type'] === self::TAG_NONE) {
$tag['text'] = $prev['text'] . $tag['text'];
array_pop($chunks);
}
$chunks[] = $tag;
$prev = $tag;
$strPos = $newPos;
}
$this->_nodes = $this->_extractNodes($chunks);
return $this->_nodes;
} | [
"public function scanText() {\n /* look for next opening tag. */\n $text = $this->scanner->scanUntilExclusive(\\StringScanner::escape($this->otag));\n\n if ($text === null) {\n /* Couldn't find any otag, which means the rest is just static text. */\n $text = $this->scanner->rest();\n $this->scanner->clear();\n }\n\n if (!empty($text)) {\n $prev = end($this->result);\n /* remove previous standalone section if found */\n if ($prev[0] === \":standalone\") {\n array_pop($this->result);\n }\n /* split text into lines, so that indentation works. */\n foreach (preg_split('/(\\n)/', $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY) as $str) {\n if ($str === \"\\n\") {\n array_push($this->result, array(\":newline\"));\n } else {\n $this->addStatic($str);\n }\n }\n }\n }",
"private function parseTags()\n {\n $tagObj = new LingerTag();\n $tags = $tagObj->getTags();\n foreach ($tags as $tag => $opt) {\n if (!isset($opt['block']) || !isset($opt['level'])) {\n continue;\n }\n for ($i = 0; $i <= $opt['level']; $i++) {\n if (!$tagObj->parseTag($tag, $this->content)) {\n break;\n }\n }\n }\n }",
"public function markup($str) { \n //$str = '[[MySnip? &chunk=`[[$dick]]`]]';\n // Gotta strip out those nasty \"space-like\" characters.\n // I can't remember why these characters were problematic, but I think it was because \n // they throw off character counts (?)\n\t\t$str = str_replace(array(\"\\r\",\"\\r\\n\",\"\\n\",\"\\t\",chr(202),chr(173),chr(0xC2),chr(0xA0) ), ' ', $str);\n \n $map = $this->get_tag_map($str);\n \n//print '<textarea rows=\"20\" cols=\"60\">'.print_r($map,true).'</textarea>'; exit;\n // Matchup each opening tag to its ending tag.\n // Then get grab the tag and get its info.\n // The $catalog array contains keys (tag start position) => values (tag end position)\n $cache = array(); // tmp save start positions.\n $catalog = array();\n $tags = array();\n $depth=0;\n $close_tag_map = array(); // copy of $this->report['tags'] but keyed off of the closing index\n foreach ($map as $k => $v) {\n if ($v == 'tag_open') {\n $depth++;\n $cache[$depth] = $k; // start position\n }\n if ($v == 'tag_close') {\n $catalog[$cache[$depth]] = $k;\n $length = ($k + 2) - $cache[$depth]; // tag_close - tag_open\n $tag = substr ($str , $cache[$depth], $length);\n $info = $this->get_tag_info($tag); // get tag info\n if ($info) {\n $info['depth'] = $depth;\n $this->modx->cacheManager->set('tags/'.$info['hash'], $tag, 0, self::$cache_opts);\n $info['tag_open'] = $cache[$depth];\n $info['tag_close'] = $k + 2;\n $this->report['tags'][$cache[$depth]] = $info; // log the start index\n $close_tag_map[$k+2] = $info;\n }\n $depth--;\n } \n }\n//return $str;\n//print '<textarea rows=\"20\" cols=\"60\">'.print_r($map,true).'</textarea>'; \n//print '<textarea rows=\"20\" cols=\"60\">'.print_r($this->report['tags'],true).'</textarea>'; exit;\n \n // 1st Pass: We simplify our tag map so we skip nested tags.\n\t\t$indices = array_keys($map);\n\t\t$count = count($indices);\n\t\t$this_index = $map[$indices[0]];\n\t\t$depth=0;\n\t\tfor ( $i = 1; $i < $count; $i++ ) {\n\t\t\t$next_index = $map[$indices[$i]];\n\t\t\tif ($this_index == 'tag_open' && $next_index == 'tag_open') {\n\t\t\t unset($map[$indices[$i]]); // <-- $next_index\n\t\t\t $depth++;\n\t\t\t}\n\t\t\tif ($this_index == 'tag_open' && $next_index == 'tag_close' && $depth) {\n\t\t\t unset($map[$indices[$i]]); // <-- $next_index\n\t\t\t $depth--;\n\t\t\t}\n\t\t\t$this_index = $next_index;\n\t\t}\n \n $shifted_map = array();\n foreach ($map as $k => $v) {\n if ($v == 'tag_open') {\n $shifted_map[$k] = $v;\n }\n if ($v == 'tag_close') {\n $shifted_map[$k + 2] = $v;\n }\n }\n \n // Do the Markup. (character by character)\n $map = $shifted_map;\n $str_len = strlen($str);\n $indices = array_keys($map);\n $out = '';\n for($i=0;$i<$str_len;$i++) {\n if (isset($map[$i]) && $map[$i] == 'tag_open') {\n if (in_array($this->report['tags'][$i]['type'], $this->config['markup'])) {\n $out .= $this->_open_tag($this->report['tags'][$i]);\n }\n }\n if (isset($map[$i]) && $map[$i] == 'tag_close') {\n if (in_array($close_tag_map[$i]['type'], $this->config['markup'])) {\n $out .= $this->_close_tag($close_tag_map[$i]);\n }\n }\n $out .= $str[$i]; \n }\n\n return $out;\n\n }",
"public function getAllWrappedInTag($text, $tag) {\n if (preg_match_all('/<'.$tag.'>((?:(?!<\\/'.$tag.'>).)*)<\\/'.$tag.'>/ms', $text, $matches))\n return $matches[1];\n else\n return array();\n }",
"function tag_contents($string, $tag_open, $tag_close){ \n foreach (explode($tag_open, $string) as $key => $value) {\n if(strpos($value, $tag_close) !== FALSE){\n $result[] = trim(substr($value, 0, strpos($value, $tag_close)));\n }\n }\n return $result;\n}",
"protected function scanText()\n {\n if ($this->lastToken->type == 'tag'\n || $this->lastToken->type == 'filter'\n || $this->lastToken->type == 'pipe'\n || $this->lastToken->type == 'attributes'\n || $this->lastToken->type == 'class'\n || $this->lastToken->type == 'id'\n ) {\n $token = $this->scanInput('/([^\\n]+)/', 'text');\n $token->value = preg_replace(\"/ *\\\\\\\\\\(/\", '(', $token->value);\n return $token;\n }\n return null;\n }",
"function find_tag( $tag,$text)\r\n\t{\r\n\t\t$x = strpos($text, '[' . $tag);\r\n \t\tif ($x === false) return null;\r\n\t\t\r\n\t\t$t=array();\r\n\t\t$t['startblock']=$x;\r\n\t\t\r\n\t\t//PvE: find closing [ of opening tags [$tag and store position\r\n\t\t$x2 = $x+strlen($tag)+1;\r\n\t\t$y = strpos($text, ']', $x);\r\n\t\t$t['startbody']=$y+1;\r\n\r\n\t\t// extracts attributes (attr=value, no spaces admitted)\r\n \t\t$tmp = split(' ', substr($text, $x2, $y-$x2));\r\n \t\tfor ($i=0; $i<count($tmp); $i++)\r\n \t\t{\r\n \t\t$tmp[$i] = trim($tmp[$i]);\r\n \t\tif ($tmp[$i] == '') continue;\r\n \t\t$tmp2 = split('=', $tmp[$i], 2);\r\n \t\t$t['attrs'][$tmp2[0]] = $tmp2[1];\r\n \t\t}\r\n\r\n\t\t//PvE: search closing tag [/$tag] from end of found opening tag \r\n\t\t$z = strpos(substr($text,$t['startbody']), '[/' . $tag . ']');\r\n \t\t\r\n\t\tif ($z !== false) \r\n \t\t{\r\n \t\t$t['endbody']=$t['startbody']+$z;\r\n\t\t\t$t['endblock']=$t['endbody']+strlen($tag)+3;\r\n\r\n\t\t\t$t['lenblock'] = $t['endblock']-$t['startblock']+1;\r\n\t\t\t$t['lenbody'] = $t['endbody']-$t['startbody']+1;\r\n\r\n\t\t\t$t['body'] = substr($text, $t['startbody'], $t['lenbody']);\r\n\r\n \t}\r\n \t\telse $t['lenbody'] = 0;\r\n\r\n\t\treturn $t;\r\n\t}",
"function split_text_tags($text = \"\") {\r\n\t\t// muß gemacht werden damit Suchmuster korrekt arbeitet\r\n\t\t$text = \"<nonsensetag>\".$text;\r\n\r\n\t\t// dieses Array wird von preg_match_all gefüllt.\r\n\t\t$text_array = array ();\r\n\r\n\t\t// Suchmuster: (<text_in_klammern>)(text_nach_klammern),\r\n\t\t// daher auch das nonsense-Tag um Texte am Anfang, also vor einem Tag zu erfassen\r\n\t\t$match_expression = \"/(<[^>]{1,}>)([^<]{0,})/i\";\r\n\t\t// füllt $text_array in der Art:\r\n\t\t// $text_array[0] = Text des gesamten Suchmusters, also Tag + Text danach bis zum nächsten Tag\r\n\t\t// $text_array[1] = das Tag (also der Text in Klammern incl. der Klammern)\r\n\t\t// $text_array[2] = Text nach Tag bis zum nächsten Tag\r\n\t\tpreg_match_all($match_expression, $text, $text_array, PREG_SET_ORDER);\r\n\r\n\t\treturn $text_array;\r\n\t}",
"public function getTags($text = '');",
"function get_tags_array($str)\n{\n $q = '?';\n return preg_split(\"/(<.*$q>)/\",$str, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);\n}",
"public function collectTags($source, $tag_name=false)\n {\n $tagname = $tag_name === false ? $this->_options['tag_name'] : $tag_name;\n \n $tags = $tag_names = array();\n $tag_count = 0;\n \n $inner_tag_open_pos = $source_len = strlen($source);\n $opener = self::$tag_open.$tagname.':';\n $opener_len = strlen($opener);\n $closer = self::$tag_open.'/'.$tagname.':';\n $closer_len = strlen($closer);\n $closer_end = self::$tag_close;\n\n while ($inner_tag_open_pos !== false)\n {\n// start getting the last found opener tag\n $open_tag_look_source = substr($source, 0, $inner_tag_open_pos);\n $open_tag_look_len = strlen($open_tag_look_source);\n $inner_tag_open_pos = strrpos($open_tag_look_source, $opener);\n\n// if there is no last tag then the rest is the final text\n if($inner_tag_open_pos === false)\n {\n array_push($tags, array('content'=>$source, 'name'=>'___text'));\n break;\n }\n else\n {\n// get the source from the start of that last tag\n $tag_look_source = substr($source, $inner_tag_open_pos);\n $open_bracket_pos = strpos($tag_look_source, self::$tag_open, 1);\n $short_tag_close_pos = strpos($tag_look_source, '/'.self::$tag_close);\n \n if($short_tag_close_pos !== false && $short_tag_close_pos < $open_bracket_pos)\n {\n $inner_tag_close_pos = $short_tag_close_pos + 2;\n }\n else\n {\n $inner_tag_close_pos_begin = strpos($tag_look_source, $closer);\n $inner_tag_close_pos = strpos($tag_look_source, $closer_end, $inner_tag_close_pos_begin)+1;\n }\n\n// get the content of the block\n $tag_source = substr($tag_look_source, 0, $inner_tag_close_pos);\n \n $tag = $this->_buildTag($tag_source, $tagname);\n $index = count($tags);\n $tag['source_marker'] = '------@@%'.self::$_instance.'-'.$index.'%@@------';\n array_push($tags, $tag);\n \n// modify the source so it doesn't get repeated\n $source = substr($source, 0, $inner_tag_open_pos).$tag['source_marker'].substr($source, $inner_tag_open_pos+$inner_tag_close_pos);\n// $source = str_replace($tag_source, '------@@%'.$index.'%@@------', $source);\n }\n }\n return $tags;\n }",
"protected function findNextTag()\n\t{\n\t\t$delimiters = $this->whitespaces;\n\t\t$delimiters['\"'] = 1;\n\t\t$delimiters['`'] = 1;\n\t\t$delimiters['\"'] = 1;\n\n\t\t/* We need to find the character '<' */\n\t\tdo {\n\t\t\t$beginpos = strpos($this->content, '<', $this->cursor);\n\n\t\t\t/* Emergency break when the tag does not appear*/\n\t\t\tif ($beginpos === FALSE)\n\t\t\t\treturn NULL;\n\n\t\t\t$nextchar = $this->content[$beginpos + 1];\n\t\t\t$this->cursor = $beginpos + 1;\n\t\t} while ($this->is_noisy() || ($nextchar != '/' && $nextchar != '!' && !preg_match('/[a-zA-Z]/', $nextchar)));\n\n\t\t/* If we can't then the document has been totally reviewed */\n\t\tif ($beginpos === FALSE) {\n\t\t\t$this->cursor = $this->getSize();\n\t\t\treturn NULL;\n\t\t}\n\n\t\t/* We then process until the closing '>' */\n\t\t$tag = array();\n\t\t$tag ['beginpos'] = $beginpos;\n\t\t$inside_quote = FALSE;\n\t\t$current_char = $nextchar;\n\n\t\twhile ($current_char != '>' || $inside_quote) {\n\n\n\t\t\t/* Handle quotes */\n\t\t\tif ($inside_quote && $current_char == $inside_quote)\n\t\t\t\t$inside_quote = FALSE;\n\t\t\telse if (!$inside_quote && ($current_char == '`' || $current_char == '\"' || $current_char == \"'\"))\n\t\t\t\t$inside_quote = $current_char;\n\n\t\t\t/* Build tag name */\n\t\t\tif (!$tagnamefound) {\n\t\t\t\tif (!isset($delimiters[$current_char]))\n\t\t\t\t\t$tag['tagname'] .= $current_char;\n\t\t\t\telse if ($current_char != \"/\"){\n\t\t\t\t\t$tagnamefound = TRUE;\n\t\t\t\t\t$seeking = \"attributes\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Handle attributes */\n\t\t\tif ($tagnamefound) {\n\t\t\t\t/* Parse the attribute name */\n\t\t\t\tif ($seeking == \"attributes\") {\n\t\t\t\t\t/* Read attribute name */\n\t\t\t\t\tif (!isset($delimiters[$current_char]) && $current_char != \"=\" || $inside_quote)\n\t\t\t\t\t\t$current_attribute .= strtolower($current_char);\n\t\t\t\t\t/* Stops when finding a '=' */\n\t\t\t\t\telseif ($current_char == \"=\")\n\t\t\t\t\t\t$seeking = \"value\";\n\t\t\t\t\t/* Stops when finding a blank */\n\t\t\t\t\telseif ($current_attribute) {\n\t\t\t\t\t\t/* Remove quotes */\n\t\t\t\t\t\tif ($current_attribute[0] == '\"' || $current_attribute[0] == \"'\" || $current_attribute[0] == '`')\n\t\t\t\t\t\t\tif ($current_attribute[strlen($current_attribute) -1] == $current_attribute[0])\n\t\t\t\t\t\t\t\t$current_attribute = substr($current_attribute, 1, -1);\n\t\t\t\t\t\t/* */\n\t\t\t\t\t\t$tag['attr'][$current_attribute] = 1;\n\t\t\t\t\t\t$last_attribute = $current_attribute;\n\t\t\t\t\t\tunset($current_attribute);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Parse the value content */\n\t\t\t\telseif ($seeking == \"value\") {\n\t\t\t\t\t/* Reading the value, case when not inside a quote */\n\t\t\t\t\tif (!$inside_quote) {\n\t\t\t\t\t\tif (isset($delimiters[$current_char])) {\n\t\t\t\t\t\t\tif ($current_char == '\"' || $current_char == \"'\" || $current_char == '`')\n\t\t\t\t\t\t\t\t$current_value .= $current_char;\n\t\t\t\t\t\t\t/* Remove quotes */\n\t\t\t\t\t\t\tif ($current_attribute[0] == '\"' || $current_attribute[0] == \"'\" || $current_attribute[0] == '`')\n\t\t\t\t\t\t\t\tif ($current_attribute[strlen($current_attribute) -1] == $current_attribute[0])\n\t\t\t\t\t\t\t\t\t$current_attribute = substr($current_attribute, 1, -1);\n\n\t\t\t\t\t\t\tif ($current_value[0] == '\"' || $current_value[0] == \"'\" || $current_value[0] == \"`\")\n\t\t\t\t\t\t\t\tif ($current_value[strlen($current_value) -1] == $current_value[0])\n\t\t\t\t\t\t\t\t\t$current_value = substr($current_value, 1, -1);\n\t\t\t\t\t\t\t/* */\n\t\t\t\t\t\t\t$tag['attr'][$current_attribute] = $current_value;\n\t\t\t\t\t\t\t$last_attribute = $current_attribute;\n\t\t\t\t\t\t\tunset($current_value);\n\t\t\t\t\t\t\tunset($current_attribute);\n\t\t\t\t\t\t\t$seeking = \"attributes\";\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t$current_value .= $current_char;\n\t\t\t\t\t}\n\t\t\t\t\t/* Case when inside a quote */\n\t\t\t\t\telse\n\t\t\t\t\t\t$current_value .= $current_char;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Emergency break when the tag does not end */\n\t\t\tif ($this->cursor >= $this->getSize())\n\t\t\t\treturn NULL;\n\n\t\t\t/* Read next character */\n\t\t\t++$this->cursor;\n\t\t\t$current_char = $this->content[$this->cursor];\n\t\t}\n\t\t++$this->cursor;\n\n\t\t/* Catch possible last attribute */\n\t\tif ($current_attribute) {\n\t\t\tif (!$current_value && $current_attribute[strlen($current_attribute) - 1] == \"/\")\n\t\t\t\t$current_attribute = substr($current_attribute, 0, -1);\n\t\t\t\n\t\t\tif ($current_attribute) {\n\t\t\t\tif ($current_attribute[0] == '\"' || $current_attribute[0] == \"'\" || $current_attribute[0] == '`')\n\t\t\t\t\tif ($current_attribute[strlen($current_attribute) -1] == $current_attribute[0])\n\t\t\t\t\t\t$current_attribute = substr($current_attribute, 1, -1);\n\t\t\t\tif ($current_value[0] == '\"' || $current_value[0] == \"'\" || $current_value[0] == \"`\")\n\t\t\t\t\tif ($current_value[strlen($current_value) -1] == $current_value[0])\n\t\t\t\t\t\t$current_value = substr($current_value, 1, -1);\n\t\t\t\tif (!$current_value)\n\t\t\t\t\t$current_value = 1;\n\n\t\t\t\t$tag['attr'][$current_attribute] = $current_value;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* We save the position of the ending '>' */\n\t\t$tag['length'] = $this->cursor - $beginpos;\n\t\t\n\t\t/* We determine the nature of the tag */\n\t\t/* Closing tags */\n\t\t$data = substr($this->content, $beginpos, $this->cursor);\n\t\tif ($nextchar == '/') {\n\t\t\t$tag['nature'] = DPARSE_CLOSING_TAG;\n\t\t\t$tag['tagname'] = substr($tag['tagname'], 1);\n\t\t}\n\t\t/* Self-closing XML tags */\n\t\tif ($current_attribute == \"/\" || (!$current_attribute && $last_attribute == \"/\")) {\n\t\t\tif ($this->is_xml)\n\t\t\t\t$tag['nature'] = DPARSE_SELF_CLOSING_TAG;\n\t\t}\n\t\t/* Opening tags */\n\t\tif (!$tag['nature']) {\n\t\t\t$tag['nature'] = DPARSE_OPENING_TAG;\n\t\t}\n\t\t/* Special self-closing HTML tags */\n\t\tif (!$this->is_xml && isset($this->self_closing_tags[$tag['tagname']])) {\n\t\t\tif ($tag['nature'] == DPARSE_CLOSING_TAG)\n\t\t\t\t$tag['ignore'] = TRUE;\n\t\t\t$tag['nature'] = DPARSE_SELF_CLOSING_TAG;\n\t\t}\n\n\t\t/* Finally we can return the whole tag */\n\t\t$tag['tagname'] = strtolower($tag['tagname']);\n\t\treturn $tag;\n\t}",
"public function parse()\n {\n// $page = preg_replace('{<script>.*?</script>}i', '<script></script>', $page);\n// $page = preg_replace('{<style>.*?</style>}i', '<style></style>', $page);\n// $page = preg_replace(\"{\\r|\\n}\", ' ', $page);\n $matches = [];\n preg_match_all(self::PATTERN, $this->html, $matches);\n $this->tags = $matches[1];\n foreach ($this->tags as &$tag) {\n $tag = strtolower($tag);\n }\n }",
"function extract_sequences($text){\r\n\r\n\r\n\r\n if (substr_count($text,\">\")==0){\r\n\r\n $sequence[0][\"seq\"] = preg_replace (\"/\\W|\\d/\", \"\", strtoupper ($text));\r\n\r\n }else{\r\n\r\n $arraysequences=preg_split(\"/>/\", $text,-1,PREG_SPLIT_NO_EMPTY);\r\n\r\n $counter=0;\r\n\r\n foreach($arraysequences as $key =>$val){\r\n\r\n $seq=substr($val,strpos($val,\"\\n\"));\r\n\r\n $seq = preg_replace (\"/\\W|\\d/\", \"\", strtoupper($seq));\r\n\r\n if (strlen($seq)>0){\r\n\r\n $sequence[$counter][\"seq\"] = $seq;\r\n\r\n $sequence[$counter][\"name\"]=substr($val,0,strpos($val,\"\\n\"));\r\n\r\n $counter++;\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n return $sequence;\r\n\r\n}",
"public function extract() {\n\t\t$this->strings = array();\n\t\tforeach ($this->files as $file) {\n\t\t\t$content = file_get_contents($file);\n\t\t\tif ($content == '')\n\t\t\t\tthrow new Exception('can not get file content: ' . $content);\n\n\t\t\t$strings = array();\n\n\t\t\t//drop svg\n\t\t\t$content = preg_replace('|<path.*/>|i', '', $content);\n\n\t\t\t//drop exceptions\n\t\t\t$content = preg_replace('|\\/\\/no-translate BEGIN[\\s\\S]+?\\/\\/no-translate END|mi', '', $content);\n\n\t\t\t//drop\n\t\t\t$content = stripslashes($content);\n\n\t\t\tif (stripos($file, '.js') !== false) {\n\t\t\t\t//json\n\n\t\t\t\t$ignore_matches = [\n\t\t\t\t\t'\\.addEventListener',\n\t\t\t\t\t'\\.style\\.',\n\t\t\t\t\t'aria-label',\n\t\t\t\t\t'\\.font',\n\t\t\t\t];\n\t\t\t\tforeach ($ignore_matches as $ignore_match) {\n\t\t\t\t\t$content = preg_replace('/' . $ignore_match . '.*/', '', $content);\n\t\t\t\t}\n\n\t\t\t\t$content = preg_replace('|[\\r\\n][ \\t]*//.*|', \"\\n\", $content);\n\n\t\t\t\t//extract between ' '\n\t\t\t\t$out = array();\n\t\t\t\tpreg_match_all(\"/[']([^']*)[']/\", $content, $out);\n\t\t\t\t$strings = array_merge($strings, $out[1]);\n\n\t\t\t\t//extract between \" \"\n\t\t\t\t$out = array();\n\t\t\t\tpreg_match_all('/[\"]([^\"]*)[\"]/', $content, $out);\n\t\t\t\t$strings = array_merge($strings, $out[1]);\n\t\t\t}\n\t\t\tif (stripos($file, '.htm') !== false || true) {\n\t\t\t\t//html\n\t\t\t\t$ignore_attributes = [\n\t\t\t\t\t'dir',\n\t\t\t\t\t'lang',\n\t\t\t\t\t'http-equiv',\n\t\t\t\t\t'content',\n\t\t\t\t\t'name',\n\t\t\t\t\t'rel',\n\t\t\t\t\t'style',\n\t\t\t\t\t'onclick',\n\t\t\t\t\t'type',\n\t\t\t\t\t'class',\n\t\t\t\t\t'id',\n\t\t\t\t\t'href',\n\t\t\t\t\t'onchange',\n\t\t\t\t\t'onKeyUp',\n\t\t\t\t\t'oninput',\n\t\t\t\t\t'src',\n\t\t\t\t\t'aria-label',\n\t\t\t\t];\n\t\t\t\tforeach ($ignore_attributes as $ignore_attribute) {\n\t\t\t\t\t$content = preg_replace('/' . $ignore_attribute . '=\"[^\"]*\"/', '', $content);\n\t\t\t\t}\n\n\t\t\t\t//extract between \" \"\n\t\t\t\t$out = array();\n\t\t\t\tpreg_match_all('/[\"]([^\"]*)[\"]/', $content, $out);\n\t\t\t\t//$strings = array_merge($strings, $out[1]);\n\t\t\t\t//extract between > <\n\t\t\t\t$out = array();\n\t\t\t\tpreg_match_all('|>([^<]{1,200})<[^ ]|', $content, $out);\n\t\t\t\t$strings = array_merge($strings, $out[1]);\n\t\t\t}\n\n\t\t\tforeach ($strings as $string) {\n\t\t\t\tif (trim($string) == '' || substr($string, 0, 2) == './')\n\t\t\t\t\tcontinue;\n\n\t\t\t\t//remove tags\n\t\t\t\t$string = preg_replace('/<[^>]*>/', ' ', $string);\n\t\t\t\t$string = trim($string);\n\n\t\t\t\t$this->strings[] = $string;\n\t\t\t}\n\t\t}\n\n\t\t$this->strings = array_unique($this->strings);\n\t\tsort($this->strings);\n\t}",
"public function extractTextFromString($string);",
"protected function scanTag()\n {\n return $this->scanInput('/^((?:[a-z][a-z0-9]*))/', 'tag');\n }",
"protected function find_tags(){\n\t\tpreg_match_all(\"/%(.+?)%/\", $this->default, $this->tags );\n\t}",
"public function getParsedText()\n {\n return Mage::helper('cms/data')->getBlockTemplateProcessor()->filter($this->getText());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fetch This function returns one record from the database table. The contents of this record depend on the parameters of the preceding find, select, or query function. Since this is called after a query, we can assume that a DB connection exists. Inputs: type return results type: MYSQL_ASSOC (def), MYSQL_NUM, MYSQL_BOTH Returns: an associative array, with the key names of each value corresponding to the table field names, or to the field name assignments in the query; or false, if there are no more entries to fetch. | function fetch($type=MYSQLI_ASSOC) {
// Just return the results row, or false, if none exists.
return mysqli_fetch_array($this->dbret, $type);
} | [
"function fetch($mode=NONE){\n\t\t$r = odbc_fetch_row( $this->res );\n\t\tif($r==NULL){\n\t\t\treturn(null);\n\t\t}\n\t\t$field_count = odbc_num_fields($this->res); \n\t\t\n \t\t$r=array();\n\t\tfor($i=1; $i <= $field_count; $i++){ \n\t \t$r[odbc_field_name( $this->res,$i)] = odbc_result( $this->res, $i); \n\t }\n\t\treturn($r);\n\t}",
"function fetch($mode=MYSQL_ASSOC){\n\t\treturn(mysql_fetch_array($this->res,$mode));\n\t}",
"public function fetch($fetch = self::PARAM_FETCH){\n\t\ttry {\n\t\t\t/** @var \\Core\\PdoStatement $query */\n\t\t\t$query = $this->db->prepare($this->query);\n\n\t\t\tforeach($this->vars as $key => $value){\n\t\t\t\tif(preg_match('`:'.$key.'[\\s|,|\\)|\\(%]`', $this->query.' ')){\n\t\t\t\t\tif(is_array($value)){\n\t\t\t\t\t\t$query->bindValue(\":$key\", $value[0], $value[1]);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tswitch(gettype($value)){\n\t\t\t\t\t\t\tcase 'boolean' :\n\t\t\t\t\t\t\t\t$query->bindValue(\":$key\", $value, self::PARAM_BOOL);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'integer' :\n\t\t\t\t\t\t\t\t$query->bindValue(\":$key\", $value, self::PARAM_INT);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'double' :\n\t\t\t\t\t\t\t\t$query->bindValue(\":$key\", $value, self::PARAM_STR);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'string' :\n\t\t\t\t\t\t\t\t$query->bindValue(\":$key\", $value, self::PARAM_STR);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'NULL' :\n\t\t\t\t\t\t\t\t$query->bindValue(\":$key\", $value, self::PARAM_NULL);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$query->execute();\n\n\t\t\tswitch($fetch){\n\t\t\t\tcase self::PARAM_FETCH : $this->data = $query->fetchAll(); break;\n\t\t\t\tcase self::PARAM_FETCHCOLUMN : $this->data = $query->fetchColumn(); break;\n\t\t\t\tdefault: $this->data = true; break;\n\t\t\t}\n\n\t\t\tfile_put_contents('app/log/sql.txt', $query->debugQuery().\"\\n\\n\", FILE_APPEND);\n\n\t\t\t$query->closeCursor();\n\n\t\t\treturn $this->data;\n\t\t}\n\t\tcatch (\\PDOException $e) {\n\t\t\tthrow new \\Exception($e->getMessage().' / '.$e->getCode());\n\t\t}\n\t}",
"public function fetchAssocRow()\n{\n\treturn $this->sth->fetch(\\PDO::FETCH_ASSOC);\n}",
"function fetch_assoc(&$rs)\n{\n\treturn mysql_fetch_assoc($rs);\n}",
"public function &fetch(&$recordset, $assoc = false) {\n if (empty($recordset))\n return $this->nothing;\n\n $result = $assoc ?\n mysqli_fetch_assoc($recordset)\n :\n mysqli_fetch_row($recordset);\n\n // $result = mysqli_fetch_array(\n // $recordset,\n // $assoc ? MYSQLI_ASSOC : MYSQLI_NUM\n // );\n\n return $result;\n }",
"function sql_fetch_row(&$res, $nr = 0)\r\n{\r\n global $dbtype;\r\n switch ($dbtype) {\r\n\r\n case \"MySQL\":\r\n $row = mysql_fetch_row($res);\r\n return $row;\r\n break;\r\n\r\n case \"mSQL\":\r\n $row = msql_fetch_row($res);\r\n return $row;\r\n break;\r\n\r\n case \"postgres\":\r\n case \"postgres_local\":\r\n if ($res->get_total_rows() > $res->get_fetched_rows()) {\r\n $row = pg_fetch_row($res->get_result(), $res->get_fetched_rows());\r\n $res->increment_fetched_rows();\r\n return $row;\r\n } else {\r\n return false;\r\n }\r\n break;\r\n\r\n case \"ODBC\":\r\n case \"ODBC_Adabas\":\r\n $row = array();\r\n $cols = odbc_fetch_into($res, $nr, $row);\r\n return $row;\r\n break;\r\n\r\n case \"Interbase\":\r\n $row = ibase_fetch_row($res);\r\n return $row;\r\n break;\r\n\r\n case \"Sybase\":\r\n $row = sybase_fetch_row($res);\r\n return $row;\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n}",
"function fetch($mode=PGSQL_ASSOC){\n\t\treturn(pg_fetch_array($this->res,NULL,$mode));\n\t}",
"function DB_Fetch_Assoc($result)\n {\n return $this->DB_Method_Call(\"Fetch_Assoc\",$result);\n }",
"public function fetchRow($type=2)\n\t{\n\t\n\t\t/*----------------------------------\n\t\tlocal variable to set Mysql Fetch Type.\n\t\t-----------------------------------*/\t\t\n\t\t$fetchType=null;\n\n\t\t/*----------------------------------\n\t\tSetting Mysql Fetch Type.\n\t\t-----------------------------------*/\t\t\n\t\tswitch($type)\n\t\t{\n\t\t\tcase 1: $fetchType=MYSQL_BOTH;\n\t\t\t\t\tbreak;\n\t\t\tcase 2: $fetchType=MYSQL_ASSOC;\n\t\t\t\t\tbreak;\t\n\t\t\tcase 3: $fetchType=MYSQL_NUM;\n\t\t\t\t\tbreak;\n\t\t\tdefault: $fetchType=MYSQL_ASSOC;\n\t\t\t\t\tbreak;\n\t\t}\n\n\t\t/*----------------------------------\n\t\tFetching a result row.\n\t\t-----------------------------------*/\t\n\t\t if(!$this->resultRow=@mysql_fetch_array($this->resultSet,$fetchType))\n\t\t{\n\t\t\tif(mysql_errno()>0)\n\t\t\tthrow new Exception(\"Error: Unable to Fetch Row\".mysql_errno());\n\t\t}\n\n\t\treturn $this->resultRow;\n\t}",
"function fetch($mode = PDO_FETCH_BOTH, $cursor = null, $offset = null) {\n\t\tif(func_num_args() == 0)\n\t\t\t$mode = &$this->__fetchmode;\n\t\t$result = false;\n\t\tif(!is_null($this->__result)) {\n\t\t\tswitch($mode) {\n\t\t\t\tcase PDO_FETCH_NUM:\n\t\t\t\t\t$result = mysql_fetch_row($this->__result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase PDO_FETCH_ASSOC:\n\t\t\t\t\t$result = mysql_fetch_assoc($this->__result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase PDO_FETCH_OBJ:\n\t\t\t\t\t$result = mysql_fetch_object($this->__result);\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase PDO_FETCH_BOTH:\n\t\t\t\tdefault:\n\t\t\t\t\t$result = mysql_fetch_array($this->__result);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(!$result)\n\t\t\t$this->__result = null;\n\t\treturn $result;\n\t}",
"function fetch ($sql)\n {\n $qry = $this->query ($sql);\n return $this->fetch_object ($qry);\n }",
"public function fetchRecord()\n {\n $ret = $this->readCurrentRecord();\n if ($ret !== false) {\n $this->next();\n }\n return $ret;\n }",
"function GetRecord() {\n\t\t$this->Record=mysql_fetch_array($this->resultDB[$this->iPtr][$this->iResult]);\n\t\treturn $this->Record;\n\t}",
"function db_fetch_array(\n\t\tmysqli_result $result,\n\t\tint $resulttype = MYSQLI_ASSOC\n\t) {\n\t\treturn mysqli_fetch_row($result);\n\t}",
"function fetchSingle() {\r\n\t\t$result = null;\r\n\t\tif(!is_null($this->__result)) {\r\n\t\t\t$result = @pg_fetch_row($this->__result);\r\n\t\t\tif($result)\r\n\t\t\t\t$result = $result[0];\r\n\t\t\telse\r\n\t\t\t\t$this->__result = null;\r\n\t\t}\r\n\t\treturn $result;\r\n\t}",
"function executeFetchOne(){\n\t\t\t$this->execute();\n\t\t\t$r = $this->fetch();\n\t\t\t$this->closeCursor();\n\t\t\treturn $r;\n\t\t}",
"function fetch_record($table, $key, $value, $row) {\r\n\t$sql = \"SELECT * FROM `\" .sql_escape($table). \"` WHERE `\" .sql_escape($key). \"` = '\" .sql_escape($value). \"' LIMIT 1\";\r\n\t$record = execute_sql($sql);\r\n\treturn (!empty($record[$row])) ? $record[$row] : null; // If the row of the record isn't empty, return it\t\r\n}",
"function db_fetch_row(&$stmt, $type=MYSQLI_ASSOC) {\n return mysqli_fetch_array($stmt, $type);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the agency associated with beloved | public function setAgencies(array $agencies,$storedAgencies=null) {
if (!array_key_exists('id', $this->data) || $this->data['id'] == ''){
return;
}
if (!is_array($storedAgencies)) {
$storedAgencies = array();
$storedAgencyResultset = $this->db->query('SELECT `agency_id` FROM `beloved_agency`
WHERE `beloved_id`=' . intval($this->data['id'])
, \Zend\Db\Adapter\Adapter::QUERY_MODE_EXECUTE);
while ($storedAgencyResultset->valid()){
$storedAgencies[] = $storedAgencyResultset->current()->agency_id;
$storedAgencyResultset->next();
}
}
foreach(array_diff($storedAgencies, $agencies) as $agency) {
$this->db->query('DELETE FROM `beloved_agency`
WHERE `beloved_id`=' . intval($this->data['id']).' AND `agency_id`='.intval($agency)
, \Zend\Db\Adapter\Adapter::QUERY_MODE_EXECUTE);
}
foreach (array_diff($agencies,$storedAgencies) as $agency) {
$this->db->query('INSERT INTO `beloved_agency`
(`beloved_id`,`agency_id`,`datetime`)
VALUES
(' . intval($this->data['id']) . ',"' . addslashes($agency) . '",NOW())'
, \Zend\Db\Adapter\Adapter::QUERY_MODE_EXECUTE);
}
} | [
"public function setAwardingAgency($value)\n {\n return $this->set('AwardingAgency', $value);\n }",
"public function setAgency(Agency $v = null)\n\t{\n\t\tif ($v === null) {\n\t\t\t$this->setAgencyId(NULL);\n\t\t} else {\n\t\t\t$this->setAgencyId($v->getId());\n\t\t}\n\n\t\t$this->aAgency = $v;\n\n\t\t// Add binding for other direction of this n:n relationship.\n\t\t// If this object has already been added to the Agency object, it will not be re-added.\n\t\tif ($v !== null) {\n\t\t\t$v->addRequester($this);\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function setAgence_id($agence_id)\n {\n $this->agence_id = $agence_id;\n\n \n }",
"public function testUpdateAgency()\n {\n\n }",
"public function setAgility($agility) {\n $this->agility = $agility;\n }",
"public function getAgence()\n {\n return $this->agence;\n }",
"protected function getBankAgencyId()\r\n {\r\n return YODLEE_AGENCY_ID;\r\n }",
"public function agency()\n {\n return $this->belongsTo('App\\Models\\Api\\v1\\Person', 'n_AgencyPersoninfoId_FK')->withDefault();\n }",
"public function setFundingAgency($value)\n {\n return $this->set('FundingAgency', $value);\n }",
"public function getAgence()\n {\n return $this->agence;\n }",
"public function testSetNumAgrementCga() {\n\n $obj = new Intervenants();\n\n $obj->setNumAgrementCga(\"numAgrementCga\");\n $this->assertEquals(\"numAgrementCga\", $obj->getNumAgrementCga());\n }",
"private function _saveAgency()\n\t {\n\t\t$hash = sha1($this->_advert->city . $this->_advert->phone);\n\t\tif ($this->_exists(\"agencies\", $hash) === false && $this->_advert->person === \"agency\")\n\t\t {\n\t\t\t$this->_db->exec(\"INSERT INTO `agencies` SET \" .\n\t\t\t \"`city` = '\" . $this->_advert->city . \"', \" .\n\t\t\t \"`hash` = '\" . $hash . \"', \" .\n\t\t\t \"`name` = '\" . mb_strtoupper($this->_advert->name) . \"', \" .\n\t\t\t \"`phone` = '\" . $this->_advert->phone . \"'\"\n\t\t\t);\n\n\t\t\t$agency = [\n\t\t\t \"name\" => mb_strtoupper($this->_advert->name),\n\t\t\t \"phone\" => $this->_advert->phone,\n\t\t\t \"city\" => $this->_advert->city,\n\t\t\t];\n\n\t\t\t$cities = [\n\t\t\t \"Москва\",\n\t\t\t \"Санкт-Петербург\",\n\t\t\t \"Иркутск\",\n\t\t\t \"Красноярск\",\n\t\t\t];\n\n\t\t\tif (in_array(trim($this->_advert->city), $cities) === true)\n\t\t\t {\n\t\t\t\t$container = new Container(\"agency_send_sms\");\n\t\t\t\t$container->add(json_encode($agency));\n\t\t\t } //end if\n\n\t\t } //end if\n\n\t }",
"private function setEstablishedEarnedIncome(){\n $this->establishedEarnedIncome = floor($this->earnedIncome / 100) * 100;\n }",
"public function setAgreementAcceptances(?array $value): void {\n $this->getBackingStore()->set('agreementAcceptances', $value);\n }",
"public function setMajAgency($value)\n {\n return $this->set('MajAgency', $value);\n }",
"public function setTitleAgency($titleAgency)\n {\n $this->titleAgency = $titleAgency;\n }",
"public function setAgios($agios)\n {\n $this->agios = $agios;\n }",
"function setPuede_agd($bpuede_agd = 'f')\n {\n $this->bpuede_agd = $bpuede_agd;\n }",
"public function agency()\n {\n return $this->belongsTo(Agency::class);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For adding quotes to query params | function add_quotes(&$value, $key)
{
$value = "'" . $value . "'";
} | [
"public function EscapeQueryString($input) {\n return $this->PDO->Quote($input);\n }",
"function addQuote($str){\n return \"'$str'\";\n}",
"public function addQuotedParam($name, $value)\n {\n $this->params->addItem(new MsSqlParameter($name, MySqlParameter::MYSQL_TYPE_VARCHAR, $value));\n }",
"public function testAdapterQuoteIntoDoubleQuote()\n {\n $string = 'id=?';\n $param = 'St John\"s Wort';\n $value = $this->_db->quoteInto($string, $param);\n $this->assertEquals(\"id='St John\\\"s Wort'\", $value);\n }",
"public function testAdapterQuoteIntoDoubleQuote()\n {\n $value = $this->_db->quoteInto('id=?', 'St John\"s Wort');\n $this->assertEquals(\"id='St John\\\"s Wort'\", $value);\n }",
"private function quote( )\n {\n if ( @ count( $this->data_buffer ) == 0 )\n return;\n foreach ( $this->data_buffer as $key => $val )\n {\n if ( in_array( $key, $this->string_fields ))\n $this->data_buffer[$key] = @\"'\".mysql_real_escape_string($val,underQL::$db_handle).\"'\";\n else\n $this->data_buffer[$key] = $val;\n }\n }",
"public function urlEncodeParameters();",
"function addSlashesSingleQuotes ($input)\n{\n\treturn str_replace (\"'\", \"\\'\", $input);\n}",
"public function addQueryString($key, $value, $preEncoded = false);",
"public function getEscapedQueryText()\n {\n \t$solrModel = Mage::getModel('solrsearch/solr');\n \t$queryText = $solrModel->getParams('q');\n \tif( isset($solrData['responseHeader']['params']['q']) && !empty($solrData['responseHeader']['params']['q']) ) {\n \t\tif ($queryText != $solrData['responseHeader']['params']['q']) {\n \t\t\t$queryText = $solrData['responseHeader']['params']['q'];\n \t\t}\n \t}\n \treturn $this->escapeHtml($queryText);\n }",
"public function toQueryString();",
"function EncodeParam($param) {\r\n return str_replace(\" \",\"+\",$param);\r\n }",
"function getSearchQueryAsString() {\n\t\treturn http_build_query($this->getSearchQuery());\n\t}",
"public function getEscapedQueryText()\n\t{\n\t\treturn $this->htmlEscape($this->getQueryText());\n\t}",
"abstract public function escape($value, $addQuotes='\"');",
"public function get_query_string_from_my_params() {\n\n return 'api_paste_private='.$this->get_paste_private().'&api_paste_name='.urlencode($this->get_paste_name()).'&api_paste_expire_date='.$this->get_paste_expire_date().'&api_paste_format='.$this->get_paste_format().'&api_paste_code='.urlencode($this->get_paste_code()).'';\n }",
"function appendToQueryString($qs, $params)\n{\n\tif (!$qs) \n\t{\n\t\t$qs = \"?$params\";\n\t}\n\telse\n\t{\n\t\t$qs .= \"&$params\";\n\t}\n\t\n\tif ($qs[0] != \"?\") $qs = \"?$qs\";\n\t$qs = preg_replace(\"/&&+/\", \"&\", $qs);\n\t\n\treturn $qs;\n}",
"public function addQueryParams()\n {\n foreach ($this->params['query'] as $paramName => $paramValue) {\n if (strpos($this->apiUrl, '?') === false) {\n $this->apiUrl = $this->apiUrl . \"?\";\n } else {\n $this->apiUrl = $this->apiUrl . \"&\";\n }\n $this->apiUrl = $this->apiUrl . $paramName . \"=\" . $paramValue;\n }\n }",
"private static function qsencode ($data) {\n\t\t$req = \"\";\n\t\tforeach ( $data as $key => $value )\n\t\t\t\t$req .= $key . '=' . urlencode( stripslashes($value) ) . '&';\n\t\t// Cut the last '&'\n\t\t$req=substr($req,0,strlen($req)-1);\n\t\treturn $req;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ detects maximal upload file number | public static function getMaxUploadFileNumber() {
return min_not_null(array(self::MAX_NUMBER_FILES, ini_get("suhosin.upload.max_uploads"), ini_get("max_file_uploads")));
} | [
"public function getMaxFiles(): int\n {\n return $this->maxFiles;\n }",
"public static function getMaxUploadFileSize() {}",
"public function getMaxFileUploads()\n {\n return ini_get('max_file_uploads');\n }",
"protected function maximumFileUploadSize() {\n\t\treturn min(Files::sizeStringToBytes(ini_get('post_max_size')), Files::sizeStringToBytes(ini_get('upload_max_filesize')));\n\t}",
"private static function fileUploadMaxSize() {\n\t $max_size = -1;\n\n\t if ($max_size < 0) {\n\t // Start with post_max_size.\n\t $max_size = static::parse_size(ini_get('post_max_size'));\n\n\t // If upload_max_size is less, then reduce. Except if upload_max_size is\n\t // zero, which indicates no limit.\n\t $upload_max = static::parse_size(ini_get('upload_max_filesize'));\n\t if ($upload_max > 0 && $upload_max < $max_size) {\n\t $max_size = $upload_max;\n\t }\n\t }\n\t return $max_size;\n\t}",
"public static function getMaxFilesize()\n {\n $sizePostMax = self::parseFilesize(ini_get('post_max_size'));\n $sizeUploadMax = self::parseFilesize(ini_get('upload_max_filesize'));\n\n return min($sizePostMax ?: PHP_INT_MAX, $sizeUploadMax ?: PHP_INT_MAX);\n }",
"public function getMaximumUploadSize();",
"protected function checkPostUploadSizeIsHigherOrEqualMaximumFileUploadSize() {}",
"public function fileUploadMaxSize()\n {\n\n function bytes( $val )\n {\n $val = trim( $val );\n $last = strtolower( $val[strlen( $val ) - 1] );\n switch($last) {\n case 'g':\n $val *= 1024;\n case 'm':\n $val *= 1024;\n case 'k':\n $val *= 1024;\n }\n\n return $val;\n }\n\n $max_size = bytes( ini_get( 'post_max_size' ) );\n $upload_max = bytes( ini_get( 'upload_max_filesize' ) );\n\n if( $upload_max > 0 && $upload_max < $max_size )\n $max_size = $upload_max;\n\n return $max_size;\n }",
"public function max_file_size() {\n\n\t\tif ( ! empty( $this->field_data['max_size'] ) ) {\n\n\t\t\t// Strip any suffix provided (eg M, MB etc), which leaves is wit the raw MB value.\n\t\t\t$max_size = preg_replace( '/[^0-9.]/', '', $this->field_data['max_size'] );\n\t\t\t$max_size = wpforms_size_to_bytes( $max_size . 'M' );\n\n\t\t} else {\n\t\t\t$max_size = wpforms_max_upload( true );\n\t\t}\n\n\t\treturn $max_size;\n\t}",
"public function getMaxNumberOfUploadsPerUser(): int\n {\n return $this->maxNumberOfUploads;\n }",
"public function getMaximumFileUploadSize()\n {\n return min(convertPHPSizeToBytes(ini_get('post_max_size')), convertPHPSizeToBytes(ini_get('upload_max_filesize')));\n }",
"function _check_attachment_count()\n{\n if ((get_forum_type() == 'cns') && (function_exists('get_member'))) {\n require_code('cns_groups');\n require_lang('cns');\n require_lang('comcode');\n $max_attachments_per_post = cns_get_member_best_group_property(get_member(), 'max_attachments_per_post');\n\n $may_have_one = false;\n foreach ($_POST as $key => $value) {\n if (is_string($key) && preg_match('#^hidFileID\\_#i', $key) != 0) {\n require_code('uploads');\n $may_have_one = is_plupload();\n }\n }\n if ($may_have_one) {\n require_code('uploads');\n is_plupload(true);\n }\n foreach (array_keys($_FILES) as $name) {\n if ((substr($name, 0, 4) == 'file') && (is_numeric(substr($name, 4)) && ($_FILES[$name]['tmp_name'] != ''))) {\n $max_attachments_per_post--;\n }\n }\n\n if ($max_attachments_per_post < 0) {\n warn_exit(do_lang_tempcode('TOO_MANY_ATTACHMENTS'));\n }\n }\n}",
"public function getUploadFieldsLimit();",
"private function check_max()\r\n {\r\n $this->maxcounter--;\r\n if($this->maxcounter <= 0){\r\n $this->maxpics_nr = $this->get_max();\r\n $this->maxcounter = self::REFRESDELAY;\r\n }\r\n return $this->maxpics_nr;\r\n \r\n }",
"function getClientMaxFileUploads() {\n return $this->config['max_user_file_uploads'];\n }",
"function numFiles()\n {\n if (empty($this->_filesToUpload)) {\n $this->_filesToUpload = $_FILES;\n }\n\n $fcount = 0;\n\n for ($i = 1; $i <= count($_FILES); $i++) {\n $curFile = current($this->_filesToUpload);\n\n // Make sure file field on HTML form wasn't empty\n if (!empty($curFile['name'])) {\n $fcount++;\n }\n next($this->_filesToUpload);\n }\n reset($_FILES);\n\n return $fcount;\n }",
"public static function getMaxUploadSize() {\n\t\treturn ceil(vglobal('upload_maxsize') / (1024 * 1024)); \n\t}",
"protected function maxUploadSizeInBytes()\n\t{\n\t\treturn $this->params->get('maxUploadSizeInBytes', 800000);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
test grabbing a Trail Relationship that does not exist grabs the data from mySQL via getTrailRelationshipBySegmentType | public function testGetInvalidTrailRelationshipBySegmentType() {
//grab a segmentType that exceeds the maximum allowable segmentType
$trailRelationship = TrailRelationship::getTrailRelationshipBySegmentType($this->getPDO(), "Q");
$this->assertNull($trailRelationship);
} | [
"public function testGetInvalidTrailRelationshipBySegmentIdAndTrailId() {\n\t\t//grab a segmentId that exceeds the maximum allowable segmentId\n\t\t$trailRelationship = TrailRelationship::getTrailRelationshipBySegmentIdAndTrailId($this->getPDO(), TrailQuailTest::INVALID_KEY, TrailQuailTest::INVALID_KEY);\n\t\t$this->assertNull($trailRelationship);\n\t}",
"public function testGetValidTrailRelationshipBySegmentIdAndTrailId() {\n\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"trailRelationship\");\n\n\t\t//create a new Trail Relationship and insert it into mySQL\n\t\t$trailRelationship = new TrailRelationship($this->segment->getSegmentId(), $this->trail->getTrailId(), $this->VALID_SEGMENTTYPE);\n\t\t$trailRelationship->insert($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoTrailRelationship = TrailRelationship::getTrailRelationshipBySegmentIdAndTrailId($this->getPDO(), $this->segment->getSegmentId(), $this->trail->getTrailId());\n\t\t$this->assertSame($numRows + 1, $this->getConnection()->getRowCount(\"trailRelationship\"));\n\t\t$this->assertSame($pdoTrailRelationship->getSegmentId(), $this->segment->getSegmentId());\n\t\t$this->assertSame($pdoTrailRelationship->getTrailId(), $this->trail->getTrailId());\n\t\t$this->assertSame($pdoTrailRelationship->getSegmentType(), $this->VALID_SEGMENTTYPE);\n\t}",
"public function testGetInvalidTrailRelationshipByTrailId() {\n\t\t//grab a trailId that exceeds the maximum allowable trailId\n\t\t$trailRelationship = TrailRelationship::getTrailRelationshipByTrailId($this->getPDO(), TrailQuailTest::INVALID_KEY);\n\t\t$this->assertNull($trailRelationship);\n\t}",
"public function testGetValidTrailRelationshipByTrailId() {\n\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"trailRelationship\");\n\n\t\t//create a new Trail Relationship and insert it into mySQL\n\t\t$trailRelationship = new TrailRelationship($this->segment->getSegmentId(), $this->trail->getTrailId(), $this->VALID_SEGMENTTYPE);\n\t\t$trailRelationship->insert($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoTrailRelationship = TrailRelationship::getTrailRelationshipByTrailId($this->getPDO(), $this->trail->getTrailId());\n\t\t$this->assertSame($numRows + 1, $this->getConnection()->getRowCount(\"trailRelationship\"));\n\t\t$this->assertSame($pdoTrailRelationship->getSegmentId(), $this->segment->getSegmentId());\n\t\t$this->assertSame($pdoTrailRelationship->getTrailId(), $this->trail->getTrailId());\n\t\t$this->assertSame($pdoTrailRelationship->getSegmentType(), $this->VALID_SEGMENTTYPE);\n\t}",
"protected function findRelationsToNonExistingRecords() : array {}",
"public\n\t\tfunction testGetInvalidTrailByTrailSubmissionType() {\n\t\t\t//grab a TrailSubmissionType that does not exist\n\t\t\t$trail = Trail::getTrailByTrailSubmissionType($this->getPDO(), \"null\");\n\t\t\t$this->assertNull($trail);\n\t\t}",
"public function testDeleteInvalidTrailRelationship() {\n\t\t// create a Trail Relationship and try to delete it without actually inserting it\n\t\t$trailRelationship = new TrailRelationship($this->segment->getSegmentId(), $this->trail->getTrailId(), $this->VALID_SEGMENTTYPE);\n\t\t$trailRelationship->delete($this->getPDO());\n\t}",
"public function testGetInvalidTrailByTrailCondition() {\n\t\t//grab a TrailCondition that does not exist\n\t\t$trail = Trail::getTrailByTrailCondition($this->getPDO(), \"<script></script>\");\n\t\t$this->assertNull($trail);\n\t}",
"public function testRelationshipsGetRelationship()\n {\n }",
"protected function _getRelationRecords(){ }",
"protected function _getRelatedRecords(){ }",
"public function testGetInvalidTrailByTrailId() : void {\n\t\t// grab a trail id that exceeds the maximum allowable trail id\n\t\t$trail = Trail::getTrailByTrailId($this->getPDO(), generateUuidV4());\n\t\t$this->assertNull($trail);\n\t}",
"public function testGetInvalidTrailByDistance() : void {\n\t\t// grab a trail by distance that does not exist\n\t\t$trail = Trail::getTrailByDistance($this->getPDO(), 35.0855, -106.6491, 100);\n\t\t$this->assertCount(0, $trail);\n\t}",
"public function postRelationshipsWithWrongResourceId(){\n foreach($this->relationships() as $relationship){\n // get related model\n $relatedModel = $this->newModel($relationship);\n // POST\n $response = $this->client()->request('POST', '/'.$this->resource.'/1/relationships/'.$relationship, [\n 'headers' => $this->headers(),\n 'body' => json_encode([\n \"data\" => [\n 'id' => $relatedModel->all()->random(1)->id,\n 'type' => strtolower(str_replace('ownedBy','',$relationship))\n ]\n ])\n ]);\n // ASSERTIONS\n $this->assertEquals(self::HTTP_NOT_FOUND, $response->getStatusCode());\n }\n }",
"public function postRelationshipsToWrongUrl(){\n $model = $this->model->first();\n foreach($this->relationships() as $relationship){\n // get related model\n $relatedModel = $this->newModel($relationship);\n // POST\n $response = $this->client()->request('POST', '/'.$this->resource.'/'.$model->id.'/relationships/wrongRelationship', [\n 'headers' => $this->headers(),\n 'body' => json_encode([\n \"data\" => [\n 'id' => $relatedModel->all()->random(1)->id,\n 'type' => strtolower(str_replace('ownedBy','',$relationship))\n ]\n ])\n ]);\n // ASSERTIONS\n $this->assertEquals(self::HTTP_NOT_FOUND, $response->getStatusCode());\n }\n }",
"public function testGetValidTrailByTrailTraffic() {\n\t\t\t//count the number of rows and save it for later\n\t\t\t$numRows = $this->getConnection()->getRowCount(\"trail\");\n\n\t\t\t//create a new trail and insert it into mySQL\n\t\t\t$trail = new Trail(null, $this->user->getUserId(), $this->VALID_BROWSER, $this->VALID_CREATEDATE, $this->VALID_IPADDRESS, $this->VALID_SUBMITTRAILID,\n\t\t\t\t\t$this->VALID_TRAILAMENITIES, $this->VALID_TRAILCONDITIION, $this->VALID_TRAILDESCRIPTION, $this->VALID_TRAILDIFFICULTY,\n\t\t\t\t\t$this->VALID_TRAILDISTANCE, $this->VALID_TRAILNAME, $this->VALID_TRAILSUBMISSIONTYPE, $this->VALID_TRAILTERRAIN, $this->VALID_TRAILTRAFFIC,\n\t\t\t\t\t$this->VALID_TRAILUSE, $this->VALID_TRAILUUID);\n\n\t\t\t$trail->insert($this->getPDO());\n\n\t\t\t//grab the data from mySQL and enforce the fields match our expectations\n\t\t\t$pdoTrails = Trail::getTrailByTrailTraffic($this->getPDO(), $trail->getTrailTraffic());\n\t\t\tforeach($pdoTrails as $pdoTrail) {\n\t\t\t\t$this->assertSame($numRows + 1, $this->getConnection()->getRowCount(\"trail\"));\n\t\t\t\t$this->assertLessThan($pdoTrail->getTrailId(),0);\n\t\t\t\t$this->assertSame($pdoTrail->getUserId(), $this->user->getUserId());\n\t\t\t\t$this->assertSame($pdoTrail->getBrowser(), $this->VALID_BROWSER);\n\t\t\t\t$this->assertEquals($pdoTrail->getCreateDate(), $this->VALID_CREATEDATE);\n\t\t\t\t$this->assertSame($pdoTrail->getIpAddress(), $this->VALID_IPADDRESS);\n\t\t\t\t$this->assertSame($pdoTrail->getSubmitTrailId(), $this->VALID_SUBMITTRAILID);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailAmenities(), $this->VALID_TRAILAMENITIES);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailCondition(), $this->VALID_TRAILCONDITIION);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailDescription(), $this->VALID_TRAILDESCRIPTION);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailDifficulty(), $this->VALID_TRAILDIFFICULTY);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailDistance(), $this->VALID_TRAILDISTANCE);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailName(), $this->VALID_TRAILNAME);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailDescription(), $this->VALID_TRAILDESCRIPTION);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailSubmissionType(), $this->VALID_TRAILSUBMISSIONTYPE);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailTerrain(), $this->VALID_TRAILTERRAIN);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailTraffic(), $this->VALID_TRAILTRAFFIC);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailUse(), $this->VALID_TRAILUSE);\n\t\t\t\t$this->assertSame($this->longUuidToShortUuid($pdoTrail->getTrailUuId()), $this->VALID_TRAILUUID);\n\t\t\t}\n\t\t}",
"public function testUpdateValidTrailRelationshipByTrailId() {\n\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"trailRelationship\");\n\n\t\t//create a new Trail Relationship and insert it into mySQL\n\t\t$trailRelationship = new TrailRelationship($this->segment->getSegmentId(), $this->trail->getTrailId(), $this->VALID_SEGMENTTYPE);\n\t\t$trailRelationship->insert($this->getPDO());\n\n\t\t// edit the Trail Relationship and update it in mySQL\n\t\t$trailRelationship->setSegmentType($this->VALID_SEGMENTTYPE2);\n\t\t$trailRelationship->update($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoTrailRelationship = TrailRelationship::getTrailRelationshipByTrailId($this->getPDO(), $trailRelationship->getTrailId());\n\t\t$this->assertSame($numRows + 1, $this->getConnection()->getRowCount(\"trailRelationship\"));\n\t\t$this->assertSame($pdoTrailRelationship->getTrailId(), $this->trail->getTrailId());\n\t\t$this->assertSame($pdoTrailRelationship->getSegmentId(), $this->segment->getSegmentId());\n\t\t$this->assertSame($pdoTrailRelationship->getSegmentType(), $this->VALID_SEGMENTTYPE2);\n\t}",
"public function testGetMultipleRelationsWithMissingRecord()\n {\n // note: crmId2 is not created yet\n $relations = $this->_object->getMultipleRelations($this->_crmId['model'], $this->_crmId['backend'], array($this->_crmId['id'], $this->_crmId2['id']));\n\n $this->assertEquals(2, count($relations), 'number of relation sets does not fit requested number');\n $this->assertArrayHasKey(0, $relations, 'crmId is missing');\n $this->assertGreaterThanOrEqual(2, count($relations[0]), 'not enough relations found for crmId');\n $this->assertArrayHasKey(1, $relations, 'crmId2 is missing');\n $this->assertEquals(0, count($relations[1]), 'to much relations for crmId2');\n }",
"public function testLoadRelated()\n {\n $this->todo('stub');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
validar_datos_entrada Valida los datos del la entrada | private function validar_datos_entrada(){
$this->data['success'] = TRUE;
$this->data['message'] = "";
$validations = [
'sNombre'=>['message'=>'NOMBRE']
];
foreach($validations AS $k=>$v){
if(!isset($this->conc[$k]) || empty(trim($this->conc[$k]))){
$this->data['success'] = FALSE;
$this->data['message'] = $v['message'].' REQUERIDO';
return $this->data;
}
if(isset($v['validations'])){
foreach($v['validations'] AS $valid){
switch ($valid) {
case 'integer':
$this->conc[$k] = str_replace(',','',$this->conc[$k]);
if(!preg_match('/^[0-9]+$/', $this->conc[$k])){
$this->data['success'] = FALSE;
$this->data['message'] = $v['message'].' - INGRESAR NÚMEROS ENTEROS';
return $this->data;
}
break;
case 'decimal':
$this->conc[$k] = str_replace(',','',$this->conc[$k]);
if(!preg_match('/^[0-9.]+$/', $this->conc[$k])){
$this->data['success'] = FALSE;
$this->data['message'] = $v['message'].' - INGRESAR NÚMEROS ENTEROS / DECIMALES';
return $this->data;
}
break;
case 'date':
$this->conc[$k] = date('Y-m-d', strtotime(str_replace('/', '-', $this->conc[$k])));
if(!preg_match('/^[0-9\/-]+$/', $this->conc[$k])){
$this->data['success'] = FALSE;
$this->data['message'] = $v['message'].' - FECHA NO VALIDA';
return $this->data;
}
break;
}
}
}
}
return $this->data;
} | [
"public function validaAsiento(){\n //no esta ocupado\n \n /*$filtrado[\"where\"] = \"t.cod_asiento = \".$this->cod_asiento;\n\n $entradas = $this->buscarTodos($filtrado);\n\n if(!empty($entradas))\n $this->setError(\"cod_asiento\",\"El asiento ya ha sido comprado\");*/\n \n if($this->asientoOcupado($this->cod_asiento,$this->cod_pase_pelicula)===true){\n $this->setError(\"cod_asiento\", \"El asiento ya ha sido reservado\");\n }\n\n }",
"function validarRegistro()\n {\n if(is_numeric($_REQUEST['cod_padre1']) && is_numeric($_REQUEST['cod_hijo1'])){\n \n $datosRegistro=array('cod_proyecto'=>$_REQUEST['cod_proyecto'],\n 'cod_padre'=>$_REQUEST['cod_padre1'],\n 'cod_proyecto_hom'=>$_REQUEST['cod_proyecto_hom'],\n 'cod_hijo'=>$_REQUEST['cod_hijo1']);\n //iniciamos las validaciones\n $valida_diferentes = $this->verificarEspaciosDiferentes($datosRegistro);\n $datos_padre = array( 'cod_proyecto'=>\"\",\n 'cod_espacio'=>$datosRegistro['cod_padre']);\n $valida_padre = $this->verificarEspacioAcademico($datos_padre);\n\n $datos_hijo = array( 'cod_proyecto'=>\"\",\n 'cod_espacio'=>$datosRegistro['cod_hijo']);\n $valida_hijo = $this->verificarEspacioAcademico($datos_hijo);\n\n $valida_registro = $this->verificarRegistro($datosRegistro);\n $valida_pareja_union=$this->verificarParejaUnion($datosRegistro);\n $valida_pareja_bifurcacion=$this->verificarParejaBifurcacion($datosRegistro);\n\n $valida_plan_estudio = $this->verificarPlanEstudios($datosRegistro);\n $valida_espacio_ppal = $this->verificarEspacioPrincipalPlanEstudios($datosRegistro);\n }\n $mensaje=\"\";\n //revisamos los mensajes de errores\n if($valida_espacio_ppal <>'ok'){\n $mensaje=$valida_espacio_ppal;\n }\n \n if($valida_plan_estudio <>'ok'){\n $mensaje=$valida_plan_estudio;\n }\n \n if($valida_pareja_bifurcacion <>'ok' ){\n $mensaje=$valida_pareja_bifurcacion;\n }\n if($valida_pareja_union <>'ok' ){\n $mensaje=$valida_pareja_union;\n }\n if($valida_registro <>'ok' ){\n $mensaje=$valida_registro;\n }\n \n if($valida_hijo <>'ok' ){\n $mensaje=$valida_hijo;\n //echo \"<br>mensaje\".$mensaje; exit;\n }\n \n if($valida_padre <>'ok' ){\n $mensaje=$valida_padre;\n // echo \"<br>mensaje\".$mensaje; exit;\n }\n \n if($valida_diferentes <>'ok'){\n $mensaje=$valida_diferentes;\n }\n \n //verificamos que las validaciones esten ok para realizar la insercion\n if($valida_diferentes=='ok' && $valida_padre =='ok' && $valida_hijo =='ok' && $valida_registro=='ok' && $valida_plan_estudio=='ok' && $valida_espacio_ppal=='ok' && $valida_pareja_union=='ok' && $valida_pareja_bifurcacion=='ok'){\n //echo \"inscribir reg\" ;exit;\n $registro = $this->buscarRegistroHomologacion($datosRegistro);\n \n if($registro[0]['ESTADO']=='I'){\n $pagina=$this->configuracion[\"host\"].$this->configuracion[\"site\"].\"/index.php?\";\n $variable=\"pagina=registro_adicionarTablaHomologacion\";\n $variable.=\"&opcion=deshabilitar\";\n $variable.=\"&tipo_hom=normal\";\n $variable.=\"&estado=A\";\n $variable.=\"&codHomologa=\".$datosRegistro['cod_hijo'];\n $variable.=\"&codPpal=\".$datosRegistro['cod_padre'];\n $variable.=\"&codCraPpal=\".$datosRegistro['cod_proyecto'];\n $variable.=\"&cod_proyecto=\".$_REQUEST['cod_proyecto'];\n $variable.=\"&fec_reg=\".$registro[0]['FEC_REG'];\n $variable.=\"&retorno=admin_homologaciones\";\n $variable.=\"&opcionRetorno=crearTablaHomologacion\";\n $variable=$this->cripto->codificar_url($variable,$this->configuracion);\n $this->enlaceParaRetornar($pagina, $variable);\n //$this->actualizarRegistro($datosRegistro);\n }else{\n $this->inscribirRegistro($datosRegistro);\n }\n \n }else{\n $variablesRegistro=array('usuario'=>$this->usuario,\n 'evento'=>'54',\n 'descripcion'=>'Error al registrar -'.$mensaje,\n 'registro'=>\"cod_proyecto-> \".$datosRegistro['cod_proyecto'].\", cod_padre->\".$datosRegistro['cod_padre'].\", cod_proyecto_hom->\".$datosRegistro['cod_proyecto_hom'].\", cod_hijo->\".$datosRegistro['cod_hijo'],\n 'afectado'=>$_REQUEST['cod_proyecto']);\n \n $pagina=$this->configuracion[\"host\"].$this->configuracion[\"site\"].\"/index.php?\";\n $variable=\"pagina=admin_homologaciones\";\n $variable.=\"&opcion=crearTablaHomologacion\";\n $variable.=\"&tipo_hom=normal\";\n $variable.=\"&cod_proyecto=\".$datosRegistro['cod_proyecto'];\n $variable.=\"&cod_padre1=\".$datosRegistro['cod_padre'];\n $variable.=\"&cod_proyecto_hom=\".$datosRegistro['cod_proyecto_hom'];\n $variable.=\"&cod_hijo1=\".$datosRegistro['cod_hijo'];\n $variable=$this->cripto->codificar_url($variable,$this->configuracion);\n \n $this->retornar($pagina,$variable,$variablesRegistro,$mensaje);\n }\n }",
"function ValidaDatos()\n{\n\tglobal $status_peticion;\n\n\t$nom_paciente\t=CCGetRequestParam('nom_paciente',ccsPost);\n\t$paciente_id\t=CCGetRequestParam('paciente_id',ccsPost);\n\t$estado_id\t\t=CCGetRequestParam('estado_id',ccsPost);\n\t$fecha\t\t\t=CCGetRequestParam('fecha',ccsPost);\n\t$hora\t\t\t=CCGetRequestParam('hora',ccsPost);\n\t$procedencia_id\t=CCGetRequestParam('procedencia_id',ccsPost);\n\t$prevision_id\t=CCGetRequestParam('prevision_id',ccsPost);\n\t$medico_id\t\t=CCGetRequestParam('medico_id',ccsPost);\n\t$test_peticion\t=CCGetRequestParam('test_peticion',ccsPost);\n\t$prioridad_id\t=CCGetRequestParam('prioridad_id',ccsPost);\n\t$observaciones\t=CCGetRequestParam('observaciones',ccsPost);\n\n\t$malo=\"\";\n\n\t$malo .= $nom_paciente \t ? \"\" : \"<br/>Falta Nombre del Paciente\";\n\t$malo .= $paciente_id\t ? \"\" : \"<br/>Falta paciente_id\";\n\t$malo .= $estado_id\t\t ? \"\" : \"<br/>Falta estado_id\";\n\t$malo .= $fecha\t\t\t ? \"\" : \"<br/>Falta fecha\";\n\t$malo .= $hora\t\t\t ? \"\" : \"<br/>Falta hora\";\n\t$malo .= $procedencia_id ? \"\" : \"<br/>Falta Seleccionar procedencia\";\n\t$malo .= $prevision_id \t ? \"\" : \"<br/>Falta Seleccionar la previsión del Paciente\";\n\t$malo .= $medico_id \t ? \"\" : \"<br/>Falta Seleccionar el médico solicitante\";\n\t$malo .= $test_peticion\t ? \"\" : \"<br/>No se ha pedido ningún test\";\n\t$malo .= $prioridad_id\t ? \"\" : \"<br/>No se ha seleccionado prioridad para el test\";\n\n\t//Valida el formato del campo fecha\n\t// debe ingresar en formato dd/mm/yyyy\n\tif ( ereg( \"([0-9]{1,2})[-/. ]([0-9]{1,2})[-/. ]([0-9]{4})\", $fecha, $regs) ) {\n\t\tif (checkdate($regs[2],$regs[1],$regs[3]))\n\t\t{\n\t\t\t$malo.=\"\";\n\t\t} else {\n\t\t\t$malo.=\"<br/>La fecha $fecha ingresada no es válida\";\n\t\t}\n\t} else {\n\t $malo.=\"<br/>Formato de fecha no válido ($fecha), use formato dd/mm/aaaa\";\n\t}\n\n\t//Valida el formato del campo hora\n\t// debe ingresar en formato HH:MM\n\tif ( ereg( \"([0-9]{1,2}):([0-5][0-9])\", $hora, $regs) ) {\n\t\tif ($regs[1]>24) $malo.=\"<br/>El valor $hora ingresado no es una hora válida\";\n\t} else {\n\t $malo.=\"<br/>Formato de Hora no válido ($hora), use formato HH:MM\";\n\t}\n\n\t$status_peticion->SetValue(\"NUEVA PETICION\");\n\n\tAddError($malo);\n\n\t$ok= ($malo!=\"\") ? false : true; \n\n\treturn $ok;\n}",
"private function validarDados()\n\t{\n\t\t// Configurar array para instaciar classe de validação de dados\n\t\t$dataToValidate = array(\n\t\t\t\"nome\" => $this->data['MONITOR_NOME'],\n\t\t\t\"login\" => $this->data['MONITOR_LOGIN'],\n\t\t\t\"email\" => $this->data['MONITOR_EMAIL'],\n\t\t\t\"pass\" => [\n\t\t\t\t\"pass\" => $this->data['MONITOR_SENHA'],\n\t\t\t\t\"confirm\" => $this->data['passConfirm']\n\t\t\t]\n\t\t);\n\n\t\t// Instanciar classe de validação de dados\n\t\ttry {\n\t\t\t/* Validar formato dos dados enviados */\n\t\t\t$conf = PACKS_PATH . \"/sline/Validation/forms/monitor.json\";\n\t\t\t$validator = new Validator($dataToValidate, $conf);\n\t\t\t\n\t\t\tif (!$validator->validate()) {\n\t\t\t\t$this->error = $validator->error;\n\t\t\t\treturn false;\n\t\t\t} else {\n\n\t\t\t\t/* Verificar autorização para cadastro */\n\t\t\t\t$w = \"WHERE AUTORIZACAO_EMAIL = '{$this->data['MONITOR_EMAIL']}'\";\n\n\t\t\t\tif (!empty($this->connection->read(\"Autorizacao\", \"*\", $w))) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\t$this->error = \"Desculpe, você não está autorizado.\";\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch(Exception $e) {\n\t\t\techo (DEBUG) ? $e : \"<!-- $e -->\";\n\t\t\texit(\"Houve um erro interno. Por favor, contate o suporte.\");\n\t\t}\n\t}",
"public function Validar(){\n\t\t$campos=\"SELECT P.PerNumDoc,\n\t\t\t\t\t\tP.PerPriNom,\n\t\t\t\t\t\tP.PerSegNom,\n\t\t\t\t\t\tP.PerPriApe,\n\t\t\t\t\t\tP.PerSegApe,\n\t\t\t\t\t\tP.PerDirRes,\n\t\t\t\t\t\tP.PerNumTel,\n\t\t\t\t\t\tP.PerEmail,\n\t\t\t\t\t\tP.Latitud,\n\t\t\t\t\t\tP.Longitud FROM personas as P WHERE P.PerNumDoc='$this->PerNumDoc'\";\n\t\t\t\t\t\t$querycampos=mysql_query($campos);\n\t\t\t\t\t\t$row=mysql_num_rows($querycampos);\n\t\t\t\t\t\tif($row==true){\n\t\t\t\t\t\t\twhile($rowper=mysql_fetch_array($row)){\n\t\t\t\t\t\t\t\trequire_once(\"../actualizar_datos.php\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo \"<script>alert('Usted no está registrado en la base de datos de SISBEN, por favor verifique su documento e intente nuevamente');</script>\";\n\t\t\t\t\t\t\techo \"<script>window.location.href='../actualizar_datos.php';</script>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\n\t\techo \"<script>alert('Entre a la funcion validar');</script>\";\n echo \"<script>window.location.href='../actualizar_datos.php';</script>\";\n\n\t}",
"public function convalida()\n {\n $dati_validi = true;\n\n if (empty($this->id)) {\n Notifica::accoda(\"Inserire l'id del servizio\", Notifica::TIPO_ERRORE);\n $dati_validi = false;\n }\n if (strlen($this->nome)) {\n Notifica::accoda(\"Inserire il nome\", Notifica::TIPO_ERRORE);\n $dati_validi = false;\n }\n /*if (strlen($this->descrizione)) {\n Notifica::accoda(\"Impostare una descrizione\", Notifica::TIPO_ERRORE);\n }\n if (empty($this->id_tipo)) {\n Notifica::accoda(\"Inserire il tipo di servizio\", Notifica::TIPO_AVVERTENZA);\n $dati_validi = false;\n }\n if (empty($this->durata)) {\n Notifica::accoda(\"Ricordati di mettere la durata\", Notifica::TIPO_ERRORE);\n }\n */\n\n return $dati_validi;\n }",
"private function validarDados() {\n $this->Dados = array_map('strip_tags', $this->Dados); // tira as tag (html) digitadas pelo usuario\n $this->Dados = array_map('trim', $this->Dados); // tiras os espacos em brancos digitados pelo usuario\n // verificar se algum campo está vazio ou não foi preenchido\n if(in_array('', $this->Dados)):\n $this->Resultado = false;\n $this->Msg = \"<p style='color:red'><b>Erro ao cadastrar: </b>Para cadastrar usuario preencha todos os campos!</p>\";\n else:\n $this->Dados['password'] = md5($this->Dados['password']); // criptografado md5\n $this->Resultado = true;\n endif;\n }",
"public function validar_fecha_distinta_controlador()\n {\n $fec_form = mainModel::limpiar_cadena($_POST['fec_even']);\n $cod_even = mainModel::limpiar_cadena($_POST['cod_even']);\n $datosEvento = [\n \"cod_even\" => $cod_even\n ];\n\n $row = eventoModelo::consultar_editar_evento_modelo($datosEvento);\n foreach ($row as $row) {\n $fecha_actual = date(\"d-m-Y\");\n $fec_even = $row['fec_even'];\n if ($fec_even < $fecha_actual) {\n $fecha_minima = $fec_even;\n } else {\n $fecha_minima = date(\"Y-m-d\");\n }\n if ($fec_form < $fecha_minima) {\n echo '<div class=\"alert alert-danger\"><strong>Error!</strong> La fecha mínima para registrar el evento es ' . $fecha_minima . '</div>';\n } else if ($fec_form > '2051-01-01') {\n echo '<div class=\"alert alert-danger\"><strong>Error!</strong> La fecha maxima para registrar el evento es 01-01-2051</div>';\n } else { }\n }\n }",
"function Validar_atributos(){\n $this->Comprobar_nombre();\n $this->Comprobar_DNI();\n if($this->erroresdatos==[]){\n return true;\n }else{\n return $this->erroresdatos;\n }\n }",
"public function validar($datos){\n\t $salida=true;\n\t $mensajes = Array();\n\t \n\t if(!is_numeric($datos['numero_documento']) && !is_null($datos['numero_documento'])){\n\t $salida=false;\n\t $mensaje1=\"EL NUMERO DE DOCUMENTO DEBE SER NUMERICO\";\n\t array_push($mensajes, $mensaje1);\n }\n if(is_null($datos['numero_documento'])){\n\t $salida=false;\n\t $mensaje2=\"EL NUMERO DE DOCUMENTO ES OBLIGATORIO\";\n\t array_push($mensajes, $mensaje2);\n } \n\t return [$salida, $mensajes];\n\t}",
"function validarInscripcionEstudiante()\n {\n $this->datosInscripcion=$_REQUEST;\n $retorno['pagina']=$this->datosInscripcion['retornoPagina']=\"admin_consultarInscripcionesEstudiante\";\n $retorno['opcion']=$this->datosInscripcion['retornoOpcion']=\"mostrarConsulta\";\n $this->datosInscripcion['retornoParametros']=array('codProyectoEstudiante'=>$_REQUEST[\"codProyectoEstudiante\"],\n 'planEstudioEstudiante'=>$_REQUEST[\"planEstudioEstudiante\"],\n 'codEstudiante'=>$_REQUEST[\"codEstudiante\"]);\n $back='';\n foreach ($this->datosInscripcion['retornoParametros'] as $key => $value) {\n $back.=\"&\".$key.\"=\".$value;\n }\n $retorno['parametros']=$back;\n $retorno['nombreEspacio']=$this->consultarNombreEspacio();\n if (trim($_REQUEST['estado_est'])=='B'||trim($_REQUEST['estado_est'])=='J')\n {\n if(isset($_REQUEST['reprobado'])||isset($_REQUEST['confirmaPlan'])||isset($_REQUEST['cancelado']))\n {\n\n }else\n {\n $this->verificarEspacioReprobado($retorno);\n }\n }else\n {\n \n }\n\n if (isset($_REQUEST['confirmaPlan'])&&$_REQUEST['confirmaPlan']==1)\n {\n $this->inscribirEstudiante($this->datosInscripcion);\n }\n else\n {\n if(isset($_REQUEST['cancelado'])&&$_REQUEST['cancelado']==1)\n {\n $this->verificarEspacioPlan($this->datosInscripcion);\n }\n else\n {\n $this->verificarInscrito($retorno);\n $this->verificarCruce($retorno);\n $this->verificarSobrecupo($retorno);\n $this->verificarCancelado($retorno);\n $this->verificarEspacioPlan($retorno);\n $this->verificarCreditos($retorno);\n $this->verificarCreditosPorClasificacion($retorno);\n \n }\n $this->inscribirEstudiante($this->datosInscripcion);\n }\n\n//si hay confirmación de cancelado pasa a varificar plan\n//si hay confirmacion de planEstudio, pasa a registrar\n //si no hay, realiza validaciones\n\n }",
"public function validar()\n {\n // Recorremos las reglas de validación para aplicarlas a cada campo.\n // Recordemos el formato de las reglas:\n /*[\n 'nombre' => ['required', 'min:2'],\n 'precio' => ['required', 'numeric'],\n 'id_marca' => ['required'],\n 'id_categoria' => ['required'],\n ]*/\n foreach($this->reglas as $nombreCampo => $reglasCampo) {\n // Para cada regla, tenemos que aplicarlas al campo.\n $this->aplicarReglas($nombreCampo, $reglasCampo);\n }\n }",
"private function ValidarRegistro(){\n\t\t$retornar=false;\n\t\t$mailfilter =filter_var($this->Mail_,FILTER_VALIDATE_EMAIL);//filtramos el correo\n\t\t//Validamos el formato de correo electronico utilizando expresiones regulares\n\t\tif(preg_match(\"/[a-zAZ0-9\\_\\-]+\\@[a-zA-Z0-9]+\\.[a-zA-Z0-9]/\", $mailfilter )==true){\n\t\t\t//intanciando de las clases\n\t\t\t$confi=new Datos_conexion();\n\t\t\t$mysql=new mysqli($confi->host(),$confi->usuario(),$confi->pasword(),$confi->DB());\n\t\t\t//Determinamos si la conexion a la bd es correcto.\n\t\t\tif(!$mysql){\n\t\t\t\t$this->Mensaje='<div class=\"alert alert-danger alert-dismissible\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button><h6><i class=\"icon fas fa-ban\"></i> Error!</h6>Error! Server of data not found</div>';\n\t\t\t}else{\n\t\t\t\t//consulta SQL para vereficar si existe tal correo \n\t\t\t\t$query = \"SELECT\n\t\t\t\t\t\t\t\ttb_users.email\n\t\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\ttb_users\n\t\t\t\t\t\t\t\tWHERE tb_users.email='\".$mailfilter.\"';\";\n\t\t\t\t$respuesta = $mysql->query($query);\n\t\t\t\t\t//Aqui determinamos con la instruccion if\n\t\t\t\t\t//la consulta generada, si mayor a cero\n\t\t\t\t\t//retornamos el valor verdadero\n\t\t\t\t\t//por el contrario mesaje de error\n\t\t\t\tif($respuesta->num_rows>0){\n\t\t\t\t\t//asignamos el mail sanitizado al campo Mail_\n $this->Mail_=$mailfilter;\t\n $retornar=false;// se retorna un valor verdadero\n $this->Mensaje='<div class=\"alert alert-danger alert-dismissible\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button><h6><i class=\"icon fas fa-ban\"></i> Error!</h6>This email is in use</div>';\n \n\t\t\t\t}else { //el email no esta en uso, registramos el usuario.\n\t\t\t\t\t$passwdhashed = Password::hashp($this->Contrasena_);\n\t\t\t\t\t$tmpdate = date('d/m/Y');\n $query = \"INSERT INTO tb_users\n\t\t\t\t\t\t\t\t(`id`, `role_id`, `name`, `email`, `passwd`, `startedon`, `recoveryCode`, `pendant_project`) VALUES (NULL, '1', '$this->Nombre_usr', '$mailfilter', '$passwdhashed', '$tmpdate', '0', '0');\";\n\t\t\t\t\t\n if ($mysql->query($query) === true) {\n\t\t\t\t\t\t$inicio=new Login($mailfilter,$this->Contrasena_);\n\t\t\t\t\t\t$inicio->Ingresar();\n\t\t\t\t\t\t$idsur = ($mysql->insert_id);\n\t\t\t\t\t\t//Recuperando el IP del usuario atravez del metodo IPuser() \n\t\t\t\t\t\t$IpUsr = $this->IPuser();\n\t\t\t\t\t\t//Recuperando la hora en el que ingreso\n\t\t\t\t\t\t$hora = time();\n\t\t\t\t\t\t$Contrasena = new PasswordHash(8, FALSE);\n\t\t\t\t\t\t//Recuperamos recuperando los dados para incriptar\n\t\t\t\t\t\t$Clave = $Contrasena->HashPassword($idsur.$IpUsr.$this->Nombre_usr.$hora); \n\t\t\t\t\t\t//Registrando a la varaible global datos en un arreglo para iniciar session\n\t\t\t\t\t\t$_SESSION['INGRESO'] = array(\n\t\t\t\t\t\t\t\"Id\" =>$idsur,\n\t\t\t\t\t\t\t\"Ip\" =>$IpUsr,\n\t\t\t\t\t\t\t\"Clave\" =>$Clave,\n\t\t\t\t\t\t\t\"Nombre\"=>$this->Nombre_usr,\n\t\t\t\t\t\t\t\"hora\" =>$hora,\n\t\t\t\t\t\t\t\"role\" => '1'); \n\t\t\t\t\t\n\t\t\t\t\t\techo \"<script>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t window.location.replace('./account.php'); \n\t\t\t\t\t\t\t </script>\";\n\t\t\t\t\t}\n }\n\t\t\t}\n\t\t}else{\n\n\t\t\t//Se muestra al usuario el mensaje de error sobre\n\t\t\t\t//el formato de correo\n\t\t\t\t$this->Mensaje='<div class=\"alert alert-danger alert-dismissible\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button><h6><i class=\"icon fas fa-ban\"></i> Error!</h6>Invalid email</div>';\n\t\t}\n\t return $retornar;\n\t}",
"function validarDatosPresupuesto($presupuesto){\n\t\tswitch ($presupuesto[\"tipoServicio\"]) {\n\t\t\tcase 'grua':\n\t\t\t\tif($presupuesto[\"horasGrua\"]==\"\"){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Las horas de grúa no pueden estar vacías.</p>\";\n\t\t\t\t}else if($presupuesto[\"horasGrua\"]<1){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Las horas de grúa deben ser mayor o igual que uno.</p>\";\n\t\t\t\t}else if(!ctype_digit($presupuesto[\"horasGrua\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Introduzca un valor entero válido para las horas.</p>\";\n\t\t\t\t}else if(!is_numeric($presupuesto[\"horasGrua\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Las horas de grúa se expresan sólo con números.</p>\";\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 'cuba_escombros':\n\t\t\t\tif($presupuesto[\"distancia\"]==\"\"){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia no puede estar vacía.</p>\";\n\t\t\t\t}else if($presupuesto[\"distancia\"]<1){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia de ser mayor o igual que uno.</p>\";\n\t\t\t\t}else if($presupuesto[\"distancia\"]>35){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia debe ser menor o igual que 35.</p>\";\n\t\t\t\t}else if(!ctype_digit($presupuesto[\"distancia\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Introduzca un valor entero válido para la distancia.</p>\";\n\t\t\t\t}else if(!is_numeric($presupuesto[\"distancia\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia se expresa sólo con números.</p>\";\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 'cuba_poda':\n\t\t\t\tif($presupuesto[\"tamañoCuba\"]==\"\"){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>El tamaño no puede estar vacío.</p>\";\n\t\t\t\t}else if ($presupuesto[\"tamañoCuba\"]!=\"pequeña\" && $presupuesto[\"tamañoCuba\"]!=\"mediana\" && $presupuesto[\"tamañoCuba\"]!=\"grande\"){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Introduzca un tamaño válido</p>\";\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 'cuba_estiercol': \n\t\t\t\tif($presupuesto[\"tamañoCuba\"]==\"\"){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>El tamaño no puede estar vacío.</p>\";\n\t\t\t\t}else if ($presupuesto[\"tamañoCuba\"]!=\"pequeña\" && $presupuesto[\"tamañoCuba\"]!=\"mediana\" && $presupuesto[\"tamañoCuba\"]!=\"grande\"){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Introduzca un tamaño válido</p>\";\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 'leña':\n\t\t\t\tif($presupuesto[\"pesoLeña\"]==\"\"){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>El peso no puede estar vacío.</p>\";\n\t\t\t\t}else if($presupuesto[\"pesoLeña\"]<100){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>El peso debe ser mayor o igual que 100.</p>\";\n\t\t\t\t}else if($presupuesto[\"pesoLeña\"]>4500){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>El peso debe ser menor o igual que 4500.</p>\";\n\t\t\t\t}else if(!ctype_digit($presupuesto[\"pesoLeña\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Introduzca un valor entero válido para el peso.</p>\";\n\t\t\t\t}else if(!is_numeric($presupuesto[\"pesoLeña\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>El peso se expresa sólo con números.</p>\";\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 'aridos':\n\t\t\t\tif($presupuesto[\"distancia\"]==\"\"){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia no puede estar vacía.</p>\";\n\t\t\t\t}else if($presupuesto[\"distancia\"]<1){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia de ser mayor o igual que uno.</p>\";\n\t\t\t\t}else if($presupuesto[\"distancia\"]>35){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia debe ser menor o igual que 35.</p>\";\n\t\t\t\t}else if(!ctype_digit($presupuesto[\"distancia\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Introduzca un valor entero válido para la distancia.</p>\";\n\t\t\t\t}else if(!is_numeric($presupuesto[\"distancia\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia se expresa sólo con números.</p>\";\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 'otros_materiales':\n\t\t\t\tif($presupuesto[\"distancia\"]==\"\"){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia no puede estar vacía.</p>\";\n\t\t\t\t}else if($presupuesto[\"distancia\"]<1){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia de ser mayor o igual que uno.</p>\";\n\t\t\t\t}else if($presupuesto[\"distancia\"]>35){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia debe ser menor o igual que 35.</p>\";\n\t\t\t\t}else if(!ctype_digit($presupuesto[\"distancia\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Introduzca un valor entero válido para la distancia.</p>\";\n\t\t\t\t}else if(!is_numeric($presupuesto[\"distancia\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia se expresa sólo con números.</p>\";\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$erroresPresupuesto[] = \"<p>Introduzca un tipo de servicio válido</p>\";\n\t\t\tbreak;\n\t\t}\n\n\t\treturn $erroresPresupuesto;\n\t}",
"public function validaDatiEsame($datiEsame) \n {\n $this->setValidati(TRUE);\n foreach ($datiEsame as $chiave => $valore) \n {\n $pattern = \"\";\n $stringaErrore = \"\";\n switch ($chiave) \n {\n case 'nome':\n case 'medico':\n case 'medicoResponsabile':\n case 'categoria':\n $pattern = '/^([a-zA-Zèéàòùì,-;\\._:\\/’]|\\s)*$/' ;\n $stringaErrore = \"Il \" . $chiave . \" deve essere una sequenza di caratteri. Minimo 2 e massimo 20\";\n break;\n \n case 'descrizione':\n $pattern = '/^([a-zA-Zèéàòùì,-;\\'\\._:\\/’\\(\\)]|\\s)*$/' ;\n $stringaErrore = \"La \" . $chiave . \" deve essere una sequenza di caratteri. Massimo 600\";\n break;\n \n case 'prezzo':\n $pattern = '/^[0-9\\.\\,]+$/' ;\n $stringaErrore = \"Il \" . $chiave . \" deve essere un numero\";\n break;\n \n case 'durata':\n case 'durataEsame':\n $pattern = '/^[0-2]{1}[0-9]{1}:([0-5]{1}[0-9]{1})$/';\n $stringaErrore = \"La \" . $chiave . \" deve essere una durata valida \";\n break;\n \n case \"numPrestazioniSimultanee\":\n $pattern = '/^[0-9]{0,2}$/';\n $stringaErrore = \"Il \" . $chiave . \" deve essere una sequenza di massimo 2 numeri\";\n break;\n \n case 'idClinica':\n $pattern = '/^[0-9]{11}$/' ;\n $stringaErrore = \"La partita IVA deve essere una sequenza di 11 numeri\";\n break;\n \n case 'idEsame':\n $pattern = '/^[a-zA-Z0-9]{24}$/';\n $stringaErrore = \"L'id dell'esame deve essere una stringa alfanumerica \";\n break;\n \n \n default:\n $this->_validati = FALSE;\n break; \n }\n $this->validaDato($pattern, $chiave, $valore, $stringaErrore);\n }\n return $this->_validati;\n }",
"public function validar()\n {\n $arrayLinea = $this->archivoPlano->getArrayLinas();\n //var_dump($arrayLinea);\n for ($i = 0; $i < count($arrayLinea); $i++) {\n\n $this->getLinea($arrayLinea[$i]);\n // gettype($this->getLinea($arrayLinea[$i]));\n }\n }",
"public function validacion(){\n\t\t$this->inicializa();\n\t\t$client=Cliente::find(1);\n\t\t$id=$client->transaccion.\"\";\n\t\t// si en la transaccion aparece el id del cliente que esta en la base de datos entonces la transaccion le pertenece\n\t\t// y por tanto es valida\n\t\t$transaction = $this->pasarela->transaction()->find(\"{$id}\");\n\t\t\n\t\tif($client->token==$transaction->customer['id'])\n\t\t\treturn true;\n\t\treturn false;\n\t\t//return response()->json($transaction);\n\t}",
"public function validacion($horasextras)\n {\n $msg = 1;\n $id = 0;\n // En caso de venir del update\n if (isset($horasextras['id'])) {\n $id = $horasextras['id'];\n }\n // Pasar tiempo a decimal\n $inicio = new DateTime($horasextras['hi_registrada']);\n $fin = new DateTime($horasextras['hf_registrada']);\n $intervalo = $inicio->diff($fin);\n $cantidadHoras = $intervalo->h + ($intervalo->i / 60);\n $totalHoras = $cantidadHoras;\n // Caso en que la fecha inicio supere a la fin \n if ($inicio >= $fin) {\n $msg = \"la hora fin debe ser mayor a la hora inicial\";\n return $msg;\n }\n $solicitud = Solicitud::where('solicitudes.id', $horasextras['solicitud_id'])->join('presupuestos', 'presupuestos.id', 'solicitudes.presupuesto_id')->first();\n $primerDiaMes = $solicitud['año'] . \"-\" . $solicitud['mes'] . \"-01\";\n $ultimoDiaMes = date('Y-m-t', strtotime($primerDiaMes));\n // Caso en que no este dentro del mes de la solicitud\n if ($horasextras['fecha'] < $primerDiaMes && $horasextras['fecha'] > $ultimoDiaMes) {\n $msg = \"la fecha debe estar ubicada dentro del mes de la solicitud\";\n return ($msg);\n }\n // Condicional para comparar si esta dentro del rango de horas de la solicitud\n if (($horasextras['hi_registrada'] < $solicitud['hora_inicio']) || ($horasextras['hf_registrada'] > $solicitud['hora_fin'])) {\n $msg = 'el intervalo de tiempo no esta dentro de la hora inicial y final de la solicitud';\n return ($msg);\n }\n\n $horasSolicitud = Hora::where('solicitud_id', $solicitud['id'])->where('id', '!=', $id)->get();\n foreach ($horasSolicitud as $hora) {\n $inicio = new DateTime($hora['hi_registrada']);\n $fin = new DateTime($hora['hf_registrada']);\n $intervalo = $inicio->diff($fin);\n $cantidadHoras = $intervalo->h + ($intervalo->i / 60);\n $totalHoras += $cantidadHoras;\n }\n // En caso que se supere el total de horas de la solicitud\n if ($totalHoras > $solicitud['total_horas']) {\n $msg = \"al registrar esa hora, supera la cantidad de total de horas de la solicitud\";\n return ($msg);\n }\n $th = TipoHora::find($solicitud['tipo_hora_id']);\n $festivos = false;\n if ($th['tipo_id'] == 4) {\n $festivos = true;\n }\n $esFestivo = false;\n $dia = date('N', strtotime($horasextras['fecha']));\n $festivos = FechaEspecial::where('fecha', $horasextras['fecha'])->first();\n // Condicional para saber si el dia es festivo\n if (($dia == 7) || (!empty($festivos))) {\n $esFestivo = true;\n }\n // Caso en que este habilitado para recibir festivos pero no es un dia festivo\n if ($festivos == true && $esFestivo == false) {\n $msg = \"la fecha ingresada no esta dentro de las fechas especiales\";\n return ($msg);\n }\n // Caso en que sea un dia festivo pero no esta habilitado para recibir festivos\n if ($festivos == false && $esFestivo == true) {\n $msg = \"solo se pueden ingresar días festivos si la solicitud tiene ese tipo de hora\";\n return ($msg);\n }\n // Consulta para buscar todas las horas del usuario de un día\n $horasNoDisponibles = Hora::where('fecha', $horasextras['fecha'])\n ->where('cargo_user_id', $solicitud['cargo_user_id'])\n ->where('horas.id','!=',$id)\n ->join('solicitudes', 'solicitudes.id', 'horas.solicitud_id')\n ->join('cargo_user', 'cargo_user.id', 'solicitudes.cargo_user_id')\n ->join('users', 'users.id', 'cargo_user.user_id')->get();\n if (!empty($horasNoDisponibles)) {\n // Recorre cada hora de la fecha dada para ver si esta dentro del rango horario\n foreach ($horasNoDisponibles as $horaNoDisponible) {\n if (($horasextras['hi_registrada'] == $horaNoDisponible['hi_registrada']) && ($horasextras['hf_registrada'] == $horaNoDisponible['hf_registrada'])) {\n $msg = 'el funcionario ya se encuentra ocupado en ese intervalo de tiempo';\n return ($msg);\n }\n if (($horasextras['hi_registrada'] >= $horaNoDisponible['hi_registrada']) && ($horasextras['hf_registrada'] <= $horaNoDisponible['hf_registrada'])) {\n $msg = 'el funcionario ya se encuentra ocupado en ese intervalo de tiempo';\n return ($msg);\n }\n if (($horasextras['hi_registrada'] <= $horaNoDisponible['hi_registrada']) && ($horasextras['hf_registrada'] >= $horaNoDisponible['hf_registrada'])) {\n $msg = 'el funcionario ya se encuentra ocupado en ese intervalo de tiempo';\n return ($msg);\n }\n }\n }\n return ($msg);\n }",
"public function validar(Request $request){\n $id = auth()->user()->id;\n $empleado = Empleado::all()->where('user_id',$id)->first();\n $area = Area::find($empleado->area_id);\n $rango = Rango::find($empleado->rango_id);\n\n if($area->nombre == 'Clasificacion' && $rango->nombre == 'Supervisor'){\n $registros = $this->generarRegistros($empleado->ciudad_id, $area->nombre, $rango->nombre);\n\n $datos = ['area'=>$area];\n\n foreach ($registros as $registro) {\n if($request->input($registro->envio_codigo) != null){\n //ver si se ha escogido el paquete con codigo de envio para ser validado\n $bitacora = null;\n if($registro->bitacora_estado_id == 2){\n $bitacora = BitacoraDeRegistro::all()->where('estado_bitacora_id', 2)->where('registro_id', $registro->registro_id)->first(); //Registrado\n }elseif($registro->bitacora_estado_id == 11){\n $bitacora = BitacoraDeRegistro::all()->where('estado_bitacora_id', 11)->where('registro_id', $registro->registro_id)->first(); //Registrado\n }\n //cambiar el registro de la bitacora de registrado a validado \n $bitacora->estado_bitacora_id = '12'; // Validado\n $bitacora->save();\n $datos['bitacora_empleado'] = $bitacora;\n\n //Crear un nuevo registro con el area a donde se va a derivar el paquete\n $bitacora = new BitacoraDeRegistro;\n $bitacora->empleado_id = $empleado->id;\n $bitacora->registro_id = $registro->registro_id;\n $bitacora->ciudad_id = $empleado->ciudad_id;\n if($registro->bitacora_estado_id == 2){\n $bitacora->estado_bitacora_id = '6'; // Derivacion a Almacen\n }elseif($registro->bitacora_estado_id == 11){\n $bitacora->estado_bitacora_id = '11'; // Derivacion a Almacen\n }\n $bitacora->save();\n $datos['bitacora_supervisor'] = $bitacora;\n\n }\n }\n\n return view('registros.guardar', array('datos'=>$datos));\n }\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
test success of description getter | public function testGetDescription_success()
{
$listing= new Listing('CSL123_100259', 'Hill Farm', 'Plough Hill Road', 'Nuneaton', 'CV11 6PE', 'This is a rare opportunity...', '6','355000', 'CSL123_100327_IMG_00.JPG','1','For Sale');
$result= $listing->getDescription();
$expected= 'This is a rare opportunity...';
$this->assertEquals($expected, $result);
} | [
"public function testGetDescription()\n {\n $this->assertEquals(\n self::$testDescription,\n $this->dataRepository->getDescription()\n );\n }",
"public function testSetGetDescription()\n {\n $this->item->setDescription('A fine javelin, suitable for throwing at retreating enemies.');\n $this->assertEquals($this->item->getDescription(), 'A fine javelin, suitable for throwing at retreating enemies.');\n }",
"public function testGetDescription()\n {\n $this->assertEquals(\n self::$testDescription,\n $this->researchGroup->getDescription()\n );\n }",
"public function testGetAndSetDescriptionFunction()\n {\n $description = 'description';\n $this->assertEquals($description, $this->getContent()->setDescription($description)->getDescription());\n }",
"public function testShowDescription()\n {\n $value = rand();\n $this->fixture->setDescription($value);\n\n $actual = $this->fixture->getDescription();\n $this->assertSame((string) $value, $actual, 'Problem getting or setting the Show Description as a string.');\n }",
"public function testGetDescription(): void\n {\n $model = InterfaceDetails::load([\n \"description\" => \"description\",\n ], $this->container);\n\n $this->assertSame(\"description\", $model->getDescription());\n }",
"public function test_description()\n\t{\n\t\treturn $this->context_description() . \" should $this->current_description\";\n\t}",
"public function testNonExistentDescription()\r\n {\r\n $description = $this->property->getDescription('DOESNOTEXIST');\r\n $this->assertEquals('', $description);\r\n }",
"public function test_get_description() {\n $info = new \\core_availability\\mock_info();\n $language = new condition((object)['type' => 'language', 'id' => 'en']);\n $information = $language->get_description(true, false, $info);\n $information = $language->get_description(true, true, $info);\n $information = $language->get_standalone_description(true, false, $info);\n $information = $language->get_standalone_description(true, true, $info);\n }",
"public function testHasDescription() {\n $this->assertEquals('A description', $this->title->description());\n }",
"public function testSetDescription()\n {\n $description = 'The quick brown fox jumps over the lazy dog';\n $this->description->setDescription($description);\n $this->assertEquals($description, self::getProperty($this->description, 'description'), 'Failed to set description');\n }",
"public function testDescription()\n {\n similar_text(self::$item->specs, self::$result['description'], $percent);\n\n $this->assertGreaterThan(97, $percent);\n }",
"public function descriptionCanBeSetTest() {\n\t\t$description = 'a description';\n\t\t$this->fixture->setDescription($description);\n\t\t$this->assertEquals($description, $this->fixture->getDescription());\n\t}",
"public function testGetDescription(): void\n {\n $model = AtomPackages::load([\n \"description\" => \"description\",\n ], $this->container);\n\n $this->assertSame(\"description\", $model->getDescription());\n }",
"public function testSetDescription() \r\n { \r\n $actu = new Actualite(); \r\n $resultat = $actu->setDescription(\"Test 2 OK avec PHPUnit !\"); \r\n $this->assertEquals(\"Test 2 OK avec PHPUnit !\", $resultat); \r\n }",
"public function descriptionCanBeSet() {\n\t\t$description = 'File description';\n\t\t$this->fileDomainModelInstance->setDescription($description);\n\t\t$this->assertEquals($description, $this->fileDomainModelInstance->getDescription());\n\t}",
"public function hasDescription(): bool;",
"public function getDescriptionReturnsTheExpectedResults()\n {\n $data = [\n 'title' => 'New Title',\n 'id' => 0,\n 'description' => '<h1><strong>Hello World</strong></h1>'\n ];\n $listing = new ListingPremium($data);\n $this->assertEquals('<strong>Hello World</strong>', $listing->getDescription());\n }",
"public function testFailedGetDescription()\n\t{\n\t\tPhockito::when($this->client->getFileContents())->return(null);\n\t\t$this->assertEquals(null, $this->client->getServiceDescription());\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes an action from the collection. | function remove($actionName); | [
"public function removeAction(Automaton\\IAction $action);",
"static public function remove_action( $action ) {\n\t\tif ( isset( self::$actions[ $action ] ) ) {\n\t\t\tunset( self::$actions[ $action ] );\n\t\t}\n\t}",
"public function removeActionFromList(string $action) : void {\n unset($this->actions[$action]);\n }",
"function deleteAction($action)\r\n {\r\n if (in_array($action, $this->_actions))\r\n {\r\n $key = array_search($action, $this->_actions);\r\n array_splice($this->_actions, $key, 1);\r\n }\r\n }",
"function removeAction($action) {\n\t\tforeach ((array)$action as $name) {\n\t\t\tif (isset($this->_formActions[$name])) {\n\t\t\t\tunset($this->_formActions[$name]);\n\t\t\t}\n\t\t}\n\t}",
"public function removePermissionTo($action)\n {\n $permissionId = Permission::where('name', $action)->first()->id;\n $this->permissions()->detach($permissionId);\n }",
"public function removeAction()\n {\n }",
"public function remove_action( $action_name, $callback, $priority = 10, $accepted_args = 1 ) {\n\t\t$this->remove_hook( 'action', $action_name, $callback, $priority, $accepted_args );\n\t}",
"public function removeTrans( $action )\r\n\t{\r\n\t\tunset($this->transitions[ $action ]);\t\r\n\t}",
"public function removeActions() {\n $object = $this->getSingleObject();\n $sql = \"DELETE FROM wcf\".WCF_N.\"_gman_action_to_application\n WHERE appID = ?\";\n $statement = WCF::getDB()->prepareStatement($sql);\n $statement->execute([$object->getObjectID()]);\n }",
"public function removeAllActions();",
"public function deauthorize(string $action)\n {\n $access = $this->owner->get($this->authAccessParam, []);\n $index = array_search($action, $access, true);\n\n if ($index !== false) {\n array_splice($access, $index, 1);\n $this->owner->set($this->authAccessParam, $access);\n }\n }",
"public function ClearActions() {\t\t\r\n\t\t$this->actions = array_slice($this->actions, 0, 0); \r\n\t}",
"public function deleted(Action $action)\n {\n //\n }",
"public function getRemoveActionName();",
"public function removeUserAction( $accessLevel, $action )\n\t{\n\t\treturn XL::o( $this->_userActionMap, $accessLevel, null, true );\n\t}",
"public function clearActionSQL(string $action): self {\n\t\tunset($this->on[$action]);\n\t\treturn $this;\n\t}",
"public function can_remove_all_applied_actions_using_the_clear_actions_method()\n {\n $cart = $this->initCart();\n $item = $cart->addItem([\n 'id' => 123,\n 'title' => 'Example title',\n ]);\n\n $item->applyAction(['id' => 1, 'title' => 'Demo action 1']);\n $item->applyAction(['id' => 2, 'title' => 'Demo action 2']);\n\n $this->assertEquals(2, $item->countActions());\n $item->clearActions();\n $this->assertEquals(0, $item->countActions());\n }",
"public function clearActions()\n {\n $this->actions = new Collection();\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether a hash is legacy, i.e. was not generated with hash() | public static function is_legacy_hash($hash)
{
return (substr($hash, 0, 4) !== '$2a$');
} | [
"function bcrypt_is_legacy_hash($hash) { return substr($hash, 0, 4) != '$2a$'; }",
"public function isHashing(): bool;",
"function password_is_legacy_hash($password) {\n\t return (bool) preg_match('/^[0-9a-f]{32}$/', $password);\n\t}",
"public function isOldHash($hash) {\n switch ($this->detectHashType($hash)) {\n case 'md5':\n case 'sha1':\n return True;\n case 'hmac':\n return $this->blowfishAvailable;\n case 'bcrypt':\n // Check the work factor\n $parts = explode('$', $hash);\n // If the work factor has increased since $hash was generated OR it's using a legacy bcrypt prefix (and the new $2y$ is available\n return (((int)$parts[2] < $this->workFactor) || (in_array($parts[1], array('2a','2x')) && version_compare(PHP_VERSION, '5.3.7') >= 0));\n default:\n return False;\n }\n }",
"public static function is_hash($hash);",
"protected function checkHashKey() {}",
"public function isHash($pass);",
"public function is_connection_hash_valid() {\n $new_connection_hash = wp_hash( $this->consumer_key . $this->consumer_secret . $this->login_uri );\n $old_connection_hash = get_option( \"woocommerce_nwsi_connection_hash\" );\n\n return $new_connection_hash === $old_connection_hash;\n }",
"public static function canHash() {\n switch ( substr(Config::get('database','hashalgorithm'),1,1) ) {\n case '5': \n if ( CRYPT_SHA256 != 1 ) {\n die('Das System unterstützt den ausgewählten Hashalgoritmus nicht.');\n }\n break;\n case '6': \n if ( CRYPT_SHA512 != 1 ) {\n die('Das System unterstützt den ausgewählten Hashalgoritmus nicht.');\n }\n break;\n default:\n die('Sie haben einen nicht unterstützten Hashalgorithmus ausgesucht.');\n break;\n } \n return true;\n }",
"public function checkUniqueHash($hash);",
"public function _check_form_hash()\n\t{\n\t\treturn true;\n\t}",
"function hash($str, $mode = 'hex'){\r\n\t\ttrigger_error('hash::hash() NOT IMPLEMENTED', E_USER_WARNING);\r\n\t\treturn false;\r\n\t}",
"public function compareHash($hash)\n {\n // No Need to Compare Hash, Hashing is Not Required\n if (config('prionapi.auth_method') == 'single') {\n return true;\n }\n\n $serverHash = $this->hash;\n if ($hash != $serverHash) {\n app()->make('error')->code('2010');\n }\n\n return true;\n }",
"abstract protected static function getHashAlgorithm() : string;",
"public function isHashedWithCurrentSettings($hash);",
"public function doHashCheck()\n {\n // some sql to select fields from oxarticles,\n // calculate hash and compare it to snapshot item hash.\n }",
"public function validHash( $hash ) {\n $h = \"\" . $hash;\n return preg_match('%[0-9a-f]{40}%i', $h)? true : false;\n }",
"public function hasHash()\n {\n return Mage::helper('buysafe')->hasHash();\n }",
"public static function is_magic_string($key, $hash){\n return ( hash('sha256', $key) === $hash );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setNamaDusun() Set the value of [desa_kelurahan] column. | public function setDesaKelurahan($v)
{
if ($v !== null && is_numeric($v)) {
$v = (string) $v;
}
if ($this->desa_kelurahan !== $v) {
$this->desa_kelurahan = $v;
$this->modifiedColumns[] = TanahPeer::DESA_KELURAHAN;
}
return $this;
} | [
"public function setNamaDusun($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->nama_dusun !== $v) {\n $this->nama_dusun = $v;\n $this->modifiedColumns[] = DudiPeer::NAMA_DUSUN;\n }\n\n\n return $this;\n }",
"public function getNamaDusun()\n {\n return $this->nama_dusun;\n }",
"public function setDesaKelurahan($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->desa_kelurahan !== $v) {\n $this->desa_kelurahan = $v;\n $this->modifiedColumns[] = DudiPeer::DESA_KELURAHAN;\n }\n\n\n return $this;\n }",
"public function setDesaKelurahan($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->desa_kelurahan !== $v) {\n $this->desa_kelurahan = $v;\n $this->modifiedColumns[] = PtkPeer::DESA_KELURAHAN;\n }\n\n\n return $this;\n }",
"public function setNomeunidade($nomeunidade){\r\n\t\t$this->nomeunidade = $nomeunidade;\r\n\t}",
"public function getDesaKelurahan()\n {\n return $this->desa_kelurahan;\n }",
"function setNoiDung($noi_dung){\r\n\t\t$this->noi_dung = $noi_dung;\r\n\t}",
"public function getNamaDepan()\n {\n return $this->namaDepan;\n }",
"public function filterByNamaDusun($namaDusun = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($namaDusun)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $namaDusun)) {\n $namaDusun = str_replace('*', '%', $namaDusun);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(LembSertifikasiPeer::NAMA_DUSUN, $namaDusun, $comparison);\n }",
"public function filterByNamaDusun($namaDusun = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($namaDusun)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $namaDusun)) {\n $namaDusun = str_replace('*', '%', $namaDusun);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(LembagaNonSekolahPeer::NAMA_DUSUN, $namaDusun, $comparison);\n }",
"public function setDataNascimento ($dtNascimento) {\n $this->dtNascimento = $dtNascimento;\n }",
"public function setNamaPelajaran($nama_pelajaran);",
"private function _ubah_provinsi_desa()\n {\n $konversi = $this->provinsi_model->konversi;\n // Dapat daftar nama provinsi tersimpan yg unik\n // Konversi setiap nama unik\n $list_provinsi = $this->db->distinct()->select('nama_provinsi')->get('desa')->result_array();\n foreach ($list_provinsi as $provinsi)\n {\n $nama_provinsi = strtolower($provinsi['nama_provinsi']);\n if(isset($konversi[$nama_provinsi]))\n {\n $this->db->where('nama_provinsi', $provinsi['nama_provinsi'])->update('desa', array('nama_provinsi' => $konversi[$nama_provinsi]));\n } else\n {\n // Cek setiap desa, apakah nama provinsi di daftar baku\n // Jika tidak, ubah jenis menjadi 2\n if ($this->provinsi_model->cek_baku($nama_provinsi) === FALSE)\n {\n $this->db->where('nama_provinsi', $provinsi['nama_provinsi'])->update('desa', array('jenis' => 2));\n }\n }\n\n }\n }",
"function berinamabuahlain ($jeruk) {\n\t\t$this->nama_buah_lain=$jeruk;\n\t}",
"public function setUnidad($unidad)\n\t{\n\t\t$this->unidad = $unidad;\n\t}",
"public function setNamaLengkap($nama_lengkap);",
"function setNombre_dl($snombre_dl = '')\n {\n $this->snombre_dl = $snombre_dl;\n }",
"function setMaDeThi($ma_de_thi){\r\n\t\t$this->ma_de_thi = $ma_de_thi;\r\n\t}",
"public function getKetDaunJendela()\n {\n return $this->ket_daun_jendela;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a shows airtime. | function addAirTime($show, $season, $episode, $title, $time, $source) {
return 2;
} | [
"function addAirTime($show, $season, $episode, $title, $time, $source) {\n\t\t\treturn 2;\n\t\t}",
"static function add_auto_time(): void {\n\t\tself::add_acf_field(self::auto_time, [\n\t\t\t'label' => 'Time to auto add/remove',\n\t\t\t'type' => 'time_picker',\n\t\t\t'instructions' => '',\n\t\t\t'required' => 1,\n\t\t\t'conditional_logic' => [\n\t\t\t\t[\n\t\t\t\t\t[\n\t\t\t\t\t\t'field' => self::qualify_field(self::auto_add),\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => '1',\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t[\n\t\t\t\t\t\t'field' => self::qualify_field(self::auto_remove),\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => '1',\n\t\t\t\t\t]\n\t\t\t\t]\n\t\t\t],\n\t\t\t'wrapper' => [\n\t\t\t\t'width' => '15',\n\t\t\t\t'class' => '',\n\t\t\t\t'id' => '',\n\t\t\t],\n\t\t\t'display_format' => 'g:i a',\n\t\t\t'return_format' => 'H:i',\n\t\t]);\n\t}",
"public function addtimeAction()\r\n {\r\n\t\t$date = $this->_getParam('start', date('Y-m-d'));\r\n\t\t$time = $this->_getParam('start-time');\r\n\r\n\t\tif (!$time) {\r\n\t\t\t$hour = $this->_getParam('start-hour');\r\n\t\t\t$min = $this->_getParam('start-min');\r\n\t\t\t$time = $hour.':'.$min;\r\n\t\t}\r\n\r\n\t\t$start = strtotime($date . ' ' . $time . ':00');\r\n $end = $start + $this->_getParam('total') * 3600;\r\n $task = $this->projectService->getTask($this->_getParam('taskid'));\r\n $user = za()->getUser();\r\n\r\n $this->projectService->addTimesheetRecord($task, $user, $start, $end);\r\n\r\n\t\t$this->view->task = $task;\r\n\t\t\r\n\t\tif ($this->_getParam('_ajax')) {\r\n\t\t\t$this->renderRawView('timesheet/timesheet-submitted.php');\r\n\t\t}\r\n }",
"public function add_associated_time( $time_id = 0 ) {\n\t\t$times = $this->get_associated_times();\n\t\t$times[] = $time_id;\n\t\t$this->set_associated_times( $times );\n\t}",
"public function setArrivalTime($time)\n {\n $this->a_time = $time;\n return $this;\n }",
"function addTime($name) {\n $field = (new Fields\\TimePicker($name));\n\n return $this->addField($field);\n }",
"public function setShowTime($a_showtime)\n\t{\n\t\t$this->showtime = $a_showtime;\n\t}",
"public function addDay();",
"public function addAdvertisementShow()\n\t{\n\t\t$oAdvertisement_Show = Core_Entity::factory('Advertisement_Show');\n\t\t$oAdvertisement_Show->date = date('Y-m-d');\n\t\t$oAdvertisement_Show->time = date('H:i:s');\n\t\t$this->add($oAdvertisement_Show);\n\n\t\treturn $oAdvertisement_Show;\n\t}",
"public function addTimeLine($timeline)\n {\n $this->timeLines[] = $timeline;\n }",
"public static function addTime(int $time)\n {\n $_SESSION['end_time'] += $time * 60;\n }",
"private function fillShowTime ($show) {\n // this gets filled with actual content... Actuall filling is dependant on time.\n $timeslotContent = array();\n \n print \"Trying to find content for the show \".$show->get_name().\" planned for timeslot \".$show->get_timeslot().\" beginning at \".$show->get_begin().\"\\n\";\n \n // first thing is to get the planned show. We have to broadcast this, this is what people expect.\n $playListItem = $this->contentFinder->findPlayListItem(CONTENT_SHOW, $show->get_timeslot(), $show);\n $timeslotContent[] = $playListItem;\n \n print \"The loaded show is located at \".$playListItem->fileLocation.\" and takes up a time of \".$playListItem->duration.\" seconds\\n\";\n \n // possibly the next show has to be canceled if this show has a longer-than-planned runtime. Exceptional cases.\n // just make sure this doesn't happen. We don't support special-day planning (planning per date)\n if ($playListItem->duration > $show->get_scheduled_duration()){\n // ... to implement: cancel next show. Or just get the next one untill it fits... no action now.\n }\n \n $secondsLeft = $show->get_scheduled_duration() - $playListItem->duration;\n print \"We must fill another \".$secondsLeft.\" seconds\\n\";\n \n // Depeding on secondsLeft, another format is chosen for filling airtime.\n \n // Filling Scenario One: \n // Very short, exceptional Scenario, dependant on the time left, get bumper...\n // you may run a few seconds in the hour... content and syncing will make up for that\n // this is very cheap filling...\n if ($secondsLeft < 10) {\n while ($secondsLeft > 0) {\n $timeslotContent[] = $timeFillingBumper = $this->contentFinder->findPlayListItem(CONTENT_BUMPER, $show->get_timeslot(), \"\", BUMPER_PROMO, \"\", $secondsLeft);\n if (empty($timeFillingBumper->fileLocation)) continue;\n $secondsLeft -= $timeFillingBumper->duration;\n }\n }\n \n // Filling Scenario Two: \n // more likely: more seconds left, but about a minute... till 2 minutes...\n if ($secondsLeft > 9 and $secondsLeft < 120) {\n // start filling... with schedule // maybe Bumper Schedule Bumper...\n $preBumper = $this->contentFinder->findPlayListItem(CONTENT_BUMPER, $show->get_timeslot(), \"\", BUMPER_PROMO, \"\", 0);\n $secondsLeft -= $preBumper->duration; \n $postBumper = $this->contentFinder->findPlayListItem(CONTENT_BUMPER, $show->get_timeslot(), \"\", BUMPER_PROMO);\n $secondsLeft -= $postBumper->duration; \n \n $timeslotContent[] = $preBumper;\n $timeslotContent[] = $this->createAnnouncement($secondsLeft, $show);\n $timeslotContent[] = $postBumper;\n } // all time should now be taken...\n \n // Filling Scenario Three: \n // Announcements, funny movies, annouceemtns. (countdown or picture?) // from 2 till 10 minutes... \n // could just fill about an half hour, then a new show has to start!\n // maybe add some bumpers in longer commercialblocks or funnymovie blocks...\n // for debugging just no upper limit... and $secondsLeft < 1900\n if ($secondsLeft > 119) {\n print \"Filling a large gap in the programming, time left: \".$secondsLeft.\" seconds\\n\";\n // station promo\n $preBumper1 = $this->contentFinder->findPlayListItem(CONTENT_BUMPER, $show->get_timeslot(), \"\", BUMPER_PROMO, \"\", 0);\n $secondsLeft -= $preBumper1->duration; \n $postBumper1 = $this->contentFinder->findPlayListItem(CONTENT_BUMPER, $show->get_timeslot(), \"\", BUMPER_PROMO);\n $secondsLeft -= $postBumper1->duration; \n \n $preBumper2 = $this->contentFinder->findPlayListItem(CONTENT_BUMPER, $show->get_timeslot(), \"\", BUMPER_PROMO, \"\", 0);\n $secondsLeft -= $preBumper2->duration; \n $postBumper2 = $this->contentFinder->findPlayListItem(CONTENT_BUMPER, $show->get_timeslot(), \"\", BUMPER_PROMO);\n $secondsLeft -= $postBumper2->duration; \n \n // the first thing you want to know when a show ends: whats next!\n // maybe we could add some of those scrolling banners on VLC...\n $announcement1 = $this->createAnnouncement(40, $show);\n $secondsLeft -= $announcement1->duration; \n \n // a commercialblock fills 22,5% to 30% of available time. with a maximum of 5 minutes.\n // an exception is that times < 2 minutes are filled with pure commercials... \n $commercialBlockOne = array();\n $commercialBlockTwo = array();\n if ($secondsLeft > 120 && $secondsLeft < 240){\n $commercialBlockOne = $this->createCommercialsBlock($secondsLeft - 120, $show->get_timeslot());\n $secondsLeft -= $commercialBlockOne[\"filledTime\"];\n $commercialBlockTwo = array();\n } else {\n // make two blocks... fill the remaining time (-1 minute of annoucements) with funny movies\n $commercialBlockOne = $this->createCommercialsBlock($secondsLeft, $show->get_timeslot());\n $commercialBlockTwo = $this->createCommercialsBlock($secondsLeft, $show->get_timeslot());\n $secondsLeft -= $commercialBlockOne[\"filledTime\"];\n $secondsLeft -= $commercialBlockTwo[\"filledTime\"];\n }\n \n print \"Commercial blocks have been generated, time left: \".$secondsLeft.\" seconds\\n\";\n \n // fill any remainingtime, excluding announcementtime, with funny movies.\n // not loading longer funny movies, \n // make sure the $secondsLeft in this while loop is long enough to overlap the while loop.\n $funnyMovies = array();\n $funnyMovieCounter = 0;\n while ($secondsLeft >= 120) {\n $funnyMovie = $this->contentFinder->findPlayListItem(CONTENT_FUNNY, $show->get_timeslot(), \"\", \"\", \"\", $secondsLeft);\n \n // its possible that we just not completely fill up the timeslot. No problem, announcements will do that for us\n // Some files get an empty duration: at indexing the metadata of time is not available to ffmpeg (or doesn't get parsed right)\n // basically there shouldn't be 0 second videos. Files wihtout a filelocation mean that there is no movie for our criteria, whichi\n // is nearly impossible; unless everything is larger than 2 minutes.\n if (empty($funnyMovie->duration) or empty($funnyMovie->fileLocation)) {\n print \"impossible content detected...\";\n continue 1;\n }\n \n $funnyMovies[] = $funnyMovie; \n $secondsLeft -= $funnyMovie->duration; \n // maybe here we can do some picture with \"x minutest left till X?\", or a stations logo in every 3 videos... todo..\n // every N funny movies we add a station bumper.\n if ($funnyMovieCounter % 4 == 0 && $funnyMovieCounter != 0 && $secondsLeft > 200){\n $funnyMovie = $this->contentFinder->findPlayListItem(CONTENT_BUMPER, $show->get_timeslot(), \"\", BUMPER_PROMO, \"\", $secondsLeft);\n $funnyMovies[] = $funnyMovie;\n $secondsLeft -= $funnyMovie->duration; \n }\n // add some commercials \n if ($funnyMovieCounter % 10 == 0 && $secondsLeft > 200 && $funnyMovieCounter != 0){\n $arbitraryCommercials = $this->createCommercialsBlock($secondsLeft, $show->get_timeslot());\n $secondsLeft -= $arbitraryCommercials[\"filledTime\"];\n foreach ($arbitraryCommercials[\"commercials\"] as $commercial){\n $funnyMovies[] = $commercial;\n }\n }\n $funnyMovieCounter++;\n //print \"Funny movie added... Time left:\".$secondsLeft.\"\\n\";\n }\n \n print \"Funny movies have been added, one announcement left: \".$secondsLeft.\" seconds\\n\";\n \n // lastly, we have about one or two minutes left...\n $announcement2 = $this->createAnnouncement($secondsLeft, $show);\n $secondsLeft -= $announcement2->duration; \n \n // create programming... lets glue everything together.\n $timeslotContent[] = $preBumper1;\n $timeslotContent[] = $announcement1;\n $timeslotContent[] = $postBumper1;\n \n foreach ($commercialBlockOne[\"commercials\"] as $commercial){\n $timeslotContent[] = $commercial;\n }\n \n // can be empty\n foreach ($funnyMovies as $funnyMovie) {\n $timeslotContent[] = $funnyMovie;\n }\n \n // can be empty\n foreach ($commercialBlockTwo[\"commercials\"] as $commercial){\n $timeslotContent[] = $commercial;\n }\n \n $timeslotContent[] = $preBumper2;\n $timeslotContent[] = $announcement2;\n $timeslotContent[] = $postBumper2;\n } // and 5 minutes are filled...\n \n //print_r($timeslotContent);\n \n // depending on our scenario and time, we have found some nice content.\n return $timeslotContent;\n }",
"public function setAddTime()\n {\n $this->add_time = time();\n\n return $this;\n }",
"function add_schedule_point($p, $time) {\n\t\n\t// Get abstract\n\t$id\t \t = $p->id;\n\t$abstr\t = \"\";\n\tif ($_POST[\"abstract\"] == 1) {\n\t\t$abstr\t= file_get_contents(\"data/\".$id.\".abstract.txt\");\n\t\t$abstr = latexSpecialChars(substr($abstr,9,-1));\n\t\t$abstr\t= \"{\\\\small \".$abstr.\"} \\n\";\n\t}\n\n\t// Get title\n\t$title\t = latexSpecialChars( $p->title, \"\\\\'\\\"&\\n\\r{}[]\" );\n\t$title\t = \"{\\\\it \".$title.\"} \\\\\\\\ \\n\";\n\n\t// Get time and place\n\tif ($time == \"\") $point = \"\\\\item[{\\\\hfill \".$p->room.\"}]\\n\";\n\telse\t\t\t $point = \"\\\\item[{\\\\hfill \\bf \".$time.\"} \\\\\\\\ {\\\\hfill \".$p->room.\"}]\\n\";\n\n\t// Get authors\n\t$authors = \"{\".$p->authors.\"} \\\\\\\\ \\n\";\n\n\treturn $point.$title.$authors.$abstr.\"\\n\";\n}",
"public function addTimetable()\n {\n\n global $conn;\n\n $tempTimetableId = Timetable::getTimetableId();\n\n //sql statement\n $sql = \"INSERT INTO timetable(timetable_id,hall_name) VALUES('$tempTimetableId','$tempTimetableId');\";\n $conn->query($sql);\n\n }",
"private function insert(Show $show, \\DateTime $timestamp) {\n $showArray = $show->getAsDBALArray();\n $showArray['ts'] = $this->formatTimestamp($timestamp);\n $this->connection->insert('shows', $showArray);\n }",
"function podcast_pro_get_the_air_time() {\n\t$date = DateTime::createFromFormat( 'U', genesis_get_custom_field( 'air_date' ) );\n\t// Format the date for display.\n\t$air_time = $date->format( 'h:i A' );\n\n\treturn $air_time;\n}",
"public function add_schedule() {\n $data['stadiums'] = $this->stadium->where('status', 1)->orderBy('stadium_name')->get();\n $data['standings'] = $this->standings->where('status', 1)->orderBy('category_id')->orderBy('standing_name')->get();\n return view('Admin.add_schedule', $data);\n }",
"private function setEventTimeDetails($event)\n {\n $start = $this->show->term->on_air->copy()\n ->subDay()\n ->modify('next '.$this->show->day)\n ->setTimeFromTimeString($this->show->start);\n if ($start <= $this->show->term->on_air) {\n $start->addWeek();\n }\n $end = $start->copy()->setTimeFromTimeString($this->show->end);\n if ($end <= $start) {\n $end->addDay();\n }\n $recurrence_end = $this->show->term->off_air->copy()->addDay();\n if ($recurrence_end->copy()->setTimeFromTimeString($this->show->start) >= $recurrence_end) {\n $recurrence_end->subDay();\n }\n\n $event_start = new Google_Service_Calendar_EventDateTime;\n $event_start->setDateTime($start->toRfc3339String());\n $event_start->setTimeZone(config('app.timezone'));\n $event->setStart($event_start);\n\n $event_end = new Google_Service_Calendar_EventDateTime;\n $event_end->setDateTime($end->toRfc3339String());\n $event_end->setTimeZone(config('app.timezone'));\n $event->setEnd($event_end);\n\n $event->setRecurrence(['RRULE:FREQ=WEEKLY;UNTIL='.$recurrence_end->format('Ymd\\THis\\Z')]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/Liefert den Link einer row zurueck | public function getLink() {
return $this->row[3];
} | [
"public function getRowLink() {\n return $this->rowLink;\n }",
"public function make_row_link()\n {\n $l_arrGetUrl = [\n C__CMDB__GET__VIEWMODE => C__CMDB__VIEW__CATEGORY,\n C__CMDB__GET__TREEMODE => C__CMDB__VIEW__TREE_OBJECT,\n C__CMDB__GET__OBJECT => \"[{isys_cats_person_list__isys_obj__id}]\",\n C__CMDB__GET__CATS => C__CATS__PERSON\n ];\n\n return isys_helper_link::create_url($l_arrGetUrl);\n }",
"function column_link( $item ) {\r\n\t\treturn esc_html( $item->link );\r\n\t}",
"public function column_url($link)\n {\n }",
"public function getRowUrl($row)\n {\n return $this->getUrl('*/*/reply', array('id'=>$row->getId()));\n }",
"public function getRowUrl($row)\n {\n return $this->getUrl('adminhtml/brand/edit', array('id' => $row->getId()));\n }",
"function report_customsql_display_row($row, $linkcolumns) {\n $rowdata = array();\n foreach ($row as $key => $value) {\n if (isset($linkcolumns[$key]) && $linkcolumns[$key] === -1) {\n // This row is the link url for another row.\n continue;\n } else if (isset($linkcolumns[$key])) {\n // Column with link url coming from another column.\n if (validateUrlSyntax($row[$linkcolumns[$key]], 's+H?S?F?E?u-P-a?I?p?f?q?r?')) {\n $rowdata[] = '<a href=\"' . s($row[$linkcolumns[$key]]) . '\">' . s($value) . '</a>';\n } else {\n $rowdata[] = s($value);\n }\n } else if (validateUrlSyntax($value, 's+H?S?F?E?u-P-a?I?p?f?q?r?')) {\n // Column where the value just looks like a link.\n $rowdata[] = '<a href=\"' . s($value) . '\">' . s($value) . '</a>';\n } else {\n $rowdata[] = s($value);\n }\n }\n return $rowdata;\n}",
"public function getLink() {\n\t\treturn $this->dbo()->getLink();\n\t}",
"public function renderLink();",
"function costs_link($row)\n{\t\t\t\n\treturn $row[\"closed\"] || !$row[\"released\"] ? '' :\n\t\tpager_link(_('Costs'),\n\t\t\t\"/manufacturing/work_order_costs.php?trans_no=\" .$row[\"id\"]);\n}",
"public function column_url( $link ) {\n\t\t$short_url = url_shorten( $link->link_url );\n\t\techo \"<a href='$link->link_url'>$short_url</a>\";\n\t}",
"public function getRowUrl()\n {\n return $this->rowUrl;\n }",
"public function getLinkForColumnAndRow(Workbook $oWorkbook, Sheet $oSheet, $iRow, $iColumn) {\n\t\treturn 'http://google.de';\n\t}",
"function LinkedRowEntry($link, $entry, $color) {\n\t$span = \"<span>\";\n\t$ref = \"<a>\";\n\tif($color != \"\") $span = \"<span class=$color>\";\n\tif($link != \"\") $ref = \"<a href=$link>\";\n\techo \"<td class=tabval>$ref$span [$entry] </span></a></td>\";\n}",
"function table_cell_primary($key, $datum, $id='') {\n// echo '<td class=\"link_button order\"><a title=\"order\" href=\"/cancer_types/forms/' . $this->edit_page .'?id=' . $datum . '&table=' .$this->table_name . '\" target=\"_blank\">' . $datum . '</a></td>';\n echo '<td class=\"link_button order\"><a title=\"order\" href=\"/cancer_types/views_controllers/' . $this->edit_page .'?id=' . $datum . '&table=' .$this->table_name . '\">' . $datum . '</a></td>';\n \n }",
"function row_links($subset, $prefs) {\n global $g_logged_in_user;\n $tokens = url_tokens($g_logged_in_user->authenticator);\n $pre_add = \"<a href=add_venue.php?venue=\";\n $pre_edit = \"<a href=prefs_edit.php?venue=\";\n $pre_remove = \"<a href=prefs_remove.php?venue=\";\n $post_add = \"&subset=$subset&cols=1$tokens>\".tra(\"Add\").\"</a>\";\n $post_edit = \"&subset=$subset&cols=1$tokens>\".tra(\"Edit\").\"</a>\";\n $post_remove = \"&subset=$subset&cols=1$tokens>\".tra(\"Remove\").\"</a>\";\n $gen = \"<a href=prefs_edit.php?subset=$subset&cols=1$tokens>\".tra(\"Edit\").\"</a>\";\n\n $hom = isset($prefs->home) ? $pre_edit.\"home\".$post_edit : $pre_add.\"home\".$post_add;\n $schl = isset($prefs->school) ? $pre_edit.\"school\".$post_edit : $pre_add.\"school\".$post_add;\n $wrk = isset($prefs->work) ? $pre_edit.\"work\".$post_edit : $pre_add.\"work\".$post_add;\n\n echo \"<tr><td class=fieldname> </td>\";\n echo \"<td>$gen</td>\";\n echo \"<td>$hom</td>\";\n echo \"<td>$schl</td>\";\n echo \"<td>$wrk</td>\";\n echo \"<td><br></td></tr>\\n\";\n\n $hom = isset($prefs->home) ? $pre_remove.\"home\".$post_remove : \"<br>\";\n $schl = isset($prefs->school) ? $pre_remove.\"school\".$post_remove : \"<br>\";\n $wrk = isset($prefs->work) ? $pre_remove.\"work\".$post_remove : \"<br>\";\n\n echo \"<tr><td class=fieldname> </td>\";\n echo \"<td> </td>\";\n echo \"<td>$hom</td>\";\n echo \"<td>$schl</td>\";\n echo \"<td>$wrk</td>\";\n echo \"<td><br></td></tr>\\n\";\n}",
"public function testGetRowUrl()\n {\n $row = new \\Magento\\Framework\\DataObject(['product_id' => 1]);\n $this->assertStringContainsString('catalog/product/edit/id/1', $this->block->getRowUrl($row));\n }",
"abstract protected function getIndirectLinksViaLinkTableByLinkTableName();",
"public function hyperlink($row, $col, $sheet=0)\n {\n $link = isset($this->sheets[$sheet]['cellsInfo'][$row][$col]['hyperlink']) ? $this->sheets[$sheet]['cellsInfo'][$row][$col]['hyperlink'] : false;\n if ($link) {\n return $link['link'];\n }\n return '';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assert that a list in the document only contains the specified values. This assertion does not check that the expected and actual lists are in the same order. To assert the order, use `assertExact`. | public static function assertExactList(
$document,
iterable $expected,
string $pointer = '/data',
bool $strict = true,
string $message = ''
): void
{
PHPUnitAssert::assertThat(
$document,
new OnlyExactInList($expected, $pointer, $strict),
$message
);
} | [
"public function testListContains()\n {\n $this->context->setValue('Namespaced::Property', array(1, 2, 3));\n $properties = new ArrayIterator(array(\n 'configValue' => 1\n ));\n $listContains = new ListContains($this->context, 'Namespaced::Property', $properties);\n $this->assertEquals($listContains->evaluate(), true);\n $properties['configValue'] = 4;\n $this->assertEquals($listContains->evaluate(), false);\n }",
"public function testValidateInList()\n {\n $test = $this->_opts;\n foreach ($test as $val) {\n $this->assertTrue($this->_filter->validateInList($val, $this->_opts));\n }\n }",
"public function testAssertAllStrictArrays() {\n $this->assertTrue(Inspector::assertAllStrictArrays([]));\n $this->assertTrue(Inspector::assertAllStrictArrays([[], []]));\n $this->assertFalse(Inspector::assertAllStrictArrays([['foo' => 'bar', 'bar' => 'foo']]));\n }",
"public function test_expected_values_are_present()\n {\n foreach ($this->getExpectedItems() as $key) {\n $this->assertArrayHasKey($key, $this->getRefinery()->bring($this->getAttachments())->refine($this->getModel()));\n }\n }",
"public function testAllNotEmpty() {\n $this->assertTrue(Inspector::assertAllNotEmpty([1, 'two']));\n $this->assertFalse(Inspector::assertAllNotEmpty(['']));\n }",
"public function testInList()\n {\n $list = new \\Europa\\Validator\\Rule\\InList(array('in', 'the', 'list'));\n $valid = $list->validate('in')->isValid()\n && $list->validate('the')->isValid()\n && $list->validate('list')->isValid()\n && !$list->validate('not in the list')->isValid();\n \n $this->assert($valid, 'In list validator not working.');\n }",
"public function testIsSatisfied(): void\n {\n $this->assertTrue((new InArraySpecification(['1', 2], '1', true))->isSatisfied());\n $this->assertTrue((new InArraySpecification(['1', 2], 2, true))->isSatisfied());\n $this->assertFalse((new InArraySpecification(['1', 2], '2', true))->isSatisfied());\n }",
"public function testAddMultipleValuesWithoutAppending()\n {\n // Set many values at once.\n $this->attr->setKey('many')\n ->setValues(['this', 'is', 'not', 'permanent'])\n ->setValues(['multitude', 'myriad', 'mucho'], false);\n\n $this->assertEquals(\n 'many=\"multitude myriad mucho\"',\n $this->attr->render()\n );\n }",
"function test_array_subset($title, $actual, $expected, $strict = false)\n{\n $result = false;\n\n if (in_array($expected, $actual, $strict)) {\n $result = true;\n }\n\n return test_result($title, $result);\n}",
"public function testGetValues()\r\n {\r\n $test = $this->array;\r\n $expect = array_values($test);\r\n $result = Arrays::GetValues($test);\r\n $this->assertEqualStrict($expect, $result);\r\n }",
"public function testContainsWillReturnFalseIfAnElementIsNotSet()\n {\n $element1 = new \\stdClass();\n $element1->Name = 'EL 1';\n\n $element2 = new \\stdClass();\n $element2->Name = 'EL 2';\n\n $element3 = new \\stdClass();\n $element3->Name = 'EL 3';\n\n $Collection = new \\MySQLExtractor\\Common\\Collection();\n\n $Collection->set('index2', $element2);\n $Collection->set('index1', $element1);\n\n $this->assertFalse($Collection->contains($element3));\n }",
"public function checkValuesAreAllPresent() {\n return empty($this->expectedNotExisting());\n }",
"public function testRejectsInvalidValues(): void\n {\n $this->assertRejectsArray(['val' => ['type' => 'number']], ['val' => true]);\n $this->assertRejectsArray(['val' => ['type' => 'number']], ['val' => '']);\n $this->assertRejectsArray(['val' => ['type' => 'boolean']], ['val' => 123]);\n $this->assertRejectsArray(['val' => ['type' => 'boolean']], ['val' => '']);\n }",
"public function test_where_clause_list() {\n\t\t$field = 'user' ;\n\t\t$values = array('Amit','Sachin','Sunil') ;\n\t\t$this->assertEquals(2,count(where_clause_list($field,$values))) ;\n\t}",
"public function checkValuesAreExact() {\n return empty($this->existingNotExpected()) && empty($this->expectedNotExisting());\n }",
"private static function everyIs($values, $expected)\n\t{\n\t\tif (!self::isIterable($values)) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ($values as $value) {\n\t\t\tif (!static::is($value, $expected)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public function testArrayFilterWithMultipleValues() {\n $original = ['foo', 0, '', 'bar', FALSE, 'baz', [], 'zip'];\n $expected = ['foo', 'bar', 'baz', 'zip'];\n $this->assertArrayEquals($expected, $this->plugin->tamper($original));\n }",
"public function testNotInList($value, $valueList, $msg = null)\n {\n if (in_array($value, $valueList)) {\n if ($msg !== null) {\n return $msg;\n }\n return 'Unmatched value.';\n }\n }",
"public function containsAll( ICollection $values )\n {\n \treturn false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/end of action /userpanel action | public function userpanel()
{
} | [
"public function yourProfileAction()\n\t{\n\t\t$this->setAdminModVars();\n\t\t$this->redirect()->toUrl('/usersadmin/editcontent/'.$this->user_details->id);\n\t}",
"public function usercontrolAction()\n {\n if ($this->_requests->gets() && is_string($this->_requests->gets()->newuser) && $posts = $this->_requests->posts()) {\n $newuser = $this->_getModel()->addNewUser($posts->name, $posts->username, hash('sha512', $posts->password));\n if ($newuser) {\n $this->getView()->newuser = $newuser;\n } else {\n $this->getView()->newuserfailed = true;\n }\n }\n if ($this->_requests->gets() && is_string($this->_requests->gets()->newgroup) && $posts = $this->_requests->posts()) {\n $newgroup = $this->_getModel()->addNewGroup($posts->name, (boolean) $posts->admin);\n if ($newgroup) {\n $this->getView()->newgroup = $newgroup;\n } else {\n $this->getView()->newgroupfailed = true;\n }\n }\n $this->getView()->pageTitle = 'User Control';\n $groups = $this->_getModel()->getGroups();\n $this->getView()->users = $this->_modifyUsers($this->_getModel()->getUsers(), $groups);\n $this->getView()->groups = $groups;\n }",
"public function actionUserPage()\n {\n return $this->renderRestrictedPage('user');\n }",
"public function showUserPanel() \n\t{\n\t //echo\"jghjhgjh\";\n\t\t$controllerName = ucfirst ( $_SESSION [\"userType\"] ) . \"Controller\";\n\t\t//print $controllerName;\n\t\t$objController = new $controllerName ();\n\t\t\n\t\t$objController->process ();\n\t}",
"public function logoutAction()\n {\n // Get layout name\n $split_url = explode(\"/\", $_SERVER['REQUEST_URI']);\n $layout_name = $split_url[1];\n // Set layout\n $this->view->setLayout($layout_name);\n $this->view->render('Log Out from Admin Panel!');\n }",
"public function joinusAction()\n {\n if (Mage::getSingleton('customer/session')->isLoggedIn()):\n\n $this->loadLayout();\n $this->renderLayout();\n else:\n $this->_redirect('awesomebox/index/authentication');\n endif;\n }",
"private final function panel () {\n \n $url = \"\";\n \n echo \"<div class='right' style='margin-top: -28px;' id='userLogout'>\".\n \"<div class='ui-icon left ui-icon-person ui-corner-all ui-state-default'></div>\";\n \n $this->widget('zii.widgets.CMenu',array(\n 'items'=>array(\n array('label'=>'Logout ('.Yii::app()->user->name.')', \n 'url'=>Yii::app()->createUrl('sLogin/logout'))\n ),\n ));\n\n echo \"</div><div class='right' style='margin-top: -28px;' id='userLogout'>\".\n \"<div class='ui-icon left ui-icon-wrench ui-corner-all ui-state-default'></div>\";\n \n\n switch(Yii::app()->user->getState(\"acctype\")) {\n\n case 8 : \n $url = Yii::app()->params[\"marketingpath\"]; \n $url = Yii::app()->createUrl($url);\n break;\n case 1: \n $url = Yii::app()->params[\"adminpath\"]; \n $url = Yii::app()->createUrl($url);\n break;\n case 2 : \n $url = Yii::app()->params[\"operatorpath\"]; \n $url = Yii::app()->createUrl($url);\n break;\n case 6 : \n $url = Yii::app()->params[\"cspath\"]; \n $url = Yii::app()->createUrl($url);\n break;\n case 7 : \n $url = Yii::app()->params[\"playerpath\"]; \n $url = Yii::app()->createUrl($url);\n break;\n case 9: \n $url = Yii::app()->params[\"aspath\"]; \n $url = Yii::app()->createUrl($url);\n break;\n case 4 : \n $url = Yii::app()->params[\"cashierpath\"]; \n $url = Yii::app()->createUrl($url);\n break;\n }\n\n $this->widget('zii.widgets.CMenu',array(\n \n 'items'=>array(\n \n array('label'=>'Control Panel', 'url'=> $url)\n \n )\n \n \n )); \n \n echo \"</div>\";\n\n }",
"protected function logoutAction() {\n\t\t$oView = new accountView($this);\n\t\t$oView->showLogoutPage();\n\t}",
"public function dashboard() {\n /* Do here something for user */\n }",
"public function showLogoutMessageAction(){\n Flash::addMessage('Logged out');\n $this->redirect('');\n\n }",
"public function showManagementPanel(){\n\t\t$flashSuccess = Session::get('flashSuccess');\n\t\t$flashError = Session::get('flashError');\n\t\t$deletedUserId = Session::get('deletedUserId');\n\n\t\t$data = array(\n\t\t\t'title' => 'PCSA - User Management'\n\t\t);\n\n\t\tif(isset($flashSuccess) && $flashSuccess){\n\t\t\t$data['flashSuccess'] = $flashSuccess;\n\t\t}\n\n\t\tif(isset($deletedUserId) && $deletedUserId){\n\t\t\t$data['deletedUserId'] = $deletedUserId;\n\t\t}\n\n\t\tif(isset($flashError) && $flashError){\n\t\t\t$data['flashError'] = $flashError;\n\t\t}\n\n\t\t$criteria = array(\n\t\t\t'username' => strtolower(trim(Input::get('userName'))),\n\t\t\t'email' => strtolower(trim(Input::get('email'))),\n\t\t\t'permission' => Input::get('userPermission'),\n\t\t\t'deleted' => Input::get('deleted')\n\t\t);\n\n\t\t$data['criteria'] = $criteria;\n\t\t$data['users'] = $this->retrieveUsers($criteria);\n\t\t$data['permissions'] = $this->getUserPermissionTypes();\n\n\t\treturn View::make('user-management-panel',$data);\n\t}",
"function showUserPage() {\n\t\t$this->setCacheLevelNone();\n\t\t$this->getEngine()->assign('userID', utilityOutputWrapper::wrap($this->getModel()->getUser()->getID()));\n\t\t$this->getEngine()->assign('username', utilityOutputWrapper::wrap($this->getModel()->getUsername()));\n\t\t$this->getEngine()->assign('token', utilityOutputWrapper::wrap($this->getModel()->getRequestToken()));\n\n\t\t$this->render($this->getTpl('user'));\n\t}",
"public function manageAction() {\n\t\tif (!FreshRSS_Auth::hasAccess('admin')) {\n\t\t\tMinz_Error::error(403);\n\t\t}\n\n\t\tMinz_View::prependTitle(_t('admin.user.title') . ' · ');\n\n\t\t// Get the correct current user.\n\t\t$username = Minz_Request::param('u', Minz_Session::param('currentUser'));\n\t\tif (!FreshRSS_UserDAO::exist($username)) {\n\t\t\t$username = Minz_Session::param('currentUser');\n\t\t}\n\t\t$this->view->current_user = $username;\n\n\t\t// Get information about the current user.\n\t\t$entryDAO = FreshRSS_Factory::createEntryDao($this->view->current_user);\n\t\t$this->view->nb_articles = $entryDAO->count();\n\t\t$this->view->size_user = $entryDAO->size();\n\t}",
"public function index() {\n\t\tredirect($this->base_url . 'user/profile', 'refresh');\n\t}",
"public function pendingUsersAction()\n\t{\n\t\tif (!$this->_getSession()->isLoggedIn()) {\n\t\t\t$this->_redirect('/profile/login');\n\t\t\treturn;\n\t\t}\n\t\tif (!$this->_isValid()) {\n\t\t\t$this->_forward('no-route');\n\t\t\treturn;\n\t\t}\n\t\tif (!$this->_plot->isOwner($this->_getSession()->user)) {\n\t\t\t$this->_redirect('/p/' . $this->_plot->getId());\n\t\t\treturn;\n\t\t}\n\n\t\t$this->_initLayout();\n\t\t$this->view->headTitle()->prepend('Pending Users');\n\t\t$this->view->users = $this->_plot->getPendingUsers();\n\t}",
"public function panelParticipationsStartupAction()\n {\n }",
"public function userLoginDisplay(){\r\n \t \t$this->display();\r\n \t }",
"public function indexAction()\n {\n // If the user's not logged in, send them to registration.\n $securityContext = $this->container->get('security.context');\n if( ! $securityContext->isGranted('IS_AUTHENTICATED_REMEMBERED') ){\n return $this->homeAction();\n } else {\n // Otherwise, send them to their profile page.\n $user = $this->getUser();\n $username = $user->getUsername();\n return $this->redirect($this->generateUrl('lists_io_user_view_by_username', array('username' => $username)));\n }\n\n }",
"function redireccion_control_panel()\n{\n\t$this->setRedirect( 'index.php?option=com_securitycheck' );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test multipart parsing with values | public function testMultiPartParsingWithValues()
{
$multiPartBodyContent = "------WebKitFormBoundaryUmLBdln8JKrYyp81\r\nContent-Disposition: form-data; name=\"--databaseStep[__state]\"\r\n\r\nTzozMzoiVFlQTzNcRm9ybVxDb3JlXFJ1bnRpbWVcRm9ybVN0YXRlIjoyOntzOjI1OiIAKgBsYXN0RGlzcGxheWVkUGFnZUluZGV4IjtpOjA7czoxMzoiACoAZm9ybVZhbHVlcyI7YTowOnt9fQ==546f5a1ab0b920821aaf34cdfb858717d666789b\r\n------WebKitFormBoundaryUmLBdln8JKrYyp81\r\nContent-Disposition: form-data; name=\"--databaseStep[__trustedProperties]\"\r\n\r\na:6:{s:6:\"driver\";i:1;s:4:\"user\";i:1;s:8:\"password\";i:1;s:4:\"host\";i:1;s:6:\"dbname\";i:1;s:13:\"__currentPage\";i:1;}6257cab62f04dfa156df41fccd93ee87ba816ebe\r\n------WebKitFormBoundaryUmLBdln8JKrYyp81\r\nContent-Disposition: form-data; name=\"__csrfToken\"\r\n\r\n23ca48201b96c207678c6154b0445444\r\n------WebKitFormBoundaryUmLBdln8JKrYyp81\r\nContent-Disposition: form-data; name=\"--databaseStep[driver]\"\r\n\r\npdo_mysql\r\n------WebKitFormBoundaryUmLBdln8JKrYyp81\r\nContent-Disposition: form-data; name=\"--databaseStep[user]\"\r\n\r\nroot\r\n------WebKitFormBoundaryUmLBdln8JKrYyp81\r\nContent-Disposition: form-data; name=\"--databaseStep[password]\"\r\n\r\npassword\r\n------WebKitFormBoundaryUmLBdln8JKrYyp81\r\nContent-Disposition: form-data; name=\"--databaseStep[host]\"\r\n\r\n127.0.0.1\r\n------WebKitFormBoundaryUmLBdln8JKrYyp81\r\nContent-Disposition: form-data; name=\"--databaseStep[dbname]\"\r\n\r\nNEOSASDFASDF\r\n------WebKitFormBoundaryUmLBdln8JKrYyp81\r\nContent-Disposition: form-data; name=\"--databaseStep[__currentPage]\"\r\n\r\n1\r\n------WebKitFormBoundaryUmLBdln8JKrYyp81--\r\n";
$expectedResult = array(
'--databaseStep' =>
array(
'__state' => 'TzozMzoiVFlQTzNcRm9ybVxDb3JlXFJ1bnRpbWVcRm9ybVN0YXRlIjoyOntzOjI1OiIAKgBsYXN0RGlzcGxheWVkUGFnZUluZGV4IjtpOjA7czoxMzoiACoAZm9ybVZhbHVlcyI7YTowOnt9fQ==546f5a1ab0b920821aaf34cdfb858717d666789b',
'__trustedProperties' => 'a:6:{s:6:"driver";i:1;s:4:"user";i:1;s:8:"password";i:1;s:4:"host";i:1;s:6:"dbname";i:1;s:13:"__currentPage";i:1;}6257cab62f04dfa156df41fccd93ee87ba816ebe',
'driver' => 'pdo_mysql',
'user' => 'root',
'password' => 'password',
'host' => '127.0.0.1',
'dbname' => 'NEOSASDFASDF',
'__currentPage' => '1',
),
'__csrfToken' => '23ca48201b96c207678c6154b0445444',
);
$request = $this->parser->getRequest();
$request->addHeader(HttpProtocol::HEADER_CONTENT_TYPE, 'multipart/form-data; boundary=----WebKitFormBoundaryUmLBdln8JKrYyp81');
$this->parser->parseMultipartFormData($multiPartBodyContent);
$result = $this->parser->getQueryParser()->getResult();
$this->assertSame(var_export($result, true), var_export($expectedResult, true));
} | [
"public function testMultiPartFormDataParsingToGetParamsFromRequestWithValues()\n {\n $bodyContent = \"------WebKitFormBoundaryIvj0dNQtwxACEjEk\\r\\nContent-Disposition: form-data; name=\\\"testParam1\\\"\\r\\n\\r\\ntestValue1\\r\\n------WebKitFormBoundaryIvj0dNQtwxACEjEk\\r\\nContent-Disposition: form-data; name=\\\"testParam2\\\"\\r\\n\\r\\ntestValue2\\r\\n------WebKitFormBoundaryIvj0dNQtwxACEjEk--\\r\\n\";\n $headerString = \"Host: 127.0.0.1\\r\\n\" .\n \"Connection: keep-alive\\r\\n\" .\n \"Content-Length: \" . strlen($bodyContent) . \"\\r\\n\" .\n \"Cache-Control: max-age=0\\r\\n\" .\n \"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\\r\\n\" .\n \"User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36\\r\\n\" .\n \"Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryIvj0dNQtwxACEjEk\\r\\n\" .\n \"Accept-Encoding: gzip,deflate,sdch\\r\\n\" .\n \"Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4\\r\\n\" .\n \"Cookie: _ga=GA1.1.1798004689.1405528669\\r\\n\";\n $this->parser->parseHeaders($headerString);\n $this->parser->parseMultipartFormData($bodyContent);\n $this->assertSame(\n $this->parser->getQueryParser()->getResult(),\n array(\n 'testParam1' => 'testValue1',\n 'testParam2' => 'testValue2'\n )\n );\n }",
"public function testMultiPartFormDataParsingToGetPartsFromRequestWithOneBoundaryAndDifferentBoundaryHeaderInformation()\n {\n $bodyContent = \"------WebKitFormBoundaryBUm5KAhIP4YY4UcI\\r\\nContent-Disposition: form-data; name=\\\"file1\\\"; filename=\\\"testUpload.txt\\\"\\r\\nContent-Type: text/plain\\r\\n\\r\\nTestContentTest0000\\r\\n------WebKitFormBoundaryBUm5KAhIP4YY4UcI\\r\\n\";\n $headerString = \"Host: 127.0.0.1\\r\\n\" .\n \"Connection: keep-alive\\r\\n\" .\n \"Content-Length: \" . strlen($bodyContent) . \"\\r\\n\" .\n \"Cache-Control: max-age=0\\r\\n\" .\n \"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\\r\\n\" .\n \"User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36\\r\\n\" .\n \"Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryBU2f3FHUr7h9fwenj\\r\\n\" .\n \"Accept-Encoding: gzip,deflate,sdch\\r\\n\" .\n \"Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4\\r\\n\" .\n \"Cookie: _ga=GA1.1.1798004689.1405528669\\r\\n\";\n $this->parser->parseHeaders($headerString);\n $this->parser->parseMultipartFormData($bodyContent);\n $this->assertSame(0, count($this->parser->getRequest()->getParts()));\n }",
"public function parseMultipartFormData($content)\n {\n // initialize the array with the matches\n $matches = array();\n // get request ref to local function context\n $request = $this->getRequest();\n // grab multipart boundary from content type header\n preg_match('/boundary=(.+)$/', $this->getRequest()->getHeader(HttpProtocol::HEADER_CONTENT_TYPE), $matches);\n // check if boundary is not set\n if (!isset($matches[1])) {\n return;\n }\n // get boundary\n $boundary = $matches[1];\n // split content by boundary\n $blocks = preg_split(\"/-+$boundary/\", $content);\n // get rid of last -- element\n array_pop($blocks);\n // loop data blocks\n foreach ($blocks as $block) {\n // of block is empty continue with next one\n if (empty($block)) {\n continue;\n }\n\n // check if filename is given\n // todo: refactor file part generating\n if (strpos($block, '; filename=\"') !== false) {\n // init new part instance\n $part = $this->getHttpPartInstance();\n // seperate headers from body\n $partHeaders = strstr($block, \"\\n\\r\\n\", true);\n $partBody = preg_replace(\"/\\n\\r\\n/\", '', strstr($block, \"\\n\\r\\n\"), 1);\n // parse part headers\n foreach (explode(\"\\n\", $partHeaders) as $h) {\n $h = explode(':', $h, 2);\n if (isset($h[1])) {\n $part->addHeader($h[0], trim($h[1]));\n }\n }\n // match name and filename\n if (preg_match(\"/name=\\\"([^\\\"]*)\\\"; filename=\\\"([^\\\"]*)\\\".*$/s\", $partHeaders, $matches) !== 0) {\n // set name\n $part->setName($matches[1]);\n // set given filename is is set\n $part->setFilename($matches[2]);\n // put content to part\n $part->putContent(preg_replace('/.' . PHP_EOL . '$/', '', $partBody));\n // add the part instance to request\n $request->addPart($part);\n }\n // parse all other fields as normal key value pairs\n } else {\n // match \"name\" and optional value in between newline sequences\n if (preg_match('/name=\\\"([^\\\"]*)\\\"[\\r\\n]+([^\\r\\n]*)?/', $block, $matches) !== 0) {\n $this->getQueryParser()->parseKeyValue($matches[1], $matches[2]);\n }\n }\n }\n }",
"public function testMultiPartFormDataParsingToGetParamsFromRequestWithMP4Video()\n {\n $videoBody = \"AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAABgNtZGF0AAACrgYF//+q3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0OCByMjY0MyA1YzY1NzA0IC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNSAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTMgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MzoweDExMyBtZT1oZXggc3VibWU9NyBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0xIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MSA4eDhkY3Q9MSBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0tMiB0aHJlYWRzPTQgbG9va2FoZWFkX3RocmVhZHM9MSBzbGljZWRfdGhyZWFkcz0wIG5yPTAgZGVjaW1hdGU9MSBpbnRlcmxhY2VkPTAgYmx1cmF5X2NvbXBhdD0wIGNvbnN0cmFpbmVkX2ludHJhPTAgYmZyYW1lcz0zIGJfcHlyYW1pZD0yIGJfYWRhcHQ9MSBiX2JpYXM9MCBkaXJlY3Q9MSB3ZWlnaHRiPTEgb3Blbl9nb3A9MCB3ZWlnaHRwPTIga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAMGWIhAA3//728P4FNlYEUJcRzeidMx+/Fbi6PXL2RZj2wmZZxBesACRgA0YoZdXQoQAAAAxBmiRsQ3/+p4QAl4AAAAAJQZ5CeIV/AHpB3gIATGF2YzU2LjYwLjEwMABCIAjBGDghEARgjBwAAAAJAZ5hdEJ/AKCAIRAEYIwcIRAEYIwcAAAACQGeY2pCfwCggSEQBGCMHAAAABJBmmhJqEFomUwIb//+p4QAl4EhEARgjBwhEARgjBwAAAALQZ6GRREsK/8AekEhEARgjBwAAAAJAZ6ldEJ/AKCBIRAEYIwcIRAEYIwcAAAACQGep2pCfwCggCEQBGCMHAAAABJBmqxJqEFsmUwIb//+p4QAl4AhEARgjBwhEARgjBwAAAALQZ7KRRUsK/8AekEhEARgjBwhEARgjBwAAAAJAZ7pdEJ/AKCAIRAEYIwcAAAACQGe62pCfwCggCEQBGCMHCEQBGCMHAAAABJBmvBJqEFsmUwIb//+p4QAl4EhEARgjBwAAAALQZ8ORRUsK/8AekEhEARgjBwhEARgjBwAAAAJAZ8tdEJ/AKCBIRAEYIwcAAAACQGfL2pCfwCggCEQBGCMHCEQBGCMHAAAABJBmzRJqEFsmUwIb//+p4QAl4AhEARgjBwhEARgjBwAAAALQZ9SRRUsK/8AekEhEARgjBwAAAAJAZ9xdEJ/AKCAIRAEYIwcIRAEYIwcAAAACQGfc2pCfwCggCEQBGCMHAAAABFBm3hJqEFsmUwIZ//+nhACTyEQBGCMHCEQBGCMHAAAAAtBn5ZFFSwr/wB6QCEQBGCMHAAAAAkBn7V0Qn8AoIEhEARgjBwhEARgjBwAAAAJAZ+3akJ/AKCBIRAEYIwcAAAAEUGbvEmoQWyZTAhf//6MsAJWIRAEYIwcIRAEYIwcAAAAC0Gf2kUVLCv/AHpBIRAEYIwcIRAEYIwcAAAACQGf+XRCfwCggCEQBGCMHAAAAAkBn/tqQn8AoIEhEARgjBwhEARgjBwAAAASQZv+SahBbJlMFEwn//3xABZRIRAEYIwcAAAACQGeHWpCfwCggCEQBGCMHCEQBGCMHCEQBGCMHCEQBGCMHCEQBGCMHCEQBGCMHCEQBGCMHAAACURtb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAEQAABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAEK3RyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAECwAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAsAAAAJAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAABAsAAAfSAAEAAAAAA6NtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAHUwAAB5N1XEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAANObWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADDnN0YmwAAACWc3RzZAAAAAAAAAABAAAAhmF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAsACQAEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAAwYXZjQwFkAAv/4QAXZ2QAC6zZQsTsBEAAAPpAADqYA8UKZYABAAZo6+PLIsAAAAAYc3R0cwAAAAAAAAABAAAAHwAAA+kAAAAUc3RzcwAAAAAAAAABAAAAAQAAAQhjdHRzAAAAAAAAAB8AAAABAAAH0gAAAAEAABONAAAAAQAAB9IAAAABAAAAAAAAAAEAAAPpAAAAAQAAE40AAAABAAAH0gAAAAEAAAAAAAAAAQAAA+kAAAABAAATjQAAAAEAAAfSAAAAAQAAAAAAAAABAAAD6QAAAAEAABONAAAAAQAAB9IAAAABAAAAAAAAAAEAAAPpAAAAAQAAE40AAAABAAAH0gAAAAEAAAAAAAAAAQAAA+kAAAABAAATjQAAAAEAAAfSAAAAAQAAAAAAAAABAAAD6QAAAAEAABONAAAAAQAAB9IAAAABAAAAAAAAAAEAAAPpAAAAAQAAC7sAAAABAAAD6QAAAChzdHNjAAAAAAAAAAIAAAABAAAAAwAAAAEAAAACAAAAAQAAAAEAAACQc3RzegAAAAAAAAAAAAAAHwAAAuYAAAAQAAAADQAAAA0AAAANAAAAFgAAAA8AAAANAAAADQAAABYAAAAPAAAADQAAAA0AAAAWAAAADwAAAA0AAAANAAAAFgAAAA8AAAANAAAADQAAABUAAAAPAAAADQAAAA0AAAAVAAAADwAAAA0AAAANAAAAFgAAAA0AAACEc3RjbwAAAAAAAAAdAAAAMAAAA1AAAANpAAADfAAAA54AAAOzAAADzAAAA98AAAQBAAAEHAAABC8AAARIAAAEZAAABH8AAASSAAAEqwAABM0AAATiAAAE+wAABQ4AAAUvAAAFRAAABV0AAAVwAAAFkQAABawAAAW/AAAF2AAABfQAAARDdHJhawAAAFx0a2hkAAAAAwAAAAAAAAAAAAAAAgAAAAAAAARAAAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAJGVkdHMAAAAcZWxzdAAAAAAAAAABAAAEQAAAAAAAAQAAAAADu21kaWEAAAAgbWRoZAAAAAAAAAAAAAAAAAAAu4AAAMwAVcQAAAAAAC1oZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU291bmRIYW5kbGVyAAAAA2ZtaW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAypzdGJsAAAAanN0c2QAAAAAAAAAAQAAAFptcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAAu4AAAAAAADZlc2RzAAAAAAOAgIAlAAIABICAgBdAFQAAAAAB9AAAAAlHBYCAgAURkFblAAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAAAzAAAEAAAAATxzdHNjAAAAAAAAABkAAAABAAAAAgAAAAEAAAADAAAAAQAAAAEAAAAEAAAAAgAAAAEAAAAFAAAAAQAAAAEAAAAGAAAAAgAAAAEAAAAHAAAAAQAAAAEAAAAIAAAAAgAAAAEAAAAKAAAAAQAAAAEAAAALAAAAAgAAAAEAAAAMAAAAAQAAAAEAAAANAAAAAgAAAAEAAAAOAAAAAQAAAAEAAAAPAAAAAgAAAAEAAAARAAAAAQAAAAEAAAASAAAAAgAAAAEAAAATAAAAAQAAAAEAAAAUAAAAAgAAAAEAAAAVAAAAAQAAAAEAAAAWAAAAAgAAAAEAAAAXAAAAAQAAAAEAAAAYAAAAAgAAAAEAAAAaAAAAAQAAAAEAAAAbAAAAAgAAAAEAAAAcAAAAAQAAAAEAAAAdAAAABwAAAAEAAADgc3RzegAAAAAAAAAAAAAAMwAAABcAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAIRzdGNvAAAAAAAAAB0AAAMzAAADXQAAA3YAAAOSAAADrQAAA8AAAAPZAAAD9QAABBAAAAQpAAAEPAAABF4AAARzAAAEjAAABJ8AAATBAAAE3AAABO8AAAUIAAAFIwAABT4AAAVRAAAFagAABYUAAAWgAAAFuQAABcwAAAXuAAAGAQAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTYuNDAuMTAx\";\n $bodyContent = \"------WebKitFormBoundary0UtlU0OEOMCbmK39\\r\\nContent-Disposition: form-data; name=\\\"file\\\"; filename=\\\"blank.mp4\\\"\\r\\nContent-Type: video/mp4\\r\\n\\r\\n\".base64_decode($videoBody).\"\\r\\n------WebKitFormBoundary0UtlU0OEOMCbmK39--\\r\\n\";\n $headerString = \"Host: 127.0.0.1\\r\\n\" .\n \"Connection: keep-alive\\r\\n\" .\n \"Content-Length: \" . strlen($bodyContent) . \"\\r\\n\" .\n \"Cache-Control: max-age=0\\r\\n\" .\n \"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\\r\\n\" .\n \"User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36\\r\\n\" .\n \"Content-Type: multipart/form-data; boundary=----WebKitFormBoundary0UtlU0OEOMCbmK39\\r\\n\" .\n \"Accept-Encoding: gzip,deflate,sdch\\r\\n\" .\n \"Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4\\r\\n\" .\n \"Cookie: _ga=GA1.1.1798004689.1405528669\\r\\n\";\n $this->parser->parseHeaders($headerString);\n $this->parser->parseMultipartFormData($bodyContent);\n $this->assertSame(1, count($this->parser->getRequest()->getParts()));\n // get part instance for file1\n $part = $this->parser->getRequest()->getPart('file');\n $this->assertInstanceOf('AppserverIo\\Psr\\HttpMessage\\PartInterface', $part);\n $this->assertSame(\"blank.mp4\", $part->getFilename());\n $this->assertSame(\"video/mp4\", $part->getContentType());\n $this->assertSame($videoBody, base64_encode(stream_get_contents($part->getInputStream())));\n // check headers on part\n $this->assertSame(array(\n 'Content-Disposition' => 'form-data; name=\"file\"; filename=\"blank.mp4\"',\n 'Content-Type' => 'video/mp4'\n ), $part->getHeaders());\n // check headername on part\n $this->assertSame(array(\n 0 => 'Content-Disposition',\n 1 => 'Content-Type'\n ), $part->getHeaderNames());\n }",
"public function splitMultipartBody()\n {\n\n }",
"private function _parseForm()\n {\n if( !empty( $this->boundary ) )\n {\n $chunks = @preg_split( '/[\\-]+'.$this->boundary.'(\\-\\-)?/', $this->input, -1, PREG_SPLIT_NO_EMPTY );\n $request = array();\n $files = array();\n $nd = 0;\n $nf = 0;\n\n if( is_array( $chunks ) )\n {\n foreach( $chunks as $index => $chunk )\n {\n $chunk = ltrim( $chunk, \"-\\r\\n\\t\\s \" );\n $lines = explode( \"\\r\\n\", $chunk );\n $levels = '';\n $name = '';\n $file = '';\n $type = '';\n $value = '';\n $path = '';\n $copy = false;\n\n // skip empty chunks\n if( empty( $chunk ) || empty( $lines ) ) continue;\n\n // extract name/filename\n if( strpos( $lines[0], 'Content-Disposition' ) !== false )\n {\n $line = $this->_line( array_shift( $lines ) );\n $name = $this->_value( @$line['name'], '', true );\n $file = $this->_value( @$line['filename'], '', true );\n }\n // extract content-type\n if( strpos( $lines[0], 'Content-Type' ) !== false )\n {\n $line = $this->_line( array_shift( $lines ) );\n $type = $this->_value( @$line['content'], '', true );\n }\n // rebuild value\n $value = trim( implode( \"\\r\\n\", $lines ) );\n\n // FILES data\n if( !empty( $type ) )\n {\n if( !empty( $value ) )\n {\n $path = str_replace( '\\\\', '/', sys_get_temp_dir() .'/php'. substr( sha1( rand() ), 0, 6 ) );\n $copy = file_put_contents( $path, $value );\n }\n if( preg_match( '/(\\[.*?\\])$/', $name, $tmp ) )\n {\n $name = str_replace( $tmp[1], '', $name );\n $levels = preg_replace( '/\\[\\]/', '['.$nf.']', $tmp[1] );\n }\n $files[ $name.'[name]'.$levels ] = $file;\n $files[ $name.'[type]'.$levels ] = $type;\n $files[ $name.'[tmp_name]'.$levels ] = $path;\n $files[ $name.'[error]'.$levels ] = !empty( $copy ) ? 0 : UPLOAD_ERR_NO_FILE;\n $files[ $name.'[size]'.$levels ] = !empty( $copy ) ? filesize( $path ) : 0;\n $nf++;\n }\n else // POST data\n {\n $name = preg_replace( '/\\[\\]/', '['.$nd.']', $name );\n $request[ $name ] = $value;\n $nd++;\n }\n }\n // finalize arrays\n $_REQUEST = array_merge( $_GET, $this->_data( $request ) );\n $_FILES = $this->_data( $files );\n return true;\n }\n }\n return false;\n }",
"public function It_should_accept_params_and_build_multipart_encoded_params_for_POST_requests()\n\t{\n\t\t// FIXME: Implement multipart form data processing.\n\t\t/*\n\t\t\tfiles = Rack::Utils::Multipart::UploadedFile.new(File.join(File.dirname(__FILE__), \"multipart\", \"file1.txt\"))\n\t\t\tres = Rack::MockRequest.new(app).post(\"/foo\", :params => { \"submit-name\" => \"Larry\", \"files\" => files })\n\t\t\tenv = YAML.load(res.body)\n\t\t\tenv[\"REQUEST_METHOD\"].should.equal \"POST\"\n\t\t\tenv[\"QUERY_STRING\"].should.equal \"\"\n\t\t\tenv[\"PATH_INFO\"].should.equal \"/foo\"\n\t\t\tenv[\"CONTENT_TYPE\"].should.equal \"multipart/form-data; boundary=AaB03x\"\n\t\t\tenv[\"mock.postdata\"].length.should.equal 206\n\t\t*/\n\t\t$this->markTestSkipped( 'pending multipart implementation' );\n\t}",
"public function testParseFormData()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}",
"public function testParseFormData()\n {\n $expected = [\n 'test' => 'test',\n 'submit' => 'Test'\n ];\n $parseDefault = new Parser('application/x-www-form-urlencoded');\n $this->assertEquals($expected, $parseDefault->parse('test=test&submit=Test'));\n }",
"public function testMultipartPart() {\n\n fwrite(STDOUT, \"Tested multipart generator methods.\\n\");\n\n $reflection = new \\ReflectionClass('\\ChapterThree\\AppleNewsAPI\\PublisherAPI\\Curl');\n\n // Access protected method getFileInformation().\n $getFileInformation = $reflection->getMethod('getFileInformation');\n $getFileInformation->setAccessible(true);\n\n // Access protected method multipartPart().\n $multipartPart = $reflection->getMethod('multipartPart');\n $multipartPart->setAccessible(true);\n\n // Access protected method multipartFinalize().\n $multipartFinalize = $reflection->getMethod('multipartFinalize');\n $multipartFinalize->setAccessible(true);\n\n // Get private property.\n $getBoundary = $reflection->getProperty('boundary');\n $getBoundary->setAccessible(true);\n $boundary = $getBoundary->getValue($this->PublisherAPI);\n\n // Multiparts\n $multiparts = [];\n\n // Process each file and generate multipart form data.\n foreach ($this->files as $path) {\n // Load file information.\n $file = $getFileInformation->invokeArgs($this->PublisherAPI, [$path]);\n $multiparts[] = $multipartPart->invokeArgs(\n \t$this->PublisherAPI,\n \t[\n [\n 'filename' => $file['filename'],\n 'name' => $file['name'],\n 'size' => $file['size']\n ],\n $file['mimetype'],\n $file['contents']\n ]\n );\n }\n\n // Generate finalized version of the multipart data.\n $contents = $multipartFinalize->invokeArgs($this->PublisherAPI, [$multiparts]);\n // Get rid of first boundary.\n $multipart1 = '--' . $boundary . static::EOL . preg_replace('/^.+\\n/', '', $contents);\n\n // Load test file.\n $file = $getFileInformation->invokeArgs($this->PublisherAPI, [$this->files[0]]);\n\n // Expected multipart content.\n $multipart2 = '--' . $boundary . static::EOL;\n $multipart2 .= 'Content-Type: image/gif'. static::EOL;\n $multipart2 .= 'Content-Disposition: form-data; filename=image.gif; name=image; size=42' . static::EOL;\n $multipart2 .= static::EOL . $file['contents'] . static::EOL;\n $multipart2 .= '--' . $boundary . '--' . static::EOL;\n\n // Test Multipart data headers and content.\n $this->assertEquals($multipart1, $multipart2);\n\n }",
"public function testContentType()\n {\n $this->multipart->boundary = \"LeChuck\";\n $expected = 'multipart/Test; boundary=\"LeChuck\"';\n $this->assertEquals( $expected, $this->multipart->getHeader( 'Content-Type' ) );\n }",
"abstract public function multipartType();",
"function _parse_raw_http_request_multipart($input, $boundary)\n{\n $post_data = array();\n\n // Split content by boundary and get rid of last -- element\n $blocks = preg_split(\"#-+$boundary#\", $input);\n array_pop($blocks);\n\n $matches = array();\n\n // Loop data blocks\n foreach ($blocks as $block) {\n // Parse blocks (except for uploaded files)\n if (strpos($block, 'application/octet-stream') === false) {\n // Match \"name\" and optional value in between newline sequences\n if (preg_match('#name=\\\"([^\\\"]*)\\\"[\\n|\\r]+([^\\n\\r].*)?[\\r\\n]$#s', $block, $matches) != 0) {\n $key = $matches[1];\n $val = $matches[2];\n if (get_magic_quotes_gpc()) {\n $val = addslashes($val);\n }\n\n if (substr($key, -2) == '[]') {\n $key = substr($key, 0, strlen($key) - 2);\n if (!isset($post_data[$key])) {\n $post_data[$key] = array();\n }\n $post_data[$key][] = $val;\n } else {\n $post_data[$key] = $val;\n }\n }\n }\n }\n\n return $post_data;\n}",
"private function prepareMultipartRequest($data) {\n\t\t$chunks = array();\n\t\t$contentLength = 0;\n\t\t$boundary = \"----moxiehttpclientboundary\";\n\n\t\t$items = $data->getItems();\n\t\tforeach ($items as $name => $item) {\n\t\t\tif (is_string($item)) {\n\t\t\t\t// Normal name/value field\n\t\t\t\t$chunk = \"--\" . $boundary . \"\\r\\n\";\n\t\t\t\t$chunk .= \"Content-Disposition: form-data; name=\\\"\" . $name . \"\\\"\\r\\n\\r\\n\";\n\t\t\t\t$chunk .= $item . \"\\r\\n\";\n\n\t\t\t\t// Add chunk and increase length\n\t\t\t\t$contentLength += strlen($chunk);\n\t\t\t\t$chunks[] = $chunk;\n\t\t\t} else {\n\t\t\t\tif (!file_exists($item[0])) {\n\t\t\t\t\tthrow new MOXMAN_Http_HttpClientException(\"Could not open file: \" . $item[0] . \" for upload using multipart.\");\n\t\t\t\t}\n\n\t\t\t\t// File/stream field\n\t\t\t\t$chunk = \"--\" . $boundary . \"\\r\\n\";\n\t\t\t\t$chunk .= \"Content-Disposition: form-data; name=\\\"\" . $name . \"\\\"; filename=\\\"\" . rawurlencode($item[1]) . \"\\\"\\r\\n\";\n\t\t\t\t$chunk .= \"Content-Type: \" . $item[2] . \"\\r\\n\\r\\n\";\n\n\t\t\t\t// Add before chunk\n\t\t\t\t$contentLength += strlen($chunk);\n\t\t\t\t$chunks[] = $chunk;\n\n\t\t\t\t// Add blob and use the blob size\n\t\t\t\t$contentLength += filesize($item[0]);\n\t\t\t\t$chunks[] = $item;\n\n\t\t\t\t// Add after chunk\n\t\t\t\t$chunk = \"\\r\\n--\" . $boundary . \"--\\r\\n\";\n\t\t\t\t$contentLength += strlen($chunk);\n\t\t\t\t$chunks[] = $chunk;\n\t\t\t}\n\t\t}\n\n\t\t// Set content type, boundary and length\n\t\t$this->setHeader(\"Content-Type\", \"multipart/form-data; boundary=\" . $boundary);\n\t\t$this->setHeader(\"Content-Length\", $contentLength);\n\n\t\treturn $chunks;\n\t}",
"public function testUploadMultiPartParams()\n {\n $localFilePath = sys_get_temp_dir() . '/' . uniqid('test_', true) . '.txt';\n file_put_contents($localFilePath, '0');\n\n try {\n $dir = '/';\n $fileResource = new FileResourceStub($this->getMockedClient(new Response()));\n $this->assertNotContains(\n [\n 'name' => 'parent_dir',\n 'contents' => $dir\n ],\n $fileResource->getMultiPartParams($localFilePath, $dir, false)\n );\n $this->assertContains(\n [\n 'name' => 'target_file',\n 'contents' => $dir . basename($localFilePath)\n ],\n $fileResource->getMultiPartParams($localFilePath, $dir, false)\n );\n } finally {\n if (is_writable($localFilePath)) {\n unlink($localFilePath);\n }\n }\n }",
"public function It_should_parse_POST_data_on_PUT_when_media_type_is_form_data()\n\t{\n\t\t$request = Prack_Request::with( Prack_Mock_Request::envFor(\n\t\t\t'/?foo=quux', array( 'REQUEST_METHOD' => 'PUT', 'CONTENT_TYPE' => 'application/x-www-form-urlencoded', 'input' => 'foo=bar&quux=bla' ) ) );\n\t\t$this->assertEquals( array( 'foo' => 'bar', 'quux' => 'bla' ), $request->POST() );\n\t\t$this->assertEquals( 'foo=bar&quux=bla', $request->body()->read() );\n\t}",
"function parse_raw_http_request(array &$a_data)\n{\n // read incoming data\n $input = file_get_contents('php://input');\n \n // grab multipart boundary from content type header\n preg_match('/boundary=(.*)$/', $_SERVER['CONTENT_TYPE'], $matches);\n \n // content type is probably regular form-encoded\n if (!count($matches))\n {\n // we expect regular puts to containt a query string containing data\n parse_str(urldecode($input), $a_data);\n return $a_data;\n }\n \n $boundary = $matches[1];\n \n // split content by boundary and get rid of last -- element\n $a_blocks = preg_split(\"/-+$boundary/\", $input);\n array_pop($a_blocks);\n \n // loop data blocks\n foreach ($a_blocks as $id => $block)\n {\n if (empty($block))\n continue;\n \n // you'll have to var_dump $block to understand this and maybe replace \\n or \\r with a visibile char\n \n // parse uploaded files\n if (strpos($block, 'application/octet-stream') !== FALSE)\n {\n // match \"name\", then everything after \"stream\" (optional) except for prepending newlines\n preg_match(\"/name=\\\"([^\\\"]*)\\\".*stream[\\n|\\r]+([^\\n\\r].*)?$/s\", $block, $matches);\n $a_data['files'][$matches[1]] = $matches[2];\n }\n // parse all other fields\n else\n {\n // match \"name\" and optional value in between newline sequences\n preg_match('/name=\\\"([^\\\"]*)\\\"[\\n|\\r]+([^\\n\\r].*)?\\r$/s', $block, $matches);\n $a_data[$matches[1]] = $matches[2];\n }\n }\n}",
"public function It_should_not_parse_POST_data_when_media_type_is_not_form_data()\n\t{\n\t\t$request = Prack_Request::with( Prack_Mock_Request::envFor(\n\t\t\t'/?foo=quux', array( 'REQUEST_METHOD' => 'POST', 'CONTENT_TYPE' => 'text/plain;charset=utf-8', 'input' => 'foo=bar&quux=bla' ) ) );\n\t\t\t\n\t\t$media_type_params = $request->mediaTypeParams();\n\t\t$this->assertEquals( 'text/plain;charset=utf-8', $request->contentType() );\n\t\t$this->assertEquals( 'utf-8', $request->contentCharset() );\n\t\t$this->assertEquals( 'text/plain', $request->mediaType() );\n\t\t$this->assertEquals( 'utf-8', $media_type_params[ 'charset' ] );\n\t\t$this->assertEquals( array(), $request->POST() );\n\t\t$this->assertEquals( array( 'foo' => 'quux' ), $request->params() );\n\t\t$this->assertEquals( 'foo=bar&quux=bla', $request->body()->read() );\n\t}",
"public function It_should_parse_POST_data_with_explicit_content_type_regardless_of_method()\n\t{\n\t\t$request = Prack_Request::with( Prack_Mock_Request::envFor(\n\t\t '/?foo=quux', array( 'CONTENT_TYPE' => 'application/x-www-form-urlencoded;foo=bar', 'input' => 'foo=bar&quux=bla' ) ) );\n\t\t\n\t\t$this->assertEquals( 'application/x-www-form-urlencoded;foo=bar', $request->contentType() );\n\t\t$this->assertEquals( 'application/x-www-form-urlencoded', $request->mediaType() );\n\t\t$this->assertEquals( array( 'foo' => 'bar', 'quux' => 'bla' ), $request->POST() );\n\t\t$this->assertEquals( array( 'foo' => 'bar', 'quux' => 'bla' ), $request->params() );\n\t\t\n\t\t$media_type_params = $request->mediaTypeParams();\n\t\t$this->assertEquals( 'bar', $media_type_params[ 'foo' ] );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Configures the object manager object configuration from config.tx_extbase.objects and plugin.tx_foo.objects | private function configureObjectManager()
{
$frameworkSetup = $this->configurationManager
->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
if (!is_array($frameworkSetup['objects'])) {
return;
}
$objectContainer = GeneralUtility::makeInstance(Container::class);
foreach ($frameworkSetup['objects'] as $classNameWithDot => $classConfiguration) {
if (isset($classConfiguration['className'])) {
$originalClassName = rtrim($classNameWithDot, '.');
$objectContainer->registerImplementation($originalClassName, $classConfiguration['className']);
}
}
} | [
"public function configureObjectManager()\n {\n $frameworkSetup = $this->configurationManager->getConfiguration(\\TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);\n if (!is_array($frameworkSetup['objects'])) {\n return;\n }\n $objectContainer = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Extbase\\Object\\Container\\Container::class);\n foreach ($frameworkSetup['objects'] as $classNameWithDot => $classConfiguration) {\n if (isset($classConfiguration['className'])) {\n $originalClassName = rtrim($classNameWithDot, '.');\n $objectContainer->registerImplementation($originalClassName, $classConfiguration['className']);\n }\n }\n }",
"protected function configureModelManager(): void\n {\n //====================================================================//\n // Load Container\n $container = $this->getConfigurationPool()->getContainer();\n if (empty($container)) {\n return;\n }\n //====================================================================//\n // Load Model Manager\n /** @var ObjectsManager $modelManager */\n $modelManager = $container->get('sonata.admin.manager.splash');\n //====================================================================//\n // Setup Model Manager\n $modelManager->setServerId($this->serverId);\n //====================================================================//\n // Override Model Manager\n $this->setModelManager($modelManager);\n }",
"protected function init_genConfigObj() {\n\t\tif (!is_object($this->genConfigObj)) {\n\t\t\t// Create object instance for generating TCA files\n\t\t\t$this->genConfigObj = t3lib_div::makeInstance('tx_kbkickstarter_genConfig');\n\t\t\t$this->genConfigObj->init($this, $this->rootObj);\n\t\t}\n\t\t// Load all tables defined in database\n\t\t$this->genConfigObj->loadTables();\n\t}",
"private function initializeObjectManager()\n {\n if (!$this->objectManager) {\n $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class);;\n }\n }",
"static public function setConfig($objectName, array $configs);",
"public function setObjectManager(ObjectManager $objectManager): void;",
"protected function initStorageObjects() {\n\t\t/**\n\t\t * Do not modify this method!\n\t\t * It will be rewritten on each save in the extension builder\n\t\t * You may modify the constructor of this class instead\n\t\t */\n\t\t$this->customer = new Tx_Extbase_Persistence_ObjectStorage();\n\n\t\t$this->tags = new Tx_Extbase_Persistence_ObjectStorage();\n\t\t\n\t\t$this->content = new Tx_Extbase_Persistence_ObjectStorage();\n\t}",
"public function initializeObject() {\n\t\t$frameworkConfiguration = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);\n\t\tif (isset($frameworkConfiguration['persistence']['tx_nxsolrbackend'])) {\n\t\t\t$settings = $frameworkConfiguration['persistence']['tx_nxsolrbackend'];\n\t\t}\n\t\t\n\t\tif (isset($settings['server']) && $settings['server'] !== '') {\n\t\t\t$this->solrServer = $settings['server'];\n\t\t} else {\n\t\t\t$globalConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS'][\"EXT\"][\"extConf\"]['nxsolrbackend']);\n\t\t\t$this->solrServer = $globalConfiguration['solrurl'];\n\t\t}\n\t}",
"protected function initStorageObjects() {\n\t\t/**\n\t\t * Do not modify this method!\n\t\t * It will be rewritten on each save in the extension builder\n\t\t * You may modify the constructor of this class instead\n\t\t */\n\t\t$this->modes = new Tx_Extbase_Persistence_ObjectStorage();\n\t}",
"public static function getObjectManager()\n {\n $objManager = parent::getObjectManager();\n\n self::initializeDi($objManager, 'Shopgate_Base');\n self::initializeDi($objManager, 'Shopgate_Export');\n //self::initializeDi($objManager, 'Shopgate_Import'); //todo-sg: need a way to pass it on per module basis\n\n return $objManager;\n }",
"protected function initStorageObjects() {\n\t/**\n\t * Do not modify this method!\n\t * It will be rewritten on each save in the extension builder\n\t * You may modify the constructor of this class instead\n\t */\n\t$this->subscriptions = new Tx_Extbase_Persistence_ObjectStorage();\n\n\t$this->viewed = new Tx_Extbase_Persistence_ObjectStorage();\n }",
"private function _setupConfiguration()\n {\n $configuration = array();\n\n //@todo: Update configuration parameters\n if (!empty($GLOBALS['conf']['kolab']['imap'])) {\n $configuration = $GLOBALS['conf']['kolab']['imap'];\n }\n if (!empty($GLOBALS['conf']['kolab']['storage'])) {\n $configuration = $GLOBALS['conf']['kolab']['storage'];\n }\n\n $this->_injector->setInstance(\n 'Horde_Kolab_Storage_Configuration', $configuration\n );\n }",
"public function checkExtObj()\n {\n if (is_array($this->extClassConf) && $this->extClassConf['name']) {\n $this->extObj = GeneralUtility::makeInstance($this->extClassConf['name']);\n $this->extObj->init($this, $this->extClassConf);\n // Re-write:\n $this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->MCONF['name'], $this->modMenu_type, $this->modMenu_dontValidateList, $this->modMenu_setDefaultList);\n }\n }",
"protected function __setDefaultExtManager(array &$config, ContainerBuilder $container) {\n if (empty($config['default_ext_manager'])) {\n $keys = array_keys($config['ext_managers']);\n $config['default_ext_manager'] = reset($keys);\n }\n $container->setParameter('rm.admin.default_ext_manager', $config['default_ext_manager']);\n }",
"public function injectObjectManager(Tx_Extbase_Object_ObjectManager $objectManager) {\n\t\t$this->objectManager = $objectManager;\n\t}",
"protected function initStorageObjects() {\n\t\t$this->fields = new Tx_Extbase_Persistence_ObjectStorage();\n\t}",
"public function setObjectManager(ObjectManager $objectManager){\n $this->objectManager= $objectManager;\n }",
"public function setObjectManager($objectManager)\n {\n $this->objectManager = $objectManager;\n }",
"protected function initStorageObjects(): void\n {\n /*\n * Do not modify this method!\n * It will be rewritten on each save in the extension builder\n * You may modify the constructor of this class instead\n */\n $this->attributes = new ObjectStorage();\n $this->categories = new ObjectStorage();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show the scheda 2 form. | public function scheda2()
{
// return the course creation form
return view('forms.scheda2')->with(['regions' => Region::all(), 'courses' => Course::whereNotIn('id', [84,85])->where('end_date', '>', Carbon::today())->get()]);
} | [
"function showForm()\n {\n $form = new SessionsAdminPanelForm($this);\n $form->show();\n return;\n }",
"public function form(){\n $calculadora = $this->modelo('Calculadora');\n $archivo = parent::getInfoSistema();\n $datos = [\n 'infoSistema' => $archivo,\n 'CalculadoraModelo' => $calculadora\n ];\n $this->vista('calculadora/form', $datos);\n }",
"public function formNewAsistenciaManual(){\r\n Obj::run()->View->render();\r\n }",
"function showForm()\n {\n $form = new BlacklistAdminPanelForm($this);\n $form->show();\n return;\n }",
"function actionForm()\n\t{\n\t\t$session = new Session();\n\t\t$config = new Config();\n\n\t\t$this->content( 'form' )\n\t\t\t->render( array(\n\t\t\t\t'model' => $this->model()->get(),\n\t\t\t\t'session' => $session->get(),\n\t\t\t\t'config' => $config->fetch('application')\n\t\t\t));\n\t}",
"public function showForm() {\n\t\t$form = $this->getTaskForm();\n\t\t$form->setValues($this->taskModel);\n\t\t$content = $this->newView('task/form.html')->assign(array(\n\t\t\t'form' => $form,\n\t\t\t'mode' => 'create'\n\t\t\t\t));\n\t\treturn $this->newResponse($content);\n\t}",
"private function view_form() {\n\t\tGLOBAL $db, $MYSQL_PREFIX, $TDTRAC_SITE;\n\t\t$sql = \"SELECT showid, showname FROM `{$MYSQL_PREFIX}shows` ORDER BY created DESC\";\n\t\t$result = mysql_query($sql, $db);\n\t\t$form = new tdform(\"{$TDTRAC_SITE}budget/view/\", 'genform', 1, 'genform', 'View Budget');\n\t\t\n\t\t$result = $form->addDrop('id', 'Show Name', null, db_list(get_sql_const('showidall'), array(showid, showname)), False);\n\t\treturn $form->output(\"View Selected\");\n\t\t\n\t\treturn $html;\n\t}",
"public function booking_form_shortcode() {\n\t\treturn $this->view( 'views/booking_form.htm.php', $this->settings );\n\t}",
"public function openForm() {\n\t\t$this->html = \"<form action='{$this->action}' method='{$this->method}'>\" . PHP_EOL;\n\t}",
"function scheduler() {\n\t\t$this->validate();\n\t\t$this->setupTemplate();\n\n\t\t$templateMgr =& TemplateManager::getManager();\n\t\t$templateMgr->assign('helpTopicId', 'conference.currentConferences.scheduler');\n\t\t$templateMgr->display('manager/scheduler/index.tpl');\n\t}",
"function actionForm()\n\t{\n\t\t$this -> view('form');\n\t}",
"public function openForm() \n\t{\n\t\t$this->sHtml = '<form';\n\t\tif (isset($this->_oForm->method)) {\n\t\t\t$this->sHtml .= ' method=\"' . $this->_oForm->method . '\"';\n\t\t}\n\t\tif (isset($this->_oForm->action)) {\n\t\t\t$this->sHtml .= ' action=\"' . $this->_oForm->action . '\"';\n\t\t}\n\t\tif (isset($this->_oForm->extra) && is_array($this->_oForm->extra)) {\n\t\t\tforeach ($this->_oForm->extra as $sAttribute => $sValue) {\n\t\t\t\t$this->sHtml .= ' ' . $sAttribute = '=\"' . $sValue . '\"';\n\t\t\t}\n\t\t}\n\t\t$this->sHtml .= \">\";\t\n\t\t$this->printCurrentHtml();\t\n\t}",
"public function formNewSistemaPension(){\r\n Obj::run()->View->render();\r\n }",
"protected function _showAppForm() {\n\t\tob_start();\n\t\trequire_once ROOTDIR . '/views/appform.phtml';\n\t\tViewController::setView(ob_get_clean());\n\t}",
"public function formEditAsistenciaManual(){\r\n Obj::run()->View->render();\r\n }",
"function showEditForm()\n{\n global $app;\n\n $tpl = new acmsTemplate($this->templatePath . \"edit_form.tpl\");\n $tpl->assign(\"Action\", \"edit\");\n $tpl->assign(\"ChunkID\", $this->ChunkID);\n $tpl->assign(\"ChunkName\", $this->ChunkName);\n $tpl->assign(\"Chunk\", $this->Chunk);\n $tpl->assign(\"Title\", $this->Title);\n $tpl->assign(\"Perms\", $this->Perms);\n\n $app->addBlock(10, CONTENT_ZONE, \"Edit Menu\", $tpl->get());\n}",
"public function show() {\n\t\trequire_once(WCF_DIR.'lib/acp/form/PackageUpdateAuthForm.class.php');\n\t\tnew PackageUpdateAuthForm($this);\n\t\texit;\n\t}",
"public function openForm()\n {\n $classList = '';\n $attributes = '';\n\n // build classlist\n if ($this->isSubmitted && $this->valid == false) {\n $classList .= ' has-error';\n } elseif ($this->isSubmitted == false) {\n $classList .= ' untouched';\n } elseif ($this->isSubmitted && $this->valid) {\n $classList .= ' is-valid submitted';\n }\n\n // build attribute string\n if ($this->autocomplete == false) {\n $attributes .= ' autocomplete=\"off\"';\n }\n if ($this->novalidate == true) {\n $attributes .= ' novalidate';\n }\n\n // echo sprintf('<form action=\"%1$s\" method=\"%2$s\" name=\"%3$s\" id=\"%3$s\" class=\"%4$s\" %5$s>', $this->action, $this->method, $this->formName, $classList, $attributes);\n echo sprintf('<form enctype=\"multipart/form-data\" action=\"%1$s\" method=\"%2$s\" name=\"%3$s\" id=\"%3$s\" class=\"%4$s\" %5$s>', $this->action, $this->method, $this->formName, $classList, $attributes);\n }",
"public function formAction() {\n\n\t\t$this->_helper->layout()->disableLayout();\n\n\t\t//Recupera os parametros\n\t\t$arDados = $this->_getAllParams();\n\n\t\t$form = $this->getForm($arDados);\n\n\t\t$this->view->form = $form;\n\t\treturn $this->render('form');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replace an existing brand with the supplied values. | public function replaceBrand(string $brand_id, string $name, object $settings, object $snippets = NULL): object
{
$params = array(
'name' => $name,
'settings' => $settings,
'snippets' => $snippets
);
$params = array_filter($params);
return $this->doRequest(
$this->buildRequest("put", "brands/" . $brand_id, $params)
);
} | [
"public function setBrand($newBrand) {\r\n $this->brand = $newBrand;\r\n }",
"public function setBrand($brand);",
"public function testUpdateBrand()\n {\n TestUtil::setupCassette('users/brand.yml');\n\n $user = self::$client->user->retrieveMe();\n\n $color = '#123456';\n\n $brand = self::$client->user->updateBrand(\n $user->id,\n ['color' => $color]\n );\n\n $this->assertInstanceOf('\\EasyPost\\Brand', $brand);\n $this->assertStringMatchesFormat('brd_%s', $brand->id);\n $this->assertEquals($color, $brand->color);\n }",
"public function updateBrand($brand)\n {\n $reference = $brand['reference'];\n $url = \"brands/\".$reference;\n $method = \"PUT\";\n $data = json_encode($brand, JSON_UNESCAPED_UNICODE);\n return $this->sendPostData($url, $method, $data);\n }",
"function BH_gpf_set_brand($elements, $product_id) {\n\t$artists = wp_get_post_terms($product_id, 'artist');\n\n\treset($artists);\n\t$artist = current($artists);\n\n\tif ($artist) {\n\t\t$elements['brand'] = array($artist->name);\n\t}\n\n\treturn $elements;\n}",
"public function setBrand(Brand $brand)\n {\n $this->brand = $brand;\n }",
"function setBrands(array $brands);",
"public function testUpdateBrandUsingPUT()\n {\n }",
"public function brand($brand) {\n $this->_brand = $brand;\n return $this;\n }",
"public function update_brand() {\n $brand_id = $_GET['brand_id'];\n $data['brand'] = $this->brands->get_brand_by_id($brand_id);\n $data['branches'] = $this->brands_location->getBranchById();\n $this->load->view('restaurant/brands/update_brand_model', $data);\n\n if (isset($_POST['update_brand'])) {\n $brandArray = Array(\n 'ar_name' => $this->input->post('brand_ar_name'),\n 'en_name' => $this->input->post('brand_en_name'),\n 'branch_location_id' => $this->input->post('update_branch_location'),\n );\n $this->brands->updateBrandData($brand_id, $brandArray);\n redirect(rest_path('Brand'));\n }\n }",
"public function updated(Brand $marca)\n {\n //\n }",
"public function testUpdateBrandingConfig()\n {\n }",
"function theme_gologo_set_brandlogo($css, $brandlogo) {\n $tag = '[[setting:brandlogo]]';\n $replacement = $brandlogo;\n if (is_null($replacement)) {\n $replacement = '';\n }\n\n $css = str_replace($tag, $replacement, $css);\n\n return $css;\n}",
"public function updateScrapedBrandFromBrandRaw(Request $request)\n {\n $supplierId = $request->id;\n $newBrandData = ($request->newBrandData) ? $request->newBrandData : array();\n\n // Get Supplier model\n $supplier = Supplier::find($supplierId);\n\n // Do we have a result?\n if ($supplier != null) {\n $supplier->scraped_brands = implode(',', $newBrandData);\n $supplier->save();\n\n return response()->json(['success' => 'Supplier brand updated'], 200);\n }\n\n // Still here? Return an error\n return response()->json(['error' => 'Supplier not found'], 403);\n\n }",
"public function updated(Brand $brand)\n {\n\n }",
"public function setCardBrand(?string $cardBrand): void\n {\n $this->cardBrand = $cardBrand;\n }",
"function save_custom_field_brand( $post_id ) {\n $product = wc_get_product( $post_id );\n $details_brand = isset( $_POST['custom_field_brand'] ) ? $_POST['custom_field_brand'] : '';\n $product->update_meta_data( 'custom_field_brand', sanitize_textarea_field( $details_brand ) );\n $product->save();\n}",
"public function setBrand(BrandBean $object = null) {\n $this->setRef('cars_ibfk_1', $object, 'cars');\n }",
"public function testSetBranding()\n {\n $this->expects('branding/', 'POST', ['json' => ['foo' => 'bar']]);\n\n $this->clientMock->branding->setBranding(['foo' => 'bar']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Import an external RSS feed via ajax | public function import_external_rss_feed() {
// @todo add nonces, add user caps check, validate inputs
update_option( 'ssp_rss_import', 0 );
$ssp_external_rss = get_option( 'ssp_external_rss', '' );
if ( empty( $ssp_external_rss ) ) {
$response = array(
'status' => 'error',
'message' => 'No feed to process',
);
wp_send_json( $response );
return;
}
$rss_importer = new Rss_Importer( $ssp_external_rss );
$response = $rss_importer->import_rss_feed();
wp_send_json( $response );
} | [
"function RSS($rssURL){\n\t\tif(substr($rssURL, 0, 4) == 'http'){\n\t\t\t$feed = implode(file($rssURL));\n\t\t\t$xml = simplexml_load_string($feed);\n\t\t\t$json = json_encode($xml);\n\t\t\t// convert the string to a json object\n\t\t\t$jfo = json_decode($json);\n\t\t}\n\t\tif(substr($rssURL, 0, 4) == 'post'){\n\t\t\t$json_file = file_get_contents('posts.json');\n\t\t\t// convert the string to a json object\n\t\t\t$jfo = json_decode($json_file);\n\t\t}\n\t\treturn $jfo;\n\t}",
"function do_feed_rss() {}",
"public function loadRssFeed($url){\n\t\t\theader('content-type: application/xml');\n\t\t\tprint $this->puf->fetch($url);\n\t\t\texit;\n\t\t}",
"public function rssFeedAction()\n {\n $rss = new RssReader('http://www.vg.no/rss/nyfront.php?frontId=1');\n $rss->fetchData();\n $rss->sortDataByDate();\n\n $this->view->articles = $rss->getData();\n }",
"public function importRssAction()\n {\n try {\n $entityManager = $this->getServiceLocator()->get('doctrine.entitymanager.orm_default');\n\n $page = $this->getRequest()->getParams()['page'];\n $file = __DIR__ . '/../../../../../data/RSS/' . $page . '.rss';\n\n if (!file_exists($file)) {\n die('file not found');\n throw new \\Exception(\"File $file not found\");\n }\n\n $rss = Feed::loadRssFile(\"file://$file\");\n\n foreach ($rss->item as $rssItem) {\n $identifier = substr($rssItem->guid, 28);\n $item = $entityManager->getRepository('Db\\Entity\\Item')->findOneBy(array(\n 'guid' => $identifier,\n ));\n\n if ($item) continue;\n\n $category = $entityManager->getRepository('Db\\Entity\\Category')->findOneBy(array(\n 'name' => $rssItem->category\n ));\n\n if (!$category) {\n $category = new CategoryEntity;\n $category->setName($rssItem->category);\n $entityManager->persist($category);\n }\n\n $item = new ItemEntity;\n $item->setGuid(substr($rssItem->guid, 28));\n $item->setTitle($rssItem->title);\n $item->setDescription($rssItem->description);\n $item->setLink($rssItem->link);\n $item->setCategory($category);\n $pubDate = date_create_from_format('D, d M Y H:i:s O', $rssItem->pubDate);\n if ($pubDate instanceof \\DateTime) {\n $item->setPubDate($pubDate);\n }\n\n $http = new Client();\n $request = new Request();\n\n $identifier = substr($rssItem->guid, 28);\n $request->setUri(\"http://www.archive.org/services/find_file.php?file=$identifier\");\n $request->setMethod(Request::METHOD_GET);\n\n try {\n $response = $http->dispatch($request);\n $dir = substr($http->getUri()->getQuery(), 4);\n $url = 'https://' . $http->getUri()->getHost() . $dir;\n $item->setUrl($url);\n } catch (\\Exception $e) {\n# Instead of logging misses run\n# error_log(\"$identifier\\n\", 3, __DIR__ . '/../../../../../data/Log/find-file-fail.log');\n }\n\n $entityManager->persist($item);\n\n // Import Keywords\n $node = \"media:keywords\";\n if ($rssItem->$node) {\n foreach (explode(',', $rssItem->$node) as $rssKeyword) {\n $keyword = $entityManager->getRepository('Db\\Entity\\Keyword')->findOneBy(array(\n 'name' => trim($rssKeyword)\n ));\n\n if (!$keyword) {\n $keyword = new KeywordEntity;\n $keyword->setName(trim($rssKeyword));\n $entityManager->persist($keyword);\n }\n\n $itemToKeyword = new ItemToKeywordEntity;\n $itemToKeyword->setItem($item);\n $itemToKeyword->setKeyword($keyword);\n $entityManager->persist($itemToKeyword);\n }\n }\n\n // Import Enclosures\n foreach ($rssItem->enclosure as $rssEnclosure) {\n $enclosure = new EnclosureEntity;\n foreach($rssEnclosure->attributes() as $name => $value) {\n switch($name) {\n case 'url':\n $enclosure->setUrl($value);\n break;\n case 'length':\n $enclosure->setLength($value);\n break;\n case 'type':\n $enclosureType = $entityManager->getRepository('Db\\Entity\\EnclosureType')->findOneBy(array(\n 'name' => $value\n ));\n if (!$enclosureType) {\n $enclosureType = new EnclosureTypeEntity();\n $enclosureType->setName($value);\n $entityManager->persist($enclosureType);\n }\n\n $enclosure->setEnclosureType($enclosureType);\n break;\n default:\n break;\n }\n\n $enclosure->setItem($item);\n $entityManager->persist($enclosure);\n\n }\n }\n\n $entityManager->flush();\n echo $rssItem->title . \"\\n\";\n }\n\n } catch (\\Exception $e) {\n die($e->getMessage());\n }\n\n return \"\\nFinished $file\\n\";\n\n }",
"public function loadFeed()\n\t{\n\t\t$this->feed = simplexml_load_file($this->feed_url);\n\t}",
"function importEventbriteRssFeed( $feed = FEED_URL, $id = EB_USERID ) {\n\n\tif ( checkEventbriteFeedAddressIsValid() == true ) {\n\n\t\t$event_feed = simplexml_load_file( $feed . $id, 'SimpleXMLElement', LIBXML_NOCDATA);\n\n\t\treturn $event_feed;\n\t}\n}",
"private function load_feed()\n\t{\n\t\t$this->debug_log .= \"load_feed()\\n\";\n\t\treturn ($this->raw_xml = simpleraw_xml_load_file($this->feed_url));\n\t}",
"public function fetchFeed(){\n\n $this->xmlDoc = new \\DOMDocument();\n $this->xmlDoc->load($this->feedUrl);\n $this->feedXML = $this->xmlDoc->saveXML(); \n }",
"protected function _importRssValid($filename)\n {\n $response = new Zend_Http_Response(200, [], file_get_contents(\"$this->_feedDir/$filename\"));\n $this->_adapter->setResponse($response);\n\n $feed = Zend_Feed::import('http://localhost');\n $this->assertTrue($feed instanceof Zend_Feed_Rss);\n return $feed;\n }",
"private function _loadFeed($url)\n {\n try {\n // get the erfurt cache via ontowiki bootstrap\n $cache\t= clone OntoWiki::getInstance()->getCache();\n\n // this uses 304 http codes to speed up retrieval\n Zend_Feed_Reader::useHttpConditionalGet();\n\n // set lifetime for cached XML documents\n if (isset($this->_privateConfig->cachelifetime)) {\n $lifetime = (int)$this->_privateConfig->cachelifetime;\n } else {\n $lifetime = 86400; // default lifetime is one day\n }\n $cache->setLifetime($lifetime);\n\n // add cache support to feed reader, short version: reuse erfurt cache\n // http://framework.zend.com/manual/en/zend.feed.reader.html#zend.feed.reader.cache-request.cache\n Zend_Feed_Reader::setCache($cache);\n\n // look for cached feed to avoid unneeded traffic\n $cacheKey = 'Zend_Feed_Reader_' . md5($url);\n $cachedXml = $cache->load($cacheKey);\n\n if ($cachedXml != false) {\n // use the cached XML\n $feed = Zend_Feed_Reader::importString($cachedXml);\n } else {\n // try to load the feed from uri whithout cache support\n $feed = Zend_Feed_Reader::import($url);\n }\n\n } catch (Exception $e) {\n // feed import failed\n return;\n }\n\n // collect entries of the feed\n foreach ($feed as $entry) {\n $newEntry = array (\n 'title' => $entry->getTitle(),\n 'description' => $entry->getDescription(),\n 'dateModified' => $entry->getDateModified(),\n 'authors' => $entry->getAuthors(),\n 'link' => $entry->getLink(),\n 'content' => $entry->getContent()\n );\n $this->_entries[$entry->getLink()] = $newEntry;\n }\n }",
"public function read_rss(){\n\n\t\t\t$curl = curl_init();\n\t\t\tcurl_setopt ($curl,CURLOPT_URL,\"http://www.lepoint.fr/rss.xml\");\n\t\t\tcurl_setopt ($curl,CURLOPT_RETURNTRANSFER,true);\n\n\t\t\t$content = curl_exec($curl);\n\t\t\t//$content = simplexml_load_file(\"http://www.lepoint.fr/rss.xml\");\n\t\t\t$xml = new simpleXMLELEMENT($content);\n\t\t\t//echo '<pre>';var_dump($xml);die('xxxx');\n\t\t\techo('<ul>');\n\t\t\tforeach($xml->channel->item as $val){\n\t\t\t\techo('<li>'.$val->title.'<p>'.$val->description.'</p></li>');\n\t\t\t}\n\t\t\techo('</ul>');\n\t\t//\t$this->load->view('onglet_vw',$data);\n\t}",
"function load_feed_xml($url)\r\n{\r\n\t$feed = new SimplePie();\r\n\t$feed->set_feed_url($url);\r\n\t$feed->init();\r\n\t$feed->handle_content_type();\r\n\t$feed->set_cache_location($GLOBALS['root_path'] . '/cache');\r\n\t\r\n\treturn $feed;\r\n}",
"public function feedAction()\n {\n // get published articles\n $articles = $this\n ->get('cms.article.repository')\n ->findPublished();\n\n // convert to feed item\n $items = $this\n ->get('jk.cms.feed.article_item_factory')\n ->create($articles);\n\n // create feed\n $feed = $this\n ->get('eko_feed.feed.manager')\n ->get('article');\n\n // add loaded articles to the feed\n $feed->addFromArray($items);\n\n // return xml response\n return new Response($feed->render('rss'));\n }",
"private function getRssUrlContent(){\n\t\treturn file_get_contents($this->rss_url);\n\t}",
"public function get_articles( )\r\n\t\t{\r\n\t\t\t$feed_settings = $this->get_feed_settings(); \r\n\r\n\t\t\tif ( isset( $_FILES['brafton-archive']['tmp_name'] ) ) //todo add archive file upload settings\r\n\t\t\t{\r\n\t\t\t\tbrafton_log( array( 'message' => \"Archive option selected. Importing articles from xml archive file.\" ) );\r\n\t\t\t\t$articles = NewsItem::getNewsList( $_FILES['brafton-archive']['tmp_name'], \"html\" );\r\n\t\t\t} \r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tif ( preg_match( \"/\\.xml$/\", $feed_settings['api_key'] ) ){\r\n\t\t\t\t\t$articles = NewsItem::getNewsList( $feed_settings['api_key'], 'news' );\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$url = 'http://' . $feed_settings['api_url'];\r\n\t\t\t\t\t$ApiHandler = new ApiHandler( $feed_settings['api_key'], $url );\r\n\t\t\t\t\t$articles = $ApiHandler->getNewsHTML(); \t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn $articles; \r\n\t\t}",
"function fetchfeed(){\nglobal $rssurl, $localfile;\n$contents=file_get_contents($rssurl); //fetch RSS feed\n$fp=fopen($localfile, \"w\");\nfwrite($fp, $contents); //write contents of feed to cache file\nfclose($fp);\n}",
"function addFeed($feed,$url,$return=true);",
"static function importFeedEntries(RDR_Feed $feed){\n ini_set(\"default_socket_timeout\", 5);\n RDR_Event::log(RDR_Event::TYPE_FEED_UPDATE_START, array(\"feed\" => $feed));\n $xml = self::getSimpleXMLFromUrl($feed->url);\n if(!$xml) return RDR_Event::$lastEvent;\n $count = 0;\n $rss = $xml->xpath(\"/rss\");\n if($rss){\n $rss = reset($rss);\n switch(self::xmlAttr($rss, \"version\")){\n default:\n $items = $xml->xpath(\"/rss/channel/item\");\n foreach($items as $item) if(self::createEntryForItem($item, $feed)) $count++;\n return RDR_Event::log(RDR_Event::TYPE_FEED_UPDATE_END, array(\"int\" => $count, \"feed\" => $feed));\n break;\n }\n }\n if(isset($xml->entry)){\n foreach($xml->entry as $item) if(self::createEntryForItem($item, $feed)) $count++;\n return RDR_Event::log(RDR_Event::TYPE_FEED_UPDATE_END, array(\"int\" => $count, \"feed\" => $feed));\n }\n if(isset($xml->item)){\n foreach($xml->item as $item) if(self::createEntryForItem($item, $feed)) $count++;\n return RDR_Event::log(RDR_Event::TYPE_FEED_UPDATE_END, array(\"int\" => $count, \"feed\" => $feed));\n }\n return RDR_Event::log(RDR_Event::TYPE_MISSING_PARSER, array(\"feed\" => $feed));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Are we on the main blog ID (first site)? | public function is_main_blog() {
return ( get_current_blog_id() === $this->get_main_blog_id() );
} | [
"function test_current_blog_id_is_main_site() {\n\t\t\t$this->assertTrue( is_main_site( get_current_blog_id() ) );\n\t\t}",
"function is_current_blog( $blog_id ) {\n\t\t$default = defined( 'BLOG_ID_CURRENT_SITE' ) ? BLOG_ID_CURRENT_SITE : 1;\n\n\t\tif ( $default === $blog_id ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"function is_current_blog( $blog_id ) {\n\t\t$default = defined( 'BLOG_ID_CURRENT_SITE' ) ? BLOG_ID_CURRENT_SITE : 1;\n\n\t\tif ( $default === (int) $blog_id ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"private function is_current_blog( $blog_id ) {\n\t\t\t$default = defined( 'BLOG_ID_CURRENT_SITE' ) ? BLOG_ID_CURRENT_SITE : 1;\n\n\t\t\tif ( $default === $blog_id ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}",
"public static function isBlog() {\n\t\treturn \n\t\t\t\t(empty(self::$request) && empty(Config::$blogURI)) ||\n\t\t\t\t(isset(self::$request[0]) && is_numeric(self::$request[0]) && empty(self::$request[1]) && empty(Config::$blogURI)) || \n\t\t\t\t(!empty(self::$request) && self::$request[0] == Config::$blogURI);\n\t}",
"protected function is_primary_blog( $user_id = 0 ) {\n\t\t$user_id = (int) $user_id;\n\t\n\t\tif ( ! $user_id ) {\n\t\t\t$user_id = get_current_user_id();\n\t\t}\n\t\t\n\t\treturn get_user_meta( $user_id, 'primary_blog', true ) == get_current_blog_id();\n\t}",
"function aecom_is_local_post( $post_id = false ) {\n if ( ! $post_id ) {\n global $post;\n $post_id = $post->ID;\n }\n\n $post_sites = array_map( 'intval', aecom_get_post_meta_all( $post_id, 'sites' ) );\n return in_array( get_current_blog_id(), $post_sites );\n}",
"function is_on_main_website(): bool {\r\n if (empty($this->website_pid)) return false;\r\n return $this->get_website()->main;\r\n }",
"public static function buddypress_site_check() {\n\t\tglobal $blog_id;\n\n\t\tif( !function_exists( 'bp_get_root_blog_id' ) )\n\t\t\treturn false;\n\n\t\tif( $blog_id != bp_get_root_blog_id() )\n\t\t\treturn false;\n\t\t\n\t\treturn true;\n\t}",
"function admission_get_main_site_id() {\n\t// The primary domain can be filtered for local development.\n\t$home_domain = apply_filters( 'admission_home_domain', 'admission.wsu.edu' );\n\n\t$site = get_blog_details( array( 'domain' => $home_domain, 'path' => '/' ) );\n\n\tif ( $site ) {\n\t\treturn $site->blog_id;\n\t}\n\n\treturn get_current_blog_id();\n}",
"public function getIsMainPage()\n {\n\t\treturn Y::app()->controller->id === 'site'\n\t\t\t&& Y::app()->controller->action->id === 'index';\n\t}",
"private static function is_viewing_liveblog_post() {\n\t\treturn (bool) ( is_single() && self::is_liveblog_post() );\n\t}",
"function IsBlogInRoot() {\n\t\t\t$blogURL = get_bloginfo('home');\n\t\t\t$urlInfo = parse_url($blogURL);\n\t\t\treturn (empty($urlInfo['path']) || $urlInfo['path']=='/');\n\t\t}",
"function choose_primary_blog()\n {\n }",
"public function have_next_blog(){\n\t\treturn !empty($this->next_blog);\n\t}",
"function isMediaSite(): bool\n{\n return ( getSideId() === (int) $GLOBALS['current_blog']->blog_id );\n}",
"function auxin_is_blog(){\n // get the slug of page template\n $page_template_slug = is_page_template() ? get_page_template_slug( get_queried_object_id() ) : '';\n // whether the current page is a blog page template or not\n $is_blog_template = ! empty( $page_template_slug ) && false !== strpos( $page_template_slug, 'blog-type' );\n\n if( ( $is_blog_template || ( is_home() && !is_paged() ) || ( is_home() && !is_front_page() ) || ( !is_category() && !is_paged() && !is_tag() && !is_author() && is_archive() && !is_date() ) ) ) {\n return true;\n }\n return false;\n}",
"function bpb_extended_get_current_blog_id() {\n\t$current_blog = bpb_extended_current_blog();\n\n\tif ( ! empty( $current_blog->id ) ) {\n\t\treturn $current_blog->id;\n\t} else {\n\t\treturn false;\n\t}\n}",
"function aecom_get_uni_blog_id() {\n if ( function_exists( 'urs_content_get_uni_blog_id' ) ) {\n return urs_content_get_uni_blog_id();\n }\n return false;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks pfz_related products on recalculation | function fn_check_calculated_pfz_related_products(&$cart, &$cart_products, $auth)
{
if (!empty($cart['products'])) {
foreach ($cart['products'] as $key => $entry) {
if (!empty($entry['product_id'])) {
$ids = fn_get_required_products_ids($entry['product_id']);
if (!empty($ids)) {
$have = fn_required_products_get_existent($auth, $ids, $cart);
if (empty($have) || count($have) != count($ids)) {
if (empty($entry['extra']['parent'])) {
$cart['amount'] -= $entry['amount'];
}
unset($cart['products'][$key]);
unset($cart_products[$key]);
if (isset($cart['product_groups'])) {
foreach ($cart['product_groups'] as $key_group => $group) {
if (in_array($key, array_keys($group['products']))) {
unset($cart['product_groups'][$key_group]['products'][$key]);
}
}
}
fn_check_calculated_required_products($cart, $cart_products, $auth);
}
}
}
}
}
return true;
} | [
"function fn_recurring_billing_update_cart_products_post(&$cart, &$product_data, &$auth)\n{\n if (is_array($cart['products'])) {\n foreach ($product_data as $k => $v) {\n if (isset($cart['products'][$k]['extra']['recurring_plan_id'])) {\n $cart['products'][$k]['extra']['recurring_force_calculate'] = true;\n }\n }\n }\n\n return true;\n}",
"function fn_cp_direct_payments_promotion_apply_before_get_promotions(\n $zone,\n $data,\n $auth,\n $cart_products,\n &$promotions,\n $applied_promotions\n)\n{\n static $cache = array();\n\n if (!empty($data['company_id'])) {\n $company_id = $data['company_id'];\n /** @var \\Tygh\\Addons\\CpDirectPayments\\Cart\\Service $cart_service */\n $cart_service = Tygh::$app['addons.cp_direct_payments.cart.service'];\n $cart_service->setRuntimeVendorId($company_id);\n } else {\n $company_id = Registry::get('runtime.cp_direct_payments.cart.vendor_id');\n }\n\n foreach ($promotions as $zone => $zone_promotions) {\n foreach ($zone_promotions as $promotion_id => $promotion) {\n $cache[$promotion['company_id']][$zone][$promotion_id] = $promotion;\n }\n }\n\n if (isset($cache[$company_id][$zone])) {\n $promotions[$zone] = $cache[$company_id][$zone];\n } else {\n unset($promotions[$zone]);\n }\n}",
"static function recalculate_numbersold(){\n\t\t$ps = singleton('Product');\n\t\t$q = $ps->buildSQL(\"\\\"Product\\\".\\\"AllowPurchase\\\" = 1\");\n\t\t$select = $q->select;\n\n\t\t$select['NewNumberSold'] = self::$number_sold_calculation_type.\"(\\\"OrderItem\\\".\\\"Quantity\\\") AS \\\"NewNumberSold\\\"\";\n\n\t\t$q->select($select);\n\t\t$q->groupby(\"\\\"Product\\\".\\\"ID\\\"\");\n\t\t$q->orderby(\"\\\"NewNumberSold\\\" DESC\");\n\n\t\t$q->leftJoin('Product_OrderItem','\"Product\".\"ID\" = \"Product_OrderItem\".\"ProductID\"');\n\t\t$q->leftJoin('OrderItem','\"Product_OrderItem\".\"ID\" = \"OrderItem\".\"ID\"');\n\t\t$records = $q->execute();\n\t\t$productssold = $ps->buildDataObjectSet($records, \"DataObjectSet\", $q, 'Product');\n\n\t\t//TODO: this could be done faster with an UPDATE query (SQLQuery doesn't support this yet @11/06/2010)\n\t\tforeach($productssold as $product){\n\t\t\tif($product->NewNumberSold != $product->NumberSold){\n\t\t\t\t$product->NumberSold = $product->NewNumberSold;\n\t\t\t\t$product->writeToStage('Stage');\n\t\t\t\t$product->publish('Stage', 'Live');\n\t\t\t}\n\t\t}\n\n\t}",
"private function needs_calculation() {\n\n\t\t$needs_calculation = (\n\t\t\tdoing_action( 'wc_ajax_update_order_review' ) ||\n\t\t\tdoing_action( 'wp_ajax_woocommerce_update_order_review' ) ||\n\t\t\tdoing_action( 'wp_ajax_nopriv_woocommerce_update_order_review' ) ||\n\t\t\tWC()->session->get( 'reload_checkout' ) ||\n\t\t\tisset( $_POST['woocommerce_checkout_update_totals'] )\n\t\t);\n\n\t\t/**\n\t\t * Filter whether the cart needs new taxes calculated.\n\t\t *\n\t\t * @since 1.0.0\n\t\t * @param $needs_calculation Whether the cart needs new taxes calculated.\n\t\t */\n\t\treturn (bool) apply_filters( 'wc_avatax_cart_needs_calculation', $needs_calculation );\n\t}",
"private function set_by_calculation(array $products) {\n$discount_rate = 0;\n$enrollment_kit_handler = null;\ntry {\n $enrollment_kit_handler = new kit_handler($this->kit_product_id, 1, array( 'country_id' => $this->country_id,\n\t\t\t\t\t\t\t\t\t\t'order_type_id' => $this->order_type_id,\n\t\t\t\t\t\t\t\t\t\t'promo_id' => $this->promo_id,\n\t\t\t\t\t\t\t\t\t\t'resend_fee' => $this->resend_fee,\n\t\t\t\t\t\t\t\t\t\t'volume_cap' => $this->volume_cap, \n\t\t\t\t\t\t\t\t\t\t'rank_volume_cap' => $this->rank_volume_cap,\n\t\t\t\t\t\t\t\t\t\t'discount_rate' => 0,\n\t\t\t\t\t\t\t\t\t\t'show_values' => $this->show_values));\n $this->volume_cap = $enrollment_kit_handler->get_kit_definition()->volume_cap;\n //$this->rank_volume_cap = product::get_rank_volume($this->kit_product_id);\n $discount_rate = $enrollment_kit_handler->get_kit_definition()->discount_rate;\n $products = $enrollment_kit_handler->pre_process_products($products);\n foreach ($enrollment_kit_handler->get_child_products() as $kit_order_product) {\n\t$this->add($kit_order_product);\n }\n $this->add($enrollment_kit_handler->get_kit_product()->get_unmodified_fields());\n} catch (kit_handler_exception $e) { $this->kit_product_id = NULL; }\n\n $order_meta_data = array( \n\t'country_id' => $this->country_id,\n\t'order_type_id' => $this->order_type_id,\n\t'promo_id' => $this->promo_id,\n\t'resend_fee' => $this->resend_fee,\n\t'volume_cap' => $this->volume_cap, \n\t'rank_volume_cap' => $this->rank_volume_cap,\n\t'discount_rate' => $discount_rate,\n\t'show_values' => $this->show_values,\n\t'currency_id' => $this->currency_id,\n\t'enrollment_kit_product_id' => $this->kit_product_id);\n foreach ($products as $product_id => $product_quantity) {\n settype($product_quantity, 'int');\n settype($product_id, 'int');\n if (0 >= $product_quantity) {\n continue;\n }\n\n try {\n $kit_product = new kit_handler($product_id, $product_quantity, $order_meta_data);\n\t\tif ($this->add_prevented_products || (! product::prevent_ordering($product_id, $this->order_type_id, $kit_product->get_kit_product()->product_id))) {\n\t\t $this->add($kit_product->get_kit_product()->get_unmodified_fields());\n\t\t foreach ($kit_product->get_child_products() as $kit_order_product) {\n\t\t\t$this->add($kit_order_product);\n\t\t }\n\t\t}\n } catch (kit_handler_exception $e) {\n $this->add_by_id($product_id, $product_quantity, $discount_rate);\n }\n }\n\t\n\tif (null !== $this->kit_product_id) {\n\t $kit_discount = new kit_discount();\n\t $total_cv = 0;\n\t $total_rank_cv = 0;\n\t foreach ($this->records as $order_product) {\n\t\t$total_cv += ($order_product->volume * $order_product->quantity);\n\t\t$total_rank_cv += ($order_product->rank_volume * $order_product->quantity);\n\t }\n\t $kit_discount->load_by_kit_product_cv($this->kit_product_id, $total_cv);\n\t if (is_numeric($kit_discount->rate)) {\n\t\tforeach ($this->records as $order_product) {\n\t\t if (!(($this->kit_product_id == $order_product->product_id) || (product::is_pack_kit($order_product->product_id)) || (product::is_pack_kit($order_product->kit_parent_id)) || (0 >= $order_product->volume))) {\n\t\t\t$order_product->discount_amount = round(($order_product->amount * $kit_discount->rate), 2);\n\t\t\t$order_product->amount -= $order_product->discount_amount;\n\t\t }\n\t\t}\n\t }\n\t}\n }",
"public function recalcPU() {\n\n $this->annualized_premium_usd = $this->calculateAPU();\n\n if (!$this->annualized_premium_usd) {\n return FALSE;\n }\n // Calculate PU\n// $pu = new CalculatePU();\n// // Set necessary parameters to PUFormula class\n// $pu->input_policy_term_year = $this->policy_term_year;\n// $pu->input_payment_term_year = $this->payment_term_year; // ignore payment_term_month 2016-2-22 H\n// $pu->input_app_rece_date = $this->app_rece_date;\n// $pu->input_acc_date = $this->acc_date;\n// $pu->idproduct = $this->idproduct;\n// $pu->idproduct_cat = $this->product->idproduct_cat;\n// $pu->idprovider = $this->idprovider;\n// $pu->input_whole_life = $this->whole_life;\n// $pu->input_whole_life_payment = $this->whole_life_payment;\n// if ($this->regular_premium > 0) {\n// $pu->input_regular_premium = $this->annualizeUSD($this->regular_premium, $this->plan_currency, $this->payment_fqy, 2); // to USD\n// }\n// if ($this->investment_amount > 0) {\n// $pu->input_investment_amount = $this->annualizeUSD($this->investment_amount, $this->plan_currency, $this->payment_fqy, 2); // to USD\n// }\n// if ($this->loading_amount > 0) {\n// $pu->input_loading_amount = $this->annualizeUSD($this->loading_amount, $this->plan_currency, $this->payment_fqy, 2); // to USD\n// }\n// if ($this->target_premium > 0) {\n// $pu->input_target_premium = $this->annualizeUSD($this->target_premium, $this->plan_currency, $this->payment_fqy, 2); // to USD\n// }\n// if ($this->excess_premium > 0) {\n// $pu->input_excess_premium = $this->annualizeUSD($this->excess_premium, $this->plan_currency, $this->payment_fqy, 2); // to USD\n// }\n// $pu->getFactorizedPU();\n// if ($pu->final_pu < 0)\n// return FALSE;\n// // assign newly calculated PU to class\n// $this->production_unit = $pu->final_pu;\n// $this->idpu_formula = $pu->id;\n// $this->factor = $pu->totalFactor;\n//\n// /* if transfer in=1, set all EXCEPT APU to zero */\n// if ($this->transfer_in == 1) {\n// $this->production_unit = 0;\n// $this->net_production_unit = 0;\n// $this->idpu_formula = 0;\n// $this->factor = 0;\n// }\n\n return $this->save();\n }",
"public function recalculateAmounts(){\n \n// $total_price_without_tax = $this->total_price_without_tax;\n \n// if(!$this->total_price_without_tax){\n //Calculate it from products total price\n $this->total_price_without_tax = 0;\n $this->total_tax = 0;\n foreach($this->products as $product){\n $this->total_price_without_tax += $product->total_price - $product->total_tax;\n $this->total_tax += $product->total_tax;\n }\n// }\n \n //calculate Taxes\n \n// $this->tax_igst_amount = 0;\n// $this->tax_cgst_amount = 0;\n// $this->tax_sgst_amount = 0;\n \n \n// //iGST\n// if($this->tax_igst){\n// $this->tax_igst_amount = ($this->total_price_without_tax * $this->tax_igst) / 100;\n// }\n// \n// //cGST\n// if($this->tax_cgst){\n// $this->tax_cgst_amount = ($this->total_price_without_tax * $this->tax_cgst) / 100;\n// }\n// \n// //sGST\n// if($this->tax_sgst){\n// $this->tax_sgst_amount = ($this->total_price_without_tax * $this->tax_sgst) / 100;\n// }\n \n// $this->total_tax = $this->tax_igst_amount + $this->tax_cgst_amount + $this->tax_sgst_amount;\n $this->total_price = $this->total_tax + $this->total_price_without_tax;\n \n //iGST\n \n $this->tax_igst_amount = $this->total_tax;\n \n \n //cGST\n \n $this->tax_cgst_amount = $this->total_tax / 2;\n \n \n //sGST\n \n $this->tax_sgst_amount = $this->total_tax / 2;\n \n \n \n //finally save it\n $this->save();\n }",
"public function checkProductsList() {\n if (!is_array($this->products) || !count($this->products)) {\n $this->logger->info(\"No \".$this->type.\" found in DST.\");\n }\n $this->logger->info(\"Checking products List\");\n foreach ($this->products as $sku => $product) {\n $errors = $this->pimhelper->check_one_reference($this->type, $product->getData());\n if ($errors > 0) {\n $this->logger->info($errors.\" Fields are missing in product : \".$sku);\n die;\n }\n }\n $this->logger->info(\"Fields were created in every products\");\n return true;\n }",
"public function ajax_product_form_recalculate_charges() {\r\n if ( isset( $_POST[ \"wpf_data\" ] ) && isset( $_POST[ \"wpf_field_values\" ] ) ) {\r\n $field_values = array_map( 'sanitize_text_field', $_POST[ \"wpf_field_values\" ] );\r\n $charges = 0;\r\n $charge_types = apply_filters( 'wpf_charge_types', array() );\r\n foreach ( $_POST[ \"wpf_data\" ] as $name => $item ) {\r\n $name = sanitize_text_field( $name );\r\n $item = array_map( 'sanitize_text_field', $item );\r\n $charge = apply_filters( 'wpf_charge_alter', $item['charge'], $item['value'], $name, $field_values, false, 0 );\r\n $charge = wpf_calculate_callback_execute( $charge, $item['value'], $item['charge_type'] );\r\n $charges += $charge;\r\n }\r\n wp_send_json( array( 'status' => true, 'charges' => $charges ) );\r\n wp_die();\r\n }\r\n wp_send_json( array( 'status' => true, 'charges' => 0 ) );\r\n wp_die();\r\n }",
"function zen_get_discount_calc($product_id, $attributes_id = false, $attributes_amount = false, $check_qty= false) {\n global $discount_type_id, $sale_maker_discount;\n global $cart;\n\n // no charge\n if ($attributes_id > 0 and $attributes_amount == 0) {\n return 0;\n }\n\n $new_products_price = zen_get_products_base_price($product_id);\n $new_special_price = zen_get_products_special_price($product_id, true);\n $new_sale_price = zen_get_products_special_price($product_id, false);\n\n $discount_type_id = zen_get_products_sale_discount_type($product_id);\n\n if ($new_products_price != 0) {\n $special_price_discount = ($new_special_price != 0 ? ($new_special_price/$new_products_price) : 1);\n } else {\n $special_price_discount = '';\n }\n $sale_maker_discount = zen_get_products_sale_discount_type($product_id, '', 'amount');\n\n // percentage adjustment of discount\n if (($discount_type_id == 120 or $discount_type_id == 1209) or ($discount_type_id == 110 or $discount_type_id == 1109)) {\n $sale_maker_discount = ($sale_maker_discount != 0 ? (100 - $sale_maker_discount)/100 : 1);\n }\n\n $qty = $check_qty;\n\n// fix here\n// BOF: percentage discounts apply to price\n switch (true) {\n case (zen_get_discount_qty($product_id, $qty) and !$attributes_id):\n // discount quanties exist and this is not an attribute\n // $this->contents[$products_id]['qty']\n $check_discount_qty_price = zen_get_products_discount_price_qty($product_id, $qty, $attributes_amount);\n//echo 'How much 1 ' . $qty . ' : ' . $attributes_amount . ' vs ' . $check_discount_qty_price . '<br />';\n return $check_discount_qty_price;\n break;\n\n case (zen_get_discount_qty($product_id, $qty) and zen_get_products_price_is_priced_by_attributes($product_id)):\n // discount quanties exist and this is not an attribute\n // $this->contents[$products_id]['qty']\n $check_discount_qty_price = zen_get_products_discount_price_qty($product_id, $qty, $attributes_amount);\n//echo 'How much 2 ' . $qty . ' : ' . $attributes_amount . ' vs ' . $check_discount_qty_price . '<br />';\n\n return $check_discount_qty_price;\n break;\n\n case ($discount_type_id == 5):\n // No Sale and No Special\n// $sale_maker_discount = 1;\n if (!$attributes_id) {\n $sale_maker_discount = $sale_maker_discount;\n } else {\n // compute attribute amount\n if ($attributes_amount != 0) {\n if ($special_price_discount != 0) {\n $calc = ($attributes_amount * $special_price_discount);\n } else {\n $calc = $attributes_amount;\n }\n\n $sale_maker_discount = $calc;\n } else {\n $sale_maker_discount = $sale_maker_discount;\n }\n }\n//echo 'How much 3 - ' . $qty . ' : ' . $product_id . ' : ' . $qty . ' x ' . $attributes_amount . ' vs ' . $check_discount_qty_price . ' - ' . $sale_maker_discount . '<br />';\n break;\n case ($discount_type_id == 59):\n // No Sale and Special\n// $sale_maker_discount = $special_price_discount;\n if (!$attributes_id) {\n $sale_maker_discount = $sale_maker_discount;\n } else {\n // compute attribute amount\n if ($attributes_amount != 0) {\n $calc = ($attributes_amount * $special_price_discount);\n $sale_maker_discount = $calc;\n } else {\n $sale_maker_discount = $sale_maker_discount;\n }\n }\n break;\n// EOF: percentage discount apply to price\n\n// BOF: percentage discounts apply to Sale\n case ($discount_type_id == 120):\n // percentage discount Sale and Special without a special\n if (!$attributes_id) {\n $sale_maker_discount = $sale_maker_discount;\n } else {\n // compute attribute amount\n if ($attributes_amount != 0) {\n $calc = ($attributes_amount * $sale_maker_discount);\n $sale_maker_discount = $calc;\n } else {\n $sale_maker_discount = $sale_maker_discount;\n }\n }\n break;\n case ($discount_type_id == 1209):\n // percentage discount on Sale and Special with a special\n if (!$attributes_id) {\n $sale_maker_discount = $sale_maker_discount;\n } else {\n // compute attribute amount\n if ($attributes_amount != 0) {\n $calc = ($attributes_amount * $special_price_discount);\n $calc2 = $calc - ($calc * $sale_maker_discount);\n $sale_maker_discount = $calc - $calc2;\n } else {\n $sale_maker_discount = $sale_maker_discount;\n }\n }\n break;\n// EOF: percentage discounts apply to Sale\n\n// BOF: percentage discounts skip specials\n case ($discount_type_id == 110):\n // percentage discount Sale and Special without a special\n if (!$attributes_id) {\n $sale_maker_discount = $sale_maker_discount;\n } else {\n // compute attribute amount\n if ($attributes_amount != 0) {\n $calc = ($attributes_amount * $sale_maker_discount);\n $sale_maker_discount = $calc;\n } else {\n// $sale_maker_discount = $sale_maker_discount;\n if ($attributes_amount != 0) {\n// $calc = ($attributes_amount * $special_price_discount);\n// $calc2 = $calc - ($calc * $sale_maker_discount);\n// $sale_maker_discount = $calc - $calc2;\n $calc = $attributes_amount - ($attributes_amount * $sale_maker_discount);\n $sale_maker_discount = $calc;\n } else {\n $sale_maker_discount = $sale_maker_discount;\n }\n }\n }\n break;\n case ($discount_type_id == 1109):\n // percentage discount on Sale and Special with a special\n if (!$attributes_id) {\n $sale_maker_discount = $sale_maker_discount;\n } else {\n // compute attribute amount\n if ($attributes_amount != 0) {\n $calc = ($attributes_amount * $special_price_discount);\n// $calc2 = $calc - ($calc * $sale_maker_discount);\n// $sale_maker_discount = $calc - $calc2;\n $sale_maker_discount = $calc;\n } else {\n $sale_maker_discount = $sale_maker_discount;\n }\n }\n break;\n// EOF: percentage discounts skip specials\n\n// BOF: flat amount discounts\n case ($discount_type_id == 20):\n // flat amount discount Sale and Special without a special\n if (!$attributes_id) {\n $sale_maker_discount = $sale_maker_discount;\n } else {\n // compute attribute amount\n if ($attributes_amount != 0) {\n $calc = ($attributes_amount - $sale_maker_discount);\n $sale_maker_discount = $calc;\n } else {\n $sale_maker_discount = $sale_maker_discount;\n }\n }\n break;\n case ($discount_type_id == 209):\n // flat amount discount on Sale and Special with a special\n if (!$attributes_id) {\n $sale_maker_discount = $sale_maker_discount;\n } else {\n // compute attribute amount\n if ($attributes_amount != 0) {\n $calc = ($attributes_amount * $special_price_discount);\n $calc2 = ($calc - $sale_maker_discount);\n $sale_maker_discount = $calc2;\n } else {\n $sale_maker_discount = $sale_maker_discount;\n }\n }\n break;\n// EOF: flat amount discounts\n\n// BOF: flat amount discounts Skip Special\n case ($discount_type_id == 10):\n // flat amount discount Sale and Special without a special\n if (!$attributes_id) {\n $sale_maker_discount = $sale_maker_discount;\n } else {\n // compute attribute amount\n if ($attributes_amount != 0) {\n $calc = ($attributes_amount - $sale_maker_discount);\n $sale_maker_discount = $calc;\n } else {\n $sale_maker_discount = $sale_maker_discount;\n }\n }\n break;\n case ($discount_type_id == 109):\n // flat amount discount on Sale and Special with a special\n if (!$attributes_id) {\n $sale_maker_discount = 1;\n } else {\n // compute attribute amount based on Special\n if ($attributes_amount != 0) {\n $calc = ($attributes_amount * $special_price_discount);\n $sale_maker_discount = $calc;\n } else {\n $sale_maker_discount = $sale_maker_discount;\n }\n }\n break;\n// EOF: flat amount discounts Skip Special\n\n// BOF: New Price amount discounts\n case ($discount_type_id == 220):\n // New Price amount discount Sale and Special without a special\n if (!$attributes_id) {\n $sale_maker_discount = $sale_maker_discount;\n } else {\n // compute attribute amount\n if ($attributes_amount != 0) {\n $calc = ($attributes_amount * $special_price_discount);\n $sale_maker_discount = $calc;\n//echo '<br />attr ' . $attributes_amount . ' spec ' . $special_price_discount . ' Calc ' . $calc . 'Calc2 ' . $calc2 . '<br />';\n } else {\n $sale_maker_discount = $sale_maker_discount;\n }\n }\n break;\n case ($discount_type_id == 2209):\n // New Price amount discount on Sale and Special with a special\n if (!$attributes_id) {\n// $sale_maker_discount = $sale_maker_discount;\n $sale_maker_discount = $sale_maker_discount;\n } else {\n // compute attribute amount\n if ($attributes_amount != 0) {\n $calc = ($attributes_amount * $special_price_discount);\n//echo '<br />attr ' . $attributes_amount . ' spec ' . $special_price_discount . ' Calc ' . $calc . 'Calc2 ' . $calc2 . '<br />';\n $sale_maker_discount = $calc;\n } else {\n $sale_maker_discount = $sale_maker_discount;\n }\n }\n break;\n// EOF: New Price amount discounts\n\n// BOF: New Price amount discounts - Skip Special\n case ($discount_type_id == 210):\n // New Price amount discount Sale and Special without a special\n if (!$attributes_id) {\n $sale_maker_discount = $sale_maker_discount;\n } else {\n // compute attribute amount\n if ($attributes_amount != 0) {\n $calc = ($attributes_amount * $special_price_discount);\n $sale_maker_discount = $calc;\n//echo '<br />attr ' . $attributes_amount . ' spec ' . $special_price_discount . ' Calc ' . $calc . 'Calc2 ' . $calc2 . '<br />';\n } else {\n $sale_maker_discount = $sale_maker_discount;\n }\n }\n break;\n case ($discount_type_id == 2109):\n // New Price amount discount on Sale and Special with a special\n if (!$attributes_id) {\n// $sale_maker_discount = $sale_maker_discount;\n $sale_maker_discount = $sale_maker_discount;\n } else {\n // compute attribute amount\n if ($attributes_amount != 0) {\n $calc = ($attributes_amount * $special_price_discount);\n//echo '<br />attr ' . $attributes_amount . ' spec ' . $special_price_discount . ' Calc ' . $calc . 'Calc2 ' . $calc2 . '<br />';\n $sale_maker_discount = $calc;\n } else {\n $sale_maker_discount = $sale_maker_discount;\n }\n }\n break;\n// EOF: New Price amount discounts - Skip Special\n\n case ($discount_type_id == 0 or $discount_type_id == 9):\n // flat discount\n return $sale_maker_discount;\n break;\n default:\n $sale_maker_discount = 7000;\n break;\n }\n\n return $sale_maker_discount;\n }",
"public static function variable_sync_has_nyp_status( $product ) {\r\n\r\n\t\t$product->delete_meta_data( '_has_nyp' );\r\n\t\t$product->delete_meta_data( '_nyp_hide_variable_price' );\r\n\r\n\t\t// Only run on supported types.\r\n\t\tif ( $product->is_type( WC_Name_Your_Price_Helpers::get_variable_supported_types() ) ) {\r\n\r\n\t\t\tglobal $wpdb;\r\n\r\n\t\t\t$variation_ids = $product ? $product->get_children() : array();\r\n\r\n\t\t\tif ( empty( $variation_ids ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t$variation_id_placeholders = implode( ', ', array_fill( 0, count( $variation_ids ), '%d' ) );\r\n\r\n\t\t\t$nyp_variation_count = $wpdb->get_var(\r\n\t\t\t\t$wpdb->prepare( \"SELECT count(post_id) FROM $wpdb->postmeta WHERE post_id IN ( $variation_id_placeholders ) AND meta_key = '_nyp' AND meta_value = 'yes' LIMIT 1\", $variation_ids ) // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared\r\n\t\t\t);\r\n\r\n\t\t\t// Has NYP variations.\r\n\t\t\tif ( 0 < $nyp_variation_count ) {\r\n\r\n\t\t\t\t$product->add_meta_data( '_has_nyp', 'yes', true );\r\n\r\n\t\t\t\t// Check if minimum priced-variation has the minimum hidden or a null minimum.\r\n\t\t\t\t$variation_prices = $product->get_variation_prices();\r\n\r\n\t\t\t\t$min_variation_id = key( $variation_prices['price'] );\r\n\t\t\t\t$min_variation_price = $variation_prices['price'][ $min_variation_id ];\r\n\t\t\t\t$min_variation = wc_get_product( $min_variation_id );\r\n\r\n\t\t\t\t// If the cheapest variation is NYP and has no price (or min is hidden... save a meta flag on the parent).\r\n\t\t\t\tif ( $min_variation && WC_Name_Your_Price_Helpers::is_nyp( $min_variation ) ) {\r\n\t\t\t\t\tif ( false === WC_Name_Your_Price_Helpers::get_minimum_price( $min_variation ) || WC_Name_Your_Price_Helpers::is_minimum_hidden( $min_variation ) ) {\r\n\t\t\t\t\t\t$product->add_meta_data( '_nyp_hide_variable_price', 'yes', true );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"protected function calculatePrices()\n {\n }",
"protected function _afterSave()\n {\n\t \tparent::_afterSave();\n\t \t\n\t \t//define in supply_needs may change\n\t \t$UpdateSupplyNeeds = false;\n\t \tif ($this->getpsop_fullstock_date() != $this->getOrigData('psop_fullstock_date'))\n\t \t\t$UpdateSupplyNeeds = true;\n\t \tif ($this->getpsop_fullstock_date_force() != $this->getOrigData('psop_fullstock_date_force'))\n\t \t\t$UpdateSupplyNeeds = true;\n\t \t\t\n\t \t//update supply needs for products\n\t \tif ($UpdateSupplyNeeds)\n\t \t{\n\t \t\t$order = mage::getModel('sales/order')->load($this->getpsop_order_id());\n\t \t\tforeach($order->getAllItems() as $item)\n\t\t\t\t{\n\t\t\t\t\t$productId = $item->getproduct_id();\n\t\t\t \tMage::dispatchEvent('purchase_update_supply_needs_for_product', array('product_id'=>$productId, 'from' => 'Order planning update'));\n\t\t\t\t}\n\t \t}\n\t \t\n }",
"function fn_product_configurator_post_add_to_cart(&$product_data, &$cart, &$auth, &$update)\n{\n if (!empty($value['product_id'])) {\n foreach ($product_data as $key => $value) {\n if (!empty($value['extra']['configuration'])) {\n $cart_id = fn_generate_cart_id($value['product_id'], $product_data[$key]['extra'], false);\n\n if (empty($cart['products'][$cart_id])) {\n continue;\n }\n\n $total_amount = $cart['products'][$cart_id]['amount'];\n $is_changed = false;\n\n foreach ($cart['products'] as $k => $v) {\n if (isset($v['extra']['parent']['configuration']) && $v['extra']['parent']['configuration'] == $cart_id) {\n $amount = ceil($v['amount'] / $cart['products'][$k]['extra']['step']);\n if ($total_amount != $amount) {\n if ($total_amount > $amount) {\n $total_amount = $amount;\n }\n $is_changed = true;\n }\n }\n }\n\n if ($is_changed) {\n $cart['products'][$cart_id]['amount'] = $total_amount;\n foreach ($cart['products'] as $k => $v) {\n if (isset($v['extra']['parent']['configuration']) && $v['extra']['parent']['configuration'] == $cart_id) {\n $cart['products'][$k]['amount'] = (int) $cart['products'][$k]['extra']['step'] * $total_amount;\n }\n }\n }\n }\n }\n }\n\n return true;\n}",
"public function UpdateMissingProducts() {\n\n\t\t$blnResult=false;\n\t\tforeach ($this->cartItems as $objItem) {\n\n\t\t\tif (!$objItem->product || $objItem->product->web != 1) {\n\t\t\t\tYii::app()->user->setFlash('warning',\n\t\t\t\t\tYii::t('cart','The product {product} is no longer available on this site and has been removed from your cart.',\n\t\t\t\t\t\tarray('{product}'=>\"<strong>\".$objItem->description.\"</strong>\")));\n\t\t\t\t$objItem->delete();\n\t\t\t\t$blnResult = true;\n\t\t\t}\n\n\t\t\t//This is a cart that has not originated as a document i.e quote\n\t\t\tif(is_null($this->document_id))\n\t\t\t{\n\n\t\t\t\tif (_xls_get_conf('INVENTORY_OUT_ALLOW_ADD',0) != Product::InventoryAllowBackorders) { //IOW, unless we allow backordering\n\t\t\t\t\tif ($objItem->product->inventoried) {\n\t\t\t\t\t\tif ($objItem->product->Inventory==0) {\n\t\t\t\t\t\t\tYii::app()->user->setFlash('warning',\n\t\t\t\t\t\t\t\tYii::t('cart','The product {product} is now out of stock and has been removed from your cart.',\n\t\t\t\t\t\t\t\t\tarray('{product}'=>\"<strong>\".$objItem->description.\"</strong>\")));\n\t\t\t\t\t\t\t$objItem->delete();\n\t\t\t\t\t\t\t$blnResult = true;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($objItem->qty > $objItem->product->Inventory) {\n\t\t\t\t\t\t\tYii::app()->user->setFlash('warning',\n\t\t\t\t\t\t\t\tYii::t('cart','The product {product} now has less stock available than the amount you requested. Your cart quantity has been reduced to match what is available.',\n\t\t\t\t\t\t\t\t\tarray('{product}'=>\"<strong>\".$objItem->description.\"</strong>\")));\n\t\t\t\t\t\t\t$objItem->qty=$objItem->product->Inventory;\n\t\t\t\t\t\t\t$objItem->save();\n\t\t\t\t\t\t\t$blnResult = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t}\n\t\tif ($blnResult) $this->UpdateCart();\n\t\treturn $blnResult;\n\t}",
"private function _checkQuantityAndPrice()\n {\n if( $this->_hasCartProperties('quantity_price') )\n {\n if( !$this->_isEmptyOptions() )\n {\n # get Cart\n $cart = $this->_getCurrentCartItem();\n # Get paper pricing according to params provided\n $pricing = PaperPricingModel::wherePaperSizeId($cart['paper_size']['id'])\n ->activeList()\n ->paperTypeId($cart['paper_type']['id'])\n ->paperColorId($cart['paper_color']['id'])\n ->tat($cart['quantity_price']['tat'])\n ->quantity($cart['quantity_price']['quantity'])\n ->first();\n\n if( isset($pricing->id) )\n {\n $pricing = $pricing->toArray();\n $pricing['current_selection_quantity_price'] = 1;\n $this->_putCartProperties('quantity_price', $pricing);\n }\n else\n {\n $this->_forgetCartProperties('quantity_price');\n } \n }\n }\n }",
"function fits_fix_discount_amount($cart_object)\n{\n global $wpdb, $woocommerce;\n $returnThis = 0;\n \n // for testing ->\techo \"discount fix running<br />\";\n \n // get cart contents\n foreach ($cart_object->get_cart() AS $item_values)\n {\n $item_id = $item_values['data']->id; // product ID\n $item_quantity = $item_values['quantity'];\n $item_price = $item_values['data']->price; // the product's original price\n \n // for testing ->\techo \"outer loop, product id: \".$item_id.\"<br />\";\n \n // the product id in the cart is not the id we need to get the discount info.\n // get program id using the product id and the meta_key, 'shopping_product_id'\n $getProgramQuery = \"SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'shopping_product_id' AND meta_value = '$item_id'\";\n $getProgramId = $wpdb->get_results($getProgramQuery);\n \n if ($getProgramId != FALSE)\n {\n foreach ($getProgramId AS $theProgramId)\n {\n $item_program = $theProgramId->post_id;\n }\n \n $discount_on = get_post_meta($item_program, \"include_discount\", true);\n \n // for testing ->\techo \"item: \".$item_program.\" has discount: \".$discount_on.\"<br />\";\n \n if (isset($discount_on) && $discount_on == \"yes\")\n {\n // for testing ->\techo \" begin inner proccess<br />\";\n \n $discount_amount = get_post_meta($item_program, \"discount_percent\", true);\n $discount_product_ids = get_post_meta($item_program, \"material_product_ids\", true);\n $discountProductIdsArray = explode(\",\", $discount_product_ids);\n \n // for testing ->\techo \"discounted products: \".$discount_product_ids.\"<br />\";\n \n // now loop through the cart again to see if products in discount array are in cart\n foreach($cart_object->get_cart() AS $inner_item_values)\n {\n $inner_item_id = $inner_item_values['data']->id;\n $inner_item_quantity = $inner_item_values['quantity'];\n $inner_item_price = $inner_item_values['data']->price;\n \n if (in_array($inner_item_id, $discountProductIdsArray))\n {\n // do calculation\n $returnThis += $inner_item_price * ($discount_amount / 100) * $inner_item_quantity;\n }\n }\n }\n } // end if that looks for product's program's id\n \n // for testing ->\techo \"cart price: \".$item_price.\" current fee value: \".$returnThis.\"<br />\";\n } // end foreach that loops through cart products\n \n \n \n if($returnThis > 0)\n {\n // this adds a line (with no description) that adds the fee to the cart\n $cart_object->add_fee(__(\"Coupon: special trainee offer\", \"woocommerce\"), -($returnThis), true);\n \n //print \"\t<script> jQuery(window).load(function(){jQuery(\\\".cart-discount .amount\\\").html(\\\"$\".$new_discount_amount.\"\\\");});</script>\";\n \n // for testing ->\techo \"old discount: \".$current_discount_amount.\"<br />new discount: \".$new_discount_amount.\"<br />difference should be: \".$returnThis.\"<br />\";\n }\n}",
"public function check_prodpoint_requisites($pp_id, $player_id, $place_id) {\n $query = $this->db->select(\"ppr.mat_id, g.gname, ppr.quantity as need_quantity, 0 as avail_quantity\")\n ->from(\"prodpoint_reqmaterials ppr\")\n ->join(\"goods g\",\"g.id = ppr.mat_id\")\n ->where(\"ppr.pp_id\",$pp_id)\n ->get();\n $res = $query->result();\n foreach($res as &$item) {\n //search if the player has the material\n $qts = $this->db->select(\"(wg.quantity-wg.locked) as avail_quantity\")\n ->from(\"warehouses_goods wg\")\n ->join(\"warehouses w\", \"w.id = wg.id_warehouse\")\n ->where(\"id_good\", $item->mat_id)\n ->where(\"w.player_id\", $player_id)\n ->where(\"w.place_id\", $place_id)\n ->where(\"w.whtype = 'STATIC'\")\n ->get()->result();\n if($qts) {\n $item->avail_quantity = $qts[0]->avail_quantity;\n }\n }\n return $res;\n }",
"public function productSalesCalculation($order)\n {\n /*\n * Marketplace Order details save before Observer\n */\n $this->_eventManager->dispatch(\n 'mp_order_save_before',\n ['order' => $order]\n );\n\n /*\n * Get Global Commission Rate for Admin\n */\n $percent = $this->_marketplaceHelper->getConfigCommissionRate();\n\n /*\n * Get Current Store Currency Rate\n */\n $currentCurrencyCode = $order->getOrderCurrencyCode();\n $baseCurrencyCode = $order->getBaseCurrencyCode();\n $allowedCurrencies = $this->_marketplaceHelper->getConfigAllowCurrencies();\n $rates = $this->_marketplaceHelper->getCurrencyRates(\n $baseCurrencyCode,\n array_values($allowedCurrencies)\n );\n if (empty($rates[$currentCurrencyCode])) {\n $rates[$currentCurrencyCode] = 1;\n }\n\n $lastOrderId = $order->getId();\n\n /*\n * Marketplace Credit Management module Observer\n */\n $this->_eventManager->dispatch(\n 'mp_discount_manager',\n ['order' => $order]\n );\n\n $this->_eventManager->dispatch(\n 'mp_advance_commission_rule',\n ['order' => $order]\n );\n\n $sellerData = $this->getSellerProductData($order, $rates[$currentCurrencyCode]);\n\n $sellerProArr = $sellerData['seller_pro_arr'];\n $sellerTaxArr = $sellerData['seller_tax_arr'];\n $sellerCouponArr = $sellerData['seller_coupon_arr'];\n\n $taxToSeller = $this->_marketplaceHelper->getConfigTaxManage();\n $shippingAll = $this->_coreSession->getData('shippinginfo');\n try {\n $shippingAllCount = count($shippingAll);\n } catch (\\Exception $e) {\n $this->_marketplaceHelper->logDataInLogger(\n \"Observer_SalesOrderPlaceAfterObserver productSalesCalculation : \".$e->getMessage()\n );\n $shippingAllCount = false;\n }\n foreach ($sellerProArr as $key => $value) {\n $productIds = implode(',', $value);\n $data = [\n 'order_id' => $lastOrderId,\n 'product_ids' => $productIds,\n 'seller_id' => $key,\n 'total_tax' => $sellerTaxArr[$key],\n 'tax_to_seller' => $taxToSeller,\n ];\n if (!$shippingAllCount && $key == 0) {\n $shippingCharges = $order->getBaseShippingAmount();\n $data = [\n 'order_id' => $lastOrderId,\n 'product_ids' => $productIds,\n 'seller_id' => $key,\n 'shipping_charges' => $shippingCharges,\n 'total_tax' => $sellerTaxArr[$key],\n 'tax_to_seller' => $taxToSeller,\n ];\n }\n if (!empty($sellerCouponArr) && !empty($sellerCouponArr[$key])) {\n $data['coupon_amount'] = $sellerCouponArr[$key];\n }\n $collection = $this->ordersFactory->create();\n $collection->setData($data);\n $collection->setCreatedAt($this->_date->gmtDate());\n $collection->setSellerPendingNotification(1);\n $collection->setUpdatedAt($this->_date->gmtDate());\n $collection->save();\n $sellerOrderId = $collection->getId();\n $this->notificationHelper->saveNotification(\n \\Webkul\\Marketplace\\Model\\Notification::TYPE_ORDER,\n $sellerOrderId,\n $lastOrderId\n );\n }\n /*\n * Marketplace Order details save after Observer\n */\n $this->_eventManager->dispatch(\n 'mp_order_save_after',\n ['order' => $order]\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the TransactionFlowLink Consumer ID | public function getConsumerId($generate = false)
{
if (is_null($this->consumerId) && $generate) {
$this->consumerId = $this->generateGuid();
}
return $this->consumerId;
} | [
"public function getConsumerId();",
"public function getConsumerId()\n {\n return $this->consumerId;\n }",
"public function getMerchantConsumerId();",
"public function getRequestMerchantConsumerId()\n {\n return $this->request_merchant_consumer_id;\n }",
"public function getMerchantConsumerId()\n {\n return '';\n }",
"private function getConsumerTag(): string\n {\n return sprintf(\"%s_%s_%s\", $this->aliasName, gethostname(), getmypid());\n }",
"public function getConsumerKey()\n {\n\t\t$res = $this->getEntity()->getConsumerKey();\n\t\tif($res == null)\n\t\t{\n\t\t\tSDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->create($this);\n\t\t\treturn $this->getEntity()->getConsumerKey();\n\t\t}\n\t\treturn $res;\n }",
"public function getConsumerName() {\n return (string) $this->idealConsumerName;\n }",
"public function getConsumerKey(): string\n {\n return $this->consumerKey;\n }",
"private function getBrokerId()\r\n {\r\n if ($this->auth->hasIdentity()) {\r\n $userRole = $this->auth->getIdentity()\r\n ->getRole()\r\n ->getId();\r\n if ($userRole == UserService::USER_ROLE_BROKER || $userRole == UserService::USER_ROLE_SETUP_BROKER) {\r\n $criteria = array(\r\n 'user' => $this->userId\r\n );\r\n \r\n $data = $this->em->getRepository('Users\\Entity\\InsuranceBrokerRegistered')->findOneBy($criteria);\r\n if ($data != NULL) {\r\n $this->brokerId = $data->getId();\r\n return $data->getId();\r\n } else {\r\n return NULL;\r\n }\r\n }\r\n }\r\n }",
"public function getConsumerKey();",
"protected static function getConsumerIdFromGenesisGateway()\n {\n global $order;\n\n try {\n $genesis = new \\Genesis\\Genesis('NonFinancial\\Consumers\\Retrieve');\n $genesis->request()->setEmail($order->customer['email_address']);\n\n $genesis->execute();\n\n $response = $genesis->response()->getResponseObject();\n\n if (static::isErrorResponse($response)) {\n return 0;\n }\n\n return intval($response->consumer_id);\n } catch (\\Exception $exception) {\n return 0;\n }\n }",
"public function getChannelId();",
"public function getConsumerName()\n {\n return (string)$this->consumerName;\n }",
"public function getCallbackId();",
"public function getConsumerAccountNumber() {\n\t\treturn $this->consumerAccountNumber;\n\t}",
"public function getTransactionExternalId();",
"public function getConsumerName()\n {\n return $this->consumer_name;\n }",
"public function getConnectorId()\n {\n return $this->connector_id;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a string representation of the primary actors for this event, including a prefix of actor type | protected function getPrimaryActorsAsString($max = 2){
$e = $this->data;
$actorList = $e->getPrimaryActors();
//Start with an empty string
$actors = "";
//Base-0, so max needs to be smaller
$max--;
for($i = 0; $i < count($actorList); $i++){
if($i > $max){
$actors .= " (...)";
break;
}
if(strlen($actors)) $actors .= ", ";
$a = $actorList[$i];
if($a instanceof Person_Person){
$actors .= $a->getFullName();
}
}
$actorName = String_String::getString("ACTOR_NAME_TEACHER",$this->getTopAncestorClassName());
return "<strong>$actorName:</strong><br />" . $actors;
} | [
"public function getActors()\n\t{\n\n\t\treturn $this->_explodeBarDelimitedString($this['Actors']);\n\n\t}",
"private function getActorInverseFunctionalIdentifier($actor) {\n if (!is_array($actor) || empty($actor)) {\n return '';\n }\n\n $identifier = [];\n if (array_key_exists('mbox', $actor)) {\n array_push($identifier, $this->t('email: @email', ['@email' => $actor['mbox']]));\n }\n if (array_key_exists('mbox_sha1sum', $actor)) {\n array_push($identifier, $this->t('email hash: @hash', ['@hash' => $actor['mbox_sha1sum']]));\n }\n if (array_key_exists('openid', $actor)) {\n array_push($identifier, $this->t('openid: @openid', ['@openid' => $actor['openid']]));\n }\n if (array_key_exists('account', $actor)) {\n array_push($identifier, $this->t('account: @account', ['@account' => $this->getAccount($actor['account'])]));\n }\n return (empty($identifier)) ? '' : implode($identifier, ', ');\n }",
"public function getActorName() {\n\t\treturn ($this->actorName);\n}",
"public function getActors()\n {\n $actors = array();\n foreach ($this->events as $i => $event) {\n $actor = $event->getActor();\n $key = '';\n if ($actor) {\n $key = $actor->getUsername();\n }\n if (!isset($actors[$key])) {\n $actors[$key]['times'] = 0;\n }\n $actors[$key]['times'] += 1;\n $actors[$key]['user'] = $actor;\n }\n\n return $actors;\n }",
"public function getActorsInString()\n {\n if(!$this->actors->isEmpty())\n {\n return $actors = implode(', ', $this->actors()->pluck('name')->all());\n }\n }",
"public function activityActorId();",
"public function getActorId()\n {\n return $this->actor_id;\n }",
"public function getActorID()\n {\n return $this->actorID;\n }",
"public function getActorInfo();",
"public function getActors() {\n\t\treturn $this->actors;\n\t}",
"static function getAgentIdentifier(\\stdClass $actor) {\n if (isset($actor->mbox)) return 'mbox';\n if (isset($actor->account)) return 'account';\n if (isset($actor->openid)) return 'openid';\n if (isset($actor->mbox_sha1sum)) return 'mbox_sha1sum';\n return null;\n }",
"public function imprimirNombreActor($actor){\n $nombre = $actor->get_nombre();\n echo '<a href=actores_ficha.php?id=' . $actor->get_id() . '>' . $actor->get_nombre() . '</a><br>';\n }",
"public function getActors()\n {\n return $this->actors;\n }",
"public function getSysprodActors()\n\t{\n\t\treturn $this->basic_select(AITBLUSERS, \"\", \"U_login\");\n\t}",
"public function getActorIdAttribute()\n\t{\n\t\treturn $this->attributes['actorId'];\n\t}",
"public function getActor();",
"private function getActor() {\n\t\tpreg_match('/ by (.+)/', $this->logLineIn, $match);\n\t\tif (isset($match[1])) {\n\t\t\treturn $match[1];\n\t\t} else {\n\t\t\treturn 'name not found';\n\t\t}\n\t}",
"public function getTroupActors()\n {\n return $this->hasMany(TroupActor::className(), ['id_actor' => 'id_actor']);\n }",
"private function __stringifyJobOwner(){\r\n $stringify = array_keys($this->__getShopsTask('addedby'));\r\n return join(',', $stringify);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function gets adhan(a call to prayer) information per salah pray by using client's device_id. target database table : halalkorea.salah_adhan | public function get_adhan($device_id, $pray_class) {
$target_table = 'this information can\'t be shared';
$target_column = 'this information can\'t be shared';
$condition = array(
'device_id' => $device_id,
'pray_class' => $pray_class
);
$result = array();
$this->db->select($target_column);
$this->db->where($condition);
$query = $this->db->get($target_table);
if ($query) {
$result_row = $query->row();
if ($result_row != null) {
$result['code'] = 200;
$result['message'] = 'Success!';
$result['adhan'] = $result_row;
} else {
$result['code'] = 410;
$result['message'] = 'failed to get adhan with device id!';
}
} else {
$result['code'] = 400;
$result['message'] = 'failed to get query result!';
}
return $result;
} | [
"function get_shabad_info($shabad_id)\n {\n $rs = DB::select('SELECT AS01.shabad_name, AC01.section AS section_name, AC01.sectionID, AS01.shabadID AS shabad_id, AS01.shabad_punjabi, A01.sectionID, A01.author, A01.raag, AS01.pageID AS pageno, A01.lineID AS lineno FROM AS01 INNER JOIN (A01 INNER JOIN AC01 ON AC01.sectionID=A01.sectionID) ON A01.shabadID=AS01.shabadID WHERE AS01.shabadID=' . trim($shabad_id) . ' LIMIT 1');\n if ( count($rs) > 0) {\n return $rs[0];\n } else {\n return false;\n }\n }",
"public function ads_get() { \r\n $response['ima_preroll']= $this->api_v100_model->get_preroll_ads_details();\r\n $response['admob'] = $this->api_v100_model->get_admob_ads_details(); \r\n $this->response($response,200);\r\n }",
"public function getDBhouseInfoByID ( $id )\n {\n\n /* $sql=\" select t1.id,t1.dbhouse_name,t1.dbhouse_code,t1.dbhouse_description ,t1.db_point,t1.db_credit_limit,t1.email,t1.vat_no,t1.tin_no,t2.db_house_status_name,t3.name,t4.distributor_name,t5.address_name,t6.name,t6.account_no,t7.north,t7.south,t7.east,t7.west from tbld_distribution_house as t1\n left join tbld_distribution_house_status as t2\n on t2.id = t1.db_house_status\n left join tbld_db_type as t3\n on t1.type = t3.id\n LEFT JOIN tbld_distributor AS t4\n ON t1.distributor_id = t4.id\n left join tbld_address as t5\n on t1.dbhouse_address_id = t5.id\n left join tbld_account as t6\n on t1.bank_account_id = t6.id\n left join tbli_db_demarcation as t7\n on t1.id = t7.db_id\n WHERE t1.id= $id \";\n <<--raju -->>\n */\n $sql = \"SELECT t1.*,t2.db_id,t2.east,t2.west,t2.north,t3.street1, t3.street2, t2.south,t3.address_name,t3.village_id,t3.union_id,t3.thana_id,\n t3.district_id,t3.division_id,t3.mobile1,t4.name,t4.account_no, t7.biz_zone_id,t8.name as district_name,t9.name as\n thana_name,t10.name as union_name,t11.name as village_name,t1.category,\n t12.bundle_price_id,t13.distributor_name,t13.distributor_address_id,t14.address_name as distributor_address,\n t14.street2 as distributor_village,t14.division_id as distributor_division_id,\n t14.district_id as distributor_district_id,t14.thana_id as distributor_thana_id,\n t14.union_id as distributor_union_id,\n t14.mobile1 as distributor_mobile_number, t14.mobile2 as telephone_number\n FROM tbld_distribution_house AS t1\n LEFT JOIN tbli_db_demarcation AS t2 ON t1.id=t2.db_id\n LEFT JOIN tbld_account AS t4 ON t1.bank_account_id = t4.id\n INNER JOIN tbld_address AS t3 ON t1.dbhouse_address_id = t3.id\n left join tbli_distribution_house_biz_zone_mapping as t7\n on t1.id = t7.dbhouse_id\n left join tbld_geo as t8\n on t3.district_id = t8.id\n left join tbld_geo as t9\n on t3.thana_id = t9.id\n left join tbld_geo as t10\n on t3.union_id = t10.id\n left join tbld_geo as t11\n on t3.village_id = t11.id\n left join `tbli_db_bundle_price_mapping` as t12 On t1.id=t12.db_id\n left join `tbld_distributor` as t13 On t1.distributor_id=t13.id\n left join `tbld_address` as t14 On t13.distributor_address_id=t14.id\n WHERE t1.id=$id\";\n\n $query = $this->db->query( $sql )->result_array();\n return $query;\n }",
"public function admob_ads_details_get() { \r\n $response['status'] = $this->db->get_where('config' , array('title'=>'admob_ads_enable'))->row()->value;\r\n $response['admob_app_id'] = $this->db->get_where('config' , array('title'=>'admob_app_id'))->row()->value;\r\n $response['admob_banner_ads_id'] = $this->db->get_where('config' , array('title'=>'admob_banner_ads_id'))->row()->value; \r\n $response['admob_interstitial_ads_id'] = $this->db->get_where('config' , array('title'=>'admob_interstitial_ads_id'))->row()->value; \r\n $this->response($response,200);\r\n }",
"public function daftar_pengadaan_kapitalisasi_berdasarkan_skpd($skpd,$tglPerolehanAwal,$tglPerolehanAkhir){\n //custom kontrak kapitalisasi \n $query=\"select K.Uraian, A.info,A.kodeKelompok,A.kodeSatker, A.noKontrak,A.StatusValidasi, Sum(NilaiPerolehan) as Total,\n Sum(Kuantitas) as Jumlah,NilaiPerolehan as Satuan from aset A \n inner join kelompok K on K.Kode=A.kodeKelompok \n inner join kontrak Ka on Ka.noKontrak = A.noKontrak \n where A.kodeSatker like '$skpd%' and ka.tglKontrak>='$tglPerolehanAwal' and ka.tglKontrak<='$tglPerolehanAkhir' \n and A.noKontrak is not null and A.StatusValidasi is null \n and Ka.n_status = 1 and Ka.tipeAset = 2 \n group by A.kodeSatker,A.kodeKelompok,A.noKontrak\"; \n\n //echo $query;\n $result = $this->query($query) or die($this->error());\n $check = $this->num_rows($result);\n while ($data = $this->fetch_array($result)) {\n \n list($tglKontrak,$keterangan,$nosp2d,$tglsp2d,$status_kontrak)= $this->get_kontrak($data[noKontrak]);\n $data['tglkontrak'] = $tglKontrak;\n $data['Satker']= $this->get_skpd($data['kodeSatker']);\n $data['keterangan'] = $keterangan;\n $data['nosp2d'] = $nosp2d;\n $data['tglsp2d'] = $tglsp2d;\n //if($status_kontrak==1)\n $dataArr[] = $data;\n }\n // pr($dataArr);\n return $dataArr;//array('dataArr' => $dataArr, 'count' => $check);\n }",
"function showHomePageAds()\n \t{\n\t\t$sqlselect = \"SELECT * FROM home_page_ads_table WHERE status ='1'\"; \n\t\t$obj = new Bin_Query();\n\t\tif($obj->executeQuery($sqlselect))\n\t\t$records=$obj->records;\n\t\treturn $records;\n \t}",
"public function getAllSalons($salon_id){\n\t\t \tif($salon_id!='')\n\t\t\t{\n\t\t\t\t$this->DB_ReadOnly->where('salon_id',$salon_id);\n\t\t\t}\n\t\t\t$this->DB_ReadOnly->select('salon_id,salon_name,salon_start_day_of_week,millennium_enabled,service_retail_reports_enabled,team_commission,salon_account_id');\n\t\t\t$configDetails = $this->DB_ReadOnly->get(MILL_ALL_SDK_CONFIG_DETAILS)->result_array();\n\t\t\t$getdbdata = array();\n\t\t\tforeach ($configDetails as $key => $value) {\n\t\t\t\t$dbresult['salon_id'] = $value['salon_id'];\n\t\t\t $dbresult['salon_name'] = $value['salon_name'];\n\t\t\t $dbresult['salon_start_day_of_week'] = $value['salon_start_day_of_week'];\n\t\t\t $dbresult['millennium_enabled'] = $value['millennium_enabled'];\n\t\t\t $dbresult['service_retail_reports_enabled'] = $value['service_retail_reports_enabled'];\n\t\t\t $dbresult['team_commission'] = $value['team_commission'];\n\t\t \t$dbresult['salon_account_id'] = $value['salon_account_id'];\n\t\t\t array_push($getdbdata,$dbresult);\n\t\t\t}\n\t\t\t$results['mill_salons'] = $getdbdata;\n\t\t\treturn $results;\n\t\t\t/*pa($results,'',false);\n if(!empty($configDetails))\n\t\t\t{\n\t\t\t\t$salonIdsArr = array();\n\t\t\t\tforeach($configDetails as $salonIds)\n\t\t\t\t{\n\t\t\t\t\t$salonIdsArr[] = $salonIds[\"salon_id\"];\n\t\t\t\t}\n\n\t\t\t\t$salonIdsInServer = implode(\",\",$salonIdsArr);\n\n\t\t\t\t$postSalonIds = array();\n\t\t\t\t$postSalonIds[\"all_salon_ids\"] = $salonIdsInServer;\n\t\t\t\t\n\t\t\t\t$ch = curl_init();\n\t\t\t\tcurl_setopt($ch, CURLOPT_URL,\"https://saloncloudsplus.com/wsInfotoIntServer/getMillSalonsInfo\");\n\t\t\t\t// for local server\n\t\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t // close\n\t\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\t\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $postSalonIds); \n\t\t\t\t$salons_result=curl_exec($ch);\n\t\t\t\tcurl_close($ch);\n\t\t\t\t$getAllSalons = json_decode($salons_result,true);\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$getAllSalons = array();\n\t\t\t}*/\n\t\t\t\n }",
"function getAds()\n {\n global $objCore;\n global $objGeneral;\n $varCountry = $objGeneral->getCountryByIp();\n\n $curDate = $objCore->serverdateTime(date(DATE_FORMAT_DB), DATE_FORMAT_DB);\n\n $varQuery = \"SELECT AdType, Title, AdUrl, ImageName, HtmlCode,(select count(addOrder) from tbl_advertisement where addOrder='1') as one,(select count(addOrder) from tbl_advertisement where addOrder='2') as two,(select count(addOrder) from tbl_advertisement where addOrder='3') as three,(select count(addOrder) from tbl_advertisement where addOrder='4') as four,(select count(addOrder) from tbl_advertisement where addOrder='5') as five FROM \" . TABLE_ADVERTISEMENT . \" WHERE AdStatus = '1' AND AdsStartDate<='\" . $curDate . \"' AND AdsEndDate >='\" . $curDate . \"' AND AdsPage = 'Home Page' AND (FIND_IN_SET('$varCountry',countryIds) OR countryIds=0) ORDER BY RAND() LIMIT \" . $this->homePageAdsDisplayLimit;\n //mail('raju.khatak@mail.vinove.com','TestQuery',$varQuery);\n $arrRes = $this->getArrayResult($varQuery);\n //pre($arrRes);\n return $arrRes;\n }",
"function wizGradeHostelData($conn) {\r\n\r\n\t\t\t\tglobal $hostelTB;\r\n\r\n\t\t\t\t$hostelData = $conn->query(\"SELECT h_id, hostel, h_limit, h_desc, h_master\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tFROM $hostelTB\")->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\tarray_unshift($hostelData,\"\");\r\n\t\t\t\tunset($hostelData[0]);\r\n\r\n\t\t\t\treturn $hostelData;\r\n\t\t\t\t\r\n\t\t}",
"public function getDataByAppId($appId){\n \n $ssql = \"SELECT a.fin_cust_id, a.fst_cust_code, a.fst_cust_name, a.fst_cust_address, a.fst_cust_phone,a.fin_price_group_id,\n a.fst_company_code,a.fst_active,a.fdt_insert_datetime,a.fin_insert_id,a.fdt_update_datetime,a.fin_update_id,a.fst_blocked_sales_code,\n b.fst_sales_code,b.fin_visit_day,b.fin_putaran,\n d.fst_cust_location FROM \". $this->tableName .\" a \n inner join tbjadwalsales b on a.fst_cust_code = b.fst_cust_code \n inner join tbappid c on b.fst_sales_code = c.fst_sales_code\n left join tblocation d on a.fst_cust_code = d.fst_cust_code \n where c.fst_appid = ?\";\n\n $query = $this->db->query($ssql,[$appId]);\n $result = $query->result();\n for($i = 0 ;$i < sizeof($result);$i++){\n $rw = $result[$i];\n if ($rw->fst_active == 'A'){\n if (! $this->inSchedule($rw->fst_cust_code,$rw->fst_sales_code,date(\"Y-m-d\")) ){\n //$rw->fst_active = 'S';\n $result[$i]->fst_active = 'S';\n }else{\n //Kalau dalam schedule chek apa di blok untuk sales ini\n if ( $rw->fst_blocked_sales_code != null){\n $blockSales=\",\" .$rw->fst_blocked_sales_code .\",\";\n if (strpos($blockSales,$rw->fst_sales_code) === false){\n\n }else{\n //Terblock\n $result[$i]->fst_active = 'B';\n }\n }\n }\n } \n }\n \n return $result;\n\n }",
"public function getDataAutelan() {\n\t\t$this->searchBy = $this->input->post ( 'searchBy' );\n\t\t$this->searchQuery = $this->input->post ( 'search' );\n\t\t$index = 0;\n\t\t\n\t\tif ($this->searchBy != \"serialNumber\" && $this->searchBy != \"macAddress\") {\n\t\t\t$searchCategory = array (\n\t\t\t\t\t'name' => 'ap_name',\n\t\t\t\t\t'location' => 'location',\n\t\t\t\t\t'ethernetMac' => 'mac_address' \n\t\t\t);\n\t\t\t$this->db->like ( $searchCategory [$this->searchBy], $this->searchQuery );\n\t\t\t$query = $this->db->get ( 'tbl_autelan' );\n\t\t\t$data ['data'] = array();\n\t\t\t$cntDown = 0;\n\t\t\tif ($query->num_rows() > 0){\n\t\t\t\t// Pengulangan sekaligus hitung yang 'down'\n\t\t\t\tforeach ( $query->result () as $row ) {\n\t\t\t\t\t$data ['data'][$index] = $row;\n\t\t\t\t\tif (strtolower($row->status) == \"down\") {\n\t\t\t\t\t\t// Perlu dikasi property background?\n\t\t\t\t\t\t// $data ['data'][$index]['background'] = \"#c62828\";\n\t\t\t\t\t\t$cntDown++;\n\t\t\t\t\t}\n\t\t\t\t\t$index++;\n\t\t\t\t}\n\t\t\t\t$data['down'] = $cntDown;\n\t\t\t\t$data['total'] = $index;\n\t\t\t\t$result = array (\n\t\t\t\t\t\t'list_data' => $data,\n\t\t\t\t\t\t'msg' => 'Success',\n\t\t\t\t\t\t'total' => $index,\n\t\t\t\t\t\t\"field\" => $this->searchBy,\n\t\t\t\t\t\t\"query\" => $this->searchQuery\n\t\t\t\t);\n\t\t\t\treturn $result;\n\t\t\t}else {\n\t\t\t\t$result = array (\n\t\t\t\t\t\t'msg' => 'Hasil Tidak Ditemukan karena tabel kosong. Mohon periksa Database Oracle'\n\t\t\t\t);\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}else{\n\t\t\t$result = array (\n\t\t\t\t\t'msg' => 'Hasil Tidak Ditemukan. Silahkan Perbaiki Kata Kunci.'\n\t\t\t);\n\t\t\treturn $result;\n\t\t}\n\t}",
"function get_adhoc_program_info($i_centre_id, $i_adhoc_id)\n\t{\n\t\t$this->db->where('sap_adhoc_programs.centre_id', $i_centre_id);\n\t\t$this->db->where('sap_adhoc_programs.id', $i_adhoc_id);\n\t\t$r_query = $this->db->get(TBL_ADHOC_PROGRAMS);\n\n\t\tif ($r_query->num_rows() > 0) {\n\t\t\treturn $r_query->row();\n\t\t} else {\n\t\t\treturn NULL;\n\t\t}\n\t}",
"public function getHCID_soaps($hcIDs,$dbhandle = false){\r\r\n\t\t\tif($dbhandle == false){\r\r\n\t\t\t\t$dbhandle = $this->dbhandleSQLI();\r\r\n\t\t\t}\r\r\n\t\t\t$hcid = false;\r\r\n\t\t\tif ($this->dbfound()){\r\r\n\t\t\t\t$tablename = \"hcsoap\";\r\r\n\t\t\t\tif ($this->tableExists($tablename)){\r\r\n\t\t\t\t\t// Get ID numbers for Consultsj\r\r\n\t\t\t\t\tif(is_array($hcIDs)){\r\r\n\t\t\t\t\t\t$str = implode(',',$hcIDs);\r\r\n\t\t\t\t\t} else{\r\r\n\t\t\t\t\t\t$str = $hcIDs; \r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\t$sql = \"SELECT `$tablename`.* FROM `$this->db`.`$tablename` WHERE `$tablename`.`hcid` IN (\".$str.\")\";\r\r\n\t\t\t\t\t$result = mysqli_query($dbhandle, $sql);\r\r\n\t\t\t\t\tif ($result){\r\r\n\t\t\t\t\t\tif (mysqli_num_rows($result) > 0){\r\r\n\t\t\t\t\t\t\tfor ( $i = 0; $i < mysqli_num_rows($result); $i++ ){ \r\r\n\t\t\t\t\t\t\t\t$row = mysqli_fetch_assoc($result);\r\r\n\t\t\t\t\t\t\t\t$metrics[$i]=$row;\r\r\n\t\t\t\t\t\t\t\t//$id = $healthConsult[$i]['id'];\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}\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\t\t\treturn $metrics;\r\r\n\t\t}",
"function getInteractiondatabyid($id){\n #$querystring = \"SELECT acir.*,acm.client_name,acm.address,acm.country_id,acm.state_id,acm.city_id,acm.tel_prefix,acm.tel_no,acm.company_web_page FROM agrimin_client_interaction_report acir,agrimin_client_master acm where acir.client_id=acm.id and acir.id = $id\";\n $querystring = \"SELECT acir.*,acm.client_name,acm.address,acm.country_code,acm.tel_no,acm.company_web_page,acnt.name country,ast.name state,act.name city,acm.country_id,acm.state_id,acm.city_id FROM agrimin_client_interaction_report acir \n left join agrimin_client_master acm ON acir.client_id=acm.id \n left join agrimin_countries acnt ON acnt.id=acm.country_id\n left join agrimin_states ast ON ast.id=acm.state_id\n left join agrimin_cities act ON act.id=acm.city_id\n Where acir.id = $id\n order by acir.id desc\";\n $queryforpubid = $this->db->query($querystring);\n\n $result = $queryforpubid->result_array();\n\n return $result;\n }",
"function hs_get_server_byid($host_id) {\n $result = db_fetch_row(\"\n SELECT t.ip_address, t.host_id, t.hostname, t.import_status,\n h.snmp_community,h.snmp_version,h.snmp_username,h.snmp_password,\n h.snmp_auth_protocol,h.snmp_priv_passphrase,h.snmp_priv_protocol,h.snmp_context,\n h.snmp_port,h.snmp_timeout,h.description,h.hw_is_ibmc,h.hw_is_hmm \n FROM huawei_server_info AS t LEFT JOIN host AS h ON (t.host_id=h.id)\n WHERE t.host_id=\" .$host_id);\n\n return $result;\n}",
"public\n function getBanner()\n {\n $query = \"select * from adsbanner\";\n $result = $this->connectdb->query($query);\n return $result;\n }",
"function query_salads() {\n\t\t$conn = db_connect;\n\t\t\n\t\t$query = \"SELECT name, description, saladSize, price FROM salads\";\n\t\treturn $result = pg_query($conn,$query);\n\t}",
"function get_starterkitdealertahun($intid_cabang, $intbulan, $tahun){\n\t\t\n\t\t$select = \"select sum(nota.inttotal_bayar) harga_dealer from nota \n\t\t\t\t\t\t\twhere intid_cabang = '$intid_cabang' \n\t\t\t\t\t\t\t\tand intid_jpenjualan = 10 \n\t\t\t\t\t\t\t\tand year(datetgl) = '$tahun' \n\t\t\t\t\t\t\t\tand intid_week in (select intid_week from week where inttahun = '$tahun' and intbulan = '$intbulan')\n\t\t\t\t\t\t\t\";\n\t\t\n\t\t$query\t=\t$this->db->query($select);\n\t\treturn $query;\n\t\t}",
"function getAdsDetails()\n {\n $varQuery = \"SELECT pkAdID,AdType,Title,AdUrl,ImageName,HtmlCode\n FROM \" . TABLE_ADVERTISEMENT . \" WHERE AdStatus = '1' AND `AdsPage` = 'Home Page' order by rand() limit 0,2\";\n\n $arrRes = $this->getArrayResult($varQuery);\n // pre($arrRes);\n return $arrRes;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to set the value of field OverrideUOMSetRef_ListID | public function setOverrideUOMSetRefListID($OverrideUOMSetRef_ListID) {
$this->OverrideUOMSetRef_ListID = $OverrideUOMSetRef_ListID;
return $this;
} | [
"public function setOverrideItemAccountListID($ListID)\n\t{\n\t\treturn $this->set('OverrideItemAccountRef ListID', $ListID);\n\t}",
"public function set_list_id( $list_id ) {\r\n\t\t$this->list_id = $list_id;\r\n\t}",
"public function setUidRecipientList($uidRecipientList)\n {\n $recipientListRepository = $this->getObjectManager()->get(RecipientListRepository::class);\n $recipientList = $recipientListRepository->findByUid($uidRecipientList);\n $this->setRecipientList($recipientList);\n }",
"public function setEntityListID($ListID)\n\t{\n\t\treturn $this->set('EntityRef ListID', $ListID);\n\t}",
"public function getSalesRepRefListID() {\n return $this->SalesRepRef_ListID;\n }",
"public function getSalesRepRefListID() {\n return $this->SalesRepRefListID;\n }",
"public function setListId($id){\n $this->_listId = ' id=\"' . $id . '\"';\n }",
"public function setItemListID($ListID)\n\t{\n\t\treturn $this->set('ItemRef ListID', $ListID);\n\t}",
"function setPidlist($pid_list) {\n\t\t$this->pid_list = $pid_list;\n\t}",
"function setPidlist($pid_list)\t{\r\n\t\t$this->pid_list = $pid_list;\r\n\t}",
"public function getTermsRefListID()\n {\n return $this->TermsRef_ListID;\n }",
"public function getSalesTaxCodeRefListID()\n {\n return $this->SalesTaxCodeRef_ListID;\n }",
"public function getSalesTaxCodeRefListID() {\n return $this->SalesTaxCodeRef_ListID;\n }",
"public function setClassListID($ListID)\n\t{\n\t\treturn $this->set('ClassRef ListID', $ListID);\n\t}",
"public function setListId($val)\n {\n $this->_propDict[\"listId\"] = $val;\n return $this;\n }",
"public function setList($list)\n {\n $this->list = $list;\n }",
"public function getItemRefListID() {\n return $this->ItemRef_ListID;\n }",
"function setRefId()\n\t{\n\t\t$this->ilias->raiseError(\"Operation ilObjStyleSheet::setRefId() not allowed.\",$this->ilias->error_obj->FATAL);\n\t}",
"function setListName($list) {\n\t\t$this->_list =& $list;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. (repos.getIamPolicy) | public function getIamPolicy($resource, $optParams = [])
{
$params = ['resource' => $resource];
$params = array_merge($params, $optParams);
return $this->call('getIamPolicy', [$params], Policy::class);
} | [
"public function getIamPolicy($resource, Google_Service_Cloudresourcemanager_GetIamPolicyRequest $postBody, $optParams = array())\n {\n $params = array('resource' => $resource, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('getIamPolicy', array($params), \"Google_Service_Cloudresourcemanager_Policy\");\n }",
"public function getIamPolicy($resource, $optParams = array())\n {\n $params = array('resource' => $resource);\n $params = array_merge($params, $optParams);\n return $this->call('getIamPolicy', array($params), \"Forminator_Google_Service_Iam_Policy\");\n }",
"public function getIamPolicy($resource, $optParams = array())\n {\n $params = array('resource' => $resource);\n $params = array_merge($params, $optParams);\n return $this->call('getIamPolicy', array($params), \"Google_Service_CloudHealthcare_Policy\");\n }",
"public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])\n {\n $params = ['resource' => $resource, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('getIamPolicy', [$params], Policy::class);\n }",
"public function getIamPolicy($resource, $optParams = array())\n {\n $params = array('resource' => $resource);\n $params = array_merge($params, $optParams);\n return $this->call('getIamPolicy', array($params), \"Google_Service_CloudPrivateCatalogProducer_GoogleIamV1Policy\");\n }",
"public function getIamPolicy()\n {\n return isset($this->iam_policy) ? $this->iam_policy : null;\n }",
"public function getAccessPolicy()\n {\n return $this->readOneof(7);\n }",
"public function getPolicy(mixed $resource): mixed;",
"public function getAuthorizationPolicy()\n {\n return $this->authorization_policy;\n }",
"public function getPolicy()\n {\n return $this->policy;\n }",
"public function getPrivacyPolicy() {\n\t\treturn $this->getPolicy($this->cachePrivacyKey);\n\t}",
"public function getSecurityPolicy()\n {\n $securityPolicies = DSecurityPolicies::load();\n\n return $securityPolicies->getDefaultPolicy();\n }",
"public function fetchPrivacyPolicy() {\n\t\t$url = sprintf(\n\t\t\tself::IUBENDA_BASE_URL . '/%s/%s',\n\t\t\t$this->policyID,\n\t\t\tself::IUBENDA_POLICY_STYLE\n\t\t);\n\n\t\treturn $this->fetchPolicy($url);\n\t}",
"public function getScopePolicy($scope_policy);",
"public function getPolicy()\n\t{\n\t\treturn $this->policy;\n\t}",
"public function getPolicy(): mixed\n {\n return Gate::getPolicyFor($this->model);\n }",
"public function getPolicy($resource): ControllerHookPolicy\n {\n if ($resource instanceof AppController) {\n return new ControllerHookPolicy();\n }\n\n throw new MissingPolicyException([get_class($resource)]);\n }",
"public function getPolicy()\n {\n return Controllers\\PolicyController::getInstance();\n }",
"public function getClientAccessPolicy()\n {\n return $this->_clientAccessPolicy;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
user financing income processor for crontab task | public function processUserFinancingIncome() : string
{
$taskLogs = date("Y-m-d") . " | process begin at " . date("Y-m-d H:i:s") . PHP_EOL;
$taskBeginTime = time();
bcscale($this->getSetting("decimalPlaces"));
$this->mysqlDao->exceptionNotInterrupt = true;
$financingUsers = $this->mysqlDao->table("member_count")
->select(["uid", "property_financing_income", "property_financing", "property_financing_start", "property_financing_remain", "property_financing_expire", "property_financing_ratio", "property_financing_basemoney"])
->where(["property_financing"])
->prepare()->execute([1]);
while( $user = $financingUsers->fetch(\PDO::FETCH_ASSOC, \PDO::FETCH_ORI_NEXT) ) {
$uid = $user["uid"];
$this->beginTransaction();
if( $taskBeginTime >= $user["property_financing_expire"] ) {
$this->financingExpireReset($uid);
$this->rollback();
continue;
}
if( $taskBeginTime >= $user["property_financing_start"] ) {
$propertyDayIncome = bcmul($user["property_financing_basemoney"], $this->getSetting("propertyFinancingRatio"));
$this->mysqlDao->setExecuteSql("update shop_member_count set property = property + ?, property_financing_income = property_financing_income + ?, property_financing_remain = property_financing_remain - ? where uid = ?")
->prepare()->execute([$propertyDayIncome, $propertyDayIncome, 1, $uid]);
$propertyLogId = $this->insertOneObject([
"uid" => $uid,
"amount" => $propertyDayIncome,
"log_time" => time(),
"description" => AppConfig::get("financingIncome", "lang"),
], "member_log_property");
if($this->getUserCount($uid, "property_financing_remain") == 0) {
$this->financingExpireReset($uid);
}
$taskLogs .= "Process Uid: $uid, Process Time: " . date("Y-m-d H:i:s") . ", Process Status: ";
if($this->mysqlDao->errorBefore) {
$this->rollback();
$this->mysqlDao->errorBefore = false;
$taskLogs .= "Faild" . PHP_EOL;
} else {
$this->commit();
$taskLogs .= "Success" . PHP_EOL;
}
}
$this->rollback();
}
return $taskLogs . PHP_EOL . PHP_EOL;
} | [
"public function cron_handler() {\n\t\t\n\t}",
"function cron_run_import(){\n $this->pushLog(\"Start export from cron:\".date(\"Y-m-d H:i:s\"));\n $this->export_by='CRON';\n if (Mage::getStoreConfig('qixol/promo/enabled')>0){\n $this->run_import_promotionsForProducts(); \n $this->run_import_promotionsForBaskets();\n }\n $this->pushLog(\"Finish export from cron\".date(\"Y-m-d H:i:s\")); \n }",
"public function handleStoreVisitCronFunctionality()\n {\n $m_config = Tools::unSerialize(Configuration::get(self::BIRTHDAY_COUPON_MODULE_CONFIGURATION));\n \n $module_config=$m_config['birthday_coupon'];\n \n if (isset($module_config['enable']) && $module_config['enable'] == 1) {\n if (isset($module_config['cron_type']) && $module_config['cron_type'] == 1) {\n $last_execution = (int)Configuration::get(self::BIRTHDAY_COUPON_STORE_VISIT_EXECUTED);\n $last_24 = ($last_execution + (24 * 60 * 60)); //plus 24 hours\n $current_timestamp = time();\n if ($current_timestamp > $last_24) {\n $this->executeBirtdayCouponCron(true);\n }\n }\n }\n unset($module_config);\n }",
"public static function cron_runner() {\n\n\t\t// Go through the various regular tasks. These functions should make no assumptions themselves how regularly they are called - i.e. be stateless, within a week (to allow use of transients).\n\t\tself::email_users_with_expiring_cards();\n\n\t\tself::charge_due_users();\n\n\t\tself::renew_due_domains();\n\n\t\tself::email_unpaid_users();\n\n\t}",
"public function dailyCron()\n {\n if (!$this->_helper->isEnabled()) {\n return;\n }\n $this->updateTotalCount();\n }",
"static function cron() {\n\t\tself::starter();\n\t\tself::ender();\n\t}",
"public function cron_cb(){\n\t\t\t\n\t\t\tdo_action( 'nn_cron' );\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}",
"public function cronHandler();",
"function _runCron()\r\t{\r\t\t$this->_extendCron();\r\t}",
"public function run_cron() {\n\n\t}",
"function hourly_cron_job() {\r\n \r\n}",
"function warquest_cron_bank_interest($info=0) {\r\n\t\t\r\n\t/* input */\r\n\tglobal $config;\r\n\t\r\n\t/* output */\r\n\tglobal $output;\r\n\t\r\n\t$query = 'select pid, bank1, bank2, bank3 from player where ';\r\n\t$query .= 'holiday_date < \"'.date(\"Y-m-d H:i:s\", time()).'\" and ';\r\n\t$query .= 'bank1>0 or bank2>0 or bank3>0 order by pid'; \r\n\t$result = warquest_db_query($query);\t\t\t\r\n\t\t\r\n\t$count=0;\r\n\t\r\n\twhile ($data=warquest_db_fetch_object($result)) {\r\n\t\t\r\n\t\t$found=0;\r\n\t\t\t\t\t\r\n\t\tif ($data->bank1>0) {\r\n\t\t\t$extra = round(($data->bank1/100) * $config[\"init_bank1_interest\"]);\r\n\t\t\t$data->bank1 += $extra;\r\n\t\t\twarquest_db_bank_insert($data->pid, 0, 1, $extra, $data->bank1, 4);\r\n\t\t\t$found=1;\r\n\t\t}\r\n\t\t\r\n\t\tif ($data->bank2>0) {\r\n\t\t\t$extra = round(($data->bank2/100) * $config[\"init_bank2_interest\"]);\r\n\t\t\t$data->bank2 += $extra;\r\n\t\t\twarquest_db_bank_insert($data->pid, 0, 2, $extra, $data->bank2, 4);\r\n\t\t\t$found=1;\r\n\t\t}\r\n\t\t\r\n\t\tif ($data->bank3>0) {\r\n\t\t\t$extra = round(($data->bank3/100) * $config[\"init_bank3_interest\"]);\r\n\t\t\t$data->bank3 += $extra;\r\n\t\t\twarquest_db_bank_insert($data->pid, 0, 3, $extra, $data->bank3, 4);\r\n\t\t\t$found=1;\r\n\t\t}\n\t\t\r\n\t\tif ($found==1) {\r\n\t\t\r\n\t\t\t$query = 'update player set '; \r\n\t\t\t$query .= 'bank1='.$data->bank1.\", \";\r\n\t\t\t$query .= 'bank2='.$data->bank2.\", \";\r\n\t\t\t$query .= 'bank3='.$data->bank3.\" \";\r\n\t\t\t$query .= 'where pid='.$data->pid;\r\n\t\t\r\n\t\t\twarquest_db_query($query);\r\n\t\t}\r\n\t\t$count++;\r\n\t}\r\n\t\r\n\t$message = number_format2($count).' players bank interest updated!';\r\n\t\r\n\tif ($info==1) {\r\n\t\t$output->popup .= warquest_box_icon(\"info\", $message);\r\n\t} \r\n\t\t\r\n\twarquest_info($message);\r\n}",
"function cronAutoCancelInvoice()\n{\n\n\t/**\n\t * @var bool\n\t */\n $data = array();\n\n\t/**\n\t * interval day cancel from invoice date / invoice duedate\n\t * @var int\n\t */\n\t$intervalDayCancel = 14;\n\n /**\n * select invoice\n */\n $query = \"SELECT * FROM tblinvoices i\n WHERE (\n i.`status`='Unpaid' AND i.duedate!='0000-00-00' AND i.duedate+INTERVAL {$intervalDayCancel} DAY<=NOW()\n ) OR (\n i.`status`='Unpaid' AND i.duedate='0000-00-00' AND i.date+INTERVAL {$intervalDayCancel} DAY<=NOW()\n ) ORDER BY i.date DESC\";\n $result = mysql_query($query);\n\n\t/**\n\t * while data result\n\t */\n while($row = mysqli_fetch_assoc($result))\n {\n $data['invoiceid'][] = $row['id'];\n }\n\n /**\n * save log to whmcs logActivity\n\t * AdminArea Log View : Utilities -> Logs -> Activity Log\n */\n logActivity('Cron Auto Cancel Invoice - ' . json_encode($data));\n\n /**\n * update invoice to Cancelled\n */\n $query = \"UPDATE tblinvoices i SET i.`status`='Cancelled'\n WHERE (\n i.`status`='Unpaid' AND i.duedate!='0000-00-00' AND i.duedate+INTERVAL {$intervalDayCancel} DAY<=NOW()\n ) OR (\n i.`status`='Unpaid' AND i.duedate='0000-00-00' AND i.date+INTERVAL {$intervalDayCancel} DAY<=NOW()\n )\";\n $result = mysql_query($query);\n\n}",
"public function cs_run_cron_import() {\n\t\t// Run the download and import process.\n\t\t$this->import_articles();\n\t}",
"function increase_due() {\n \n }",
"protected function cronRun() {\n $this->drupalGet('cron/' . \\Drupal::state()->get('system.cron_key'));\n }",
"public function cronAction()\n {\n /** @var AutoImportServiceInterface $autoImporter */\n $autoImporter = $this->get('swag_import_export.auto_importer');\n $autoImporter->runAutoImport();\n }",
"function _crons()\n {\n\t\n\t}",
"function cron_compute_race($db, $ins_id)\n\t{\n\t\tai_update_drivers($ins_id, $db);\n\t\tai_update_parts($ins_id, $db);\n\t\tai_compute_race($ins_id, $db);\n\t\t\n\t\tinclude_once('classes/F1Cron.class.php');\n\t\t$f1cron = new F1Cron($db);\n\t\t$f1cron->compute_race($ins_id);\n\t\t$f1cron->compute_points($ins_id);\n\t\t$f1cron->compute_finance($ins_id);\n\t\t$f1cron->compute_statistic($ins_id);\n\t\t$f1cron->compute_training($ins_id);\n\t\t$f1cron->change_mechanic_values($ins_id);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
(PECL imagick 2.0.0) Sets the interpretation of clip path units | public function setClipUnits ($clip_units) {} | [
"public function getClipUnits () {}",
"function getClipUnits(){}",
"function getClipPath(){}",
"public function getClipPath () {}",
"function setImageClipMask($clip_mask){}",
"public function setImageClipMask (Imagick $clip_mask) {}",
"function setClipping($params = false)\n {\n }",
"public function GridClipPath()\n {\n if(isset($this->grid_clip_id))\n return $this->grid_clip_id;\n\n $rect = array(\n 'x' => $this->pad_left, 'y' => $this->pad_top,\n 'width' => $this->width - $this->pad_left - $this->pad_right,\n 'height' => $this->height - $this->pad_top - $this->pad_bottom\n );\n $clip_id = $this->NewID();\n $this->defs[] = $this->Element('clipPath', array('id' => $clip_id),\n NULL, $this->Element('rect', $rect));\n return ($this->grid_clip_id = $clip_id);\n }",
"public function clip()\n {\n $clip = $this->attributes['clip'] ?? false;\n\n if ($clip === false) {\n return false;\n }\n\n return Str::slug(($clip['width'] ?? 0) . 'x' . ($clip['height'] ?? 0) . '-' . ($clip['top'] ?? 0) . 'x' . ($clip['left'] ?? 0));\n }",
"function getImageClipMask(){}",
"public function setClipRule ($fill_rule) {}",
"protected function ClipGrid(&$attr)\n {\n $clip_id = $this->GridClipPath();\n $attr['clip-path'] = \"url(#{$clip_id})\";\n }",
"public function getImageClipMask () {}",
"function SetDeviceClippingRegion(wxRegion $region){}",
"public function UnsetClipping() {\n $this->_out('Q');\n }",
"public function getImageClipMask() {\n\t}",
"public function pushClipPath ($clip_mask_id) {}",
"function ClipHorzGridLines($clip){}",
"function clipcornersround(){\n\n\t\t$clipsize = floor($this->size[0] * ($this->Clipcorner[1] / 100));\n\t\t$clip_degrees = 90 / max($clipsize, 1);\n\t\t$points_tl = array(0, 0);\n\t\t$points_br = array($this->size[0], $this->size[1]);\n\t\t$points_tr = array($this->size[0], 0);\n\t\t$points_bl = array(0, $this->size[1]);\n\t\t$bgcolor = imagecolorallocate($this->im, hexdec(substr($this->Backgroundcolor, 1, 2)), hexdec(substr($this->Backgroundcolor, 3, 2)), hexdec(substr($this->Backgroundcolor, 5, 2)));\n\t\tfor($i = 0; $i < $clipsize; $i++){\n\t\t\t$x = $clipsize * cos(deg2rad($i * $clip_degrees));\n\t\t\t$y = $clipsize * sin(deg2rad($i * $clip_degrees));\n\t\t\tarray_push($points_tl, $clipsize - $x);\n\t\t\tarray_push($points_tl, $clipsize - $y);\n\t\t\tarray_push($points_tr, $this->size[0] - $clipsize + $x);\n\t\t\tarray_push($points_tr, $clipsize - $y);\n\t\t\tarray_push($points_br, $this->size[0] - $clipsize + $x);\n\t\t\tarray_push($points_br, $this->size[1] - $clipsize + $y);\n\t\t\tarray_push($points_bl, $clipsize - $x);\n\t\t\tarray_push($points_bl, $this->size[1] - $clipsize + $y);\n\t\t}\n\t\tarray_push($points_tl, $clipsize, 0);\n\t\tarray_push($points_br, $this->size[0] - $clipsize, $this->size[1]);\n\t\tarray_push($points_tr, $this->size[0] - $clipsize, 0);\n\t\tarray_push($points_bl, $clipsize, $this->size[1]);\n\t\tif($this->Clipcorner[2]){\n\t\t\t$random1 = rand(0, 1);\n\t\t\t$random2 = rand(0, 1);\n\t\t\t$random3 = rand(0, 1);\n\t\t\t$random4 = rand(0, 1);\n\t\t} else{\n\t\t\t$random1 = 1;\n\t\t\t$random2 = 1;\n\t\t\t$random3 = 1;\n\t\t\t$random4 = 1;\n\t\t}\n\t\tif($this->Clipcorner[3] && $random1){\n\t\t\timagefilledpolygon($this->im, $points_tl, count($points_tl) / 2, $bgcolor);\n\t\t}\n\t\tif($this->Clipcorner[4] && $random2){\n\t\t\timagefilledpolygon($this->im, $points_bl, count($points_bl) / 2, $bgcolor);\n\t\t}\n\t\tif($this->Clipcorner[5] && $random3){\n\t\t\timagefilledpolygon($this->im, $points_tr, count($points_tr) / 2, $bgcolor);\n\t\t}\n\t\tif($this->Clipcorner[6] && $random4){\n\t\t\timagefilledpolygon($this->im, $points_br, count($points_br) / 2, $bgcolor);\n\t\t}\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the sources of currency | public function getCurrencySources($currency)
{
$this->db->distinct();
$this->db->select("url");
$this->db->where('currency', $currency);
$this->db->where('status', 1);
return $this->db->get("zimrate");
} | [
"public function getCurrencyList();",
"public function getSourceCurrency();",
"public function getCurrencies();",
"public function get_sources() {\n\t\tif ( ! $this->get_id() ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$sources = get_transient( 'stripe_sources_' . $this->get_id() );\n\n\t\t$response = WC_Stripe_API::request(\n\t\t\tarray(\n\t\t\t\t'limit' => 100,\n\t\t\t),\n\t\t\t'customers/' . $this->get_id() . '/sources',\n\t\t\t'GET'\n\t\t);\n\n\t\tif ( ! empty( $response->error ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\tif ( is_array( $response->data ) ) {\n\t\t\t$sources = $response->data;\n\t\t}\n\n\t\treturn empty( $sources ) ? array() : $sources;\n\t}",
"public function getExchangeRatesProviders();",
"abstract public function getSupportedCurrencies();",
"public function getAvailableCurrencyCodes();",
"abstract public function retrieveCurrencies();",
"abstract protected function getSupportedCurrencies();",
"private function getCurrencies()\n {\n $array = array();\n foreach ($this->availableCurrencies as $currencyDetails) {\n $array[$currencyDetails['short']] = $currencyDetails;\n }\n return $array;\n }",
"public function getCurrencies(): iterable;",
"public function getCurrencies() {\n\n $currencies= array();\n $date = '';\n \n $client = \\Drupal::httpClient();\n $request = $client->get(self::LESSON3_RATES_SERVICE);\n $responseXML = $request->getBody();\n\n\n if (!empty($request) && isset($responseXML)) {\n\n $data = new \\SimpleXMLElement($responseXML);\n foreach ($data->Currency as $value) {\n $currencies[] = array(\n 'CharCode' => (string)$value->CharCode,\n 'Name' => (string)$value->Name,\n 'Rate' => (string)$value->Rate,\n );\n }\n\n foreach ($data->attributes() as $key => $val) {\n $date .= (string) $val;\n }\n \n \\Drupal::configFactory()\n ->getEditable('lesson3.settings')\n ->set('lesson3.currencies', $currencies)\n ->set('lesson3.date', $date)\n ->save();\n } \n\n return $currencies;\n }",
"public function getAllRates() {\n $rates = [];\n foreach ($this->sources as $src) {\n $json = file_get_contents($src);\n $source = json_decode($json);\n $rates = array_merge($rates, $this->prepareRates($source));\n }\n $rates = array_map(\"unserialize\", array_unique(array_map(\"serialize\", $rates)));\n\n return $rates;\n }",
"public function currencies(): array;",
"public function getAvailableCurrencies(): array;",
"public function filterDataProviderForExchangeRates() {\n return [ \n ['From', 'USD'],\n ['To', 'EUR'],\n ['From', 'TJS'],\n ['Status', 1],\n ['Status', 0],\n ['Date', '2016-07-05'],\n ['Date', '2016-06-30'], \n ];\n }",
"public static function getCurrencyList()\n\t{\n\t\trequire_once 'install/models/Currencies.php';\n\n\t\treturn $currencies;\n\t}",
"public function getAllCurrencies()\n {\n return array_merge($this->getWorldCurrencies(), $this->getCryptoCurrencies());\n }",
"function getAllCurrencyCodes(){\n $currCodes = XMLOperation::invoke(function($f){\n return $f\n ->setFilePath(\"currencies\")\n ->findElementsArray(\"//Ccy\");\n });\n\t\treturn array_unique($currCodes);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test Four tiles eight faces matching | public function testFiveTilesMatching($face1, $face2, $face3, $face4, $face5, $face6, $face7, $face8, $isMatching)
{
$grass = Tile::TILE_TYPE_GRASS;
//Create Tiles to Test
$tileA = Tile::createFromString("{$face1}:{$grass}:{$face1}:{$grass}:{$grass}");
$tileB = Tile::createFromString("{$grass}:{$face3}:{$grass}:{$face3}:{$grass}");
$tileC = Tile::createFromString("{$grass}:{$face6}:{$grass}:{$face6}:{$grass}");
$tileD = Tile::createFromString("{$face8}:{$grass}:{$face8}:{$grass}:{$grass}");
$tileE = Tile::createFromString("{$face2}:{$face5}:{$face7}:{$face4}:{$grass}");
$tileF = Tile::createFromString("{$face2}:{$face4}:{$face7}:{$face5}:{$grass}");
$tileG = Tile::createFromString("{$face7}:{$face5}:{$face2}:{$face4}:{$grass}");
$tileH = Tile::createFromString("{$face7}:{$face4}:{$face2}:{$face5}:{$grass}");
//Create Tiles array to add to Map
$tiles = array(
(new Coordinate(-1 , 2))->toHash() => $tileA,
(new Coordinate(1 , 2))->toHash() => $tileA,
(new Coordinate(-2 , 1))->toHash() => $tileB,
(new Coordinate(0 , 1))->toHash() => $tileC,
(new Coordinate(2 , 1))->toHash() => $tileB,
(new Coordinate(-1 , 0))->toHash() => $tileD,
(new Coordinate(1 , 0))->toHash() => $tileD,
(new Coordinate(-2 , -1))->toHash() => $tileB,
(new Coordinate(0 , -1))->toHash() => $tileC,
(new Coordinate(2 , -1))->toHash() => $tileB,
(new Coordinate(-1 , -2))->toHash() => $tileA,
(new Coordinate(1 , -2))->toHash() => $tileA,
);
//Create Map
$map = new Map(Tile::createFromString("{$grass}:{$grass}:{$grass}:{$grass}:{$grass}"));
//Make Map properties accessible
$mapReflection = new \ReflectionClass('Codecassonne\Map\Map');
$tilesReflection = $mapReflection->getProperty('tiles');
$tilesReflection->setAccessible(true);
//Get the Bag Tiles
$tilesReflection->setValue($map, $tiles);
//Call Playable Positions for played positions
$updatePlayableReflection = new \ReflectionMethod('Codecassonne\Map\Map', 'updatePlayablePositions');
$updatePlayableReflection->setAccessible(true);
$updatePlayableReflection->invoke($map, (new Coordinate(-1 , 2)));
$updatePlayableReflection->invoke($map, (new Coordinate(1 , 2)));
$updatePlayableReflection->invoke($map, (new Coordinate(-2 , 1)));
$updatePlayableReflection->invoke($map, (new Coordinate(0 , 1)));
$updatePlayableReflection->invoke($map, (new Coordinate(2 , 1)));
$updatePlayableReflection->invoke($map, (new Coordinate(-1 , 0)));
$updatePlayableReflection->invoke($map, (new Coordinate(1 , 0)));
$updatePlayableReflection->invoke($map, (new Coordinate(-2 , -1)));
$updatePlayableReflection->invoke($map, (new Coordinate(0 , -1)));
$updatePlayableReflection->invoke($map, (new Coordinate(2 , -1)));
$updatePlayableReflection->invoke($map, (new Coordinate(-1 , -2)));
$updatePlayableReflection->invoke($map, (new Coordinate(1 , -2)));
//Update the maps minimum bounding rectangle
$minimumBoundingRectangleReflection = new \ReflectionMethod('Codecassonne\Map\Map', 'updateMinimumBoundingRectangle');
$minimumBoundingRectangleReflection->setAccessible(true);
$minimumBoundingRectangleReflection->invoke($map, (new Coordinate(-2 , -2)));
$minimumBoundingRectangleReflection->invoke($map, (new Coordinate(2 , 2)));
//Test Placing Tile E
$this->placeTiles($map, $tileE, new Coordinate(-1, 1), $isMatching);
//Test Placing Tile F
$this->placeTiles($map, $tileF, new Coordinate(1, 1), $isMatching);
//Test Placing Tile G
$this->placeTiles($map, $tileG, new Coordinate(-1, -1), $isMatching);
//Test Placing Tile H
$this->placeTiles($map, $tileH, new Coordinate(1, -1), $isMatching);
} | [
"public function testNoResurectionWithFourNeighbours()\n {\n $seed = array(\n array(1, 0, 1),\n array(0, 0, 0),\n array(1, 0, 1)\n );\n\n $result = array(\n array(0, 0, 0),\n array(0, 0, 0),\n array(0, 0, 0)\n );\n\n $this->runEngineTest($seed, $result);\n }",
"public function testTwoTilesMatching($face1, $face2, $isMatching)\n {\n //Create starting tiles with all sides the first face (only matching one face at a time)\n $startingTile = Tile::createFromString($face1 . ':' . $face1 . ':' .$face1 . ':' .$face1 . ':' .$face1);\n\n //Creating a placing tile with all sides the second face (only matching one face at a time\n $placingTile = Tile::createFromString($face2 . ':' . $face2 . ':' .$face2 . ':' .$face2 . ':' .$face2);\n\n $map = new Map($startingTile);\n\n //Attempt to place the tile in the North location. Matching start Tile North, Place Tile South\n $this->placeTiles($map, $placingTile, new Coordinate(0, 1), $isMatching);\n\n //Attempt to place the tile in the East location. Matching start Tile East, Place Tile West\n $this->placeTiles($map, $placingTile, new Coordinate(1, 0), $isMatching);\n\n //Attempt to place the tile in the South location. Matching start Tile South, Place Tile North\n $this->placeTiles($map, $placingTile, new Coordinate(0, -1), $isMatching);\n\n //Attempt to place the tile in the West location. Matching start Tile West, Place Tile East\n $this->placeTiles($map, $placingTile, new Coordinate(-1, 0), $isMatching);\n }",
"function checkSolved() {\n\n $result = true;\n for ($c = 0; $c < 8; $c++)\n if ($this->corners[$c]->place != $c*3) {\n // echo \"corner \".$c.\": \".$this->corners[$c]->place.\"<br>\";\n $result = false;\n }\n for ($e = 0; $e < 12; $e++)\n if ($this->edges[$e]->place != $e*2) {\n // echo \"edge \".$e.\": \".$this->edges[$e]->place.\"<br>\";\n $result = false;\n }\n\n // no errors \n return $result;\n }",
"public function testGetFace($tile, $northFace, $eastFace, $southFace, $westFace, $center)\n {\n $this->assertSame($northFace, $tile->getFace('North'));\n $this->assertSame($eastFace, $tile->getFace('East'));\n $this->assertSame($southFace, $tile->getFace('South'));\n $this->assertSame($westFace, $tile->getFace('West'));\n $this->assertSame($center, $tile->getFace('Center'));\n }",
"function tileIsReachable($fig, $fig_pos, $dest_pos)\n{\n global $board;\n\n if ($fig_pos == $dest_pos)\n return;\n $result = 0;\n $fy = floor($fig_pos / 8);\n $fx = $fig_pos % 8;\n $dy = floor($dest_pos / 8);\n $dx = $dest_pos % 8;\n /* DEBUG: echo \"$fx,$fy--> $dx,$dy: \"; */\n switch ($fig) {\n /* knight */\n case 'N':\n if (abs($fx - $dx) == 1 && abs($fy - $dy) == 2)\n $result = 1;\n if (abs($fy - $dy) == 1 && abs($fx - $dx) == 2)\n $result = 1;\n break;\n /* bishop */\n case 'B':\n if (abs($fx - $dx) != abs($fy - $dy))\n break;\n if ($dy < $fy)\n $change = -8;\n else\n $change = 8;\n if ($dx < $fx)\n $change -= 1;\n else\n $change += 1;\n if (pathIsNotBlocked($fig_pos + $change, $dest_pos, $change))\n $result = 1;\n break;\n /* rook */\n case 'R':\n if ($fx != $dx && $fy != $dy)\n break;\n if ($fx == $dx) {\n if ($dy < $fy)\n $change = -8;\n else\n $change = 8;\n } else {\n if ($dx < $fx)\n $change = -1;\n else\n $change = 1;\n }\n if (pathIsNotBlocked($fig_pos + $change, $dest_pos, $change))\n $result = 1;\n break;\n /* queen */\n case 'Q':\n if (abs($fx - $dx) != abs($fy - $dy) && $fx != $dx && $fy != $dy)\n break;\n if (abs($fx - $dx) == abs($fy - $dy)) {\n if ($dy < $fy)\n $change = -8;\n else\n $change = 8;\n if ($dx < $fx)\n $change -= 1;\n else\n $change += 1;\n } else\n if ($fx == $dx) {\n if ($dy < $fy)\n $change = -8;\n else\n $change = 8;\n } else {\n if ($dx < $fx)\n $change = -1;\n else\n $change = 1;\n }\n if (pathIsNotBlocked($fig_pos + $change, $dest_pos, $change))\n $result = 1;\n break;\n /* king */\n case 'K':\n if (abs($fx - $dx) > 1 || abs($fy - $dy) > 1)\n break;\n $kings = 0;\n $adj_tiles = getAdjTiles($dest_pos);\n foreach ($adj_tiles as $tile)\n if ($board[$tile][1] == 'K')\n $kings++;\n if ($kings == 2)\n break;\n $result = 1;\n break;\n }\n\n /* DEBUG: echo \" $result<BR>\"; */\n return $result;\n}",
"public function testCellLivesWithTwoNeighbours()\n {\n $seed = array(\n array(1, 0, 0),\n array(1, 1, 0),\n array(0, 0, 0)\n );\n\n $result = array(\n array(1, 1, 0),\n array(1, 1, 0),\n array(0, 0, 0)\n );\n\n $this->runEngineTest($seed, $result); \n }",
"private function decide_which_get_captions()\n {\n # We will split the tile (along with its margins) into 12x12 squares.\n # A single geocache placed in square (x, y) gets the caption only\n # when there are no other geocaches in any of the adjacent squares.\n # This is efficient and yields acceptable results.\n\n $matrix = array();\n for ($i=0; $i<12; $i++)\n $matrix[] = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n\n foreach ($this->rows_ref as &$row_ref)\n {\n $mx = ($row_ref[1] + 64) >> 5;\n $my = ($row_ref[2] + 64) >> 5;\n if (($mx >= 12) || ($my >= 12)) continue;\n if (($matrix[$mx][$my] === 0) && ($row_ref[8] == 1)) # 8 is count\n $matrix[$mx][$my] = $row_ref[0]; # 0 is cache_id\n else\n $matrix[$mx][$my] = -1;\n }\n $selected_cache_ids = array();\n for ($mx=1; $mx<11; $mx++)\n {\n for ($my=1; $my<11; $my++)\n {\n if ($matrix[$mx][$my] > 0) # cache_id\n {\n # Check all adjacent squares.\n\n if ( ($matrix[$mx-1][$my-1] === 0)\n && ($matrix[$mx-1][$my ] === 0)\n && ($matrix[$mx-1][$my+1] === 0)\n && ($matrix[$mx ][$my-1] === 0)\n && ($matrix[$mx ][$my+1] === 0)\n && ($matrix[$mx+1][$my-1] === 0)\n && ($matrix[$mx+1][$my ] === 0)\n && ($matrix[$mx+1][$my+1] === 0)\n )\n $selected_cache_ids[] = $matrix[$mx][$my];\n }\n }\n }\n\n foreach ($this->rows_ref as &$row_ref)\n if (in_array($row_ref[0], $selected_cache_ids))\n $row_ref[6] |= TileTree::$FLAG_DRAW_CAPTION;\n }",
"private function testThree(){\r\n\t\t$this->obj->you->body = [\r\n\t\t\t$this->getCoordinateObj(4,5),\r\n\t\t\t$this->getCoordinateObj(5,5)\r\n\t\t];\r\n\t\t$exmoves = [\r\n\t\t\t\\models\\MoveTypes::$Up,\r\n\t\t\t\\models\\MoveTypes::$Down\r\n\t\t];\r\n\t\t$this->runTest($exmoves,\"two-cell left\");\r\n\t\t\r\n\t\t//2 cell snake going right\r\n\t\t$this->obj->you->body = [\r\n\t\t\t$this->getCoordinateObj(6,5),\r\n\t\t\t$this->getCoordinateObj(5,5)\r\n\t\t];\r\n\t\t$exmoves = [\r\n\t\t\t\\models\\MoveTypes::$Up,\r\n\t\t\t\\models\\MoveTypes::$Down\r\n\t\t];\r\n\t\t$this->runTest($exmoves,\"two-cell right\");\r\n\t\t\r\n\t\t//4 cell snake going left\r\n\t\t$this->obj->you->body = [\r\n\t\t\t$this->getCoordinateObj(2,5),\r\n\t\t\t$this->getCoordinateObj(3,5),\r\n\t\t\t$this->getCoordinateObj(4,5),\r\n\t\t\t$this->getCoordinateObj(5,5)\r\n\t\t];\r\n\t\t$exmoves = [\r\n\t\t\t\\models\\MoveTypes::$Up,\r\n\t\t\t\\models\\MoveTypes::$Down\r\n\t\t];\r\n\t\t$this->runTest($exmoves,\"four-cell left\");\r\n\t\t\r\n\t\t//4 cell snake going right\r\n\t\t$this->obj->you->body = [\r\n\t\t\t$this->getCoordinateObj(8,5),\r\n\t\t\t$this->getCoordinateObj(7,5),\r\n\t\t\t$this->getCoordinateObj(6,5),\r\n\t\t\t$this->getCoordinateObj(5,5)\r\n\t\t];\r\n\t\t$exmoves = [\r\n\t\t\t\\models\\MoveTypes::$Up,\r\n\t\t\t\\models\\MoveTypes::$Down\r\n\t\t];\r\n\t\t$this->runTest($exmoves,\"four-cell right\");\r\n\t}",
"function masonTiles() {\n\t\t\twhile(!$this->compArea()){\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\t//calcWidth remaining from out_array[beside]\n\t\t\t\t$width_remaining = self::PANEL_WIDTH - $this->width_used;\n\t\t\t\t\n\t\t\t\n\t\t\t//getRandomTile based on remaining\n\t\t\t\tswitch ($width_remaining) {\n\t\t\t\t\tcase 800:\n\t\t\t\t\tcase 640:\n\t\t\t\t\t\t$this->commitTile($this->getRandomTile(\"all\"), 0, $this->out_array[$this->out_index-1]->getWidth());\n\t\t\t\t\t\techo $this->out_array[$this->out_index-1]->getLeft();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 480:\n\t\t\t\t\tcase 320:\n\t\t\t\t\t\t$this->commitTile($this->getRandomTile(\"320\"), 0, $this->out_array[$this->out_index-1]->getWidth());\n\t\t\t\t\t\techo $this->out_array[$this->out_index-1]->getLeft();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 160:\n\t\t\t\t\t\t$this->commitTile($this->getRandomTile(\"160\"), 0, $this->out_array[$this->out_index-1]->getWidth());\n\t\t\t\t\t\techo $this->out_array[$this->out_index-1]->getLeft();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\techo $this->out_array[$this->out_index-1]->getLeft();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//ifRoom -> commitTile() top: 0, left: beside->getWidth + getLeft\n\t\t\t\n\t\t\t\t\n\t\t\t\techo $width_remaining;\n\t\t\t\n\t\t\t//calcHeight remaining from out_array[n-1]\n\t\t\t//getHeight from out_array[n-1]\n\t\t\t//if height > 160\n\t\t\t\t//getRandomTile based on remaining\n\t\t\t\t//ifRoom -> commitTile() top: above->getHeight + getTop, left: 0\n\t\t\t//else getLeft\n\t\t\t\t//calcWidth remaining from out_array[n-1]\n\t\t\t\t//ifRoom -> commitTile() top: above->getHeight + getTop, left: 0\n\t\t\t\n\t\t\t}\n\t\t}",
"function surface_area () {\n global $LavaVoxels ;\n\n $area = 0 ;\n\n foreach ($LavaVoxels as $k => $v) {\n list($x,$y,$z) = coords($k) ;\n \n $area += 6 ;\n \n $neighbors = facing_voxels($k) ;\n \n foreach ($neighbors as $n) {\n if (array_key_exists($n,$LavaVoxels)) {\n $area -= 1 ;\n }\n }\n }\n\n return $area ;\n}",
"abstract protected function get_surfaces();",
"public function testCreateFeaturesWithNonFeatureFace()\n {\n $factory = new Factory();\n\n // Get North tile on a tile that has no North feature\n $features = $factory->createFeatures(\n new Coordinate(0, 0),\n new Map(\n \\Codecassonne\\Tile\\Tile::createFromString(\n \\Codecassonne\\Tile\\Tile::TILE_TYPE_GRASS . \":\" .\n \\Codecassonne\\Tile\\Tile::TILE_TYPE_GRASS . \":\" .\n \\Codecassonne\\Tile\\Tile::TILE_TYPE_GRASS . \":\" .\n \\Codecassonne\\Tile\\Tile::TILE_TYPE_GRASS . \":\" .\n \\Codecassonne\\Tile\\Tile::TILE_TYPE_GRASS\n )\n )\n );\n\n // No features should be returned for a tile with no feature faces\n $this->assertCount(0, $features);\n }",
"public function testGetFilesByFingerPrintMatchesForGame()\n {\n $fingerprints = [1949504940, 1177254054];\n $fileIds = [3602226, 4096696];\n $files = $this->apiClient->getFilesByFingerPrintMatches($fingerprints, static::MINECRAFT_GAME_ID);\n\n $this->assertSameSize($fingerprints, $files->getExactFingerprints());\n $this->assertSameSize($fingerprints, $files->getExactMatches());\n foreach ($fileIds as $id) {\n $this->assertNotEmpty(array_filter($files->getExactMatches(),\n fn (FingerprintMatch $file) => $file->getFile()->getId() === $id));\n }\n }",
"function make8x8Tiles($source, $gd, $pal, $tileAddr, $bigendian = TRUE) \n{\n\tfseek($source, $tileAddr);\n\t$i = 0;\n\tfor($i= 0; $i < 256; $i++)\n\t{\n\t\t$j = 0;\n\t\tfor($j= 0; $j < 32; $j++)\n\t\t{\n\t\t\t$y = 0;\n\t\t\tfor($y= 0; $y < 8; $y++)\n\t\t\t{\n\t\t\t\t$x = 0;\n\t\t\t\tfor($x= 0; $x < 8; $x = $x + 2)\n\t\t\t\t{\n\t\t\t\t\t$byte = getByte($source);\n\t\t\t\t\t// Split a byte into nybbles\n\t\t\t\t\tif ($bigendian)\n\t\t\t\t\t{\n\t\t\t\t\t\t$leftpixel = floor($byte / 16);\n\t\t\t\t\t\t$rightpixel = ($byte % 16);\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$rightpixel = floor($byte / 16);\n\t\t\t\t\t\t$leftpixel = ($byte % 16);\n\t\t\t\t\t}\n\t\t\t\t\t//Paint the two pixels\n\t\t\t\t\timagesetpixel($gd, $x + ($j * 8), $y + ($i * 8), $pal[$leftpixel]);\n\t\t\t\t\timagesetpixel($gd, $x + 1 + ($j * 8), $y + ($i * 8), $pal[$rightpixel]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn $gd;\n}",
"function make8x8Tiles( $source, $gd, $pal, $tileAddr ) {\n\tfseek($source, $tileAddr);\n\t$i = 0;\n\tfor($i= 0; $i < 48; $i++)\n\t{\n\t\t$j = 0;\n\t\tfor($j= 0; $j < 32; $j++)\n\t\t{\n\t\t\t$y = 0;\n\t\t\tfor($y= 0; $y < 8; $y++)\n\t\t\t{\n\t\t\t\t$x = 0;\n\t\t\t\tfor($x= 0; $x < 8; $x = $x + 2)\n\t\t\t\t{\n\t\t\t\t\t$byte = getByte($source);\n\t\t\t\t\t// Split a byte into nybbles\n\t\t\t\t\t$rightpixel = floor($byte / 16);\n\t\t\t\t\t$leftpixel = ($byte % 16);\n\t\t\t\t\t//Paint the two pixels\n\t\t\t\t\timagesetpixel($gd, $x + ($j * 8), $y + ($i * 8), $pal[$leftpixel]);\n\t\t\t\t\timagesetpixel($gd, $x + 1 + ($j * 8), $y + ($i * 8), $pal[$rightpixel]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn $gd;\n}",
"function make8x8Tiles( $source, $gd, $pal, $tileAddr ) {\n\tfseek($source, $tileAddr);\n\t$i = 0;\n\tfor($i= 0; $i < 48; $i++)\n\t{\n\t\t$j = 0;\n\t\tfor($j= 0; $j < 32; $j++)\n\t\t{\n\t\t\t$y = 0;\n\t\t\tfor($y= 0; $y < 8; $y++)\n\t\t\t{\n\t\t\t\t$x = 0;\n\t\t\t\tfor($x= 0; $x < 8; $x = $x + 2)\n\t\t\t\t{\n\t\t\t\t\t$byte = getByte($source);\n\t\t\t\t\t// Split a byte into nybbles\n\t\t\t\t\t$leftpixel = floor($byte / 16);\n\t\t\t\t\t$rightpixel = ($byte % 16);\n\t\t\t\t\t//Paint the two pixels\n\t\t\t\t\timagesetpixel($gd, $x + ($j * 8), $y + ($i * 8), $pal[$leftpixel]);\n\t\t\t\t\timagesetpixel($gd, $x + 1 + ($j * 8), $y + ($i * 8), $pal[$rightpixel]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn $gd;\n}",
"function analyzeImageColors($im, $xCount = 3, $yCount = 3) {\n\t//get dimensions for image\n\t$imWidth = imagesx($im);\n\t$imHeight = imagesy($im);\n\t//find out the dimensions of the blocks we're going to make\n\t$blockWidth =round($imWidth/$xCount);\n\t$blockHeight =round($imHeight/$yCount);\n\t//now get the image colors...\n\tfor($x =0; $x < $xCount; $x++) { //cycle through the x-axis\n\t\tfor ($y =0; $y < $yCount; $y++) { //cycle through the y-axis\n\t\t\t//this is the start x and y points to make the block from\n\t\t\t$blockStartX =($x*$blockWidth);\n\t\t\t$blockStartY =($y*$blockHeight);\n\t\t\t//create the image we'll use for the block\n\t\t\t$block =imagecreatetruecolor(1, 1);\n\t\t\t//We'll put the section of the image we want to get a color for into the block\n\t\t\timagecopyresampled($block, $im, 0, 0, $blockStartX, $blockStartY, 1, 1, $blockWidth, $blockHeight );\n\t\t\t//the palette is where I'll get my color from for this block\n\t\t\timagetruecolortopalette($block, true, 1);\n\t\t\t//I create a variable called eyeDropper to get the color information\n\t\t\t$eyeDropper =imagecolorat($block, 0, 0);\n\t\t\t$palette =imagecolorsforindex($block, $eyeDropper);\n\t\t\t$colorArray[$x][$y]['r'] =$palette['red'];\n\t\t\t$colorArray[$x][$y]['g'] =$palette['green'];\n\t\t\t$colorArray[$x][$y]['b'] =$palette['blue'];\n\t\t\t//get the rgb value too\n\t\t\t$hex =sprintf(\"%02X%02X%02X\", $colorArray[$x][$y]['r'], $colorArray[$x][$y]['g'], $colorArray[$x][$y]['b']);\n\t\t\t$colorArray[$x][$y]['rgbHex'] = $hex;\n\t\t\t//destroy the block\n\t\t\timagedestroy($block);\n\t\t}\n\t}\n\t//destroy the source image\n\timagedestroy($im);\n\n\treturn $colorArray;\n}",
"private function validate_regions(){\n\n for ($row = 0; $row < 9; $row += 3) {\n for ($col = 0; $col < 9; $col += 3) {\n\n // validate each 3x3 region\n if (!$this->validate_region($row, $col)) {\n return false;\n }\n }\n }\n return true;\n }",
"public function testNextGenerationFrom6Neighbors()\n {\n // here we check for liveness of [5,5] specifically - previous tests were checking for known and expected total counts\n $this->lb->addOrganism(5, 5);\n for ($y = 4; $y <= 6; $y++) {\n $this->lb->addOrganism(4, $y);\n }\n $this->lb->addOrganism(5, 6);\n $this->lb->addOrganism(5, 4);\n $this->lb->addOrganism(6, 4);\n $lbNext = $this->livenessCalculator->getNextBoard($this->lb);\n $this->assertFalse($lbNext->isLive(5, 5));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the output canvas dimensions. If no canvas size is specified, margins are applied as a border around the image. | function setCanvasDimensions($width, $height) {
$this->setCanvasWidth($width);
$this->setCanvasHeight($height);
return $this;
} | [
"protected function createCanvas()\n {\n $w = 0;\n if($this->border instanceof Border){\n $w = $this->border->width();\n }\n\n $this->x = $this->radius + $w;\n $this->y = $this->radius + $w;\n\n $this->width = $this->x + $this->radius + $w + 1;\n $this->height = $this->y + $this->radius + $w + 1;\n $this->image = imagecreatetruecolor($this->width, $this->height);\n }",
"private function determineCanvasDimensions()\n {\n if($this->parameters->has('width') && $this->parameters->has('height')) {\n $this->y = clamp($this->parameters->get('height'), $this->min_y, $this->max_x);\n $this->x = clamp($this->parameters->get('width'), $this->min_x, $this->max_y);\n\n return;\n }\n\n if($this->parameters->has('height')) {\n $this->y = clamp($this->parameters->get('height'), $this->min_y, $this->max_x);\n $this->x = clamp($this->autoSizeWidthOnly(), $this->min_x, $this->max_y);\n\n return;\n }\n\n if($this->parameters->has('width')) {\n $this->x = clamp($this->parameters->get('width'), $this->min_x, $this->max_y);\n $this->y = clamp($this->autoSizeHeightOnly(), $this->min_y, $this->max_x);\n\n return;\n }\n\n $this->autoSizeBoth();\n }",
"function ImageResizeCanvas(\\raylib\\Image &$image, int $newWidth, int $newHeight, int $offsetX, int $offsetY, \\raylib\\Color $fill): void { }",
"public function ApplyMetricsToCanvas()\n\t{\n\t\t$destinationCanvas = @imageCreateTrueColor( $this->_metrics->frameWidth, $this->_metrics->frameHeight );\n\n\t\t$backColor = imagecolorallocate( $destinationCanvas, 255, 255, 255 );\n\n\t\tif( $this->_metrics->sourceFormat == 3 )\n\t\t{\n\t\t\t$backColor = imagecolorallocatealpha( $destinationCanvas, 255, 255, 255, 127 );\n\t\t\timagealphablending( $destinationCanvas, true );\n\t\t\timagesavealpha( $destinationCanvas, true );\n\t\t}\n\n\t\timagefill( $destinationCanvas, 1, 1, $backColor );\n\n\t\t@imageCopyResampled(\n\t\t\t$destinationCanvas,\n\t\t\t$this->GetCanvas(),\n\t\t\t$this->_metrics->offsetX, $this->_metrics->offsetY, 0, 0,\n\t\t\t$this->_metrics->scaleWidth, $this->_metrics->scaleHeight,\n\t\t\t$this->_metrics->sourceWidth, $this->_metrics->sourceHeight );\n\n\t\t$this->SetCanvas( $destinationCanvas );\n\n\t\t$this->_metrics->Commit();\n\t}",
"public function drawDimensions() {\n\t\tset_image_header();\n\n\t\t$this->selectTriggers();\n\t\t$this->calcDimentions();\n\n\t\tif (function_exists('imagecolorexactalpha') && function_exists('imagecreatetruecolor')\n\t\t\t\t&& @imagecreatetruecolor(1, 1)\n\t\t) {\n\t\t\t$this->im = imagecreatetruecolor(1, 1);\n\t\t}\n\t\telse {\n\t\t\t$this->im = imagecreate(1, 1);\n\t\t}\n\n\t\t$this->initColors();\n\n\t\timageOut($this->im);\n\t}",
"function setPrintCanvasMode($mode) {\n if (!preg_match(\"/(?i)^(default|fit|stretch)$/\", $mode))\n throw new Error(create_invalid_value_message($mode, \"setPrintCanvasMode\", \"image-to-image\", \"Allowed values are default, fit, stretch.\", \"set_print_canvas_mode\"), 470);\n \n $this->fields['print_canvas_mode'] = $mode;\n return $this;\n }",
"function SetBitmapMargins(wxSize $sz, $x, $y){}",
"private function _prepare_canvas()\n {\n $this->_params['canvas'] = array(\n 'center' => $this->_get_canvas_center(),\n 'color' => $this->_params['canvas_background']);\n }",
"function newOutputSize($width, $height, $mode = 0, $autorotate = false, $bgcolor = '#000000') {\n\t\tif ($width > 0 && $height > 0 && is_int($width) && is_int($height)) {\n\t\t\t//ignore aspectratio\n\t\t\tif (!$mode) {\n\t\t\t\t//do not crop to get correct aspectratio\n\t\t\t\t($width >= $height) ? ($this->_img['target']['bias'] = IMAGE_TOOLBOX_BIAS_HORIZONTAL) : ($this->_img['target']['bias'] = IMAGE_TOOLBOX_BIAS_VERTICAL);\n\t\t\t\tif ($this->_img['main']['bias'] == $this->_img['target']['bias'] || !$autorotate) {\n\t\t\t\t\t$this->_img['target']['width'] = $width;\n\t\t\t\t\t$this->_img['target']['height'] = $height;\n\t\t\t\t} else {\n\t\t\t\t\t$this->_img['target']['width'] = $height;\n\t\t\t\t\t$this->_img['target']['height'] = $width;\n\t\t\t\t}\n\t\t\t\t$this->_img['target']['aspectratio'] = $this->_img['target']['width'] / $this->_img['target']['height'];\n\t\t\t\t\n\t\t\t\t$cpy_w = $this->_img['main']['width'];\n\t\t\t\t$cpy_h = $this->_img['main']['height'];\n\t\t\t\t$cpy_w_offset = 0;\n\t\t\t\t$cpy_h_offset = 0;\n\t\t\t} elseif ($mode == 1) {\n\t\t\t\t//crop to get correct aspectratio\n\t\t\t\t($width >= $height) ? ($this->_img['target']['bias'] = IMAGE_TOOLBOX_BIAS_HORIZONTAL) : ($this->_img['target']['bias'] = IMAGE_TOOLBOX_BIAS_VERTICAL);\n\t\t\t\tif ($this->_img['main']['bias'] == $this->_img['target']['bias'] || !$autorotate) {\n\t\t\t\t\t$this->_img['target']['width'] = $width;\n\t\t\t\t\t$this->_img['target']['height'] = $height;\n\t\t\t\t} else {\n\t\t\t\t\t$this->_img['target']['width'] = $height;\n\t\t\t\t\t$this->_img['target']['height'] = $width;\n\t\t\t\t}\n\t\t\t\t$this->_img['target']['aspectratio'] = $this->_img['target']['width'] / $this->_img['target']['height'];\n\t\t\t\t\n\t\t\t\tif ($this->_img['main']['width'] / $this->_img['target']['width'] >= $this->_img['main']['height'] / $this->_img['target']['height']) {\n\t\t\t\t\t$cpy_h = $this->_img['main']['height'];\n\t\t\t\t\t$cpy_w = (integer) $this->_img['main']['height'] * $this->_img['target']['aspectratio'];\n\t\t\t\t\t$cpy_w_offset = (integer) ($this->_img['main']['width'] - $cpy_w) / 2;\n\t\t\t\t\t$cpy_h_offset = 0;\n\t\t\t\t} else {\n\t\t\t\t\t$cpy_w = $this->_img['main']['width'];\n\t\t\t\t\t$cpy_h = (integer) $this->_img['main']['width'] / $this->_img['target']['aspectratio'];\n\t\t\t\t\t$cpy_h_offset = (integer) ($this->_img['main']['height'] - $cpy_h) / 2;\n\t\t\t\t\t$cpy_w_offset = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($mode == 2) {\n\t\t\t\t//fill remaining background with a color to keep aspectratio\n\t\t\t\t$final_aspectratio = $width / $height;\n\t\t\t\tif ($final_aspectratio < $this->_img['main']['aspectratio']) {\n\t\t\t\t\t$this->_img['target']['width'] = $width;\n\t\t\t\t\t$this->_img['target']['height'] = (integer) $width / $this->_img['main']['aspectratio'];\n\t\t\t\t\t$cpy_w_offset2 = 0;\n\t\t\t\t\t$cpy_h_offset2 = (integer) (($height - $this->_img['target']['height']) / 2);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->_img['target']['height'] = $height;\n\t\t\t\t\t$this->_img['target']['width'] = (integer) $height * $this->_img['main']['aspectratio'];\n\t\t\t\t\t$cpy_h_offset2 = 0;\n\t\t\t\t\t$cpy_w_offset2 = (integer) (($width - $this->_img['target']['width']) / 2);\n\t\t\t\t}\n\t\t\t\t$this->_img['target']['aspectratio'] = $this->_img['main']['aspectratio'];\n\t\t\t\t$cpy_w = $this->_img['main']['width'];\n\t\t\t\t$cpy_h = $this->_img['main']['height'];\n\t\t\t\t$cpy_w_offset = 0;\n\t\t\t\t$cpy_h_offset = 0;\n\t\t\t}\n\t\t} elseif (($width == 0 && $height > 0) || ($width > 0 && $height == 0) && is_int($width) && is_int($height)) {\n\t\t\t//keep aspectratio\n\t\t\tif ($autorotate == true) {\n\t\t\t\tif ($this->_img['main']['bias'] == IMAGE_TOOLBOX_BIAS_HORIZONTAL && $width > 0) {\n\t\t\t\t\t$height = $width;\n\t\t\t\t\t$width = 0;\n\t\t\t\t} elseif ($this->_img['main']['bias'] == IMAGE_TOOLBOX_BIAS_VERTICAL && $height > 0) {\n\t\t\t\t\t$width = $height;\n\t\t\t\t\t$height = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t($width >= $height) ? ($this->_img['target']['bias'] = IMAGE_TOOLBOX_BIAS_HORIZONTAL) : ($this->_img['target']['bias'] = IMAGE_TOOLBOX_BIAS_VERTICAL);\n\t\t\tif ($width != 0) {\n\t\t\t\t$this->_img['target']['width'] = $width;\n\t\t\t\t$this->_img['target']['height'] = (integer) $width / $this->_img['main']['aspectratio'];\n\t\t\t} else {\n\t\t\t\t$this->_img['target']['height'] = $height;\n\t\t\t\t$this->_img['target']['width'] = (integer) $height * $this->_img['main']['aspectratio'];\n\t\t\t}\n\t\t\t$this->_img['target']['aspectratio'] = $this->_img['main']['aspectratio'];\n\t\t\t\n\t\t\t$cpy_w = $this->_img['main']['width'];\n\t\t\t$cpy_h = $this->_img['main']['height'];\n\t\t\t$cpy_w_offset = 0;\n\t\t\t$cpy_h_offset = 0;\n\t\t} else {\n\t\t\ttrigger_error($this->_error_prefix . 'Outputwidth and -height must be integers greater zero.', E_USER_ERROR);\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t//create resized picture\n\t\t$functionname = $this->_imagecreatefunction;\n\t\t$dummy = $functionname($this->_img['target']['width'] + 1, $this->_img['target']['height'] + 1);\n\t\teval($this->_resize_function . '($dummy, $this->_img[\"main\"][\"resource\"], 0, 0, $cpy_w_offset, $cpy_h_offset, $this->_img[\"target\"][\"width\"], $this->_img[\"target\"][\"height\"], $cpy_w, $cpy_h);');\n\t\tif ($mode == 2) {\n\t\t\t$this->_img['target']['resource'] = $functionname($width, $height);\n\t\t\t$fillcolor = $this->_hexToPHPColor($bgcolor);\n imagefill($this->_img['target']['resource'], 0, 0, $fillcolor);\n\t\t} else {\n\t\t\t$this->_img['target']['resource'] = $functionname($this->_img['target']['width'], $this->_img['target']['height']);\n\t\t\t$cpy_w_offset2 = 0;\n\t\t\t$cpy_h_offset2 = 0;\n\t\t}\n\t\timagecopy($this->_img['target']['resource'], $dummy, $cpy_w_offset2, $cpy_h_offset2, 0, 0, $this->_img['target']['width'], $this->_img['target']['height']);\n\t\timagedestroy($dummy);\n\t\t\n\t\tif ($mode == 2) {\n\t\t\t$this->_img['target']['width'] = $width;\n $this->_img['target']['height'] = $height;\n }\n\t\t//update _img['main'] with new data\n\t\tforeach ($this->_img['target'] as $key => $value) {\n\t\t\t$this->_img['main'][$key] = $value;\n\t\t}\n\t\tunset ($this->_img['target']);\n\t\t\n\t\treturn true;\n\t}",
"public function setWidthAndHeight()\n {\n $this->width = $this->layer->getWidth();\n $this->height = $this->layer->getHeight();\n }",
"protected function setImageSize()\n {\n $this->width = imagesx($this->file);\n $this->height = imagesy($this->file);\n }",
"private function setImageDimensions()\n {\n global $Core;\n\n if ($this->allowedSizes) {\n if (!isset($this->allowedSizes[$this->sizeType]) || !isset($this->allowedSizes[$this->sizeType][$this->sizeKey])) {\n $Core->doOrDie();\n } else {\n $this->width = $this->allowedSizes[$this->sizeType][$this->sizeKey]['width'];\n $this->height = $this->allowedSizes[$this->sizeType][$this->sizeKey]['height'];\n }\n }\n }",
"function SetToolBitmapSize(wxSize $size){}",
"public function setCropBoxSize(int $width, int $height);",
"function SetPlotAreaPixels($x1 = NULL, $y1 = NULL, $x2 = NULL, $y2 = NULL)\n {\n $this->x_left_margin = $x1;\n $this->x_right_margin = isset($x2) ? $this->image_width - $x2 : NULL;\n $this->y_top_margin = $y1;\n $this->y_bot_margin = isset($y2) ? $this->image_height - $y2 : NULL;\n return TRUE;\n }",
"function canvasactions_definecanvas_image(& $image, $action = array()) {\r\n \r\n // May be given either exact or relative dimensions.\r\n if ($action['exact']['width'] || $action['exact']['width']) {\r\n // Allows only one dimension to be used if the other is unset.\r\n if (! $action['exact']['width']) $action['exact']['width'] = $image->info['width'];\r\n if (! $action['exact']['height']) $action['exact']['height'] = $image->info['height'];\r\n\r\n $targetsize['width'] = _imagecache_percent_filter($action['exact']['width'], $image->info['width']);\r\n $targetsize['height'] = _imagecache_percent_filter($action['exact']['height'], $image->info['height']);\r\n\r\n $targetsize['left'] = _imagecache_keyword_filter($action['exact']['xpos'], $targetsize['width'], $image->info['width']);\r\n $targetsize['top'] = _imagecache_keyword_filter($action['exact']['ypos'], $targetsize['height'], $image->info['height']);\r\n\r\n }\r\n else {\r\n // calculate relative size\r\n $targetsize['width'] = $image->info['width'] + $action['relative']['leftdiff'] + $action['relative']['rightdiff'];\r\n $targetsize['height'] = $image->info['height'] + $action['relative']['topdiff'] + $action['relative']['bottomdiff'];\r\n $targetsize['left'] = $action['relative']['leftdiff'];\r\n $targetsize['top'] = $action['relative']['topdiff'];\r\n }\r\n \r\n $newcanvas = imagecreatetruecolor($targetsize['width'], $targetsize['height']);\r\n $RGB = $action['RGB'];\r\n\r\n // convert from hex (as it is stored in the UI)\r\n if($RGB['HEX'] && $deduced = hex_to_rgb($RGB['HEX'])) {\r\n $RGB = array_merge($RGB, $deduced);\r\n }\r\n\r\n if ($RGB['red'] || $RGB['green'] || $RGB['blue']) { // one may be zero...\r\n $background = imagecolorallocate($newcanvas, $RGB['red'], $RGB['green'], $RGB['blue']);\r\n }\r\n else {\r\n // No color, attempt transparency, assume white\r\n $background = imagecolorallocatealpha($newcanvas, 255, 255, 255, 127);\r\n imagesavealpha($newcanvas, TRUE);\r\n imagealphablending($newcanvas, false);\r\n imagesavealpha($image->res, TRUE);\r\n }\r\n imagefilledrectangle($newcanvas, 0, 0, $targetsize['width'], $targetsize['height'], $background);\r\n \r\n if ($action['under']) {\r\n require_once('watermark.inc');\r\n $watermark = new watermark();\r\n $image->res = $watermark->create_watermark($newcanvas, $image->res, $targetsize['left'], $targetsize['top'], 100);\r\n imagesavealpha($image->res, TRUE);\r\n } \r\n else {\r\n $image->res = $newcanvas ;\r\n }\r\n \r\n $image->info['width'] = $targetsize['width'];\r\n $image->info['height'] = $targetsize['height'];\r\n return TRUE;\r\n}",
"function FitThisSizeToPageMargins(wxSize $imageSize, wxPageSetupDialogData $pageSetupData){}",
"function build_cropCanvas($cropConf=array())\r\n {\r\n $conf['imgSrc'] = (isset($cropConf['imgSrc'])) ? $cropConf['imgSrc'] : false;\r\n $conf['uniqueID'] = (isset($cropConf['uniqueID'])) ? $cropConf['uniqueID'] : false;\r\n $conf['cropSize'] = (isset($cropConf['cropSize'])) ? $cropConf['cropSize'] : false;\r\n $conf['imgUrl'] = (isset($cropConf['imgUrl'])) ? $cropConf['imgUrl'] : false;\r\n $conf['submitUrl'] = (isset($cropConf['submitUrl'])) ? $cropConf['submitUrl'] : false;\r\n $conf['include_freeResize'] = (isset($cropConf['include_freeResize'])) ? $cropConf['include_freeResize'] : false;\r\n $conf['ajaxSubmit'] = (isset($cropConf['ajaxSubmit'])) ? $cropConf['ajaxSubmit'] : false;\r\n \r\n foreach($conf as $key=>$c)\r\n if($c==false && $key!='ajaxSubmit') return 'Insufficient Parameter options';\r\n \r\n #echo $conf['imgSrc'];\r\n $size = getimagesize($conf['imgSrc']);\r\n $img_name = explode(\"/\", $conf['imgSrc']);\r\n $img_name = end($img_name);\r\n \r\n //img size option\r\n $option = $img_dest = $savePath = '';\r\n foreach($conf['cropSize']['size'] as $key=>$i)\r\n {\r\n #$option .= '<option value=\"'.$i.'\">'.$i.'</option>';\r\n $img_dest .= 'img_dest[\"'.$i.'\"] = \"'.$conf['cropSize']['path'][$key].'\"; '; \r\n if(!$savePath) $savePath = $conf['cropSize']['path'][$key] . (($conf['uniqueID']) ? $conf['uniqueID'].'/' : '');\r\n }\r\n #$option .= '<option value=\"200x100\">200x100</option>';\r\n if($conf['include_freeResize']) $option .= '<option value=\"free\">Free Size</option>';\r\n //end \r\n #echo '<pre>'; print_r($img_dest); echo '</pre>';\r\n \r\n $content = '\r\n <div style=\"min-width:700px; padding:10px 0 10px 30px;\">\r\n <form id=\"frCrop\" action=\"'.$conf['submitUrl'].'\" method=\"POST\">\r\n <div class=\"row-fluid\">\r\n <div class=\"span4\">\r\n <h3>Cropping Setting</h3> \r\n <label>Cropped Image size : </label>\r\n <select name=\"cSize\" id=\"cSize\">'.$option.'</select>\r\n <input type=\"hidden\" name=\"img_newName\" value=\"'.$img_name.'\" />\r\n <input type=\"hidden\" name=\"uniqueID\" value=\"'.$conf['uniqueID'].'\" />\r\n \r\n <input type=\"hidden\" id=\"x\" name=\"x\" />\r\n \t\t<input type=\"hidden\" id=\"y\" name=\"y\" />\r\n \t\t<input type=\"hidden\" id=\"w\" name=\"w\" />\r\n \t\t<input type=\"hidden\" id=\"h\" name=\"h\" />\r\n <input type=\"hidden\" id=\"img_real\" name=\"img_real\" value=\"'.$conf['imgUrl'].'\" />\r\n <label>Cropped Image destination : </label> \r\n <input type=\"hidden\" name=\"dest_path\" id=\"dest_path\" value=\"'.$savePath.'\" />\r\n \r\n <div class=\"alert\">select image size then drag mouse inside image area to crop !</div>\r\n <input type=\"button\" value=\"Crop\" name\"crop\" id\"Savecrop\" class=\"btn btn-primary\" onclick=\"act_cropSave()\" />\r\n <span id=\"sp-loadCrop\" class=\"hide\"><img src=\"/media/img/loading.gif\" alt=\"loading\" /> loading..</span>\r\n </div>\r\n <div style=\"float:left; width:600px; margin-left:20px;\">\r\n <img src=\"'.$conf['imgUrl'].'\" id=\"cropbox\" width=\"600\" />\r\n </div>\r\n </div>\r\n </form>\r\n <br class=\"clear\" />\r\n </div>\r\n <script>\r\n function initCrop(){ \r\n var img_dest = new Array(); \r\n '.$img_dest.'\r\n var snil = $(\"#cSize\").val();\r\n nil = snil.split(\"x\");\r\n \r\n var jcrop_api = $.Jcrop(\\'#cropbox\\', { \r\n trueSize: ['.$size[0].','.$size[1].'],\r\n aspectRatio: nil[0] / nil[1],\r\n onSelect: updateCoords\r\n });\r\n \r\n $(\"#cSize\").bind(\"change\", function(){\r\n var snil = $(this).val();\r\n nil = snil.split(\"x\");\r\n alert(nil);\r\n jcrop_api.setOptions({\r\n aspectRatio: nil[0] / nil[1]\r\n });\r\n $(\"#dest_path\").val( img_dest[snil] );\r\n });\r\n \r\n ' . (($conf['ajaxSubmit']) ? ('\r\n $(\"#frCrop\").ajaxForm({\r\n dataType: \"json\", \r\n beforeSubmit: function(){\r\n $(\"#sp-loadCrop\").show();\r\n }, \r\n success: function(data){\r\n //alert(data);\r\n $(\".alert\").replaceWith(data.msg);\r\n $(\"#sp-loadCrop\").hide();\r\n } \r\n });\r\n ') : '') . '\r\n \r\n function updateCoords(c)\r\n \t\t\t{\r\n \t\t\t\t$(\"#x\").val(c.x);\r\n \t\t\t\t$(\"#y\").val(c.y);\r\n \t\t\t\t$(\"#w\").val(c.w);\r\n \t\t\t\t$(\"#h\").val(c.h);\r\n \t\t\t};\r\n \r\n \t\t\tfunction checkCoords()\r\n \t\t\t{\r\n \t\t\t\tif (parseInt($(\"#w\").val())) return true;\r\n \t\t\t\talert(\"Please select a crop region then press submit.\");\r\n \t\t\t\treturn false;\r\n \t\t\t};\r\n }\r\n </script>\r\n ';\r\n \r\n return $content;\r\n }",
"function canvasactions_definecanvas_form($action) {\n if (image_get_toolkit() != 'gd') {\n drupal_set_message('Define Canvas not currently supported by using imagemagick. This effect requires GD image toolkit only.', 'warning');\n }\n $defaults = array(\n 'RGB' => array(\n 'HEX' => '#333333',\n ),\n 'under' => TRUE,\n 'exact' => array(\n 'width' => '',\n 'height' => '',\n 'xpos' => 'center',\n 'ypos' => 'center',\n ),\n 'relative' => array(\n 'leftdiff' => '',\n 'rightdiff' => '',\n 'topdiff' => '',\n 'bottomdiff' => '',\n ),\n );\n $action = array_merge($defaults, (array) $action);\n\n $form = array(\n 'RGB' => imagecache_rgb_form($action['RGB']),\n 'help' => array(\n '#type' => 'markup',\n '#value' => t('Enter no color value for transparent. This will have the effect of adding clear margins around the image.'),\n '#prefix' => '<p>',\n '#suffix' => '</p>',\n ),\n 'under' => array(\n '#type' => 'checkbox',\n '#title' => t('Resize canvas <em>under</em> image (possibly cropping)'),\n '#default_value' => $action['under'],\n '#description' => t('If <em>not</em> set, this will create a solid flat layer, probably totally obscuring the source image'),\n ),\n );\n $form['info'] = array('#value' => t('Enter values in ONLY ONE of the below options. Either exact or relative. Most values are optional - you can adjust only one dimension as needed. If no useful values are set, the current base image size will be used.'));\n $form['exact'] = array(\n '#type' => 'fieldset',\n '#collapsible' => TRUE,\n '#title' => 'Exact size',\n 'help' => array(\n '#type' => 'markup',\n '#value' => t('Set the canvas to a precise size, possibly cropping the image. Use to start with a known size.'),\n '#prefix' => '<p>',\n '#suffix' => '</p>',\n ),\n 'width' => array(\n '#type' => 'textfield',\n '#title' => t('Width'),\n '#default_value' => $action['exact']['width'],\n '#description' => t('Enter a value in pixels or percent'),\n '#size' => 5,\n ),\n 'height' => array(\n '#type' => 'textfield',\n '#title' => t('Height'),\n '#default_value' => $action['exact']['height'],\n '#description' => t('Enter a value in pixels or percent'),\n '#size' => 5,\n ),\n );\n $form['exact'] = array_merge($form['exact'], imagecache_actions_pos_form($action['exact']));\n if (! $action['exact']['width'] && !$action['exact']['height']) {\n $form['exact']['#collapsed'] = TRUE;\n }\n\n $form['relative'] = array(\n '#type' => 'fieldset',\n '#collapsible' => TRUE,\n '#title' => t('Relative size'),\n 'help' => array(\n '#type' => 'markup',\n '#value' => '<p>' . t('Set the canvas to a relative size, based on the current image dimensions. Use to add simple borders or expand by a fixed amount. Negative values may crop the image.') . '</p>',\n ),\n 'leftdiff' => array(\n '#type' => 'textfield',\n '#title' => t('left difference'),\n '#default_value' => $action['relative']['leftdiff'],\n '#size' => 6,\n '#description' => t('Enter an offset in pixels.'),\n ),\n 'rightdiff' => array(\n '#type' => 'textfield',\n '#title' => t('right difference'),\n '#default_value' => $action['relative']['rightdiff'],\n '#size' => 6,\n '#description' => t('Enter an offset in pixels.'),\n ),\n 'topdiff' => array(\n '#type' => 'textfield',\n '#title' => t('top difference'),\n '#default_value' => $action['relative']['topdiff'],\n '#size' => 6,\n '#description' => t('Enter an offset in pixels.'),\n ),\n 'bottomdiff' => array(\n '#type' => 'textfield',\n '#title' => t('bottom difference'),\n '#default_value' => $action['relative']['bottomdiff'],\n '#size' => 6,\n '#description' => t('Enter an offset in pixels.'),\n ),\n );\n if (! $action['relative']['leftdiff'] && !$action['relative']['rightdiff'] && !$action['relative']['topdiff'] && !$action['relative']['bottomdiff']) {\n $form['relative']['#collapsed'] = TRUE;\n }\n\n $form['#submit'][] = 'canvasactions_definecanvas_form_submit';\n return $form;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the last ClassLoader Reader | public function getLastReader()
{
$classLoader = $this->getLastClassLoader();
if ($classLoader) {
return new ClassLoaderReader($classLoader);
}
return new CompositeClassLoaderReader;
} | [
"public function getFirstClassLoader()\n {\n $classLoaders = static::getClassLoaders();\n\n if (!count($classLoaders)) {\n return null;\n }\n\n return $classLoaders[0];\n }",
"public static function lastLoaded(): ?File\n {\n return self::$lastLoadedFile;\n }",
"public function getReader($class);",
"protected function getRegistryLoader()\n {\n return $this->registryLoader;\n }",
"public function getLoader()\n {\n return Provider::getServices()->get('ClassLoader');\n }",
"protected function getReader()\n {\n return $this->reader;\n }",
"protected function getLoader()\n {\n return $this->loader;\n }",
"public function getLoader()\n {\n return $this->_loader;\n }",
"public function getLoader()\n {\n return $this->loader;\n }",
"public function getLoader() {\n return $this->loader;\n }",
"public function getReader() {\n\t\treturn singleton('ContentService')->getReader($this->getContentId());\n\t}",
"public function getReader()\n {\n return $this->reader;\n }",
"public function getAnnotationReader()\n {\n\n // query whether or not an instance already exists\n if (AbstractDescriptor::$annotationReaderInstance === null) {\n AbstractDescriptor::$annotationReaderInstance = new AnnotationReader();\n }\n\n // return the instance\n return AbstractDescriptor::$annotationReaderInstance;\n }",
"public static function pop()\n {\n $loader = self::$loader;\n if (!empty(self::$stack)) {\n self::$loader = array_pop(self::$stack);\n }\n return $loader;\n }",
"private function getReader() {\n // If the annotation reader isn't set, create it.\n if (!$this->reader) {\n $this->reader = Reader::createFromDefaults();\n }\n\n return $this->reader;\n }",
"protected function getWorkingReader()\n {\n static $reader;\n\n // Reader aready created\n if ($reader)\n {\n return $reader;\n }\n\n // The path to the data source\n $file_path = realpath(__DIR__.'/logs/raceroom-server/qualify.and.race.json');\n\n // Get the data reader for the given data source\n $reader = Data_Reader::factory($file_path);\n\n // Return reader\n return $reader;\n }",
"public static function getReaderManager()\n {\n if (static::$readers === null) {\n static::$readers = new ReaderManager();\n }\n return static::$readers;\n }",
"public function getLoader(): Loader\n {\n return $this->loader;\n }",
"public function loadLastJob() {\n return $this->getFilesystem()->load();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
recibe una columna y una tabla y devuelve verdadero si la columna pertenece a la tabla y falso en caso contrario | function pertenece_a_tabla(&$col, $tabla)
{
// si no está seteado $col['tabla'] entonces no puede ser un ap
// multitabla, por tanto todas las columnas perteneces a la tabla $this->_tabla
// porque no hay otra ;)
return !isset($col['tabla']) || $tabla == $col['tabla'];
} | [
"function PCO_ConsultarColumnas($tabla,$ConexionAlterna=\"\",$MotorAlterno=\"\",$BaseDatosAlterna=\"\")\n\t{\n\t\tglobal $MULTILANG_ErrorTiempoEjecucion;\n\t\t//Determina si se debe usar la conexion global del sistema o una especifica de usuario\n\t\tif($ConexionAlterna==\"\")\n\t\t {\n\t\t\t global $ConexionPDO;\n \t\t\tglobal $MotorBD;\n \t\t\tglobal $BaseDatos;\n\t\t }\n\t\telse\n\t\t {\n\t\t\t $ConexionPDO=$ConexionAlterna;\n \t\t\t$MotorBD=$MotorAlterno;\n \t\t\t$BaseDatos=$BaseDatosAlterna;\n\t\t }\n\n\t\t//Busca los campos dependiendo del motor de BD configurado actualmente\n\t\tif ($MotorBD==\"mysql\" || $MotorBD==\"sqlsrv\" || $MotorBD==\"mssql\" || $MotorBD==\"ibm\" || $MotorBD==\"dblib\" || $MotorBD==\"odbc\" || $MotorBD==\"oracle\" || $MotorBD==\"ifmx\" || $MotorBD==\"fbd\")\n\t\t\t{\n\t\t\t\t$columna=0;\n\t\t\t\t$resultado=PCO_EjecutarSQL(\"DESCRIBE $tabla \",\"\",$ConexionPDO,1);\n\t\t\t\t//echo $resultado;\n\t\t\t\t//Evalua si se retorno 1 (error) por la funcion para saber si sigue o no\n\t\t\t\t//if($resultado!=\"1\")\n\t\t\t\t\t{\n\t\t\t\t\t\twhile($registro = $resultado->fetch())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$columnas[$columna][\"nombre\"] = $registro[\"Field\"];\n\t\t\t\t\t\t\t\t$columnas[$columna][\"tipo\"] = $registro[\"Type\"];\n\t\t\t\t\t\t\t\t$columnas[$columna][\"nulo\"] = $registro[\"Null\"];\n\t\t\t\t\t\t\t\t$columnas[$columna][\"llave\"] = $registro[\"Key\"];\n\t\t\t\t\t\t\t\t$columnas[$columna][\"predefinido\"] = $registro[\"Default\"];\n\t\t\t\t\t\t\t\t$columnas[$columna][\"extras\"] = $registro[\"Extra\"];\n\t\t\t\t\t\t\t\t$columna++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t/*else\n\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$columnas[$columna][\"nombre\"] = \"ERROR: Tabla no conectada\";\n\t\t\t\t\t\t\t\t$columnas[$columna][\"tipo\"] = \"ERROR: Tabla no conectada\";\n\t\t\t\t\t\t\t\t$columnas[$columna][\"nulo\"] = \"ERROR: Tabla no conectada\";\n\t\t\t\t\t\t\t\t$columnas[$columna][\"llave\"] = \"ERROR: Tabla no conectada\";\n\t\t\t\t\t\t\t\t$columnas[$columna][\"predefinido\"] = \"ERROR: Tabla no conectada\";\n\t\t\t\t\t\t\t\t$columnas[$columna][\"extras\"] = \"ERROR: Tabla no conectada\";\n\t\t\t\t\t\t\t\t$columna++;\n\t\t\t\t\t}*/\n\t\t\t}\n\n\t\tif ($MotorBD==\"pgsql\")\n\t\t\t{\n\t\t\t\t$columna=0;\n\t\t\t\t$resultado=PCO_EjecutarSQL(\"SELECT * from INFORMATION_SCHEMA.COLUMNS where table_name = ? \",\"$tabla\",$ConexionPDO,1);\n\t\t\t\twhile($registro = $resultado->fetch())\n\t\t\t\t\t{\n\t\t\t\t\t\t$columnas[$columna][\"nombre\"] = $registro[\"column_name\"];\n\t\t\t\t\t\t$columnas[$columna][\"tipo\"] = $registro[\"data_type\"];\n\t\t\t\t\t\t$columnas[$columna][\"nulo\"] = $registro[\"is_nullable\"];\n\t\t\t\t\t\t$columnas[$columna][\"llave\"] = \"\";\n\t\t\t\t\t\t$columnas[$columna][\"predefinido\"] = $registro[\"column_default\"];\n\t\t\t\t\t\t$columnas[$columna][\"extras\"] = $registro[\"udt_name\"];\n\t\t\t\t\t\t$columna++;\n\t\t\t\t\t}\n\t\t\t}\n\n\t\tif ($MotorBD==\"sqlite\")\n\t\t\t{\n\t\t\t\t$columna=0;\n\t\t\t\t$resultado=PCO_EjecutarSQL(\"SELECT * FROM sqlite_master WHERE type='table' AND name=? \",\"$tabla\",$ConexionPDO,1);\n\t\t\t\t$registro = $resultado->fetch();\n\t\t\t\t//Toma los campos encontrados en el SQL de la tabla, los separa y los depura para devolver valores\n\t\t\t\t$campos=explode(\",\",$registro[\"sql\"]);\n\t\t\t\tfor($i=0;$i<count($campos);$i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$campos[$i]=trim($campos[$i]); // Elimina espacios al comienzo y final\n\t\t\t\t\t\t$campos[$i]=str_replace(\" \",\" \",$campos[$i]); //Elimina espacios dobles\n\t\t\t\t\t\tif ($i==0) $campos[$i]=str_replace(\"CREATE TABLE $tabla (\",\"\",$campos[$i]); //Elimina instruccion create del primer campo\n\t\t\t\t\t\tif ($i==count($campos)-1) $campos[$i]=str_replace(\"))\",\")\",$campos[$i]); //Elimina ultimos parentesis\n\t\t\t\t\t\t//echo $i.\" valor:\".$campos[$i].\"<hr>\"; // Usado para depuracion en tiempo de desarrollo\n\t\t\t\t\t\t$analisis_campo=explode(\" \",$campos[$i]);\n\t\t\t\t\t\t$columnas[$columna][\"nombre\"] = $analisis_campo[0];\n\t\t\t\t\t\t$columnas[$columna][\"tipo\"] = $analisis_campo[1];\n\t\t\t\t\t\t$palabra_siguiente=2;\n\t\t\t\t\t\tif (trim(strtoupper($analisis_campo[$palabra_siguiente]))==\"PRIMARY\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$columnas[$columna][\"llave\"] = $analisis_campo[$palabra_siguiente];\n\t\t\t\t\t\t\t\t$palabra_siguiente+=2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (trim(strtoupper($analisis_campo[$palabra_siguiente]))==\"NOT\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$columnas[$columna][\"nulo\"] = $analisis_campo[$palabra_siguiente].\" \".$analisis_campo[$palabra_siguiente+1];\n\t\t\t\t\t\t\t\t$palabra_siguiente+=2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (trim(strtoupper($analisis_campo[$palabra_siguiente]))==\"DEFAULT\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$columnas[$columna][\"predefinido\"] = $analisis_campo[$palabra_siguiente+1];\n\t\t\t\t\t\t\t\t$palabra_siguiente+=2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$columnas[$columna][\"extras\"] = $registro[\"\"];\n\t\t\t\t\t\t$columna++;\n\t\t\t\t\t}\n\t\t\t}\n\n\n\t\t//Retorna el arreglo asociativo\n\t\treturn $columnas;\n\n\n\t\t/*//Forma 1 (General solo nombres)\n\t\t$resultado=PCO_EjecutarSQL(\"SELECT * FROM \".$tabla);\n\t\t$columnas = array();\n\t\tforeach($resultado->fetch(PDO::FETCH_ASSOC) as $key=>$val)\n\t\t\t{\n\t\t\t\t$columnas[][\"nombre\"] = $key;\n\t\t\t}\n\t\treturn $columnas;*/\n\n\t\t/*//Forma 2\n\t\t$resultado=PCO_EjecutarSQL(\"SELECT * FROM \".$tabla);\n\t\t$columnas = array();\n\t\tfor ($i = 0; $i < $resultado->columnCount(); $i++)\n\t\t\t{\n\t\t\t\t$col = $resultado->getColumnMeta($i);\n\t\t\t\t$columnas[] = $col['name'];\n\t\t\t}\n\t\treturn $columnas;*/\n\t}",
"public function needsTableColumn()\n {\n return in_array($this->type, static::USES_COLUMN, true);\n }",
"function PCO_ExisteCampoTabla($campo,$tabla,$ConexionAlterna=\"\",$MotorAlterno=\"\",$BaseDatosAlterna=\"\")\n\t{\n\t\t//Determina si se debe usar la conexion global del sistema o una especifica de usuario\n\t\tif($ConexionAlterna==\"\")\n\t\t {\n\t\t\t global $ConexionPDO;\n \t\t\tglobal $MotorBD;\n \t\t\tglobal $BaseDatos;\n\t\t }\n\t\telse\n\t\t {\n\t\t\t $ConexionPDO=$ConexionAlterna;\n \t\t\t$MotorBD=$MotorAlterno;\n \t\t\t$BaseDatos=$BaseDatosAlterna;\n\t\t }\n\n\t\t//Asume que el campo no existe\n\t\t$estado=false;\n\n\t\t//Busca todos los campos de la tabla\n\t\tif($ConexionAlterna!=\"\")\n\t\t $resultadocampos=PCO_ConsultarColumnas($tabla,$ConexionPDO,$MotorBD,$BaseDatos);\n\t\telse\n\t\t $resultadocampos=PCO_ConsultarColumnas($tabla);\n\n\t\tfor($i=0;$i<count($resultadocampos);$i++)\n\t\t\t{\n\t\t\t\t//Si el campo en el arreglo es igual al campo buscado cambia el estado a verdadero\n\t\t\t\tif ($resultadocampos[$i][\"nombre\"]==$campo)\n\t\t\t\t\t$estado=true;\n\t\t\t}\n\n\t\t//Retorna el resultado\n\t\treturn $estado;\n\t}",
"public function hasTable();",
"public function hasColumn(): bool;",
"function colunasTabela($codigo_estat_conexao,$nome_esquema,$nome_tabela,$tipo=\"\",$tipotratamento=\"=\"){\n $colunas = array();\n $res = $this->execSQLDB($codigo_estat_conexao,\"SELECT column_name as coluna,udt_name, data_type FROM information_schema.columns where table_schema = '$nome_esquema' and table_name = '$nome_tabela'\");\n if($tipo != \"\"){\n $res = $this->execSQLDB($codigo_estat_conexao,\"SELECT column_name as coluna,udt_name, data_type FROM information_schema.columns where table_schema = '$nome_esquema' and udt_name $tipotratamento '$tipo' and table_name = '$nome_tabela'\");\n }\n foreach($res as $c){\n $colunas[] = $c[\"coluna\"];\n }\n return $colunas;\n }",
"function agregacol($tabla,$columna,$tipo){\n\t\t$CI =& get_instance();\n\t\t$existe = $CI->db->query(\"DESCRIBE $tabla $columna\");\n\t\tif ( $existe->num_rows() == 0 )\n\t\t\t$CI->db->query(\"ALTER TABLE $tabla ADD COLUMN $columna $tipo\");\n\t}",
"function getTabla()\r\n {\r\n if($this->tabla == NULL){\r\n if($this->getColumna()!=NULL){\r\n $this->tabla = $this->getColumna()->getTabla();\r\n }\r\n }\r\n return $this->tabla;\r\n }",
"function \tf_valida_tabla(\n\t\t\t\t$cod_tabla\t\t\t,\n\t\t\t\t$cod_tabla_detalle\t,\n\t\t\t\t$post\t\t\t\t,\n\t\t\t\t$cod_pk\t\t\t\t,\n\t\t\t\t$arr_mensajes\t\t,\n\t\t\t\t$arr_parametro\t\t,\n\t\t\t\t$cod_navegacion_formulario\n\t){\n\t\tglobal $db;\t\t\n\t\t//=== Valida todas las columnas >>>\n\t\t$cursor_info_columnas\t= $this->f_get_columnas_formulario($cod_tabla,$cod_navegacion_formulario,$cod_tabla_detalle);\n\t\t$num_registros \t\t\t= $db->num_registros($cursor_info_columnas);\n\t\tfor($i=0; $i<$num_registros; $i++){\n\t\t\t$row_info_columna\t\t= $db->sacar_registro($cursor_info_columnas,$i);\n\t\t\t$txt_nombre_columna\t\t= $row_info_columna['txt_nombre'];\n\t\t\t$txt_alias\t\t\t\t= str_replace(\"_\",\" \", $row_info_columna['txt_alias']);\n\t\t\t$ind_not_null\t\t\t= $row_info_columna['ind_not_null'];\n\t\t\t$ind_unique\t\t\t\t= $row_info_columna['ind_unique'];\n\t\t\t$cod_tipo_dato_columna\t= $row_info_columna['cod_tipo_dato_columna'];\n\t\t\t$value_columna\t\t\t= $post[$txt_nombre_columna];\n\t\t\tif($value_columna===0) \t$value_columna == \" 0\";\n\t\n\t\t\t//=== Obtiene el registro que viola la restriccion UNIQUE >>>\n\t\t\tif($ind_unique){\n\n\t\t\t\t$row_restringe_unique\t= \t$this->f_get_row_restriccion_unique(\n\t\t\t\t\t\t\t\t\t\t\t$cod_pk\t\t\t\t,\n\t\t\t\t\t\t\t\t\t\t\t$row_info_columna\t,\n\t\t\t\t\t\t\t\t\t\t\t$value_columna\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t}\n\n\t\t\t//=== Valida campos NULL >>>\n\t\t\tif($ind_not_null && $value_columna == NULL ){\n\t\t\t\tarray_push($arr_mensajes,'1'); \t\t\t\t\t\t\t\t\t//Registra el codigo del mensaje que se debe mostrar\n\t\t\t\tarray_push($arr_parametro,$txt_alias); \t\t\t\t\t\t\t//Nombre del campo not null\n\t\t\t}\n\t\t\t//=== Valida campos LISTBOX que no pueden ser NULL >>>\n\t\t\telse if($ind_not_null && $value_columna == -1 && $cod_tipo_dato_columna == 4){\n\t\t\t\tarray_push($arr_mensajes,'1'); \t\t\t\t\t\t\t\t\t//Registra el codigo del mensaje que se debe mostrar\n\t\t\t\tarray_push($arr_parametro,$txt_alias); \t\t\t\t\t\t\t//Nombre del campo not null\n\t\t\t}\n\t\t\t//=== Valida campos de TIPO NUMERICO CON Y SIN FORMATO ADICIONALMENTE EVALUA CELULARES >>>\n\t\t\telse if($cod_tipo_dato_columna == 2 || $cod_tipo_dato_columna == 5 || $cod_tipo_dato_columna == 10){\n\t\t\t\t$value_columna\t\t\t\t= str_replace(\",\",\"\",$value_columna);\n\t\t\t\t$value_columna\t\t\t\t= ltrim(rtrim($value_columna));\n\t\t\t\tif(!is_numeric($value_columna) && $value_columna!=NULL){\n\t\t\t\t\tarray_push($arr_mensajes,'6'); \t\t\t\t\t\t//MENSAJE ERROR CAMPO NUMERICO\n\t\t\t\t\tarray_push($arr_parametro,$txt_alias); \t\t\t\t//Nombre del campo not null\n\t\t\t\t}\n\t\t\t}\n\t\t\t//=== Valida restriccion UNIQUE >>>\n\t\t\telse if( $ind_unique && $row_restringe_unique[0] ){\n\t\t\t\tarray_push($arr_mensajes,'7'); \t\t\t\t\t\t\t\t\t//Registra el codigo del mensaje que se debe mostrar\n\t\t\t\tarray_push($arr_parametro,$txt_alias); \t\t\t\t\t\t\t//Nombre del campo not null\n\t\t\t}\t\n\t\t\t//=== Evalua varchar sin numeros>>>\n\t\t\tif(\t$cod_tipo_dato_columna == 15){\n\t\t\t\t$vr\t= str_split($value_columna);\n\t\t\t\tif(\tin_array(\"0\",$vr) \t|| \tin_array(\"1\",$vr) || in_array(\"2\",$vr) ||in_array(\"3\",$vr) \t|| \n\t\t\t\t\tin_array(\"4\",$vr) \t|| \tin_array(\"5\",$vr) || in_array(\"6\",$vr) || in_array(\"7\",$vr) || \n\t\t\t\t\tin_array(\"8\",$vr) \t||\tin_array(\"9\",$vr) \n\t\t\t\t){\n\t\t\t\t\tarray_push($arr_mensajes,'11'); \t\t\t\t\t\t\t\t\t//Registra el codigo del mensaje que se debe mostrar\n\t\t\t\t\tarray_push($arr_parametro,$txt_alias); \t\t\t\t\t\t\t//Nombre del campo not null\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$array_retorno = array();\n\t\t$array_retorno['arr_mensajes'] \t= \t$arr_mensajes;\n\t\t$array_retorno['arr_parametro'] = \t$arr_parametro;\t\t\t\n\t\treturn $array_retorno;\n\t}",
"function agregar_tabla( $tabla, $sql, $columna_clave )\n\t{\n\t\t//Recupero el contenido\n\t\t$this->tablas[$tabla] = $this->db->consultar( $sql );\n\n\t\t//Genero indices\n\t\t$this->indices[$tabla] = array();\n\t\tfor ($a=0; $a < count($this->tablas[$tabla]); $a++) {\n\t\t\t$id = $this->tablas[$tabla][$a][$columna_clave];\n\t\t\t$this->indices[$tabla][$id][] = $a;\n\t\t}\n\t}",
"public function testCamposExisten()\n {\n for ($i=0; count($this->columns) > $i; $i++)\n {\n $this->assertTrue(Schema::hasColumn($this->tabla, $this->columns[$i]));\n }\n }",
"abstract public function checkCreateTable($table);",
"function get_columna($columna)\n\t{\n\t\tif ($this->get_cantidad_filas() == 0) {\n\t\t\treturn null;\n\t\t} elseif ($this->hay_cursor()) {\n\t\t\treturn $this->get_fila_columna($this->get_cursor(), $columna);\n\t\t} else {\n\t\t\tthrow new toba_error_def('No hay posicionado un cursor en la tabla, no es posible determinar la fila actual');\n\t\t}\t\t\n\t}",
"abstract public function getColumnMeta();",
"function fieldIsInTable($campo,$tabela) {\n $campos = $this->getFieldsOfTable($tabela);\n if (in_array($campo,$campos)) return 1;\n else\t\t\t return 0;\n }",
"public function CampoExiste($tabela, $campo) {PRINT \"FORA\";\n\t\tif($this->TabelaExiste($tabela)) {\n\t \t\t\n\t\t\t$this->tipocampo=null;\n\t\t \t$this->tamcampo=null;\n\t\t \t$sql = \"SHOW FIELDS FROM \".$tabela;\n\t\t \t\n\t\t \t/*$sql=\"select distinct \";\n\t\t \t$sql.=\"A.RDB\\$FIELD_NAME as F_NAME, \";\n\t\t \t$sql.=\"case \"; \t \n\t\t \t$sql.=\"when B.RDB\\$FIELD_PRECISION > 0 then 'FLOAT' \";\n\t\t \t$sql.=\"when C.RDB\\$TYPE_NAME='LONG' then 'INTEGER' \";\n\t\t \t$sql.=\"when C.RDB\\$TYPE_NAME='SHORT' then 'INTEGER' \";\n\t\t \t$sql.=\"when C.RDB\\$TYPE_NAME='VARYING' then 'STRING' \";\n\t\t \t$sql.=\"when C.RDB\\$TYPE_NAME='TEXT' then 'STRING' \";\n\t\t \t$sql.=\"when C.RDB\\$TYPE_NAME='BLOB' then 'STRING' \";\n\t\t \t$sql.=\"else \";\n\t\t \t$sql.=\"C.RDB\\$TYPE_NAME \";\n\t\t \t$sql.=\"end as F_TIPO, \";\n\t\t \t$sql.=\"case \";\n\t\t \t$sql.=\"when B.RDB\\$FIELD_PRECISION > 0 then \";\n\t\t \t$sql.=\"''||cast(B.RDB\\$FIELD_PRECISION as \"; \n\t\t \t$sql.=\"varchar(2))||','||cast(B.RDB\\$FIELD_SCALE*-1 as varchar(2))||''\"; \t\n\t\t \t$sql.=\"when B.RDB\\$CHARACTER_LENGTH is null then '0' \";\n\t\t \t$sql.=\"else \";\n\t\t \t$sql.=\"B.RDB\\$CHARACTER_LENGTH \";\n\t\t \t$sql.=\"end as F_TAMANHO \";\n\t\t \t$sql.=\"from \";\n\t\t \t$sql.=\"RDB\\$RELATION_FIELDS A \";\n\t\t \t$sql.=\"left join RDB\\$FIELDS B on A.RDB\\$FIELD_SOURCE=B.RDB\\$FIELD_NAME \";\n\t\t \t$sql.=\"left join RDB\\$TYPES C on C.RDB\\$FIELD_NAME='RDB\\$FIELD_TYPE' and \";\n\t\t \t$sql.=\"B.RDB\\$FIELD_TYPE=C.RDB\\$TYPE \";\n\t\t \t$sql.=\"left join RDB\\$RELATION_CONSTRAINTS E on A.RDB\\$RELATION_NAME=E.RDB\\$RELATION_NAME \";\n\t\t \t$sql.=\"left join RDB\\$INDEX_SEGMENTS F on E.RDB\\$INDEX_NAME=F.RDB\\$INDEX_NAME and \";\n\t\t \t$sql.=\"A.RDB\\$FIELD_NAME=F.RDB\\$FIELD_NAME \";\n\t\t \t$sql.=\"where \";\n\t\t \t$sql.=\"A.RDB\\$RELATION_NAME = '$tabela' and A.RDB\\$FIELD_NAME = '$campo'\";\n\t\t\tPRINT $sql;*/\n\t\t \t$res=@mysql_query($sql, $this->conex);\n\t\t $row=@mysql_fetch_object($res);\n\t\t \n\t\t if(!empty($row->Type)) {\n\t\t \tif (strpos($row->Type,\"(\")){\n\t\t\t \t$nome = trim(substr($row->Type,0,strpos($row->Type,\"(\")));\n\t\t\t }else{\n\t\t\t \t$nome = $row->Type;\n\t\t\t }\n\t\t \tPRINT $this->tipocampo=trim($nome);\n\t\t \tPRINT $this->tamcampo=substr($row->Type,strpos($row->Type,\"(\")+1,strpos($row->Type,\")\")-(strpos($row->Type,\"(\")+1));\n\t\t \t$result = 1;\n\t\t }else \n\t\t \t$result = 0;\n\t\t \n\t\t @mysql_free_result($res);\n\t\t} \n\t\t\n\t\treturn $result;\n\t}",
"public function hasColumns();",
"public function testTablaExiste()\n {\n $this->assertTrue(Schema::hasTable($this->tabla));\n }",
"protected function checkStandardDataTable()\n {\n Piwik::checkObjectTypeIs($this->dataTable, array('\\Piwik\\DataTable'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/! \return the creator of the version published in the node. | function creator()
{
$db = eZDB::instance();
$query = "SELECT creator_id
FROM ezcontentobject_version
WHERE
contentobject_id = '$this->ContentObjectID' AND
version = '$this->ContentObjectVersion' ";
$creatorArray = $db->arrayQuery($query);
return eZContentObject::fetch($creatorArray[0]['creator_id']);
} | [
"public function get_creator()\n {\n return $this->creator;\n }",
"public function getCreator()\n {\n return $this->creator;\n }",
"public function getCreator() {\n\t\treturn new Google_Calendar_Creator_output(Temboo_Results::getSubItemByKey($this->base, \"creator\"));\n\t}",
"public function getCreator()\n\t{\n\t\treturn $this->creatorId;\n\t}",
"public function getCreator()\n {\n return $this->getImplodedField('creator');\n }",
"function getCreatorName() \n {\n return $this->getValueByFieldName( 'module_creatorName' );\n }",
"public function getVersionAuthor()\n {\n return $this->logs->last()->getUsername();\n }",
"public function getCreator()\n {\n return $this->creatorId ? Craft::$app->getUsers()->getUserById($this->creatorId) : null;\n }",
"public function getCreator()\n\t{\n\t\tswitch ($this->creator) {\n\t\t\tcase self::CREATOR_STAFF:\n\t\t\t\treturn $this->getStaff();\n\t\t\tcase self::CREATOR_USER:\n\t\t\t\treturn $this->getUser();\n\t\t}\n\t\treturn null;\n\t}",
"public function getCreatorID()\n {\n return $this->creatorID;\n }",
"public function creator()\n\t{\n\t\treturn User::find($this->getCreatedBy());\n\t}",
"public function getCreatorId()\n {\n return $this->creatorId;\n }",
"public function get_cust_rel_creator_name();",
"public function getCreatorId()\n {\n return $this->creator_id;\n }",
"public function getRoomcreator()\n\t{\n\n\t\treturn $this->roomcreator;\n\t}",
"public function GetCreator()\r\n\t{\r\n\t\treturn $this->_phreezer->GetManyToOne($this, \"fk_reference_creator\");\r\n\t}",
"public function getIdealCreator()\n {\n return $this->ideal_creator;\n }",
"private function get_creator($key)\n\t{\n\t\tif (plugin_is_active('OaipmhHarvester')) {\n\t\t\t$item = OaipmhHarvesterPlugin::getTopParentItem($this->_item);\n\t\t} else {\n\t\t\t$item = $this->_item;\n\t\t}\n\n\t\t$creators = metadata($item, array('Dublin Core', 'Creator'));\n\t\t$link = metadata($item, array('Item Type Metadata', 'Creator Link'));\n\n\t\t$res = array();\n\n\t\tif ($this->_disable_links) return $creators;\n\n\t\tif (isset($link)) {\n\t\t\treturn '<a target=\"_blank\" class=\"repository-link\" href=\"'.$link.'\">'.$creators.'</a>';\n\t\t}\n\t\t\n\t\treturn $res;\n\t}",
"public function getCreatorId() : int {\n return $this->creatorId;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the given mode is supported by the wrapper. | private function isSupportedMode($mode) {
return $mode === self::MODE_READONLY || $mode === self::MODE_WRITEONLY;
} | [
"public function supports(int $mode): bool;",
"public function supports($target, string $mode): bool;",
"public static function is_supported_mode($mode) {\n return ($mode === self::MODE_APPLICATION || $mode === self::MODE_SESSION);\n }",
"function eri_mode_valid($mode = null) {\r\n\tif (empty($mode))\r\n\t\t$mode = eri_get_option(\"mode\");\r\n\t$fn = 'eri_im_' . $mode . '_valid';\r\n\treturn (!empty($mode) && function_exists($fn) && call_user_func($fn));\r\n}",
"public function supports($target, $mode);",
"public function isValidMode($mode);",
"abstract public function isSupported();",
"function checkValidMode($mode) {\n\tglobal $validModes;\n\treturn in_array($mode, $validModes);\n}",
"function is_mode($mode) {\n\t\treturn Application::mode() === $mode;\n\t}",
"public function isSupported();",
"protected function checkRequirements($mode)\n {\n if (true !== in_array($mode, self::$validModes, true)) {\n throw new Exception(\n sprintf('Mode \"%s\" not supported. Supported: \"%s\"', $mode, var_export(self::$validModes, true))\n );\n }\n\n switch ($mode) {\n case self::MODE_OPEN_SSL:\n case self::MODE_PHP_DEFAULT:\n case self::MODE_PHP_MERSENNE_TWISTER:\n default:\n // Intentionally omitted cause not required - listed here for code quality and readability\n break;\n }\n\n return true;\n }",
"public function check_mode($mode){\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\treturn $mode;\r\n\t\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t}",
"static public function isValidMode($mode)\n {\n return in_array($mode, static::getModes(), true);\n }",
"public function hasMode($mode)\n {\n if(strpos($this->m_mode,$mode)!==false)\n {\n return true;\n }\n return false;\n }",
"public function isSupported()\n\t{\n\t\treturn LeadConversionScheme::isSupported(\n\t\t\t$this->getSchemeID(),\n\t\t\t['TYPE_ID' => $this->typeID]\n\t\t);\n\t}",
"function _validMode($mode) {\n\t\tif ( 'r' == $mode\n\t\t\tOR 'w' == $mode )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function isSupported()\n {\n return isset($this->supporter_id);\n }",
"public function isSupported ($feature, $version) {}",
"public static function exp_checkGameCompability() {\n $gameInfo = \\ManiaLive\\Data\\Storage::getInstance()->gameInfos;\n $class = get_called_class();\n\n if (isset(self::$plugin_gameModeSupport[$class])) {\n if ($gameInfo->gameMode == GameInfos::GAMEMODE_SCRIPT && isset(self::$plugin_gameModeSupport[$class][$gameInfo->gameMode]) && is_array(self::$plugin_gameModeSupport[$class][$gameInfo->gameMode])) {\n return isset(self::$plugin_gameModeSupport[$class][$gameInfo->gameMode][$gameInfo->scriptName]) ? self::$plugin_gameModeSupport[$class][$gameInfo->gameMode][$gameInfo->scriptName] : false;\n } else {\n return isset(self::$plugin_gameModeSupport[$class][$gameInfo->gameMode]) ? self::$plugin_gameModeSupport[$class][$gameInfo->gameMode] : false;\n }\n } else\n //This plugin supports all GameModes\n return true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return all nodes of one project | public function extract_ProjectNodes($project){
$id_project=$project->getId();
$request = $this->db->query('SELECT * FROM node WHERE id_project='.$id_project );
$request = $request->fetchall(PDO::FETCH_CLASS,'Node');
return $request;
} | [
"public function getNodes();",
"public function nodes() {\n return Node::query()->whereIn('id',$this->path);\n }",
"public function getNodes()\n {\n return $this->get('/nodes');\n }",
"public function get_nodes() {\n\t\treturn $this->client->GetNodes();\n\t}",
"public function getProjects();",
"function action_get_nodes(){\r\n\t\t// main processing\r\n\t\tglobal $_REQUEST, $beanFiles, $beanList;\r\n\t\tif($_REQUEST['node'] != 'unionroot')\r\n\t\t{\r\n\t\t\t$nodeArray = explode(':', $_REQUEST['node']);\r\n\r\n\t\t\t$returnArray = array();\r\n\r\n\t\t\tif($nodeArray[0] == 'root' || preg_match('/union/',$nodeArray[0]) > 0)\r\n\t\t\t{\r\n\t\t\t\tprint json_encode_kinamu($this->buildNodeArray($nodeArray['1'], 'TREE'));\r\n\t\t\t}\r\n\t\t\tif($nodeArray[0] == 'link')\r\n\t\t\t{\r\n\t\t\t\trequire_once($beanFiles[$beanList[$nodeArray['1']]]);\r\n\t\t\t\t$nodeModule = new $beanList[$nodeArray['1']];\r\n\t\t\t\t$nodeModule->load_relationship($nodeArray['2']);\r\n\r\n\t\t\t\t$returnJArray = json_encode_kinamu($this->buildNodeArray($nodeModule->$nodeArray['2']->getRelatedModuleName(), 'TREE', $nodeModule->$nodeArray['2']));\r\n\r\n\t\t\t\tprint $returnJArray;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\telse\r\n\t\t\techo '';\r\n\t}",
"function btrCore_project_list_all() {\n $project_list = btr::project_list_all();\n drupal_json_output($project_list);\n drupal_exit();\n}",
"public function nodes()\n {\n return $this->belongsToMany(Config::get('workflow::node'), Config::get('workflow::node_user_table'));\n }",
"protected function getPublicNodes()\n {\n $comic = $this->getTestHelper()->insertComic(2131);\n return [\"comics/\", \"comics/failed\", \"comics/show/\" . $comic->id];\n\n }",
"public function getNodes()\n {\n return $this->nodes;\n }",
"public function getNodes()\n\t{\n\t\treturn $this->nodes;\n\t}",
"private function getNodes() {\n $group_name = 'ereol_app_feeds_category';\n $field_name = 'page_ids';\n $pages = _ereol_app_feeds_variable_get($group_name, $field_name, []);\n $included = array_filter($pages, function ($page) {\n return isset($page['included']) && 1 === $page['included'];\n });\n\n return $this->nodeHelper->loadNodes(array_keys($included));\n }",
"public function getLinkNodes(): Collection;",
"public function getProjectNode() {\n return $this->project_node;\n }",
"public function getPeople(){\n\t\treturn $this->nodeStore->getNodes();\n\t}",
"public function actionIndex()\n {\n $searchModel = new NodeSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $getNodesResponse = [];\n $columns = $searchModel->getHtmlGridColumns();\n $layout = $searchModel->getGridLayout();\n try {\n $getNodesResponse = (Yii::$app->pandora->getHttpClient()->get('nodes/get_nodes')->send())->data['nodes'];\n } catch (Exception $e) {\n Yii::$app->session->setFlash('error', ' Ai grijă ca rețeaua ta să fie pornită !');\n }\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'layout' => $layout,\n 'columns' => $columns,\n 'getNodesResponse' => $getNodesResponse,\n ]);\n }",
"public function getAllProjects(){\r\n \r\n try{\r\n $projects = $this->sendRequest( '/services/v3/projects' );\r\n if( property_exists($projects, 'project') ){\r\n $projects = $projects->project;\r\n }\r\n }catch( \\Exception $e ){\r\n $projects = array();\r\n }\r\n return $projects;\r\n \r\n }",
"public function getAllProject()\n {\n return $this->client->request('GET','/rest/api/2/project');\n }",
"public function allProjects()\n { \n $client = new HttpClient();\n $body = $client->request('projects/all');\n\n dump($body);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clear all search parameters | function ResetSearchParms() {
global $mapas_zonas;
// Clear search WHERE clause
$this->sSrchWhere = "";
$mapas_zonas->setSearchWhere($this->sSrchWhere);
// Clear basic search parameters
$this->ResetBasicSearchParms();
} | [
"function ResetSearchParms() {\n\t\tglobal $frm_u_rep_ta_form_a_1;\n\n\t\t// Clear search WHERE clause\n\t\t$this->SearchWhere = \"\";\n\t\t$frm_u_rep_ta_form_a_1->setSearchWhere($this->SearchWhere);\n\n\t\t// Clear basic search parameters\n\t\t$this->ResetBasicSearchParms();\n\t}",
"function ResetSearchParms() {\n\t\tglobal $frm_fp_rep_ta_form_a_1;\n\n\t\t// Clear search WHERE clause\n\t\t$this->SearchWhere = \"\";\n\t\t$frm_fp_rep_ta_form_a_1->setSearchWhere($this->SearchWhere);\n\n\t\t// Clear basic search parameters\n\t\t$this->ResetBasicSearchParms();\n\t}",
"public function clearSearchParams()\n {\n $this->GoogleApi->clearSearchParams();\n $this->redirect(\n [\n 'controller' => 'GoogleApis',\n 'action' => 'index'\n ]\n );\n }",
"function ResetSearchParms() {\n\t\tglobal $t_lylich;\n\n\t\t// Clear search WHERE clause\n\t\t$this->sSrchWhere = \"\";\n\t\t$t_lylich->setSearchWhere($this->sSrchWhere);\n\n\t\t// Clear basic search parameters\n\t\t$this->ResetBasicSearchParms();\n\n\t\t// Clear advanced search parameters\n\t\t$this->ResetAdvancedSearchParms();\n\t}",
"function ResetSearchParms() {\n\n\t\t// Clear search WHERE clause\n\t\t$this->SearchWhere = \"\";\n\t\t$this->setSearchWhere($this->SearchWhere);\n\n\t\t// Clear basic search parameters\n\t\t$this->ResetBasicSearchParms();\n\t}",
"function ResetSearchParms() {\r\n\r\n\t\t// Clear search WHERE clause\r\n\t\t$this->SearchWhere = \"\";\r\n\t\t$this->setSearchWhere($this->SearchWhere);\r\n\r\n\t\t// Clear basic search parameters\r\n\t\t$this->ResetBasicSearchParms();\r\n\r\n\t\t// Clear advanced search parameters\r\n\t\t$this->ResetAdvancedSearchParms();\r\n\t}",
"function ResetSearchParms() {\n\n\t\t// Clear search where\n\t\tglobal $logistik_transfer_material;\n\t\t$this->sSrchWhere = \"\";\n\t\t$logistik_transfer_material->setSearchWhere($this->sSrchWhere);\n\n\t\t// Clear advanced search parameters\n\t\t$this->ResetAdvancedSearchParms();\n\t}",
"public function clearSearch(): void {}",
"function clearQuery() {\n $params= array(Q_ALL,'rss', 'astext', Q_SEARCH, Q_EXCLUDE, Q_YEAR, EDITOR, Q_TAG, Q_AUTHOR, Q_TYPE, Q_ACADEMIC, Q_KEY);\n foreach($params as $p) { unset($_GET[$p]); }\n }",
"public function clearParameters() {\n $this->parameters = array();\n }",
"public function clearParams()\n\t{\n\t\t$this->params = array();\n\t}",
"public function clearParameters() {}",
"public function clearParams()\n\t{\n\t\t$this->_params = array();\n\t}",
"function ResetAdvancedSearchParms() {\n\n\t\t// Clear advanced search parameters\n\t\tglobal $rpt_booking;\n\t\t$rpt_booking->setAdvancedSearch(\"x_kode\", \"\");\n\t\t$rpt_booking->setAdvancedSearch(\"x_tanggal\", \"\");\n\t\t$rpt_booking->setAdvancedSearch(\"x_title\", \"\");\n\t\t$rpt_booking->setAdvancedSearch(\"x_nama\", \"\");\n\t\t$rpt_booking->setAdvancedSearch(\"x_phone\", \"\");\n\t\t$rpt_booking->setAdvancedSearch(\"x_room\", \"\");\n\t\t$rpt_booking->setAdvancedSearch(\"x_arrival\", \"\");\n\t\t$rpt_booking->setAdvancedSearch(\"x_departure\", \"\");\n\t\t$rpt_booking->setAdvancedSearch(\"x_notes\", \"\");\n\t\t$rpt_booking->setAdvancedSearch(\"x_confirmasi\", \"\");\n\t\t$rpt_booking->setAdvancedSearch(\"x_checkin\", \"\");\n\t\t$rpt_booking->setAdvancedSearch(\"x_confirmdate\", \"\");\n\t\t$rpt_booking->setAdvancedSearch(\"x_checkindate\", \"\");\n\t}",
"function searchReset() {\n\t\tSession::resetSearch(\"itemtype_id\");\n\t\tSession::resetSearch(\"tags\");\n\t\tSession::resetSearch(\"sindex\");\n\t}",
"public function clearParams()\n {\n $this->params = [];\n }",
"private function resetQueryParameters()\n {\n $this->queryParameters = null;\n }",
"function ResetAdvancedSearchParms() {\n\n\t\t// Clear advanced search parameters\n\t\tglobal $CustomView1;\n\t\t$CustomView1->setAdvancedSearch(\"x_DetailNo\", \"\");\n\t\t$CustomView1->setAdvancedSearch(\"x_PatientID\", \"\");\n\t\t$CustomView1->setAdvancedSearch(\"x_StudyDate\", \"\");\n\t\t$CustomView1->setAdvancedSearch(\"x_StudyTime\", \"\");\n\t\t$CustomView1->setAdvancedSearch(\"x_PatientName\", \"\");\n\t\t$CustomView1->setAdvancedSearch(\"x_PatientSex\", \"\");\n\t\t$CustomView1->setAdvancedSearch(\"x_Modality\", \"\");\n\t\t$CustomView1->setAdvancedSearch(\"x_ProtocolName\", \"\");\n\t\t$CustomView1->setAdvancedSearch(\"x_BodyPartExamined\", \"\");\n\t\t$CustomView1->setAdvancedSearch(\"x_StudyID\", \"\");\n\t\t$CustomView1->setAdvancedSearch(\"x_InstanceNumber\", \"\");\n\t\t$CustomView1->setAdvancedSearch(\"x_Status\", \"\");\n\t}",
"public function clearQuerySetting()\n\t{\n\t\t$this->clearWhere();\n\t\t$this->clearLimit();\n\t\t$this->clearSort();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new instance of SoundImpl for the portal.trigger sound. | public static function PORTAL_TRIGGER(): SoundImpl
{
return new SoundImpl(SoundIds::PORTAL_TRIGGER);
} | [
"public static function MOB_SHULKER_OPEN(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_SHULKER_OPEN);\n }",
"public static function SOUND_DEFINITIONS(): SoundImpl\n {\n return new SoundImpl(SoundIds::SOUND_DEFINITIONS);\n }",
"public static function NOTE_BASSATTACK(): SoundImpl\n {\n return new SoundImpl(SoundIds::NOTE_BASSATTACK);\n }",
"public static function PORTAL_PORTAL(): SoundImpl\n {\n return new SoundImpl(SoundIds::PORTAL_PORTAL);\n }",
"public static function MOB_FROG_LAY_SPAWN(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_FROG_LAY_SPAWN);\n }",
"public static function MOB_ALLAY_HURT(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_ALLAY_HURT);\n }",
"abstract public function makeSound();",
"public static function MOB_SLIME_ATTACK(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_SLIME_ATTACK);\n }",
"public static function MOB_HORSE_SOFT(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_HORSE_SOFT);\n }",
"public static function RANDOM_EXPLODE(): SoundImpl\n {\n return new SoundImpl(SoundIds::RANDOM_EXPLODE);\n }",
"public static function RANDOM_SPLASH(): SoundImpl\n {\n return new SoundImpl(SoundIds::RANDOM_SPLASH);\n }",
"public static function RANDOM_DOOR_OPEN(): SoundImpl\n {\n return new SoundImpl(SoundIds::RANDOM_DOOR_OPEN);\n }",
"public static function STEP_SOUL_SAND(): SoundImpl\n {\n return new SoundImpl(SoundIds::STEP_SOUL_SAND);\n }",
"public static function NOTE_FLUTE(): SoundImpl\n {\n return new SoundImpl(SoundIds::NOTE_FLUTE);\n }",
"public static function MOB_SHEEP_SAY(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_SHEEP_SAY);\n }",
"public static function DIG_SNOW(): SoundImpl\n {\n return new SoundImpl(SoundIds::DIG_SNOW);\n }",
"public static function RANDOM_CHESTOPEN(): SoundImpl\n {\n return new SoundImpl(SoundIds::RANDOM_CHESTOPEN);\n }",
"public static function DIG_SOUL_SAND(): SoundImpl\n {\n return new SoundImpl(SoundIds::DIG_SOUL_SAND);\n }",
"public static function MOB_PHANTOM_FLAP(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_PHANTOM_FLAP);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructor. Initiates a new UserModel | public function __construct() {
$this->UserModel = new UserModel();
} | [
"public function __construct () {\n $this->model = (new UserModel);\n }",
"public function __construct() {\n $this->user_model = new UserModel();\n }",
"public function __construct()\n\t{\n\t\t$this->userObj = new \\EloquentModel\\User;\n\t}",
"function Users_model() {\r\n // call the Model constructor\r\n parent::Model();\r\n }",
"public function __construct()\n {\n $this->_userModel = new UserModel();\n $this->_session = \\Config\\Services::session();\n }",
"public static function newUserModel()\n {\n $model = static::userModel();\n\n return new $model;\n }",
"protected function getUserModel() {\n return new User();\n }",
"public function __construct() {\r\n $this->user = new User();\r\n }",
"public function __construct(){\n\t\trequire_once('model/User.class.php');\n\t}",
"public static function newUserModel(): mixed\n {\n $model = static::userModel();\n\n return new $model;\n }",
"public static function user()\n {\n return new static::$userModel;\n }",
"public function __construct($value, $key = 'username')\n\t{\n\t\tif (!self::$instantiated) {\n\t\t\t// Load the model\n\t\t\tself::$model = new UserModel();\n\t\t\tself::$instantiated = true;\n\t\t}\n\n\t\tif ($key == 'ID') {\n\t\t\t$this->data = self::$model->getUserByID($value);\n\t\t} elseif ($key == 'username') {\n\t\t\tif ($value != '_guest') {\n\t\t\t\t$this->data = self::$model->getUserByUsername($value);\n\t\t\t} else {\n\t\t\t\t// Loading default values\n\t\t\t\t$this->data = new \\stdClass();\n\t\t\t\t$this->data->domain = DOMAIN;\n\t\t\t\t$this->data->ID = 0;\n\t\t\t\t$this->data->username = '_guest';\n\t\t\t\t$this->data->firstName = 'Guest';\n\t\t\t\t$this->data->lastName = 'User';\n\t\t\t\t$this->data->userGroup = 'N/A';\n\t\t\t\t$this->data->clearanceLevel = 0;\n\t\t\t}\n\t\t}\n\t}",
"function User_model ()\r\n\t{\r\n\t\tparent::DF_Model('User_model', 'users', array(\r\n\t\t\t'id' , \r\n\t\t\t'username' , \r\n\t\t\t'password' , \r\n\t\t\t'mail' , \r\n\t\t\t'created' \r\n\t\t), 'id');\r\n\t}",
"public function __construct() {\n\t\t// set the searching and lookup attributes\n\t\t$this->username = config('dbauth.username');\n\t\t$this->password = config('dbauth.password');\n\n\t\t// set the model name to use as the user model (Laravel 5.2 and up)\n\t\t$this->modelName = config('auth.providers.users.model');\n\t\tif(empty($this->modelName)) {\n\t\t\t// try to read from the configuration value used by Laravel 5.0\n\t\t\t// and 5.1 as a fallback\n\t\t\t$this->modelName = config('auth.model');\n\t\t\tif(empty($this->modelName)) {\n\t\t\t\t// no valid model configuration so throw an exception immediately\n\t\t\t\t// to prevent any further problems\n\t\t\t\tthrow new InvalidUserModelException(\n\t\t\t\t\t\"No valid user model could be found in your auth configuration\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// next, throw an exception if the class specified does not exist\n\t\tif(!class_exists($this->modelName)) {\n\t\t\tthrow new InvalidUserModelException(\n\t\t\t\t\"The auth user model {$this->modelName} does not exist\"\n\t\t\t);\n\t\t}\n\n\t\t// set whether blank passwords are allowed to be used for auth\n\t\t$this->allow_no_pass = config('dbauth.allow_no_pass');\n\t}",
"public function __construct()\n\t{\n\t\t$this->model = new Model();\n\n\t}",
"public function __construct()\n {\n $this->userModel = new UserModel();\n $view = new View('header',array('title' => 'User - Overview', 'heading' => 'User'));\n $view->display();\n }",
"public static function userModel()\n {\n $model = config('admin.modules.users.model');\n return new $model;\n }",
"public function __construct()\n {\n $this->user = new UserRepo(Auth::loginUsingId(1, true));\n }",
"public function __construct()\n {\n $this->_peopleModel = new PeopleModel();\n $this->_session = \\Config\\Services::session();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the type of this clustering. | public function get_type()
{
return self::CLUSTERING_TYPE;
} | [
"public function getType() {\n\t\treturn self::$singular_types[$this->type];\n\t}",
"public function get_type() {\n\n\t\tswitch ( $this->get_name() ) {\n\t\t\tcase 'length':\n\t\t\tcase 'width':\n\t\t\tcase 'height': return 'dimension';\n\t\t\tdefault: return $this->get_name();\n\t\t}\n\t}",
"public function getType()\n {\n return $this->type ?: $this->defaultIndexType;\n }",
"public function getType()\n\t{\n\t\tif (isset($this->coordinates['type']))\n\t\t\treturn $this->coordinates['type'];\n\t}",
"public function get_category_type()\n {\n return $this->m_cat_dao->get_category_type();\n }",
"public function getType()\n {\n return $this->metadata->getName();\n }",
"function GetType()\r\n\t{\r\n\t\treturn $this->m_type;\r\n\t}",
"public function getType()\n {\n $type = $this->data['type'];\n if ($type === null) {\n $type = Reader\\Reader::detectType($this->getEntryElement(), true);\n $this->setType($type);\n }\n\n return $type;\n }",
"public function get_type()\r\n\t{\r\n\t\treturn $this->get_attr('type');\r\n\t}",
"public function getCategoryType()\n {\n return $this->categoryType;\n }",
"public function getCategoryType(): string {\n\t\treturn $this->categoryType;\n\t}",
"public function getType() {\n return $this->attributes()->getValue('type');\n }",
"public function getCategoryType()\n\t{\n\t\treturn $this->category_type;\n\t}",
"public function getInstanceType()\n {\n return $this->instance_type;\n }",
"public function getType()\n {\n return $this->query['type'];\n }",
"public function getClusterMode()\n {\n return $this->clusterMode;\n }",
"public function getTypeclt()\n {\n return $this->typeclt;\n }",
"public function getTypeClassProperty()\n {\n return AttributeManifest::getType($this->type);\n }",
"public function getType()\n {\n return get_class($this->cacheProvider);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Action to load a tabular form grid for AtestParticipantAnswers | public function actionAddAtestParticipantAnswers()
{
if (Yii::$app->request->isAjax) {
$row = Yii::$app->request->post('AtestParticipantAnswers');
if((Yii::$app->request->post('isNewRecord') && Yii::$app->request->post('_action') == 'load' && empty($row)) || Yii::$app->request->post('_action') == 'add')
$row[] = [];
return $this->renderAjax('_formAtestParticipantAnswers', ['row' => $row]);
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
} | [
"public function examsGridAction()\n {\n $this->_initDocwisement();\n $this->loadLayout();\n $this->getLayout()->getBlock('docwisement.edit.tab.exam')\n ->setDocwisementExams($this->getRequest()->getPost('docwisement_exams', null));\n $this->renderLayout();\n }",
"function Levels_Exam_Form()\n {\n $this->QuestionsObj()->Sql_Table_Structure_Update();\n $this->QuestionsObj()->ItemData(\"ID\");\n $this->QuestionsObj()->ItemDataGroups(\"Basic\");\n $this->QuestionsObj()->Actions(\"Show\");\n \n return\n $this->Html_Table\n (\n $this->Levels_Exam_Titles(),\n $this->Levels_Exam_Table()\n ).\n \"\";\n }",
"public function actionAddAtestQuestionAnswers()\n {\n if (Yii::$app->request->isAjax) {\n $row = Yii::$app->request->post('AtestQuestionAnswers');\n if((Yii::$app->request->post('isNewRecord') && Yii::$app->request->post('_action') == 'load' && empty($row)) || Yii::$app->request->post('_action') == 'add')\n $row[] = [];\n return $this->renderAjax('_formAtestQuestionAnswers', ['row' => $row]);\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function gridAction()\n {\n $this->loadLayout();\n $this->getResponse()->setBody(\n $this->getLayout()->createBlock('inchoo_supportticket/adminhtml_tickets_edit_tab_testgrid')->toHtml()\n );\n }",
"public function display_kent_submissions_table() {\n $tifirst = optional_param('tifirst', '', PARAM_ALPHA); // First letter of the name.\n $tilast = optional_param('tilast', '', PARAM_ALPHA); // First letter of the surname.\n\n if(!$this->set_mpa_cm()) {\n print_error('noassessedmodulefound', 'mod_surveypro');\n exit;\n }\n\n global $CFG, $OUTPUT, $DB, $USER;\n\n require_once($CFG->libdir.'/tablelib.php');\n\n $canalwaysseeowner = has_capability('mod/surveypro:alwaysseeowner', $this->context);\n $canseeotherssubmissions = has_capability('mod/surveypro:seeotherssubmissions', $this->context);\n $caneditownsubmissions = has_capability('mod/surveypro:editownsubmissions', $this->context);\n $caneditotherssubmissions = has_capability('mod/surveypro:editotherssubmissions', $this->context);\n $canduplicateownsubmissions = has_capability('mod/surveypro:duplicateownsubmissions', $this->context);\n $canduplicateotherssubmissions = has_capability('mod/surveypro:duplicateotherssubmissions', $this->context);\n $candeleteownsubmissions = has_capability('mod/surveypro:deleteownsubmissions', $this->context);\n $candeleteotherssubmissions = has_capability('mod/surveypro:deleteotherssubmissions', $this->context);\n $cansavesubmissiontopdf = has_capability('mod/surveypro:savesubmissiontopdf', $this->context);\n $canaccessallgroups = has_capability('moodle/site:accessallgroups', $this->context);\n\n $table = new flexible_table('submissionslist');\n\n if ($canseeotherssubmissions) {\n $table->initialbars(true);\n }\n else {\n echo '\n <script type=\"text/javascript\">\n $(document).ready( function() {\n $(\\'.resettable\\').hide();\n });\n </script>';\n }\n\n $paramurl = array();\n $paramurl['id'] = $this->cm->id;\n if ($this->searchquery) {\n $paramurl['searchquery'] = $this->searchquery;\n }\n $baseurl = new moodle_url('/mod/surveypro/view.php', $paramurl);\n $table->define_baseurl($baseurl);\n\n $tablecolumns = array();\n $tableheaders = array();\n if($this->group_total > 1) {\n $tablecolumns[] = 'group_name';\n $table->column_class('group_name', 'group_name');\n $tableheaders[] = get_string('group');\n }\n if ($canseeotherssubmissions && ($canalwaysseeowner || empty($this->surveypro->anonymous))) {\n $tablecolumns[] = 'a_picture';\n $tablecolumns[] = 'assessor';\n $table->column_class('a_picture', 'picture');\n $table->column_class('assessor', 'fullname');\n $tableheaders[] = '';\n $tableheaders[] = \"Assessor\";\n }\n if(empty($this->surveypro->anonymous)) {\n $tablecolumns[] = 'picture';\n $tablecolumns[] = 'fullname';\n $table->column_class('picture', 'picture');\n $table->column_class('fullname', 'fullname');\n $tableheaders[] = '';\n $tableheaders[] = get_string('fullname');\n }\n $tablecolumns[] = 'status';\n $table->column_class('status', 'status');\n $tableheaders[] = get_string('status');\n\n $tablecolumns[] = 'timecreated';\n $table->column_class('timecreated', 'timecreated');\n $tableheaders[] = get_string('timecreated', 'mod_surveypro');\n\n if (!$this->surveypro->history) {\n $tablecolumns[] = 'timemodified';\n $table->column_class('modified', 'timemodified');\n $tableheaders[] = get_string('timemodified', 'mod_surveypro');\n }\n $tablecolumns[] = 'actions';\n $table->column_class('actions', 'actions');\n $tableheaders[] = \"Edit or View\";//get_string('actions');\n\n $table->define_columns($tablecolumns);\n $table->define_headers($tableheaders);\n\n $table->sortable(true, 'sortindex', 'ASC'); // Sorted by sortindex by default.\n $table->no_sorting('actions');\n $table->no_sorting('a_picture');\n\n // Hide the same info whether in two consecutive rows.\n if ($canalwaysseeowner || empty($this->surveypro->anonymous)) {\n //$table->column_suppress('picture');\n //$table->column_suppress('fullname');\n }\n\n // General properties for the whole table.\n $table->set_attribute('cellpadding', 5);\n $table->set_attribute('id', 'submissions');\n $table->set_attribute('class', 'generaltable');\n $table->set_attribute('align', 'center');\n $table->setup();\n\n $status = array();\n $status[SURVEYPRO_STATUSINPROGRESS] = get_string('statusinprogress', 'mod_surveypro');\n $done = ucwords(get_string('statusclosed', 'mod_surveypro'));\n $status[SURVEYPRO_STATUSCLOSED] = \"<i aria-hidden class='fa fa-check' title='$done'></i><span class=\\\"sr-only\\\">$done</span>\";\n\n $neverstr = get_string('never');\n\n\n\n /*\n $this->display_submissions_overview($counter['allusers'],\n $counter['closedsubmissions'], $counter['closedusers'],\n $counter['inprogresssubmissions'], $counter['inprogressusers']);\n */\n list($sql, $whereparams) = $this->get_pa_submissions_sql($table);\n\n if(!$sql) {\n if ($this->searchquery) {\n echo '<div class=\"alert alert-danger\">No details with this query for this Peer assessment can be found!</div>';\n $url = new moodle_url('/mod/surveypro/view.php', array('id' => $this->cm->id));\n $label = get_string('showallsubmissions', 'mod_surveypro');\n echo $OUTPUT->box($OUTPUT->single_button($url, $label, 'get'), 'clearfix mdl-align');\n }\n else {\n echo '<div class=\"alert alert-danger\">No details for this Peer assessment can be found!</div>';\n }\n echo '\n <script type=\"text/javascript\">\n $(document).ready( function() {\n $(\\'ul.nav-tabs\\').hide();\n $(\\'button[type=\"submit\"]:contains(\"' . get_string(\"deleteallsubmissions\", \"mod_surveypro\") . '\")\\').hide(); \n $(\\'button[type=\"submit\"]:contains(\"' . get_string(\"addnewsubmission\", \"mod_surveypro\") . '\")\\').hide();\n });\n </script>';\n\n return;\n }\n\n if($canseeotherssubmissions || $canaccessallgroups) {}\n else {\n echo '\n <script type=\"text/javascript\">\n $(document).ready( function() {\n $(\\'a.nav-link[title=\"' . get_string(\"tabsubmissionspage1\", \"mod_surveypro\") . '\"]\\').hide();\n });\n </script>';\n }\n\n\n echo \"<h3>Peer assessment for \" . $this->mpa_cm_name . \"</h3>\";\n if ($this->group_total < 2) {\n if($canseeotherssubmissions) {\n echo \"<h4>Assessments for \" . $this->group_name . \"</h4>\";\n }\n else {\n echo \"<h4>My assessments for \" . $this->group_name . \"</h4>\";\n }\n }\n\n $table->pagesize(20, $this->mpa_total);\n\n $submissions = $DB->get_recordset_sql($sql, $whereparams, $table->get_page_start(), $table->get_page_size());\n\n if ($submissions->valid()) {\n\n $iconparams = array();\n\n $nonhistoryeditstr = get_string('edit');\n $iconparams['title'] = $nonhistoryeditstr;\n $nonhistoryediticn = new pix_icon('i/edit', $nonhistoryeditstr, 'moodle', $iconparams);\n\n $readonlyaccessstr = get_string('readonlyaccess', 'mod_surveypro');\n $iconparams['title'] = $readonlyaccessstr;\n $readonlyicn = new pix_icon('readonly', $readonlyaccessstr, 'surveypro', $iconparams);\n\n $duplicatestr = get_string('duplicate');\n $iconparams['title'] = $duplicatestr;\n $duplicateicn = new pix_icon('t/copy', $duplicatestr, 'moodle', $iconparams);\n\n if ($this->surveypro->history) {\n $attributestr = get_string('editcopy', 'mod_surveypro');\n $linkidprefix = 'editcopy_submission_';\n } else {\n $attributestr = $nonhistoryeditstr;\n $linkidprefix = 'edit_submission_';\n }\n $iconparams['title'] = $attributestr;\n $attributeicn = new pix_icon('i/edit', $attributestr, 'moodle', $iconparams);\n\n $deletestr = get_string('delete');\n $iconparams['title'] = $deletestr;\n $deleteicn = new pix_icon('t/delete', $deletestr, 'moodle', $iconparams);\n\n $downloadpdfstr = get_string('downloadpdf', 'mod_surveypro');\n $iconparams['title'] = $downloadpdfstr;\n $downloadpdficn = new pix_icon('i/export', $downloadpdfstr, 'moodle', $iconparams);\n\n if ($this->groupmode == SEPARATEGROUPS) {\n $mygroupmates = surveypro_groupmates($this->cm);\n }\n\n $tablerowcounter = 0;\n $this->response_total = 0;\n\n $paramurlbase = array('id' => $this->cm->id);\n\n $mpa_submission = new stdClass();\n $prev_group = \"\";\n $prev_assessor = \"\";\n\n foreach ($submissions as $submission) {\n\n // Count submissions per each user.\n $tablerowcounter++;\n $submissionsuffix = 'row_'.$tablerowcounter;\n\n // Before starting, just set some information.\n if (!$ismine = ($submission->id == $USER->id)) {\n if (!$canseeotherssubmissions) {\n continue;\n }\n if ($this->groupmode == SEPARATEGROUPS) {\n if ($canaccessallgroups) {\n $groupuser = true;\n } else {\n $groupuser = in_array($submission->id, $mygroupmates);\n }\n } else {\n $groupuser = true;\n }\n }\n\n $tablerow = array();\n\n // Group\n if($this->group_total > 1) {\n $tablerow[] = $submission->group_name;\n }\n\n // Assessor\n if($canseeotherssubmissions && $prev_group == $submission->group_name && $prev_assessor == $submission->id) {\n $tablerow[] = \"\";\n $tablerow[] = \"\";\n }\n elseif ($canseeotherssubmissions && ($canalwaysseeowner || empty($this->surveypro->anonymous))) {\n $tablerow[] = $OUTPUT->user_picture($submission, array('courseid' => $this->mpa_cm->course));\n\n // User fullname.\n $paramurl = array('id' => $submission->id, 'course' => $this->mpa_cm->course);\n $url = new moodle_url('/user/view.php', $paramurl);\n $tablerow[] = '<a href=\"'.$url->out().'\">'.fullname($submission).'</a>';\n }\n $prev_group = $submission->group_name;\n $prev_assessor = $submission->id;\n\n // Assessed user.\n $mpa_submission->id = $submission->mpa_id;\n $mpa_submission->picture = $submission->mpa_picture;\n $mpa_submission->firstname = $submission->mpa_firstname;\n $mpa_submission->lastname = $submission->mpa_lastname;\n $mpa_submission->firstnamephonetic = $submission->mpa_firstnamephonetic;\n $mpa_submission->lastnamephonetic = $submission->mpa_lastnamephonetic;\n $mpa_submission->middlename = $submission->mpa_middlename;\n $mpa_submission->alternatename = $submission->mpa_alternatename;\n $mpa_submission->imagealt = $submission->mpa_imagealt;\n $mpa_submission->email = $submission->mpa_email;\n\n if(empty($this->surveypro->anonymous)) {\n $tablerow[] = $OUTPUT->user_picture($mpa_submission, array('courseid' => $this->mpa_cm->course));\n\n // User fullname.\n $paramurl = array('id' => $mpa_submission->id, 'course' => $this->mpa_cm->course);\n $url = new moodle_url('/user/view.php', $paramurl);\n $tablerow[] = '<a href=\"' . $url->out() . '\">' . fullname($mpa_submission) . '</a>';\n }\n\n // Surveypro status.\n if(!isset($status[$submission->status])) {\n $tablerow[] = $submission->status;\n }\n else {\n $tablerow[] = $status[$submission->status];\n if($ismine && $submission->status == 0) {\n $this->response_total++;\n }\n }\n\n if($ismine) {\n $this->response_count++;\n }\n #$this->response_count = $tablerowcounter;\n\n\n\n // Creation time.\n if($submission->timecreated) {\n $tablerow[] = userdate($submission->timecreated);\n }\n else {\n $tablerow[] = \"\";\n }\n\n // Timemodified.\n if (!$this->surveypro->history) {\n // Modification time.\n if ($submission->timemodified) {\n $tablerow[] = userdate($submission->timemodified);\n } else {\n $tablerow[] = $neverstr;\n }\n }\n\n // Actions.\n $icons = \"\";\n $paramurl = $paramurlbase;\n $paramurl['submissionid'] = $submission->submissionid;\n\n #echo \"<p> status \".$submission->status.\" AND \".SURVEYPRO_STATUSINPROGRESS.\" AND $ismine AND $caneditownsubmissions</p>\";\n\n // Edit.\n if ($ismine) { // I am the owner.\n if ($submission->status == SURVEYPRO_STATUSINPROGRESS) {\n $displayediticon = true;\n } else {\n $displayediticon = $caneditownsubmissions;\n }\n } else { // I am not the owner.\n if ($this->groupmode == SEPARATEGROUPS) {\n $displayediticon = $groupuser && $caneditotherssubmissions;\n } else { // NOGROUPS || VISIBLEGROUPS.\n $displayediticon = $caneditotherssubmissions;\n }\n }\n\n //New - allow edit now set as paselect variable in setup\n if ($this->allow_edit_flag && $ismine) {\n $displayediticon = true;\n }\n if (!$this->allow_edit_flag) {\n $displayediticon = false;\n }\n\n\n if ($displayediticon && $submission->submissionid) {\n $paramurl['view'] = SURVEYPRO_EDITRESPONSE;\n if ($submission->status == SURVEYPRO_STATUSINPROGRESS) {\n // Here title and alt are ALWAYS $nonhistoryeditstr.\n $link = new moodle_url('/mod/surveypro/view_form.php', $paramurl);\n $paramlink = array('id' => 'edit_submission_'.$submissionsuffix, 'title' => $nonhistoryeditstr);\n $icons = $OUTPUT->action_icon($link, $nonhistoryediticn, null, $paramlink);\n } else {\n // Here title and alt depend from $this->surveypro->history.\n $link = new moodle_url('/mod/surveypro/view_form.php', $paramurl);\n $paramlink = array('id' => $linkidprefix.$submissionsuffix, 'title' => $attributestr);\n $icons = $OUTPUT->action_icon($link, $attributeicn, null, $paramlink);\n }\n } elseif ($submission->submissionid) {\n $paramurl['view'] = SURVEYPRO_READONLYRESPONSE;\n\n $link = new moodle_url('/mod/surveypro/view_form.php', $paramurl);\n $paramlink = array('id' => 'view_submission_'.$submissionsuffix, 'title' => $readonlyaccessstr);\n $icons = $OUTPUT->action_icon($link, $readonlyicn, null, $paramlink);\n }\n elseif($submission->id == $USER->id) {\n $paramurl = $paramurlbase;\n $paramurl['paid'] = $mpa_submission->id;\n $paramurl['view'] = 1;\n $link = new moodle_url('/mod/surveypro/view_form.php', $paramurl);\n $paramlink = array('id' => 'new_submission_'.$this->surveypro->id, 'title' => 'New submission');\n $icons = $OUTPUT->action_icon($link, $attributeicn, null, $paramlink);\n }\n\n\n // Duplicate.\n /* Don't think we want to duplicate peer assessments giving someone more than one assessment from same person\n if ($ismine) { // I am the owner.\n $displayduplicateicon = $canduplicateownsubmissions;\n } else { // I am not the owner.\n if ($groupmode == SEPARATEGROUPS) {\n $displayduplicateicon = $groupuser && $canduplicateotherssubmissions;\n } else { // NOGROUPS || VISIBLEGROUPS.\n $displayduplicateicon = $canduplicateotherssubmissions;\n }\n }\n if ($displayduplicateicon && $submission->submissionid) { // I am the owner or a groupmate.\n $utilityman = new mod_surveypro_utility($this->cm, $this->surveypro);\n $cansubmitmore = $utilityman->can_submit_more($submission->id);\n if ($cansubmitmore) { // The copy will be assigned to the same owner.\n $paramurl = $paramurlbase;\n $paramurl['submissionid'] = $submission->submissionid;\n $paramurl['sesskey'] = sesskey();\n $paramurl['act'] = SURVEYPRO_DUPLICATERESPONSE;\n\n $link = new moodle_url('/mod/surveypro/view.php', $paramurl);\n $paramlink = array('id' => 'duplicate_submission_'.$submissionsuffix, 'title' => $duplicatestr);\n $icons .= $OUTPUT->action_icon($link, $duplicateicn, null, $paramlink);\n }\n }\n */\n\n // Delete.\n /*\n $paramurl = $paramurlbase;\n $paramurl['submissionid'] = $submission->submissionid;\n if ($ismine) { // I am the owner.\n $displaydeleteicon = $candeleteownsubmissions;\n } else {\n if ($groupmode == SEPARATEGROUPS) {\n $displaydeleteicon = $groupuser && $candeleteotherssubmissions;\n } else { // NOGROUPS || VISIBLEGROUPS.\n $displaydeleteicon = $candeleteotherssubmissions;\n }\n }\n if ($displaydeleteicon && $submission->submissionid) {\n $paramurl['sesskey'] = sesskey();\n $paramurl['act'] = SURVEYPRO_DELETERESPONSE;\n\n $link = new moodle_url('/mod/surveypro/view.php', $paramurl);\n $paramlink = array('id' => 'delete_submission_'.$submissionsuffix, 'title' => $deletestr);\n $icons .= $OUTPUT->action_icon($link, $deleteicn, null, $paramlink);\n }\n */\n\n // Download to pdf.\n /*\n if ($cansavesubmissiontopdf && $submission->submissionid) {\n $paramurl = $paramurlbase;\n $paramurl['submissionid'] = $submission->submissionid;\n $paramurl['view'] = SURVEYPRO_RESPONSETOPDF;\n\n $link = new moodle_url('/mod/surveypro/view.php', $paramurl);\n $paramlink = array('id' => 'pdfdownload_submission_'.$submissionsuffix, 'title' => $downloadpdfstr);\n $icons .= $OUTPUT->action_icon($link, $downloadpdficn, null, $paramlink);\n }\n */\n $tablerow[] = $icons;\n\n // Add row to the table.\n $table->add_data($tablerow);\n }\n }\n $submissions->close();\n\n $this->show_kent_action_buttons($tifirst, $tilast);\n\n $table->summary = get_string('submissionslist', 'mod_surveypro');\n $table->print_html();\n\n\n // If this is the output of a search add a way to show all submissions.\n if ($this->searchquery) {\n $url = new moodle_url('/mod/surveypro/view.php', array('id' => $this->cm->id));\n $label = get_string('showallsubmissions', 'mod_surveypro');\n echo $OUTPUT->box($OUTPUT->single_button($url, $label, 'get'), 'clearfix mdl-align');\n }\n }",
"public function populate_answered_questions()\n\t{\n\t\t$user_data=$_SESSION['user_data'];\n\t\t$u_id=$user_data['u_id'];\n\t\t$from=$this->input->get('from');\n\t\t$model=$this->getQuestionModel();\n\t\t$result=$model->get_questions_answered($u_id,$from);\n\t\t$set=$result['set'];\n\t\t//$html_string='';\n\t\tfor($i=1; $i<=$result['no']; $i++)\n\t\t{\n\t\t\t$data=$set[$i];\n\t\t\t$this->load->view('Question_view',$data);\n\t\t}\n\n\t}",
"public function ajax_get_questions_table_for_teacher() {\n\t\t$excludeChallengeId = $this->input->post('exclude_challenge_id');\n $subjectId = $this->input->post('subject_id');\n $topicId = $this->input->post('topic_id');\n\t\t$grade = $this->input->post('grade');\n\t\t$teacherUserId = TeacherHelper::getUserId();\n\n\t\t$questions = $this->question_model->getQuestionsByTeacher($teacherUserId, $excludeChallengeId, $subjectId, $topicId, $grade);\n $out = $this->create_table_questions_for_teacher($questions);\n $this->output->set_output($out);\n\t}",
"function load_exam_form()\n\n\t{\n\n\t\taccess_control($this);\n\n\t\t\n\n\t\t# Get the passed details into the url data array if any\n\n\t\t$urldata = $this->uri->uri_to_assoc(3, array('m', 'i','a'));\n\n\t\t# Pick all assigned data\n\n\t\t$data = assign_to_data($urldata);\n\n\t\t\n\n\t\t$data['classes'] = $this->classobj->get_classes();\n\n\t\t\n\n\t\t$data['terms'] = $this->terms->get_terms();\n\n \n\n #user is editing\n\n\t\tif(!empty($data['i']))\n\n\t\t{\n\n\t\t\t$examid = decryptValue($data['i']);\n\n\t\t\t\n\n\t\t\t$data['formdata'] = $examdetails = $this->Query_reader->get_row_as_array('search_exams', array('limittext'=>'', 'searchstring' => ' AND isactive = \"Y\" AND id = '.$examid));\n\n\t\t\t\n\n\t\t\t#Check if the exam belongs to the current user's school\n\n\t\t\tif($examdetails['school'] != $this->myschool['id']){\n\n\t\t\t\t$data['msg'] = \"ERROR: The exam details could not be loaded.\";\n\n\t\t\t\t$data['formdata'] = $examdetails = array ();\t\n\n\t\t\t}\n\n\t\t\t \n\n #Check if the user is simply viewing\n\n if(!empty($data['a']) && decryptValue($data['a']) == 'view')\n\n {\n\n $data['isview'] = \"Y\";\n\n }\n\n\t\t}\n\n\t\t\n\n\t\t$this->load->view('exams/exam_form_view', $data);\n\n\t}",
"public function getSectionQuestionsTable($id)\n {\n if($this::check_session()){\n $data['sectionQuestions'] = $this->getSectionQuestions($id);\n $this->load->view('pages/admin/mng_ques', $data);\n }\n }",
"public function table()\n\t{\n\t\t$this->datatables->select('experiment_id, user_id_leader, id');\n\t\t$this->datatables->from('leader');\n\n\t\t$this->datatables->edit_column('experiment_id', '$1', 'experiment_get_link_by_id(experiment_id)');\n\t\t$this->datatables->edit_column('user_id_leader', '$1', 'user_get_link_by_id(user_id_leader)');\n\t\t$this->datatables->edit_column('id', '$1', 'leader_actions(id)');\n\n\t\techo $this->datatables->generate();\n\t}",
"protected function question_table($data)\n\t{\n\t\t$this->load->library('table', $this->table_config);\n\t\t$this->load->helper('text');\n\t\t$table_data = array(array('First Name', 'Last Name', 'Email', 'Question', 'Action'));\n\n\t\tforeach ($data as $row) {\n\t\t\t$feed = array();\n\t\t\t$feed[] = htmlentities($row->first_name);\n\t\t\t$feed[] = htmlentities($row->last_name);\n\t\t\t$feed[] = character_limiter(htmlentities($row->email), 30);\n\t\t\t$feed[] = word_limiter(htmlentities($row->comments), 4);\n\t\t\t$feed[] = anchor('ad/admin/messages/' . $row->id, 'View This', 'Class=\"btn btn-sm btn-warning\"');\n\n\t\t\t$table_data[] = $feed;\n\t\t}\n\t\treturn $this->table->generate($table_data);\n\t}",
"function show_detailed_testcase($ID) {\n\n $query = \"SELECT * FROM daf.testcase where ID = '\" . $ID . \"'\";\n $testcase = mysql_query($query);\n\n if (! $testcase) \n die (\"Database access failed for query=$query: \" . mysql_error());\n\n $num_rows = mysql_num_rows($testcase); // should only be one row\n $num_fields = mysql_num_fields($testcase);\n\n echo '<table class=\"tab1\">';\n echo \"<caption class=\\\"cap1\\\"><div>Testcase</div></caption>\";\n echo \"\\n\";\n \n $fieldindex = array();\n for ($i = 0; $i < $num_fields; $i++) {\n $fieldname = mysql_field_name($testcase, $i);\n $fieldindex[$fieldname] = $i;\n }\n \n $testcase_row = mysql_fetch_row($testcase);\n /* $ScenarioID = $scenario_row[$fieldindex['ID']]; */\n\n for ($i = 0; $i < $num_fields; $i++) {\n echo '<tr>';\n echo '<th>' . mysql_field_name($testcase, $i) . '</th>';\n echo '<td>' . $testcase_row[$i] . '</td>';\n echo '</tr>';\n echo \"\\n\";\n }\n echo '</table>';\n \n $query = \"SELECT DISTINCT scenario.ID, scenario.Name, action.Stepnumber FROM daf.action INNER JOIN daf.scenario ON action.ScenarioID = scenario.ID WHERE action.TestcaseID = '\" . $ID . \"'\";\n $testcase = mysql_query($query);\n\n if (! $testcase) \n die (\"Database access failed for query=$query: \" . mysql_error());\n\n $num_rows = mysql_num_rows($testcase); // should only be one row\n $num_fields = mysql_num_fields($testcase);\n\n echo '<form action=\"index.php\" method=\"post\">' . \"\\n\";\n\n echo '<table class=\"tab1\">';\n echo \"<caption class=\\\"cap1\\\"><div>Scenarios</div></caption>\";\n echo \"\\n\";\n \n $fieldindex = array();\n for ($i = 0; $i < $num_fields; $i++) {\n $fieldname = mysql_field_name($testcase, $i);\n echo '<th>' . $fieldname . '</th>';\n $fieldindex[$fieldname] = $i; \n }\n echo \"</tr>\\n\";\n \n $idindex = $fieldindex['ID'];\n $nameindex = $fieldindex['Name'];\n \n for ($i= 0; $i < $num_rows; $i++) {\n \n $testcase_row = mysql_fetch_row($testcase);\n echo '<tr>';\n for ($j = 0; $j < $num_fields; $j++) { \n if ($j == $nameindex) {\n echo \"<td class=td_smd><a href=index.php?action=show&object=scenario&ID=$testcase_row[$idindex]>$testcase_row[$j]</a></td>\"; \n } else { \n echo '<td>' . $testcase_row[$j] . '</td>';\n }\n } \n echo \"</tr>\\n\";\n \n }\n \n echo \"</tr>\\n\";\n echo '</table>'; \n \n}",
"function viewAttempts($lessonsID) {\n // Get an array containing all the attempts records.\n $records = attemptsArray();\n \n // Get the id of the lesson's quiz.\n $quiz = getQuiz($lessonsID);\n $quizID = $quiz['id'];\n \n // Table Headers\n echo \"<table><tr><th> First Name </th><th> Last Name </th><th> Date </th>\" .\n \"<th> Attempt </th><th> Score </th><th></th></tr>\";\n \n foreach ($records as $record) {\n if ($record['quizzesID'] == $quizID) {\n // Get Persons Record\n $person = getPerson($record['personsID']);\n \n // Table Row\n echo \"<tr><td>$person[firstName]</td><td>$person[lastName]</td><td>\" .\n \"$record[attemptDate]</td><td>$record[attemptNumber]</td><td>$record[score]\".\n \"</td></tr>\";\n }\n }\n\n echo \"</table>\";\n }",
"public function getResultsTable(UserQuizStatusInterface $state) {\n $answerStorage = static::entityTypeManager()->getStorage('answer');\n\n $header = array();\n $header['id'] = 'No.';\n $header['question'] = 'Question';\n $header['expected'] = 'Correct Answer';\n $header['received'] = 'Your Answer';\n\n $rows = array();\n $answers = $state->getAnswers();\n\n $c = 1;\n foreach ($answers as $answer) {\n /* @var $answer \\Drupal\\quiz\\Entity\\Answer */\n\n $question = $answer->getQuestion();\n /* @var $question \\Drupal\\quiz\\Entity\\Question */\n\n $rows[$answer->id()]['id'] = $c++;\n $rows[$answer->id()]['question'] = $answer->getQuestion()->get('question')->value;\n $rows[$answer->id()]['expected'] = '';\n $rows[$answer->id()]['received'] = '';\n $possible = array();\n\n //display the correct answer for the question\n if($question->getType() == 'multiple_choice_question') {\n foreach ($question->get('field_multiple_answer') as $field) {\n if ($field->value == 1) {\n $rows[$answer->id()]['expected'] .= $field->name . ', ';\n }\n $possible[] = $field->name;\n }\n }\n\n if($question->getType() == 'text_question')\n $rows[$answer->id()]['expected'] = $question->get('field_text_answer')->value;\n\n if($question->getType() == 'true_or_false') {\n if ($question->get('field_true_or_false')->value == 0) {\n $rows[$answer->id()]['expected'] = 'False';\n }\n else {\n $rows[$answer->id()]['expected'] = 'True';\n }\n }\n\n //display the user answer for the question\n if($answer->getType() == 'multiple_choice_answer') {\n foreach ($answer->get('field_multiple_answer') as $delta => $field) {\n if ($field->value == 1) {\n $rows[$answer->id()]['received'] .= $possible[$delta] . ', ';\n }\n }\n }\n\n if($answer->getType() == 'text_answer')\n $rows[$answer->id()]['received'] = $answer->get('field_text_answer')->value;\n\n if($answer->getType() == 'true_or_false') {\n if($answer->get('field_true_or_false')->value == 0) {\n $rows[$answer->id()]['received'] = 'False';\n }\n else {\n $rows[$answer->id()]['received'] = 'True';\n }\n }\n }\n\n $build['table'] = array(\n '#type' => 'table',\n '#header' => $header,\n '#rows' => $rows,\n '#empty' => $this->t('You didn\\'t answer any question.'),\n '#cache' => [\n 'contexts' => $answerStorage->getEntityType()->getListCacheContexts(),\n 'tags' => $answerStorage->getEntityType()->getListCacheTags(),\n ],\n );\n\n return $build;\n }",
"public function display_submissions_table() {\n global $CFG, $OUTPUT, $DB, $COURSE, $USER;\n\n require_once($CFG->libdir.'/tablelib.php');\n\n $canalwaysseeowner = has_capability('mod/surveypro:alwaysseeowner', $this->context);\n $canseeotherssubmissions = has_capability('mod/surveypro:seeotherssubmissions', $this->context);\n $canaccessallgroups = has_capability('moodle/site:accessallgroups', $this->context);\n $caneditownsubmissions = has_capability('mod/surveypro:editownsubmissions', $this->context);\n $caneditotherssubmissions = has_capability('mod/surveypro:editotherssubmissions', $this->context);\n $canduplicateownsubmissions = has_capability('mod/surveypro:duplicateownsubmissions', $this->context);\n $canduplicateotherssubmissions = has_capability('mod/surveypro:duplicateotherssubmissions', $this->context);\n $candeleteownsubmissions = has_capability('mod/surveypro:deleteownsubmissions', $this->context);\n $candeleteotherssubmissions = has_capability('mod/surveypro:deleteotherssubmissions', $this->context);\n $cansavetopdfownsubmissions = has_capability('mod/surveypro:savetopdfownsubmissions', $this->context);\n $cansavetopdfotherssubmissions = has_capability('mod/surveypro:savetopdfotherssubmissions', $this->context);\n\n $table = new \\flexible_table('submissionslist');\n\n if ($canseeotherssubmissions) {\n $table->initialbars(true);\n }\n\n $paramurl = array();\n $paramurl['id'] = $this->cm->id;\n if ($this->searchquery) {\n $paramurl['searchquery'] = $this->searchquery;\n }\n $baseurl = new \\moodle_url('/mod/surveypro/view_submissions.php', $paramurl);\n $table->define_baseurl($baseurl);\n\n $tablecolumns = array();\n if ($canalwaysseeowner || empty($this->surveypro->anonymous)) {\n $tablecolumns[] = 'picture';\n $tablecolumns[] = 'fullname';\n }\n $tablecolumns[] = 'status';\n $tablecolumns[] = 'timecreated';\n if (!$this->surveypro->history) {\n $tablecolumns[] = 'timemodified';\n }\n $tablecolumns[] = 'actions';\n $table->define_columns($tablecolumns);\n\n $tableheaders = array();\n if ($canalwaysseeowner || empty($this->surveypro->anonymous)) {\n $tableheaders[] = '';\n $tableheaders[] = get_string('fullname');\n }\n $tableheaders[] = get_string('status');\n $tableheaders[] = get_string('timecreated', 'mod_surveypro');\n if (!$this->surveypro->history) {\n $tableheaders[] = get_string('timemodified', 'mod_surveypro');\n }\n $tableheaders[] = get_string('actions');\n $table->define_headers($tableheaders);\n\n $table->sortable(true, 'sortindex', 'ASC'); // Sorted by sortindex by default.\n $table->no_sorting('actions');\n\n $table->column_class('picture', 'picture');\n $table->column_class('fullname', 'fullname');\n $table->column_class('status', 'status');\n $table->column_class('timecreated', 'timecreated');\n if (!$this->surveypro->history) {\n $table->column_class('timemodified', 'timemodified');\n }\n $table->column_class('actions', 'actions');\n\n // Hide the same info whether in two consecutive rows.\n if ($canalwaysseeowner || empty($this->surveypro->anonymous)) {\n $table->column_suppress('picture');\n $table->column_suppress('fullname');\n }\n\n // General properties for the whole table.\n $table->set_attribute('cellpadding', 5);\n $table->set_attribute('id', 'submissions');\n $table->set_attribute('class', 'generaltable');\n $table->set_attribute('align', 'center');\n $table->setup();\n\n $status = array();\n $status[SURVEYPRO_STATUSINPROGRESS] = get_string('statusinprogress', 'mod_surveypro');\n $status[SURVEYPRO_STATUSCLOSED] = get_string('statusclosed', 'mod_surveypro');\n\n $neverstr = get_string('never');\n\n $counter = $this->get_counter($table);\n $table->pagesize(20, $counter['closedsubmissions'] + $counter['inprogresssubmissions']);\n\n $this->display_submissions_overview($counter['enrolled'], $counter['allusers'],\n $counter['closedsubmissions'], $counter['closedusers'],\n $counter['inprogresssubmissions'], $counter['inprogressusers']);\n\n list($sql, $whereparams) = $this->get_submissions_sql($table);\n\n $submissions = $DB->get_recordset_sql($sql, $whereparams, $table->get_page_start(), $table->get_page_size());\n if ($submissions->valid()) {\n\n $iconparams = array();\n\n $nonhistoryeditstr = get_string('edit');\n $iconparams['title'] = $nonhistoryeditstr;\n $nonhistoryediticn = new \\pix_icon('t/edit', $nonhistoryeditstr, 'moodle', $iconparams);\n\n $readonlyaccessstr = get_string('readonlyaccess', 'mod_surveypro');\n $iconparams['title'] = $readonlyaccessstr;\n $readonlyicn = new \\pix_icon('readonly', $readonlyaccessstr, 'surveypro', $iconparams);\n\n $duplicatestr = get_string('duplicate');\n $iconparams['title'] = $duplicatestr;\n $duplicateicn = new \\pix_icon('t/copy', $duplicatestr, 'moodle', $iconparams);\n\n if ($this->surveypro->history) {\n $attributestr = get_string('editcopy', 'mod_surveypro');\n $linkidprefix = 'editcopy_submission_';\n } else {\n $attributestr = $nonhistoryeditstr;\n $linkidprefix = 'edit_submission_';\n }\n $iconparams['title'] = $attributestr;\n $attributeicn = new \\pix_icon('t/edit', $attributestr, 'moodle', $iconparams);\n\n $deletestr = get_string('delete');\n $iconparams['title'] = $deletestr;\n $deleteicn = new \\pix_icon('t/delete', $deletestr, 'moodle', $iconparams);\n\n $downloadpdfstr = get_string('downloadpdf', 'mod_surveypro');\n $iconparams['title'] = $downloadpdfstr;\n $downloadpdficn = new \\pix_icon('t/download', $downloadpdfstr, 'moodle', $iconparams);\n\n $groupmode = groups_get_activity_groupmode($this->cm, $COURSE);\n if ($groupmode) { // Activity is divided into groups.\n $utilitysubmissionman = new utility_submission($this->cm, $this->surveypro);\n $mygroupmates = $utilitysubmissionman->get_groupmates($this->cm);\n } else {\n $mygroupmates = [];\n }\n\n $tablerowcounter = 0;\n $paramurlbase = ['id' => $this->cm->id];\n\n foreach ($submissions as $submission) {\n // Count each submission.\n $tablerowcounter++;\n $submissionsuffix = 'row_'.$tablerowcounter;\n\n // Before starting, just set some information.\n $ismine = ($submission->userid == $USER->id);\n if ($canaccessallgroups) {\n $mysamegroup = true;\n } else {\n if ($groupmode) { // Activity is divided into groups.\n $mysamegroup = in_array($submission->userid, $mygroupmates);\n } else {\n $mysamegroup = false;\n }\n }\n\n $tablerow = array();\n\n // Icon.\n if ($canalwaysseeowner || empty($this->surveypro->anonymous)) {\n $tablerow[] = $OUTPUT->user_picture($submission, ['courseid' => $COURSE->id]);\n\n // User fullname.\n $paramurl = ['id' => $submission->userid, 'course' => $COURSE->id];\n $url = new \\moodle_url('/user/view.php', $paramurl);\n $tablerow[] = '<a href=\"'.$url->out().'\">'.fullname($submission).'</a>';\n }\n\n // Surveypro status.\n $tablerow[] = $status[$submission->status];\n\n // Creation time.\n $tablerow[] = userdate($submission->timecreated);\n\n // Timemodified.\n if (!$this->surveypro->history) {\n // Modification time.\n if ($submission->timemodified) {\n $tablerow[] = userdate($submission->timemodified);\n } else {\n $tablerow[] = $neverstr;\n }\n }\n\n // Actions.\n $paramurl = $paramurlbase;\n $paramurl['submissionid'] = $submission->submissionid;\n\n // Edit.\n $displayediticon = false;\n if ($ismine) { // Owner is me.\n if ($submission->status == SURVEYPRO_STATUSINPROGRESS) {\n // You always MUST have the possibility to close an inprogress submission.\n $displayediticon = true;\n } else {\n $displayediticon = $caneditownsubmissions;\n }\n } else {\n if ($mysamegroup) { // Owner is from a group of mine.\n // I should be here only if $canseeotherssubmissions = true.\n if ($submission->status == SURVEYPRO_STATUSINPROGRESS) {\n // You always MUST have the possibility to close an inprogress submission of someone from your same group.\n $displayediticon = $canseeotherssubmissions;\n } else {\n $displayediticon = $caneditotherssubmissions;\n }\n }\n }\n if ($displayediticon) {\n $paramurl['view'] = SURVEYPRO_EDITRESPONSE;\n $paramurl['begin'] = 1;\n\n if ($submission->status == SURVEYPRO_STATUSINPROGRESS) {\n // Here title and alt are ALWAYS $nonhistoryeditstr.\n $link = new \\moodle_url('/mod/surveypro/view_form.php', $paramurl);\n $paramlink = ['id' => 'edit_submission_'.$submissionsuffix, 'title' => $nonhistoryeditstr];\n $icons = $OUTPUT->action_icon($link, $nonhistoryediticn, null, $paramlink);\n } else {\n // Here title and alt depend from $this->surveypro->history.\n $link = new \\moodle_url('/mod/surveypro/view_form.php', $paramurl);\n $paramlink = ['id' => $linkidprefix.$submissionsuffix, 'title' => $attributestr];\n $icons = $OUTPUT->action_icon($link, $attributeicn, null, $paramlink);\n }\n } else {\n $paramurl['view'] = SURVEYPRO_READONLYRESPONSE;\n $paramurl['begin'] = 1;\n\n $link = new \\moodle_url('/mod/surveypro/view_form.php', $paramurl);\n $paramlink = ['id' => 'view_submission_'.$submissionsuffix, 'title' => $readonlyaccessstr];\n $icons = $OUTPUT->action_icon($link, $readonlyicn, null, $paramlink);\n }\n\n // Duplicate.\n $displayduplicateicon = false;\n if ($ismine) { // Owner is me.\n $displayduplicateicon = $canduplicateownsubmissions;\n } else {\n if ($mysamegroup) { // Owner is from a group of mine.\n // I should be here only if $canseeotherssubmissions = true.\n $displayduplicateicon = $caneditotherssubmissions;\n }\n }\n if ($displayduplicateicon) { // I am the owner or a groupmate.\n $utilitylayoutman = new utility_layout($this->cm, $this->surveypro);\n $cansubmitmore = $utilitylayoutman->can_submit_more($submission->userid);\n if ($cansubmitmore) { // The copy will be assigned to the same owner.\n $paramurl = $paramurlbase;\n $paramurl['submissionid'] = $submission->submissionid;\n $paramurl['sesskey'] = sesskey();\n $paramurl['act'] = SURVEYPRO_DUPLICATERESPONSE;\n\n $link = new \\moodle_url('/mod/surveypro/view_submissions.php', $paramurl);\n $paramlink = ['id' => 'duplicate_submission_'.$submissionsuffix, 'title' => $duplicatestr];\n $icons .= $OUTPUT->action_icon($link, $duplicateicn, null, $paramlink);\n }\n }\n\n // Delete.\n $displaydeleteicon = false;\n $paramurl = $paramurlbase;\n $paramurl['submissionid'] = $submission->submissionid;\n if ($ismine) { // Owner is me.\n $displaydeleteicon = $candeleteownsubmissions;\n } else {\n if ($mysamegroup) { // Owner is from a group of mine.\n // I should be here only if $canseeotherssubmissions = true.\n $displaydeleteicon = $candeleteotherssubmissions;\n }\n }\n if ($displaydeleteicon) {\n $paramurl['sesskey'] = sesskey();\n $paramurl['act'] = SURVEYPRO_DELETERESPONSE;\n\n $link = new \\moodle_url('/mod/surveypro/view_submissions.php', $paramurl);\n $paramlink = ['id' => 'delete_submission_'.$submissionsuffix, 'title' => $deletestr];\n $icons .= $OUTPUT->action_icon($link, $deleteicn, null, $paramlink);\n }\n\n // Download to pdf.\n $displaydownloadtopdficon = false;\n if ($submission->status == SURVEYPRO_STATUSINPROGRESS) {\n $displaydownloadtopdficon = false;\n } else {\n if ($ismine) { // Owner is me.\n $displaydownloadtopdficon = $cansavetopdfownsubmissions;\n } else {\n if ($mysamegroup) { // Owner is from a group of mine.\n $displaydownloadtopdficon = $cansavetopdfotherssubmissions;\n }\n }\n }\n if ($displaydownloadtopdficon) {\n $paramurl = $paramurlbase;\n $paramurl['submissionid'] = $submission->submissionid;\n $paramurl['act'] = SURVEYPRO_RESPONSETOPDF;\n $paramurl['sesskey'] = sesskey();\n\n $link = new \\moodle_url('/mod/surveypro/view_submissions.php', $paramurl);\n $paramlink = ['id' => 'pdfdownload_submission_'.$submissionsuffix, 'title' => $downloadpdfstr];\n $icons .= $OUTPUT->action_icon($link, $downloadpdficn, null, $paramlink);\n }\n\n $tablerow[] = $icons;\n\n // Add row to the table.\n $table->add_data($tablerow);\n }\n }\n $submissions->close();\n\n $table->summary = get_string('submissionslist', 'mod_surveypro');\n $table->print_html();\n\n // If this is the output of a search and nothing has been found add a way to show all submissions.\n if (!isset($tablerow) && ($this->searchquery)) {\n $url = new \\moodle_url('/mod/surveypro/view_submissions.php', ['id' => $this->cm->id]);\n $label = get_string('showallsubmissions', 'mod_surveypro');\n echo $OUTPUT->box($OUTPUT->single_button($url, $label, 'get'), 'clearfix mdl-align');\n }\n }",
"function show_detailed_teststand($ID) {\n\n $query = \"SELECT * FROM daf.teststand where ID = '\" . $ID . \"'\";\n $teststand = mysql_query($query);\n\n if (! $teststand) \n die (\"Database access failed for query=$query: \" . mysql_error());\n\n $num_rows = mysql_num_rows($teststand); // should only be one row\n $num_fields = mysql_num_fields($teststand);\n\n echo '<table class=\"fullwidth\">';\n echo \"<caption class=\\\"cap1\\\"><div>Teststand</div></caption>\";\n echo \"\\n\";\n \n $fieldindex = array();\n for ($i = 0; $i < $num_fields; $i++) {\n $fieldname = mysql_field_name($teststand, $i);\n $fieldindex[$fieldname] = $i;\n }\n \n $teststand_row = mysql_fetch_row($teststand);\n /* $ScenarioID = $scenario_row[$fieldindex['ID']]; */\n\n for ($i = 0; $i < $num_fields; $i++) {\n echo '<tr>';\n echo '<th class=\"fullwidth\">' . mysql_field_name($teststand, $i) . '</th>';\n echo '<td>' . $teststand_row[$i] . '</td>';\n echo '</tr>';\n echo \"\\n\";\n }\n echo '</table>';\n \n show_all_hosts($ID, \"fullwidth\");\n \n /* $query = \"SELECT ID, Name, Type, Model, Serial, Hostselectorvalue, Teststandprimary, Comments, Agentstatus, Agentstatusdate FROM daf.host WHERE host.TeststandID = '\" . $ID . \"'\";\n \n $testcase = mysql_query($query);\n\n if (! $testcase) die (\"Database access failed for query=$query: \" . mysql_error());\n\n $num_rows = mysql_num_rows($testcase); // should only be one row\n $num_fields = mysql_num_fields($testcase);\n\n echo '<form action=\"index.php\" method=\"post\">' . \"\\n\";\n\n echo '<table class=\"tab1\">';\n echo \"<caption class=\\\"cap1\\\"><div>Hosts</div></caption>\";\n echo \"\\n\";\n \n $fieldindex = array();\n for ($i = 0; $i < $num_fields; $i++) {\n $fieldname = mysql_field_name($testcase, $i);\n echo '<th>' . $fieldname . '</th>';\n $fieldindex[$fieldname] = $i; \n }\n echo \"</tr>\\n\";\n \n $idindex = $fieldindex['ID'];\n $nameindex = $fieldindex['Name'];\n \n for ($i= 0; $i < $num_rows; $i++) {\n \n $testcase_row = mysql_fetch_row($testcase);\n echo '<tr>';\n for ($j = 0; $j < $num_fields; $j++) { \n if ($j == $nameindex) {\n echo \"<td class=td_smd><a href=index.php?action=show&object=host&ID=$testcase_row[$idindex]>$testcase_row[$j]</a></td>\"; \n } else { \n echo '<td>' . $testcase_row[$j] . '</td>';\n }\n } \n echo \"</tr>\\n\";\n \n }\n\n echo '</table>'; */\n \n show_detailed_child_objects(\"teststand\", $ID, 1);\n \n}",
"public function enquiries()\n\t{\n\t\t$this->checkAdminLoginSession();\n\t\t$data['page'] = '123';\n\t\t$data['list_arr']=$this->AM->adminEnquiryList();\t\t\n\t\t$this->load->view($this->_admin_enquiries,$data);\n\t}",
"function asTable($form);",
"function createAnswersForm ($form) {\n\n\t\t$nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 4; // The previous default value was 2. See task #1759.\n\t\t$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));\n\n\t\t$obj_ex = $_SESSION['objExercise'];\n \n\t\t$html.='<div class=\"row\">\n\t\t\t <div class=\"label\">\n\t\t\t '.get_lang('Answers').'<br /><img src=\"../img/fill_field.png\">\n\t\t\t </div>\n\t\t\t <div class=\"formw\">'; \n \n $html2 ='<div class=\"row\">\n <div class=\"label\"> \n </div>\n <div class=\"formw\">';\n \n $form -> addElement ('html', $html2); \n $form -> addElement ('html', '<table><tr>'); \n $renderer = & $form->defaultRenderer();\n $defaults = array();\n //Extra values True, false, Dont known\n if (!empty($this->extra)) {\n $scores = explode(':',$this->extra);\n \n if (!empty($scores)) {\n for ($i = 1; $i <=3; $i++) {\n $defaults['option['.$i.']']\t= $scores[$i-1]; \n } \n } \n }\n \n // 3 scores\n $form->addElement('text', 'option[1]',get_lang('True'), array('size'=>'5','value'=>'1'));\n $form->addElement('text', 'option[2]',get_lang('False'), array('size'=>'5','value'=>'-0.5')); \n $form->addElement('text', 'option[3]',get_lang('DoubtScore'),array('size'=>'5','value'=>'0')); \n \n $form -> addElement('hidden', 'options_count', 3);\n \n $form -> addElement ('html', '</tr></table>');\n $form -> addElement ('html', '</div></div>');\n \n\t\t$html.='<table class=\"data_table\">\n\t\t\t\t\t<tr style=\"text-align: center;\">\n\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t'.get_lang('Number').'\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t'.get_lang('True').'\n\t\t\t\t\t\t</th>\n <th>\n '.get_lang('False').'\n </th> \n\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t'.get_lang('Answer').'\n\t\t\t\t\t\t</th>';\n \t\t\t\t// show column comment when feedback is enable\n \t\t\t\tif ($obj_ex->selectFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM ) {\n \t\t\t\t $html .='<th>'.get_lang('Comment').'</th>';\n \t\t\t\t}\n\t\t\t\t$html .= '</tr>';\n\t\t$form -> addElement ('html', $html);\n\n\t\t\n\t\t$correct = 0;\n\t\tif (!empty($this -> id))\t{\n\t\t\t$answer = new Answer($this -> id);\n\t\t\t$answer->read();\t\t\t\n\t\t\tif (count($answer->nbrAnswers) > 0 && !$form->isSubmitted()) {\n\t\t\t\t$nb_answers = $answer->nbrAnswers;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$form -> addElement('hidden', 'nb_answers');\n\t\t$boxes_names = array();\n\n\t\tif ($nb_answers < 1) {\n\t\t\t$nb_answers = 1;\n\t\t\tDisplay::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));\n\t\t}\n \n // Can be more options \n $option_data = Question::readQuestionOption($this->id); \n \n \n\t\tfor ($i = 1 ; $i <= $nb_answers ; ++$i) {\n \n $renderer->setElementTemplate('<td><!-- BEGIN error --><span class=\"form_error\">{error}</span><!-- END error -->{label} {element}</td>'); \n $answer_number=$form->addElement('text', null,null,'value=\"'.$i.'\"');\n $answer_number->freeze(); \n \n\t\t\tif (is_object($answer)) { \n\t\t\t\t$defaults['answer['.$i.']'] = $answer -> answer[$i];\n\t\t\t\t$defaults['comment['.$i.']'] = $answer -> comment[$i];\n\t\t\t\t//$defaults['weighting['.$i.']'] = float_format($answer -> weighting[$i], 1);\n \n $correct = $answer->correct[$i];\n \n $defaults['correct['.$i.']'] = $correct; \n\t\t\t\n $j = 1; \n if (!empty($option_data)) {\n foreach ($option_data as $id=>$data) { \n $form->addElement('radio', 'correct['.$i.']', null, null, $id);\n $j++;\n if ($j == 3) {\n \tbreak;\n }\n \n } \n }\n\t\t\t} else { \n $form->addElement('radio', 'correct['.$i.']', null, null, 1); \n $form->addElement('radio', 'correct['.$i.']', null, null, 2);\n \n $defaults['answer['.$i.']'] = '';\n $defaults['comment['.$i.']'] = '';\n $defaults['correct['.$i.']'] = ''; \n\t\t\t} \n \n //$form->addElement('select', 'correct['.$i.']',null, $this->options, array('id'=>$i,'onchange'=>'multiple_answer_true_false_onchange(this)'));\n \n\t\t\t$boxes_names[] = 'correct['.$i.']';\n\n\t\t\t$form->addElement('html_editor', 'answer['.$i.']',null, 'style=\"vertical-align:middle\"', array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));\n\t\t\t$form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required');\n\n\t\t\t// show comment when feedback is enable\n\t\t\tif ($obj_ex->selectFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM) {\n\t\t\t\t$form->addElement('html_editor', 'comment['.$i.']',null, 'style=\"vertical-align:middle\"', array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));\n\t\t\t}\n\t\t\t$form->addElement ('html', '</tr>');\n\t\t}\n\t\t$form -> addElement ('html', '</table>');\n\t\t$form -> addElement ('html', '<br />');\n\n\t\t//$form -> add_multiple_required_rule ($boxes_names , get_lang('ChooseAtLeastOneCheckbox') , 'multiple_required');\n\n\n\t\t$navigator_info = api_get_navigator();\n\n\t\tglobal $text, $class, $show_quiz_edition;\n\t\tif ($show_quiz_edition) {\n\t\t\t//ie6 fix\n\t\t\tif ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=='6') {\n \n $form->addElement('submit', 'lessAnswers', get_lang('LessAnswer'),'class=\"minus\"');\n $form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'),'class=\"plus\"');\t\t\t\t\n $form->addElement('submit', 'submitQuestion',$text, 'class=\"'.$class.'\"');\n\t\t\t} else {\n // setting the save button here and not in the question class.php\n \n $form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'),'class=\"minus\"');\n $form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'),'class=\"plus\"');\n $form->addElement('style_submit_button', 'submitQuestion',$text, 'class=\"'.$class.'\"');\t\n\t\t\t}\n\t\t}\n\t\t$renderer->setElementTemplate('{element} ','lessAnswers');\n\t\t$renderer->setElementTemplate('{element} ','submitQuestion');\n\t\t$renderer->setElementTemplate('{element}','moreAnswers');\n\t\t$form -> addElement ('html', '</div></div>');\n\t\t$defaults['correct'] = $correct;\n\n\t\tif (!empty($this -> id)) {\n\t\t\t$form -> setDefaults($defaults);\n\t\t} else {\n\t\t\t//if ($this -> isContent == 1) {\n\t\t\t\t$form -> setDefaults($defaults);\n\t\t\t//}\n\t\t}\n\n\t\t$form->setConstants(array('nb_answers' => $nb_answers));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check for authorization and redirect. | private function authorization_redirect() {
self::authorization();
wp_safe_redirect( esc_url( pointfinder_apim()->get_page_url()) );
exit;
} | [
"protected function handleAuthorization()\n {\n if (isset($this->request->target)) {\n $this->authorizeClient($_SERVER['REMOTE_ADDR']);\n $this->onSuccess();\n $this->redirect();\n } elseif ($this->isClientAuthorized($_SERVER['REMOTE_ADDR'])) {\n $this->redirect();\n } else {\n $this->showError();\n }\n }",
"public function RedirectToAuthorization();",
"public function checkAuthorization() {\n\t\tif (!($this->isTeacher || $this->isStudent)) {\n\t\t\t$this->flashMessage('Unauthorized access.', $type = 'unauthorized');\n\t\t\t$this->redirect('courselist:homepage');\n\t\t}\n\t}",
"protected function _checkAccess()\n {\n $front = Zend_Controller_Front::getInstance();\n $request = Zend_Controller_Front::getInstance()->getRequest();\n $module = $request->getModuleName();\n $controller = $request->getControllerName();\n $action = $request->getActionName();\n $url = $module . \"/\" . $controller . \"/\" . $action;\n \n if ($module == 'default' and ($controller == 'install' or $controller == 'error')) {\n return;\n }\n\n $pageAccess = new Core_Model_UrlAccess;\n\n $privilegeName = $pageAccess->getPrivilgeNameFromUrl($url);\n $assertion = $pageAccess->getAssertionClass($url);\n $acl = Zend_Registry::get('acl');\n $currentUser = Zend_Registry::get('user');\n $auth = Zend_Auth::getInstance();\n \n /**\n * Check access based on privilege id stored in the database\n */\n if ($privilegeName) { \n /**\n * If user does not have access to the resource and privielge redirect\n */ \n if (!$acl->isAllowed($currentUser, $privilegeName)){\n if ($auth->hasIdentity()) {\n /*\n * Redirect to error if user is authenticated\n */\n #$this->sendToErrorAccess();\n $this->_alterRequest('default', 'error', 'access');\n } else {\n /*\n * Redirect to login page if user is anonymous\n */\n #$this->sendToUserLogin();\n $this->_alterRequest('default', 'user', 'login');\n }\n }\n\n } \n \n /**\n * If callback validator is available use it\n */\n if ($assertion) { \n $assertionObject = new $assertion($request->getParams());\n /**\n * If user does not have access to the privilege redirect to access denied page\n */ \n if (!$acl->isAllowed($currentUser, null, $assertionObject)) {\n if ($auth->hasIdentity()) {\n /*\n * Redirect to error if user is authenticated\n */\n $this->_alterRequest('default', 'error', 'access');\n } else {\n /**\n * Redirect to login page if user is anonymous\n */\n $this->_alterRequest('default', 'user', 'login');\n }\n }\n } \n }",
"abstract public function check_auth();",
"public function checkAuthentication() {}",
"protected function handleUnauthorizedAccess()\n {\n HttpUtility::redirect($this->getRedirectUrlForUnauthorized(), HttpUtility::HTTP_STATUS_401);\n }",
"public function checkAuthorization() {\n\t\tif( $this->authorizationRequest )\n\t\t\treturn false;\n\n\t\t$result = $this->requestWithAuth( new HttpRequest(\"\"), true );\n\t\treturn !!$result;\n\t}",
"function checkUnauthorizedAccess() {\n if(!isLoggedIn()) {\n redirect(\\route\\Route::get(\"unauthorizedAccess\")->generate());\n }\n}",
"public function authorizationFlow();",
"public function mustRedirect();",
"public function checkAuthentication(){\n\t\t\n\t\t// if user is not logged in\n\t\tif (!Session::userIsLoggedIn()) {\n\t\t\t// ... then treat user as \"not logged in\", destroy session, redirect to login page\n\t\t\tSession::destroy();\n\t\t\t// send the user to the login form page, but also add the current page's URI (the part after the base URL)\n\t\t\t// as a parameter argument, making it possible to send the user back to where he/she came from after a\n\t\t\t// successful login\n\t\n\t\t\t$this->redirect($this->config('app.baseurl') . '/login?redirect=' . urlencode($_SERVER['REQUEST_URI']));\n\t\t\t// in ambiente Slim, in alterantiva a $_SERVER['REQUEST_URI'] forse si potrebbe uare $this->request->getPath();\n\t\n\t\t\t// to prevent fetching views via cURL (which \"ignores\" the header-redirect above) we leave the application\n\t\t\t// the hard way, via exit(). @see https://github.com/panique/php-login/issues/453\n\t\t\t// this is not optimal and will be fixed in future releases\n\t\t\texit();\n\t\t}\n\t}",
"public function authorize()\n {\n // Only authenticated user can make this request\n if (Auth()->check())\n {\n return true;\n }\n return false;\n }",
"public function checkRoute()\n\t{\n\t\t$allow=0;\n\t\tforeach ($this->allow as $key => $value) {\n\t\t\tif($this->route == $value){\n\t\t\t\t$allow=1;\n\t\t\t}\n\t\t}\n if (!$this->user->isAuthorized() && !$allow) {\n \t$this->redirect('/user/login');\n \texit();\n }\n if ($this->user->isAuthorized() && $allow) {\n \t$this->redirect('/');\n \texit();\n }\n\t}",
"protected function CheckAuthStatus(){\n\t\tif ($this->auth)\n\t\t\t$this->auth->check();\n\t}",
"public static function checkPermission(){\n\t\tif(!self::checkLoggedin())\n\t\t\tHeaderUtil::redirect(\"/login\");\n\t\telse\n\t\t{\n\t\t\t// check if banned\n\t\t}\n\t}",
"protected function authorization()\n {\n $this->gate();\n Horizon::auth(function ($request) {\n return app()->environment('local') ||\n Gate::forUser($request->user('admin'))->check('viewHorizon');\n });\n }",
"public function authRequired();",
"private function check_login()\n {\n if ($this->auth_required == TRUE AND Auth::instance()->logged_in($this->auth_role) == FALSE)\n {\n if (Auth::instance()->logged_in())\n {\n $this->redirect('pages/noaccess');\n }\n else\n {\n $this->redirect('login');\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function generates the rows of the table if the user is requesting to see a single thread. In this case each row of the table will be a post in the thread. | private function generateSingleThread()
{
$table =
'
<style type="text/css">
.tg {border-collapse:collapse;border-spacing:0;border-color:#999;}
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#999;color:#444;background-color:#F7FDFA;}
.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#999;color:#333;background-color:#26ADE4;}
.tg .tg-shvy{font-weight:bold;background-color: #f5f5f5; font-size: 16px; text-align: center; }
</style>
<table class="tg" style="width: 100%;">
';
$table .= $this->singleThreadQuery();
$table .= '</table>';
return $table;
} | [
"function createPostTable(&$dbparams, &$existingthread, &$posts, &$css)\r\n\t{\r\n\t\t//get required params\r\n\t\tdefined('_DATE_FORMAT_LC2') or define('_DATE_FORMAT_LC2','%A, %d %B %Y %H:%M');\r\n\t\t$date_format = $dbparams->get('custom_date', _DATE_FORMAT_LC2);\r\n\t\t$tz_offset = intval($dbparams->get('tz_offset'));\r\n\t\t$showdate = intval($dbparams->get('show_date'));\r\n\t\t$showuser = intval($dbparams->get('show_user'));\r\n\t\t$showavatar = $dbparams->get(\"show_avatar\");\r\n\t\t$avatar_software = $dbparams->get(\"avatar_software\",false);\r\n\t\t$userlink = intval($dbparams->get('user_link'));\r\n\t\t$link_software = $dbparams->get('userlink_software',false);\r\n\t\t$userlink_custom = $dbparams->get('userlink_custom',false);\r\n\t\t$itemid = $dbparams->get(\"itemid\");\r\n\t\t$jname = $this->getJname();\r\n\t\t$header = $dbparams->get(\"post_header\");\r\n\r\n\t\tif($showdate && $showuser) $colspan = 2;\r\n\t\telse $colspan = 1;\r\n\r\n\t\t$table = \"<div class='{$css[\"postHeader\"]}'>$header</div>\\n\";\r\n\r\n\t\tfor ($i=0; $i<count($posts); $i++)\r\n\t\t{\r\n\t\t\t$p = &$posts[$i];\r\n\r\n\t\t\t$table .= \"<div class = '{$css[\"postBody\"]}'> \\n\";\r\n\r\n\t\t\t//avatar\r\n\t\t\tif($showavatar){\r\n if(empty($avatar_software) || $avatar_software=='jfusion') {\r\n\t\t\t\t\t$avatarSrc = $this->getAvatar($p->ID_MEMBER);\r\n } else {\r\n \t$avatarSrc = JFusionFunction::getAltAvatar($avatar_software,$p->ID_MEMBER,true,$this->getJname(),$p->memberName);\r\n }\r\n \t \r\n\t\t\t\tif(empty($avatarSrc)) {\r\n\t\t\t\t\t$avatarSrc = JFusionFunction::getJoomlaURL().\"administrator\".DS.\"components\".DS.\"com_jfusion\".DS.\"images\".DS.\"noavatar.png\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$size = @getimagesize($avatarSrc);\r\n\t\t\t\t$w = $size[0];\r\n\t\t\t\t$h = $size[1];\r\n\t\t\t\tif($size[0]>60) {\r\n\t\t\t\t\t$scale = min(60/$w, 80/$h);\r\n\t\t\t\t\t$w = floor($scale*$w);\r\n\t\t\t\t\t$h = floor($scale*$h);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$w = 60;\r\n\t\t\t\t\t$h = 80;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t$avatar = \"<div class='{$css[\"userAvatar\"]}'><img height='$h' width='$w' src='$avatarSrc'></div>\";\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t$avatar = \"\";\r\n\t\t\t}\r\n\t\t\t$table .= $avatar;\r\n\r\n\t\t\t//post title\r\n\t\t\t$urlstring_pre = JFusionFunction::routeURL($this->getPostURL($p->ID_TOPIC,$p->ID_MSG), $itemid);\r\n\t\t\t$title = '<a href=\"'. $urlstring_pre . '\">'. $p->subject .'</a>';\r\n\t\t\t$table .= \"<div class = '{$css[\"postTitle\"]}'>{$title}</div>\\n\";\r\n\r\n\t\t\t//user info\r\n\t\t\tif ($showuser)\r\n\t\t\t{\r\n\t\t\t\tif ($userlink) {\r\n\t\t\t\t\tif(!empty($link_software) && $link_software != 'jfusion' && $link_software!='custom') {\r\n\t\t\t\t\t\t$user_url = JFusionFunction::getAltProfileURL($link_software,$p->memberName);\r\n\t\t\t\t\t} elseif ($link_software=='custom' && !empty($userlink_custom)) {\r\n\t\t\t\t\t\t$userlookup = JFusionFunction::lookupUser($this->getJname(),$p->ID_MEMBER,false, $p->memberName);\r\n\t\t\t\t\t\t$user_url = $userlink_custom.$userlookup->id;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$user_url = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif($user_url === false) {\r\n\t\t\t\t\t\t$user_url = JFusionFunction::routeURL($this->getProfileURL($p->ID_MEMBER), $itemid);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$user = '<a href=\"'. $user_url . '\">'.$p->memberName.'</a>';\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$user = $p->memberName;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$table .= \"<div class='{$css[\"postUser\"]}'> by $user</div>\";\r\n\t\t\t}\r\n\r\n\t\t\t//post date\r\n\t\t\tif($showdate) {\r\n\t\t\t\tjimport('joomla.utilities.date');\r\n\t\t\t\t$JDate = new JDate($p->posterTime);\r\n\t\t\t\t$JDate->setOffset($tz_offset);\r\n\t\t\t\t$date = $JDate->toFormat($date_format);\r\n\t\t\t\t$table .= \"<div class='{$css[\"postDate\"]}'>\".$date.\"</div>\";\r\n\t\t\t}\r\n\r\n\t\t\t//post body\r\n\t\t\t$text = $this->prepareText($p->body,true);\r\n\t\t\t$table .= \"<div class='{$css[\"postText\"]}'>{$text}</div> \\n\";\r\n\t\t\t$table .= \"</div>\";\r\n\t\t}\r\n\t\treturn $table;\r\n\t}",
"public function viewGameThreadPosts(){\n\t\t$gameID = $_POST['gameID'];\n\t\t$tid = $_POST['tid'];\n\t\t\n\t\t// unset $_POST\n\t\tunset($_POST['gameID']);\n\t\tunset($_POST['tid']);\n\t\t\n\t\t$threadPosts = $gameID . \"_\" . $tid .\"_Post\";\n\t\t\n\t\t$exists = $this->db->prepare(\"SELECT * FROM :threadPosts\");\n\t\t$exists->execute(array(\n\t\t\t':threadPosts' => $threadPosts,\n\t\t));\n\t\t\n\t\t$row = $exists->rowCount();\n\t\t\n\t\tfor($i = 0; $i < $row; $i++){\n\t\t\t\n\t\t}\n\t}",
"function show_thread_and_context($thread, $user, $i) {\n $thread_forum = BoincForum::lookup_id($thread->forum);\n if (!$thread_forum) return;\n if (!is_forum_visible_to_user($thread_forum, $user)) return;\n $owner = BoincUser::lookup_id($thread->owner);\n $j = $i % 2;\n echo \"<tr class=row$j><td>\\n\";\n switch($thread_forum->parent_type) {\n case 0:\n $category = BoincCategory::lookup_id($thread_forum->category);\n show_forum_title($category, $thread_forum, $thread, true);\n break;\n case 1:\n show_team_forum_title($thread_forum, $thread);\n break;\n }\n echo '\n </td><td class=\"numbers\">'.($thread->replies+1).'</td>\n <td>'.user_links($owner).'</td>\n <td class=\"numbers\">'.$thread->views.'</td>\n <td class=\"lastpost\">'.time_diff_str($thread->timestamp, time()).'</td>\n </tr>\n ';\n}",
"function f_tableQueue()\n\t{\n\t\tglobal $db;\n\t\t$sql_query = \"select tc.avg_duration,tr.user_id, tr.test_id, tr.request_id,tr.label,tc.test_name,tr.request_timestamp\n\t\t\t\t\t\t\t\tfrom test_request as tr,test_case as tc where tr.status = 0 and tr.test_id = tc.test_id order by tr.request_id\";\n\t\t$result = $db->query($sql_query) or die($db->error);\n while($row = $result->fetch_assoc())\n\t\t{\n\t\t\t$rid='';\n\t\t\t$label='';\n\t\t\t$name='';\n\t\t\t$rtime='';\n\t\t\t$uid='';\n\t\t\t$user_name='';\n\t\t\t$duration='';\n\t\t\t\n\t\t\t$test_id='';\n\t\t\t$env='';\n\t\t\t\n\t\t\t$rid = $row['request_id'];\n\t\t\t$label = $row['label'];\n\t\t\t$name = $row['test_name'];\n\t\t\t$rtime = $row['request_timestamp'];\n\t\t\t$uid = $row['user_id'];\n\t\t\t$user_name = f_getUserFromId($uid);\n\t\t\t$duration = $row['avg_duration'];\n\t\t\t\n\t\t\t$test_id = $row['test_id'];\n\t\t\t$env = f_getEnv($test_id);\n\t\t\t\n\t\t\techo \"<tr id='q_$rid'>\n\t\t\t\t\t\t\t<td>$env</td>\n\t\t\t\t\t\t\t<td><a title='Cancel' id='$rid' href='test_action.php?action=cancel&rid=$rid' class='btn btn-warning btn-xs test_cancel_btn'><span class='glyphicon glyphicon-remove'></span></a></td>\n\t\t\t\t\t\t\t<td>$rid</td>\n\t\t\t\t\t\t\t<td>$label</td>\n\t\t\t\t\t\t\t<td>$name</td>\n\t\t\t\t\t\t\t<td>$rtime</td>\n\t\t\t\t\t\t\t<td>$user_name</td>\n\t\t\t\t\t\t\t<td>$duration</td>\n\t\t\t\t\t\t</tr>\";\n\t\t}//End of while\n\t}",
"public function get_table($data)\n {\n $row = 0;\n $table = new HTML_Table(array('class' => 'forum', 'cellspacing' => 2));\n $post_counter = 0;\n \n foreach ($data as $post)\n {\n $class = ($post_counter % 2 == 0 ? 'row1' : 'row2');\n $table->setCellContents(\n $row, \n 0, \n '<div style=\"float:right;\"><b>' . Translation::get('Subject') . ':</b> ' . $post->get_title() . '</div>');\n $table->setCellAttributes(\n $row, \n 0, \n array('class' => $class, 'height' => 25, 'style' => 'padding-left: 10px;'));\n \n $row ++;\n \n $info = DatetimeUtilities::format_locale_date(null, $post->get_creation_date());\n \n $message = $this->format_message($post->get_content());\n $message .= '</ul></div>';\n \n $table->setCellContents($row, 0, $message);\n $table->setCellAttributes(\n $row, \n 0, \n array('class' => $class, 'valign' => 'top', 'style' => 'padding: 10px; padding-top: 10px;'));\n \n $row ++;\n \n $bottom_bar = '<div style=\"float: right;\"><a name=\"post_' . $post->get_id() . '\"></a>' .\n Translation::get('Created by') . '<b> ' . $post->get_user()->get_fullname() . '</b> ' .\n Translation::get('On') . ' <b> ' . $info . '</b></div>';\n $table->setCellContents($row, 0, $bottom_bar);\n $table->setCellAttributes($row, 0, array('class' => $class, 'style' => 'padding: 10px;', 'width' => 500));\n \n $row ++;\n \n $table->setCellContents($row, 0, ' ');\n $table->setCellAttributes($row, 0, array('colspan' => '1', 'class' => 'spacer'));\n \n $row ++;\n }\n \n $html = $this->convert_images($table->toHtml());\n return $html;\n }",
"function show_thread_row() {\n\t\t\n\t\t# Indent to current depth\n\t\tfor ( $i = 0; $i < $this->$depth; $i++ ) {\n\t\t\techo \" \";\n\t\t}\n\t\t\n\t\tif ( $this->$has_children ) {\n\t\t\techo \"<a href=\\\"#\\\" id=\\\"collapse\\\">-</a>\\n\";\n\t\t}\n\t\t\n\t\techo \"<strong>$this->$subject</strong> | Author: <strong>$this->$user</strong> | Posted: <strong>$this->$created_on</strong><br />\\n\";\n\t\techo \"$this->$content\\n\";\n\t\t\n\t}",
"function construct_posts() {\n $html = \"\";\n // gets all users posts from db\n $posts = $this->model->get_users_posts();\n\n if (empty($posts)) {\n $html = \"Zatím jste nenapsal žadný příspěvek!\";\n }\n\n $html .= \"\\n<table class='table table-striped'>\\n<tbody>\\n\";\n /*\n * state 0 = just submitted - waiting for reviewer assignments\n * state 1 = waiting for reviews\n * state 2 = waiting for decision\n * state 3 = accepted/denied\n */\n foreach ($posts as $item){\n $html .= \"<tr>\n <td><a href='read_my_post/\".$item['title'].\"'>\".$item['title'].\"</a></td>\";\n\n switch ($item['state']) {\n case 0: $html .= \"<td>Čekám na přiřazení recenzentů</td>\"; break;\n case 1: $html .= \"<td>Čekám na recenze</td>\"; break;\n case 2: $html .= \"<td>Čekám na adminovo rozhodnutí</td>\"; break;\n case 3: if ($item['published'] == 1) {\n $html .= \"<td>Publikován</td>\";\n break;\n } else {\n $html .= \"<td>Zamítnut</td>\";\n break;\n }\n }\n $html .= \"</tr>\\n\";\n }\n $html .= \"</tbody>\\n</table>\\n\";\n\n return $html;\n }",
"private function createThreadsTable()\n {\n DB::schema()->create(\n 'threads',\n function ($table) {\n $table->increments('id');\n $table->string('subject');\n $table->timestamps();\n $table->softDeletes();\n }\n );\n }",
"function displayThreads()\n{\n\t$result = mysql_query(\"SELECT * FROM threads WHERE boardid='\" . $_GET['id'] . \"' ORDER BY sticky DESC, latestpost DESC\") or die(mysql_error()); \n\techo '<table><tr><th>Thread</th><th>Posted by</th><th>Posts</th><th>Latest</th></tr>';\n\twhile($thread = mysql_fetch_array( $result ))\n\t{\n\t\techo '<tr><td>';\n\t\t$threadname = stripslashes($thread['name']);\n\t\tif ($thread['sticky']==1) {echo '<img src=\"/img/sticky.gif\" alt=\"[stickied] \"> ';}\n\t\techo \"<a href=\\\"/thread.php?id=\" . $thread['id'] . \"\\\">\" . $threadname . \"</a>\";\n\t\tif ($thread['lock']==1) {echo ' <img src=\"/img/lock.gif\" alt=\" [locked]>\">';}\n\t\techo '</td><td>';\n\t\t$result2 = mysql_query(\"SELECT `user` FROM users WHERE id='\" . $thread['poster'] . \"'\") or die(mysql_error());\n\t\t$poster = mysql_fetch_array($result2);\n\t\techo '<a href=\"/profile.php?id=' . $thread['poster'] . '\">' . $poster['user'] . '</a>';\n\t\techo '</td><td>';\n\t\techo $thread['posts'];\n\t\techo '</td><td>';\n\t\techo $thread['latestpost'];\n\t\techo '</td></tr>';\n\t}\n\techo '</table><br>';\n}",
"function bim_setup_posts_table( $cm, $bim, $userid, $questions )\n{\n global $CFG;\n $baseurl = $CFG->wwwroot.'/mod/bim/view.php?id='.$cm->id .\n '&screen=ShowPostDetails';\n\n $table = new flexible_table( \"BimShowPostDetails-\".$cm->id.\n '-'.$bim.'-'.$userid );\n $table->course = $cm->course;\n \n $num_questions = count( $questions );\n\n $columns = array( \"username\", \"name\", \"questions\",\n \"marked\" ) ;\n $headers = array( get_string('bim_table_username','bim'),\n get_string('bim_table_name_blog', 'bim' ),\n get_string('bim_table_questions', 'bim' ),\n get_string('bim_table_marked', 'bim' ) );\n\n $no_sorting = array( 'questions', 'marked', 'username', 'name' );\n // add columns/headers for each question\n \n if ( ! empty( $questions ) )\n {\n foreach ( $questions as $id => $question )\n {\n $columns[] = $id;\n $headers[] = $question->title;\n $no_sorting[] = $question->title;\n }\n }\n\n $table->define_columns( $columns );\n $table->define_headers( $headers );\n\n $table->define_baseurl( $baseurl );\n\n $table->sortable( true, 'name', 'ASC' );\n $table->sortable( true, 'username', 'ASC' );\n foreach ( $no_sorting as $field )\n {\n $table->no_sorting( $field );\n }\n\n $table->set_attribute('cellpadding','5');\n $table->set_attribute('class', 'generaltable generalbox reporttable');\n $table->set_control_variables(array(\n TABLE_VAR_SORT => 'ssortShowPosts',\n TABLE_VAR_HIDE => 'shideShowPosts',\n TABLE_VAR_SHOW => 'sshowShowPosts',\n TABLE_VAR_IFIRST => 'sifirstShowPosts',\n TABLE_VAR_ILAST => 'silastShowPosts',\n TABLE_VAR_PAGE => 'spageShowPosts'\n ));\n $table->setup();\n return $table;\n}",
"function showthread ($cat) {\n\t\tglobal $tr_color;\n\n\t\twhile($GLOBALS['egw']->db->next_record()) {\n\t\t\t$tr_color = $GLOBALS['egw']->nextmatchs->alternate_row_color($tr_color);\n\n\t\t\tif($GLOBALS['egw']->db->f(\"id\") == $current) $tr_color = $GLOBALS['egw_info'][\"theme\"][\"bg05\"];\n\t\t\techo \"<tr bgcolor=\\\"$tr_color\\\">\";\n\n\t\t\t$move = \"\";\n\t\t\tfor($tmp = 1;$tmp <= $GLOBALS['egw']->db->f(\"depth\"); $tmp++)\n\t\t\t\t\t$move .= \" \";\n\n\t\t\t$pos = $GLOBALS['egw']->db->f(\"pos\");\n\t\t\t$cat = $GLOBALS['egw']->db->f(\"cat_id\");\n\t\t\t$for = $GLOBALS['egw']->db->f(\"for_id\");\n\t\t\t$subject = $GLOBALS['egw']->db->f(\"subject\");\n\t\t\tif (! $subject) {\n\t\t\t\t $subject = \"[ No subject ]\";\n\t\t\t}\n\t\t\techo \"<td>\" . $move . \"<a href=\" . $GLOBALS['egw']->link(\"read.php\",\"cat=$cat&for=$for&pos=$pos&col=1&msg=\" . $GLOBALS['egw']->db->f(\"id\")) .\">\"\n\t\t\t\t . $subject . \"</a></td>\\n\";\n\n\t\t\techo \"<td align=left valign=top>\" . ($GLOBALS['egw']->db->f('thread_owner')?$GLOBALS['egw']->accounts->id2name($GLOBALS['egw']->db->f('thread_owner')):lang('Unknown')) .\"</td>\\n\";\n\t\t\techo \"<td align=left valign=top>\" . $GLOBALS['egw']->common->show_date($GLOBALS['egw']->db->from_timestamp($GLOBALS['egw']->db->f('postdate'))) .\"</td>\\n\";\n\n\t\t\tif($debug) echo \"<td>\" . $GLOBALS['egw']->db->f(\"id\").\" \" . $GLOBALS['egw']->db->f(\"parent\") .\" \"\n\t\t\t\t\t\t\t\t\t\t. $GLOBALS['egw']->db->f(\"depth\") .\" \" . $GLOBALS['egw']->db->f(\"pos\") .\"</td>\";\n\n\t\t}\n}",
"function Show_SForum() {\n $sql = 'SELECT * FROM SForum WHERE id=wid ORDER BY for_dataw DESC';\n #print $sql.\"<br>\\n\";\n $sql = mysql_query($sql) or die (mysql_error());\n $iledokumentow = mysql_affected_rows();\n if ($iledokumentow > 0) {\n print(\"<TABLE BORDER=\\\"1\\\" WIDTH=\\\"90%\\\">\\n\");\n while ($row = mysql_fetch_array($sql)) {\n \t$sql1 = \"SELECT COUNT(wid)-1 AS num FROM SForum WHERE wid=\".$row['id'].\" GROUP BY wid\";\n #print $sql1.\"<br>\\n\";\n $sql1 = mysql_query($sql1) or die (mysql_error());\n $row1 = mysql_fetch_array($sql1);\n //number of reactions\n $this->react=$row1['num'];\n if ($row['for_name'] == \"\") {\n $row['for_name'] = \"Guest\";\n }\n $this->ptitle = stripslashes($row['for_ptitle']);\n print(\"<tr><TD><A HREF=\\\"\".$_SERVER['PHP_SELF'].\"?wid=\".$row['id'].\"\\\">\".$this->ptitle.\"</A></TD><TD ALIGN=\\\"center\\\">reactions: \".$this->react.\"</TD><TD ALIGN=\\\"center\\\" WIDTH=\\\"20%\\\">\".$row['for_name'].\"</TD><TD ALIGN=\\\"center\\\" WIDTH=\\\"20%\\\">\".$row['for_dataw'].\"</TD></tr>\\n\\n\");\n }\n unset($this->react);\n print(\"</TABLE>\\n\");\n } else {\n print(\"No threads<br>\\n\");\n }\n $this->ptitle = \"\"; //the new thread's title is empty\n }",
"public function genBoards(){\n\t\t// Does not do much other than show these 50.\n\t\t\n\t\t// Board page 'constants'\n\t\t$col_span = 4;\n\t\t$board_name = \"Boards\";\n\t\t$this->genPageTop($board_name);\n\t\t\n\t\t// Create the table header\n\t\techo \"<table><tr><th>Topic Name</th><th class='name'>Created By</th><th class='msgno'>Msgs</th><th class='date'>Last Post</th></tr>\";\n\t\t\n\t\t// Create the table rows for each result\n\t\twhile($row = mysqli_fetch_array($this->result)){\n\t\t\t// Bold pinned topics\n\t\t\t$topic_name = (($row[DBV::$topic_pinned]) == 1) ? '<b>'.$row[DBV::$topic_name].'</b>' : $row[DBV::$topic_name];\n\t\t\t\n\t\t\techo \"<tr><td><a href='showmessages.php?topic=\". $row[DBV::$topic_id] .\"'>\". $topic_name .\"</a></td><td><a href='profile.php?user=\".$row[DBV::$user_id].\"'>\". $row[DBV::$user_name] .\n\t\t\t\"</a></td><td>\". $row[DBV::$topic_msgno] .\"</td><td>\". date(DBV::$date, strtotime($row[DBV::$topic_lastpost])) .\"</td></tr>\";\n\t\t}\n\t\t\n\t\t// Next page, Users browsing and end the table \n\t\t\n\t\t// TODO : Adjust so that it includes people not in topics\n\t\t\n\t\t$this->nextPage($col_span, DBV::$topics);\n\t\t\n\t\t// TODO : Make some kind of 'users reading this page' system\n\t\t\n\t\t$sql =\"\tSELECT \t\".DBV::$user_ctopic.\"\n\t\t\t\tFROM \t\".DBV::$users.\"\n\t\t\t\tWHERE \t\".DBV::$user_ctopic.\" <> NULL\";\n\t\t$count = mysqli_num_rows(mysqli_query($this->con, $sql)) + 1;\n\t\techo \"<tr><th class='menu' colspan='\". $col_span .\"'><a>\".$count.\" users currently reading this board</a></th></tr>\";\n\t\t\n\t\t// This closes out all remaining tags, may be used for supplying additional information later on\n\t\t$this->genPageBottom();\n\t\t\n\t}",
"private function fetchThreads() {\n\t\t\t$query = '';\n\t\t\t$boards = listBoards(true);\n\n\t\t\tforeach ($boards as $b) {\n\t\t\t\tif (in_array($b, $this->settings['exclude']))\n\t\t\t\t\tcontinue;\n\t\t\t\t// Threads are those posts that have no parent thread\n\t\t\t\t$query .= \"SELECT *, '$b' AS `board` FROM ``posts_$b`` \" .\n\t\t\t\t\t\"WHERE `thread` IS NULL UNION ALL \";\n\t\t\t}\n\n\t\t\t$query = preg_replace('/UNION ALL $/', 'ORDER BY `bump` DESC', $query);\n\t\t\t$result = query($query) or error(db_error());\n\n\t\t\treturn $result->fetchAll(PDO::FETCH_ASSOC);\n\t\t}",
"function show_posts($dbc, $thread_id, $page_num) {\n \n // Define the number of posts per page as a constant\n define(\"POSTS_PER_PAGE\", 15);\n\n\n // Convert to the users timezone\n if (isset($_COOKIE['user_tz'])) {\n $correct_joined = \"CONVERT_TZ(users.joined, '-06:00', '\" . $_COOKIE['user_tz'] . \"')\";\n $correct_posted = \"CONVERT_TZ(posted_on, '-06:00', '\" . $_COOKIE['user_tz'] . \"')\";\n } else {\n $correct_joined = 'users.joined';\n $correct_posted = 'posted_on';\n }\n\n\n // Get all info for posts for the thread\n $q = \"SELECT users.username, users.user_id, users.thumb_url, DATE_FORMAT($correct_joined, '%M %D, %Y %l:%i %p') as joined, users.location, \n message, DATE_FORMAT($correct_posted, '%M %D, %Y %l:%i %p') as date, posts.post_id, threads.subject, posts.edited\n FROM posts \n INNER JOIN threads ON posts.thread_id=$thread_id AND threads.thread_id=$thread_id \n INNER JOIN users ON users.user_id=posts.user_id\n ORDER BY posted_on\";\n\n\n // Execute the query\n $s = $dbc->query($q);\n\n // Fetch the first row from the array\n $result = $s->fetch_array(MYSQLI_ASSOC);\n \n\n // Get the thread title and thread author\n $thread_title = $result['subject'];\n $thread_author = $result['username'];\n \n // Get the total number of pages required (15 posts per page)\n $pages = floor(count_thread_posts($dbc, $thread_id) / POSTS_PER_PAGE) + 1;\n\n\n // html for the header information\n echo '<td valign=\"middle\"> \n <h1 style=\"padding: 0; margin: 0; margin-bottom: 3px; font-size: 26px\">' . $thread_title . '</h1>\n <span style=\"font-size: 12px\">by ' . $thread_author . '</span>\n </td>\n </tr>\n </tbody>\n </table>\n ' . page_emblem($page_num, $pages, 'showthread.php?t=' . $thread_id) . '\n </div>';\n\n \n // The number of the post in the thread\n $number = POSTS_PER_PAGE * ($page_num - 1);\n\n // Number that must iterate until 15 * ($page_num - 1) + 1 post is reached\n $post = 0;\n\n // Print all of the posts for the thread\n do {\n\n // Loop until the first post for the page is reached\n if ($post >= POSTS_PER_PAGE * ($page_num - 1)) {\n \n // Set variables for post\n $body = $result['message'];\n $user = $result['username'];\n $user_id = $result['user_id']; \n $avatar = $result['thumb_url'];\n $joined = $result['joined'];\n $location = $result['location'];\n $date = $result['date'];\n $post_id = $result['post_id'];\n $number += 1;\n \n // Count the number of posts for each user\n $posts = count_posts($dbc, $user_id);\n\n // html for the new thread reply\n echo '<div id=\"thread\">\n \n <div id=\"thread_header\" style=\"width: 930px\">\n <table cellpadding=\"0\" cellspacing=\"0\" width=\"98%\">\n <tr>\n <td><span id=\"user_name\"><a href=\"member.php?u=' . $user_id . '\">' . $user . '</a></span></td>\n <td align=\"right\" valign=\"middle\" style=\"color: #fff\" width=\"290px\">';\n\n // Check if the post has been edited\n if ($result['edited'] == 1) {\n echo '[Edited] ';\n }\n\n echo $date . ' #<strong>' . $number . '\n </strong></td>\n </tr>\n </table>\n </div>\n\n <div id=\"thread_body\">\n <table cellpadding=\"10\" cellspacing=\"0\" border=\"0\" width=\"100%\" align=\"center\">\n <tbody>\n\n <tr valign=\"top\">\n <td width=\"21%\" style=\"height: 100%; border-right: 1px solid #ccc\">\n <div>\n <a href=\"member.php?u=' . $user_id . '\" id=\"avatar_link\">\n <img src=\"images/avatars/' . $avatar . '\" class=\"avatar\" height=\"90px\"; width=\"90px\" name=\"avatar\"/>\n </a>\n <div id=\"user_emblem\">Posts: ' . $posts . '</div>\n <p style=\"font-size: 10px\"><span style=\"font-weight: bold\">Joined:</span> ' . $joined . '<br/>\n <span style=\"font-weight: bold\">From:</span> ' . $location . '</p>\n </div>\n </td>\n <td colspan=\"2\">\n <div id=\"thread_text\">' . $body . '</div>\n </td>\n </tr>\n\n </tbody>\n </table>';\n\n // Show the edit button if the user is logged in\n if ($_COOKIE['user_id'] == $user_id) {\n\n echo '<a href=\"editpost.php?p=' . $post_id . '&t=' . $thread_id . '&page=' . $page_num . '\">\n <div class=\"nav_button\" style=\"width: 45px; height: 22px; float: right; margin: 0px 0px 0px 0px\">Edit</div>\n </a>';\n } \n\n echo '</div>\n \n <!-- for vertical spacing -->\n <div style=\"margin-bottom: 25px;\"></div>\n \n </div>';\n }\n\n // Increment the post count\n $post += 1;\n\n } while ( ($post < POSTS_PER_PAGE * $page_num) && ($result = $s->fetch_array(MYSQLI_ASSOC)) != NULL );\n}",
"public function getThreadSummary() {\n $threadData = $this->discuss->hooks->load('post/getthread',array(\n 'post' => &$this->post,\n 'controller' => &$this,\n 'thread' => $this->post->get('thread'),\n 'limit' => 5,\n ));\n $this->setPlaceholder('thread_posts',$threadData['results']);\n }",
"public function buildTbody( )\n {\n\n // create the table body\n $body = '<tbody>'.NL;\n\n // simple switch method to create collored rows\n $num = 1;\n foreach( $this->data as $key => $row )\n {\n\n $objid = $row['my_task_rowid'];\n $rowid = $this->id.'_row_'.$objid;\n\n $body .= '<tr class=\"row'.$num.'\" id=\"'.$rowid.'\" >'.NL;\n if( $this->enableMultiSelect )\n {\n $body .= '<td valign=\"top\" style=\"text-align:center;\" >\n <input type=\"checkbox\" name=\"slct[]\" value=\"'.$objid.'\" class=\"wgt-ignore\" />\n </td>'.NL;\n }\n\n $body .= '<td valign=\"top\" >'.Validator::sanitizeHtml($row['my_task_title']).'</td>'.NL;\n $body .= '<td valign=\"top\" style=\"text-align:center;\" >'.( trim( $row['my_task_http_url'] ) == '' ? ' ' : '<a href=\"'.Validator::sanitizeHtml($row['my_task_http_url']).'\">'.Validator::sanitizeHtml($row['my_task_http_url']).'</a>' ).'</td>'.NL;\n $body .= '<td valign=\"top\" class=\"wcm wcm_ui_progress\" >'.(!is_null($row['my_task_progress'])?$row['my_task_progress']:0).'</td>'.NL;\n $body .= '<td valign=\"top\" ><a class=\"wcm wcm_req_ajax\" href=\"maintab.php?c=Wbfsys.TaskType.listing\" >'.Validator::sanitizeHtml($row['wbfsys_task_type_name']).'</a></td>'.NL;\n $body .= '<td valign=\"top\" ><a class=\"wcm wcm_req_ajax\" href=\"maintab.php?c=Wbfsys.TaskStatus.listing\" >'.Validator::sanitizeHtml($row['wbfsys_task_status_name']).'</a></td>'.NL;\n\n\n if( $this->enableNav )\n {\n $navigation = $this->rowMenu\n (\n $objid,\n $row\n );\n $body .= '<td valign=\"top\" style=\"text-align:center;\" class=\"wcm wcm_ui_buttonset\" >'.$navigation.'</td>'.NL;\n }\n\n $body .= '</tr>'.NL;\n\n $num ++;\n if ( $num > $this->numOfColors )\n $num = 1;\n\n } //end foreach\n\n if( $this->dataSize > ($this->start + $this->stepSize) )\n {\n $body .= '<tr><td colspan=\"'.$this->numCols.'\" class=\"wcm wcm_action_appear '.$this->searchForm.' '.$this->id.'\" ><var>'.($this->start + $this->stepSize).'</var>'.$this->image('wgt/bar-loader.gif','loader').' Loading the next '.$this->stepSize.' entries.</td></tr>';\n }\n\n $body .= '</tbody>'.NL;\n //\\ Create the table body\n\n return $body;\n\n }",
"function main(){\n include_once '../config.php';\n include_once '../connect.php';\n include_once '../authenticate.php';\n\n $roomOptions = getOptions($conn,'room', 'Rooms');\n $machineName = getOptions($conn, 'machine_name', 'Machines');\n $statusOptions = getOptions($conn, 'status', 'Status');\n $requestedByOptions = getOptions($conn, 'requested_by', 'Requested By');\n $assignedTechOptions = getOptions($conn, 'assigned_tech', 'Assigned Tech');\n $listOfAdmins = getAdmins($conn);\n $testOutput = \"\";\n if (isset($_POST['fromRow']) && $_POST['fromRow'] != null){\n $fromRow = $_POST['fromRow'];\n }\n else{\n $fromRow = 0;\n }\n $rowStep = 10;\n\n $totalRows = getTotalRows($conn,$isAdmin,$uid);\n $tablePageMessage = \"Showing: \" . $fromRow . \" to \" . ($fromRow + $rowStep) . \" out of: \" . $totalRows;\n\n $tableInfo = getTableheader($isAdmin);\n $sql = getSQLQuery($isAdmin,$fromRow, $rowStep,$uid);\n $testOutput = $testOutput . $sql;\n //fill the table with ALL information.\n $sqlPrepared = $conn->prepare($sql);\n $sqlPrepared->execute(); //should be in a try/catch, but in this scenario it isnt required.\n $height = 1;\n $i = 0; //initialize i. Normally i wouldnt have to do this here, but in the case that the user searches something with no results $i still needs to be initalized to tell <p id=colCount> how many columns there are\n //While there are rows left in the SQL\n while($row = $sqlPrepared->fetch(PDO::FETCH_NUM)) {\n $tableInfo = $tableInfo . \"<tr>\";\n $i = 0;\n for ($j = 0; $j < sizeof($row); $j++){\n $value = $row[$j];\n $ticketid = $row[0];\n if($i == 4){\n $tableInfo = $tableInfo . \"<td class='ticketCommentCell'> <a id=forumLink class='nav-link' href='./messagePage.php?ticket_id=$ticketid'>Click To See Forum </a>\";\n }\n else{\n $tableInfo = $tableInfo . \"<td class='ticketCell'>\";\n }\n //Admin can change the values for Status, Assigned Tech\n if ($isAdmin == true && $i == 10){ \n $tableInfo = $tableInfo . \n \"\n <select class='ticketInput' type='text' name='value\" . $i . \"a\" . $height . \"'>\n <option value='$value'>$value</option>\n $listOfAdmins \n </select>\n </td>\";\n }\n elseif(($isAdmin && $i == 1) || ($isAdmin && $i == 2)){ //machine name and room are now editable by admins.\n $tableInfo = $tableInfo . \"<input type='text' name='value\" . $i . \"a\" . $height . \"' value='$value'></td>\";\n }\n elseif($i == 4){ //comments\n $displayValue = explode(\" \",$value);\n $tableInfo = $tableInfo . $displayValue[0] . \"<br>\" . $displayValue[1];\n $tableInfo = $tableInfo . \"<input type=hidden name='value\" . $i . \"a\" . $height . \"' value='$value'></td>\";\n }\n //Supervisor information.\n elseif (($isAdmin && $i == 9) || (!$isAdmin && $i == 7)){\n $displayValue = explode(\" \",$value);\n //displayValue[0] = supervisor name. (a name, or null)\n //displayValue[1] = supervisor code. (a code or null)\n $tableInfo = $tableInfo . $displayValue[0] . \"<br>\" . $displayValue[1];\n $tableInfo = $tableInfo . \"<input type=hidden name='value\" . $i . \"a\" . $height . \"' value='$value'></td>\";\n }\n //Admin can change the value for closed using a drop box, if closed == null\n elseif ($isAdmin == true && $i == 3){\n if($value == 'Unassigned'){\n $tableInfo = $tableInfo .\n \"<select name='value\" . $i . \"a\" . $height . \"'>\n <option value='Unassigned'>Unassigned</option>\n <option value='In Progress'>In Progress</option>\n <option value='Closed'>Closed</option>\n </select></td>\";\n }\n elseif($value == 'In Progress'){\n $tableInfo = $tableInfo .\n \"<select name='value\" . $i . \"a\" . $height . \"'>\n <option value='In Progress'>In Progress</option>\n <option value='Unassigned'>Unassigned</option>\n <option value='Closed'>Closed</option>\n </select></td>\";\n }\n elseif($value == 'Closed'){\n $tableInfo = $tableInfo .\n \"<select name='value\" . $i . \"a\" . $height . \"'>\n <option value='Closed'>Closed</option>\n <option value='In Progress'>In Progress</option>\n <option value='Unassigned'>Unassigned</option>\n </select></td>\";\n }\n else{ \n $tableInfo = $tableInfo . \n \"<select name='value\" . $i . \"a\" . $height . \"'>\n <option value='$value'>Your Value:$value Please choose one of the below options</option>\n <option value='Unassigned'>Unassigned</option>\n <option value='In Progress'>In Progress</option>\n <option value='Closed'>Closed</option>\n </select></td>\";\n }//end else\n }//end elseif admin, status, 'closed'\n elseif($isAdmin == true && $i == 11){ //invoice link\n $tableInfo = $tableInfo . \"<input type=hidden name='value\" . $i . \"a\" . $height . \"' value='$value'>\n <a id=invoiceLink class=nav-link href='./invoicePage.php?ticket_id=$ticketid'>Invoice</a> </td>\";\n }\n //closed time (for both admin and user)\n elseif($i == 6){ \n if ($row[3] == 'Closed'){ //row[3] = status. (only show closed date value when its closed)\n $tableInfo = $tableInfo . $value;\n }\n $tableInfo = $tableInfo . \"<input type=hidden name='value\" . $i . \"a\" . $height . \"' value='$value'></td>\";\n }\n //Else: The column cannot be edited. It should display a value and have a hidden input of the value aswell so \n // The information can be used in a $_POST for saving changes.\n else{\n $tableInfo = $tableInfo . \"$value \";\n $tableInfo = $tableInfo . \"<input type=hidden name='value\" . $i . \"a\" . $height . \"' value='$value'></td>\";\n }//end isAdmin, editable column\n $i = $i + 1;\n }//end fore loop\n $height = $height + 1;\n $tableInfo = $tableInfo . \"</tr>\";\n }//End While (There is a row to fetch)\n \n $tableInfo = $tableInfo . \"</table>\";\n $tableHeightOutput = $height;\n $colCountOutput = $i;\n\n echo json_encode(\n array(\n \"tableInfo\" => $tableInfo,\n \"roomOptions\" => $roomOptions,\n \"machineOptions\" => $machineName,\n \"statusOptions\" => $statusOptions,\n \"requestedByOptions\" => $requestedByOptions,\n \"assignedTechOptions\" => $assignedTechOptions,\n \"tableHeight\" => $tableHeightOutput,\n \"colCount\" => $colCountOutput,\n \"fromRow\" => $fromRow,\n \"tablePageMessage\" => $tablePageMessage,\n \"totalRows\" => $totalRows,\n \"testOutput\" => $testOutput\n )\n );\n}",
"function processRows() {\n\t\t\n\t\t$this->rows = array();\n\t\tif (!$this->rowsset) {\n\t\t\tif ($this->table) { \n\t\t\t\t$this->getRows();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\twhile(list($k,$v) = @each($this->datarows)) {\n\t\t\t$row = $this->arrayToRow($v);\n\t\t\tif (is_array($this->rowClasses)) {\n\t\t\t\t$row->class = $this->rowClasses[(int)$rowcount];\n\t\t\t\t$rowcount++;\n\t\t\t\tif ($rowcount>=count($this->rowClasses)) {\n\t\t\t\t\t$rowcount=0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->rows[] = $row->toHTML();\n\t\t}\n\t\t$this->data = @implode(\"\",$this->rows);\n\t\t$this->headers();\n\t\t$this->processed = true;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Maps all settings files to a function | public static function settings_map(callable $function)
{
$base_dir = APPLICATION . "Settings";
$settings_files = self::get_php_file_paths($base_dir);
foreach ($settings_files as $file)
{
// $file is the full filesystem path
// strip everything up to /$folder_name, and the .php extension
$rel_path = substr($file, strlen(ROOT), -4);
// convert / to \ so that it's a php namespace
/** @var SettingsInterface $ns_path */
$ns_path = str_replace("/", "\\", $rel_path);
$oReflectionClass = new \ReflectionClass($ns_path);
if (!$oReflectionClass->isAbstract() && $oReflectionClass->isSubclassOf(
'\\SCT\\Interfaces\\SettingsInterface'
)
)
{
$function($ns_path);
}
}
} | [
"function function_map() { \n\n $map = array();\n\n\t\t/* Required Functions */\n $map['add'] = 'add_songs';\n $map['delete'] = 'delete_songs';\n $map['play'] = 'play';\n $map['stop'] = 'stop';\n $map['get'] = 'get_songs';\n\t\t$map['status']\t\t= 'get_status';\n $map['connect'] = 'connect';\n\t\t\n\t\t/* Recommended Functions */\n\t\t$map['skip']\t\t= 'skip';\n\t\t$map['next']\t\t= 'next';\n\t\t$map['prev']\t\t= 'prev';\n\t\t$map['pause']\t\t= 'pause';\n\t\t$map['volume_up'] = 'volume_up';\n\t\t$map['volume_down']\t= 'volume_down';\n\t\t$map['random'] = 'random';\n\t\t$map['repeat']\t\t= 'loop';\n\n\t\t/* Optional Functions */\n\t\t$map['delete_all']\t= 'clear_playlist';\n\t\t$map['add_url']\t\t= 'add_url';\n\n return $map;\n\n\t}",
"function _map($path) {\n\t\t$include = '.*[\\/\\\\].*\\.[a-z0-9]{2,3}$';\n\n\t\t$directories = array('.htaccess', '.DS_Store', 'media', '.git', '.svn', 'simpletest', 'empty');\n\t\t$extensions = array('db', 'htm', 'html', 'txt', 'php', 'ctp');\n\n\t\t$exclude = '.*[/\\\\\\](' . implode('|', $directories) . ').*$';\n\t\t$exclude .= '|.*[/\\\\\\].*\\.(' . implode('|', $extensions) . ')$';\n\n\t\tif (!empty($this->_exclude)) {\n\t\t\t$exclude = '|.*[/\\\\\\](' . implode('|', $this->_exclude) . ').*$';\n\t\t}\n\n\t\t$Folder = new Folder($path);\n\t\t$files = $Folder->findRecursive($include);\n\n\t\tforeach ($files as $file) {\n\t\t\tif (preg_match('#' . $exclude . '#', $file)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$search[] = '/' . preg_quote($Folder->pwd(), '/') . '/';\n\t\t\t$search[] = '/(' . implode('|', Media::short()) . ')' . preg_quote(DS, '/') . '/';\n\t\t\t$fragment = preg_replace($search, null, $file);\n\n\t\t\t$mapped = array(\n\t\t\t\t$file => MEDIA_STATIC . Media::short($file) . DS . $fragment\n\t\t\t);\n\n\t\t\twhile (in_array(current($mapped), $this->_map) && $mapped) {\n\t\t\t\t$mapped = $this->_handleCollision($mapped);\n\t\t\t}\n\t\t\twhile (file_exists(current($mapped)) && $mapped) {\n\t\t\t\t$this->out($this->shortPath(current($mapped)) . ' already exists.');\n\t\t\t\t$answer = $this->in('Would you like to [r]ename or [s]kip?', 'r,s', 's');\n\n\t\t\t\tif ($answer == 's') {\n\t\t\t\t\t$mapped = array();\n\t\t\t\t} else {\n\t\t\t\t\t$mapped = array(key($mapped) => $this->_rename(current($mapped)));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($mapped) {\n\t\t\t\t$this->_map[key($mapped)] = current($mapped);\n\t\t\t}\n\t\t}\n\t}",
"function loadFunctionFiles(){\n\t\tif( is_dir(FUNCTIONS_PATH) && ($dir=dir(FUNCTIONS_PATH)) ){\n\t\t\twhile( $name=$dir->read() ){\n\t\t\t\tif( $name == '.' || $name == '..' ) continue;\n\t\t\t\tif( is_dir($file=FUNCTIONS_PATH.$name) ) continue;\n\t\t\t\trequire_once( $functions[]=$file );\n\t\t\t}\n\t\t\t$dir->close();\n\t\t}\n\t\telse trigger_error('Error al iniciar aplicación.', E_USER_ERROR);\n\n\t}",
"protected static function loadAllFunctions() {\n $themePath = self::getThemePath();\n $fullPath = $themePath . 'source/_twig-components/functions/';\n if (is_dir($fullPath)) {\n static::load($fullPath . 'add_attributes.function.drupal.php', self::$functions);\n }\n }",
"private function loadMappings(): void {\n\t\tif (!empty($this->mimetypes)) {\n\t\t\treturn;\n\t\t}\n\n\t\t$mimetypeMapping = json_decode(file_get_contents($this->defaultConfigDir . '/mimetypemapping.dist.json'), true);\n\t\t$mimetypeMapping = $this->loadCustomDefinitions(self::CUSTOM_MIMETYPEMAPPING, $mimetypeMapping);\n\n\t\t$this->registerTypeArray($mimetypeMapping);\n\t}",
"public static function loadAll()\n\t{\n\n\t\tforeach (self::$config_files as $key => $file_name) {\n\t\t\t\n\t\t\tself::loadFile($file_name);\n\t\t}\n\n\t}",
"protected static function generateParamMap() {\n $map_files = [\n 'actions' => config('common.param_map_file'),\n 'triggers' => config('common.trigger_param_file'),\n ];\n foreach ($map_files as $folder => $map_file) {\n $map = [];\n foreach (static::getPHPFiles(getenv('APP_DIR') . '/' . $folder) as $file) {\n $content = file_get_contents($file);\n if (preg_match_all('/^\\s*\\*\\s*\\@param\\s+([a-z]+)\\s+(.+?)$/ium', $content, $m)) {\n foreach ($m[0] as $k => $matches) {\n $map[$file][] = [\n 'name' => $param = substr(strtok($m[2][$k], ' '), 1),\n 'type' => $m[1][$k],\n 'default' => trim(substr($m[2][$k], strlen($param) + 1)) ?: null,\n ];\n }\n }\n }\n App::writeJSON($map_file, $map);\n }\n }",
"function initSettingDefines()\n{\n foreach (getSettings() as $key => $value) {\n define($key, $value);\n }\n}",
"private function createModuleMap() {\n\t\tCore::spider(['modules', 'nodes'], function($filePath, $file, $dir) {\n\t\t\t\n\t\t\t// we only want .js and .scss files\n\t\t\tif (substr($file, -3) === '.js') {\n\t\t\t\t$this->mapJsFile($filePath, $file, $dir);\n\t\t\t} else if (substr($file, -5) === '.scss') {\n\t\t\t\t$this->trackSassFile($filePath, $file, $dir);\n\t\t\t}\n\t\t});\n\t}",
"public static function loadFunctionMap(): FunctionMap\n {\n return FunctionMap::loadFunctionMap();\n }",
"abstract protected function _settingsKeys();",
"protected function loadConfigurations()\n {\n\n $files = feather_dir_files(static::$configPath);\n\n foreach ($files as $file) {\n\n if (is_file(static::$configPath . \"/$file\") && stripos($file, '.php') === strlen($file) - 4) {\n $filename = substr($file, 0, strripos($file, '.php'));\n static::$config[strtolower($filename)] = include static::$configPath . '/' . $file;\n }\n }\n }",
"function php_ini_scanned_files () {}",
"function settings_callback() {}",
"function load_root_functions_files() {\n\t\trequire_once( WPTOUCH_DIR . '/core/menu.php' );\n\t\t$clear_settings = false;\n\n\t\t// Load the parent root-functions if it exists\n\t\tif ( $this->has_parent_theme() ) {\n\t\t\t$parent_info = $this->get_parent_theme_info();\n\t\t\tif ( file_exists( WP_CONTENT_DIR . $parent_info->location . '/root-functions.php' ) ) {\n\t\t\t\trequire_once( WP_CONTENT_DIR . $parent_info->location . '/root-functions.php' );\n\t\t\t}\n\n\t\t\t// next time get_settings is called, the current theme defaults will be added in\n\t\t\t$clear_settings = true;\n\t\t}\n\n\t\t// Load the current theme functions.php, or the child root functions if it exists in WPtouch themes\n\t\tif ( file_exists( $this->get_current_theme_directory() . '/root-functions.php' ) ) {\n\t\t\trequire_once( $this->get_current_theme_directory() . '/root-functions.php' );\n\n\t\t\t// next time get_settings is called, the current theme defaults will be added in\n\t\t\t$clear_settings = true;\n\t\t}\n\n\t\t// Load a custom functions.php file\n\t\tif ( file_exists( WPTOUCH_BASE_CONTENT_DIR . '/functions.php' ) ) {\n\t\t\trequire_once( WPTOUCH_BASE_CONTENT_DIR . '/functions.php' );\n\t\t}\n\n\t\tdo_action( 'wptouch_functions_loaded' );\n\n\t\tif ( $clear_settings ) {\n\t\t\t// each theme can add it's own default settings, so we need to reset our internal settings object\n\t\t\t// so that the defaults will get merged in from the current theme\n\t\t\t$this->reload_settings();\n\t\t}\n\t}",
"abstract public function getConfigFiles(array $config);",
"function LoadAllFiles($dirname){}",
"private static function loadConfigFiles(): void\n {\n foreach (glob('../config/*.php') as $filename) {\n $name = pathinfo($filename)['filename'];\n self::$config[$name] = require $filename;\n }\n }",
"public function register_job_factory_files(){\n $file_paths = [];\n $file_paths = apply_filters( 'wbj_job_factory_files', $file_paths );\n foreach( $file_paths as $file_path ){\n require_once $file_path;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a field to generate a join for when parsing the joins | private function addFieldJoin(RelationField $field) {
if ($field->isLocalized()) {
$this->localize = true;
}
$this->fieldJoins[$field->getName()] = $field;
} | [
"public function add_filter_join($field, $join_type = 'or')\n\t{\n\t\tif (!empty($this->filter_join) AND is_string($this->filter_join))\n\t\t{\n\t\t\t$this->filter_join = array($this->filter_join);\n\t\t}\n\t\t$this->filter_join[$field] = $join_type;\n\t}",
"public function joinFields()\n {\n\t\t$this->getSelect()\n\t\t ->join(\n array('mad' => $this->getTable('magebid/auction_detail')), \n 'mad.magebid_auction_detail_id = main_table.magebid_auction_detail_id')\t\n\t\t ->join(\n array('mat' => $this->getTable('magebid/auction_type')), \n 'mat.magebid_auction_type_id = main_table.magebid_auction_type_id');\t\t\t\t\t\n\t\t//echo $this->getSelect()->__toString();\n }",
"function summary_join() {\n $field = $this->handler->table . '.' . $this->handler->field;\n $join = $this->get_join();\n\n // shortcuts\n $options = $this->handler->options;\n $view = &$this->handler->view;\n $query = &$this->handler->query;\n\n if (!empty($options['require_value'])) {\n $join->type = 'INNER';\n }\n\n if (empty($options['add_table']) || empty($view->many_to_one_tables[$field])) {\n return $query->ensure_table($this->handler->table, $this->handler->relationship, $join);\n }\n else {\n if (!empty($view->many_to_one_tables[$field])) {\n foreach ($view->many_to_one_tables[$field] as $value) {\n $join->extra = array(\n array(\n 'field' => $this->handler->real_field,\n 'operator' => '!=',\n 'value' => $value,\n 'numeric' => !empty($this->definition['numeric']),\n ),\n );\n }\n }\n return $this->add_table($join);\n }\n }",
"protected function _build_join() {\n if (count($this->_join_sources) === 0) {\n return '';\n }\n $retour = \" \";\n foreach( $this->_join_sources as $_join_source ){\n $retour .= \"\".trim($_join_source[\"what\"]).\"\";\n $retour .= \" ON ( \" . trim( substr(join(\" \", $_join_source[\"on\"] ),0,-4) ).\" ) \";\n }\n\n return $retour;\n }",
"private function join_associations_table( $join ) {\n\t\t$association_table = $this->get_table_names()->association_table();\n\t\t$posts_table_name = $this->wpdb->posts;\n\t\t$target_element_column = $this->target_role->get_name() . '_id';\n\t\t$for_element_column = $this->target_role->other() . '_id';\n\n\t\t$join .= $this->wpdb->prepare(\n\t\t\t\" LEFT JOIN {$association_table} AS toolset_associations ON ( \n\t\t\t\ttoolset_associations.relationship_id = %d\n\t\t\t\tAND toolset_associations.{$target_element_column} = {$posts_table_name}.ID\n\t\t\t\tAND toolset_associations.{$for_element_column} = %d\n\t\t\t) \",\n\t\t\t$this->relationship->get_row_id(),\n\t\t\t$this->for_element->get_default_language_id()\n\t\t);\n\n\t\treturn $join;\n\t}",
"private function _register_join_fields()\n {\n \tif( sizeof($this->join_fields) > 0 )\n \t{\n \t\tforeach($this->join_fields as $field)\n \t\t{\n \t\t\tif( ! in_array($field,$this->fields) )\n \t\t\t\tarray_push($this->fields,$field);\n \t\t}\n \t}\n }",
"public function getJoinType(): string;",
"private function getJoinClause() : string\n {\n $sql = '';\n foreach ($this->join as $j) {\n $sql .= sprintf(' %s %s %s', $j['type'], $j['table'], $j['alias']);\n if ($j['keyCol'] && $j['refCol']) {\n $sql .= sprintf(' ON %s=%s.%s', $j['keyCol'], $j['alias'], $j['refCol']);\n }\n }\n\n return $sql;\n }",
"public function getJoin()\n\t{\n\t\treturn isset($this->_query['join']) ? $this->_query['join'] : '';\n\t}",
"private static function sqlJoining() : string {\n $relations = self::getsRelationsHasOne();\n\n $baseTable = static::tableName();\n $baseProperties = self::getProperties();\n foreach ($baseProperties as &$property) {\n $property = $baseTable . '.' . $property;\n }\n $colsFromBaseTabel = implode(', ', $baseProperties);\n $colsFromJoinedTables = '';\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $modelProperties = $modelNamespace::getProperties();\n foreach ($modelProperties as $key => &$value) {\n $value = $modelTableName . '.' . $value . ' AS ' . $modelTableName . '_' . $value;\n }\n $colsFromJoinedTables .= ', ' . implode(', ', $modelProperties);\n\n }\n $sql = 'SELECT ' . $colsFromBaseTabel . ' ' . $colsFromJoinedTables . ' FROM ' . $baseTable;\n\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $sql .= ' INNER JOIN ' . $modelTableName . ' ON ' . $baseTable . '.' . $relation['column'] . ' = ' . $modelTableName . '.' . $relation['joined-table-column'];\n }\n\n return $sql . ' WHERE ' . $baseTable . '.';\n }",
"public function getJoinOn() {\n \t$joinOnString = \"\";\n \tforeach ($this->joinOnParts as $i => $joinOn) {\n \t\t$joinOnString = $joinOnString . \" \" . $joinOn;\n \t}\n \treturn $joinOnString;\n }",
"protected function _joinFields()\n {\n $reviewTable = $this->_resource->getTableName('review');\n $reviewDetailTable = $this->_resource->getTableName('review_detail');\n\n $this->addAttributeToSelect('name')->addAttributeToSelect('sku');\n\n $this->getSelect()->join(\n ['rt' => $reviewTable],\n 'rt.entity_pk_value = e.entity_id',\n ['rt.review_id', 'review_created_at' => 'rt.created_at', 'rt.entity_pk_value', 'rt.status_id', 'rt.vendor_id']\n )->join(\n ['rdt' => $reviewDetailTable],\n 'rdt.review_id = rt.review_id',\n ['rdt.title', 'rdt.nickname', 'rdt.detail', 'rdt.customer_id', 'rdt.store_id']\n );\n return $this;\n }",
"function _buildCustomPropertiesJoinByTable($id_field, $ref_table = 'content', $alias = 'jcp') {\n $join = ' INNER JOIN #__custom_properties ' . $alias . ' ON ' . $id_field . ' = ' . $alias . '.content_id' .\n ' AND ' . $alias . '.ref_table = \\'' . $ref_table . '\\' ';\n\n $helper = new comZonalesHelper();\n $zonal = $helper->getZonal();\n if ($zonal) {\n $join .= ' AND ' . $alias . '.field_id = ' . $zonal->id;\n }\n\n return $join;\n }",
"protected function join_field(WaxModel $model)\n {\n return $model->table . \"_\" . $model->primary_key;\n }",
"public function testBuildSelectWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->fields()\n ->addField('user@email', 'email')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->fields()\n ->addField('user@email', 'email')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n \"'user@email' AS table1__email, 'user@email' AS table2__email\",\n $query->buildSelectFields()\n );\n }",
"function slt_se_join_sql( $join, $query ) {\n\n\tif ( slt_se_apply_hook( $query, 'join' ) ) {\n\t\tglobal $wpdb;\n\t\t$join .= \", $wpdb->postmeta \";\n\t}\n\n\treturn $join;\n}",
"private function buildJoin()\n {\n if (empty($this->join)) {\n return;\n }\n\n foreach ($this->join as $data) {\n list ($joinType, $joinTable, $joinCondition) = $data;\n\n if (is_object($joinTable)) {\n $joinStr = $this->buildPair(\"\", $joinTable);\n } else {\n $joinStr = $joinTable;\n }\n\n $this->query .= \" \".$joinType.\" JOIN \".$joinStr.\n (false !== stripos($joinCondition, 'using') ? \" \" : \" ON \")\n .$joinCondition;\n }\n }",
"private function getJoinString()\n {\n // If there are not joins, return empty\n if (!count($this->orderBy)) {\n return '';\n }\n\n // Create join strings\n $joins = array_map(function ($join) {\n return $join['type'] . ' JOIN ' . $join['table'] . ' ON ' . $this->table . '.' . $join['first'] . $join['operator'] . $join['table'] . '.' . $join['second'];\n }, $this->joins);\n\n // Return complete join string\n return implode(' ', $joins);\n }",
"public function setJoinField(string $joinField): self\n {\n $this->joinField = $joinField;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the resource title. | public function set_resource_title( $title ) {
$this->resource_title = esc_html( $title );
} | [
"protected function set_title()\n {\n }",
"public function setTitle($title)\r\n {\r\n $this->_title = $title;\r\n }",
"public function setTitle($title) {\n $this->title = $title;\n }",
"function set_title ($title) {\r\n\t\r\n\t\t$this->title = $title;\r\n\t}",
"public function set_title($title);",
"function setTitle($newTitle) {\n $this->title = $newTitle;\n }",
"public function title($title) {\n $this->title = $title;\n $this->forcetitle = true;\n }",
"public function setTitle($title) {\n\t\t$this->title = $title;\n\t\t$this->changeTitle();\n\t}",
"protected function setTitle()\n {\n $settings = HtmlPageSettings::singleton();\n $settings->pageTitle = $this->model->restModel->isNewRecord()\n ? 'New ' . $this->getModelDisplayName()\n : $this->model->restModel->getLabel();\n }",
"public function setTitle( $title )\n\t{\n\t\t$this->setAttribute( \"title\", $title );\n\t}",
"public function title($title) {\n\t\t$this->Controller->set('title_for_layout', $title);\n\t}",
"public function setTitle($title)\n {\n $this->title = ModelValidation::getValidTitle($title);\n }",
"public function setTitle($title) {\n $this->setOption('title', $title);\n }",
"function setTitle($title) {\n\t\t$this->description->_title = $title;\n\t}",
"public function setTitle(string $title) \t\t{$this->title = $title;$this->setSlug(create_slug($title));}",
"public static function setTitle($title){\n self::$renderContent[\"title\"] = $title;\n }",
"public function setTitle($title)\r\n {\r\n $this->_pageTitle = $title;\r\n }",
"public function set_Title($Title)\n\t{\n\t\t\t$this->Title = $Title;\n\t}",
"function _set_title($title=NULL) {\n $this->output->prepend_title($title);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get argument by name | public function getByName($name)
{
return array_key_exists($name, $this->argumentList)?$this->argumentList[$name]:null;
} | [
"public function getArg($name);",
"public function getArg(string $name): mixed;",
"protected function argument($name)\n {\n return $this->input->getArgument($name);\n }",
"public function getArgumentValue(string $name);",
"public function getArgument(string $name)\n {\n return $this->getInput()->getArgument($name);\n }",
"public function getNamedStringArgument($name);",
"public static function getArg($name)\n {\n if (isset(static::$_args[$name])) {\n return static::$_args[$name];\n }\n return false;\n }",
"public function getArg($name)\n {\n if (isset($this->_args[$name])) {\n return $this->_args[$name];\n }\n return false;\n }",
"public function getArg($name)\n {\n if (isset($this->_args[ $name ])) {\n return $this->_args[ $name ];\n }\n\n return false;\n }",
"public function getArgument(string $key);",
"public function getNamedExpressionArgument($name);",
"public function getParam(string $name);",
"public function get_argument( $name, $default = NULL )\n {\n $argument = NULL;\n $widget_name = $this->get_full_name();\n\n if( !array_key_exists( $widget_name, $this->arguments ) ||\n !array_key_exists( $name, $this->arguments[$widget_name] ) )\n { // the argument is missing\n if( 1 == func_num_args() )\n { // if only one argument was passed to this method then the argument is required\n throw lib::create( 'exception\\argument', $name, NULL, __METHOD__ );\n }\n\n // if the argument was not required, then use the default instead\n $argument = $default;\n }\n else\n { // the argument exists\n $argument = $this->arguments[$widget_name][$name];\n }\n\n return $argument;\n }",
"abstract protected function getArgumentName();",
"public function getArgument($key);",
"public function getNamedTypeArgument($name);",
"public function getArgument($name, $default = null)\n {\n if (isset($this->arguments[$name]) && $this->arguments[$name] !== null) {\n return $this->arguments[$name];\n } else {\n return $default;\n }\n }",
"public function getArgument($path);",
"public function argument($key)\n {\n return $this->input->getArgument($key);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dump XML schema info for $tables | function dumpSchema($tables = array())
{
$defs = $this->getTableDefinitions($tables);
if (is_a($defs, 'PEAR_Error')) {
return $defs;
}
// Make the database name a variable
$defs['name'] = '<variable>name</variable>';
$args = array(
'output_mode' => 'function',
'output' => array(&$this, '_collectXml'),
);
$this->_xml = '';
$this->_reader->dumpDatabase($defs, $args, MDB2_SCHEMA_DUMP_STRUCTURE);
$xml = $this->_xml;
$this->_xml = '';
return $xml;
} | [
"public function printSchema() {\n $table_info = $this->getTableInfo();\n foreach ($table_info as $table_name => $table_obj) {\n $table_obj->printSchema();\n print \"\\n\";\n }\n }",
"public function printSchema() {\r\n\t\t \r\n\t\t echo $this->_template_schema->saveXML();\r\n\t }",
"private function handleSchemaOnlyTables(): string\n {\n $dbDumper = $this->createDatabaseDumper();\n\n $outputFilename = $this->getOutputFilename($this->databaseName . '-schema-only.sql.gz');\n\n $dbDumper\n ->includeTables($this->schemaOnlyTables)\n ->addExtraOption($this->databaseType->schemaOnlyOption())\n ->dumpToFile($outputFilename);\n\n return $outputFilename;\n }",
"public function dump()\n {\n $pdo = $this->pdo();\n\n $sql = '';\n\n foreach ($this->list_tables() as $table) {\n $query = $pdo->query(\"SELECT * FROM `{$table}`\");\n\n while ($row = $query->fetch(\\PDO::FETCH_NUM)) {\n $values = array();\n\n foreach ($row as $column) {\n $values[] = is_null($column) ? 'null' : $pdo->quote($column);\n }\n\n $sql .= \"INSERT INTO `{$table}` VALUES (\".join(',', $values). \");\\n\";\n }\n }\n\n return $sql;\n }",
"public function printSchema() {\r\n\t\t global $_whomp_storage_path;\r\n\t\t \r\n\t\t header('Content-type: text/xml');\r\n\t\t readfile($_whomp_storage_path . $this->_schema_path);\r\n\t }",
"function dbDump() {\r\n $ArrTables = $this->dbListTables();\r\n foreach ($ArrTables as $tablename){\r\n // get description of table\r\n $desctable = $this->dbDescribeTable($tablename);\r\n\r\n // set fields =0\r\n $fields=0;\r\n\r\n // contruct table string\r\n $table = \"--\\n-- Table structure for table `$tablename`\\n--\\n\\n\";\r\n $table .= \"CREATE TABLE $tablename (\\n\";\r\n\r\n while ($row = $this->dbFetchArray($desctable)){\r\n $fields=$fields+1;\r\n $table .= \" $row[0] $row[1],\\n\";\r\n }\r\n $table = substr($table, 0, strlen($table)-2);\r\n $table .= \"\\n);\\n\\n\";\r\n $o .= $table;\r\n $sql=substr($sql,0,strlen($sql)-2);\r\n\r\n // get rows in table\r\n $allrows = $this->dbQuery(\"select * from $tablename\");\r\n while ($row = $this->dbFetchArray($allrows)) {\r\n $insert = \"INSERT INTO $tablename VALUES(\";\r\n\r\n for ($i=0; $i<count($row)/2; $i++) {\r\n if(strlen($row[$i])==0) $insert .= \"NULL,\"; \r\n else $insert .= \"'\".addslashes($row[$i]).\"',\";\r\n } \r\n\r\n $insert = substr($insert, 0, -1);\r\n $o .= $insert.\");\\n\";\r\n }\r\n }\r\n return $o;\r\n }",
"private function handleTables(): string\n {\n $dbDumper = $this->createDatabaseDumper();\n\n $outputFilename = $this->getOutputFilename($this->databaseName . '.sql.gz');\n\n if ($this->schemaOnlyTables !== null) {\n $dbDumper->excludeTables($this->schemaOnlyTables);\n }\n\n $dbDumper->dumpToFile($outputFilename);\n\n return $outputFilename;\n }",
"public function exportSchema() {\n\t\t//if ($this->databaseExists($databaseName, $serverName, $userName, $password);\n\t\t$classes = $this->getOwnClasses();\n\t\t$tool = new \\Doctrine\\ORM\\Tools\\SchemaTool($this->entityManager);\n\t\t$tool->updateSchema($classes, true);\n\n\t\t//$tool->createSchema($classes);\n\t}",
"public function extractTables() {\n\t\t$fixtureSql\t\t= $this->getFixtureContent('dump1.sql',__FILE__);\n\t\t$schemaFactory\t= new Domain_Database_Schema_Factory();\n\t\t$schema\t\t\t= $schemaFactory->createFromSql($fixtureSql);\n\t\t\n\t\t$this->assertEquals(6,$schema->getTables()->getCount(),'Unexpected number of tables in the schema');\n\t}",
"public function dumpTables()\n {\n $cnf = \\Pimcore\\Config::getSystemConfig();\n $return_var = NULL;\n $output = NULL;\n $u = $cnf->database->params->username;\n $p = $cnf->database->params->password;\n $db = $cnf->database->params->dbname;\n $h = $cnf->database->params->host;\n $file = $this->backupPath . $this->migrationSqlFile;\n\n $purged = '';\n if (true) {\n $purged = '--set-gtid-purged=OFF';\n }\n\n var_dump($this->staticDataTables);\n\n $tables = implode(' ', $this->staticDataTables);\n if(count($this->staticDataTables) > 0) {\n $command = \"mysqldump $purged --add-drop-table -u$u -p$p -h$h $db $tables | sed -e '/DEFINER/d' > $file\";\n }\n else {\n // REMOVE existing file!!!\n $command = \"cp /dev/null $file\";\n }\n\n exec($command, $output, $return_var);\n }",
"public function printSchema() {\n print \"\\n[\" . $this->name . \"]\\n\";\n foreach ($this->attrs as $attr_name => $attr_obj) {\n $attr_obj->printSchema();\n }\n }",
"public function dump(array $table);",
"#[@target(input= array('fetchTables', 'fetchConstraints', 'storage'))]\n public function generateTableXml($tables, $constraints, $storage) {\n $xml= array();\n foreach ($tables as $table) {\n\n // Calculate classname\n $className= ucfirst($table->name);\n if (isset($this->prefix)) {\n switch (1) {\n case (false == $this->ptargets):\n case (in_array($table->name, $this->ptargets) && false == $this->pexclude):\n case (!in_array($table->name, $this->ptargets) && true == $this->pexclude):\n $className= $this->prefix.$className;\n break;\n }\n }\n\n $gen= DBXmlGenerator::createFromTable(\n $table,\n $this->host,\n $this->adapter->conn->dsn->getDatabase()\n )->getTree();\n\n // Add extra information\n with ($node= $gen->root->children[0]); {\n $node->setAttribute('dbtype', $this->adapter->conn->dsn->getDriver());\n $node->setAttribute('class', $className);\n $node->setAttribute('package', $this->package);\n }\n\n $xml[]= $storage->write($className, $gen->getSource(INDENT_DEFAULT));\n }\n $storage->write(self::CONSTRAINT_FILE_NAME, $constraints->getSource(INDENT_DEFAULT));\n return $xml;\n }",
"public function getDatabaseDump(){\n Loader::library('backup');\n $db = Loader::db();\n\n // get tables listing\n $tablesArray = $db->getCol(\"SHOW TABLES FROM `\" . DB_DATABASE . \"`\");\n\n // loop through tables and create export\n foreach ($tablesArray as $bkuptable) {\n $tableobj = new Concrete5_Library_Backup_BackupTable($bkuptable);\n $str_backupdata .= \"DROP TABLE IF EXISTS $bkuptable;\\n\\n\";\n $str_backupdata .= $tableobj->str_createTableSql . \"\\n\\n\";\n if ($tableobj->str_createTableSql != \"\" ) {\n $str_backupdata .= $tableobj->str_insertionSql . \"\\n\\n\";\n }\n }\n\n // print out database schema\n print $str_backupdata;\n }",
"function xml_to_sql($databasename, $tablename, $xmlpath, $connection, $dropold = false)\n{\n // leggo i dati dalla tabella xml\n $TableXml = new XMLTable($databasename,$tablename,$xmlpath);\n $records = $TableXml->GetRecords();\n //dprint_r($connection);\n //die();\n if ( isset($TableXml->xmltable->connection) )\n {\n echo \"this is alredy sql database\";\n return;\n }\n //modifico le proprietà della tabella xml\n $oldfilestring = file_get_contents($xmlpath . \"/$databasename/$tablename.php\");\n $strnew = \"\\n\\t<driver>mysql</driver>\";\n $strnew .= \"\\n\\t<host>\" . $connection['host'] . \"</host>\";\n $strnew .= \"\\n\\t<user>\" . $connection['user'] . \"</user>\";\n $strnew .= \"\\n\\t<password>\" . $connection['password'] . \"</password>\";\n\n $newfilestring = preg_replace('/<\\/tables>$/s',encode_preg_replace2nd($strnew) . \"\\n</tables>\",trim(($oldfilestring))) . \"\\n\";\n //die(\"<pre>\".htmlspecialchars($newfilestring).\"</pre>\");\n $file = fopen($xmlpath . \"/$databasename/$tablename.php\",\"w\");\n fwrite($file,$newfilestring);\n $TableSql = new XMLTable($databasename,$tablename,$xmlpath);\n\n $fields = array();\n foreach ( $TableXml->fields as $field )\n {\n $tmp = array();\n $tmp['name'] = $field->name;\n $tmp['type'] = $field->type;\n $tmp['size'] = $field->size;\n if ($tmp['type'] != \"varchar\" || $tmp['type'] != \"text\" || $tmp['type'] != \"datetime\" )\n {\n $tmp['type'] = \"text\";\n $tmp['size'] = \"\";\n }\n if ( isset($field->extra) )\n $tmp['extra'] = $field->extra;\n if ( isset($field->primarykey) && $field->primarykey == 1 )\n $tmp['primarykey'] = $field->primarykey;\n $fields[] = $tmp;\n }\n if ( $dropold )\n {\n if ( !$connessione = mysql_connect($connection['host'],$connection['user'],$connection['password']) )\n return (mysql_error());\n mysql_select_db($databasename);\n $err = mysql_query(\"DROP TABLE `$tablename`\");\n mysql_close();\n echo (mysql_error());\n }\n // creo la tabella sql\n $err = createxmldatabase($databasename,$xmlpath,$connection);\n echo (\"<br />create database:\" . $err);\n $err = createxmltable($databasename,$tablename,$fields,$xmlpath,$connection);\n echo (\"<br />create table:\" . $err);\n foreach ( $records as $record )\n {\n //print_r($record);\n //inserisco i dati nella tabella sql\n $err = $TableSql->InsertRecord($record);\n if ( !is_array($err) )\n echo (\"<br />$err\");\n else\n dprint_r($err);\n }\n\n}",
"static public function mapSchemaToSQLDefinition($xml, &$tables)\n\t{\n\t\t$Parser = new QuickBooks_XML($xml);\n\t\t\n\t\t$errnum = 0;\n\t\t$errmsg = '';\n\t\t$tmp = $Parser->parse($errnum, $errmsg);\n\t\t\n\t\t$tmp = $tmp->children();\n\t\t$base = current($tmp);\n\t\t\n\t\t$tmp = $base->children();\n\t\t$rs = next($tmp);\n\t\t\n\t\tforeach ($rs->children() as $qbxml)\n\t\t{\n\t\t\tQuickBooks_SQL_Schema::_transform('', $qbxml, $tables);\n\t\t}\n\t\t\n\t\t/*\n\t\twhile (count($subtables) > 0)\n\t\t{\n\t\t\t$node = array_shift($subtables);\n\t\t\t\n\t\t\t$subsubtables = array();\n\t\t\t$tables[] = QuickBooks_SQL_Schema::_transform('', $node, $subsubtables);\n\t\t\t\n\t\t\t$subtables = array_merge($subtables, $subsubtables);\n\t\t}\n\t\t*/\n\t\t\n\t\t// The code below tries to guess as a good set of indexes to use for \n\t\t//\tany database tables we've generated from the schema. The code looks \n\t\t//\tat all of the fields in the table and if any of them are *ListID or \n\t\t//\t*TxnID it makes them indexes. \n\t\t\n\t\t// This is a list of field names that will *always* be assigned \n\t\t//\tindexes, regardless of what table they are in\n\t\t$always_index_fields = array(\n\t\t\t'Name', \n\t\t\t'FullName', \n\t\t\t'EntityType', \n\t\t\t'TxnType', \n\t\t\t'Email', \n\t\t\t//'Phone', \n\t\t\t'IsActive', \n\t\t\t'RefNumber', \n\t\t\t//'Address_City', \n\t\t\t'Address_State', \n\t\t\t'Address_Country', \n\t\t\t//'Address_PostalCode', \n\t\t\t//'BillAddress_City', \n\t\t\t'BillAddress_State', \n\t\t\t'BillAddress_Country', \n\t\t\t//'BillAddress_PostalCode', \n\t\t\t//'ShipAddress_City', \n\t\t\t'ShipAddress_State', \n\t\t\t'ShipAddress_Country', \n\t\t\t//'ShipAddress_PostalCode', \n\t\t\t'CompanyName', \n\t\t\t//'FirstName', \n\t\t\t'LastName', \n\t\t\t//'Contact', \n\t\t\t'TxnDate', \n\t\t\t'IsPaid', \n\t\t\t'IsPending', \n\t\t\t'IsManuallyClosed', \n\t\t\t'IsFullyReceived', \n\t\t\t'IsToBePrinted', \n\t\t\t'IsToBeEmailed', \n\t\t\t'IsFullyInvoiced', \n\t\t\t//'IsFinanceCharge', \n\t\t\t);\n\t\t\n\t\t// This is a list of table.field names that will be assigned indexes \n\t\t$always_index_tablefields = array(\n\t\t\t//'Account.AccountType', \n\t\t\t);\n\t\t\n\t\t/*\n\t\t'*FullName', \n\t\t'*ListID', \n\t\t'*TxnID', \n\t\t'*EntityType', \n\t\t'*TxnType', \n\t\t'*LineID', \n\t\t*/\n\t\t\n\t\tforeach ($tables as $table => $tabledef)\n\t\t{\n\t\t\t$uniques = array();\n\t\t\t$indexes = array();\n\t\t\t\n\t\t\tforeach ($tabledef[1] as $field => $fielddef)\n\t\t\t{\n\t\t\t\tif ($field == 'ListID' or \t\t// Unique keys\n\t\t\t\t\t$field == 'TxnID' or \n\t\t\t\t\t$field == 'Name')\n\t\t\t\t{\n\t\t\t\t\t// We can't apply indexes to TEXT columns, so we need to \n\t\t\t\t\t//\tcheck and make sure the column isn't of type TEXT \n\t\t\t\t\t//\tbefore we decide to use this as an index\n\t\t\t\t\t\n\t\t\t\t\tif ($fielddef[0] != QUICKBOOKS_DRIVER_SQL_TEXT)\n\t\t\t\t\t{\n\t\t\t\t\t\t$uniques[] = $field;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (substr($field, -6, 6) == 'ListID' or \t\t// Other things we should index for performance\n\t\t\t\t\tsubstr($field, -5, 5) == 'TxnID' or \n\t\t\t\t\tsubstr($field, -6, 6) == 'LineID' or \n\t\t\t\t\tin_array($field, $always_index_fields) or \n\t\t\t\t\tin_array($table . '.' . $field, $always_index_tablefields))\n\t\t\t\t{\n\t\t\t\t\t// We can't apply indexes to TEXT columns, so we need to \n\t\t\t\t\t//\tcheck and make sure the column isn't of type TEXT \n\t\t\t\t\t//\tbefore we decide to use this as an index\n\t\t\t\t\t\n\t\t\t\t\tif ($fielddef[0] != QUICKBOOKS_DRIVER_SQL_TEXT)\n\t\t\t\t\t{\n\t\t\t\t\t\t$indexes[] = $field;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//print_r($indexes);\n\t\t\t//print_r($uniques);\n\t\t\t\n\t\t\t$tables[$table][3] = $indexes;\n\t\t\t$tables[$table][4] = $uniques;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"function _tableSerialization( $xmlTable )\r\n{\r\n\t$res = \"\";\r\n\r\n\r\n\r\n\t$columnsClause\t= \"\";\r\n\r\n\t$columns = $xmlTable->SelectNodes(\"table/column\");\r\n\t$attributes = $xmlTable->GetXmlNodeAttributes();\r\n\r\n\t$i = 0;\r\n\tforeach( $columns as $xmlColumn )\r\n\t{\r\n\t\t$attr = $xmlColumn->GetXmlNodeAttributes();\r\n\t\t$columnName = $xmlColumn->GetXmlNodeData();\r\n\t\t$columnName = trim($columnName);\r\n\r\n\t\tif ( $i == 0 ) $columnsClause .= $columnName;\r\n\t\telse $columnsClause .= \", \".$columnName;\r\n\t\t$i++;\r\n\t}\r\n\r\n\t$tableName = $attributes[\"NAME\"];\r\n\r\n\r\n\t$selectSql = _getSelectStatement( $tableName, $columnsClause );\r\n\t$q = ss_db_query( $selectSql );\r\n\twhile( $row = db_fetch_row($q) )\r\n\t{\r\n\t\t$insertSql = _getInsertStatement( $xmlTable, $row, $columns, $attributes, $columnsClause );\r\n\t\tif ( $insertSql == \"\" )\r\n\t\t\tcontinue;\r\n\t\t$res .= $insertSql.\";\\n\";\r\n\t}\r\n\treturn $res;\r\n}",
"public function get_table_schema() {\n\t\tglobal $wpdb;\n\n\t\t$tables = array_keys( $this->get_all_tables() );\n\t\t$show = array();\n\n\t\tforeach ( $tables as $table ) {\n\t\t\t// These are known queries without user input\n\t\t\t// phpcs:ignore\n\t\t\t$row = $wpdb->get_row( 'SHOW CREATE TABLE ' . $table, ARRAY_N );\n\n\t\t\tif ( $row ) {\n\t\t\t\t$show = array_merge( $show, explode( \"\\n\", $row[1] ) );\n\t\t\t\t$show[] = '';\n\t\t\t} else {\n\t\t\t\t/* translators: 1: table name */\n\t\t\t\t$show[] = sprintf( __( 'Table \"%s\" is missing', 'redirection' ), $table );\n\t\t\t}\n\t\t}\n\n\t\treturn $show;\n\t}",
"public function dumpSchema(Schema $schema)\n {\n $rootNode = $this->document->createElement('app-data');\n $this->document->appendChild($rootNode);\n foreach ($schema->getDatabases() as $database) {\n $this->appendDatabaseNode($database, $rootNode);\n }\n\n return trim($this->document->saveXML());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Estos margenes se incluyen poorque no esta implementado el CSS con margin ni paddin. Por lo que hay que definir los espacios de separacion de esta manera, donde la primera posicion del array de cada tag, (0) es antes del taghtml y la siguiente posicion (1) es despues del tagHTML, dentro de cada uno un array donde 'h' es la distacia y 'n' las repeticiones por ejemplo: 'p' => array(0 => array('h' => 2, 'n' => 3), 1 => array('h' => 4, 'n' => 3) indica que para antes del tag se pone una distancia de 2x3 y al final del tag () de 4x3 | public function incluirMargenesHTML() {
$this->setHtmlVSpace(
array('p' => array(0 => array('h' => 2, 'n' => 3), 1 => array('h' => 2, 'n' => 3)),
'img' => array(0 => array('h' => 0, 'n' => 0), 1 => array('h' => 0, 'n' => 0)),
'ul' => array(0 => array('h' => 1, 'n' => 0), 1 => array('h' => 1, 'n' => 0)),
'ol' => array(0 => array('h' => 2, 'n' => 3), 1 => array('h' => 2, 'n' => 3))));
} | [
"function listTextMinMax($margin_left, $margin_top)\n{\n $text = array('min', '', '-s', 'm', '+s', '', 'max');\n $sum = $margin_left;\n foreach ($text as $key => $value) {\n $newResult[] = array('text_header' => $value, 'margin_left' => $sum, 'margin_top' => $margin_top);\n $sum += 50;\n }\n\n return $newResult;\n}",
"function compress_padding_and_margins( $item ) {\n\t\t// get the type and value of the property\n\t\t$item_parts = explode(':', $item);\n\n\t\t// check if this is a padding or margin property\n\t\tif ($item_parts[0] == 'padding' || $item_parts[0] == 'margin') {\n\t\t\t// place all the values into an array\n\t\t\t$values = explode(' ', $item_parts[1]);\n\n\t\t\t// switched based on the number of values found\n\t\t\t// no need to check if it's 1, because that can't be compressed\n\t\t\tswitch (count($values)) {\n\t\t\t\t// icey demonstrates the art of making pop corn:\n\t\t\tcase 2:\n\t\t\t\t// example: margin: 4px 4px\n\t\t\t\tif ($values[0] == $values[1])\n\t\t\t\t// example: margin: 4px\n\t\t\t\tarray_pop($values);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t// example: margin: 5px 7px 5px\n\t\t\t\tif ($values[0] == $values[2]) {\n\t\t\t\t\t// example: margin: 5px 7px\n\t\t\t\t\tarray_pop($values);\n\t\t\t\t\t// example: margin: 4px 4px\n\t\t\t\t\tif ($values[0] == $values[1])\n\t\t\t\t\t// example: 4px\n\t\t\t\t\tarray_pop($values);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t// example: margin: 3px 7px 9px 7px\n\t\t\t\tif ($values[1] == $values[3]) {\n\t\t\t\t\t// example: 3px 7px 9px\n\t\t\t\t\tarray_pop($values);\n\t\t\t\t\t// example: 3px 4px 3px\n\t\t\t\t\tif ($values[0] == $values[2]) {\n\t\t\t\t\t\t// example: 3px 4px\n\t\t\t\t\t\tarray_pop($values);\n\t\t\t\t\t\t// example: 7px 7px\n\t\t\t\t\t\tif ($values[0] == $values[1])\n\t\t\t\t\t\t// example: 7px\n\t\t\t\t\t\tarray_pop($values);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// check if any changes were made by comparing the original values to the current values\n\t\t\tif (implode(' ', $values) != $item_parts[1])\n\t\t\t// if so, change the item in the array to the shorter version\n\t\t\t$item = $item_parts[0].':'.implode(' ', $values);\n\t\t}\n\t\treturn $item;\n\t}",
"public function getMargins():array{\n\t\t$margins = explode(\",\", $this->pageMargins);\n\n\t\t$dictionary = [\"top\", \"right\", \"bottom\", \"left\", \"header\", \"footer\"];\n\n\t\t$marginsOut = [];\n\t\tforeach($margins AS $key => $val){\n\t\t\t$marginsOut[$dictionary[$key]] = (int)$val;\n\t\t}\n\n\t\treturn $marginsOut;\n\t}",
"public function getPageMargins()\n {\n return [$this->tMargin, $this->rMargin, $this->bMargin, $this->lMargin];\n }",
"public function margin($margin);",
"function GetMargins(){}",
"public function addMarginData ()\n {\n return [\n [1, 20, 1.25,],\n [4, 99.2, 500,],\n [-1, 20, 0,],\n [1, -20, 0.8,],\n [-1, -20, 0,],\n ];\n }",
"function parseMargin($str, $default = NULL) {\n $marginPatterns = array(\n 't_r_b_l' => '~^(\\d+(\\.\\d+)?)\\s+(\\d+(\\.\\d+)?)\\s+(\\d+(\\.\\d+)?)\\s+(\\d+(\\.\\d+)?)$~',\n 't_rl_b' => '~^(\\d+(\\.\\d+)?)\\s+(\\d+(\\.\\d+)?)\\s+(\\d+(\\.\\d+)?)$~',\n 'tb_rl' => '~^(\\d+(\\.\\d+)?)\\s+(\\d+(\\.\\d+)?)$~',\n 'trbl' => '~^(\\d+(\\.\\d+)?)$~'\n );\n if (preg_match($marginPatterns['t_r_b_l'], $str, $matches)) {\n $result = array(\n 'top' => $matches[1],\n 'right' => $matches[3],\n 'bottom' => $matches[5],\n 'left' => $matches[7],\n );\n } elseif (preg_match($marginPatterns['t_rl_b'], $str, $matches)) {\n $result = array(\n 'top' => $matches[1],\n 'right' => $matches[3],\n 'bottom' => $matches[5],\n 'left' => $matches[3],\n );\n } elseif (preg_match($marginPatterns['tb_rl'], $str, $matches)) {\n $result = array(\n 'top' => $matches[1],\n 'right' => $matches[3],\n 'bottom' => $matches[1],\n 'left' => $matches[3],\n );\n } elseif (preg_match($marginPatterns['trbl'], $str, $matches)) {\n $result = array(\n 'top' => $matches[1],\n 'right' => $matches[1],\n 'bottom' => $matches[1],\n 'left' => $matches[1],\n );\n } elseif (isset($default)) {\n return $default;\n } else {\n return $this->defaultMargin;\n }\n return $result;\n }",
"private function pPrSpacing($properties) {\r\n $before = 0;\r\n $after = 0;\r\n $line = 240;\r\n //let us look at the margin top\r\n if(!empty($properties['margin_top'])){\r\n $temp = $this->_wordMLUnits($properties['margin_top'], $properties['font_size']);\r\n $before += (int) round($temp[0]);\r\n }\r\n //let us look now at the padding top\r\n if(!empty($properties['padding_top'])){\r\n $temp = $this->_wordMLUnits($properties['padding_top'], $properties['font_size']);\r\n $before += (int) round($temp[0]);\r\n }\r\n //let us look at the margin bottom\r\n if(!empty($properties['margin_bottom'])){\r\n $temp = $this->_wordMLUnits($properties['margin_bottom'], $properties['font_size']);\r\n $after += (int) round($temp[0]);\r\n }\r\n //let us look now at the padding bottom\r\n if(!empty($properties['padding_bottom'])){\r\n $temp = $this->_wordMLUnits($properties['padding_bottom'], $properties['font_size']);\r\n $after += (int) round($temp[0]);\r\n }\r\n\r\n $before = max(0, $before);\r\n $after = max(0, $after);\r\n\r\n //we now check the line height property\r\n\r\n if(isset($properties['line_height'])){\r\n $line = (int) round($properties['line_height'] * 16.6667);\r\n }\r\n\r\n $spacing ='<w:spacing w:before=\"'.$before.'\" w:after=\"'.$after.'\" ';\r\n $spacing .= 'w:line=\"'.$line.'\" w:lineRule=\"auto\"';\r\n $spacing .= ' />';\r\n return $spacing;\r\n }",
"protected function set_margins()\n\t{\n\t\t$x = $this->captcha_width - $this->key_width;\n\t\tif ($x > 1)\n\t\t{\n\t\t\t$x = floor($x/2);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$x = 0;\n\t\t}\n\t\t$this->margin_x = $x;\n\t\t\n\t\tif ($this->font_height >= $this->captcha_height)\n\t\t{\n\t\t\t$y = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$y = $this->captcha_height - $this->font_height;\n\t\t\tif ($y > 1)\n\t\t\t{\n\t\t\t\t$y = floor($y/2);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$y = 0;\n\t\t\t}\n\t\t}\n\t\t$this->margin_y = $y;\n\t\treturn true;\n\t}",
"function SetMargins($extraWidth, $extraHeight){}",
"public function testCanCalculateVariousTextElementBoundariesOnPdfPage()\n\t {\n\t\t$leftof = $this->object->leftOf(\"TOP LEFT CORNER\");\n\t\t$this->assertEquals(0, $leftof);\n\n\t\t$toleftof = $this->object->toLeftOf(\"TOP LEFT CORNER\");\n\t\t$this->assertEquals(0, $toleftof);\n\n\t\t$rightof = $this->object->rightOf(\"TOP LEFT CORNER\");\n\t\t$this->assertEquals(148, $rightof);\n\n\t\t$torightof = $this->object->toRightOf(\"TOP LEFT CORNER\");\n\t\t$this->assertEquals(149, $torightof);\n\n\t\t$topof = $this->object->topOf(\"TOP LEFT CORNER\");\n\t\t$this->assertEquals(0, $topof);\n\n\t\t$above = $this->object->above(\"TOP LEFT CORNER\");\n\t\t$this->assertEquals(0, $above);\n\n\t\t$bottomof = $this->object->bottomOf(\"TOP LEFT CORNER\");\n\t\t$this->assertEquals(13, $bottomof);\n\n\t\t$below = $this->object->below(\"TOP LEFT CORNER\");\n\t\t$this->assertEquals(14, $below);\n\n\t\t$leftof = $this->object->leftOf(\"MULTIPLE LABELS\");\n\t\t$this->assertEquals(103, $leftof);\n\n\t\t$toleftof = $this->object->toLeftOf(\"MULTIPLE LABELS\");\n\t\t$this->assertEquals(102, $toleftof);\n\n\t\t$rightof = $this->object->rightOf(\"MULTIPLE LABELS\");\n\t\t$this->assertEquals(287, $rightof);\n\n\t\t$torightof = $this->object->toRightOf(\"MULTIPLE LABELS\");\n\t\t$this->assertEquals(288, $torightof);\n\n\t\t$topof = $this->object->topOf(\"MULTIPLE LABELS\");\n\t\t$this->assertEquals(518, $topof);\n\n\t\t$above = $this->object->above(\"MULTIPLE LABELS\");\n\t\t$this->assertEquals(517, $above);\n\n\t\t$bottomof = $this->object->bottomOf(\"MULTIPLE LABELS\");\n\t\t$this->assertEquals(568, $bottomof);\n\n\t\t$below = $this->object->below(\"MULTIPLE LABELS\");\n\t\t$this->assertEquals(569, $below);\n\n\t\t$leftof = $this->object->leftOf(\"BOTTOM RIGHT CORNER\", 1, true);\n\t\t$this->assertEquals(697, $leftof);\n\n\t\t$toleftof = $this->object->toLeftOf(\"BOTTOM RIGHT CORNER\");\n\t\t$this->assertEquals(696, $toleftof);\n\n\t\t$rightof = $this->object->rightOf(\"BOTTOM RIGHT CORNER\", 1, true);\n\t\t$this->assertEquals(892, $rightof);\n\n\t\t$torightof = $this->object->toRightOf(\"BOTTOM RIGHT CORNER\");\n\t\t$this->assertEquals(893, $torightof);\n\n\t\t$topof = $this->object->topOf(\"BOTTOM RIGHT CORNER\", 1, true);\n\t\t$this->assertEquals(1249, $topof);\n\n\t\t$above = $this->object->above(\"BOTTOM RIGHT CORNER\");\n\t\t$this->assertEquals(1248, $above);\n\n\t\t$bottomof = $this->object->bottomOf(\"BOTTOM RIGHT CORNER\", 1, true);\n\t\t$this->assertEquals(1262, $bottomof);\n\n\t\t$below = $this->object->below(\"BOTTOM RIGHT CORNER\");\n\t\t$this->assertEquals(1263, $below);\n\n\t\t$torightof = $this->object->toRightOf(\"NON-EXISTENT LABEL\");\n\t\t$this->assertFalse($torightof);\n\n\t\t$below = $this->object->below(\"NON-EXISTENT LABEL\");\n\t\t$this->assertFalse($below);\n\t }",
"function GetMarginOptions(){}",
"function GetMarginMask($margin){}",
"function _CheckMarginValue()\n{\nif($this->MarginTop<0)\n trigger_error(\"Top margin is < 0. It should be greater or equal to 0\",E_USER_ERROR);\nif($this->PaperDimY>0 && $this->MarginTop>$this->PaperDimY)\n trigger_error(\"Top margin bigger then paper size\",E_USER_ERROR);\n \nif($this->MarginBottom<0)\n trigger_error(\"Bottom margin is < 0. It should be greater or equal to 0\",E_USER_ERROR);\nif($this->PaperDimY>0 && $this->MarginBottom>$this->PaperDimY)\n trigger_error(\"Bottom margin bigger then paper size\",E_USER_ERROR);\nif($this->PaperDimY>0 && ($this->MarginBottom+$this->MarginTop)>$this->PaperDimY)\n trigger_error(\"No rows to write left. Bottom margin + top margin bigger then paper size\",E_USER_ERROR);\n\nif($this->MarginLeft<0)\n trigger_error(\"Left margin is < 0. It should be greater or equal to 0\",E_USER_ERROR);\nif($this->PaperDimX>0 && $this->MarginLeft>$this->PaperDimX)\n trigger_error(\"Left margin bigger then paper width\",E_USER_ERROR);\n\nif($this->MarginRight<0)\n trigger_error(\"Right margin is < 0. It should be greater or equal to 0\",E_USER_ERROR);\nif($this->PaperDimX>0 && $this->MarginRight>$this->PaperDimX)\n trigger_error(\"Right margin bigger then paper width\",E_USER_ERROR);\nif($this->PaperDimX>0 && ($this->MarginLeft+$this->MarginRight)>$this->PaperDimX)\n trigger_error(\"No columns to write left. Left margin + right margin bigger then paper width\",E_USER_ERROR);\n\n \n\n}",
"public static function getArrayParagraphLoremIpsum(){\n return array(\n \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec rutrum mauris ac elit euismod vitae rutrum orci cursus. Phasellus facilisis condimentum mollis. Ut vitae nibh nec lorem laoreet iaculis. Morbi sed odio nec tellus commodo molestie sed sit amet odio. Phasellus quis nulla tellus, ut molestie est. Integer lacus dolor, dapibus et suscipit sed, pharetra eget arcu. Aliquam erat volutpat.\",\n \"Nulla nisl mauris, dapibus a eleifend eu, laoreet ac sapien. Mauris dignissim congue condimentum. Phasellus iaculis ante a risus imperdiet malesuada. Sed vulputate mattis mauris eu bibendum. Fusce hendrerit congue dolor, quis sollicitudin leo tincidunt ut. Maecenas sodales porttitor enim et cursus. Vivamus ullamcorper lobortis consectetur. Integer sed libero ut mi hendrerit accumsan. Ut ac odio sem, vitae pulvinar sapien. Aenean congue odio vitae erat laoreet at iaculis tellus semper.\",\n \"Vestibulum dui augue, pulvinar in commodo eget, porta a libero. Sed eget nibh nulla. Vestibulum sapien odio, tempor quis pellentesque quis, ultricies pulvinar sem. Integer ac justo sapien. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sit amet erat in nulla pharetra iaculis sed non velit. Sed ullamcorper cursus enim eget pretium. Quisque in erat non lectus cursus lacinia quis sit amet sem. Nulla ut posuere mi. Sed euismod nisl non tortor pulvinar adipiscing. Mauris lobortis placerat lacus quis euismod. Proin vehicula blandit congue. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nunc dapibus venenatis consequat.\",\n \"Integer vehicula consectetur hendrerit. Nam sed arcu quis est pharetra pretium. Maecenas adipiscing gravida eros, at commodo tortor mattis sit amet. Donec ultrices commodo urna eget hendrerit. Nullam quam urna, interdum ac semper lacinia, pellentesque non turpis. Quisque ac tortor ac dui suscipit gravida eu in nulla. Praesent lectus mi, faucibus ut ultrices sit amet, volutpat et ante. Nam nec nunc massa, ac pharetra tortor. Curabitur eget volutpat felis. Integer malesuada enim in odio blandit nec varius tortor dignissim. In egestas lobortis suscipit. Sed blandit sagittis lectus, eu ullamcorper arcu tincidunt sit amet.\",\n \"Nunc a felis vitae quam aliquet rhoncus eu condimentum orci. Nam in nisi nisl. Praesent fermentum, nibh at vehicula sodales, felis nibh mattis lorem, non venenatis orci sapien a quam. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus egestas nisi non urna sollicitudin non porttitor ligula pretium. Nullam at erat eu lacus lobortis varius at sit amet metus. Donec id nisl elementum mauris bibendum dapibus eget vitae lectus. In eget nunc non nisi gravida tincidunt. Nunc tristique bibendum eros in tempor.\",\n \"Phasellus lobortis mauris in leo mollis quis rhoncus eros ultricies. Proin ornare sem sed risus luctus condimentum a sed velit. Donec quam erat, feugiat in pretium ut, interdum sollicitudin dui. Nulla facilisi. Maecenas lobortis neque quis tellus iaculis sed condimentum justo pulvinar. Nunc eleifend venenatis accumsan. Aenean ultricies felis augue. Integer suscipit luctus sodales. Mauris eu magna orci, sit amet pellentesque massa. Curabitur luctus ligula nec est congue non mattis diam aliquam. Donec imperdiet metus sit amet tortor fringilla interdum. Praesent non purus ac metus tristique ornare vitae a enim. Sed consequat augue quis felis bibendum convallis. Quisque fringilla augue eu magna vulputate dictum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.\",\n \"Nam bibendum, odio non hendrerit eleifend, elit sapien sodales orci, sit amet adipiscing ante diam eu leo. Fusce dui lectus, malesuada sed consectetur non, lobortis nec tellus. Curabitur adipiscing sem quis augue porttitor at consequat erat congue. Aenean at sem tortor. Sed sodales velit sit amet lacus pulvinar id cursus diam porta. Duis feugiat mattis dictum. Duis fringilla augue a nibh condimentum lacinia consequat metus semper. Ut ut nisl dolor. Ut velit justo, fermentum quis rutrum id, sollicitudin non quam. Integer at mauris nunc. Praesent iaculis nibh eu turpis ultricies tincidunt. Etiam at tortor enim. Nullam semper posuere interdum. Nullam vel eros turpis, posuere accumsan dui.\",\n \"Aliquam varius quam nec lorem bibendum pharetra. Aenean placerat aliquet fermentum. Praesent molestie justo a lorem consectetur lobortis. Vestibulum vitae nisl ut massa rutrum sollicitudin nec sed ligula. In sed cursus erat. Aenean eu urna erat. Praesent in enim lectus, et tristique arcu. Donec eget massa tortor. Duis sit amet leo eros, id malesuada risus.\",\n \"Duis condimentum dui vel libero commodo sollicitudin. Integer libero tortor, commodo in vestibulum in, tristique eu justo. Mauris ligula dolor, dapibus vel luctus in, congue quis nulla. Fusce et nunc sapien, ac imperdiet velit. Etiam lorem sem, aliquet a commodo vel, mattis in erat. Cras fringilla metus bibendum nunc rhoncus vitae convallis metus commodo. Aliquam dignissim sem id lorem iaculis lacinia. Donec congue, eros eget tristique aliquam, libero ipsum placerat nisi, ut gravida nibh enim quis tellus. Proin eu ligula odio, vitae tristique mauris. Nunc feugiat odio id quam tristique vehicula. Sed leo sapien, dictum nec malesuada id, euismod et lacus. Nullam libero est, sodales auctor scelerisque eget, tincidunt sed nisl. Aliquam erat volutpat. Nam sed arcu ac nisl vestibulum ultrices. Mauris sit amet elit id orci pulvinar varius. Duis magna mauris, scelerisque vel aliquet vel, luctus vel neque.\",\n \"Phasellus dictum neque eget mauris iaculis sit amet egestas nibh commodo. Nulla facilisi. Maecenas a egestas urna. Nulla facilisi. Proin bibendum volutpat massa, eu eleifend arcu fermentum ac. Nulla tincidunt ullamcorper tellus, aliquet volutpat massa sollicitudin in. Phasellus scelerisque, lectus quis luctus suscipit, tortor urna adipiscing risus, ut commodo sapien eros non nulla. Etiam at erat ipsum, eu fermentum mi. Praesent semper interdum mauris non tincidunt. Vivamus pulvinar ultricies pulvinar. Nunc porttitor sollicitudin augue, a hendrerit lectus ultricies ac. Nam non nibh arcu. Pellentesque vel velit tellus, at dignissim tellus. Duis et dui lectus, non rhoncus massa. Donec rutrum, velit eget cursus semper, magna odio vehicula turpis, nec commodo odio erat et dolor.\",\n );\n }",
"function GetBitmapMargins(){}",
"function EnableMargins($flag){}",
"function printFontAlign() {\n\n /**\n * 〈BR〉: line break (if there is a closing tag (e.g. 〈/C〉), it should be placed in front of the closing tag, two consecutive line breaks indicate adding a null string.\n * 〈L〉〈/L〉: left aligned\n * 〈C〉〈/C〉: center aligned\n * 〈R〉〈/R〉: right aligned\n * 〈N〉〈/C〉: normal font size\n * 〈HB〉〈/HB〉: double font in height\n * 〈WB〉〈/WB〉: double font in width\n * 〈B〉〈/B〉: double font in size\n * 〈CB〉〈/CB〉: double font in size centred\n * 〈HB2〉〈/HB2〉: three times the font in height\n * 〈WB2〉〈/WB2〉: three times the font in width\n * 〈B2〉〈/B2〉: three times the font in size\n * 〈BOLD〉〈/BOLD〉: bold font\n * 〈LOGO〉〈/LOGO〉: logo (the tag content is a character string in Base64 format, temporarily not opened)\n * 〈OR〉〈/QR〉: QR code (the tag content is a value of QR code, which cannot exceed 256 characters)\n * 〈BARCODE〉〈/BARCODE〉: barcode (the content is a value of barcode)\n * 〈CUT〉: cutter command (active paper cutting, only valid for cutter printer. Note: the print order of cutter printer has a cutter instruction by default in the end.)\n */\n\n$printContent= <<<EOF\nno element:default font<BR>\n<BR>\nL element: <L>left<BR></L>\n<BR>\nR element: <R>right<BR></R>\n<BR>\nC element: <C>center<BR></C>\n<BR>\nN element:<N>normal font size<BR></N>\n<BR>\nHB element: <HB>double font height<BR></HB>\n<BR>\nWB element: <WB>double font width<BR></WB>\n<BR>\nB element: <B>double font size<BR></B>\n<BR>\nHB2 element: <HB2>triple font height<BR></HB2>\n<BR>\nWB2 element: <WB2>triple font width<BR></WB2>\n<BR>\nB2 element: <B2>triple font size<BR></B2>\n<BR>\nBOLD element: <BOLD>bold font<BR></BOLD>\nEOF;\n\n // neseted using font and align element\n $printContent = $printContent.\"<BR>\";\n $printContent = $printContent.\"<C>nested use: <BOLD>center bold<BR></C>\";\n\n // print barcode and QR\n $printContent = $printContent.\"<BR>\";\n $printContent = $printContent.\"<C><BARCODE>9884822189</BARCODE></C>\";\n $printContent = $printContent.\"<C><QR>https://www.xpyun.net</QR></C>\";\n\n $request = new PrintRequest();\n $request->generateSign();\n\n //*Required*: The serial number of the printer\n $request->sn=OK_PRINTER_SN;\n\n //*Required*: The content to be printed can’t exceed 12288 bytes.\n $request->content=$printContent;\n\n //The number of printed copies is 1 by default.\n $request->copies=1;\n\n //Print mode:\n //If the value is 0 or not specified, it will check whether the printer is online. If not online, it will not generate a print order and directly return the status code of an offline device.\n //If online, it will generate a print order and return the print order number.If the value is 1, it will not check whether the printer is online, directly generate a print order and return the print order number.\n //If the printer is not online, the order will be cached in the print queue and will be printed automatically when the printer is normally online.\n $request->mode=0;\n\n $result = xpYunPrint($request);\n print $result->content->code.\"\\n\";\n print $result->content->msg.\"\\n\";\n\n //resp.data: Return to order No. correctly \n print $result->content->data.\"\\n\";\t\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check whether the given key can be used within the given algorithm. | private static function checkKeySize($managedKey, $algorithm) : bool
{
//check for the key length
if (($algorithm == self::AES_CBC_128) && ($managedKey['byteLength'] != 16)) {
return false;
} elseif (($algorithm == self::AES_CBC_192) && ($managedKey['byteLength'] != 24)) {
return false;
} elseif (($algorithm == self::AES_CBC_256) && ($managedKey['byteLength'] != 32)) {
return false;
}
return true;
} | [
"public function supportsKeyAlgorithm(AlgorithmIdentifier $algo): bool;",
"public function supportsKeyAlgorithm(AlgorithmIdentifier $algo);",
"public function isKeyValid($key);",
"public function checkKey($key) {}",
"public static function hasAlgorithm($algorithm) {}",
"private function checkKeyValidation()\n\t\t\t\t{\n\t\t\t\t\t\t\t\t$objSecurity = new Security();\n\n\t\t\t\t\t\t\t\tif($objSecurity->checkKey($this->receivedAPIKey,$this->requestedFeature))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}",
"protected function is_valid_key($key)\n {\n }",
"public function support(string $key): bool;",
"protected function isValidKey($key)\n {\n return (is_string($key) || is_int($key));\n }",
"public static function supported(string $key, string $cipher): bool\n {\n $length = mb_strlen($key, '8bit');\n\n return ($cipher === 'AES-128-CBC' && $length === 16) ||\n ($cipher === 'AES-256-CBC' && $length === 32);\n }",
"public static function cryptoAvailable($key = '')\n\t{\n\t\tif($key == '')\n\t\t{\n\t\t\t// get the key from the settings\n\t\t\t$key = static::getDefaultKey();\n\t\t}\n\n\t\tif($key <> '')\n\t\t{\n\t\t\tif(static::$cipher === null)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tstatic::$cipher = new Security\\Cipher();\n\t\t\t\t}\n\t\t\t\tcatch(Security\\SecurityException $e)\n\t\t\t\t{\n\t\t\t\t\tstatic::$cipher = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn ($key <> '' && static::$cipher);\n\t}",
"public static function check_valid_hmac_key($key)\n {\n $math = \\Mdanter\\Ecc\\EccFactory::getAdapter();\n $g = \\Mdanter\\Ecc\\EccFactory::getSecgCurves($math)->generator256k1();\n $n = $g->getOrder();\n\n // initialize the key as a base 16 number.\n $g_l = $math->hexDec($key);\n\n // compare it to zero\n $_equal_zero = $math->cmp($g_l, 0);\n // compare it to the order of the curve\n $_GE_n = $math->cmp($g_l, $n);\n\n // Check for invalid data\n if ($_equal_zero == 0 || $_GE_n == 1 || $_GE_n == 0) {\n return false; // Exception?\n }\n\n return true;\n }",
"static function valid_acckey($key) {\n $tok = self::grab_sectok($key);\n if($tok == null || $tok == false) return false;\n return self::valid_sectok($tok);\n }",
"public function checkIdentityKey($key);",
"public function isPackageKeyValid($packageKey);",
"public function canGetKey(string $key, ?EntityIdentifier $entity = null): bool;",
"public static function isKeyMandatory();",
"function validateKey($unvalidatedKey)\n\t{\n\t\tif(preg_match('/[A-Z][0-9][0-9][A-Z][A-Z][0-9][A-Z][0-9]$/', $unvalidatedKey) == 1){\n\n\t\t\t// Check if the digits fit the algorithm [first digit * third digit = last digit (first digit only)]\n\t\t\tif($unvalidatedKey[7] == substr(($unvalidatedKey[1] * $unvalidatedKey[5]), 0, 1)){\n\t\t\t\t\n\t\t\t\t// Check if the letters fit the algorithm\n\t\t\t\t// 4th Letter ID = (1st Letter ID + 3rd Letter ID)\n\n\n\t\t\t\t$keyLetters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\n\t\t\t\t// Retrieve the letter ids based on their position in the alphabet\n\t\t\t\t$letterOneID = strpos($keyLetters, $unvalidatedKey[0]);\n\t\t\t\t$letterThreeID = strpos($keyLetters, $unvalidatedKey[4]);\n\n\t\t\t\t// Create the value of the fourth letter\n\t\t\t\t$letterFourID = ($letterOneID + $letterThreeID);\n\n\n\t\t\t\t// If the fourth letter value is larger than the length of the alphabet, remove 'one alphabet' count from the value\n\t\t\t\tif($letterFourID > 25)\n\t\t\t\t{\n\t\t\t\t\t$letterFourID -= 25;\n\t\t\t\t}\n\n\n\t\t\t\t// Check if the fourth letter of the key matches the algorithm's result\n\t\t\t\tif($keyLetters[$letterFourID] == $unvalidatedKey[6]){\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\n\t}",
"public function isAcquired($key);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
loads the security key from the file system | protected function _loadSecurityKey()
{
$filename = APPLICATION_PATH . self::CONFIG_PATH . self::CONFIG_FILE;
if (file_exists($filename)){
$config = new Zend_Config_Ini(APPLICATION_PATH . self::CONFIG_PATH . self::CONFIG_FILE);
if ($config->get("security") && $config->get("security")->get("hash")){
$this->_securekey = $config->get("security")->get("hash");
}
}
if (is_null($this->_securekey)){
Core_Model_DiFactory::getMessageManager()->addError(self::KEY_NOT_FOUND);
}
return $this->_securekey;
} | [
"private function load_key () {\n \t$key = @file_get_contents($this->key_file);\n\n \tif($key === false)\n \t\t$key = $this->generate_key();\n\n \t$this->api_key = $key;\n }",
"private function loadApiKey()\n {\n // Trying to get key\n $key = @file_get_contents(WEB_DIR . '/../config/google.key');\n // File doesn't exist or permission denied\n if ($key === false) {\n throw new \\Exception('File \"google.key\" not found in \"/config\" dir.');\n } // File exists, but has no content\n elseif (!$key) {\n throw new \\Exception('You should place your GoogleAPI key in \"google.key\" file.');\n }\n\n return $key;\n }",
"function loadCrypto(){\n if(file_exists($this->_PATH.'/crypto.iv')){\n $this->_IV = file_get_contents($this->_PATH.'/crypto.iv');\n }else{\n return false;\n }\n if(file_exists($this->_PATH.'/crypto.key')){\n $this->_KEY = file_get_contents($this->_PATH.'/crypto.key');\n }else{\n return false;\n }\n return true;\n }",
"public function load($key);",
"function read_local_key() {\n\t\tif (!file_exists( $path = '' . $this->local_key_path . $this->local_key_name )) {\n\t\t\treturn $this->errors = $this->status_messages['missing_license_file'] . $path;\n\t\t}\n\n\n\t\tif (!is_writable( $path )) {\n\t\t\treturn $this->errors = $this->status_messages['license_file_not_writable'] . $path;\n\t\t}\n\n\t\t@file_get_contents( $path );\n\n\t\tif (!$local_key = ) {\n\t\t\t$this->fetch_new_local_key( );\n\t\t\t$local_key = ;\n\n\t\t\tif ($this->errors) {\n\t\t\t\treturn $this->errors;\n\t\t\t}\n\n\t\t\t$this->write_local_key( urldecode( $local_key ), $path );\n\t\t}\n\n\t\treturn $this->local_key_last = $local_key;\n\t}",
"protected function loadKeys()\n {\n if ($this->privateKeyFile) {\n $this->privateKey = $this->loadPrivateKey($this->privateKeyFile, $this->passphrase);\n $this->dataMaxLength = $this->getDataMaxLength($this->privateKey);\n }\n\n if ($this->publicKeyFile) {\n $this->publicKey = $this->loadPublicKey($this->publicKeyFile);\n } elseif ($this->certificateFile) {\n $this->publicKey = $this->loadPublicKey($this->certificateFile);\n }\n\n if ($this->publicKey && !$this->dataMaxLength) {\n $this->dataMaxLength = $this->getDataMaxLength($this->publicKey);\n }\n\n if ($this->publicKey && $this->privateKey) {\n $encryptedText = $this->encryptByPublicKey($this->generateRandomString());\n\n try {\n $this->decryptByPrivateKey($encryptedText);\n } catch (\\Exception $exception) {\n throw new InvalidConfigException('Invalid public-private key pair');\n }\n }\n }",
"public function testLoadKeys() {\n $result = $this->dsig->loadPrivateKey(self::PRIVATE_KEY, self::PRIVATE_KEY_PASSPHRASE);\n $this->assertTrue($result);\n\n $result = $this->dsig->loadPrivateKey(file_get_contents(self::PRIVATE_KEY), self::PRIVATE_KEY_PASSPHRASE, false);\n $this->assertTrue($result);\n\n $result = $this->dsig->loadPublicKey(self::PUBLIC_KEY);\n $this->assertTrue($result);\n\n $result = $this->dsig->loadPublicKey(file_get_contents(self::PUBLIC_KEY), false);\n $this->assertTrue($result);\n\n $result = $this->dsig->loadPublicXmlKey(file_get_contents(self::PUBLIC_XML_KEY), false);\n $this->assertTrue($result);\n\n $result = $this->dsig->loadPublicXmlKey(self::PUBLIC_XML_KEY);\n $this->assertTrue($result);\n }",
"private function loadPrivateKey()\n {\n $privateKey = openssl_pkey_get_private('file://' . $this->privateKey);\n if (!$privateKey) {\n throw new \\Exception('Failed to load private key');\n }\n return $privateKey;\n }",
"public function loadAccountKeyPair();",
"public function loadPrivateKey($path)\n {\n $fp = fopen($path, 'r');\n $key = fread($fp, 8192);\n\n return $key;\n }",
"private function load() {\n\n $this->initialise();\n $this->data_connector->Resource_Link_Share_Key_load($this);\n if (!is_null($this->id)) {\n $this->length = strlen($this->id);\n }\n if (!is_null($this->expires)) {\n $this->life = ($this->expires - time()) / 60 / 60;\n }\n\n }",
"public static function load(){\n \n if(! self::_checkIfExist()) {\n if(! $acl = self::_getFromApc()) {\n $acl = self::_generateFromDb();\n self::_storeInApc($acl);\n }\n self::_storeInRegistry($acl);\n }\n }",
"private function loadBitpayKeys()\n {\n try {\n $storageEngine = new \\Bitpay\\Storage\\FilesystemStorage();\n $this->privateKey = $storageEngine->load(THELIA_CACHE_DIR . 'bitpay.pri');\n $this->publicKey = $storageEngine->load(THELIA_CACHE_DIR . 'bitpay.pub');\n } catch (\\Exception $e) {\n $this->generateBitpayKeys();\n }\n }",
"public static function getSysPublicKeyFile() {\n\t\treturn self::SYS_KEY_DIR . '/public.pem';\n\t}",
"public function load($filename, $password, $options=array()) \n {\n \n try {\n \n // check that file exists\n if (!file_exists($filename)) {\n throw new Crypt_KeyStore_Exception(\"Key store does not exist\"); \n }\n \n // open read-only, put file pointer at beginning\n $fd = fopen($filename, 'r');\n if ($fd == false) {\n throw new Crypt_KeyStore_Exception(\"Failed to open key store\"); \n }\n \n $processedOpts = $this->_processSymmetricOptions($options);\n \n /* Open the cipher */\n $td = mcrypt_module_open(\n $processedOpts[self::OPT_CIPHER], \n '', \n $processedOpts[self::OPT_MODE], \n ''\n );\n \n // get the IV and salt from beginning of file and decode from hex\n $ivsize = mcrypt_enc_get_iv_size($td);\n $iv = pack(\n 'H*', \n fread($fd, $ivsize * 2)\n );\n $salt = pack(\n 'H*', \n fread($fd, $processedOpts[self::OPT_SALTSIZE] * 2)\n );\n \n // create the decryption key from the password, salt, and keysize\n // the keysize is cipher dependent - see above\n $dec_key = mhash_keygen_s2k(\n $processedOpts[self::OPT_HASH], \n $password, \n $salt, \n mcrypt_enc_get_key_size($td)\n );\n \n /* Intialize encryption */\n mcrypt_generic_init($td, $dec_key, $iv);\n \n // read the entries from the remaining key store file\n // and explode them into an array, delimited by |\n $header_size = ($ivsize * 2) + \n ($processedOpts[self::OPT_SALTSIZE] * 2);\n $entries = explode(\n '|', \n fread($fd, filesize($filename) - $header_size)\n );\n foreach ($entries as $entry) {\n \n // we may have an empty array elem because of a trailing |\n if ($entry != '') {\n \n // explode the entries into a list of record data \n // delimited by ,\n list($alias, $type, $size, $algo, $keysize, $encoded_data) \n = explode(',', $entry);\n \n // decode the encrypted key data, and then decrypt it\n $data = mdecrypt_generic($td, pack('H*', $encoded_data));\n \n // depending on the key type, add the \n // specific key to the key store\n switch ($type) {\n \n // asymmetric key entry\n case Crypt_KeyStore_BaseEntry::PRIVATEKEY_TYPE:\n // the asymmetric key is split into sections of \n // PEM formatted ascii-armored texts - after they are \n // decrypted, we can list them delimited by ,\n $sections = explode(',', $data);\n if (is_array($sections) && count($sections) > 1) {\n \n $pkey = $sections[0];\n $cert = $sections[1];\n $chain = array();\n \n if (count($sections) > 2) {\n \n // if the sections is built out of more than 2 \n // sections, the assumption is that there is a \n // chain file - copy the certs from public chain \n // file\n for ($n = 2; $n < count($sections); $n++) {\n $chain[] = $sections[$n];\n }\n } else {\n \n // otherwise, just use the public cert as \n // the chain\n $chain[] = $sections[1];\n }\n \n $this->_setKeyEntry(\n $alias, \n $pkey, \n $algo,\n $keysize,\n $cert, \n $chain\n );\n } else {\n $this->_log(\n \"Invalid asymmetric entry format\", \n PEAR_LOG_WARNING\n );\n }\n break;\n \n // symmetric key entry\n case Crypt_KeyStore_BaseEntry::SECRETKEY_TYPE:\n \n // there is only one portion the the scecret key - \n // the key itself\n // this is easy\n $this->_setSecretKeyEntry($alias, $data, $algo, $keysize);\n break;\n \n // trusted certificate entry\n case Crypt_KeyStore_BaseEntry::TRUSTEDCERT_TYPE:\n \n // a trusted certificate\n $this->_setCertificateEntry($alias, $data);\n break;\n \n // wtf? ignore\n default:\n $this->_log(\n \"Invalid key store entry type: $type\", \n PEAR_LOG_WARNING\n );\n break;\n }\n }\n }\n \n /* Terminate encryption handler */\n mcrypt_generic_deinit($td);\n mcrypt_module_close($td);\n \n fclose($fd);\n }\n catch (Crypt_KeyStore_Exception $e) {\n throw $e;\n }\n catch (Exception $e) {\n // general exception handler\n throw new Crypt_KeyStore_Exception($e);\n }\n \n return;\n }",
"public function loadAccountKeyPair(): KeyPair;",
"public function loadSSHKeys()\r\n {\r\n $ka = json_decode($this->listSSHKeys(), true);\r\n foreach ($ka['ssh_keys'] as $key) {\r\n $id = $key['id'];\r\n $this->ids[] = $id;\r\n $this->sshKey[$id] = $key;\r\n }\r\n $this->total_ssh_keys = $ka['meta']['total'];\r\n }",
"private function loadAccessoriesSubSec(){\n }",
"public function testLoadKeychainInvalid()\n\t{\n\t\t$publicKeyFile = __DIR__ . '/data/publickey.pem';\n\t\t$passphraseFile = __DIR__ . '/data/web-passphrase.dat';\n\n\t\t$keychain = new JKeychain;\n\n\t\t$keychain->loadKeychain($passphraseFile, $passphraseFile, $publicKeyFile);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function setAuthToken Set auth tokem | public function setAuthToken()
{
$this->authtoken = $this->getAccessTokenByRefreshToken();
} | [
"public function setAuthToken(string $authToken);",
"public function setAuthToken($auth_token) {\n\t\t$this->auth_token = $auth_token;\n\t}",
"public function setAuthToken($token)\n {\n $this->authToken = $token;\n }",
"public function setAuthToken($token) {\n $this->authentication->store($token);\n $this->authToken = $token;\n }",
"public function setAuthToken($token) {\n $this->_token = (string) $token;\n // if the token changes the user has likely changed\n $this->_userId = null;\n }",
"private function setAuthToken()\n {\n $salt = $this->app['randomgenerator']->generateString(12);\n $token = array(\n 'username' => $this->currentuser['username'],\n 'token' => $this->getAuthToken($this->currentuser['username'], $salt),\n 'salt' => $salt,\n 'validity' => date('Y-m-d H:i:s', time() + $this->app['config']->get('general/cookies_lifetime')),\n 'ip' => $this->remoteIP,\n 'lastseen' => date('Y-m-d H:i:s'),\n 'useragent' => $_SERVER['HTTP_USER_AGENT']\n );\n\n // Update or set the authtoken cookie.\n setcookie(\n 'bolt_authtoken',\n $token['token'],\n time() + $this->app['config']->get('general/cookies_lifetime'),\n '/',\n $this->app['config']->get('general/cookies_domain'),\n $this->app['config']->get('general/enforce_ssl'),\n true\n );\n\n try {\n // Check if there's already a token stored for this name / IP combo.\n $query = sprintf('SELECT id FROM %s WHERE username=? AND ip=? AND useragent=?', $this->authtokentable);\n $query = $this->app['db']->getDatabasePlatform()->modifyLimitQuery($query, 1);\n $row = $this->db->executeQuery($query, array($token['username'], $token['ip'], $token['useragent']), array(\\PDO::PARAM_STR))->fetch();\n\n // Update or insert the row.\n if (empty($row)) {\n $this->db->insert($this->authtokentable, $token);\n } else {\n $this->db->update($this->authtokentable, $token, array('id' => $row['id']));\n }\n } catch (DBALException $e) {\n // Oops. User will get a warning on the dashboard about tables that need to be repaired.\n }\n }",
"public function setToken()\n\t{\n\t\t $args = phpSmug::processArgs(func_get_args());\n\t\t $this->oauth_token = $args['id'];\n\t\t $this->oauth_token_secret = $args['Secret'];\n\t}",
"public function setToken();",
"private function setToken() {\n\n /* valid register */\n $request = $this->post('/v1/register', [\n 'firstname' => 'John',\n 'lastname' => 'Doe',\n 'email' => 'john.doe@email.com',\n 'password' => 'secret',\n ]);\n\n /* valid login */\n $this->post('/v1/login', [\n 'email' => 'john.doe@email.com',\n 'password' => 'secret',\n ]);\n\n }",
"private function setToken()\r\n {\r\n $this->token = $this->response->data->sl_token;\r\n\r\n $this->setTokenExpiryDate();\r\n }",
"private function setAuthUserToken()\n {\n $authUser = factory(App\\User::class)->create();\n\n $this->authUser = $authUser;\n $this->authUserToken = JWTAuth::fromUser($authUser);\n }",
"public static function initAuthToken(){\n\t\t$_SESSION[\"user\"][\"auth_token\"] = self::generateRandomCode(32);\n\t\t$_SESSION[\"user\"][\"auth_cnt\"] = 1;\n\t}",
"abstract public function setNextAuthToken($token);",
"public function setAuthToken($IDorKey) {\n\t\tif ($this->authType == 'sessionID') {\n\t\t\t$this->mySessionID = $IDorKey;\n\t\t}\n\t\telseif ($this->authType == 'apiKey') {\n\t\t\t$this->myApiKey = $IDorKey;\n\t\t}\n\t\t$this->authToken = $IDorKey;\n }",
"public function setAuthKey();",
"function setSyncToken($token);",
"public function setToken($token);",
"public function setToken($token, $token_secret)\n {\n }",
"public function setAccessToken() {\n\t\tif(!isset($_SERVER[\"HTTP_AUTHORIZATION\"]) || stripos($_SERVER[\"HTTP_AUTHORIZATION\"],\"Bearer \")!==0) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$this->accessToken = trim(substr($_SERVER[\"HTTP_AUTHORIZATION\"],7));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ The method is responsible to consult by id the database time table. This function have the idTimePlay of the class GameData (to search the database table) as input parameter. It returns all the game data that are in the database table searched. | public function consultByIdTimePlay(GameData $idTimePlay){
$sql = "SELECT * FROM dados WHERE tempo_id_tempo = '{$idTimePlay}'";
$result = $this->connection->dataBase->Execute($sql);
$record = $result->FetchNextObject();
$generalGameData = new GameData();
$generalGameData->__constructOverload($record->ID_DADOS,
$record->JOGADOR_ID_JOGADOR,
$record->TEMPO_ID_TEMPO,
$record->ADVERTENCIA, $record->PUNICAO,
$record->DESQUALIFICACAO, $record->RELATORIO,
$record->GOL);
return $generalGameData;
} | [
"public function _consultByIdTime($idTimePlay){\n $dataTime = new Time();\n $dataTime = $this->timeDAO->consultByIdTime($idTimePlay);\n $arrayData['idTimePlay'] = $dataTime->__getIdTimePlay();\n $arrayData['idGame'] = $dataTime->__getIdPlayer();\n $arrayData['type'] = $dataTime->__getType();\n $arrayData['amountSevenMetersTotal'] = $dataTime->__getAmountSevenMetersTotal();\n $arrayData['timeCoach'] = $dataTime->__getTimeCoach();\n $arrayData['scoreboardTeam1'] = $dataTime->__getScoreboardTeam1();\n $arrayData['scoreboardTeam2'] = $dataTime->__getScoreboardTeam2();\n\n return $arrayData;\n }",
"public function fetchGame($gameId);",
"public function consultByIdGameData($id){\n\treturn $this->gameDataCO->_consultByIdGameData($id);\n }",
"public function _consultByIdGame($idGame){\n $gameData = new Game();\n $gameData = $this->gameDAO->consultByIdGame($idGame);\n $arrayGameData['gameAudience'] = $gameData->__getGameAudience();\n $arrayGameData['gameCity'] = $gameData->__getGameCity();\n $arrayGameData['gameLocation'] = $gameData->__getGameLocation();\n $arrayGameData['gameDate'] = $gameData->__getGameDate();\n $arrayGameData['gameDuration'] = $gameData->__getGameDuration();\n $arrayGameData['total7Meters'] = $gameData->__getTotal7Meters();\n\n return $arrayGameData;\n }",
"public function getTimeInGameUser(int $idUser,int $idGame)\n {\n try{\n $this->psGetTimeInGame->execute(array(':search_idGame' => $idGame, ':search_idUser' => $idUser));\n $result = $this->psGetTimeInGame->fetchAll();\n }catch (PDOException $e) {\n print \"Erreur !: \" . $e->getMessage() . \"<br>\";\n die();\n }\n return $result;\n }",
"function db_get_every_game_for_sport($sport_id) {\n $games = db_load_table('game');\n \n // Filter sports\n $games_for_sport = array_filter($games, function($game) use ($sport_id) {\n return $game['sport_id'] == $sport_id;\n });\n \n // Sort by time\n usort($games_for_sport, function($g1, $g2) {\n return ($g1['datetime'] < $g2['datetime']) ? -1 : 1;\n });\n \n return $games_for_sport;\n}",
"public function pullGameData()\n {\n // Make the query to retreive game information from games table in database: \n $q = \"SELECT id_team, date, time, opponent, venue, result, note\n FROM games\n WHERE id_game = {$this->id_game}\n LIMIT 1\";\n\n // Execute the query & store result\n $result = $this->dbObject->getRow($q);\n\n // Found result\n if($result !== false) {\n $this->setGameAttributes($result['id_team'], $result['date'], $result['time'],\n $result['opponent'], $result['venue'], $result['result'],\n $result['note']);\n }\n }",
"public function _consultByIdGameData($idGameData){\n $generalGameData = new GameData();\n $generalGameData = $this->gameDataDAO->consultByIdGameData($idGameData);\n $arrayGameData['amountWarning'] = $generalGameData->__getAmountWarnings();\n $arrayGameData['amountPunishment'] = $generalGameData->__getAmountPunishment();\n $arrayGameData['amountDisqualification'] = $generalGameData->__getAmountDisqualification();\n $arrayGameData['amountReports'] = $generalGameData->__getAmountReports();\n return $arrayGameData;\n }",
"public function getGameById($id) {\n\n $sql = <<<SQL\nSELECT *\nFROM $this->tableName\nWHERE id=?\nSQL;\n\n $pdo = $this->pdo();\n $statement = $pdo->prepare($sql);\n\n $statement->execute(array($id));\n if($statement->rowCount() === 0) {\n return null;\n }\n\n return $statement->fetch(\\PDO::FETCH_ASSOC);\n\n\n\n }",
"public function getRecords($id) {\n $records = [];\n $steamid = $this->convertId($id);\n\n $records = $this->db->fetchAll('SELECT steamid, mapname, runtime, teleports, runtimepro FROM playertimes '.\n 'WHERE steamid = \"'.$steamid.'\" AND mapname NOT IN ('.$this->ignored.') ORDER BY mapname');\n\n return $records;\n }",
"public function load_game_from_db($id)\n\t{\n\t\tif(!is_int($id))\n\t\t{\n\t\t\techo 'Wrong datatype. Use GameID (INT)'; //Durch LOG ersetzen, sonst müllt das die Seite zu\n\t\t\treturn false;\n\t\t}\n\t\t$conn = OpenCon();\n\t\t$sql = 'SELECT * FROM games WHERE gameid='.$id;\n\t\t$tmp = $conn->query($sql);\n\n\t\tif($tmp->num_rows > 0)\n\t\t{\n\t\t\twhile($row = $tmp->fetch_assoc())\n\t\t\t{\n\t\t\t\t$this->gameid = $row['gameid'];\n\t\t\t\t$this->block = $row['block'];\n\t\t\t\t$this->time_start = $row['time_start'];\n\t\t\t\t$this->time_act = $row['time_act'];\n\t\t\t\t$this->points = $row['points'];\n\t\t\t\t$this->teamid = $row['teamid'];\n\t\t\t\t$this->active = $row['active'];\n\t\t\t\t$this->finished = $row['finished'];\n\t\t\t\t$this->highlight = $row['highlight'];\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo 'No Data found'; //Durch LOG ersetzen\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function findById( $id )\n {\n return \\R::findOne( 'time', ' id = ? ', [ $id ] );\n }",
"public static function loadFromDB($gameName,$gameID = null)\r\n\t{\t$gam = new Game();\r\n\t\r\n\t\t$con = db_connect();\r\n\t\t\r\n\t\tif($gameID!=null)\r\n\t\t{\t$statement = $con->prepare('Select * from game where game_id = ?');\r\n\t\t\t$statement->execute(array($gameID));\r\n\t\t}\r\n\t\telse\r\n\t\t{\t$statement = $con->prepare('Select * from game where name = ? and finished is null');\r\n\t\t\t$statement->execute(array($gameName));\r\n\t\t}\r\n\t\t\r\n\t\t$result = $statement;\r\n\t\tif($result->rowCount()!=0)\r\n\t\t{\t$row = $result->fetch(PDO::FETCH_ASSOC);\r\n\t\t\t\t\r\n\t\t\t$gam->creationDate = $row['creation_date'];\r\n\t\t\t$gam->finished = $row['finished'];\r\n\t\t\t$gam->gameID = $row['game_id'];\r\n\t\t\t$gam->gameName = $row['name'];\r\n\t\t\t$gam->isStarted = $row['is_started'];\r\n\t\t\t$gam->timeToPlay = $row['time_to_play'];\r\n\t\t\t$gam->mode = $row['mode'];\r\n\t\t\t$gam->playground = Playground::loadFromDB($row['playground']);\r\n\t\t\t$gam->buildingList = Building::loadSelectedBuildingsFromGame($gam->gameID);\r\n\t\t\t$gam->cardList = Card::loadSelectedCardsFromGame($gam->gameID);\r\n\t\t\t$gam->attendingUsers = User::getUsersInGame($gam->gameID);\r\n\t\t\t\r\n\t\t\treturn $gam;\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn \"e104\";\r\n\t}",
"public function read_game($id)\n\t{\n\t\t//\n\t}",
"function find_game($gamename,$gameid)\n\t{\n\t\tglobal $conn;\n\t\t$sql = 'SELECT * FROM game WHERE game_name = :name || game_id= :id';\n\t\t$statement = $conn->prepare($sql);\n\t\t$statement->bindValue(':name', $gamename);\n\t\t$statement->bindValue(':id', $gameid);\n\t\t$statement->execute();\n\t\t$result = $statement->fetchAll();\n\t\t$statement->closeCursor();\t\n\t\treturn $result;\n\t}",
"public function insertGame(Time $idGame){\n $sql = \"INSERT INTO tempo (jogo_id_jogo, tiro_7metros, tempo_tecnico, placar_time1,\n placar_time2,tipo) \n VALUES ('{$idGame->__getIdTimePlay()}',0,0,0,0,0)\";\n \n $return = mysql_query($sql);\n return $return;\n\t}",
"protected function getAllDatas()\n {\n $result = array();\n \n $current_player_id = self::getCurrentPlayerId(); // !! We must only return informations visible by this player !!\n \n // Get information about players\n // Note: you can retrieve some extra field you added for \"player\" table in \"dbmodel.sql\" if you need it.\n $sql = \"SELECT player_id id, player_score score FROM player \";\n $result['players'] = self::getCollectionFromDb( $sql );\n \n // TODO: Gather all information about current game situation (visible by player $current_player_id).\n \n return $result;\n }",
"function getAllGames($link)\n {\n $sql = 'SELECT * FROM games ORDER BY id DESC';\n if ($stmt = mysqli_prepare($link, $sql))\n {\n if (mysqli_stmt_execute($stmt))\n {\n $result = $stmt->get_result();\n $results = [];\n while ($row = $result->fetch_assoc())\n {\n $date = new DateTime($row[\"game_time\"]);\n $day = $date->format(\"Y-m-d\");\n if (array_key_exists($day, $results))\n {\n array_push($results[$day], $row);\n }\n else\n {\n $matchday = [$row];\n $results[$day] = $matchday;\n }\n }\n return $results;\n }\n }\n }",
"public function load_game($id){\n\n\t\t$query = \"SELECT * FROM `games` WHERE `id` = '$id'\";\n\n\t\t$result = DB::sql_fetch(DB::sql($query));\n\t\tif(setData($result)){\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save wholesale exclusive variation custom field for variable products on product edit page. | public function saveVariableProductWholesaleOnlyVariationCustomField ( $post_id ) {
$this->_wwpp_product_custom_fields->saveVariableProductWholesaleOnlyVariationCustomField( $post_id , $this->wwppGetAllRegisteredWholesaleRoles( null , false ) );
} | [
"function after_save_variations() {\n $data = $_POST['data'];\n\n $post_id = $data['post_id'];\n update_post_meta($post_id, '_regular_price', $data['global_price']);\n update_post_meta($post_id, '_sale_price', $data['global_sale']);\n }",
"public function saveVariableProductWholesaleOnlyVariationCustomField ( $post_id , $registeredCustomRoles ) {\r\n\r\n global $_POST;\r\n\r\n if ( isset( $_POST[ 'variable_sku' ] ) ) {\r\n\r\n $variable_post_id = $_POST[ 'variable_post_id' ];\r\n $max_loop = max( array_keys( $variable_post_id ) );\r\n\r\n foreach ( $registeredCustomRoles as $roleKey => $role ) {\r\n\r\n $wholesaleExclusive = array();\r\n if ( isset( $_POST[ $roleKey . '_exclusive_variation' ] ) )\r\n $wholesaleExclusive = $_POST[ $roleKey . '_exclusive_variation' ];\r\n\r\n for ( $i = 0; $i <= $max_loop; $i++ ) {\r\n\r\n if ( !isset( $variable_post_id[ $i ] ) )\r\n continue;\r\n\r\n $variation_id = (int) $variable_post_id[ $i ];\r\n\r\n if ( isset( $wholesaleExclusive[ $i ] ) )\r\n update_post_meta( $variation_id , $roleKey . '_exclusive_variation' , $wholesaleExclusive[ $i ] );\r\n else\r\n delete_post_meta( $variation_id , $roleKey . '_exclusive_variation' );\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }",
"function wcs_product_variation_save( $new_product_id, $variation_id, $variations, $wcfm_products_manage_form_data ) {\r\n\t \tglobal $wpdb, $WCFM, $WCFMu;\r\n\t \t\r\n\t \tif ( WC_Subscriptions_Product::is_subscription( $new_product_id ) ) {\r\n\t \t \r\n\t\t\t$subscription_price = isset( $variations['_subscription_price'] ) ? wc_format_decimal( $variations['_subscription_price'] ) : '';\r\n\t\t\tupdate_post_meta( $variation_id, '_subscription_price', $subscription_price );\r\n\t\t\tupdate_post_meta( $variation_id, '_regular_price', $subscription_price );\r\n\t\t\tupdate_post_meta( $new_product_id, '_price', $subscription_price );\r\n\t\t\tupdate_post_meta( $variation_id, '_price', $subscription_price );\r\n\t\r\n\t\t\t$subscription_fields = array(\r\n\t\t\t\t'_subscription_period',\r\n\t\t\t\t'_subscription_period_interval',\r\n\t\t\t\t'_subscription_sign_up_fee',\r\n\t\t\t\t'_subscription_trial_period',\r\n\t\t\t\t'_subscription_trial_length'\r\n\t\t\t);\r\n\t\r\n\t\t\tforeach ( $subscription_fields as $field_name ) {\r\n\t\t\t\tif ( isset( $variations[ $field_name ] ) ) {\r\n\t\t\t\t\tupdate_post_meta( $variation_id, $field_name, stripslashes( $variations[ $field_name ] ) );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tupdate_post_meta( $variation_id, '_subscription_length', stripslashes( $variations[ '_subscription_length_' . $variations[ '_subscription_period' ] ] ) );\r\n\t\t\t\r\n\t\t\tif ( WC_Subscriptions::is_woocommerce_pre( '3.0' ) ) {\r\n\t\t\t\t$variable_subscription = wc_get_product( $new_product_id );\r\n\t\t\t\t$variable_subscription->variable_product_sync();\r\n\t\t\t} else {\r\n\t\t\t\tWC_Product_Variable::sync( $new_product_id );\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function ewsp_add_pricing_fields_to_variable_product() {\n\t\n\techo '<div class=\"ewsp_wholesale_fields\">';\n\t\n\twoocommerce_wp_text_input(\n\t\tarray(\n\t\t\t'id' => '_ewsp_wc_wholesale_markup_variable',\n\t\t\t'class' => 'wc_input_price short',\n\t\t\t'wrapper_class' => 'show_if_variable',\n\t\t\t'label' => __( 'Wholesale Markup (%)', 'ewsp' ),\n\t\t\t'type' => 'number',\n\t\t\t'desc_tip' => true,\n\t\t\t'description' => __( 'Default wholesale markup for product variations', 'ewsp' ),\n\t\t\t'custom_attributes' => array(\n\t\t\t\t'step' => 'any',\n\t\t\t\t'min' => '0',\n\t\t\t),\n\t\t)\n\t);\n\t\n\twoocommerce_wp_text_input(\n\t\tarray(\n\t\t\t'id' => '_ewsp_wc_wholesale_price_variable',\n\t\t\t'class' => 'wc_input_price short',\n\t\t\t'wrapper_class' => 'show_if_variable',\n\t\t\t'label' => sprintf( __( 'Wholesale Price (%s)', 'ewsp' ), get_woocommerce_currency_symbol() ),\n\t\t\t'type' => 'number',\n\t\t\t'desc_tip' => true,\n\t\t\t'description' => __( 'Default wholesale price for product variations', 'ewsp' ),\n\t\t\t'custom_attributes' => array(\n\t\t\t\t'step' => 'any',\n\t\t\t\t'min' => '0',\n\t\t\t),\n\t\t)\n\t);\n\t\n\techo '</div>';\n\t\n\techo '<div class=\"ewsp_suggested_retail_fields\">';\n\t\n\twoocommerce_wp_text_input(\n\t\tarray(\n\t\t\t'id' => '_ewsp_wc_suggested_retail_markup_variable',\n\t\t\t'class' => 'wc_input_price short',\n\t\t\t'wrapper_class' => 'show_if_variable',\n\t\t\t'label' => __( 'Suggested Retail Markup (%)', 'ewsp' ),\n\t\t\t'type' => 'number',\n\t\t\t'desc_tip' => true,\n\t\t\t'description' => __( 'Default suggested retail markup for product variations', 'ewsp' ),\n\t\t\t'custom_attributes' => array(\n\t\t\t\t'step' => 'any',\n\t\t\t\t'min' => '0',\n\t\t\t),\n\t\t)\n\t);\n\t\n\twoocommerce_wp_text_input(\n\t\tarray(\n\t\t\t'id' => '_ewsp_wc_suggested_retail_price_variable',\n\t\t\t'class' => 'wc_input_price short',\n\t\t\t'wrapper_class' => 'show_if_variable',\n\t\t\t'label' => sprintf( __( 'Suggested Retail Price (%s)', 'ewsp' ), get_woocommerce_currency_symbol() ),\n\t\t\t'type' => 'number',\n\t\t\t'desc_tip' => true,\n\t\t\t'description' => __( 'Default suggested retail price for product variations', 'ewsp' ),\n\t\t\t'custom_attributes' => array(\n\t\t\t\t'step' => 'any',\n\t\t\t\t'min' => '0',\n\t\t\t),\n\t\t)\n\t);\n\t\n\techo '</div>';\n\t\n}",
"function save_variation_fields( $variation_id) {\n if (is_numeric($_POST['addon_'.$variation_id])){\n $addon = stripslashes( $_POST['addon_'.$variation_id]);\n update_post_meta( $variation_id, 'addon', esc_attr( $addon));\n // var_dump($_POST['addon_'.$variation_id]);\n }\n}",
"function fn_product_variations_apply_options_rules_post(&$product)\n{\n $product['options_update'] = true;\n}",
"function add_to_variations_metabox( $loop, $variation_data, $variation) {\n\n $custom = get_post_meta( $variation->ID, 'netsuite_id', true ); ?>\n\n <div class=\"variable_custom_field\">\n <p class=\"form-row form-row-first\">\n <label><?php echo __( 'Netsuite Id:', 'plugin_textdomain' ); ?></label>\n <input type=\"text\" size=\"5\" name=\"variation_custom_data[<?php echo $loop; ?>]\" value=\"<?php echo esc_attr( $custom ); ?>\" />\n </p>\n </div>\n\n <?php \n\n}",
"function woo_vou_product_variable_meta( $loop, $variation_data, $variation ) {\r\r\n\t\t\r\r\n\t\tinclude( WOO_VOU_ADMIN . '/forms/woo-vou-product-variable-meta.php' );\r\r\n\t}",
"public function testUpdateProductsVariation()\n {\n }",
"function save_variation_settings_fields( $post_id ) {\n // Text Field\n $text_field = $_POST['_aviability_text'][ $post_id ];\n if( ! empty( $text_field ) ) {\n update_post_meta( $post_id, '_aviability_text', esc_attr( $text_field ) );\n }\n}",
"function wc_bv_update_post_meta( $product_id, $meta_key, $meta_value ) {\n\tif ( WC_Bulk_Variations_Compatibility::is_wc_version_gte_2_7() ) {\n\t\t$product = wc_get_product( $product_id );\n\t\t$product->update_meta_data( $meta_key, $meta_value );\n\t\t$product->save_meta_data();\n\t} else {\n\t\tupdate_post_meta( $product_id, $meta_key, $meta_value );\n\t}\n}",
"function product_save_data($post_id) {\n global $product_meta_box;\n custom_save_meta_box($product_meta_box, $post_id);\n}",
"function fn_product_variations_apply_options_rules_post(&$product)\n{\n if ($product['product_type'] === ProductManager::PRODUCT_TYPE_CONFIGURABLE) {\n $product['options_update'] = true;\n }\n}",
"function load_variation_settings_fields( $variations ) {\n\n $variations['_custom_product_upc_'] = get_post_meta( $variations[ 'variation_id' ], '_custom_product_upc_', true );\n\n return $variations;\n}",
"function fn_product_variations_yml_export_update_product_pre_post($product_data, $product_id)\n{\n if (empty($product_id)) {\n return;\n }\n $sync_service = ProductVariationsServiceProvider::getSyncService();\n $sync_service->onTableChanged('yml_exclude_objects', $product_id);\n}",
"function save_custom_field_brand( $post_id ) {\n $product = wc_get_product( $post_id );\n $details_brand = isset( $_POST['custom_field_brand'] ) ? $_POST['custom_field_brand'] : '';\n $product->update_meta_data( 'custom_field_brand', sanitize_textarea_field( $details_brand ) );\n $product->save();\n}",
"function woocommerce_product_custom_fields_save($post_id)\n{\n $woocommerce_custom_product_text_field = $_POST['_custom_product_text_field'];\n if (!empty($woocommerce_custom_product_text_field)) {\n update_post_meta($post_id, '_custom_product_text_field', esc_attr($woocommerce_custom_product_text_field));\n }\n // Custom Product Textarea Field\n $woocommerce_custom_procut_textarea = $_POST['_custom_product_textarea'];\n if (!empty($woocommerce_custom_procut_textarea)) {\n update_post_meta($post_id, '_custom_product_textarea', esc_html($woocommerce_custom_procut_textarea));\n }\n}",
"function fn_product_variations_update_cart_products_post(&$cart)\n{\n foreach ($cart['products'] as &$product) {\n if (!empty($product['product_options'])) {\n /** @var \\Tygh\\Addons\\ProductVariations\\Product\\Manager $product_manager */\n $product_manager = Tygh::$app['addons.product_variations.product.manager'];\n $product_type = $product_manager->getProductFieldValue($product['product_id'], 'product_type');\n $product['extra']['product_type'] = $product_type;\n\n if ($product_type === ProductManager::PRODUCT_TYPE_CONFIGURABLE) {\n $variation_id = $product_manager->getVariationId($product['product_id'], $product['product_options']);\n\n if ($variation_id) {\n $product['extra']['variation_product_id'] = $variation_id;\n }\n }\n }\n }\n}",
"function variation_settings_fields( $loop, $variation_data, $variation ) {\n\n // Text Field\n woocommerce_wp_text_input( \n array( \n 'id' => '_aviability_text[' . $variation->ID . ']', \n 'label' => __( 'Disponibilità in', 'iro' ), \n 'placeholder' => '',\n 'desc_tip' => 'true',\n 'description' => __( 'Inserisci il testo su eventuale disponibilità (es: \\'Disponibile in 15 giorni.\\'.', 'woocommerce' ),\n 'value' => get_post_meta( $variation->ID, '_aviability_text', true )\n )\n );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation addLoggedTimeTagWithHttpInfo Add new tags for a loggedTime. | public function addLoggedTimeTagWithHttpInfo($logged_time_id, $logged_time_tag)
{
$returnType = '';
$request = $this->addLoggedTimeTagRequest($logged_time_id, $logged_time_tag);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
$e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
}
throw $e;
}
} | [
"public function addLoggedTimeTag($logged_time_id, $logged_time_tag)\n {\n $this->addLoggedTimeTagWithHttpInfo($logged_time_id, $logged_time_tag);\n }",
"public function addLoggedTimeTagAsyncWithHttpInfo($logged_time_id, $logged_time_tag)\n {\n $returnType = '';\n $request = $this->addLoggedTimeTagRequest($logged_time_id, $logged_time_tag);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function addLoggedTimeAuditWithHttpInfo($logged_time_id, $logged_time_audit)\n {\n $returnType = '';\n $request = $this->addLoggedTimeAuditRequest($logged_time_id, $logged_time_audit);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function addJobTimeTagWithHttpInfo($job_time_id, $job_time_tag)\n {\n $returnType = '';\n $request = $this->addJobTimeTagRequest($job_time_id, $job_time_tag);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function addLoggedTimeFileByURLWithHttpInfo($body, $logged_time_id)\n {\n $returnType = '';\n $request = $this->addLoggedTimeFileByURLRequest($body, $logged_time_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function addJobTimeTagWithHttpInfo($job_time_id, $job_time_tag)\n {\n \n // verify the required parameter 'job_time_id' is set\n if ($job_time_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $job_time_id when calling addJobTimeTag');\n }\n // verify the required parameter 'job_time_tag' is set\n if ($job_time_tag === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $job_time_tag when calling addJobTimeTag');\n }\n \n // parse inputs\n $resourcePath = \"/beta/jobTime/{jobTimeId}/tag/{jobTimeTag}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json'));\n \n \n \n // path params\n \n if ($job_time_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"jobTimeId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($job_time_id),\n $resourcePath\n );\n }// path params\n \n if ($job_time_tag !== null) {\n $resourcePath = str_replace(\n \"{\" . \"jobTimeTag\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($job_time_tag),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n \n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('API-Key');\n if (strlen($apiKey) !== 0) {\n $headerParams['API-Key'] = $apiKey;\n }\n \n \n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, 'PUT',\n $queryParams, $httpBody,\n $headerParams\n );\n \n return array(null, $statusCode, $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n }\n \n throw $e;\n }\n }",
"public function addLoggedTimeFile($logged_time_id, $file_name)\n {\n $this->addLoggedTimeFileWithHttpInfo($logged_time_id, $file_name);\n }",
"public function addJobTimeActivityTagWithHttpInfo($job_time_activity_id, $job_time_activity_tag)\n {\n $returnType = '';\n $request = $this->addJobTimeActivityTagRequest($job_time_activity_id, $job_time_activity_tag);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function addJobTimeAuditWithHttpInfo($job_time_id, $job_time_audit)\n {\n \n // verify the required parameter 'job_time_id' is set\n if ($job_time_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $job_time_id when calling addJobTimeAudit');\n }\n // verify the required parameter 'job_time_audit' is set\n if ($job_time_audit === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $job_time_audit when calling addJobTimeAudit');\n }\n \n // parse inputs\n $resourcePath = \"/beta/jobTime/{jobTimeId}/audit/{jobTimeAudit}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json'));\n \n \n \n // path params\n \n if ($job_time_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"jobTimeId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($job_time_id),\n $resourcePath\n );\n }// path params\n \n if ($job_time_audit !== null) {\n $resourcePath = str_replace(\n \"{\" . \"jobTimeAudit\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($job_time_audit),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n \n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('API-Key');\n if (strlen($apiKey) !== 0) {\n $headerParams['API-Key'] = $apiKey;\n }\n \n \n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, 'PUT',\n $queryParams, $httpBody,\n $headerParams\n );\n \n return array(null, $statusCode, $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n }\n \n throw $e;\n }\n }",
"public function updateLoggedTimeCustomFieldsWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateLoggedTimeCustomFieldsRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function addLoggedTimeAudit($logged_time_id, $logged_time_audit)\n {\n $this->addLoggedTimeAuditWithHttpInfo($logged_time_id, $logged_time_audit);\n }",
"public function addLoggedTimeTagAsync($logged_time_id, $logged_time_tag)\n {\n return $this->addLoggedTimeTagAsyncWithHttpInfo($logged_time_id, $logged_time_tag)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public static function addTagToLog($name){\n\t\tself::$tag_log[] = $name;\n\t}",
"public function getLoggedTimeFilesWithHttpInfo($logged_time_id)\n {\n $returnType = '';\n $request = $this->getLoggedTimeFilesRequest($logged_time_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"protected function addLoggedTimeAuditRequest($logged_time_id, $logged_time_audit)\n {\n // verify the required parameter 'logged_time_id' is set\n if ($logged_time_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $logged_time_id when calling addLoggedTimeAudit'\n );\n }\n // verify the required parameter 'logged_time_audit' is set\n if ($logged_time_audit === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $logged_time_audit when calling addLoggedTimeAudit'\n );\n }\n\n $resourcePath = '/beta/loggedTime/{loggedTimeId}/audit/{loggedTimeAudit}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($logged_time_id !== null) {\n $resourcePath = str_replace(\n '{' . 'loggedTimeId' . '}',\n ObjectSerializer::toPathValue($logged_time_id),\n $resourcePath\n );\n }\n // path params\n if ($logged_time_audit !== null) {\n $resourcePath = str_replace(\n '{' . 'loggedTimeAudit' . '}',\n ObjectSerializer::toPathValue($logged_time_audit),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function addTag($name, $value)\n {\n if ($this->timer) {\n pinba_timer_tags_merge($this->timer, [$name, $value]);\n }\n }",
"public function deleteLoggedTimeTagWithHttpInfo($logged_time_id, $logged_time_tag)\n {\n $returnType = '';\n $request = $this->deleteLoggedTimeTagRequest($logged_time_id, $logged_time_tag);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function getLoggedTimeTags($logged_time_id)\n {\n $this->getLoggedTimeTagsWithHttpInfo($logged_time_id);\n }",
"public function addJobTimeActivityTagAsyncWithHttpInfo($job_time_activity_id, $job_time_activity_tag)\n {\n $returnType = '';\n $request = $this->addJobTimeActivityTagRequest($job_time_activity_id, $job_time_activity_tag);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert Location to Address | public static function convertToAddress(Entity\Location $location): Address
{
$type = $location->getType() === Location\Type::UNKNOWN ? Address\FieldType::ADDRESS_LINE_2 : $location->getType();
$result = (new Address($location->getLanguageId()))
->setLatitude($location->getLatitude())
->setLongitude($location->getLongitude())
->setFieldValue($type, $location->getName());
if($parents = $location->getParents())
{
/** @var Location $parent */
foreach ($parents as $parent)
{
$result->setFieldValue($parent->getType(), $parent->getName());
}
}
if($fields = $location->getAllFieldsValues())
{
foreach($fields as $type => $value)
{
if(!$result->isFieldExist($type))
{
$result->setFieldValue($type, $value);
}
}
}
return $result;
} | [
"public static function resolveAddressFromLocation(self $location): string\n {\n $locality = $location->sublocality;\n\n if ($locality !== $location->locality && ! \\is_null($location->locality)) {\n $locality = (! empty($locality) ? \"{$locality}, \" : '').$location->locality;\n }\n\n $address = [\n $location->street_number,\n $location->street_name,\n \\trim($location->postcode.' '.$locality),\n $location->country,\n ];\n\n return $location->address ?? \\implode(', ', \\array_filter($address, static function ($value) {\n if (! empty($value)) {\n return $value;\n }\n }));\n }",
"public function getAddressFromLocation() {\n\t\t\t\t//Get the address for lcoation reference '012345678912345'. \n\t\t\t\t//Use %20 for spaces.\n\t\t\t\t//Replace ENTITY_ID placeholder with your actual entity id below. \n $curl = curl_init($this->URL.'entity/STX-02199-00/getAddressFromLocation?LocationReference=069265312635943');\n \n\t\t\t\t//Attach the header\n curl_setopt($curl, CURLOPT_HTTPHEADER, $this->multiHeaders);\n \n\t\t\t\t//Make the call and then close the connection\n $response = curl_exec($curl);\n curl_close($curl);\n }",
"public function formattedAddressIsStringFromAddress(): void\n {\n $municipality = new Municipality('9000', 'Gent');\n $address = new Address('Bellevue', '1', $municipality);\n\n $wgs84 = new Wgs84Point(10, 10);\n $lambert72 = new Lambert72Point(10, 10);\n $position = new Position($wgs84, $lambert72);\n $boundingBox = new BoundingBox($position, $position);\n\n $locationId = new LocationId(12345);\n $location = new Location(\n $locationId,\n 'location_type',\n $address,\n $position,\n $boundingBox\n );\n\n $this->assertSame('Bellevue 1, 9000 Gent', $location->addressFormatted());\n }",
"public function getAddressString()\r\n {\r\n // Get the variables\r\n $street1 = $this->getStreet1();\r\n $city = $this->getCity();\r\n $state = $this->getState();\r\n $postal = $this->getPostalCode();\r\n\r\n return Locations::createAddressString($street1, $city, $state, $postal);\r\n }",
"function map_addressString($location){\n\treturn ($location->address != \"\"?$location->address.\", \":\"\") . $location->city . \", \" . ($location->state != \"\"?$location->state.\", \":\"\") . $location->country;\n}",
"public function createOrderAddressFromLocation(DataObject $location): Address\n {\n $address = $this->addressFactory->create();\n $locationAddress = $location->getAddress();\n $address->setCompany($location->getName());\n $address->setCountryId($locationAddress['countryCode']);\n $address->setPostcode($locationAddress['postalCode']);\n $address->setCity($locationAddress['city']);\n $street = [$locationAddress['streetAddress']];\n if (isset($locationAddress['streetAddress2']) && !empty($locationAddress['streetAddress2'])) {\n $street[] = $locationAddress['streetAddress2'];\n }\n $address->setStreet($street);\n return $address;\n }",
"function _bn_geocoding_get_street_address( $result ) {\n\t$number = _bn_geocoding_property( $result, 'street_number' ); // 12345\n\t$name = _bn_geocoding_property( $result, 'route' ); // Example Avenue\n\t\n\treturn implode(' ', array_filter( array( $number, $name ) ) );\n}",
"function getLocation($street, $number, $municipality='Catania', $countryCode='IT', $countryLabel='Italy'){\n $uri=retrieveURI($street, $number, $municipality, $countryCode);\n $r=\"<locn:Location rdf:about=\\\"$uri\\\">\\n\";\n $r.=getLocnAddress($street, $number, $municipality, $countryCode, $countryLabel);\n return $r;\n}",
"public function getStreetAddress();",
"public function getCoordinateFromAddress(string $address): string;",
"public function getLocationAddressObject()\n {\n if (null === $this->_requestAddress) {\n $this->_requestAddress = new Address();\n }\n\n return $this->_requestAddress;\n }",
"public function getAddressObject();",
"public function toPaymentAddress(): NetopiaAddress\n {\n $address = new NetopiaAddress();\n $address->type = $this->type;\n $address->firstName = $this->firstName;\n $address->lastName = $this->lastName;\n $address->address = join(', ', array_filter([\n $this->address,\n $this->city,\n $this->county,\n $this->country,\n $this->postCode\n ], fn (mixed $v) => $v && (!\\is_string($v) || $v !== '')));\n $address->email = $this->email;\n $address->mobilePhone = $this->phone;\n\n return $address;\n }",
"function grav_address2location($address)\n{\n\n\t$address = str_replace (\" \", \"+\", urlencode($address));\n\t$details_url = \"http://maps.googleapis.com/maps/api/geocode/json?address=\".$address.\"&sensor=false\";\n\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $details_url);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t$response = json_decode(curl_exec($ch), true);\n\n\t// If Status Code is ZERO_RESULTS, OVER_QUERY_LIMIT, REQUEST_DENIED or INVALID_REQUEST\n\tif ($response['status'] != 'OK')\n\t{\n\t\treturn false;\n\t}\n\n\t$geometry = $response['results'][0]['geometry'];\n\n\t$longitude = $geometry['location']['lng'];\n\t$latitude = $geometry['location']['lat'];\n\n\t$array = array(\n\t\t'latitude' => $geometry['location']['lat'],\n\t\t'longitude' => $geometry['location']['lng'],\n\t\t'location_type' => $geometry['location_type'],\n\t);\n\n\treturn $array;\n}",
"public function formatAddress()\n\t{\n\t\t$address = $this->address.''.$this->address_2;\n\n\t\t// Find a match and store it in $result.\n\t\tif ( preg_match('/([^\\d]+)\\s?(.+)/i', $address, $result) )\n\t\t{\n\t\t\t// $result[1] will have the steet name\n\t\t\t$this->streetName = $result[1];\n\t\t\t// and $result[2] is the number part.\n\t\t\t$this->streetNumber = $result[2];\n\t\t}\n\t}",
"public function extractAddress($object);",
"function bn_get_location_street_address( $post_id, $meta_key = 'location', $verify_state_province = 'Brantford' ) {\n\t$location = get_post_meta( $post_id, $meta_key . '_geocoded', true );\n\t\n\t// Fall back to show whole address:\n\tif ( empty($location['address']) )\n\t\treturn bn_get_location_address( $post_id );\n\t\n\t// If different city, show whole address\n\tif ( empty($location['city']) || strtolower($location['city']) != strtolower($verify_state_province) )\n\t\treturn bn_get_location_address( $post_id );\n\t\n\treturn $location['address'];\n}",
"public function addressFormatted(): string;",
"public function getFormattedAddress()\n {\n return $this->formattedAddress;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Will take a single KalturaBatchJob and fetch the URL to the job's destFile | private function fetchFileSsh(KalturaBatchJob $job, KalturaSshImportJobData $data)
{
KalturaLog::debug("fetchFile($job->id)");
try
{
$sourceUrl = $data->srcFileUrl;
KalturaLog::debug("sourceUrl [$sourceUrl]");
// extract information from URL and job data
$parsedUrl = parse_url($sourceUrl);
$host = isset($parsedUrl['host']) ? $parsedUrl['host'] : null;
$remotePath = isset($parsedUrl['path']) ? $parsedUrl['path'] : null;
$username = isset($parsedUrl['user']) ? $parsedUrl['user'] : null;
$password = isset($parsedUrl['pass']) ? $parsedUrl['pass'] : null;
$port = isset($parsedUrl['port']) ? $parsedUrl['port'] : null;
$privateKey = isset($data->privateKey) ? $data->privateKey : null;
$publicKey = isset($data->publicKey) ? $data->publicKey : null;
$passPhrase = isset($data->passPhrase) ? $data->passPhrase : null;
KalturaLog::debug("host [$host] remotePath [$remotePath] username [$username] password [$password] port [$port]");
if ($privateKey || $publicKey) {
KalturaLog::debug("Private Key: $privateKey");
KalturaLog::debug("Public Key: $publicKey");
}
if (!$host) {
$this->closeJob($job, KalturaBatchJobErrorTypes::APP, KalturaBatchJobAppErrors::MISSING_PARAMETERS, 'Error: missing host', KalturaBatchJobStatus::FAILED);
return $job;
}
if (!$remotePath) {
$this->closeJob($job, KalturaBatchJobErrorTypes::APP, KalturaBatchJobAppErrors::MISSING_PARAMETERS, 'Error: missing path', KalturaBatchJobStatus::FAILED);
return $job;
}
// create suitable file transfer manager object
$subType = $job->jobSubType;
$engineOptions = isset($this->taskConfig->engineOptions) ? $this->taskConfig->engineOptions->toArray() : array();
$fileTransferMgr = kFileTransferMgr::getInstance($subType, $engineOptions);
if (!$fileTransferMgr) {
$this->closeJob($job, KalturaBatchJobErrorTypes::APP, KalturaBatchJobAppErrors::ENGINE_NOT_FOUND, "Error: file transfer manager not found for type [$subType]", KalturaBatchJobStatus::FAILED);
return $job;
}
// login to server
if (!$privateKey || !$publicKey) {
$fileTransferMgr->login($host, $username, $password, $port);
}
else {
$privateKeyFile = $this->getFileLocationForSshKey($privateKey, 'privateKey');
$publicKeyFile = $this->getFileLocationForSshKey($publicKey, 'publicKey');
$fileTransferMgr->loginPubKey($host, $username, $publicKeyFile, $privateKeyFile, $passPhrase);
}
// check if file exists
$fileExists = $fileTransferMgr->fileExists($remotePath);
if (!$fileExists) {
$this->closeJob($job, KalturaBatchJobErrorTypes::APP, KalturaBatchJobAppErrors::MISSING_PARAMETERS, "Error: remote file [$remotePath] does not exist", KalturaBatchJobStatus::FAILED);
return $job;
}
// get file size
$fileSize = $fileTransferMgr->fileSize($remotePath);
// create a temp file path
$destFile = $this->getTempFilePath($remotePath);
$data->destFileLocalPath = $destFile;
$data->fileSize = is_null($fileSize) ? -1 : $fileSize;
KalturaLog::debug("destFile [$destFile]");
// download file - overwrite local if exists
$this->updateJob($job, "Downloading file, size: $fileSize", KalturaBatchJobStatus::PROCESSING, $data);
KalturaLog::debug("Downloading remote file [$remotePath] to local path [$destFile]");
$res = $fileTransferMgr->getFile($remotePath, $destFile);
if(!file_exists($data->destFileLocalPath))
{
$this->closeJob($job, KalturaBatchJobErrorTypes::APP, KalturaBatchJobAppErrors::OUTPUT_FILE_DOESNT_EXIST, "Error: output file doesn't exist", KalturaBatchJobStatus::RETRY);
return $job;
}
// check the file size only if its first or second retry
// in case it failed few times, taks the file as is
if($fileSize)
{
clearstatcache();
$actualFileSize = kFile::fileSize($data->destFileLocalPath);
if($actualFileSize < $fileSize)
{
$percent = floor($actualFileSize * 100 / $fileSize);
$job = $this->updateJob($job, "Downloaded size: $actualFileSize($percent%)", KalturaBatchJobStatus::PROCESSING, $data);
$this->kClient->batch->resetJobExecutionAttempts($job->id, $this->getExclusiveLockKey(), $job->jobType);
return $job;
}
}
$this->updateJob($job, 'File imported, copy to shared folder', KalturaBatchJobStatus::PROCESSED);
$job = $this->moveFile($job, $data->destFileLocalPath, $fileSize);
}
catch(Exception $ex)
{
$this->closeJob($job, KalturaBatchJobErrorTypes::RUNTIME, $ex->getCode(), "Error: " . $ex->getMessage(), KalturaBatchJobStatus::FAILED);
}
return $job;
} | [
"public function getResultUrl(Job $job);",
"public static function exportSourceAssetFromJob(BatchJob $dbBatchJob)\r\n\t{\r\n\t\tif($dbBatchJob->getJobType() == BatchJobType::CONVERT_PROFILE)\r\n\t\t{\r\n\t\t\t$externalStorages = StorageProfilePeer::retrieveAutomaticByPartnerId($dbBatchJob->getPartnerId());\r\n\t\t\t$sourceFlavor = assetPeer::retrieveOriginalByEntryId($dbBatchJob->getEntryId());\r\n\t\t\tif (!$sourceFlavor) \r\n\t\t\t{\r\n\t\t\t KalturaLog::debug('Cannot find source flavor for entry id ['.$dbBatchJob->getEntryId().']');\r\n\t\t\t}\r\n\t\t\telse if (!$sourceFlavor->isLocalReadyStatus()) \r\n\t\t\t{\r\n\t\t\t KalturaLog::debug('Source flavor id ['.$sourceFlavor->getId().'] has status ['.$sourceFlavor->getStatus().'] - not ready for export');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n \t\t\tforeach($externalStorages as $externalStorage)\r\n \t\t\t{\r\n \t\t\t\tif ($externalStorage->triggerFitsReadyAsset($dbBatchJob->getEntryId()))\r\n \t\t\t\t{\r\n \t\t\t\t self::exportFlavorAsset($sourceFlavor, $externalStorage);\r\n \t\t\t\t}\r\n \t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n \t\t\t\r\n\t\t// convert collection finished - export ism and ismc files\r\n\t\tif($dbBatchJob->getJobType() == BatchJobType::CONVERT_COLLECTION && $dbBatchJob->getJobSubType() == conversionEngineType::EXPRESSION_ENCODER3)\r\n\t\t{\r\n\t\t\t$entry = $dbBatchJob->getEntry();\r\n\t\t\t$externalStorages = StorageProfilePeer::retrieveAutomaticByPartnerId($dbBatchJob->getPartnerId());\r\n\t\t\tforeach($externalStorages as $externalStorage)\r\n\t\t\t{\r\n\t\t\t\tif($externalStorage->triggerFitsReadyAsset($entry->getId()))\r\n\t\t\t\t{\r\n\t\t\t\t\t$ismKey = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_ISM);\r\n\t\t\t\t\tif(kFileSyncUtils::fileSync_exists($ismKey))\r\n\t\t\t\t\t\tself::export($entry, $externalStorage, $ismKey);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$ismcKey = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_ISMC);\r\n\t\t\t\t\tif(kFileSyncUtils::fileSync_exists($ismcKey))\r\n\t\t\t\t\t\tself::export($entry, $externalStorage, $ismcKey);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"function affwp_process_batch_export_download() {\n\tif( ! wp_verify_nonce( $_REQUEST['nonce'], 'affwp-batch-export' ) ) {\n\t\twp_die(\n\t\t\t__( 'Nonce verification failed', 'affiliate-wp' ),\n\t\t\t__( 'Error', 'affiliate-wp' ),\n\t\t\tarray( 'response' => 403 )\n\t\t);\n\t}\n\n\tif ( empty( $_REQUEST['batch_id'] ) || false === $batch = affiliate_wp()->utils->batch->get( $_REQUEST['batch_id'] ) ) {\n\t\twp_die(\n\t\t\t__( 'Invalid batch ID.', 'affiliate-wp' ),\n\t\t\t__( 'Error', 'affiliate-wp' ),\n\t\t\tarray( 'response' => 403 )\n\t\t);\n\t}\n\n\trequire_once $batch['file'];\n\n\tif ( empty( $batch['class'] ) || ( ! empty( $batch['class'] ) && ! class_exists( $batch['class'] ) ) ) {\n\t\twp_die(\n\t\t\t__( 'Invalid batch export class.', 'affiliate-wp' ),\n\t\t\t__( 'Error', 'affiliate-wp' ),\n\t\t\tarray( 'response' => 403 )\n\t\t);\n\t}\n\n\t$export = new $batch['class']( $step = 0 );\n\t$export->export();\n\n}",
"public function downloadScrapingJobJSON($scrapingJobId, $outputFile) {\n\n\t\t$this->httpClient->requestRaw('GET', \"scraping-job/{$scrapingJobId}/json\", [\n\t\t\t'headers' => ['Accept-Encoding' => 'gzip'],\n\t\t\t'timeout' => 600.0,\n\t\t\t'save_to' => $outputFile,\n\t\t]);\n\t}",
"public function batchjob()\n {\n return $this->api('Batchjob');\n }",
"public function getBatchUrls()\n {\n return $this->batchUrls;\n }",
"function get_batch($r) {\n if (!empty($r->batch_id)) {\n $batch_id = (int)($r->batch_id);\n $batch = BoincBatch::lookup_id($batch_id);\n } else if (!empty($r->batch_name)) {\n $batch_name = (string)($r->batch_name);\n $batch_name = BoincDb::escape_string($batch_name);\n $batch = BoincBatch::lookup_name($batch_name);\n } else {\n xml_error(-1, \"BOINC server: batch not specified\");\n }\n if (!$batch) xml_error(-1, \"BOINC server: no such batch\");\n return $batch;\n}",
"public function downloadScrapingJobCSV($scrapingJobId, $outputFile) {\n\n\t\t$this->httpClient->requestRaw('GET', \"scraping-job/{$scrapingJobId}/csv\", [\n\t\t\t'headers' => ['Accept-Encoding' => 'gzip'],\n\t\t\t'timeout' => 600.0,\n\t\t\t'save_to' => $outputFile,\n\t\t]);\n\t}",
"public function DownloadBatchJobResults($downloadUrl) {\n $this->adsUtilityRegistry->addUtility(AdsUtility::BATCHJOB_UTILS);\n return $this->batchJobUtilsDelegate->DownloadBatchJobResults($downloadUrl);\n }",
"function job_queue_link($id_job,$objets){\n\tinclude_spip('inc/queue');\n\treturn queue_link_job($id_job,$objets);\n}",
"public function getUri() {\n return Yii::app()->s3->assetsPath . 'user_jobs/' . $this->user_id . '/' . $this->job_id . '/';\n }",
"function _oa_export_batch_import_blueprint(&$batch, $blueprint, $space) {\n\n // Export a json file that contains the blueprint.\n $export = oa_export_create_json_export('blueprint', $blueprint, $_SESSION['oa_export']['directory']);\n\n // @todo: Add this in the finish function.\n $_SESSION['oa_export']['blueprint'] = $blueprint;\n\n // Add some operations to our batch process.\n oa_export_batch_import_operations($batch, $space);\n}",
"public function createBatch()\n {\n //creation url du batch\n $url=$this->url.\"/upload/\";\n\n //creation de la requete\n $reponse=\\Guzzle::post($url,[\n 'auth' => [ $this->user, $this->pass],\n ]);\n\n //récupère la réponse http contenant le batchid\n $out=$reponse->getBody();\n\n #decode le json en array\n $out=json_decode($out,true);\n\n /*print \"Batchid : \";\n print_r($out);*/\n\n //retourne l'uid du dossier/fichier créé\n return $out['batchId'];\n\n }",
"private function download_file() {\n // User output\n echo \"Downloading from URL \" . $this->source . \"\\r\\n\";\n echo \"File size: \" . $this->requested_file_size . \"\\r\\n\";\n\n // Create multiple curl handle for parallel retrieval\n $mh = curl_multi_init();\n\n // Create curl handle for each chunk\n for ($index = 0; $index < $this->chunk_quantity; $index++) {\n ${'ch' . $index} = $this->init_curl_handler($index);\n curl_multi_add_handle($mh,${'ch' . $index});\n }\n\n // Execute all requests simultaneously and continue when all are complete\n $running = null;\n do {\n curl_multi_exec($mh, $running);\n } while ($running);\n\n // Write results to file\n for ($index = 0; $index < $this->chunk_quantity; $index++) {\n // Open file\n if ($index > 0) {\n // Open file for writing and append to existing file\n $fp = fopen(\"./\" . $this->output_file, \"a\");\n } else {\n // Open file for writing and overwrite if file is pre-existing\n $fp = fopen(\"./\" . $this->output_file, \"w\");\n }\n\n // Write current chunk to file\n $response = curl_multi_getcontent(${'ch'.$index});\n fwrite($fp, $response);\n echo \"Writing chunk \" . ($index+1) . \" to file \" . $this->output_file . \"\\r\\n\";\n \n // Clean up\n fclose($fp);\n curl_multi_remove_handle($mh, ${'ch' . $index});\n }\n\n // Let user know everything completed normally\n echo \"All done!\\r\\n\";\n\n // Clean up \n curl_multi_close($mh);\n }",
"public function getJobRecord()\n {\n return $this->job;\n }",
"function getBatchReference() {\n return $this->m_batchReference;\n }",
"private function fetchDir(KalturaBatchJob &$job, $sourceUrl, $dirDestination)\r\n\t{\r\n\t\tKalturaLog::debug('fetchDir - job id ['.$job->id.'], source url ['.$sourceUrl.'], destination ['.$dirDestination.']');\r\n\t\t\r\n\t\t// create directory if does not exist\r\n\t\t$res = $this->createAndSetDir($dirDestination);\r\n\t\tif (!$res) {\r\n\t\t\t$msg = \"Error: Cannot create destination directory [$dirDestination]\";\r\n\t\t\tKalturaLog::err($msg);\r\n\t\t\t$this->closeJob($job, KalturaBatchJobErrorTypes::APP, KalturaBatchJobAppErrors::CANNOT_CREATE_DIRECTORY, $msg, KalturaBatchJobStatus::RETRY);\t\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// get directory contents\r\n\t\tKalturaLog::debug('Executing CURL to get directory contents for ['.$sourceUrl.']');\r\n\t\t$curlWrapper = new KCurlWrapper($sourceUrl);\t\r\n\t\t$contents = $curlWrapper->exec();\r\n\t\t$curlError = $curlWrapper->getError();\r\n\t\t$curlErrorNumber = $curlWrapper->getErrorNumber();\r\n\t\t$curlWrapper->close();\r\n\t\t\r\n\t\tif ($contents === false || $curlError) {\r\n\t\t\t$msg = \"Error: $curlError\";\r\n\t\t\tKalturaLog::err($msg);\r\n\t\t\t$this->closeJob($job, KalturaBatchJobErrorTypes::CURL, $curlErrorNumber, $msg, KalturaBatchJobStatus::RETRY);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$contents = unserialize($contents); // if an exception is thrown, it will be catched in fetchUrl\r\n\t\t\r\n\t\t// sort contents alphabetically - this is important so that we will first encounter directories and only later the files in them\r\n\t\tsort($contents, SORT_STRING);\t\t\r\n\t\t\r\n\t\t// fetch each direcotry content\r\n\t\tforeach ($contents as $current)\r\n\t\t{\r\n\t\t\t$name = trim($current[0],' /');\r\n\t\t\t$type = trim($current[1]);\r\n\t\t\t$filesize = trim($current[2]);\r\n\t\t\t\r\n\t\t\t$newUrl = $sourceUrl .'/fileName/'.base64_encode($name);\r\n\t\t\t\r\n\t\t\tif (!$type || !$filesize)\r\n\t\t\t{\r\n\t\t\t\t$curlHeaderResponse = $this->fetchHeader($job, $newUrl);\r\n\t\t\t\tif (!$curlHeaderResponse) {\r\n\t\t\t\t\treturn false; // job already closed with an error\r\n\t\t\t\t}\r\n\t\t\t\t// check if current is a file or directory\r\n\t\t\t\t$isDir = $this->isDirectoryHeader($curlHeaderResponse);\r\n\t\t\t\t$filesize = $this->getFilesizeFromHeader($curlHeaderResponse);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$isDir = $type === 'dir';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($isDir)\r\n\t\t\t{\r\n\t\t\t\t// is a directory - no need to fetch from server, just create it and proceed\r\n\t\t\t\t$res = $this->createAndSetDir($dirDestination.'/'.$name);\r\n\t\t\t\tif (!$res)\r\n\t\t\t\t{\r\n\t\t\t\t\t$msg = 'Error: Cannot create destination directory ['.$dirDestination.'/'.$name.']';\r\n\t\t\t\t\tKalturaLog::err($msg);\r\n\t\t\t\t\t$this->closeJob($job, KalturaBatchJobErrorTypes::APP, KalturaBatchJobAppErrors::CANNOT_CREATE_DIRECTORY, $msg, KalturaBatchJobStatus::RETRY);\t\t\t\t\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// is a file - fetch it from server\r\n\t\t\t\t$res = $this->fetchFile($job, $newUrl, $dirDestination.'/'.$name, null, $filesize);\r\n\t\t\t\tif (!$res) {\r\n\t\t\t\t\treturn false; // job already closed with an error\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tKalturaLog::debug('fetchDir - done succesfuly');\r\n\t\treturn true;\r\n\t}",
"public function getResultUrl(Job $job) {\n \n return $this->container->getParameter('scheduler.result_url').$job->getProgramName().'/'.$job->getJobUid().'/';\n }",
"public function getNextJob();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a user as a mail recipient. | protected function addMailUserRecipient(NotifiableUser $user): void
{
$this->mailRecipients[] = [
'email' => $user->__get($user::getEmailField()),
'name' => $user::hasNameField() ? $user->__get($user::getNameField()) : '',
'user' => $user,
];
} | [
"public function addRecipient(Address $address);",
"public function addUserRecipient(NotifiableUser $user): static;",
"public function addRecipient(Recipient $recipient);",
"public function addMailRecipient(string $email, string $name = ''): static;",
"function send_mail_user($user)\n { \n Mail::to($user->email)->send(new CreatedUserMailable($user));\n }",
"public function add_recipient($address, $name=null) {\n\t\t$this->mailer->add_recipient($address, $name);\n\t}",
"public function addRecipient( $recipient ) {\n\t\t$to = new EmailRecipient( $recipient );\n\t\tif ( $to->validate() ) {\n\t\t\t$this->to[] = \"{$to}\";\n\t\t}\n\t}",
"public function addEmail();",
"public function addUser($fields) {\n $vars = array();\n $this->to[] = array(\n 'email' => $fields['email'],\n 'name' => $fields['name'],\n 'type' => 'to',\n );\n foreach($fields as $key => $value) {\n if ($key == 'name' || $key == 'email') {\n continue;\n }\n $vars[] = array(\n 'name' => strtoupper($key),\n 'content' => $value,\n );\n }\n $this->merge_vars[] = array(\n 'rcpt' => $fields['email'],\n 'vars' => $vars,\n\n );\n }",
"public function addRecipient( EmailAddress $recipient )\n {\n array_push( $this->to, $recipient );\n }",
"private function sendTo($user_email){\n $this->addAddress($user_email);\n return $this->send();\n }",
"function addRecipient($email, $name = null)\n\t{\n if (!is_array($this->recipients))\n\t $this->recipients = array();\t \n\t \n if ($adress = $this->__makeRFC2822MailAdress($email, $name))\n\t $this->recipients[] = $adress;\n else\n return false;\n\n return true;\n\t}",
"public function addTo(EmailIdentity $recipient) {\n $this->to[$recipient->getEmail()] = $recipient;\n }",
"function compose( $user ) {\n\t\tglobal $wgEnotifImpersonal;\n\n\t\tif ( !$this->composed_common ) {\n\t\t\t$this->composeCommonMailtext();\n\t\t}\n\n\t\tif ( $wgEnotifImpersonal ) {\n\t\t\t$this->mailTargets[] = new MailAddress( $user );\n\t\t} else {\n\t\t\t$this->sendPersonalised( $user );\n\t\t}\n\t}",
"public function add_to(string $email, ?string $name = null): mail_interface;",
"public function sendUserSignUpEmail(User $user);",
"public function AddRecipient($name, $address, $type=\"to\"){\n\t\t\t// prepare type\n\t\t\t$type = strtolower($type);\n\t\t\tif(strlen($name)==0){$name=$address;}\n\t\t\t\n\t\t\t// prepare type array\n\t\t\tif(isset($this->recipients[$type])&&!is_array($this->recipients[$type])){$this->recipients[$type]=Array();}\n\t\t\t\t\n\t\t\t// add\n\t\t\t$this->recipients[$type][$address]=$name;\n\t\t}",
"public function addMail(array $data);",
"function addRecipients( $recipients ) {\r\n $recipients_list = explode(',', $recipients);\r\n foreach ($recipients_list as $recipient) {\r\n $this->mail->addAddress($recipient);\r\n }\r\n $this->recipients .= $recipients . ',';\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check values for operate | private function checkValues($values)
{
$operates=array_slice(static::$supportOperate, 0, -2);
if( in_array($this->operate, $operates) ) {
if (count($values) > 1) {
throw new \InvalidArgumentException("unsupported values for operate {$this->operate}, and values is" . json_encode($values));
}
}
else {
if (count($values) == 0) {
throw new \InvalidArgumentException("unsupported values for operate {$this->operate}, and values is" . json_encode($values));
}
}
return $values;
} | [
"protected function checkValuesValidity(): void\n {\n //\n }",
"public function checkInput(){\n foreach ($this as $key => $value) {\n\n //check for numeric (internal class value exceptions)\n if (\n $key !== \"result\"\n && $key !== \"err_flag\"\n && $key !== \"costPrototypes\"\n && $key !== \"costInventory\"\n && $key !== \"seedSalesCostForRound\"\n && $key !== \"salesCostForRound\"\n && $key !== \"startUpCost\"\n && $key !== \"owners_daily_cost\"\n && $key !== \"manager_daily_cost\"\n && $key !== \"labor_daily_cost\"\n && $key !== \"employees_daily_cost\"\n && $key !== \"this_rounds_months\"\n && $key !== \"employee_monthly_cost\"\n && $key !== \"monthly_supply_cost\"\n ) {\n if (!is_numeric($value)) {\n $this->errorOut(\"$key with value '$value' is not numeric.\");\n break;\n };\n }\n //check for 0\n if($value===0){\n $this->errorOut(\"$key cannot be '0'.\");\n break;\n };\n\n }\n }",
"private function checkValues()\n {\n if (!$this->insertVals) {\n return false;\n }\n\n return true;\n }",
"public static function checkDeafultValues(){\n return (VwOpcionesdocumentos::tienevalorpordefecto('DailyWork', 'hidturno') &&\n VwOpcionesdocumentos::tienevalorpordefecto('DailyWork', 'codproyecto')&&\n VwOpcionesdocumentos::tienevalorpordefecto('DailyWork', 'codresponsable'));\n \n }",
"abstract public function check($value);",
"function Value_exist()\n {\n $result=$this->admin_control_model->value_exist(prepare_post());\n validation_response($result['name'],$result['value'],$result['is_error'],$result['error_text']);\n }",
"public function evalValues()\n {\n // Check required, set failure if not ok.\n $tempArr = array();\n foreach ($this->requiredArr as $theField) {\n if (!trim($this->dataArr[$theField])) {\n $tempArr[] = $theField;\n }\n }\n\n // Evaluate: This evaluates for more advanced things than 'required' does.\n // But it returns the same error code, so you must let the required-message tell, if further evaluation has failed!\n $recExist = 0;\n if (is_array($this->conf[$this->cmdKey.'.']['evalValues.'])) {\n switch ($this->cmd) {\n case 'edit':\n if (isset($this->dataArr['pid'])) {\n // This may be tricked if the input has the pid-field set but the edit-field list does NOT allow the pid to be edited. Then the pid may be false.\n $recordTestPid = intval($this->dataArr['pid']);\n } else {\n $tempRecArr = $this->getTypoScriptFrontendController()->sys_page->getRawRecord($this->theTable, $this->dataArr['uid']);\n $recordTestPid = intval($tempRecArr['pid']);\n }\n $recExist = 1;\n break;\n default:\n $pid = MathUtility::convertToPositiveInteger($this->dataArr['pid']);\n $recordTestPid = $this->thePid ? $this->thePid : $pid;\n break;\n }\n\n foreach ($this->conf[$this->cmdKey.'.']['evalValues.'] as $theField => $theValue) {\n $listOfCommands = GeneralUtility::trimExplode(',', $theValue, 1);\n foreach ($listOfCommands as $cmd) {\n // Point is to enable parameters after each command enclosed in brackets [..]. These will be in position 1 in the array.\n $cmdParts = preg_split('/\\[|\\]/', $cmd);\n $theCmd = trim($cmdParts[0]);\n switch ($theCmd) {\n case 'uniqueGlobal':\n $DBrows = $this->getTypoScriptFrontendController()->sys_page->getRecordsByField($this->theTable, $theField, $this->dataArr[$theField], '', '', '', '1');\n if ($DBrows) {\n if (!$recExist || $DBrows[0]['uid'] != $this->dataArr['uid']) {\n // Only issue an error if the record is not existing (if new...) and if the record with the false value selected was not our self.\n $tempArr[] = $theField;\n $this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, 'The value existed already. Enter a new value.');\n }\n }\n break;\n case 'uniqueLocal':\n $DBrows = $this->getTypoScriptFrontendController()->sys_page->getRecordsByField($this->theTable, $theField, $this->dataArr[$theField], 'AND pid IN ('.$recordTestPid.')', '', '', '1');\n if ($DBrows) {\n if (!$recExist || $DBrows[0]['uid'] != $this->dataArr['uid']) {\n // Only issue an error if the record is not existing (if new...) and if the record with the false value selected was not our self.\n $tempArr[] = $theField;\n $this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, 'The value existed already. Enter a new value.');\n }\n }\n break;\n case 'twice':\n if (strcmp($this->dataArr[$theField], $this->dataArr[$theField.'_again'])) {\n $tempArr[] = $theField;\n $this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, 'You must enter the same value twice');\n }\n break;\n case 'email':\n if (!GeneralUtility::validEmail($this->dataArr[$theField])) {\n $tempArr[] = $theField;\n $this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, 'You must enter a valid email address');\n }\n break;\n case 'required':\n if (!trim($this->dataArr[$theField])) {\n $tempArr[] = $theField;\n $this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, 'You must enter a value!');\n }\n break;\n case 'atLeast':\n $chars = intval($cmdParts[1]);\n if (strlen($this->dataArr[$theField]) < $chars) {\n $tempArr[] = $theField;\n $this->failureMsg[$theField][] = sprintf($this->getFailure($theField, $theCmd, 'You must enter at least %s characters!'), $chars);\n }\n break;\n case 'atMost':\n $chars = intval($cmdParts[1]);\n if (strlen($this->dataArr[$theField]) > $chars) {\n $tempArr[] = $theField;\n $this->failureMsg[$theField][] = sprintf($this->getFailure($theField, $theCmd, 'You must enter at most %s characters!'), $chars);\n }\n break;\n case 'inBranch':\n $pars = explode(';', $cmdParts[1]);\n if (intval($pars[0])) {\n $pid_list = $this->cObj->getTreeList(\n intval($pars[0]),\n intval($pars[1]) ? intval($pars[1]) : 999,\n intval($pars[2])\n );\n if (!$pid_list || !GeneralUtility::inList($pid_list, $this->dataArr[$theField])) {\n $tempArr[] = $theField;\n $this->failureMsg[$theField][] = sprintf($this->getFailure($theField, $theCmd, 'The value was not a valid valud from this list: %s'), $pid_list);\n }\n }\n break;\n case 'unsetEmpty':\n if (!$this->dataArr[$theField]) {\n $hash = array_flip($tempArr);\n unset($hash[$theField]);\n $tempArr = array_keys($hash);\n unset($this->failureMsg[$theField]);\n // This should prevent the field from entering the database.\n unset($this->dataArr[$theField]);\n }\n break;\n }\n }\n $this->markerArray['###EVAL_ERROR_FIELD_'.$theField.'###'] = is_array($this->failureMsg[$theField]) ? implode('<br />', $this->failureMsg[$theField]) : '';\n }\n $tempArr[] = $this->checkCaptcha();\n }\n\n $this->failure = implode(',', $tempArr); //$failure will show which fields were not OK\n }",
"private function performChecks($params){\n \n $isNumber = true;\n //method that checks if variables have values if not set to defualts\n \n self::check_presence($params);\n \n $paramsInt = array($params[\"x\"], $params[\"number\"] );\n \n $has_query = self::check_query_string($params);\n \n if($has_query){\n // perform search?? probably not here\n } else {\n // do something maybe??\n }\n \n foreach ($paramsInt as $value){//test if any value is not a number \n if (!is_numeric($value)){\n return false;\n } \n }\n return $isNumber;\n }",
"public function getValidValues();",
"public function possibleValidValues();",
"abstract protected function hasValue();",
"private function validateValues()\n {\n if ($this->getNumberOfValues() === 0) {\n throw new \\Exception(\"Please supply a range of numbers\");\n }\n\n \\array_walk($this->numbers, function($value){\n\n if (!\\is_numeric($value)) {\n throw new \\Exception(\"All values need to be a number\");\n }\n\n });\n }",
"function valcheck($id)\r\n { \r\n global $rightdata3;\r\n if(in_array($id,$rightdata3))\r\n return 0;\r\n else\r\n\treturn 1;\t \r\n }",
"public function check_option_value()\n {\n // beacasue values of select tag can be change by the developer mode.\n // those changed values instead of original values can be sent to process and can be easly stored in database.\n // so this is also very important step to see.\n // this step is mainly for hackers or other users who have malicious intension.\n\n foreach ($this->properties as $property) {\n //checking constant is defined or NOT\n if (defined(\"self::\" . $this->combine[$property])) {\n // $set will be an array\n $set = constant(\"self::\".$this->combine[$property]);\n if (has_exclusion_of($this->$property, $set, $case_insensitive=false)) {\n $this->errors[] = \"'\".$this->$property.\"'\" .' is not valid value for ' . ucfirst($property);\n }\n } elseif($property == 'YearOfPassing'){\n $set = $this->combine[$property];\n $set = $this->$set; // $set will be an array\n if (has_exclusion_of($this->$property, $set, $case_insensitive=false)) {\n $this->errors[] = \"'\".$this->$property.\"'\" .' is not valid value for ' . ucfirst($property);\n }\n \n } //elseif\n } //foreach\n }",
"public function check_option_value()\n {\n // beacasue values of select tag can be change by the developer mode.\n // those changed values instead of original values can be sent to process and can be easly stored in database.\n // so this is also very important step to see.\n // this step is mainly for hackers or other users who have malicious intension.\n\n foreach ($this->properties as $property) {\n //checking constant is defined or NOT\n if (defined(\"self::\" . $this->combine[$property])) {\n // $set will be an array\n $set = constant(\"self::\".$this->combine[$property]);\n if (has_exclusion_of($this->$property, $set, $case_insensitive=false)) {\n $this->errors[] = \"'\".$this->$property.\"'\" .' is not valid value for ' . ucfirst($property);\n }\n } //if\n } //foreach\n }",
"function check_unit($data = array()){\n $unit_import = isset($data['usp_unit_import'])? intval($data['usp_unit_import']) : 0;\n $unit = isset($data['usp_unit'])? intval($data['usp_unit']) : 0;\n $specifi = isset($data['usp_specifi'])? intval($data['usp_specifi']) : 1;\n \n if($unit > 0 && $unit_import == 0) return 0;\n if($unit == 0) return 0;\n if($unit_import == 0 && $unit == 0) return 0;\n if($unit_import == 0) return 0;\n if($unit_import == $unit && $specifi > 1) return 0;\n \n return 1;\n}",
"protected function check(){\n\n\tforeach ($this->rules as $input => $rules) {\n\t\tfor($i = 0; $i < count($rules); $i++){\n\t\t\tif(strpos($rules[$i], ':') == true){\n\t\t\t\t$method = Str::findBefore($rules[$i], ':');\n\t\t\t\t$param = Str::findAfter($rules[$i], ':');\n\t\t\t\t$this->results[] = call_user_func(array($this, $method), $input, $this->values[$input], $param);\n\t\t\t} else {\n\t\t\t\t$this->results[] = call_user_func(array($this, $rules[$i]), $input, $this->values[$input]);\n\t\t\t}\n\t\t}\n\t}\n\n}",
"static function isValidValue()\n {\n }",
"public function executeValueModifierInvalidDataProvider() : array {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test Update Contract Paid And Rest Updates Contracts Paid And Rest | public function update_contract_paid_and_rest_updates_contracts_paid_and_rest()
{
$paid = self::$contract->value_euro/4;
$rest = self::$contract->value - $paid;
$this->assertEquals(
self::$contract->update_contract_paid_and_rest(self::$contract, $paid, $rest),
self::$contract->update(['paid' => $paid, 'rest' => $rest])
);
} | [
"public function testUpdateContract()\n {\n $contract = $this->_getContract();\n $contractData = $this->_instance->saveContract($contract->toArray());\n $contractData = $this->_instance->getContract($contractData['id']);\n\n // add account and contact + update contract\n $contractData['relations'] = $this->_getRelations();\n\n //print_r($contractData);\n\n $contractUpdated = $this->_instance->saveContract($contractData);\n\n //print_r($contractUpdated);\n\n // check\n $this->assertEquals($contractData['id'], $contractUpdated['id']);\n $this->assertGreaterThan(0, count($contractUpdated['relations']));\n $this->assertEquals('Addressbook_Model_Contact', $contractUpdated['relations'][0]['related_model']);\n $this->assertEquals(Sales_Model_Contract::RELATION_TYPE_CUSTOMER, $contractUpdated['relations'][0]['type']);\n $this->assertEquals(Tinebase_Core::getUser()->getId(), $contractUpdated['relations'][1]['related_id']);\n $this->assertEquals(Sales_Model_Contract::RELATION_TYPE_ACCOUNT, $contractUpdated['relations'][1]['type']);\n\n // cleanup\n $this->_instance->deleteContracts($contractData['id']);\n Addressbook_Controller_Contact::getInstance()->delete($contractUpdated['relations'][0]['related_id']);\n $this->_decreaseNumber();\n }",
"public function testCurrencyPATCHRequestCurrencyIDUpdate()\n {\n }",
"public function testLandedCostBookInPATCHRequestBookInIDUpdate()\n {\n }",
"public function testCustomerContractPutBycontractId()\n {\n }",
"public function testCreditorPATCHRequestCreditorIDUpdate()\n {\n }",
"public function testApiUpdateAccount()\n {\n /**\n * Create one account\n */\n $data = factory(\\App\\Account::class)->create();\n\n $toUpdate = ['title' => 'Conta do Rafael'];\n\n\n /**\n * Makes a PUT request to /api/accounts/{id} passing data to update\n */\n $response = $this->json('PUT', '/api/accounts/' . $data->id, $toUpdate);\n\n /**\n * Checks if HTTP status code of request is 200\n * and if response has a JSON as $data\n */\n $response->assertStatus(200)\n ->assertJson($toUpdate);\n }",
"public function testCrceOnlinePaymentUpdatePlan()\n {\n\n }",
"public function testUpdatePay()\n {\n $this->json('PUT', '/booking/12/pay')\n ->seeJsonEquals([\n 'created' => true,\n ]);\n }",
"public function test_can_update_payment()\n { \n $data = $this->paymentDataHelper(); \n $payment = $this->postJson('v1/payment', $data);\n $payment = Payment::first();\n \n $response = $this->json('PATCH', 'v1/payment/'.$payment->id, $data); \n $response->assertStatus(200)\n ->assertJson([\n 'success' => true,\n ]); \n }",
"public function testV1UpdateFee()\n {\n\n }",
"public function testPaymentsUpdate()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testQuarantineUpdateAll()\n {\n\n }",
"public function testInventoryPATCHRequestInventoryIDUpdate()\n {\n }",
"public function testOrderUpdate()\n {\n $response = $this->json('PATCH', '/orders/5',\n ['status' => 'TAKEN']\n );\n\n $response->assertStatus(200);\n }",
"public function testCashInvoicesPost()\n {\n }",
"public function testUpdatePayrun()\n {\n }",
"public function testPaymentAddPut()\n {\n }",
"public function testInventoryUpSellPATCHRequestInventoryIDUpSellsUpSellIDUpdate()\n {\n }",
"public function testPurchaseInvoiceLinePATCHRequestPurchaseInvoiceIDLinesPurchaseInvoiceLineIDUpdate()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Restore the specified snapshot to the virtual machine. Any data already on the virtual machine will be lost. | public function restoreSnapshot($params = [])
{
return $this->api->apiRequest(
'/instances/' . ($params['instance-id'] ?? '') . '/restore',
['snapshot_id' => $params['snapshot_id'] ?? ''],
'POST'
);
} | [
"private function VMRestoreSnapshot($snapshotName)\n\t{\n\t\tif (!$this->isVM()) return(false);\n\n\t\tAUTOTEST_VM_restoreSnapshot(VM_NAME, $snapshotName);\n\t}",
"function restore(Snap $snap);",
"public function restoreVolumeSnapshot($volumeSnapshot, RestoreVolumeSnapshotRequest $postBody, $optParams = [])\n {\n $params = ['volumeSnapshot' => $volumeSnapshot, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('restoreVolumeSnapshot', [$params], Operation::class);\n }",
"public function revert_vm($ip, $path, $snapshot) {\n\t \t$path = str_replace('\\\\', '/', $path);\n\t \t//$path = 'C:/labs/AL1/vm/viper24vm1.vmx';\n\t \t$path = str_replace('\\\\', '/', trim($path));\n\t \t$dropins_dir = '/cygdrive/c/labmgr-wd/dropins/revert.gui-command';\n\t \t$command = 'vmrun -T ws revertToSnapshot \"'.$path. '\" \"'.$snapshot. '\"';\n\t \t\n\t \t$file = './uploads/revert'.uniqid().'.gui-command';\n\t \tfile_put_contents($file, $command);\n\t \t/*echo \"Sending revert vm command to: \".$ip;\n\n\t \techo \"<br>Cert: \" . FCPATH . 'certs/labmgr';\n\t \techo \"<br>Command: \" . $command;\n\t \treturn shell_exec('scp -i ./certs/labmgr '.$file.' IBM_USER@' . $ip. ':/cygdrive/c/labmgr-wd/dropins/');\n\t \t*/\n\t \t$output = array(\n\t \t\t'status' => \"Sending revert vm command to: \".$ip,\n\t \t\t'output' => shell_exec('scp -i ./certs/labmgr -o StrictHostKeyChecking=no -o ConnectTimeout=1 '.$file.' IBM_USER@' . $ip. ':/cygdrive/c/labmgr-wd/dropins/'),\n\t \t\t'cmd' => $command,\n\t \t\t'exit_status' => ''\n \t\t);\n \t\tunlink($file);\n\t \treturn $output;\n\t }",
"public function restored(Reservation $reservation)\n {\n //\n }",
"public function restore( $snapshot ) {\n\t\tglobal $wpdb;\n\n\t\t// Get the contents of the snapshot file.\n\t\t$data = $this->read_from_file( $snapshot );\n\t\tif ( empty( $data ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Decode the snapshot data to an PHP object.\n\t\t$data = json_decode( $data, true );\n\t\tif ( empty( $data ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// The restore-process is handled as execution transaction.\n\t\t$this->clear();\n\n\t\t// Options\n\t\tif ( ! empty( $data['options'] ) && is_array( $data['options'] ) ) {\n\t\t\t$sql_delete = \"DELETE FROM {$wpdb->options} WHERE option_name IN \";\n\t\t\t$sql_idlist = array();\n\t\t\t$sql_insert = \"INSERT INTO {$wpdb->options} (option_name, option_value) VALUES \";\n\t\t\t$sql_values = array();\n\n\t\t\tforeach ( $data['options'] as $key => $value ) {\n\t\t\t\t$sql_idlist[] = $wpdb->prepare( '%s', $key );\n\t\t\t\t$sql_values[] = $wpdb->prepare( '(%s,%s)', $key, maybe_serialize( $value ) );\n\t\t\t}\n\n\t\t\tif ( ! empty( $sql_values ) ) {\n\t\t\t\t$this->add( $sql_delete . '(' . implode( ',', $sql_idlist ) . ')' );\n\t\t\t\t$this->add( $sql_insert . implode( \",\\n\", $sql_values ) );\n\t\t\t}\n\t\t}\n\n\t\t// Posts\n\t\tif ( ! empty( $data['posts'] ) && is_array( $data['posts'] ) ) {\n\t\t\tforeach ( $data['posts'] as $posttype => $items ) {\n\t\t\t\t$sql_delete_post = \"DELETE FROM {$wpdb->posts} WHERE ID IN \";\n\t\t\t\t$sql_delete_meta = \"DELETE FROM {$wpdb->postmeta} WHERE post_id IN \";\n\t\t\t\t$sql_idlist = array();\n\t\t\t\t$sql_insert = \"INSERT INTO {$wpdb->posts} (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_content_filtered, post_parent, guid, menu_order, post_type, post_mime_type, comment_count) VALUES \";\n\t\t\t\t$sql_values = array();\n\n\t\t\t\tforeach ( $items as $id => $post ) {\n\t\t\t\t\tself::$core->array->equip(\n\t\t\t\t\t\t$post,\n\t\t\t\t\t\t'post_author',\n\t\t\t\t\t\t'post_date',\n\t\t\t\t\t\t'post_date_gmt',\n\t\t\t\t\t\t'post_content',\n\t\t\t\t\t\t'post_title',\n\t\t\t\t\t\t'post_excerpt',\n\t\t\t\t\t\t'post_status',\n\t\t\t\t\t\t'comment_status',\n\t\t\t\t\t\t'ping_status',\n\t\t\t\t\t\t'post_password',\n\t\t\t\t\t\t'post_name',\n\t\t\t\t\t\t'to_ping',\n\t\t\t\t\t\t'pinged',\n\t\t\t\t\t\t'post_modified',\n\t\t\t\t\t\t'post_modified_gmt',\n\t\t\t\t\t\t'post_content_filtered',\n\t\t\t\t\t\t'post_parent',\n\t\t\t\t\t\t'guid',\n\t\t\t\t\t\t'menu_order',\n\t\t\t\t\t\t'post_type',\n\t\t\t\t\t\t'post_mime_type',\n\t\t\t\t\t\t'comment_count'\n\t\t\t\t\t);\n\t\t\t\t\t$sql_idlist[] = $wpdb->prepare( '%s', $id );\n\t\t\t\t\t$sql_values[] = $wpdb->prepare(\n\t\t\t\t\t\t'(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)',\n\t\t\t\t\t\t$id,\n\t\t\t\t\t\t$post['post_author'],\n\t\t\t\t\t\t$post['post_date'],\n\t\t\t\t\t\t$post['post_date_gmt'],\n\t\t\t\t\t\t$post['post_content'],\n\t\t\t\t\t\t$post['post_title'],\n\t\t\t\t\t\t$post['post_excerpt'],\n\t\t\t\t\t\t$post['post_status'],\n\t\t\t\t\t\t$post['comment_status'],\n\t\t\t\t\t\t$post['ping_status'],\n\t\t\t\t\t\t$post['post_password'],\n\t\t\t\t\t\t$post['post_name'],\n\t\t\t\t\t\t$post['to_ping'],\n\t\t\t\t\t\t$post['pinged'],\n\t\t\t\t\t\t$post['post_modified'],\n\t\t\t\t\t\t$post['post_modified_gmt'],\n\t\t\t\t\t\t$post['post_content_filtered'],\n\t\t\t\t\t\t$post['post_parent'],\n\t\t\t\t\t\t$post['guid'],\n\t\t\t\t\t\t$post['menu_order'],\n\t\t\t\t\t\t$post['post_type'],\n\t\t\t\t\t\t$post['post_mime_type'],\n\t\t\t\t\t\t$post['comment_count']\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\twhile ( ! empty( $sql_idlist ) ) {\n\t\t\t\t\t$values = array();\n\t\t\t\t\tfor ( $i = 0; $i < 100; $i += 1 ) {\n\t\t\t\t\t\tif ( empty( $sql_idlist ) ) { break; }\n\t\t\t\t\t\t$values[] = array_shift( $sql_idlist );\n\t\t\t\t\t}\n\t\t\t\t\t$this->add( $sql_delete_post . '(' . implode( ',', $values ) . ')' );\n\t\t\t\t\t$this->add( $sql_delete_meta . '(' . implode( ',', $values ) . ')' );\n\t\t\t\t}\n\t\t\t\twhile ( ! empty( $sql_values ) ) {\n\t\t\t\t\t$values = array();\n\t\t\t\t\tfor ( $i = 0; $i < 100; $i += 1 ) {\n\t\t\t\t\t\tif ( empty( $sql_values ) ) { break; }\n\t\t\t\t\t\t$values[] = array_shift( $sql_values );\n\t\t\t\t\t}\n\t\t\t\t\t$this->add( $sql_insert . implode( \",\\n\", $values ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Postmeta\n\t\tif ( ! empty( $data['postmeta'] ) && is_array( $data['postmeta'] ) ) {\n\t\t\tforeach ( $data['postmeta'] as $posttype => $items ) {\n\t\t\t\tforeach ( $items as $id => $entries ) {\n\t\t\t\t\t$sql_meta = \"INSERT INTO {$wpdb->postmeta} (post_id,meta_key,meta_value) VALUES \";\n\t\t\t\t\t$sql_values = array();\n\n\t\t\t\t\tforeach ( $entries as $key => $value ) {\n\t\t\t\t\t\t$sql_values[] = $wpdb->prepare( '(%s,%s,%s)', $id, $key, $value );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! empty( $sql_values ) ) {\n\t\t\t\t\t\t$this->add( $sql_meta . implode( \",\\n\", $sql_values ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Run all scheduled queries\n\t\tforeach ( $this->commands as $key => $params ) {\n\t\t\tif ( ! isset( $params[0] ) ) { continue; }\n\t\t\t$query = $params[0];\n\n\t\t\t$res = $wpdb->query( $query );\n\t\t}\n\n\t\treturn true;\n\t}",
"public function restored(Camera $camera)\n {\n //\n }",
"public function restored(ReservationPayment $ReservationPayment)\n {\n //\n }",
"public function takeSnapshot($args, &$response) {\r\n\r\n\t\t// Connect to vboxwebsrv\r\n\t\t$this->__vboxwebsrvConnect();\r\n\r\n\t\t$m = $this->__getMachineRef($args['vm']);\r\n\t\t$state = (string)$m->sessionState;\r\n\t\t$m->releaseRemote();\r\n\r\n\t\t$progress = $session = null;\r\n\r\n\t\ttry {\r\n\r\n\t\t\t// VRDP is not supported in OSE\r\n\t\t\t$version = $this->getVersion();\r\n\t\t\t$sessionType = ($version['ose'] ? 'headless' : 'vrdp');\r\n\r\n\t\t\t// Open session to machine\r\n\t\t\t$session = &$this->websessionManager->getSessionObject($this->vbox);\r\n\t\t\tif($state == 'Closed') $this->vbox->openSession($session, $args['vm']);\r\n\t\t\telse $this->vbox->openExistingSession($session, $args['vm'], $sessionType, '');\r\n\r\n\t\t\t$progress = $session->console->takeSnapshot($args['name'],$args['description']);\r\n\r\n\t\t\t// Does an exception exist?\r\n\t\t\ttry {\r\n\t\t\t\tif((string)$progress->errorInfo) {\r\n\t\t\t\t\t$this->errors[] = new Exception($progress->errorInfo->text);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception $null) {}\r\n\r\n\t\t\t$this->__storeProgress($progress,array('__getMachine'.$args['vm'],'getMediums','__getStorageControllers'.$args['vm']));\r\n\r\n\t\t} catch (Exception $e) {\r\n\r\n\t\t\t$this->errors[] = $e;\r\n\r\n\t\t\t$response['data']['error'][] = $e->getMessage();\r\n\t\t\t$response['data']['progress'] = (string)$progress;\r\n\t\t\t$response['data']['result'] = 0;\r\n\r\n\t\t\tif(!(string)$progress && (string)$session) {\r\n\t\t\t\ttry{$session->close();}catch(Exception $e){}\r\n\t\t\t}\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$response['data']['progress'] = (string)$progress;\r\n\t\treturn ($response['data']['result'] = 1);\r\n\t}",
"public function recoverSnapshot()\n {\n $this->queueEntries = $this->queueEntriesBackup;\n }",
"public function restored(Vehicle $vehicle)\n {\n //\n }",
"private function restore()\n\t{\n\t\t// get the db module - not needed but will prevent restore for\n\t\t// suites that don't use Db\n\t try {\n\t $this->_db = $this->getModule('Db');\n\t } catch (\\Exception $e) {\n\t return;\n\t }\n\n\t\t$this->writeln('Laxative: Restoring your database from backup...');\n\n\t\t// use pg_restore to restore from our binary backup\n\t\t$command = sprintf('pg_restore -h %s -U %s -d %s -c %s',\n\t\t\t$this->_host,\n\t\t\t'postgres',\n\t\t\t$this->_database,\n\t\t\t$this->_backupPath);\n\n\t\texec($command);\n\n\t\t$this->writeln('Done.');\n\t}",
"public function restored(Photo $photo)\n {\n //\n }",
"public function restored(Household $household)\n {\n //\n }",
"public function restore();",
"public function restored(Remission $remission)\n {\n //\n }",
"public function restored(Review $review)\n {\n //\n }",
"public function restored(Reserva $reserva)\n {\n //\n }",
"public function takeSnapshot(): void\n {\n $this->snapshot = $this->unwrap()->toArray();\n $this->isDirty = false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[Validation Rule] Validate that a value is an IP address. | private function validateIp($attribute, $value)
{
return filter_var($value, FILTER_VALIDATE_IP) !== false;
} | [
"function validate_internal_ip_address($value) {\n if (!filter_var($value, FILTER_VALIDATE_IP)) {\n throw new Carbon_Validator_ValidationError(\"Please enter valid IP address. \");\n }\n $pieces = explode('.', $value);\n\n if (count($pieces) !== 4) {\n throw new Carbon_Validator_ValidationError(\"Your IP should have exactly 4 numbers. \");\n }\n\n if (intval($pieces[0]) !== 192 || intval($pieces[1]) !== 168) {\n throw new Carbon_Validator_ValidationError(\"Your IP address should start with 192.168 \");\n }\n\n return true;\n}",
"public function validateIp($attribute, $value)\n {\n return filter_var($value, FILTER_VALIDATE_IP) !== false;\n }",
"protected function _validateIp($field, $value) {\n\n\t\t\treturn filter_var($value, FILTER_VALIDATE_IP) !== false;\n\t\t}",
"protected function validateIp($attribute, $value)\n\t{\n\t\treturn filter_var($value, FILTER_VALIDATE_IP) !== false;\n\t}",
"protected function validateIp($attribute, $value)\n {\n return filter_var($value, FILTER_VALIDATE_IP) !== false;\n }",
"public function ip(string $value): bool\n {\n return filter_var($value, FILTER_VALIDATE_IP) !== false;\n }",
"public function checkIpAddress($value)\n {\n $log_level = error_reporting(0);\n $success = Val::stringable($value) && @inet_pton((string) $value) !== false;\n error_reporting($log_level);\n\n return new Result($success, '{name} must be a valid ip address');\n }",
"public function testIp()\n\t{\n\t\t$this->assertTrue(Validate::ip('192.168.0.1'));\n\n\t\t$this->assertFalse(Validate::ip('256.256.256.256'));\n\n\t\t$this->assertTrue(Validate::ip('684D:1111:222:3333:4444:5555:6:77', 'ipv6'));\n\n\t\t$this->assertFalse(Validate::ip('192.168.0.1', 'ipv6'));\n\n\t\t$this->assertFalse(Validate::ip('684D:1111:222:3333:4444:5555:6:77', 'ipv4'));\n\t}",
"function is_ipaddr_valid($val)\n{\n return is_string($val) && (is_ipaddr($val) || is_masksubnet($val) || is_subnet($val) || is_iprange_sg($val));\n}",
"public function testTheIPRule()\n\t{\n\t\t$input = array('ip' => '192.168.1.1');\n\t\t$rules = array('ip' => 'ip');\n\t\t$this->assertTrue(Validator::make($input, $rules)->valid());\n\n\t\t$input['ip'] = '192.111';\n\t\t$this->assertFalse(Validator::make($input, $rules)->valid());\n\t}",
"public function validateBindToIp()\n {\n if ($this->bind_to_ip) {\n $ips = explode(',', $this->bind_to_ip);\n\n foreach ($ips as $ip) {\n if (!filter_var(trim($ip), FILTER_VALIDATE_IP)) {\n $this->addError('bind_to_ip', Yii::t('app', \"Wrong format. Enter valid IPs separated by comma\"));\n }\n }\n }\n }",
"public function isIP($value)\n {\n return (boolean) filter_var($value, FILTER_VALIDATE_IP);\n }",
"public function testRuleIsIp(): void {\r\n\r\n //Should pass\r\n foreach(['::1', '192.168.1.1', '127.0.0.1', '1.1.1.1', '255.255.255.255', '2001:0db8:85a3:0000:0000:8a2e:0370:7334'] as $data) {\r\n\r\n $validator = new Validator(['field' => $data]);\r\n $validator -> field('field') -> isIp();\r\n $this -> assertTrue($validator -> passes());\r\n $this -> assertFalse($validator -> fails());\r\n }\r\n\r\n //Should fail\r\n foreach([null, (object) [], [], 'abcdef', true, '255.255.255.256', '20010:0db8:85a3:0000:0000:8a2e:0370:7334'] as $data) {\r\n \r\n $validator = new Validator(['field' => $data]);\r\n $validator -> field('field') -> isIp();\r\n $this -> assertFalse($validator -> passes());\r\n }\r\n\r\n //Should fail\r\n $validator = new Validator();\r\n $validator -> field('field') -> isIp();\r\n $this -> assertFalse($validator -> passes());\r\n }",
"function is_ipaddr($var) {\r\n\tif (!is_string($var))\r\n\t\treturn FALSE;\r\n\treturn filter_var($var, FILTER_VALIDATE_IP);\r\n}",
"public function test_valid_ip()\n\t{\n\t\t$name = 'test';\n\t\t$label = 'Test field';\n\t\t$params = array('label' => $label);\n\n\t\tself::$inst\n\t\t\t-> add($name, $label)\n\t\t\t-> add_rule('valid_ip');\n\n\t\t$this->assertFalse( self::$inst->run(array($name => 'localhost')) );\n\n\t\t$expected = array( $name => \\Lang::get('validation.valid_ip', $params, null, 'ja') );\n\t\t$actual = array_map(function($v){ return (string)$v; }, self::$inst->error());\n\t\t$this->assertEquals($expected, $actual);\n\t}",
"function validate_ip( $ip ) {\n if( filter_var( $ip, FILTER_VALIDATE_IP, \n FILTER_FLAG_IPV4 |\n FILTER_FLAG_NO_PRIV_RANGE |\n FILTER_FLAG_NO_RES_RANGE \n ) === false ) {\n return false;\n } else {\n return true;\n }\n}",
"function validateIpAddress($ip_addr)\n{\n //first of all the format of the ip address is matched\n if(preg_match(\"/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/\",$ip_addr))\n {\n //now all the intger values are separated\n $parts=explode(\".\",$ip_addr);\n //now we need to check each part can range from 0-255\n foreach($parts as $ip_parts)\n {\n if(intval($ip_parts)>255 || intval($ip_parts)<0)\n return false; //if number is not within range of 0-255\n }\n return true;\n }\n else\n return false; //if format of ip address doesn't matches\n}",
"public static function validIpDataProvider() {}",
"public static function filterIp($attrValue)\n\t{\n\t\treturn filter_var($attrValue, FILTER_VALIDATE_IP);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Whether the remainder is blank | public function isBlank(): bool
{
return $this->nextNonSpaceCache === $this->length || $this->getNextNonSpacePosition() === $this->length;
} | [
"function is_empty($chaine){\r\n if(long_chaine($chaine)==0){\r\n return true;\r\n }\r\n return false;\r\n}",
"function filled($value) {\n\t\treturn !blank($value);\n\t}",
"protected function getIsNullOrEmpty()\r\n\t\t{\r\n\t\t\treturn $this->length == 0;\r\n\t\t}",
"function is_blank($value) {\n\t\t\n\t\treturn empty($value) && !is_numeric($value);\n\t\t\n\t}",
"function filled($value)\n {\n return !blank($value);\n }",
"public function isBlank()\n {\n return ($this->trim()->_string === '');\n }",
"public function is_empty()\r\n\t{\r\n\t\treturn substr($this->type(), 0, 6) == 'empty-';\r\n\t}",
"private function isEmpty(): bool\n {\n $data = $this->value;\n if (is_numeric($data)) {\n return false;\n }\n return empty(is_string($data) ? trim($data) : $data);\n }",
"function isBlank($value){\n return $value == \"\";\n }",
"public function empty()\n {\n return $this->length() === 0;\n }",
"function not_empty($var)\n{\n\treturn ! empty($var) || $var === 0 || $var === '0';\n}",
"private function checkIfAnyEmptyBox() : bool {\n $empty = false;\n foreach ($this->board as $key => $value) {\n if($value[\"A\"] == \"\" || $value[\"B\"] == \"\" || $value[\"C\"] == \"\" ){\n $empty = true;\n break;\n }\n }\n return $empty;\n }",
"function _mash_check_not_empty($string)\n{\n $string = str_replace(\" \",\"\",$string);\n $string = trim($string);\n return (isset($string) && strlen($string)); // var is set and not an empty string ''\n}",
"public function isEmpty()\n\t{\n\t\treturn $this->counter === 0;\n\t}",
"public function isEmpty() {\n\t\treturn $this->rawString === '';\n\t}",
"function is_blank($string){\n\t\t// is_blank return true on: \"\", \" \", false\n\t\treturn (!isset($string) || trim($string) ==='');\n\t}",
"function is_nothing_empty($nothing) {\n if (empty($nothing)) {\n return \"\\$nothing is EMPTY\" . PHP_EOL;\n } \n}",
"private function isCurrentLineBlank()\n {\n return '' == trim($this->currentLine, ' ');\n }",
"function number_empty($value)\n{\n return empty($value) && $value != '0';\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'getInvoiceWorksheetFiles' | protected function getInvoiceWorksheetFilesRequest($invoice_worksheet_id)
{
// verify the required parameter 'invoice_worksheet_id' is set
if ($invoice_worksheet_id === null) {
throw new \InvalidArgumentException(
'Missing the required parameter $invoice_worksheet_id when calling getInvoiceWorksheetFiles'
);
}
$resourcePath = '/beta/invoiceWorksheet/{invoiceWorksheetId}/file';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($invoice_worksheet_id !== null) {
$resourcePath = str_replace(
'{' . 'invoiceWorksheetId' . '}',
ObjectSerializer::toPathValue($invoice_worksheet_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
$httpBody = $_tempBody;
// \stdClass has no __toString(), so we should encode it manually
if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($httpBody);
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('API-Key');
if ($apiKey !== null) {
$headers['API-Key'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"protected function getReceivingWorksheetFilesRequest($receiving_worksheet_id)\n {\n // verify the required parameter 'receiving_worksheet_id' is set\n if ($receiving_worksheet_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $receiving_worksheet_id when calling getReceivingWorksheetFiles'\n );\n }\n\n $resourcePath = '/beta/receivingWorksheet/{receivingWorksheetId}/file';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($receiving_worksheet_id !== null) {\n $resourcePath = str_replace(\n '{' . 'receivingWorksheetId' . '}',\n ObjectSerializer::toPathValue($receiving_worksheet_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function GetListFilesRequest(Requests\\GetListFilesRequest $request)\n {\n\n $resourcePath = '/storage/folder';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = \"\";\n $multipart = false;\n \n\n // query params\n if ($request->path !== null) {\n $localName = lcfirst('path');\n $localValue = is_bool($request->path) ? ($request->path ? 'true' : 'false') : $request->path;\n if (strpos($resourcePath, '{' . $localName . '}') !== false) {\n $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath);\n } else {\n $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue);\n }\n }\n // query params\n if ($request->storage !== null) {\n $localName = lcfirst('storage');\n $localValue = is_bool($request->storage) ? ($request->storage ? 'true' : 'false') : $request->storage;\n if (strpos($resourcePath, '{' . $localName . '}') !== false) {\n $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath);\n } else {\n $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue);\n }\n }\n \n \n $resourcePath = $this->_parseURL($resourcePath, $queryParams);\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n // for HTTP post (form)\n $httpBody = $formParams[\"file\"];\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = $formParams[\"data\"];\n }\n }\n \n $this->_requestToken();\n\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent();\n }\n \n $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion();\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n \n $req = new Request(\n 'GET',\n $this->config->getHost() . $resourcePath,\n $headers,\n $httpBody\n );\n if ($this->config->getDebug()) {\n $this->_writeRequestLog('GET', $this->config->getHost() . $resourcePath, $headers, $httpBody);\n }\n \n return $req;\n }",
"protected function editDocumentXlsxGetWorksheetsRequest($input)\n {\n // verify the required parameter 'input' is set\n if ($input === null || (is_array($input) && count($input) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $input when calling editDocumentXlsxGetWorksheets'\n );\n }\n\n $resourcePath = '/convert/edit/xlsx/get-worksheets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($input)) {\n $_tempBody = $input;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Apikey');\n if ($apiKey !== null) {\n $headers['Apikey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getFilesListRequest(Model\\GetFilesListRequest $request)\n {\n // verify the required parameter 'path' is set\n if ($request->path === null) {\n throw new InvalidArgumentException(\n 'Missing the required parameter $path when calling getFilesList'\n );\n }\n\n $resourcePath = '/email/storage/folder/{path}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $multipart = false;\n\n // path params\n if ($request->path !== null) {\n $localName = lcfirst('path');\n $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->path), $resourcePath);\n }\n\n // query params\n $paramValue = $request->storage_name;\n $paramBaseName = 'storageName';\n $this->processQueryParameter($paramValue, $paramBaseName, $queryParams, $resourcePath);\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n return $this->toClientRequest(\n 'GET',\n null,\n $resourcePath,\n $queryParams,\n $formParams,\n [],\n $multipart,\n $headers,\n $headerParams\n );\n }",
"protected function convertDocumentXlsToXlsxRequest($input_file)\n {\n // verify the required parameter 'input_file' is set\n if ($input_file === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $input_file when calling convertDocumentXlsToXlsx'\n );\n }\n\n $resourcePath = '/convert/xls/to/xlsx';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // form params\n if ($input_file !== null) {\n $multipart = true;\n $formParams['inputFile'] = \\GuzzleHttp\\Psr7\\try_fopen(ObjectSerializer::toFormValue($input_file), 'rb');\n }\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/octet-stream']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/octet-stream'],\n ['multipart/form-data']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Apikey');\n if ($apiKey !== null) {\n $headers['Apikey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function restStorageFrontendFilesGetRequest($continuation_token = null)\n {\n\n $resourcePath = '/rest/storage/frontend/files';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($continuation_token)) {\n $continuation_token = ObjectSerializer::serializeCollection($continuation_token, '', true);\n }\n if ($continuation_token !== null) {\n $queryParams['continuationToken'] = $continuation_token;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public static function getFilesListRequest()\n {\n return new GetFilesListRequestBuilder(new GetFilesListRequest());\n }",
"protected function userfilesGetRequest()\n {\n\n $resourcePath = '/userfiles';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('cbrain_api_token');\n if ($apiKey !== null) {\n $queryParams['cbrain_api_token'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function upcomingInvoicesRequest()\n {\n\n $resourcePath = '/v2/billing/invoices/upcoming';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getUserPendingInvitationsRequest($offset = '0', $limit = '25')\n {\n\n $resourcePath = '/api/v1/envelope/invitations';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($offset !== null) {\n $queryParams['offset'] = ObjectSerializer::toQueryValue($offset, 'int32');\n }\n // query params\n if ($limit !== null) {\n $queryParams['limit'] = ObjectSerializer::toQueryValue($limit, 'int32');\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // // this endpoint requires Bearer token\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function inboundDocumentGetRequest($virtual_operator, $id, $include_pdf = null, $include_xml = null, $include_attachments = null)\n {\n // verify the required parameter 'virtual_operator' is set\n if ($virtual_operator === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $virtual_operator when calling inboundDocumentGet'\n );\n }\n if (strlen($virtual_operator) > 60) {\n throw new \\InvalidArgumentException('invalid length for \"$virtual_operator\" when calling InboundDocumentApi.inboundDocumentGet, must be smaller than or equal to 60.');\n }\n\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling inboundDocumentGet'\n );\n }\n\n $resourcePath = '/api/{virtualOperator}/inbounddocuments/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($include_pdf !== null) {\n $queryParams['includePdf'] = ObjectSerializer::toQueryValue($include_pdf);\n }\n // query params\n if ($include_xml !== null) {\n $queryParams['includeXml'] = ObjectSerializer::toQueryValue($include_xml);\n }\n // query params\n if ($include_attachments !== null) {\n $queryParams['includeAttachments'] = ObjectSerializer::toQueryValue($include_attachments);\n }\n\n // path params\n if ($virtual_operator !== null) {\n $resourcePath = str_replace(\n '{' . 'virtualOperator' . '}',\n ObjectSerializer::toPathValue($virtual_operator),\n $resourcePath\n );\n }\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function addInvoiceWorksheetLineFileRequest($invoice_worksheet_line_id, $file_name)\n {\n // verify the required parameter 'invoice_worksheet_line_id' is set\n if ($invoice_worksheet_line_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_worksheet_line_id when calling addInvoiceWorksheetLineFile'\n );\n }\n // verify the required parameter 'file_name' is set\n if ($file_name === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $file_name when calling addInvoiceWorksheetLineFile'\n );\n }\n\n $resourcePath = '/beta/invoiceWorksheetLine/{invoiceWorksheetLineId}/file/{fileName}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($invoice_worksheet_line_id !== null) {\n $resourcePath = str_replace(\n '{' . 'invoiceWorksheetLineId' . '}',\n ObjectSerializer::toPathValue($invoice_worksheet_line_id),\n $resourcePath\n );\n }\n // path params\n if ($file_name !== null) {\n $resourcePath = str_replace(\n '{' . 'fileName' . '}',\n ObjectSerializer::toPathValue($file_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function imageGetSupportedFileExtensionsRequest()\n {\n\n $resourcePath = '/api/image/ImageGetSupportedFileExtensions';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['text/plain', 'application/json', 'text/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['text/plain', 'application/json', 'text/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getFilesListRequest(Requests\\GetFilesListRequest $request)\n {\n\n $resourcePath = '/slides/storage/folder/{path}';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n\n // query params\n if ($request->storageName !== null) {\n $queryParams['storageName'] = ObjectSerializer::toQueryValue($request->storageName);\n }\n\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"path\", $request->path);\n $this->headerSelector->selectHeaders(\n $headerParams,\n ['application/json'],\n ['application/json']);\n\n return $this->createRequest($resourcePath, $queryParams, $headerParams, $httpBody, 'GET');\n }",
"protected function accountByPeriodInquiryPutFileRequest($ids, $filename)\n {\n // verify the required parameter 'ids' is set\n if ($ids === null || (is_array($ids) && count($ids) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $ids when calling accountByPeriodInquiryPutFile'\n );\n }\n // verify the required parameter 'filename' is set\n if ($filename === null || (is_array($filename) && count($filename) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $filename when calling accountByPeriodInquiryPutFile'\n );\n }\n\n $resourcePath = '/AccountByPeriodInquiry/{ids}/files/{filename}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if (is_array($ids)) {\n $ids = ObjectSerializer::serializeCollection($ids, 'pipes');\n }\n if ($ids !== null) {\n $resourcePath = str_replace(\n '{' . 'ids' . '}',\n ObjectSerializer::toPathValue($ids),\n $resourcePath\n );\n }\n // path params\n if ($filename !== null) {\n $resourcePath = str_replace(\n '{' . 'filename' . '}',\n ObjectSerializer::toPathValue($filename),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function editDocumentXlsxDeleteWorksheetRequest($req_config)\n {\n // verify the required parameter 'req_config' is set\n if ($req_config === null || (is_array($req_config) && count($req_config) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $req_config when calling editDocumentXlsxDeleteWorksheet'\n );\n }\n\n $resourcePath = '/convert/edit/xlsx/delete-worksheet';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($req_config)) {\n $_tempBody = $req_config;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/octet-stream']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/octet-stream'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Apikey');\n if ($apiKey !== null) {\n $headers['Apikey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function asFileRequest($request)\n {\n // verify the required parameter '$request' is set\n if ($request === null) {\n throw new InvalidArgumentException(\n 'Missing the required parameter $request when calling asFile'\n );\n }\n\n // body params\n if (is_string($request)) {\n $httpBody = \"\\\"\" . $request . \"\\\"\";\n } else {\n $httpBody = $request;\n }\n\n $headers = $this->headerSelector->selectHeaders(\n ['multipart/form-data'],\n ['application/json']\n );\n $path = '/email/Calendar/as-file';\n return $this->toClientRequest('PUT', $httpBody, $path, [], [], [], false, $headers, []);\n }",
"protected function invitationsSentRequest()\n {\n\n $resourcePath = '/v0.1/invitations/sent';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-API-Token');\n if ($apiKey !== null) {\n $headers['X-API-Token'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"private function getCallsFilesRequest(int $page = 0, int $size = 20): Request\n {\n $allData = [\n 'page' => $page,\n 'size' => $size,\n ];\n\n $validationConstraints = [];\n\n $this\n ->addParamConstraints(\n [\n 'page' => [\n new Assert\\GreaterThan(0),\n ],\n 'size' => [\n new Assert\\LessThan(100),\n new Assert\\GreaterThan(1),\n ],\n ],\n $validationConstraints\n );\n\n $this->validateParams($allData, $validationConstraints);\n\n $resourcePath = '/calls/1/files';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n\n // query params\n if ($page !== null) {\n $queryParams['page'] = $page;\n }\n\n // query params\n if ($size !== null) {\n $queryParams['size'] = $size;\n }\n\n $headers = [\n 'Accept' => 'application/json',\n\n ];\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n $formParams = \\json_decode($this->objectSerializer->serialize($formParams), true);\n\n if ($headers['Content-Type'] === 'multipart/form-data') {\n $boundary = '----' . hash('sha256', uniqid('', true));\n $headers['Content-Type'] .= '; boundary=' . $boundary;\n $multipartContents = [];\n\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = (\\is_array($formParamValue)) ? $formParamValue : [$formParamValue];\n\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents, $boundary);\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = $this->objectSerializer->serialize($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = Query::build($formParams);\n }\n }\n\n $apiKey = $this->config->getApiKey();\n\n if ($apiKey !== null) {\n $headers[$this->config->getApiKeyHeader()] = $apiKey;\n }\n\n $defaultHeaders = [];\n\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = \\array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n foreach ($queryParams as $key => $value) {\n if (\\is_array($value)) {\n continue;\n }\n\n $queryParams[$key] = $this->objectSerializer->toString($value);\n }\n\n $query = Query::build($queryParams);\n\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Relationship with Runs table. | public function runs(){
return $this->hasMany('\App\Run');
} | [
"public function runs() {\n \treturn $this->hasMany('App\\Run');\n }",
"public function runs() {\n \treturn $this->belongsToMany('App\\Run');\n }",
"public function runs()\n {\n return $this->belongsToMany(CoffeeRun::class,\n 'coffee_run_user_coffee', 'user_coffee_id', 'coffee_run_id'\n );\n }",
"public function runs()\n {\n return $this->hasManyThrough(MatchTeamPlayerRun::class,MatchTeamPlayerBatsMan::class,'match_team_id','match_team_player_bats_man_id');\n }",
"function get_runs()\n\t\t{\n\t\t\t$query = \"SELECT * FROM runs ORDER BY id DESC\";\n\t\t\t$results = $this->query($query);\n\t\t\twhile ( $row = $this->fetchassoc($results) )\n\t\t\t{\n\t\t\t\t$run = $row['id'];\n\t\t\t\t$this->runs_list[$run] = $row;\t\t\t\t\n\t\t\t}\n\t\t}",
"public function partner_runs()\n {\n return $this->hasManyThrough(MatchTeamPlayerRun::class,MatchTeamPlayerBatsMan::class,'match_team_id','partner_id');\n }",
"public function getRuns()\n {\n return $this->runs;\n }",
"public function runners()\n {\n return $this->belongsToMany('App\\Runner', 'race_runner', 'id_race', 'id_runner')->withPivot('start_time', 'finish_time');\n }",
"public function getRun(): Run\n {\n }",
"public function setRuns($val)\n {\n $this->_propDict[\"runs\"] = $val;\n return $this;\n }",
"public function run(): HasOne\n {\n return $this->hasOne(ScholarshipRun::class, 'version_id', 'version');\n }",
"public function getRunId()\n {\n return $this->RunId;\n }",
"public function train(){\n\t\t\n\t\treturn $this->belongsTo('Alsaudi\\\\Eloquent\\\\TrainRelation');\n\t}",
"function viewRunner(){\n $sql = \"select * from runner where runner_id=:runner_id\";\n $args = [':runner_id'=>$this->runner_id];\n return DB::run($sql,$args);\n }",
"public function entries()\n {\n return $this->hasMany(WorkflowEntry::class, 'week_id');\n }",
"public function trainers()\n {\n return $this->belongsToMany('App\\Trainer', 'trainers_pokedex_entries', 'pokedex_entry_id', 'trainer_id');\n }",
"public function trains(){\n\t\t\n\t\treturn $this->belongsToMany('Alsaudi\\\\Eloquent\\\\TrainRelation');\n\t}",
"public function train()\n {\n return $this->belongsTo(Train::class);\n }",
"public function setRunsTo($value)\n {\n $this->runsTo = $value;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove the specified CustomPageType from storage. | public function destroy($id)
{
$customPageType = $this->customPageTypeRepository->findWithoutFail($id);
if (empty($customPageType)) {
Flash::error('Custom Page Type not found');
return redirect(route('customPageTypes.index'));
}
$this->customPageTypeRepository->delete($id);
Flash::success('删除成功.');
return redirect(route('customPageTypes.index'));
} | [
"function Remove(){\n\t\tif($this->AuthUser->Role=='Demo'){ // handle demo mode\n\t\t\t$tojson = array (\n\t\t\t \"IsSuccessful\" => 'false',\n\t\t\t\t\"Error\" => 'Not available in demo mode'\n\t\t\t);\n\n\t\t\t// encode to json\n\t\t\t$encoded = json_encode($tojson);\n\n\t\t\tdie($encoded);\n\t\t}\n\n\t\t$pageTypeUniqId = $this->GetPostData(\"PageTypeUniqId\");\n\t\t\n\t\t$pageType = PageType::GetByPageTypeUniqId($pageTypeUniqId);\n\t\t\n\t\t$pageType->Delete();\n\t\t\n\t\t$tojson = array (\n\t\t 'IsSuccessful' => 'true',\n\t\t\t'Type' => $pageType->PageTypeUniqId,\n\t\t\t'Message' => 'Page type removed successfully'\n\t\t);\n\t\t\n\t\t// encode to json\n\t\t$encoded = json_encode($tojson);\n\t\t \n\t\tdie($encoded);\n\t}",
"public function remove(){\n\t\t$this->typeObject->remove();\n\t\t\n\t\t$this->db->reset();\n\t\t$this->db->where('page_id', $this->id);\n\t\t$this->db->delete('OPC_Page_components');\n\n\t\t$this->db->reset();\n\t\t$this->db->where('id', $this->id);\n\t\t$this->db->delete('OPC_Pages');\n\t}",
"function remove_by_type($type) {\n\t\t$db=openqrm_get_db_connection();\n\t\t$rs = $db->Execute(\"delete from $this->_db_table where deployment_type='$type'\");\n\t}",
"function removeType()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n // delete values\r\n $db->query( \"DELETE FROM eZMediaCatalogue_AttributeValue WHERE MediaID='$this->ID'\" );\r\n\r\n $db->query( \"DELETE FROM eZMediaCatalogue_TypeLink WHERE MediaID='$this->ID'\" );\r\n\r\n }",
"public static function remove($type = null)\n {\n if (is_null($type)) {\n self::$caches = array();\n } else {\n if (SzUtility::checkArrayKey($type, self::$caches)) {\n unset(self::$caches[$type]);\n }\n }\n }",
"public function removeExternalItem($type, $name) {\n parent::removeItem($type, $name);\n }",
"function removeType()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n // delete values\r\n $res[] = $db->query( \"DELETE FROM eZTrade_AttributeValue\r\n WHERE ProductID='$this->ID'\" );\r\n\r\n $res[] = $db->query( \"DELETE FROM eZTrade_ProductTypeLink\r\n WHERE ProductID='$this->ID'\" );\r\n eZDB::finish( $res, $db );\r\n\r\n }",
"function gs_unregister_post_type( $post_type, $slug = '' ){\n\t\n\tglobal $wp_post_types;\n\t\n\tif ( isset( $wp_post_types[ $post_type ] ) ) {\n unset( $wp_post_types[ $post_type ] );\n \t\n $slug = ( !$slug ) ? 'edit.php?post_type=' . $post_type : $slug;\n remove_menu_page( $slug );\n\t}\n}",
"function removeType()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n // delete values\r\n $db->query( \"DELETE FROM eZLink_AttributeValue WHERE LinkID='$this->ID'\" );\r\n\r\n $db->query( \"DELETE FROM eZLink_TypeLink WHERE LinkID='$this->ID'\" );\r\n\r\n }",
"public function deleting(Page $Page)\n {\n //code...\n }",
"public function delete_page() { \n \n if( wp_delete_post( $this->page_id, true ) ) :\n \n $this->page_id = null;\n \n endif;\n \n }",
"function ch5_hcf_remove_custom_fields_metabox() {\n\tremove_meta_box( 'postcustom', 'post', 'normal' );\n\tremove_meta_box( 'postcustom', 'page', 'normal' );\n}",
"private function removeAccountType()\n {\n $this->get('session')->remove('client.accounts.account_type');\n }",
"public function removeTypePaper(TypePaper $type)\r\n {\r\n }",
"public function deleting(Page $page)\n {\n //\n }",
"public function deleteById(string $customyCmsPageCounterId);",
"public function deleted(Page $page)\n {\n //\n }",
"function timetracking_type_delete(timetrackingType $type) {\n $type->delete();\n}",
"function customcert_delete_page($pageid) {\n global $DB;\n\n // Get the page.\n $page = $DB->get_record('customcert_pages', array('id' => $pageid), '*', MUST_EXIST);\n\n // Delete this page.\n $DB->delete_records('customcert_pages', array('id' => $page->id));\n\n // The element may have some extra tasks it needs to complete to completely delete itself.\n if ($elements = $DB->get_records('customcert_elements', array('pageid' => $page->id))) {\n foreach ($elements as $element) {\n // Get an instance of the element class.\n if ($e = customcert_get_element_instance($element)) {\n $e->delete_element();\n } else {\n // The plugin files are missing, so just remove the entry from the DB.\n $DB->delete_records('customcert_elements', array('id' => $element->id));\n }\n }\n }\n\n // Now we want to decrease the page number values of\n // the pages that are greater than the page we deleted.\n $sql = \"UPDATE {customcert_pages}\n SET pagenumber = pagenumber - 1\n WHERE customcertid = :customcertid\n AND pagenumber > :pagenumber\";\n $DB->execute($sql, array('customcertid' => $page->customcertid, 'pagenumber' => $page->pagenumber));\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The list of published articles | public function getArticlesList(); | [
"public function lists()\n\t\t{\n\t\t\t$conditions = array('Article.published' => 1);\n\t\t\t$this->set('articles', $this->Article->find('all', array('conditions' => $conditions)));\n\t\t}",
"public function getAllPublished();",
"public static function findAllPublished()\n {\n $query = Article::where('type', self::POST_ARTICLE)\n ->where('status', self::STATUS_PUBLISHED)\n ->orderBy('created_at', 'DESC');\n\n return $query->get();\n }",
"function getPublished() {\n $query = \"SELECT * FROM \".Article::TABLE_NAME.\" WHERE state=:state\";\n $articles = [];\n\n $db = getConnection();\n\n $stmt = $db->prepare($query);\n $stmt->execute(array(\":state\" => ArticleState::PUBLISHED));\n $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n foreach($rows as $row) {\n $a = new Article();\n $a->fill($row);\n $articles[] = $a;\n }\n\n $db = null;\n return $articles;\n }",
"public function getAllPublished()\n {\n return $this->cache->rememberForever('articles.published', function () {\n return $this->repository->getAllPublished();\n });\n }",
"public function list()\n {\n // Get all articles and return data\n return Article::paginate(5);\n }",
"public function getArticles()\n {\n return $this->articles;\n }",
"public function getArticles()\n {\n return $this->articles;\n }",
"public function getAll()\n {\n return $this->articles;\n }",
"public function listAction()\n {\n \t\n\n $articles = $this->getDoctrine()->getRepository('AppBundle:Article')->findAll();\n \n return $articles;\n }",
"public function getArticles()\n {\n return Db::queryAll('\n SELECT `article_id`, `title`, `url`, `description`\n FROM `article`\n ORDER BY `article_id` DESC\n ');\n }",
"public function index()\n {\n $articles = Article::latest('published_at')->published()->get();\n\n return view('articles.index', compact('articles'));\n\t}",
"public function getAllArticles(){\n\n\t\t$news = new NewsArticle;\n\n\t\t$articles = $news->getBlogArticles('blog', '1');\n\n\t\t// $randomNews=$news->FeaturedArticles(11);\n\n\t\tif(isset($articles) && $articles != ''){\n\t\t\tforeach($articles as $a){\n\t\t\t\t$a->timeAgo = $this->xTimeAgo($a->created_at, date(\"Y-m-d H:i:s\"));\n\t\t\t}\n\t\t}\n\n\t\treturn $articles;\n\n\t}",
"public function listArticles() {\n\t\t\t$query = \"SELECT * FROM articles\";\n\t\t\t$resultat = $this->db->getAll($query);\n\t\t\treturn $resultat;\n\t\t}",
"public function listArticlesPaginated()\n {\n $numdata = 5;\n $articles = Article::orderBy('date', 'DESC')->paginate($numdata,['id','title','author','date','summary']);\n return $articles;\n }",
"public function getAllArticleItems()\n {\n return $this->articles;\n }",
"public function posts() \n {\n return Post::allPublished();\n }",
"public function allPublished()\n {\n return $this->model->where('published', true)->orderBy('start_datetime')->get();\n }",
"public function publishlistAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $stories = $em->getRepository('PDSStoryBundle:Story')->publishRequest();\n\n\n return array('stories' => $stories);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setJdvlClient() Set the value of [jdvl_reference] column. | public function setJdvlReference($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->jdvl_reference !== $v) {
$this->jdvl_reference = $v;
$this->modifiedColumns[] = JournalDeVenteLignePeer::JDVL_REFERENCE;
}
return $this;
} | [
"public function getJdvlReference()\n {\n\n return $this->jdvl_reference;\n }",
"public function getJdvlClient()\n {\n\n return $this->jdvl_client;\n }",
"public function setClientReference($val)\n {\n $this->_propDict[\"clientReference\"] = $val;\n return $this;\n }",
"public function setClient(Client &$client);",
"public function setClientReferenceAttribute($value)\n {\n $this->attributes['client_reference'] = strtolower($value);\n }",
"public function setJdvId($v)\n {\n if ($v === ''){\n $v = null;\n }\n elseif ($v !== null){\n \n if(is_numeric($v)) {\n $v = (int) $v;\n }\n }\n if ($this->jdv_id !== $v) {\n $this->jdv_id = $v;\n $this->modifiedColumns[] = JournalDeVenteLignePeer::JDV_ID;\n }\n\n if ($this->aJournalDeVente !== null && $this->aJournalDeVente->getJdvId() !== $v) {\n $this->aJournalDeVente = null;\n }\n\n\n return $this;\n }",
"public function setJdvlDateEcheance($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->jdvl_date_echeance !== null || $dt !== null) {\n $currentDateAsString = ($this->jdvl_date_echeance !== null && $tmpDt = new DateTime($this->jdvl_date_echeance)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ($currentDateAsString !== $newDateAsString) {\n $this->jdvl_date_echeance = $newDateAsString;\n $this->modifiedColumns[] = JournalDeVenteLignePeer::JDVL_DATE_ECHEANCE;\n }\n } // if either are not null\n\n\n return $this;\n }",
"public function setClientVdCode($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->client_vd_code !== $v) {\n $this->client_vd_code = $v;\n $this->modifiedColumns[] = DemandeIdentifiantPeer::CLIENT_VD_CODE;\n }\n\n\n return $this;\n }",
"public function getJd_client()\n {\n return $this->jd_client;\n }",
"function oci_set_client_identifier ( resource $connection , string $client_identifier ){}",
"public function setClient($client);",
"public function setJdvlJournal($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->jdvl_journal !== $v) {\n $this->jdvl_journal = $v;\n $this->modifiedColumns[] = JournalDeVenteLignePeer::JDVL_JOURNAL;\n }\n\n\n return $this;\n }",
"public function setCityRef($ref);",
"function setUserReference($userReference) {\n\t\t$this->m_userReference = $userReference;\n\t}",
"public function setCompteclient($compteclient)\n {\n $this->compteclient = $compteclient;\n\n \n }",
"public function filterByJdvlReference($jdvlReference = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($jdvlReference)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $jdvlReference)) {\n $jdvlReference = str_replace('*', '%', $jdvlReference);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(JournalDeVenteLignePeer::JDVL_REFERENCE, $jdvlReference, $comparison);\n }",
"public function setConnection($client)\n {\n $this->client = $client;\n }",
"public function setJdvlAuxiliaire($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->jdvl_auxiliaire !== $v) {\n $this->jdvl_auxiliaire = $v;\n $this->modifiedColumns[] = JournalDeVenteLignePeer::JDVL_AUXILIAIRE;\n }\n\n\n return $this;\n }",
"public function setRef_prov($ref_prov){\n $this->ref_prov = $ref_prov;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get store the current cats race value | public function getRace()
{
return $this->race;
} | [
"public function race()\n {\n return self::RACES[$this->race];\n }",
"function getRace() {\n\t\treturn $this->data['race'];\n\t}",
"public function getRace(){\n\t\treturn $this->race;\n\t}",
"function getRace()\r\n {\r\n return $this->char_race;\r\n }",
"function get_race() {\n if (empty($this->_objRace)) {\n $strRace = $this->get_stat(RACE);\n require_once(\"inc/races/clsRace.php\");\n $_objRace = clsRace::getRace($strRace);\n }\n return $_objRace;\n }",
"public function getRace(): int;",
"public function getCst()\n {\n return $this->cst;\n }",
"public function getCrimeData()\n {\n return $this->crimeData;\n }",
"public function getValue() {\n\t\treturn $this->cache[$this->key];\n\t}",
"public function getCurrentLife()\n {\n return $this->currentLife;\n }",
"public function getCatering()\r\n {\r\n return $this->catering;\r\n }",
"protected function CartRecord_current() {\n\t$rcSess = $this->SessionRecord();\n\treturn $rcSess->GetCartRecord_ifWriteable();\n }",
"public function ratesSpawn()\n {\n return $this->value(@$this->attributes->rates->spawn);\n }",
"function getCurrentDistributionValue()\n\t{\n\t\treturn $this->connection->getActiveShardId();\n\t}",
"function getCurrentDistributionValue();",
"public function getStoreCredit()\n {\n return $this->store_credit;\n }",
"public function getValue()\n\t\t{\n\t\t\treturn $this->trade_value;\n\t\t}",
"public function getCurRealestate()\n {\n return $this->CurRealestate;\n }",
"public function getCurrentTreasureValue() {\r\n return $this->_currentTreasuresValue;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get investors foreah funding | private function getInvestors($investors){
$dataArray = array();
foreach($investors as $anItem){
$data['name'] = $anItem->financial_org->name;
$data['permalink'] = $anItem->financial_org->permalink;
array_push($dataArray, $data);
}
return $dataArray;
} | [
"public function getInvestmentFunds(): array\n {\n return $this->investmentFunds;\n }",
"public function countInvestorFunded()\n {\n return \\Md\\Fund::where('investor_id', '=', \\Auth::user()->id)->distinct('innovation_id')->count('innovation_id');\n\n }",
"public function getPersonFund()\n {\n return $this->person_fund;\n }",
"public function getFunds()\n {\n // Graceful degradation -- return empty fund list if no method supported.\n return method_exists($this->driver, 'getFunds') ?\n $this->driver->getFunds() : array();\n }",
"public function getFundDateEstimate();",
"public function get_fund_data()\n {\n global $iconic_woo_fundraisers;\n\n $return = false;\n\n if($this->product_type == \"fundraiser\"):\n\n $return = array(\n 'rewards' => false,\n 'goal' => false\n );\n\n $fundData = get_post_meta($this->id, $iconic_woo_fundraisers->slug, true);\n\n $return['goal'] = (isset($fundData['goal'])) ? $fundData['goal'] : false;\n $return['rewards'] = (isset($fundData['rewards'])) ? $fundData['rewards'] : false;\n\n endif;\n\n return $return;\n }",
"public function investors()\n {\n return $this->hasMany(Investor::class);\n }",
"public function getDebtFunds() \n\n {\n $allFund = Fund::all();\n $allFund = DB::select('SELECT fund_house.fund_name,fund_house.launch_date,funds.fund_scheme,fund_category.category_name\n FROM funds\n JOIN fund_house ON funds.fund_id = fund_house.id\n JOIN fund_category ON fund_category.category_id = funds.id WHERE category_name = \"debt\"') ;\n if(empty($allFund))\n {\n $result = array(\"status\"=>0);\n }\n else\n {\n $result = array(\"status\"=>1,\"data\"=>$allFund);\n }\n return $result;\n }",
"public function getFinance()\n {\n return $this->usr_finance;\n }",
"public function getDatafund()\n {\n return $this->datafund;\n }",
"function showProfit($investors, $date) {\n foreach ($investors as $investor) {\n if($investor['profit'] != 0) {\n x($investor['obj']->name .' has won: '. $investor['profit'] .' form Tranche: '. $investor['obj']->tranche->name.' during '. $investor['date'] .' - '. $date);\n }\n }\n}",
"public function getForwardersFallDue();",
"public function funds()\n {\n return $this->hasMany(Fund::class);\n }",
"public function getDataFund(){\n\t\t$list=array();\n\t\t$data=array(\n\t\t\t'KEY'=>'A9129A4DF87E1030B8217CB61E71DE05',\n\t\t\t'DAYS'=>'2',\n\t\t);\n try{\n $dataentity=$this->getData($data,'DataFundTypePrice.asmx/GetDaysLatestApprovedNAVinXML','FundPrice');\n return $dataentity;\n } catch(Exception $e){\n //$this->response->body;\n } \n}",
"public function investor()\n {\n return $this->belongsToMany('App\\Models\\Investor', 'investor_bank_accounts', 'bank_id', 'investor_id');\n }",
"public function getCurrentFunding()\n {\n $rowset = Factory::getInstance()->get('Subscriptions')\n ->select(function($select) {\n return $select->columns(array(\n 'funding' => new Expression('SUM(payment)')\n ))\n ->where(array(\n 'profile_id' => $this->getId(),\n 'is_active' => 1,\n ));\n });\n\n return $rowset->current()->funding;\n }",
"function getFundAmount(){\n return $this->fundAmount; \n }",
"public function getInvestimento()\n {\n return $this->investimento;\n }",
"public function getRegisteredFund()\n {\n return $this->registered_fund;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that takes an array of dates (going to be used in conjunction with the getNeededDates function), and goes through the database to find the entries for thoes dates given, then combines all entries into one array called $day_and_type which is returned | function determineDays($db_file, $date_array, $date_format = DATE_FORMAT, $display_format = DISPLAY_FORMAT){
# empty array for use later
$day_and_type = [];
# opens the sqlite database using PDO
$pdo = new PDO("sqlite:{$db_file}");
# stmt stores the prepared statement which will select all collumns from the table Days where the date matches the date given in the variable $date, which is binded to the :date thingy
$stmt = $pdo->prepare("SELECT * FROM Days WHERE Date = :date");
$stmt->bindParam(':date', $date);
# for every $date in $date array
foreach ($date_array as $date){
# executes the statement with the date variable, and then sets the output of it to a Key Pair (date => type of day array)
$stmt->execute();
$result = $stmt->setFetchMode(PDO::FETCH_KEY_PAIR);
# fetches the result of the statement and stores it in $result
$result = $stmt->fetchAll();
# for every $date and $type_of_day in the result
foreach ($result as $date => $type_of_day){
# formats the date into the display format using the function below, changes the date into the format Weekday, Month Day[th] so that it can be used to get the right day display on the main page
$formatted_date = convertDateFormat($date, $date_format, $display_format);
# appends the $formatted_date and $type_of_day to the $day_and_type variable
$day_and_type[$formatted_date] = $type_of_day;
}
}
# closed the PDO session
$pdo = null;
# returns the associative array $day_and_type
return $day_and_type;
} | [
"public function get_col_dates($all_waste_types=true){\n\t\t\n\t\tif ($all_waste_types){\n\t\t\t$year=intval($this->dt_create->Format('Y'));\n\t\t\tif (!$this->from_now){\n\t\t\t\t$date_start = ($year=='2018')?'2018-04-01':$year.'-01-01';\n\t\t\t\t//$date_start=$year.'-01-01';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$date_start= $this->dt_create->Format('Y-m-d');\n\t\t\t}\n\t\t\t$date_end=($year+1).'-01-01';\t\t\n\t\t\t\n\t\t\tforeach($this->week_patterns as $waste_type=>$pattern){\n\t\t\t\t$sort_dates=false;$dates_added=false;\n\t\t\t\tforeach($pattern as $day_name=>$val){\n\t\t\t\t\tif ($day_name=='PM'){break;}\n\t\t\t\t\tif ($val){\n\t\t\t\t\t\t//echo $day_name.$waste_type.$val._B; //debug\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$weekly=1;\n\t\t\t\t\t\t$dates[$waste_type]=CalFunctions::weekday_pattern($day_name,$weekly,$date_start,$date_end);\n\t\t\t\t\t\tif ( isset($this->col_dates[$waste_type]) ){ //if dates are already present in ::col_dates for this waste type \n\t\t\t\t\t\t\t$this->col_dates[$waste_type]=array_merge($this->col_dates[$waste_type],$dates[$waste_type]);\n\t\t\t\t\t\t\t$sort_dates=true; //Y-m-d date strings are added to the end, array will have to be sorted\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$this->col_dates[$waste_type]=$dates[$waste_type];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$dates_added=true;\n\t\t\t\t}\n\t\t\t\tif ($dates_added){ $this->del_excl_dates($waste_type); }\n\t\t\t\tif ($sort_dates) { sort($this->col_dates[$waste_type]); }\n\t\t\t}\n\t\t}\n\t\treturn $this->col_dates;\n\t}",
"function create_all_program_dates_array($valid_post_array = FALSE){\n\t\n\tglobal $wpdb;\n\t\n\t//Build Query. Fetch all post id's and dates from Post Meta\n\t$query = \"SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key='mf_SALF_meta_date'\";\n\t// Run Query\n\t$post_ID_query= $wpdb->get_results($query);\n\t$post_ID_query = remove_unpublished_posts($post_ID_query);\n\t\n\t\n\t\n\t\n\t\n\t//seperate days/months/years\n\tforeach ($post_ID_query as $post_dates){\n\t\t\n\t\t//create $post_id->$date array\n\t\t$dates[$post_dates->post_id]=$post_dates->meta_value;\n\t\t\n\t\t//unset invalid posts (program dates from unselected venues)\n\t\tif($valid_post_array){//if have valid posts\n\t\t\tforeach ($dates as $post_id=>$post_date){\n\t\t\t\tif(!in_array($post_id,$valid_post_array)) unset($dates[$post_id]);\n\t\t\t}\n\t\t}\n\t\t//explode dates within array as day/month/year\n\t\tforeach ($dates as $post_id=>$post_date){\n\t\t\t\n\t\t\t\n\t\t\t\t$exploded_post_date_array[$post_id] = explode('/',$post_date);\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t//Create Key Values, Day, Month, Year\n\t\t\t\t$exploded_post_date_array[$post_id]['day']= $exploded_post_date_array[$post_id][0];\n\t\t\t\t$exploded_post_date_array[$post_id]['month']= $exploded_post_date_array[$post_id][1];\n\t\t\t\t$exploded_post_date_array[$post_id]['year']= $exploded_post_date_array[$post_id][2];\n\t\t\t\n\t\t\t\t//remove old key values\n\t\t\t\tunset($exploded_post_date_array[$post_id][0]);\n\t\t\t\tunset($exploded_post_date_array[$post_id][1]);\n\t\t\t\tunset($exploded_post_date_array[$post_id][2]);\n\t\t}\n\t\n\t}\n\t\n\t\n\treturn $exploded_post_date_array;\n}",
"function make_day()\n {\n global $ec3;\n $result = array();\n if(!empty($this->dayobj))\n {\n for($evt=$this->dayobj->iter_events_allday(); $evt->valid(); $evt->next())\n $result[] = $this->make_event_allday($ec3->event);\n\n for($evt=$this->dayobj->iter_events(); $evt->valid(); $evt->next())\n $result[] = $this->make_event($ec3->event);\n\n foreach($this->dayobj->_posts as $p)\n {\n global $post;\n $post = get_post($p->ID);\n setup_postdata($post);\n $result[] = $this->make_post($post);\n }\n }\n return $result;\n }",
"protected function repeatedDatesByRelativeDayType()\n {\n $repeatedDates = array();\n\n $this->date->setTimestamp($this->begin);\n\n // Skip some months\n if ($this->begin < $this->from) {\n $from = $this->date->createNewWithSameI18nInfo();\n $from->setTimestamp($this->from);\n $this->date->setDay(1);\n $this->date->addMonth(ceil($this->date->diffAbsoluteMonth($from) / $this->ruleInfo['freq']) * $this->ruleInfo['freq']);\n $this->date->gotoNthDayOfMonth($this->ruleInfo['day'], $this->ruleInfo['position']);\n }\n\n while ($this->date->getTimestamp() <= $this->to) {\n if ($this->date->getTimestamp() >= $this->begin && $this->date->getTimestamp() >= $this->from) {\n $repeatedDates[] = $this->date->getDateWithExtendedYear();\n }\n\n // Prevent run date goes to next month\n $this->date->setDay(1)->addMonth($this->ruleInfo['freq']);\n $this->date->gotoNthDayOfMonth($this->ruleInfo['day'], $this->ruleInfo['position']);\n }\n\n return $repeatedDates;\n }",
"function deriveDBDateTimes($focus) {\n global $timedate;\n\t\t$GLOBALS['log']->debug('deriveDBDateTimes got an object of type: '.$focus->object_name);\n\t\t/* [min][hr][dates][mon][days] */\n\t\t$dateTimes = array();\n\t\t$ints\t= explode('::', str_replace(' ','',$focus->job_interval));\n\t\t$days\t= $ints[4];\n\t\t$mons\t= $ints[3];\n\t\t$dates\t= $ints[2];\n\t\t$hrs\t= $ints[1];\n\t\t$mins\t= $ints[0];\n\t\t$today\t= getdate($timedate->getNow()->ts);\n\n\t\t\n\t\t// derive day part\n\t\tif($days == '*') {\n\t\t\t$GLOBALS['log']->debug('got * day');\n\n\t\t} elseif(strstr($days, '*/')) {\n\t\t\t// the \"*/x\" format is nonsensical for this field\n\t\t\t// do basically nothing.\n\t\t\t$theDay = str_replace('*/','',$days);\n\t\t\t$dayName[] = str_replace($focus->dayInt, $focus->dayLabel, $theDay);\n\t\t} elseif($days != '*') { // got particular day(s)\n\t\t\tif(strstr($days, ',')) {\n\t\t\t\t$exDays = explode(',',$days);\n\t\t\t\tforeach($exDays as $k1 => $dayGroup) {\n\t\t\t\t\tif(strstr($dayGroup,'-')) {\n\t\t\t\t\t\t$exDayGroup = explode('-', $dayGroup); // build up range and iterate through\n\t\t\t\t\t\tfor($i=$exDayGroup[0];$i<=$exDayGroup[1];$i++) {\n\t\t\t\t\t\t\t$dayName[] = str_replace($focus->dayInt, $focus->dayLabel, $i);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else { // individuals\n\t\t\t\t\t\t$dayName[] = str_replace($focus->dayInt, $focus->dayLabel, $dayGroup);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif(strstr($days, '-')) {\n\t\t\t\t$exDayGroup = explode('-', $days); // build up range and iterate through\n\t\t\t\tfor($i=$exDayGroup[0];$i<=$exDayGroup[1];$i++) {\n\t\t\t\t\t$dayName[] = str_replace($focus->dayInt, $focus->dayLabel, $i);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$dayName[] = str_replace($focus->dayInt, $focus->dayLabel, $days);\n\t\t\t}\n\t\t\t\n\t\t\t// check the day to be in scope:\n\t\t\tif(!in_array($today['weekday'], $dayName)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t\n\t\t// derive months part\n\t\tif($mons == '*') {\n\t\t\t$GLOBALS['log']->debug('got * months');\n\t\t} elseif(strstr($mons, '*/')) {\n\t\t\t$mult = str_replace('*/','',$mons);\n\t\t\t$startMon = $timedate->fromTimestamp($focus->date_time_start)->month;\n\t\t\t$startFrom = ($startMon % $mult);\n\n\t\t\tfor($i=$startFrom;$i<=12;$i+$mult) {\n\t\t\t\t$compMons[] = $i+$mult;\n\t\t\t\t$i += $mult;\n\t\t\t}\n\t\t\t// this month is not in one of the multiplier months\n\t\t\tif(!in_array($today['mon'],$compMons)) {\n\t\t\t\treturn false;\t\n\t\t\t}\n\t\t} elseif($mons != '*') {\n\t\t\tif(strstr($mons,',')) { // we have particular (groups) of months\n\t\t\t\t$exMons = explode(',',$mons);\n\t\t\t\tforeach($exMons as $k1 => $monGroup) {\n\t\t\t\t\tif(strstr($monGroup, '-')) { // we have a range of months\n\t\t\t\t\t\t$exMonGroup = explode('-',$monGroup);\n\t\t\t\t\t\tfor($i=$exMonGroup[0];$i<=$exMonGroup[1];$i++) {\n\t\t\t\t\t\t\t$monName[] = $i;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$monName[] = $monGroup;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif(strstr($mons, '-')) {\n\t\t\t\t$exMonGroup = explode('-', $mons);\n\t\t\t\tfor($i=$exMonGroup[0];$i<=$exMonGroup[1];$i++) {\n\t\t\t\t\t$monName[] = $i;\n\t\t\t\t}\n\t\t\t} else { // one particular month\n\t\t\t\t$monName[] = $mons;\n\t\t\t}\n\t\t\t\n\t\t\t// check that particular months are in scope\n\t\t\tif(!in_array($today['mon'], $monName)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// derive dates part\n\t\tif($dates == '*') {\n\t\t\t$GLOBALS['log']->debug('got * dates');\n\t\t} elseif(strstr($dates, '*/')) {\n\t\t\t$mult = str_replace('*/','',$dates);\n\t\t\t$startDate = $timedate->fromTimestamp($focus->date_time_start)->day;\n\t\t\t$startFrom = ($startDate % $mult);\n\n\t\t\tfor($i=$startFrom; $i<=31; $i+$mult) {\n\t\t\t\t$dateName[] = str_pad(($i+$mult),2,'0',STR_PAD_LEFT);\n\t\t\t\t$i += $mult;\n\t\t\t}\n\t\t\t\n\t\t\tif(!in_array($today['mday'], $dateName)) {\n\t\t\t\treturn false;\t\n\t\t\t}\n\t\t} elseif($dates != '*') {\n\t\t\tif(strstr($dates, ',')) {\n\t\t\t\t$exDates = explode(',', $dates);\n\t\t\t\tforeach($exDates as $k1 => $dateGroup) {\n\t\t\t\t\tif(strstr($dateGroup, '-')) {\n\t\t\t\t\t\t$exDateGroup = explode('-', $dateGroup);\n\t\t\t\t\t\tfor($i=$exDateGroup[0];$i<=$exDateGroup[1];$i++) {\n\t\t\t\t\t\t\t$dateName[] = $i; \n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$dateName[] = $dateGroup;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif(strstr($dates, '-')) {\n\t\t\t\t$exDateGroup = explode('-', $dates);\n\t\t\t\tfor($i=$exDateGroup[0];$i<=$exDateGroup[1];$i++) {\n\t\t\t\t\t$dateName[] = $i; \n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$dateName[] = $dates;\n\t\t\t}\n\t\t\t\n\t\t\t// check that dates are in scope\n\t\t\tif(!in_array($today['mday'], $dateName)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// derive hours part\n\t\t//$startHour = date('G', strtotime($focus->date_time_start));\n\t\t//$currentHour = ($startHour < 1) ? 23 : date('G', strtotime($focus->date_time_start));\n\t\t$currentHour = $timedate->getNow()->hour;\n\t\tif($hrs == '*') {\n\t\t\t$GLOBALS['log']->debug('got * hours');\n\t\t\tfor($i=0;$i<=24; $i++) {\n\t\t\t\tif($currentHour + $i > 23) {\n\t\t\t\t\t$hrName[] = $currentHour + $i - 24;\n\t\t\t\t} else {\n\t\t\t\t\t$hrName[] = $currentHour + $i;\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif(strstr($hrs, '*/')) {\n\t\t\t$mult = str_replace('*/','',$hrs);\n\t\t\tfor($i=0; $i<24; $i) { // weird, i know\n\t\t\t\tif($currentHour + $i > 23) {\n\t\t\t\t\t$hrName[] = $currentHour + $i - 24;\n\t\t\t\t} else {\n\t\t\t\t\t$hrName[] = $currentHour + $i;\n\t\t\t\t}\n\t\t\t\t$i += $mult;\n\t\t\t}\n\t\t} elseif($hrs != '*') {\n\t\t\tif(strstr($hrs, ',')) {\n\t\t\t\t$exHrs = explode(',',$hrs);\n\t\t\t\tforeach($exHrs as $k1 => $hrGroup) {\n\t\t\t\t\tif(strstr($hrGroup, '-')) {\n\t\t\t\t\t\t$exHrGroup = explode('-', $hrGroup);\n\t\t\t\t\t\tfor($i=$exHrGroup[0];$i<=$exHrGroup[1];$i++) {\n\t\t\t\t\t\t\t$hrName[] = $i;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$hrName[] = $hrGroup;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif(strstr($hrs, '-')) {\n\t\t\t\t$exHrs = explode('-', $hrs);\n\t\t\t\tfor($i=$exHrs[0];$i<=$exHrs[1];$i++) {\n\t\t\t\t\t$hrName[] = $i;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$hrName[] = $hrs;\n\t\t\t}\n\t\t}\n\t\t// derive minutes\n\t\t$currentMin = $timedate->getNow()->minute;\n\t\tif(substr($currentMin, 0, 1) == '0') {\n\t\t\t$currentMin = substr($currentMin, 1, 1);\n\t\t}\n\t\tif($mins == '*') {\n\t\t\t$GLOBALS['log']->debug('got * mins');\n\t\t\tfor($i=0; $i<60; $i++) {\n\t\t\t\tif(($currentMin + $i) > 59) {\n\t\t\t\t\t$minName[] = ($i + $currentMin - 60);\n\t\t\t\t} else {\n\t\t\t\t\t$minName[] = ($i+$currentMin);\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif(strstr($mins,'*/')) {\n\t\t\t$mult = str_replace('*/','',$mins);\n\t\t\t$startMin = $timedate->fromTimestmp($focus->date_time_start)->minute;\n\t\t\t$startFrom = ($startMin % $mult);\n\t\t\t\n\t\t\tfor($i=$startFrom; $i<=59; $i+$mult) {\n\t\t\t\tif(($currentMin + $i) > 59) {\n\t\t\t\t\t$minName[] = ($i + $currentMin - 60);\n\t\t\t\t} else {\n\t\t\t\t\t$minName[] = ($i+$currentMin);\n\t\t\t\t}\n\t\t\t\t$i += $mult;\n\t\t\t}\n\t\t} elseif($mins != '*') {\n\t\t\tif(strstr($mins, ',')) {\n\t\t\t\t$exMins = explode(',',$mins);\n\t\t\t\tforeach($exMins as $k1 => $minGroup) {\n\t\t\t\t\tif(strstr($minGroup, '-')) {\n\t\t\t\t\t\t$exMinGroup = explode('-', $minGroup);\n\t\t\t\t\t\tfor($i=$exMinGroup[0]; $i<=$exMinGroup[1]; $i++) {\n\t\t\t\t\t\t\t$minName[] = $i;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$minName[] = $minGroup;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif(strstr($mins, '-')) {\n\t\t\t\t$exMinGroup = explode('-', $mins);\n\t\t\t\tfor($i=$exMinGroup[0]; $i<=$exMinGroup[1]; $i++) {\n\t\t\t\t\t$minName[] = $i;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$minName[] = $mins;\n\t\t\t}\n\t\t} \n\t\t\n\t\t// prep some boundaries - these are not in GMT b/c gmt is a 24hour period, possibly bridging 2 local days\n\t\tif(empty($focus->time_from) && empty($focus->time_to) ) {\n\t\t\t$timeFromTs = 0;\n\t\t\t$timeToTs = strtotime('+1 day');\n\t\t} else {\n\t\t\t$timeFromTs = strtotime($focus->time_from);\t// these are now GMT (timestamps are all GMT)\n\t\t\t$timeToTs\t= strtotime($focus->time_to);\t// see above\n\t\t\tif($timeFromTs > $timeToTs) { // we've crossed into the next day \n\t\t\t\t$timeToTs = strtotime('+1 day '. $focus->time_to);\t// also in GMT\n\t\t\t}\n\t\t}\n\t\t$timeToTs++;\n\t\t\n\t\tif(empty($focus->last_run)) {\n\t\t\t$lastRunTs = 0;\n\t\t} else {\n\t\t\t$lastRunTs = strtotime($focus->last_run);\n\t\t}\n\n\t\t\n\t\t// now smush the arrays together =)\n\t\t$validJobTime = array();\n\t\tglobal $timedate;\n\t\t$dts = explode(' ',$focus->date_time_start); // split up datetime field into date & time\n\t\t\n\t\t$dts2 = $timedate->to_db_date_time($dts[0],$dts[1]); // get date/time into DB times (GMT)\n\t\t$dateTimeStart = $dts2[0].\" \".$dts2[1];\n\t\t$timeStartTs = strtotime($dateTimeStart);\n\t\tif(!empty($focus->date_time_end) && !$focus->date_time_end == '2021-01-01 07:59:00') { // do the same for date_time_end if not empty\n\t\t\t$dte = explode(' ', $focus->date_time_end);\n\t\t\t$dte2 = $timedate->to_db_date_time($dte[0],$dte[1]);\n\t\t\t$dateTimeEnd = $dte2[0].\" \".$dte2[1];\n\t\t} else {\n\t\t\t$dateTimeEnd = $timedate->getNow()->get('+1 day')->asDb();\n//\t\t\t$dateTimeEnd = '2020-12-31 23:59:59'; // if empty, set it to something ridiculous\n\t\t}\n\t\t$timeEndTs = strtotime($dateTimeEnd); // GMT end timestamp if necessary\n\t\t$timeEndTs++;\n\t\t/*_pp('hours:'); _pp($hrName);_pp('mins:'); _pp($minName);*/\n\t\t$nowTs = $timedate->getNow()->ts;\n\n//\t\t_pp('currentHour: '. $currentHour);\n//\t\t_pp('timeStartTs: '.date('r',$timeStartTs));\n//\t\t_pp('timeFromTs: '.date('r',$timeFromTs));\n//\t\t_pp('timeEndTs: '.date('r',$timeEndTs));\n//\t\t_pp('timeToTs: '.date('r',$timeToTs));\n//\t\t_pp('mktime: '.date('r',mktime()));\n//\t\t_pp('timeLastRun: '.date('r',$lastRunTs));\n//\t\t\n//\t\t_pp('hours: ');\n//\t\t_pp($hrName);\n//\t\t_pp('mins: ');\n//\t\t_ppd($minName);\n\t\t$hourSeen = 0;\n\t\tforeach($hrName as $kHr=>$hr) {\n\t\t\t$hourSeen++;\n\t\t\tforeach($minName as $kMin=>$min) {\n\t\t\t\tif($hr < $currentHour || $hourSeen == 25) {\n\t\t\t\t\t$theDate = $timedate->asDbDate($timedate->getNow()->get('+1 day'));\n\t\t\t\t} else {\n\t\t\t\t\t$theDate = $timedate->nowDbDate();\t\t\n\t\t\t\t}\n\t\t\t\t$tsGmt = strtotime($theDate.' '.str_pad($hr,2,'0',STR_PAD_LEFT).\":\".str_pad($min,2,'0',STR_PAD_LEFT).\":00\"); // this is LOCAL\n//\t\t\t\t_pp(date('Y-m-d H:i:s',$tsGmt));\n\t\t\t\t\n\t\t\t\tif( $tsGmt >= $timeStartTs ) { // start is greater than the date specified by admin\n\t\t\t\t\tif( $tsGmt >= $timeFromTs ) { // start is greater than the time_to spec'd by admin\n\t\t\t\t\t\tif( $tsGmt <= $timeEndTs ) { // this is taken care of by the initial query - start is less than the date spec'd by admin\n\t\t\t\t\t\t\tif( $tsGmt <= $timeToTs ) { // start is less than the time_to\n\t\t\t\t\t\t\t\tif( $tsGmt >= $nowTs ) { // we only want to add jobs that are in the future\n\t\t\t\t\t\t\t\t\tif( $tsGmt > $lastRunTs ) { //TODO figure if this is better than the above check\n\t\t\t\t\t\t\t\t\t\t$validJobTime[] = $timedate->fromTimestamp($tsGmt)->asDb(); //_pp(\"Job Qualified for: \".date('Y-m-d H:i:s', $tsGmt));\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t//_pp('Job Time is NOT greater than Last Run');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//_pp('Job Time is NOT larger than NOW'); _pp(date('Y-m-d H:i:s', $nowTs));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t//_pp('Job Time is NOT smaller that TimeTO: '.$tsGmt .'<='. $timeToTs);\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//_pp('Job Time is NOT smaller that DateTimeEnd: '.date('Y-m-d H:i:s',$tsGmt) .'<='. $dateTimeEnd); _pp( $tsGmt .'<='. $timeEndTs );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//_pp('Job Time is NOT bigger that TimeFrom: '.$tsGmt .'>='. $timeFromTs);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//_pp('Job Time is NOT Bigger than DateTimeStart: '.date('Y-m-d H:i',$tsGmt) .'>='. $dateTimeStart);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n//\t\t_ppd();\n//\t\t_ppd($validJobTime);\n\t\treturn $validJobTime;\n\t\t\n\t}",
"function filter_date_array_by_days($dates_array, $days_array) {\n $return_array=array();\n foreach($dates_array as $date_string) {\n if (in_array(date('N', strtotime($date_string)), $days_array)) {\n array_push($return_array, $date_string);\n }\n }\n return $return_array;\n}",
"function RetrieveDates($filter = NULL) {\n $inputIsValid = TRUE;\n //--------------------------------------------------------------------------------\n // Validate Input parameters\n //--------------------------------------------------------------------------------\n if ($filter <> NULL) {\n foreach ($filter as $key => $value) {\n if (strcmp($key, DATE_TABLE_DATE_ID) == 0) {\n if (!is_numeric($value)) {\n printCallStackAndDie();\n error_log(\"Invalid DATE_TABLE_DATE_ID of \" . $value .\n \" passed to RetrieveDates.\");\n $inputIsValid = FALSE;\n }\n } else if (strcmp($key, DATE_TABLE_DATE) == 0) {\n if (!isValidDate($value)) {\n error_log(\"Invalid DATE_TABLE_DATE of \" . $value .\n \" passed to RetrieveDates.\");\n $inputIsValid = FALSE;\n }\n } else if (strcmp($key, DATE_TABLE_PUBLIC_HOL_ID) == 0) {\n if (!is_numeric($value)) {\n error_log(\"Invalid DATE_TABLE_PUBLIC_HOL_ID of \" . $value .\n \" passed to RetrieveDates.\");\n $inputIsValid = FALSE;\n }\n } else {\n error_log(\"Unknown Filter \" . $key . \" passed to RetrieveDates.\");\n $inputIsValid = FALSE;\n }\n }\n }\n\n //--------------------------------------------------------------------------------\n // Only attempt to perform query in the database if the input parameters are ok.\n //--------------------------------------------------------------------------------\n $result = NULL;\n if ($inputIsValid) {\n $result = performSQLSelect(DATE_TABLE, $filter);\n }\n return $result;\n}",
"function get_reminders_for_today() {\n $reminders = array();\n \n $query = \"SELECT eventID, date_type FROM event_reminders WHERE date_type = 0 AND reminder_date = CURDATE()\";\n array_merge($reminders, execute_query($query)->fetchAll());\n \n $query = \"SELECT eventID, date_type FROM event_reminders WHERE date_type = 1\";\n $reminders_1 = execute_query($query)->fetchAll();\n\n foreach($reminders_1 as $reminder) {\n $event_id = $reminder['eventID'];\n $event_date = get_event($event_id)['event_date'];\n \n $today = new DateTime();\n $today->add(new DateInterval('P1D'));\n if($today->format('Y-m-d') == $event_date) {\n array_push($reminders, $reminder);\n }\n }\n\n $query = \"SELECT eventID, date_type FROM event_reminders WHERE date_type = 2\";\n $reminders_2 = execute_query($query)->fetchAll();\n\n foreach($reminders_2 as $reminder) {\n $event_id = $reminder['eventID'];\n $event_date = get_event($event_id)['event_date'];\n \n $today = new DateTime();\n $today->add(new DateInterval('P7D'));\n if($today->format('Y-m-d') == $event_date) {\n array_push($reminders, $reminder);\n }\n }\n\n return $reminders;\n}",
"private function getNewTicketsByDayList() {\r\n\t\t$sql = \"SELECT dateadd(DAY,0, datediff(day,0, Date_Entered_UTC)) AS day, count(TicketNbr) as count \";\r\n\t\t$sql .= \"FROM v_rpt_Service \";\r\n\t\t$sql .= \"WHERE Date_Entered_UTC >= DATEADD(day, -30, GETDATE()) \";\r\n\t\t$sql .= \"GROUP BY dateadd(DAY,0, datediff(day,0, Date_Entered_UTC)) \";\r\n\t\t$sql .= \"ORDER BY dateadd(DAY,0, datediff(day,0, Date_Entered_UTC)) \";\r\n\t\t$result = sqlsrv_query($this->conn, $sql) or die ('Error in SQL: ' . $sql);\r\n\r\n\t\t$i = 0;\r\n\t\twhile($row = sqlsrv_fetch_array($result)) {\r\n\t\t\t$r[$i]['date'] = (strtotime($row['day'])*1000)-6*60*60*1000;\r\n\t\t\t$r[$i]['count'] = (string)$row['count'];\r\n\t\t\t$i++;\r\n\t\t}\r\n\r\n\t\treturn($r);\r\n\t}",
"function getAllDayPaitentArticle($paitent_id)\n\t{\n\t\n\t\t $query;\n\t\t\n\t\t \n\t\t $query=\"(SELECT AR.article_id AS articleID,AR.link_url AS link,AR.file_path AS path, NULL AS plan_id, AR.article_name AS article_name, AR.headline AS artcleHeadline, PAA.patient_id AS patient_id, PAA.patientArticleId AS patientArticleId, PAA.read_article AS read_article, PAA.assignday AS assignday, FLOOR( (PAA.assignday-1) /7 ) +1 AS week1\n\t\t\t\tFROM article AR\n\t\t\t\tLEFT JOIN patient_article PAA ON PAA.article_id = AR.article_id\n\t\t\t\tWHERE PAA.patient_id = ' \".$paitent_id.\"' AND AR.status='1'\n\t\t\t\tORDER BY assignday ASC\n\t\t\t\t)\n\t\t\t\tUNION (\n\n\t\t\t\tSELECT RS.article_id AS articleID,RS.link_url AS link,RS.file_path AS path, P.plan_id AS plan_id, RS.article_name AS article_name, RS.headline AS artcleHeadline, P.patient_id AS patient_id, NULL AS patientArticleId, PA.read_article AS read_article, P.assignday AS assignday, FLOOR( (P.assignday-1) /7 ) +1 AS week1\n\t\t\t\tFROM article RS\n\t\t\t\tLEFT JOIN plan_article PA ON RS.article_id = PA.article_id\n\t\t\t\tLEFT JOIN plan P ON P.plan_id = PA.plan_id\n\t\t\t\tAND P.status = '1'\n\t\t\t\tWHERE (\n\t\t\t\tP.patient_id = ' \".$paitent_id.\"' AND RS.status='1'\n\t\t\t\t)\n\t\t\t\tORDER BY assignday ASC\n\t\t\t\t)\n\t\t\t\tORDER BY assignday ASC\";\n $result = @mysql_query($query);\n\n $num = @mysql_num_rows($result);\n\n $arr = array();\n\n \n\n while($row = @mysql_fetch_array($result)){\n\t\t$arr[]=$row;\n\t\t}\n\t\n\t\treturn $arr;\n\t}",
"public static function buildDay(): array\n {\n $results_array = array();\n\n while(true)\n {\n if(count($results_array) == 24)\n {\n break;\n }\n\n $results_array[count($results_array) + 1] = 0;\n }\n\n return $results_array;\n }",
"function get_device_data_day($startDate, $endDate, $deviceId, $chartType){\r\n\t\t# This function is used to find all data of the given data type for the given period.\r\n\t\t# Start date is inclusive, end date is not inclusive. Should only be used when displaying one day on a chart.\r\n\t\t$connect = connect_db();\r\n\t\tif($chartType == \"cpuUsage\"){\r\n\t\t\t$sql = \"SELECT * FROM device_cpu_data WHERE date>='\" . $startDate . \"' AND date<'\" . $endDate . \"' AND device_id='\" . $deviceId . \"'\";\r\n\t\t}else{\r\n\t\t\t$sql = \"SELECT * FROM device_battery_data WHERE date>='\" . $startDate . \"' AND date<'\" . $endDate . \"' AND device_id='\" . $deviceId . \"'\";\r\n\t\t}\r\n\t\t$result = mysqli_query($connect, $sql);\r\n\t\tif(mysqli_num_rows($result) != 0){\r\n\t\t\t# Store data in relevant array.\r\n\t\t\tif($chartType == \"cpuUsage\"){\r\n\t\t\t\twhile($row = mysqli_fetch_array($result)){\r\n\t\t\t\t\t$cpuPerArray[] = $row['cpu_percent_avg'];\r\n\t\t\t\t\t$dateTimeArray[] = $row['date'];\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\twhile($row = mysqli_fetch_array($result)){\r\n\t\t\t\t\t$batLevelArray[] = $row['battery_level'];\r\n\t\t\t\t\t$dateTimeArray[] = $row['date'];\r\n\t\t\t\t\tif($row['charging_state'] == 1){\r\n\t\t\t\t\t\t$batStateArray[] = 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$batStateArray[] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t# Store information to show that no data is available for the given date(s).\r\n\t\t\tif($chartType == \"cpuUsage\"){\r\n\t\t\t\t$cpuPerArray[] = 0;\r\n\t\t\t}else{\r\n\t\t\t\t$batLevelArray[] = 0;\r\n\t\t\t\t$batStateArray[] = 0;\r\n\t\t\t}\r\n\t\t\t$dateTimeArray[] = \"No Data\";\r\n\t\t}\r\n\t\t\r\n\t\t# Return the relevant array.\r\n\t\tif($chartType == \"cpuUsage\"){\r\n\t\t\treturn array($cpuPerArray, $dateTimeArray);\r\n\t\t}else{\r\n\t\t\treturn array($batLevelArray, $dateTimeArray, $batStateArray);\r\n\t\t}\r\n\t}",
"static function fetchDay($date){\n\t\t\tinclude \"global.php\";\n\t\t\t$resultEvents=array();\n\t\t\t$resultEvents = array_merge(self::fetchDayByUser($date), self::fetchDayByGroup($date));\n\t\t\tusort($resultEvents,\"Event::compareTo\"); // sort all events base on thier time.\n\t\t\t//echo \"I am here\";\n\t\t\treturn $resultEvents;\n\t\t}",
"private static function _dates($day) \n {\n try\n {\n $today = new DateTime($day);\n $yesterday = new DateTime($day);\n $tomorrow = new DateTime($day);\n $date = $today->format(option('date_format'));\n \n $yesterday->sub(new DateInterval('P1D'));\n $tomorrow->add(new DateInterval('P1D'));\n }\n catch (Exception $e)\n {\n return false;\n }\n \n $dates = (object) array(\n 'date' => $date,\n 'today' => $today->format('Y-m-d'),\n 'yesterday' => $yesterday->format('Y-m-d'),\n 'tomorrow' => $tomorrow->format('Y-m-d'),\n );\n\n foreach ($dates as $k => $v) {\n set($k, $v);\n }\n \n return $dates;\n }",
"function get_files_and_dates($num, $type) {\n check_assignment($num, $type);\n\n $meta = get_metafile($num, $type);\n\n if ($meta === null)\n return null;\n\n $info = array();\n\n foreach ($meta as $file => $due_dates) {\n $dates = array();\n\n foreach ($due_dates as $date => $penalty) {\n $d = DateTime::createFromFormat(ISO8601_TZ, $date);\n\n if ($d === false)\n trigger_error(\"could not parse date: $date\");\n\n if ($penalty < 0 || $penalty > 1)\n trigger_error(\"invalid late multiplier: $penalty\");\n\n $pair = array($d, $penalty);\n\n $dates[] = $pair;\n }\n\n $info[$file] = $dates;\n }\n\n return $info;\n}",
"function get_event_days(){\r\n\t\t$event_days = array();\r\n\r\n\t\tforeach($this->merged_feed_data as $item){\r\n\t\t\t$start_date = $item->get_start_date();\r\n\r\n\t\t\t//Round start date to nearest day\r\n\t\t\t$start_date = mktime(0, 0, 0, date('m', $start_date), date('d', $start_date) , date('Y', $start_date));\r\n\r\n\t\t\tif(!isset($event_days[$start_date])){\r\n\t\t\t\t//Create new array in $event_days for this date (only dates with events will go into array, so, for \r\n\t\t\t\t//example $event_days[26] will exist if 26th of month has events, but won't if it has no events)\r\n\t\t\t\t//(Now uses unix timestamp rather than day number, but same concept applies).\r\n\t\t\t\t$event_days[$start_date] = array();\r\n\t\t\t}\r\n\r\n\t\t\t//Push event into array just created (may be another event for this date later in feed)\r\n\t\t\tarray_push($event_days[$start_date], $item);\r\n\t\t}\r\n\r\n\t\treturn $event_days;\r\n\t}",
"function weeklyRequestToInstance($startDate, $endDate, $arrayOfDays){\n $events=array();\n foreach($arrayOfDays as $day){\n $day = (int)$day;\n //Find the first n-day on or after the start date\n $day = ($day-1)%7; //Input convention changed to PHP convention\n $day = (string)$day;\n $dateForDay = $startDate;\n while(dateToDay($dateForDay) != $day)\n {\n $dateForDay = date(\"Y-m-d\", strtotime($dateForDay.\"+ 1 day\"));\n }\n // echo \"\\n\\n**\".$dateForDay.\"\\n\";\n $events=array_merge($events,addWeeklyRequest($dateForDay, $endDate));\n }\n return $events;\n}",
"function getItemsByType($type, $calendarId){\n\n\tglobal $conn;\n\n $queries = array(\"event\" => \"SELECT * FROM Items I, EventItems E\n \t\t\t\t\t\t\t\tWHERE I.type = 'event' && I.itemId = E.itemId && I.calendarId = $calendarId\n ORDER BY E.startDate ASC;\",\n \"task\" => \"SELECT * FROM Items I, TaskItems E\n \t\t\t\tWHERE I.type = 'task' && I.itemId = E.itemId && I.calendarId = $calendarId\n \t\t\t\tORDER BY E.dueDate ASC;\",\n \"reminder\" => \"SELECT * FROM Items\n \t\t\t\tWHERE type = 'reminder' && calendarId = $calendarId\n \t\t\t\tORDER BY createDate ASC;\",\n \"note\" => \"SELECT * FROM Items\n \t\t\t\tWHERE type = 'note' && calendarId = $calendarId\n \t\t\t\tORDER BY createDate DESC;\");\n\n if ($queries[$type]){\n\n $response = @mysqli_query($conn, $queries[$type]);\n // echo \"<br> ******* Getting all \" . $type . \" items with calendarId = \" . $calendarId . \" ******* <br>\";\n\n if ($response){\n \t$items = [];\n while($item = mysqli_fetch_assoc($response)){\n // echo \"<br> itemId: \" . $row[\"itemId\"] .\n // \"<br>\" . \"name: \" . $row[\"name\"] .\n // \"<br>\" . \"createDate: \" . $row[\"createDate\"] .\n // \"<br>\" . \"note: \" . ($row[\"note\"] ? $row[\"note\"] : \"NULL\") .\n // \"<br>\" . \"reminder: \" . ($row[\"reminder\"] ? $row[\"reminder\"] : \"NULL\") .\n // \"<br>\" . \"type: \" . $row[\"type\"] .\n // \"<br>\" . \"EVENT SPECIFIC: startDate: \" . ($row[\"startDate\"] ? $row[\"startDate\"] : \"NULL\") . \", endDate: \" . ($row[\"endDate\"] ? $row[\"endDate\"] : \"NULL\") .\n // \"<br>\" . \"TASK SPECIFIC: dueDate: \" . ($row[\"dueDate\"] ? $row[\"dueDate\"] : \"NULL\") . \", completionDate: \" . ($row[\"completionDate\"] ? $row[\"completionDate\"] : \"NULL\") .\n // \"<br>\";\n\n array_push($items, $item);\n }\n return $items;\n }\n else{\n \treturn NULL;\n } // end if($response)\n }\n else{\n echo(\"<br> !!!! Incorrect type inputted: \" . $type . \" !!!! <br>\");\n \t\treturn NULL;\n }\n}",
"private function getDayProgram($date){\n // Query the dance program for the given day if it is a single event ticket\n $this->db->query('SELECT e.name, e.location, TIME_FORMAT(e.start_time, \\'%H:%i\\') as startTime FROM event AS e\n JOIN event_day AS ed ON e.id = ed.event_id\n WHERE e.category = :category AND start_time IS NOT NULL AND ed.date= :eventDate');\n\n // Fill in the parameters for the specific category and day\n $this->db->bind(':category', 'DANCE');\n $this->db->bind(':eventDate', $date);\n\n try{\n // Get the result and return it\n return $this->db->getAll();\n } catch (\\Throwable $th) {\n return [];\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if this is a query on user tables | function ModUserTables(&$query) {
global $db_prefix, $db_name, $user_db_prefix, $user_db_name;
$isUserQuery = false;
// only do this if there's a prefix defined
if (!empty($db_prefix)) {
// tables with user information
$usertables = array("users", "new_users", "user_groups", "bad_login", "online", "blacklist");
// check if this is a query on a user table
foreach($usertables as $usertable) {
if(strpos($query, " ".$db_prefix.$usertable)) {
$isUserQuery = true;
$query = str_replace(" ".$db_prefix.$usertable, " ".$user_db_name.".".$user_db_prefix.$usertable, $query);
$query = str_replace("=".$db_prefix.$usertable, "=".$user_db_name.".".$user_db_prefix.$usertable, $query);
}
}
// prefix all other tables with the database name as well
$query = str_replace(" ".$db_prefix, " ".$db_name.".".$db_prefix, $query);
}
// and return the result
return $isUserQuery;
} | [
"function isNOuser($username)\r\n{\r\n\t$adminResult = isAdmin($username);\r\n\t$sqaResult = isSQAuser($username);\r\n\t$devResult = isDEVUser($username);\r\n\t$guestResult = isGuest($username);\r\n\r\n\tif($adminResult || $sqaResult || $devResult || $guestResult){\r\n\t\t//user is in one of the tables\r\n\t\treturn true;\r\n\t}\r\n\telse{\r\n\t\treturn false;//user is not in any of the user tables\r\n\t}\r\n}",
"private function verifyUserTableInfo(): bool {\n $query = \"\n SELECT $this->userIdColumn, $this->userUsernameColumn, $this->userPasswordColumn\n FROM $this->userTable\n WHERE $this->userIdColumn IS NULL\n \";\n\n return $this->db->select($query);\n }",
"public function hasQuery();",
"function checkUserTableIntegrity() {\n \n $sm = $this->db->getSchemaManager();\n\n $tables = $this->getTables();\n \n // Check the users table..\n if (!isset($tables[$this->prefix.\"users\"])) {\n return false; \n }\n \n return true; \n \n }",
"function isUserPresent() {\n\n\n $queryExistingUser = $this->buildSearchQuery();\n $rs = $this->COMMON->executeQuery($queryExistingUser, $_SERVER[\"SCRIPT_NAME\"]);\n if($row = mysql_fetch_row($rs)){\n return true;\n } else {\n return false;\n }\n }",
"public function checkUserTableExists()\n {\n // Query to check if there is a users table\n $sql = \"SELECT * FROM users\";\n return $this->mysql->query($sql);\n }",
"public function is_main_query()\n {\n }",
"public function isUserInDB(){\n\n\t$isInDB = false;\n\n\t$results = $this->generic_db->customQuery( 'facebook_users', 'SELECT * FROM facebook_users where id = ' . $this->session['uid'] );\n\n\tif( count( $results ) > 0 ){\n\t\t$isInDB = true;\n\t}\n\n\treturn $isInDB;\n}",
"public function checkUserTableIntegrity()\n {\n $tables = $this->getTableObjects();\n\n // Check the users table.\n if (!isset($tables[$this->prefix . 'users'])) {\n return false;\n }\n\n return true;\n }",
"function isExistUser($tableName,$user_id)\n\t\t{\n\t\t\t$query = \"Select user_id from $tableName where user_id = $user_id\";\n\t\t\t$rs = $this->Execute($query);\n\t\t\tif($rs->RecordCount() > 0)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"public function isQuery()\n {\n return $this->type === EntryType::QUERY;\n }",
"public function isUser()\n\t{\n\t\treturn $this->role()->where('type', 'User')->exists();\n\t}",
"function userHasAccessToTable($tableid){\r\n\t\tif ($this->userHasPermission(\"AllTableAccess\")) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tglobal $sql;\r\n\t\t//Translate the tableid to the tables database id. (tableids are unique per guild, table db id are unique\r\n\t\t//for all guilds).\r\n\t\t//$guildid = sql::Escape($this->guildid);\r\n\t\t//$tableid = sql::Escape($tableid);\r\n\t\t//$tableDbId = $sql->QueryItem(\"SELECT id FROM dkp_tables WHERE guild='$guildid' AND tableid='$tableid'\");\r\n\t\t//now see if this table database id is in the tables array\r\n\t\treturn in_array($tableid,$this->tables);\r\n\r\n\t}",
"function existsUserDetailsTable() {\n\t$conn = new mysqli(DB_HOST, DB_USER, DB_PSWD, DB_NAME);\n\t$query = \"SELECT 1 FROM logbookUsers\";\n\t$existsUserDetails = $conn->query($query);\n\tif($existsUserDetails) {\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n\t$conn->close();\n}",
"private function hasQueryPermission($query)\n\t{\n\t\tif( $this->type == self::CONNECTION_TYPE_WRITE )\n\t\t\treturn true;\n\n\t\tif( preg_match(\"/(INSERT|UPDATE|DELETE) (.*)/i\", $query) ||\n\t\t\tpreg_match(\"/(?:CREATE|DROP|ALTER|CACHE) (.*)(?:FUNCTION|TABLE|VIEW|EVENT|TRIGGER|INDEX|SERVER|USER|DATABASE|TABLESPACE|PROCEDURE) /i\", $query) )\n\t\t\treturn false;\n\n\t\treturn true;\n\t}",
"public function hasQueryType()\n {\n return $this->query_type !== null;\n }",
"private function tableExists() {\n\t\ttry {\n\t\t\t$result = $this->pdo->query(\"SELECT 1 FROM oauth_session LIMIT 1\");\n\t\t} catch (\\Exception $e) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $result !== false;\n\t}",
"abstract public function supportsQuerying();",
"public function isFromUser()\n\t{\n\t\t$username = $this->getHostmask()->getUsername();\n\t\treturn !empty($username);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set prices for all product types. | private function setPrices($product)
{
if ($product->getTypeId() == 'configurable') {
foreach ($product->getTypeInstance()->getUsedProducts($product) as $childProduct) {
$childPrices[] = $childProduct->getPrice();
if ($childProduct->getSpecialPrice() !== null) {
$childSpecialPrices[] = $childProduct->getSpecialPrice();
}
}
$price = isset($childPrices) ? min($childPrices) : null;
$specialPrice = isset($childSpecialPrices) ? min($childSpecialPrices) : null;
} elseif ($product->getTypeId() == 'bundle') {
$price = $product->getPriceInfo()->getPrice('regular_price')->getMinimalPrice()->getValue();
$specialPrice = $product->getPriceInfo()->getPrice('final_price')->getMinimalPrice()->getValue();
//if special price equals to price then its wrong.
$specialPrice = ($specialPrice === $price) ? null : $specialPrice;
} elseif ($product->getTypeId() == 'grouped') {
foreach ($product->getTypeInstance()->getAssociatedProducts($product) as $childProduct) {
$childPrices[] = $childProduct->getPrice();
if ($childProduct->getSpecialPrice() !== null) {
$childSpecialPrices[] = $childProduct->getSpecialPrice();
}
}
$price = isset($childPrices) ? min($childPrices) : null;
$specialPrice = isset($childSpecialPrices) ? min($childSpecialPrices) : null;
} else {
$price = $product->getPrice();
$specialPrice = $product->getSpecialPrice();
}
$this->formatPriceValues($price, $specialPrice);
} | [
"protected function setPrices()\n {\n global $woocommerce;\n\n // We're dealing with Woocommerce 3.0.0 or later.\n if (version_compare($woocommerce->version, '3.0.0', '>=')) {\n $this->model->setTotal($this->cart->get_total('price'))\n ->setSubtotal($this->cart->get_subtotal())\n ->setShipping($this->cart->get_shipping_total())\n ->setDiscount($this->cart->get_discount_total())\n ->setTax($this->cart->get_total_tax());\n\n // We're dealing with an older version of Woocommerce.\n } else {\n $this->model->setTotal($this->cart->total)\n ->setSubtotal($this->cart->subtotal)\n ->setShipping($this->cart->shipping_total)\n ->setDiscount($this->cart->discount_cart)\n ->setTax($this->cart->tax_total);\n }\n }",
"function setPrices($prices) {\r\r\n\t\t$this->prices = $prices;\r\r\n\t}",
"public function setPrices($prices)\n {\n $this->prices = $prices;\n }",
"public function collectProductPrices()\n {\n $product = $this->getProduct();\n $xmlObject = $this->getProductXmlObj();\n\n if ($product && $product->getId()) {\n $type = $product->getTypeId();\n if (isset($this->_renderers[$type])) {\n $blockName = $this->_renderers[$type];\n } else {\n $blockName = $this->_defaultPriceRenderer;\n }\n\n $renderer = $this->getLayout()->getBlock($blockName);\n if (!$renderer) {\n $renderer = $this->getLayout()->createBlock($blockName);\n }\n\n if ($renderer) {\n $renderer->collectProductPrices($product, $xmlObject);\n }\n }\n }",
"function setProductPrices() : array {\n //Product price array\n return array(\n 'A' => array('1'=>2.00, '4'=>7.00), // product price, group price\n 'B' => array('1'=>12.00), \n 'C' => array('1'=>1.25, '6'=>6.00),\n 'D' => array('1'=>0.15)\n );\n }",
"public function setTierPrices(array $tierPrices): void\n {\n if (!$this instanceof ProductVariantInterface) {\n return;\n }\n\n $this->tierPrices = new ArrayCollection();\n\n foreach ($tierPrices as $tierPrice) {\n /** @var TierPrice $tierPrice */\n $this->addTierPrice($tierPrice);\n }\n }",
"protected function _assignProducts()\n {\n Varien_Profiler::start('QUOTE:' . __METHOD__);\n $productIds = array();\n foreach ($this as $item) {\n $productIds[] = (int)$item->getProductId();\n }\n $this->_productIds = array_merge($this->_productIds, $productIds);\n\n $productCollection = Mage::getModel('catalog/product')->getCollection()\n ->setStoreId($this->getStoreId())\n ->addIdFilter($this->_productIds)\n ->addAttributeToSelect(Mage::getSingleton('sales/quote_config')->getProductAttributes())\n ->addOptionsToResult()\n ->addStoreFilter()\n ->addUrlRewrite()\n ->addTierPriceData()\n ->setFlag('require_stock_items', true);\n\n Mage::dispatchEvent(\n 'prepare_catalog_product_collection_prices', array(\n 'collection' => $productCollection,\n 'store_id' => $this->getStoreId(),\n )\n );\n Mage::dispatchEvent(\n 'sales_quote_item_collection_products_after_load', array(\n 'product_collection' => $productCollection\n )\n );\n\n $recollectQuote = false;\n foreach ($this as $item) {\n $product = $productCollection->getItemById($item->getProductId());\n if ($product) {\n // check if this product appears in the basket multiple times\n // if so, reload the poduct to fix the type\n $repeated = $this->countProductsRepeated();\n if ($repeated[$item->getProductId()] > 1) {\n $product = Mage::getModel('catalog/product')->load($product->getId());\n }\n $product->setCustomOptions(array());\n $qtyOptions = array();\n $optionProductIds = array();\n foreach ($item->getOptions() as $option) {\n /**\n * Call type specified logic for product associated with quote item\n */\n $product->getTypeInstance(true)->assignProductToOption(\n $productCollection->getItemById($option->getProductId()), $option, $product\n );\n\n if (is_object($option->getProduct()) && $option->getProductId() != $product->getId()) {\n $optionProductIds[$option->getProductId()] = $option->getProductId();\n }\n }\n\n if ($optionProductIds) {\n foreach ($optionProductIds as $optionProductId) {\n $qtyOption = $item->getOptionByCode('product_qty_' . $optionProductId);\n if ($qtyOption) {\n $qtyOptions[$optionProductId] = $qtyOption;\n }\n }\n }\n $item->setQtyOptions($qtyOptions);\n\n $item->setProduct($product);\n } else {\n $item->isDeleted(true);\n $recollectQuote = true;\n }\n $item->checkData();\n }\n\n if ($recollectQuote && $this->_quote) {\n $this->_quote->collectTotals();\n }\n Varien_Profiler::stop('QUOTE:' . __METHOD__);\n\n return $this;\n }",
"public function setPrice($price)\n {\n $this->setPrices($price);\n }",
"function _assignProducts() {\n\t\t\t$productIds = array( );\n\t\t\tforeach ($this as $item) {\n\t\t\t\t$productIds[] = $item->getProductId( );\n\t\t\t}\n\n\t\t\t$this->_productIds = array_merge( $this->_productIds, $productIds );\n\t\t\t$productCollection = Mage::getModel( 'catalog/product' )->getCollection( )->setStoreId( $this->getStoreId( ) )->addIdFilter( $this->_productIds )->addAttributeToSelect( Mage::getSingleton( 'sales/quote_config' )->getProductAttributes( ) )->addOptionsToResult( )->addStoreFilter( )->addUrlRewrite( )->addTierPriceData( );\n\t\t\tMage::dispatchEvent( 'prepare_catalog_product_collection_prices', array( 'collection' => $productCollection, 'store_id' => $this->getStoreId( ) ) );\n\t\t\tMage::dispatchEvent( 'sales_quote_item_collection_products_after_load', array( 'product_collection' => $productCollection ) );\n\t\t\t$recollectQuote = false;\n\t\t\tforeach ($this as $item) {\n\t\t\t\t$product = $productCollection->getItemById( $item->getProductId( ) );\n\n\t\t\t\tif ($product) {\n\t\t\t\t\t$product->setCustomOptions( array( ) );\n\t\t\t\t\t$qtyOptions = array( );\n\t\t\t\t\t$optionProductIds = array( );\n\t\t\t\t\tforeach ($item->getOptions( ) as $option) {\n\t\t\t\t\t\t$product->getTypeInstance( true )->assignProductToOption( $productCollection->getItemById( $option->getProductId( ) ), $option, $product );\n\n\t\t\t\t\t\tif (( is_object( $option->getProduct( ) ) && $option->getProduct( )->getId( ) != $product->getId( ) )) {\n\t\t\t\t\t\t\t$optionProductIds[$option->getProduct( )->getId( )] = $option->getProduct( )->getId( );\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\t\t\t\t\tif ($optionProductIds) {\n\t\t\t\t\t\tforeach ($optionProductIds as $optionProductId) {\n\t\t\t\t\t\t\t$qtyOption = $item->getOptionByCode( 'product_qty_' . $optionProductId );\n\n\t\t\t\t\t\t\tif ($qtyOption) {\n\t\t\t\t\t\t\t\t$qtyOptions[$optionProductId] = $qtyOption;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$item->setQtyOptions( $qtyOptions );\n\t\t\t\t\t$item->setProduct( $product );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$item->isDeleted( true );\n\t\t\t\t$recollectQuote = true;\n\t\t\t}\n\n\t\t\tforeach ($this as $item) {\n\t\t\t\t$item->checkData( );\n\t\t\t}\n\n\n\t\t\tif (( $recollectQuote && $this->_quote )) {\n\t\t\t\t$this->_quote->collectTotals( );\n\t\t\t}\n\n\t\t\treturn $this;\n\t\t}",
"public function setPricing($products=array(), $prices = array()){\n\t\t\n\t\t\n\t\t// if any of the parameter is blank..then return false..\n\t\tif(is_array($products) && is_array($prices) && sizeof($products) == sizeof($prices)) \n\t\t{\n\t\t\t\t\t\t\n\t\t\t// set price of each product..\n\t\t\tforeach($products as $index=>$product_name)\n\t\t\t{\n\t\t\t\t$this->products[$product_name]\t=\t$prices[$index];\n\t\t\t}\n\t\t\t\n\t\t\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\t$this->error\t=\t'Please check products and price paramters.'.$this->seperator;\n\t\t\treturn false;\n\t\t}\t\t\n\t\t\n\t}",
"public function setProductSubscriptionTypePrices(Mage_Catalog_Model_Product $product, array $newTypePrices)\n {\n if (!$product->getId()) {\n return;\n }\n\n // Delete already saved\n /** @var Sheep_Subscription_Model_Resource_ProductTypePrice_Collection $typePrices */\n $typePrices = Mage::getModel('sheep_subscription/productTypePrice')->getCollection();\n $typePrices->addProductToFilter($product->getId());\n $typePrices->walk('delete');\n\n // Save new type prices\n if ($newTypePrices) {\n $productTypes = $this->getProductSubscriptionTypes($product);\n $typePrices->clear();\n\n foreach ($newTypePrices as $typePrice) {\n // Don't save price specified for type that is no longer associated to this product\n if (!$productTypes->getItemById($typePrice['type_id'])) {\n continue;\n }\n\n $typePrice['discount'] = (float)$typePrice['discount'];\n $typePrice['discount_percent'] = (float)$typePrice['discount_percent'];\n\n // Ignore type prices where both discount and discount_percent are zero\n if (!($typePrice['discount'] || $typePrice['discount_percent'])) {\n continue;\n }\n\n /** @var Sheep_Subscription_Model_ProductTypePrice $typePriceModel */\n $typePriceModel = Mage::getModel('sheep_subscription/productTypePrice');\n $typePriceModel->setProductId($product->getId());\n $typePriceModel->setTypeId($typePrice['type_id']);\n $typePriceModel->setDiscount($typePrice['discount']);\n $typePriceModel->setDiscountPercent($typePrice['discount_percent']);\n $typePrices->addItem($typePriceModel);\n }\n $typePrices->save();\n }\n }",
"public function setPrice($value);",
"private function initBasePriceForVariants() : void\n {\n /**\n * @var $variant TariffVariant\n */\n foreach ($this->variants as $variant) {\n $variant->setBasePrice($this->basePrice);\n }\n }",
"public function set_price($price) {\n $this->getProduct()->set_price($price);\n }",
"public function testSetProductSubscriptionTypePricesWithOldType()\n {\n $product = $this->getModelMock('catalog/product', array('getId', 'load', 'save'));\n $product->expects($this->any())->method('getId')->willReturn(100);\n\n $prices = array(\n array('type_id' => 5, 'discount' => 25, 'discount_percent' => 0, )\n );\n\n // Verify that existing prices are deleted, new prices are added and saved\n $typePrices = $this->getResourceModelMock('sheep_subscription/productTypePrice_collection', array('addProductToFilter', 'walk', 'clear', 'getItemById', 'addItem', 'save', 'load'));\n $typePrices->expects($this->once())->method('addProductToFilter')->with(100);\n $typePrices->expects($this->once())->method('walk')->with('delete'); // current prices are deleted\n $typePrices->expects($this->once())->method('clear'); // current collection is cleared\n $typePrices->expects($this->never())->method('addItem'); // new type price model is never added\n $typePrices->expects($this->once())->method('save'); // collection is still saved\n $this->replaceByMock('resource_model', 'sheep_subscription/productTypePrice_collection', $typePrices);\n\n // Verify that price type doesn't belong to a type currently associated to our product\n $types = $this->getResourceModelMock('sheep_subscription/type_collection', array('getItemById', 'load'));\n $types->expects($this->once())->method('getItemById')->with(5)->willReturn(false);\n\n $helper = $this->getHelperMock('sheep_subscription/product', array('getProductSubscriptionTypes'));\n $helper->expects($this->once())->method('getProductSubscriptionTypes')->willReturn($types);\n\n $helper->setProductSubscriptionTypePrices($product, $prices);\n }",
"public function set_prices()\n {\n require_code('input_filter_2');\n modsecurity_workaround_enable();\n\n // Save configuration for hooks\n $_hooks = find_all_hooks('modules', 'pointstore');\n foreach (array_keys($_hooks) as $hook) {\n require_code('hooks/modules/pointstore/' . filter_naughty_harsh($hook));\n $object = object_factory('Hook_pointstore_' . filter_naughty_harsh($hook), true);\n if (is_null($object)) {\n continue;\n }\n if (method_exists($object, 'save_config')) {\n $object->save_config();\n }\n }\n\n log_it('POINTSTORE_CHANGED_PRICES');\n\n // Show it worked / Refresh\n $url = build_url(array('page' => '_SELF', 'type' => 'p'), '_SELF');\n return redirect_screen($this->title, $url, do_lang_tempcode('SUCCESS'));\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 }",
"public function setTierPrices(array $tierPrices): void;",
"public function testSetTierPrices()\n {\n $tierPriceToAdd = ['sku_1' => [['qty' => 1, 'website_id' => 3]]];\n $presentTierPrice = ['sku_1' => [['qty' => 1, 'website_id' => 2]]];\n $this->session->expects($this->once())->method('getData')\n ->with($this->key . '_' . Wizard::SESSION_KEY_PRODUCT_TIER_PRICES)->willReturn($presentTierPrice);\n $this->session->expects($this->once())->method('setData')\n ->with(\n $this->key . '_' . Wizard::SESSION_KEY_PRODUCT_TIER_PRICES,\n ['sku_1' => [$presentTierPrice['sku_1'][0], $tierPriceToAdd['sku_1'][0]]]\n )->willReturnSelf();\n $this->wizard->setTierPrices($tierPriceToAdd);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for createTimesheet Use this method to create a timesheet. | public function testCreateTimesheet()
{
} | [
"protected function make_timesheet()\n\t{\n\t\t$bo = new \\timesheet_bo();\n\t\t$bo->data = array(\n\t\t\t'ts_title' => \"Test timesheet for #{$this->pm_id}\",\n\t\t\t'ts_description' => 'Test element as part of the project for test ' . $this->getName(),\n\t\t\t'ts_status' => null,\n\t\t\t'ts_owner' => $GLOBALS['egw_info']['user']['account_id'],\n\t\t\t'ts_start' => \\time()\n\t\t);\n\t\t$bo->save();\n\t\t$element_id = $bo->data['ts_id'];\n\t\tApi\\Link::link(TIMESHEET_APP,$element_id,'projectmanager',$this->pm_id);\n\t\t$this->elements[] = 'timesheet:'.$element_id;\n\t}",
"private function create_timesheets() {\n\t\techo 'Create timesheets: ';\n\n\t\t$timesheets_created = 0;\n\n\t\t// get active accounts\n\t\t$where= array(\n\t\t\t'active' => 1\n\t\t);\n\t\t$accounts = $this->db->from('accounts')->where($where)->get();\n\n\t\tforeach ($accounts->result() as $account) {\n\t\t\t// check date\n\t\t\tif (date('N') == $this->settings_library->get('timesheets_create_day', $account->accountID)) {\n\t\t\t\t$timesheets_created = $this->crm_library->generate_timesheets(NULL, $account->accountID);\n\t\t\t}\n\t\t}\n\n\t\techo $timesheets_created . '<br />';\n\t}",
"static function createTimesheet($fields)\n {\n // Create a new timesheet entry.\n global $user;\n $mdb2 = getConnection();\n\n $user_id = $user->getUser();\n $group_id = $user->getGroup();\n $org_id = $user->org_id;\n\n $client_id = $fields['client_id'];\n $project_id = $fields['project_id'];\n $name = $fields['name'];\n $comment = $fields['comment'];\n\n $start_date = new DateAndTime($user->date_format, $fields['start_date']);\n $start = $start_date->toString(DB_DATEFORMAT);\n\n $end_date = new DateAndTime($user->date_format, $fields['end_date']);\n $end = $end_date->toString(DB_DATEFORMAT);\n\n $created_part = ', now(), '.$mdb2->quote($_SERVER['REMOTE_ADDR']).', '.$user->id;\n\n $sql = \"insert into tt_timesheets (user_id, group_id, org_id, client_id, project_id, name, comment,\".\n \" start_date, end_date, created, created_ip, created_by)\".\n \" values ($user_id, $group_id, $org_id, \".$mdb2->quote($client_id).\", \".$mdb2->quote($project_id).\", \".$mdb2->quote($name).\n \", \".$mdb2->quote($comment).\", \".$mdb2->quote($start).\", \".$mdb2->quote($end).$created_part.\")\";\n $affected = $mdb2->exec($sql);\n if (is_a($affected, 'PEAR_Error'))\n return false;\n\n $last_id = $mdb2->lastInsertID('tt_timesheets', 'id');\n\n // Associate tt_log items with timesheet.\n if (isset($fields['client'])) $client_id = (int) $fields['client_id'];\n if (isset($fields['project_id'])) $project_id = (int) $fields['project_id'];\n // sql parts.\n if ($client_id) $client_part = \" and client_id = $client_id\";\n if ($project_id) $project_part = \" and project_id = $project_id\";\n\n $sql = \"update tt_log set timesheet_id = $last_id\".\n \" where status = 1 $client_part $project_part and timesheet_id is null\".\n \" and date >= \".$mdb2->quote($start).\" and date <= \".$mdb2->quote($end).\n \" and user_id = $user_id and group_id = $group_id and org_id = $org_id\";\n $affected = $mdb2->exec($sql);\n if (is_a($affected, 'PEAR_Error'))\n return false;\n\n return $last_id;\n }",
"public function testTimesheetsTimesheetIDPost()\n {\n }",
"public function testTimesheetsPost()\n {\n }",
"public static function generateNewTimesheetForUser($id_user)\n\t{\n\t\ttry {\n\t\t\t$newTimesheet = Yii::app()->db->createCommand()->insert('timesheets', array(\n\t\t\t\t\t'timesheet_cod' => '00000',\n\t\t\t\t\t'id_user'\t\t=> $id_user,\n\t\t\t\t\t'week'\t\t\t=> date('W'),\n\t\t\t\t\t'week_start'\t=> (date('w') == 1 ? date('Y-m-d H:i:s', strtotime('previous sunday')) : date('Y-m-d H:i:s', strtotime('previous sunday'))),\n\t\t\t\t\t'week_end'\t\t=> (date('w') == 0 ? date('Y-m-d H:i:s', strtotime('today')) : date('Y-m-d H:i:s', strtotime('next saturday'))),\n\t\t\t\t\t'status'\t\t=> Timesheets::STATUS_NEW\n\t\t\t));\n\t\t\t\t\n\t\t\tif($newTimesheet == 1)\n\t\t\t{\n\t\t\t\t$nextTimesheetId = Yii::app()->db->getLastInsertId('timesheets');\n\t\t\t\tTimesheets::model()->updateByPk($nextTimesheetId, array('timesheet_cod' => Utils::paddingCode($nextTimesheetId)));\n\t\t\t\t\n\t\t\t\t// Inserting the default tasks from user group\n\t\t\t\t$defaultTasks = Users::getUserDefaultTasksById($id_user);\n\t\t\t\t$values = '';\n\t\t\t\tforeach($defaultTasks as $defaultTask)\n\t\t\t\t{\n\t\t\t\t\t$values .= '(' . $id_user . ', ' . $defaultTask['id_task'] . ', ' . $nextTimesheetId . ', \"' . (date('w') == 1 ? date('Y-m-d H:i:s', strtotime('today')) : date('Y-m-d H:i:s', strtotime('previous sunday'))) . '\", 1),';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// if string is not empty insert all values into the table\n\t\t\t\tif($values != '')\n\t\t\t\t{\n\t\t\t\t\t$values = rtrim($values, \",\");\n\t\t\t\t\t$nextUserTimes = Yii::app()->db->createCommand('INSERT INTO user_time(id_user, id_task, id_timesheet, date, `default`) VALUES ' . $values)->execute();\n\t\t\t\t}\n\t\t\t\techo \"Timesheet Code \".Utils::paddingCode($nextTimesheetId).\" for user \". $id_user.\" for week \".(date('W')).\" was created.<br />\";\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\techo \"Timesheet for user \". $id_user.\" for week \".(date('W')).\" WAS NOT created.<br />\";\n\t\t}\n\t}",
"public static function create($timesheet)\n {\n $filename = \"timesheet_{$timesheet->created_at->getTimestamp()}_{$timesheet->user->snakecase_name}.pdf\";\n $storage = Storage::disk('temporary');\n\n if ($storage->missing($filename)) {\n $dompdf = new Dompdf();\n $dompdf->loadHtml(view('pdf.timesheet', [\n 'timesheet' => $timesheet,\n ]));\n $dompdf->setPaper('A4', 'portrait');\n $dompdf->render();\n $storage->put($filename, $dompdf->output());\n }\n\n return $storage->path($filename);\n }",
"public function createTimesheet($xeroTenantId, $timesheets)\n {\n ['model' => $model, 'request' => $request, 'response' => $response]\n = $this->createTimesheetWithHttpInfo($xeroTenantId, $timesheets);\n\n $statusCode = (int)$response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $request,\n $response,\n $model\n );\n }\n\n return $model;\n }",
"public function generateTimesheets(){\n\n //Check db for active users\n $query = mysqli_query($this->con, \"SELECT * FROM users WHERE is_deleted='no'\");\n if (mysqli_num_rows($query)>0){\n\n while ($row = mysqli_fetch_array($query)){\n $empId = $row['user_id'];\n $hasCurrent = false;\n $count=0;\n\n //check db for existing timesheets\n $timesheetQuery = mysqli_query($this->con, \"SELECT * FROM timesheets WHERE emp_id='$empId'\");\n if (mysqli_num_rows($timesheetQuery)>0){\n while ($timesheetRow = mysqli_fetch_array($timesheetQuery)){\n $sheetDate = $timesheetRow['week_start'];\n if (strtotime($sheetDate) == strtotime($this->getCurrentTimesheetDate())){\n $hasCurrent = true;\n }\n $count++;\n }\n }\n $start = $this->getCurrentTimesheetDate();\n $end = date(\"Y-m-d\", (strtotime($start) + (60*60*24*13)));\n $count++;\n\n //creates new current timesheet if user is not current\n if ($hasCurrent == false){\n $addQuery = mysqli_query($this->con, \"INSERT INTO timesheets VALUES('$empId', '$count', '$start', '$end', '', 'no', 'no','0','no')\");\n }\n }\n }\n }",
"public function createTimesheetRequest($xeroTenantId, $timesheets)\n {\n // Verify the required parameter 'xeroTenantId' is set\n\n if ($xeroTenantId === null || (is_array($xeroTenantId) && count($xeroTenantId) === 0)) {\n throw new InvalidArgumentException(sprintf(\n 'Missing the required parameter $%s when calling %s',\n 'xeroTenantId',\n 'createTimesheet'\n ));\n }\n // Verify the required parameter 'timesheets' is set\n\n if ($timesheets === null || (is_array($timesheets) && count($timesheets) === 0)) {\n throw new InvalidArgumentException(sprintf(\n 'Missing the required parameter $%s when calling %s',\n 'timesheets',\n 'createTimesheet'\n ));\n }\n\n $resourcePath = '/Timesheets';\n $formParams = [];\n $queryParams = [];\n $httpBody = null;\n $multipart = false;\n\n \n\n\n\n // Body parameter\n $_tempBody = null;\n if (isset($timesheets)) {\n $_tempBody = $timesheets;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // Header parameters\n if ($xeroTenantId !== null) {\n $headers['Xero-Tenant-Id'] = ObjectSerializer::toHeaderValue($xeroTenantId);\n }\n\n // For model (json/xml)\n\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present.\n\n if ($headers['Content-Type'] === 'application/json') {\n $httpBodyText = $this->jsonEncode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBodyText = $_tempBody;\n }\n\n $httpBody = $this->createStream($httpBodyText);\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n\n // FIXME: how do we do multiparts with PSR-7?\n // MultipartStream() is a Guzzle tool.\n\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = $this->createStream($this->jsonEncode($formParams));\n\n } else {\n // for HTTP post (form)\n $httpBody = $this->createStream($this->buildQuery($formParams));\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n return $this->buildHttpRequest(\n $headers,\n $queryParams,\n $httpBody,\n 'POST',\n $resourcePath\n );\n }",
"private function createSpreadSheet()\n {\n try {\n $sheetService = new \\Google_Service_Sheets($this->googleClient);\n\n $spreadSheetService = new \\Google_Service_Sheets_Spreadsheet([\n 'properties' => [\n 'title' => 'Xml Data #' . time()\n ]\n ]);\n\n $spreadsheet = $sheetService->spreadsheets->create($spreadSheetService, [\n 'fields' => 'spreadsheetId'\n ]);\n\n $this->spreadSheetId = $spreadsheet->spreadsheetId;\n }\n catch (\\Exception $e) {\n $this->logger->error('Can\\'t create spreadsheet' . $e->getMessage());\n return false;\n }\n\n return true;\n }",
"public function actionCreate()\n {\n $model = new Timetable();\n $model->setScenario('timetable-create');\n $groupsArray = Group::getGroupArray();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success',\n Module::t('timetable-admin', 'Created record \"{group} | {weekDay} | {start} - {end}\".',\n [\n 'group' => $groupsArray[$model->group_id],\n 'weekDay' => $model->getWeekArray()[$model->week_day],\n 'start' => Yii::$app->formatter->asTime(strtotime($model->start), 'H:i'),\n 'end' => Yii::$app->formatter->asTime(strtotime($model->end), 'H:i'),\n ]\n ));\n\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'groupsArray' => $groupsArray,\n ]);\n }\n }",
"public function testTimesheetsTimesheetIDGet()\n {\n }",
"public function admin_timecard_create($data)\n\t{\n\t\t$this->db->insert('timesheets', $data);\n\t}",
"protected function createFile()\n {\n if (!$this->_created) {\n $workbook = $this->getWorkbook();\n $i = 0;\n foreach ($this->sheets as $title => $config) {\n if (is_string($config)) {\n $config = ['class' => $config];\n } elseif (is_array($config)) {\n if (!isset($config['class'])) {\n $config['class'] = ExcelSheet::className();\n }\n } elseif (!is_object($config)) {\n throw new \\Exception('Invalid sheet configuration');\n }\n $sheet = (0===$i++) ? $workbook->getActiveSheet() : $workbook->createSheet();\n if (is_string($title)) {\n $sheet->setTitle($title);\n }\n Yii::createObject($config, [$sheet])->render();\n }\n $this->getWriter()->save((string) $this->getTmpFile());\n $this->_created = true;\n }\n }",
"public function init(){\n\t\t$empId = $this->getCurrentProfileId();\n\t\tif(date('w', strtotime(\"now\")) == 0) {\n\t\t\t$start = date(\"Y-m-d\", strtotime(\"now\"));\n\t\t}else{\n\t\t\t$start = date(\"Y-m-d\", strtotime(\"last Sunday\"));\n\t\t}\n\t\t\n\t\tif(date('w', strtotime(\"now\")) == 6) {\n\t\t\t$end = date(\"Y-m-d\", strtotime(\"now\"));\n\t\t}else{\n\t\t\t$end = date(\"Y-m-d\", strtotime(\"next Saturday\"));\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$timeSheet = new EmployeeTimeSheet();\n\t\t$timeSheet->Load(\"employee = ? and date_start = ? and date_end = ?\",array($empId,$start,$end));\n\t\tif($timeSheet->date_start == $start && $timeSheet->employee == $empId){\n\t\t\t\t\n\t\t}else{\n\t\t\tif(!empty($empId)){\n\t\t\t\t$timeSheet->employee = $empId;\n\t\t\t\t$timeSheet->date_start = $start;\n\t\t\t\t$timeSheet->date_end = $end;\n\t\t\t\t$timeSheet->status = \"Pending\";\n\t\t\t\t$ok = $timeSheet->Save();\n\t\t\t\tif(!$ok){\n\t\t\t\t\tLogManager::getInstance()->info(\"Error creating time sheet : \".$timeSheet->ErrorMsg());\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t//Generate missing timesheets\n\t\t\n\t\t\n\t}",
"function createTourLogSheet($name, $data, &$workBook, $writeStats){\n\t$file = 0;\n\t$excel = 1;\n\t$cols = array('Tour ID', 'Date/Time', 'Majors', 'Student', 'Parent', 'People', 'School', 'Year', 'City', 'State', 'Email', 'Phone', 'Tour Status', 'Comments from Family', 'Comments from Ambassadors');\n\t$entries = array('id', 'tourTime', 'majorsOfInterest', 'studentName', 'parentName', 'numPeople', 'school', 'yearInSchool', 'city', 'state', 'email', 'phone', 'status', 'tourComments', 'ambComments');\n\n\t$tourDayCounts = array_fill(0, 7, 0);\n\t$tourWeekCounts = array_fill(0, 53, 0);\n\t$tourDateCounts = array_fill(0, 53, null);\n\t$weekStrings = array();\n\t$numSemesterTours = count($data);\n\t$timeStringLength = 0;\n\tif($excel)\n\t\t$tourSheet = & $workBook->add_worksheet($name. ' Tours');\n\tif($file)\n\t\tfwrite($f, \"\\nWorksheet: $name Tours\\n\");\n\t$numCols = count($cols);\n\tfor($col = 0; $col < $numCols; $col++){\n\t\t$colName = $cols[$col];\n\t\t$colRef = $entries[$col];\n\t\t$maxWidth = getTextWidth($colName);\n\t\tif($excel)\n\t\t\t$tourSheet->write_string(0, $col, $colName);\n\t\tif($file)\n\t\t\tfwrite($f, \"Row: 0, Col: $col, $colRef: $colName, width:$maxWidth\\t\");\n\n\t\tfor($tour = 0; $tour < $numSemesterTours; $tour++){\n\t\t\t$text = $data[$tour][$colRef];\n\t\t\t$width = getTextWidth($text);\n\t\t\tif($width > $maxWidth){\n\t\t\t\t$maxWidth = $width;\n\t\t\t}\n\n\t\t\tif($excel){\n\t\t\t\tif(is_numeric($text)){\n\t\t\t\t\t$tourSheet->write_number($tour + 1, $col, intval($text));\n\t\t\t\t} else {\n\t\t\t\t\t$tourSheet->write_string($tour + 1, $col, $text);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($file)\n\t\t\t\tfwrite($f, \"Row: $tour, Col: $col, val: $text, width: $width\\t\");\n\n\t\t\t/*\n\t\t\t //formats do not work at the moment\n\t\t\t if($col == 0){\n\t\t\t\t$tourSheet->set_row($tour + 1, NULL, $formatOffset + ($tour % 2));\n\t\t\t}\n\t\t\t*/\n\t\t}\n\t\tif($file)\n\t\t\tfwrite($f, \"\\n\");\n\t\tif($excel)\n\t\t\t$tourSheet->set_column($col, $col, $maxWidth * (2.0/3.0));\n\t}\n\n\tfor($tour = 0; $tour < $numSemesterTours; $tour++){\n\t\tif($file)\n\t\t\tfwrite($f, \"Week 03: \".$tourWeekCounts[\"03\"].\"\\n\");\n\t\t//and now we add each tour to the stats\n\t\t$timestamp = strtotime($data[$tour]['tourTime']);\n\t\tif($file)\n\t\t\tfwrite($f, \"timestamp: $timestamp Time:\".$tour['tourTime'].\" Week: \".date('W', $timestamp).\"\\n\");\n\t\tif(($timestamp == false) || ($timestamp == -1)) continue;\n\t\t$tourDOW = intval(date('w', $timestamp));\n\t\t$tourDayCounts[\"$tourDOW\"] += 1;\n\t\t$tourWeek = intval(date('W', $timestamp));\n\t\t$tourWeekCounts[\"$tourWeek\"] += 1;\n\t\tif($tourDateCounts[\"$tourWeek\"] == null){\n\t\t\t$tourDateCounts[\"$tourWeek\"] = array_fill(0,7,0);\n\t\t}\n\t\t$tourDateCounts[\"$tourWeek\"][\"$tourDOW\"] += 1;\n\n\t\t//and create the date string for this week if it doesn't exist already\n\t\tif(!array_key_exists($tourWeek, $weekStrings)){\n\t\t\t$timeInfo = getdate($timestamp);\n\t\t\t$sunTimestamp = mktime(0,0,0, $timeInfo['mon'], $timeInfo['mday'] - $tourDOW, $timeInfo['year']);\n\t\t\t$satTimestamp = mktime(0,0,0, $timeInfo['mon'], $timeInfo['mday'] - $tourDOW + 6, $timeInfo['year']);\n\t\t\tif(date('M', $sunTimestamp) == date('M', $satTimestamp)){\n\t\t\t\t$timeStr = date('M j', $sunTimestamp) . ' - ' . date('j', $satTimestamp);\n\t\t\t} else {\n\t\t\t\t$timeStr = date('M j', $sunTimestamp) . ' - ' . date('M j', $satTimestamp);\n\t\t\t}\n\t\t\t$weekStrings[\"$tourWeek\"] = $timeStr;\n\t\t\t$tsl = getTextWidth($timeStr);\n\t\t\tif($tsl > $timeStringLength) $timeStringLength = $tsl;\n\t\t}\n\t}\n\n\tif(!$writeStats) return;\n\n\tif($excel)\n\t\t$statsSheet = &$workBook->add_worksheet($name.' Stats');\n\n\t//fill the column headers and set the the column widths\n\t$statsSheet->set_column(0, 0, $timeStringLength * (2.0/3.0));\n\t$statsSheet->write_string(0, 1, \"Monday\");\n\t$statsSheet->set_column(1, 1, getTextWidth(\"Monday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 2, \"Tuesday\");\n\t$statsSheet->set_column(2, 2, getTextWidth(\"Tuesday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 3, \"Wednesday\");\n\t$statsSheet->set_column(3, 3, getTextWidth(\"Wednesday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 4, \"Thursday\");\n\t$statsSheet->set_column(4, 4, getTextWidth(\"Thursday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 5, \"Friday\");\n\t$statsSheet->set_column(5, 5, getTextWidth(\"Friday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 6, \"Total\");\n\t$statsSheet->set_column(6, 6, getTextWidth(\"Total\") * (2.0/3.0));\n\n\t//then start populating all the data from the tours\n\t$numWeeks = count($tourDateCounts);\n\t$displayWeek = 0;\n\t//write the counts for each week\n\tfor($week = 0; $week < $numWeeks; $week++){\n\t\tif($file){\n\t\t\tfwrite($f, \"Week $week, Tours \".$tourWeekCounts[$week].\"\\n\");\n\t\t\tfor($i = 0; $i < 7; $i++){\n\t\t\t\tfwrite($f, \"Day $i, Tours \".$tourDateCounts[$week][$i].\"\\n\");\n\t\t\t}\n\t\t}\n\t\tif($tourWeekCounts[$week] == 0) continue;\n\t\t$statsSheet->write_string($displayWeek+1, 0, $weekStrings[$week]);\n\t\tfor($day = 1; $day < 6; $day++){\n\t\t\tif($excel)\n\t\t\t\t$statsSheet->write_number($displayWeek + 1, $day, $tourDateCounts[$week][$day]);\n\t\t\tif($file)\n\t\t\t\tfwrite($f, \"Week $week, Day $day, Tours \".$tourDateCounts[$week][$day].\"\\n\");\n\t\t}\n\t\t//write the totals for each week\n\t\tif($excel)\n\t\t\t$statsSheet->write_number($displayWeek + 1, 6, $tourWeekCounts[$week]);\n\t\tif($file)\n\t\t\tfwrite($f, \"Week $week, Total Tours \".$tourWeekCounts[$week].\"\\n\");\n\t\t$displayWeek++;\n\t}\n\t//then write the totals for the semester\n\tfor($day = 1; $day < 6; $day++){\n\t\tif($excel)\n\t\t\t$statsSheet->write_number($displayWeek + 1, $day, $tourDayCounts[$day]);\n\t\tif($file)\n\t\t\tfwrite($f, \"Day $day, Total Tours \".$tourDayCounts[$day].\"\\n\");\n\t}\n\n\tif($excel)\n\t\t$statsSheet->write_number($displayWeek + 1, 6, $numSemesterTours);\n\tif($file)\n\t\tfwrite($f, \"Total Tours: $numSemesterTours\\n\");\n\n\tunset($tourDayCounts);\n\tunset($tourWeekCounts);\n\tunset($tourDateCounts);\n\tunset($weekStrings);\n}",
"public function saveTimesheet()\n {\n $query = \"INSERT INTO Timesheets (Date, TimeFrom, TimeTo, Contract, JobNumber, Estimate, Exchange, UserId, Status, Comments)\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n //$query = \"select * FROM registered_users WHERE id = ?\";\n $paramType = \"sssssssiss\";\n $paramArray = array(\n $this->timesheetProperties['date'],\n $this->timesheetProperties['timefrom'],\n $this->timesheetProperties['timeto'],\n $this->timesheetProperties['contract'],\n $this->timesheetProperties['jobnumber'],\n $this->timesheetProperties['estimate'],\n $this->timesheetProperties['exchange'],\n $_SESSION[\"userId\"],\n 'pending',\n $this->timesheetProperties['comments']\n );\n $currentTimesheetID = $this->ds->insert($query, $paramType, $paramArray);\n //echo \"timesheet ID : \" . $currentTimesheetID;\n\n /* Save synthetic details */\n\n /*\n * Save planned synthetic\n */\n $syntheticName = $this->timesheetProperties['plannedsynthetic'][1][\"'plannedsynthetic'\"];\n $syntheticQuantity = $this->timesheetProperties['plannedsynthetic'][1][\"'quantity'\"];\n\n $query = \"INSERT INTO Synthetics (TimesheetID, Name, Quantity, syntheticType)\n VALUES (?, ?, ?, ?)\";\n $paramType = \"isis\";\n $paramArray = array($currentTimesheetID, $syntheticName, $syntheticQuantity, 'planned');\n $memberResult = $this->ds->insert($query, $paramType, $paramArray);\n\n /*\n * Save unplanned synthetic\n *\n */\n $syntheticName = $this->timesheetProperties['unplannedsynthetic'][1][\"'unplannedsynthetic'\"];\n $syntheticQuantity = $this->timesheetProperties['unplannedsynthetic'][1][\"'quantity'\"];\n\n $query = \"INSERT INTO Synthetics (TimesheetID, Name, Quantity, syntheticType)\n VALUES (?, ?, ?, ?)\";\n $paramType = \"isis\";\n $paramArray = array($currentTimesheetID, $syntheticName, $syntheticQuantity, 'unplanned');\n $memberResult = $this->ds->insert($query, $paramType, $paramArray);\n\n\n\n\n //$syntheticQuantity = $this->timesheetProperties['plannedsynthetic'][1];\n\n // dispatch email to submitter\n $email = \"nvrwdu@hotmail.com\";\n $this->sendMailTo($email);\n $this->sendMailTo($email, true);\n\n }",
"public function create()\n {\n if($this->courseSectionID != null && $this->dayOfWeek != null && $this->startTime != null && $this->endTime != null)\n {\n $data = array('CourseSectionID' => $this->courseSectionID, 'DayOfWeek' => $this->dayOfWeek, 'StartTime' => $this->startTime, 'EndTime' => $this->endTime);\n \n $this->db->insert('CourseSectionTimes', $data);\n \n return $this->db->affected_rows() > 0;\n }\n \n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get rulers by denomination | public function getRomanDenomRuler($denomination) {
$rulers = $this->getAdapter();
$select = $rulers->select()
->from($this->_name, array(
'id','term' => 'CONCAT(issuer," (",date1," - ",date2,")")'))
->joinLeft('denominations_rulers',
'rulers.id = denominations_rulers.ruler_id', array())
->joinLeft('denominations',
'denominations.id = denominations_rulers.denomination_id',
array())
->where('denominations.id = ?', (int)$denomination)
->order('issuer ASC');
return $rulers->fetchAll($select);
} | [
"public function getRulerDenomination( $id) {\n $options = $this->getAdapter();\n $select = $options->select()\n ->from($this->_name, array('id','denomination'))\n ->joinLeft('denominations_rulers','denominations.id = denominations_rulers.denomination_id',\n array())\n ->joinLeft('rulers','rulers.id = denominations_rulers.ruler_id',\n array('i'=>'rulers.id', 'issuer'))\n ->where('denominations_rulers.denomination_id= ?',(int)$id)\n ->group('issuer');\n return $options->fetchAll($select);\n }",
"public function getRomanRulerDenom($id) {\n $select = $this->select()\n ->from($this->_name, array('id', 'term' => 'denomination'))\n ->joinLeft('denominations_rulers', 'denominations.id = denominations_rulers.denomination_id',\n array())\n ->joinLeft('rulers','rulers.id = denominations_rulers.ruler_id', array())\n ->where('denominations_rulers.ruler_id= ?', $id);\n return $this->getAdapter()->fetchAll($select);\n }",
"public function denominations()\n {\n return $this->hasMany(Denomination::class, \"network_id\", \"network_id\");\n }",
"public function getRatioList();",
"public function getMedievalRulersList() {\n $key = md5('medievalListRulers');\n if (!$data = $this->_cache->load()) {\n $rulers = $this->getAdapter();\n $select = $rulers->select()\n ->from($this->_name)\n ->where('period = ?',(int)29)\n ->order('id');\n $data = $rulers->fetchAll($select);\n $this->_cache->save($data, $key);\n }\n return $data;\n }",
"protected static function getRatios()\n {\n $rate = 10;\n $ratios = [\n static::KM => 0,\n static::HM => 1,\n static::DAM => 2,\n static::M => 3,\n static::DM => 4,\n static::CM => 5,\n static::MM => 6,\n ];\n\n return array_map(function ($ratio) use ($rate) {\n return static::calculate($rate, '^', $ratio);\n }, $ratios);\n }",
"public function getIronAgeDenoms() {\n $denoms = $this->getAdapter();\n $select = $denoms->select()\n ->from($this->_name, array('id', 'denomination'))\n ->where('period = ?', (int)16)\n ->where('valid = ?', (int)1)\n ->order('id');\n return $denoms->fetchAll($select);\n }",
"public function denominationAction() {\n\tif($this->_getParam('id',false)){\n\t$id = (int)$this->_getParam('id');\n\t$denoms = new Denominations();\n\t$this->view->denoms = $denoms->getDenom($id,$this->_period);\n\t$rulers = new Denominations();\n\t$this->view->rulers = $rulers->getRulerDenomination($id);\n\t} else {\n\t\tthrow new Pas_Exception_Param($this->_missingParameter);\n\t}\n\t}",
"public function denominationAction() {\n\tif($this->_getParam('id',false)) {\n\t\n\t$id = (int)$this->_getParam('id');\n\t$this->view->id = $id;\n\t\n\t$denoms = new Denominations();\n\t$this->view->denoms = $denoms->getDenom($id,(int)$this->_period);\n\t\n\t$rulers = new Denominations();\n\t$this->view->rulers = $rulers->getRulerDenomination((int)$id);\n\t\n\t} else {\n\tthrow new Pas_Exception_Param($this->_missingParameter); \n\t}\n\t}",
"public function getPerItemRate();",
"public function getIronAgeDenom() {\n $denoms = $this->getAdapter();\n $select = $denoms->select()\n ->from($this->_name, array('id', 'denomination'))\n ->where('period = ?', (int)16)\n ->order('id');\n return $denoms->fetchAll($select);\n }",
"public function getRates();",
"public function getDenominacion()\n {\n return $this->denominacion;\n }",
"public function getIronAgeRulers() {\n $rulers = $this->getAdapter();\n $select = $rulers->select()\n ->from($this->_name, array('id','issuer'))\n ->where('period = ?', (int)16)\n ->order('issuer ASC');\n return $rulers->fetchPairs($select);\n }",
"public function getRut(): array\n {\n return $this->rut;\n }",
"function get_divide_denial_accounts()\n\t{\n\t return $this->db->select()\n\t\t ->from('pamm_accounts')\n\t\t ->where('divide_denial','1')\n\t\t ->get()->result();\n\t}",
"public function librasDolares(){\n return $this->numero*1.3922;\n }",
"function radiusToMeter($r){\n\treturn $r*111.2*1000;\n}",
"public function getDiscountRates();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
use the Amara API to create a new subtitle entry for this median entry | function send_entry_to_amara($mid) {
/*
what needs to happen:
- get entry's title, duration, and thumbnail URL
- copy/link the entry to a sandbox with a random video URL
- package title, thumbnail, sandbox URL
- send that to the Amara API
- store the Amara ID that's given back
*/
global $sandbox_base_path, $sandbox_base_url, $amara_base_url, $amara_headers, $m6db, $mdb, $median_base_url;
if (!is_numeric($mid) || $mid * 1 == 0) {
return array( 'ok' => false, 'error' => 'invalid MID supplied to the function' );
}
$mid = (int) $mid * 1;
$info = getMediaInfo($mid);
if ($info == false) {
return array( 'ok' => false, 'error' => 'could not get info for MID #'.$mid );
}
// make a random strong sandbox URL
$random_filename = $mid.'_'.bin2hex(openssl_random_pseudo_bytes(16)).'.mp4';
$sandbox_fullpath = $sandbox_base_path . $random_filename;
$sandbox_url = $sandbox_base_url . $random_filename;
// choose which video to use for captioning...
$original_file_fullpath = '';
foreach ($info['pa']['c'] as $media_path) {
if (!isset($media_path['e']) || $media_path['e'] == false) {
continue;
}
if ($media_path['b'] > 500 && $media_path['b'] < 1000) {
$original_file_fullpath = $media_path['p'];
}
}
if ($original_file_fullpath == '' && isset($info['pa']['c'][0]) && isset($info['pa']['c'][0]['p'])) {
if (!isset($info['pa']['c'][0]['e']) || $info['pa']['c'][0]['e'] == false) {
// hmm
return array( 'ok' => false, 'error' => 'no video file to use for subtitles' );
} else {
$original_file_fullpath = $info['pa']['c'][0]['p']; // welp. just get the first one if it's the only one left.
}
}
// ok so we're gonna put in a file operation
// to symlink $sandbox_fullpath => $original_file_fullpath
$fileop_queue_result = addSymlinkToOperationsQueue($original_file_fullpath, $sandbox_fullpath);
if ($fileop_queue_result == false) {
// uh oh
return array( 'ok' => false, 'error' => 'error inserting symlink op into file ops queue' );
}
// the amara call will be a POST request
$amara_call_type = 'POST';
$creating_new_amara_entry = false;
// ok first check to see if there's already an Amara ID for this median entry
// if so, add the new URL, instead of a POST for a new video
if (isset($info['amara']) && trim($info['amara']) != '') {
// data to send to amara to update an existing entry with a new primary URL
// to /api2/partners/videos/[video-id]/urls/
// based on: http://amara.readthedocs.org/en/latest/api.html#video-url-resource
$amara_api_url = $amara_base_url . '/api2/partners/videos/'.trim($info['amara']).'/urls/';
$data_for_amara = array();
$data_for_amara['url'] = $sandbox_url;
$data_for_amara['primary'] = true;
} else {
// data to send to amara to create a new entry
$amara_api_url = $amara_base_url . '/api/videos/';
// this is the object we'll send to the Amara API
$data_for_amara = array();
$data_for_amara['title'] = $info['ti'];
$data_for_amara['video_url'] = $sandbox_url;
$data_for_amara['duration'] = $info['du'];
$data_for_amara['thumbnail'] = substr($median_base_url, 0, -1).str_replace('/thumbs/', '/files/thumb/', $info['th']['b']);
$data_for_amara['team'] = 'emerson';
$creating_new_amara_entry = true;
}
// serialize the info into JSON
$post_data_string = json_encode($data_for_amara);
// set up the final HTTP headers for sending to Amara
$final_headers = array();
$final_headers[] = 'Content-Type: application/json';
$final_headers[] = 'Content-Length: ' . strlen($post_data_string);
$final_headers = array_merge($amara_headers, $final_headers);
// we'll use curl to send the video entry's info to amara
$amara_post_new_curl = curl_init();
curl_setopt($amara_post_new_curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($amara_post_new_curl, CURLOPT_URL, $amara_api_url);
curl_setopt($amara_post_new_curl, CURLOPT_PORT, 443);
curl_setopt($amara_post_new_curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($amara_post_new_curl, CURLOPT_HEADER, 0);
curl_setopt($amara_post_new_curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($amara_post_new_curl, CURLOPT_HTTPHEADER, $final_headers);
curl_setopt($amara_post_new_curl, CURLOPT_CUSTOMREQUEST, $amara_call_type);
curl_setopt($amara_post_new_curl, CURLOPT_POSTFIELDS, $post_data_string);
// the API call should return JSON as well...
$amara_entry_info = curl_exec($amara_post_new_curl);
// check for curl errors
if (curl_errno($amara_post_new_curl) > 0) {
return array( 'ok' => false, 'error' => 'Error fetching entry info from Amara: ' . curl_error($amara_post_new_curl) );
}
// decode it...
$amara_entry_data = json_decode($amara_entry_info, true);
if (!$amara_entry_data) {
return array( 'ok' => false, 'error' => 'error decoding amara data result: '.$amara_entry_info );
}
if (isset($amara_entry_data['id']) && trim($amara_entry_data['id']) != '') {
//echo '<p>new amara ID: '.$amara_entry_data['id'].'</p>';
$amara_id = $amara_entry_data['id'];
} else {
// problems
return array( 'ok' => false, 'error' => 'did not get an Amara ID back from Amara: '.print_r($amara_entry_data, true) );
}
curl_close($amara_post_new_curl);
// things to update the media entry with
$updated_entry = array();
if ($creating_new_amara_entry) {
// only save the amara ID if we've made a new amara entry
$updated_entry['amara'] = $amara_id;
}
$updated_entry['sbx'] = array();
$updated_entry['sbx']['url'] = $sandbox_url;
$updated_entry['sbx']['path'] = $sandbox_fullpath;
// update median entry
try {
$update_entry = $mdb->media->update( array('mid' => $mid), array('$set' => $updated_entry), array( 'w' => 1 ) );
} catch(MongoCursorException $e) {
//echo 'error saving to database: '.print_r($e, true)."\n";
return array( 'ok' => false, 'error' => 'error saving to database: '.print_r($e, true) );
}
// all done? cool
return array( 'ok' => true );
} | [
"function subtitle_entry($subtitle_file, &$object) {\n $iso639 = new Matriphe\\ISO639\\ISO639;\n\n $search_str = strtolower(substr($subtitle_file, strripos($subtitle_file, '.', -5)));\n $file_ext = substr($subtitle_file, -4);\n\n foreach ($iso639->allLanguages() as $languages) {\n if ($this->find_correct_language($search_str, $languages)) {\n $object->{sprintf(\"html5x:subtitle:%s:%s\", $languages[0], $languages[4])} = $this->action_url_encoded(\"\", str_replace($this->path, \"\", $subtitle_file));\n return;\n }\n }\n // odd sub file name, assume it's English\n $object->{\"html5x:subtitle:en:English\"} = $this->action_url_encoded(\"\", str_replace($this->path, \"\", $subtitle_file));\n }",
"public function newSubtitle() {\n $this->subtitle = new \\WBW\\Bundle\\HighchartsBundle\\API\\Chart\\HighchartsSubtitle();\n return $this->subtitle;\n }",
"public static function _add_subtitle_meta_box() {\n\n\t\tglobal $post;\n\n\t\t$value = self::get_admin_subtitle_value( $post );\n\n\t\techo '<input type=\"hidden\" name=\"wps_noncename\" id=\"wps_noncename\" value=\"' . wp_create_nonce( 'wp-subtitle' ) . '\" />';\n\n\t\t// As of WordPress 4.3 no need to esc_attr() AND htmlentities().\n\t\t// @see https://core.trac.wordpress.org/changeset/33271\n\t\techo '<input type=\"text\" id=\"wpsubtitle\" name=\"wps_subtitle\" value=\"' . esc_attr( $value ) . '\" autocomplete=\"off\" placeholder=\"' . esc_attr( apply_filters( 'wps_subtitle_field_placeholder', __( 'Enter subtitle here', 'wp-subtitle' ) ) ) . '\" style=\"width:99%;\" />';\n\n\t\techo apply_filters( 'wps_subtitle_field_description', '', $post );\n\n\t}",
"function sync_captions_from_amara($mid) {\n /*\n \n what needs to happen:\n \n - get entry info and amara ID\n - get captions from amara via API\n - convert captions to JSON\n - save JSON to median captions collection\n \n */\n global $mdb, $m6db;\n $amara_id = getAmaraSubtitlesID($mid);\n if ($amara_id == false) {\n return array( 'ok' => false, 'error' => 'No Amara ID present for that Median entry' );\n }\n $get_subtitles_result = get_subtitles_from_amara($amara_id);\n if ($get_subtitles_result['ok'] == true) {\n \t// ok now convert to JSON\n \t$subtitle_convert_result = convert_subtitles_to_json($get_subtitles_result['data']);\n \tif ($subtitle_convert_result['ok'] == true) {\n \t\t$subtitles_record = array();\n \t\t$subtitles_record['mid'] = $mid;\n \t\t$subtitles_record['ts'] = time();\n \t\t$subtitles_record['captions'] = $subtitle_convert_result['data'];\n \t\ttry {\n \t\t\t$upsert_captions = $m6db->captions->update( array('mid' => $mid), array('$set' => $subtitles_record), array( 'upsert' => true, 'w' => 1 ) );\n \t\t\treturn array('ok' => true);\n \t\t} catch(MongoCursorException $e) {\n return array('ok' => false, 'error' => 'error saving to database: '.print_r($e, true));\n \t\t}\n \t} else {\n return array('ok' => false, 'error' => 'error converting subtitles: '.$subtitle_convert_result['error']);\n \t}\n } else {\n return array('ok' => false, 'error' => 'error getting subtitles: '.$get_subtitles_result['error']);\n }\n}",
"function sierra_page_subtitle_meta() {\r\n\tadd_meta_box( 'page-subtitle-meta-box-id', esc_html__( 'Page Subtitle', 'sierra' ), 'sierra_meta_display_callback', 'page', 'side' );\r\n}",
"public function subtitle($subtitle)\n {\n $this->subtitle = $subtitle;\n\n return $this;\n }",
"function save_subtitle_metadata( $post_id, $post ) {\n\t\t\n\t\t// If we're not in the right place, bailout!\n\t\tif( ! isset( $post ) || wp_is_post_autosave( $post ) || wp_is_post_revision( $post ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t\n\t\t/**\n\t\t * List of acceptable post types to display this metadata on\n\t\t *\n\t\t * @param Array - Array of dfeault post types\n\t\t *\n\t\t * @return Array\n\t\t */\n\t\t$acceptable_types = apply_filters( 'wpse_subtitle_post_types', $this->post_types );\n\t\t\n\t\t// If this isn't an acceptable post type, bailout!\n\t\tif( empty( $acceptable_types ) || ! in_array( $post->post_type, $acceptable_types ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Ensure our nonce is intact\n\t\tif( isset( $_POST, $_POST['wpse279493_subtitle_metadisplay_field'] ) && wp_verify_nonce( $_POST['wpse279493_subtitle_metadisplay_field'], 'wpse279493_subtitle_metadisplay' ) ) {\n\t\t\t\n\t\t\t// Save our subtitle metadata OR delete postmeta if left empty\n\t\t\tif( isset( $_POST['wpse_subtitle'] ) && ! empty( $_POST['wpse_subtitle'] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'wpse_subtitle', sanitize_text_field( $_POST['wpse_subtitle'] ) );\n\t\t\t} else {\n\t\t\t\tdelete_post_meta( $post_id, 'wpse_subtitle' );\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}",
"function evoss_new_speaker(){\r\n\t\t\tglobal $evo_speak;\r\n\r\n\t\t\t$term_name = esc_attr(stripslashes($_POST['evo_speaker_name']));\r\n\t\t\t$term = term_exists( $term_name, 'event_speaker');\r\n\t\t\t$post_id = $_POST['eventid'];\r\n\r\n\t\t\t$termid = false;\r\n\r\n\t\t\t// Term Exist\r\n\t\t\tif($term !== 0 && $term !== null){\r\n\t\t\t\twp_set_object_terms( $post_id, $term_name, 'event_speaker', true);\r\n\t\t\t\t$termid = isset($_POST['termid'])?$_POST['termid']: $term->term_id;\r\n\t\t\t\tif(!empty($_POST['evo_speaker_desc'])){\r\n\t\t\t\t\twp_update_term($termid, 'event_speaker', array(\r\n\t\t\t\t\t\t'description'=> stripslashes($_POST['evo_speaker_desc'])\r\n\t\t\t\t\t));\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\t// create slug from name\r\n\t\t\t\t\t$trans = array(\" \"=>'-', \",\"=>'');\r\n\t\t\t\t\t$term_slug= strtr($term_name, $trans);\r\n\r\n\t\t\t\t// create wp term\r\n\t\t\t\t$new_term_ = wp_insert_term( $term_name, 'event_speaker', array(\r\n\t\t\t\t\t'slug'=>$term_slug,\r\n\t\t\t\t\t'description'=> (!empty($_POST['evo_speaker_desc'])? $_POST['evo_speaker_desc']: '')\r\n\t\t\t\t) );\r\n\r\n\t\t\t\t// if term created correctly\r\n\t\t\t\tif(!is_wp_error($new_term_)){\r\n\t\t\t\t\t$termid = (int)$new_term_['term_id'];\r\n\t\t\t\t\twp_set_object_terms( $post_id, array($termid), 'event_speaker', true);\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\r\n\t\t\t// if term good, save term meta values\r\n\t\t\tif($termid){\r\n\t\t\t\tforeach($evo_speak->functions->speaker_fields() as $field=>$var){\r\n\t\t\t\t\tif($field=='evo_speaker_desc') continue;\r\n\t\t\t\t\tif(!empty($_POST[$field])){\r\n\t\t\t\t\t\t$newtermmeta[$field]= $_POST[$field];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tevo_save_term_metas('event_speaker',$termid, $newtermmeta);\t\r\n\r\n\t\t\t\t// get new content\r\n\t\t\t\t\t$speaker_terms = wp_get_post_terms($post_id, 'event_speaker');\r\n\t\t\t\t\t$content = ''; $list = ''; $existing_tax_ids = array();\r\n\r\n\t\t\t\t\t// if terms exists\r\n\t\t\t\t\tif ( $speaker_terms && ! is_wp_error( $speaker_terms ) ){\r\n\t\t\t\t\t\t$termMeta = get_option( \"evo_tax_meta\");\r\n\t\t\t\t\t\tforeach($speaker_terms as $speakerTerm){\r\n\t\t\t\t\t\t\t$existing_tax_ids[] = $speakerTerm->term_id;\r\n\t\t\t\t\t\t\t$content .= $evo_speak->functions->get_selected_item_html($speakerTerm, $termMeta);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$content .= \"<div class='clear'></div>\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// get updated terms list\r\n\t\t\t\t\t\t$allTerms = get_terms('event_speaker', array('hide_empty'=>false) );\r\n\t\t\t\t\t\tforeach ( $allTerms as $term ) {\r\n\t\t\t\t\t\t\t$checked = (count($existing_tax_ids)>0 && in_array($term->term_id, $existing_tax_ids))?\r\n\t\t\t\t\t\t\t\t'dot-circle-o': 'circle-o';\r\n\t\t\t\t\t\t\t$list.= $evo_speak->functions->get_tax_select_list($term, $checked);\r\n\t\t\t\t\t\t\tif($checked=='dot-circle-o') $selectedSpeakers[] = $term->term_id;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$list .= \"<input type='hidden' class='evo_tax_selected_list_values' name='event_speakers' value='\".implode(',',$selectedSpeakers).\"'/>\";\r\n\r\n\t\t\t\techo json_encode(array(\r\n\t\t\t\t\t'content'=>$content, \r\n\t\t\t\t\t'list'=>$list,\r\n\t\t\t\t\t'status'=>'good',\r\n\t\t\t\t\t'msg'=>__('Speaker Updated Successfully!','eventon')\r\n\t\t\t\t));\r\n\t\t\t\texit;\r\n\t\t\t}else{\r\n\t\t\t\techo json_encode(array(\r\n\t\t\t\t\t'status'=>__('Could not create term','eventon')\r\n\t\t\t\t));\r\n\t\t\t\texit;\r\n\t\t\t}\t\r\n\t\t}",
"private function saveSubtitlesAuth($subtitles) {\r\n\r\n $result = 0;\r\n $subtitleLines = $subtitles->subtitleLines;\r\n $mediaId = $subtitles->mediaId;\r\n \r\n if(!$this->_subtitlesWereModified($subtitleLines))\r\n return \"Provided subtitles have no modifications\";\r\n \r\n if(($errors = $this->_checkSubtitleErrors($subtitleLines)) != \"\")\r\n return $errors;\r\n \r\n $exerciseData = $this->getExerciseUsingMediaId($mediaId);\r\n if(!$exerciseData)\r\n \tthrow new Exception(\"Specified media could not be found\",1011);\r\n \r\n $this->conn->_startTransaction(); \r\n $optime = time();\r\n $subtitle_data = array();\r\n foreach($subtitleLines as $sl){\r\n $subline = array();\r\n $subline['start_time'] = $sl->showTime * 1000; //time representation in ms\r\n $subline['end_time'] = $sl->hideTime * 1000; //time representation in ms\r\n $subline['text'] = trim($sl->text);\r\n //For now we won't allow more than one voice per subtitle line\r\n if($sl->exerciseRoleName)\r\n $subline['meta']['voice'] = $sl->exerciseRoleName;\r\n \r\n $subtitle_data[] = $subline;\r\n }\r\n $subtitle_count = count($subtitle_data);\r\n $serialized_subtitles = $this->custom_json_encode($subtitle_data);\r\n $cb64_subtitles = $this->packblob($serialized_subtitles);\r\n \r\n $insert = \"INSERT INTO subtitle (fk_media_id, fk_user_id, language, complete, serialized_subtitles, subtitle_count, timecreated) VALUES (%d, %d, '%s', %d, '%s', %d, %d)\";\r\n $subtitleId = $this->conn->_insert($insert,$mediaId,$_SESSION['uid'],$exerciseData->language,$subtitles->complete, $cb64_subtitles, $subtitle_count, $optime);\r\n \r\n //Update the user's credit count\r\n $creditUpdate = $this->_addCreditsForSubtitling();\r\n if(!$creditUpdate){\r\n $this->conn->_failedTransaction();\r\n throw new Exception(\"Credit addition failed\");\r\n }\r\n\r\n //Update the credit history\r\n $creditHistoryInsert = $this->_addSubtitlingToCreditHistory($exerciseData->id);\r\n if(!$creditHistoryInsert){\r\n $this->conn->_failedTransaction();\r\n throw new Exception(\"Credit history update failed\");\r\n }\r\n\r\n if ($subtitleId && $creditUpdate && $creditHistoryInsert){\r\n $this->conn->_endTransaction();\r\n $result = $this->_getUserInfo();\r\n }\r\n\r\n return $result;\r\n\r\n }",
"public function createMosaic(Array $entry_video) {\n\t\t$file_save_3073 = 'mosaic/' . $entry_video['_id'] . '/3073.jpg';\n\n\t\t$dst_w = (int)(self::MOSAIC_WIDTH / self::MOSAIC_COLUMNS) - self::MOSAIC_MARGIN;\n\n\t\tswitch ($entry_video['full_video']['format']) {\n\t\t\tcase 'sbs2l':\n\t\t\tcase 'sbs2r':\n\t\t\t\t$src_w = (int)$entry_video['full_video']['orig_res']['w'] / 2;\n\t\t\t\t$src_h = $entry_video['full_video']['orig_res']['h'];\n\t\t\t\t$format_string = 'Side by side stereo';\n\t\t\t\tbreak;\n\t\t\tcase 'ab2l':\n\t\t\tcase 'ab2r':\n\t\t\t\t$src_w = $entry_video['full_video']['orig_res']['w'];\n\t\t\t\t$src_h = (int)$entry_video['full_video']['orig_res']['h'] / 2;\n\t\t\t\t$format_string = 'Above below stereo';\n\t\t\t\tbreak;\n\t\t\tcase 'mono':\n\t\t\t\t$src_w = $entry_video['full_video']['orig_res']['w'];\n\t\t\t\t$src_h = $entry_video['full_video']['orig_res']['h'];\n\t\t\t\t$format_string = 'Mono';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new \\Exception('Unknown format - ' . $entry_video['full_video']['format']);\n\t\t}\n\n\t\t$dst_h = ($src_h / $src_w) * $dst_w - self::MOSAIC_MARGIN;\n\n\t\t$im = imagecreatetruecolor(self::MOSAIC_WIDTH + self::MOSAIC_MARGIN,\n\t\t\t$dst_h * self::MOSAIC_ROWS + self::MOSAIC_MARGIN * (self::MOSAIC_ROWS + 1) + self::MOSAIC_FILE_DESC_HEIGHT);\n\n\t\t// Logo\n\t\t$im_logo = imagecreatefrompng(self::MOSAIC_LOGO);\n\t\timagecopy($im, $im_logo, 2400, 100, 0, 0, 625, 74);\n\n\t\t$color_desc = imagecolorallocate($im, 0xFF, 0xFF, 0xFF);\n\n\t\t/** @var \\Guzzle\\Service\\Resource\\Model $result */\n\t\t$entry_transcoding = $this->clientTranscoding->readJob(\n\t\t\tarray('Id' => (string)$entry_video['full_video']['job_id'])\n\t\t)->get('Job');\n\t\t$video_props = $entry_transcoding['Inputs'][0]['DetectedProperties'];\n\n\t\timagefttext(\n\t\t\t$im, 36, 0,\n\t\t\t15, 60,\n\t\t\t$color_desc, self::MOSAIC_FONT,\n\t\t\t'File: ' . substr(basename($entry_transcoding['Inputs'][0]['Key']), 6) . '; Produced by ' . $entry_video['link']['name']\n\t\t);\n\t\timagefttext(\n\t\t\t$im, 36, 0,\n\t\t\t15, 120,\n\t\t\t$color_desc, self::MOSAIC_FONT,\n\t\t\t'Size: ' . number_format($video_props['FileSize']) . ' bytes (' . number_format($video_props['FileSize'] / 1073741824, 2) . ' GB); ' .\n\t\t\t'Duration: ' . sprintf('%d:%02d:%02d', floor($entry_video['full_video']['length'] / 3600), floor($entry_video['full_video']['length'] / 60 % 60), $entry_video['full_video']['length'] % 60) . '; ' .\n\t\t\t'Avg. bitrate: ' . number_format((($video_props['FileSize'] / $entry_video['full_video']['length']) * 8) / 1048576, 2) . ' Mbit/sec'\n\t\t);\n\t\timagefttext(\n\t\t\t$im, 36, 0,\n\t\t\t15, 180,\n\t\t\t$color_desc, self::MOSAIC_FONT,\n\t\t\t'Audio: ' . $video_props['AudioCodec'] . '; ' . number_format($video_props['AudioBitrate'] / 1024) . ' kbit/sec'\n\t\t);\n\t\timagefttext(\n\t\t\t$im, 36, 0,\n\t\t\t15, 240,\n\t\t\t$color_desc, self::MOSAIC_FONT,\n\t\t\t'Video: ' . $video_props['VideoCodec'] . '; ' . $video_props['Width'] . 'x' . $video_props['Height'] . '; ' . number_format($video_props['VideoBitrate'] / 1048576, 2) . ' Mbit/sec; ' . $video_props['FrameRate'] . ' fps; ' . $format_string . '; ' . $entry_video['view_angle'] . '°'\n\t\t);\n\n\t\timagefttext(\n\t\t\t$im, 36, 0,\n\t\t\t15, 300,\n\t\t\t$color_desc, self::MOSAIC_FONT,\n\t\t\t'Hosted by SexLikeReal.com, HottiesVR.com, VRPornUpdates.com. Played with DeoVR.com video player'\n\t\t);\n\n\t\t$color_timestamp = imagecolorallocate($im, 0xFF, 0xFF, 0xFF);\n\t\t$shadow_timestamp = imagecolorallocate($im, 0x00, 0x00, 0x00);\n\n\t\tfor ($i = 1; $i <= self::MOSAIC_COLUMNS * self::MOSAIC_ROWS; $i++) {\n\t\t\t$thumb = $this->storage->fetchItem('mosaic/' . $entry_video['_id'] . '/thumbs_orig/' . sprintf('%\\'05d', $i) . '.png');\n\t\t\tif (empty($thumb)) {\n\t\t\t\t$this->log(\"\\nUNABLE TO FETCH FILE - \" . $i . \"\\n\", \\Zend_Log::ERR);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$thumb_im = imagecreatefromstring($thumb);\n\t\t\tif ($thumb_im === false) {\n\t\t\t\t$this->log(\"\\nUNABLE TO DECODE PNG - \" . $i . \"\\n\", \\Zend_Log::ERR);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$col = ($i - 1) % self::MOSAIC_COLUMNS;\n\t\t\t$row = floor(($i - 1) / self::MOSAIC_COLUMNS);\n\n\t\t\t$this->log($i . ' ~ ' . $col . '/' . $row . \"\\t\");\n\n\t\t\t$dst_x = $col * $dst_w + ($col + 1) * self::MOSAIC_MARGIN;\n\t\t\t$dst_y = $row * $dst_h + ($row + 1) * self::MOSAIC_MARGIN + self::MOSAIC_FILE_DESC_HEIGHT;\n\n\t\t\timagecopyresampled($im, $thumb_im,\n\t\t\t\t$dst_x, $dst_y,\n\t\t\t\t0, 0,\n\t\t\t\t$dst_w, $dst_h,\n\t\t\t\t$src_w, $src_h\n\t\t\t);\n\n\t\t\t$sec_current = round(($entry_video['full_video']['length'] / (self::MOSAIC_COLUMNS * self::MOSAIC_ROWS)) * ($i - 0.5));\n\t\t\t$timestamp = sprintf('%d:%02d:%02d', floor($sec_current / 3600), floor($sec_current / 60 % 60), $sec_current % 60);\n\t\t\t// Write frame time shadow\n\t\t\timagefttext(\n\t\t\t\t$im, 24, 0,\n\t\t\t\t($dst_x + $dst_w - 119), ($dst_y + $dst_h - 11),\n\t\t\t\t$shadow_timestamp, self::MOSAIC_FONT,\n\t\t\t\t$timestamp\n\t\t\t);\n\t\t\t// Write frame time\n\t\t\timagefttext(\n\t\t\t\t$im, 24, 0,\n\t\t\t\t($dst_x + $dst_w - 120), ($dst_y + $dst_h - 12),\n\t\t\t\t$color_timestamp, self::MOSAIC_FONT,\n\t\t\t\t$timestamp\n\t\t\t);\n\t\t}\n\n\t\t$im_watermark = imagecreatefrompng(self::MOSAIC_WATERMARK);\n\t\timagecopy($im, $im_watermark, (int)(self::MOSAIC_WIDTH / 2 - 240), (int)(imagesy($im) * 0.3 - 235), 0, 0, 481, 470);\n\t\timagecopy($im, $im_watermark, (int)(self::MOSAIC_WIDTH / 2 - 240), (int)(imagesy($im) * 0.66 - 235), 0, 0, 481, 470);\n\n\t\t$this->log(\"\\n\");\n\n\t\tob_start();\n\t\timagejpeg($im, null, 85);\n\t\t$thumb = ob_get_contents();\n\t\tob_end_clean();\n\n\t\t$s3_options_public = \\Dao\\Files\\AbstractClass::getS3Options();\n\n\t\t$this->storage->storeItem($file_save_3073, $thumb, $s3_options_public);\n\n\t\treturn true;\n\t}",
"public function addSubtitles($subtitlesId);",
"private function getATOMSubtitle() {\r\n $subtitle = '';\r\n if (isset($this->description['properties']['totalResults']) && $this->description['properties']['totalResults'] !== -1) {\r\n $subtitle = $this->context->dictionary->translate($this->description['properties']['totalResults'] === 1 ? '_oneResult' : '_multipleResult', $this->description['properties']['totalResults']);\r\n }\r\n $previous = isset($this->description['properties']['links']['previous']) ? '<a href=\"' . RestoUtil::updateUrlFormat($this->description['properties']['links']['previous'], 'atom') . '\">' . $this->context->dictionary->translate('_previousPage') . '</a> ' : '';\r\n $next = isset($this->description['properties']['links']['next']) ? ' <a href=\"' . RestoUtil::updateUrlFormat($this->description['properties']['links']['next'], 'atom') . '\">' . $this->context->dictionary->translate('_nextPage') . '</a>' : '';\r\n $subtitle .= isset($this->description['properties']['startIndex']) ? ' | ' . $previous . $this->context->dictionary->translate('_pagination', $this->description['properties']['startIndex'], $this->description['properties']['startIndex'] + 1) . $next : '';\r\n return $subtitle;\r\n }",
"private function addSubtitlesAndNotes($startLineIndex, $endLineIndex)\n {\n $prevStartTime = '';\n $framesCount = 1;\n $index = $startLineIndex;\n while ($index < $endLineIndex) {\n $line = trim($this->lines[$index]);\n \n $speaker = $line;\n $index = $this->getSpeakerFullText($speaker, $index, $endLineIndex);\n \n // Set time\n //-----------------------------------------------\n $curStartTime = $this->getFormattedTime($this->lines[$index]);\n $curEndTime = $this->addFrame($curStartTime);\n \n $subtitlesCount = count($this->subtitles);\n \n if ($subtitlesCount > 0) {\n if ($curStartTime == '00:00:00:00')\n $curStartTime = $prevStartTime;\n \n $framesCount = ($prevStartTime == $curStartTime) ? ($framesCount + 1) : 1;\n $curEndTime = $this->addFrame($curStartTime, $framesCount); \n if ($prevStartTime != $curStartTime)\n $this->setSubtitleEndTime($subtitlesCount - 1, $curStartTime);\n }\n \n $prevStartTime = $curStartTime;\n \n $times = [\n 'begin' => $curStartTime,\n 'end' => $curEndTime\n ];\n //-----------------------------------------------\n \n if (strpos($curStartTime, '11:26') > -1) {\n $a = 5;\n }\n \n $index++;\n $subtitleText = trim($this->lines[$index]); \n $index = $this->getSubtitleFullText($subtitleText, $index, $endLineIndex);\n \n $note = '';\n \n $subtitleText = $speaker . \"\\n\" . $subtitleText;\n $this->addSubtitle($subtitleText, $times);\n\n $subtitlesCount = count($this->subtitles);\n\n if (!empty($note))\n $this->addSubtitleNote($note, $subtitlesCount - 1);\n\n if ($subtitlesCount > 1) {\n $this->setSubtitleEndTime($subtitlesCount - 2, $curStartTime);\n }\n }\n }",
"function redblue_services_add_subtitles() {\n add_post_type_support( 'services', 'wps_subtitle' );\n}",
"protected function createEmbed( $info ) {\n\t\t$embed = [\n\t\t\t'title' => $info['title'],\n\t\t\t// TODO: Check into listening to event *after* db processing to get post id\n\t\t\t// 'url' => site_url( 'sim/viewpost/'. $postID ),\n\t\t\t'url' => site_url( 'sim/listposts/mission/' . $info['mission_id'] ),\n\t\t\t'color' => $this->settings['sidebar_color'],\n\t\t\t'fields' => [\n\t\t\t\t[\n\t\t\t\t\t'name' => 'Authors',\n\t\t\t\t\t'value' => join( $info['chars'], ', ' ),\n\t\t\t\t],\n\t\t\t\t// [\n\t\t\t\t// \t'name' => 'Mission',\n\t\t\t\t// \t'value' => $info['mission'],\n\t\t\t\t// ],\n\t\t\t],\n\t\t];\n\n\t\tif ( $this->settings['snippet_length'] > 0 ) {\n\t\t\t$embed[ 'description' ] = substr(\n\t\t\t\t\t$info['content'], 0,\n\t\t\t\t\t$this->settings['snippet_length']\n\t\t\t\t) .\n\t\t\t\t$this->settings['ellipses'];\n\t\t}\n\n\t\tif ( $this->settings[ 'footer_text' ] ) {\n\t\t\t$embed[ 'footer' ] = [\n\t\t\t\t'text' => $this->settings[ 'footer_text' ],\n\t\t\t\t'icon_url' => $this->settings[ 'footer_icon' ]\n\t\t\t];\n\t\t}\n\n\t\treturn $embed;\n\t}",
"public function setSubtitle($subtitle)\n {\n $this->subtitle = $subtitle;\n }",
"function insert_editorial_metadata_term( $args ) {\n\n\t\t\n\t\t// Term is always added to the end of the list\n\t\t$default_position = count( $this->get_editorial_metadata_terms() ) + 2;\n\t\t$defaults = array(\n\t\t\t'position' => $default_position,\n\t\t\t'name' => '',\n\t\t\t'slug' => '',\n\t\t\t'description' => '',\n\t\t\t'type' => '',\n\t\t\t'viewable' => false,\n\t\t);\n\t\t$args = array_merge( $defaults, $args );\n\t\t$term_name = $args['name'];\n\t\tunset( $args['name'] );\n\t\t\n\t\t// We're encoding metadata that isn't supported by default in the term's description field\n\t\t$args_to_encode = array(\n\t\t\t'description' => $args['description'],\n\t\t\t'position' => $args['position'],\n\t\t\t'type' => $args['type'],\n\t\t\t'viewable' => $args['viewable'],\n\t\t);\t\n\t\t$encoded_description = $this->get_encoded_description( $args_to_encode );\n\t\t$args['description'] = $encoded_description;\n\n\t\t$inserted_term = wp_insert_term( $term_name, self::metadata_taxonomy, $args );\n\n\t\t// Reset the internal object cache\n\t\t$this->editorial_metadata_terms_cache = array();\n\n\t\treturn $inserted_term;\n\t}",
"function wp_experts_add_subtitle_field(){\r\n global $post, $cms_meta;\r\n \r\n /* get current_screen. */\r\n $screen = get_current_screen();\r\n \r\n /* show field in post. */\r\n if(in_array($screen->id, array('post'))){\r\n \r\n /* get value. */\r\n $value = get_post_meta($post->ID, 'post_subtitle', true);\r\n \r\n /* html. */\r\n echo '<div class=\"subtitle\"><input type=\"text\" name=\"post_subtitle\" value=\"'.esc_attr($value).'\" id=\"subtitle\" placeholder = \"'.esc_html__('Subtitle', \"wp-experts\").'\" style=\"width: 100%;margin-top: 4px;\"></div>';\r\n }\r\n}",
"function media_change_title_callback() {\r\n $id = $_POST['id'];\r\n $new_title = $_POST['new_title'];\r\n global $wpdb,$bp,$kaltura_validation_data; // this is how you get access to the database\r\n $bp->media->table_media_data = $wpdb->base_prefix . 'bp_media_data';\r\n $e_id = $wpdb->get_var($wpdb->prepare(\"SELECT entry_id from {$bp->media->table_media_data} WHERE id = {$id} \"));\r\n\r\n try {\r\n $k = new KalturaMediaEntry();\r\n $k->name=$new_title;\r\n $kaltura_validation_data['client']->media->update($e_id,$k);\r\n echo $new_title;\r\n }\r\n catch(Exception $e) {\r\n echo e. \"Error in updating title :: Kaltura Error\";\r\n }\r\n die();\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ PRIVATE mkWeekUrl() > creates the week and navigation link structure | function mkWeekUrl($week, $year)
{
if (strpos($this->url,"?"))
$glue = "&";
else
$glue = "?";
if (strpos($this->urlNav,"?"))
$glueNav="&";
else
$glueNav="?";
$weekNavLink = "<a href=\"".$this->url.$glue.$this->weekID."=".$week."&".$this->yearID."=".$year."\">".$week."</a>";
return $weekNavLink;
} | [
"function mkUrl($year,$month=false,$day=false){\r\n\tif (strpos($this->url,\"?\")) $glue=\"&\";\r\n\telse $glue=\"?\";\r\n\tif (strpos($this->urlNav,\"?\")) $glueNav=\"&\";\r\n\telse $glueNav=\"?\";\r\nif ($this->onclick) {\n //$yearNavLink=\"<a href=\".$this->urlNav.\">\";\n //$monthNavLink=\"<a href=\".$this->urlNav.\">\";\n $dayLink=\"<a href=\\\"#\\\" onclick=\\\"\".$this->onclick .$year.\",\".$month.\",\".$day.\"');\\\">\".$day.\"</a>\";\n}\nelse {\n $dayLink=\"<a href=\\\"\".$this->url.$glue.$this->yearID.\"=\".$year.\"&\".$this->monthID.\"=\".$month.\"&\".$this->dayID.\"=\".$day.\"\\\">\".$day.\"</a>\";\n}\n $yearNavLink=\"<a href=\\\"\".$this->urlNav.$glueNav.$this->yearID.\"=\".$year.\"\\\">\";\r\n $monthNavLink=\"<a href=\\\"\".$this->urlNav.$glueNav.$this->yearID.\"=\".$year.\"&\".$this->monthID.\"=\".$month.\"\\\">\";\r\n \n //if ($this->onclick) {\n // $dayLink .= \" onclick=\\\"\".$this->onclick.\" \";\n //}\n \n \r//}\n\tif ($year && $month && $day) return $dayLink;\r\n\tif ($year && !$month && !$day) return $yearNavLink;\r\n\tif ($year && $month && !$day) return $monthNavLink;\r\n}",
"function mkUrl($year,$month=false,$day=false)\n{\n\tif (strpos($this->url,\"?\"))\n\t\t$glue = \"&\";\n\telse\n\t\t$glue = \"?\";\n\tif (strpos($this->urlNav,\"?\"))\n\t\t$glueNav=\"&\";\n\telse\n\t\t$glueNav=\"?\";\n\t\t\n\t$yearNavLink=\"<a href=\\\"\".$this->urlNav.$glueNav.$this->yearID.\"=\".$year.\"\\\">\";\n\t$monthNavLink=\"<a href=\\\"\".$this->urlNav.$glueNav.$this->yearID.\"=\".$year.\"&\".$this->monthID.\"=\".$month.\"\\\">\";\n\t$dayLink=\"<a href=\\\"\".$this->url.$glue.$this->yearID.\"=\".$year.\"&\".$this->monthID.\"=\".$month.\"&\".$this->dayID.\"=\".$day.\"\\\">\".$day.\"</a>\";\n\tif ($year && $month && $day) return $dayLink;\n\tif ($year && !$month && !$day) return $yearNavLink;\n\tif ($year && $month && !$day) return $monthNavLink;\n}",
"function create_week($week_of_month, $month, $year, $days_events)\n{\n\t$start_day = 1 + ($week_of_month - 1) * 7\n\t\t- day_of_week($month, 1, $year);\n\t$week_of_year = week_of_year($month, $start_day, $year);\n\n\t$args = array('week' => $week_of_year, 'year' => year_of_week_of_year($month, $start_day, $year));\n $click = create_action_url('display_week', false, false, false, $args);\n\t$week_html = tag('tr', tag('th', attrs('class=\"ui-state-default\"',\n\t\t\t\t\t\"onclick=\\\"window.location.href='$click'\\\"\"),\n\t\t\t\tcreate_action_link($week_of_year,\n\t\t\t\t\t'display_week', $args)));\n\t\t\n\tfor($day_of_week = 0; $day_of_week < 7; $day_of_week++) {\n\t\t$day = $start_day + $day_of_week;\n\t\t$week_html->add(create_day($month, $day, $year, $days_events));\n\t}\n\n\treturn $week_html;\n}",
"protected function getWeekUrls()\n {\n $scraper = $this->makeScraper('CommitteeMeetingWeekList');\n\n // We already have a crawler storing the content\n // to scrape, so we inject it to avoid uselessly\n // downloading this content one more time.\n $scraper->setOptions(['crawler' => $this->crawler]);\n\n $data = $scraper->scrape();\n\n // The scraper gives us a bunch of data about each week. We extract\n // the URLs because that’s the only info we’re interested in.\n $weekUrls = array_pluck($data, 'url');\n\n return $this->sort($weekUrls);\n }",
"public function default_week(){\n\t\tredirect ('Picks_wk17/week17');\n\t}",
"abstract protected function formatWeeks($n);",
"function get_week_from_url($p) {\n\t$pos = strpos($p,'/',0);\n\t$week = substr($p,$pos+1);\n\treturn $week;\n}",
"function displayWeekLink($begindate, $enddate) {\n\t$query = \"select * from nassets where ndate between '$begindate' and '$enddate'\";\n\t$results = mysql_query($query);\n\t$numresults = mysql_num_rows($results);\n\n\techo \"<li>\";\n\t#if I have any news stories between these two dates, then display a link, otherwise, just don't bother.\n\tif ($numresults > 0) {\n\t\techo \"<a href=\\\"menu2.php?begindate=$begindate&enddate=$enddate\\\" target=\\\"menu2\\\">\";\n\t}\n\n\techo \"$begindate to $enddate\";\n\tif ($numresults > 0) {\n\t\techo \"</a>\";\n\t}\n\n\techo \"</li>\\n\";\n}",
"public function addWeekArchiveItems(){\n // Add $wp_rewrite->front to the trail.\n $this->addFrontItems();\n\n // Get the year and week.\n $year = sprintf($this->getLabel('archive_year'), get_the_time(_x('Y', 'yearly archives date format', 'breadcrumb-trail')));\n $week = sprintf($this->getLabel('archive_week'), get_the_time( _x( 'W', 'weekly archives date format', 'breadcrumb-trail' ) ) );\n\n // Add the year item.\n $this->addItem(new WabootBreadcrumbItem($year,get_year_link(get_the_time('Y'))));\n\n // Add the week item.\n if (is_paged()){\n $newItemUrl = add_query_arg(['m' => get_the_time('Y'), 'w' => get_the_time('W')], home_url());\n $this->addItem(new WabootBreadcrumbItem($week,$newItemUrl));\n } elseif($this->canShowTitles()){\n $this->addItem(new WabootBreadcrumbItem($week));\n }\n }",
"function mkWeekDays(){\n\tif ($this->startOnSun){\n\t\t$out=\"<tr>\";\n\t\tif ($this->weekNum) $out.=\"<td class=\\\"\".$this->cssWeekNumTitle.\"\\\">\".$this->weekNumTitle.\"</td>\";\n\t\tfor ($x=0;$x<=6;$x++) $out.=\"<td class=\\\"\".$this->cssWeekDay.\"\\\">\".$this->getDayName($x).\"</td>\";\n\t\t$out.=\"</tr>\\n\";\n\t}\n\telse{\n\t\t$out=\"<tr>\";\n\t\tif ($this->weekNum) $out.=\"<td class=\\\"\".$this->cssWeekNumTitle.\"\\\">\".$this->weekNumTitle.\"</td>\";\n\t\tfor ($x=1;$x<=6;$x++) $out.=\"<td class=\\\"\".$this->cssWeekDay.\"\\\">\".$this->getDayName($x).\"</td>\";\n\t\t$out.=\"<td class=\\\"\".$this->cssWeekDay.\"\\\">\".$this->getDayName(0).\"</td>\";\n\t\t$out.=\"</tr>\\n\";\n\t\t$this->firstday=$this->firstday-1;\n\t\tif ($this->firstday<0) $this->firstday=6;\n\t}\nreturn $out;\n}",
"function enableWeekLinks($link=false,$javaScript=false)\n\t{\n\t\tif ($link) {\n\t\t\t$this->url=$link;\n\t\t} else {\n\t\t\t$this->url=$_SERVER['PHP_SELF'];\n\t\t}\n\t\tif ($javaScript) {\n\t\t\t$this-> $this->javaScriptDay=$javaScript;\n\t\t}\n\t\t$this->weekLinks=true;\n\t}",
"function build_pathway()\n{\n global $lang;\n global $pathway_info;\n global $title_str,$pathway_str;\n $path_c = count($pathway_info);\n $pathway_info[$path_c-1]['link'] = '';\n $pathway_str = '';\n\t$pathway_str .= '<a href=\"./\">Main</a>';\n if(is_array($pathway_info))\n\t{\n foreach($pathway_info as $newpath)\n\t\t{\n if(isset($newpath['title']))\n\t\t\t{\n if(empty($newpath['link']))\n\t\t\t\t{\n\t\t\t\t\t$pathway_str .= ' » '.$newpath['title'].'';\n\t\t\t\t}\n else\n\t\t\t\t{\n\t\t\t\t\t$pathway_str .= ' » <a href=\"'.$newpath['link'].'\">'.$newpath['title'].'</a>';\n\t\t\t\t}\n $title_str .= ' » '.$newpath['title'];\n }\n }\n }\n $pathway_str .= '';\n}",
"function get_weekly_URL($zipCode_Or_CityName){\n $firstCharacter= $zipCode_Or_CityName[0];\n /**\n * if $zipCode_Or_CityName[0] is digit then return zip code url else return city name url\n */\n if($firstCharacter==\"0\" || $firstCharacter==\"1\" || $firstCharacter==\"2\"\n || $firstCharacter==\"3\"|| $firstCharacter==\"4\"|| $firstCharacter==\"5\"\n || $firstCharacter==\"6\"|| $firstCharacter==\"7\"|| $firstCharacter==\"8\"\n || $firstCharacter==\"9\")\n {\n $URL = \"https://api.openweathermap.org/data/2.5/forecast?zip=\";\n $ZIP = rawurlencode(\"$zipCode_Or_CityName\");\n $openMapWatherApiKey = \"49d81087680614c83a1c4ee91a328384\";\n $URL_LINK = \"{$URL}\".\"{$ZIP}\".\"&APPID={$openMapWatherApiKey}\";\n //getSixHourTemperature(\"{$URL_LINK}\");\n return $URL_LINK;\n }\n else\n {\n $URL = \"http://api.openweathermap.org/data/2.5/forecast?q=\";\n $address = rawurlencode(\"$zipCode_Or_CityName\");\n $openMapWatherApiKey = \"49d81087680614c83a1c4ee91a328384\";\n $URL_LINK = \"{$URL}\".\"{$address}\".\"&APPID={$openMapWatherApiKey}\";\n //getSixHourTemperature(\"{$URL_LINK}\");\n return $URL_LINK;\n }\n}",
"function get_course_week_from_url($p) {\n\t$course_start_pos = strpos($p,'/',0);\n\t$course_end_pos = strpos($p,'/week',0);\n\t$course_code_length = $course_end_pos - $course_start_pos - 1;\n\t$week_start_pos = $course_end_pos + 5;\n\t$course_code = substr($p,$course_start_pos+1,$course_code_length);\n\t$week = substr($p,$week_start_pos+1);\n\t$course = course_load_from_code($course_code);\n\t$cid = isset($course['Course_ID']) ? $course['Course_ID']: 0;\n\t$course_week = array(\n\t\t\t\t\t'cid' => $cid,\n\t\t\t\t\t'week' => $week\n\t\t\t\t\t);\n\treturn (isset($course)) ? $course_week: null;\n}",
"function getWeekHTML($wo, $m, $y){\n\t\t// Show sunday - saturday \n\t\t// $wo = week offset, +1 next week, -1 = last week\n\t\t// $day for 1 day view\n\n\t\t$NumDays = 7;\n\n\t\t$cws = null; // currentweekstart\n\t\t$dws = null; // displayweekstart\n\t\t\n\t\tif($this->startDay == 0){\n\t\t\tif(date(\"w\")==0){\n\t\t\t\t// today is Sunday $cws = today\n\t\t\t\t$cws = strtotime(\"now\");\n\t\t\t} else {\n\t\t\t\t$cws = strtotime(\"last Sunday\");\n\t\t\t}\n\t\t} else {\n\t\t\t// get current week's Sunday ($cws = currentweekstart)\n\t\t\tif(date(\"w\")==1){\n\t\t\t\t// today is Sunday $cws = today\n\t\t\t\t$cws = strtotime(\"now\");\n\t\t\t} else {\n\t\t\t\t$cws = strtotime(\"last Monday\");\n\t\t\t}\n\t\t}\n\n\t\tif($wo == 0){\n\t\t\t$dws = $cws;\n\t\t} else {\n\t\t\t$dws = strtotime(strval($wo).\" week\", $cws); \n\t\t}\t\t\n\t\t\n\t\t$bookings = $this->getBookings($this->resAdmin, '', '', date(\"Y-m-d\", $dws), $NumDays, \"week\");\n\n\t\t$bookoffs = null;\n\t\tif($this->fd_show_bookoffs){\n\t\t\t$bookoffs = $this->getBookoffs($this->resAdmin, date(\"m\", $dws), date(\"y\", $dws), date(\"Y-m-d\", $dws), $NumDays, \"week\");\n\t\t\t//print_r($bookoffs);\n\t\t}\n\t\t$statuses = $this->getStatuses();\n\t\t\n\t\t$header = JText::_('RS1_FRONTDESK_SCRN_VIEW_WEEK');\n\t\t$prevWeek = $this->getWeekviewLinkOnClick($wo-1);\n\t\t$nextWeek = $this->getWeekviewLinkOnClick($wo+1);\n\t\t$lang = JFactory::getLanguage();\n\t\tsetlocale(LC_TIME, str_replace(\"-\", \"_\", $lang->getTag()).\".utf8\");\n\t\t// on a Windows server you need to spell it out\n\t\t// offical names can be found here..\n\t\t// http://msdn.microsoft.com/en-ca/library/39cwe7zf(v=vs.80).aspx\n\t\t//setlocale(LC_TIME,\"swedish\");\n\t\t// Using the first two letteres seems to work in many cases.\n\t\tif(WINDOWS){\t\n\t\t\tsetlocale(LC_TIME, substr($lang->getTag(),0,2)); \n\t\t}\n\t\t//setlocale(LC_TIME,\"french\");\n\t\t// for Greek you may need to hard code..\n\t\t//setlocale(LC_TIME, array('el_GR.UTF-8','el_GR','greek'));\n\t\t\n\t\t$s = \"\";\n\t\t$i2=1;\n\t\t$colspan = 8;\n\t\tif($this->mobile){\n\t\t\t$colspan = 5;\n\t\t}\n\t\t$array_daynames = getLongDayNamesArray($this->startDay);\n\t\t$s .= \"<div id=\\\"sv_apptpro_front_desk_top\\\">\\n\";\n\t\t$s .= \"<table width=\\\"100%\\\" align=\\\"center\\\" border=\\\"0\\\" class=\\\"calendar_week_view\\\" cellspacing=\\\"0\\\" >\\n\";\n\t\t$s .= \"<tr class=\\\"calendar_week_view_header_row\\\">\\n\";\n\t\t$s .= \"<td width=\\\"5%\\\" align=\\\"left\\\" ><input type=\\\"button\\\" onclick=\\\"$prevWeek\\\" value=\\\"<<\\\"></td>\\n\";\n\t\t$s .= \"<td style=\\\"text-align:center\\\" colspan=\\\"\".($colspan-2).\"\\\" class=\\\"calendarHeader\\\" >$header</td>\\n\"; \n\t\t$s .= \"<td width=\\\"5%\\\" align=\\\"right\\\" ><input type=\\\"button\\\" onclick=\\\"$nextWeek\\\" value=\\\">>\\\"></td>\\n\";\n\t\t$s .= \"</tr>\\n\";\n\t\tfor($i=0; $i<$NumDays; $i++){\n\t\t\t// week day\n\t\t\t$link = \"# onclick='goDayView(\\\"\".date(\"Y-m-d\", strtotime(strval($i).\" day\", $dws)).\"\\\");return false;'\";\t\t\t\t\t\t\n\t\t\t$s .= \"<tr>\\n\";\n\t\t\t$s .= \" <td colspan=\\\"\".$colspan.\"\\\">\\n\";\n\t\t\t$s .= \" <table class=\\\"week_day_table\\\" width=\\\"100%\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" >\\n\";\n\t\t\t$s .= \" <tr >\\n\";\n\n\t\t\tif(WINDOWS){\n\t\t\t\t$s .= \" <td colspan=\\\"\".$colspan.\"\\\"> <a href=\".$link.\">\".$array_daynames[$i].\" \".iconv(getIconvCharset(), 'UTF-8//IGNORE',strftime($this->week_view_header_date_format, strtotime(strval($i).\" day\", $dws))).\"</a></td>\\n\";\n\t\t\t} else {\n\t\t\t\t$s .= \" <td colspan=\\\"\".$colspan.\"\\\"> <a href=\".$link.\">\".$array_daynames[$i].\" \".strftime($this->week_view_header_date_format, strtotime(strval($i).\" day\", $dws)).\"</a></td>\\n\";\n\t\t\t}\n\t\t\t$s .= \" </tr>\\n\";\t\t\n\t\t\t$day_to_check = date(\"Y-m-d\", strtotime(strval($i).\" day\", $dws));\n\t\t\t$k = 0;\n\t\t\tforeach($bookings as $booking){\n\t\t\t\tif($booking->startdate == $day_to_check){\n\t\t\t\t\tif($this->fd_read_only){\n\t\t\t\t\t\tif($this->fd_detail_popup){\n\t\t\t\t\t\t\t$link = JRoute::_( 'index.php?option=com_rsappt_pro3&controller=admin_detail&task=edit&cid='. $booking->id_requests.'&frompage=front_desk&Itemid='.$this->Itemid). \"&format=readonly class=\\\"modal\\\" rel=\\\"{handler: 'iframe', size: {x: 800, y: 600}, onClose: function() {}}\\\" \";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$link = \"'#' onclick=\\\"alert('\".JText::_('RS1_DETAIL_VIEW_DISABLED').\"');return true;\\\" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$link \t= JRoute::_( 'index.php?option=com_rsappt_pro3&controller=admin_detail&task=edit&cid='. $booking->id_requests.'&frompage=front_desk&Itemid='.$this->Itemid);\n\t\t\t\t\t}\n\n\t\t\t\t\t$s .= \"<tr class='week_row'>\\n\";\n\t\t\t\t\t$s .= \" <td width=\\\"5%\\\" align=\\\"center\\\"><input type=\\\"checkbox\\\" id=\\\"cb\".$i2.\"\\\" name=\\\"cid[]\\\" value=\\\"\".$booking->id_requests.\"\\\" /></td>\\n\";\n\t\t\t\t\t$s .= \" <td width=\\\"10%\\\" align=\\\"left\\\">\".$booking->display_starttime.\"</td>\\n\";\n\t\t\t\t\t$s .= \" <td width=\\\"15%\\\" align=\\\"left\\\"> \".JText::_(stripslashes($booking->resname)).\"</td>\\n\";\n\t\t\t\t\tif(!$this->mobile){\n\t\t\t\t\t\t$s .= \" <td width=\\\"15%\\\" align=\\\"left\\\"> \".JText::_(stripslashes($booking->ServiceName)).\"</td>\";\n\t\t\t\t\t}\n\t\t\t\t\tif($this->fd_allow_show_seats){\n\t\t\t\t\t\tif(!$this->mobile){\n\t\t\t\t\t\t\t$s .= \" <td width=\\\"5%\\\" align=\\\"left\\\"> \".$booking->booked_seats.\"</td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$s .= \" <td width=\\\"15%\\\" align=\\\"left\\\"> <a href=\".$link.\">\".stripslashes($booking->name).\"</a></td>\";\n\t\t\t\t\tif($this->fd_show_contact_info){\n\t\t\t\t\t\tif(!$this->mobile){\n\t\t\t\t\t\t\t$s .= \" <td width=\\\"30%\\\" align=\\\"left\\\"><a href=\\\"mailto:\".$booking->email.\"\\\">\".$booking->email.\"</a></td>\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n//\t\t\t\t\t\t$s .= \" <td align=\\\"center\\\" width=\\\"10%\\\"><span class='color_\".$booking->payment_status.\"'>\".translated_status($booking->payment_status).\"</span></td>\\n\";\n\t\t\t\t\n\t\t\t\t\tif($this->apptpro_config->status_quick_change == \"No\"){\n\t\t\t\t\t\tif(!$this->mobile){\n\t\t\t\t\t\t\t$s .= \" <td align=\\\"center\\\"><span class='color_\".$booking->request_status.\"'>\".translated_status($booking->request_status).\"</span></td>\\n\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$s .= \" <td width=\\\"10%\\\" align=\\\"center\\\"><span class='color_\".$booking->request_status.\"'>\".substr(translated_status($booking->request_status),0,3).\"</span></td>\\n\";\n\t\t\t\t\t\t}\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$s .= \" <td align=\\\"center\\\">\\n\";\n\t\t\t\t\t\t$s .= \" <select id=\\\"booking_status_\".$booking->id_requests.\"\\\" name=\\\"booking_status\".$booking->id_requests.\"\\\" \"; \n\t\t\t\t\t\t$s .= \"\t\t\tonfocus=\\\"this.oldvalue = this.value;\\\" onchange=\\\"quick_status_change('\".$booking->id_requests.\"',this); return false;\\\"\";\n\t\t\t\t\t\t$s .= \"\t\t\tstyle=\\\"width:auto\\\">\\n\";\n\t\t\t\t\t\tforeach($statuses as $status_row){\n\t\t\t\t\t\t\t$s .= \"\t\t<option value=\\\"\".$status_row->internal_value.\"\\\" class=\\\"color_\".$status_row->internal_value.\"\\\" \";\n\t\t\t\t\t\t\t\tif($booking->request_status == $status_row->internal_value ? $s .=\" selected='selected' \":\"\");\n\t\t\t\t\t\t\t\t$s .= \">\".JText::_($status_row->status).\"</option>\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$s .= \"\t\t</select>\\n\";\n\t\t\t\t\t\t$s .= \"</td>\\n\";\n\t\t\t\t\t}\n\t\t\t\t\tif($this->fd_show_financials){\n\t\t\t\t\t\t$s .= \" <td align=\\\"right\\\">\".translated_status($booking->payment_status).($booking->invoice_number != \"\"?\"<br/>(\".$booking->invoice_number.\")\":\"\").\"</td>\\n\";\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t$s .= \"</tr>\\n\";\n\t\t\t\t\t$i2++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($this->fd_show_bookoffs){\n\t\t\t\tforeach($bookoffs as $bookoff){\n\t\t\t\t\tif($bookoff->off_date == $day_to_check){\n\t\t\t\t\t\tif($bookoff->full_day == \"Yes\"){\n\t\t\t\t\t\t\t$display_timeoff = JText::_('RS1_FRONTDESK_BO_FULLDAY');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$display_timeoff = $bookoff->display_bo_starttime.\" - \".$bookoff->display_bo_endtime;\n\t\t\t\t\t\t\tif($bookoff->description != \"\"){\n\t\t\t\t\t\t\t\t$display_timeoff .= \"\\n\".$bookoff->description;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$s .= \"<tr><td colspan=8><label class='calendar_text_bookoff' title='\".$display_timeoff.\"'>\".$bookoff->name.\" - \".$display_timeoff.\"</label></td></tr>\";\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t $s .= \" </table>\\n\";\n\t\t $s .= \" </td>\\n\";\n\t\t $s .= \" </tr>\\n\";\n\t\t}\n\t\t$s .= \"</table>\\n\";\n\t\t$s .= \"</div>\\n\";\n\t\t$s .= \"<input type=\\\"hidden\\\" name=\\\"cur_week_offset\\\" id=\\\"cur_week_offset\\\" value=\\\"\".$wo.\"\\\">\";\n\n\t\tif($this->printerView == \"Yes\"){\n\t\t\t// remove all links\n\t\t\t$s = preg_replace(array('\"<a href(.*?)>\"', '\"</a>\"'), array('',''), $s);\n\t\t}\n\n\t\treturn $s; \t\n\t}",
"function listWeekEvents()\n {\n SessionUtil :: setVar('crpCalendar_choosed_view', 'week_view');\n SessionUtil :: setVar('crpCalendar_return_url', pnModURL('crpCalendar', 'user', 'week_view'));\n\n $navigationValues = $this->collectNavigationFromInput();\n SessionUtil :: delVar('crpCalendar_export_events');\n\n $date = $this->timeToDMY($navigationValues['t']);\n\n $days = array (\n DateUtil :: getDatetime($navigationValues['t'])\n );\n $weekDay = DateUtil :: getDatetime($navigationValues['t']);\n\n $navigationValues['startDate'] = DateUtil :: getDatetime($this->backToFirstDOW(DateUtil :: parseUIDateTime($weekDay)));\n $navigationValues['endDate'] = DateUtil :: getDatetime($this->forwardToLastDOW(DateUtil :: parseUIDateTime($weekDay)));\n $navigationValues['sortOrder'] = 'ASC';\n // reset page limit for weeklist\n $navigationValues['modvars']['itemsperpage'] = '-1';\n\n // Get all matching events\n $items = pnModAPIFunc('crpCalendar', 'user', 'getall', $navigationValues);\n\n if (!$items)\n $items = array ();\n\n $exports = array ();\n foreach ($items as $key => $item)\n {\n $exports[] = $item['eventid'];\n }\n\n SessionUtil :: setVar('crpCalendar_export_events', $exports);\n SessionUtil :: setVar('crpCalendar_choosed_time', $navigationValues['t']);\n\n // expand days array\n $this->expandFirstDOW(DateUtil :: parseUIDateTime($weekDay), $days);\n $this->expandLastDOW(DateUtil :: parseUIDateTime($weekDay), $days);\n\n $daysexpanded = $days;\n\n $monthDays = DateUtil :: getMonthDates($date['m'], $date['y']);\n\n // for style purpose\n foreach ($days as $kday => $day)\n {\n if (!in_array($day, $monthDays))\n unset ($days[$kday]);\n }\n\n $today = DateUtil :: getDatetime(time());\n\n return $this->ui->userWeekList($items, $days, $daysexpanded, $navigationValues['t'], $date, $navigationValues['startDate'], $navigationValues['endDate'], $today, $navigationValues['category'], $navigationValues['mainCat'], $navigationValues['modvars']);\n }",
"function calendar_week_header($view) {\r\n $len = isset($view->date_info->style_name_size) ? $view->date_info->style_name_size : (!empty($view->date_info->mini) ? 1 : 3);\r\n $with_week = !empty($view->date_info->style_with_weekno);\r\n \r\n // create week header\r\n $untranslated_days = calendar_untranslated_days();\r\n if ($len == 99) {\r\n $translated_days = date_week_days_ordered(date_week_days(TRUE));\r\n }\r\n else {\r\n $translated_days = date_week_days_ordered(date_week_days_abbr(TRUE));\r\n }\r\n if ($with_week) {\r\n $row[] = array('header' => TRUE, 'class' => \"days week\", 'data' => ' ');\r\n }\r\n foreach ($untranslated_days as $delta => $day) {\r\n $label = $len < 3 ? drupal_substr($translated_days[$delta], 0 , $len) : $translated_days[$delta];\r\n $row[] = array('header' => TRUE, 'class' => \"days \". $day, 'data' => $label);\r\n }\r\n return $row;\r\n}",
"function getDateLink($day, $month, $year){\n\tif ($this->week_has_stories){\n\t\treturn $this->calendar_base_link_web_path.\"day=\".$day.\"&month=\".$month.\"&year=\".$year;\n \t}else{\n\t\treturn null;\n\t}\n }",
"function week($year, $week)\n{\n//echo week(2008,27);\n//Returns: Week 27 in 2008 is from 2008-06-30 to 2008-07-06.\n $from = date(\"Y-m-d\", strtotime(\"{$year}-W{$week}-1\")); //Returns the date of monday in week\n $to = date(\"Y-m-d\", strtotime(\"{$year}-W{$week}-7\")); //Returns the date of sunday in week\n return \"Week {$week} in {$year} is from {$from} to {$to}.\";\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the status of the season | function setSeasonStatus($status)
{
$this->__status = $status ;
} | [
"function setSeasonId($id)\n {\n $this->__seasonid = $id ;\n }",
"function setSeasonStart($seasonStart)\n {\n $this->__seasonStart = $seasonStart ;\n }",
"public function setStartingSeason($year){\n\t if($year <> \"Select season...\"){\n\t $this->startYear = $year; \n\t } else{\n\t\t$this->startYear = date(\"Y\") - 1;\n\t\t}\t \n\t $this->endYear = $this->startYear + 1;\n\t $this->label = \"$this->startYear/\" . \"$this->endYear\";\n\t $this->populateLeague();\n\n\t}",
"function setSeasonLabel($seasonLabel)\n {\n $this->__seasonLabel = $seasonLabel ;\n }",
"public function setStatus($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Ads\\GoogleAds\\V13\\Enums\\SeasonalityEventStatusEnum\\SeasonalityEventStatus::class);\n $this->status = $var;\n\n return $this;\n }",
"public function setSeason($season) {\n $this->season = $season;\n }",
"public function setSeason($season) {\n $this->season = (object) array(\"value\" => $season);\n return $this;\n }",
"protected function set_current_season() {\n $curl = curl_init();\n $resource = $this->get_team().\"/stats\";\n $this->get_curl($curl, $resource);\n $result = curl_exec($curl);\n \n if ($e = curl_error($curl)) {\n echo $e;\n } else {\n $obj = json_decode($result, true);\n return $obj;\n }\n curl_close($curl);\n }",
"function _setSeasonData($season) {\n if ($season) {\n $result[] = JArrayHelper::fromObject($season);\n $result[0]['object'] = 'Season';\n return $result;\n }\n return false;\n }",
"public function _setStatus($status)\n {\n $this->status = $status;\n }",
"public function setSeasonNumber($sNum)\n {\n $this->seasonNumber = $sNum;\n }",
"public function setStatus(Status $status);",
"public function setStatus() {\n if ($this->dt_num_races === null)\n $this->setData();\n else {\n $this->dt_status = $this->calcStatus();\n DB::set($this);\n }\n }",
"public function getSeason()\r\n {\r\n return $this->season;\r\n }",
"public function setCalendarStatus ($v)\n {\n\n // Since the native PHP type for this column is string,\n // we will cast the input to a string (if it is not).\n if ( $v !== null && !is_string ($v) )\n {\n $v = (string) $v;\n }\n\n if ( $this->calendar_status !== $v || $v === 'ACTIVE' )\n {\n $this->calendar_status = $v;\n }\n }",
"public function _setStatus($status) {\n\t\t$this->_status = $status;\n\t}",
"public function setStatus($status)\r\n {\r\n if (!isset($status)) {\r\n DUP_Log::Error(\"Package SetStatus did not receive a proper code.\");\r\n }\r\n $this->Status = $status;\r\n $this->update();\r\n }",
"function setSeasonEnd($seasonEnd)\n {\n $this->__seasonEnd = $seasonEnd ;\n }",
"public function setStatusAttribute($value)\n {\n $this->attributes['status'] = Project::STATUS[$value];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve checkout state model | protected function _getState()
{
return $this->_objectManager->get(\Magento\Multishipping\Model\Checkout\Type\Multishipping\State::class);
} | [
"protected function _getCheckout()\n {\n return Mage::getSingleton('ketai/type_checkout');\n }",
"public function getState()\n\t{\n\t\treturn $this->model->searchState($this->result, $this->data['state'] ?? null);\n\t}",
"public function getState() {\n return $this->findParentRow('My_Model_Table_State');\n }",
"public function getPaymentState () {\n\t$data = $this->paymentState;\n\t return $data;\n}",
"public function findPayingOutState() : LineWorkflowState {\n return $this->genericRepository->findOneByMachineName(LineWorkflowState::STATE_PAYINGOUT);\n }",
"public function getstate() {\n /**\n * Returning the resource Model for 'state'\n */\n return Mage::getResourceModel ( 'eav/entity_attribute' )->getIdByCode ( 'catalog_product', 'state' );\n }",
"public function getState();",
"public function getFromState();",
"public function getCheckout()\n {\n return Mage::getSingleton('checkout/type_multishipping');\n }",
"public function state()\n {\n return $this->hasOne('App\\State', 'state_id','fk_state');\n }",
"public function getState() {\n return State::where('abbrev', $this->state)->firstOrFail();\n }",
"public function getState()\n {\n return $this->data['ik_payment_state'];\n }",
"public function state()\n\t{\n\t\treturn $this->hasOne('\\App\\Models\\State', 'id', 'state_id');\n\t}",
"protected function _getCheckout()\n {\n return Mage::getSingleton('checkout/session');\n }",
"public function getRybState() {\n return $this->hasOne(StateMaster::className(), ['ryb_state_id' => 'ryb_state_id']);\n }",
"final public function getTransactionState(){}",
"function _getState()\n {\n \t$app = JFactory::getApplication();\n $model = $this->_getModel( 'orders' );\n $ns = $this->_getNamespace();\n\n $state = array();\n \n $state['filter_userid'] = $app->getUserStateFromRequest($ns.'userid', 'filter_userid');\n $state['filter_id_from'] = $app->getUserStateFromRequest($ns.'filter_id_from','filter_id_from');\n\t\t$state['filter_id_to'] = $app->getUserStateFromRequest($ns.'filter_id_to','filter_id_to');\n\t\t$state['filter_date_from'] = $app->getUserStateFromRequest($ns.'filter_date_from','filter_date_from');\n\t\t$state['filter_date_to'] = $app->getUserStateFromRequest($ns.'filter_date_to','filter_date_to');\n\t\t$state['filter_total_from'] = $app->getUserStateFromRequest($ns.'filter_total_from','filter_total_from');\n\t\t$state['filter_total_to'] = $app->getUserStateFromRequest($ns.'filter_total_to','filter_total_to');\n\t\t$state['filter_datetype']=$app->getUserStateFromRequest($ns.'filter_datetype','filter_datetype');\n\n $state = $this->_handleRangePresets( $state );\n\n foreach (@$state as $key=>$value)\n {\n $model->setState( $key, $value );\n }\n\n return $state;\n\n }",
"public function getState() {\n return (object) $this->state;\n }",
"public function state()\n {\n \treturn $this->hasMany(State::class);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.